@revolist/revogrid 4.9.2 → 4.9.4
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/{base.plugin-d48d867d.js → base.plugin-bf5f43a0.js} +2 -2
- package/dist/cjs/{base.plugin-d48d867d.js.map → base.plugin-bf5f43a0.js.map} +1 -1
- package/dist/cjs/{column.service-6f691f50.js → column.service-01f4a6c7.js} +25 -6
- package/dist/cjs/column.service-01f4a6c7.js.map +1 -0
- package/dist/cjs/{dimension.helpers-e9d22516.js → dimension.helpers-a6788214.js} +10 -5
- package/dist/cjs/dimension.helpers-a6788214.js.map +1 -0
- package/dist/cjs/{header-cell-renderer-81a22b00.js → header-cell-renderer-3bc70679.js} +10 -8
- package/dist/cjs/header-cell-renderer-3bc70679.js.map +1 -0
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/revo-grid.cjs.entry.js +81 -93
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-attribution_6.cjs.entry.js +61 -41
- package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +9 -7
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_4.cjs.entry.js +45 -36
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/{selection.helpers-8fa19c04.js → selection.helpers-1a8c8d49.js} +32 -31
- package/dist/cjs/selection.helpers-1a8c8d49.js.map +1 -0
- package/dist/cjs/{throttle-bcc4740d.js → throttle-52be9e67.js} +4 -3
- package/dist/cjs/throttle-52be9e67.js.map +1 -0
- package/dist/cjs/{viewport.store-9cf01c71.js → viewport.store-35a3e7ee.js} +13 -9
- package/dist/cjs/viewport.store-35a3e7ee.js.map +1 -0
- package/dist/collection/components/clipboard/revogr-clipboard.js +5 -5
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
- package/dist/collection/components/data/cell-renderer.js +7 -4
- package/dist/collection/components/data/cell-renderer.js.map +1 -1
- package/dist/collection/components/data/column.service.js +1 -1
- package/dist/collection/components/data/column.service.js.map +1 -1
- package/dist/collection/components/data/revogr-data.js +1 -1
- package/dist/collection/components/data/revogr-data.js.map +1 -1
- package/dist/collection/components/editors/revogr-edit.js +6 -6
- package/dist/collection/components/editors/revogr-edit.js.map +1 -1
- package/dist/collection/components/editors/text-editor.js +3 -1
- package/dist/collection/components/editors/text-editor.js.map +1 -1
- package/dist/collection/components/header/header-renderer.js +2 -1
- package/dist/collection/components/header/header-renderer.js.map +1 -1
- package/dist/collection/components/header/resizable.directive.js +7 -5
- package/dist/collection/components/header/resizable.directive.js.map +1 -1
- package/dist/collection/components/header/resizable.element.js +1 -1
- package/dist/collection/components/header/resizable.element.js.map +1 -1
- package/dist/collection/components/overlay/autofill.service.js +5 -4
- package/dist/collection/components/overlay/autofill.service.js.map +1 -1
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.js +71 -37
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/overlay/selection.utils.js +4 -4
- package/dist/collection/components/overlay/selection.utils.js.map +1 -1
- package/dist/collection/components/revoGrid/grid.helpers.js +10 -8
- package/dist/collection/components/revoGrid/grid.helpers.js.map +1 -1
- package/dist/collection/components/revoGrid/revo-grid.js +42 -42
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.helpers.js +19 -0
- package/dist/collection/components/revoGrid/viewport.helpers.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +4 -3
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.service.js +27 -37
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +2 -2
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +34 -29
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
- package/dist/collection/components/scrollable/autohide-scroll.plugin.js +1 -1
- package/dist/collection/components/scrollable/autohide-scroll.plugin.js.map +1 -1
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +3 -3
- package/dist/collection/components/selectionFocus/revogr-focus.js +1 -1
- package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -1
- package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -1
- package/dist/collection/components/vnode/vnode-converter.js +6 -6
- package/dist/collection/components/vnode/vnode-converter.js.map +1 -1
- package/dist/collection/components/vnode/vnode.utils.js.map +1 -1
- package/dist/collection/global/global.js.map +1 -1
- package/dist/collection/plugins/export/export.plugin.js +2 -2
- package/dist/collection/plugins/export/export.plugin.js.map +1 -1
- package/dist/collection/plugins/filter/filter.panel.js +4 -4
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +1 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +2 -2
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js +1 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js.map +1 -1
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +1 -1
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.js +9 -12
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/services/cell.helpers.js +3 -2
- package/dist/collection/services/cell.helpers.js.map +1 -1
- package/dist/collection/services/column.data.provider.js.map +1 -1
- package/dist/collection/services/data.provider.js.map +1 -1
- package/dist/collection/services/dimension.provider.js +2 -1
- package/dist/collection/services/dimension.provider.js.map +1 -1
- package/dist/collection/services/local.scroll.service.js +3 -2
- package/dist/collection/services/local.scroll.service.js.map +1 -1
- package/dist/collection/services/selection.store.connector.js +20 -16
- package/dist/collection/services/selection.store.connector.js.map +1 -1
- package/dist/collection/store/selection/selection.helpers.js +8 -12
- package/dist/collection/store/selection/selection.helpers.js.map +1 -1
- package/dist/collection/store/selection/selection.store.js +2 -1
- package/dist/collection/store/selection/selection.store.js.map +1 -1
- package/dist/collection/store/vp/viewport.helpers.js +10 -6
- package/dist/collection/store/vp/viewport.helpers.js.map +1 -1
- package/dist/collection/store/vp/viewport.store.js +1 -1
- package/dist/collection/store/vp/viewport.store.js.map +1 -1
- package/dist/collection/themeManager/theme.service.js +1 -1
- package/dist/collection/themeManager/theme.service.js.map +1 -1
- package/dist/collection/types/interfaces.js.map +1 -1
- package/dist/collection/types/selection.js.map +1 -1
- package/dist/collection/types/viewport.interfaces.js.map +1 -1
- package/dist/collection/utils/closest.polifill.js.map +1 -1
- package/dist/collection/utils/store.utils.js +9 -4
- package/dist/collection/utils/store.utils.js.map +1 -1
- package/dist/esm/{base.plugin-78393655.js → base.plugin-5e7a3c51.js} +2 -2
- package/dist/esm/{base.plugin-78393655.js.map → base.plugin-5e7a3c51.js.map} +1 -1
- package/dist/esm/{column.service-0e41057a.js → column.service-5d14e7e9.js} +25 -6
- package/dist/esm/column.service-5d14e7e9.js.map +1 -0
- package/dist/esm/{dimension.helpers-91398565.js → dimension.helpers-56298828.js} +10 -5
- package/dist/esm/dimension.helpers-56298828.js.map +1 -0
- package/dist/esm/{header-cell-renderer-6d8ac25d.js → header-cell-renderer-fc999784.js} +10 -8
- package/dist/esm/header-cell-renderer-fc999784.js.map +1 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/revo-grid.entry.js +81 -93
- package/dist/esm/revo-grid.entry.js.map +1 -1
- package/dist/esm/revogr-attribution_6.entry.js +61 -41
- package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
- package/dist/esm/revogr-clipboard_3.entry.js +9 -7
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
- package/dist/esm/revogr-data_4.entry.js +45 -36
- package/dist/esm/revogr-data_4.entry.js.map +1 -1
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/{selection.helpers-50e9f09d.js → selection.helpers-accaad4a.js} +32 -31
- package/dist/esm/selection.helpers-accaad4a.js.map +1 -0
- package/dist/esm/{throttle-1b1dd9d2.js → throttle-7283692c.js} +4 -3
- package/dist/esm/throttle-7283692c.js.map +1 -0
- package/dist/esm/{viewport.store-bfd0b036.js → viewport.store-d8e03528.js} +13 -9
- package/dist/esm/viewport.store-d8e03528.js.map +1 -0
- package/dist/revo-grid/{base.plugin-78393655.js → base.plugin-5e7a3c51.js} +2 -2
- package/dist/revo-grid/column.service-5d14e7e9.js +5 -0
- package/dist/revo-grid/column.service-5d14e7e9.js.map +1 -0
- package/dist/revo-grid/{dimension.helpers-91398565.js → dimension.helpers-56298828.js} +2 -2
- package/dist/revo-grid/{dimension.helpers-91398565.js.map → dimension.helpers-56298828.js.map} +1 -1
- package/dist/revo-grid/header-cell-renderer-fc999784.js +5 -0
- package/dist/revo-grid/header-cell-renderer-fc999784.js.map +1 -0
- package/dist/revo-grid/index.esm.js +1 -1
- 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/revogr-attribution_6.entry.js +1 -1
- package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +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.map +1 -1
- package/dist/revo-grid/selection.helpers-accaad4a.js +5 -0
- package/dist/revo-grid/selection.helpers-accaad4a.js.map +1 -0
- package/dist/revo-grid/{throttle-1b1dd9d2.js → throttle-7283692c.js} +2 -2
- package/dist/revo-grid/throttle-7283692c.js.map +1 -0
- package/dist/revo-grid/viewport.store-d8e03528.js +5 -0
- package/dist/revo-grid/viewport.store-d8e03528.js.map +1 -0
- package/dist/types/components/data/column.service.d.ts +1 -1
- package/dist/types/components/data/row-highlight.plugin.d.ts +1 -1
- package/dist/types/components/editors/revogr-edit.d.ts +1 -1
- package/dist/types/components/editors/text-editor.d.ts +3 -3
- package/dist/types/components/header/header-renderer.d.ts +2 -2
- package/dist/types/components/header/resizable.directive.d.ts +2 -2
- package/dist/types/components/overlay/autofill.service.d.ts +6 -6
- package/dist/types/components/overlay/keyboard.service.d.ts +4 -4
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +15 -11
- package/dist/types/components/overlay/selection.utils.d.ts +5 -4
- package/dist/types/components/revoGrid/revo-grid.d.ts +7 -6
- package/dist/types/components/revoGrid/viewport.helpers.d.ts +18 -3
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +1 -1
- package/dist/types/components/revoGrid/viewport.service.d.ts +2 -6
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +6 -6
- package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +1 -1
- package/dist/types/components/vnode/vnode-converter.d.ts +1 -1
- package/dist/types/components/vnode/vnode.utils.d.ts +1 -1
- package/dist/types/components.d.ts +21 -18
- package/dist/types/plugins/column.auto-size.plugin.d.ts +2 -2
- package/dist/types/plugins/export/export.plugin.d.ts +3 -3
- package/dist/types/plugins/filter/filter.button.d.ts +1 -1
- package/dist/types/plugins/filter/filter.panel.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.service.d.ts +3 -3
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +8 -8
- package/dist/types/services/column.data.provider.d.ts +1 -1
- package/dist/types/services/data.provider.d.ts +1 -1
- package/dist/types/services/dimension.provider.d.ts +3 -2
- package/dist/types/services/selection.store.connector.d.ts +9 -9
- package/dist/types/store/selection/selection.helpers.d.ts +1 -1
- package/dist/types/store/selection/selection.store.d.ts +4 -4
- package/dist/types/store/vp/viewport.helpers.d.ts +2 -2
- package/dist/types/themeManager/theme.service.d.ts +1 -1
- package/dist/types/types/interfaces.d.ts +4 -1
- package/dist/types/types/viewport.interfaces.d.ts +2 -2
- package/dist/types/utils/store.utils.d.ts +7 -4
- package/hydrate/index.js +261 -210
- package/hydrate/index.mjs +261 -210
- package/package.json +1 -1
- package/standalone/column.service.js +32 -31
- package/standalone/column.service.js.map +1 -1
- package/standalone/data.store.js +9 -4
- package/standalone/data.store.js.map +1 -1
- package/standalone/index.js.map +1 -1
- package/standalone/local.scroll.timer.js +3 -2
- package/standalone/local.scroll.timer.js.map +1 -1
- package/standalone/revo-grid.js +76 -88
- package/standalone/revo-grid.js.map +1 -1
- package/standalone/revogr-clipboard2.js +3 -3
- package/standalone/revogr-clipboard2.js.map +1 -1
- package/standalone/revogr-data2.js +7 -4
- package/standalone/revogr-data2.js.map +1 -1
- package/standalone/revogr-edit2.js +5 -3
- package/standalone/revogr-edit2.js.map +1 -1
- package/standalone/revogr-filter-panel.js.map +1 -1
- package/standalone/revogr-focus2.js.map +1 -1
- package/standalone/revogr-header2.js +11 -8
- package/standalone/revogr-header2.js.map +1 -1
- package/standalone/revogr-overlay-selection2.js +50 -30
- package/standalone/revogr-overlay-selection2.js.map +1 -1
- package/standalone/revogr-row-headers2.js +12 -8
- package/standalone/revogr-row-headers2.js.map +1 -1
- package/standalone/revogr-scroll-virtual2.js +1 -1
- package/standalone/revogr-scroll-virtual2.js.map +1 -1
- package/standalone/revogr-temp-range2.js.map +1 -1
- package/standalone/revogr-viewport-scroll2.js +47 -23
- package/standalone/revogr-viewport-scroll2.js.map +1 -1
- package/standalone/selection.utils.js +4 -4
- package/standalone/selection.utils.js.map +1 -1
- package/standalone/vnode-converter.js +3 -3
- package/standalone/vnode-converter.js.map +1 -1
- package/dist/cjs/column.service-6f691f50.js.map +0 -1
- package/dist/cjs/dimension.helpers-e9d22516.js.map +0 -1
- package/dist/cjs/header-cell-renderer-81a22b00.js.map +0 -1
- package/dist/cjs/selection.helpers-8fa19c04.js.map +0 -1
- package/dist/cjs/throttle-bcc4740d.js.map +0 -1
- package/dist/cjs/viewport.store-9cf01c71.js.map +0 -1
- package/dist/esm/column.service-0e41057a.js.map +0 -1
- package/dist/esm/dimension.helpers-91398565.js.map +0 -1
- package/dist/esm/header-cell-renderer-6d8ac25d.js.map +0 -1
- package/dist/esm/selection.helpers-50e9f09d.js.map +0 -1
- package/dist/esm/throttle-1b1dd9d2.js.map +0 -1
- package/dist/esm/viewport.store-bfd0b036.js.map +0 -1
- package/dist/revo-grid/column.service-0e41057a.js +0 -5
- package/dist/revo-grid/column.service-0e41057a.js.map +0 -1
- package/dist/revo-grid/header-cell-renderer-6d8ac25d.js +0 -5
- package/dist/revo-grid/header-cell-renderer-6d8ac25d.js.map +0 -1
- package/dist/revo-grid/selection.helpers-50e9f09d.js +0 -5
- package/dist/revo-grid/selection.helpers-50e9f09d.js.map +0 -1
- package/dist/revo-grid/throttle-1b1dd9d2.js.map +0 -1
- package/dist/revo-grid/viewport.store-bfd0b036.js +0 -5
- package/dist/revo-grid/viewport.store-bfd0b036.js.map +0 -1
- /package/dist/revo-grid/{base.plugin-78393655.js.map → base.plugin-5e7a3c51.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -2311,10 +2311,10 @@ class Clipboard {
|
|
|
2311
2311
|
}
|
|
2312
2312
|
const clipboardData = this.getData(e);
|
|
2313
2313
|
const isHTML = ((clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.types.indexOf('text/html')) || -1) > -1;
|
|
2314
|
-
const data = isHTML
|
|
2314
|
+
const data = (isHTML
|
|
2315
2315
|
? clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text/html')
|
|
2316
|
-
: clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
|
|
2317
|
-
const dataText = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
|
|
2316
|
+
: clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
|
|
2317
|
+
const dataText = (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
|
|
2318
2318
|
const beforePaste = this.beforePaste.emit({
|
|
2319
2319
|
raw: data,
|
|
2320
2320
|
dataText,
|
|
@@ -6832,11 +6832,16 @@ function gatherTrimmedItems(trimmedItems) {
|
|
|
6832
6832
|
return trimmed;
|
|
6833
6833
|
}
|
|
6834
6834
|
|
|
6835
|
-
/**
|
|
6835
|
+
/**
|
|
6836
|
+
* Sets the given data on the specified store.
|
|
6837
|
+
*
|
|
6838
|
+
* @param store - The store to set data on.
|
|
6839
|
+
* @param data - The data to set on the store.
|
|
6840
|
+
*/
|
|
6836
6841
|
function setStore(store, data) {
|
|
6837
|
-
|
|
6838
|
-
store.set(key,
|
|
6839
|
-
}
|
|
6842
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
6843
|
+
store.set(key, value);
|
|
6844
|
+
});
|
|
6840
6845
|
}
|
|
6841
6846
|
|
|
6842
6847
|
/**
|
|
@@ -7650,7 +7655,8 @@ class SelectionStore {
|
|
|
7650
7655
|
setStore(this.store, { range, edit: null, tempRange: null });
|
|
7651
7656
|
}
|
|
7652
7657
|
setRange(start, end) {
|
|
7653
|
-
|
|
7658
|
+
const range = getRange(start, end);
|
|
7659
|
+
this.setRangeArea(range);
|
|
7654
7660
|
}
|
|
7655
7661
|
setLastCell(lastCell) {
|
|
7656
7662
|
setStore(this.store, { lastCell });
|
|
@@ -7749,7 +7755,7 @@ class SelectionStoreConnector {
|
|
|
7749
7755
|
return this.columnStores[x];
|
|
7750
7756
|
}
|
|
7751
7757
|
this.columnStores[x] = new SelectionStore();
|
|
7752
|
-
// build cross
|
|
7758
|
+
// build cross-linking type to position
|
|
7753
7759
|
this.storesByType[type] = x;
|
|
7754
7760
|
this.storesXToType[x] = type;
|
|
7755
7761
|
return this.columnStores[x];
|
|
@@ -7800,13 +7806,13 @@ class SelectionStoreConnector {
|
|
|
7800
7806
|
(_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
7801
7807
|
delete this.rowStores[y];
|
|
7802
7808
|
delete this.columnStores[x];
|
|
7803
|
-
// clear x cross
|
|
7809
|
+
// clear x cross-link
|
|
7804
7810
|
if (this.storesXToType[x]) {
|
|
7805
7811
|
const type = this.storesXToType[x];
|
|
7806
7812
|
delete this.storesXToType[x];
|
|
7807
7813
|
delete this.storesByType[type];
|
|
7808
7814
|
}
|
|
7809
|
-
// clear y cross
|
|
7815
|
+
// clear y cross-link
|
|
7810
7816
|
if (this.storesYToType[y]) {
|
|
7811
7817
|
const type = this.storesYToType[y];
|
|
7812
7818
|
delete this.storesYToType[y];
|
|
@@ -7836,9 +7842,10 @@ class SelectionStoreConnector {
|
|
|
7836
7842
|
return;
|
|
7837
7843
|
}
|
|
7838
7844
|
// Get the next store based on the current focus and the last cell.
|
|
7839
|
-
const
|
|
7845
|
+
const lastCell = this.focusedStore.entity.store.get('lastCell');
|
|
7846
|
+
const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
|
|
7840
7847
|
// Set the next focus cell in the store.
|
|
7841
|
-
(_a = next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
|
|
7848
|
+
(_a = next === null || next === void 0 ? void 0 : next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
|
|
7842
7849
|
}
|
|
7843
7850
|
focusByCell(storePos, start, end) {
|
|
7844
7851
|
const store = this.stores[storePos.y][storePos.x];
|
|
@@ -7851,15 +7858,17 @@ class SelectionStoreConnector {
|
|
|
7851
7858
|
}
|
|
7852
7859
|
// check for the focus in nearby store/viewport
|
|
7853
7860
|
const lastCell = store.store.get('lastCell');
|
|
7854
|
-
const next = this.getNextStore(focus, currentStorePointer, lastCell);
|
|
7861
|
+
const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
|
|
7855
7862
|
// if next store present - update
|
|
7856
7863
|
if (next === null || next === void 0 ? void 0 : next.store) {
|
|
7857
7864
|
const item = Object.assign(Object.assign({}, focus), next.item);
|
|
7858
7865
|
this.focus(next.store, { focus: item, end: item });
|
|
7859
7866
|
return null;
|
|
7860
7867
|
}
|
|
7861
|
-
|
|
7862
|
-
|
|
7868
|
+
if (lastCell) {
|
|
7869
|
+
focus = cropCellToMax(focus, lastCell);
|
|
7870
|
+
end = cropCellToMax(end, lastCell);
|
|
7871
|
+
}
|
|
7863
7872
|
store.setFocus(focus, end);
|
|
7864
7873
|
return focus;
|
|
7865
7874
|
}
|
|
@@ -7896,10 +7905,9 @@ class SelectionStoreConnector {
|
|
|
7896
7905
|
getNextStore(focus, currentStorePointer, lastCell) {
|
|
7897
7906
|
// item in new store
|
|
7898
7907
|
const nextItem = nextCell(focus, lastCell);
|
|
7899
|
-
let nextStore
|
|
7908
|
+
let nextStore;
|
|
7900
7909
|
if (nextItem) {
|
|
7901
|
-
|
|
7902
|
-
let type = i;
|
|
7910
|
+
Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
|
|
7903
7911
|
let stores;
|
|
7904
7912
|
switch (type) {
|
|
7905
7913
|
case 'x':
|
|
@@ -7909,20 +7917,20 @@ class SelectionStoreConnector {
|
|
|
7909
7917
|
case 'y':
|
|
7910
7918
|
// Get the Y stores for the current X coordinate of the current store pointer
|
|
7911
7919
|
stores = this.getYStores(currentStorePointer.x);
|
|
7912
|
-
stores = this.getYStores(currentStorePointer.x);
|
|
7913
7920
|
break;
|
|
7914
7921
|
}
|
|
7915
|
-
|
|
7922
|
+
// Get the next store based on the item in the new store
|
|
7923
|
+
if (nextItemCoord >= 0) {
|
|
7916
7924
|
nextStore = stores[++currentStorePointer[type]];
|
|
7917
7925
|
}
|
|
7918
7926
|
else {
|
|
7919
7927
|
nextStore = stores[--currentStorePointer[type]];
|
|
7920
7928
|
const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
|
|
7921
7929
|
if (nextLastCell) {
|
|
7922
|
-
nextItem[type] = nextLastCell[type] +
|
|
7930
|
+
nextItem[type] = nextLastCell[type] + nextItemCoord;
|
|
7923
7931
|
}
|
|
7924
7932
|
}
|
|
7925
|
-
}
|
|
7933
|
+
});
|
|
7926
7934
|
}
|
|
7927
7935
|
return {
|
|
7928
7936
|
store: nextStore,
|
|
@@ -7954,7 +7962,9 @@ class SelectionStoreConnector {
|
|
|
7954
7962
|
continue;
|
|
7955
7963
|
}
|
|
7956
7964
|
const lastCell = store.store.get('lastCell');
|
|
7957
|
-
|
|
7965
|
+
if (lastCell) {
|
|
7966
|
+
store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
|
|
7967
|
+
}
|
|
7958
7968
|
}
|
|
7959
7969
|
}
|
|
7960
7970
|
}
|
|
@@ -7993,21 +8003,17 @@ function nextCell(cell, lastCell) {
|
|
|
7993
8003
|
return null;
|
|
7994
8004
|
}
|
|
7995
8005
|
function cropCellToMax(cell, lastCell) {
|
|
7996
|
-
const
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
newCell[t] = 0;
|
|
8006
|
+
const croppedCell = Object.assign({}, cell);
|
|
8007
|
+
const cellCoordinates = ['x', 'y'];
|
|
8008
|
+
for (const coordinate of cellCoordinates) {
|
|
8009
|
+
if (cell[coordinate] < 0) {
|
|
8010
|
+
croppedCell[coordinate] = 0;
|
|
8002
8011
|
}
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
for (let t of types) {
|
|
8006
|
-
if (cell[t] >= lastCell[t]) {
|
|
8007
|
-
newCell[t] = lastCell[t] - 1;
|
|
8012
|
+
else if (cell[coordinate] >= lastCell[coordinate]) {
|
|
8013
|
+
croppedCell[coordinate] = lastCell[coordinate] - 1;
|
|
8008
8014
|
}
|
|
8009
8015
|
}
|
|
8010
|
-
return
|
|
8016
|
+
return croppedCell;
|
|
8011
8017
|
}
|
|
8012
8018
|
function getRange(start, end) {
|
|
8013
8019
|
return start && end
|
|
@@ -8123,6 +8129,7 @@ function getItems(opt, currentSize = 0) {
|
|
|
8123
8129
|
return items;
|
|
8124
8130
|
}
|
|
8125
8131
|
function recombineByOffset(offset, data) {
|
|
8132
|
+
var _a, _b;
|
|
8126
8133
|
const newItems = [...data.items];
|
|
8127
8134
|
const itemsCount = newItems.length;
|
|
8128
8135
|
let newRange = {
|
|
@@ -8131,7 +8138,7 @@ function recombineByOffset(offset, data) {
|
|
|
8131
8138
|
};
|
|
8132
8139
|
// if offset out of revo-viewport, makes sense whole redraw
|
|
8133
8140
|
if (offset > itemsCount) {
|
|
8134
|
-
return
|
|
8141
|
+
return undefined;
|
|
8135
8142
|
}
|
|
8136
8143
|
// is direction of scroll positive
|
|
8137
8144
|
if (data.positiveDirection) {
|
|
@@ -8170,19 +8177,21 @@ function recombineByOffset(offset, data) {
|
|
|
8170
8177
|
let firstItem = getFirstItem(data);
|
|
8171
8178
|
const end = newRange.end;
|
|
8172
8179
|
for (let i = 0; i < offset; i++) {
|
|
8173
|
-
const newIndex = firstItem.itemIndex - 1;
|
|
8180
|
+
const newIndex = ((_a = firstItem === null || firstItem === void 0 ? void 0 : firstItem.itemIndex) !== null && _a !== void 0 ? _a : 0) - 1;
|
|
8174
8181
|
const size = getItemSize(newIndex, data.sizes, data.originItemSize);
|
|
8175
8182
|
// new item index to recombine
|
|
8176
8183
|
let newStart = end - i;
|
|
8177
8184
|
newStart = (newStart < 0 ? itemsCount + newStart : newStart) % itemsCount;
|
|
8178
8185
|
// item should always present, we do not create new item, we recombine them
|
|
8179
8186
|
if (!newItems[newStart]) {
|
|
8180
|
-
|
|
8187
|
+
console.error('incorrect index');
|
|
8188
|
+
break;
|
|
8181
8189
|
}
|
|
8182
8190
|
// do recombination
|
|
8191
|
+
const firstItemStart = (_b = firstItem === null || firstItem === void 0 ? void 0 : firstItem.start) !== null && _b !== void 0 ? _b : 0;
|
|
8183
8192
|
newItems[newStart] = firstItem = {
|
|
8184
|
-
start:
|
|
8185
|
-
end:
|
|
8193
|
+
start: firstItemStart - size,
|
|
8194
|
+
end: firstItemStart,
|
|
8186
8195
|
itemIndex: newIndex,
|
|
8187
8196
|
size: size,
|
|
8188
8197
|
};
|
|
@@ -8218,11 +8227,12 @@ function isActiveRange(pos, realSize, first, last) {
|
|
|
8218
8227
|
(pos > first.end && last.end === realSize));
|
|
8219
8228
|
}
|
|
8220
8229
|
function isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem) {
|
|
8230
|
+
var _a;
|
|
8221
8231
|
// if no first item, means no items in viewport
|
|
8222
8232
|
if (!firstItem) {
|
|
8223
8233
|
return false;
|
|
8224
8234
|
}
|
|
8225
|
-
return virtualSize + pos > (lastItem === null || lastItem === void 0 ? void 0 : lastItem.end);
|
|
8235
|
+
return virtualSize + pos > ((_a = lastItem === null || lastItem === void 0 ? void 0 : lastItem.end) !== null && _a !== void 0 ? _a : 0);
|
|
8226
8236
|
}
|
|
8227
8237
|
function getFirstItem(s) {
|
|
8228
8238
|
return s.items[s.start];
|
|
@@ -8365,7 +8375,7 @@ class ViewportStore {
|
|
|
8365
8375
|
}
|
|
8366
8376
|
else if (isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem)) {
|
|
8367
8377
|
const items = [...allItems.items];
|
|
8368
|
-
// check is any item missing for
|
|
8378
|
+
// check is any item missing for fulfill content
|
|
8369
8379
|
const missing = addMissingItems(firstItem, this.store.get('realCount'), virtualSize + pos - firstItem.start, allItems, {
|
|
8370
8380
|
sizes: dimension.sizes,
|
|
8371
8381
|
originItemSize: dimension.originItemSize,
|
|
@@ -8744,7 +8754,7 @@ function measureEqualDepth(groupA, groupB) {
|
|
|
8744
8754
|
}
|
|
8745
8755
|
function getParsedGroup(id) {
|
|
8746
8756
|
const parseGroup = JSON.parse(id);
|
|
8747
|
-
// extra precaution and type
|
|
8757
|
+
// extra precaution and type safeguard
|
|
8748
8758
|
if (!Array.isArray(parseGroup)) {
|
|
8749
8759
|
return null;
|
|
8750
8760
|
}
|
|
@@ -8860,7 +8870,7 @@ class ColumnService {
|
|
|
8860
8870
|
const data = this.rowDataModel(r, c);
|
|
8861
8871
|
return readOnly(data);
|
|
8862
8872
|
}
|
|
8863
|
-
return readOnly;
|
|
8873
|
+
return !!readOnly;
|
|
8864
8874
|
}
|
|
8865
8875
|
mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
|
|
8866
8876
|
const cellClass = {
|
|
@@ -9301,18 +9311,18 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
|
9301
9311
|
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9302
9312
|
}
|
|
9303
9313
|
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9304
|
-
const updateCoordinate = (c) => {
|
|
9314
|
+
const updateCoordinate = (c, pos = 0) => {
|
|
9305
9315
|
const start = { x: range.x, y: range.y };
|
|
9306
9316
|
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9307
9317
|
const point = end[c] > focus[c] ? end : start;
|
|
9308
|
-
point[c] +=
|
|
9318
|
+
point[c] += pos;
|
|
9309
9319
|
return { start, end };
|
|
9310
9320
|
};
|
|
9311
9321
|
if (changes.x) {
|
|
9312
|
-
return updateCoordinate('x');
|
|
9322
|
+
return updateCoordinate('x', changes['x']);
|
|
9313
9323
|
}
|
|
9314
9324
|
if (changes.y) {
|
|
9315
|
-
return updateCoordinate('y');
|
|
9325
|
+
return updateCoordinate('y', changes['y']);
|
|
9316
9326
|
}
|
|
9317
9327
|
return null;
|
|
9318
9328
|
}
|
|
@@ -9716,8 +9726,9 @@ class AutoFillService {
|
|
|
9716
9726
|
this.sv.setTempRange(null);
|
|
9717
9727
|
}
|
|
9718
9728
|
else {
|
|
9729
|
+
const area = getRange(this.autoFillInitial, this.autoFillLast);
|
|
9719
9730
|
this.sv.setTempRange({
|
|
9720
|
-
area
|
|
9731
|
+
area,
|
|
9721
9732
|
type: this.autoFillType,
|
|
9722
9733
|
});
|
|
9723
9734
|
}
|
|
@@ -9752,7 +9763,7 @@ class AutoFillService {
|
|
|
9752
9763
|
range,
|
|
9753
9764
|
});
|
|
9754
9765
|
// If data apply was not prevented, apply new range
|
|
9755
|
-
if (!stopApply) {
|
|
9766
|
+
if (!stopApply && oldRange) {
|
|
9756
9767
|
this.applyRangeWithData(newRange, oldRange);
|
|
9757
9768
|
}
|
|
9758
9769
|
else {
|
|
@@ -9790,14 +9801,14 @@ class AutoFillService {
|
|
|
9790
9801
|
this.sv.setRange(range);
|
|
9791
9802
|
}
|
|
9792
9803
|
/** Apply range and copy data during range application */
|
|
9793
|
-
applyRangeWithData(newRange,
|
|
9804
|
+
applyRangeWithData(newRange, rangeToCopy) {
|
|
9794
9805
|
const rangeData = {
|
|
9795
9806
|
type: this.sv.dataStore.get('type'),
|
|
9796
9807
|
colType: this.sv.columnService.type,
|
|
9797
9808
|
newData: {},
|
|
9798
9809
|
mapping: {},
|
|
9799
9810
|
newRange,
|
|
9800
|
-
oldRange,
|
|
9811
|
+
oldRange: rangeToCopy,
|
|
9801
9812
|
};
|
|
9802
9813
|
const { mapping, changed } = this.sv.columnService.getRangeData(rangeData, this.sv.columnService.columns);
|
|
9803
9814
|
rangeData.newData = changed;
|
|
@@ -9864,7 +9875,6 @@ class OverlaySelection {
|
|
|
9864
9875
|
this.beforeCellSave = createEvent(this, "beforecellsave", 7);
|
|
9865
9876
|
this.keyboardService = null;
|
|
9866
9877
|
this.autoFillService = null;
|
|
9867
|
-
this.revogrEdit = null;
|
|
9868
9878
|
this.unsubscribeSelectionStore = [];
|
|
9869
9879
|
this.readonly = undefined;
|
|
9870
9880
|
this.range = undefined;
|
|
@@ -9884,19 +9894,21 @@ class OverlaySelection {
|
|
|
9884
9894
|
// #endregion
|
|
9885
9895
|
// #region Listeners
|
|
9886
9896
|
onMouseMove(e) {
|
|
9897
|
+
var _a;
|
|
9887
9898
|
if (this.selectionStore.get('focus')) {
|
|
9888
|
-
this.autoFillService.selectionMouseMove(e);
|
|
9899
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionMouseMove(e);
|
|
9889
9900
|
}
|
|
9890
9901
|
}
|
|
9891
9902
|
/**
|
|
9892
|
-
* Action finished inside
|
|
9903
|
+
* Action finished inside the document.
|
|
9893
9904
|
* Pointer left document, clear any active operation.
|
|
9894
9905
|
*/
|
|
9895
9906
|
onMouseUp() {
|
|
9896
|
-
|
|
9907
|
+
var _a;
|
|
9908
|
+
// Clear autofill selection
|
|
9897
9909
|
// when pointer left document,
|
|
9898
9910
|
// clear any active operation.
|
|
9899
|
-
this.autoFillService.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
|
|
9911
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
|
|
9900
9912
|
}
|
|
9901
9913
|
/**
|
|
9902
9914
|
* Row drag started.
|
|
@@ -9913,7 +9925,7 @@ class OverlaySelection {
|
|
|
9913
9925
|
*/
|
|
9914
9926
|
onKeyUp(e) {
|
|
9915
9927
|
// Emit before key up event.
|
|
9916
|
-
this.beforeKeyUp.emit(e);
|
|
9928
|
+
this.beforeKeyUp.emit(Object.assign({ original: e }, this.getData()));
|
|
9917
9929
|
}
|
|
9918
9930
|
/**
|
|
9919
9931
|
* Get keyboard down from element.
|
|
@@ -9922,7 +9934,7 @@ class OverlaySelection {
|
|
|
9922
9934
|
onKeyDown(e) {
|
|
9923
9935
|
var _a;
|
|
9924
9936
|
// Emit before key down event and check if default prevention is set.
|
|
9925
|
-
const proxy = this.beforeKeyDown.emit(e);
|
|
9937
|
+
const proxy = this.beforeKeyDown.emit(Object.assign({ original: e }, this.getData()));
|
|
9926
9938
|
if (e.defaultPrevented || proxy.defaultPrevented) {
|
|
9927
9939
|
return;
|
|
9928
9940
|
}
|
|
@@ -9940,10 +9952,10 @@ class OverlaySelection {
|
|
|
9940
9952
|
// clear subscriptions
|
|
9941
9953
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
9942
9954
|
this.unsubscribeSelectionStore.length = 0;
|
|
9943
|
-
this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => this.doFocus(v, v)));
|
|
9955
|
+
this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => v && this.doFocus(v, v)));
|
|
9944
9956
|
this.keyboardService = new KeyboardService({
|
|
9945
9957
|
selectionStore: s,
|
|
9946
|
-
range: r => this.triggerRangeEvent(r),
|
|
9958
|
+
range: r => !!r && this.triggerRangeEvent(r),
|
|
9947
9959
|
focus: (f, changes, focusNextViewport) => {
|
|
9948
9960
|
if (focusNextViewport) {
|
|
9949
9961
|
this.beforeNextViewportFocus.emit(f);
|
|
@@ -9960,7 +9972,8 @@ class OverlaySelection {
|
|
|
9960
9972
|
this.doEdit(val);
|
|
9961
9973
|
},
|
|
9962
9974
|
cancel: async () => {
|
|
9963
|
-
|
|
9975
|
+
var _a;
|
|
9976
|
+
await ((_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.cancelChanges());
|
|
9964
9977
|
this.closeEdit();
|
|
9965
9978
|
},
|
|
9966
9979
|
clearCell: () => !this.readonly && this.clearCell(),
|
|
@@ -9982,7 +9995,7 @@ class OverlaySelection {
|
|
|
9982
9995
|
selectionChanged: e => this.selectionChange.emit(e),
|
|
9983
9996
|
rangeCopy: e => this.beforeRangeCopyApply.emit(e),
|
|
9984
9997
|
rangeDataApply: e => this.rangeEditApply.emit(e),
|
|
9985
|
-
setRange: e => this.triggerRangeEvent(e),
|
|
9998
|
+
setRange: e => !!e && this.triggerRangeEvent(e),
|
|
9986
9999
|
getData: () => this.getData(),
|
|
9987
10000
|
});
|
|
9988
10001
|
}
|
|
@@ -10044,6 +10057,7 @@ class OverlaySelection {
|
|
|
10044
10057
|
} }));
|
|
10045
10058
|
}
|
|
10046
10059
|
render() {
|
|
10060
|
+
var _a;
|
|
10047
10061
|
const nodes = [];
|
|
10048
10062
|
const editCell = this.renderEditor();
|
|
10049
10063
|
// Editor
|
|
@@ -10063,14 +10077,14 @@ class OverlaySelection {
|
|
|
10063
10077
|
}
|
|
10064
10078
|
// Autofill
|
|
10065
10079
|
if (focus && !this.readonly && this.range) {
|
|
10066
|
-
nodes.push(this.autoFillService.renderAutofill(range, focus));
|
|
10080
|
+
nodes.push((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.renderAutofill(range, focus));
|
|
10067
10081
|
}
|
|
10068
10082
|
// Order
|
|
10069
10083
|
if (this.canDrag) {
|
|
10070
10084
|
nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
10071
10085
|
}
|
|
10072
10086
|
}
|
|
10073
|
-
return (hAsync(Host, { key: '
|
|
10087
|
+
return (hAsync(Host, { key: '1913cd032d2cede0a8d560e330358a178500dc21', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, nodes, hAsync("slot", { key: '96cc5bc4e39d5d229f4d3c7ae98d092cc5ff9102', name: "data" })));
|
|
10074
10088
|
}
|
|
10075
10089
|
/**
|
|
10076
10090
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -10125,6 +10139,7 @@ class OverlaySelection {
|
|
|
10125
10139
|
* Handle mouse down event on Host element
|
|
10126
10140
|
*/
|
|
10127
10141
|
onElementMouseDown(e, touch = false) {
|
|
10142
|
+
var _a;
|
|
10128
10143
|
// Get the target element from the event object
|
|
10129
10144
|
const targetElement = e.target;
|
|
10130
10145
|
// Ignore focus if clicked input
|
|
@@ -10141,7 +10156,7 @@ class OverlaySelection {
|
|
|
10141
10156
|
this.focus(focusCell, this.range && e.shiftKey);
|
|
10142
10157
|
// Initiate autofill selection
|
|
10143
10158
|
if (this.range) {
|
|
10144
|
-
this.autoFillService.selectionStart(targetElement, this.getData());
|
|
10159
|
+
targetElement && ((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionStart(targetElement, this.getData()));
|
|
10145
10160
|
// Prevent default behavior for mouse events,
|
|
10146
10161
|
// but only if target element is not a mobile input
|
|
10147
10162
|
if (!touch) {
|
|
@@ -10161,18 +10176,21 @@ class OverlaySelection {
|
|
|
10161
10176
|
var _a;
|
|
10162
10177
|
if (this.canEdit()) {
|
|
10163
10178
|
const focus = this.selectionStore.get('focus');
|
|
10179
|
+
if (!focus) {
|
|
10180
|
+
return;
|
|
10181
|
+
}
|
|
10164
10182
|
const data = this.columnService.getSaveData(focus.y, focus.x);
|
|
10165
10183
|
(_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
|
|
10166
10184
|
}
|
|
10167
10185
|
}
|
|
10168
10186
|
/**
|
|
10169
10187
|
* Close editor event triggered
|
|
10170
|
-
* @param details - if requires focus next
|
|
10188
|
+
* @param details - if it requires focus next
|
|
10171
10189
|
*/
|
|
10172
|
-
closeEdit(e) {
|
|
10190
|
+
async closeEdit(e) {
|
|
10173
10191
|
this.cancelEdit.emit();
|
|
10174
10192
|
if (e === null || e === void 0 ? void 0 : e.detail) {
|
|
10175
|
-
this.focusNext();
|
|
10193
|
+
await this.focusNext();
|
|
10176
10194
|
}
|
|
10177
10195
|
}
|
|
10178
10196
|
/**
|
|
@@ -10192,6 +10210,7 @@ class OverlaySelection {
|
|
|
10192
10210
|
return range;
|
|
10193
10211
|
}
|
|
10194
10212
|
onCopy(e) {
|
|
10213
|
+
var _a;
|
|
10195
10214
|
const range = this.getRegion();
|
|
10196
10215
|
const canCopyEvent = this.beforeCopyRegion.emit(range);
|
|
10197
10216
|
if (canCopyEvent.defaultPrevented) {
|
|
@@ -10207,10 +10226,11 @@ class OverlaySelection {
|
|
|
10207
10226
|
rangeData = event.detail.data;
|
|
10208
10227
|
}
|
|
10209
10228
|
}
|
|
10210
|
-
this.clipboard.doCopy(e, rangeData);
|
|
10229
|
+
(_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.doCopy(e, rangeData);
|
|
10211
10230
|
return true;
|
|
10212
10231
|
}
|
|
10213
10232
|
onPaste(data) {
|
|
10233
|
+
var _a;
|
|
10214
10234
|
const focus = this.selectionStore.get('focus');
|
|
10215
10235
|
const isEditing = this.selectionStore.get('edit') !== null;
|
|
10216
10236
|
if (!focus || isEditing) {
|
|
@@ -10221,24 +10241,30 @@ class OverlaySelection {
|
|
|
10221
10241
|
if (canPaste) {
|
|
10222
10242
|
return;
|
|
10223
10243
|
}
|
|
10224
|
-
this.autoFillService.onRangeApply(changed, range);
|
|
10244
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range);
|
|
10225
10245
|
}
|
|
10226
10246
|
async focusNext() {
|
|
10227
|
-
|
|
10247
|
+
var _a;
|
|
10248
|
+
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
10228
10249
|
code: codesLetter.ARROW_DOWN,
|
|
10229
|
-
}), this.range);
|
|
10250
|
+
}), this.range));
|
|
10230
10251
|
if (!canFocus) {
|
|
10231
10252
|
this.closeEdit();
|
|
10232
10253
|
}
|
|
10233
10254
|
}
|
|
10234
10255
|
clearCell() {
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10256
|
+
var _a;
|
|
10257
|
+
const range = this.selectionStore.get('range');
|
|
10258
|
+
if (range &&
|
|
10259
|
+
!isRangeSingleCell(range)) {
|
|
10260
|
+
const data = this.columnService.getRangeStaticData(range, '');
|
|
10261
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range);
|
|
10239
10262
|
}
|
|
10240
10263
|
else if (this.canEdit()) {
|
|
10241
10264
|
const focused = this.selectionStore.get('focus');
|
|
10265
|
+
if (!focused) {
|
|
10266
|
+
return;
|
|
10267
|
+
}
|
|
10242
10268
|
const cell = this.columnService.getSaveData(focused.y, focused.x);
|
|
10243
10269
|
this.cellEdit({
|
|
10244
10270
|
rgRow: focused.y,
|
|
@@ -10275,7 +10301,10 @@ class OverlaySelection {
|
|
|
10275
10301
|
const end = cell;
|
|
10276
10302
|
const start = this.selectionStore.get('focus');
|
|
10277
10303
|
if (isRangeEdit && start) {
|
|
10278
|
-
|
|
10304
|
+
const range = getRange(start, end);
|
|
10305
|
+
if (range) {
|
|
10306
|
+
return this.triggerRangeEvent(range);
|
|
10307
|
+
}
|
|
10279
10308
|
}
|
|
10280
10309
|
return this.doFocus(cell, end);
|
|
10281
10310
|
}
|
|
@@ -10296,6 +10325,7 @@ class OverlaySelection {
|
|
|
10296
10325
|
lastCell: this.lastCell,
|
|
10297
10326
|
focus: this.selectionStore.get('focus'),
|
|
10298
10327
|
range: this.selectionStore.get('range'),
|
|
10328
|
+
edit: this.selectionStore.get('edit'),
|
|
10299
10329
|
};
|
|
10300
10330
|
}
|
|
10301
10331
|
get element() { return getElement(this); }
|
|
@@ -10336,6 +10366,7 @@ class TextEditor {
|
|
|
10336
10366
|
constructor(column, saveCallback) {
|
|
10337
10367
|
this.column = column;
|
|
10338
10368
|
this.saveCallback = saveCallback;
|
|
10369
|
+
this.editInput = null;
|
|
10339
10370
|
this.element = null;
|
|
10340
10371
|
this.editCell = undefined;
|
|
10341
10372
|
}
|
|
@@ -10366,7 +10397,8 @@ class TextEditor {
|
|
|
10366
10397
|
* IMPORTANT: Prevent scroll glitches when editor is closed and focus is on current input element.
|
|
10367
10398
|
*/
|
|
10368
10399
|
beforeDisconnect() {
|
|
10369
|
-
|
|
10400
|
+
var _a;
|
|
10401
|
+
(_a = this.editInput) === null || _a === void 0 ? void 0 : _a.blur();
|
|
10370
10402
|
}
|
|
10371
10403
|
/**
|
|
10372
10404
|
* Get value from input
|
|
@@ -10469,8 +10501,8 @@ class RevoEdit {
|
|
|
10469
10501
|
}
|
|
10470
10502
|
}
|
|
10471
10503
|
componentWillRender() {
|
|
10472
|
-
// Active editor present
|
|
10473
|
-
if (this.currentEditor) {
|
|
10504
|
+
// Active editor present and not yet closed.
|
|
10505
|
+
if (this.currentEditor || !this.column) {
|
|
10474
10506
|
return;
|
|
10475
10507
|
}
|
|
10476
10508
|
this.preventSaveOnClose = false;
|
|
@@ -11151,8 +11183,9 @@ class DimensionProvider {
|
|
|
11151
11183
|
}
|
|
11152
11184
|
/**
|
|
11153
11185
|
* Sets dimension data and view port coordinate
|
|
11154
|
-
* @param
|
|
11186
|
+
* @param itemCount
|
|
11155
11187
|
* @param type - dimension type
|
|
11188
|
+
* @param noVirtual - disable virtual data
|
|
11156
11189
|
*/
|
|
11157
11190
|
setData(itemCount, type, noVirtual = false) {
|
|
11158
11191
|
this.setItemCount(itemCount, type);
|
|
@@ -11306,7 +11339,7 @@ class ThemeService {
|
|
|
11306
11339
|
}
|
|
11307
11340
|
}
|
|
11308
11341
|
static getTheme(theme) {
|
|
11309
|
-
if (allowedThemes.indexOf(theme) > -1) {
|
|
11342
|
+
if (theme && allowedThemes.indexOf(theme) > -1) {
|
|
11310
11343
|
return theme;
|
|
11311
11344
|
}
|
|
11312
11345
|
return DEFAULT_THEME;
|
|
@@ -12162,10 +12195,6 @@ class SortingPlugin extends BasePlugin {
|
|
|
12162
12195
|
constructor(revogrid, providers) {
|
|
12163
12196
|
super(revogrid, providers);
|
|
12164
12197
|
this.revogrid = revogrid;
|
|
12165
|
-
// sorting order per column
|
|
12166
|
-
this.sorting = null;
|
|
12167
|
-
// sorting function per column, multiple columns sorting supported
|
|
12168
|
-
this.sortingFunc = null;
|
|
12169
12198
|
this.sortingPromise = null;
|
|
12170
12199
|
this.postponeSort = debounce_1(async (order, comparison) => this.runSorting(order, comparison), 50);
|
|
12171
12200
|
const beforeanysource = async ({ detail: { type }, }) => {
|
|
@@ -12179,7 +12208,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12179
12208
|
}
|
|
12180
12209
|
};
|
|
12181
12210
|
const aftercolumnsset = async ({ detail: { order }, }) => {
|
|
12182
|
-
const columns = await this.revogrid.getColumns();
|
|
12211
|
+
const columns = (await this.revogrid.getColumns());
|
|
12183
12212
|
const sortingFunc = {};
|
|
12184
12213
|
for (let prop in order) {
|
|
12185
12214
|
const cmp = this.getComparer(ColumnDataProvider.getColumnByProp(columns, prop), order[prop]);
|
|
@@ -12225,6 +12254,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12225
12254
|
* If additive - add to existing sorting, multiple columns can be sorted
|
|
12226
12255
|
*/
|
|
12227
12256
|
async headerclick(column, index, additive) {
|
|
12257
|
+
var _a, _b;
|
|
12228
12258
|
let order = this.getNextOrder(column.order);
|
|
12229
12259
|
const beforeEvent = this.emit('beforesorting', { column, order, additive });
|
|
12230
12260
|
if (beforeEvent.defaultPrevented) {
|
|
@@ -12265,8 +12295,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
12265
12295
|
this.sortingFunc = { [column.prop]: cmp };
|
|
12266
12296
|
}
|
|
12267
12297
|
else {
|
|
12268
|
-
|
|
12269
|
-
|
|
12298
|
+
(_a = this.sorting) === null || _a === void 0 ? true : delete _a[column.prop];
|
|
12299
|
+
(_b = this.sortingFunc) === null || _b === void 0 ? true : delete _b[column.prop];
|
|
12270
12300
|
}
|
|
12271
12301
|
}
|
|
12272
12302
|
this.startSorting(this.sorting, this.sortingFunc);
|
|
@@ -12282,8 +12312,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
12282
12312
|
async sort(sorting, sortingFunc, types = ['rgRow', 'rowPinStart', 'rowPinEnd']) {
|
|
12283
12313
|
// if no sorting - reset
|
|
12284
12314
|
if (!size_1(sorting)) {
|
|
12285
|
-
this.sorting =
|
|
12286
|
-
this.sortingFunc =
|
|
12315
|
+
this.sorting = undefined;
|
|
12316
|
+
this.sortingFunc = undefined;
|
|
12287
12317
|
for (let type of types) {
|
|
12288
12318
|
const store = await this.revogrid.getSourceStore(type);
|
|
12289
12319
|
// row data
|
|
@@ -12328,10 +12358,10 @@ class SortingPlugin extends BasePlugin {
|
|
|
12328
12358
|
return -1 * cmp(prop, a, b);
|
|
12329
12359
|
};
|
|
12330
12360
|
}
|
|
12331
|
-
sortIndexByItems(indexes, source, sortingFunc) {
|
|
12361
|
+
sortIndexByItems(indexes, source, sortingFunc = {}) {
|
|
12332
12362
|
// if no sorting - return unsorted indexes
|
|
12333
12363
|
if (Object.entries(sortingFunc).length === 0) {
|
|
12334
|
-
//
|
|
12364
|
+
// Unsorted indexes
|
|
12335
12365
|
return [...Array(indexes.length).keys()];
|
|
12336
12366
|
}
|
|
12337
12367
|
//
|
|
@@ -12347,7 +12377,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12347
12377
|
* If the comparison function returns a non-zero value (sorted), it means that the items should be sorted based on the given property. In such a case, the function immediately returns the sorted value, indicating the order in which the items should be arranged.
|
|
12348
12378
|
* If none of the comparison functions result in a non-zero value, indicating that the items are equal or should remain in the same order, the function eventually returns 0.
|
|
12349
12379
|
*/
|
|
12350
|
-
const sorted = cmp(prop, itemA, itemB);
|
|
12380
|
+
const sorted = cmp === null || cmp === void 0 ? void 0 : cmp(prop, itemA, itemB);
|
|
12351
12381
|
if (sorted) {
|
|
12352
12382
|
return sorted;
|
|
12353
12383
|
}
|
|
@@ -12597,13 +12627,13 @@ class ExportFilePlugin extends BasePlugin {
|
|
|
12597
12627
|
/** Export file */
|
|
12598
12628
|
async exportFile(options = {}, t = ExportTypes.csv) {
|
|
12599
12629
|
const formatter = this.formatter(t, options);
|
|
12600
|
-
const blob = await this.getBlob(formatter);
|
|
12601
12630
|
// url
|
|
12602
12631
|
const URL = window.URL || window.webkitURL;
|
|
12603
12632
|
const a = document.createElement('a');
|
|
12604
12633
|
const { filename, fileKind } = formatter.options;
|
|
12605
12634
|
const name = `${filename}.${fileKind}`;
|
|
12606
|
-
const
|
|
12635
|
+
const blob = await this.getBlob(formatter);
|
|
12636
|
+
const url = blob ? URL.createObjectURL(blob) : '';
|
|
12607
12637
|
a.style.display = 'none';
|
|
12608
12638
|
a.setAttribute('href', url);
|
|
12609
12639
|
a.setAttribute('download', name);
|
|
@@ -13028,7 +13058,7 @@ class GroupingRowPlugin extends BasePlugin {
|
|
|
13028
13058
|
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({ prevExpanded }, options));
|
|
13029
13059
|
// setup source
|
|
13030
13060
|
this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer: options === null || options === void 0 ? void 0 : options.groupLabelTemplate }, true);
|
|
13031
|
-
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes, oldNewIndexMap);
|
|
13061
|
+
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap);
|
|
13032
13062
|
}
|
|
13033
13063
|
/**
|
|
13034
13064
|
* Apply grouping on data set
|
|
@@ -13094,7 +13124,7 @@ class GroupingRowPlugin extends BasePlugin {
|
|
|
13094
13124
|
this.providers.data.setData(source, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, undefined, true);
|
|
13095
13125
|
this.updateTrimmed(undefined, undefined, oldNewIndexes);
|
|
13096
13126
|
}
|
|
13097
|
-
updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap, secondLevelMap) {
|
|
13127
|
+
updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap = {}, secondLevelMap) {
|
|
13098
13128
|
// map previously trimmed data
|
|
13099
13129
|
const trimemedOptionsToUpgrade = processDoubleConversionTrimmed(this.trimmed, firstLevelMap, secondLevelMap);
|
|
13100
13130
|
for (let type in trimemedOptionsToUpgrade) {
|
|
@@ -13132,6 +13162,25 @@ function getLastCell(data, rowType) {
|
|
|
13132
13162
|
y: lastVisibleRowCount,
|
|
13133
13163
|
};
|
|
13134
13164
|
}
|
|
13165
|
+
function viewportDataPartition(data, type, slot, fixed) {
|
|
13166
|
+
return {
|
|
13167
|
+
colData: data.colStore,
|
|
13168
|
+
viewportCol: data.viewports[data.colType].store,
|
|
13169
|
+
viewportRow: data.viewports[type].store,
|
|
13170
|
+
// lastCell is the last real coordinate + 1
|
|
13171
|
+
lastCell: getLastCell(data, type),
|
|
13172
|
+
slot,
|
|
13173
|
+
type,
|
|
13174
|
+
canDrag: !fixed,
|
|
13175
|
+
position: data.position,
|
|
13176
|
+
dataStore: data.rowStores[type].store,
|
|
13177
|
+
dimensionCol: data.dimensions[data.colType].store,
|
|
13178
|
+
dimensionRow: data.dimensions[type].store,
|
|
13179
|
+
style: fixed
|
|
13180
|
+
? { height: `${data.dimensions[type].store.get('realSize')}px` }
|
|
13181
|
+
: undefined,
|
|
13182
|
+
};
|
|
13183
|
+
}
|
|
13135
13184
|
|
|
13136
13185
|
/** Collect Column data */
|
|
13137
13186
|
function gatherColumnData(data) {
|
|
@@ -13214,11 +13263,9 @@ class ViewportService {
|
|
|
13214
13263
|
segmentSelection.setLastCell(rgRow.lastCell);
|
|
13215
13264
|
// register selection store for Row
|
|
13216
13265
|
const rowSelectionStore = this.registerRow(rgRow.position.y, rgRow.type);
|
|
13217
|
-
const rowDef = Object.assign(Object.assign({}, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
|
|
13266
|
+
const rowDef = Object.assign(Object.assign({ colType: val }, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
|
|
13218
13267
|
segmentSelection.setRangeArea(e.detail);
|
|
13219
|
-
}, onSettemprange: e => {
|
|
13220
|
-
segmentSelection.setTempArea(e.detail);
|
|
13221
|
-
}, onFocuscell: e => {
|
|
13268
|
+
}, onSettemprange: e => segmentSelection.setTempArea(e.detail), onFocuscell: e => {
|
|
13222
13269
|
// todo: multi focus
|
|
13223
13270
|
segmentSelection.clearFocus();
|
|
13224
13271
|
config.selectionStoreConnector.focus(segmentSelection, e.detail);
|
|
@@ -13268,43 +13315,27 @@ class ViewportService {
|
|
|
13268
13315
|
};
|
|
13269
13316
|
// y position for selection
|
|
13270
13317
|
let y = 0;
|
|
13271
|
-
return rowTypes.reduce((
|
|
13318
|
+
return rowTypes.reduce((result, type) => {
|
|
13272
13319
|
// filter out empty sources, we still need to return source to keep slot working
|
|
13273
13320
|
const isPresent = data.viewports[type].store.get('realCount') || type === 'rgRow';
|
|
13274
13321
|
const rgCol = Object.assign(Object.assign({}, data), { position: Object.assign(Object.assign({}, data.position), { y: isPresent ? y : EMPTY_INDEX }) });
|
|
13275
|
-
|
|
13322
|
+
const partition = viewportDataPartition(rgCol, type, slots[type], type !== 'rgRow');
|
|
13323
|
+
result.push(partition);
|
|
13276
13324
|
if (isPresent) {
|
|
13277
13325
|
y++;
|
|
13278
13326
|
}
|
|
13279
|
-
return
|
|
13327
|
+
return result;
|
|
13280
13328
|
}, []);
|
|
13281
13329
|
}
|
|
13282
|
-
dataPartition(data, type, slot, fixed) {
|
|
13283
|
-
return {
|
|
13284
|
-
colData: data.colStore,
|
|
13285
|
-
viewportCol: data.viewports[data.colType].store,
|
|
13286
|
-
viewportRow: data.viewports[type].store,
|
|
13287
|
-
// lastCell is the last real coordinate + 1
|
|
13288
|
-
lastCell: getLastCell(data, type),
|
|
13289
|
-
slot,
|
|
13290
|
-
type,
|
|
13291
|
-
canDrag: !fixed,
|
|
13292
|
-
position: data.position,
|
|
13293
|
-
dataStore: data.rowStores[type].store,
|
|
13294
|
-
dimensionCol: data.dimensions[data.colType].store,
|
|
13295
|
-
dimensionRow: data.dimensions[type].store,
|
|
13296
|
-
style: fixed
|
|
13297
|
-
? { height: `${data.dimensions[type].store.get('realSize')}px` }
|
|
13298
|
-
: undefined,
|
|
13299
|
-
};
|
|
13300
|
-
}
|
|
13301
13330
|
scrollToCell(cell) {
|
|
13302
13331
|
for (let key in cell) {
|
|
13303
13332
|
const coordinate = cell[key];
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
|
|
13307
|
-
|
|
13333
|
+
if (typeof coordinate === 'number') {
|
|
13334
|
+
this.config.scrollingService.proxyScroll({
|
|
13335
|
+
dimension: key === 'x' ? 'rgCol' : 'rgRow',
|
|
13336
|
+
coordinate,
|
|
13337
|
+
});
|
|
13338
|
+
}
|
|
13308
13339
|
}
|
|
13309
13340
|
}
|
|
13310
13341
|
/**
|
|
@@ -13340,22 +13371,30 @@ class ViewportService {
|
|
|
13340
13371
|
}
|
|
13341
13372
|
getStoreCoordinateByType(colType, rowType) {
|
|
13342
13373
|
const stores = this.config.selectionStoreConnector.storesByType;
|
|
13343
|
-
|
|
13374
|
+
if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {
|
|
13375
|
+
return;
|
|
13376
|
+
}
|
|
13377
|
+
return {
|
|
13344
13378
|
x: stores[colType],
|
|
13345
13379
|
y: stores[rowType],
|
|
13346
13380
|
};
|
|
13347
|
-
return storeCoordinate;
|
|
13348
13381
|
}
|
|
13349
13382
|
setFocus(colType, rowType, start, end) {
|
|
13350
13383
|
var _a;
|
|
13351
|
-
|
|
13384
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
13385
|
+
if (coordinate) {
|
|
13386
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.focusByCell(coordinate, start, end);
|
|
13387
|
+
}
|
|
13352
13388
|
}
|
|
13353
13389
|
getSelectedRange() {
|
|
13354
13390
|
return this.config.selectionStoreConnector.selectedRange;
|
|
13355
13391
|
}
|
|
13356
13392
|
setEdit(rowIndex, colIndex, colType, rowType) {
|
|
13357
13393
|
var _a;
|
|
13358
|
-
|
|
13394
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
13395
|
+
if (coordinate) {
|
|
13396
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEditByCell(coordinate, { x: colIndex, y: rowIndex });
|
|
13397
|
+
}
|
|
13359
13398
|
}
|
|
13360
13399
|
}
|
|
13361
13400
|
|
|
@@ -13366,7 +13405,7 @@ class GridScrollingService {
|
|
|
13366
13405
|
}
|
|
13367
13406
|
async proxyScroll(e, key) {
|
|
13368
13407
|
var _a;
|
|
13369
|
-
let
|
|
13408
|
+
let newEventPromise;
|
|
13370
13409
|
let event = e;
|
|
13371
13410
|
for (let elKey in this.elements) {
|
|
13372
13411
|
// skip
|
|
@@ -13380,7 +13419,7 @@ class GridScrollingService {
|
|
|
13380
13419
|
}
|
|
13381
13420
|
for (let el of this.elements[elKey]) {
|
|
13382
13421
|
if (el.changeScroll) {
|
|
13383
|
-
|
|
13422
|
+
newEventPromise = el.changeScroll(e);
|
|
13384
13423
|
}
|
|
13385
13424
|
}
|
|
13386
13425
|
}
|
|
@@ -13390,8 +13429,9 @@ class GridScrollingService {
|
|
|
13390
13429
|
}
|
|
13391
13430
|
}
|
|
13392
13431
|
}
|
|
13432
|
+
const newEvent = await newEventPromise;
|
|
13393
13433
|
if (newEvent) {
|
|
13394
|
-
event =
|
|
13434
|
+
event = newEvent;
|
|
13395
13435
|
}
|
|
13396
13436
|
this.setViewport(event);
|
|
13397
13437
|
}
|
|
@@ -13591,14 +13631,15 @@ function isStretchPlugin(plugin) {
|
|
|
13591
13631
|
const rowDefinitionByType = (newVal = []) => {
|
|
13592
13632
|
const result = {};
|
|
13593
13633
|
for (const v of newVal) {
|
|
13594
|
-
|
|
13595
|
-
|
|
13634
|
+
let rowDefs = result[v.type];
|
|
13635
|
+
if (!rowDefs) {
|
|
13636
|
+
rowDefs = result[v.type] = {};
|
|
13596
13637
|
}
|
|
13597
13638
|
if (v.size) {
|
|
13598
|
-
if (!
|
|
13599
|
-
|
|
13639
|
+
if (!rowDefs.sizes) {
|
|
13640
|
+
rowDefs.sizes = {};
|
|
13600
13641
|
}
|
|
13601
|
-
|
|
13642
|
+
rowDefs.sizes[v.index] = v.size;
|
|
13602
13643
|
}
|
|
13603
13644
|
}
|
|
13604
13645
|
return result;
|
|
@@ -13606,11 +13647,12 @@ const rowDefinitionByType = (newVal = []) => {
|
|
|
13606
13647
|
const rowDefinitionRemoveByType = (oldVal = []) => {
|
|
13607
13648
|
const result = {};
|
|
13608
13649
|
for (const v of oldVal) {
|
|
13609
|
-
|
|
13610
|
-
|
|
13650
|
+
let rowDefs = result[v.type];
|
|
13651
|
+
if (!rowDefs) {
|
|
13652
|
+
rowDefs = result[v.type] = [];
|
|
13611
13653
|
}
|
|
13612
13654
|
if (v.size) {
|
|
13613
|
-
|
|
13655
|
+
rowDefs.push(v.index);
|
|
13614
13656
|
}
|
|
13615
13657
|
}
|
|
13616
13658
|
return result;
|
|
@@ -13730,6 +13772,7 @@ const defaultProps = (props) => {
|
|
|
13730
13772
|
};
|
|
13731
13773
|
class ResizeDirective {
|
|
13732
13774
|
constructor(initialProps, $event) {
|
|
13775
|
+
var _a, _b;
|
|
13733
13776
|
this.initialProps = initialProps;
|
|
13734
13777
|
this.$event = $event;
|
|
13735
13778
|
this.mouseX = 0;
|
|
@@ -13744,8 +13787,8 @@ class ResizeDirective {
|
|
|
13744
13787
|
this.mouseUpFunc = this.handleUp.bind(this);
|
|
13745
13788
|
this.minW = this.props.minWidth;
|
|
13746
13789
|
this.minH = this.props.minHeight;
|
|
13747
|
-
this.maxW = this.props.maxWidth;
|
|
13748
|
-
this.maxH = this.props.maxHeight;
|
|
13790
|
+
this.maxW = (_a = this.props.maxWidth) !== null && _a !== void 0 ? _a : 0;
|
|
13791
|
+
this.maxH = (_b = this.props.maxHeight) !== null && _b !== void 0 ? _b : 0;
|
|
13749
13792
|
this.parent = { width: 0, height: 0 };
|
|
13750
13793
|
this.resizeState = 0;
|
|
13751
13794
|
}
|
|
@@ -13880,13 +13923,14 @@ class ResizeDirective {
|
|
|
13880
13923
|
this.unbindMove();
|
|
13881
13924
|
}
|
|
13882
13925
|
setInitials({ clientX, clientY }, target) {
|
|
13926
|
+
var _a, _b, _c, _d;
|
|
13883
13927
|
const computedStyle = getComputedStyle(this.$el);
|
|
13884
13928
|
this.$el.classList.add('active');
|
|
13885
13929
|
this.activeResizer = target;
|
|
13886
13930
|
if (this.disableCalcMap & DISABLE_MASK.w) {
|
|
13887
13931
|
this.mouseX = clientX;
|
|
13888
13932
|
this.width = this.$el.clientWidth;
|
|
13889
|
-
this.parent.width = this.$el.parentElement.clientWidth;
|
|
13933
|
+
this.parent.width = (_b = (_a = this.$el.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
13890
13934
|
// min width
|
|
13891
13935
|
const minPaddingX = parseFloat(computedStyle.paddingLeft) +
|
|
13892
13936
|
parseFloat(computedStyle.paddingRight);
|
|
@@ -13899,7 +13943,7 @@ class ResizeDirective {
|
|
|
13899
13943
|
if (this.disableCalcMap & DISABLE_MASK.h) {
|
|
13900
13944
|
this.mouseY = clientY;
|
|
13901
13945
|
this.height = this.$el.clientHeight;
|
|
13902
|
-
this.parent.height = this.$el.parentElement.clientHeight;
|
|
13946
|
+
this.parent.height = (_d = (_c = this.$el.parentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
|
|
13903
13947
|
// min height
|
|
13904
13948
|
const minPaddingY = parseFloat(computedStyle.paddingTop) +
|
|
13905
13949
|
parseFloat(computedStyle.paddingBottom);
|
|
@@ -13917,7 +13961,7 @@ class ResizeDirective {
|
|
|
13917
13961
|
this.activeResizer.removeAttribute('style');
|
|
13918
13962
|
}
|
|
13919
13963
|
this.$el.classList.remove('active');
|
|
13920
|
-
this.activeResizer =
|
|
13964
|
+
this.activeResizer = undefined;
|
|
13921
13965
|
}
|
|
13922
13966
|
bindMove() {
|
|
13923
13967
|
document.documentElement.addEventListener('mouseup', this.mouseUpFunc, true);
|
|
@@ -13966,7 +14010,7 @@ const ResizableElement = (props, children) => {
|
|
|
13966
14010
|
}
|
|
13967
14011
|
}
|
|
13968
14012
|
}
|
|
13969
|
-
return (hAsync("div", Object.assign({}, props, { ref: (e) => directive === null || directive === void 0 ? void 0 : directive.set(e) }),
|
|
14013
|
+
return (hAsync("div", Object.assign({}, props, { ref: (e) => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
|
|
13970
14014
|
children,
|
|
13971
14015
|
resizeEls));
|
|
13972
14016
|
};
|
|
@@ -14095,7 +14139,7 @@ class ColumnPlugin extends BasePlugin {
|
|
|
14095
14139
|
}
|
|
14096
14140
|
onMouseUp(e) {
|
|
14097
14141
|
// apply new positions
|
|
14098
|
-
if (this.dragData) {
|
|
14142
|
+
if (this.dragData && this.staticDragData) {
|
|
14099
14143
|
let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
14100
14144
|
if (relativePos < 0) {
|
|
14101
14145
|
relativePos = 0;
|
|
@@ -14212,9 +14256,6 @@ class RevoGridComponent {
|
|
|
14212
14256
|
this.aftergridinit = createEvent(this, "aftergridinit", 7);
|
|
14213
14257
|
this.additionaldatachanged = createEvent(this, "additionaldatachanged", 7);
|
|
14214
14258
|
this.afterthemechanged = createEvent(this, "afterthemechanged", 7);
|
|
14215
|
-
// #endregion
|
|
14216
|
-
// #region Listeners outside scope
|
|
14217
|
-
this.clickTrackForFocusClear = null;
|
|
14218
14259
|
this.extraElements = [];
|
|
14219
14260
|
this.viewport = null;
|
|
14220
14261
|
this.isInited = false;
|
|
@@ -14386,6 +14427,7 @@ class RevoGridComponent {
|
|
|
14386
14427
|
* @param column - full column details to update
|
|
14387
14428
|
* @param index - virtual column index
|
|
14388
14429
|
* @param order - order to apply
|
|
14430
|
+
* @param additive - if false will replace current order
|
|
14389
14431
|
*/
|
|
14390
14432
|
async updateColumnSorting(column, index, order, additive) {
|
|
14391
14433
|
return this.columnProvider.updateColumnSorting(column, index, order, additive);
|
|
@@ -14424,8 +14466,8 @@ class RevoGridComponent {
|
|
|
14424
14466
|
* Get the currently focused cell.
|
|
14425
14467
|
*/
|
|
14426
14468
|
async getFocused() {
|
|
14427
|
-
var _a;
|
|
14428
|
-
return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
|
|
14469
|
+
var _a, _b;
|
|
14470
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused()) !== null && _b !== void 0 ? _b : null;
|
|
14429
14471
|
}
|
|
14430
14472
|
/**
|
|
14431
14473
|
* Get size of content
|
|
@@ -14439,8 +14481,8 @@ class RevoGridComponent {
|
|
|
14439
14481
|
* Get the currently selected Range.
|
|
14440
14482
|
*/
|
|
14441
14483
|
async getSelectedRange() {
|
|
14442
|
-
var _a;
|
|
14443
|
-
return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange();
|
|
14484
|
+
var _a, _b;
|
|
14485
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange()) !== null && _b !== void 0 ? _b : null;
|
|
14444
14486
|
}
|
|
14445
14487
|
mousedownHandle(event) {
|
|
14446
14488
|
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
@@ -14453,7 +14495,8 @@ class RevoGridComponent {
|
|
|
14453
14495
|
/**
|
|
14454
14496
|
* To keep your elements from losing focus use mouseup/touchend e.preventDefault();
|
|
14455
14497
|
*/
|
|
14456
|
-
mouseupHandle(event) {
|
|
14498
|
+
async mouseupHandle(event) {
|
|
14499
|
+
var _a;
|
|
14457
14500
|
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
14458
14501
|
const screenY = getPropertyFromEvent(event, 'screenY');
|
|
14459
14502
|
if (screenX === null || screenY === null) {
|
|
@@ -14464,16 +14507,16 @@ class RevoGridComponent {
|
|
|
14464
14507
|
}
|
|
14465
14508
|
const pos = screenX + screenY;
|
|
14466
14509
|
// detect if mousemove then do nothing
|
|
14467
|
-
if (Math.abs(this.clickTrackForFocusClear - pos) > 10) {
|
|
14510
|
+
if (Math.abs(((_a = this.clickTrackForFocusClear) !== null && _a !== void 0 ? _a : 0) - pos) > 10) {
|
|
14468
14511
|
return;
|
|
14469
14512
|
}
|
|
14470
|
-
// Check if action finished inside
|
|
14471
|
-
// if event prevented or it is current table don't clear focus
|
|
14513
|
+
// Check if action finished inside the document
|
|
14514
|
+
// if event prevented, or it is current table don't clear focus
|
|
14472
14515
|
const path = event.composedPath();
|
|
14473
14516
|
if (!path.includes(this.element) &&
|
|
14474
|
-
!path.includes(this.element.shadowRoot)) {
|
|
14517
|
+
!(this.element.shadowRoot && path.includes(this.element.shadowRoot))) {
|
|
14475
14518
|
// Perform actions if the click is outside the component
|
|
14476
|
-
this.clearFocus();
|
|
14519
|
+
await this.clearFocus();
|
|
14477
14520
|
}
|
|
14478
14521
|
}
|
|
14479
14522
|
// #endregion
|
|
@@ -14683,15 +14726,12 @@ class RevoGridComponent {
|
|
|
14683
14726
|
let grPlugin;
|
|
14684
14727
|
for (let p of this.internalPlugins) {
|
|
14685
14728
|
const isGrouping = p;
|
|
14686
|
-
if (isGrouping.setGrouping) {
|
|
14729
|
+
if (!!isGrouping.setGrouping) {
|
|
14687
14730
|
grPlugin = isGrouping;
|
|
14688
14731
|
break;
|
|
14689
14732
|
}
|
|
14690
14733
|
}
|
|
14691
|
-
|
|
14692
|
-
return;
|
|
14693
|
-
}
|
|
14694
|
-
grPlugin.setGrouping(newVal || {});
|
|
14734
|
+
grPlugin === null || grPlugin === void 0 ? void 0 : grPlugin.setGrouping(newVal || {});
|
|
14695
14735
|
}
|
|
14696
14736
|
/**
|
|
14697
14737
|
* Stretch Plugin Apply
|
|
@@ -14775,7 +14815,7 @@ class RevoGridComponent {
|
|
|
14775
14815
|
(_a = this.plugins) === null || _a === void 0 ? void 0 : _a.forEach(p => this.internalPlugins.push(new p(this.element, pluginData)));
|
|
14776
14816
|
}
|
|
14777
14817
|
removePlugins() {
|
|
14778
|
-
this.internalPlugins.forEach(p => p.destroy());
|
|
14818
|
+
this.internalPlugins.forEach(p => { var _a; return (_a = p.destroy) === null || _a === void 0 ? void 0 : _a.call(p); });
|
|
14779
14819
|
this.internalPlugins = [];
|
|
14780
14820
|
}
|
|
14781
14821
|
// #endregion
|
|
@@ -14875,7 +14915,7 @@ class RevoGridComponent {
|
|
|
14875
14915
|
const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData: this.additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: this.resize, readonly: this.readonly, columnFilter: !!this.filter });
|
|
14876
14916
|
// Column headers
|
|
14877
14917
|
const dataViews = [
|
|
14878
|
-
hAsync("revogr-header", Object.assign({ key: '
|
|
14918
|
+
hAsync("revogr-header", Object.assign({ key: 'b08c837765cf20c88cb5b253a876f0f442c31628' }, headerProperties, { slot: HEADER_SLOT })),
|
|
14879
14919
|
];
|
|
14880
14920
|
// Render viewport data (vertical sections)
|
|
14881
14921
|
view.dataPorts.forEach(data => {
|
|
@@ -14897,11 +14937,12 @@ class RevoGridComponent {
|
|
|
14897
14937
|
const typeCol = 'rgCol';
|
|
14898
14938
|
const viewports = this.viewportProvider.stores;
|
|
14899
14939
|
const dimensions = this.dimensionProvider.stores;
|
|
14900
|
-
return (hAsync(Host, { key: '
|
|
14940
|
+
return (hAsync(Host, { key: '057a2cf1a64aaeec12d2aca17b09316fb3cbfde6' }, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { key: 'e89e3d136d756f80421f42f47e09583985edb1bc', class: "main-viewport", onClick: (e) => {
|
|
14941
|
+
var _a;
|
|
14901
14942
|
if (e.currentTarget === e.target) {
|
|
14902
|
-
this.viewport.clearEdit();
|
|
14943
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
|
|
14903
14944
|
}
|
|
14904
|
-
} }, hAsync("div", { key: '
|
|
14945
|
+
} }, hAsync("div", { key: '177db78970907d36b8d56549386a18a683573944', class: "viewports" }, hAsync("slot", { key: '481d830a232b1969fcaa2519a5306fafaff58fb4', name: "viewport" }), viewportSections, hAsync("revogr-scroll-virtual", { key: '6a123b2e84bec95d7a63a73322fe167248e8415e', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), hAsync(OrderRenderer, { key: 'fea1be24668f2039746fff93d0ab5e76d932a166', ref: e => (this.orderService = e) }))), hAsync("revogr-scroll-virtual", { key: '74c6e05c81b2782320755c910b098edf8858d6db', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
|
|
14905
14946
|
}
|
|
14906
14947
|
disconnectedCallback() {
|
|
14907
14948
|
// Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
|
|
@@ -15113,10 +15154,13 @@ function renderCell(v) {
|
|
|
15113
15154
|
// Row drag
|
|
15114
15155
|
if (v.model.column.rowDrag &&
|
|
15115
15156
|
isRowDragService(v.model.column.rowDrag, v.model)) {
|
|
15116
|
-
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent =>
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15157
|
+
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
|
|
15158
|
+
var _a;
|
|
15159
|
+
return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
|
|
15160
|
+
originalEvent,
|
|
15161
|
+
model: v.model,
|
|
15162
|
+
});
|
|
15163
|
+
} },
|
|
15120
15164
|
hAsync("span", { class: DRAG_ICON_CLASS })));
|
|
15121
15165
|
}
|
|
15122
15166
|
els.push(`${getCellData(v.model.model[v.model.prop])}`);
|
|
@@ -15750,7 +15794,8 @@ const HeaderRenderer = (p) => {
|
|
|
15750
15794
|
},
|
|
15751
15795
|
onResize: p.onResize,
|
|
15752
15796
|
onDoubleClick(originalEvent) {
|
|
15753
|
-
|
|
15797
|
+
var _a;
|
|
15798
|
+
(_a = p.onDoubleClick) === null || _a === void 0 ? void 0 : _a.call(p, {
|
|
15754
15799
|
column: p.data,
|
|
15755
15800
|
index: p.column.itemIndex,
|
|
15756
15801
|
originalEvent,
|
|
@@ -15815,7 +15860,7 @@ const ColumnGroupsRenderer = ({ additionalData, providers, depth, groups, visibl
|
|
|
15815
15860
|
// coordinates
|
|
15816
15861
|
const groupStart = getItemByIndex(dimensionCol, groupStartIndex).start;
|
|
15817
15862
|
const groupEnd = getItemByIndex(dimensionCol, groupEndIndex).end;
|
|
15818
|
-
groupRow.push(hAsync(GroupHeaderRenderer, { providers: providers, start: groupStart, end: groupEnd, group: group, active: active, canResize: canResize, onResize: e => onResize(e.changedX, groupStartIndex, groupEndIndex), additionalData: additionalData }));
|
|
15863
|
+
groupRow.push(hAsync(GroupHeaderRenderer, { providers: providers, start: groupStart, end: groupEnd, group: group, active: active, canResize: canResize, onResize: e => { var _a; return onResize((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupStartIndex, groupEndIndex); }, additionalData: additionalData }));
|
|
15819
15864
|
}
|
|
15820
15865
|
}
|
|
15821
15866
|
}
|
|
@@ -15982,7 +16027,7 @@ class RevogrRowHeaders {
|
|
|
15982
16027
|
const viewportHeader = Object.assign(Object.assign({}, this.headerProp), { colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: ROW_HEADER_TYPE,
|
|
15983
16028
|
// parent,
|
|
15984
16029
|
slot: HEADER_SLOT });
|
|
15985
|
-
return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: '
|
|
16030
|
+
return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: '743c1dbaed3edf679c0616a2b79171a43d94806f' }, viewportScroll, { "row-header": true }), hAsync("revogr-header", Object.assign({ key: '53f1f64b1358d7828a5e45807915740ef198df21' }, viewportHeader)), dataViews)));
|
|
15986
16031
|
}
|
|
15987
16032
|
static get cmpMeta() { return {
|
|
15988
16033
|
"$flags$": 0,
|
|
@@ -16096,7 +16141,7 @@ class LocalScrollService {
|
|
|
16096
16141
|
if (c < 0) {
|
|
16097
16142
|
return NO_COORDINATE;
|
|
16098
16143
|
}
|
|
16099
|
-
if (c > param.maxSize) {
|
|
16144
|
+
if (typeof param.maxSize === 'number' && c > param.maxSize) {
|
|
16100
16145
|
return param.maxSize;
|
|
16101
16146
|
}
|
|
16102
16147
|
return c;
|
|
@@ -16109,8 +16154,9 @@ class LocalScrollService {
|
|
|
16109
16154
|
}
|
|
16110
16155
|
/* convert virtual to real and back, scale range */
|
|
16111
16156
|
convert(pos, param, toReal = true) {
|
|
16157
|
+
var _a;
|
|
16112
16158
|
const minRange = param.clientSize;
|
|
16113
|
-
const from = [0, param.virtualContentSize - minRange];
|
|
16159
|
+
const from = [0, ((_a = param.virtualContentSize) !== null && _a !== void 0 ? _a : minRange) - minRange];
|
|
16114
16160
|
const to = [0, param.contentSize - param.virtualSize];
|
|
16115
16161
|
if (toReal) {
|
|
16116
16162
|
return scaleValue(pos, from, to);
|
|
@@ -16152,7 +16198,7 @@ class AutohideScrollPlugin {
|
|
|
16152
16198
|
show(element, timeout) {
|
|
16153
16199
|
clearTimeout(timeout);
|
|
16154
16200
|
return Number(setTimeout(() => {
|
|
16155
|
-
element.removeAttribute('visible');
|
|
16201
|
+
element === null || element === void 0 ? void 0 : element.removeAttribute('visible');
|
|
16156
16202
|
}, 1000));
|
|
16157
16203
|
}
|
|
16158
16204
|
clear() {
|
|
@@ -16392,8 +16438,9 @@ class RevogrViewportScroll {
|
|
|
16392
16438
|
* @param e
|
|
16393
16439
|
*/
|
|
16394
16440
|
async changeScroll(e, silent = false) {
|
|
16441
|
+
var _a, _b;
|
|
16395
16442
|
if (silent) {
|
|
16396
|
-
if (e.coordinate) {
|
|
16443
|
+
if (e.coordinate && this.verticalScroll) {
|
|
16397
16444
|
switch (e.dimension) {
|
|
16398
16445
|
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
16399
16446
|
case 'rgRow':
|
|
@@ -16401,7 +16448,7 @@ class RevogrViewportScroll {
|
|
|
16401
16448
|
break;
|
|
16402
16449
|
}
|
|
16403
16450
|
}
|
|
16404
|
-
return
|
|
16451
|
+
return;
|
|
16405
16452
|
}
|
|
16406
16453
|
if (e.delta) {
|
|
16407
16454
|
switch (e.dimension) {
|
|
@@ -16409,7 +16456,7 @@ class RevogrViewportScroll {
|
|
|
16409
16456
|
e.coordinate = this.horizontalScroll.scrollLeft + e.delta;
|
|
16410
16457
|
break;
|
|
16411
16458
|
case 'rgRow':
|
|
16412
|
-
e.coordinate = this.verticalScroll.scrollTop + e.delta;
|
|
16459
|
+
e.coordinate = ((_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0) + e.delta;
|
|
16413
16460
|
break;
|
|
16414
16461
|
}
|
|
16415
16462
|
this.setScroll(e);
|
|
@@ -16457,11 +16504,13 @@ class RevogrViewportScroll {
|
|
|
16457
16504
|
this.horizontalScroll.scrollLeft = e.coordinate;
|
|
16458
16505
|
break;
|
|
16459
16506
|
case 'rgRow':
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
|
|
16463
|
-
|
|
16464
|
-
this.verticalScroll.style.transform
|
|
16507
|
+
if (this.verticalScroll) {
|
|
16508
|
+
// this will trigger on scroll event
|
|
16509
|
+
this.verticalScroll.scrollTop = e.coordinate;
|
|
16510
|
+
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
16511
|
+
if (this.verticalScroll.style.transform) {
|
|
16512
|
+
this.verticalScroll.style.transform = '';
|
|
16513
|
+
}
|
|
16465
16514
|
}
|
|
16466
16515
|
break;
|
|
16467
16516
|
}
|
|
@@ -16472,23 +16521,23 @@ class RevogrViewportScroll {
|
|
|
16472
16521
|
// track horizontal viewport resize
|
|
16473
16522
|
this.resizeService = new GridResizeService(this.horizontalScroll, {
|
|
16474
16523
|
resize: entries => {
|
|
16475
|
-
var _a, _b, _c;
|
|
16524
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16476
16525
|
let height = ((_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect.height) || 0;
|
|
16477
16526
|
if (height) {
|
|
16478
|
-
height -= this.header.clientHeight + this.footer.clientHeight;
|
|
16527
|
+
height -= ((_c = (_b = this.header) === null || _b === void 0 ? void 0 : _b.clientHeight) !== null && _c !== void 0 ? _c : 0) + ((_e = (_d = this.footer) === null || _d === void 0 ? void 0 : _d.clientHeight) !== null && _e !== void 0 ? _e : 0);
|
|
16479
16528
|
}
|
|
16480
16529
|
const els = {
|
|
16481
16530
|
rgRow: {
|
|
16482
16531
|
size: height,
|
|
16483
16532
|
contentSize: this.contentHeight,
|
|
16484
|
-
scroll: this.verticalScroll.scrollTop,
|
|
16533
|
+
scroll: (_f = this.verticalScroll) === null || _f === void 0 ? void 0 : _f.scrollTop,
|
|
16485
16534
|
noScroll: false,
|
|
16486
16535
|
},
|
|
16487
16536
|
rgCol: {
|
|
16488
|
-
size: ((
|
|
16537
|
+
size: ((_g = entries[0]) === null || _g === void 0 ? void 0 : _g.contentRect.width) || 0,
|
|
16489
16538
|
contentSize: this.contentWidth,
|
|
16490
16539
|
scroll: this.horizontalScroll.scrollLeft,
|
|
16491
|
-
noScroll: this.colType !== 'rgCol'
|
|
16540
|
+
noScroll: this.colType !== 'rgCol',
|
|
16492
16541
|
},
|
|
16493
16542
|
};
|
|
16494
16543
|
for (const [dim, item] of Object.entries(els)) {
|
|
@@ -16497,7 +16546,7 @@ class RevogrViewportScroll {
|
|
|
16497
16546
|
if (item.noScroll) {
|
|
16498
16547
|
continue;
|
|
16499
16548
|
}
|
|
16500
|
-
(
|
|
16549
|
+
(_h = this.localScrollService) === null || _h === void 0 ? void 0 : _h.scroll((_j = item.scroll) !== null && _j !== void 0 ? _j : 0, dimension, true);
|
|
16501
16550
|
// track scroll visibility on outer element change
|
|
16502
16551
|
this.setScrollVisibility(dimension, item.size, item.contentSize);
|
|
16503
16552
|
}
|
|
@@ -16527,10 +16576,10 @@ class RevogrViewportScroll {
|
|
|
16527
16576
|
}
|
|
16528
16577
|
// based on scroll visibility assign or remove class and event
|
|
16529
16578
|
if (hasScroll) {
|
|
16530
|
-
el.classList.add(`scroll-${type}`);
|
|
16579
|
+
el === null || el === void 0 ? void 0 : el.classList.add(`scroll-${type}`);
|
|
16531
16580
|
}
|
|
16532
16581
|
else {
|
|
16533
|
-
el.classList.remove(`scroll-${type}`);
|
|
16582
|
+
el === null || el === void 0 ? void 0 : el.classList.remove(`scroll-${type}`);
|
|
16534
16583
|
}
|
|
16535
16584
|
this.scrollchange.emit({ type, hasScroll });
|
|
16536
16585
|
}
|
|
@@ -16538,6 +16587,7 @@ class RevogrViewportScroll {
|
|
|
16538
16587
|
this.resizeService.destroy();
|
|
16539
16588
|
}
|
|
16540
16589
|
async componentDidRender() {
|
|
16590
|
+
var _a, _b, _c, _d;
|
|
16541
16591
|
// scroll update if number of rows changed
|
|
16542
16592
|
if (this.contentHeight < this.oldValY && this.verticalScroll) {
|
|
16543
16593
|
this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;
|
|
@@ -16550,7 +16600,7 @@ class RevogrViewportScroll {
|
|
|
16550
16600
|
this.oldValX = this.contentWidth;
|
|
16551
16601
|
this.localScrollService.setParams({
|
|
16552
16602
|
contentSize: this.contentHeight,
|
|
16553
|
-
clientSize: this.verticalScroll.clientHeight,
|
|
16603
|
+
clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
16554
16604
|
virtualSize: 0,
|
|
16555
16605
|
}, 'rgRow');
|
|
16556
16606
|
this.localScrollService.setParams({
|
|
@@ -16558,11 +16608,11 @@ class RevogrViewportScroll {
|
|
|
16558
16608
|
clientSize: this.horizontalScroll.clientWidth,
|
|
16559
16609
|
virtualSize: 0,
|
|
16560
16610
|
}, 'rgCol');
|
|
16561
|
-
this.setScrollVisibility('rgRow', this.verticalScroll.clientHeight, this.contentHeight);
|
|
16611
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
16562
16612
|
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
16563
16613
|
}
|
|
16564
16614
|
render() {
|
|
16565
|
-
return (hAsync(Host, { key: '
|
|
16615
|
+
return (hAsync(Host, { key: '8395ce30127f30fff81dc67bfe2f4c3b087b2007', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'efd2db0f5b22b394e93923926f86f2ab9bffb8e0', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, hAsync("div", { key: '2794c7187ec23ac45dab5f6cb3f20ba59102b2a7', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '1a344d7e5cf58d77818390e8d541de88a75399d0', name: HEADER_SLOT })), hAsync("div", { key: '2aeb56f4bf3f3fc60eaeaffd8c18565beaa127ca', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: '59482ef73d3c4617c2511b8613056bbc200cd089', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, hAsync("slot", { key: 'f318ab365e5f6eddcd2812a314f55cac0959c3b4', name: CONTENT_SLOT }))), hAsync("div", { key: '265c036107a8ed3d47b767fec10ae0225cc927cf', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '2aa7e178375b462e666cf067e075856f592714b6', name: FOOTER_SLOT })))));
|
|
16566
16616
|
}
|
|
16567
16617
|
/**
|
|
16568
16618
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -16605,10 +16655,11 @@ class RevogrViewportScroll {
|
|
|
16605
16655
|
* @param e
|
|
16606
16656
|
*/
|
|
16607
16657
|
onVerticalMouseWheel(type, delta, e) {
|
|
16608
|
-
var _a, _b;
|
|
16658
|
+
var _a, _b, _c, _d;
|
|
16609
16659
|
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
16610
|
-
const
|
|
16611
|
-
|
|
16660
|
+
const scrollTop = (_c = (_b = this.verticalScroll) === null || _b === void 0 ? void 0 : _b.scrollTop) !== null && _c !== void 0 ? _c : 0;
|
|
16661
|
+
const pos = scrollTop + e[delta];
|
|
16662
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
16612
16663
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
16613
16664
|
}
|
|
16614
16665
|
/**
|
|
@@ -16665,9 +16716,9 @@ class VNodeToHtml {
|
|
|
16665
16716
|
});
|
|
16666
16717
|
}
|
|
16667
16718
|
render() {
|
|
16668
|
-
var _a;
|
|
16669
|
-
this.vnodes = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
16670
|
-
return (hAsync(Host, { key: '
|
|
16719
|
+
var _a, _b;
|
|
16720
|
+
this.vnodes = (_b = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : null;
|
|
16721
|
+
return (hAsync(Host, { key: 'dcaa7c6bd2f1eef1dd9a7f95a723f8ec778681a0', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
|
|
16671
16722
|
}
|
|
16672
16723
|
get el() { return getElement(this); }
|
|
16673
16724
|
static get cmpMeta() { return {
|