Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onBeforeDropdownMenuSetItems(items) {
const menuKeys = arrayMap(items, (item) => item.key);
this.components.forEach((component) => {
component[menuKeys.indexOf(component.getMenuItemDescriptor().key) === -1 ? 'hide' : 'show']();
});
this.initHiddenRowsCache();
}
filter() {
let dataFilter = this._createDataFilter();
let needToFilter = !this.conditionCollection.isEmpty();
let visibleVisualRows = [];
const conditions = this.conditionCollection.exportAllConditions();
const allowFiltering = this.hot.runHooks('beforeFilter', conditions);
if (allowFiltering !== false) {
if (needToFilter) {
let trimmedRows = [];
this.trimRowsPlugin.trimmedRows.length = 0;
visibleVisualRows = arrayMap(dataFilter.filter(), (rowData) => rowData.meta.visualRow);
const visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
rangeEach(this.hot.countSourceRows() - 1, (row) => {
if (!visibleVisualRowsAssertion(row)) {
trimmedRows.push(row);
}
});
this.trimRowsPlugin.trimRows(trimmedRows);
if (!visibleVisualRows.length) {
this.hot.deselectCell();
}
} else {
this.trimRowsPlugin.untrimAll();
value: function filter() {
var dataFilter = this._createDataFilter();
var needToFilter = !this.conditionCollection.isEmpty();
var visibleVisualRows = [];
var conditions = this.conditionCollection.exportAllConditions();
var allowFiltering = this.hot.runHooks('beforeFilter', conditions);
if (allowFiltering !== false) {
if (needToFilter) {
var trimmedRows = [];
this.trimRowsPlugin.trimmedRows.length = 0;
visibleVisualRows = arrayMap(dataFilter.filter(), function (rowData) {
return rowData.meta.visualRow;
});
var visibleVisualRowsAssertion = createArrayAssertion(visibleVisualRows);
rangeEach(this.hot.countSourceRows() - 1, function (row) {
if (!visibleVisualRowsAssertion(row)) {
trimmedRows.push(row);
}
});
this.trimRowsPlugin.trimRows(trimmedRows);
if (!visibleVisualRows.length) {
this.hot.deselectCell();
}
function valueToItems(availableItems, selectedValue) {
const arrayAssertion = createArrayAssertion(selectedValue);
return arrayMap(availableItems, (item) => {
item.checked = arrayAssertion(item.value);
return item;
});
}
value: function onBeforeDropdownMenuSetItems(items) {
var menuKeys = arrayMap(items, function (item) {
return item.key;
});
this.components.forEach(function (component) {
component[menuKeys.indexOf(component.getMenuItemDescriptor().key) === -1 ? 'hide' : 'show']();
});
this.initHiddenRowsCache();
}
function valueToItems(availableItems, selectedValue) {
var arrayAssertion = createArrayAssertion(selectedValue);
return arrayMap(availableItems, function (item) {
item.checked = arrayAssertion(item.value);
return item;
});
}