@revolist/revogrid 4.9.13 → 4.9.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{column.drag.plugin-e636b5af.js → column.drag.plugin-9841e68f.js} +108 -188
- package/dist/cjs/column.drag.plugin-9841e68f.js.map +1 -0
- package/dist/cjs/{column.service-15c8352d.js → column.service-2471e4f3.js} +159 -25
- package/dist/cjs/column.service-2471e4f3.js.map +1 -0
- package/dist/cjs/{edit.utils-1172677c.js → edit.utils-eef92df0.js} +2 -2
- package/dist/cjs/{edit.utils-1172677c.js.map → edit.utils-eef92df0.js.map} +1 -1
- package/dist/cjs/{header-cell-renderer-375a879f.js → header-cell-renderer-751067c0.js} +14 -14
- package/dist/cjs/header-cell-renderer-751067c0.js.map +1 -0
- package/dist/cjs/{index-28b6fdfb.js → index-8bceed03.js} +1 -2
- package/dist/cjs/index-8bceed03.js.map +1 -0
- package/dist/cjs/index.cjs.js +19 -17
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/{key.utils-c62ab1e1.js → key.utils-f548f37c.js} +2 -2
- package/dist/cjs/{key.utils-c62ab1e1.js.map → key.utils-f548f37c.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/revo-grid.cjs.entry.js +33 -94
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revo-grid.cjs.js +1 -1
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +6 -6
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +4 -4
- package/dist/cjs/revogr-data_4.cjs.entry.js +16 -15
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +17 -10
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/{row-header-utils-22ffee54.js → row-header-utils-5d0d3fab.js} +2 -2
- package/dist/cjs/{row-header-utils-22ffee54.js.map → row-header-utils-5d0d3fab.js.map} +1 -1
- package/dist/cjs/{text-editor-91a9f5b5.js → text-editor-f066d388.js} +3 -3
- package/dist/cjs/{text-editor-91a9f5b5.js.map → text-editor-f066d388.js.map} +1 -1
- package/dist/cjs/{throttle-5da5df51.js → throttle-216690f1.js} +2 -2
- package/dist/cjs/{throttle-5da5df51.js.map → throttle-216690f1.js.map} +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/data/cell-renderer.js +2 -2
- package/dist/collection/components/data/cell-renderer.js.map +1 -1
- package/dist/collection/components/data/column.service.js +22 -24
- package/dist/collection/components/data/column.service.js.map +1 -1
- package/dist/collection/components/data/revogr-data.js +7 -6
- package/dist/collection/components/data/revogr-data.js.map +1 -1
- package/dist/collection/components/header/header-cell-renderer.js +5 -4
- package/dist/collection/components/header/header-cell-renderer.js.map +1 -1
- package/dist/collection/components/header/header-renderer.js +2 -2
- package/dist/collection/components/header/header-renderer.js.map +1 -1
- package/dist/collection/components/header/resizable.directive.js.map +1 -1
- package/dist/collection/components/header/resizable.element.js +9 -10
- package/dist/collection/components/header/resizable.element.js.map +1 -1
- package/dist/collection/components/header/revogr-header.js +3 -3
- package/dist/collection/components/header/revogr-header.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +6 -6
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/global/global.js +2 -2
- package/dist/collection/global/global.js.map +1 -1
- package/dist/collection/plugins/filter/{filter.service.js → filter.indexed.js} +18 -18
- package/dist/collection/plugins/filter/filter.indexed.js.map +1 -0
- package/dist/collection/plugins/filter/filter.panel.js +32 -46
- package/dist/collection/plugins/filter/filter.panel.js.map +1 -1
- package/dist/collection/plugins/filter/filter.plugin.js +86 -40
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
- package/dist/collection/plugins/filter/filter.types.js.map +1 -1
- package/dist/collection/plugins/wcag/index.js +7 -1
- package/dist/collection/plugins/wcag/index.js.map +1 -1
- package/dist/collection/serve/controller.js +1 -1
- package/dist/collection/serve/data.js +8 -0
- package/dist/collection/services/column.data.provider.js +6 -5
- package/dist/collection/services/column.data.provider.js.map +1 -1
- package/dist/collection/themeManager/theme.compact.js +1 -1
- package/dist/collection/themeManager/theme.compact.js.map +1 -1
- package/dist/collection/themeManager/theme.default.js +1 -1
- package/dist/collection/themeManager/theme.default.js.map +1 -1
- package/dist/collection/themeManager/theme.material.js +1 -1
- package/dist/collection/themeManager/theme.material.js.map +1 -1
- package/dist/collection/themeManager/theme.service.js +9 -9
- package/dist/collection/themeManager/theme.service.js.map +1 -1
- package/dist/collection/types/interfaces.js.map +1 -1
- package/dist/collection/utils/column.utils.js +10 -0
- package/dist/collection/utils/column.utils.js.map +1 -1
- package/dist/esm/{column.drag.plugin-30dc4e24.js → column.drag.plugin-c9787a50.js} +107 -181
- package/dist/esm/column.drag.plugin-c9787a50.js.map +1 -0
- package/dist/esm/{column.service-414e9cba.js → column.service-a6682d9d.js} +153 -26
- package/dist/esm/column.service-a6682d9d.js.map +1 -0
- package/dist/esm/{edit.utils-0666e5bd.js → edit.utils-c358c970.js} +2 -2
- package/dist/esm/{edit.utils-0666e5bd.js.map → edit.utils-c358c970.js.map} +1 -1
- package/dist/esm/{header-cell-renderer-ca570fcf.js → header-cell-renderer-52d9d6ba.js} +14 -14
- package/dist/esm/header-cell-renderer-52d9d6ba.js.map +1 -0
- package/dist/esm/{index-74b9801b.js → index-6c437a0d.js} +2 -2
- package/dist/esm/index-6c437a0d.js.map +1 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/{key.utils-d3df5db8.js → key.utils-5a827d12.js} +2 -2
- package/dist/esm/{key.utils-d3df5db8.js.map → key.utils-5a827d12.js.map} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/revo-grid.entry.js +26 -87
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revo-grid.js +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +6 -6
- package/dist/esm/revogr-clipboard_3.entry.js +4 -4
- package/dist/esm/revogr-data_4.entry.js +16 -15
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/esm/revogr-filter-panel.entry.js +17 -10
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/{row-header-utils-c7e3e2d5.js → row-header-utils-f5b04d1a.js} +2 -2
- package/dist/esm/{row-header-utils-c7e3e2d5.js.map → row-header-utils-f5b04d1a.js.map} +1 -1
- package/dist/esm/{text-editor-96d69516.js → text-editor-79a617b5.js} +3 -3
- package/dist/esm/{text-editor-96d69516.js.map → text-editor-79a617b5.js.map} +1 -1
- package/dist/esm/{throttle-262c3ed2.js → throttle-b94844de.js} +2 -2
- package/dist/esm/{throttle-262c3ed2.js.map → throttle-b94844de.js.map} +1 -1
- package/dist/revo-grid/column.drag.plugin-c9787a50.js +5 -0
- package/dist/revo-grid/column.drag.plugin-c9787a50.js.map +1 -0
- package/dist/revo-grid/column.service-a6682d9d.js +5 -0
- package/dist/revo-grid/column.service-a6682d9d.js.map +1 -0
- package/dist/revo-grid/{edit.utils-0666e5bd.js → edit.utils-c358c970.js} +2 -2
- package/dist/revo-grid/{header-cell-renderer-ca570fcf.js → header-cell-renderer-52d9d6ba.js} +2 -2
- package/dist/revo-grid/header-cell-renderer-52d9d6ba.js.map +1 -0
- package/dist/revo-grid/{index-74b9801b.js → index-6c437a0d.js} +2 -2
- package/dist/revo-grid/index.esm.js +1 -1
- package/dist/revo-grid/{key.utils-d3df5db8.js → key.utils-5a827d12.js} +2 -2
- package/dist/revo-grid/revo-grid.entry.js +1 -1
- package/dist/revo-grid/revo-grid.entry.js.map +1 -1
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js +1 -1
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/{row-header-utils-c7e3e2d5.js → row-header-utils-f5b04d1a.js} +2 -2
- package/dist/revo-grid/{text-editor-96d69516.js → text-editor-79a617b5.js} +2 -2
- package/dist/revo-grid/{throttle-262c3ed2.js → throttle-b94844de.js} +2 -2
- package/dist/types/components/data/column.service.d.ts +1 -2
- package/dist/types/components/header/header-cell-renderer.d.ts +7 -9
- package/dist/types/components/header/header-renderer.d.ts +2 -3
- package/dist/types/components/header/resizable.directive.d.ts +0 -1
- package/dist/types/components/header/resizable.element.d.ts +3 -2
- package/dist/types/components/revoGrid/revo-grid.d.ts +1 -1
- package/dist/types/components.d.ts +2 -8
- package/dist/types/plugins/filter/{filter.service.d.ts → filter.indexed.d.ts} +2 -2
- package/dist/types/plugins/filter/filter.panel.d.ts +3 -27
- package/dist/types/plugins/filter/filter.plugin.d.ts +14 -47
- package/dist/types/plugins/filter/filter.types.d.ts +86 -1
- package/dist/types/services/column.data.provider.d.ts +2 -1
- package/dist/types/themeManager/theme.compact.d.ts +1 -1
- package/dist/types/themeManager/theme.default.d.ts +1 -1
- package/dist/types/themeManager/theme.material.d.ts +1 -1
- package/dist/types/themeManager/theme.service.d.ts +2 -2
- package/dist/types/types/interfaces.d.ts +10 -12
- package/dist/types/utils/column.utils.d.ts +3 -1
- package/hydrate/index.js +786 -787
- package/hydrate/index.mjs +786 -787
- package/package.json +1 -1
- package/standalone/column.service.js +153 -25
- package/standalone/column.service.js.map +1 -1
- package/standalone/dimension.helpers.js +2 -216
- package/standalone/dimension.helpers.js.map +1 -1
- package/standalone/index.js +7 -6
- package/standalone/index.js.map +1 -1
- package/standalone/index2.js +2 -84
- package/standalone/index2.js.map +1 -1
- package/standalone/platform.js +89 -0
- package/standalone/platform.js.map +1 -0
- package/standalone/{data.store.js → reduce.js} +252 -38
- package/standalone/reduce.js.map +1 -0
- package/standalone/revo-grid.js +127 -261
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-data2.js +10 -8
- package/standalone/revogr-data2.js.map +1 -1
- package/standalone/revogr-edit2.js +2 -1
- package/standalone/revogr-edit2.js.map +1 -1
- package/standalone/revogr-filter-panel.js +17 -11
- package/standalone/revogr-filter-panel.js.map +1 -1
- package/standalone/revogr-focus2.js +1 -1
- package/standalone/revogr-header2.js +20 -20
- package/standalone/revogr-header2.js.map +1 -1
- package/standalone/revogr-order-editor2.js +1 -1
- package/standalone/revogr-overlay-selection2.js +3 -2
- package/standalone/revogr-overlay-selection2.js.map +1 -1
- package/standalone/revogr-row-headers2.js +1 -1
- package/standalone/selection.utils.js +1 -1
- package/dist/cjs/column.drag.plugin-e636b5af.js.map +0 -1
- package/dist/cjs/column.service-15c8352d.js.map +0 -1
- package/dist/cjs/header-cell-renderer-375a879f.js.map +0 -1
- package/dist/cjs/index-28b6fdfb.js.map +0 -1
- package/dist/collection/plugins/filter/filter.service.js.map +0 -1
- package/dist/esm/column.drag.plugin-30dc4e24.js.map +0 -1
- package/dist/esm/column.service-414e9cba.js.map +0 -1
- package/dist/esm/header-cell-renderer-ca570fcf.js.map +0 -1
- package/dist/esm/index-74b9801b.js.map +0 -1
- package/dist/revo-grid/column.drag.plugin-30dc4e24.js +0 -5
- package/dist/revo-grid/column.drag.plugin-30dc4e24.js.map +0 -1
- package/dist/revo-grid/column.service-414e9cba.js +0 -5
- package/dist/revo-grid/column.service-414e9cba.js.map +0 -1
- package/dist/revo-grid/header-cell-renderer-ca570fcf.js.map +0 -1
- package/standalone/data.store.js.map +0 -1
- /package/dist/revo-grid/{edit.utils-0666e5bd.js.map → edit.utils-c358c970.js.map} +0 -0
- /package/dist/revo-grid/{index-74b9801b.js.map → index-6c437a0d.js.map} +0 -0
- /package/dist/revo-grid/{key.utils-d3df5db8.js.map → key.utils-5a827d12.js.map} +0 -0
- /package/dist/revo-grid/{row-header-utils-c7e3e2d5.js.map → row-header-utils-f5b04d1a.js.map} +0 -0
- /package/dist/revo-grid/{text-editor-96d69516.js.map → text-editor-79a617b5.js.map} +0 -0
- /package/dist/revo-grid/{throttle-262c3ed2.js.map → throttle-b94844de.js.map} +0 -0
package/hydrate/index.mjs
CHANGED
|
@@ -2435,55 +2435,6 @@ class Clipboard {
|
|
|
2435
2435
|
}; }
|
|
2436
2436
|
}
|
|
2437
2437
|
|
|
2438
|
-
const FILTER_BUTTON_CLASS = 'rv-filter';
|
|
2439
|
-
const FILTER_BUTTON_ACTIVE = 'active';
|
|
2440
|
-
const FILTER_PROP = 'hasFilter';
|
|
2441
|
-
const AND_OR_BUTTON = 'and-or-button';
|
|
2442
|
-
const TRASH_BUTTON = 'trash-button';
|
|
2443
|
-
const FilterButton = ({ column }) => {
|
|
2444
|
-
return (hAsync("span", null,
|
|
2445
|
-
hAsync("button", { class: {
|
|
2446
|
-
[FILTER_BUTTON_CLASS]: true,
|
|
2447
|
-
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
2448
|
-
} },
|
|
2449
|
-
hAsync("svg", { class: "filter-img", viewBox: "0 0 64 64" },
|
|
2450
|
-
hAsync("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
2451
|
-
hAsync("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
|
|
2452
|
-
};
|
|
2453
|
-
const TrashButton = () => {
|
|
2454
|
-
return (hAsync("div", { class: { [TRASH_BUTTON]: true } },
|
|
2455
|
-
hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" },
|
|
2456
|
-
hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
2457
|
-
};
|
|
2458
|
-
const AndOrButton = ({ text }) => {
|
|
2459
|
-
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
2460
|
-
};
|
|
2461
|
-
function isFilterBtn(e) {
|
|
2462
|
-
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
2463
|
-
return true;
|
|
2464
|
-
}
|
|
2465
|
-
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
|
|
2466
|
-
}
|
|
2467
|
-
|
|
2468
|
-
(function closest() {
|
|
2469
|
-
if (!Element.prototype.matches) {
|
|
2470
|
-
Element.prototype.matches =
|
|
2471
|
-
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
2472
|
-
}
|
|
2473
|
-
if (!Element.prototype.closest) {
|
|
2474
|
-
Element.prototype.closest = function (s) {
|
|
2475
|
-
let el = this;
|
|
2476
|
-
do {
|
|
2477
|
-
if (Element.prototype.matches.call(el, s)) {
|
|
2478
|
-
return el;
|
|
2479
|
-
}
|
|
2480
|
-
el = el.parentElement || el.parentNode;
|
|
2481
|
-
} while (el !== null && el.nodeType === 1);
|
|
2482
|
-
return null;
|
|
2483
|
-
};
|
|
2484
|
-
}
|
|
2485
|
-
})();
|
|
2486
|
-
|
|
2487
2438
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2488
2439
|
|
|
2489
2440
|
/**
|
|
@@ -3025,6 +2976,55 @@ function debounce$2(func, wait, options) {
|
|
|
3025
2976
|
|
|
3026
2977
|
var debounce_1 = debounce$2;
|
|
3027
2978
|
|
|
2979
|
+
const FILTER_BUTTON_CLASS = 'rv-filter';
|
|
2980
|
+
const FILTER_BUTTON_ACTIVE = 'active';
|
|
2981
|
+
const FILTER_PROP = 'hasFilter';
|
|
2982
|
+
const AND_OR_BUTTON = 'and-or-button';
|
|
2983
|
+
const TRASH_BUTTON = 'trash-button';
|
|
2984
|
+
const FilterButton = ({ column }) => {
|
|
2985
|
+
return (hAsync("span", null,
|
|
2986
|
+
hAsync("button", { class: {
|
|
2987
|
+
[FILTER_BUTTON_CLASS]: true,
|
|
2988
|
+
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
2989
|
+
} },
|
|
2990
|
+
hAsync("svg", { class: "filter-img", viewBox: "0 0 64 64" },
|
|
2991
|
+
hAsync("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
2992
|
+
hAsync("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
|
|
2993
|
+
};
|
|
2994
|
+
const TrashButton = () => {
|
|
2995
|
+
return (hAsync("div", { class: { [TRASH_BUTTON]: true } },
|
|
2996
|
+
hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" },
|
|
2997
|
+
hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
2998
|
+
};
|
|
2999
|
+
const AndOrButton = ({ text }) => {
|
|
3000
|
+
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
3001
|
+
};
|
|
3002
|
+
function isFilterBtn(e) {
|
|
3003
|
+
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
3004
|
+
return true;
|
|
3005
|
+
}
|
|
3006
|
+
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
|
|
3007
|
+
}
|
|
3008
|
+
|
|
3009
|
+
(function closest() {
|
|
3010
|
+
if (!Element.prototype.matches) {
|
|
3011
|
+
Element.prototype.matches =
|
|
3012
|
+
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
3013
|
+
}
|
|
3014
|
+
if (!Element.prototype.closest) {
|
|
3015
|
+
Element.prototype.closest = function (s) {
|
|
3016
|
+
let el = this;
|
|
3017
|
+
do {
|
|
3018
|
+
if (Element.prototype.matches.call(el, s)) {
|
|
3019
|
+
return el;
|
|
3020
|
+
}
|
|
3021
|
+
el = el.parentElement || el.parentNode;
|
|
3022
|
+
} while (el !== null && el.nodeType === 1);
|
|
3023
|
+
return null;
|
|
3024
|
+
};
|
|
3025
|
+
}
|
|
3026
|
+
})();
|
|
3027
|
+
|
|
3028
3028
|
const filterStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:32px;background:none;color:#000;box-shadow:none}revogr-filter-panel{position:absolute;display:block;top:0;left:0;z-index:100;opacity:1;transform:none;background-color:#fff;transform-origin:62px 0px;box-shadow:0 5px 18px -2px rgba(0, 0, 0, 0.2);padding:10px;border-radius:4px;min-width:220px;text-align:left}revogr-filter-panel .filter-holder>div{display:flex;flex-direction:column}revogr-filter-panel label{font-size:13px;display:block;padding:8px 0}revogr-filter-panel select{width:100%}revogr-filter-panel input[type=text]{border:0;min-height:34px;margin:5px 0;background:#f3f3f3;border-radius:5px;padding:0 10px;box-sizing:border-box;width:100%}revogr-filter-panel button{margin-top:10px;margin-right:5px}revogr-filter-panel .filter-actions{text-align:right;margin-right:-5px}.rgHeaderCell:hover .rv-filter{transition:opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.rgHeaderCell:hover .rv-filter,.rgHeaderCell .rv-filter.active{opacity:1}.rgHeaderCell .rv-filter{height:24px;width:24px;background:none;border:0;opacity:0;visibility:visible;cursor:pointer;border-radius:4px}.rgHeaderCell .rv-filter.active{color:#10224a}.rgHeaderCell .rv-filter .filter-img{color:gray;width:11px}.select-css{display:block;font-family:sans-serif;font-weight:600;color:#444;line-height:1.3;padding:0.6em 1.4em 0.5em 0.8em;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid #f1f1f1;box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);background-repeat:no-repeat, repeat;background-position:right 0.7em top 50%, 0 0;background-size:0.65em auto, 100%;}.select-css::-ms-expand{display:none}.select-css:hover{border-color:rgb(197, 197, 197)}.select-css:focus{border-color:#f1f1f1;box-shadow:0 0 1px 3px rgba(59, 153, 252, 0.7);box-shadow:0 0 0 3px -moz-mac-focusring;color:#222;outline:none}.select-css option{font-weight:normal}.select-css:disabled,.select-css[aria-disabled=true]{color:gray;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%)}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:#f1f1f1}.multi-filter-list{margin-top:5px;margin-bottom:5px}.multi-filter-list div{white-space:nowrap}.multi-filter-list .multi-filter-list-action{display:flex;justify-content:space-between;align-items:center}.multi-filter-list .and-or-button{margin:0 0 0 10px;min-width:58px;cursor:pointer}.multi-filter-list .trash-button{margin:0 0 -2px 6px;cursor:pointer;width:22px;height:100%;font-size:16px}.multi-filter-list .trash-button .trash-img{width:1em}.add-filter-divider{display:block;margin:0 -10px 10px -10px;border-bottom:1px solid #d9d9d9;height:10px}.select-input{display:flex;justify-content:space-between;align-items:center}";
|
|
3029
3029
|
var RevogrFilterPanelStyle0 = filterStyleCss;
|
|
3030
3030
|
|
|
@@ -3062,7 +3062,6 @@ class FilterPanel {
|
|
|
3062
3062
|
this.currentFilterType = defaultType;
|
|
3063
3063
|
this.changes = undefined;
|
|
3064
3064
|
this.filterItems = {};
|
|
3065
|
-
this.filterTypes = {};
|
|
3066
3065
|
this.filterNames = {};
|
|
3067
3066
|
this.filterEntities = {};
|
|
3068
3067
|
this.filterCaptions = undefined;
|
|
@@ -3088,7 +3087,9 @@ class FilterPanel {
|
|
|
3088
3087
|
}
|
|
3089
3088
|
this.currentFilterId = -1;
|
|
3090
3089
|
const isOutside = !path.includes(this.element);
|
|
3091
|
-
if (e.target instanceof HTMLElement &&
|
|
3090
|
+
if (e.target instanceof HTMLElement &&
|
|
3091
|
+
isOutside &&
|
|
3092
|
+
!isFilterBtn(e.target)) {
|
|
3092
3093
|
this.changes = undefined;
|
|
3093
3094
|
}
|
|
3094
3095
|
}
|
|
@@ -3112,15 +3113,19 @@ class FilterPanel {
|
|
|
3112
3113
|
}
|
|
3113
3114
|
}
|
|
3114
3115
|
renderSelectOptions(type, isDefaultTypeRemoved = false) {
|
|
3115
|
-
|
|
3116
|
+
if (!this.changes) {
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3116
3119
|
const options = [];
|
|
3117
|
-
const prop =
|
|
3120
|
+
const prop = this.changes.prop;
|
|
3118
3121
|
if (!isDefaultTypeRemoved) {
|
|
3119
3122
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
3120
|
-
options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
|
|
3123
|
+
options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
|
|
3124
|
+
? capts.add
|
|
3125
|
+
: this.filterNames[defaultType]));
|
|
3121
3126
|
}
|
|
3122
|
-
for (let gIndex in this.filterTypes) {
|
|
3123
|
-
options.push(...this.filterTypes[gIndex].map(k => (hAsync("option", { value: k, selected: type === k }, this.filterNames[k]))));
|
|
3127
|
+
for (let gIndex in this.changes.filterTypes) {
|
|
3128
|
+
options.push(...this.changes.filterTypes[gIndex].map(k => (hAsync("option", { value: k, selected: type === k }, this.filterNames[k]))));
|
|
3124
3129
|
options.push(hAsync("option", { disabled: true }));
|
|
3125
3130
|
}
|
|
3126
3131
|
return options;
|
|
@@ -3171,8 +3176,10 @@ class FilterPanel {
|
|
|
3171
3176
|
top: `${this.changes.y}px`,
|
|
3172
3177
|
};
|
|
3173
3178
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
3174
|
-
return (hAsync(Host, { style: style, ref:
|
|
3175
|
-
|
|
3179
|
+
return (hAsync(Host, { style: style, ref: el => {
|
|
3180
|
+
var _a;
|
|
3181
|
+
((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) && this.autoCorrect(el);
|
|
3182
|
+
} }, hAsync("label", null, capts.title), hAsync("div", { class: "filter-holder" }, this.getFilterItemsList()), hAsync("div", { class: "add-filter" }, hAsync("select", { id: FILTER_ID, class: "select-css", onChange: e => this.onAddNewFilter(e) }, this.renderSelectOptions(this.currentFilterType))), hAsync("div", { class: "filter-actions" }, this.disableDynamicFiltering && (hAsync("button", { id: "revo-button-save", "aria-label": "save", class: "revo-button green", onClick: () => this.onSave() }, capts.save)), hAsync("button", { id: "revo-button-reset", "aria-label": "reset", class: "revo-button light", onClick: () => this.onReset() }, capts.reset), hAsync("button", { id: "revo-button-cancel", "aria-label": "cancel", class: "revo-button light", onClick: () => this.onCancel() }, capts.cancel))));
|
|
3176
3183
|
}
|
|
3177
3184
|
onFilterTypeChange(e, prop, index) {
|
|
3178
3185
|
if (!(e.target instanceof HTMLSelectElement)) {
|
|
@@ -3310,7 +3317,6 @@ class FilterPanel {
|
|
|
3310
3317
|
"$tagName$": "revogr-filter-panel",
|
|
3311
3318
|
"$members$": {
|
|
3312
3319
|
"filterItems": [16],
|
|
3313
|
-
"filterTypes": [16],
|
|
3314
3320
|
"filterNames": [16],
|
|
3315
3321
|
"filterEntities": [16],
|
|
3316
3322
|
"filterCaptions": [16],
|
|
@@ -5236,15 +5242,15 @@ var isFunction = isFunction_1,
|
|
|
5236
5242
|
* _.isArrayLike(_.noop);
|
|
5237
5243
|
* // => false
|
|
5238
5244
|
*/
|
|
5239
|
-
function isArrayLike$
|
|
5245
|
+
function isArrayLike$4(value) {
|
|
5240
5246
|
return value != null && isLength$1(value.length) && !isFunction(value);
|
|
5241
5247
|
}
|
|
5242
5248
|
|
|
5243
|
-
var isArrayLike_1 = isArrayLike$
|
|
5249
|
+
var isArrayLike_1 = isArrayLike$4;
|
|
5244
5250
|
|
|
5245
5251
|
var arrayLikeKeys = _arrayLikeKeys,
|
|
5246
5252
|
baseKeys$1 = _baseKeys,
|
|
5247
|
-
isArrayLike$
|
|
5253
|
+
isArrayLike$3 = isArrayLike_1;
|
|
5248
5254
|
|
|
5249
5255
|
/**
|
|
5250
5256
|
* Creates an array of the own enumerable property names of `object`.
|
|
@@ -5274,15 +5280,15 @@ var arrayLikeKeys = _arrayLikeKeys,
|
|
|
5274
5280
|
* _.keys('hi');
|
|
5275
5281
|
* // => ['0', '1']
|
|
5276
5282
|
*/
|
|
5277
|
-
function keys$
|
|
5278
|
-
return isArrayLike$
|
|
5283
|
+
function keys$3(object) {
|
|
5284
|
+
return isArrayLike$3(object) ? arrayLikeKeys(object) : baseKeys$1(object);
|
|
5279
5285
|
}
|
|
5280
5286
|
|
|
5281
|
-
var keys_1 = keys$
|
|
5287
|
+
var keys_1 = keys$3;
|
|
5282
5288
|
|
|
5283
5289
|
var baseGetAllKeys = _baseGetAllKeys,
|
|
5284
5290
|
getSymbols = _getSymbols,
|
|
5285
|
-
keys$
|
|
5291
|
+
keys$2 = keys_1;
|
|
5286
5292
|
|
|
5287
5293
|
/**
|
|
5288
5294
|
* Creates an array of own enumerable property names and symbols of `object`.
|
|
@@ -5292,7 +5298,7 @@ var baseGetAllKeys = _baseGetAllKeys,
|
|
|
5292
5298
|
* @returns {Array} Returns the array of property names and symbols.
|
|
5293
5299
|
*/
|
|
5294
5300
|
function getAllKeys$1(object) {
|
|
5295
|
-
return baseGetAllKeys(object, keys$
|
|
5301
|
+
return baseGetAllKeys(object, keys$2, getSymbols);
|
|
5296
5302
|
}
|
|
5297
5303
|
|
|
5298
5304
|
var _getAllKeys = getAllKeys$1;
|
|
@@ -5672,7 +5678,7 @@ function isStrictComparable$2(value) {
|
|
|
5672
5678
|
var _isStrictComparable = isStrictComparable$2;
|
|
5673
5679
|
|
|
5674
5680
|
var isStrictComparable$1 = _isStrictComparable,
|
|
5675
|
-
keys$
|
|
5681
|
+
keys$1 = keys_1;
|
|
5676
5682
|
|
|
5677
5683
|
/**
|
|
5678
5684
|
* Gets the property names, values, and compare flags of `object`.
|
|
@@ -5682,7 +5688,7 @@ var isStrictComparable$1 = _isStrictComparable,
|
|
|
5682
5688
|
* @returns {Array} Returns the match data of `object`.
|
|
5683
5689
|
*/
|
|
5684
5690
|
function getMatchData$1(object) {
|
|
5685
|
-
var result = keys$
|
|
5691
|
+
var result = keys$1(object),
|
|
5686
5692
|
length = result.length;
|
|
5687
5693
|
|
|
5688
5694
|
while (length--) {
|
|
@@ -6319,7 +6325,7 @@ var baseMatches = _baseMatches,
|
|
|
6319
6325
|
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
|
6320
6326
|
* @returns {Function} Returns the iteratee.
|
|
6321
6327
|
*/
|
|
6322
|
-
function baseIteratee$
|
|
6328
|
+
function baseIteratee$3(value) {
|
|
6323
6329
|
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
6324
6330
|
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
6325
6331
|
if (typeof value == 'function') {
|
|
@@ -6336,7 +6342,7 @@ function baseIteratee$4(value) {
|
|
|
6336
6342
|
return property(value);
|
|
6337
6343
|
}
|
|
6338
6344
|
|
|
6339
|
-
var _baseIteratee = baseIteratee$
|
|
6345
|
+
var _baseIteratee = baseIteratee$3;
|
|
6340
6346
|
|
|
6341
6347
|
var toNumber = toNumber_1;
|
|
6342
6348
|
|
|
@@ -6419,7 +6425,7 @@ function toInteger$4(value) {
|
|
|
6419
6425
|
var toInteger_1 = toInteger$4;
|
|
6420
6426
|
|
|
6421
6427
|
var baseFindIndex = _baseFindIndex,
|
|
6422
|
-
baseIteratee$
|
|
6428
|
+
baseIteratee$2 = _baseIteratee,
|
|
6423
6429
|
toInteger$3 = toInteger_1;
|
|
6424
6430
|
|
|
6425
6431
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
@@ -6460,7 +6466,7 @@ var nativeMax$1 = Math.max;
|
|
|
6460
6466
|
* _.findIndex(users, 'active');
|
|
6461
6467
|
* // => 2
|
|
6462
6468
|
*/
|
|
6463
|
-
function findIndex
|
|
6469
|
+
function findIndex(array, predicate, fromIndex) {
|
|
6464
6470
|
var length = array == null ? 0 : array.length;
|
|
6465
6471
|
if (!length) {
|
|
6466
6472
|
return -1;
|
|
@@ -6469,10 +6475,10 @@ function findIndex$1(array, predicate, fromIndex) {
|
|
|
6469
6475
|
if (index < 0) {
|
|
6470
6476
|
index = nativeMax$1(length + index, 0);
|
|
6471
6477
|
}
|
|
6472
|
-
return baseFindIndex(array, baseIteratee$
|
|
6478
|
+
return baseFindIndex(array, baseIteratee$2(predicate), index);
|
|
6473
6479
|
}
|
|
6474
6480
|
|
|
6475
|
-
var findIndex_1 = findIndex
|
|
6481
|
+
var findIndex_1 = findIndex;
|
|
6476
6482
|
|
|
6477
6483
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
6478
6484
|
|
|
@@ -6505,7 +6511,7 @@ function baseRange$1(start, end, step, fromRight) {
|
|
|
6505
6511
|
var _baseRange = baseRange$1;
|
|
6506
6512
|
|
|
6507
6513
|
var eq$1 = eq_1,
|
|
6508
|
-
isArrayLike$
|
|
6514
|
+
isArrayLike$2 = isArrayLike_1,
|
|
6509
6515
|
isIndex = _isIndex,
|
|
6510
6516
|
isObject$1 = isObject_1;
|
|
6511
6517
|
|
|
@@ -6525,7 +6531,7 @@ function isIterateeCall$3(value, index, object) {
|
|
|
6525
6531
|
}
|
|
6526
6532
|
var type = typeof index;
|
|
6527
6533
|
if (type == 'number'
|
|
6528
|
-
? (isArrayLike$
|
|
6534
|
+
? (isArrayLike$2(object) && isIndex(index, object.length))
|
|
6529
6535
|
: (type == 'string' && index in object)
|
|
6530
6536
|
) {
|
|
6531
6537
|
return eq$1(object[index], value);
|
|
@@ -7033,7 +7039,7 @@ var baseFor$1 = createBaseFor();
|
|
|
7033
7039
|
var _baseFor = baseFor$1;
|
|
7034
7040
|
|
|
7035
7041
|
var baseFor = _baseFor,
|
|
7036
|
-
keys
|
|
7042
|
+
keys = keys_1;
|
|
7037
7043
|
|
|
7038
7044
|
/**
|
|
7039
7045
|
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
|
@@ -7044,12 +7050,12 @@ var baseFor = _baseFor,
|
|
|
7044
7050
|
* @returns {Object} Returns `object`.
|
|
7045
7051
|
*/
|
|
7046
7052
|
function baseForOwn$1(object, iteratee) {
|
|
7047
|
-
return object && baseFor(object, iteratee, keys
|
|
7053
|
+
return object && baseFor(object, iteratee, keys);
|
|
7048
7054
|
}
|
|
7049
7055
|
|
|
7050
7056
|
var _baseForOwn = baseForOwn$1;
|
|
7051
7057
|
|
|
7052
|
-
var isArrayLike$
|
|
7058
|
+
var isArrayLike$1 = isArrayLike_1;
|
|
7053
7059
|
|
|
7054
7060
|
/**
|
|
7055
7061
|
* Creates a `baseEach` or `baseEachRight` function.
|
|
@@ -7064,7 +7070,7 @@ function createBaseEach$1(eachFunc, fromRight) {
|
|
|
7064
7070
|
if (collection == null) {
|
|
7065
7071
|
return collection;
|
|
7066
7072
|
}
|
|
7067
|
-
if (!isArrayLike$
|
|
7073
|
+
if (!isArrayLike$1(collection)) {
|
|
7068
7074
|
return eachFunc(collection, iteratee);
|
|
7069
7075
|
}
|
|
7070
7076
|
var length = collection.length,
|
|
@@ -7124,7 +7130,7 @@ var _baseReduce = baseReduce$1;
|
|
|
7124
7130
|
|
|
7125
7131
|
var arrayReduce = _arrayReduce,
|
|
7126
7132
|
baseEach$2 = _baseEach,
|
|
7127
|
-
baseIteratee$
|
|
7133
|
+
baseIteratee$1 = _baseIteratee,
|
|
7128
7134
|
baseReduce = _baseReduce,
|
|
7129
7135
|
isArray$3 = isArray_1;
|
|
7130
7136
|
|
|
@@ -7169,7 +7175,7 @@ function reduce(collection, iteratee, accumulator) {
|
|
|
7169
7175
|
var func = isArray$3(collection) ? arrayReduce : baseReduce,
|
|
7170
7176
|
initAccum = arguments.length < 3;
|
|
7171
7177
|
|
|
7172
|
-
return func(collection, baseIteratee$
|
|
7178
|
+
return func(collection, baseIteratee$1(iteratee), accumulator, initAccum, baseEach$2);
|
|
7173
7179
|
}
|
|
7174
7180
|
|
|
7175
7181
|
var reduce_1 = reduce;
|
|
@@ -8644,138 +8650,426 @@ class OrderEditor {
|
|
|
8644
8650
|
}; }
|
|
8645
8651
|
}
|
|
8646
8652
|
|
|
8647
|
-
|
|
8648
|
-
|
|
8649
|
-
|
|
8650
|
-
const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
|
|
8651
|
-
const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
|
|
8652
|
-
const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
|
|
8653
|
-
const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
|
|
8654
|
-
const GROUP_EXPAND_BTN = `group-expand`;
|
|
8655
|
-
const GROUP_EXPAND_EVENT = `groupexpandclick`;
|
|
8656
|
-
const GROUPING_ROW_TYPE = 'rgRow';
|
|
8657
|
-
|
|
8658
|
-
function getGroupValueDefault(item, prop) {
|
|
8659
|
-
return item[prop] || null;
|
|
8660
|
-
}
|
|
8661
|
-
/**
|
|
8662
|
-
* Gather data for grouping
|
|
8663
|
-
* @param array - flat data array
|
|
8664
|
-
* @param groupIds - ids of groups
|
|
8665
|
-
* @param expanded - potentially expanded items if present
|
|
8666
|
-
*/
|
|
8667
|
-
function gatherGrouping(array, groupIds, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
|
|
8668
|
-
const groupedItems = new Map();
|
|
8669
|
-
array.forEach((item, originalIndex) => {
|
|
8670
|
-
const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));
|
|
8671
|
-
const lastLevelValue = groupLevelValues.pop();
|
|
8672
|
-
let currentGroupLevel = groupedItems;
|
|
8673
|
-
groupLevelValues.forEach(value => {
|
|
8674
|
-
if (!currentGroupLevel.has(value)) {
|
|
8675
|
-
currentGroupLevel.set(value, new Map());
|
|
8676
|
-
}
|
|
8677
|
-
currentGroupLevel = currentGroupLevel.get(value);
|
|
8678
|
-
});
|
|
8679
|
-
if (!currentGroupLevel.has(lastLevelValue)) {
|
|
8680
|
-
currentGroupLevel.set(lastLevelValue, []);
|
|
8681
|
-
}
|
|
8682
|
-
const lastLevelItems = currentGroupLevel.get(lastLevelValue);
|
|
8683
|
-
lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
|
|
8684
|
-
});
|
|
8685
|
-
let itemIndex = -1;
|
|
8686
|
-
const groupingDepth = groupIds.length;
|
|
8687
|
-
// collapse all groups in the beginning
|
|
8688
|
-
const trimmed = {};
|
|
8689
|
-
// index mapping
|
|
8690
|
-
const oldNewIndexMap = {};
|
|
8691
|
-
// check if group header exists
|
|
8692
|
-
const pseudoGroupTest = {};
|
|
8693
|
-
const sourceWithGroups = [];
|
|
8694
|
-
function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
|
|
8695
|
-
const depth = parentIds.length;
|
|
8696
|
-
groupedValues.forEach((innerGroupedValues, groupId) => {
|
|
8697
|
-
const levelIds = [...parentIds, groupId];
|
|
8698
|
-
const mergedIds = levelIds.join(',');
|
|
8699
|
-
const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
|
|
8700
|
-
sourceWithGroups.push({
|
|
8701
|
-
[PSEUDO_GROUP_ITEM]: groupId,
|
|
8702
|
-
[GROUP_DEPTH]: depth,
|
|
8703
|
-
[PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
|
|
8704
|
-
[PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
|
|
8705
|
-
[GROUP_EXPANDED]: isGroupExpanded,
|
|
8706
|
-
});
|
|
8707
|
-
itemIndex += 1;
|
|
8708
|
-
if (!isGroupExpanded && depth) {
|
|
8709
|
-
trimmed[itemIndex] = true;
|
|
8710
|
-
}
|
|
8711
|
-
if (Array.isArray(innerGroupedValues)) {
|
|
8712
|
-
innerGroupedValues.forEach(value => {
|
|
8713
|
-
itemIndex += 1;
|
|
8714
|
-
if (!isGroupExpanded) {
|
|
8715
|
-
trimmed[itemIndex] = true;
|
|
8716
|
-
}
|
|
8717
|
-
oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
|
|
8718
|
-
const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
|
|
8719
|
-
pseudoGroupTestIds.forEach(pseudoGroupTestId => {
|
|
8720
|
-
if (!pseudoGroupTest[pseudoGroupTestId]) {
|
|
8721
|
-
pseudoGroupTest[pseudoGroupTestId] = [];
|
|
8722
|
-
}
|
|
8723
|
-
pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
|
|
8724
|
-
});
|
|
8725
|
-
});
|
|
8726
|
-
sourceWithGroups.push(...innerGroupedValues);
|
|
8727
|
-
}
|
|
8728
|
-
else {
|
|
8729
|
-
flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
|
|
8730
|
-
}
|
|
8731
|
-
});
|
|
8653
|
+
function getCellData(val) {
|
|
8654
|
+
if (typeof val === 'undefined' || val === null) {
|
|
8655
|
+
return '';
|
|
8732
8656
|
}
|
|
8733
|
-
|
|
8734
|
-
return {
|
|
8735
|
-
sourceWithGroups, // updates source mirror
|
|
8736
|
-
depth: groupingDepth, // largest depth for grouping
|
|
8737
|
-
trimmed, // used for expand/collapse grouping values
|
|
8738
|
-
oldNewIndexMap, // used for mapping old values to new
|
|
8739
|
-
childrenByGroup: pseudoGroupTest, // used to get child items in group
|
|
8740
|
-
};
|
|
8741
|
-
}
|
|
8742
|
-
function getGroupingName(rgRow) {
|
|
8743
|
-
return rgRow && rgRow[PSEUDO_GROUP_ITEM];
|
|
8744
|
-
}
|
|
8745
|
-
function isGrouping(rgRow) {
|
|
8746
|
-
return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
|
|
8657
|
+
return val;
|
|
8747
8658
|
}
|
|
8748
|
-
function
|
|
8749
|
-
|
|
8659
|
+
function getCellDataParsed(model, column) {
|
|
8660
|
+
const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];
|
|
8661
|
+
return getCellData(val);
|
|
8750
8662
|
}
|
|
8751
|
-
function
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
for (; i < ln; i++) {
|
|
8755
|
-
if (groupA[i] !== groupB[i]) {
|
|
8756
|
-
return i;
|
|
8757
|
-
}
|
|
8663
|
+
function getColumnType(rgCol) {
|
|
8664
|
+
if (rgCol.pin) {
|
|
8665
|
+
return rgCol.pin;
|
|
8758
8666
|
}
|
|
8759
|
-
return
|
|
8667
|
+
return 'rgCol';
|
|
8760
8668
|
}
|
|
8761
|
-
function
|
|
8762
|
-
const
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8669
|
+
function getColumnSizes(cols) {
|
|
8670
|
+
const res = {};
|
|
8671
|
+
for (const [i, c] of cols.entries()) {
|
|
8672
|
+
if (c.size) {
|
|
8673
|
+
res[i] = c.size;
|
|
8674
|
+
}
|
|
8766
8675
|
}
|
|
8767
|
-
return
|
|
8676
|
+
return res;
|
|
8768
8677
|
}
|
|
8769
|
-
|
|
8770
|
-
|
|
8771
|
-
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
}
|
|
8775
|
-
const depth = measureEqualDepth(currentGroup, nextGroup);
|
|
8776
|
-
return currentModel[GROUP_DEPTH] < depth;
|
|
8678
|
+
/**
|
|
8679
|
+
* Check if column is grouping column
|
|
8680
|
+
*/
|
|
8681
|
+
function isColGrouping(colData) {
|
|
8682
|
+
return !!colData.children;
|
|
8777
8683
|
}
|
|
8778
|
-
|
|
8684
|
+
/**
|
|
8685
|
+
* This function is used to create a collection of columns.
|
|
8686
|
+
*/
|
|
8687
|
+
function getColumns(columns, level = 0, types) {
|
|
8688
|
+
const collection = {
|
|
8689
|
+
// columns as they are in stores per type
|
|
8690
|
+
columns: {
|
|
8691
|
+
rgCol: [],
|
|
8692
|
+
colPinStart: [],
|
|
8693
|
+
colPinEnd: [],
|
|
8694
|
+
},
|
|
8695
|
+
// columns indexed by prop for quick access
|
|
8696
|
+
columnByProp: {},
|
|
8697
|
+
// column grouping
|
|
8698
|
+
columnGrouping: {
|
|
8699
|
+
rgCol: [],
|
|
8700
|
+
colPinStart: [],
|
|
8701
|
+
colPinEnd: [],
|
|
8702
|
+
},
|
|
8703
|
+
// max depth level for column grouping
|
|
8704
|
+
maxLevel: level,
|
|
8705
|
+
// sorting
|
|
8706
|
+
sort: {},
|
|
8707
|
+
};
|
|
8708
|
+
return reduce_1(columns, (res, colData) => {
|
|
8709
|
+
// Grouped column
|
|
8710
|
+
if (isColGrouping(colData)) {
|
|
8711
|
+
return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
|
|
8712
|
+
}
|
|
8713
|
+
// Regular column
|
|
8714
|
+
const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
|
|
8715
|
+
// Regular column, no Pin
|
|
8716
|
+
if (!regularColumn.pin) {
|
|
8717
|
+
res.columns.rgCol.push(regularColumn);
|
|
8718
|
+
// Pin
|
|
8719
|
+
}
|
|
8720
|
+
else {
|
|
8721
|
+
res.columns[regularColumn.pin].push(regularColumn);
|
|
8722
|
+
}
|
|
8723
|
+
if (regularColumn.order) {
|
|
8724
|
+
res.sort[regularColumn.prop] = regularColumn;
|
|
8725
|
+
}
|
|
8726
|
+
// it's possible that some columns have same prop, but better to avoid it
|
|
8727
|
+
if (!res.columnByProp[regularColumn.prop]) {
|
|
8728
|
+
res.columnByProp[regularColumn.prop] = [];
|
|
8729
|
+
}
|
|
8730
|
+
res.columnByProp[regularColumn.prop].push(regularColumn);
|
|
8731
|
+
// trigger setup hook if present
|
|
8732
|
+
regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
|
|
8733
|
+
return res;
|
|
8734
|
+
}, collection);
|
|
8735
|
+
}
|
|
8736
|
+
function gatherGroup(res, colData, collection, level = 0) {
|
|
8737
|
+
// group template
|
|
8738
|
+
const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
|
|
8739
|
+
// check columns for update
|
|
8740
|
+
for (let k in collection.columns) {
|
|
8741
|
+
const key = k;
|
|
8742
|
+
const resultItem = res.columns[key];
|
|
8743
|
+
const collectionItem = collection.columns[key];
|
|
8744
|
+
// if column data
|
|
8745
|
+
if (isArray_1(resultItem) && isArray_1(collectionItem)) {
|
|
8746
|
+
// fill columns
|
|
8747
|
+
resultItem.push(...collectionItem);
|
|
8748
|
+
// fill grouping
|
|
8749
|
+
if (collectionItem.length) {
|
|
8750
|
+
res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
|
|
8751
|
+
}
|
|
8752
|
+
}
|
|
8753
|
+
}
|
|
8754
|
+
// merge column groupings
|
|
8755
|
+
for (let k in collection.columnGrouping) {
|
|
8756
|
+
const key = k;
|
|
8757
|
+
const collectionItem = collection.columnGrouping[key];
|
|
8758
|
+
res.columnGrouping[key].push(...collectionItem);
|
|
8759
|
+
}
|
|
8760
|
+
res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
|
|
8761
|
+
res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
|
|
8762
|
+
return res;
|
|
8763
|
+
}
|
|
8764
|
+
function findColumn(columns, prop) {
|
|
8765
|
+
for (const c of columns) {
|
|
8766
|
+
if (isColGrouping(c)) {
|
|
8767
|
+
const found = findColumn(c.children, prop);
|
|
8768
|
+
if (found) {
|
|
8769
|
+
return found;
|
|
8770
|
+
}
|
|
8771
|
+
}
|
|
8772
|
+
else if (c.prop === prop) {
|
|
8773
|
+
return c;
|
|
8774
|
+
}
|
|
8775
|
+
}
|
|
8776
|
+
return undefined;
|
|
8777
|
+
}
|
|
8778
|
+
function getColumnByProp(columns, prop) {
|
|
8779
|
+
return findColumn(columns, prop);
|
|
8780
|
+
}
|
|
8781
|
+
|
|
8782
|
+
var codes;
|
|
8783
|
+
(function (codes) {
|
|
8784
|
+
codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
|
|
8785
|
+
codes[codes["MOUSE_RIGHT"] = 3] = "MOUSE_RIGHT";
|
|
8786
|
+
codes[codes["MOUSE_MIDDLE"] = 2] = "MOUSE_MIDDLE";
|
|
8787
|
+
codes[codes["BACKSPACE"] = 8] = "BACKSPACE";
|
|
8788
|
+
codes[codes["COMMA"] = 188] = "COMMA";
|
|
8789
|
+
codes[codes["INSERT"] = 45] = "INSERT";
|
|
8790
|
+
codes[codes["DELETE"] = 46] = "DELETE";
|
|
8791
|
+
codes[codes["END"] = 35] = "END";
|
|
8792
|
+
codes[codes["ENTER"] = 13] = "ENTER";
|
|
8793
|
+
codes[codes["ESCAPE"] = 27] = "ESCAPE";
|
|
8794
|
+
codes[codes["CONTROL"] = 17] = "CONTROL";
|
|
8795
|
+
codes[codes["COMMAND_LEFT"] = 91] = "COMMAND_LEFT";
|
|
8796
|
+
codes[codes["COMMAND_RIGHT"] = 93] = "COMMAND_RIGHT";
|
|
8797
|
+
codes[codes["COMMAND_FIREFOX"] = 224] = "COMMAND_FIREFOX";
|
|
8798
|
+
codes[codes["ALT"] = 18] = "ALT";
|
|
8799
|
+
codes[codes["HOME"] = 36] = "HOME";
|
|
8800
|
+
codes[codes["PAGE_DOWN"] = 34] = "PAGE_DOWN";
|
|
8801
|
+
codes[codes["PAGE_UP"] = 33] = "PAGE_UP";
|
|
8802
|
+
codes[codes["PERIOD"] = 190] = "PERIOD";
|
|
8803
|
+
codes[codes["SPACE"] = 32] = "SPACE";
|
|
8804
|
+
codes[codes["SHIFT"] = 16] = "SHIFT";
|
|
8805
|
+
codes[codes["CAPS_LOCK"] = 20] = "CAPS_LOCK";
|
|
8806
|
+
codes[codes["TAB"] = 9] = "TAB";
|
|
8807
|
+
codes[codes["ARROW_RIGHT"] = 39] = "ARROW_RIGHT";
|
|
8808
|
+
codes[codes["ARROW_LEFT"] = 37] = "ARROW_LEFT";
|
|
8809
|
+
codes[codes["ARROW_UP"] = 38] = "ARROW_UP";
|
|
8810
|
+
codes[codes["ARROW_DOWN"] = 40] = "ARROW_DOWN";
|
|
8811
|
+
codes[codes["F1"] = 112] = "F1";
|
|
8812
|
+
codes[codes["F2"] = 113] = "F2";
|
|
8813
|
+
codes[codes["F3"] = 114] = "F3";
|
|
8814
|
+
codes[codes["F4"] = 115] = "F4";
|
|
8815
|
+
codes[codes["F5"] = 116] = "F5";
|
|
8816
|
+
codes[codes["F6"] = 117] = "F6";
|
|
8817
|
+
codes[codes["F7"] = 118] = "F7";
|
|
8818
|
+
codes[codes["F8"] = 119] = "F8";
|
|
8819
|
+
codes[codes["F9"] = 120] = "F9";
|
|
8820
|
+
codes[codes["F10"] = 121] = "F10";
|
|
8821
|
+
codes[codes["F11"] = 122] = "F11";
|
|
8822
|
+
codes[codes["F12"] = 123] = "F12";
|
|
8823
|
+
codes[codes["A"] = 65] = "A";
|
|
8824
|
+
codes[codes["C"] = 67] = "C";
|
|
8825
|
+
codes[codes["D"] = 68] = "D";
|
|
8826
|
+
codes[codes["F"] = 70] = "F";
|
|
8827
|
+
codes[codes["L"] = 76] = "L";
|
|
8828
|
+
codes[codes["O"] = 79] = "O";
|
|
8829
|
+
codes[codes["P"] = 80] = "P";
|
|
8830
|
+
codes[codes["S"] = 83] = "S";
|
|
8831
|
+
codes[codes["V"] = 86] = "V";
|
|
8832
|
+
codes[codes["X"] = 88] = "X";
|
|
8833
|
+
})(codes || (codes = {}));
|
|
8834
|
+
var codesLetter;
|
|
8835
|
+
(function (codesLetter) {
|
|
8836
|
+
codesLetter["ENTER"] = "Enter";
|
|
8837
|
+
codesLetter["ENTER_NUM"] = "NumpadEnter";
|
|
8838
|
+
codesLetter["A"] = "KeyA";
|
|
8839
|
+
codesLetter["C"] = "KeyC";
|
|
8840
|
+
codesLetter["X"] = "KeyX";
|
|
8841
|
+
codesLetter["V"] = "KeyV";
|
|
8842
|
+
codesLetter["ESCAPE"] = "Escape";
|
|
8843
|
+
codesLetter["TAB"] = "Tab";
|
|
8844
|
+
codesLetter["BACKSPACE"] = "Backspace";
|
|
8845
|
+
codesLetter["DELETE"] = "Delete";
|
|
8846
|
+
codesLetter["ARROW_RIGHT"] = "ArrowRight";
|
|
8847
|
+
codesLetter["ARROW_LEFT"] = "ArrowLeft";
|
|
8848
|
+
codesLetter["ARROW_UP"] = "ArrowUp";
|
|
8849
|
+
codesLetter["ARROW_DOWN"] = "ArrowDown";
|
|
8850
|
+
codesLetter["SHIFT"] = "Shift";
|
|
8851
|
+
})(codesLetter || (codesLetter = {}));
|
|
8852
|
+
var keyValues;
|
|
8853
|
+
(function (keyValues) {
|
|
8854
|
+
keyValues["ENTER"] = "Enter";
|
|
8855
|
+
keyValues["TAB"] = "Tab";
|
|
8856
|
+
})(keyValues || (keyValues = {}));
|
|
8857
|
+
|
|
8858
|
+
var osPlatform;
|
|
8859
|
+
(function (osPlatform) {
|
|
8860
|
+
osPlatform["mac"] = "Mac";
|
|
8861
|
+
})(osPlatform || (osPlatform = {}));
|
|
8862
|
+
|
|
8863
|
+
function isClear(code) {
|
|
8864
|
+
return codesLetter.BACKSPACE === code || codesLetter.DELETE === code;
|
|
8865
|
+
}
|
|
8866
|
+
function isTab(code) {
|
|
8867
|
+
return codesLetter.TAB === code;
|
|
8868
|
+
}
|
|
8869
|
+
function isEnterKeyValue(key) {
|
|
8870
|
+
return keyValues.ENTER === key;
|
|
8871
|
+
}
|
|
8872
|
+
function isCut(event) {
|
|
8873
|
+
return ((event.ctrlKey && event.code === 'KeyX') || // Ctrl + X on Windows
|
|
8874
|
+
(event.metaKey && event.code === 'KeyX')); // Cmd + X on Mac
|
|
8875
|
+
}
|
|
8876
|
+
function isCopy(event) {
|
|
8877
|
+
return ((event.ctrlKey && event.code === 'KeyC') || // Ctrl + C on Windows
|
|
8878
|
+
(event.metaKey && event.code === 'KeyC')); // Cmd + C on Mac
|
|
8879
|
+
}
|
|
8880
|
+
function isPaste(event) {
|
|
8881
|
+
return ((event.ctrlKey && event.code === 'KeyV') || // Ctrl + V on Windows
|
|
8882
|
+
(event.metaKey && event.code === 'KeyV')); // Cmd + V on Mac
|
|
8883
|
+
}
|
|
8884
|
+
function isAll(event) {
|
|
8885
|
+
return ((event.ctrlKey && event.code === 'KeyA') || // Ctrl + A on Windows
|
|
8886
|
+
(event.metaKey && event.code === 'KeyA')); // Cmd + A on Mac
|
|
8887
|
+
}
|
|
8888
|
+
|
|
8889
|
+
const LETTER_BLOCK_SIZE$1 = 10;
|
|
8890
|
+
const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
|
|
8891
|
+
return ((rowHeaderColumn === null || rowHeaderColumn === void 0 ? void 0 : rowHeaderColumn.size) ||
|
|
8892
|
+
Math.max((itemsLength.toString().length + 1) * LETTER_BLOCK_SIZE$1, minWidth));
|
|
8893
|
+
};
|
|
8894
|
+
|
|
8895
|
+
/**
|
|
8896
|
+
* Calculate system scrollbar size
|
|
8897
|
+
*/
|
|
8898
|
+
function getScrollbarSize(document) {
|
|
8899
|
+
// Create a temporary div container and append it to the body
|
|
8900
|
+
const container = document.createElement('div');
|
|
8901
|
+
// Apply styling to ensure the div is scrollable
|
|
8902
|
+
container.style.overflow = 'scroll';
|
|
8903
|
+
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
8904
|
+
container.style.position = 'absolute';
|
|
8905
|
+
container.style.top = '-9999px'; // move it out of the screen
|
|
8906
|
+
container.style.width = '50px'; // arbitrary width
|
|
8907
|
+
container.style.height = '50px'; // arbitrary height
|
|
8908
|
+
// Append the div to the body
|
|
8909
|
+
document.body.appendChild(container);
|
|
8910
|
+
// Calculate the width of the scrollbar
|
|
8911
|
+
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
8912
|
+
// Remove the div from the body after calculation
|
|
8913
|
+
document.body.removeChild(container);
|
|
8914
|
+
// Return the calculated width of the scrollbar
|
|
8915
|
+
return scrollbarWidth;
|
|
8916
|
+
}
|
|
8917
|
+
/* Scale a value between 2 ranges
|
|
8918
|
+
*
|
|
8919
|
+
* Sample:
|
|
8920
|
+
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
8921
|
+
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
8922
|
+
*
|
|
8923
|
+
* Ranges of two values
|
|
8924
|
+
* @from
|
|
8925
|
+
* @to
|
|
8926
|
+
*
|
|
8927
|
+
* ~~ return value does the equivalent of Math.floor but faster.
|
|
8928
|
+
*/
|
|
8929
|
+
function scaleValue(value, from, to) {
|
|
8930
|
+
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
8931
|
+
}
|
|
8932
|
+
/**
|
|
8933
|
+
* Async timeout
|
|
8934
|
+
*/
|
|
8935
|
+
async function timeout(delay = 0) {
|
|
8936
|
+
await new Promise((r) => {
|
|
8937
|
+
setTimeout(() => r(), delay);
|
|
8938
|
+
});
|
|
8939
|
+
}
|
|
8940
|
+
|
|
8941
|
+
const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
|
|
8942
|
+
const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
|
|
8943
|
+
const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;
|
|
8944
|
+
const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
|
|
8945
|
+
const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
|
|
8946
|
+
const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
|
|
8947
|
+
const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
|
|
8948
|
+
const GROUP_EXPAND_BTN = `group-expand`;
|
|
8949
|
+
const GROUP_EXPAND_EVENT = `groupexpandclick`;
|
|
8950
|
+
const GROUPING_ROW_TYPE = 'rgRow';
|
|
8951
|
+
|
|
8952
|
+
function getGroupValueDefault(item, prop) {
|
|
8953
|
+
return item[prop] || null;
|
|
8954
|
+
}
|
|
8955
|
+
/**
|
|
8956
|
+
* Gather data for grouping
|
|
8957
|
+
* @param array - flat data array
|
|
8958
|
+
* @param groupIds - ids of groups
|
|
8959
|
+
* @param expanded - potentially expanded items if present
|
|
8960
|
+
*/
|
|
8961
|
+
function gatherGrouping(array, groupIds, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
|
|
8962
|
+
const groupedItems = new Map();
|
|
8963
|
+
array.forEach((item, originalIndex) => {
|
|
8964
|
+
const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));
|
|
8965
|
+
const lastLevelValue = groupLevelValues.pop();
|
|
8966
|
+
let currentGroupLevel = groupedItems;
|
|
8967
|
+
groupLevelValues.forEach(value => {
|
|
8968
|
+
if (!currentGroupLevel.has(value)) {
|
|
8969
|
+
currentGroupLevel.set(value, new Map());
|
|
8970
|
+
}
|
|
8971
|
+
currentGroupLevel = currentGroupLevel.get(value);
|
|
8972
|
+
});
|
|
8973
|
+
if (!currentGroupLevel.has(lastLevelValue)) {
|
|
8974
|
+
currentGroupLevel.set(lastLevelValue, []);
|
|
8975
|
+
}
|
|
8976
|
+
const lastLevelItems = currentGroupLevel.get(lastLevelValue);
|
|
8977
|
+
lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
|
|
8978
|
+
});
|
|
8979
|
+
let itemIndex = -1;
|
|
8980
|
+
const groupingDepth = groupIds.length;
|
|
8981
|
+
// collapse all groups in the beginning
|
|
8982
|
+
const trimmed = {};
|
|
8983
|
+
// index mapping
|
|
8984
|
+
const oldNewIndexMap = {};
|
|
8985
|
+
// check if group header exists
|
|
8986
|
+
const pseudoGroupTest = {};
|
|
8987
|
+
const sourceWithGroups = [];
|
|
8988
|
+
function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
|
|
8989
|
+
const depth = parentIds.length;
|
|
8990
|
+
groupedValues.forEach((innerGroupedValues, groupId) => {
|
|
8991
|
+
const levelIds = [...parentIds, groupId];
|
|
8992
|
+
const mergedIds = levelIds.join(',');
|
|
8993
|
+
const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
|
|
8994
|
+
sourceWithGroups.push({
|
|
8995
|
+
[PSEUDO_GROUP_ITEM]: groupId,
|
|
8996
|
+
[GROUP_DEPTH]: depth,
|
|
8997
|
+
[PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
|
|
8998
|
+
[PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
|
|
8999
|
+
[GROUP_EXPANDED]: isGroupExpanded,
|
|
9000
|
+
});
|
|
9001
|
+
itemIndex += 1;
|
|
9002
|
+
if (!isGroupExpanded && depth) {
|
|
9003
|
+
trimmed[itemIndex] = true;
|
|
9004
|
+
}
|
|
9005
|
+
if (Array.isArray(innerGroupedValues)) {
|
|
9006
|
+
innerGroupedValues.forEach(value => {
|
|
9007
|
+
itemIndex += 1;
|
|
9008
|
+
if (!isGroupExpanded) {
|
|
9009
|
+
trimmed[itemIndex] = true;
|
|
9010
|
+
}
|
|
9011
|
+
oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
|
|
9012
|
+
const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
|
|
9013
|
+
pseudoGroupTestIds.forEach(pseudoGroupTestId => {
|
|
9014
|
+
if (!pseudoGroupTest[pseudoGroupTestId]) {
|
|
9015
|
+
pseudoGroupTest[pseudoGroupTestId] = [];
|
|
9016
|
+
}
|
|
9017
|
+
pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
|
|
9018
|
+
});
|
|
9019
|
+
});
|
|
9020
|
+
sourceWithGroups.push(...innerGroupedValues);
|
|
9021
|
+
}
|
|
9022
|
+
else {
|
|
9023
|
+
flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
|
|
9024
|
+
}
|
|
9025
|
+
});
|
|
9026
|
+
}
|
|
9027
|
+
flattenGroupMaps(groupedItems, [], true);
|
|
9028
|
+
return {
|
|
9029
|
+
sourceWithGroups, // updates source mirror
|
|
9030
|
+
depth: groupingDepth, // largest depth for grouping
|
|
9031
|
+
trimmed, // used for expand/collapse grouping values
|
|
9032
|
+
oldNewIndexMap, // used for mapping old values to new
|
|
9033
|
+
childrenByGroup: pseudoGroupTest, // used to get child items in group
|
|
9034
|
+
};
|
|
9035
|
+
}
|
|
9036
|
+
function getGroupingName(rgRow) {
|
|
9037
|
+
return rgRow && rgRow[PSEUDO_GROUP_ITEM];
|
|
9038
|
+
}
|
|
9039
|
+
function isGrouping(rgRow) {
|
|
9040
|
+
return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
|
|
9041
|
+
}
|
|
9042
|
+
function isGroupingColumn(column) {
|
|
9043
|
+
return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';
|
|
9044
|
+
}
|
|
9045
|
+
function measureEqualDepth(groupA, groupB) {
|
|
9046
|
+
const ln = groupA.length;
|
|
9047
|
+
let i = 0;
|
|
9048
|
+
for (; i < ln; i++) {
|
|
9049
|
+
if (groupA[i] !== groupB[i]) {
|
|
9050
|
+
return i;
|
|
9051
|
+
}
|
|
9052
|
+
}
|
|
9053
|
+
return i;
|
|
9054
|
+
}
|
|
9055
|
+
function getParsedGroup(id) {
|
|
9056
|
+
const parseGroup = JSON.parse(id);
|
|
9057
|
+
// extra precaution and type safeguard
|
|
9058
|
+
if (!Array.isArray(parseGroup)) {
|
|
9059
|
+
return null;
|
|
9060
|
+
}
|
|
9061
|
+
return parseGroup;
|
|
9062
|
+
}
|
|
9063
|
+
// check if items is child of current clicked group
|
|
9064
|
+
function isSameGroup(currentGroup, currentModel, nextModel) {
|
|
9065
|
+
const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);
|
|
9066
|
+
if (!nextGroup) {
|
|
9067
|
+
return false;
|
|
9068
|
+
}
|
|
9069
|
+
const depth = measureEqualDepth(currentGroup, nextGroup);
|
|
9070
|
+
return currentModel[GROUP_DEPTH] < depth;
|
|
9071
|
+
}
|
|
9072
|
+
|
|
8779
9073
|
/**
|
|
8780
9074
|
* The base implementation of `_.slice` without an iteratee call guard.
|
|
8781
9075
|
*
|
|
@@ -8879,11 +9173,10 @@ class ColumnService {
|
|
|
8879
9173
|
return !!readOnly;
|
|
8880
9174
|
}
|
|
8881
9175
|
mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
|
|
8882
|
-
const
|
|
8883
|
-
|
|
8884
|
-
[
|
|
8885
|
-
|
|
8886
|
-
let props = Object.assign(Object.assign({}, defaultProps), { class: cellClass });
|
|
9176
|
+
const props = Object.assign({}, defaultProps);
|
|
9177
|
+
props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
|
|
9178
|
+
? { [props.class]: true }
|
|
9179
|
+
: props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
|
|
8887
9180
|
const extra = extraPropsFunc === null || extraPropsFunc === void 0 ? void 0 : extraPropsFunc(model);
|
|
8888
9181
|
if (!extra) {
|
|
8889
9182
|
return props;
|
|
@@ -8899,10 +9192,10 @@ class ColumnService {
|
|
|
8899
9192
|
return getCellData(data.model[data.prop]);
|
|
8900
9193
|
}
|
|
8901
9194
|
getSaveData(rowIndex, colIndex, val) {
|
|
9195
|
+
const data = this.rowDataModel(rowIndex, colIndex);
|
|
8902
9196
|
if (typeof val === 'undefined') {
|
|
8903
|
-
val =
|
|
9197
|
+
val = getCellData(data.model[data.prop]);
|
|
8904
9198
|
}
|
|
8905
|
-
const data = this.rowDataModel(rowIndex, colIndex);
|
|
8906
9199
|
return {
|
|
8907
9200
|
prop: data.prop,
|
|
8908
9201
|
rowIndex,
|
|
@@ -9104,124 +9397,47 @@ class ColumnService {
|
|
|
9104
9397
|
}
|
|
9105
9398
|
return {
|
|
9106
9399
|
data: toCopy,
|
|
9107
|
-
mapping,
|
|
9108
|
-
};
|
|
9109
|
-
}
|
|
9110
|
-
destroy() {
|
|
9111
|
-
this.unsubscribe.forEach(f => f());
|
|
9112
|
-
}
|
|
9113
|
-
}
|
|
9114
|
-
|
|
9115
|
-
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
function
|
|
9124
|
-
if (typeof
|
|
9125
|
-
|
|
9126
|
-
}
|
|
9127
|
-
|
|
9128
|
-
}
|
|
9129
|
-
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
}
|
|
9149
|
-
|
|
9150
|
-
var codes;
|
|
9151
|
-
(function (codes) {
|
|
9152
|
-
codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
|
|
9153
|
-
codes[codes["MOUSE_RIGHT"] = 3] = "MOUSE_RIGHT";
|
|
9154
|
-
codes[codes["MOUSE_MIDDLE"] = 2] = "MOUSE_MIDDLE";
|
|
9155
|
-
codes[codes["BACKSPACE"] = 8] = "BACKSPACE";
|
|
9156
|
-
codes[codes["COMMA"] = 188] = "COMMA";
|
|
9157
|
-
codes[codes["INSERT"] = 45] = "INSERT";
|
|
9158
|
-
codes[codes["DELETE"] = 46] = "DELETE";
|
|
9159
|
-
codes[codes["END"] = 35] = "END";
|
|
9160
|
-
codes[codes["ENTER"] = 13] = "ENTER";
|
|
9161
|
-
codes[codes["ESCAPE"] = 27] = "ESCAPE";
|
|
9162
|
-
codes[codes["CONTROL"] = 17] = "CONTROL";
|
|
9163
|
-
codes[codes["COMMAND_LEFT"] = 91] = "COMMAND_LEFT";
|
|
9164
|
-
codes[codes["COMMAND_RIGHT"] = 93] = "COMMAND_RIGHT";
|
|
9165
|
-
codes[codes["COMMAND_FIREFOX"] = 224] = "COMMAND_FIREFOX";
|
|
9166
|
-
codes[codes["ALT"] = 18] = "ALT";
|
|
9167
|
-
codes[codes["HOME"] = 36] = "HOME";
|
|
9168
|
-
codes[codes["PAGE_DOWN"] = 34] = "PAGE_DOWN";
|
|
9169
|
-
codes[codes["PAGE_UP"] = 33] = "PAGE_UP";
|
|
9170
|
-
codes[codes["PERIOD"] = 190] = "PERIOD";
|
|
9171
|
-
codes[codes["SPACE"] = 32] = "SPACE";
|
|
9172
|
-
codes[codes["SHIFT"] = 16] = "SHIFT";
|
|
9173
|
-
codes[codes["CAPS_LOCK"] = 20] = "CAPS_LOCK";
|
|
9174
|
-
codes[codes["TAB"] = 9] = "TAB";
|
|
9175
|
-
codes[codes["ARROW_RIGHT"] = 39] = "ARROW_RIGHT";
|
|
9176
|
-
codes[codes["ARROW_LEFT"] = 37] = "ARROW_LEFT";
|
|
9177
|
-
codes[codes["ARROW_UP"] = 38] = "ARROW_UP";
|
|
9178
|
-
codes[codes["ARROW_DOWN"] = 40] = "ARROW_DOWN";
|
|
9179
|
-
codes[codes["F1"] = 112] = "F1";
|
|
9180
|
-
codes[codes["F2"] = 113] = "F2";
|
|
9181
|
-
codes[codes["F3"] = 114] = "F3";
|
|
9182
|
-
codes[codes["F4"] = 115] = "F4";
|
|
9183
|
-
codes[codes["F5"] = 116] = "F5";
|
|
9184
|
-
codes[codes["F6"] = 117] = "F6";
|
|
9185
|
-
codes[codes["F7"] = 118] = "F7";
|
|
9186
|
-
codes[codes["F8"] = 119] = "F8";
|
|
9187
|
-
codes[codes["F9"] = 120] = "F9";
|
|
9188
|
-
codes[codes["F10"] = 121] = "F10";
|
|
9189
|
-
codes[codes["F11"] = 122] = "F11";
|
|
9190
|
-
codes[codes["F12"] = 123] = "F12";
|
|
9191
|
-
codes[codes["A"] = 65] = "A";
|
|
9192
|
-
codes[codes["C"] = 67] = "C";
|
|
9193
|
-
codes[codes["D"] = 68] = "D";
|
|
9194
|
-
codes[codes["F"] = 70] = "F";
|
|
9195
|
-
codes[codes["L"] = 76] = "L";
|
|
9196
|
-
codes[codes["O"] = 79] = "O";
|
|
9197
|
-
codes[codes["P"] = 80] = "P";
|
|
9198
|
-
codes[codes["S"] = 83] = "S";
|
|
9199
|
-
codes[codes["V"] = 86] = "V";
|
|
9200
|
-
codes[codes["X"] = 88] = "X";
|
|
9201
|
-
})(codes || (codes = {}));
|
|
9202
|
-
var codesLetter;
|
|
9203
|
-
(function (codesLetter) {
|
|
9204
|
-
codesLetter["ENTER"] = "Enter";
|
|
9205
|
-
codesLetter["ENTER_NUM"] = "NumpadEnter";
|
|
9206
|
-
codesLetter["A"] = "KeyA";
|
|
9207
|
-
codesLetter["C"] = "KeyC";
|
|
9208
|
-
codesLetter["X"] = "KeyX";
|
|
9209
|
-
codesLetter["V"] = "KeyV";
|
|
9210
|
-
codesLetter["ESCAPE"] = "Escape";
|
|
9211
|
-
codesLetter["TAB"] = "Tab";
|
|
9212
|
-
codesLetter["BACKSPACE"] = "Backspace";
|
|
9213
|
-
codesLetter["DELETE"] = "Delete";
|
|
9214
|
-
codesLetter["ARROW_RIGHT"] = "ArrowRight";
|
|
9215
|
-
codesLetter["ARROW_LEFT"] = "ArrowLeft";
|
|
9216
|
-
codesLetter["ARROW_UP"] = "ArrowUp";
|
|
9217
|
-
codesLetter["ARROW_DOWN"] = "ArrowDown";
|
|
9218
|
-
codesLetter["SHIFT"] = "Shift";
|
|
9219
|
-
})(codesLetter || (codesLetter = {}));
|
|
9220
|
-
var keyValues;
|
|
9221
|
-
(function (keyValues) {
|
|
9222
|
-
keyValues["ENTER"] = "Enter";
|
|
9223
|
-
keyValues["TAB"] = "Tab";
|
|
9224
|
-
})(keyValues || (keyValues = {}));
|
|
9400
|
+
mapping,
|
|
9401
|
+
};
|
|
9402
|
+
}
|
|
9403
|
+
destroy() {
|
|
9404
|
+
this.unsubscribe.forEach(f => f());
|
|
9405
|
+
}
|
|
9406
|
+
}
|
|
9407
|
+
/**
|
|
9408
|
+
* Checks if the given rowDrag is a service for dragging rows.
|
|
9409
|
+
*/
|
|
9410
|
+
function isRowDragService(rowDrag, model) {
|
|
9411
|
+
if (typeof rowDrag === 'function') {
|
|
9412
|
+
return rowDrag(model);
|
|
9413
|
+
}
|
|
9414
|
+
return !!rowDrag;
|
|
9415
|
+
}
|
|
9416
|
+
function mergeClasses(class1 = {}, class2 = {}) {
|
|
9417
|
+
if (typeof class1 === 'string') {
|
|
9418
|
+
class1 = { [class1]: true };
|
|
9419
|
+
}
|
|
9420
|
+
if (typeof class2 === 'string') {
|
|
9421
|
+
class2 = { [class2]: true };
|
|
9422
|
+
}
|
|
9423
|
+
return Object.assign(Object.assign({}, class1), class2);
|
|
9424
|
+
}
|
|
9425
|
+
function doPropMerge(existing, extra) {
|
|
9426
|
+
// if className is provided - remove it from props it messing with stencil
|
|
9427
|
+
if (extra.className) {
|
|
9428
|
+
extra.class = mergeClasses(extra.class, extra.className);
|
|
9429
|
+
delete extra.className;
|
|
9430
|
+
}
|
|
9431
|
+
let props = Object.assign(Object.assign({}, extra), existing);
|
|
9432
|
+
// extend existing props
|
|
9433
|
+
if (extra.class) {
|
|
9434
|
+
props.class = mergeClasses(props.class, extra.class);
|
|
9435
|
+
}
|
|
9436
|
+
if (extra.style) {
|
|
9437
|
+
props.style = Object.assign(Object.assign({}, extra.style), props.style);
|
|
9438
|
+
}
|
|
9439
|
+
return props;
|
|
9440
|
+
}
|
|
9225
9441
|
|
|
9226
9442
|
function isTouch(e) {
|
|
9227
9443
|
return !!e.touches;
|
|
@@ -9298,311 +9514,109 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
|
9298
9514
|
let cellX = x - left;
|
|
9299
9515
|
// Limit the cell position to the element height
|
|
9300
9516
|
if (cellY >= height) {
|
|
9301
|
-
cellY = height - 1;
|
|
9302
|
-
}
|
|
9303
|
-
// Limit the cell position to the element width
|
|
9304
|
-
if (cellX >= width) {
|
|
9305
|
-
cellX = width - 1;
|
|
9306
|
-
}
|
|
9307
|
-
// Get the row and column items based on the cell position
|
|
9308
|
-
const rgRow = getItemByPosition(rows, cellY);
|
|
9309
|
-
const rgCol = getItemByPosition(cols, cellX);
|
|
9310
|
-
// Set the row and column index to 0 if they are before the first item
|
|
9311
|
-
if (rgCol.itemIndex < 0) {
|
|
9312
|
-
rgCol.itemIndex = 0;
|
|
9313
|
-
}
|
|
9314
|
-
if (rgRow.itemIndex < 0) {
|
|
9315
|
-
rgRow.itemIndex = 0;
|
|
9316
|
-
}
|
|
9317
|
-
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9318
|
-
}
|
|
9319
|
-
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9320
|
-
const updateCoordinate = (c, pos = 0) => {
|
|
9321
|
-
const start = { x: range.x, y: range.y };
|
|
9322
|
-
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9323
|
-
const point = end[c] > focus[c] ? end : start;
|
|
9324
|
-
point[c] += pos;
|
|
9325
|
-
return { start, end };
|
|
9326
|
-
};
|
|
9327
|
-
if (changes.x) {
|
|
9328
|
-
return updateCoordinate('x', changes['x']);
|
|
9329
|
-
}
|
|
9330
|
-
if (changes.y) {
|
|
9331
|
-
return updateCoordinate('y', changes['y']);
|
|
9332
|
-
}
|
|
9333
|
-
return null;
|
|
9334
|
-
}
|
|
9335
|
-
/**
|
|
9336
|
-
* Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position
|
|
9337
|
-
* or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position
|
|
9338
|
-
*/
|
|
9339
|
-
function isAfterLast({ x, y }, lastCell) {
|
|
9340
|
-
return x >= lastCell.x || y >= lastCell.y;
|
|
9341
|
-
}
|
|
9342
|
-
/** check if out of range */
|
|
9343
|
-
function isBeforeFirst({ x, y }) {
|
|
9344
|
-
return x < 0 || y < 0;
|
|
9345
|
-
}
|
|
9346
|
-
/** Compare cells, only 1 coordinate difference is possible */
|
|
9347
|
-
// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9348
|
-
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9349
|
-
// for (let k of c) {
|
|
9350
|
-
// if (initial[k] !== last[k]) {
|
|
9351
|
-
// return { [k]: 1 };
|
|
9352
|
-
// }
|
|
9353
|
-
// }
|
|
9354
|
-
// return null;
|
|
9355
|
-
// }
|
|
9356
|
-
// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9357
|
-
// const cell: Partial<Cell> = {};
|
|
9358
|
-
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9359
|
-
// for (let k of c) {
|
|
9360
|
-
// cell[k] = Math.abs(initial[k] - last[k]);
|
|
9361
|
-
// }
|
|
9362
|
-
// if (cell.x > cell.y) {
|
|
9363
|
-
// return { x: 1 };
|
|
9364
|
-
// }
|
|
9365
|
-
// if (cell.y > cell.x) {
|
|
9366
|
-
// return { y: 1 };
|
|
9367
|
-
// }
|
|
9368
|
-
// return null;
|
|
9369
|
-
// }
|
|
9370
|
-
function styleByCellProps(styles) {
|
|
9371
|
-
return {
|
|
9372
|
-
left: `${styles.left}px`,
|
|
9373
|
-
top: `${styles.top}px`,
|
|
9374
|
-
width: `${styles.width}px`,
|
|
9375
|
-
height: `${styles.height}px`,
|
|
9376
|
-
};
|
|
9377
|
-
}
|
|
9378
|
-
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
9379
|
-
const top = getItemByIndex(dimensionRow, y).start;
|
|
9380
|
-
const left = getItemByIndex(dimensionCol, x).start;
|
|
9381
|
-
const bottom = getItemByIndex(dimensionRow, y1).end;
|
|
9382
|
-
const right = getItemByIndex(dimensionCol, x1).end;
|
|
9383
|
-
return {
|
|
9384
|
-
left,
|
|
9385
|
-
right,
|
|
9386
|
-
top,
|
|
9387
|
-
bottom,
|
|
9388
|
-
width: right - left,
|
|
9389
|
-
height: bottom - top,
|
|
9390
|
-
};
|
|
9391
|
-
}
|
|
9392
|
-
function getElStyle(range, dimensionRow, dimensionCol) {
|
|
9393
|
-
const styles = getCell(range, dimensionRow, dimensionCol);
|
|
9394
|
-
return styleByCellProps(styles);
|
|
9395
|
-
}
|
|
9396
|
-
|
|
9397
|
-
// is edit input
|
|
9398
|
-
function isEditInput(el) {
|
|
9399
|
-
return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
|
|
9400
|
-
}
|
|
9401
|
-
// Type guard for EditorCtrConstructible
|
|
9402
|
-
function isEditorCtrConstructible(editor) {
|
|
9403
|
-
return typeof editor === 'function' && typeof editor.prototype === 'object';
|
|
9404
|
-
}
|
|
9405
|
-
|
|
9406
|
-
var osPlatform;
|
|
9407
|
-
(function (osPlatform) {
|
|
9408
|
-
osPlatform["mac"] = "Mac";
|
|
9409
|
-
})(osPlatform || (osPlatform = {}));
|
|
9410
|
-
|
|
9411
|
-
function isClear(code) {
|
|
9412
|
-
return codesLetter.BACKSPACE === code || codesLetter.DELETE === code;
|
|
9413
|
-
}
|
|
9414
|
-
function isTab(code) {
|
|
9415
|
-
return codesLetter.TAB === code;
|
|
9416
|
-
}
|
|
9417
|
-
function isEnterKeyValue(key) {
|
|
9418
|
-
return keyValues.ENTER === key;
|
|
9419
|
-
}
|
|
9420
|
-
function isCut(event) {
|
|
9421
|
-
return ((event.ctrlKey && event.code === 'KeyX') || // Ctrl + X on Windows
|
|
9422
|
-
(event.metaKey && event.code === 'KeyX')); // Cmd + X on Mac
|
|
9423
|
-
}
|
|
9424
|
-
function isCopy(event) {
|
|
9425
|
-
return ((event.ctrlKey && event.code === 'KeyC') || // Ctrl + C on Windows
|
|
9426
|
-
(event.metaKey && event.code === 'KeyC')); // Cmd + C on Mac
|
|
9427
|
-
}
|
|
9428
|
-
function isPaste(event) {
|
|
9429
|
-
return ((event.ctrlKey && event.code === 'KeyV') || // Ctrl + V on Windows
|
|
9430
|
-
(event.metaKey && event.code === 'KeyV')); // Cmd + V on Mac
|
|
9431
|
-
}
|
|
9432
|
-
function isAll(event) {
|
|
9433
|
-
return ((event.ctrlKey && event.code === 'KeyA') || // Ctrl + A on Windows
|
|
9434
|
-
(event.metaKey && event.code === 'KeyA')); // Cmd + A on Mac
|
|
9435
|
-
}
|
|
9436
|
-
|
|
9437
|
-
function getColumnType(rgCol) {
|
|
9438
|
-
if (rgCol.pin) {
|
|
9439
|
-
return rgCol.pin;
|
|
9440
|
-
}
|
|
9441
|
-
return 'rgCol';
|
|
9442
|
-
}
|
|
9443
|
-
function getColumnSizes(cols) {
|
|
9444
|
-
const res = {};
|
|
9445
|
-
for (const [i, c] of cols.entries()) {
|
|
9446
|
-
if (c.size) {
|
|
9447
|
-
res[i] = c.size;
|
|
9448
|
-
}
|
|
9449
|
-
}
|
|
9450
|
-
return res;
|
|
9451
|
-
}
|
|
9452
|
-
/**
|
|
9453
|
-
* Check if column is grouping column
|
|
9454
|
-
*/
|
|
9455
|
-
function isColGrouping(colData) {
|
|
9456
|
-
return !!colData.children;
|
|
9457
|
-
}
|
|
9458
|
-
/**
|
|
9459
|
-
* This function is used to create a collection of columns.
|
|
9460
|
-
*/
|
|
9461
|
-
function getColumns(columns, level = 0, types) {
|
|
9462
|
-
const collection = {
|
|
9463
|
-
// columns as they are in stores per type
|
|
9464
|
-
columns: {
|
|
9465
|
-
rgCol: [],
|
|
9466
|
-
colPinStart: [],
|
|
9467
|
-
colPinEnd: [],
|
|
9468
|
-
},
|
|
9469
|
-
// columns indexed by prop for quick access
|
|
9470
|
-
columnByProp: {},
|
|
9471
|
-
// column grouping
|
|
9472
|
-
columnGrouping: {
|
|
9473
|
-
rgCol: [],
|
|
9474
|
-
colPinStart: [],
|
|
9475
|
-
colPinEnd: [],
|
|
9476
|
-
},
|
|
9477
|
-
// max depth level for column grouping
|
|
9478
|
-
maxLevel: level,
|
|
9479
|
-
// sorting
|
|
9480
|
-
sort: {},
|
|
9481
|
-
};
|
|
9482
|
-
return reduce_1(columns, (res, colData) => {
|
|
9483
|
-
// Grouped column
|
|
9484
|
-
if (isColGrouping(colData)) {
|
|
9485
|
-
return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
|
|
9486
|
-
}
|
|
9487
|
-
// Regular column
|
|
9488
|
-
const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
|
|
9489
|
-
// Regular column, no Pin
|
|
9490
|
-
if (!regularColumn.pin) {
|
|
9491
|
-
res.columns.rgCol.push(regularColumn);
|
|
9492
|
-
// Pin
|
|
9493
|
-
}
|
|
9494
|
-
else {
|
|
9495
|
-
res.columns[regularColumn.pin].push(regularColumn);
|
|
9496
|
-
}
|
|
9497
|
-
if (regularColumn.order) {
|
|
9498
|
-
res.sort[regularColumn.prop] = regularColumn;
|
|
9499
|
-
}
|
|
9500
|
-
// it's possible that some columns have same prop, but better to avoid it
|
|
9501
|
-
if (!res.columnByProp[regularColumn.prop]) {
|
|
9502
|
-
res.columnByProp[regularColumn.prop] = [];
|
|
9503
|
-
}
|
|
9504
|
-
res.columnByProp[regularColumn.prop].push(regularColumn);
|
|
9505
|
-
// trigger setup hook if present
|
|
9506
|
-
regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
|
|
9507
|
-
return res;
|
|
9508
|
-
}, collection);
|
|
9509
|
-
}
|
|
9510
|
-
function gatherGroup(res, colData, collection, level = 0) {
|
|
9511
|
-
// group template
|
|
9512
|
-
const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
|
|
9513
|
-
// check columns for update
|
|
9514
|
-
for (let k in collection.columns) {
|
|
9515
|
-
const key = k;
|
|
9516
|
-
const resultItem = res.columns[key];
|
|
9517
|
-
const collectionItem = collection.columns[key];
|
|
9518
|
-
// if column data
|
|
9519
|
-
if (isArray_1(resultItem) && isArray_1(collectionItem)) {
|
|
9520
|
-
// fill columns
|
|
9521
|
-
resultItem.push(...collectionItem);
|
|
9522
|
-
// fill grouping
|
|
9523
|
-
if (collectionItem.length) {
|
|
9524
|
-
res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
|
|
9525
|
-
}
|
|
9526
|
-
}
|
|
9517
|
+
cellY = height - 1;
|
|
9527
9518
|
}
|
|
9528
|
-
//
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
const collectionItem = collection.columnGrouping[key];
|
|
9532
|
-
res.columnGrouping[key].push(...collectionItem);
|
|
9519
|
+
// Limit the cell position to the element width
|
|
9520
|
+
if (cellX >= width) {
|
|
9521
|
+
cellX = width - 1;
|
|
9533
9522
|
}
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
if (isColGrouping(c)) {
|
|
9541
|
-
const found = findColumn(c.children, prop);
|
|
9542
|
-
if (found) {
|
|
9543
|
-
return found;
|
|
9544
|
-
}
|
|
9545
|
-
}
|
|
9546
|
-
else if (c.prop === prop) {
|
|
9547
|
-
return c;
|
|
9548
|
-
}
|
|
9523
|
+
// Get the row and column items based on the cell position
|
|
9524
|
+
const rgRow = getItemByPosition(rows, cellY);
|
|
9525
|
+
const rgCol = getItemByPosition(cols, cellX);
|
|
9526
|
+
// Set the row and column index to 0 if they are before the first item
|
|
9527
|
+
if (rgCol.itemIndex < 0) {
|
|
9528
|
+
rgCol.itemIndex = 0;
|
|
9549
9529
|
}
|
|
9550
|
-
|
|
9530
|
+
if (rgRow.itemIndex < 0) {
|
|
9531
|
+
rgRow.itemIndex = 0;
|
|
9532
|
+
}
|
|
9533
|
+
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9551
9534
|
}
|
|
9552
|
-
function
|
|
9553
|
-
|
|
9535
|
+
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9536
|
+
const updateCoordinate = (c, pos = 0) => {
|
|
9537
|
+
const start = { x: range.x, y: range.y };
|
|
9538
|
+
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9539
|
+
const point = end[c] > focus[c] ? end : start;
|
|
9540
|
+
point[c] += pos;
|
|
9541
|
+
return { start, end };
|
|
9542
|
+
};
|
|
9543
|
+
if (changes.x) {
|
|
9544
|
+
return updateCoordinate('x', changes['x']);
|
|
9545
|
+
}
|
|
9546
|
+
if (changes.y) {
|
|
9547
|
+
return updateCoordinate('y', changes['y']);
|
|
9548
|
+
}
|
|
9549
|
+
return null;
|
|
9554
9550
|
}
|
|
9555
|
-
|
|
9556
|
-
const LETTER_BLOCK_SIZE$1 = 10;
|
|
9557
|
-
const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
|
|
9558
|
-
return ((rowHeaderColumn === null || rowHeaderColumn === void 0 ? void 0 : rowHeaderColumn.size) ||
|
|
9559
|
-
Math.max((itemsLength.toString().length + 1) * LETTER_BLOCK_SIZE$1, minWidth));
|
|
9560
|
-
};
|
|
9561
|
-
|
|
9562
9551
|
/**
|
|
9563
|
-
*
|
|
9552
|
+
* Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position
|
|
9553
|
+
* or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position
|
|
9564
9554
|
*/
|
|
9565
|
-
function
|
|
9566
|
-
|
|
9567
|
-
const container = document.createElement('div');
|
|
9568
|
-
// Apply styling to ensure the div is scrollable
|
|
9569
|
-
container.style.overflow = 'scroll';
|
|
9570
|
-
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
9571
|
-
container.style.position = 'absolute';
|
|
9572
|
-
container.style.top = '-9999px'; // move it out of the screen
|
|
9573
|
-
container.style.width = '50px'; // arbitrary width
|
|
9574
|
-
container.style.height = '50px'; // arbitrary height
|
|
9575
|
-
// Append the div to the body
|
|
9576
|
-
document.body.appendChild(container);
|
|
9577
|
-
// Calculate the width of the scrollbar
|
|
9578
|
-
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
9579
|
-
// Remove the div from the body after calculation
|
|
9580
|
-
document.body.removeChild(container);
|
|
9581
|
-
// Return the calculated width of the scrollbar
|
|
9582
|
-
return scrollbarWidth;
|
|
9555
|
+
function isAfterLast({ x, y }, lastCell) {
|
|
9556
|
+
return x >= lastCell.x || y >= lastCell.y;
|
|
9583
9557
|
}
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
9588
|
-
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
9589
|
-
*
|
|
9590
|
-
* Ranges of two values
|
|
9591
|
-
* @from
|
|
9592
|
-
* @to
|
|
9593
|
-
*
|
|
9594
|
-
* ~~ return value does the equivalent of Math.floor but faster.
|
|
9595
|
-
*/
|
|
9596
|
-
function scaleValue(value, from, to) {
|
|
9597
|
-
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
9558
|
+
/** check if out of range */
|
|
9559
|
+
function isBeforeFirst({ x, y }) {
|
|
9560
|
+
return x < 0 || y < 0;
|
|
9598
9561
|
}
|
|
9599
|
-
/**
|
|
9600
|
-
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9562
|
+
/** Compare cells, only 1 coordinate difference is possible */
|
|
9563
|
+
// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9564
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9565
|
+
// for (let k of c) {
|
|
9566
|
+
// if (initial[k] !== last[k]) {
|
|
9567
|
+
// return { [k]: 1 };
|
|
9568
|
+
// }
|
|
9569
|
+
// }
|
|
9570
|
+
// return null;
|
|
9571
|
+
// }
|
|
9572
|
+
// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9573
|
+
// const cell: Partial<Cell> = {};
|
|
9574
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9575
|
+
// for (let k of c) {
|
|
9576
|
+
// cell[k] = Math.abs(initial[k] - last[k]);
|
|
9577
|
+
// }
|
|
9578
|
+
// if (cell.x > cell.y) {
|
|
9579
|
+
// return { x: 1 };
|
|
9580
|
+
// }
|
|
9581
|
+
// if (cell.y > cell.x) {
|
|
9582
|
+
// return { y: 1 };
|
|
9583
|
+
// }
|
|
9584
|
+
// return null;
|
|
9585
|
+
// }
|
|
9586
|
+
function styleByCellProps(styles) {
|
|
9587
|
+
return {
|
|
9588
|
+
left: `${styles.left}px`,
|
|
9589
|
+
top: `${styles.top}px`,
|
|
9590
|
+
width: `${styles.width}px`,
|
|
9591
|
+
height: `${styles.height}px`,
|
|
9592
|
+
};
|
|
9593
|
+
}
|
|
9594
|
+
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
9595
|
+
const top = getItemByIndex(dimensionRow, y).start;
|
|
9596
|
+
const left = getItemByIndex(dimensionCol, x).start;
|
|
9597
|
+
const bottom = getItemByIndex(dimensionRow, y1).end;
|
|
9598
|
+
const right = getItemByIndex(dimensionCol, x1).end;
|
|
9599
|
+
return {
|
|
9600
|
+
left,
|
|
9601
|
+
right,
|
|
9602
|
+
top,
|
|
9603
|
+
bottom,
|
|
9604
|
+
width: right - left,
|
|
9605
|
+
height: bottom - top,
|
|
9606
|
+
};
|
|
9607
|
+
}
|
|
9608
|
+
function getElStyle(range, dimensionRow, dimensionCol) {
|
|
9609
|
+
const styles = getCell(range, dimensionRow, dimensionCol);
|
|
9610
|
+
return styleByCellProps(styles);
|
|
9611
|
+
}
|
|
9612
|
+
|
|
9613
|
+
// is edit input
|
|
9614
|
+
function isEditInput(el) {
|
|
9615
|
+
return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
|
|
9616
|
+
}
|
|
9617
|
+
// Type guard for EditorCtrConstructible
|
|
9618
|
+
function isEditorCtrConstructible(editor) {
|
|
9619
|
+
return typeof editor === 'function' && typeof editor.prototype === 'object';
|
|
9606
9620
|
}
|
|
9607
9621
|
|
|
9608
9622
|
const DIRECTION_CODES = [
|
|
@@ -10713,81 +10727,12 @@ class RevoEdit {
|
|
|
10713
10727
|
}; }
|
|
10714
10728
|
}
|
|
10715
10729
|
|
|
10716
|
-
var baseIteratee$1 = _baseIteratee,
|
|
10717
|
-
isArrayLike$1 = isArrayLike_1,
|
|
10718
|
-
keys = keys_1;
|
|
10719
|
-
|
|
10720
|
-
/**
|
|
10721
|
-
* Creates a `_.find` or `_.findLast` function.
|
|
10722
|
-
*
|
|
10723
|
-
* @private
|
|
10724
|
-
* @param {Function} findIndexFunc The function to find the collection index.
|
|
10725
|
-
* @returns {Function} Returns the new find function.
|
|
10726
|
-
*/
|
|
10727
|
-
function createFind$1(findIndexFunc) {
|
|
10728
|
-
return function(collection, predicate, fromIndex) {
|
|
10729
|
-
var iterable = Object(collection);
|
|
10730
|
-
if (!isArrayLike$1(collection)) {
|
|
10731
|
-
var iteratee = baseIteratee$1(predicate);
|
|
10732
|
-
collection = keys(collection);
|
|
10733
|
-
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
|
10734
|
-
}
|
|
10735
|
-
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
10736
|
-
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
|
10737
|
-
};
|
|
10738
|
-
}
|
|
10739
|
-
|
|
10740
|
-
var _createFind = createFind$1;
|
|
10741
|
-
|
|
10742
|
-
var createFind = _createFind,
|
|
10743
|
-
findIndex = findIndex_1;
|
|
10744
|
-
|
|
10745
|
-
/**
|
|
10746
|
-
* Iterates over elements of `collection`, returning the first element
|
|
10747
|
-
* `predicate` returns truthy for. The predicate is invoked with three
|
|
10748
|
-
* arguments: (value, index|key, collection).
|
|
10749
|
-
*
|
|
10750
|
-
* @static
|
|
10751
|
-
* @memberOf _
|
|
10752
|
-
* @since 0.1.0
|
|
10753
|
-
* @category Collection
|
|
10754
|
-
* @param {Array|Object} collection The collection to inspect.
|
|
10755
|
-
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
10756
|
-
* @param {number} [fromIndex=0] The index to search from.
|
|
10757
|
-
* @returns {*} Returns the matched element, else `undefined`.
|
|
10758
|
-
* @example
|
|
10759
|
-
*
|
|
10760
|
-
* var users = [
|
|
10761
|
-
* { 'user': 'barney', 'age': 36, 'active': true },
|
|
10762
|
-
* { 'user': 'fred', 'age': 40, 'active': false },
|
|
10763
|
-
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
|
10764
|
-
* ];
|
|
10765
|
-
*
|
|
10766
|
-
* _.find(users, function(o) { return o.age < 40; });
|
|
10767
|
-
* // => object for 'barney'
|
|
10768
|
-
*
|
|
10769
|
-
* // The `_.matches` iteratee shorthand.
|
|
10770
|
-
* _.find(users, { 'age': 1, 'active': true });
|
|
10771
|
-
* // => object for 'pebbles'
|
|
10772
|
-
*
|
|
10773
|
-
* // The `_.matchesProperty` iteratee shorthand.
|
|
10774
|
-
* _.find(users, ['active', false]);
|
|
10775
|
-
* // => object for 'fred'
|
|
10776
|
-
*
|
|
10777
|
-
* // The `_.property` iteratee shorthand.
|
|
10778
|
-
* _.find(users, 'active');
|
|
10779
|
-
* // => object for 'barney'
|
|
10780
|
-
*/
|
|
10781
|
-
var find = createFind(findIndex);
|
|
10782
|
-
|
|
10783
|
-
var find_1 = find;
|
|
10784
|
-
|
|
10785
10730
|
class ColumnDataProvider {
|
|
10786
10731
|
get order() {
|
|
10787
10732
|
const order = {};
|
|
10788
10733
|
const sorting = this.sorting;
|
|
10789
10734
|
if (sorting) {
|
|
10790
|
-
Object.keys(sorting).forEach(
|
|
10735
|
+
Object.keys(sorting).forEach(prop => {
|
|
10791
10736
|
order[prop] = sorting[prop].order;
|
|
10792
10737
|
});
|
|
10793
10738
|
}
|
|
@@ -10798,6 +10743,7 @@ class ColumnDataProvider {
|
|
|
10798
10743
|
}
|
|
10799
10744
|
constructor() {
|
|
10800
10745
|
this.sorting = null;
|
|
10746
|
+
this.collection = null;
|
|
10801
10747
|
this.dataSources = columnTypes.reduce((sources, k) => {
|
|
10802
10748
|
sources[k] = new DataStore(k);
|
|
10803
10749
|
return sources;
|
|
@@ -10831,9 +10777,9 @@ class ColumnDataProvider {
|
|
|
10831
10777
|
getColumnIndexByProp(prop, type) {
|
|
10832
10778
|
return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);
|
|
10833
10779
|
}
|
|
10834
|
-
getColumnByProp(prop
|
|
10835
|
-
|
|
10836
|
-
return
|
|
10780
|
+
getColumnByProp(prop) {
|
|
10781
|
+
var _a;
|
|
10782
|
+
return (_a = this.collection) === null || _a === void 0 ? void 0 : _a.columnByProp[prop];
|
|
10837
10783
|
}
|
|
10838
10784
|
refreshByType(type) {
|
|
10839
10785
|
this.dataSources[type].refresh();
|
|
@@ -10855,6 +10801,7 @@ class ColumnDataProvider {
|
|
|
10855
10801
|
});
|
|
10856
10802
|
});
|
|
10857
10803
|
this.sorting = data.sort;
|
|
10804
|
+
this.collection = data;
|
|
10858
10805
|
return data;
|
|
10859
10806
|
}
|
|
10860
10807
|
updateColumns(cols) {
|
|
@@ -11187,7 +11134,7 @@ class ThemeService {
|
|
|
11187
11134
|
this.register('default');
|
|
11188
11135
|
}
|
|
11189
11136
|
register(theme) {
|
|
11190
|
-
const parsedTheme =
|
|
11137
|
+
const parsedTheme = getTheme(theme);
|
|
11191
11138
|
switch (parsedTheme) {
|
|
11192
11139
|
case 'material':
|
|
11193
11140
|
case 'darkMaterial':
|
|
@@ -11202,12 +11149,12 @@ class ThemeService {
|
|
|
11202
11149
|
break;
|
|
11203
11150
|
}
|
|
11204
11151
|
}
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
return DEFAULT_THEME;
|
|
11152
|
+
}
|
|
11153
|
+
function getTheme(theme) {
|
|
11154
|
+
if (theme && allowedThemes.indexOf(theme) > -1) {
|
|
11155
|
+
return theme;
|
|
11210
11156
|
}
|
|
11157
|
+
return DEFAULT_THEME;
|
|
11211
11158
|
}
|
|
11212
11159
|
|
|
11213
11160
|
/**
|
|
@@ -11614,23 +11561,7 @@ const notContains = (value, extra) => {
|
|
|
11614
11561
|
notContains.extra = 'input';
|
|
11615
11562
|
contains.extra = 'input';
|
|
11616
11563
|
|
|
11617
|
-
const
|
|
11618
|
-
none: 'None',
|
|
11619
|
-
empty: 'Not set',
|
|
11620
|
-
notEmpty: 'Set',
|
|
11621
|
-
eq: 'Equal',
|
|
11622
|
-
notEq: 'Not equal',
|
|
11623
|
-
begins: 'Begins with',
|
|
11624
|
-
contains: 'Contains',
|
|
11625
|
-
notContains: 'Does not contain',
|
|
11626
|
-
eqN: '=',
|
|
11627
|
-
neqN: '!=',
|
|
11628
|
-
gt: '>',
|
|
11629
|
-
gte: '>=',
|
|
11630
|
-
lt: '<',
|
|
11631
|
-
lte: '<=',
|
|
11632
|
-
};
|
|
11633
|
-
const filterEntities = {
|
|
11564
|
+
const filterCoreFunctionsIndexedByType = {
|
|
11634
11565
|
none: () => true,
|
|
11635
11566
|
empty: notSet,
|
|
11636
11567
|
notEmpty: set,
|
|
@@ -11650,7 +11581,37 @@ const filterTypes = {
|
|
|
11650
11581
|
string: ['notEmpty', 'empty', 'eq', 'notEq', 'begins', 'contains', 'notContains'],
|
|
11651
11582
|
number: ['notEmpty', 'empty', 'eqN', 'neqN', 'gt', 'gte', 'lt', 'lte'],
|
|
11652
11583
|
};
|
|
11584
|
+
const filterNames = {
|
|
11585
|
+
none: 'None',
|
|
11586
|
+
empty: 'Not set',
|
|
11587
|
+
notEmpty: 'Set',
|
|
11588
|
+
eq: 'Equal',
|
|
11589
|
+
notEq: 'Not equal',
|
|
11590
|
+
begins: 'Begins with',
|
|
11591
|
+
contains: 'Contains',
|
|
11592
|
+
notContains: 'Does not contain',
|
|
11593
|
+
eqN: '=',
|
|
11594
|
+
neqN: '!=',
|
|
11595
|
+
gt: '>',
|
|
11596
|
+
gte: '>=',
|
|
11597
|
+
lt: '<',
|
|
11598
|
+
lte: '<=',
|
|
11599
|
+
};
|
|
11653
11600
|
|
|
11601
|
+
/**
|
|
11602
|
+
* @typedef ColumnFilterConfig
|
|
11603
|
+
* @type {object}
|
|
11604
|
+
* @property {FilterCollection|undefined} collection - preserved filter data
|
|
11605
|
+
* @property {string[]|undefined} include - filters to be included, if defined everything else out of scope will be ignored
|
|
11606
|
+
* @property {Record<string, CustomFilter>|undefined} customFilters - hash map of {FilterType:CustomFilter}.
|
|
11607
|
+
* @property {FilterLocalization|undefined} localization - translation for filter popup captions.
|
|
11608
|
+
* @property {MultiFilterItem|undefined} multiFilterItems - data for multi filtering.
|
|
11609
|
+
* @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering.
|
|
11610
|
+
* A way to define your own filter types per column
|
|
11611
|
+
*/
|
|
11612
|
+
/**
|
|
11613
|
+
* @internal
|
|
11614
|
+
*/
|
|
11654
11615
|
const FILTER_TRIMMED_TYPE = 'filter';
|
|
11655
11616
|
const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';
|
|
11656
11617
|
class FilterPlugin extends BasePlugin {
|
|
@@ -11660,14 +11621,13 @@ class FilterPlugin extends BasePlugin {
|
|
|
11660
11621
|
this.revogrid = revogrid;
|
|
11661
11622
|
this.filterCollection = {};
|
|
11662
11623
|
this.multiFilterItems = {};
|
|
11663
|
-
this.
|
|
11664
|
-
this.
|
|
11665
|
-
this.
|
|
11624
|
+
this.filterByType = Object.assign({}, filterTypes);
|
|
11625
|
+
this.filterNameIndexByType = Object.assign({}, filterNames);
|
|
11626
|
+
this.filterFunctionsIndexedByType = Object.assign({}, filterCoreFunctionsIndexedByType);
|
|
11666
11627
|
this.filterProp = FILTER_PROP;
|
|
11667
11628
|
if (config) {
|
|
11668
11629
|
this.initConfig(config);
|
|
11669
11630
|
}
|
|
11670
|
-
const headerclick = (e) => this.headerclick(e);
|
|
11671
11631
|
const aftersourceset = async () => {
|
|
11672
11632
|
const filterCollectionProps = Object.keys(this.filterCollection);
|
|
11673
11633
|
if (filterCollectionProps.length > 0) {
|
|
@@ -11687,7 +11647,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11687
11647
|
}
|
|
11688
11648
|
await this.runFiltering();
|
|
11689
11649
|
};
|
|
11690
|
-
this.addEventListener('headerclick', headerclick);
|
|
11650
|
+
this.addEventListener('headerclick', (e) => this.headerclick(e));
|
|
11691
11651
|
this.addEventListener(FILTER_CONFIG_CHANGED_EVENT, ({ detail }) => {
|
|
11692
11652
|
if (!detail) {
|
|
11693
11653
|
this.clearFiltering();
|
|
@@ -11700,27 +11660,29 @@ class FilterPlugin extends BasePlugin {
|
|
|
11700
11660
|
});
|
|
11701
11661
|
this.addEventListener('aftersourceset', aftersourceset);
|
|
11702
11662
|
this.addEventListener('filter', ({ detail }) => this.onFilterChange(detail));
|
|
11703
|
-
const existingNodes = this.revogrid.registerVNode.filter(
|
|
11663
|
+
const existingNodes = this.revogrid.registerVNode.filter(n => n.$tag$ !== 'revogr-filter-panel');
|
|
11704
11664
|
this.revogrid.registerVNode = [
|
|
11705
11665
|
...existingNodes,
|
|
11706
|
-
hAsync("revogr-filter-panel", { filterItems: this.multiFilterItems, filterNames: this.
|
|
11666
|
+
hAsync("revogr-filter-panel", { filterItems: this.multiFilterItems, filterNames: this.filterNameIndexByType, filterEntities: this.filterFunctionsIndexedByType, filterCaptions: (_a = config === null || config === void 0 ? void 0 : config.localization) === null || _a === void 0 ? void 0 : _a.captions, onFilterChange: e => this.onFilterChange(e.detail), disableDynamicFiltering: config === null || config === void 0 ? void 0 : config.disableDynamicFiltering, ref: e => (this.pop = e) }),
|
|
11707
11667
|
];
|
|
11708
11668
|
}
|
|
11709
11669
|
initConfig(config) {
|
|
11710
11670
|
if (config.multiFilterItems) {
|
|
11711
11671
|
this.multiFilterItems = Object.assign({}, config.multiFilterItems);
|
|
11712
11672
|
}
|
|
11673
|
+
// Add custom filters
|
|
11713
11674
|
if (config.customFilters) {
|
|
11714
|
-
for (let
|
|
11715
|
-
const cFilter = config.customFilters[
|
|
11716
|
-
if (!this.
|
|
11717
|
-
this.
|
|
11675
|
+
for (let customFilterType in config.customFilters) {
|
|
11676
|
+
const cFilter = config.customFilters[customFilterType];
|
|
11677
|
+
if (!this.filterByType[cFilter.columnFilterType]) {
|
|
11678
|
+
this.filterByType[cFilter.columnFilterType] = [];
|
|
11718
11679
|
}
|
|
11719
|
-
this.
|
|
11720
|
-
this.
|
|
11721
|
-
this.
|
|
11680
|
+
this.filterByType[cFilter.columnFilterType].push(customFilterType);
|
|
11681
|
+
this.filterFunctionsIndexedByType[customFilterType] = cFilter.func;
|
|
11682
|
+
this.filterNameIndexByType[customFilterType] = cFilter.name;
|
|
11722
11683
|
}
|
|
11723
11684
|
}
|
|
11685
|
+
// Add filterProp if provided in config
|
|
11724
11686
|
if (config.filterProp) {
|
|
11725
11687
|
this.filterProp = config.filterProp;
|
|
11726
11688
|
}
|
|
@@ -11731,21 +11693,21 @@ class FilterPlugin extends BasePlugin {
|
|
|
11731
11693
|
const cfgInlcude = config.include;
|
|
11732
11694
|
if (cfgInlcude) {
|
|
11733
11695
|
const filters = {};
|
|
11734
|
-
for (let t in this.
|
|
11696
|
+
for (let t in this.filterByType) {
|
|
11735
11697
|
// validate filters, if appropriate function present
|
|
11736
|
-
const newTypes = this.
|
|
11698
|
+
const newTypes = this.filterByType[t].filter(f => cfgInlcude.indexOf(f) > -1);
|
|
11737
11699
|
if (newTypes.length) {
|
|
11738
11700
|
filters[t] = newTypes;
|
|
11739
11701
|
}
|
|
11740
11702
|
}
|
|
11741
11703
|
// if any valid filters provided show them
|
|
11742
11704
|
if (Object.keys(filters).length > 0) {
|
|
11743
|
-
this.
|
|
11705
|
+
this.filterByType = filters;
|
|
11744
11706
|
}
|
|
11745
11707
|
}
|
|
11746
11708
|
if (config.collection) {
|
|
11747
11709
|
this.filterCollection = reduce_1(config.collection, (result, item, prop) => {
|
|
11748
|
-
if (this.
|
|
11710
|
+
if (this.filterFunctionsIndexedByType[item.type]) {
|
|
11749
11711
|
result[prop] = item;
|
|
11750
11712
|
}
|
|
11751
11713
|
else {
|
|
@@ -11757,8 +11719,8 @@ class FilterPlugin extends BasePlugin {
|
|
|
11757
11719
|
if (config.localization) {
|
|
11758
11720
|
if (config.localization.filterNames) {
|
|
11759
11721
|
Object.entries(config.localization.filterNames).forEach(([k, v]) => {
|
|
11760
|
-
if (this.
|
|
11761
|
-
this.
|
|
11722
|
+
if (this.filterNameIndexByType[k] != void 0) {
|
|
11723
|
+
this.filterNameIndexByType[k] = v;
|
|
11762
11724
|
}
|
|
11763
11725
|
});
|
|
11764
11726
|
}
|
|
@@ -11784,13 +11746,12 @@ class FilterPlugin extends BasePlugin {
|
|
|
11784
11746
|
const gridPos = this.revogrid.getBoundingClientRect();
|
|
11785
11747
|
const buttonPos = el.getBoundingClientRect();
|
|
11786
11748
|
const prop = e.detail.prop;
|
|
11787
|
-
this.pop.filterTypes
|
|
11788
|
-
this.pop.show(Object.assign(Object.assign({}, this.filterCollection[prop]), { x: buttonPos.x - gridPos.x, y: buttonPos.y - gridPos.y + buttonPos.height, autoCorrect: true, prop }));
|
|
11749
|
+
this.pop.show(Object.assign(Object.assign({}, this.filterCollection[prop]), { x: buttonPos.x - gridPos.x, y: buttonPos.y - gridPos.y + buttonPos.height, autoCorrect: true, prop, filterTypes: this.getColumnFilter(e.detail.filter) }));
|
|
11789
11750
|
}
|
|
11790
11751
|
getColumnFilter(type) {
|
|
11791
11752
|
let filterType = 'string';
|
|
11792
11753
|
if (!type) {
|
|
11793
|
-
return { [filterType]: this.
|
|
11754
|
+
return { [filterType]: this.filterByType[filterType] };
|
|
11794
11755
|
}
|
|
11795
11756
|
// if custom column filter
|
|
11796
11757
|
if (this.isValidType(type)) {
|
|
@@ -11800,44 +11761,59 @@ class FilterPlugin extends BasePlugin {
|
|
|
11800
11761
|
else if (typeof type === 'object' && type.length) {
|
|
11801
11762
|
return type.reduce((r, multiType) => {
|
|
11802
11763
|
if (this.isValidType(multiType)) {
|
|
11803
|
-
r[multiType] = this.
|
|
11764
|
+
r[multiType] = this.filterByType[multiType];
|
|
11804
11765
|
}
|
|
11805
11766
|
return r;
|
|
11806
11767
|
}, {});
|
|
11807
11768
|
}
|
|
11808
|
-
return { [filterType]: this.
|
|
11769
|
+
return { [filterType]: this.filterByType[filterType] };
|
|
11809
11770
|
}
|
|
11810
11771
|
isValidType(type) {
|
|
11811
|
-
return !!(typeof type === 'string' && this.
|
|
11772
|
+
return !!(typeof type === 'string' && this.filterByType[type]);
|
|
11812
11773
|
}
|
|
11813
|
-
|
|
11774
|
+
/**
|
|
11775
|
+
* Called on internal component change
|
|
11776
|
+
*/
|
|
11814
11777
|
async onFilterChange(filterItems) {
|
|
11778
|
+
// store the filter items
|
|
11815
11779
|
this.multiFilterItems = filterItems;
|
|
11780
|
+
// run the filtering when the items change
|
|
11816
11781
|
this.runFiltering();
|
|
11817
11782
|
}
|
|
11818
11783
|
/**
|
|
11819
11784
|
* Triggers grid filtering
|
|
11820
11785
|
*/
|
|
11821
|
-
async doFiltering(collection,
|
|
11786
|
+
async doFiltering(collection, source, columns, filterItems) {
|
|
11822
11787
|
const columnsToUpdate = [];
|
|
11788
|
+
/**
|
|
11789
|
+
* Loop through the columns and update the columns that need to be updated with the `hasFilter` property.
|
|
11790
|
+
*/
|
|
11791
|
+
const columnByProp = {};
|
|
11823
11792
|
columns.forEach(rgCol => {
|
|
11824
11793
|
const column = Object.assign({}, rgCol);
|
|
11825
11794
|
const hasFilter = filterItems[column.prop];
|
|
11795
|
+
columnByProp[column.prop] = column;
|
|
11796
|
+
/**
|
|
11797
|
+
* If the column has a filter and it's not already marked as filtered, update the column.
|
|
11798
|
+
*/
|
|
11826
11799
|
if (column[this.filterProp] && !hasFilter) {
|
|
11827
11800
|
delete column[this.filterProp];
|
|
11828
11801
|
columnsToUpdate.push(column);
|
|
11829
11802
|
}
|
|
11803
|
+
/**
|
|
11804
|
+
* If the column does not have a filter and it's marked as filtered, update the column.
|
|
11805
|
+
*/
|
|
11830
11806
|
if (!column[this.filterProp] && hasFilter) {
|
|
11831
11807
|
columnsToUpdate.push(column);
|
|
11832
11808
|
column[this.filterProp] = true;
|
|
11833
11809
|
}
|
|
11834
11810
|
});
|
|
11835
|
-
const
|
|
11811
|
+
const itemsToTrim = this.getRowFilter(source, filterItems, columnByProp);
|
|
11836
11812
|
// check is filter event prevented
|
|
11837
11813
|
const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {
|
|
11838
11814
|
collection,
|
|
11839
|
-
itemsToFilter,
|
|
11840
|
-
source
|
|
11815
|
+
itemsToFilter: itemsToTrim,
|
|
11816
|
+
source,
|
|
11841
11817
|
filterItems,
|
|
11842
11818
|
});
|
|
11843
11819
|
if (defaultPrevented) {
|
|
@@ -11849,7 +11825,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11849
11825
|
return;
|
|
11850
11826
|
}
|
|
11851
11827
|
// applies the hasFilter to the columns to show filter icon
|
|
11852
|
-
|
|
11828
|
+
this.providers.column.updateColumns(columnsToUpdate);
|
|
11853
11829
|
this.emit('afterfilterapply');
|
|
11854
11830
|
}
|
|
11855
11831
|
async clearFiltering() {
|
|
@@ -11865,7 +11841,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11865
11841
|
if (this.multiFilterItems[prop].length > 0) {
|
|
11866
11842
|
const firstFilterItem = this.multiFilterItems[prop][0];
|
|
11867
11843
|
collection[prop] = {
|
|
11868
|
-
filter:
|
|
11844
|
+
filter: this.filterFunctionsIndexedByType[firstFilterItem.type],
|
|
11869
11845
|
type: firstFilterItem.type,
|
|
11870
11846
|
value: firstFilterItem.value,
|
|
11871
11847
|
};
|
|
@@ -11890,52 +11866,68 @@ class FilterPlugin extends BasePlugin {
|
|
|
11890
11866
|
columns: await this.revogrid.getColumns(),
|
|
11891
11867
|
};
|
|
11892
11868
|
}
|
|
11893
|
-
|
|
11869
|
+
/**
|
|
11870
|
+
* Get trimmed rows based on filter
|
|
11871
|
+
*/
|
|
11872
|
+
getRowFilter(rows, filterItems, columnByProp) {
|
|
11894
11873
|
const propKeys = Object.keys(filterItems);
|
|
11895
11874
|
const trimmed = {};
|
|
11896
11875
|
let propFilterSatisfiedCount = 0;
|
|
11897
11876
|
let lastFilterResults = [];
|
|
11898
11877
|
// each rows
|
|
11899
11878
|
rows.forEach((model, rowIndex) => {
|
|
11900
|
-
//
|
|
11879
|
+
// check filter by column properties
|
|
11901
11880
|
for (const prop of propKeys) {
|
|
11902
11881
|
const propFilters = filterItems[prop];
|
|
11882
|
+
// reset the count of satisfied filters
|
|
11903
11883
|
propFilterSatisfiedCount = 0;
|
|
11884
|
+
// reset the array of last filter results
|
|
11904
11885
|
lastFilterResults = [];
|
|
11905
11886
|
// testing each filter for a prop
|
|
11906
11887
|
for (const [filterIndex, filterData] of propFilters.entries()) {
|
|
11907
11888
|
// the filter LogicFunction based on the type
|
|
11908
|
-
const
|
|
11889
|
+
const filterFunc = this.filterFunctionsIndexedByType[filterData.type];
|
|
11909
11890
|
// THE MAGIC OF FILTERING IS HERE
|
|
11891
|
+
const column = columnByProp[prop];
|
|
11892
|
+
// If there is no column but user wants to filter by a property
|
|
11893
|
+
const value = column ? getCellDataParsed(model, columnByProp[prop]) : model[prop];
|
|
11894
|
+
// OR relation
|
|
11910
11895
|
if (filterData.relation === 'or') {
|
|
11896
|
+
// reset the array of last filter results
|
|
11911
11897
|
lastFilterResults = [];
|
|
11912
|
-
if
|
|
11898
|
+
// if the filter is satisfied, continue to the next filter
|
|
11899
|
+
if (filterFunc(value, filterData.value)) {
|
|
11913
11900
|
continue;
|
|
11914
11901
|
}
|
|
11902
|
+
// if the filter is not satisfied, count it
|
|
11915
11903
|
propFilterSatisfiedCount++;
|
|
11904
|
+
// AND relation
|
|
11916
11905
|
}
|
|
11917
11906
|
else {
|
|
11918
11907
|
// 'and' relation will need to know the next filter
|
|
11919
11908
|
// so we save this current filter to include it in the next filter
|
|
11920
|
-
lastFilterResults.push(!
|
|
11909
|
+
lastFilterResults.push(!filterFunc(value, filterData.value));
|
|
11921
11910
|
// check first if we have a filter on the next index to pair it with this current filter
|
|
11922
11911
|
const nextFilterData = propFilters[filterIndex + 1];
|
|
11923
11912
|
// stop the sequence if there is no next filter or if the next filter is not an 'and' relation
|
|
11924
11913
|
if (!nextFilterData || nextFilterData.relation !== 'and') {
|
|
11925
11914
|
// let's just continue since for sure propFilterSatisfiedCount cannot be satisfied
|
|
11926
11915
|
if (lastFilterResults.indexOf(true) === -1) {
|
|
11916
|
+
// reset the array of last filter results
|
|
11927
11917
|
lastFilterResults = [];
|
|
11928
11918
|
continue;
|
|
11929
11919
|
}
|
|
11930
11920
|
// we need to add all of the lastFilterResults since we need to satisfy all
|
|
11931
11921
|
propFilterSatisfiedCount += lastFilterResults.length;
|
|
11922
|
+
// reset the array of last filter results
|
|
11932
11923
|
lastFilterResults = [];
|
|
11933
11924
|
}
|
|
11934
11925
|
}
|
|
11935
11926
|
} // end of propFilters forEach
|
|
11936
11927
|
// add to the list of removed/trimmed rows of filter condition is satisfied
|
|
11937
|
-
if (propFilterSatisfiedCount === propFilters.length)
|
|
11928
|
+
if (propFilterSatisfiedCount === propFilters.length) {
|
|
11938
11929
|
trimmed[rowIndex] = true;
|
|
11930
|
+
}
|
|
11939
11931
|
} // end of for-of propKeys
|
|
11940
11932
|
});
|
|
11941
11933
|
return trimmed;
|
|
@@ -13927,34 +13919,33 @@ const ResizableElement = (props, children) => {
|
|
|
13927
13919
|
const resizeEls = [];
|
|
13928
13920
|
const directive = (props.canResize &&
|
|
13929
13921
|
new ResizeDirective(props, e => {
|
|
13922
|
+
var _a;
|
|
13930
13923
|
if (e.eventName === ResizeEvents.end) {
|
|
13931
|
-
props.onResize
|
|
13924
|
+
(_a = props.onResize) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13932
13925
|
}
|
|
13933
13926
|
})) ||
|
|
13934
13927
|
null;
|
|
13935
|
-
if (props.
|
|
13936
|
-
if (props.
|
|
13928
|
+
if (props.active) {
|
|
13929
|
+
if (props.canResize) {
|
|
13937
13930
|
for (let p in props.active) {
|
|
13938
13931
|
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
13939
13932
|
var _a;
|
|
13940
13933
|
e.preventDefault();
|
|
13941
|
-
(_a = props.
|
|
13934
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13942
13935
|
}, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
|
|
13943
13936
|
}
|
|
13944
13937
|
}
|
|
13945
|
-
|
|
13946
|
-
else {
|
|
13947
|
-
if (props.active) {
|
|
13938
|
+
else {
|
|
13948
13939
|
for (let p in props.active) {
|
|
13949
13940
|
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
13950
13941
|
var _a;
|
|
13951
13942
|
e.preventDefault();
|
|
13952
|
-
(_a = props.
|
|
13943
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13953
13944
|
}, class: `no-resize resizable resizable-${props.active[p]}` }));
|
|
13954
13945
|
}
|
|
13955
13946
|
}
|
|
13956
13947
|
}
|
|
13957
|
-
return (hAsync("div", Object.assign({}, props, { ref:
|
|
13948
|
+
return (hAsync("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
|
|
13958
13949
|
children,
|
|
13959
13950
|
resizeEls));
|
|
13960
13951
|
};
|
|
@@ -13968,16 +13959,17 @@ const HeaderCellRenderer = ({ data, props, additionalData }, children) => {
|
|
|
13968
13959
|
}
|
|
13969
13960
|
if (data === null || data === void 0 ? void 0 : data.columnProperties) {
|
|
13970
13961
|
const extra = data.columnProperties(data);
|
|
13971
|
-
if (extra
|
|
13962
|
+
if (extra) {
|
|
13972
13963
|
cellProps = doPropMerge(props, extra);
|
|
13973
13964
|
}
|
|
13974
13965
|
}
|
|
13975
|
-
|
|
13966
|
+
const resizeProps = Object.assign(Object.assign({}, cellProps), { onMouseDown(e) {
|
|
13976
13967
|
dispatch(e.currentTarget, ON_COLUMN_CLICK, {
|
|
13977
13968
|
data,
|
|
13978
13969
|
event: e,
|
|
13979
13970
|
});
|
|
13980
|
-
} })
|
|
13971
|
+
} });
|
|
13972
|
+
return (hAsync(ResizableElement, Object.assign({}, resizeProps),
|
|
13981
13973
|
hAsync("div", { class: "header-content" }, colTemplate),
|
|
13982
13974
|
children));
|
|
13983
13975
|
};
|
|
@@ -14190,8 +14182,14 @@ class WCAGPlugin extends BasePlugin {
|
|
|
14190
14182
|
return result;
|
|
14191
14183
|
};
|
|
14192
14184
|
column.cellProperties = (...args) => {
|
|
14185
|
+
const wcagProps = {
|
|
14186
|
+
['role']: 'gridcell',
|
|
14187
|
+
['aria-colindex']: index,
|
|
14188
|
+
['aria-rowindex']: args[0].rowIndex,
|
|
14189
|
+
['tabindex']: -1,
|
|
14190
|
+
};
|
|
14193
14191
|
const columnProps = (cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties(...args)) || {};
|
|
14194
|
-
return Object.assign({
|
|
14192
|
+
return Object.assign(Object.assign({}, wcagProps), columnProps);
|
|
14195
14193
|
};
|
|
14196
14194
|
});
|
|
14197
14195
|
});
|
|
@@ -15374,7 +15372,7 @@ class RevogrData {
|
|
|
15374
15372
|
if (cellEvent.defaultPrevented) {
|
|
15375
15373
|
continue;
|
|
15376
15374
|
}
|
|
15377
|
-
const { detail: { column: columnProps, row: rowProps, model:
|
|
15375
|
+
const { detail: { column: columnProps, row: rowProps, model: schemaModel }, } = cellEvent;
|
|
15378
15376
|
const defaultProps = {
|
|
15379
15377
|
[DATA_COL]: columnProps.itemIndex,
|
|
15380
15378
|
[DATA_ROW]: rowProps.itemIndex,
|
|
@@ -15390,16 +15388,17 @@ class RevogrData {
|
|
|
15390
15388
|
if (groupDepth && !columnProps.itemIndex && defaultProps.style) {
|
|
15391
15389
|
defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;
|
|
15392
15390
|
}
|
|
15393
|
-
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps,
|
|
15391
|
+
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel, (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties);
|
|
15394
15392
|
// Never use webcomponent for cell render
|
|
15395
15393
|
// It's very slow because of webcomponent initialization takes time
|
|
15396
|
-
|
|
15397
|
-
model:
|
|
15394
|
+
const cellNode = hAsync(CellRenderer, { renderProps: {
|
|
15395
|
+
model: schemaModel,
|
|
15398
15396
|
providers: this.providers,
|
|
15399
|
-
template: (_b =
|
|
15397
|
+
template: (_b = schemaModel.column) === null || _b === void 0 ? void 0 : _b.cellTemplate,
|
|
15400
15398
|
additionalData: this.additionalData,
|
|
15401
15399
|
dragStartCell: this.dragStartCell,
|
|
15402
|
-
}, cellProps: props })
|
|
15400
|
+
}, cellProps: props });
|
|
15401
|
+
cells.push(cellNode);
|
|
15403
15402
|
}
|
|
15404
15403
|
// #endregion
|
|
15405
15404
|
// #region Rows
|
|
@@ -15877,9 +15876,9 @@ const HeaderRenderer = (p) => {
|
|
|
15877
15876
|
transform: `translateX(${p.column.start}px)`,
|
|
15878
15877
|
},
|
|
15879
15878
|
onResize: p.onResize,
|
|
15880
|
-
|
|
15879
|
+
onDblClick(originalEvent) {
|
|
15881
15880
|
var _a;
|
|
15882
|
-
(_a = p.
|
|
15881
|
+
(_a = p.onDblClick) === null || _a === void 0 ? void 0 : _a.call(p, {
|
|
15883
15882
|
column: p.data,
|
|
15884
15883
|
index: p.column.itemIndex,
|
|
15885
15884
|
originalEvent,
|
|
@@ -16007,12 +16006,12 @@ class RevogrHeaderComponent {
|
|
|
16007
16006
|
// render header columns
|
|
16008
16007
|
for (let rgCol of cols) {
|
|
16009
16008
|
const colData = this.colData[rgCol.itemIndex];
|
|
16010
|
-
cells.push(hAsync(HeaderRenderer, { range: range, column: rgCol, data: Object.assign(Object.assign({}, colData), { index: rgCol.itemIndex, providers: this.providers }), canFilter: !!this.columnFilter, canResize: this.canResize, active: this.resizeHandler, onResize: e => this.onResize(e, rgCol.itemIndex),
|
|
16009
|
+
cells.push(hAsync(HeaderRenderer, { range: range, column: rgCol, data: Object.assign(Object.assign({}, colData), { index: rgCol.itemIndex, providers: this.providers }), canFilter: !!this.columnFilter, canResize: this.canResize, active: this.resizeHandler, onResize: e => this.onResize(e, rgCol.itemIndex), onDblClick: e => this.headerdblClick.emit(e), onClick: e => this.initialHeaderClick.emit(e), additionalData: this.additionalData }));
|
|
16011
16010
|
visibleProps[colData === null || colData === void 0 ? void 0 : colData.prop] = rgCol.itemIndex;
|
|
16012
16011
|
}
|
|
16013
16012
|
return [
|
|
16014
|
-
hAsync("div", { key: '
|
|
16015
|
-
hAsync("div", { key: '
|
|
16013
|
+
hAsync("div", { key: 'fcfd687bcae987699e2c0c6dd2b403dc3bb36c3d', class: "group-rgRow" }, hAsync(ColumnGroupsRenderer, { key: 'e3dfe9c5cbdd3c3dbbcbd7301a1a8a97353abf4b', canResize: this.canResize, active: this.resizeHandler, visibleProps: visibleProps, providers: this.providers, groups: this.groups, dimensionCol: this.dimensionCol.state, depth: this.groupingDepth, onResize: (changedX, startIndex, endIndex) => this.onResizeGroup(changedX, startIndex, endIndex), additionalData: this.additionalData })),
|
|
16014
|
+
hAsync("div", { key: '6b373546cc50bd85c7458da556c987e1a556d81b', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
|
|
16016
16015
|
];
|
|
16017
16016
|
}
|
|
16018
16017
|
get providers() {
|