@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.js
CHANGED
|
@@ -2439,55 +2439,6 @@ class Clipboard {
|
|
|
2439
2439
|
}; }
|
|
2440
2440
|
}
|
|
2441
2441
|
|
|
2442
|
-
const FILTER_BUTTON_CLASS = 'rv-filter';
|
|
2443
|
-
const FILTER_BUTTON_ACTIVE = 'active';
|
|
2444
|
-
const FILTER_PROP = 'hasFilter';
|
|
2445
|
-
const AND_OR_BUTTON = 'and-or-button';
|
|
2446
|
-
const TRASH_BUTTON = 'trash-button';
|
|
2447
|
-
const FilterButton = ({ column }) => {
|
|
2448
|
-
return (hAsync("span", null,
|
|
2449
|
-
hAsync("button", { class: {
|
|
2450
|
-
[FILTER_BUTTON_CLASS]: true,
|
|
2451
|
-
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
2452
|
-
} },
|
|
2453
|
-
hAsync("svg", { class: "filter-img", viewBox: "0 0 64 64" },
|
|
2454
|
-
hAsync("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
2455
|
-
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" }))))));
|
|
2456
|
-
};
|
|
2457
|
-
const TrashButton = () => {
|
|
2458
|
-
return (hAsync("div", { class: { [TRASH_BUTTON]: true } },
|
|
2459
|
-
hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" },
|
|
2460
|
-
hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
2461
|
-
};
|
|
2462
|
-
const AndOrButton = ({ text }) => {
|
|
2463
|
-
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
2464
|
-
};
|
|
2465
|
-
function isFilterBtn(e) {
|
|
2466
|
-
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
2467
|
-
return true;
|
|
2468
|
-
}
|
|
2469
|
-
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
|
-
(function closest() {
|
|
2473
|
-
if (!Element.prototype.matches) {
|
|
2474
|
-
Element.prototype.matches =
|
|
2475
|
-
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
2476
|
-
}
|
|
2477
|
-
if (!Element.prototype.closest) {
|
|
2478
|
-
Element.prototype.closest = function (s) {
|
|
2479
|
-
let el = this;
|
|
2480
|
-
do {
|
|
2481
|
-
if (Element.prototype.matches.call(el, s)) {
|
|
2482
|
-
return el;
|
|
2483
|
-
}
|
|
2484
|
-
el = el.parentElement || el.parentNode;
|
|
2485
|
-
} while (el !== null && el.nodeType === 1);
|
|
2486
|
-
return null;
|
|
2487
|
-
};
|
|
2488
|
-
}
|
|
2489
|
-
})();
|
|
2490
|
-
|
|
2491
2442
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2492
2443
|
|
|
2493
2444
|
/**
|
|
@@ -3029,6 +2980,55 @@ function debounce$2(func, wait, options) {
|
|
|
3029
2980
|
|
|
3030
2981
|
var debounce_1 = debounce$2;
|
|
3031
2982
|
|
|
2983
|
+
const FILTER_BUTTON_CLASS = 'rv-filter';
|
|
2984
|
+
const FILTER_BUTTON_ACTIVE = 'active';
|
|
2985
|
+
const FILTER_PROP = 'hasFilter';
|
|
2986
|
+
const AND_OR_BUTTON = 'and-or-button';
|
|
2987
|
+
const TRASH_BUTTON = 'trash-button';
|
|
2988
|
+
const FilterButton = ({ column }) => {
|
|
2989
|
+
return (hAsync("span", null,
|
|
2990
|
+
hAsync("button", { class: {
|
|
2991
|
+
[FILTER_BUTTON_CLASS]: true,
|
|
2992
|
+
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
2993
|
+
} },
|
|
2994
|
+
hAsync("svg", { class: "filter-img", viewBox: "0 0 64 64" },
|
|
2995
|
+
hAsync("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
2996
|
+
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" }))))));
|
|
2997
|
+
};
|
|
2998
|
+
const TrashButton = () => {
|
|
2999
|
+
return (hAsync("div", { class: { [TRASH_BUTTON]: true } },
|
|
3000
|
+
hAsync("svg", { class: "trash-img", viewBox: "0 0 24 24" },
|
|
3001
|
+
hAsync("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
3002
|
+
};
|
|
3003
|
+
const AndOrButton = ({ text }) => {
|
|
3004
|
+
return hAsync("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
|
|
3005
|
+
};
|
|
3006
|
+
function isFilterBtn(e) {
|
|
3007
|
+
if (e.classList.contains(FILTER_BUTTON_CLASS)) {
|
|
3008
|
+
return true;
|
|
3009
|
+
}
|
|
3010
|
+
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
(function closest() {
|
|
3014
|
+
if (!Element.prototype.matches) {
|
|
3015
|
+
Element.prototype.matches =
|
|
3016
|
+
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
|
|
3017
|
+
}
|
|
3018
|
+
if (!Element.prototype.closest) {
|
|
3019
|
+
Element.prototype.closest = function (s) {
|
|
3020
|
+
let el = this;
|
|
3021
|
+
do {
|
|
3022
|
+
if (Element.prototype.matches.call(el, s)) {
|
|
3023
|
+
return el;
|
|
3024
|
+
}
|
|
3025
|
+
el = el.parentElement || el.parentNode;
|
|
3026
|
+
} while (el !== null && el.nodeType === 1);
|
|
3027
|
+
return null;
|
|
3028
|
+
};
|
|
3029
|
+
}
|
|
3030
|
+
})();
|
|
3031
|
+
|
|
3032
3032
|
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}";
|
|
3033
3033
|
var RevogrFilterPanelStyle0 = filterStyleCss;
|
|
3034
3034
|
|
|
@@ -3066,7 +3066,6 @@ class FilterPanel {
|
|
|
3066
3066
|
this.currentFilterType = defaultType;
|
|
3067
3067
|
this.changes = undefined;
|
|
3068
3068
|
this.filterItems = {};
|
|
3069
|
-
this.filterTypes = {};
|
|
3070
3069
|
this.filterNames = {};
|
|
3071
3070
|
this.filterEntities = {};
|
|
3072
3071
|
this.filterCaptions = undefined;
|
|
@@ -3092,7 +3091,9 @@ class FilterPanel {
|
|
|
3092
3091
|
}
|
|
3093
3092
|
this.currentFilterId = -1;
|
|
3094
3093
|
const isOutside = !path.includes(this.element);
|
|
3095
|
-
if (e.target instanceof HTMLElement &&
|
|
3094
|
+
if (e.target instanceof HTMLElement &&
|
|
3095
|
+
isOutside &&
|
|
3096
|
+
!isFilterBtn(e.target)) {
|
|
3096
3097
|
this.changes = undefined;
|
|
3097
3098
|
}
|
|
3098
3099
|
}
|
|
@@ -3116,15 +3117,19 @@ class FilterPanel {
|
|
|
3116
3117
|
}
|
|
3117
3118
|
}
|
|
3118
3119
|
renderSelectOptions(type, isDefaultTypeRemoved = false) {
|
|
3119
|
-
|
|
3120
|
+
if (!this.changes) {
|
|
3121
|
+
return;
|
|
3122
|
+
}
|
|
3120
3123
|
const options = [];
|
|
3121
|
-
const prop =
|
|
3124
|
+
const prop = this.changes.prop;
|
|
3122
3125
|
if (!isDefaultTypeRemoved) {
|
|
3123
3126
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
3124
|
-
options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
|
|
3127
|
+
options.push(hAsync("option", { selected: this.currentFilterType === defaultType, value: defaultType }, prop && this.filterItems[prop] && this.filterItems[prop].length > 0
|
|
3128
|
+
? capts.add
|
|
3129
|
+
: this.filterNames[defaultType]));
|
|
3125
3130
|
}
|
|
3126
|
-
for (let gIndex in this.filterTypes) {
|
|
3127
|
-
options.push(...this.filterTypes[gIndex].map(k => (hAsync("option", { value: k, selected: type === k }, this.filterNames[k]))));
|
|
3131
|
+
for (let gIndex in this.changes.filterTypes) {
|
|
3132
|
+
options.push(...this.changes.filterTypes[gIndex].map(k => (hAsync("option", { value: k, selected: type === k }, this.filterNames[k]))));
|
|
3128
3133
|
options.push(hAsync("option", { disabled: true }));
|
|
3129
3134
|
}
|
|
3130
3135
|
return options;
|
|
@@ -3175,8 +3180,10 @@ class FilterPanel {
|
|
|
3175
3180
|
top: `${this.changes.y}px`,
|
|
3176
3181
|
};
|
|
3177
3182
|
const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);
|
|
3178
|
-
return (hAsync(Host, { style: style, ref:
|
|
3179
|
-
|
|
3183
|
+
return (hAsync(Host, { style: style, ref: el => {
|
|
3184
|
+
var _a;
|
|
3185
|
+
((_a = this.changes) === null || _a === void 0 ? void 0 : _a.autoCorrect) && this.autoCorrect(el);
|
|
3186
|
+
} }, 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))));
|
|
3180
3187
|
}
|
|
3181
3188
|
onFilterTypeChange(e, prop, index) {
|
|
3182
3189
|
if (!(e.target instanceof HTMLSelectElement)) {
|
|
@@ -3314,7 +3321,6 @@ class FilterPanel {
|
|
|
3314
3321
|
"$tagName$": "revogr-filter-panel",
|
|
3315
3322
|
"$members$": {
|
|
3316
3323
|
"filterItems": [16],
|
|
3317
|
-
"filterTypes": [16],
|
|
3318
3324
|
"filterNames": [16],
|
|
3319
3325
|
"filterEntities": [16],
|
|
3320
3326
|
"filterCaptions": [16],
|
|
@@ -5240,15 +5246,15 @@ var isFunction = isFunction_1,
|
|
|
5240
5246
|
* _.isArrayLike(_.noop);
|
|
5241
5247
|
* // => false
|
|
5242
5248
|
*/
|
|
5243
|
-
function isArrayLike$
|
|
5249
|
+
function isArrayLike$4(value) {
|
|
5244
5250
|
return value != null && isLength$1(value.length) && !isFunction(value);
|
|
5245
5251
|
}
|
|
5246
5252
|
|
|
5247
|
-
var isArrayLike_1 = isArrayLike$
|
|
5253
|
+
var isArrayLike_1 = isArrayLike$4;
|
|
5248
5254
|
|
|
5249
5255
|
var arrayLikeKeys = _arrayLikeKeys,
|
|
5250
5256
|
baseKeys$1 = _baseKeys,
|
|
5251
|
-
isArrayLike$
|
|
5257
|
+
isArrayLike$3 = isArrayLike_1;
|
|
5252
5258
|
|
|
5253
5259
|
/**
|
|
5254
5260
|
* Creates an array of the own enumerable property names of `object`.
|
|
@@ -5278,15 +5284,15 @@ var arrayLikeKeys = _arrayLikeKeys,
|
|
|
5278
5284
|
* _.keys('hi');
|
|
5279
5285
|
* // => ['0', '1']
|
|
5280
5286
|
*/
|
|
5281
|
-
function keys$
|
|
5282
|
-
return isArrayLike$
|
|
5287
|
+
function keys$3(object) {
|
|
5288
|
+
return isArrayLike$3(object) ? arrayLikeKeys(object) : baseKeys$1(object);
|
|
5283
5289
|
}
|
|
5284
5290
|
|
|
5285
|
-
var keys_1 = keys$
|
|
5291
|
+
var keys_1 = keys$3;
|
|
5286
5292
|
|
|
5287
5293
|
var baseGetAllKeys = _baseGetAllKeys,
|
|
5288
5294
|
getSymbols = _getSymbols,
|
|
5289
|
-
keys$
|
|
5295
|
+
keys$2 = keys_1;
|
|
5290
5296
|
|
|
5291
5297
|
/**
|
|
5292
5298
|
* Creates an array of own enumerable property names and symbols of `object`.
|
|
@@ -5296,7 +5302,7 @@ var baseGetAllKeys = _baseGetAllKeys,
|
|
|
5296
5302
|
* @returns {Array} Returns the array of property names and symbols.
|
|
5297
5303
|
*/
|
|
5298
5304
|
function getAllKeys$1(object) {
|
|
5299
|
-
return baseGetAllKeys(object, keys$
|
|
5305
|
+
return baseGetAllKeys(object, keys$2, getSymbols);
|
|
5300
5306
|
}
|
|
5301
5307
|
|
|
5302
5308
|
var _getAllKeys = getAllKeys$1;
|
|
@@ -5676,7 +5682,7 @@ function isStrictComparable$2(value) {
|
|
|
5676
5682
|
var _isStrictComparable = isStrictComparable$2;
|
|
5677
5683
|
|
|
5678
5684
|
var isStrictComparable$1 = _isStrictComparable,
|
|
5679
|
-
keys$
|
|
5685
|
+
keys$1 = keys_1;
|
|
5680
5686
|
|
|
5681
5687
|
/**
|
|
5682
5688
|
* Gets the property names, values, and compare flags of `object`.
|
|
@@ -5686,7 +5692,7 @@ var isStrictComparable$1 = _isStrictComparable,
|
|
|
5686
5692
|
* @returns {Array} Returns the match data of `object`.
|
|
5687
5693
|
*/
|
|
5688
5694
|
function getMatchData$1(object) {
|
|
5689
|
-
var result = keys$
|
|
5695
|
+
var result = keys$1(object),
|
|
5690
5696
|
length = result.length;
|
|
5691
5697
|
|
|
5692
5698
|
while (length--) {
|
|
@@ -6323,7 +6329,7 @@ var baseMatches = _baseMatches,
|
|
|
6323
6329
|
* @param {*} [value=_.identity] The value to convert to an iteratee.
|
|
6324
6330
|
* @returns {Function} Returns the iteratee.
|
|
6325
6331
|
*/
|
|
6326
|
-
function baseIteratee$
|
|
6332
|
+
function baseIteratee$3(value) {
|
|
6327
6333
|
// Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
|
|
6328
6334
|
// See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
|
|
6329
6335
|
if (typeof value == 'function') {
|
|
@@ -6340,7 +6346,7 @@ function baseIteratee$4(value) {
|
|
|
6340
6346
|
return property(value);
|
|
6341
6347
|
}
|
|
6342
6348
|
|
|
6343
|
-
var _baseIteratee = baseIteratee$
|
|
6349
|
+
var _baseIteratee = baseIteratee$3;
|
|
6344
6350
|
|
|
6345
6351
|
var toNumber = toNumber_1;
|
|
6346
6352
|
|
|
@@ -6423,7 +6429,7 @@ function toInteger$4(value) {
|
|
|
6423
6429
|
var toInteger_1 = toInteger$4;
|
|
6424
6430
|
|
|
6425
6431
|
var baseFindIndex = _baseFindIndex,
|
|
6426
|
-
baseIteratee$
|
|
6432
|
+
baseIteratee$2 = _baseIteratee,
|
|
6427
6433
|
toInteger$3 = toInteger_1;
|
|
6428
6434
|
|
|
6429
6435
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
@@ -6464,7 +6470,7 @@ var nativeMax$1 = Math.max;
|
|
|
6464
6470
|
* _.findIndex(users, 'active');
|
|
6465
6471
|
* // => 2
|
|
6466
6472
|
*/
|
|
6467
|
-
function findIndex
|
|
6473
|
+
function findIndex(array, predicate, fromIndex) {
|
|
6468
6474
|
var length = array == null ? 0 : array.length;
|
|
6469
6475
|
if (!length) {
|
|
6470
6476
|
return -1;
|
|
@@ -6473,10 +6479,10 @@ function findIndex$1(array, predicate, fromIndex) {
|
|
|
6473
6479
|
if (index < 0) {
|
|
6474
6480
|
index = nativeMax$1(length + index, 0);
|
|
6475
6481
|
}
|
|
6476
|
-
return baseFindIndex(array, baseIteratee$
|
|
6482
|
+
return baseFindIndex(array, baseIteratee$2(predicate), index);
|
|
6477
6483
|
}
|
|
6478
6484
|
|
|
6479
|
-
var findIndex_1 = findIndex
|
|
6485
|
+
var findIndex_1 = findIndex;
|
|
6480
6486
|
|
|
6481
6487
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
6482
6488
|
|
|
@@ -6509,7 +6515,7 @@ function baseRange$1(start, end, step, fromRight) {
|
|
|
6509
6515
|
var _baseRange = baseRange$1;
|
|
6510
6516
|
|
|
6511
6517
|
var eq$1 = eq_1,
|
|
6512
|
-
isArrayLike$
|
|
6518
|
+
isArrayLike$2 = isArrayLike_1,
|
|
6513
6519
|
isIndex = _isIndex,
|
|
6514
6520
|
isObject$1 = isObject_1;
|
|
6515
6521
|
|
|
@@ -6529,7 +6535,7 @@ function isIterateeCall$3(value, index, object) {
|
|
|
6529
6535
|
}
|
|
6530
6536
|
var type = typeof index;
|
|
6531
6537
|
if (type == 'number'
|
|
6532
|
-
? (isArrayLike$
|
|
6538
|
+
? (isArrayLike$2(object) && isIndex(index, object.length))
|
|
6533
6539
|
: (type == 'string' && index in object)
|
|
6534
6540
|
) {
|
|
6535
6541
|
return eq$1(object[index], value);
|
|
@@ -7037,7 +7043,7 @@ var baseFor$1 = createBaseFor();
|
|
|
7037
7043
|
var _baseFor = baseFor$1;
|
|
7038
7044
|
|
|
7039
7045
|
var baseFor = _baseFor,
|
|
7040
|
-
keys
|
|
7046
|
+
keys = keys_1;
|
|
7041
7047
|
|
|
7042
7048
|
/**
|
|
7043
7049
|
* The base implementation of `_.forOwn` without support for iteratee shorthands.
|
|
@@ -7048,12 +7054,12 @@ var baseFor = _baseFor,
|
|
|
7048
7054
|
* @returns {Object} Returns `object`.
|
|
7049
7055
|
*/
|
|
7050
7056
|
function baseForOwn$1(object, iteratee) {
|
|
7051
|
-
return object && baseFor(object, iteratee, keys
|
|
7057
|
+
return object && baseFor(object, iteratee, keys);
|
|
7052
7058
|
}
|
|
7053
7059
|
|
|
7054
7060
|
var _baseForOwn = baseForOwn$1;
|
|
7055
7061
|
|
|
7056
|
-
var isArrayLike$
|
|
7062
|
+
var isArrayLike$1 = isArrayLike_1;
|
|
7057
7063
|
|
|
7058
7064
|
/**
|
|
7059
7065
|
* Creates a `baseEach` or `baseEachRight` function.
|
|
@@ -7068,7 +7074,7 @@ function createBaseEach$1(eachFunc, fromRight) {
|
|
|
7068
7074
|
if (collection == null) {
|
|
7069
7075
|
return collection;
|
|
7070
7076
|
}
|
|
7071
|
-
if (!isArrayLike$
|
|
7077
|
+
if (!isArrayLike$1(collection)) {
|
|
7072
7078
|
return eachFunc(collection, iteratee);
|
|
7073
7079
|
}
|
|
7074
7080
|
var length = collection.length,
|
|
@@ -7128,7 +7134,7 @@ var _baseReduce = baseReduce$1;
|
|
|
7128
7134
|
|
|
7129
7135
|
var arrayReduce = _arrayReduce,
|
|
7130
7136
|
baseEach$2 = _baseEach,
|
|
7131
|
-
baseIteratee$
|
|
7137
|
+
baseIteratee$1 = _baseIteratee,
|
|
7132
7138
|
baseReduce = _baseReduce,
|
|
7133
7139
|
isArray$3 = isArray_1;
|
|
7134
7140
|
|
|
@@ -7173,7 +7179,7 @@ function reduce(collection, iteratee, accumulator) {
|
|
|
7173
7179
|
var func = isArray$3(collection) ? arrayReduce : baseReduce,
|
|
7174
7180
|
initAccum = arguments.length < 3;
|
|
7175
7181
|
|
|
7176
|
-
return func(collection, baseIteratee$
|
|
7182
|
+
return func(collection, baseIteratee$1(iteratee), accumulator, initAccum, baseEach$2);
|
|
7177
7183
|
}
|
|
7178
7184
|
|
|
7179
7185
|
var reduce_1 = reduce;
|
|
@@ -8648,138 +8654,426 @@ class OrderEditor {
|
|
|
8648
8654
|
}; }
|
|
8649
8655
|
}
|
|
8650
8656
|
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
|
|
8655
|
-
const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
|
|
8656
|
-
const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
|
|
8657
|
-
const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
|
|
8658
|
-
const GROUP_EXPAND_BTN = `group-expand`;
|
|
8659
|
-
const GROUP_EXPAND_EVENT = `groupexpandclick`;
|
|
8660
|
-
const GROUPING_ROW_TYPE = 'rgRow';
|
|
8661
|
-
|
|
8662
|
-
function getGroupValueDefault(item, prop) {
|
|
8663
|
-
return item[prop] || null;
|
|
8664
|
-
}
|
|
8665
|
-
/**
|
|
8666
|
-
* Gather data for grouping
|
|
8667
|
-
* @param array - flat data array
|
|
8668
|
-
* @param groupIds - ids of groups
|
|
8669
|
-
* @param expanded - potentially expanded items if present
|
|
8670
|
-
*/
|
|
8671
|
-
function gatherGrouping(array, groupIds, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
|
|
8672
|
-
const groupedItems = new Map();
|
|
8673
|
-
array.forEach((item, originalIndex) => {
|
|
8674
|
-
const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));
|
|
8675
|
-
const lastLevelValue = groupLevelValues.pop();
|
|
8676
|
-
let currentGroupLevel = groupedItems;
|
|
8677
|
-
groupLevelValues.forEach(value => {
|
|
8678
|
-
if (!currentGroupLevel.has(value)) {
|
|
8679
|
-
currentGroupLevel.set(value, new Map());
|
|
8680
|
-
}
|
|
8681
|
-
currentGroupLevel = currentGroupLevel.get(value);
|
|
8682
|
-
});
|
|
8683
|
-
if (!currentGroupLevel.has(lastLevelValue)) {
|
|
8684
|
-
currentGroupLevel.set(lastLevelValue, []);
|
|
8685
|
-
}
|
|
8686
|
-
const lastLevelItems = currentGroupLevel.get(lastLevelValue);
|
|
8687
|
-
lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
|
|
8688
|
-
});
|
|
8689
|
-
let itemIndex = -1;
|
|
8690
|
-
const groupingDepth = groupIds.length;
|
|
8691
|
-
// collapse all groups in the beginning
|
|
8692
|
-
const trimmed = {};
|
|
8693
|
-
// index mapping
|
|
8694
|
-
const oldNewIndexMap = {};
|
|
8695
|
-
// check if group header exists
|
|
8696
|
-
const pseudoGroupTest = {};
|
|
8697
|
-
const sourceWithGroups = [];
|
|
8698
|
-
function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
|
|
8699
|
-
const depth = parentIds.length;
|
|
8700
|
-
groupedValues.forEach((innerGroupedValues, groupId) => {
|
|
8701
|
-
const levelIds = [...parentIds, groupId];
|
|
8702
|
-
const mergedIds = levelIds.join(',');
|
|
8703
|
-
const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
|
|
8704
|
-
sourceWithGroups.push({
|
|
8705
|
-
[PSEUDO_GROUP_ITEM]: groupId,
|
|
8706
|
-
[GROUP_DEPTH]: depth,
|
|
8707
|
-
[PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
|
|
8708
|
-
[PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
|
|
8709
|
-
[GROUP_EXPANDED]: isGroupExpanded,
|
|
8710
|
-
});
|
|
8711
|
-
itemIndex += 1;
|
|
8712
|
-
if (!isGroupExpanded && depth) {
|
|
8713
|
-
trimmed[itemIndex] = true;
|
|
8714
|
-
}
|
|
8715
|
-
if (Array.isArray(innerGroupedValues)) {
|
|
8716
|
-
innerGroupedValues.forEach(value => {
|
|
8717
|
-
itemIndex += 1;
|
|
8718
|
-
if (!isGroupExpanded) {
|
|
8719
|
-
trimmed[itemIndex] = true;
|
|
8720
|
-
}
|
|
8721
|
-
oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
|
|
8722
|
-
const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
|
|
8723
|
-
pseudoGroupTestIds.forEach(pseudoGroupTestId => {
|
|
8724
|
-
if (!pseudoGroupTest[pseudoGroupTestId]) {
|
|
8725
|
-
pseudoGroupTest[pseudoGroupTestId] = [];
|
|
8726
|
-
}
|
|
8727
|
-
pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
|
|
8728
|
-
});
|
|
8729
|
-
});
|
|
8730
|
-
sourceWithGroups.push(...innerGroupedValues);
|
|
8731
|
-
}
|
|
8732
|
-
else {
|
|
8733
|
-
flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
|
|
8734
|
-
}
|
|
8735
|
-
});
|
|
8657
|
+
function getCellData(val) {
|
|
8658
|
+
if (typeof val === 'undefined' || val === null) {
|
|
8659
|
+
return '';
|
|
8736
8660
|
}
|
|
8737
|
-
|
|
8738
|
-
return {
|
|
8739
|
-
sourceWithGroups, // updates source mirror
|
|
8740
|
-
depth: groupingDepth, // largest depth for grouping
|
|
8741
|
-
trimmed, // used for expand/collapse grouping values
|
|
8742
|
-
oldNewIndexMap, // used for mapping old values to new
|
|
8743
|
-
childrenByGroup: pseudoGroupTest, // used to get child items in group
|
|
8744
|
-
};
|
|
8745
|
-
}
|
|
8746
|
-
function getGroupingName(rgRow) {
|
|
8747
|
-
return rgRow && rgRow[PSEUDO_GROUP_ITEM];
|
|
8748
|
-
}
|
|
8749
|
-
function isGrouping(rgRow) {
|
|
8750
|
-
return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
|
|
8661
|
+
return val;
|
|
8751
8662
|
}
|
|
8752
|
-
function
|
|
8753
|
-
|
|
8663
|
+
function getCellDataParsed(model, column) {
|
|
8664
|
+
const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];
|
|
8665
|
+
return getCellData(val);
|
|
8754
8666
|
}
|
|
8755
|
-
function
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
for (; i < ln; i++) {
|
|
8759
|
-
if (groupA[i] !== groupB[i]) {
|
|
8760
|
-
return i;
|
|
8761
|
-
}
|
|
8667
|
+
function getColumnType(rgCol) {
|
|
8668
|
+
if (rgCol.pin) {
|
|
8669
|
+
return rgCol.pin;
|
|
8762
8670
|
}
|
|
8763
|
-
return
|
|
8671
|
+
return 'rgCol';
|
|
8764
8672
|
}
|
|
8765
|
-
function
|
|
8766
|
-
const
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8673
|
+
function getColumnSizes(cols) {
|
|
8674
|
+
const res = {};
|
|
8675
|
+
for (const [i, c] of cols.entries()) {
|
|
8676
|
+
if (c.size) {
|
|
8677
|
+
res[i] = c.size;
|
|
8678
|
+
}
|
|
8770
8679
|
}
|
|
8771
|
-
return
|
|
8680
|
+
return res;
|
|
8772
8681
|
}
|
|
8773
|
-
|
|
8774
|
-
|
|
8775
|
-
|
|
8776
|
-
|
|
8777
|
-
|
|
8778
|
-
}
|
|
8779
|
-
const depth = measureEqualDepth(currentGroup, nextGroup);
|
|
8780
|
-
return currentModel[GROUP_DEPTH] < depth;
|
|
8682
|
+
/**
|
|
8683
|
+
* Check if column is grouping column
|
|
8684
|
+
*/
|
|
8685
|
+
function isColGrouping(colData) {
|
|
8686
|
+
return !!colData.children;
|
|
8781
8687
|
}
|
|
8782
|
-
|
|
8688
|
+
/**
|
|
8689
|
+
* This function is used to create a collection of columns.
|
|
8690
|
+
*/
|
|
8691
|
+
function getColumns(columns, level = 0, types) {
|
|
8692
|
+
const collection = {
|
|
8693
|
+
// columns as they are in stores per type
|
|
8694
|
+
columns: {
|
|
8695
|
+
rgCol: [],
|
|
8696
|
+
colPinStart: [],
|
|
8697
|
+
colPinEnd: [],
|
|
8698
|
+
},
|
|
8699
|
+
// columns indexed by prop for quick access
|
|
8700
|
+
columnByProp: {},
|
|
8701
|
+
// column grouping
|
|
8702
|
+
columnGrouping: {
|
|
8703
|
+
rgCol: [],
|
|
8704
|
+
colPinStart: [],
|
|
8705
|
+
colPinEnd: [],
|
|
8706
|
+
},
|
|
8707
|
+
// max depth level for column grouping
|
|
8708
|
+
maxLevel: level,
|
|
8709
|
+
// sorting
|
|
8710
|
+
sort: {},
|
|
8711
|
+
};
|
|
8712
|
+
return reduce_1(columns, (res, colData) => {
|
|
8713
|
+
// Grouped column
|
|
8714
|
+
if (isColGrouping(colData)) {
|
|
8715
|
+
return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
|
|
8716
|
+
}
|
|
8717
|
+
// Regular column
|
|
8718
|
+
const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
|
|
8719
|
+
// Regular column, no Pin
|
|
8720
|
+
if (!regularColumn.pin) {
|
|
8721
|
+
res.columns.rgCol.push(regularColumn);
|
|
8722
|
+
// Pin
|
|
8723
|
+
}
|
|
8724
|
+
else {
|
|
8725
|
+
res.columns[regularColumn.pin].push(regularColumn);
|
|
8726
|
+
}
|
|
8727
|
+
if (regularColumn.order) {
|
|
8728
|
+
res.sort[regularColumn.prop] = regularColumn;
|
|
8729
|
+
}
|
|
8730
|
+
// it's possible that some columns have same prop, but better to avoid it
|
|
8731
|
+
if (!res.columnByProp[regularColumn.prop]) {
|
|
8732
|
+
res.columnByProp[regularColumn.prop] = [];
|
|
8733
|
+
}
|
|
8734
|
+
res.columnByProp[regularColumn.prop].push(regularColumn);
|
|
8735
|
+
// trigger setup hook if present
|
|
8736
|
+
regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
|
|
8737
|
+
return res;
|
|
8738
|
+
}, collection);
|
|
8739
|
+
}
|
|
8740
|
+
function gatherGroup(res, colData, collection, level = 0) {
|
|
8741
|
+
// group template
|
|
8742
|
+
const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
|
|
8743
|
+
// check columns for update
|
|
8744
|
+
for (let k in collection.columns) {
|
|
8745
|
+
const key = k;
|
|
8746
|
+
const resultItem = res.columns[key];
|
|
8747
|
+
const collectionItem = collection.columns[key];
|
|
8748
|
+
// if column data
|
|
8749
|
+
if (isArray_1(resultItem) && isArray_1(collectionItem)) {
|
|
8750
|
+
// fill columns
|
|
8751
|
+
resultItem.push(...collectionItem);
|
|
8752
|
+
// fill grouping
|
|
8753
|
+
if (collectionItem.length) {
|
|
8754
|
+
res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
|
|
8755
|
+
}
|
|
8756
|
+
}
|
|
8757
|
+
}
|
|
8758
|
+
// merge column groupings
|
|
8759
|
+
for (let k in collection.columnGrouping) {
|
|
8760
|
+
const key = k;
|
|
8761
|
+
const collectionItem = collection.columnGrouping[key];
|
|
8762
|
+
res.columnGrouping[key].push(...collectionItem);
|
|
8763
|
+
}
|
|
8764
|
+
res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
|
|
8765
|
+
res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
|
|
8766
|
+
return res;
|
|
8767
|
+
}
|
|
8768
|
+
function findColumn(columns, prop) {
|
|
8769
|
+
for (const c of columns) {
|
|
8770
|
+
if (isColGrouping(c)) {
|
|
8771
|
+
const found = findColumn(c.children, prop);
|
|
8772
|
+
if (found) {
|
|
8773
|
+
return found;
|
|
8774
|
+
}
|
|
8775
|
+
}
|
|
8776
|
+
else if (c.prop === prop) {
|
|
8777
|
+
return c;
|
|
8778
|
+
}
|
|
8779
|
+
}
|
|
8780
|
+
return undefined;
|
|
8781
|
+
}
|
|
8782
|
+
function getColumnByProp(columns, prop) {
|
|
8783
|
+
return findColumn(columns, prop);
|
|
8784
|
+
}
|
|
8785
|
+
|
|
8786
|
+
var codes;
|
|
8787
|
+
(function (codes) {
|
|
8788
|
+
codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
|
|
8789
|
+
codes[codes["MOUSE_RIGHT"] = 3] = "MOUSE_RIGHT";
|
|
8790
|
+
codes[codes["MOUSE_MIDDLE"] = 2] = "MOUSE_MIDDLE";
|
|
8791
|
+
codes[codes["BACKSPACE"] = 8] = "BACKSPACE";
|
|
8792
|
+
codes[codes["COMMA"] = 188] = "COMMA";
|
|
8793
|
+
codes[codes["INSERT"] = 45] = "INSERT";
|
|
8794
|
+
codes[codes["DELETE"] = 46] = "DELETE";
|
|
8795
|
+
codes[codes["END"] = 35] = "END";
|
|
8796
|
+
codes[codes["ENTER"] = 13] = "ENTER";
|
|
8797
|
+
codes[codes["ESCAPE"] = 27] = "ESCAPE";
|
|
8798
|
+
codes[codes["CONTROL"] = 17] = "CONTROL";
|
|
8799
|
+
codes[codes["COMMAND_LEFT"] = 91] = "COMMAND_LEFT";
|
|
8800
|
+
codes[codes["COMMAND_RIGHT"] = 93] = "COMMAND_RIGHT";
|
|
8801
|
+
codes[codes["COMMAND_FIREFOX"] = 224] = "COMMAND_FIREFOX";
|
|
8802
|
+
codes[codes["ALT"] = 18] = "ALT";
|
|
8803
|
+
codes[codes["HOME"] = 36] = "HOME";
|
|
8804
|
+
codes[codes["PAGE_DOWN"] = 34] = "PAGE_DOWN";
|
|
8805
|
+
codes[codes["PAGE_UP"] = 33] = "PAGE_UP";
|
|
8806
|
+
codes[codes["PERIOD"] = 190] = "PERIOD";
|
|
8807
|
+
codes[codes["SPACE"] = 32] = "SPACE";
|
|
8808
|
+
codes[codes["SHIFT"] = 16] = "SHIFT";
|
|
8809
|
+
codes[codes["CAPS_LOCK"] = 20] = "CAPS_LOCK";
|
|
8810
|
+
codes[codes["TAB"] = 9] = "TAB";
|
|
8811
|
+
codes[codes["ARROW_RIGHT"] = 39] = "ARROW_RIGHT";
|
|
8812
|
+
codes[codes["ARROW_LEFT"] = 37] = "ARROW_LEFT";
|
|
8813
|
+
codes[codes["ARROW_UP"] = 38] = "ARROW_UP";
|
|
8814
|
+
codes[codes["ARROW_DOWN"] = 40] = "ARROW_DOWN";
|
|
8815
|
+
codes[codes["F1"] = 112] = "F1";
|
|
8816
|
+
codes[codes["F2"] = 113] = "F2";
|
|
8817
|
+
codes[codes["F3"] = 114] = "F3";
|
|
8818
|
+
codes[codes["F4"] = 115] = "F4";
|
|
8819
|
+
codes[codes["F5"] = 116] = "F5";
|
|
8820
|
+
codes[codes["F6"] = 117] = "F6";
|
|
8821
|
+
codes[codes["F7"] = 118] = "F7";
|
|
8822
|
+
codes[codes["F8"] = 119] = "F8";
|
|
8823
|
+
codes[codes["F9"] = 120] = "F9";
|
|
8824
|
+
codes[codes["F10"] = 121] = "F10";
|
|
8825
|
+
codes[codes["F11"] = 122] = "F11";
|
|
8826
|
+
codes[codes["F12"] = 123] = "F12";
|
|
8827
|
+
codes[codes["A"] = 65] = "A";
|
|
8828
|
+
codes[codes["C"] = 67] = "C";
|
|
8829
|
+
codes[codes["D"] = 68] = "D";
|
|
8830
|
+
codes[codes["F"] = 70] = "F";
|
|
8831
|
+
codes[codes["L"] = 76] = "L";
|
|
8832
|
+
codes[codes["O"] = 79] = "O";
|
|
8833
|
+
codes[codes["P"] = 80] = "P";
|
|
8834
|
+
codes[codes["S"] = 83] = "S";
|
|
8835
|
+
codes[codes["V"] = 86] = "V";
|
|
8836
|
+
codes[codes["X"] = 88] = "X";
|
|
8837
|
+
})(codes || (codes = {}));
|
|
8838
|
+
var codesLetter;
|
|
8839
|
+
(function (codesLetter) {
|
|
8840
|
+
codesLetter["ENTER"] = "Enter";
|
|
8841
|
+
codesLetter["ENTER_NUM"] = "NumpadEnter";
|
|
8842
|
+
codesLetter["A"] = "KeyA";
|
|
8843
|
+
codesLetter["C"] = "KeyC";
|
|
8844
|
+
codesLetter["X"] = "KeyX";
|
|
8845
|
+
codesLetter["V"] = "KeyV";
|
|
8846
|
+
codesLetter["ESCAPE"] = "Escape";
|
|
8847
|
+
codesLetter["TAB"] = "Tab";
|
|
8848
|
+
codesLetter["BACKSPACE"] = "Backspace";
|
|
8849
|
+
codesLetter["DELETE"] = "Delete";
|
|
8850
|
+
codesLetter["ARROW_RIGHT"] = "ArrowRight";
|
|
8851
|
+
codesLetter["ARROW_LEFT"] = "ArrowLeft";
|
|
8852
|
+
codesLetter["ARROW_UP"] = "ArrowUp";
|
|
8853
|
+
codesLetter["ARROW_DOWN"] = "ArrowDown";
|
|
8854
|
+
codesLetter["SHIFT"] = "Shift";
|
|
8855
|
+
})(codesLetter || (codesLetter = {}));
|
|
8856
|
+
var keyValues;
|
|
8857
|
+
(function (keyValues) {
|
|
8858
|
+
keyValues["ENTER"] = "Enter";
|
|
8859
|
+
keyValues["TAB"] = "Tab";
|
|
8860
|
+
})(keyValues || (keyValues = {}));
|
|
8861
|
+
|
|
8862
|
+
var osPlatform;
|
|
8863
|
+
(function (osPlatform) {
|
|
8864
|
+
osPlatform["mac"] = "Mac";
|
|
8865
|
+
})(osPlatform || (osPlatform = {}));
|
|
8866
|
+
|
|
8867
|
+
function isClear(code) {
|
|
8868
|
+
return codesLetter.BACKSPACE === code || codesLetter.DELETE === code;
|
|
8869
|
+
}
|
|
8870
|
+
function isTab(code) {
|
|
8871
|
+
return codesLetter.TAB === code;
|
|
8872
|
+
}
|
|
8873
|
+
function isEnterKeyValue(key) {
|
|
8874
|
+
return keyValues.ENTER === key;
|
|
8875
|
+
}
|
|
8876
|
+
function isCut(event) {
|
|
8877
|
+
return ((event.ctrlKey && event.code === 'KeyX') || // Ctrl + X on Windows
|
|
8878
|
+
(event.metaKey && event.code === 'KeyX')); // Cmd + X on Mac
|
|
8879
|
+
}
|
|
8880
|
+
function isCopy(event) {
|
|
8881
|
+
return ((event.ctrlKey && event.code === 'KeyC') || // Ctrl + C on Windows
|
|
8882
|
+
(event.metaKey && event.code === 'KeyC')); // Cmd + C on Mac
|
|
8883
|
+
}
|
|
8884
|
+
function isPaste(event) {
|
|
8885
|
+
return ((event.ctrlKey && event.code === 'KeyV') || // Ctrl + V on Windows
|
|
8886
|
+
(event.metaKey && event.code === 'KeyV')); // Cmd + V on Mac
|
|
8887
|
+
}
|
|
8888
|
+
function isAll(event) {
|
|
8889
|
+
return ((event.ctrlKey && event.code === 'KeyA') || // Ctrl + A on Windows
|
|
8890
|
+
(event.metaKey && event.code === 'KeyA')); // Cmd + A on Mac
|
|
8891
|
+
}
|
|
8892
|
+
|
|
8893
|
+
const LETTER_BLOCK_SIZE$1 = 10;
|
|
8894
|
+
const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
|
|
8895
|
+
return ((rowHeaderColumn === null || rowHeaderColumn === void 0 ? void 0 : rowHeaderColumn.size) ||
|
|
8896
|
+
Math.max((itemsLength.toString().length + 1) * LETTER_BLOCK_SIZE$1, minWidth));
|
|
8897
|
+
};
|
|
8898
|
+
|
|
8899
|
+
/**
|
|
8900
|
+
* Calculate system scrollbar size
|
|
8901
|
+
*/
|
|
8902
|
+
function getScrollbarSize(document) {
|
|
8903
|
+
// Create a temporary div container and append it to the body
|
|
8904
|
+
const container = document.createElement('div');
|
|
8905
|
+
// Apply styling to ensure the div is scrollable
|
|
8906
|
+
container.style.overflow = 'scroll';
|
|
8907
|
+
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
8908
|
+
container.style.position = 'absolute';
|
|
8909
|
+
container.style.top = '-9999px'; // move it out of the screen
|
|
8910
|
+
container.style.width = '50px'; // arbitrary width
|
|
8911
|
+
container.style.height = '50px'; // arbitrary height
|
|
8912
|
+
// Append the div to the body
|
|
8913
|
+
document.body.appendChild(container);
|
|
8914
|
+
// Calculate the width of the scrollbar
|
|
8915
|
+
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
8916
|
+
// Remove the div from the body after calculation
|
|
8917
|
+
document.body.removeChild(container);
|
|
8918
|
+
// Return the calculated width of the scrollbar
|
|
8919
|
+
return scrollbarWidth;
|
|
8920
|
+
}
|
|
8921
|
+
/* Scale a value between 2 ranges
|
|
8922
|
+
*
|
|
8923
|
+
* Sample:
|
|
8924
|
+
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
8925
|
+
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
8926
|
+
*
|
|
8927
|
+
* Ranges of two values
|
|
8928
|
+
* @from
|
|
8929
|
+
* @to
|
|
8930
|
+
*
|
|
8931
|
+
* ~~ return value does the equivalent of Math.floor but faster.
|
|
8932
|
+
*/
|
|
8933
|
+
function scaleValue(value, from, to) {
|
|
8934
|
+
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
8935
|
+
}
|
|
8936
|
+
/**
|
|
8937
|
+
* Async timeout
|
|
8938
|
+
*/
|
|
8939
|
+
async function timeout(delay = 0) {
|
|
8940
|
+
await new Promise((r) => {
|
|
8941
|
+
setTimeout(() => r(), delay);
|
|
8942
|
+
});
|
|
8943
|
+
}
|
|
8944
|
+
|
|
8945
|
+
const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
|
|
8946
|
+
const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
|
|
8947
|
+
const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;
|
|
8948
|
+
const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
|
|
8949
|
+
const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
|
|
8950
|
+
const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
|
|
8951
|
+
const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
|
|
8952
|
+
const GROUP_EXPAND_BTN = `group-expand`;
|
|
8953
|
+
const GROUP_EXPAND_EVENT = `groupexpandclick`;
|
|
8954
|
+
const GROUPING_ROW_TYPE = 'rgRow';
|
|
8955
|
+
|
|
8956
|
+
function getGroupValueDefault(item, prop) {
|
|
8957
|
+
return item[prop] || null;
|
|
8958
|
+
}
|
|
8959
|
+
/**
|
|
8960
|
+
* Gather data for grouping
|
|
8961
|
+
* @param array - flat data array
|
|
8962
|
+
* @param groupIds - ids of groups
|
|
8963
|
+
* @param expanded - potentially expanded items if present
|
|
8964
|
+
*/
|
|
8965
|
+
function gatherGrouping(array, groupIds, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
|
|
8966
|
+
const groupedItems = new Map();
|
|
8967
|
+
array.forEach((item, originalIndex) => {
|
|
8968
|
+
const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));
|
|
8969
|
+
const lastLevelValue = groupLevelValues.pop();
|
|
8970
|
+
let currentGroupLevel = groupedItems;
|
|
8971
|
+
groupLevelValues.forEach(value => {
|
|
8972
|
+
if (!currentGroupLevel.has(value)) {
|
|
8973
|
+
currentGroupLevel.set(value, new Map());
|
|
8974
|
+
}
|
|
8975
|
+
currentGroupLevel = currentGroupLevel.get(value);
|
|
8976
|
+
});
|
|
8977
|
+
if (!currentGroupLevel.has(lastLevelValue)) {
|
|
8978
|
+
currentGroupLevel.set(lastLevelValue, []);
|
|
8979
|
+
}
|
|
8980
|
+
const lastLevelItems = currentGroupLevel.get(lastLevelValue);
|
|
8981
|
+
lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
|
|
8982
|
+
});
|
|
8983
|
+
let itemIndex = -1;
|
|
8984
|
+
const groupingDepth = groupIds.length;
|
|
8985
|
+
// collapse all groups in the beginning
|
|
8986
|
+
const trimmed = {};
|
|
8987
|
+
// index mapping
|
|
8988
|
+
const oldNewIndexMap = {};
|
|
8989
|
+
// check if group header exists
|
|
8990
|
+
const pseudoGroupTest = {};
|
|
8991
|
+
const sourceWithGroups = [];
|
|
8992
|
+
function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
|
|
8993
|
+
const depth = parentIds.length;
|
|
8994
|
+
groupedValues.forEach((innerGroupedValues, groupId) => {
|
|
8995
|
+
const levelIds = [...parentIds, groupId];
|
|
8996
|
+
const mergedIds = levelIds.join(',');
|
|
8997
|
+
const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
|
|
8998
|
+
sourceWithGroups.push({
|
|
8999
|
+
[PSEUDO_GROUP_ITEM]: groupId,
|
|
9000
|
+
[GROUP_DEPTH]: depth,
|
|
9001
|
+
[PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
|
|
9002
|
+
[PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
|
|
9003
|
+
[GROUP_EXPANDED]: isGroupExpanded,
|
|
9004
|
+
});
|
|
9005
|
+
itemIndex += 1;
|
|
9006
|
+
if (!isGroupExpanded && depth) {
|
|
9007
|
+
trimmed[itemIndex] = true;
|
|
9008
|
+
}
|
|
9009
|
+
if (Array.isArray(innerGroupedValues)) {
|
|
9010
|
+
innerGroupedValues.forEach(value => {
|
|
9011
|
+
itemIndex += 1;
|
|
9012
|
+
if (!isGroupExpanded) {
|
|
9013
|
+
trimmed[itemIndex] = true;
|
|
9014
|
+
}
|
|
9015
|
+
oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
|
|
9016
|
+
const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
|
|
9017
|
+
pseudoGroupTestIds.forEach(pseudoGroupTestId => {
|
|
9018
|
+
if (!pseudoGroupTest[pseudoGroupTestId]) {
|
|
9019
|
+
pseudoGroupTest[pseudoGroupTestId] = [];
|
|
9020
|
+
}
|
|
9021
|
+
pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
|
|
9022
|
+
});
|
|
9023
|
+
});
|
|
9024
|
+
sourceWithGroups.push(...innerGroupedValues);
|
|
9025
|
+
}
|
|
9026
|
+
else {
|
|
9027
|
+
flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
|
|
9028
|
+
}
|
|
9029
|
+
});
|
|
9030
|
+
}
|
|
9031
|
+
flattenGroupMaps(groupedItems, [], true);
|
|
9032
|
+
return {
|
|
9033
|
+
sourceWithGroups, // updates source mirror
|
|
9034
|
+
depth: groupingDepth, // largest depth for grouping
|
|
9035
|
+
trimmed, // used for expand/collapse grouping values
|
|
9036
|
+
oldNewIndexMap, // used for mapping old values to new
|
|
9037
|
+
childrenByGroup: pseudoGroupTest, // used to get child items in group
|
|
9038
|
+
};
|
|
9039
|
+
}
|
|
9040
|
+
function getGroupingName(rgRow) {
|
|
9041
|
+
return rgRow && rgRow[PSEUDO_GROUP_ITEM];
|
|
9042
|
+
}
|
|
9043
|
+
function isGrouping(rgRow) {
|
|
9044
|
+
return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
|
|
9045
|
+
}
|
|
9046
|
+
function isGroupingColumn(column) {
|
|
9047
|
+
return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';
|
|
9048
|
+
}
|
|
9049
|
+
function measureEqualDepth(groupA, groupB) {
|
|
9050
|
+
const ln = groupA.length;
|
|
9051
|
+
let i = 0;
|
|
9052
|
+
for (; i < ln; i++) {
|
|
9053
|
+
if (groupA[i] !== groupB[i]) {
|
|
9054
|
+
return i;
|
|
9055
|
+
}
|
|
9056
|
+
}
|
|
9057
|
+
return i;
|
|
9058
|
+
}
|
|
9059
|
+
function getParsedGroup(id) {
|
|
9060
|
+
const parseGroup = JSON.parse(id);
|
|
9061
|
+
// extra precaution and type safeguard
|
|
9062
|
+
if (!Array.isArray(parseGroup)) {
|
|
9063
|
+
return null;
|
|
9064
|
+
}
|
|
9065
|
+
return parseGroup;
|
|
9066
|
+
}
|
|
9067
|
+
// check if items is child of current clicked group
|
|
9068
|
+
function isSameGroup(currentGroup, currentModel, nextModel) {
|
|
9069
|
+
const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);
|
|
9070
|
+
if (!nextGroup) {
|
|
9071
|
+
return false;
|
|
9072
|
+
}
|
|
9073
|
+
const depth = measureEqualDepth(currentGroup, nextGroup);
|
|
9074
|
+
return currentModel[GROUP_DEPTH] < depth;
|
|
9075
|
+
}
|
|
9076
|
+
|
|
8783
9077
|
/**
|
|
8784
9078
|
* The base implementation of `_.slice` without an iteratee call guard.
|
|
8785
9079
|
*
|
|
@@ -8883,11 +9177,10 @@ class ColumnService {
|
|
|
8883
9177
|
return !!readOnly;
|
|
8884
9178
|
}
|
|
8885
9179
|
mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
|
|
8886
|
-
const
|
|
8887
|
-
|
|
8888
|
-
[
|
|
8889
|
-
|
|
8890
|
-
let props = Object.assign(Object.assign({}, defaultProps), { class: cellClass });
|
|
9180
|
+
const props = Object.assign({}, defaultProps);
|
|
9181
|
+
props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
|
|
9182
|
+
? { [props.class]: true }
|
|
9183
|
+
: props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
|
|
8891
9184
|
const extra = extraPropsFunc === null || extraPropsFunc === void 0 ? void 0 : extraPropsFunc(model);
|
|
8892
9185
|
if (!extra) {
|
|
8893
9186
|
return props;
|
|
@@ -8903,10 +9196,10 @@ class ColumnService {
|
|
|
8903
9196
|
return getCellData(data.model[data.prop]);
|
|
8904
9197
|
}
|
|
8905
9198
|
getSaveData(rowIndex, colIndex, val) {
|
|
9199
|
+
const data = this.rowDataModel(rowIndex, colIndex);
|
|
8906
9200
|
if (typeof val === 'undefined') {
|
|
8907
|
-
val =
|
|
9201
|
+
val = getCellData(data.model[data.prop]);
|
|
8908
9202
|
}
|
|
8909
|
-
const data = this.rowDataModel(rowIndex, colIndex);
|
|
8910
9203
|
return {
|
|
8911
9204
|
prop: data.prop,
|
|
8912
9205
|
rowIndex,
|
|
@@ -9108,124 +9401,47 @@ class ColumnService {
|
|
|
9108
9401
|
}
|
|
9109
9402
|
return {
|
|
9110
9403
|
data: toCopy,
|
|
9111
|
-
mapping,
|
|
9112
|
-
};
|
|
9113
|
-
}
|
|
9114
|
-
destroy() {
|
|
9115
|
-
this.unsubscribe.forEach(f => f());
|
|
9116
|
-
}
|
|
9117
|
-
}
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
function
|
|
9128
|
-
if (typeof
|
|
9129
|
-
|
|
9130
|
-
}
|
|
9131
|
-
|
|
9132
|
-
}
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9151
|
-
|
|
9152
|
-
}
|
|
9153
|
-
|
|
9154
|
-
var codes;
|
|
9155
|
-
(function (codes) {
|
|
9156
|
-
codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
|
|
9157
|
-
codes[codes["MOUSE_RIGHT"] = 3] = "MOUSE_RIGHT";
|
|
9158
|
-
codes[codes["MOUSE_MIDDLE"] = 2] = "MOUSE_MIDDLE";
|
|
9159
|
-
codes[codes["BACKSPACE"] = 8] = "BACKSPACE";
|
|
9160
|
-
codes[codes["COMMA"] = 188] = "COMMA";
|
|
9161
|
-
codes[codes["INSERT"] = 45] = "INSERT";
|
|
9162
|
-
codes[codes["DELETE"] = 46] = "DELETE";
|
|
9163
|
-
codes[codes["END"] = 35] = "END";
|
|
9164
|
-
codes[codes["ENTER"] = 13] = "ENTER";
|
|
9165
|
-
codes[codes["ESCAPE"] = 27] = "ESCAPE";
|
|
9166
|
-
codes[codes["CONTROL"] = 17] = "CONTROL";
|
|
9167
|
-
codes[codes["COMMAND_LEFT"] = 91] = "COMMAND_LEFT";
|
|
9168
|
-
codes[codes["COMMAND_RIGHT"] = 93] = "COMMAND_RIGHT";
|
|
9169
|
-
codes[codes["COMMAND_FIREFOX"] = 224] = "COMMAND_FIREFOX";
|
|
9170
|
-
codes[codes["ALT"] = 18] = "ALT";
|
|
9171
|
-
codes[codes["HOME"] = 36] = "HOME";
|
|
9172
|
-
codes[codes["PAGE_DOWN"] = 34] = "PAGE_DOWN";
|
|
9173
|
-
codes[codes["PAGE_UP"] = 33] = "PAGE_UP";
|
|
9174
|
-
codes[codes["PERIOD"] = 190] = "PERIOD";
|
|
9175
|
-
codes[codes["SPACE"] = 32] = "SPACE";
|
|
9176
|
-
codes[codes["SHIFT"] = 16] = "SHIFT";
|
|
9177
|
-
codes[codes["CAPS_LOCK"] = 20] = "CAPS_LOCK";
|
|
9178
|
-
codes[codes["TAB"] = 9] = "TAB";
|
|
9179
|
-
codes[codes["ARROW_RIGHT"] = 39] = "ARROW_RIGHT";
|
|
9180
|
-
codes[codes["ARROW_LEFT"] = 37] = "ARROW_LEFT";
|
|
9181
|
-
codes[codes["ARROW_UP"] = 38] = "ARROW_UP";
|
|
9182
|
-
codes[codes["ARROW_DOWN"] = 40] = "ARROW_DOWN";
|
|
9183
|
-
codes[codes["F1"] = 112] = "F1";
|
|
9184
|
-
codes[codes["F2"] = 113] = "F2";
|
|
9185
|
-
codes[codes["F3"] = 114] = "F3";
|
|
9186
|
-
codes[codes["F4"] = 115] = "F4";
|
|
9187
|
-
codes[codes["F5"] = 116] = "F5";
|
|
9188
|
-
codes[codes["F6"] = 117] = "F6";
|
|
9189
|
-
codes[codes["F7"] = 118] = "F7";
|
|
9190
|
-
codes[codes["F8"] = 119] = "F8";
|
|
9191
|
-
codes[codes["F9"] = 120] = "F9";
|
|
9192
|
-
codes[codes["F10"] = 121] = "F10";
|
|
9193
|
-
codes[codes["F11"] = 122] = "F11";
|
|
9194
|
-
codes[codes["F12"] = 123] = "F12";
|
|
9195
|
-
codes[codes["A"] = 65] = "A";
|
|
9196
|
-
codes[codes["C"] = 67] = "C";
|
|
9197
|
-
codes[codes["D"] = 68] = "D";
|
|
9198
|
-
codes[codes["F"] = 70] = "F";
|
|
9199
|
-
codes[codes["L"] = 76] = "L";
|
|
9200
|
-
codes[codes["O"] = 79] = "O";
|
|
9201
|
-
codes[codes["P"] = 80] = "P";
|
|
9202
|
-
codes[codes["S"] = 83] = "S";
|
|
9203
|
-
codes[codes["V"] = 86] = "V";
|
|
9204
|
-
codes[codes["X"] = 88] = "X";
|
|
9205
|
-
})(codes || (codes = {}));
|
|
9206
|
-
var codesLetter;
|
|
9207
|
-
(function (codesLetter) {
|
|
9208
|
-
codesLetter["ENTER"] = "Enter";
|
|
9209
|
-
codesLetter["ENTER_NUM"] = "NumpadEnter";
|
|
9210
|
-
codesLetter["A"] = "KeyA";
|
|
9211
|
-
codesLetter["C"] = "KeyC";
|
|
9212
|
-
codesLetter["X"] = "KeyX";
|
|
9213
|
-
codesLetter["V"] = "KeyV";
|
|
9214
|
-
codesLetter["ESCAPE"] = "Escape";
|
|
9215
|
-
codesLetter["TAB"] = "Tab";
|
|
9216
|
-
codesLetter["BACKSPACE"] = "Backspace";
|
|
9217
|
-
codesLetter["DELETE"] = "Delete";
|
|
9218
|
-
codesLetter["ARROW_RIGHT"] = "ArrowRight";
|
|
9219
|
-
codesLetter["ARROW_LEFT"] = "ArrowLeft";
|
|
9220
|
-
codesLetter["ARROW_UP"] = "ArrowUp";
|
|
9221
|
-
codesLetter["ARROW_DOWN"] = "ArrowDown";
|
|
9222
|
-
codesLetter["SHIFT"] = "Shift";
|
|
9223
|
-
})(codesLetter || (codesLetter = {}));
|
|
9224
|
-
var keyValues;
|
|
9225
|
-
(function (keyValues) {
|
|
9226
|
-
keyValues["ENTER"] = "Enter";
|
|
9227
|
-
keyValues["TAB"] = "Tab";
|
|
9228
|
-
})(keyValues || (keyValues = {}));
|
|
9404
|
+
mapping,
|
|
9405
|
+
};
|
|
9406
|
+
}
|
|
9407
|
+
destroy() {
|
|
9408
|
+
this.unsubscribe.forEach(f => f());
|
|
9409
|
+
}
|
|
9410
|
+
}
|
|
9411
|
+
/**
|
|
9412
|
+
* Checks if the given rowDrag is a service for dragging rows.
|
|
9413
|
+
*/
|
|
9414
|
+
function isRowDragService(rowDrag, model) {
|
|
9415
|
+
if (typeof rowDrag === 'function') {
|
|
9416
|
+
return rowDrag(model);
|
|
9417
|
+
}
|
|
9418
|
+
return !!rowDrag;
|
|
9419
|
+
}
|
|
9420
|
+
function mergeClasses(class1 = {}, class2 = {}) {
|
|
9421
|
+
if (typeof class1 === 'string') {
|
|
9422
|
+
class1 = { [class1]: true };
|
|
9423
|
+
}
|
|
9424
|
+
if (typeof class2 === 'string') {
|
|
9425
|
+
class2 = { [class2]: true };
|
|
9426
|
+
}
|
|
9427
|
+
return Object.assign(Object.assign({}, class1), class2);
|
|
9428
|
+
}
|
|
9429
|
+
function doPropMerge(existing, extra) {
|
|
9430
|
+
// if className is provided - remove it from props it messing with stencil
|
|
9431
|
+
if (extra.className) {
|
|
9432
|
+
extra.class = mergeClasses(extra.class, extra.className);
|
|
9433
|
+
delete extra.className;
|
|
9434
|
+
}
|
|
9435
|
+
let props = Object.assign(Object.assign({}, extra), existing);
|
|
9436
|
+
// extend existing props
|
|
9437
|
+
if (extra.class) {
|
|
9438
|
+
props.class = mergeClasses(props.class, extra.class);
|
|
9439
|
+
}
|
|
9440
|
+
if (extra.style) {
|
|
9441
|
+
props.style = Object.assign(Object.assign({}, extra.style), props.style);
|
|
9442
|
+
}
|
|
9443
|
+
return props;
|
|
9444
|
+
}
|
|
9229
9445
|
|
|
9230
9446
|
function isTouch(e) {
|
|
9231
9447
|
return !!e.touches;
|
|
@@ -9302,311 +9518,109 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
|
9302
9518
|
let cellX = x - left;
|
|
9303
9519
|
// Limit the cell position to the element height
|
|
9304
9520
|
if (cellY >= height) {
|
|
9305
|
-
cellY = height - 1;
|
|
9306
|
-
}
|
|
9307
|
-
// Limit the cell position to the element width
|
|
9308
|
-
if (cellX >= width) {
|
|
9309
|
-
cellX = width - 1;
|
|
9310
|
-
}
|
|
9311
|
-
// Get the row and column items based on the cell position
|
|
9312
|
-
const rgRow = getItemByPosition(rows, cellY);
|
|
9313
|
-
const rgCol = getItemByPosition(cols, cellX);
|
|
9314
|
-
// Set the row and column index to 0 if they are before the first item
|
|
9315
|
-
if (rgCol.itemIndex < 0) {
|
|
9316
|
-
rgCol.itemIndex = 0;
|
|
9317
|
-
}
|
|
9318
|
-
if (rgRow.itemIndex < 0) {
|
|
9319
|
-
rgRow.itemIndex = 0;
|
|
9320
|
-
}
|
|
9321
|
-
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9322
|
-
}
|
|
9323
|
-
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9324
|
-
const updateCoordinate = (c, pos = 0) => {
|
|
9325
|
-
const start = { x: range.x, y: range.y };
|
|
9326
|
-
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9327
|
-
const point = end[c] > focus[c] ? end : start;
|
|
9328
|
-
point[c] += pos;
|
|
9329
|
-
return { start, end };
|
|
9330
|
-
};
|
|
9331
|
-
if (changes.x) {
|
|
9332
|
-
return updateCoordinate('x', changes['x']);
|
|
9333
|
-
}
|
|
9334
|
-
if (changes.y) {
|
|
9335
|
-
return updateCoordinate('y', changes['y']);
|
|
9336
|
-
}
|
|
9337
|
-
return null;
|
|
9338
|
-
}
|
|
9339
|
-
/**
|
|
9340
|
-
* Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position
|
|
9341
|
-
* or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position
|
|
9342
|
-
*/
|
|
9343
|
-
function isAfterLast({ x, y }, lastCell) {
|
|
9344
|
-
return x >= lastCell.x || y >= lastCell.y;
|
|
9345
|
-
}
|
|
9346
|
-
/** check if out of range */
|
|
9347
|
-
function isBeforeFirst({ x, y }) {
|
|
9348
|
-
return x < 0 || y < 0;
|
|
9349
|
-
}
|
|
9350
|
-
/** Compare cells, only 1 coordinate difference is possible */
|
|
9351
|
-
// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9352
|
-
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9353
|
-
// for (let k of c) {
|
|
9354
|
-
// if (initial[k] !== last[k]) {
|
|
9355
|
-
// return { [k]: 1 };
|
|
9356
|
-
// }
|
|
9357
|
-
// }
|
|
9358
|
-
// return null;
|
|
9359
|
-
// }
|
|
9360
|
-
// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9361
|
-
// const cell: Partial<Cell> = {};
|
|
9362
|
-
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9363
|
-
// for (let k of c) {
|
|
9364
|
-
// cell[k] = Math.abs(initial[k] - last[k]);
|
|
9365
|
-
// }
|
|
9366
|
-
// if (cell.x > cell.y) {
|
|
9367
|
-
// return { x: 1 };
|
|
9368
|
-
// }
|
|
9369
|
-
// if (cell.y > cell.x) {
|
|
9370
|
-
// return { y: 1 };
|
|
9371
|
-
// }
|
|
9372
|
-
// return null;
|
|
9373
|
-
// }
|
|
9374
|
-
function styleByCellProps(styles) {
|
|
9375
|
-
return {
|
|
9376
|
-
left: `${styles.left}px`,
|
|
9377
|
-
top: `${styles.top}px`,
|
|
9378
|
-
width: `${styles.width}px`,
|
|
9379
|
-
height: `${styles.height}px`,
|
|
9380
|
-
};
|
|
9381
|
-
}
|
|
9382
|
-
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
9383
|
-
const top = getItemByIndex(dimensionRow, y).start;
|
|
9384
|
-
const left = getItemByIndex(dimensionCol, x).start;
|
|
9385
|
-
const bottom = getItemByIndex(dimensionRow, y1).end;
|
|
9386
|
-
const right = getItemByIndex(dimensionCol, x1).end;
|
|
9387
|
-
return {
|
|
9388
|
-
left,
|
|
9389
|
-
right,
|
|
9390
|
-
top,
|
|
9391
|
-
bottom,
|
|
9392
|
-
width: right - left,
|
|
9393
|
-
height: bottom - top,
|
|
9394
|
-
};
|
|
9395
|
-
}
|
|
9396
|
-
function getElStyle(range, dimensionRow, dimensionCol) {
|
|
9397
|
-
const styles = getCell(range, dimensionRow, dimensionCol);
|
|
9398
|
-
return styleByCellProps(styles);
|
|
9399
|
-
}
|
|
9400
|
-
|
|
9401
|
-
// is edit input
|
|
9402
|
-
function isEditInput(el) {
|
|
9403
|
-
return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
|
|
9404
|
-
}
|
|
9405
|
-
// Type guard for EditorCtrConstructible
|
|
9406
|
-
function isEditorCtrConstructible(editor) {
|
|
9407
|
-
return typeof editor === 'function' && typeof editor.prototype === 'object';
|
|
9408
|
-
}
|
|
9409
|
-
|
|
9410
|
-
var osPlatform;
|
|
9411
|
-
(function (osPlatform) {
|
|
9412
|
-
osPlatform["mac"] = "Mac";
|
|
9413
|
-
})(osPlatform || (osPlatform = {}));
|
|
9414
|
-
|
|
9415
|
-
function isClear(code) {
|
|
9416
|
-
return codesLetter.BACKSPACE === code || codesLetter.DELETE === code;
|
|
9417
|
-
}
|
|
9418
|
-
function isTab(code) {
|
|
9419
|
-
return codesLetter.TAB === code;
|
|
9420
|
-
}
|
|
9421
|
-
function isEnterKeyValue(key) {
|
|
9422
|
-
return keyValues.ENTER === key;
|
|
9423
|
-
}
|
|
9424
|
-
function isCut(event) {
|
|
9425
|
-
return ((event.ctrlKey && event.code === 'KeyX') || // Ctrl + X on Windows
|
|
9426
|
-
(event.metaKey && event.code === 'KeyX')); // Cmd + X on Mac
|
|
9427
|
-
}
|
|
9428
|
-
function isCopy(event) {
|
|
9429
|
-
return ((event.ctrlKey && event.code === 'KeyC') || // Ctrl + C on Windows
|
|
9430
|
-
(event.metaKey && event.code === 'KeyC')); // Cmd + C on Mac
|
|
9431
|
-
}
|
|
9432
|
-
function isPaste(event) {
|
|
9433
|
-
return ((event.ctrlKey && event.code === 'KeyV') || // Ctrl + V on Windows
|
|
9434
|
-
(event.metaKey && event.code === 'KeyV')); // Cmd + V on Mac
|
|
9435
|
-
}
|
|
9436
|
-
function isAll(event) {
|
|
9437
|
-
return ((event.ctrlKey && event.code === 'KeyA') || // Ctrl + A on Windows
|
|
9438
|
-
(event.metaKey && event.code === 'KeyA')); // Cmd + A on Mac
|
|
9439
|
-
}
|
|
9440
|
-
|
|
9441
|
-
function getColumnType(rgCol) {
|
|
9442
|
-
if (rgCol.pin) {
|
|
9443
|
-
return rgCol.pin;
|
|
9444
|
-
}
|
|
9445
|
-
return 'rgCol';
|
|
9446
|
-
}
|
|
9447
|
-
function getColumnSizes(cols) {
|
|
9448
|
-
const res = {};
|
|
9449
|
-
for (const [i, c] of cols.entries()) {
|
|
9450
|
-
if (c.size) {
|
|
9451
|
-
res[i] = c.size;
|
|
9452
|
-
}
|
|
9453
|
-
}
|
|
9454
|
-
return res;
|
|
9455
|
-
}
|
|
9456
|
-
/**
|
|
9457
|
-
* Check if column is grouping column
|
|
9458
|
-
*/
|
|
9459
|
-
function isColGrouping(colData) {
|
|
9460
|
-
return !!colData.children;
|
|
9461
|
-
}
|
|
9462
|
-
/**
|
|
9463
|
-
* This function is used to create a collection of columns.
|
|
9464
|
-
*/
|
|
9465
|
-
function getColumns(columns, level = 0, types) {
|
|
9466
|
-
const collection = {
|
|
9467
|
-
// columns as they are in stores per type
|
|
9468
|
-
columns: {
|
|
9469
|
-
rgCol: [],
|
|
9470
|
-
colPinStart: [],
|
|
9471
|
-
colPinEnd: [],
|
|
9472
|
-
},
|
|
9473
|
-
// columns indexed by prop for quick access
|
|
9474
|
-
columnByProp: {},
|
|
9475
|
-
// column grouping
|
|
9476
|
-
columnGrouping: {
|
|
9477
|
-
rgCol: [],
|
|
9478
|
-
colPinStart: [],
|
|
9479
|
-
colPinEnd: [],
|
|
9480
|
-
},
|
|
9481
|
-
// max depth level for column grouping
|
|
9482
|
-
maxLevel: level,
|
|
9483
|
-
// sorting
|
|
9484
|
-
sort: {},
|
|
9485
|
-
};
|
|
9486
|
-
return reduce_1(columns, (res, colData) => {
|
|
9487
|
-
// Grouped column
|
|
9488
|
-
if (isColGrouping(colData)) {
|
|
9489
|
-
return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
|
|
9490
|
-
}
|
|
9491
|
-
// Regular column
|
|
9492
|
-
const regularColumn = Object.assign(Object.assign({}, (colData.columnType && types && types[colData.columnType])), colData);
|
|
9493
|
-
// Regular column, no Pin
|
|
9494
|
-
if (!regularColumn.pin) {
|
|
9495
|
-
res.columns.rgCol.push(regularColumn);
|
|
9496
|
-
// Pin
|
|
9497
|
-
}
|
|
9498
|
-
else {
|
|
9499
|
-
res.columns[regularColumn.pin].push(regularColumn);
|
|
9500
|
-
}
|
|
9501
|
-
if (regularColumn.order) {
|
|
9502
|
-
res.sort[regularColumn.prop] = regularColumn;
|
|
9503
|
-
}
|
|
9504
|
-
// it's possible that some columns have same prop, but better to avoid it
|
|
9505
|
-
if (!res.columnByProp[regularColumn.prop]) {
|
|
9506
|
-
res.columnByProp[regularColumn.prop] = [];
|
|
9507
|
-
}
|
|
9508
|
-
res.columnByProp[regularColumn.prop].push(regularColumn);
|
|
9509
|
-
// trigger setup hook if present
|
|
9510
|
-
regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
|
|
9511
|
-
return res;
|
|
9512
|
-
}, collection);
|
|
9513
|
-
}
|
|
9514
|
-
function gatherGroup(res, colData, collection, level = 0) {
|
|
9515
|
-
// group template
|
|
9516
|
-
const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
|
|
9517
|
-
// check columns for update
|
|
9518
|
-
for (let k in collection.columns) {
|
|
9519
|
-
const key = k;
|
|
9520
|
-
const resultItem = res.columns[key];
|
|
9521
|
-
const collectionItem = collection.columns[key];
|
|
9522
|
-
// if column data
|
|
9523
|
-
if (isArray_1(resultItem) && isArray_1(collectionItem)) {
|
|
9524
|
-
// fill columns
|
|
9525
|
-
resultItem.push(...collectionItem);
|
|
9526
|
-
// fill grouping
|
|
9527
|
-
if (collectionItem.length) {
|
|
9528
|
-
res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
|
|
9529
|
-
}
|
|
9530
|
-
}
|
|
9521
|
+
cellY = height - 1;
|
|
9531
9522
|
}
|
|
9532
|
-
//
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
const collectionItem = collection.columnGrouping[key];
|
|
9536
|
-
res.columnGrouping[key].push(...collectionItem);
|
|
9523
|
+
// Limit the cell position to the element width
|
|
9524
|
+
if (cellX >= width) {
|
|
9525
|
+
cellX = width - 1;
|
|
9537
9526
|
}
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
if (isColGrouping(c)) {
|
|
9545
|
-
const found = findColumn(c.children, prop);
|
|
9546
|
-
if (found) {
|
|
9547
|
-
return found;
|
|
9548
|
-
}
|
|
9549
|
-
}
|
|
9550
|
-
else if (c.prop === prop) {
|
|
9551
|
-
return c;
|
|
9552
|
-
}
|
|
9527
|
+
// Get the row and column items based on the cell position
|
|
9528
|
+
const rgRow = getItemByPosition(rows, cellY);
|
|
9529
|
+
const rgCol = getItemByPosition(cols, cellX);
|
|
9530
|
+
// Set the row and column index to 0 if they are before the first item
|
|
9531
|
+
if (rgCol.itemIndex < 0) {
|
|
9532
|
+
rgCol.itemIndex = 0;
|
|
9553
9533
|
}
|
|
9554
|
-
|
|
9534
|
+
if (rgRow.itemIndex < 0) {
|
|
9535
|
+
rgRow.itemIndex = 0;
|
|
9536
|
+
}
|
|
9537
|
+
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9555
9538
|
}
|
|
9556
|
-
function
|
|
9557
|
-
|
|
9539
|
+
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9540
|
+
const updateCoordinate = (c, pos = 0) => {
|
|
9541
|
+
const start = { x: range.x, y: range.y };
|
|
9542
|
+
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9543
|
+
const point = end[c] > focus[c] ? end : start;
|
|
9544
|
+
point[c] += pos;
|
|
9545
|
+
return { start, end };
|
|
9546
|
+
};
|
|
9547
|
+
if (changes.x) {
|
|
9548
|
+
return updateCoordinate('x', changes['x']);
|
|
9549
|
+
}
|
|
9550
|
+
if (changes.y) {
|
|
9551
|
+
return updateCoordinate('y', changes['y']);
|
|
9552
|
+
}
|
|
9553
|
+
return null;
|
|
9558
9554
|
}
|
|
9559
|
-
|
|
9560
|
-
const LETTER_BLOCK_SIZE$1 = 10;
|
|
9561
|
-
const calculateRowHeaderSize = (itemsLength, rowHeaderColumn, minWidth = 50) => {
|
|
9562
|
-
return ((rowHeaderColumn === null || rowHeaderColumn === void 0 ? void 0 : rowHeaderColumn.size) ||
|
|
9563
|
-
Math.max((itemsLength.toString().length + 1) * LETTER_BLOCK_SIZE$1, minWidth));
|
|
9564
|
-
};
|
|
9565
|
-
|
|
9566
9555
|
/**
|
|
9567
|
-
*
|
|
9556
|
+
* Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position
|
|
9557
|
+
* or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position
|
|
9568
9558
|
*/
|
|
9569
|
-
function
|
|
9570
|
-
|
|
9571
|
-
const container = document.createElement('div');
|
|
9572
|
-
// Apply styling to ensure the div is scrollable
|
|
9573
|
-
container.style.overflow = 'scroll';
|
|
9574
|
-
container.style.visibility = 'hidden'; // make sure the container isn't visible
|
|
9575
|
-
container.style.position = 'absolute';
|
|
9576
|
-
container.style.top = '-9999px'; // move it out of the screen
|
|
9577
|
-
container.style.width = '50px'; // arbitrary width
|
|
9578
|
-
container.style.height = '50px'; // arbitrary height
|
|
9579
|
-
// Append the div to the body
|
|
9580
|
-
document.body.appendChild(container);
|
|
9581
|
-
// Calculate the width of the scrollbar
|
|
9582
|
-
const scrollbarWidth = container.offsetWidth - container.clientWidth;
|
|
9583
|
-
// Remove the div from the body after calculation
|
|
9584
|
-
document.body.removeChild(container);
|
|
9585
|
-
// Return the calculated width of the scrollbar
|
|
9586
|
-
return scrollbarWidth;
|
|
9559
|
+
function isAfterLast({ x, y }, lastCell) {
|
|
9560
|
+
return x >= lastCell.x || y >= lastCell.y;
|
|
9587
9561
|
}
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
* // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
|
|
9592
|
-
* const n = scaleValue(55, [0,100], [0,1000]);
|
|
9593
|
-
*
|
|
9594
|
-
* Ranges of two values
|
|
9595
|
-
* @from
|
|
9596
|
-
* @to
|
|
9597
|
-
*
|
|
9598
|
-
* ~~ return value does the equivalent of Math.floor but faster.
|
|
9599
|
-
*/
|
|
9600
|
-
function scaleValue(value, from, to) {
|
|
9601
|
-
return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
|
|
9562
|
+
/** check if out of range */
|
|
9563
|
+
function isBeforeFirst({ x, y }) {
|
|
9564
|
+
return x < 0 || y < 0;
|
|
9602
9565
|
}
|
|
9603
|
-
/**
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
|
|
9607
|
-
|
|
9608
|
-
|
|
9609
|
-
|
|
9566
|
+
/** Compare cells, only 1 coordinate difference is possible */
|
|
9567
|
+
// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9568
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9569
|
+
// for (let k of c) {
|
|
9570
|
+
// if (initial[k] !== last[k]) {
|
|
9571
|
+
// return { [k]: 1 };
|
|
9572
|
+
// }
|
|
9573
|
+
// }
|
|
9574
|
+
// return null;
|
|
9575
|
+
// }
|
|
9576
|
+
// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
9577
|
+
// const cell: Partial<Cell> = {};
|
|
9578
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
9579
|
+
// for (let k of c) {
|
|
9580
|
+
// cell[k] = Math.abs(initial[k] - last[k]);
|
|
9581
|
+
// }
|
|
9582
|
+
// if (cell.x > cell.y) {
|
|
9583
|
+
// return { x: 1 };
|
|
9584
|
+
// }
|
|
9585
|
+
// if (cell.y > cell.x) {
|
|
9586
|
+
// return { y: 1 };
|
|
9587
|
+
// }
|
|
9588
|
+
// return null;
|
|
9589
|
+
// }
|
|
9590
|
+
function styleByCellProps(styles) {
|
|
9591
|
+
return {
|
|
9592
|
+
left: `${styles.left}px`,
|
|
9593
|
+
top: `${styles.top}px`,
|
|
9594
|
+
width: `${styles.width}px`,
|
|
9595
|
+
height: `${styles.height}px`,
|
|
9596
|
+
};
|
|
9597
|
+
}
|
|
9598
|
+
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
9599
|
+
const top = getItemByIndex(dimensionRow, y).start;
|
|
9600
|
+
const left = getItemByIndex(dimensionCol, x).start;
|
|
9601
|
+
const bottom = getItemByIndex(dimensionRow, y1).end;
|
|
9602
|
+
const right = getItemByIndex(dimensionCol, x1).end;
|
|
9603
|
+
return {
|
|
9604
|
+
left,
|
|
9605
|
+
right,
|
|
9606
|
+
top,
|
|
9607
|
+
bottom,
|
|
9608
|
+
width: right - left,
|
|
9609
|
+
height: bottom - top,
|
|
9610
|
+
};
|
|
9611
|
+
}
|
|
9612
|
+
function getElStyle(range, dimensionRow, dimensionCol) {
|
|
9613
|
+
const styles = getCell(range, dimensionRow, dimensionCol);
|
|
9614
|
+
return styleByCellProps(styles);
|
|
9615
|
+
}
|
|
9616
|
+
|
|
9617
|
+
// is edit input
|
|
9618
|
+
function isEditInput(el) {
|
|
9619
|
+
return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
|
|
9620
|
+
}
|
|
9621
|
+
// Type guard for EditorCtrConstructible
|
|
9622
|
+
function isEditorCtrConstructible(editor) {
|
|
9623
|
+
return typeof editor === 'function' && typeof editor.prototype === 'object';
|
|
9610
9624
|
}
|
|
9611
9625
|
|
|
9612
9626
|
const DIRECTION_CODES = [
|
|
@@ -10717,81 +10731,12 @@ class RevoEdit {
|
|
|
10717
10731
|
}; }
|
|
10718
10732
|
}
|
|
10719
10733
|
|
|
10720
|
-
var baseIteratee$1 = _baseIteratee,
|
|
10721
|
-
isArrayLike$1 = isArrayLike_1,
|
|
10722
|
-
keys = keys_1;
|
|
10723
|
-
|
|
10724
|
-
/**
|
|
10725
|
-
* Creates a `_.find` or `_.findLast` function.
|
|
10726
|
-
*
|
|
10727
|
-
* @private
|
|
10728
|
-
* @param {Function} findIndexFunc The function to find the collection index.
|
|
10729
|
-
* @returns {Function} Returns the new find function.
|
|
10730
|
-
*/
|
|
10731
|
-
function createFind$1(findIndexFunc) {
|
|
10732
|
-
return function(collection, predicate, fromIndex) {
|
|
10733
|
-
var iterable = Object(collection);
|
|
10734
|
-
if (!isArrayLike$1(collection)) {
|
|
10735
|
-
var iteratee = baseIteratee$1(predicate);
|
|
10736
|
-
collection = keys(collection);
|
|
10737
|
-
predicate = function(key) { return iteratee(iterable[key], key, iterable); };
|
|
10738
|
-
}
|
|
10739
|
-
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
10740
|
-
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
|
|
10741
|
-
};
|
|
10742
|
-
}
|
|
10743
|
-
|
|
10744
|
-
var _createFind = createFind$1;
|
|
10745
|
-
|
|
10746
|
-
var createFind = _createFind,
|
|
10747
|
-
findIndex = findIndex_1;
|
|
10748
|
-
|
|
10749
|
-
/**
|
|
10750
|
-
* Iterates over elements of `collection`, returning the first element
|
|
10751
|
-
* `predicate` returns truthy for. The predicate is invoked with three
|
|
10752
|
-
* arguments: (value, index|key, collection).
|
|
10753
|
-
*
|
|
10754
|
-
* @static
|
|
10755
|
-
* @memberOf _
|
|
10756
|
-
* @since 0.1.0
|
|
10757
|
-
* @category Collection
|
|
10758
|
-
* @param {Array|Object} collection The collection to inspect.
|
|
10759
|
-
* @param {Function} [predicate=_.identity] The function invoked per iteration.
|
|
10760
|
-
* @param {number} [fromIndex=0] The index to search from.
|
|
10761
|
-
* @returns {*} Returns the matched element, else `undefined`.
|
|
10762
|
-
* @example
|
|
10763
|
-
*
|
|
10764
|
-
* var users = [
|
|
10765
|
-
* { 'user': 'barney', 'age': 36, 'active': true },
|
|
10766
|
-
* { 'user': 'fred', 'age': 40, 'active': false },
|
|
10767
|
-
* { 'user': 'pebbles', 'age': 1, 'active': true }
|
|
10768
|
-
* ];
|
|
10769
|
-
*
|
|
10770
|
-
* _.find(users, function(o) { return o.age < 40; });
|
|
10771
|
-
* // => object for 'barney'
|
|
10772
|
-
*
|
|
10773
|
-
* // The `_.matches` iteratee shorthand.
|
|
10774
|
-
* _.find(users, { 'age': 1, 'active': true });
|
|
10775
|
-
* // => object for 'pebbles'
|
|
10776
|
-
*
|
|
10777
|
-
* // The `_.matchesProperty` iteratee shorthand.
|
|
10778
|
-
* _.find(users, ['active', false]);
|
|
10779
|
-
* // => object for 'fred'
|
|
10780
|
-
*
|
|
10781
|
-
* // The `_.property` iteratee shorthand.
|
|
10782
|
-
* _.find(users, 'active');
|
|
10783
|
-
* // => object for 'barney'
|
|
10784
|
-
*/
|
|
10785
|
-
var find = createFind(findIndex);
|
|
10786
|
-
|
|
10787
|
-
var find_1 = find;
|
|
10788
|
-
|
|
10789
10734
|
class ColumnDataProvider {
|
|
10790
10735
|
get order() {
|
|
10791
10736
|
const order = {};
|
|
10792
10737
|
const sorting = this.sorting;
|
|
10793
10738
|
if (sorting) {
|
|
10794
|
-
Object.keys(sorting).forEach(
|
|
10739
|
+
Object.keys(sorting).forEach(prop => {
|
|
10795
10740
|
order[prop] = sorting[prop].order;
|
|
10796
10741
|
});
|
|
10797
10742
|
}
|
|
@@ -10802,6 +10747,7 @@ class ColumnDataProvider {
|
|
|
10802
10747
|
}
|
|
10803
10748
|
constructor() {
|
|
10804
10749
|
this.sorting = null;
|
|
10750
|
+
this.collection = null;
|
|
10805
10751
|
this.dataSources = columnTypes.reduce((sources, k) => {
|
|
10806
10752
|
sources[k] = new DataStore(k);
|
|
10807
10753
|
return sources;
|
|
@@ -10835,9 +10781,9 @@ class ColumnDataProvider {
|
|
|
10835
10781
|
getColumnIndexByProp(prop, type) {
|
|
10836
10782
|
return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);
|
|
10837
10783
|
}
|
|
10838
|
-
getColumnByProp(prop
|
|
10839
|
-
|
|
10840
|
-
return
|
|
10784
|
+
getColumnByProp(prop) {
|
|
10785
|
+
var _a;
|
|
10786
|
+
return (_a = this.collection) === null || _a === void 0 ? void 0 : _a.columnByProp[prop];
|
|
10841
10787
|
}
|
|
10842
10788
|
refreshByType(type) {
|
|
10843
10789
|
this.dataSources[type].refresh();
|
|
@@ -10859,6 +10805,7 @@ class ColumnDataProvider {
|
|
|
10859
10805
|
});
|
|
10860
10806
|
});
|
|
10861
10807
|
this.sorting = data.sort;
|
|
10808
|
+
this.collection = data;
|
|
10862
10809
|
return data;
|
|
10863
10810
|
}
|
|
10864
10811
|
updateColumns(cols) {
|
|
@@ -11191,7 +11138,7 @@ class ThemeService {
|
|
|
11191
11138
|
this.register('default');
|
|
11192
11139
|
}
|
|
11193
11140
|
register(theme) {
|
|
11194
|
-
const parsedTheme =
|
|
11141
|
+
const parsedTheme = getTheme(theme);
|
|
11195
11142
|
switch (parsedTheme) {
|
|
11196
11143
|
case 'material':
|
|
11197
11144
|
case 'darkMaterial':
|
|
@@ -11206,12 +11153,12 @@ class ThemeService {
|
|
|
11206
11153
|
break;
|
|
11207
11154
|
}
|
|
11208
11155
|
}
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
return DEFAULT_THEME;
|
|
11156
|
+
}
|
|
11157
|
+
function getTheme(theme) {
|
|
11158
|
+
if (theme && allowedThemes.indexOf(theme) > -1) {
|
|
11159
|
+
return theme;
|
|
11214
11160
|
}
|
|
11161
|
+
return DEFAULT_THEME;
|
|
11215
11162
|
}
|
|
11216
11163
|
|
|
11217
11164
|
/**
|
|
@@ -11618,23 +11565,7 @@ const notContains = (value, extra) => {
|
|
|
11618
11565
|
notContains.extra = 'input';
|
|
11619
11566
|
contains.extra = 'input';
|
|
11620
11567
|
|
|
11621
|
-
const
|
|
11622
|
-
none: 'None',
|
|
11623
|
-
empty: 'Not set',
|
|
11624
|
-
notEmpty: 'Set',
|
|
11625
|
-
eq: 'Equal',
|
|
11626
|
-
notEq: 'Not equal',
|
|
11627
|
-
begins: 'Begins with',
|
|
11628
|
-
contains: 'Contains',
|
|
11629
|
-
notContains: 'Does not contain',
|
|
11630
|
-
eqN: '=',
|
|
11631
|
-
neqN: '!=',
|
|
11632
|
-
gt: '>',
|
|
11633
|
-
gte: '>=',
|
|
11634
|
-
lt: '<',
|
|
11635
|
-
lte: '<=',
|
|
11636
|
-
};
|
|
11637
|
-
const filterEntities = {
|
|
11568
|
+
const filterCoreFunctionsIndexedByType = {
|
|
11638
11569
|
none: () => true,
|
|
11639
11570
|
empty: notSet,
|
|
11640
11571
|
notEmpty: set,
|
|
@@ -11654,7 +11585,37 @@ const filterTypes = {
|
|
|
11654
11585
|
string: ['notEmpty', 'empty', 'eq', 'notEq', 'begins', 'contains', 'notContains'],
|
|
11655
11586
|
number: ['notEmpty', 'empty', 'eqN', 'neqN', 'gt', 'gte', 'lt', 'lte'],
|
|
11656
11587
|
};
|
|
11588
|
+
const filterNames = {
|
|
11589
|
+
none: 'None',
|
|
11590
|
+
empty: 'Not set',
|
|
11591
|
+
notEmpty: 'Set',
|
|
11592
|
+
eq: 'Equal',
|
|
11593
|
+
notEq: 'Not equal',
|
|
11594
|
+
begins: 'Begins with',
|
|
11595
|
+
contains: 'Contains',
|
|
11596
|
+
notContains: 'Does not contain',
|
|
11597
|
+
eqN: '=',
|
|
11598
|
+
neqN: '!=',
|
|
11599
|
+
gt: '>',
|
|
11600
|
+
gte: '>=',
|
|
11601
|
+
lt: '<',
|
|
11602
|
+
lte: '<=',
|
|
11603
|
+
};
|
|
11657
11604
|
|
|
11605
|
+
/**
|
|
11606
|
+
* @typedef ColumnFilterConfig
|
|
11607
|
+
* @type {object}
|
|
11608
|
+
* @property {FilterCollection|undefined} collection - preserved filter data
|
|
11609
|
+
* @property {string[]|undefined} include - filters to be included, if defined everything else out of scope will be ignored
|
|
11610
|
+
* @property {Record<string, CustomFilter>|undefined} customFilters - hash map of {FilterType:CustomFilter}.
|
|
11611
|
+
* @property {FilterLocalization|undefined} localization - translation for filter popup captions.
|
|
11612
|
+
* @property {MultiFilterItem|undefined} multiFilterItems - data for multi filtering.
|
|
11613
|
+
* @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering.
|
|
11614
|
+
* A way to define your own filter types per column
|
|
11615
|
+
*/
|
|
11616
|
+
/**
|
|
11617
|
+
* @internal
|
|
11618
|
+
*/
|
|
11658
11619
|
const FILTER_TRIMMED_TYPE = 'filter';
|
|
11659
11620
|
const FILTER_CONFIG_CHANGED_EVENT = 'filterconfigchanged';
|
|
11660
11621
|
class FilterPlugin extends BasePlugin {
|
|
@@ -11664,14 +11625,13 @@ class FilterPlugin extends BasePlugin {
|
|
|
11664
11625
|
this.revogrid = revogrid;
|
|
11665
11626
|
this.filterCollection = {};
|
|
11666
11627
|
this.multiFilterItems = {};
|
|
11667
|
-
this.
|
|
11668
|
-
this.
|
|
11669
|
-
this.
|
|
11628
|
+
this.filterByType = Object.assign({}, filterTypes);
|
|
11629
|
+
this.filterNameIndexByType = Object.assign({}, filterNames);
|
|
11630
|
+
this.filterFunctionsIndexedByType = Object.assign({}, filterCoreFunctionsIndexedByType);
|
|
11670
11631
|
this.filterProp = FILTER_PROP;
|
|
11671
11632
|
if (config) {
|
|
11672
11633
|
this.initConfig(config);
|
|
11673
11634
|
}
|
|
11674
|
-
const headerclick = (e) => this.headerclick(e);
|
|
11675
11635
|
const aftersourceset = async () => {
|
|
11676
11636
|
const filterCollectionProps = Object.keys(this.filterCollection);
|
|
11677
11637
|
if (filterCollectionProps.length > 0) {
|
|
@@ -11691,7 +11651,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11691
11651
|
}
|
|
11692
11652
|
await this.runFiltering();
|
|
11693
11653
|
};
|
|
11694
|
-
this.addEventListener('headerclick', headerclick);
|
|
11654
|
+
this.addEventListener('headerclick', (e) => this.headerclick(e));
|
|
11695
11655
|
this.addEventListener(FILTER_CONFIG_CHANGED_EVENT, ({ detail }) => {
|
|
11696
11656
|
if (!detail) {
|
|
11697
11657
|
this.clearFiltering();
|
|
@@ -11704,27 +11664,29 @@ class FilterPlugin extends BasePlugin {
|
|
|
11704
11664
|
});
|
|
11705
11665
|
this.addEventListener('aftersourceset', aftersourceset);
|
|
11706
11666
|
this.addEventListener('filter', ({ detail }) => this.onFilterChange(detail));
|
|
11707
|
-
const existingNodes = this.revogrid.registerVNode.filter(
|
|
11667
|
+
const existingNodes = this.revogrid.registerVNode.filter(n => n.$tag$ !== 'revogr-filter-panel');
|
|
11708
11668
|
this.revogrid.registerVNode = [
|
|
11709
11669
|
...existingNodes,
|
|
11710
|
-
hAsync("revogr-filter-panel", { filterItems: this.multiFilterItems, filterNames: this.
|
|
11670
|
+
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) }),
|
|
11711
11671
|
];
|
|
11712
11672
|
}
|
|
11713
11673
|
initConfig(config) {
|
|
11714
11674
|
if (config.multiFilterItems) {
|
|
11715
11675
|
this.multiFilterItems = Object.assign({}, config.multiFilterItems);
|
|
11716
11676
|
}
|
|
11677
|
+
// Add custom filters
|
|
11717
11678
|
if (config.customFilters) {
|
|
11718
|
-
for (let
|
|
11719
|
-
const cFilter = config.customFilters[
|
|
11720
|
-
if (!this.
|
|
11721
|
-
this.
|
|
11679
|
+
for (let customFilterType in config.customFilters) {
|
|
11680
|
+
const cFilter = config.customFilters[customFilterType];
|
|
11681
|
+
if (!this.filterByType[cFilter.columnFilterType]) {
|
|
11682
|
+
this.filterByType[cFilter.columnFilterType] = [];
|
|
11722
11683
|
}
|
|
11723
|
-
this.
|
|
11724
|
-
this.
|
|
11725
|
-
this.
|
|
11684
|
+
this.filterByType[cFilter.columnFilterType].push(customFilterType);
|
|
11685
|
+
this.filterFunctionsIndexedByType[customFilterType] = cFilter.func;
|
|
11686
|
+
this.filterNameIndexByType[customFilterType] = cFilter.name;
|
|
11726
11687
|
}
|
|
11727
11688
|
}
|
|
11689
|
+
// Add filterProp if provided in config
|
|
11728
11690
|
if (config.filterProp) {
|
|
11729
11691
|
this.filterProp = config.filterProp;
|
|
11730
11692
|
}
|
|
@@ -11735,21 +11697,21 @@ class FilterPlugin extends BasePlugin {
|
|
|
11735
11697
|
const cfgInlcude = config.include;
|
|
11736
11698
|
if (cfgInlcude) {
|
|
11737
11699
|
const filters = {};
|
|
11738
|
-
for (let t in this.
|
|
11700
|
+
for (let t in this.filterByType) {
|
|
11739
11701
|
// validate filters, if appropriate function present
|
|
11740
|
-
const newTypes = this.
|
|
11702
|
+
const newTypes = this.filterByType[t].filter(f => cfgInlcude.indexOf(f) > -1);
|
|
11741
11703
|
if (newTypes.length) {
|
|
11742
11704
|
filters[t] = newTypes;
|
|
11743
11705
|
}
|
|
11744
11706
|
}
|
|
11745
11707
|
// if any valid filters provided show them
|
|
11746
11708
|
if (Object.keys(filters).length > 0) {
|
|
11747
|
-
this.
|
|
11709
|
+
this.filterByType = filters;
|
|
11748
11710
|
}
|
|
11749
11711
|
}
|
|
11750
11712
|
if (config.collection) {
|
|
11751
11713
|
this.filterCollection = reduce_1(config.collection, (result, item, prop) => {
|
|
11752
|
-
if (this.
|
|
11714
|
+
if (this.filterFunctionsIndexedByType[item.type]) {
|
|
11753
11715
|
result[prop] = item;
|
|
11754
11716
|
}
|
|
11755
11717
|
else {
|
|
@@ -11761,8 +11723,8 @@ class FilterPlugin extends BasePlugin {
|
|
|
11761
11723
|
if (config.localization) {
|
|
11762
11724
|
if (config.localization.filterNames) {
|
|
11763
11725
|
Object.entries(config.localization.filterNames).forEach(([k, v]) => {
|
|
11764
|
-
if (this.
|
|
11765
|
-
this.
|
|
11726
|
+
if (this.filterNameIndexByType[k] != void 0) {
|
|
11727
|
+
this.filterNameIndexByType[k] = v;
|
|
11766
11728
|
}
|
|
11767
11729
|
});
|
|
11768
11730
|
}
|
|
@@ -11788,13 +11750,12 @@ class FilterPlugin extends BasePlugin {
|
|
|
11788
11750
|
const gridPos = this.revogrid.getBoundingClientRect();
|
|
11789
11751
|
const buttonPos = el.getBoundingClientRect();
|
|
11790
11752
|
const prop = e.detail.prop;
|
|
11791
|
-
this.pop.filterTypes
|
|
11792
|
-
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 }));
|
|
11753
|
+
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) }));
|
|
11793
11754
|
}
|
|
11794
11755
|
getColumnFilter(type) {
|
|
11795
11756
|
let filterType = 'string';
|
|
11796
11757
|
if (!type) {
|
|
11797
|
-
return { [filterType]: this.
|
|
11758
|
+
return { [filterType]: this.filterByType[filterType] };
|
|
11798
11759
|
}
|
|
11799
11760
|
// if custom column filter
|
|
11800
11761
|
if (this.isValidType(type)) {
|
|
@@ -11804,44 +11765,59 @@ class FilterPlugin extends BasePlugin {
|
|
|
11804
11765
|
else if (typeof type === 'object' && type.length) {
|
|
11805
11766
|
return type.reduce((r, multiType) => {
|
|
11806
11767
|
if (this.isValidType(multiType)) {
|
|
11807
|
-
r[multiType] = this.
|
|
11768
|
+
r[multiType] = this.filterByType[multiType];
|
|
11808
11769
|
}
|
|
11809
11770
|
return r;
|
|
11810
11771
|
}, {});
|
|
11811
11772
|
}
|
|
11812
|
-
return { [filterType]: this.
|
|
11773
|
+
return { [filterType]: this.filterByType[filterType] };
|
|
11813
11774
|
}
|
|
11814
11775
|
isValidType(type) {
|
|
11815
|
-
return !!(typeof type === 'string' && this.
|
|
11776
|
+
return !!(typeof type === 'string' && this.filterByType[type]);
|
|
11816
11777
|
}
|
|
11817
|
-
|
|
11778
|
+
/**
|
|
11779
|
+
* Called on internal component change
|
|
11780
|
+
*/
|
|
11818
11781
|
async onFilterChange(filterItems) {
|
|
11782
|
+
// store the filter items
|
|
11819
11783
|
this.multiFilterItems = filterItems;
|
|
11784
|
+
// run the filtering when the items change
|
|
11820
11785
|
this.runFiltering();
|
|
11821
11786
|
}
|
|
11822
11787
|
/**
|
|
11823
11788
|
* Triggers grid filtering
|
|
11824
11789
|
*/
|
|
11825
|
-
async doFiltering(collection,
|
|
11790
|
+
async doFiltering(collection, source, columns, filterItems) {
|
|
11826
11791
|
const columnsToUpdate = [];
|
|
11792
|
+
/**
|
|
11793
|
+
* Loop through the columns and update the columns that need to be updated with the `hasFilter` property.
|
|
11794
|
+
*/
|
|
11795
|
+
const columnByProp = {};
|
|
11827
11796
|
columns.forEach(rgCol => {
|
|
11828
11797
|
const column = Object.assign({}, rgCol);
|
|
11829
11798
|
const hasFilter = filterItems[column.prop];
|
|
11799
|
+
columnByProp[column.prop] = column;
|
|
11800
|
+
/**
|
|
11801
|
+
* If the column has a filter and it's not already marked as filtered, update the column.
|
|
11802
|
+
*/
|
|
11830
11803
|
if (column[this.filterProp] && !hasFilter) {
|
|
11831
11804
|
delete column[this.filterProp];
|
|
11832
11805
|
columnsToUpdate.push(column);
|
|
11833
11806
|
}
|
|
11807
|
+
/**
|
|
11808
|
+
* If the column does not have a filter and it's marked as filtered, update the column.
|
|
11809
|
+
*/
|
|
11834
11810
|
if (!column[this.filterProp] && hasFilter) {
|
|
11835
11811
|
columnsToUpdate.push(column);
|
|
11836
11812
|
column[this.filterProp] = true;
|
|
11837
11813
|
}
|
|
11838
11814
|
});
|
|
11839
|
-
const
|
|
11815
|
+
const itemsToTrim = this.getRowFilter(source, filterItems, columnByProp);
|
|
11840
11816
|
// check is filter event prevented
|
|
11841
11817
|
const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', {
|
|
11842
11818
|
collection,
|
|
11843
|
-
itemsToFilter,
|
|
11844
|
-
source
|
|
11819
|
+
itemsToFilter: itemsToTrim,
|
|
11820
|
+
source,
|
|
11845
11821
|
filterItems,
|
|
11846
11822
|
});
|
|
11847
11823
|
if (defaultPrevented) {
|
|
@@ -11853,7 +11829,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11853
11829
|
return;
|
|
11854
11830
|
}
|
|
11855
11831
|
// applies the hasFilter to the columns to show filter icon
|
|
11856
|
-
|
|
11832
|
+
this.providers.column.updateColumns(columnsToUpdate);
|
|
11857
11833
|
this.emit('afterfilterapply');
|
|
11858
11834
|
}
|
|
11859
11835
|
async clearFiltering() {
|
|
@@ -11869,7 +11845,7 @@ class FilterPlugin extends BasePlugin {
|
|
|
11869
11845
|
if (this.multiFilterItems[prop].length > 0) {
|
|
11870
11846
|
const firstFilterItem = this.multiFilterItems[prop][0];
|
|
11871
11847
|
collection[prop] = {
|
|
11872
|
-
filter:
|
|
11848
|
+
filter: this.filterFunctionsIndexedByType[firstFilterItem.type],
|
|
11873
11849
|
type: firstFilterItem.type,
|
|
11874
11850
|
value: firstFilterItem.value,
|
|
11875
11851
|
};
|
|
@@ -11894,52 +11870,68 @@ class FilterPlugin extends BasePlugin {
|
|
|
11894
11870
|
columns: await this.revogrid.getColumns(),
|
|
11895
11871
|
};
|
|
11896
11872
|
}
|
|
11897
|
-
|
|
11873
|
+
/**
|
|
11874
|
+
* Get trimmed rows based on filter
|
|
11875
|
+
*/
|
|
11876
|
+
getRowFilter(rows, filterItems, columnByProp) {
|
|
11898
11877
|
const propKeys = Object.keys(filterItems);
|
|
11899
11878
|
const trimmed = {};
|
|
11900
11879
|
let propFilterSatisfiedCount = 0;
|
|
11901
11880
|
let lastFilterResults = [];
|
|
11902
11881
|
// each rows
|
|
11903
11882
|
rows.forEach((model, rowIndex) => {
|
|
11904
|
-
//
|
|
11883
|
+
// check filter by column properties
|
|
11905
11884
|
for (const prop of propKeys) {
|
|
11906
11885
|
const propFilters = filterItems[prop];
|
|
11886
|
+
// reset the count of satisfied filters
|
|
11907
11887
|
propFilterSatisfiedCount = 0;
|
|
11888
|
+
// reset the array of last filter results
|
|
11908
11889
|
lastFilterResults = [];
|
|
11909
11890
|
// testing each filter for a prop
|
|
11910
11891
|
for (const [filterIndex, filterData] of propFilters.entries()) {
|
|
11911
11892
|
// the filter LogicFunction based on the type
|
|
11912
|
-
const
|
|
11893
|
+
const filterFunc = this.filterFunctionsIndexedByType[filterData.type];
|
|
11913
11894
|
// THE MAGIC OF FILTERING IS HERE
|
|
11895
|
+
const column = columnByProp[prop];
|
|
11896
|
+
// If there is no column but user wants to filter by a property
|
|
11897
|
+
const value = column ? getCellDataParsed(model, columnByProp[prop]) : model[prop];
|
|
11898
|
+
// OR relation
|
|
11914
11899
|
if (filterData.relation === 'or') {
|
|
11900
|
+
// reset the array of last filter results
|
|
11915
11901
|
lastFilterResults = [];
|
|
11916
|
-
if
|
|
11902
|
+
// if the filter is satisfied, continue to the next filter
|
|
11903
|
+
if (filterFunc(value, filterData.value)) {
|
|
11917
11904
|
continue;
|
|
11918
11905
|
}
|
|
11906
|
+
// if the filter is not satisfied, count it
|
|
11919
11907
|
propFilterSatisfiedCount++;
|
|
11908
|
+
// AND relation
|
|
11920
11909
|
}
|
|
11921
11910
|
else {
|
|
11922
11911
|
// 'and' relation will need to know the next filter
|
|
11923
11912
|
// so we save this current filter to include it in the next filter
|
|
11924
|
-
lastFilterResults.push(!
|
|
11913
|
+
lastFilterResults.push(!filterFunc(value, filterData.value));
|
|
11925
11914
|
// check first if we have a filter on the next index to pair it with this current filter
|
|
11926
11915
|
const nextFilterData = propFilters[filterIndex + 1];
|
|
11927
11916
|
// stop the sequence if there is no next filter or if the next filter is not an 'and' relation
|
|
11928
11917
|
if (!nextFilterData || nextFilterData.relation !== 'and') {
|
|
11929
11918
|
// let's just continue since for sure propFilterSatisfiedCount cannot be satisfied
|
|
11930
11919
|
if (lastFilterResults.indexOf(true) === -1) {
|
|
11920
|
+
// reset the array of last filter results
|
|
11931
11921
|
lastFilterResults = [];
|
|
11932
11922
|
continue;
|
|
11933
11923
|
}
|
|
11934
11924
|
// we need to add all of the lastFilterResults since we need to satisfy all
|
|
11935
11925
|
propFilterSatisfiedCount += lastFilterResults.length;
|
|
11926
|
+
// reset the array of last filter results
|
|
11936
11927
|
lastFilterResults = [];
|
|
11937
11928
|
}
|
|
11938
11929
|
}
|
|
11939
11930
|
} // end of propFilters forEach
|
|
11940
11931
|
// add to the list of removed/trimmed rows of filter condition is satisfied
|
|
11941
|
-
if (propFilterSatisfiedCount === propFilters.length)
|
|
11932
|
+
if (propFilterSatisfiedCount === propFilters.length) {
|
|
11942
11933
|
trimmed[rowIndex] = true;
|
|
11934
|
+
}
|
|
11943
11935
|
} // end of for-of propKeys
|
|
11944
11936
|
});
|
|
11945
11937
|
return trimmed;
|
|
@@ -13931,34 +13923,33 @@ const ResizableElement = (props, children) => {
|
|
|
13931
13923
|
const resizeEls = [];
|
|
13932
13924
|
const directive = (props.canResize &&
|
|
13933
13925
|
new ResizeDirective(props, e => {
|
|
13926
|
+
var _a;
|
|
13934
13927
|
if (e.eventName === ResizeEvents.end) {
|
|
13935
|
-
props.onResize
|
|
13928
|
+
(_a = props.onResize) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13936
13929
|
}
|
|
13937
13930
|
})) ||
|
|
13938
13931
|
null;
|
|
13939
|
-
if (props.
|
|
13940
|
-
if (props.
|
|
13932
|
+
if (props.active) {
|
|
13933
|
+
if (props.canResize) {
|
|
13941
13934
|
for (let p in props.active) {
|
|
13942
13935
|
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onDblClick: e => {
|
|
13943
13936
|
var _a;
|
|
13944
13937
|
e.preventDefault();
|
|
13945
|
-
(_a = props.
|
|
13938
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13946
13939
|
}, 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]}` }));
|
|
13947
13940
|
}
|
|
13948
13941
|
}
|
|
13949
|
-
|
|
13950
|
-
else {
|
|
13951
|
-
if (props.active) {
|
|
13942
|
+
else {
|
|
13952
13943
|
for (let p in props.active) {
|
|
13953
13944
|
resizeEls.push(hAsync("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
|
|
13954
13945
|
var _a;
|
|
13955
13946
|
e.preventDefault();
|
|
13956
|
-
(_a = props.
|
|
13947
|
+
(_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
13957
13948
|
}, class: `no-resize resizable resizable-${props.active[p]}` }));
|
|
13958
13949
|
}
|
|
13959
13950
|
}
|
|
13960
13951
|
}
|
|
13961
|
-
return (hAsync("div", Object.assign({}, props, { ref:
|
|
13952
|
+
return (hAsync("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
|
|
13962
13953
|
children,
|
|
13963
13954
|
resizeEls));
|
|
13964
13955
|
};
|
|
@@ -13972,16 +13963,17 @@ const HeaderCellRenderer = ({ data, props, additionalData }, children) => {
|
|
|
13972
13963
|
}
|
|
13973
13964
|
if (data === null || data === void 0 ? void 0 : data.columnProperties) {
|
|
13974
13965
|
const extra = data.columnProperties(data);
|
|
13975
|
-
if (extra
|
|
13966
|
+
if (extra) {
|
|
13976
13967
|
cellProps = doPropMerge(props, extra);
|
|
13977
13968
|
}
|
|
13978
13969
|
}
|
|
13979
|
-
|
|
13970
|
+
const resizeProps = Object.assign(Object.assign({}, cellProps), { onMouseDown(e) {
|
|
13980
13971
|
dispatch(e.currentTarget, ON_COLUMN_CLICK, {
|
|
13981
13972
|
data,
|
|
13982
13973
|
event: e,
|
|
13983
13974
|
});
|
|
13984
|
-
} })
|
|
13975
|
+
} });
|
|
13976
|
+
return (hAsync(ResizableElement, Object.assign({}, resizeProps),
|
|
13985
13977
|
hAsync("div", { class: "header-content" }, colTemplate),
|
|
13986
13978
|
children));
|
|
13987
13979
|
};
|
|
@@ -14194,8 +14186,14 @@ class WCAGPlugin extends BasePlugin {
|
|
|
14194
14186
|
return result;
|
|
14195
14187
|
};
|
|
14196
14188
|
column.cellProperties = (...args) => {
|
|
14189
|
+
const wcagProps = {
|
|
14190
|
+
['role']: 'gridcell',
|
|
14191
|
+
['aria-colindex']: index,
|
|
14192
|
+
['aria-rowindex']: args[0].rowIndex,
|
|
14193
|
+
['tabindex']: -1,
|
|
14194
|
+
};
|
|
14197
14195
|
const columnProps = (cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties(...args)) || {};
|
|
14198
|
-
return Object.assign({
|
|
14196
|
+
return Object.assign(Object.assign({}, wcagProps), columnProps);
|
|
14199
14197
|
};
|
|
14200
14198
|
});
|
|
14201
14199
|
});
|
|
@@ -15378,7 +15376,7 @@ class RevogrData {
|
|
|
15378
15376
|
if (cellEvent.defaultPrevented) {
|
|
15379
15377
|
continue;
|
|
15380
15378
|
}
|
|
15381
|
-
const { detail: { column: columnProps, row: rowProps, model:
|
|
15379
|
+
const { detail: { column: columnProps, row: rowProps, model: schemaModel }, } = cellEvent;
|
|
15382
15380
|
const defaultProps = {
|
|
15383
15381
|
[DATA_COL]: columnProps.itemIndex,
|
|
15384
15382
|
[DATA_ROW]: rowProps.itemIndex,
|
|
@@ -15394,16 +15392,17 @@ class RevogrData {
|
|
|
15394
15392
|
if (groupDepth && !columnProps.itemIndex && defaultProps.style) {
|
|
15395
15393
|
defaultProps.style.paddingLeft = `${PADDING_DEPTH * groupDepth}px`;
|
|
15396
15394
|
}
|
|
15397
|
-
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps,
|
|
15395
|
+
const props = this.columnService.mergeProperties(rowProps.itemIndex, columnProps.itemIndex, defaultProps, schemaModel, (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties);
|
|
15398
15396
|
// Never use webcomponent for cell render
|
|
15399
15397
|
// It's very slow because of webcomponent initialization takes time
|
|
15400
|
-
|
|
15401
|
-
model:
|
|
15398
|
+
const cellNode = hAsync(CellRenderer, { renderProps: {
|
|
15399
|
+
model: schemaModel,
|
|
15402
15400
|
providers: this.providers,
|
|
15403
|
-
template: (_b =
|
|
15401
|
+
template: (_b = schemaModel.column) === null || _b === void 0 ? void 0 : _b.cellTemplate,
|
|
15404
15402
|
additionalData: this.additionalData,
|
|
15405
15403
|
dragStartCell: this.dragStartCell,
|
|
15406
|
-
}, cellProps: props })
|
|
15404
|
+
}, cellProps: props });
|
|
15405
|
+
cells.push(cellNode);
|
|
15407
15406
|
}
|
|
15408
15407
|
// #endregion
|
|
15409
15408
|
// #region Rows
|
|
@@ -15881,9 +15880,9 @@ const HeaderRenderer = (p) => {
|
|
|
15881
15880
|
transform: `translateX(${p.column.start}px)`,
|
|
15882
15881
|
},
|
|
15883
15882
|
onResize: p.onResize,
|
|
15884
|
-
|
|
15883
|
+
onDblClick(originalEvent) {
|
|
15885
15884
|
var _a;
|
|
15886
|
-
(_a = p.
|
|
15885
|
+
(_a = p.onDblClick) === null || _a === void 0 ? void 0 : _a.call(p, {
|
|
15887
15886
|
column: p.data,
|
|
15888
15887
|
index: p.column.itemIndex,
|
|
15889
15888
|
originalEvent,
|
|
@@ -16011,12 +16010,12 @@ class RevogrHeaderComponent {
|
|
|
16011
16010
|
// render header columns
|
|
16012
16011
|
for (let rgCol of cols) {
|
|
16013
16012
|
const colData = this.colData[rgCol.itemIndex];
|
|
16014
|
-
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),
|
|
16013
|
+
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 }));
|
|
16015
16014
|
visibleProps[colData === null || colData === void 0 ? void 0 : colData.prop] = rgCol.itemIndex;
|
|
16016
16015
|
}
|
|
16017
16016
|
return [
|
|
16018
|
-
hAsync("div", { key: '
|
|
16019
|
-
hAsync("div", { key: '
|
|
16017
|
+
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 })),
|
|
16018
|
+
hAsync("div", { key: '6b373546cc50bd85c7458da556c987e1a556d81b', class: `${HEADER_ROW_CLASS} ${HEADER_ACTUAL_ROW_CLASS}` }, cells),
|
|
16020
16019
|
];
|
|
16021
16020
|
}
|
|
16022
16021
|
get providers() {
|