Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
reset() {
const lastSelectedColumn = this.hot.getPlugin('filters').getSelectedColumn();
const visualIndex = lastSelectedColumn && lastSelectedColumn.visualIndex;
const columnType = this.hot.getDataType.apply(this.hot, this.hot.getSelectedLast() || [0, visualIndex]);
const items = getOptionsList(columnType);
arrayEach(this.getInputElements(), (element) => element.hide());
this.getSelectElement().setItems(items);
super.reset();
// Select element as default 'None'
this.getSelectElement().setValue(items[0]);
}
checkForOverlappingHeaders() {
arrayEach(this.colspanArray, (level, i) => {
arrayEach(this.colspanArray[i], (header, j) => {
if (header.colspan > 1) {
let row = this.levelToRowCoords(i);
let childHeaders = this.getChildHeaders(row, j);
if (childHeaders.length > 0) {
let childColspanSum = 0;
arrayEach(childHeaders, (col, i) => {
childColspanSum += this.getColspan(row + 1, col);
});
if (childColspanSum > header.colspan) {
console.warn('Your Nested Headers plugin setup contains overlapping headers. This kind of configuration is ' +
'currently not supported and might result in glitches.');
}
value: function checkForOverlappingHeaders() {
var _this5 = this;
arrayEach(this.colspanArray, function (level, i) {
arrayEach(_this5.colspanArray[i], function (header, j) {
if (header.colspan > 1) {
var row = _this5.levelToRowCoords(i);
var childHeaders = _this5.getChildHeaders(row, j);
if (childHeaders.length > 0) {
var childColspanSum = 0;
arrayEach(childHeaders, function (col, i) {
childColspanSum += _this5.getColspan(row + 1, col);
});
if (childColspanSum > header.colspan) {
console.warn('Your Nested Headers plugin setup contains overlapping headers. This kind of configuration is ' + 'currently not supported and might result in glitches.');
}
untrimRows(rows) {
arrayEach(rows, (row) => {
row = parseInt(row, 10);
if (this.isTrimmed(row)) {
this.trimmedRows.splice(this.trimmedRows.indexOf(row), 1);
}
});
this.hot.runHooks('skipLengthCache', 100);
this.rowsMapper.createMap(this.hot.countSourceRows());
this.hot.runHooks('afterUntrimRow', rows);
}
value: function trimRows(rows) {
var _this3 = this;
arrayEach(rows, function (row) {
row = parseInt(row, 10);
if (!_this3.isTrimmed(row)) {
_this3.trimmedRows.push(row);
}
});
this.hot.runHooks('skipLengthCache', 100);
this.rowsMapper.createMap(this.hot.countSourceRows());
this.hot.runHooks('afterTrimRow', rows);
}
function itemsToValue(availableItems) {
let items = [];
arrayEach(availableItems, (item) => {
if (item.checked) {
items.push(item.value);
}
});
return items;
}
value: function getDataMapAtColumn(column) {
var _this4 = this;
var visualIndex = this.t.toVisualColumn(column);
var data = [];
arrayEach(this.hot.getSourceDataAtCol(visualIndex), function (value, rowIndex) {
var _hot$getCellMeta = _this4.hot.getCellMeta(rowIndex, visualIndex),
row = _hot$getCellMeta.row,
col = _hot$getCellMeta.col,
visualCol = _hot$getCellMeta.visualCol,
visualRow = _hot$getCellMeta.visualRow,
type = _hot$getCellMeta.type,
instance = _hot$getCellMeta.instance,
dateFormat = _hot$getCellMeta.dateFormat;
data.push({
meta: { row: row, col: col, visualCol: visualCol, visualRow: visualRow, type: type, instance: instance, dateFormat: dateFormat },
value: toEmptyString(value)
});
});
return data;
arrayEach(components, (component) => {
arrayEach(menu.menuItems, (item, index) => {
if (item.key === component.getMenuItemDescriptor().key) {
indexes.push(index);
}
});
});
registerHooks() {
this.getSelectElement().addLocalHook('select', (command) => this.onConditionSelect(command));
this.getSelectElement().addLocalHook('afterClose', () => this.onSelectUIClosed());
arrayEach(this.getInputElements(), (input) => {
input.addLocalHook('keydown', (event) => this.onInputKeyDown(event));
});
}
value: function onSelectAllClick(event) {
event.preventDefault();
arrayEach(this.itemsBox.getSourceData(), function (row) {
row.checked = true;
});
this.itemsBox.render();
}