Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/react-virtualized/dist/commonjs/Table/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = createMultiSort;
function createMultiSort(sortCallback) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
defaultSortBy = _ref.defaultSortBy,
_ref$defaultSortDirec = _ref.defaultSortDirection,
defaultSortDirection = _ref$defaultSortDirec === void 0 ? {} : _ref$defaultSortDirec;
if (!sortCallback) {
throw Error("Required parameter \"sortCallback\" not specified");
}
var sortBy = defaultSortBy || [];
var sortDirection = {};
sortBy.forEach(function (dataKey) {
sortDirection[dataKey] = defaultSortDirection[dataKey] !== undefined ? defaultSortDirection[dataKey] : 'ASC';
});
function sort(_ref2) {
var defaultSortDirection = _ref2.defaultSortDirection,
event = _ref2.event,
dataKey = _ref2.sortBy;
if (event.shiftKey) {
// Shift + click appends a column to existing criteria
if (sortDirection[dataKey] !== undefined) {
sortDirection[dataKey] = sortDirection[dataKey] === 'ASC' ? 'DESC' : 'ASC';
} else {
sortDirection[dataKey] = defaultSortDirection;
sortBy.push(dataKey);
}
} else if (event.ctrlKey || event.metaKey) {
// Control + click removes column from sort (if pressent)
var index = sortBy.indexOf(dataKey);
if (index >= 0) {
sortBy.splice(index, 1);
delete sortDirection[dataKey];
}
} else {
// Clear sortBy array of all non-selected keys
sortBy.length = 0;
sortBy.push(dataKey); // Clear sortDirection object of all non-selected keys
var sortDirectionKeys = Object.keys(sortDirection);
sortDirectionKeys.forEach(function (key) {
if (key !== dataKey) delete sortDirection[key];
}); // If key is already selected, reverse sort direction.
// Else, set sort direction to default direction.
if (sortDirection[dataKey] !== undefined) {
sortDirection[dataKey] = sortDirection[dataKey] === 'ASC' ? 'DESC' : 'ASC';
} else {
sortDirection[dataKey] = defaultSortDirection;
}
} // Notify application code
sortCallback({
sortBy: sortBy,
sortDirection: sortDirection
});
}
return {
sort: sort,
sortBy: sortBy,
sortDirection: sortDirection
};
} |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |