Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
PrimaryColsHeaderPanel.prototype.createCheckIcons = function () {
this.eSelect.appendChild(this.eSelectChecked = main_1._.createIconNoSpan('checkboxChecked', this.gridOptionsWrapper));
this.eSelect.appendChild(this.eSelectUnchecked = main_1._.createIconNoSpan('checkboxUnchecked', this.gridOptionsWrapper));
this.eSelect.appendChild(this.eSelectIndeterminate = main_1._.createIconNoSpan('checkboxIndeterminate', this.gridOptionsWrapper));
};
// we only show expand / collapse if we are showing columns
ToolPanelColumnComp.prototype.init = function () {
this.setTemplate(ToolPanelColumnComp.TEMPLATE);
this.eDragHandle = main_1._.createIconNoSpan('columnDrag', this.gridOptionsWrapper);
main_1._.addCssClass(this.eDragHandle, 'ag-column-drag');
this.cbSelect.getGui().insertAdjacentElement('afterend', this.eDragHandle);
this.displayName = this.columnController.getDisplayNameForColumn(this.column, 'toolPanel');
var displayNameSanitised = main_1._.escape(this.displayName);
this.eLabel.innerHTML = displayNameSanitised;
// if grouping, we add an extra level of indent, to cater for expand/contract icons we need to indent for
var indent = this.columnDept;
if (this.groupsExist) {
this.addCssClass('ag-toolpanel-add-group-indent');
}
this.addCssClass("ag-toolpanel-indent-" + indent);
this.setupDragging();
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_VALUE_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_PIVOT_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_ROW_GROUP_CHANGED, this.onColumnStateChanged.bind(this));
ToolPanelColumnComp.prototype.init = function () {
this.setTemplate(ToolPanelColumnComp.TEMPLATE);
this.eDragHandle = main_1._.createIconNoSpan('columnDrag', this.gridOptionsWrapper);
main_1._.addCssClass(this.eDragHandle, 'ag-column-drag');
this.cbSelect.getGui().insertAdjacentElement('afterend', this.eDragHandle);
this.displayName = this.columnController.getDisplayNameForColumn(this.column, 'toolPanel');
var displayNameSanitised = main_1._.escape(this.displayName);
this.eLabel.innerHTML = displayNameSanitised;
// if grouping, we add an extra level of indent, to cater for expand/contract icons we need to indent for
var indent = this.columnDept;
if (this.groupsExist) {
this.addCssClass('ag-toolpanel-add-group-indent');
}
this.addCssClass("ag-toolpanel-indent-" + indent);
this.setupDragging();
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_VALUE_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_PIVOT_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_ROW_GROUP_CHANGED, this.onColumnStateChanged.bind(this));
this.addDestroyableEventListener(this.column, main_1.Column.EVENT_VISIBLE_CHANGED, this.onColumnStateChanged.bind(this));
PivotDropZonePanel.prototype.passBeansUp = function () {
_super.prototype.setBeans.call(this, {
gridOptionsWrapper: this.gridOptionsWrapper,
eventService: this.eventService,
context: this.getContext(),
loggerFactory: this.loggerFactory,
dragAndDropService: this.dragAndDropService
});
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var emptyMessage = localeTextFunc('pivotColumnsEmptyMessage', 'Drag here to set column labels');
var title = localeTextFunc('pivots', 'Column Labels');
_super.prototype.init.call(this, {
dragAndDropIcon: main_1.DragAndDropService.ICON_GROUP,
icon: main_1._.createIconNoSpan('pivotPanel', this.gridOptionsWrapper, null),
emptyMessage: emptyMessage,
title: title
});
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_EVERYTHING_CHANGED, this.refresh.bind(this));
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_PIVOT_CHANGED, this.refresh.bind(this));
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, this.checkVisibility.bind(this));
this.refresh();
};
PivotDropZonePanel.prototype.refresh = function () {
PrimaryColsHeaderPanel.prototype.setExpandState = function (state) {
this.expandState = state;
main_1._.setDisplayed(this.eExpandChecked, this.expandState === SELECTED_STATE.CHECKED);
main_1._.setDisplayed(this.eExpandUnchecked, this.expandState === SELECTED_STATE.UNCHECKED);
main_1._.setDisplayed(this.eExpandIndeterminate, this.expandState === SELECTED_STATE.INDETERMINATE);
};
PrimaryColsHeaderPanel.prototype.setColumnsCheckedState = function () {
function BaseDropZonePanel(horizontal, valueColumn, name) {
var _this = _super.call(this, "<div name="" class="\"ag-column-drop"></div>") || this;
_this.state = BaseDropZonePanel.STATE_NOT_DRAGGING;
_this.guiDestroyFunctions = [];
_this.childColumnComponents = [];
_this.horizontal = horizontal;
_this.valueColumn = valueColumn;
_this.eColumnDropList = main_1._.loadTemplate('<div class="ag-column-drop-list"></div>');
return _this;
}
BaseDropZonePanel.prototype.isHorizontal = function () {
RowGroupDropZonePanel.prototype.passBeansUp = function () {
_super.prototype.setBeans.call(this, {
gridOptionsWrapper: this.gridOptionsWrapper,
eventService: this.eventService,
context: this.getContext(),
loggerFactory: this.loggerFactory,
dragAndDropService: this.dragAndDropService
});
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var emptyMessage = localeTextFunc('rowGroupColumnsEmptyMessage', 'Drag here to set row groups');
var title = localeTextFunc('groups', 'Row Groups');
_super.prototype.init.call(this, {
dragAndDropIcon: main_1.DragAndDropService.ICON_GROUP,
icon: main_1._.createIconNoSpan('rowGroupPanel', this.gridOptionsWrapper, null),
emptyMessage: emptyMessage,
title: title
});
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, this.refreshGui.bind(this));
};
RowGroupDropZonePanel.prototype.isColumnDroppable = function (column) {
ColumnToolPanel.prototype.destroyChildren = function () {
this.childDestroyFuncs.forEach(function (func) { return func(); });
this.childDestroyFuncs.length = 0;
main_1._.clearElement(this.getGui());
};
ColumnToolPanel.prototype.refresh = function () {
ToolPanelColumnGroupComp.prototype.setupDragging = function () {
var _this = this;
if (!this.allowDragging) {
main_1._.setDisplayed(this.eDragHandle, false);
return;
}
var dragSource = {
type: main_1.DragSourceType.ToolPanel,
eElement: this.eDragHandle,
dragItemName: this.displayName,
dragItemCallback: function () { return _this.createDragItem(); }
};
this.dragAndDropService.addDragSource(dragSource, true);
this.addDestroyFunc(function () { return _this.dragAndDropService.removeDragSource(dragSource); });
};
ToolPanelColumnGroupComp.prototype.createDragItem = function () {
ValuesDropZonePanel.prototype.passBeansUp = function () {
_super.prototype.setBeans.call(this, {
gridOptionsWrapper: this.gridOptionsWrapper,
eventService: this.eventService,
context: this.getContext(),
loggerFactory: this.loggerFactory,
dragAndDropService: this.dragAndDropService
});
var localeTextFunc = this.gridOptionsWrapper.getLocaleTextFunc();
var emptyMessage = localeTextFunc('valueColumnsEmptyMessage', 'Drag here to aggregate');
var title = localeTextFunc('values', 'Values');
_super.prototype.init.call(this, {
dragAndDropIcon: main_1.DragAndDropService.ICON_AGGREGATE,
icon: main_1._.createIconNoSpan('valuePanel', this.gridOptionsWrapper, null),
emptyMessage: emptyMessage,
title: title
});
this.addDestroyableEventListener(this.eventService, main_1.Events.EVENT_COLUMN_VALUE_CHANGED, this.refreshGui.bind(this));
};
ValuesDropZonePanel.prototype.getIconName = function () {