@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.mjs
CHANGED
|
@@ -2307,10 +2307,10 @@ class Clipboard {
|
|
|
2307
2307
|
}
|
|
2308
2308
|
const clipboardData = this.getData(e);
|
|
2309
2309
|
const isHTML = ((clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.types.indexOf('text/html')) || -1) > -1;
|
|
2310
|
-
const data = isHTML
|
|
2310
|
+
const data = (isHTML
|
|
2311
2311
|
? clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text/html')
|
|
2312
|
-
: clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
|
|
2313
|
-
const dataText = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
|
|
2312
|
+
: clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
|
|
2313
|
+
const dataText = (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
|
|
2314
2314
|
const beforePaste = this.beforePaste.emit({
|
|
2315
2315
|
raw: data,
|
|
2316
2316
|
dataText,
|
|
@@ -6828,11 +6828,16 @@ function gatherTrimmedItems(trimmedItems) {
|
|
|
6828
6828
|
return trimmed;
|
|
6829
6829
|
}
|
|
6830
6830
|
|
|
6831
|
-
/**
|
|
6831
|
+
/**
|
|
6832
|
+
* Sets the given data on the specified store.
|
|
6833
|
+
*
|
|
6834
|
+
* @param store - The store to set data on.
|
|
6835
|
+
* @param data - The data to set on the store.
|
|
6836
|
+
*/
|
|
6832
6837
|
function setStore(store, data) {
|
|
6833
|
-
|
|
6834
|
-
store.set(key,
|
|
6835
|
-
}
|
|
6838
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
6839
|
+
store.set(key, value);
|
|
6840
|
+
});
|
|
6836
6841
|
}
|
|
6837
6842
|
|
|
6838
6843
|
/**
|
|
@@ -7646,7 +7651,8 @@ class SelectionStore {
|
|
|
7646
7651
|
setStore(this.store, { range, edit: null, tempRange: null });
|
|
7647
7652
|
}
|
|
7648
7653
|
setRange(start, end) {
|
|
7649
|
-
|
|
7654
|
+
const range = getRange(start, end);
|
|
7655
|
+
this.setRangeArea(range);
|
|
7650
7656
|
}
|
|
7651
7657
|
setLastCell(lastCell) {
|
|
7652
7658
|
setStore(this.store, { lastCell });
|
|
@@ -7745,7 +7751,7 @@ class SelectionStoreConnector {
|
|
|
7745
7751
|
return this.columnStores[x];
|
|
7746
7752
|
}
|
|
7747
7753
|
this.columnStores[x] = new SelectionStore();
|
|
7748
|
-
// build cross
|
|
7754
|
+
// build cross-linking type to position
|
|
7749
7755
|
this.storesByType[type] = x;
|
|
7750
7756
|
this.storesXToType[x] = type;
|
|
7751
7757
|
return this.columnStores[x];
|
|
@@ -7796,13 +7802,13 @@ class SelectionStoreConnector {
|
|
|
7796
7802
|
(_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
7797
7803
|
delete this.rowStores[y];
|
|
7798
7804
|
delete this.columnStores[x];
|
|
7799
|
-
// clear x cross
|
|
7805
|
+
// clear x cross-link
|
|
7800
7806
|
if (this.storesXToType[x]) {
|
|
7801
7807
|
const type = this.storesXToType[x];
|
|
7802
7808
|
delete this.storesXToType[x];
|
|
7803
7809
|
delete this.storesByType[type];
|
|
7804
7810
|
}
|
|
7805
|
-
// clear y cross
|
|
7811
|
+
// clear y cross-link
|
|
7806
7812
|
if (this.storesYToType[y]) {
|
|
7807
7813
|
const type = this.storesYToType[y];
|
|
7808
7814
|
delete this.storesYToType[y];
|
|
@@ -7832,9 +7838,10 @@ class SelectionStoreConnector {
|
|
|
7832
7838
|
return;
|
|
7833
7839
|
}
|
|
7834
7840
|
// Get the next store based on the current focus and the last cell.
|
|
7835
|
-
const
|
|
7841
|
+
const lastCell = this.focusedStore.entity.store.get('lastCell');
|
|
7842
|
+
const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
|
|
7836
7843
|
// Set the next focus cell in the store.
|
|
7837
|
-
(_a = next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
|
|
7844
|
+
(_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));
|
|
7838
7845
|
}
|
|
7839
7846
|
focusByCell(storePos, start, end) {
|
|
7840
7847
|
const store = this.stores[storePos.y][storePos.x];
|
|
@@ -7847,15 +7854,17 @@ class SelectionStoreConnector {
|
|
|
7847
7854
|
}
|
|
7848
7855
|
// check for the focus in nearby store/viewport
|
|
7849
7856
|
const lastCell = store.store.get('lastCell');
|
|
7850
|
-
const next = this.getNextStore(focus, currentStorePointer, lastCell);
|
|
7857
|
+
const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
|
|
7851
7858
|
// if next store present - update
|
|
7852
7859
|
if (next === null || next === void 0 ? void 0 : next.store) {
|
|
7853
7860
|
const item = Object.assign(Object.assign({}, focus), next.item);
|
|
7854
7861
|
this.focus(next.store, { focus: item, end: item });
|
|
7855
7862
|
return null;
|
|
7856
7863
|
}
|
|
7857
|
-
|
|
7858
|
-
|
|
7864
|
+
if (lastCell) {
|
|
7865
|
+
focus = cropCellToMax(focus, lastCell);
|
|
7866
|
+
end = cropCellToMax(end, lastCell);
|
|
7867
|
+
}
|
|
7859
7868
|
store.setFocus(focus, end);
|
|
7860
7869
|
return focus;
|
|
7861
7870
|
}
|
|
@@ -7892,10 +7901,9 @@ class SelectionStoreConnector {
|
|
|
7892
7901
|
getNextStore(focus, currentStorePointer, lastCell) {
|
|
7893
7902
|
// item in new store
|
|
7894
7903
|
const nextItem = nextCell(focus, lastCell);
|
|
7895
|
-
let nextStore
|
|
7904
|
+
let nextStore;
|
|
7896
7905
|
if (nextItem) {
|
|
7897
|
-
|
|
7898
|
-
let type = i;
|
|
7906
|
+
Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
|
|
7899
7907
|
let stores;
|
|
7900
7908
|
switch (type) {
|
|
7901
7909
|
case 'x':
|
|
@@ -7905,20 +7913,20 @@ class SelectionStoreConnector {
|
|
|
7905
7913
|
case 'y':
|
|
7906
7914
|
// Get the Y stores for the current X coordinate of the current store pointer
|
|
7907
7915
|
stores = this.getYStores(currentStorePointer.x);
|
|
7908
|
-
stores = this.getYStores(currentStorePointer.x);
|
|
7909
7916
|
break;
|
|
7910
7917
|
}
|
|
7911
|
-
|
|
7918
|
+
// Get the next store based on the item in the new store
|
|
7919
|
+
if (nextItemCoord >= 0) {
|
|
7912
7920
|
nextStore = stores[++currentStorePointer[type]];
|
|
7913
7921
|
}
|
|
7914
7922
|
else {
|
|
7915
7923
|
nextStore = stores[--currentStorePointer[type]];
|
|
7916
7924
|
const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
|
|
7917
7925
|
if (nextLastCell) {
|
|
7918
|
-
nextItem[type] = nextLastCell[type] +
|
|
7926
|
+
nextItem[type] = nextLastCell[type] + nextItemCoord;
|
|
7919
7927
|
}
|
|
7920
7928
|
}
|
|
7921
|
-
}
|
|
7929
|
+
});
|
|
7922
7930
|
}
|
|
7923
7931
|
return {
|
|
7924
7932
|
store: nextStore,
|
|
@@ -7950,7 +7958,9 @@ class SelectionStoreConnector {
|
|
|
7950
7958
|
continue;
|
|
7951
7959
|
}
|
|
7952
7960
|
const lastCell = store.store.get('lastCell');
|
|
7953
|
-
|
|
7961
|
+
if (lastCell) {
|
|
7962
|
+
store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
|
|
7963
|
+
}
|
|
7954
7964
|
}
|
|
7955
7965
|
}
|
|
7956
7966
|
}
|
|
@@ -7989,21 +7999,17 @@ function nextCell(cell, lastCell) {
|
|
|
7989
7999
|
return null;
|
|
7990
8000
|
}
|
|
7991
8001
|
function cropCellToMax(cell, lastCell) {
|
|
7992
|
-
const
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
newCell[t] = 0;
|
|
8002
|
+
const croppedCell = Object.assign({}, cell);
|
|
8003
|
+
const cellCoordinates = ['x', 'y'];
|
|
8004
|
+
for (const coordinate of cellCoordinates) {
|
|
8005
|
+
if (cell[coordinate] < 0) {
|
|
8006
|
+
croppedCell[coordinate] = 0;
|
|
7998
8007
|
}
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
for (let t of types) {
|
|
8002
|
-
if (cell[t] >= lastCell[t]) {
|
|
8003
|
-
newCell[t] = lastCell[t] - 1;
|
|
8008
|
+
else if (cell[coordinate] >= lastCell[coordinate]) {
|
|
8009
|
+
croppedCell[coordinate] = lastCell[coordinate] - 1;
|
|
8004
8010
|
}
|
|
8005
8011
|
}
|
|
8006
|
-
return
|
|
8012
|
+
return croppedCell;
|
|
8007
8013
|
}
|
|
8008
8014
|
function getRange(start, end) {
|
|
8009
8015
|
return start && end
|
|
@@ -8119,6 +8125,7 @@ function getItems(opt, currentSize = 0) {
|
|
|
8119
8125
|
return items;
|
|
8120
8126
|
}
|
|
8121
8127
|
function recombineByOffset(offset, data) {
|
|
8128
|
+
var _a, _b;
|
|
8122
8129
|
const newItems = [...data.items];
|
|
8123
8130
|
const itemsCount = newItems.length;
|
|
8124
8131
|
let newRange = {
|
|
@@ -8127,7 +8134,7 @@ function recombineByOffset(offset, data) {
|
|
|
8127
8134
|
};
|
|
8128
8135
|
// if offset out of revo-viewport, makes sense whole redraw
|
|
8129
8136
|
if (offset > itemsCount) {
|
|
8130
|
-
return
|
|
8137
|
+
return undefined;
|
|
8131
8138
|
}
|
|
8132
8139
|
// is direction of scroll positive
|
|
8133
8140
|
if (data.positiveDirection) {
|
|
@@ -8166,19 +8173,21 @@ function recombineByOffset(offset, data) {
|
|
|
8166
8173
|
let firstItem = getFirstItem(data);
|
|
8167
8174
|
const end = newRange.end;
|
|
8168
8175
|
for (let i = 0; i < offset; i++) {
|
|
8169
|
-
const newIndex = firstItem.itemIndex - 1;
|
|
8176
|
+
const newIndex = ((_a = firstItem === null || firstItem === void 0 ? void 0 : firstItem.itemIndex) !== null && _a !== void 0 ? _a : 0) - 1;
|
|
8170
8177
|
const size = getItemSize(newIndex, data.sizes, data.originItemSize);
|
|
8171
8178
|
// new item index to recombine
|
|
8172
8179
|
let newStart = end - i;
|
|
8173
8180
|
newStart = (newStart < 0 ? itemsCount + newStart : newStart) % itemsCount;
|
|
8174
8181
|
// item should always present, we do not create new item, we recombine them
|
|
8175
8182
|
if (!newItems[newStart]) {
|
|
8176
|
-
|
|
8183
|
+
console.error('incorrect index');
|
|
8184
|
+
break;
|
|
8177
8185
|
}
|
|
8178
8186
|
// do recombination
|
|
8187
|
+
const firstItemStart = (_b = firstItem === null || firstItem === void 0 ? void 0 : firstItem.start) !== null && _b !== void 0 ? _b : 0;
|
|
8179
8188
|
newItems[newStart] = firstItem = {
|
|
8180
|
-
start:
|
|
8181
|
-
end:
|
|
8189
|
+
start: firstItemStart - size,
|
|
8190
|
+
end: firstItemStart,
|
|
8182
8191
|
itemIndex: newIndex,
|
|
8183
8192
|
size: size,
|
|
8184
8193
|
};
|
|
@@ -8214,11 +8223,12 @@ function isActiveRange(pos, realSize, first, last) {
|
|
|
8214
8223
|
(pos > first.end && last.end === realSize));
|
|
8215
8224
|
}
|
|
8216
8225
|
function isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem) {
|
|
8226
|
+
var _a;
|
|
8217
8227
|
// if no first item, means no items in viewport
|
|
8218
8228
|
if (!firstItem) {
|
|
8219
8229
|
return false;
|
|
8220
8230
|
}
|
|
8221
|
-
return virtualSize + pos > (lastItem === null || lastItem === void 0 ? void 0 : lastItem.end);
|
|
8231
|
+
return virtualSize + pos > ((_a = lastItem === null || lastItem === void 0 ? void 0 : lastItem.end) !== null && _a !== void 0 ? _a : 0);
|
|
8222
8232
|
}
|
|
8223
8233
|
function getFirstItem(s) {
|
|
8224
8234
|
return s.items[s.start];
|
|
@@ -8361,7 +8371,7 @@ class ViewportStore {
|
|
|
8361
8371
|
}
|
|
8362
8372
|
else if (isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem)) {
|
|
8363
8373
|
const items = [...allItems.items];
|
|
8364
|
-
// check is any item missing for
|
|
8374
|
+
// check is any item missing for fulfill content
|
|
8365
8375
|
const missing = addMissingItems(firstItem, this.store.get('realCount'), virtualSize + pos - firstItem.start, allItems, {
|
|
8366
8376
|
sizes: dimension.sizes,
|
|
8367
8377
|
originItemSize: dimension.originItemSize,
|
|
@@ -8740,7 +8750,7 @@ function measureEqualDepth(groupA, groupB) {
|
|
|
8740
8750
|
}
|
|
8741
8751
|
function getParsedGroup(id) {
|
|
8742
8752
|
const parseGroup = JSON.parse(id);
|
|
8743
|
-
// extra precaution and type
|
|
8753
|
+
// extra precaution and type safeguard
|
|
8744
8754
|
if (!Array.isArray(parseGroup)) {
|
|
8745
8755
|
return null;
|
|
8746
8756
|
}
|
|
@@ -8856,7 +8866,7 @@ class ColumnService {
|
|
|
8856
8866
|
const data = this.rowDataModel(r, c);
|
|
8857
8867
|
return readOnly(data);
|
|
8858
8868
|
}
|
|
8859
|
-
return readOnly;
|
|
8869
|
+
return !!readOnly;
|
|
8860
8870
|
}
|
|
8861
8871
|
mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
|
|
8862
8872
|
const cellClass = {
|
|
@@ -9297,18 +9307,18 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
|
9297
9307
|
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
9298
9308
|
}
|
|
9299
9309
|
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
9300
|
-
const updateCoordinate = (c) => {
|
|
9310
|
+
const updateCoordinate = (c, pos = 0) => {
|
|
9301
9311
|
const start = { x: range.x, y: range.y };
|
|
9302
9312
|
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
9303
9313
|
const point = end[c] > focus[c] ? end : start;
|
|
9304
|
-
point[c] +=
|
|
9314
|
+
point[c] += pos;
|
|
9305
9315
|
return { start, end };
|
|
9306
9316
|
};
|
|
9307
9317
|
if (changes.x) {
|
|
9308
|
-
return updateCoordinate('x');
|
|
9318
|
+
return updateCoordinate('x', changes['x']);
|
|
9309
9319
|
}
|
|
9310
9320
|
if (changes.y) {
|
|
9311
|
-
return updateCoordinate('y');
|
|
9321
|
+
return updateCoordinate('y', changes['y']);
|
|
9312
9322
|
}
|
|
9313
9323
|
return null;
|
|
9314
9324
|
}
|
|
@@ -9712,8 +9722,9 @@ class AutoFillService {
|
|
|
9712
9722
|
this.sv.setTempRange(null);
|
|
9713
9723
|
}
|
|
9714
9724
|
else {
|
|
9725
|
+
const area = getRange(this.autoFillInitial, this.autoFillLast);
|
|
9715
9726
|
this.sv.setTempRange({
|
|
9716
|
-
area
|
|
9727
|
+
area,
|
|
9717
9728
|
type: this.autoFillType,
|
|
9718
9729
|
});
|
|
9719
9730
|
}
|
|
@@ -9748,7 +9759,7 @@ class AutoFillService {
|
|
|
9748
9759
|
range,
|
|
9749
9760
|
});
|
|
9750
9761
|
// If data apply was not prevented, apply new range
|
|
9751
|
-
if (!stopApply) {
|
|
9762
|
+
if (!stopApply && oldRange) {
|
|
9752
9763
|
this.applyRangeWithData(newRange, oldRange);
|
|
9753
9764
|
}
|
|
9754
9765
|
else {
|
|
@@ -9786,14 +9797,14 @@ class AutoFillService {
|
|
|
9786
9797
|
this.sv.setRange(range);
|
|
9787
9798
|
}
|
|
9788
9799
|
/** Apply range and copy data during range application */
|
|
9789
|
-
applyRangeWithData(newRange,
|
|
9800
|
+
applyRangeWithData(newRange, rangeToCopy) {
|
|
9790
9801
|
const rangeData = {
|
|
9791
9802
|
type: this.sv.dataStore.get('type'),
|
|
9792
9803
|
colType: this.sv.columnService.type,
|
|
9793
9804
|
newData: {},
|
|
9794
9805
|
mapping: {},
|
|
9795
9806
|
newRange,
|
|
9796
|
-
oldRange,
|
|
9807
|
+
oldRange: rangeToCopy,
|
|
9797
9808
|
};
|
|
9798
9809
|
const { mapping, changed } = this.sv.columnService.getRangeData(rangeData, this.sv.columnService.columns);
|
|
9799
9810
|
rangeData.newData = changed;
|
|
@@ -9860,7 +9871,6 @@ class OverlaySelection {
|
|
|
9860
9871
|
this.beforeCellSave = createEvent(this, "beforecellsave", 7);
|
|
9861
9872
|
this.keyboardService = null;
|
|
9862
9873
|
this.autoFillService = null;
|
|
9863
|
-
this.revogrEdit = null;
|
|
9864
9874
|
this.unsubscribeSelectionStore = [];
|
|
9865
9875
|
this.readonly = undefined;
|
|
9866
9876
|
this.range = undefined;
|
|
@@ -9880,19 +9890,21 @@ class OverlaySelection {
|
|
|
9880
9890
|
// #endregion
|
|
9881
9891
|
// #region Listeners
|
|
9882
9892
|
onMouseMove(e) {
|
|
9893
|
+
var _a;
|
|
9883
9894
|
if (this.selectionStore.get('focus')) {
|
|
9884
|
-
this.autoFillService.selectionMouseMove(e);
|
|
9895
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionMouseMove(e);
|
|
9885
9896
|
}
|
|
9886
9897
|
}
|
|
9887
9898
|
/**
|
|
9888
|
-
* Action finished inside
|
|
9899
|
+
* Action finished inside the document.
|
|
9889
9900
|
* Pointer left document, clear any active operation.
|
|
9890
9901
|
*/
|
|
9891
9902
|
onMouseUp() {
|
|
9892
|
-
|
|
9903
|
+
var _a;
|
|
9904
|
+
// Clear autofill selection
|
|
9893
9905
|
// when pointer left document,
|
|
9894
9906
|
// clear any active operation.
|
|
9895
|
-
this.autoFillService.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
|
|
9907
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
|
|
9896
9908
|
}
|
|
9897
9909
|
/**
|
|
9898
9910
|
* Row drag started.
|
|
@@ -9909,7 +9921,7 @@ class OverlaySelection {
|
|
|
9909
9921
|
*/
|
|
9910
9922
|
onKeyUp(e) {
|
|
9911
9923
|
// Emit before key up event.
|
|
9912
|
-
this.beforeKeyUp.emit(e);
|
|
9924
|
+
this.beforeKeyUp.emit(Object.assign({ original: e }, this.getData()));
|
|
9913
9925
|
}
|
|
9914
9926
|
/**
|
|
9915
9927
|
* Get keyboard down from element.
|
|
@@ -9918,7 +9930,7 @@ class OverlaySelection {
|
|
|
9918
9930
|
onKeyDown(e) {
|
|
9919
9931
|
var _a;
|
|
9920
9932
|
// Emit before key down event and check if default prevention is set.
|
|
9921
|
-
const proxy = this.beforeKeyDown.emit(e);
|
|
9933
|
+
const proxy = this.beforeKeyDown.emit(Object.assign({ original: e }, this.getData()));
|
|
9922
9934
|
if (e.defaultPrevented || proxy.defaultPrevented) {
|
|
9923
9935
|
return;
|
|
9924
9936
|
}
|
|
@@ -9936,10 +9948,10 @@ class OverlaySelection {
|
|
|
9936
9948
|
// clear subscriptions
|
|
9937
9949
|
this.unsubscribeSelectionStore.forEach(v => v());
|
|
9938
9950
|
this.unsubscribeSelectionStore.length = 0;
|
|
9939
|
-
this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => this.doFocus(v, v)));
|
|
9951
|
+
this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => v && this.doFocus(v, v)));
|
|
9940
9952
|
this.keyboardService = new KeyboardService({
|
|
9941
9953
|
selectionStore: s,
|
|
9942
|
-
range: r => this.triggerRangeEvent(r),
|
|
9954
|
+
range: r => !!r && this.triggerRangeEvent(r),
|
|
9943
9955
|
focus: (f, changes, focusNextViewport) => {
|
|
9944
9956
|
if (focusNextViewport) {
|
|
9945
9957
|
this.beforeNextViewportFocus.emit(f);
|
|
@@ -9956,7 +9968,8 @@ class OverlaySelection {
|
|
|
9956
9968
|
this.doEdit(val);
|
|
9957
9969
|
},
|
|
9958
9970
|
cancel: async () => {
|
|
9959
|
-
|
|
9971
|
+
var _a;
|
|
9972
|
+
await ((_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.cancelChanges());
|
|
9960
9973
|
this.closeEdit();
|
|
9961
9974
|
},
|
|
9962
9975
|
clearCell: () => !this.readonly && this.clearCell(),
|
|
@@ -9978,7 +9991,7 @@ class OverlaySelection {
|
|
|
9978
9991
|
selectionChanged: e => this.selectionChange.emit(e),
|
|
9979
9992
|
rangeCopy: e => this.beforeRangeCopyApply.emit(e),
|
|
9980
9993
|
rangeDataApply: e => this.rangeEditApply.emit(e),
|
|
9981
|
-
setRange: e => this.triggerRangeEvent(e),
|
|
9994
|
+
setRange: e => !!e && this.triggerRangeEvent(e),
|
|
9982
9995
|
getData: () => this.getData(),
|
|
9983
9996
|
});
|
|
9984
9997
|
}
|
|
@@ -10040,6 +10053,7 @@ class OverlaySelection {
|
|
|
10040
10053
|
} }));
|
|
10041
10054
|
}
|
|
10042
10055
|
render() {
|
|
10056
|
+
var _a;
|
|
10043
10057
|
const nodes = [];
|
|
10044
10058
|
const editCell = this.renderEditor();
|
|
10045
10059
|
// Editor
|
|
@@ -10059,14 +10073,14 @@ class OverlaySelection {
|
|
|
10059
10073
|
}
|
|
10060
10074
|
// Autofill
|
|
10061
10075
|
if (focus && !this.readonly && this.range) {
|
|
10062
|
-
nodes.push(this.autoFillService.renderAutofill(range, focus));
|
|
10076
|
+
nodes.push((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.renderAutofill(range, focus));
|
|
10063
10077
|
}
|
|
10064
10078
|
// Order
|
|
10065
10079
|
if (this.canDrag) {
|
|
10066
10080
|
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) }));
|
|
10067
10081
|
}
|
|
10068
10082
|
}
|
|
10069
|
-
return (hAsync(Host, { key: '
|
|
10083
|
+
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" })));
|
|
10070
10084
|
}
|
|
10071
10085
|
/**
|
|
10072
10086
|
* Executes the focus operation on the specified range of cells.
|
|
@@ -10121,6 +10135,7 @@ class OverlaySelection {
|
|
|
10121
10135
|
* Handle mouse down event on Host element
|
|
10122
10136
|
*/
|
|
10123
10137
|
onElementMouseDown(e, touch = false) {
|
|
10138
|
+
var _a;
|
|
10124
10139
|
// Get the target element from the event object
|
|
10125
10140
|
const targetElement = e.target;
|
|
10126
10141
|
// Ignore focus if clicked input
|
|
@@ -10137,7 +10152,7 @@ class OverlaySelection {
|
|
|
10137
10152
|
this.focus(focusCell, this.range && e.shiftKey);
|
|
10138
10153
|
// Initiate autofill selection
|
|
10139
10154
|
if (this.range) {
|
|
10140
|
-
this.autoFillService.selectionStart(targetElement, this.getData());
|
|
10155
|
+
targetElement && ((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionStart(targetElement, this.getData()));
|
|
10141
10156
|
// Prevent default behavior for mouse events,
|
|
10142
10157
|
// but only if target element is not a mobile input
|
|
10143
10158
|
if (!touch) {
|
|
@@ -10157,18 +10172,21 @@ class OverlaySelection {
|
|
|
10157
10172
|
var _a;
|
|
10158
10173
|
if (this.canEdit()) {
|
|
10159
10174
|
const focus = this.selectionStore.get('focus');
|
|
10175
|
+
if (!focus) {
|
|
10176
|
+
return;
|
|
10177
|
+
}
|
|
10160
10178
|
const data = this.columnService.getSaveData(focus.y, focus.x);
|
|
10161
10179
|
(_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
|
|
10162
10180
|
}
|
|
10163
10181
|
}
|
|
10164
10182
|
/**
|
|
10165
10183
|
* Close editor event triggered
|
|
10166
|
-
* @param details - if requires focus next
|
|
10184
|
+
* @param details - if it requires focus next
|
|
10167
10185
|
*/
|
|
10168
|
-
closeEdit(e) {
|
|
10186
|
+
async closeEdit(e) {
|
|
10169
10187
|
this.cancelEdit.emit();
|
|
10170
10188
|
if (e === null || e === void 0 ? void 0 : e.detail) {
|
|
10171
|
-
this.focusNext();
|
|
10189
|
+
await this.focusNext();
|
|
10172
10190
|
}
|
|
10173
10191
|
}
|
|
10174
10192
|
/**
|
|
@@ -10188,6 +10206,7 @@ class OverlaySelection {
|
|
|
10188
10206
|
return range;
|
|
10189
10207
|
}
|
|
10190
10208
|
onCopy(e) {
|
|
10209
|
+
var _a;
|
|
10191
10210
|
const range = this.getRegion();
|
|
10192
10211
|
const canCopyEvent = this.beforeCopyRegion.emit(range);
|
|
10193
10212
|
if (canCopyEvent.defaultPrevented) {
|
|
@@ -10203,10 +10222,11 @@ class OverlaySelection {
|
|
|
10203
10222
|
rangeData = event.detail.data;
|
|
10204
10223
|
}
|
|
10205
10224
|
}
|
|
10206
|
-
this.clipboard.doCopy(e, rangeData);
|
|
10225
|
+
(_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.doCopy(e, rangeData);
|
|
10207
10226
|
return true;
|
|
10208
10227
|
}
|
|
10209
10228
|
onPaste(data) {
|
|
10229
|
+
var _a;
|
|
10210
10230
|
const focus = this.selectionStore.get('focus');
|
|
10211
10231
|
const isEditing = this.selectionStore.get('edit') !== null;
|
|
10212
10232
|
if (!focus || isEditing) {
|
|
@@ -10217,24 +10237,30 @@ class OverlaySelection {
|
|
|
10217
10237
|
if (canPaste) {
|
|
10218
10238
|
return;
|
|
10219
10239
|
}
|
|
10220
|
-
this.autoFillService.onRangeApply(changed, range);
|
|
10240
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range);
|
|
10221
10241
|
}
|
|
10222
10242
|
async focusNext() {
|
|
10223
|
-
|
|
10243
|
+
var _a;
|
|
10244
|
+
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
10224
10245
|
code: codesLetter.ARROW_DOWN,
|
|
10225
|
-
}), this.range);
|
|
10246
|
+
}), this.range));
|
|
10226
10247
|
if (!canFocus) {
|
|
10227
10248
|
this.closeEdit();
|
|
10228
10249
|
}
|
|
10229
10250
|
}
|
|
10230
10251
|
clearCell() {
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10252
|
+
var _a;
|
|
10253
|
+
const range = this.selectionStore.get('range');
|
|
10254
|
+
if (range &&
|
|
10255
|
+
!isRangeSingleCell(range)) {
|
|
10256
|
+
const data = this.columnService.getRangeStaticData(range, '');
|
|
10257
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range);
|
|
10235
10258
|
}
|
|
10236
10259
|
else if (this.canEdit()) {
|
|
10237
10260
|
const focused = this.selectionStore.get('focus');
|
|
10261
|
+
if (!focused) {
|
|
10262
|
+
return;
|
|
10263
|
+
}
|
|
10238
10264
|
const cell = this.columnService.getSaveData(focused.y, focused.x);
|
|
10239
10265
|
this.cellEdit({
|
|
10240
10266
|
rgRow: focused.y,
|
|
@@ -10271,7 +10297,10 @@ class OverlaySelection {
|
|
|
10271
10297
|
const end = cell;
|
|
10272
10298
|
const start = this.selectionStore.get('focus');
|
|
10273
10299
|
if (isRangeEdit && start) {
|
|
10274
|
-
|
|
10300
|
+
const range = getRange(start, end);
|
|
10301
|
+
if (range) {
|
|
10302
|
+
return this.triggerRangeEvent(range);
|
|
10303
|
+
}
|
|
10275
10304
|
}
|
|
10276
10305
|
return this.doFocus(cell, end);
|
|
10277
10306
|
}
|
|
@@ -10292,6 +10321,7 @@ class OverlaySelection {
|
|
|
10292
10321
|
lastCell: this.lastCell,
|
|
10293
10322
|
focus: this.selectionStore.get('focus'),
|
|
10294
10323
|
range: this.selectionStore.get('range'),
|
|
10324
|
+
edit: this.selectionStore.get('edit'),
|
|
10295
10325
|
};
|
|
10296
10326
|
}
|
|
10297
10327
|
get element() { return getElement(this); }
|
|
@@ -10332,6 +10362,7 @@ class TextEditor {
|
|
|
10332
10362
|
constructor(column, saveCallback) {
|
|
10333
10363
|
this.column = column;
|
|
10334
10364
|
this.saveCallback = saveCallback;
|
|
10365
|
+
this.editInput = null;
|
|
10335
10366
|
this.element = null;
|
|
10336
10367
|
this.editCell = undefined;
|
|
10337
10368
|
}
|
|
@@ -10362,7 +10393,8 @@ class TextEditor {
|
|
|
10362
10393
|
* IMPORTANT: Prevent scroll glitches when editor is closed and focus is on current input element.
|
|
10363
10394
|
*/
|
|
10364
10395
|
beforeDisconnect() {
|
|
10365
|
-
|
|
10396
|
+
var _a;
|
|
10397
|
+
(_a = this.editInput) === null || _a === void 0 ? void 0 : _a.blur();
|
|
10366
10398
|
}
|
|
10367
10399
|
/**
|
|
10368
10400
|
* Get value from input
|
|
@@ -10465,8 +10497,8 @@ class RevoEdit {
|
|
|
10465
10497
|
}
|
|
10466
10498
|
}
|
|
10467
10499
|
componentWillRender() {
|
|
10468
|
-
// Active editor present
|
|
10469
|
-
if (this.currentEditor) {
|
|
10500
|
+
// Active editor present and not yet closed.
|
|
10501
|
+
if (this.currentEditor || !this.column) {
|
|
10470
10502
|
return;
|
|
10471
10503
|
}
|
|
10472
10504
|
this.preventSaveOnClose = false;
|
|
@@ -11147,8 +11179,9 @@ class DimensionProvider {
|
|
|
11147
11179
|
}
|
|
11148
11180
|
/**
|
|
11149
11181
|
* Sets dimension data and view port coordinate
|
|
11150
|
-
* @param
|
|
11182
|
+
* @param itemCount
|
|
11151
11183
|
* @param type - dimension type
|
|
11184
|
+
* @param noVirtual - disable virtual data
|
|
11152
11185
|
*/
|
|
11153
11186
|
setData(itemCount, type, noVirtual = false) {
|
|
11154
11187
|
this.setItemCount(itemCount, type);
|
|
@@ -11302,7 +11335,7 @@ class ThemeService {
|
|
|
11302
11335
|
}
|
|
11303
11336
|
}
|
|
11304
11337
|
static getTheme(theme) {
|
|
11305
|
-
if (allowedThemes.indexOf(theme) > -1) {
|
|
11338
|
+
if (theme && allowedThemes.indexOf(theme) > -1) {
|
|
11306
11339
|
return theme;
|
|
11307
11340
|
}
|
|
11308
11341
|
return DEFAULT_THEME;
|
|
@@ -12158,10 +12191,6 @@ class SortingPlugin extends BasePlugin {
|
|
|
12158
12191
|
constructor(revogrid, providers) {
|
|
12159
12192
|
super(revogrid, providers);
|
|
12160
12193
|
this.revogrid = revogrid;
|
|
12161
|
-
// sorting order per column
|
|
12162
|
-
this.sorting = null;
|
|
12163
|
-
// sorting function per column, multiple columns sorting supported
|
|
12164
|
-
this.sortingFunc = null;
|
|
12165
12194
|
this.sortingPromise = null;
|
|
12166
12195
|
this.postponeSort = debounce_1(async (order, comparison) => this.runSorting(order, comparison), 50);
|
|
12167
12196
|
const beforeanysource = async ({ detail: { type }, }) => {
|
|
@@ -12175,7 +12204,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12175
12204
|
}
|
|
12176
12205
|
};
|
|
12177
12206
|
const aftercolumnsset = async ({ detail: { order }, }) => {
|
|
12178
|
-
const columns = await this.revogrid.getColumns();
|
|
12207
|
+
const columns = (await this.revogrid.getColumns());
|
|
12179
12208
|
const sortingFunc = {};
|
|
12180
12209
|
for (let prop in order) {
|
|
12181
12210
|
const cmp = this.getComparer(ColumnDataProvider.getColumnByProp(columns, prop), order[prop]);
|
|
@@ -12221,6 +12250,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12221
12250
|
* If additive - add to existing sorting, multiple columns can be sorted
|
|
12222
12251
|
*/
|
|
12223
12252
|
async headerclick(column, index, additive) {
|
|
12253
|
+
var _a, _b;
|
|
12224
12254
|
let order = this.getNextOrder(column.order);
|
|
12225
12255
|
const beforeEvent = this.emit('beforesorting', { column, order, additive });
|
|
12226
12256
|
if (beforeEvent.defaultPrevented) {
|
|
@@ -12261,8 +12291,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
12261
12291
|
this.sortingFunc = { [column.prop]: cmp };
|
|
12262
12292
|
}
|
|
12263
12293
|
else {
|
|
12264
|
-
|
|
12265
|
-
|
|
12294
|
+
(_a = this.sorting) === null || _a === void 0 ? true : delete _a[column.prop];
|
|
12295
|
+
(_b = this.sortingFunc) === null || _b === void 0 ? true : delete _b[column.prop];
|
|
12266
12296
|
}
|
|
12267
12297
|
}
|
|
12268
12298
|
this.startSorting(this.sorting, this.sortingFunc);
|
|
@@ -12278,8 +12308,8 @@ class SortingPlugin extends BasePlugin {
|
|
|
12278
12308
|
async sort(sorting, sortingFunc, types = ['rgRow', 'rowPinStart', 'rowPinEnd']) {
|
|
12279
12309
|
// if no sorting - reset
|
|
12280
12310
|
if (!size_1(sorting)) {
|
|
12281
|
-
this.sorting =
|
|
12282
|
-
this.sortingFunc =
|
|
12311
|
+
this.sorting = undefined;
|
|
12312
|
+
this.sortingFunc = undefined;
|
|
12283
12313
|
for (let type of types) {
|
|
12284
12314
|
const store = await this.revogrid.getSourceStore(type);
|
|
12285
12315
|
// row data
|
|
@@ -12324,10 +12354,10 @@ class SortingPlugin extends BasePlugin {
|
|
|
12324
12354
|
return -1 * cmp(prop, a, b);
|
|
12325
12355
|
};
|
|
12326
12356
|
}
|
|
12327
|
-
sortIndexByItems(indexes, source, sortingFunc) {
|
|
12357
|
+
sortIndexByItems(indexes, source, sortingFunc = {}) {
|
|
12328
12358
|
// if no sorting - return unsorted indexes
|
|
12329
12359
|
if (Object.entries(sortingFunc).length === 0) {
|
|
12330
|
-
//
|
|
12360
|
+
// Unsorted indexes
|
|
12331
12361
|
return [...Array(indexes.length).keys()];
|
|
12332
12362
|
}
|
|
12333
12363
|
//
|
|
@@ -12343,7 +12373,7 @@ class SortingPlugin extends BasePlugin {
|
|
|
12343
12373
|
* 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.
|
|
12344
12374
|
* 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.
|
|
12345
12375
|
*/
|
|
12346
|
-
const sorted = cmp(prop, itemA, itemB);
|
|
12376
|
+
const sorted = cmp === null || cmp === void 0 ? void 0 : cmp(prop, itemA, itemB);
|
|
12347
12377
|
if (sorted) {
|
|
12348
12378
|
return sorted;
|
|
12349
12379
|
}
|
|
@@ -12593,13 +12623,13 @@ class ExportFilePlugin extends BasePlugin {
|
|
|
12593
12623
|
/** Export file */
|
|
12594
12624
|
async exportFile(options = {}, t = ExportTypes.csv) {
|
|
12595
12625
|
const formatter = this.formatter(t, options);
|
|
12596
|
-
const blob = await this.getBlob(formatter);
|
|
12597
12626
|
// url
|
|
12598
12627
|
const URL = window.URL || window.webkitURL;
|
|
12599
12628
|
const a = document.createElement('a');
|
|
12600
12629
|
const { filename, fileKind } = formatter.options;
|
|
12601
12630
|
const name = `${filename}.${fileKind}`;
|
|
12602
|
-
const
|
|
12631
|
+
const blob = await this.getBlob(formatter);
|
|
12632
|
+
const url = blob ? URL.createObjectURL(blob) : '';
|
|
12603
12633
|
a.style.display = 'none';
|
|
12604
12634
|
a.setAttribute('href', url);
|
|
12605
12635
|
a.setAttribute('download', name);
|
|
@@ -13024,7 +13054,7 @@ class GroupingRowPlugin extends BasePlugin {
|
|
|
13024
13054
|
const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({ prevExpanded }, options));
|
|
13025
13055
|
// setup source
|
|
13026
13056
|
this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer: options === null || options === void 0 ? void 0 : options.groupLabelTemplate }, true);
|
|
13027
|
-
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes, oldNewIndexMap);
|
|
13057
|
+
this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap);
|
|
13028
13058
|
}
|
|
13029
13059
|
/**
|
|
13030
13060
|
* Apply grouping on data set
|
|
@@ -13090,7 +13120,7 @@ class GroupingRowPlugin extends BasePlugin {
|
|
|
13090
13120
|
this.providers.data.setData(source, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, undefined, true);
|
|
13091
13121
|
this.updateTrimmed(undefined, undefined, oldNewIndexes);
|
|
13092
13122
|
}
|
|
13093
|
-
updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap, secondLevelMap) {
|
|
13123
|
+
updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap = {}, secondLevelMap) {
|
|
13094
13124
|
// map previously trimmed data
|
|
13095
13125
|
const trimemedOptionsToUpgrade = processDoubleConversionTrimmed(this.trimmed, firstLevelMap, secondLevelMap);
|
|
13096
13126
|
for (let type in trimemedOptionsToUpgrade) {
|
|
@@ -13128,6 +13158,25 @@ function getLastCell(data, rowType) {
|
|
|
13128
13158
|
y: lastVisibleRowCount,
|
|
13129
13159
|
};
|
|
13130
13160
|
}
|
|
13161
|
+
function viewportDataPartition(data, type, slot, fixed) {
|
|
13162
|
+
return {
|
|
13163
|
+
colData: data.colStore,
|
|
13164
|
+
viewportCol: data.viewports[data.colType].store,
|
|
13165
|
+
viewportRow: data.viewports[type].store,
|
|
13166
|
+
// lastCell is the last real coordinate + 1
|
|
13167
|
+
lastCell: getLastCell(data, type),
|
|
13168
|
+
slot,
|
|
13169
|
+
type,
|
|
13170
|
+
canDrag: !fixed,
|
|
13171
|
+
position: data.position,
|
|
13172
|
+
dataStore: data.rowStores[type].store,
|
|
13173
|
+
dimensionCol: data.dimensions[data.colType].store,
|
|
13174
|
+
dimensionRow: data.dimensions[type].store,
|
|
13175
|
+
style: fixed
|
|
13176
|
+
? { height: `${data.dimensions[type].store.get('realSize')}px` }
|
|
13177
|
+
: undefined,
|
|
13178
|
+
};
|
|
13179
|
+
}
|
|
13131
13180
|
|
|
13132
13181
|
/** Collect Column data */
|
|
13133
13182
|
function gatherColumnData(data) {
|
|
@@ -13210,11 +13259,9 @@ class ViewportService {
|
|
|
13210
13259
|
segmentSelection.setLastCell(rgRow.lastCell);
|
|
13211
13260
|
// register selection store for Row
|
|
13212
13261
|
const rowSelectionStore = this.registerRow(rgRow.position.y, rgRow.type);
|
|
13213
|
-
const rowDef = Object.assign(Object.assign({}, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
|
|
13262
|
+
const rowDef = Object.assign(Object.assign({ colType: val }, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
|
|
13214
13263
|
segmentSelection.setRangeArea(e.detail);
|
|
13215
|
-
}, onSettemprange: e => {
|
|
13216
|
-
segmentSelection.setTempArea(e.detail);
|
|
13217
|
-
}, onFocuscell: e => {
|
|
13264
|
+
}, onSettemprange: e => segmentSelection.setTempArea(e.detail), onFocuscell: e => {
|
|
13218
13265
|
// todo: multi focus
|
|
13219
13266
|
segmentSelection.clearFocus();
|
|
13220
13267
|
config.selectionStoreConnector.focus(segmentSelection, e.detail);
|
|
@@ -13264,43 +13311,27 @@ class ViewportService {
|
|
|
13264
13311
|
};
|
|
13265
13312
|
// y position for selection
|
|
13266
13313
|
let y = 0;
|
|
13267
|
-
return rowTypes.reduce((
|
|
13314
|
+
return rowTypes.reduce((result, type) => {
|
|
13268
13315
|
// filter out empty sources, we still need to return source to keep slot working
|
|
13269
13316
|
const isPresent = data.viewports[type].store.get('realCount') || type === 'rgRow';
|
|
13270
13317
|
const rgCol = Object.assign(Object.assign({}, data), { position: Object.assign(Object.assign({}, data.position), { y: isPresent ? y : EMPTY_INDEX }) });
|
|
13271
|
-
|
|
13318
|
+
const partition = viewportDataPartition(rgCol, type, slots[type], type !== 'rgRow');
|
|
13319
|
+
result.push(partition);
|
|
13272
13320
|
if (isPresent) {
|
|
13273
13321
|
y++;
|
|
13274
13322
|
}
|
|
13275
|
-
return
|
|
13323
|
+
return result;
|
|
13276
13324
|
}, []);
|
|
13277
13325
|
}
|
|
13278
|
-
dataPartition(data, type, slot, fixed) {
|
|
13279
|
-
return {
|
|
13280
|
-
colData: data.colStore,
|
|
13281
|
-
viewportCol: data.viewports[data.colType].store,
|
|
13282
|
-
viewportRow: data.viewports[type].store,
|
|
13283
|
-
// lastCell is the last real coordinate + 1
|
|
13284
|
-
lastCell: getLastCell(data, type),
|
|
13285
|
-
slot,
|
|
13286
|
-
type,
|
|
13287
|
-
canDrag: !fixed,
|
|
13288
|
-
position: data.position,
|
|
13289
|
-
dataStore: data.rowStores[type].store,
|
|
13290
|
-
dimensionCol: data.dimensions[data.colType].store,
|
|
13291
|
-
dimensionRow: data.dimensions[type].store,
|
|
13292
|
-
style: fixed
|
|
13293
|
-
? { height: `${data.dimensions[type].store.get('realSize')}px` }
|
|
13294
|
-
: undefined,
|
|
13295
|
-
};
|
|
13296
|
-
}
|
|
13297
13326
|
scrollToCell(cell) {
|
|
13298
13327
|
for (let key in cell) {
|
|
13299
13328
|
const coordinate = cell[key];
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13329
|
+
if (typeof coordinate === 'number') {
|
|
13330
|
+
this.config.scrollingService.proxyScroll({
|
|
13331
|
+
dimension: key === 'x' ? 'rgCol' : 'rgRow',
|
|
13332
|
+
coordinate,
|
|
13333
|
+
});
|
|
13334
|
+
}
|
|
13304
13335
|
}
|
|
13305
13336
|
}
|
|
13306
13337
|
/**
|
|
@@ -13336,22 +13367,30 @@ class ViewportService {
|
|
|
13336
13367
|
}
|
|
13337
13368
|
getStoreCoordinateByType(colType, rowType) {
|
|
13338
13369
|
const stores = this.config.selectionStoreConnector.storesByType;
|
|
13339
|
-
|
|
13370
|
+
if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {
|
|
13371
|
+
return;
|
|
13372
|
+
}
|
|
13373
|
+
return {
|
|
13340
13374
|
x: stores[colType],
|
|
13341
13375
|
y: stores[rowType],
|
|
13342
13376
|
};
|
|
13343
|
-
return storeCoordinate;
|
|
13344
13377
|
}
|
|
13345
13378
|
setFocus(colType, rowType, start, end) {
|
|
13346
13379
|
var _a;
|
|
13347
|
-
|
|
13380
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
13381
|
+
if (coordinate) {
|
|
13382
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.focusByCell(coordinate, start, end);
|
|
13383
|
+
}
|
|
13348
13384
|
}
|
|
13349
13385
|
getSelectedRange() {
|
|
13350
13386
|
return this.config.selectionStoreConnector.selectedRange;
|
|
13351
13387
|
}
|
|
13352
13388
|
setEdit(rowIndex, colIndex, colType, rowType) {
|
|
13353
13389
|
var _a;
|
|
13354
|
-
|
|
13390
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
13391
|
+
if (coordinate) {
|
|
13392
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEditByCell(coordinate, { x: colIndex, y: rowIndex });
|
|
13393
|
+
}
|
|
13355
13394
|
}
|
|
13356
13395
|
}
|
|
13357
13396
|
|
|
@@ -13362,7 +13401,7 @@ class GridScrollingService {
|
|
|
13362
13401
|
}
|
|
13363
13402
|
async proxyScroll(e, key) {
|
|
13364
13403
|
var _a;
|
|
13365
|
-
let
|
|
13404
|
+
let newEventPromise;
|
|
13366
13405
|
let event = e;
|
|
13367
13406
|
for (let elKey in this.elements) {
|
|
13368
13407
|
// skip
|
|
@@ -13376,7 +13415,7 @@ class GridScrollingService {
|
|
|
13376
13415
|
}
|
|
13377
13416
|
for (let el of this.elements[elKey]) {
|
|
13378
13417
|
if (el.changeScroll) {
|
|
13379
|
-
|
|
13418
|
+
newEventPromise = el.changeScroll(e);
|
|
13380
13419
|
}
|
|
13381
13420
|
}
|
|
13382
13421
|
}
|
|
@@ -13386,8 +13425,9 @@ class GridScrollingService {
|
|
|
13386
13425
|
}
|
|
13387
13426
|
}
|
|
13388
13427
|
}
|
|
13428
|
+
const newEvent = await newEventPromise;
|
|
13389
13429
|
if (newEvent) {
|
|
13390
|
-
event =
|
|
13430
|
+
event = newEvent;
|
|
13391
13431
|
}
|
|
13392
13432
|
this.setViewport(event);
|
|
13393
13433
|
}
|
|
@@ -13587,14 +13627,15 @@ function isStretchPlugin(plugin) {
|
|
|
13587
13627
|
const rowDefinitionByType = (newVal = []) => {
|
|
13588
13628
|
const result = {};
|
|
13589
13629
|
for (const v of newVal) {
|
|
13590
|
-
|
|
13591
|
-
|
|
13630
|
+
let rowDefs = result[v.type];
|
|
13631
|
+
if (!rowDefs) {
|
|
13632
|
+
rowDefs = result[v.type] = {};
|
|
13592
13633
|
}
|
|
13593
13634
|
if (v.size) {
|
|
13594
|
-
if (!
|
|
13595
|
-
|
|
13635
|
+
if (!rowDefs.sizes) {
|
|
13636
|
+
rowDefs.sizes = {};
|
|
13596
13637
|
}
|
|
13597
|
-
|
|
13638
|
+
rowDefs.sizes[v.index] = v.size;
|
|
13598
13639
|
}
|
|
13599
13640
|
}
|
|
13600
13641
|
return result;
|
|
@@ -13602,11 +13643,12 @@ const rowDefinitionByType = (newVal = []) => {
|
|
|
13602
13643
|
const rowDefinitionRemoveByType = (oldVal = []) => {
|
|
13603
13644
|
const result = {};
|
|
13604
13645
|
for (const v of oldVal) {
|
|
13605
|
-
|
|
13606
|
-
|
|
13646
|
+
let rowDefs = result[v.type];
|
|
13647
|
+
if (!rowDefs) {
|
|
13648
|
+
rowDefs = result[v.type] = [];
|
|
13607
13649
|
}
|
|
13608
13650
|
if (v.size) {
|
|
13609
|
-
|
|
13651
|
+
rowDefs.push(v.index);
|
|
13610
13652
|
}
|
|
13611
13653
|
}
|
|
13612
13654
|
return result;
|
|
@@ -13726,6 +13768,7 @@ const defaultProps = (props) => {
|
|
|
13726
13768
|
};
|
|
13727
13769
|
class ResizeDirective {
|
|
13728
13770
|
constructor(initialProps, $event) {
|
|
13771
|
+
var _a, _b;
|
|
13729
13772
|
this.initialProps = initialProps;
|
|
13730
13773
|
this.$event = $event;
|
|
13731
13774
|
this.mouseX = 0;
|
|
@@ -13740,8 +13783,8 @@ class ResizeDirective {
|
|
|
13740
13783
|
this.mouseUpFunc = this.handleUp.bind(this);
|
|
13741
13784
|
this.minW = this.props.minWidth;
|
|
13742
13785
|
this.minH = this.props.minHeight;
|
|
13743
|
-
this.maxW = this.props.maxWidth;
|
|
13744
|
-
this.maxH = this.props.maxHeight;
|
|
13786
|
+
this.maxW = (_a = this.props.maxWidth) !== null && _a !== void 0 ? _a : 0;
|
|
13787
|
+
this.maxH = (_b = this.props.maxHeight) !== null && _b !== void 0 ? _b : 0;
|
|
13745
13788
|
this.parent = { width: 0, height: 0 };
|
|
13746
13789
|
this.resizeState = 0;
|
|
13747
13790
|
}
|
|
@@ -13876,13 +13919,14 @@ class ResizeDirective {
|
|
|
13876
13919
|
this.unbindMove();
|
|
13877
13920
|
}
|
|
13878
13921
|
setInitials({ clientX, clientY }, target) {
|
|
13922
|
+
var _a, _b, _c, _d;
|
|
13879
13923
|
const computedStyle = getComputedStyle(this.$el);
|
|
13880
13924
|
this.$el.classList.add('active');
|
|
13881
13925
|
this.activeResizer = target;
|
|
13882
13926
|
if (this.disableCalcMap & DISABLE_MASK.w) {
|
|
13883
13927
|
this.mouseX = clientX;
|
|
13884
13928
|
this.width = this.$el.clientWidth;
|
|
13885
|
-
this.parent.width = this.$el.parentElement.clientWidth;
|
|
13929
|
+
this.parent.width = (_b = (_a = this.$el.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
|
|
13886
13930
|
// min width
|
|
13887
13931
|
const minPaddingX = parseFloat(computedStyle.paddingLeft) +
|
|
13888
13932
|
parseFloat(computedStyle.paddingRight);
|
|
@@ -13895,7 +13939,7 @@ class ResizeDirective {
|
|
|
13895
13939
|
if (this.disableCalcMap & DISABLE_MASK.h) {
|
|
13896
13940
|
this.mouseY = clientY;
|
|
13897
13941
|
this.height = this.$el.clientHeight;
|
|
13898
|
-
this.parent.height = this.$el.parentElement.clientHeight;
|
|
13942
|
+
this.parent.height = (_d = (_c = this.$el.parentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
|
|
13899
13943
|
// min height
|
|
13900
13944
|
const minPaddingY = parseFloat(computedStyle.paddingTop) +
|
|
13901
13945
|
parseFloat(computedStyle.paddingBottom);
|
|
@@ -13913,7 +13957,7 @@ class ResizeDirective {
|
|
|
13913
13957
|
this.activeResizer.removeAttribute('style');
|
|
13914
13958
|
}
|
|
13915
13959
|
this.$el.classList.remove('active');
|
|
13916
|
-
this.activeResizer =
|
|
13960
|
+
this.activeResizer = undefined;
|
|
13917
13961
|
}
|
|
13918
13962
|
bindMove() {
|
|
13919
13963
|
document.documentElement.addEventListener('mouseup', this.mouseUpFunc, true);
|
|
@@ -13962,7 +14006,7 @@ const ResizableElement = (props, children) => {
|
|
|
13962
14006
|
}
|
|
13963
14007
|
}
|
|
13964
14008
|
}
|
|
13965
|
-
return (hAsync("div", Object.assign({}, props, { ref: (e) => directive === null || directive === void 0 ? void 0 : directive.set(e) }),
|
|
14009
|
+
return (hAsync("div", Object.assign({}, props, { ref: (e) => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
|
|
13966
14010
|
children,
|
|
13967
14011
|
resizeEls));
|
|
13968
14012
|
};
|
|
@@ -14091,7 +14135,7 @@ class ColumnPlugin extends BasePlugin {
|
|
|
14091
14135
|
}
|
|
14092
14136
|
onMouseUp(e) {
|
|
14093
14137
|
// apply new positions
|
|
14094
|
-
if (this.dragData) {
|
|
14138
|
+
if (this.dragData && this.staticDragData) {
|
|
14095
14139
|
let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
|
|
14096
14140
|
if (relativePos < 0) {
|
|
14097
14141
|
relativePos = 0;
|
|
@@ -14208,9 +14252,6 @@ class RevoGridComponent {
|
|
|
14208
14252
|
this.aftergridinit = createEvent(this, "aftergridinit", 7);
|
|
14209
14253
|
this.additionaldatachanged = createEvent(this, "additionaldatachanged", 7);
|
|
14210
14254
|
this.afterthemechanged = createEvent(this, "afterthemechanged", 7);
|
|
14211
|
-
// #endregion
|
|
14212
|
-
// #region Listeners outside scope
|
|
14213
|
-
this.clickTrackForFocusClear = null;
|
|
14214
14255
|
this.extraElements = [];
|
|
14215
14256
|
this.viewport = null;
|
|
14216
14257
|
this.isInited = false;
|
|
@@ -14382,6 +14423,7 @@ class RevoGridComponent {
|
|
|
14382
14423
|
* @param column - full column details to update
|
|
14383
14424
|
* @param index - virtual column index
|
|
14384
14425
|
* @param order - order to apply
|
|
14426
|
+
* @param additive - if false will replace current order
|
|
14385
14427
|
*/
|
|
14386
14428
|
async updateColumnSorting(column, index, order, additive) {
|
|
14387
14429
|
return this.columnProvider.updateColumnSorting(column, index, order, additive);
|
|
@@ -14420,8 +14462,8 @@ class RevoGridComponent {
|
|
|
14420
14462
|
* Get the currently focused cell.
|
|
14421
14463
|
*/
|
|
14422
14464
|
async getFocused() {
|
|
14423
|
-
var _a;
|
|
14424
|
-
return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
|
|
14465
|
+
var _a, _b;
|
|
14466
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused()) !== null && _b !== void 0 ? _b : null;
|
|
14425
14467
|
}
|
|
14426
14468
|
/**
|
|
14427
14469
|
* Get size of content
|
|
@@ -14435,8 +14477,8 @@ class RevoGridComponent {
|
|
|
14435
14477
|
* Get the currently selected Range.
|
|
14436
14478
|
*/
|
|
14437
14479
|
async getSelectedRange() {
|
|
14438
|
-
var _a;
|
|
14439
|
-
return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange();
|
|
14480
|
+
var _a, _b;
|
|
14481
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange()) !== null && _b !== void 0 ? _b : null;
|
|
14440
14482
|
}
|
|
14441
14483
|
mousedownHandle(event) {
|
|
14442
14484
|
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
@@ -14449,7 +14491,8 @@ class RevoGridComponent {
|
|
|
14449
14491
|
/**
|
|
14450
14492
|
* To keep your elements from losing focus use mouseup/touchend e.preventDefault();
|
|
14451
14493
|
*/
|
|
14452
|
-
mouseupHandle(event) {
|
|
14494
|
+
async mouseupHandle(event) {
|
|
14495
|
+
var _a;
|
|
14453
14496
|
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
14454
14497
|
const screenY = getPropertyFromEvent(event, 'screenY');
|
|
14455
14498
|
if (screenX === null || screenY === null) {
|
|
@@ -14460,16 +14503,16 @@ class RevoGridComponent {
|
|
|
14460
14503
|
}
|
|
14461
14504
|
const pos = screenX + screenY;
|
|
14462
14505
|
// detect if mousemove then do nothing
|
|
14463
|
-
if (Math.abs(this.clickTrackForFocusClear - pos) > 10) {
|
|
14506
|
+
if (Math.abs(((_a = this.clickTrackForFocusClear) !== null && _a !== void 0 ? _a : 0) - pos) > 10) {
|
|
14464
14507
|
return;
|
|
14465
14508
|
}
|
|
14466
|
-
// Check if action finished inside
|
|
14467
|
-
// if event prevented or it is current table don't clear focus
|
|
14509
|
+
// Check if action finished inside the document
|
|
14510
|
+
// if event prevented, or it is current table don't clear focus
|
|
14468
14511
|
const path = event.composedPath();
|
|
14469
14512
|
if (!path.includes(this.element) &&
|
|
14470
|
-
!path.includes(this.element.shadowRoot)) {
|
|
14513
|
+
!(this.element.shadowRoot && path.includes(this.element.shadowRoot))) {
|
|
14471
14514
|
// Perform actions if the click is outside the component
|
|
14472
|
-
this.clearFocus();
|
|
14515
|
+
await this.clearFocus();
|
|
14473
14516
|
}
|
|
14474
14517
|
}
|
|
14475
14518
|
// #endregion
|
|
@@ -14679,15 +14722,12 @@ class RevoGridComponent {
|
|
|
14679
14722
|
let grPlugin;
|
|
14680
14723
|
for (let p of this.internalPlugins) {
|
|
14681
14724
|
const isGrouping = p;
|
|
14682
|
-
if (isGrouping.setGrouping) {
|
|
14725
|
+
if (!!isGrouping.setGrouping) {
|
|
14683
14726
|
grPlugin = isGrouping;
|
|
14684
14727
|
break;
|
|
14685
14728
|
}
|
|
14686
14729
|
}
|
|
14687
|
-
|
|
14688
|
-
return;
|
|
14689
|
-
}
|
|
14690
|
-
grPlugin.setGrouping(newVal || {});
|
|
14730
|
+
grPlugin === null || grPlugin === void 0 ? void 0 : grPlugin.setGrouping(newVal || {});
|
|
14691
14731
|
}
|
|
14692
14732
|
/**
|
|
14693
14733
|
* Stretch Plugin Apply
|
|
@@ -14771,7 +14811,7 @@ class RevoGridComponent {
|
|
|
14771
14811
|
(_a = this.plugins) === null || _a === void 0 ? void 0 : _a.forEach(p => this.internalPlugins.push(new p(this.element, pluginData)));
|
|
14772
14812
|
}
|
|
14773
14813
|
removePlugins() {
|
|
14774
|
-
this.internalPlugins.forEach(p => p.destroy());
|
|
14814
|
+
this.internalPlugins.forEach(p => { var _a; return (_a = p.destroy) === null || _a === void 0 ? void 0 : _a.call(p); });
|
|
14775
14815
|
this.internalPlugins = [];
|
|
14776
14816
|
}
|
|
14777
14817
|
// #endregion
|
|
@@ -14871,7 +14911,7 @@ class RevoGridComponent {
|
|
|
14871
14911
|
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 });
|
|
14872
14912
|
// Column headers
|
|
14873
14913
|
const dataViews = [
|
|
14874
|
-
hAsync("revogr-header", Object.assign({ key: '
|
|
14914
|
+
hAsync("revogr-header", Object.assign({ key: 'b08c837765cf20c88cb5b253a876f0f442c31628' }, headerProperties, { slot: HEADER_SLOT })),
|
|
14875
14915
|
];
|
|
14876
14916
|
// Render viewport data (vertical sections)
|
|
14877
14917
|
view.dataPorts.forEach(data => {
|
|
@@ -14893,11 +14933,12 @@ class RevoGridComponent {
|
|
|
14893
14933
|
const typeCol = 'rgCol';
|
|
14894
14934
|
const viewports = this.viewportProvider.stores;
|
|
14895
14935
|
const dimensions = this.dimensionProvider.stores;
|
|
14896
|
-
return (hAsync(Host, { key: '
|
|
14936
|
+
return (hAsync(Host, { key: '057a2cf1a64aaeec12d2aca17b09316fb3cbfde6' }, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { key: 'e89e3d136d756f80421f42f47e09583985edb1bc', class: "main-viewport", onClick: (e) => {
|
|
14937
|
+
var _a;
|
|
14897
14938
|
if (e.currentTarget === e.target) {
|
|
14898
|
-
this.viewport.clearEdit();
|
|
14939
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
|
|
14899
14940
|
}
|
|
14900
|
-
} }, hAsync("div", { key: '
|
|
14941
|
+
} }, 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));
|
|
14901
14942
|
}
|
|
14902
14943
|
disconnectedCallback() {
|
|
14903
14944
|
// Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
|
|
@@ -15109,10 +15150,13 @@ function renderCell(v) {
|
|
|
15109
15150
|
// Row drag
|
|
15110
15151
|
if (v.model.column.rowDrag &&
|
|
15111
15152
|
isRowDragService(v.model.column.rowDrag, v.model)) {
|
|
15112
|
-
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent =>
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15153
|
+
els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
|
|
15154
|
+
var _a;
|
|
15155
|
+
return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
|
|
15156
|
+
originalEvent,
|
|
15157
|
+
model: v.model,
|
|
15158
|
+
});
|
|
15159
|
+
} },
|
|
15116
15160
|
hAsync("span", { class: DRAG_ICON_CLASS })));
|
|
15117
15161
|
}
|
|
15118
15162
|
els.push(`${getCellData(v.model.model[v.model.prop])}`);
|
|
@@ -15746,7 +15790,8 @@ const HeaderRenderer = (p) => {
|
|
|
15746
15790
|
},
|
|
15747
15791
|
onResize: p.onResize,
|
|
15748
15792
|
onDoubleClick(originalEvent) {
|
|
15749
|
-
|
|
15793
|
+
var _a;
|
|
15794
|
+
(_a = p.onDoubleClick) === null || _a === void 0 ? void 0 : _a.call(p, {
|
|
15750
15795
|
column: p.data,
|
|
15751
15796
|
index: p.column.itemIndex,
|
|
15752
15797
|
originalEvent,
|
|
@@ -15811,7 +15856,7 @@ const ColumnGroupsRenderer = ({ additionalData, providers, depth, groups, visibl
|
|
|
15811
15856
|
// coordinates
|
|
15812
15857
|
const groupStart = getItemByIndex(dimensionCol, groupStartIndex).start;
|
|
15813
15858
|
const groupEnd = getItemByIndex(dimensionCol, groupEndIndex).end;
|
|
15814
|
-
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 }));
|
|
15859
|
+
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 }));
|
|
15815
15860
|
}
|
|
15816
15861
|
}
|
|
15817
15862
|
}
|
|
@@ -15978,7 +16023,7 @@ class RevogrRowHeaders {
|
|
|
15978
16023
|
const viewportHeader = Object.assign(Object.assign({}, this.headerProp), { colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: ROW_HEADER_TYPE,
|
|
15979
16024
|
// parent,
|
|
15980
16025
|
slot: HEADER_SLOT });
|
|
15981
|
-
return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: '
|
|
16026
|
+
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)));
|
|
15982
16027
|
}
|
|
15983
16028
|
static get cmpMeta() { return {
|
|
15984
16029
|
"$flags$": 0,
|
|
@@ -16092,7 +16137,7 @@ class LocalScrollService {
|
|
|
16092
16137
|
if (c < 0) {
|
|
16093
16138
|
return NO_COORDINATE;
|
|
16094
16139
|
}
|
|
16095
|
-
if (c > param.maxSize) {
|
|
16140
|
+
if (typeof param.maxSize === 'number' && c > param.maxSize) {
|
|
16096
16141
|
return param.maxSize;
|
|
16097
16142
|
}
|
|
16098
16143
|
return c;
|
|
@@ -16105,8 +16150,9 @@ class LocalScrollService {
|
|
|
16105
16150
|
}
|
|
16106
16151
|
/* convert virtual to real and back, scale range */
|
|
16107
16152
|
convert(pos, param, toReal = true) {
|
|
16153
|
+
var _a;
|
|
16108
16154
|
const minRange = param.clientSize;
|
|
16109
|
-
const from = [0, param.virtualContentSize - minRange];
|
|
16155
|
+
const from = [0, ((_a = param.virtualContentSize) !== null && _a !== void 0 ? _a : minRange) - minRange];
|
|
16110
16156
|
const to = [0, param.contentSize - param.virtualSize];
|
|
16111
16157
|
if (toReal) {
|
|
16112
16158
|
return scaleValue(pos, from, to);
|
|
@@ -16148,7 +16194,7 @@ class AutohideScrollPlugin {
|
|
|
16148
16194
|
show(element, timeout) {
|
|
16149
16195
|
clearTimeout(timeout);
|
|
16150
16196
|
return Number(setTimeout(() => {
|
|
16151
|
-
element.removeAttribute('visible');
|
|
16197
|
+
element === null || element === void 0 ? void 0 : element.removeAttribute('visible');
|
|
16152
16198
|
}, 1000));
|
|
16153
16199
|
}
|
|
16154
16200
|
clear() {
|
|
@@ -16388,8 +16434,9 @@ class RevogrViewportScroll {
|
|
|
16388
16434
|
* @param e
|
|
16389
16435
|
*/
|
|
16390
16436
|
async changeScroll(e, silent = false) {
|
|
16437
|
+
var _a, _b;
|
|
16391
16438
|
if (silent) {
|
|
16392
|
-
if (e.coordinate) {
|
|
16439
|
+
if (e.coordinate && this.verticalScroll) {
|
|
16393
16440
|
switch (e.dimension) {
|
|
16394
16441
|
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
16395
16442
|
case 'rgRow':
|
|
@@ -16397,7 +16444,7 @@ class RevogrViewportScroll {
|
|
|
16397
16444
|
break;
|
|
16398
16445
|
}
|
|
16399
16446
|
}
|
|
16400
|
-
return
|
|
16447
|
+
return;
|
|
16401
16448
|
}
|
|
16402
16449
|
if (e.delta) {
|
|
16403
16450
|
switch (e.dimension) {
|
|
@@ -16405,7 +16452,7 @@ class RevogrViewportScroll {
|
|
|
16405
16452
|
e.coordinate = this.horizontalScroll.scrollLeft + e.delta;
|
|
16406
16453
|
break;
|
|
16407
16454
|
case 'rgRow':
|
|
16408
|
-
e.coordinate = this.verticalScroll.scrollTop + e.delta;
|
|
16455
|
+
e.coordinate = ((_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0) + e.delta;
|
|
16409
16456
|
break;
|
|
16410
16457
|
}
|
|
16411
16458
|
this.setScroll(e);
|
|
@@ -16453,11 +16500,13 @@ class RevogrViewportScroll {
|
|
|
16453
16500
|
this.horizontalScroll.scrollLeft = e.coordinate;
|
|
16454
16501
|
break;
|
|
16455
16502
|
case 'rgRow':
|
|
16456
|
-
|
|
16457
|
-
|
|
16458
|
-
|
|
16459
|
-
|
|
16460
|
-
this.verticalScroll.style.transform
|
|
16503
|
+
if (this.verticalScroll) {
|
|
16504
|
+
// this will trigger on scroll event
|
|
16505
|
+
this.verticalScroll.scrollTop = e.coordinate;
|
|
16506
|
+
// for mobile devices to skip negative scroll loop. only on vertical scroll
|
|
16507
|
+
if (this.verticalScroll.style.transform) {
|
|
16508
|
+
this.verticalScroll.style.transform = '';
|
|
16509
|
+
}
|
|
16461
16510
|
}
|
|
16462
16511
|
break;
|
|
16463
16512
|
}
|
|
@@ -16468,23 +16517,23 @@ class RevogrViewportScroll {
|
|
|
16468
16517
|
// track horizontal viewport resize
|
|
16469
16518
|
this.resizeService = new GridResizeService(this.horizontalScroll, {
|
|
16470
16519
|
resize: entries => {
|
|
16471
|
-
var _a, _b, _c;
|
|
16520
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
16472
16521
|
let height = ((_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect.height) || 0;
|
|
16473
16522
|
if (height) {
|
|
16474
|
-
height -= this.header.clientHeight + this.footer.clientHeight;
|
|
16523
|
+
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);
|
|
16475
16524
|
}
|
|
16476
16525
|
const els = {
|
|
16477
16526
|
rgRow: {
|
|
16478
16527
|
size: height,
|
|
16479
16528
|
contentSize: this.contentHeight,
|
|
16480
|
-
scroll: this.verticalScroll.scrollTop,
|
|
16529
|
+
scroll: (_f = this.verticalScroll) === null || _f === void 0 ? void 0 : _f.scrollTop,
|
|
16481
16530
|
noScroll: false,
|
|
16482
16531
|
},
|
|
16483
16532
|
rgCol: {
|
|
16484
|
-
size: ((
|
|
16533
|
+
size: ((_g = entries[0]) === null || _g === void 0 ? void 0 : _g.contentRect.width) || 0,
|
|
16485
16534
|
contentSize: this.contentWidth,
|
|
16486
16535
|
scroll: this.horizontalScroll.scrollLeft,
|
|
16487
|
-
noScroll: this.colType !== 'rgCol'
|
|
16536
|
+
noScroll: this.colType !== 'rgCol',
|
|
16488
16537
|
},
|
|
16489
16538
|
};
|
|
16490
16539
|
for (const [dim, item] of Object.entries(els)) {
|
|
@@ -16493,7 +16542,7 @@ class RevogrViewportScroll {
|
|
|
16493
16542
|
if (item.noScroll) {
|
|
16494
16543
|
continue;
|
|
16495
16544
|
}
|
|
16496
|
-
(
|
|
16545
|
+
(_h = this.localScrollService) === null || _h === void 0 ? void 0 : _h.scroll((_j = item.scroll) !== null && _j !== void 0 ? _j : 0, dimension, true);
|
|
16497
16546
|
// track scroll visibility on outer element change
|
|
16498
16547
|
this.setScrollVisibility(dimension, item.size, item.contentSize);
|
|
16499
16548
|
}
|
|
@@ -16523,10 +16572,10 @@ class RevogrViewportScroll {
|
|
|
16523
16572
|
}
|
|
16524
16573
|
// based on scroll visibility assign or remove class and event
|
|
16525
16574
|
if (hasScroll) {
|
|
16526
|
-
el.classList.add(`scroll-${type}`);
|
|
16575
|
+
el === null || el === void 0 ? void 0 : el.classList.add(`scroll-${type}`);
|
|
16527
16576
|
}
|
|
16528
16577
|
else {
|
|
16529
|
-
el.classList.remove(`scroll-${type}`);
|
|
16578
|
+
el === null || el === void 0 ? void 0 : el.classList.remove(`scroll-${type}`);
|
|
16530
16579
|
}
|
|
16531
16580
|
this.scrollchange.emit({ type, hasScroll });
|
|
16532
16581
|
}
|
|
@@ -16534,6 +16583,7 @@ class RevogrViewportScroll {
|
|
|
16534
16583
|
this.resizeService.destroy();
|
|
16535
16584
|
}
|
|
16536
16585
|
async componentDidRender() {
|
|
16586
|
+
var _a, _b, _c, _d;
|
|
16537
16587
|
// scroll update if number of rows changed
|
|
16538
16588
|
if (this.contentHeight < this.oldValY && this.verticalScroll) {
|
|
16539
16589
|
this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;
|
|
@@ -16546,7 +16596,7 @@ class RevogrViewportScroll {
|
|
|
16546
16596
|
this.oldValX = this.contentWidth;
|
|
16547
16597
|
this.localScrollService.setParams({
|
|
16548
16598
|
contentSize: this.contentHeight,
|
|
16549
|
-
clientSize: this.verticalScroll.clientHeight,
|
|
16599
|
+
clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
|
|
16550
16600
|
virtualSize: 0,
|
|
16551
16601
|
}, 'rgRow');
|
|
16552
16602
|
this.localScrollService.setParams({
|
|
@@ -16554,11 +16604,11 @@ class RevogrViewportScroll {
|
|
|
16554
16604
|
clientSize: this.horizontalScroll.clientWidth,
|
|
16555
16605
|
virtualSize: 0,
|
|
16556
16606
|
}, 'rgCol');
|
|
16557
|
-
this.setScrollVisibility('rgRow', this.verticalScroll.clientHeight, this.contentHeight);
|
|
16607
|
+
this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
|
|
16558
16608
|
this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
|
|
16559
16609
|
}
|
|
16560
16610
|
render() {
|
|
16561
|
-
return (hAsync(Host, { key: '
|
|
16611
|
+
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 })))));
|
|
16562
16612
|
}
|
|
16563
16613
|
/**
|
|
16564
16614
|
* Extra layer for scroll event monitoring, where MouseWheel event is not passing
|
|
@@ -16601,10 +16651,11 @@ class RevogrViewportScroll {
|
|
|
16601
16651
|
* @param e
|
|
16602
16652
|
*/
|
|
16603
16653
|
onVerticalMouseWheel(type, delta, e) {
|
|
16604
|
-
var _a, _b;
|
|
16654
|
+
var _a, _b, _c, _d;
|
|
16605
16655
|
(_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
|
|
16606
|
-
const
|
|
16607
|
-
|
|
16656
|
+
const scrollTop = (_c = (_b = this.verticalScroll) === null || _b === void 0 ? void 0 : _b.scrollTop) !== null && _c !== void 0 ? _c : 0;
|
|
16657
|
+
const pos = scrollTop + e[delta];
|
|
16658
|
+
(_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
|
|
16608
16659
|
this.localScrollTimer.latestScrollUpdate(type);
|
|
16609
16660
|
}
|
|
16610
16661
|
/**
|
|
@@ -16661,9 +16712,9 @@ class VNodeToHtml {
|
|
|
16661
16712
|
});
|
|
16662
16713
|
}
|
|
16663
16714
|
render() {
|
|
16664
|
-
var _a;
|
|
16665
|
-
this.vnodes = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
16666
|
-
return (hAsync(Host, { key: '
|
|
16715
|
+
var _a, _b;
|
|
16716
|
+
this.vnodes = (_b = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : null;
|
|
16717
|
+
return (hAsync(Host, { key: 'dcaa7c6bd2f1eef1dd9a7f95a723f8ec778681a0', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
|
|
16667
16718
|
}
|
|
16668
16719
|
get el() { return getElement(this); }
|
|
16669
16720
|
static get cmpMeta() { return {
|