balala-revogrid 1.0.0
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/LICENSE +21 -0
- package/dist/cjs/app-globals-D67EXhgK.js +16 -0
- package/dist/cjs/app-globals-D67EXhgK.js.map +1 -0
- package/dist/cjs/cell-renderer-B87qecTb.js +57 -0
- package/dist/cjs/cell-renderer-B87qecTb.js.map +1 -0
- package/dist/cjs/debounce-CcpHiH2p.js +498 -0
- package/dist/cjs/debounce-CcpHiH2p.js.map +1 -0
- package/dist/cjs/dimension.helpers-DA9-xqPT.js +3606 -0
- package/dist/cjs/dimension.helpers-DA9-xqPT.js.map +1 -0
- package/dist/cjs/edit.utils-CKsIiHlD.js +113 -0
- package/dist/cjs/edit.utils-CKsIiHlD.js.map +1 -0
- package/dist/cjs/events-DeLDyZlb.js +46 -0
- package/dist/cjs/events-DeLDyZlb.js.map +1 -0
- package/dist/cjs/filter.button-DSsWNs23.js +49 -0
- package/dist/cjs/filter.button-DSsWNs23.js.map +1 -0
- package/dist/cjs/grouping.row.renderer-BqR0ytMi.js +64 -0
- package/dist/cjs/grouping.row.renderer-BqR0ytMi.js.map +1 -0
- package/dist/cjs/header-cell-renderer-D-RjAVfe.js +1766 -0
- package/dist/cjs/header-cell-renderer-D-RjAVfe.js.map +1 -0
- package/dist/cjs/index-BF1c1pO3.js +2549 -0
- package/dist/cjs/index-BF1c1pO3.js.map +1 -0
- package/dist/cjs/index.cjs.js +6426 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +19 -0
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.entry.js +3215 -0
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.js +31 -0
- package/dist/cjs/revo-grid.cjs.js.map +1 -0
- package/dist/cjs/revo-grid.entry.cjs.js.map +1 -0
- package/dist/cjs/revogr-attribution.revogr-extra.revogr-focus.revogr-grouping-overlay.revogr-header-unified.revogr-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.cjs.js.map +1 -0
- package/dist/cjs/revogr-attribution_9.cjs.entry.js +2629 -0
- package/dist/cjs/revogr-attribution_9.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-clipboard.revogr-edit.revogr-order-editor.entry.cjs.js.map +1 -0
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js +471 -0
- package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.cjs.js.map +1 -0
- package/dist/cjs/revogr-data_4.cjs.entry.js +1420 -0
- package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +382 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.entry.cjs.js.map +1 -0
- package/dist/cjs/row-renderer-BTE7VKD9.js +49 -0
- package/dist/cjs/row-renderer-BTE7VKD9.js.map +1 -0
- package/dist/cjs/text-editor-BdhmcrkS.js +81 -0
- package/dist/cjs/text-editor-BdhmcrkS.js.map +1 -0
- package/dist/cjs/throttle-2ZxfGjEI.js +533 -0
- package/dist/cjs/throttle-2ZxfGjEI.js.map +1 -0
- package/dist/cjs/tree-data.plugin-BRjwZtxI.js +5350 -0
- package/dist/cjs/tree-data.plugin-BRjwZtxI.js.map +1 -0
- package/dist/cjs/viewport.helpers-BAovztDd.js +61 -0
- package/dist/cjs/viewport.helpers-BAovztDd.js.map +1 -0
- package/dist/cjs/viewport.store-BTbPlyF-.js +525 -0
- package/dist/cjs/viewport.store-BTbPlyF-.js.map +1 -0
- package/dist/collection/collection-manifest.json +30 -0
- package/dist/collection/components/attribution/revogr-attribution.js +20 -0
- package/dist/collection/components/attribution/revogr-attribution.js.map +1 -0
- package/dist/collection/components/clipboard/revogr-clipboard.js +411 -0
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -0
- package/dist/collection/components/data/cell-renderer.js +44 -0
- package/dist/collection/components/data/cell-renderer.js.map +1 -0
- package/dist/collection/components/data/column.service.js +333 -0
- package/dist/collection/components/data/column.service.js.map +1 -0
- package/dist/collection/components/data/revogr-data-style.css +95 -0
- package/dist/collection/components/data/revogr-data.js +939 -0
- package/dist/collection/components/data/revogr-data.js.map +1 -0
- package/dist/collection/components/data/row-highlight.plugin.js +51 -0
- package/dist/collection/components/data/row-highlight.plugin.js.map +1 -0
- package/dist/collection/components/data/row-renderer.js +37 -0
- package/dist/collection/components/data/row-renderer.js.map +1 -0
- package/dist/collection/components/editors/edit.utils.js +13 -0
- package/dist/collection/components/editors/edit.utils.js.map +1 -0
- package/dist/collection/components/editors/revogr-edit-style.css +16 -0
- package/dist/collection/components/editors/revogr-edit.js +346 -0
- package/dist/collection/components/editors/revogr-edit.js.map +1 -0
- package/dist/collection/components/editors/text-editor.js +74 -0
- package/dist/collection/components/editors/text-editor.js.map +1 -0
- package/dist/collection/components/extra/revogr-extra.js +125 -0
- package/dist/collection/components/extra/revogr-extra.js.map +1 -0
- package/dist/collection/components/grouping-overlay/revogr-grouping-overlay.css +62 -0
- package/dist/collection/components/grouping-overlay/revogr-grouping-overlay.js +644 -0
- package/dist/collection/components/grouping-overlay/revogr-grouping-overlay.js.map +1 -0
- package/dist/collection/components/header/header-cell-renderer.js +49 -0
- package/dist/collection/components/header/header-cell-renderer.js.map +1 -0
- package/dist/collection/components/header/header-group-renderer.js +29 -0
- package/dist/collection/components/header/header-group-renderer.js.map +1 -0
- package/dist/collection/components/header/header-renderer.js +100 -0
- package/dist/collection/components/header/header-renderer.js.map +1 -0
- package/dist/collection/components/header/resizable.directive.js +274 -0
- package/dist/collection/components/header/resizable.directive.js.map +1 -0
- package/dist/collection/components/header/resizable.element.js +36 -0
- package/dist/collection/components/header/resizable.element.js.map +1 -0
- package/dist/collection/components/header/revogr-header-style.css +164 -0
- package/dist/collection/components/header/revogr-header-unified-style.css +205 -0
- package/dist/collection/components/header/revogr-header-unified.js +1013 -0
- package/dist/collection/components/header/revogr-header-unified.js.map +1 -0
- package/dist/collection/components/header/revogr-header.js +852 -0
- package/dist/collection/components/header/revogr-header.js.map +1 -0
- package/dist/collection/components/order/order-renderer.js +50 -0
- package/dist/collection/components/order/order-renderer.js.map +1 -0
- package/dist/collection/components/order/order-row.service.js +72 -0
- package/dist/collection/components/order/order-row.service.js.map +1 -0
- package/dist/collection/components/order/revogr-order-editor.js +461 -0
- package/dist/collection/components/order/revogr-order-editor.js.map +1 -0
- package/dist/collection/components/overlay/autofill.service.js +221 -0
- package/dist/collection/components/overlay/autofill.service.js.map +1 -0
- package/dist/collection/components/overlay/keyboard.service.js +178 -0
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js +1606 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -0
- package/dist/collection/components/overlay/revogr-overlay-style.css +95 -0
- package/dist/collection/components/overlay/selection.utils.js +136 -0
- package/dist/collection/components/overlay/selection.utils.js.map +1 -0
- package/dist/collection/components/revoGrid/grid.helpers.js +33 -0
- package/dist/collection/components/revoGrid/grid.helpers.js.map +1 -0
- package/dist/collection/components/revoGrid/plugin.service.js +81 -0
- package/dist/collection/components/revoGrid/plugin.service.js.map +1 -0
- package/dist/collection/components/revoGrid/revo-grid-style.css +897 -0
- package/dist/collection/components/revoGrid/revo-grid.js +4717 -0
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.helpers.js +51 -0
- package/dist/collection/components/revoGrid/viewport.helpers.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.resize.service.js +55 -0
- package/dist/collection/components/revoGrid/viewport.resize.service.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +139 -0
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.service.js +253 -0
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -0
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +291 -0
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -0
- package/dist/collection/components/rowHeaders/row-header-render.js +5 -0
- package/dist/collection/components/rowHeaders/row-header-render.js.map +1 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +70 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +938 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -0
- package/dist/collection/components/scrollable/autohide-scroll.plugin.js +44 -0
- package/dist/collection/components/scrollable/autohide-scroll.plugin.js.map +1 -0
- package/dist/collection/components/scrollable/revogr-scroll-style.css +34 -0
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +346 -0
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +1 -0
- package/dist/collection/components/selectionFocus/revogr-focus-style.css +7 -0
- package/dist/collection/components/selectionFocus/revogr-focus.js +429 -0
- package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -0
- package/dist/collection/components/selectionTempRange/revogr-temp-range-style.css +28 -0
- package/dist/collection/components/selectionTempRange/revogr-temp-range.js +171 -0
- package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -0
- package/dist/collection/components/vnode/vnode-converter.js +84 -0
- package/dist/collection/components/vnode/vnode-converter.js.map +1 -0
- package/dist/collection/components/vnode/vnode.utils.js +18 -0
- package/dist/collection/components/vnode/vnode.utils.js.map +1 -0
- package/dist/collection/global/global.js +19 -0
- package/dist/collection/global/global.js.map +1 -0
- package/dist/collection/index.js +13 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/plugins/add-rows-on-paste.plugin.js +40 -0
- package/dist/collection/plugins/add-rows-on-paste.plugin.js.map +1 -0
- package/dist/collection/plugins/base.plugin.js +90 -0
- package/dist/collection/plugins/base.plugin.js.map +1 -0
- package/dist/collection/plugins/column-hide.plugin.js +532 -0
- package/dist/collection/plugins/column-hide.plugin.js.map +1 -0
- package/dist/collection/plugins/column-manage.plugin.js +1218 -0
- package/dist/collection/plugins/column-manage.plugin.js.map +1 -0
- package/dist/collection/plugins/column-stretch.plugin.js +921 -0
- package/dist/collection/plugins/column-stretch.plugin.js.map +1 -0
- package/dist/collection/plugins/column.auto-size.plugin.js +308 -0
- package/dist/collection/plugins/column.auto-size.plugin.js.map +1 -0
- package/dist/collection/plugins/column.stretch.plugin.js +96 -0
- package/dist/collection/plugins/column.stretch.plugin.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/column-move.helper.js +361 -0
- package/dist/collection/plugins/customColumnDrag/column-move.helper.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/custom-column-drag.plugin.js +145 -0
- package/dist/collection/plugins/customColumnDrag/custom-column-drag.plugin.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/drag.handler.js +726 -0
- package/dist/collection/plugins/customColumnDrag/drag.handler.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/example.js +282 -0
- package/dist/collection/plugins/customColumnDrag/example.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/index.js +8 -0
- package/dist/collection/plugins/customColumnDrag/index.js.map +1 -0
- package/dist/collection/plugins/customColumnDrag/types.js +2 -0
- package/dist/collection/plugins/customColumnDrag/types.js.map +1 -0
- package/dist/collection/plugins/dispatcher.js +40 -0
- package/dist/collection/plugins/dispatcher.js.map +1 -0
- package/dist/collection/plugins/enhanced-scrollbar.plugin.js +493 -0
- package/dist/collection/plugins/enhanced-scrollbar.plugin.js.map +1 -0
- package/dist/collection/plugins/export/csv.js +72 -0
- package/dist/collection/plugins/export/csv.js.map +1 -0
- package/dist/collection/plugins/export/export.plugin.js +157 -0
- package/dist/collection/plugins/export/export.plugin.js.map +1 -0
- package/dist/collection/plugins/export/types.js +2 -0
- package/dist/collection/plugins/export/types.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/equal.js +21 -0
- package/dist/collection/plugins/filter/conditions/equal.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js +14 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +11 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/lessThan.js +16 -0
- package/dist/collection/plugins/filter/conditions/number/lessThan.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +11 -0
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/set.js +7 -0
- package/dist/collection/plugins/filter/conditions/set.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/string/beginswith.js +21 -0
- package/dist/collection/plugins/filter/conditions/string/beginswith.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/string/contains.js +25 -0
- package/dist/collection/plugins/filter/conditions/string/contains.js.map +1 -0
- package/dist/collection/plugins/filter/filter.button.js +28 -0
- package/dist/collection/plugins/filter/filter.button.js.map +1 -0
- package/dist/collection/plugins/filter/filter.indexed.js +49 -0
- package/dist/collection/plugins/filter/filter.indexed.js.map +1 -0
- package/dist/collection/plugins/filter/filter.panel.js +610 -0
- package/dist/collection/plugins/filter/filter.panel.js.map +1 -0
- package/dist/collection/plugins/filter/filter.plugin.js +388 -0
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -0
- package/dist/collection/plugins/filter/filter.style.css +165 -0
- package/dist/collection/plugins/filter/filter.types.js +9 -0
- package/dist/collection/plugins/filter/filter.types.js.map +1 -0
- package/dist/collection/plugins/grid-setup.js +131 -0
- package/dist/collection/plugins/grid-setup.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.const.js +18 -0
- package/dist/collection/plugins/groupingRow/grouping.const.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +122 -0
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +252 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +49 -0
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.types.js +2 -0
- package/dist/collection/plugins/groupingRow/grouping.row.types.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.service.js +215 -0
- package/dist/collection/plugins/groupingRow/grouping.service.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +61 -0
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js.map +1 -0
- package/dist/collection/plugins/index.js +26 -0
- package/dist/collection/plugins/index.js.map +1 -0
- package/dist/collection/plugins/manual-focus.plugin.js +353 -0
- package/dist/collection/plugins/manual-focus.plugin.js.map +1 -0
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +171 -0
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -0
- package/dist/collection/plugins/moveColumn/order-column.handler.js +69 -0
- package/dist/collection/plugins/moveColumn/order-column.handler.js.map +1 -0
- package/dist/collection/plugins/pin-shadow.plugin.js +487 -0
- package/dist/collection/plugins/pin-shadow.plugin.js.map +1 -0
- package/dist/collection/plugins/resize-indicator.plugin.js +430 -0
- package/dist/collection/plugins/resize-indicator.plugin.js.map +1 -0
- package/dist/collection/plugins/row-select-plugin-2026228.js +1803 -0
- package/dist/collection/plugins/row-select-plugin-2026228.js.map +1 -0
- package/dist/collection/plugins/row-select.plugin.js +2096 -0
- package/dist/collection/plugins/row-select.plugin.js.map +1 -0
- package/dist/collection/plugins/rtl/rtl.plugin.js +110 -0
- package/dist/collection/plugins/rtl/rtl.plugin.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.func.js +82 -0
- package/dist/collection/plugins/sorting/sorting.func.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.plugin.js +224 -0
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.sign.js +9 -0
- package/dist/collection/plugins/sorting/sorting.sign.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.types.js +2 -0
- package/dist/collection/plugins/sorting/sorting.types.js.map +1 -0
- package/dist/collection/plugins/tree-data.plugin.js +447 -0
- package/dist/collection/plugins/tree-data.plugin.js.map +1 -0
- package/dist/collection/plugins/wcag/index.js +84 -0
- package/dist/collection/plugins/wcag/index.js.map +1 -0
- package/dist/collection/serve/controller.js +344 -0
- package/dist/collection/serve/data.js +201 -0
- package/dist/collection/serve/realData.js +4148 -0
- package/dist/collection/services/cell.helpers.js +12 -0
- package/dist/collection/services/cell.helpers.js.map +1 -0
- package/dist/collection/services/column.data.provider.js +122 -0
- package/dist/collection/services/column.data.provider.js.map +1 -0
- package/dist/collection/services/data.provider.js +89 -0
- package/dist/collection/services/data.provider.js.map +1 -0
- package/dist/collection/services/dimension.provider.js +257 -0
- package/dist/collection/services/dimension.provider.js.map +1 -0
- package/dist/collection/services/local.scroll.service.js +136 -0
- package/dist/collection/services/local.scroll.service.js.map +1 -0
- package/dist/collection/services/local.scroll.timer.js +84 -0
- package/dist/collection/services/local.scroll.timer.js.map +1 -0
- package/dist/collection/services/selection.store.connector.js +274 -0
- package/dist/collection/services/selection.store.connector.js.map +1 -0
- package/dist/collection/services/viewport.provider.js +17 -0
- package/dist/collection/services/viewport.provider.js.map +1 -0
- package/dist/collection/store/dataSource/data.proxy.js +45 -0
- package/dist/collection/store/dataSource/data.proxy.js.map +1 -0
- package/dist/collection/store/dataSource/data.store.js +146 -0
- package/dist/collection/store/dataSource/data.store.js.map +1 -0
- package/dist/collection/store/dataSource/index.js +7 -0
- package/dist/collection/store/dataSource/index.js.map +1 -0
- package/dist/collection/store/dataSource/trimmed.plugin.js +34 -0
- package/dist/collection/store/dataSource/trimmed.plugin.js.map +1 -0
- package/dist/collection/store/dimension/dimension.helpers.js +101 -0
- package/dist/collection/store/dimension/dimension.helpers.js.map +1 -0
- package/dist/collection/store/dimension/dimension.recalculate.plugin.js +29 -0
- package/dist/collection/store/dimension/dimension.recalculate.plugin.js.map +1 -0
- package/dist/collection/store/dimension/dimension.store.js +124 -0
- package/dist/collection/store/dimension/dimension.store.js.map +1 -0
- package/dist/collection/store/dimension/dimension.trim.plugin.js +61 -0
- package/dist/collection/store/dimension/dimension.trim.plugin.js.map +1 -0
- package/dist/collection/store/dimension/index.js +6 -0
- package/dist/collection/store/dimension/index.js.map +1 -0
- package/dist/collection/store/index.js +17 -0
- package/dist/collection/store/index.js.map +1 -0
- package/dist/collection/store/selection/index.js +6 -0
- package/dist/collection/store/selection/index.js.map +1 -0
- package/dist/collection/store/selection/selection.helpers.js +49 -0
- package/dist/collection/store/selection/selection.helpers.js.map +1 -0
- package/dist/collection/store/selection/selection.store.js +85 -0
- package/dist/collection/store/selection/selection.store.js.map +1 -0
- package/dist/collection/store/vp/index.js +6 -0
- package/dist/collection/store/vp/index.js.map +1 -0
- package/dist/collection/store/vp/viewport.helpers.js +251 -0
- package/dist/collection/store/vp/viewport.helpers.js.map +1 -0
- package/dist/collection/store/vp/viewport.store.js +256 -0
- package/dist/collection/store/vp/viewport.store.js.map +1 -0
- package/dist/collection/themeManager/theme.compact.js +9 -0
- package/dist/collection/themeManager/theme.compact.js.map +1 -0
- package/dist/collection/themeManager/theme.default.js +9 -0
- package/dist/collection/themeManager/theme.default.js.map +1 -0
- package/dist/collection/themeManager/theme.material.js +9 -0
- package/dist/collection/themeManager/theme.material.js.map +1 -0
- package/dist/collection/themeManager/theme.service.js +53 -0
- package/dist/collection/themeManager/theme.service.js.map +1 -0
- package/dist/collection/types/dimension.js +2 -0
- package/dist/collection/types/dimension.js.map +1 -0
- package/dist/collection/types/events.js +124 -0
- package/dist/collection/types/events.js.map +1 -0
- package/dist/collection/types/index.js +12 -0
- package/dist/collection/types/index.js.map +1 -0
- package/dist/collection/types/interfaces.js +6 -0
- package/dist/collection/types/interfaces.js.map +1 -0
- package/dist/collection/types/plugin.js +2 -0
- package/dist/collection/types/plugin.js.map +1 -0
- package/dist/collection/types/plugin.types.js +2 -0
- package/dist/collection/types/plugin.types.js.map +1 -0
- package/dist/collection/types/selection.js +2 -0
- package/dist/collection/types/selection.js.map +1 -0
- package/dist/collection/types/theme.js +2 -0
- package/dist/collection/types/theme.js.map +1 -0
- package/dist/collection/types/viewport.interfaces.js +2 -0
- package/dist/collection/types/viewport.interfaces.js.map +1 -0
- package/dist/collection/utils/batchGroupCollapse.js +190 -0
- package/dist/collection/utils/batchGroupCollapse.js.map +1 -0
- package/dist/collection/utils/browser.js +7 -0
- package/dist/collection/utils/browser.js.map +1 -0
- package/dist/collection/utils/cell-template-helper.js +181 -0
- package/dist/collection/utils/cell-template-helper.js.map +1 -0
- package/dist/collection/utils/closest.polifill.js +22 -0
- package/dist/collection/utils/closest.polifill.js.map +1 -0
- package/dist/collection/utils/column.utils.js +448 -0
- package/dist/collection/utils/column.utils.js.map +1 -0
- package/dist/collection/utils/consts.js +26 -0
- package/dist/collection/utils/consts.js.map +1 -0
- package/dist/collection/utils/events.js +39 -0
- package/dist/collection/utils/events.js.map +1 -0
- package/dist/collection/utils/header.utils.js +24 -0
- package/dist/collection/utils/header.utils.js.map +1 -0
- package/dist/collection/utils/index.js +133 -0
- package/dist/collection/utils/index.js.map +1 -0
- package/dist/collection/utils/key.codes.js +80 -0
- package/dist/collection/utils/key.codes.js.map +1 -0
- package/dist/collection/utils/key.utils.js +86 -0
- package/dist/collection/utils/key.utils.js.map +1 -0
- package/dist/collection/utils/mobile.js +7 -0
- package/dist/collection/utils/mobile.js.map +1 -0
- package/dist/collection/utils/platform.js +9 -0
- package/dist/collection/utils/platform.js.map +1 -0
- package/dist/collection/utils/row-header-utils.js +9 -0
- package/dist/collection/utils/row-header-utils.js.map +1 -0
- package/dist/collection/utils/store.types.js +2 -0
- package/dist/collection/utils/store.types.js.map +1 -0
- package/dist/collection/utils/store.utils.js +15 -0
- package/dist/collection/utils/store.utils.js.map +1 -0
- package/dist/esm/app-globals-C3ZHKjnB.js +14 -0
- package/dist/esm/app-globals-C3ZHKjnB.js.map +1 -0
- package/dist/esm/cell-renderer-C2Td6LKY.js +54 -0
- package/dist/esm/cell-renderer-C2Td6LKY.js.map +1 -0
- package/dist/esm/debounce-BfO9dz9v.js +488 -0
- package/dist/esm/debounce-BfO9dz9v.js.map +1 -0
- package/dist/esm/dimension.helpers-DDil7Dg0.js +3546 -0
- package/dist/esm/dimension.helpers-DDil7Dg0.js.map +1 -0
- package/dist/esm/edit.utils-ClxXX_x9.js +99 -0
- package/dist/esm/edit.utils-ClxXX_x9.js.map +1 -0
- package/dist/esm/events-BvSmBueA.js +43 -0
- package/dist/esm/events-BvSmBueA.js.map +1 -0
- package/dist/esm/filter.button-DmOE7VCJ.js +39 -0
- package/dist/esm/filter.button-DmOE7VCJ.js.map +1 -0
- package/dist/esm/grouping.row.renderer-6NYszUJA.js +60 -0
- package/dist/esm/grouping.row.renderer-6NYszUJA.js.map +1 -0
- package/dist/esm/header-cell-renderer-BVHTuFGE.js +1715 -0
- package/dist/esm/header-cell-renderer-BVHTuFGE.js.map +1 -0
- package/dist/esm/index-Dyptvvxf.js +2519 -0
- package/dist/esm/index-Dyptvvxf.js.map +1 -0
- package/dist/esm/index.js +6232 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/revo-grid.entry.js +3213 -0
- package/dist/esm/revo-grid.entry.js.map +1 -0
- package/dist/esm/revo-grid.js +27 -0
- package/dist/esm/revo-grid.js.map +1 -0
- package/dist/esm/revogr-attribution.revogr-extra.revogr-focus.revogr-grouping-overlay.revogr-header-unified.revogr-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.js.map +1 -0
- package/dist/esm/revogr-attribution_9.entry.js +2619 -0
- package/dist/esm/revogr-attribution_9.entry.js.map +1 -0
- package/dist/esm/revogr-clipboard.revogr-edit.revogr-order-editor.entry.js.map +1 -0
- package/dist/esm/revogr-clipboard_3.entry.js +467 -0
- package/dist/esm/revogr-clipboard_3.entry.js.map +1 -0
- package/dist/esm/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.js.map +1 -0
- package/dist/esm/revogr-data_4.entry.js +1415 -0
- package/dist/esm/revogr-data_4.entry.js.map +1 -0
- package/dist/esm/revogr-filter-panel.entry.js +380 -0
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -0
- package/dist/esm/row-renderer-sb6QTqH-.js +46 -0
- package/dist/esm/row-renderer-sb6QTqH-.js.map +1 -0
- package/dist/esm/text-editor-CxXqoicM.js +79 -0
- package/dist/esm/text-editor-CxXqoicM.js.map +1 -0
- package/dist/esm/throttle-DXYrmEeb.js +525 -0
- package/dist/esm/throttle-DXYrmEeb.js.map +1 -0
- package/dist/esm/tree-data.plugin-C2eXkf9_.js +5319 -0
- package/dist/esm/tree-data.plugin-C2eXkf9_.js.map +1 -0
- package/dist/esm/viewport.helpers-VXhsJZtn.js +55 -0
- package/dist/esm/viewport.helpers-VXhsJZtn.js.map +1 -0
- package/dist/esm/viewport.store-C-GnV31k.js +512 -0
- package/dist/esm/viewport.store-C-GnV31k.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/revo-grid/app-globals-C3ZHKjnB.js +14 -0
- package/dist/revo-grid/app-globals-C3ZHKjnB.js.map +1 -0
- package/dist/revo-grid/cell-renderer-C2Td6LKY.js +54 -0
- package/dist/revo-grid/cell-renderer-C2Td6LKY.js.map +1 -0
- package/dist/revo-grid/debounce-BfO9dz9v.js +488 -0
- package/dist/revo-grid/debounce-BfO9dz9v.js.map +1 -0
- package/dist/revo-grid/dimension.helpers-DDil7Dg0.js +3546 -0
- package/dist/revo-grid/dimension.helpers-DDil7Dg0.js.map +1 -0
- package/dist/revo-grid/edit.utils-ClxXX_x9.js +99 -0
- package/dist/revo-grid/edit.utils-ClxXX_x9.js.map +1 -0
- package/dist/revo-grid/events-BvSmBueA.js +43 -0
- package/dist/revo-grid/events-BvSmBueA.js.map +1 -0
- package/dist/revo-grid/filter.button-DmOE7VCJ.js +39 -0
- package/dist/revo-grid/filter.button-DmOE7VCJ.js.map +1 -0
- package/dist/revo-grid/grouping.row.renderer-6NYszUJA.js +60 -0
- package/dist/revo-grid/grouping.row.renderer-6NYszUJA.js.map +1 -0
- package/dist/revo-grid/header-cell-renderer-BVHTuFGE.js +1715 -0
- package/dist/revo-grid/header-cell-renderer-BVHTuFGE.js.map +1 -0
- package/dist/revo-grid/index-Dyptvvxf.js +2490 -0
- package/dist/revo-grid/index-Dyptvvxf.js.map +1 -0
- package/dist/revo-grid/index.esm.js +6232 -0
- package/dist/revo-grid/index.esm.js.map +1 -0
- package/dist/revo-grid/loader.esm.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.esm.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.js +3213 -0
- package/dist/revo-grid/revo-grid.entry.js.map +1 -0
- package/dist/revo-grid/revo-grid.esm.js +27 -0
- package/dist/revo-grid/revo-grid.esm.js.map +1 -0
- package/dist/revo-grid/revogr-attribution.revogr-extra.revogr-focus.revogr-grouping-overlay.revogr-header-unified.revogr-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.esm.js.map +1 -0
- package/dist/revo-grid/revogr-attribution_9.entry.js +2619 -0
- package/dist/revo-grid/revogr-attribution_9.entry.js.map +1 -0
- package/dist/revo-grid/revogr-clipboard.revogr-edit.revogr-order-editor.entry.esm.js.map +1 -0
- package/dist/revo-grid/revogr-clipboard_3.entry.js +467 -0
- package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -0
- package/dist/revo-grid/revogr-data.revogr-header.revogr-viewport-scroll.vnode-html.entry.esm.js.map +1 -0
- package/dist/revo-grid/revogr-data_4.entry.js +1415 -0
- package/dist/revo-grid/revogr-data_4.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.esm.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +380 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -0
- package/dist/revo-grid/row-renderer-sb6QTqH-.js +46 -0
- package/dist/revo-grid/row-renderer-sb6QTqH-.js.map +1 -0
- package/dist/revo-grid/text-editor-CxXqoicM.js +79 -0
- package/dist/revo-grid/text-editor-CxXqoicM.js.map +1 -0
- package/dist/revo-grid/throttle-DXYrmEeb.js +525 -0
- package/dist/revo-grid/throttle-DXYrmEeb.js.map +1 -0
- package/dist/revo-grid/tree-data.plugin-C2eXkf9_.js +5319 -0
- package/dist/revo-grid/tree-data.plugin-C2eXkf9_.js.map +1 -0
- package/dist/revo-grid/viewport.helpers-VXhsJZtn.js +55 -0
- package/dist/revo-grid/viewport.helpers-VXhsJZtn.js.map +1 -0
- package/dist/revo-grid/viewport.store-C-GnV31k.js +512 -0
- package/dist/revo-grid/viewport.store-C-GnV31k.js.map +1 -0
- package/dist/types/components/attribution/revogr-attribution.d.ts +12 -0
- package/dist/types/components/clipboard/revogr-clipboard.d.ts +89 -0
- package/dist/types/components/data/cell-renderer.d.ts +12 -0
- package/dist/types/components/data/column.service.d.ts +65 -0
- package/dist/types/components/data/revogr-data.d.ts +132 -0
- package/dist/types/components/data/row-highlight.plugin.d.ts +10 -0
- package/dist/types/components/data/row-renderer.d.ts +13 -0
- package/dist/types/components/editors/edit.utils.d.ts +3 -0
- package/dist/types/components/editors/revogr-edit.d.ts +63 -0
- package/dist/types/components/editors/text-editor.d.ts +43 -0
- package/dist/types/components/extra/revogr-extra.d.ts +38 -0
- package/dist/types/components/grouping-overlay/revogr-grouping-overlay.d.ts +71 -0
- package/dist/types/components/header/header-cell-renderer.d.ts +10 -0
- package/dist/types/components/header/header-group-renderer.d.ts +17 -0
- package/dist/types/components/header/header-renderer.d.ts +24 -0
- package/dist/types/components/header/resizable.directive.d.ts +60 -0
- package/dist/types/components/header/resizable.element.d.ts +5 -0
- package/dist/types/components/header/revogr-header-unified.d.ts +168 -0
- package/dist/types/components/header/revogr-header.d.ts +131 -0
- package/dist/types/components/order/order-renderer.d.ts +29 -0
- package/dist/types/components/order/order-row.service.d.ts +27 -0
- package/dist/types/components/order/revogr-order-editor.d.ts +56 -0
- package/dist/types/components/overlay/autofill.service.d.ts +80 -0
- package/dist/types/components/overlay/keyboard.service.d.ts +29 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +295 -0
- package/dist/types/components/overlay/selection.utils.d.ts +47 -0
- package/dist/types/components/revoGrid/grid.helpers.d.ts +17 -0
- package/dist/types/components/revoGrid/plugin.service.d.ts +37 -0
- package/dist/types/components/revoGrid/revo-grid.d.ts +801 -0
- package/dist/types/components/revoGrid/viewport.helpers.d.ts +42 -0
- package/dist/types/components/revoGrid/viewport.resize.service.d.ts +17 -0
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +24 -0
- package/dist/types/components/revoGrid/viewport.service.d.ts +59 -0
- package/dist/types/components/rowHeaders/revogr-row-headers.d.ts +51 -0
- package/dist/types/components/rowHeaders/row-header-render.d.ts +9 -0
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +159 -0
- package/dist/types/components/scrollable/autohide-scroll.plugin.d.ts +22 -0
- package/dist/types/components/scrollable/revogr-scroll-virtual.d.ts +49 -0
- package/dist/types/components/selectionFocus/revogr-focus.d.ts +63 -0
- package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +28 -0
- package/dist/types/components/vnode/vnode-converter.d.ts +19 -0
- package/dist/types/components/vnode/vnode.utils.d.ts +9 -0
- package/dist/types/components.d.ts +2928 -0
- package/dist/types/global/global.d.ts +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/plugins/add-rows-on-paste.plugin.d.ts +14 -0
- package/dist/types/plugins/base.plugin.d.ts +51 -0
- package/dist/types/plugins/column-hide.plugin.d.ts +110 -0
- package/dist/types/plugins/column-manage.plugin.d.ts +225 -0
- package/dist/types/plugins/column-stretch.plugin.d.ts +159 -0
- package/dist/types/plugins/column.auto-size.plugin.d.ts +69 -0
- package/dist/types/plugins/column.stretch.plugin.d.ts +20 -0
- package/dist/types/plugins/customColumnDrag/column-move.helper.d.ts +71 -0
- package/dist/types/plugins/customColumnDrag/custom-column-drag.plugin.d.ts +35 -0
- package/dist/types/plugins/customColumnDrag/drag.handler.d.ts +112 -0
- package/dist/types/plugins/customColumnDrag/example.d.ts +31 -0
- package/dist/types/plugins/customColumnDrag/index.d.ts +5 -0
- package/dist/types/plugins/customColumnDrag/types.d.ts +46 -0
- package/dist/types/plugins/dispatcher.d.ts +20 -0
- package/dist/types/plugins/enhanced-scrollbar.plugin.d.ts +76 -0
- package/dist/types/plugins/export/csv.d.ts +9 -0
- package/dist/types/plugins/export/export.plugin.d.ts +24 -0
- package/dist/types/plugins/export/types.d.ts +23 -0
- package/dist/types/plugins/filter/conditions/equal.d.ts +4 -0
- package/dist/types/plugins/filter/conditions/number/greaterThan.d.ts +3 -0
- package/dist/types/plugins/filter/conditions/number/greaterThanOrEqual.d.ts +3 -0
- package/dist/types/plugins/filter/conditions/number/lessThan.d.ts +3 -0
- package/dist/types/plugins/filter/conditions/number/lessThanOrEqual.d.ts +3 -0
- package/dist/types/plugins/filter/conditions/set.d.ts +4 -0
- package/dist/types/plugins/filter/conditions/string/beginswith.d.ts +3 -0
- package/dist/types/plugins/filter/conditions/string/contains.d.ts +4 -0
- package/dist/types/plugins/filter/filter.button.d.ts +14 -0
- package/dist/types/plugins/filter/filter.indexed.d.ts +20 -0
- package/dist/types/plugins/filter/filter.panel.d.ts +53 -0
- package/dist/types/plugins/filter/filter.plugin.d.ts +73 -0
- package/dist/types/plugins/filter/filter.types.d.ts +129 -0
- package/dist/types/plugins/grid-setup.d.ts +65 -0
- package/dist/types/plugins/groupingRow/grouping.const.d.ts +14 -0
- package/dist/types/plugins/groupingRow/grouping.row.expand.service.d.ts +15 -0
- package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +39 -0
- package/dist/types/plugins/groupingRow/grouping.row.renderer.d.ts +6 -0
- package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +144 -0
- package/dist/types/plugins/groupingRow/grouping.service.d.ts +36 -0
- package/dist/types/plugins/groupingRow/grouping.trimmed.service.d.ts +10 -0
- package/dist/types/plugins/index.d.ts +22 -0
- package/dist/types/plugins/manual-focus.plugin.d.ts +113 -0
- package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +50 -0
- package/dist/types/plugins/moveColumn/order-column.handler.d.ts +16 -0
- package/dist/types/plugins/pin-shadow.plugin.d.ts +73 -0
- package/dist/types/plugins/resize-indicator.plugin.d.ts +71 -0
- package/dist/types/plugins/row-select-plugin-2026228.d.ts +367 -0
- package/dist/types/plugins/row-select.plugin.d.ts +378 -0
- package/dist/types/plugins/rtl/rtl.plugin.d.ts +37 -0
- package/dist/types/plugins/sorting/sorting.func.d.ts +9 -0
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +48 -0
- package/dist/types/plugins/sorting/sorting.sign.d.ts +6 -0
- package/dist/types/plugins/sorting/sorting.types.d.ts +14 -0
- package/dist/types/plugins/tree-data.plugin.d.ts +56 -0
- package/dist/types/plugins/wcag/index.d.ts +26 -0
- package/dist/types/services/cell.helpers.d.ts +2 -0
- package/dist/types/services/column.data.provider.d.ts +27 -0
- package/dist/types/services/data.provider.d.ts +36 -0
- package/dist/types/services/dimension.provider.d.ts +71 -0
- package/dist/types/services/local.scroll.service.d.ts +36 -0
- package/dist/types/services/local.scroll.timer.d.ts +32 -0
- package/dist/types/services/selection.store.connector.d.ts +74 -0
- package/dist/types/services/viewport.provider.d.ts +9 -0
- package/dist/types/stencil-public-runtime.d.ts +1709 -0
- package/dist/types/store/dataSource/data.proxy.d.ts +14 -0
- package/dist/types/store/dataSource/data.store.d.ts +77 -0
- package/dist/types/store/dataSource/index.d.ts +3 -0
- package/dist/types/store/dataSource/trimmed.plugin.d.ts +12 -0
- package/dist/types/store/dimension/dimension.helpers.d.ts +24 -0
- package/dist/types/store/dimension/dimension.recalculate.plugin.d.ts +15 -0
- package/dist/types/store/dimension/dimension.store.d.ts +34 -0
- package/dist/types/store/dimension/dimension.trim.plugin.d.ts +13 -0
- package/dist/types/store/dimension/index.d.ts +2 -0
- package/dist/types/store/index.d.ts +8 -0
- package/dist/types/store/selection/index.d.ts +2 -0
- package/dist/types/store/selection/selection.helpers.d.ts +5 -0
- package/dist/types/store/selection/selection.store.d.ts +22 -0
- package/dist/types/store/vp/index.d.ts +7 -0
- package/dist/types/store/vp/viewport.helpers.d.ts +54 -0
- package/dist/types/store/vp/viewport.store.d.ts +38 -0
- package/dist/types/themeManager/theme.compact.d.ts +4 -0
- package/dist/types/themeManager/theme.default.d.ts +4 -0
- package/dist/types/themeManager/theme.material.d.ts +4 -0
- package/dist/types/themeManager/theme.service.d.ts +13 -0
- package/dist/types/types/dimension.d.ts +8 -0
- package/dist/types/types/events.d.ts +2 -0
- package/dist/types/types/index.d.ts +8 -0
- package/dist/types/types/interfaces.d.ts +795 -0
- package/dist/types/types/plugin.d.ts +9 -0
- package/dist/types/types/plugin.types.d.ts +48 -0
- package/dist/types/types/selection.d.ts +178 -0
- package/dist/types/types/theme.d.ts +7 -0
- package/dist/types/types/viewport.interfaces.d.ts +45 -0
- package/dist/types/utils/batchGroupCollapse.d.ts +77 -0
- package/dist/types/utils/browser.d.ts +1 -0
- package/dist/types/utils/cell-template-helper.d.ts +74 -0
- package/dist/types/utils/closest.polifill.d.ts +0 -0
- package/dist/types/utils/column.utils.d.ts +110 -0
- package/dist/types/utils/consts.d.ts +22 -0
- package/dist/types/utils/events.d.ts +5 -0
- package/dist/types/utils/header.utils.d.ts +2 -0
- package/dist/types/utils/index.d.ts +32 -0
- package/dist/types/utils/key.codes.d.ts +73 -0
- package/dist/types/utils/key.utils.d.ts +12 -0
- package/dist/types/utils/mobile.d.ts +1 -0
- package/dist/types/utils/platform.d.ts +4 -0
- package/dist/types/utils/row-header-utils.d.ts +2 -0
- package/dist/types/utils/store.types.d.ts +97 -0
- package/dist/types/utils/store.utils.d.ts +10 -0
- package/hydrate/index.d.ts +273 -0
- package/hydrate/index.js +39851 -0
- package/hydrate/index.mjs +39843 -0
- package/hydrate/package.json +12 -0
- package/loader/cdn.js +4 -0
- package/loader/index.cjs.js +4 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +4 -0
- package/loader/index.js +5 -0
- package/package.json +149 -0
- package/readme.md +303 -0
- package/standalone/column.service.js +1110 -0
- package/standalone/column.service.js.map +1 -0
- package/standalone/consts.js +30 -0
- package/standalone/consts.js.map +1 -0
- package/standalone/data.store.js +3101 -0
- package/standalone/data.store.js.map +1 -0
- package/standalone/debounce.js +215 -0
- package/standalone/debounce.js.map +1 -0
- package/standalone/dimension.helpers.js +229 -0
- package/standalone/dimension.helpers.js.map +1 -0
- package/standalone/filter.button.js +39 -0
- package/standalone/filter.button.js.map +1 -0
- package/standalone/grouping.service.js +234 -0
- package/standalone/grouping.service.js.map +1 -0
- package/standalone/header-group-renderer.js +634 -0
- package/standalone/header-group-renderer.js.map +1 -0
- package/standalone/index.d.ts +72 -0
- package/standalone/index.js +6272 -0
- package/standalone/index.js.map +1 -0
- package/standalone/index2.js +131 -0
- package/standalone/index2.js.map +1 -0
- package/standalone/local.scroll.timer.js +222 -0
- package/standalone/local.scroll.timer.js.map +1 -0
- package/standalone/platform.js +90 -0
- package/standalone/platform.js.map +1 -0
- package/standalone/revo-grid.d.ts +11 -0
- package/standalone/revo-grid.js +8734 -0
- package/standalone/revo-grid.js.map +1 -0
- package/standalone/revogr-attribution.d.ts +11 -0
- package/standalone/revogr-attribution.js +12 -0
- package/standalone/revogr-attribution.js.map +1 -0
- package/standalone/revogr-attribution2.js +32 -0
- package/standalone/revogr-attribution2.js.map +1 -0
- package/standalone/revogr-clipboard.d.ts +11 -0
- package/standalone/revogr-clipboard.js +12 -0
- package/standalone/revogr-clipboard.js.map +1 -0
- package/standalone/revogr-clipboard2.js +179 -0
- package/standalone/revogr-clipboard2.js.map +1 -0
- package/standalone/revogr-data.d.ts +11 -0
- package/standalone/revogr-data.js +12 -0
- package/standalone/revogr-data.js.map +1 -0
- package/standalone/revogr-data2.js +503 -0
- package/standalone/revogr-data2.js.map +1 -0
- package/standalone/revogr-edit.d.ts +11 -0
- package/standalone/revogr-edit.js +12 -0
- package/standalone/revogr-edit.js.map +1 -0
- package/standalone/revogr-edit2.js +330 -0
- package/standalone/revogr-edit2.js.map +1 -0
- package/standalone/revogr-extra.d.ts +11 -0
- package/standalone/revogr-extra.js +12 -0
- package/standalone/revogr-extra.js.map +1 -0
- package/standalone/revogr-extra2.js +73 -0
- package/standalone/revogr-extra2.js.map +1 -0
- package/standalone/revogr-filter-panel.d.ts +11 -0
- package/standalone/revogr-filter-panel.js +411 -0
- package/standalone/revogr-filter-panel.js.map +1 -0
- package/standalone/revogr-focus.d.ts +11 -0
- package/standalone/revogr-focus.js +12 -0
- package/standalone/revogr-focus.js.map +1 -0
- package/standalone/revogr-focus2.js +119 -0
- package/standalone/revogr-focus2.js.map +1 -0
- package/standalone/revogr-grouping-overlay.d.ts +11 -0
- package/standalone/revogr-grouping-overlay.js +12 -0
- package/standalone/revogr-grouping-overlay.js.map +1 -0
- package/standalone/revogr-grouping-overlay2.js +356 -0
- package/standalone/revogr-grouping-overlay2.js.map +1 -0
- package/standalone/revogr-header-unified.d.ts +11 -0
- package/standalone/revogr-header-unified.js +12 -0
- package/standalone/revogr-header-unified.js.map +1 -0
- package/standalone/revogr-header-unified2.js +781 -0
- package/standalone/revogr-header-unified2.js.map +1 -0
- package/standalone/revogr-header.d.ts +11 -0
- package/standalone/revogr-header.js +12 -0
- package/standalone/revogr-header.js.map +1 -0
- package/standalone/revogr-header2.js +343 -0
- package/standalone/revogr-header2.js.map +1 -0
- package/standalone/revogr-order-editor.d.ts +11 -0
- package/standalone/revogr-order-editor.js +12 -0
- package/standalone/revogr-order-editor.js.map +1 -0
- package/standalone/revogr-order-editor2.js +201 -0
- package/standalone/revogr-order-editor2.js.map +1 -0
- package/standalone/revogr-overlay-selection.d.ts +11 -0
- package/standalone/revogr-overlay-selection.js +12 -0
- package/standalone/revogr-overlay-selection.js.map +1 -0
- package/standalone/revogr-overlay-selection2.js +1068 -0
- package/standalone/revogr-overlay-selection2.js.map +1 -0
- package/standalone/revogr-row-headers.d.ts +11 -0
- package/standalone/revogr-row-headers.js +12 -0
- package/standalone/revogr-row-headers.js.map +1 -0
- package/standalone/revogr-row-headers2.js +625 -0
- package/standalone/revogr-row-headers2.js.map +1 -0
- package/standalone/revogr-scroll-virtual.d.ts +11 -0
- package/standalone/revogr-scroll-virtual.js +12 -0
- package/standalone/revogr-scroll-virtual.js.map +1 -0
- package/standalone/revogr-scroll-virtual2.js +235 -0
- package/standalone/revogr-scroll-virtual2.js.map +1 -0
- package/standalone/revogr-temp-range.d.ts +11 -0
- package/standalone/revogr-temp-range.js +12 -0
- package/standalone/revogr-temp-range.js.map +1 -0
- package/standalone/revogr-temp-range2.js +93 -0
- package/standalone/revogr-temp-range2.js.map +1 -0
- package/standalone/revogr-viewport-scroll.d.ts +11 -0
- package/standalone/revogr-viewport-scroll.js +12 -0
- package/standalone/revogr-viewport-scroll.js.map +1 -0
- package/standalone/revogr-viewport-scroll2.js +761 -0
- package/standalone/revogr-viewport-scroll2.js.map +1 -0
- package/standalone/row-renderer.js +41 -0
- package/standalone/row-renderer.js.map +1 -0
- package/standalone/selection.utils.js +179 -0
- package/standalone/selection.utils.js.map +1 -0
- package/standalone/throttle.js +75 -0
- package/standalone/throttle.js.map +1 -0
- package/standalone/toNumber.js +282 -0
- package/standalone/toNumber.js.map +1 -0
- package/standalone/vnode-converter.js +46 -0
- package/standalone/vnode-converter.js.map +1 -0
- package/standalone/vnode-html.d.ts +11 -0
- package/standalone/vnode-html.js +12 -0
- package/standalone/vnode-html.js.map +1 -0
|
@@ -0,0 +1,3213 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist OU ❤️
|
|
3
|
+
*/
|
|
4
|
+
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-Dyptvvxf.js';
|
|
5
|
+
import { a as columnTypes, Q as reduce, J as getColumnType, r as rowTypes, i as isRowType, K as getColumnSizes, b as cropCellToMax, n as nextCell, O as getColumnByProp, M as getColumns } from './header-cell-renderer-BVHTuFGE.js';
|
|
6
|
+
import { D as DataStore, b as getSourceItem, f as getSourceItemVirtualIndexByProp, d as setSourceByPhysicalIndex, s as setSourceByVirtualIndex, a as getVisibleSourceItem, h as gatherTrimmedItems, k as getItemByIndex, R as RESIZE_INTERVAL, u as timeout } from './dimension.helpers-DDil7Dg0.js';
|
|
7
|
+
import { d as debounce } from './debounce-BfO9dz9v.js';
|
|
8
|
+
import { g as getUpdatedItemsByPosition, V as ViewportStore } from './viewport.store-C-GnV31k.js';
|
|
9
|
+
import { D as DimensionStore, S as SelectionStore, B as BasePlugin, T as TreeDataPlugin, G as GroupingRowPlugin, a as StretchColumn, i as isStretchPlugin, e as FilterPlugin, E as ExportFilePlugin, n as SortingPlugin, l as ColumnMovePlugin, t as ColumnManagePlugin, A as AutoSizeColumnPlugin } from './tree-data.plugin-C2eXkf9_.js';
|
|
10
|
+
import { v as viewportDataPartition, F as FOOTER_SLOT, C as CONTENT_SLOT, H as HEADER_SLOT, D as DATA_SLOT } from './viewport.helpers-VXhsJZtn.js';
|
|
11
|
+
import { g as getPropertyFromEvent } from './events-BvSmBueA.js';
|
|
12
|
+
import './filter.button-DmOE7VCJ.js';
|
|
13
|
+
|
|
14
|
+
class ThemeCompact {
|
|
15
|
+
constructor() {
|
|
16
|
+
this.defaultRowSize = 32;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
class ThemeDefault {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.defaultRowSize = 27;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
class ThemeMaterial {
|
|
27
|
+
constructor() {
|
|
28
|
+
this.defaultRowSize = 42;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const DEFAULT_THEME = 'default';
|
|
33
|
+
const allowedThemes = [
|
|
34
|
+
DEFAULT_THEME,
|
|
35
|
+
'material',
|
|
36
|
+
'compact',
|
|
37
|
+
'darkMaterial',
|
|
38
|
+
'darkCompact',
|
|
39
|
+
];
|
|
40
|
+
class ThemeService {
|
|
41
|
+
get theme() {
|
|
42
|
+
return this.currentTheme;
|
|
43
|
+
}
|
|
44
|
+
get rowSize() {
|
|
45
|
+
return this.customRowSize || this.currentTheme.defaultRowSize;
|
|
46
|
+
}
|
|
47
|
+
set rowSize(size) {
|
|
48
|
+
this.customRowSize = size;
|
|
49
|
+
}
|
|
50
|
+
constructor(cfg) {
|
|
51
|
+
this.customRowSize = 0;
|
|
52
|
+
this.customRowSize = cfg.rowSize;
|
|
53
|
+
this.register('default');
|
|
54
|
+
}
|
|
55
|
+
register(theme) {
|
|
56
|
+
const parsedTheme = getTheme(theme);
|
|
57
|
+
switch (parsedTheme) {
|
|
58
|
+
case 'material':
|
|
59
|
+
case 'darkMaterial':
|
|
60
|
+
this.currentTheme = new ThemeMaterial();
|
|
61
|
+
break;
|
|
62
|
+
case 'compact':
|
|
63
|
+
case 'darkCompact':
|
|
64
|
+
this.currentTheme = new ThemeCompact();
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
this.currentTheme = new ThemeDefault();
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function getTheme(theme) {
|
|
73
|
+
if (theme && allowedThemes.indexOf(theme) > -1) {
|
|
74
|
+
return theme;
|
|
75
|
+
}
|
|
76
|
+
return DEFAULT_THEME;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
class ColumnDataProvider {
|
|
80
|
+
get stores() {
|
|
81
|
+
return this.dataSources;
|
|
82
|
+
}
|
|
83
|
+
constructor() {
|
|
84
|
+
this.collection = null;
|
|
85
|
+
this.dataSources = columnTypes.reduce((sources, k) => {
|
|
86
|
+
sources[k] = new DataStore(k);
|
|
87
|
+
return sources;
|
|
88
|
+
}, {});
|
|
89
|
+
}
|
|
90
|
+
column(c, type = 'rgCol') {
|
|
91
|
+
return this.getColumn(c, type);
|
|
92
|
+
}
|
|
93
|
+
getColumn(virtualIndex, type) {
|
|
94
|
+
return getSourceItem(this.dataSources[type].store, virtualIndex);
|
|
95
|
+
}
|
|
96
|
+
getRawColumns() {
|
|
97
|
+
return reduce(this.dataSources, (result, item, type) => {
|
|
98
|
+
result[type] = item.store.get('source');
|
|
99
|
+
return result;
|
|
100
|
+
}, {
|
|
101
|
+
rgCol: [],
|
|
102
|
+
colPinStart: [],
|
|
103
|
+
colPinEnd: [],
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
getColumns(type = 'all') {
|
|
107
|
+
const columnsByType = this.getRawColumns();
|
|
108
|
+
if (type !== 'all') {
|
|
109
|
+
return columnsByType[type];
|
|
110
|
+
}
|
|
111
|
+
return columnTypes.reduce((r, t) => [...r, ...columnsByType[t]], []);
|
|
112
|
+
}
|
|
113
|
+
getColumnIndexByProp(prop, type) {
|
|
114
|
+
return getSourceItemVirtualIndexByProp(this.dataSources[type].store, prop);
|
|
115
|
+
}
|
|
116
|
+
getColumnByProp(prop) {
|
|
117
|
+
var _a;
|
|
118
|
+
return (_a = this.collection) === null || _a === void 0 ? void 0 : _a.columnByProp[prop];
|
|
119
|
+
}
|
|
120
|
+
refreshByType(type) {
|
|
121
|
+
this.dataSources[type].refresh();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Main method to set columns
|
|
125
|
+
*/
|
|
126
|
+
setColumns(data, version) {
|
|
127
|
+
columnTypes.forEach(k => {
|
|
128
|
+
// set columns data
|
|
129
|
+
this.dataSources[k].updateData(data.columns[k], {
|
|
130
|
+
// max depth level
|
|
131
|
+
depth: data.maxLevel,
|
|
132
|
+
// groups
|
|
133
|
+
groups: data.columnGrouping[k].reduce((res, g) => {
|
|
134
|
+
if (!res[g.level]) {
|
|
135
|
+
res[g.level] = [];
|
|
136
|
+
}
|
|
137
|
+
res[g.level].push(g);
|
|
138
|
+
return res;
|
|
139
|
+
}, {}),
|
|
140
|
+
}, false, { preserveItems: true });
|
|
141
|
+
if (version !== undefined) {
|
|
142
|
+
this.dataSources[k].setData({ version });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
this.collection = data;
|
|
146
|
+
return data;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Used in plugins
|
|
150
|
+
* Modify columns in store
|
|
151
|
+
*/
|
|
152
|
+
updateColumns(updatedColumns) {
|
|
153
|
+
// collect column by type and propert
|
|
154
|
+
const columnByKey = updatedColumns.reduce((res, c) => {
|
|
155
|
+
const type = getColumnType(c);
|
|
156
|
+
if (!res[type]) {
|
|
157
|
+
res[type] = {};
|
|
158
|
+
}
|
|
159
|
+
res[type][c.prop] = c;
|
|
160
|
+
return res;
|
|
161
|
+
}, {});
|
|
162
|
+
// find indexes in source
|
|
163
|
+
const colByIndex = {};
|
|
164
|
+
for (const t in columnByKey) {
|
|
165
|
+
if (!columnByKey.hasOwnProperty(t)) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
const type = t;
|
|
169
|
+
const colsToUpdate = columnByKey[type];
|
|
170
|
+
const sourceItems = this.dataSources[type].store.get('source');
|
|
171
|
+
colByIndex[type] = {};
|
|
172
|
+
for (let i = 0; i < sourceItems.length; i++) {
|
|
173
|
+
const column = sourceItems[i];
|
|
174
|
+
const colToUpdateIfExists = colsToUpdate === null || colsToUpdate === void 0 ? void 0 : colsToUpdate[column.prop];
|
|
175
|
+
// update column if exists in source
|
|
176
|
+
if (colToUpdateIfExists) {
|
|
177
|
+
colByIndex[type][i] = colToUpdateIfExists;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
for (const t in colByIndex) {
|
|
182
|
+
if (!colByIndex.hasOwnProperty(t)) {
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const type = t;
|
|
186
|
+
setSourceByPhysicalIndex(this.dataSources[type].store, colByIndex[type] || {});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
updateColumn(column, index) {
|
|
190
|
+
const type = getColumnType(column);
|
|
191
|
+
setSourceByVirtualIndex(this.dataSources[type].store, { [index]: column });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Data source provider
|
|
197
|
+
*
|
|
198
|
+
* @dependsOn DimensionProvider
|
|
199
|
+
*/
|
|
200
|
+
class DataProvider {
|
|
201
|
+
constructor(dimensionProvider) {
|
|
202
|
+
this.dimensionProvider = dimensionProvider;
|
|
203
|
+
this.stores = reduce(rowTypes, (sources, k) => {
|
|
204
|
+
sources[k] = new DataStore(k);
|
|
205
|
+
return sources;
|
|
206
|
+
}, {});
|
|
207
|
+
}
|
|
208
|
+
setData(data, type = 'rgRow', disableVirtualRows = false, grouping, silent = false) {
|
|
209
|
+
// set rgRow data
|
|
210
|
+
this.stores[type].updateData([...data], grouping, silent);
|
|
211
|
+
// for pinned row no need virtual data
|
|
212
|
+
const noVirtual = type !== 'rgRow' || disableVirtualRows;
|
|
213
|
+
this.dimensionProvider.setData(data.length, type, noVirtual);
|
|
214
|
+
return data;
|
|
215
|
+
}
|
|
216
|
+
getModel(virtualIndex, type = 'rgRow') {
|
|
217
|
+
const store = this.stores[type].store;
|
|
218
|
+
return getSourceItem(store, virtualIndex);
|
|
219
|
+
}
|
|
220
|
+
changeOrder({ rowType = 'rgRow', from, to }) {
|
|
221
|
+
const storeService = this.stores[rowType];
|
|
222
|
+
// take currently visible row indexes
|
|
223
|
+
const newItemsOrder = [...storeService.store.get('proxyItems')];
|
|
224
|
+
const prevItems = storeService.store.get('items');
|
|
225
|
+
// take out
|
|
226
|
+
const toMove = newItemsOrder.splice(newItemsOrder.indexOf(prevItems[from]), // get index in proxy
|
|
227
|
+
1);
|
|
228
|
+
// insert before
|
|
229
|
+
newItemsOrder.splice(newItemsOrder.indexOf(prevItems[to]), // get index in proxy
|
|
230
|
+
0, ...toMove);
|
|
231
|
+
storeService.setData({
|
|
232
|
+
proxyItems: newItemsOrder,
|
|
233
|
+
});
|
|
234
|
+
// take currently visible row indexes
|
|
235
|
+
const newItems = storeService.store.get('items');
|
|
236
|
+
this.dimensionProvider.updateSizesPositionByNewDataIndexes(rowType, newItems, prevItems);
|
|
237
|
+
}
|
|
238
|
+
setCellData({ type, rowIndex, prop, val }, mutate = true) {
|
|
239
|
+
const model = this.getModel(rowIndex, type);
|
|
240
|
+
model[prop] = val;
|
|
241
|
+
this.stores[type].setSourceData({ [rowIndex]: model }, mutate);
|
|
242
|
+
}
|
|
243
|
+
setRangeData(data, type) {
|
|
244
|
+
const items = {};
|
|
245
|
+
for (let rowIndex in data) {
|
|
246
|
+
const oldModel = (items[rowIndex] = getSourceItem(this.stores[type].store, parseInt(rowIndex, 10)));
|
|
247
|
+
if (!oldModel) {
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
for (let prop in data[rowIndex]) {
|
|
251
|
+
oldModel[prop] = data[rowIndex][prop];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
this.stores[type].setSourceData(items);
|
|
255
|
+
}
|
|
256
|
+
refresh(type = 'all') {
|
|
257
|
+
if (isRowType(type)) {
|
|
258
|
+
this.refreshItems(type);
|
|
259
|
+
}
|
|
260
|
+
rowTypes.forEach((t) => this.refreshItems(t));
|
|
261
|
+
}
|
|
262
|
+
refreshItems(type = 'rgRow') {
|
|
263
|
+
const items = this.stores[type].store.get('items');
|
|
264
|
+
this.stores[type].setData({ items: [...items] });
|
|
265
|
+
}
|
|
266
|
+
setGrouping({ depth }, type = 'rgRow') {
|
|
267
|
+
this.stores[type].setData({ groupingDepth: depth });
|
|
268
|
+
}
|
|
269
|
+
setTrimmed(trimmed, type = 'rgRow') {
|
|
270
|
+
const store = this.stores[type];
|
|
271
|
+
store.addTrimmed(trimmed);
|
|
272
|
+
this.dimensionProvider.setTrimmed(trimmed, type);
|
|
273
|
+
if (type === 'rgRow') {
|
|
274
|
+
this.dimensionProvider.setData(getVisibleSourceItem(store.store).length, type);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Dimension provider
|
|
281
|
+
* Stores dimension information and custom sizes
|
|
282
|
+
*
|
|
283
|
+
* @dependsOn ViewportProvider
|
|
284
|
+
*/
|
|
285
|
+
class DimensionProvider {
|
|
286
|
+
constructor(viewports, config) {
|
|
287
|
+
this.viewports = viewports;
|
|
288
|
+
this.gridTotalWidth = 0;
|
|
289
|
+
const sizeChanged = debounce((k) => config.realSizeChanged(k), RESIZE_INTERVAL);
|
|
290
|
+
this.stores = reduce([...rowTypes, ...columnTypes], (sources, t) => {
|
|
291
|
+
sources[t] = new DimensionStore(t);
|
|
292
|
+
sources[t].store.onChange('realSize', () => sizeChanged(t));
|
|
293
|
+
return sources;
|
|
294
|
+
}, {});
|
|
295
|
+
// 为 rgCol 设置获取其他列类型 realSize 的函数
|
|
296
|
+
this.stores.rgCol.setOtherColumnRealSizesGetter(() => {
|
|
297
|
+
var _a, _b;
|
|
298
|
+
return ({
|
|
299
|
+
colPinStart: ((_a = this.stores.colPinStart) === null || _a === void 0 ? void 0 : _a.store.get('realSize')) || 0,
|
|
300
|
+
colPinEnd: ((_b = this.stores.colPinEnd) === null || _b === void 0 ? void 0 : _b.store.get('realSize')) || 0,
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
// 为 rgCol 设置获取表格总宽度的函数
|
|
304
|
+
this.stores.rgCol.setGridTotalWidthGetter(() => this.gridTotalWidth);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* 设置表格总宽度(由 revo-grid 组件调用)
|
|
308
|
+
*/
|
|
309
|
+
setGridTotalWidth(width) {
|
|
310
|
+
this.gridTotalWidth = width;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Clear old sizes from dimension and viewports
|
|
314
|
+
* @param type - dimension type
|
|
315
|
+
* @param count - count of items
|
|
316
|
+
*/
|
|
317
|
+
clearSize(t, count) {
|
|
318
|
+
this.stores[t].drop();
|
|
319
|
+
// after we done with drop trigger viewport recalculaction
|
|
320
|
+
this.viewports.stores[t].setOriginalSizes(this.stores[t].store.get('originItemSize'));
|
|
321
|
+
this.setItemCount(count, t);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Apply new custom sizes to dimension and view port
|
|
325
|
+
* @param type - dimension type
|
|
326
|
+
* @param sizes - new custom sizes
|
|
327
|
+
* @param keepOld - keep old sizes merge new with old
|
|
328
|
+
*/
|
|
329
|
+
setCustomSizes(type, sizes, keepOld = false) {
|
|
330
|
+
let newSizes = sizes;
|
|
331
|
+
if (keepOld) {
|
|
332
|
+
const oldSizes = this.stores[type].store.get('sizes');
|
|
333
|
+
newSizes = Object.assign(Object.assign({}, oldSizes), sizes);
|
|
334
|
+
}
|
|
335
|
+
this.stores[type].setDimensionSize(newSizes);
|
|
336
|
+
// 对于冻结列(非rgCol/rgRow),需要同步更新virtualSize
|
|
337
|
+
// 因为冻结列不使用虚拟滚动,virtualSize应该等于realSize
|
|
338
|
+
const isVirtualDisabled = (type === 'colPinStart' || type === 'colPinEnd') ||
|
|
339
|
+
(type === 'rowPinStart' || type === 'rowPinEnd');
|
|
340
|
+
if (isVirtualDisabled) {
|
|
341
|
+
const newRealSize = this.stores[type].getCurrentState().realSize;
|
|
342
|
+
this.viewports.stores[type].setViewport({
|
|
343
|
+
virtualSize: newRealSize
|
|
344
|
+
}, { preserveItems: true });
|
|
345
|
+
}
|
|
346
|
+
// 对于 rgCol 和 rgRow 类型,列宽变化时只更新现有项的位置
|
|
347
|
+
// 不重新计算哪些项应该可见,避免触发重新渲染
|
|
348
|
+
const shouldUpdatePositionsOnly = type === 'rgCol' || type === 'rgRow';
|
|
349
|
+
if (shouldUpdatePositionsOnly) {
|
|
350
|
+
// 立即更新现有项的位置信息
|
|
351
|
+
const dimension = this.stores[type].getCurrentState();
|
|
352
|
+
const viewportStore = this.viewports.stores[type];
|
|
353
|
+
this.viewports.stores[type].updateItemPositions(dimension);
|
|
354
|
+
// 列宽变化后,即使当前位置未变,也需要按最新尺寸重算可见项窗口。
|
|
355
|
+
// 否则在“先调整列宽再快速横向滚动”场景下,可能出现 viewport items 过期导致空白。
|
|
356
|
+
this.setViewPortCoordinate({
|
|
357
|
+
type,
|
|
358
|
+
coordinate: viewportStore.lastCoordinate,
|
|
359
|
+
force: true,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
// 对于其他类型,使用原来的逻辑
|
|
364
|
+
this.setViewPortCoordinate({
|
|
365
|
+
type,
|
|
366
|
+
force: true,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
setItemCount(realCount, type) {
|
|
371
|
+
this.viewports.stores[type].setViewport({ realCount });
|
|
372
|
+
this.stores[type].setStore({ count: realCount });
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Apply trimmed items
|
|
376
|
+
* @param trimmed - trimmed items
|
|
377
|
+
* @param type
|
|
378
|
+
*/
|
|
379
|
+
setTrimmed(trimmed, type) {
|
|
380
|
+
const allTrimmed = gatherTrimmedItems(trimmed);
|
|
381
|
+
const dimStoreType = this.stores[type];
|
|
382
|
+
dimStoreType.setStore({ trimmed: allTrimmed });
|
|
383
|
+
this.setViewPortCoordinate({
|
|
384
|
+
type,
|
|
385
|
+
force: true,
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Sets dimension data and viewport coordinate
|
|
390
|
+
* @param itemCount
|
|
391
|
+
* @param type - dimension type
|
|
392
|
+
* @param noVirtual - disable virtual data
|
|
393
|
+
*/
|
|
394
|
+
setData(itemCount, type, noVirtual = false) {
|
|
395
|
+
this.setItemCount(itemCount, type);
|
|
396
|
+
// Virtualization will get disabled
|
|
397
|
+
if (noVirtual) {
|
|
398
|
+
const dimension = this.stores[type].getCurrentState();
|
|
399
|
+
this.viewports.stores[type].setViewport({
|
|
400
|
+
virtualSize: dimension.realSize,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
this.setViewPortCoordinate({
|
|
404
|
+
type,
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Applies new columns to the dimension provider
|
|
409
|
+
* @param columns - new columns data
|
|
410
|
+
* @param disableVirtualX - disable virtual data for X axis
|
|
411
|
+
*/
|
|
412
|
+
applyNewColumns(columns, disableVirtualX, keepOld = false, version) {
|
|
413
|
+
// 第一阶段:先更新所有冻结列的维度数据
|
|
414
|
+
const pinnedTypes = ['colPinStart', 'colPinEnd'];
|
|
415
|
+
for (let type of pinnedTypes) {
|
|
416
|
+
if (!keepOld) {
|
|
417
|
+
this.stores[type].drop();
|
|
418
|
+
}
|
|
419
|
+
const items = columns[type];
|
|
420
|
+
this.stores[type].setStore({ count: items.length });
|
|
421
|
+
const newSizes = getColumnSizes(items);
|
|
422
|
+
this.stores[type].setDimensionSize(newSizes);
|
|
423
|
+
}
|
|
424
|
+
// 第二阶段:更新 rgCol 的维度数据
|
|
425
|
+
const rgColType = 'rgCol';
|
|
426
|
+
if (!keepOld) {
|
|
427
|
+
this.stores[rgColType].drop();
|
|
428
|
+
}
|
|
429
|
+
const rgColItems = columns[rgColType];
|
|
430
|
+
this.stores[rgColType].setStore({ count: rgColItems.length });
|
|
431
|
+
const rgColSizes = getColumnSizes(rgColItems);
|
|
432
|
+
this.stores[rgColType].setDimensionSize(rgColSizes);
|
|
433
|
+
// 第三阶段:更新所有列类型的 viewport
|
|
434
|
+
for (let type of columnTypes) {
|
|
435
|
+
const items = columns[type];
|
|
436
|
+
const noVirtual = type !== 'rgCol' || disableVirtualX;
|
|
437
|
+
const vpUpdate = {
|
|
438
|
+
realCount: items.length,
|
|
439
|
+
};
|
|
440
|
+
if (noVirtual) {
|
|
441
|
+
vpUpdate.virtualSize = this.stores[type].getCurrentState().realSize;
|
|
442
|
+
}
|
|
443
|
+
if (version !== undefined) {
|
|
444
|
+
vpUpdate.version = version;
|
|
445
|
+
}
|
|
446
|
+
const preserveItems = items.length > 0;
|
|
447
|
+
const viewportStore = this.viewports.stores[type];
|
|
448
|
+
const dimensionState = this.stores[type].getCurrentState();
|
|
449
|
+
const fallbackClientSize = viewportStore.store.get('clientSize');
|
|
450
|
+
const virtualSizeRaw = typeof vpUpdate.virtualSize === 'number'
|
|
451
|
+
? vpUpdate.virtualSize
|
|
452
|
+
: viewportStore.store.get('virtualSize');
|
|
453
|
+
let virtualSize = virtualSizeRaw || fallbackClientSize;
|
|
454
|
+
if (!virtualSize && items.length > 0) {
|
|
455
|
+
const originItemSize = dimensionState.originItemSize || 1;
|
|
456
|
+
virtualSize = originItemSize;
|
|
457
|
+
if (!virtualSizeRaw) {
|
|
458
|
+
vpUpdate.virtualSize = virtualSize;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
if (items.length > 0 && virtualSize > 0) {
|
|
462
|
+
const toUpdate = getUpdatedItemsByPosition(viewportStore.lastCoordinate, viewportStore.getItems(), items.length, virtualSize, dimensionState);
|
|
463
|
+
vpUpdate.items = toUpdate.items;
|
|
464
|
+
vpUpdate.start = toUpdate.start;
|
|
465
|
+
vpUpdate.end = toUpdate.end;
|
|
466
|
+
}
|
|
467
|
+
else if (items.length === 0) {
|
|
468
|
+
vpUpdate.items = [];
|
|
469
|
+
vpUpdate.start = 0;
|
|
470
|
+
vpUpdate.end = 0;
|
|
471
|
+
}
|
|
472
|
+
viewportStore.setViewport(vpUpdate, { preserveItems });
|
|
473
|
+
this.setViewPortCoordinate({
|
|
474
|
+
type,
|
|
475
|
+
force: true,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Gets the full size of the grid by summing up the sizes of all dimensions
|
|
481
|
+
* Goes through all dimensions columnTypes (x) and rowTypes (y) and sums up their sizes
|
|
482
|
+
*/
|
|
483
|
+
getFullSize() {
|
|
484
|
+
var _a, _b;
|
|
485
|
+
let x = 0;
|
|
486
|
+
let y = 0;
|
|
487
|
+
for (let type of columnTypes) {
|
|
488
|
+
x += ((_a = this.stores[type]) === null || _a === void 0 ? void 0 : _a.store.get('realSize')) || 0;
|
|
489
|
+
}
|
|
490
|
+
for (let type of rowTypes) {
|
|
491
|
+
y += ((_b = this.stores[type]) === null || _b === void 0 ? void 0 : _b.store.get('realSize')) || 0;
|
|
492
|
+
}
|
|
493
|
+
return { y, x };
|
|
494
|
+
}
|
|
495
|
+
setViewPortCoordinate({ type, coordinate = this.viewports.stores[type].lastCoordinate, force = false, }) {
|
|
496
|
+
const dimension = this.stores[type].getCurrentState();
|
|
497
|
+
this.viewports.stores[type].setViewPortCoordinate(coordinate, dimension, force);
|
|
498
|
+
}
|
|
499
|
+
getViewPortPos(e) {
|
|
500
|
+
const dimension = this.stores[e.dimension].getCurrentState();
|
|
501
|
+
const item = getItemByIndex(dimension, e.coordinate);
|
|
502
|
+
return item.start;
|
|
503
|
+
}
|
|
504
|
+
setSettings(data, dimensionType) {
|
|
505
|
+
let stores = [];
|
|
506
|
+
switch (dimensionType) {
|
|
507
|
+
case 'rgCol':
|
|
508
|
+
stores = columnTypes;
|
|
509
|
+
break;
|
|
510
|
+
case 'rgRow':
|
|
511
|
+
stores = rowTypes;
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
for (let s of stores) {
|
|
515
|
+
this.stores[s].setStore(data);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
updateSizesPositionByNewDataIndexes(type, newItemsOrder, prevItemsOrder = []) {
|
|
519
|
+
// Move custom sizes to new order
|
|
520
|
+
this.stores[type].updateSizesPositionByIndexes(newItemsOrder, prevItemsOrder);
|
|
521
|
+
this.setViewPortCoordinate({
|
|
522
|
+
type,
|
|
523
|
+
force: true,
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
class ViewportProvider {
|
|
529
|
+
constructor() {
|
|
530
|
+
this.stores = reduce([...rowTypes, ...columnTypes], (sources, k) => {
|
|
531
|
+
sources[k] = new ViewportStore(k);
|
|
532
|
+
return sources;
|
|
533
|
+
}, {});
|
|
534
|
+
}
|
|
535
|
+
setViewport(type, data, options) {
|
|
536
|
+
this.stores[type].setViewport(data, options);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/** Collect Column data */
|
|
541
|
+
function gatherColumnData(data) {
|
|
542
|
+
const colDimension = data.dimensions[data.colType].store;
|
|
543
|
+
const realWidth = colDimension.get('realSize');
|
|
544
|
+
const prop = {
|
|
545
|
+
contentWidth: realWidth,
|
|
546
|
+
class: data.colType,
|
|
547
|
+
contentHeight: data.contentHeight,
|
|
548
|
+
key: data.colType,
|
|
549
|
+
colType: data.colType,
|
|
550
|
+
onResizeviewport: data.onResizeviewport,
|
|
551
|
+
// 为所有列类型设置明确的宽度,避免flex布局导致的渲染不同步
|
|
552
|
+
// 冻结列和非冻结列都使用 contentWidth 作为明确宽度
|
|
553
|
+
style: {
|
|
554
|
+
width: `${realWidth}px`,
|
|
555
|
+
flexShrink: data.colType === 'rgCol' ? '1' : '0',
|
|
556
|
+
flexGrow: '0',
|
|
557
|
+
},
|
|
558
|
+
};
|
|
559
|
+
const headerProp = {
|
|
560
|
+
colData: getVisibleSourceItem(data.colStore),
|
|
561
|
+
dimensionCol: colDimension,
|
|
562
|
+
type: data.colType,
|
|
563
|
+
groups: data.colStore.get('groups'),
|
|
564
|
+
groupingDepth: data.colStore.get('groupingDepth'),
|
|
565
|
+
resizeHandler: undefined,
|
|
566
|
+
onHeaderresize: data.onHeaderresize,
|
|
567
|
+
};
|
|
568
|
+
return {
|
|
569
|
+
prop,
|
|
570
|
+
type: data.colType,
|
|
571
|
+
position: data.position,
|
|
572
|
+
headerProp,
|
|
573
|
+
viewportCol: data.viewports[data.colType].store,
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
class ViewportService {
|
|
577
|
+
constructor(config, contentHeight) {
|
|
578
|
+
// ----------- Handle columns ----------- //
|
|
579
|
+
var _a;
|
|
580
|
+
this.config = config;
|
|
581
|
+
// Transform data from stores and apply it to different components
|
|
582
|
+
const columns = [];
|
|
583
|
+
let x = 0; // we increase x only if column present
|
|
584
|
+
columnTypes.forEach(val => {
|
|
585
|
+
const colStore = config.columnProvider.stores[val].store;
|
|
586
|
+
// rgCol 必须始终渲染,即使没有列,否则行数据无法显示
|
|
587
|
+
// 同时保持冻结区域始终存在(宽度为 0),避免 pin/unpin 时 DOM 结构抖动
|
|
588
|
+
const column = {
|
|
589
|
+
colType: val,
|
|
590
|
+
position: { x, y: 1 },
|
|
591
|
+
contentHeight,
|
|
592
|
+
// only central column has dynamic width
|
|
593
|
+
fixWidth: val !== 'rgCol',
|
|
594
|
+
viewports: config.viewportProvider.stores,
|
|
595
|
+
dimensions: config.dimensionProvider.stores,
|
|
596
|
+
rowStores: config.dataProvider.stores,
|
|
597
|
+
colStore,
|
|
598
|
+
onHeaderresize: e => this.onColumnResize(val, e, colStore),
|
|
599
|
+
};
|
|
600
|
+
if (val === 'rgCol') {
|
|
601
|
+
column.onResizeviewport = (e) => {
|
|
602
|
+
var _a, _b, _c, _d, _e, _f;
|
|
603
|
+
const vpState = {
|
|
604
|
+
clientSize: e.detail.size,
|
|
605
|
+
};
|
|
606
|
+
// virtual size will be handled by dimension provider if disabled
|
|
607
|
+
if ((e.detail.dimension === 'rgRow' && !config.disableVirtualY)
|
|
608
|
+
|| (e.detail.dimension === 'rgCol' && !config.disableVirtualX)) {
|
|
609
|
+
vpState.virtualSize = e.detail.size;
|
|
610
|
+
}
|
|
611
|
+
const dimensionStore = (_b = (_a = config.dimensionProvider) === null || _a === void 0 ? void 0 : _a.stores) === null || _b === void 0 ? void 0 : _b[e.detail.dimension];
|
|
612
|
+
const viewportStore = (_d = (_c = config.viewportProvider) === null || _c === void 0 ? void 0 : _c.stores) === null || _d === void 0 ? void 0 : _d[e.detail.dimension];
|
|
613
|
+
if (dimensionStore && viewportStore) {
|
|
614
|
+
const dimensionState = dimensionStore.getCurrentState();
|
|
615
|
+
const realCount = viewportStore.store.get('realCount');
|
|
616
|
+
const virtualSize = typeof vpState.virtualSize === 'number'
|
|
617
|
+
? vpState.virtualSize
|
|
618
|
+
: viewportStore.store.get('virtualSize');
|
|
619
|
+
if (realCount > 0 && virtualSize > 0) {
|
|
620
|
+
const toUpdate = getUpdatedItemsByPosition(viewportStore.lastCoordinate, viewportStore.getItems(), realCount, virtualSize, dimensionState);
|
|
621
|
+
viewportStore.setViewport(Object.assign(Object.assign({}, vpState), toUpdate), { preserveItems: true });
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
(_e = config.viewportProvider) === null || _e === void 0 ? void 0 : _e.setViewport(e.detail.dimension, vpState, { preserveItems: true });
|
|
626
|
+
(_f = config.dimensionProvider) === null || _f === void 0 ? void 0 : _f.setViewPortCoordinate({
|
|
627
|
+
type: e.detail.dimension,
|
|
628
|
+
force: true,
|
|
629
|
+
});
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
const colData = gatherColumnData(column);
|
|
633
|
+
const columnSelectionStore = this.registerCol(colData.position.x, val);
|
|
634
|
+
// render per each column data collections vertically
|
|
635
|
+
const dataPorts = this.dataViewPort(column).reduce((r, rgRow) => {
|
|
636
|
+
// register selection store for Segment
|
|
637
|
+
const segmentSelection = this.registerSegment(rgRow.position, rgRow.lastCell);
|
|
638
|
+
// register selection store for Row
|
|
639
|
+
const rowSelectionStore = this.registerRow(rgRow.position.y, rgRow.type);
|
|
640
|
+
const rowDef = Object.assign(Object.assign({ colType: val }, rgRow), { rowSelectionStore, selectionStore: segmentSelection.store, onSetrange: e => {
|
|
641
|
+
segmentSelection.setRangeArea(e.detail);
|
|
642
|
+
}, onSettemprange: e => segmentSelection.setTempArea(e.detail), onFocuscell: e => {
|
|
643
|
+
// todo: multi focus
|
|
644
|
+
segmentSelection.clearFocus();
|
|
645
|
+
config.selectionStoreConnector.focus(segmentSelection, e.detail);
|
|
646
|
+
} });
|
|
647
|
+
r.push(rowDef);
|
|
648
|
+
return r;
|
|
649
|
+
}, []);
|
|
650
|
+
columns.push(Object.assign(Object.assign({}, colData), { columnSelectionStore,
|
|
651
|
+
dataPorts }));
|
|
652
|
+
x++;
|
|
653
|
+
});
|
|
654
|
+
this.columns = columns;
|
|
655
|
+
// ----------- Handle columns end ----------- //
|
|
656
|
+
(_a = this.config.scrollingService) === null || _a === void 0 ? void 0 : _a.unregister();
|
|
657
|
+
}
|
|
658
|
+
onColumnResize(type, { detail }, store) {
|
|
659
|
+
var _a;
|
|
660
|
+
// apply to dimension provider
|
|
661
|
+
(_a = this.config.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(type, detail, true);
|
|
662
|
+
// set resize event
|
|
663
|
+
const changedItems = {};
|
|
664
|
+
for (const [i, size] of Object.entries(detail || {})) {
|
|
665
|
+
const virtualIndex = parseInt(i, 10);
|
|
666
|
+
const item = getSourceItem(store, virtualIndex);
|
|
667
|
+
if (item) {
|
|
668
|
+
changedItems[virtualIndex] = Object.assign(Object.assign({}, item), { size });
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
this.config.resize(changedItems);
|
|
672
|
+
}
|
|
673
|
+
/** register selection store for Segment */
|
|
674
|
+
registerSegment(position, lastCell) {
|
|
675
|
+
const store = this.config.selectionStoreConnector.register(position);
|
|
676
|
+
store.setLastCell(lastCell);
|
|
677
|
+
return store;
|
|
678
|
+
}
|
|
679
|
+
/** register selection store for Row */
|
|
680
|
+
registerRow(y, type) {
|
|
681
|
+
return this.config.selectionStoreConnector.registerRow(y, type).store;
|
|
682
|
+
}
|
|
683
|
+
/** register selection store for Column */
|
|
684
|
+
registerCol(x, type) {
|
|
685
|
+
return this.config.selectionStoreConnector.registerColumn(x, type).store;
|
|
686
|
+
}
|
|
687
|
+
/** Collect Row data */
|
|
688
|
+
dataViewPort(data) {
|
|
689
|
+
const slots = {
|
|
690
|
+
rowPinStart: HEADER_SLOT,
|
|
691
|
+
rgRow: CONTENT_SLOT,
|
|
692
|
+
rowPinEnd: FOOTER_SLOT,
|
|
693
|
+
};
|
|
694
|
+
// y position for selection
|
|
695
|
+
let y = 0;
|
|
696
|
+
return rowTypes.reduce((result, type) => {
|
|
697
|
+
const rgCol = Object.assign(Object.assign({}, data), { position: Object.assign(Object.assign({}, data.position), { y }) });
|
|
698
|
+
const partition = viewportDataPartition(rgCol, type, slots[type], type !== 'rgRow');
|
|
699
|
+
result.push(partition);
|
|
700
|
+
y++;
|
|
701
|
+
return result;
|
|
702
|
+
}, []);
|
|
703
|
+
}
|
|
704
|
+
scrollToCell(cell) {
|
|
705
|
+
for (let key in cell) {
|
|
706
|
+
const coordinate = cell[key];
|
|
707
|
+
if (typeof coordinate === 'number') {
|
|
708
|
+
this.config.scrollingService.proxyScroll({
|
|
709
|
+
dimension: key === 'x' ? 'rgCol' : 'rgRow',
|
|
710
|
+
coordinate,
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* Clear current grid focus
|
|
717
|
+
*/
|
|
718
|
+
clearFocused() {
|
|
719
|
+
this.config.selectionStoreConnector.clearAll();
|
|
720
|
+
}
|
|
721
|
+
clearEdit() {
|
|
722
|
+
this.config.selectionStoreConnector.setEdit(false);
|
|
723
|
+
}
|
|
724
|
+
/**
|
|
725
|
+
* Collect focused element data
|
|
726
|
+
*/
|
|
727
|
+
getFocused() {
|
|
728
|
+
const focused = this.config.selectionStoreConnector.focusedStore;
|
|
729
|
+
if (!focused) {
|
|
730
|
+
return null;
|
|
731
|
+
}
|
|
732
|
+
// get column data
|
|
733
|
+
const colType = this.config.selectionStoreConnector.storesXToType[focused.position.x];
|
|
734
|
+
const column = this.config.columnProvider.getColumn(focused.cell.x, colType);
|
|
735
|
+
// get row data
|
|
736
|
+
const rowType = this.config.selectionStoreConnector.storesYToType[focused.position.y];
|
|
737
|
+
const model = this.config.dataProvider.getModel(focused.cell.y, rowType);
|
|
738
|
+
return {
|
|
739
|
+
column,
|
|
740
|
+
model,
|
|
741
|
+
cell: focused.cell,
|
|
742
|
+
colType,
|
|
743
|
+
rowType,
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
getStoreCoordinateByType(colType, rowType) {
|
|
747
|
+
const stores = this.config.selectionStoreConnector.storesByType;
|
|
748
|
+
if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {
|
|
749
|
+
return;
|
|
750
|
+
}
|
|
751
|
+
return {
|
|
752
|
+
x: stores[colType],
|
|
753
|
+
y: stores[rowType],
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
setFocus(colType, rowType, start, end) {
|
|
757
|
+
var _a;
|
|
758
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
759
|
+
if (coordinate) {
|
|
760
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.focusByCell(coordinate, start, end);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
getSelectedRange() {
|
|
764
|
+
const focused = this.config.selectionStoreConnector.focusedStore;
|
|
765
|
+
if (!focused) {
|
|
766
|
+
return null;
|
|
767
|
+
}
|
|
768
|
+
// get column data
|
|
769
|
+
const colType = this.config.selectionStoreConnector.storesXToType[focused.position.x];
|
|
770
|
+
// get row data
|
|
771
|
+
const rowType = this.config.selectionStoreConnector.storesYToType[focused.position.y];
|
|
772
|
+
const range = focused.entity.store.get('range');
|
|
773
|
+
if (!range) {
|
|
774
|
+
return null;
|
|
775
|
+
}
|
|
776
|
+
return Object.assign(Object.assign({}, range), { colType,
|
|
777
|
+
rowType });
|
|
778
|
+
}
|
|
779
|
+
setEdit(rowIndex, colIndex, colType, rowType) {
|
|
780
|
+
var _a;
|
|
781
|
+
const coordinate = this.getStoreCoordinateByType(colType, rowType);
|
|
782
|
+
if (coordinate) {
|
|
783
|
+
(_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEditByCell(coordinate, { x: colIndex, y: rowIndex });
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
class GridScrollingService {
|
|
789
|
+
constructor(setViewport, isScrollDisabled) {
|
|
790
|
+
this.setViewport = setViewport;
|
|
791
|
+
this.isScrollDisabled = isScrollDisabled;
|
|
792
|
+
this.elements = {};
|
|
793
|
+
this.requestIds = {
|
|
794
|
+
rgCol: 0,
|
|
795
|
+
rgRow: 0,
|
|
796
|
+
};
|
|
797
|
+
this.lastCoordinates = {};
|
|
798
|
+
}
|
|
799
|
+
async proxyScroll(e, key) {
|
|
800
|
+
var _a, _b;
|
|
801
|
+
// Check if scroll is disabled
|
|
802
|
+
if ((_a = this.isScrollDisabled) === null || _a === void 0 ? void 0 : _a.call(this)) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
const shouldGuardHorizontalRace = e.dimension === 'rgCol';
|
|
806
|
+
const requestId = shouldGuardHorizontalRace
|
|
807
|
+
? ++this.requestIds[e.dimension]
|
|
808
|
+
: this.requestIds[e.dimension];
|
|
809
|
+
let newEventPromise;
|
|
810
|
+
let event = e;
|
|
811
|
+
for (let elKey in this.elements) {
|
|
812
|
+
// 仅在横向滚动时跳过 source 视口,避免快速滚动重复回写;
|
|
813
|
+
// 纵向链路保留 source 回写以保证多视口同步稳定(防止错位/空白)。
|
|
814
|
+
if (shouldGuardHorizontalRace && key && elKey === key) {
|
|
815
|
+
continue;
|
|
816
|
+
}
|
|
817
|
+
// 如果已有更新的同维度滚动请求,丢弃当前旧请求
|
|
818
|
+
if (shouldGuardHorizontalRace && requestId !== this.requestIds[e.dimension]) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
// skip
|
|
822
|
+
if (e.dimension === 'rgCol' && elKey === 'headerRow') {
|
|
823
|
+
continue;
|
|
824
|
+
// pinned column only
|
|
825
|
+
}
|
|
826
|
+
else if (this.isPinnedColumn(key) && e.dimension === 'rgCol') {
|
|
827
|
+
if (elKey === key || !e.delta) {
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
for (let el of this.elements[elKey]) {
|
|
831
|
+
if (el.changeScroll) {
|
|
832
|
+
newEventPromise = el.changeScroll(e);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
else {
|
|
837
|
+
for (let el of this.elements[elKey]) {
|
|
838
|
+
await ((_b = el.setScroll) === null || _b === void 0 ? void 0 : _b.call(el, e));
|
|
839
|
+
// await 后再次校验,避免旧请求在异步边界后继续执行
|
|
840
|
+
if (shouldGuardHorizontalRace && requestId !== this.requestIds[e.dimension]) {
|
|
841
|
+
return;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
const newEvent = await newEventPromise;
|
|
847
|
+
if (shouldGuardHorizontalRace && requestId !== this.requestIds[e.dimension]) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
if (newEvent) {
|
|
851
|
+
event = newEvent;
|
|
852
|
+
}
|
|
853
|
+
this.lastCoordinates[event.dimension] = event.coordinate;
|
|
854
|
+
this.setViewport(event);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Silent scroll update for mobile devices when we have negative scroll top
|
|
858
|
+
*/
|
|
859
|
+
async scrollSilentService(e, key) {
|
|
860
|
+
var _a;
|
|
861
|
+
for (let elKey in this.elements) {
|
|
862
|
+
// skip same element update
|
|
863
|
+
if (elKey === key) {
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
if (columnTypes.includes(key) &&
|
|
867
|
+
(elKey === 'headerRow' ||
|
|
868
|
+
columnTypes.includes(elKey))) {
|
|
869
|
+
for (let el of this.elements[elKey]) {
|
|
870
|
+
await ((_a = el.changeScroll) === null || _a === void 0 ? void 0 : _a.call(el, e, true));
|
|
871
|
+
}
|
|
872
|
+
continue;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
isPinnedColumn(key) {
|
|
877
|
+
return !!key && ['colPinStart', 'colPinEnd'].indexOf(key) > -1;
|
|
878
|
+
}
|
|
879
|
+
registerElements(els) {
|
|
880
|
+
this.elements = els;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Register new element for farther scroll support
|
|
884
|
+
* @param el - can be null if holder removed
|
|
885
|
+
* @param key - element key
|
|
886
|
+
*/
|
|
887
|
+
registerElement(el, key) {
|
|
888
|
+
if (!this.elements[key]) {
|
|
889
|
+
this.elements[key] = [];
|
|
890
|
+
}
|
|
891
|
+
// new element added
|
|
892
|
+
if (el) {
|
|
893
|
+
const exists = this.elements[key].includes(el);
|
|
894
|
+
if (!exists) {
|
|
895
|
+
this.elements[key].push(el);
|
|
896
|
+
}
|
|
897
|
+
this.replayLastCoordinates(el);
|
|
898
|
+
}
|
|
899
|
+
else if (this.elements[key]) {
|
|
900
|
+
// element removed
|
|
901
|
+
delete this.elements[key];
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
replayLastCoordinates(el) {
|
|
905
|
+
var _a;
|
|
906
|
+
const dimensions = ['rgRow', 'rgCol'];
|
|
907
|
+
for (const dimension of dimensions) {
|
|
908
|
+
const coordinate = this.lastCoordinates[dimension];
|
|
909
|
+
if (typeof coordinate === 'number') {
|
|
910
|
+
void ((_a = el.setScroll) === null || _a === void 0 ? void 0 : _a.call(el, {
|
|
911
|
+
dimension,
|
|
912
|
+
coordinate,
|
|
913
|
+
outside: true,
|
|
914
|
+
}));
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
unregister() {
|
|
919
|
+
this.elements = {};
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
class SelectionStoreConnector {
|
|
924
|
+
constructor() {
|
|
925
|
+
this.stores = {};
|
|
926
|
+
this.columnStores = {};
|
|
927
|
+
this.rowStores = {};
|
|
928
|
+
/**
|
|
929
|
+
* Helpers for data conversion
|
|
930
|
+
*/
|
|
931
|
+
this.storesByType = {};
|
|
932
|
+
this.storesXToType = {};
|
|
933
|
+
this.storesYToType = {};
|
|
934
|
+
}
|
|
935
|
+
get focusedStore() {
|
|
936
|
+
var _a;
|
|
937
|
+
for (let y in this.stores) {
|
|
938
|
+
for (let x in this.stores[y]) {
|
|
939
|
+
const focused = (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.store.get('focus');
|
|
940
|
+
if (focused) {
|
|
941
|
+
return {
|
|
942
|
+
entity: this.stores[y][x],
|
|
943
|
+
cell: focused,
|
|
944
|
+
position: {
|
|
945
|
+
x: parseInt(x, 10),
|
|
946
|
+
y: parseInt(y, 10),
|
|
947
|
+
},
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return null;
|
|
953
|
+
}
|
|
954
|
+
get edit() {
|
|
955
|
+
var _a;
|
|
956
|
+
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('edit');
|
|
957
|
+
}
|
|
958
|
+
get focused() {
|
|
959
|
+
var _a;
|
|
960
|
+
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('focus');
|
|
961
|
+
}
|
|
962
|
+
get selectedRange() {
|
|
963
|
+
var _a;
|
|
964
|
+
return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('range');
|
|
965
|
+
}
|
|
966
|
+
registerColumn(x, type) {
|
|
967
|
+
if (this.columnStores[x]) {
|
|
968
|
+
return this.columnStores[x];
|
|
969
|
+
}
|
|
970
|
+
this.columnStores[x] = new SelectionStore();
|
|
971
|
+
// build cross-linking type to position
|
|
972
|
+
this.storesByType[type] = x;
|
|
973
|
+
this.storesXToType[x] = type;
|
|
974
|
+
return this.columnStores[x];
|
|
975
|
+
}
|
|
976
|
+
registerRow(y, type) {
|
|
977
|
+
if (this.rowStores[y]) {
|
|
978
|
+
return this.rowStores[y];
|
|
979
|
+
}
|
|
980
|
+
this.rowStores[y] = new SelectionStore();
|
|
981
|
+
// build cross linking type to position
|
|
982
|
+
this.storesByType[type] = y;
|
|
983
|
+
this.storesYToType[y] = type;
|
|
984
|
+
return this.rowStores[y];
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Cross store proxy, based on multiple dimensions
|
|
988
|
+
*/
|
|
989
|
+
register({ x, y }) {
|
|
990
|
+
if (!this.stores[y]) {
|
|
991
|
+
this.stores[y] = {};
|
|
992
|
+
}
|
|
993
|
+
let store = this.stores[y][x];
|
|
994
|
+
if (store) {
|
|
995
|
+
// Store already registered. Do not register twice
|
|
996
|
+
return store;
|
|
997
|
+
}
|
|
998
|
+
this.stores[y][x] = store = new SelectionStore();
|
|
999
|
+
// proxy update, column store trigger only range area
|
|
1000
|
+
store.onChange('range', c => {
|
|
1001
|
+
this.columnStores[x].setRangeArea(c);
|
|
1002
|
+
this.rowStores[y].setRangeArea(c);
|
|
1003
|
+
});
|
|
1004
|
+
// clean up on remove
|
|
1005
|
+
store.store.on('dispose', () => this.destroy(x, y));
|
|
1006
|
+
return store;
|
|
1007
|
+
}
|
|
1008
|
+
destroy(x, y) {
|
|
1009
|
+
var _a, _b;
|
|
1010
|
+
(_a = this.columnStores[x]) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
1011
|
+
(_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
|
|
1012
|
+
delete this.rowStores[y];
|
|
1013
|
+
delete this.columnStores[x];
|
|
1014
|
+
// clear x cross-link
|
|
1015
|
+
if (this.storesXToType[x]) {
|
|
1016
|
+
const type = this.storesXToType[x];
|
|
1017
|
+
delete this.storesXToType[x];
|
|
1018
|
+
delete this.storesByType[type];
|
|
1019
|
+
}
|
|
1020
|
+
// clear y cross-link
|
|
1021
|
+
if (this.storesYToType[y]) {
|
|
1022
|
+
const type = this.storesYToType[y];
|
|
1023
|
+
delete this.storesYToType[y];
|
|
1024
|
+
delete this.storesByType[type];
|
|
1025
|
+
}
|
|
1026
|
+
if (this.stores[y]) {
|
|
1027
|
+
delete this.stores[y][x];
|
|
1028
|
+
}
|
|
1029
|
+
// clear empty rows
|
|
1030
|
+
if (!Object.keys(this.stores[y] || {}).length) {
|
|
1031
|
+
delete this.stores[y];
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
setEditByCell(storePos, editCell) {
|
|
1035
|
+
this.focusByCell(storePos, editCell, editCell);
|
|
1036
|
+
this.setEdit('');
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Sets the next focus cell before the current one.
|
|
1040
|
+
*
|
|
1041
|
+
* @param focus - The cell to set as the next focus.
|
|
1042
|
+
*/
|
|
1043
|
+
beforeNextFocusCell(focus) {
|
|
1044
|
+
var _a;
|
|
1045
|
+
// If there is no focused store, return early.
|
|
1046
|
+
if (!this.focusedStore) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
// Get the next store based on the current focus and the last cell.
|
|
1050
|
+
const lastCell = this.focusedStore.entity.store.get('lastCell');
|
|
1051
|
+
const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
|
|
1052
|
+
// Set the next focus cell in the store.
|
|
1053
|
+
(_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));
|
|
1054
|
+
}
|
|
1055
|
+
focusByCell(storePos, start, end) {
|
|
1056
|
+
const store = this.stores[storePos.y][storePos.x];
|
|
1057
|
+
this.focus(store, { focus: start, end });
|
|
1058
|
+
}
|
|
1059
|
+
focus(store, { focus, end }) {
|
|
1060
|
+
const currentStorePointer = this.getCurrentStorePointer(store);
|
|
1061
|
+
if (!currentStorePointer) {
|
|
1062
|
+
return null;
|
|
1063
|
+
}
|
|
1064
|
+
// check for the focus in nearby store/viewport
|
|
1065
|
+
const lastCell = store.store.get('lastCell');
|
|
1066
|
+
const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
|
|
1067
|
+
// if next store present - update
|
|
1068
|
+
if (next === null || next === void 0 ? void 0 : next.store) {
|
|
1069
|
+
const item = Object.assign(Object.assign({}, focus), next.item);
|
|
1070
|
+
this.focus(next.store, { focus: item, end: item });
|
|
1071
|
+
return null;
|
|
1072
|
+
}
|
|
1073
|
+
if (lastCell) {
|
|
1074
|
+
focus = cropCellToMax(focus, lastCell);
|
|
1075
|
+
end = cropCellToMax(end, lastCell);
|
|
1076
|
+
}
|
|
1077
|
+
store.setFocus(focus, end);
|
|
1078
|
+
return focus;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Retrieves the current store pointer based on the active store.
|
|
1082
|
+
* Clears focus from all stores except the active one.
|
|
1083
|
+
*/
|
|
1084
|
+
getCurrentStorePointer(store) {
|
|
1085
|
+
let currentStorePointer;
|
|
1086
|
+
// Iterate through all stores
|
|
1087
|
+
for (let y in this.stores) {
|
|
1088
|
+
for (let x in this.stores[y]) {
|
|
1089
|
+
const s = this.stores[y][x];
|
|
1090
|
+
// Clear focus from stores other than the active one
|
|
1091
|
+
if (s !== store) {
|
|
1092
|
+
s.clearFocus();
|
|
1093
|
+
}
|
|
1094
|
+
else {
|
|
1095
|
+
// Update the current store pointer with the active store coordinates
|
|
1096
|
+
currentStorePointer = {
|
|
1097
|
+
x: parseInt(x, 10),
|
|
1098
|
+
y: parseInt(y, 10)
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
return currentStorePointer;
|
|
1104
|
+
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Retrieves the next store based on the focus cell and current store pointer.
|
|
1107
|
+
* If the next store exists, returns an object with the next store and the item in the new store.
|
|
1108
|
+
* If the next store does not exist, returns null.
|
|
1109
|
+
*/
|
|
1110
|
+
getNextStore(focus, currentStorePointer, lastCell) {
|
|
1111
|
+
// item in new store
|
|
1112
|
+
const nextItem = nextCell(focus, lastCell);
|
|
1113
|
+
let nextStore;
|
|
1114
|
+
if (nextItem) {
|
|
1115
|
+
Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
|
|
1116
|
+
let stores;
|
|
1117
|
+
switch (type) {
|
|
1118
|
+
case 'x':
|
|
1119
|
+
// Get the X stores for the current Y coordinate of the current store pointer
|
|
1120
|
+
stores = this.getXStores(currentStorePointer.y);
|
|
1121
|
+
break;
|
|
1122
|
+
case 'y':
|
|
1123
|
+
// Get the Y stores for the current X coordinate of the current store pointer
|
|
1124
|
+
stores = this.getYStores(currentStorePointer.x);
|
|
1125
|
+
break;
|
|
1126
|
+
}
|
|
1127
|
+
// Get the next store based on the item in the new store
|
|
1128
|
+
if (nextItemCoord >= 0) {
|
|
1129
|
+
nextStore = stores[++currentStorePointer[type]];
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
nextStore = stores[--currentStorePointer[type]];
|
|
1133
|
+
const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
|
|
1134
|
+
if (nextLastCell) {
|
|
1135
|
+
nextItem[type] = nextLastCell[type] + nextItemCoord;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
// if last cell is empty store is empty, no next store
|
|
1141
|
+
const lastCellNext = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
|
|
1142
|
+
if (!(lastCellNext === null || lastCellNext === void 0 ? void 0 : lastCellNext.x) || !(lastCellNext === null || lastCellNext === void 0 ? void 0 : lastCellNext.y)) {
|
|
1143
|
+
nextStore = undefined;
|
|
1144
|
+
}
|
|
1145
|
+
return {
|
|
1146
|
+
store: nextStore,
|
|
1147
|
+
item: nextItem,
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
clearAll() {
|
|
1151
|
+
var _a;
|
|
1152
|
+
for (let y in this.stores) {
|
|
1153
|
+
for (let x in this.stores[y]) {
|
|
1154
|
+
(_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.clearFocus();
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
setEdit(val) {
|
|
1159
|
+
if (!this.focusedStore) {
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
this.focusedStore.entity.setEdit(val);
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Select all cells across all stores
|
|
1166
|
+
*/
|
|
1167
|
+
selectAll() {
|
|
1168
|
+
for (let y in this.stores) {
|
|
1169
|
+
for (let x in this.stores[y]) {
|
|
1170
|
+
const store = this.stores[y][x];
|
|
1171
|
+
if (!store) {
|
|
1172
|
+
continue;
|
|
1173
|
+
}
|
|
1174
|
+
const lastCell = store.store.get('lastCell');
|
|
1175
|
+
if (lastCell) {
|
|
1176
|
+
store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
getXStores(y) {
|
|
1182
|
+
return this.stores[y];
|
|
1183
|
+
}
|
|
1184
|
+
getYStores(x) {
|
|
1185
|
+
const stores = {};
|
|
1186
|
+
for (let i in this.stores) {
|
|
1187
|
+
stores[i] = this.stores[i][x];
|
|
1188
|
+
}
|
|
1189
|
+
return stores;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
/**
|
|
1194
|
+
* Draw drag
|
|
1195
|
+
*/
|
|
1196
|
+
class OrdererService {
|
|
1197
|
+
constructor() {
|
|
1198
|
+
this.parentY = 0;
|
|
1199
|
+
}
|
|
1200
|
+
start(parent, { pos, text, event }) {
|
|
1201
|
+
var _a;
|
|
1202
|
+
const { top } = parent.getBoundingClientRect();
|
|
1203
|
+
this.parentY = top;
|
|
1204
|
+
if (this.text) {
|
|
1205
|
+
this.text.innerText = text;
|
|
1206
|
+
}
|
|
1207
|
+
this.move(pos);
|
|
1208
|
+
this.moveTip({ x: event.x, y: event.y });
|
|
1209
|
+
(_a = this.el) === null || _a === void 0 ? void 0 : _a.classList.remove('hidden');
|
|
1210
|
+
}
|
|
1211
|
+
end() {
|
|
1212
|
+
var _a;
|
|
1213
|
+
(_a = this.el) === null || _a === void 0 ? void 0 : _a.classList.add('hidden');
|
|
1214
|
+
}
|
|
1215
|
+
move(pos) {
|
|
1216
|
+
this.moveElement(pos.end - this.parentY);
|
|
1217
|
+
}
|
|
1218
|
+
moveTip({ x, y }) {
|
|
1219
|
+
if (!this.draggable) {
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
this.draggable.style.left = `${x}px`;
|
|
1223
|
+
this.draggable.style.top = `${y}px`;
|
|
1224
|
+
}
|
|
1225
|
+
moveElement(y) {
|
|
1226
|
+
if (!this.rgRow) {
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
this.rgRow.style.transform = `translateY(${y}px)`;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
const OrderRenderer = ({ ref }) => {
|
|
1233
|
+
const service = new OrdererService();
|
|
1234
|
+
ref(service);
|
|
1235
|
+
return (h("div", { class: "draggable-wrapper hidden", ref: e => (service.el = e) },
|
|
1236
|
+
h("div", { class: "draggable", ref: el => (service.draggable = el) },
|
|
1237
|
+
h("span", { class: "revo-alt-icon" }),
|
|
1238
|
+
h("span", { ref: e => (service.text = e) })),
|
|
1239
|
+
h("div", { class: "drag-position", ref: e => (service.rgRow = e) })));
|
|
1240
|
+
};
|
|
1241
|
+
|
|
1242
|
+
const rowDefinitionByType = (newVal = []) => {
|
|
1243
|
+
const result = {};
|
|
1244
|
+
for (const v of newVal) {
|
|
1245
|
+
let rowDefs = result[v.type];
|
|
1246
|
+
if (!rowDefs) {
|
|
1247
|
+
rowDefs = result[v.type] = {};
|
|
1248
|
+
}
|
|
1249
|
+
if (v.size) {
|
|
1250
|
+
if (!rowDefs.sizes) {
|
|
1251
|
+
rowDefs.sizes = {};
|
|
1252
|
+
}
|
|
1253
|
+
rowDefs.sizes[v.index] = v.size;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
return result;
|
|
1257
|
+
};
|
|
1258
|
+
const rowDefinitionRemoveByType = (oldVal = []) => {
|
|
1259
|
+
const result = {};
|
|
1260
|
+
for (const v of oldVal) {
|
|
1261
|
+
let rowDefs = result[v.type];
|
|
1262
|
+
if (!rowDefs) {
|
|
1263
|
+
rowDefs = result[v.type] = [];
|
|
1264
|
+
}
|
|
1265
|
+
if (v.size) {
|
|
1266
|
+
rowDefs.push(v.index);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
return result;
|
|
1270
|
+
};
|
|
1271
|
+
|
|
1272
|
+
function isMobileDevice() {
|
|
1273
|
+
return /Mobi/i.test(navigator.userAgent) || /Android/i.test(navigator.userAgent) || navigator.maxTouchPoints > 0;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
/**
|
|
1277
|
+
* WCAG Plugin is responsible for enhancing the accessibility features of the RevoGrid component.
|
|
1278
|
+
* It ensures that the grid is fully compliant with Web Content Accessibility Guidelines (WCAG) 2.1.
|
|
1279
|
+
* This plugin should be the last plugin you add, as it modifies the grid's default behavior.
|
|
1280
|
+
*
|
|
1281
|
+
* The WCAG Plugin performs the following tasks:
|
|
1282
|
+
* - Sets the 'dir' attribute to 'ltr' for left-to-right text direction.
|
|
1283
|
+
* - Sets the 'role' attribute to 'treegrid' for treelike hierarchical structure.
|
|
1284
|
+
* - Sets the 'aria-keyshortcuts' attribute to 'Enter' and 'Esc' for keyboard shortcuts.
|
|
1285
|
+
* - Adds event listeners for keyboard navigation and editing.
|
|
1286
|
+
*
|
|
1287
|
+
* By default, the plugin adds ARIA roles and properties to the grid elements, providing semantic information
|
|
1288
|
+
* for assistive technologies. These roles include 'grid', 'row', and 'gridcell'. The plugin also sets
|
|
1289
|
+
* ARIA attributes such as 'aria-rowindex', 'aria-colindex', and 'aria-selected'.
|
|
1290
|
+
*
|
|
1291
|
+
* The WCAG Plugin ensures that the grid is fully functional and usable for users with various disabilities,
|
|
1292
|
+
* including visual impairments, deaf-blindness, and cognitive disabilities.
|
|
1293
|
+
*
|
|
1294
|
+
* Note: The WCAG Plugin should be added as the last plugin in the list of plugins, as it modifies the grid's
|
|
1295
|
+
* default behavior and may conflict with other plugins if added earlier.
|
|
1296
|
+
*/
|
|
1297
|
+
class WCAGPlugin extends BasePlugin {
|
|
1298
|
+
constructor(revogrid, providers) {
|
|
1299
|
+
super(revogrid, providers);
|
|
1300
|
+
revogrid.setAttribute('role', 'treegrid');
|
|
1301
|
+
revogrid.setAttribute('aria-keyshortcuts', 'Enter');
|
|
1302
|
+
revogrid.setAttribute('aria-multiselectable', 'true');
|
|
1303
|
+
revogrid.setAttribute('tabindex', '0');
|
|
1304
|
+
/**
|
|
1305
|
+
* Before Columns Set Event
|
|
1306
|
+
*/
|
|
1307
|
+
this.addEventListener('beforecolumnsset', ({ detail }) => {
|
|
1308
|
+
const columns = [
|
|
1309
|
+
...detail.columns.colPinStart,
|
|
1310
|
+
...detail.columns.rgCol,
|
|
1311
|
+
...detail.columns.colPinEnd,
|
|
1312
|
+
];
|
|
1313
|
+
revogrid.setAttribute('aria-colcount', `${columns.length}`);
|
|
1314
|
+
columns.forEach((column, index) => {
|
|
1315
|
+
const { columnProperties, cellProperties } = column;
|
|
1316
|
+
column.columnProperties = (...args) => {
|
|
1317
|
+
const result = (columnProperties === null || columnProperties === void 0 ? void 0 : columnProperties(...args)) || {};
|
|
1318
|
+
result.role = 'columnheader';
|
|
1319
|
+
result['aria-colindex'] = `${index}`;
|
|
1320
|
+
return result;
|
|
1321
|
+
};
|
|
1322
|
+
column.cellProperties = (...args) => {
|
|
1323
|
+
const wcagProps = {
|
|
1324
|
+
['role']: 'gridcell',
|
|
1325
|
+
['aria-colindex']: `${index}`,
|
|
1326
|
+
['aria-rowindex']: `${args[0].rowIndex}`,
|
|
1327
|
+
['tabindex']: -1,
|
|
1328
|
+
};
|
|
1329
|
+
const columnProps = (cellProperties === null || cellProperties === void 0 ? void 0 : cellProperties(...args)) || {};
|
|
1330
|
+
return Object.assign(Object.assign({}, wcagProps), columnProps);
|
|
1331
|
+
};
|
|
1332
|
+
});
|
|
1333
|
+
});
|
|
1334
|
+
/**
|
|
1335
|
+
* Before Row Set Event
|
|
1336
|
+
*/
|
|
1337
|
+
this.addEventListener('beforesourceset', ({ detail, }) => {
|
|
1338
|
+
revogrid.setAttribute('aria-rowcount', `${detail.source.length}`);
|
|
1339
|
+
});
|
|
1340
|
+
this.addEventListener('beforerowrender', ({ detail, }) => {
|
|
1341
|
+
detail.node.$attrs$ = Object.assign(Object.assign({}, detail.node.$attrs$), { role: 'row', ['aria-rowindex']: detail.item.itemIndex });
|
|
1342
|
+
});
|
|
1343
|
+
// focuscell
|
|
1344
|
+
this.addEventListener('afterfocus', async (e) => {
|
|
1345
|
+
if (e.defaultPrevented) {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
const el = this.revogrid.querySelector(`revogr-data[type="${e.detail.rowType}"][col-type="${e.detail.colType}"] [data-rgrow="${e.detail.rowIndex}"][data-rgcol="${e.detail.colIndex}"]`);
|
|
1349
|
+
if (el instanceof HTMLElement) {
|
|
1350
|
+
el.focus();
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Plugin service
|
|
1358
|
+
* Manages plugins
|
|
1359
|
+
*/
|
|
1360
|
+
class PluginService {
|
|
1361
|
+
constructor() {
|
|
1362
|
+
/**
|
|
1363
|
+
* Plugins
|
|
1364
|
+
* Define plugins collection
|
|
1365
|
+
*/
|
|
1366
|
+
this.internalPlugins = [];
|
|
1367
|
+
}
|
|
1368
|
+
/**
|
|
1369
|
+
* Get all plugins
|
|
1370
|
+
*/
|
|
1371
|
+
get() {
|
|
1372
|
+
return [...this.internalPlugins];
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Add plugin to collection
|
|
1376
|
+
*/
|
|
1377
|
+
add(plugin) {
|
|
1378
|
+
this.internalPlugins.push(plugin);
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Add user plugins and create
|
|
1382
|
+
*/
|
|
1383
|
+
addUserPluginsAndCreate(element, plugins = [], prevPlugins, pluginData) {
|
|
1384
|
+
if (!pluginData) {
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
// Step 1: Identify plugins to remove, compare new and old plugins
|
|
1388
|
+
const pluginsToRemove = (prevPlugins === null || prevPlugins === void 0 ? void 0 : prevPlugins.filter(prevPlugin => !plugins.some(userPlugin => userPlugin === prevPlugin))) || [];
|
|
1389
|
+
// Step 2: Remove old plugins
|
|
1390
|
+
pluginsToRemove.forEach(plugin => {
|
|
1391
|
+
var _a, _b;
|
|
1392
|
+
const index = this.internalPlugins.findIndex(createdPlugin => createdPlugin instanceof plugin);
|
|
1393
|
+
if (index !== -1) {
|
|
1394
|
+
(_b = (_a = this.internalPlugins[index]).destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1395
|
+
this.internalPlugins.splice(index, 1); // Remove the plugin
|
|
1396
|
+
}
|
|
1397
|
+
});
|
|
1398
|
+
// Step 3: Register user plugins
|
|
1399
|
+
plugins === null || plugins === void 0 ? void 0 : plugins.forEach(userPlugin => {
|
|
1400
|
+
// check if plugin already exists, if so, skip
|
|
1401
|
+
const existingPlugin = this.internalPlugins.find(createdPlugin => createdPlugin instanceof userPlugin);
|
|
1402
|
+
if (existingPlugin) {
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
this.add(new userPlugin(element, pluginData));
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Get plugin by class
|
|
1410
|
+
*/
|
|
1411
|
+
getByClass(pluginClass) {
|
|
1412
|
+
return this.internalPlugins.find(p => p instanceof pluginClass);
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Remove plugin
|
|
1416
|
+
*/
|
|
1417
|
+
remove(plugin) {
|
|
1418
|
+
var _a, _b;
|
|
1419
|
+
const index = this.internalPlugins.indexOf(plugin);
|
|
1420
|
+
if (index > -1) {
|
|
1421
|
+
(_b = (_a = this.internalPlugins[index]).destroy) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
1422
|
+
this.internalPlugins.splice(index, 1);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
/**
|
|
1426
|
+
* Remove all plugins
|
|
1427
|
+
*/
|
|
1428
|
+
destroy() {
|
|
1429
|
+
this.internalPlugins.forEach(p => { var _a; return (_a = p.destroy) === null || _a === void 0 ? void 0 : _a.call(p); });
|
|
1430
|
+
this.internalPlugins = [];
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* RTL (Right-to-Left) Plugin for RevoGrid
|
|
1436
|
+
*
|
|
1437
|
+
* This plugin handles RTL transformation by subscribing to the beforecolumnsset event
|
|
1438
|
+
* and applying column order reversal when RTL mode is enabled.
|
|
1439
|
+
*/
|
|
1440
|
+
class RTLPlugin extends BasePlugin {
|
|
1441
|
+
constructor(revogrid, providers) {
|
|
1442
|
+
super(revogrid, providers);
|
|
1443
|
+
this.isRTLEnabled = false;
|
|
1444
|
+
this.init();
|
|
1445
|
+
}
|
|
1446
|
+
init() {
|
|
1447
|
+
// Subscribe to beforecolumnsset event to apply RTL transformation
|
|
1448
|
+
this.addEventListener('beforecolumnsset', (event) => {
|
|
1449
|
+
this.handleBeforeColumnsSet(event);
|
|
1450
|
+
});
|
|
1451
|
+
// Listen for RTL property changes
|
|
1452
|
+
this.addEventListener('aftergridinit', () => {
|
|
1453
|
+
this.updateRTLState();
|
|
1454
|
+
});
|
|
1455
|
+
// Watch for RTL property changes
|
|
1456
|
+
this.watch('rtl', (value) => {
|
|
1457
|
+
this.isRTLEnabled = value;
|
|
1458
|
+
this.emit('rtlstatechanged', { rtl: this.isRTLEnabled });
|
|
1459
|
+
}, { immediate: true });
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* Handle the beforecolumnsset event to apply RTL transformation
|
|
1463
|
+
*/
|
|
1464
|
+
handleBeforeColumnsSet(event) {
|
|
1465
|
+
if (!this.isRTLEnabled) {
|
|
1466
|
+
return; // No transformation needed if RTL is disabled
|
|
1467
|
+
}
|
|
1468
|
+
const columnCollection = event.detail;
|
|
1469
|
+
// Apply RTL transformation to all column types
|
|
1470
|
+
const transformedColumns = this.applyRTLTransformationToCollection(columnCollection);
|
|
1471
|
+
// Update the event detail with transformed columns
|
|
1472
|
+
event.detail.columns = transformedColumns.columns;
|
|
1473
|
+
event.detail.columnByProp = transformedColumns.columnByProp;
|
|
1474
|
+
event.detail.columnGrouping = transformedColumns.columnGrouping;
|
|
1475
|
+
}
|
|
1476
|
+
/**
|
|
1477
|
+
* Apply RTL transformation to the entire column collection
|
|
1478
|
+
*/
|
|
1479
|
+
applyRTLTransformationToCollection(collection) {
|
|
1480
|
+
const transformedCollection = {
|
|
1481
|
+
columns: {
|
|
1482
|
+
rgCol: [],
|
|
1483
|
+
colPinStart: [],
|
|
1484
|
+
colPinEnd: [],
|
|
1485
|
+
},
|
|
1486
|
+
columnByProp: Object.assign({}, collection.columnByProp),
|
|
1487
|
+
columnGrouping: {
|
|
1488
|
+
rgCol: [],
|
|
1489
|
+
colPinStart: [],
|
|
1490
|
+
colPinEnd: [],
|
|
1491
|
+
},
|
|
1492
|
+
maxLevel: collection.maxLevel,
|
|
1493
|
+
sort: Object.assign({}, collection.sort),
|
|
1494
|
+
};
|
|
1495
|
+
// Transform each column type
|
|
1496
|
+
Object.keys(collection.columns).forEach((type) => {
|
|
1497
|
+
const columnType = type;
|
|
1498
|
+
const columns = collection.columns[columnType];
|
|
1499
|
+
// Apply RTL transformation to columns - create new reversed array
|
|
1500
|
+
const reversedColumns = [...columns].reverse();
|
|
1501
|
+
transformedCollection.columns[columnType] = reversedColumns;
|
|
1502
|
+
// Transform column grouping for this type
|
|
1503
|
+
transformedCollection.columnGrouping[columnType] = this.applyRTLTransformationToGroups(collection.columnGrouping[columnType], columns.length);
|
|
1504
|
+
});
|
|
1505
|
+
return transformedCollection;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Apply RTL transformation to column groups
|
|
1509
|
+
*/
|
|
1510
|
+
applyRTLTransformationToGroups(groups, totalColumns) {
|
|
1511
|
+
return groups.map(group => {
|
|
1512
|
+
// Reverse the indexes for RTL
|
|
1513
|
+
const reversedIndexes = group.indexes.map((index) => totalColumns - 1 - index).reverse();
|
|
1514
|
+
return Object.assign(Object.assign({}, group), { indexes: reversedIndexes });
|
|
1515
|
+
}).reverse(); // Reverse the group order
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Update RTL state based on the grid's rtl property
|
|
1519
|
+
*/
|
|
1520
|
+
updateRTLState() {
|
|
1521
|
+
const grid = this.revogrid;
|
|
1522
|
+
if (grid && typeof grid.rtl === 'boolean') {
|
|
1523
|
+
this.isRTLEnabled = grid.rtl;
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Get current RTL state
|
|
1528
|
+
*/
|
|
1529
|
+
getRTLState() {
|
|
1530
|
+
return this.isRTLEnabled;
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* Clean up the plugin
|
|
1534
|
+
*/
|
|
1535
|
+
destroy() {
|
|
1536
|
+
super.destroy();
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
const revoGridStyleCss = "@charset \"UTF-8\";revo-grid[theme=default],revo-grid:not([theme]){font-size:12px}revo-grid[theme=default] .rowHeaders revogr-header,revo-grid:not([theme]) .rowHeaders revogr-header{box-shadow:-1px 0 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-header,revo-grid:not([theme]) revogr-header{text-align:center;line-height:30px;background-color:var(--revo-grid-header-bg)}revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{box-shadow:none}revo-grid[theme=default] revogr-header .group-rgRow .rgHeaderCell,revo-grid:not([theme]) revogr-header .group-rgRow .rgHeaderCell{box-shadow:-1px 0 0 0 var(--revo-grid-header-border), -1px 0 0 0 var(--revo-grid-header-border) inset, 0 -1px 0 0 var(--revo-grid-header-border), 0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid[theme=default] revogr-header .group-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .group-rgRow{text-transform:uppercase;font-size:12px;color:var(--revo-grid-header-color)}revo-grid[theme=default] revogr-header .header-rgRow,revo-grid:not([theme]) revogr-header .header-rgRow{height:30px;box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-header .rgHeaderCell,revo-grid:not([theme]) revogr-header .rgHeaderCell{box-shadow:-1px 0 0 0 var(--revo-grid-header-border) inset, 0 -1px 0 0 var(--revo-grid-header-border), 0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] .rowHeaders,revo-grid:not([theme]) .rowHeaders{background-color:var(--revo-grid-header-bg)}revo-grid[theme=default] .rowHeaders revogr-data .rgCell,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell{color:var(--revo-grid-header-color)}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:first-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:first-child{box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:not(:first-child),revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:not(:first-child){box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset, 1px 0 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] .rowHeaders revogr-data .rgCell:last-child,revo-grid:not([theme]) .rowHeaders revogr-data .rgCell:last-child{border-right:1px solid var(--revo-grid-header-border)}revo-grid[theme=default] .rowHeaders revogr-data revogr-header,revo-grid:not([theme]) .rowHeaders revogr-data revogr-header{box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart revogr-data .rgRow .rgCell:last-child{box-shadow:0 -1px 0 0 var(--revo-grid-cell-border) inset, -1px 0 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) revogr-viewport-scroll.colPinStart .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 var(--revo-grid-header-border) inset, -1px 0 0 0 var(--revo-grid-header-border) inset}revo-grid[theme=default] revogr-viewport-scroll.colPinEnd revogr-header,revo-grid:not([theme]) revogr-viewport-scroll.colPinEnd revogr-header{box-shadow:none}revo-grid[theme=default] .footer-wrapper revogr-data .rgRow:first-child .rgCell,revo-grid:not([theme]) .footer-wrapper revogr-data .rgRow:first-child .rgCell{box-shadow:0 1px 0 0 var(--revo-grid-cell-border) inset, -1px 0 0 0 var(--revo-grid-cell-border) inset, 0 -1px 0 0 var(--revo-grid-cell-border) inset}revo-grid[theme=default] revogr-data,revo-grid:not([theme]) revogr-data{text-align:center}revo-grid[theme=default] revogr-data .revo-draggable,revo-grid:not([theme]) revogr-data .revo-draggable{float:left}revo-grid[theme=default] revogr-data .rgRow,revo-grid:not([theme]) revogr-data .rgRow{line-height:27px}revo-grid[theme=default] revogr-data .rgCell,revo-grid:not([theme]) revogr-data .rgCell{box-shadow:0 -1px 0 0 var(--revo-grid-cell-border) inset, -1px 0 0 0 var(--revo-grid-cell-border) inset}revo-grid[theme=default] revogr-grouping-overlay .rgRow,revo-grid:not([theme]) revogr-grouping-overlay .rgRow{line-height:27px}revo-grid[theme=material]{--rg-header-row-height:50px;font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=material] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=material] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=material] revogr-header .header-rgRow{height:50px}revo-grid[theme=material] revogr-data{text-align:left}revo-grid[theme=material] revogr-data .rgRow{line-height:42px}revo-grid[theme=material] revogr-data .rgCell{padding:0 15px}revo-grid[theme=material] revogr-grouping-overlay .rgRow{line-height:42px}revo-grid[theme=darkMaterial]{--rg-header-row-height:50px;font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=darkMaterial] revogr-header{line-height:50px;font-weight:600;text-align:left}revo-grid[theme=darkMaterial] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkMaterial] revogr-header .header-rgRow{height:50px}revo-grid[theme=darkMaterial] revogr-data{text-align:left}revo-grid[theme=darkMaterial] revogr-data .rgRow{line-height:42px}revo-grid[theme=darkMaterial] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkMaterial] revogr-grouping-overlay .rgRow{line-height:42px}revo-grid[theme=darkCompact]{--rg-header-row-height:45px;font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=darkCompact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=darkCompact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=darkCompact] revogr-header .header-rgRow{height:45px}revo-grid[theme=darkCompact] revogr-data{text-align:left}revo-grid[theme=darkCompact] revogr-data .rgRow{line-height:32px}revo-grid[theme=darkCompact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=darkCompact] revogr-grouping-overlay .rgRow{line-height:32px}revo-grid[theme=compact]{--rg-header-row-height:45px;font-family:Nunito, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"}revo-grid[theme=compact] revogr-header{line-height:45px;font-weight:600;text-align:left}revo-grid[theme=compact] revogr-header .rgHeaderCell{padding:0 15px;text-overflow:ellipsis}revo-grid[theme=compact] revogr-header .header-rgRow{height:45px}revo-grid[theme=compact] revogr-data{text-align:left}revo-grid[theme=compact] revogr-data .rgRow{line-height:32px}revo-grid[theme=compact] revogr-data .rgCell{padding:0 15px}revo-grid[theme=compact] revogr-grouping-overlay .rgRow{line-height:32px}revo-grid[theme=compact] revo-dropdown .rv-dr-root{padding:0px 9px}revo-grid[dir=rtl] .viewports{flex-direction:row-reverse}revo-grid[dir=rtl] revogr-header .rgHeaderCell{text-align:right}revo-grid[dir=rtl] revogr-data .rgCell{text-align:right}revo-grid[dir=rtl] .rowHeaders revogr-data .rgCell{text-align:right}revo-grid[dir=rtl] revogr-filter-panel{direction:rtl}revo-grid[dir=rtl] revo-dropdown .rv-dr-root{text-align:right}revo-grid[dir=rtl] .drag-position{right:0;left:auto}revo-grid[dir=rtl] .drag-auto-scroll-y{right:0;left:auto}revo-grid[dir=rtl] .clipboard{right:0;left:auto}revo-grid[dir=rtl] .draggable{margin-left:-20px;margin-right:0;padding-right:20px;padding-left:5px}revo-grid[dir=rtl] .draggable .revo-alt-icon{right:5px;left:auto}revo-grid[dir=rtl] .focused-cell{border-right:2px solid var(--revo-grid-primary);border-left:none}revo-grid[dir=rtl] .selection-range{border-right:2px solid var(--revo-grid-primary);border-left:none}revo-grid[dir=rtl] .resize-handle{right:0;left:auto}revo-grid[dir=rtl] .sort-indicator{margin-left:0;margin-right:5px}revo-grid[dir=rtl] .filter-button{margin-left:0;margin-right:5px}revo-grid[dir=rtl] .group-expand{margin-right:0;margin-left:2px;padding-right:5px;padding-left:0}revo-grid[dir=rtl] .rgCell,revo-grid[dir=rtl] .rgHeaderCell{padding-left:5px;padding-right:5px}revo-grid[dir=rtl] revogr-edit{direction:rtl}revo-grid[dir=rtl] .rgHeaderCell{direction:rtl}revo-grid[dir=rtl][theme=material] revogr-header,revo-grid[dir=rtl][theme=darkMaterial] revogr-header{text-align:right}revo-grid[dir=rtl][theme=material] revogr-data,revo-grid[dir=rtl][theme=darkMaterial] revogr-data{text-align:right}revo-grid[dir=rtl][theme=default] .rowHeaders,revo-grid[dir=rtl]:not([theme]) .rowHeaders{background-color:var(--revo-grid-header-bg)}revo-grid[dir=rtl][theme=default] .rowHeaders revogr-data .rgCell,revo-grid[dir=rtl]:not([theme]) .rowHeaders revogr-data .rgCell{color:var(--revo-grid-header-color)}revo-grid[dir=rtl][theme=default] .rowHeaders revogr-data .rgCell:first-child,revo-grid[dir=rtl]:not([theme]) .rowHeaders revogr-data .rgCell:first-child{box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[dir=rtl][theme=default] .rowHeaders revogr-data .rgCell:not(:first-child),revo-grid[dir=rtl]:not([theme]) .rowHeaders revogr-data .rgCell:not(:first-child){box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset, 1px 0 0 0 var(--revo-grid-header-border) inset}revo-grid[dir=rtl][theme=default] .rowHeaders revogr-data .rgCell:last-child,revo-grid[dir=rtl]:not([theme]) .rowHeaders revogr-data .rgCell:last-child{border-left:1px solid var(--revo-grid-header-border);border-right:none}revo-grid[dir=rtl][theme=default] .rowHeaders revogr-data revogr-header,revo-grid[dir=rtl]:not([theme]) .rowHeaders revogr-data revogr-header{box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid[dir=rtl][theme=default] revogr-header,revo-grid[dir=rtl]:not([theme]) revogr-header{text-align:right}revo-grid[dir=rtl][theme=default] revogr-data,revo-grid[dir=rtl]:not([theme]) revogr-data{text-align:right}revo-grid[dir=rtl][theme=compact] revogr-header,revo-grid[dir=rtl][theme=darkCompact] revogr-header{text-align:right}revo-grid[dir=rtl][theme=compact] revogr-data,revo-grid[dir=rtl][theme=darkCompact] revogr-data{text-align:right}.revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\";display:inline-block}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}revo-grid.custom-column-draggable .rgHeaderCell{cursor:grab;transition:background-color 0.2s ease}revo-grid.custom-column-draggable .rgHeaderCell[data-draggable=false]{cursor:default}revo-grid.custom-column-draggable.custom-column-drag-active{cursor:grabbing !important;user-select:none}revo-grid.custom-column-draggable.custom-column-drag-active *{cursor:grabbing !important}revo-grid.custom-column-draggable .custom-drag-indicator{position:fixed;width:2px;background-color:#0f87ff;pointer-events:none;z-index:99999;box-shadow:0 0 4px rgba(15, 135, 255, 0.5)}revo-grid.custom-column-draggable.column-drag-start *,revo-grid.custom-column-draggable.column-drag-start *::before,revo-grid.custom-column-draggable.column-drag-start *::after{animation-duration:0s !important;animation-delay:0s !important;transition-duration:0s !important;transition-delay:0s !important}revo-grid{--revo-grid-row-selected-bg:rgba(38, 106, 232, 0.1);--revo-grid-row-selected-hover-bg:rgba(38, 106, 232, 0.15);--revo-grid-wheel-capture-row-border:0 -1px 0 0 var(\n --revo-grid-wheel-capture-row-border-color,\n var(--revo-grid-cell-border)\n ) inset}.cell-checkbox{display:flex;align-items:center;justify-content:center}.cell-checkbox input[type=checkbox]{cursor:pointer;width:16px;height:16px;margin:0;accent-color:var(--revo-grid-primary, #266ae8)}.cell-header-checkbox-container{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.cell-header-checkbox-container input[type=checkbox]{cursor:pointer;width:16px;height:16px;margin:0;accent-color:var(--revo-grid-primary, #266ae8)}revo-grid[theme*=dark]{--revo-grid-row-selected-bg:rgba(38, 106, 232, 0.2);--revo-grid-row-selected-hover-bg:rgba(38, 106, 232, 0.25)}revo-grid .rgHeaderCell:has(.resize-handle-hover){z-index:92 !important}revo-grid revogr-header-unified .header-area-rgCol:has(.resize-handle-hover){z-index:14 !important}revo-grid revogr-header-unified .header-rgRow.actual-rgRow:has(.resize-handle-hover){z-index:3 !important}revo-grid revogr-viewport-scroll.rgCol:has(.resize-handle-hover){z-index:94 !important}revo-grid revogr-viewport-scroll.colPinStart:has(.resize-handle-hover),revo-grid revogr-viewport-scroll.colPinEnd:has(.resize-handle-hover){z-index:93 !important}revo-grid .rgHeaderCell>.resizable-r::after,revo-grid .rgHeaderCell>.resizable-l::after,revo-grid .rgHeaderCell>.resizable-r:hover::after,revo-grid .rgHeaderCell>.resizable-l:hover::after{background-color:transparent !important}revo-grid .rgHeaderCell>.resizable-r.resize-handle-hover::after,revo-grid .rgHeaderCell>.resizable-l.resize-handle-hover::after{background-color:var(--revo-grid-resize-indicator-color, #0f87ff) !important;display:block !important}revo-grid .rgHeaderCell.last-column>.resizable-r.resize-handle-hover::after{left:auto !important;right:50% !important;transform:none !important}revo-grid revogr-header-unified .header-area-colPinStart .rgHeaderCell:last-child>.resizable-r.resize-handle-hover::after,revo-grid revogr-header-unified .header-area-rgCol .rgHeaderCell:last-child>.resizable-r.resize-handle-hover::after{left:auto !important;right:50% !important;transform:none !important}revo-grid revogr-header-unified .header-area-rgCol .rgHeaderCell:first-child>.resizable-l.resize-handle-hover::after,revo-grid revogr-header-unified .header-area-colPinEnd .rgHeaderCell:first-child>.resizable-l.resize-handle-hover::after{left:50% !important;transform:none !important}revo-grid .rgHeaderCell.active{z-index:9998 !important}revo-grid.resize-indicator-active{cursor:col-resize !important}revo-grid.resize-indicator-active .header-area,revo-grid.resize-indicator-active .header-area *,revo-grid.resize-indicator-active .rgHeaderCell,revo-grid.resize-indicator-active .rgHeaderCell *{cursor:col-resize !important}revo-grid.resize-indicator-active revogr-data,revo-grid.resize-indicator-active revogr-overlay-selection{pointer-events:none}revo-grid.resize-indicator-active .resizable-r::after,revo-grid.resize-indicator-active .resizable-l::after{display:none !important}revo-grid.resize-indicator-active .resizable-r.resize-handle-hover::after,revo-grid.resize-indicator-active .resizable-l.resize-handle-hover::after{display:none !important;background-color:transparent !important}revo-grid.resize-indicator-active .rgHeaderCell:hover{background-color:initial !important;background-image:none !important}revo-grid .resizable-r,revo-grid .resizable-l{cursor:col-resize !important}.revo-grid-resize-indicator{border:none !important;outline:none !important;padding:0 !important;margin:0 !important}.resizable-r.resizable-hover-active::after,.resizable-l.resizable-hover-active::after{display:none !important}body.resize-indicator-global-cursor,body.resize-indicator-global-cursor *{cursor:col-resize !important}revo-grid{--revo-grid-primary:#266ae8;--revo-grid-primary-transparent:rgba(38, 106, 232, 0.9);--revo-grid-background:#fff;--revo-grid-foreground:black;--revo-grid-divider:gray;--revo-grid-shadow:rgba(0, 0, 0, 0.15);--revo-grid-text:black;--revo-grid-border:rgba(0, 0, 0, 0.2);--revo-grid-filter-panel-bg:#fff;--revo-grid-filter-panel-border:#d9d9d9;--revo-grid-filter-panel-shadow:rgba(0, 0, 0, 0.15);--revo-grid-filter-panel-input-bg:#eaeaeb;--revo-grid-filter-panel-divider:#d9d9d9;--revo-grid-filter-panel-select-border:transparent;--revo-grid-filter-panel-select-border-hover:transparent;--revo-grid-header-bg:#f8f9fa;--revo-grid-header-color:#000;--revo-grid-header-border:#cecece;--revo-grid-cell-border:#e2e3e3;--revo-grid-focused-bg:rgba(233, 234, 237, 0.5);--revo-grid-row-hover:#f1f1f1;--revo-grid-row-headers-bg:#f7faff;--revo-grid-row-headers-color:#757a82;--revo-grid-cell-disabled-bg:rgba(0, 0, 0, 0.07);direction:ltr !important;position:relative;display:flex !important;height:100%;position:relative;min-height:300px;font-family:Helvetica, Arial, Sans-Serif, serif;font-size:14px;position:relative;color:var(--revo-grid-text);display:flex;flex-direction:column;width:100%;height:100%}revo-grid[theme*=dark]{--revo-grid-background:#212529;--revo-grid-foreground:#fff;--revo-grid-text:rgba(255, 255, 255, 0.9);--revo-grid-divider:#505050;--revo-grid-border:rgba(255, 255, 255, 0.2);--revo-grid-filter-panel-bg:#212529;--revo-grid-filter-panel-border:#505050;--revo-grid-filter-panel-input-bg:#343a40;--revo-grid-filter-panel-divider:#505050;--revo-grid-header-bg:#343a40;--revo-grid-header-color:#fff;--revo-grid-header-border:#505050;--revo-grid-cell-border:#424242;--revo-grid-focused-bg:rgba(52, 58, 64, 0.5);--revo-grid-row-hover:rgba(80, 80, 80, 0.5);--revo-grid-row-headers-bg:rgba(52, 58, 64, 0.8);--revo-grid-row-headers-color:rgba(255, 255, 255, 0.8);--revo-grid-cell-disabled-bg:rgba(255, 255, 255, 0.07)}revo-grid::before{content:\"\";position:absolute;left:0;top:0;width:100%;height:16px;background:var(--rv-grid-fixed-top-shadow, linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0) 100%));pointer-events:none;opacity:0;transition:opacity 0.2s ease;z-index:100;transform:translateY(var(--header-shadow-offset, 0))}revo-grid.header-shadow::before{opacity:1}revo-grid revogr-header .header-rgRow.group{box-shadow:0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid revogr-header .header-rgRow:not(.group){box-shadow:0 -1px 0 0 var(--revo-grid-header-border), 0 -1px 0 0 var(--revo-grid-header-border) inset}revo-grid revogr-header .rgHeaderCell.sortable:hover{background-color:var(--revo-grid-row-hover)}revo-grid revogr-header .rgHeaderCell.focused-cell{background:var(--revo-grid-focused-bg)}revo-grid .footer-wrapper revogr-data{box-shadow:0 -1px 0 var(--revo-grid-cell-border)}revo-grid revogr-viewport-scroll.colPinStart,revo-grid revogr-viewport-scroll.colPinEnd{box-shadow:none}revo-grid revogr-data .rgRow{box-shadow:0 -1px 0 0 var(--revo-grid-cell-border) inset}revo-grid revogr-data .rgCell{color:var(--revo-grid-text)}revo-grid revogr-data .rgCell.disabled{background-color:var(--revo-grid-cell-disabled-bg)}revo-grid .revo-grid-border-line{position:absolute;top:0;left:0;right:0;bottom:0;border:1px solid var(--revo-grid-cell-border);border-radius:inherit;pointer-events:none;z-index:100}revo-grid .attribution{position:absolute;bottom:0;left:0;right:0;z-index:1000;width:0;height:0;border-left:4px solid var(--revo-grid-primary-transparent);border-bottom:4px solid var(--revo-grid-primary-transparent);border-top:4px solid transparent;border-right:4px solid transparent;cursor:pointer}revo-grid .attribution .value{position:absolute;bottom:0;left:0;background-color:var(--revo-grid-background);padding:4px;border-radius:4px;box-shadow:0 1px 10px var(--revo-grid-border);white-space:nowrap;text-decoration:none;color:var(--revo-grid-text);letter-spacing:0.3px;font-size:11px;opacity:0;width:4px;overflow:hidden;transition:opacity 0.5s ease-in-out, width 0.3s ease-in-out}revo-grid .attribution:hover .value{width:63px;opacity:1}revo-grid.column-draggable.column-drag-start:hover,revo-grid.column-draggable.column-drag-start *:hover{cursor:grabbing}revo-grid .footer-wrapper,revo-grid .header-wrapper{width:100%;flex-shrink:0}revo-grid .footer-wrapper revogr-data,revo-grid .header-wrapper revogr-data{z-index:3}revo-grid revo-dropdown{width:100%}revo-grid revo-dropdown .rv-dr-root{max-height:100%}revo-grid revo-dropdown.shrink label{opacity:0}revo-grid .viewports{position:relative;max-width:100%;display:flex;flex-direction:row;align-items:flex-start;flex-grow:1}revo-grid .viewports .header-placeholder{visibility:hidden;height:var(--rg-header-row-height, 45px)}revo-grid .viewports::before{content:\"\";position:absolute;top:0;left:0;width:16px;height:100%;background:linear-gradient(90deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0) 100%);background:var(--rv-grid-fixed-left-shadow);pointer-events:none;opacity:0;transition:opacity 0.2s ease;z-index:10;transform:translateX(var(--pin-start-shadow-offset, 0))}revo-grid .viewports::after{content:\"\";position:absolute;top:0;right:0;width:16px;height:100%;background:linear-gradient(270deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0) 100%);background:var(--rv-grid-fixed-right-shadow);pointer-events:none;opacity:0;transition:opacity 0.2s ease;z-index:10;transform:translateX(var(--pin-end-shadow-offset, 0))}revo-grid .viewports.pin-start-shadow::before{opacity:1}revo-grid .viewports.pin-end-shadow::after{opacity:1}revo-grid .viewports revogr-viewport-scroll.colPinStart,revo-grid .viewports revogr-viewport-scroll.colPinEnd{flex:0 0 auto}revo-grid .viewports revogr-viewport-scroll.rgCol{flex:0 1 auto;min-width:0}revo-grid .viewports revogr-viewport-scroll:not(.grouping-overlay-viewport){pointer-events:none}revo-grid .viewports revogr-viewport-scroll:not(.grouping-overlay-viewport) .header-wrapper{pointer-events:auto}revo-grid .viewports revogr-viewport-scroll:not(.grouping-overlay-viewport) .content-wrapper .rgRow{pointer-events:auto}revo-grid .viewports revogr-viewport-scroll:not(.grouping-overlay-viewport) .content-wrapper .rgRow.groupingRow{pointer-events:none}revo-grid .viewports revogr-viewport-scroll.grouping-overlay-viewport{position:absolute;top:0;left:0;right:0;bottom:0}revo-grid .viewports revogr-viewport-scroll.grouping-overlay-viewport .grouping-header-placeholder{visibility:hidden}revo-grid .main-viewport{flex-grow:1;height:0;display:flex;justify-content:space-between;flex-direction:row}revo-grid .draggable{position:fixed;height:30px;line-height:30px;background:var(--revo-grid-background);border-radius:3px;display:block;z-index:100;margin-top:5px;margin-right:-20px;box-shadow:0 4px 20px 0 var(--revo-grid-shadow);padding-left:20px;padding-right:5px}revo-grid .draggable.hidden{display:none}revo-grid .draggable .revo-alt-icon{background-color:var(--revo-grid-foreground);position:absolute;left:5px;top:10px}revo-grid .draggable-wrapper.hidden{display:none}revo-grid .drag-position{position:absolute;left:0;right:0;height:1px;z-index:2;background:var(--revo-grid-divider);pointer-events:none}revo-grid .drag-position-y{position:absolute;top:0;left:0;bottom:0;width:1px;z-index:2;background:var(--revo-grid-divider);pointer-events:none}revo-grid .drag-auto-scroll-y{pointer-events:none;position:absolute;left:0;top:0;height:50px;width:1px}revo-grid .clipboard{position:absolute;left:0;top:0}revo-grid revogr-scroll-virtual{position:relative}revo-grid revogr-scroll-virtual.vertical,revo-grid revogr-scroll-virtual.horizontal{z-index:3}revo-grid .empty-placeholder{position:absolute;top:var(--rg-empty-top, var(--rg-header-row-height, 45px));left:0;right:0;bottom:var(--rg-empty-bottom, 0);display:flex;align-items:center;justify-content:center;z-index:100;pointer-events:none;background:var(--rg-empty-background, #fff)}revo-grid .empty-placeholder [slot=empty]{display:block !important}";
|
|
1541
|
+
|
|
1542
|
+
const RevoGridComponent = class {
|
|
1543
|
+
constructor(hostRef) {
|
|
1544
|
+
registerInstance(this, hostRef);
|
|
1545
|
+
this.contentsizechanged = createEvent(this, "contentsizechanged", 7);
|
|
1546
|
+
this.beforeedit = createEvent(this, "beforeedit", 7);
|
|
1547
|
+
this.beforerangeedit = createEvent(this, "beforerangeedit", 7);
|
|
1548
|
+
this.afteredit = createEvent(this, "afteredit", 7);
|
|
1549
|
+
this.beforeautofill = createEvent(this, "beforeautofill", 7);
|
|
1550
|
+
this.beforerange = createEvent(this, "beforerange", 7);
|
|
1551
|
+
this.afterfocus = createEvent(this, "afterfocus", 7);
|
|
1552
|
+
this.roworderchanged = createEvent(this, "roworderchanged", 7);
|
|
1553
|
+
this.beforesorting = createEvent(this, "beforesorting", 7);
|
|
1554
|
+
this.beforesourcesortingapply = createEvent(this, "beforesourcesortingapply", 7);
|
|
1555
|
+
this.beforesortingapply = createEvent(this, "beforesortingapply", 7);
|
|
1556
|
+
this.rowdragstart = createEvent(this, "rowdragstart", 7);
|
|
1557
|
+
this.headerclick = createEvent(this, "headerclick", 7);
|
|
1558
|
+
this.beforecellfocus = createEvent(this, "beforecellfocus", 7);
|
|
1559
|
+
this.cellclick = createEvent(this, "cellclick", 7);
|
|
1560
|
+
this.beforefocuslost = createEvent(this, "beforefocuslost", 7);
|
|
1561
|
+
this.beforesourceset = createEvent(this, "beforesourceset", 7);
|
|
1562
|
+
this.beforeanysource = createEvent(this, "beforeanysource", 7);
|
|
1563
|
+
this.aftersourceset = createEvent(this, "aftersourceset", 7);
|
|
1564
|
+
this.afteranysource = createEvent(this, "afteranysource", 7);
|
|
1565
|
+
this.beforecolumnsset = createEvent(this, "beforecolumnsset", 7);
|
|
1566
|
+
this.beforecolumnapplied = createEvent(this, "beforecolumnapplied", 7);
|
|
1567
|
+
this.aftercolumnsset = createEvent(this, "aftercolumnsset", 7);
|
|
1568
|
+
this.beforefilterapply = createEvent(this, "beforefilterapply", 7);
|
|
1569
|
+
this.beforefiltertrimmed = createEvent(this, "beforefiltertrimmed", 7);
|
|
1570
|
+
this.beforetrimmed = createEvent(this, "beforetrimmed", 7);
|
|
1571
|
+
this.aftertrimmed = createEvent(this, "aftertrimmed", 7);
|
|
1572
|
+
this.viewportscroll = createEvent(this, "viewportscroll", 7);
|
|
1573
|
+
this.beforeexport = createEvent(this, "beforeexport", 7);
|
|
1574
|
+
this.beforeeditstart = createEvent(this, "beforeeditstart", 7);
|
|
1575
|
+
this.aftercolumnresize = createEvent(this, "aftercolumnresize", 7);
|
|
1576
|
+
this.beforerowdefinition = createEvent(this, "beforerowdefinition", 7);
|
|
1577
|
+
this.filterconfigchanged = createEvent(this, "filterconfigchanged", 7);
|
|
1578
|
+
this.sortingconfigchanged = createEvent(this, "sortingconfigchanged", 7);
|
|
1579
|
+
this.rowheaderschanged = createEvent(this, "rowheaderschanged", 7);
|
|
1580
|
+
this.beforegridrender = createEvent(this, "beforegridrender", 7);
|
|
1581
|
+
this.aftergridrender = createEvent(this, "aftergridrender", 7);
|
|
1582
|
+
this.afterdatarendered = createEvent(this, "afterdatarendered", 7);
|
|
1583
|
+
this.aftergridinit = createEvent(this, "aftergridinit", 7);
|
|
1584
|
+
this.additionaldatachanged = createEvent(this, "additionaldatachanged", 7);
|
|
1585
|
+
this.afterthemechanged = createEvent(this, "afterthemechanged", 7);
|
|
1586
|
+
this.created = createEvent(this, "created", 7);
|
|
1587
|
+
/**
|
|
1588
|
+
* Defines how many rows/columns should be rendered outside visible area.
|
|
1589
|
+
*/
|
|
1590
|
+
this.frameSize = 1;
|
|
1591
|
+
/**
|
|
1592
|
+
* Indicates default rgRow size.
|
|
1593
|
+
* By default 0, means theme package size will be applied
|
|
1594
|
+
*
|
|
1595
|
+
* Alternatively you can use `rowSize` to reset viewport
|
|
1596
|
+
*/
|
|
1597
|
+
this.rowSize = 0;
|
|
1598
|
+
/** Indicates default column size. */
|
|
1599
|
+
this.colSize = 100;
|
|
1600
|
+
/** When true, user can range selection. */
|
|
1601
|
+
this.range = false;
|
|
1602
|
+
/** When true, grid in read only mode. */
|
|
1603
|
+
this.readonly = false;
|
|
1604
|
+
/** When true, columns are resizable. */
|
|
1605
|
+
this.resize = false;
|
|
1606
|
+
/** When true cell focus appear. */
|
|
1607
|
+
this.canFocus = true;
|
|
1608
|
+
/** When true enable clipboard. */
|
|
1609
|
+
this.useClipboard = true;
|
|
1610
|
+
/**
|
|
1611
|
+
* Columns - defines an array of grid columns.
|
|
1612
|
+
* Can be column or grouped column.
|
|
1613
|
+
*/
|
|
1614
|
+
this.columns = [];
|
|
1615
|
+
/**
|
|
1616
|
+
* Source - defines main data source.
|
|
1617
|
+
* Can be an Object or 2 dimensional array([][]);
|
|
1618
|
+
* Keys/indexes referenced from columns Prop.
|
|
1619
|
+
*/
|
|
1620
|
+
this.source = [];
|
|
1621
|
+
/** Internal state to track if source is empty for triggering re-render */
|
|
1622
|
+
this.isSourceEmpty = true;
|
|
1623
|
+
/** Pinned top Source: {[T in ColumnProp]: any} - defines pinned top rows data source. */
|
|
1624
|
+
this.pinnedTopSource = [];
|
|
1625
|
+
/** Pinned bottom Source: {[T in ColumnProp]: any} - defines pinned bottom rows data source. */
|
|
1626
|
+
this.pinnedBottomSource = [];
|
|
1627
|
+
/** Custom row properies to be applied. See `RowDefinition` for more info. */
|
|
1628
|
+
this.rowDefinitions = [];
|
|
1629
|
+
/** Custom editors register. */
|
|
1630
|
+
this.editors = {};
|
|
1631
|
+
/**
|
|
1632
|
+
* Apply changes in editor when closed except 'Escape' cases.
|
|
1633
|
+
* If custom editor in use method getValue required.
|
|
1634
|
+
* Check interfaces.d.ts `EditorBase` for more info.
|
|
1635
|
+
*/
|
|
1636
|
+
this.applyOnClose = false;
|
|
1637
|
+
/**
|
|
1638
|
+
* Custom grid plugins. Can be added or removed at runtime.
|
|
1639
|
+
* Every plugin should be inherited from BasePlugin class.
|
|
1640
|
+
*
|
|
1641
|
+
* For more details check [Plugin guide](https://rv-grid.com/guide/plugin/)
|
|
1642
|
+
*/
|
|
1643
|
+
this.plugins = [];
|
|
1644
|
+
/**
|
|
1645
|
+
* Column Types Format.
|
|
1646
|
+
* Every type represent multiple column properties.
|
|
1647
|
+
* Types will be merged but can be replaced with column properties.
|
|
1648
|
+
* Types were made as separate objects to be reusable per multiple columns.
|
|
1649
|
+
*/
|
|
1650
|
+
this.columnTypes = {};
|
|
1651
|
+
/** Theme name. */
|
|
1652
|
+
this.theme = 'default';
|
|
1653
|
+
/**
|
|
1654
|
+
* Row class property mapping.
|
|
1655
|
+
* Map custom classes to rows from row object data.
|
|
1656
|
+
* Define this property in rgRow object and this will be mapped as rgRow class.
|
|
1657
|
+
*/
|
|
1658
|
+
this.rowClass = '';
|
|
1659
|
+
/**
|
|
1660
|
+
* Autosize config.
|
|
1661
|
+
* Enables columns autoSize.
|
|
1662
|
+
* For more details check `autoSizeColumn` plugin.
|
|
1663
|
+
* By default disabled, hence operation is not performance efficient.
|
|
1664
|
+
* `true` to enable with default params (double header separator click for autosize).
|
|
1665
|
+
* Or define config. See `AutoSizeColumnConfig` for more details.
|
|
1666
|
+
*/
|
|
1667
|
+
this.autoSizeColumn = false;
|
|
1668
|
+
/**
|
|
1669
|
+
* Enables filter plugin.
|
|
1670
|
+
* Can be boolean.
|
|
1671
|
+
* Or can be filter collection See `FilterCollection` for more info.
|
|
1672
|
+
*/
|
|
1673
|
+
this.filter = false;
|
|
1674
|
+
/**
|
|
1675
|
+
* Enable column move plugin.
|
|
1676
|
+
*/
|
|
1677
|
+
this.canMoveColumns = false;
|
|
1678
|
+
/**
|
|
1679
|
+
* Trimmed rows.
|
|
1680
|
+
* Functionality which allows to hide rows from main data set.
|
|
1681
|
+
* `trimmedRows` are physical `rgRow` indexes to hide.
|
|
1682
|
+
*/
|
|
1683
|
+
this.trimmedRows = {};
|
|
1684
|
+
/**
|
|
1685
|
+
* Enable export plugin.
|
|
1686
|
+
*/
|
|
1687
|
+
this.exporting = false;
|
|
1688
|
+
/**
|
|
1689
|
+
* Stretch strategy for columns by `StretchColumn` plugin.
|
|
1690
|
+
* For example if there are more space on the right last column size would be increased.
|
|
1691
|
+
*/
|
|
1692
|
+
this.stretch = false;
|
|
1693
|
+
/**
|
|
1694
|
+
* Additional data to be passed to plugins, renders or editors.
|
|
1695
|
+
* For example if you need to pass Vue component instance.
|
|
1696
|
+
*/
|
|
1697
|
+
this.additionalData = {};
|
|
1698
|
+
/**
|
|
1699
|
+
* Disable lazy rendering mode for the `X axis`.
|
|
1700
|
+
* Use when not many columns present and you don't need rerenader cells during scroll.
|
|
1701
|
+
* Can be used for initial rendering performance improvement.
|
|
1702
|
+
*/
|
|
1703
|
+
this.disableVirtualX = false;
|
|
1704
|
+
/**
|
|
1705
|
+
* Disable lazy rendering mode for the `Y axis`.
|
|
1706
|
+
* Use when not many rows present and you don't need rerenader cells during scroll.
|
|
1707
|
+
* Can be used for initial rendering performance improvement.
|
|
1708
|
+
*/
|
|
1709
|
+
this.disableVirtualY = false;
|
|
1710
|
+
/**
|
|
1711
|
+
* Please only hide the attribution if you are subscribed to Pro version
|
|
1712
|
+
*/
|
|
1713
|
+
this.hideAttribution = false;
|
|
1714
|
+
/**
|
|
1715
|
+
* Prevent rendering until job is done.
|
|
1716
|
+
* Can be used for initial rendering performance improvement.
|
|
1717
|
+
* When several plugins require initial rendering this will prevent double initial rendering.
|
|
1718
|
+
*/
|
|
1719
|
+
this.jobsBeforeRender = [];
|
|
1720
|
+
/**
|
|
1721
|
+
* Register new virtual node inside of grid.
|
|
1722
|
+
* Used for additional items creation such as plugin elements.
|
|
1723
|
+
* Should be set before grid render inside of plugins.
|
|
1724
|
+
* Can return VNode result of h() function or a function that returns VNode.
|
|
1725
|
+
* Function can be used for performance improvement and additional renders.
|
|
1726
|
+
*/
|
|
1727
|
+
this.registerVNode = [];
|
|
1728
|
+
/**
|
|
1729
|
+
* Enable accessibility. If disabled, the grid will not be accessible.
|
|
1730
|
+
* @default true
|
|
1731
|
+
*/
|
|
1732
|
+
this.accessible = true;
|
|
1733
|
+
/**
|
|
1734
|
+
* Enable right-to-left (RTL) mode. When enabled, columns will be displayed from right to left.
|
|
1735
|
+
* @default false
|
|
1736
|
+
*/
|
|
1737
|
+
this.rtl = false;
|
|
1738
|
+
/**
|
|
1739
|
+
* Disable native drag&drop plugin.
|
|
1740
|
+
*/
|
|
1741
|
+
this.canDrag = true;
|
|
1742
|
+
/**
|
|
1743
|
+
* Show scrollbars. When false, scrollbars will be hidden.
|
|
1744
|
+
* @default true
|
|
1745
|
+
*/
|
|
1746
|
+
this.showScrollbar = true;
|
|
1747
|
+
/**
|
|
1748
|
+
* Hide empty placeholder during initial loading.
|
|
1749
|
+
* Set to true when loading data asynchronously.
|
|
1750
|
+
* @default false
|
|
1751
|
+
*/
|
|
1752
|
+
this.hideEmpty = false;
|
|
1753
|
+
/**
|
|
1754
|
+
* Disable scrolling. When true, the grid will not respond to scroll events.
|
|
1755
|
+
* @default false
|
|
1756
|
+
*/
|
|
1757
|
+
this.disableScroll = false;
|
|
1758
|
+
/**
|
|
1759
|
+
* Auto scroll to focused cell. When true, the grid will automatically scroll to make the focused cell visible.
|
|
1760
|
+
* @default false
|
|
1761
|
+
*/
|
|
1762
|
+
this.autoScrollToFocus = false;
|
|
1763
|
+
this.columnsUpdateNonce = 0;
|
|
1764
|
+
this.extraElements = [];
|
|
1765
|
+
this.pluginService = new PluginService();
|
|
1766
|
+
this.viewport = null;
|
|
1767
|
+
this.isInited = false;
|
|
1768
|
+
this.columnsVersion = 0;
|
|
1769
|
+
this.columnsUpdateToken = 0;
|
|
1770
|
+
this.dataUpdateToken = 0;
|
|
1771
|
+
// 暂时保留,后续可能使用
|
|
1772
|
+
this._hasGroupingValue = false;
|
|
1773
|
+
}
|
|
1774
|
+
// #endregion
|
|
1775
|
+
// #region Methods
|
|
1776
|
+
/**
|
|
1777
|
+
* Refreshes data viewport.
|
|
1778
|
+
* Can be specific part as rgRow or pinned rgRow or 'all' by default.
|
|
1779
|
+
*/
|
|
1780
|
+
async refresh(type = 'all') {
|
|
1781
|
+
if (!this.dataProvider) {
|
|
1782
|
+
throw new Error('Not connected');
|
|
1783
|
+
}
|
|
1784
|
+
this.dataProvider.refresh(type);
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* Refreshes data at specified cell.
|
|
1788
|
+
* Useful for performance optimization.
|
|
1789
|
+
* No viewport update will be triggered.
|
|
1790
|
+
*
|
|
1791
|
+
* @example
|
|
1792
|
+
* const grid = document.querySelector('revo-grid');
|
|
1793
|
+
* grid.setDataAt({ row: 0, col: 0, val: 'test' }); // refresh
|
|
1794
|
+
*/
|
|
1795
|
+
async setDataAt({ row, col, colType = 'rgCol', rowType = 'rgRow', val, skipDataUpdate = false }) {
|
|
1796
|
+
var _a;
|
|
1797
|
+
if (this.dataProvider && this.columnProvider && !skipDataUpdate) {
|
|
1798
|
+
const columnProp = (_a = this.columnProvider.getColumn(col, colType)) === null || _a === void 0 ? void 0 : _a.prop;
|
|
1799
|
+
if (typeof columnProp !== 'undefined') {
|
|
1800
|
+
this.dataProvider.setCellData({
|
|
1801
|
+
type: rowType,
|
|
1802
|
+
rowIndex: row,
|
|
1803
|
+
prop: columnProp,
|
|
1804
|
+
val,
|
|
1805
|
+
}, false);
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
const dataElement = this.element.querySelector(`revogr-data[type="${rowType}"][col-type="${colType}"]`);
|
|
1809
|
+
return dataElement === null || dataElement === void 0 ? void 0 : dataElement.updateCell({
|
|
1810
|
+
row,
|
|
1811
|
+
col,
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Scrolls viewport to specified row by index.
|
|
1816
|
+
*/
|
|
1817
|
+
async scrollToRow(coordinate = 0) {
|
|
1818
|
+
if (!this.dimensionProvider) {
|
|
1819
|
+
throw new Error('Not connected');
|
|
1820
|
+
}
|
|
1821
|
+
const y = this.dimensionProvider.getViewPortPos({
|
|
1822
|
+
coordinate,
|
|
1823
|
+
dimension: 'rgRow',
|
|
1824
|
+
});
|
|
1825
|
+
await this.scrollToCoordinate({ y });
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Scrolls viewport to specified column by index.
|
|
1829
|
+
*/
|
|
1830
|
+
async scrollToColumnIndex(coordinate = 0) {
|
|
1831
|
+
if (!this.dimensionProvider) {
|
|
1832
|
+
throw new Error('Not connected');
|
|
1833
|
+
}
|
|
1834
|
+
const x = this.dimensionProvider.getViewPortPos({
|
|
1835
|
+
coordinate,
|
|
1836
|
+
dimension: 'rgCol',
|
|
1837
|
+
});
|
|
1838
|
+
await this.scrollToCoordinate({ x });
|
|
1839
|
+
}
|
|
1840
|
+
/**
|
|
1841
|
+
* Scrolls viewport to specified column by prop
|
|
1842
|
+
*/
|
|
1843
|
+
async scrollToColumnProp(prop, dimension = 'rgCol') {
|
|
1844
|
+
if (!this.dimensionProvider || !this.columnProvider) {
|
|
1845
|
+
throw new Error('Not connected');
|
|
1846
|
+
}
|
|
1847
|
+
const coordinate = this.columnProvider.getColumnIndexByProp(prop, dimension);
|
|
1848
|
+
if (coordinate < 0) {
|
|
1849
|
+
// already on the screen
|
|
1850
|
+
return;
|
|
1851
|
+
}
|
|
1852
|
+
const x = this.dimensionProvider.getViewPortPos({
|
|
1853
|
+
coordinate,
|
|
1854
|
+
dimension,
|
|
1855
|
+
});
|
|
1856
|
+
await this.scrollToCoordinate({ x });
|
|
1857
|
+
}
|
|
1858
|
+
/**
|
|
1859
|
+
* Scrolls viewport to row by property value
|
|
1860
|
+
* @param propName - Property name to search for (e.g., 'id', 'name')
|
|
1861
|
+
* @param value - Value to match
|
|
1862
|
+
* @param type - Row type, default 'rgRow'
|
|
1863
|
+
* @returns true if row found and scrolled, false otherwise
|
|
1864
|
+
*/
|
|
1865
|
+
async scrollToRowByProp(propName, value, type = 'rgRow') {
|
|
1866
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
1867
|
+
throw new Error('Not connected');
|
|
1868
|
+
}
|
|
1869
|
+
const dataStore = this.dataProvider.stores[type];
|
|
1870
|
+
if (!dataStore) {
|
|
1871
|
+
return false;
|
|
1872
|
+
}
|
|
1873
|
+
const source = dataStore.store.get('source');
|
|
1874
|
+
// 查找目标行的物理索引
|
|
1875
|
+
const physicalIndex = source.findIndex((row) => row[propName] === value);
|
|
1876
|
+
if (physicalIndex < 0) {
|
|
1877
|
+
return false;
|
|
1878
|
+
}
|
|
1879
|
+
// 检查行是否可见
|
|
1880
|
+
let items = dataStore.store.get('items');
|
|
1881
|
+
let virtualIndex = items.indexOf(physicalIndex);
|
|
1882
|
+
// 如果不可见,尝试展开父节点
|
|
1883
|
+
if (virtualIndex < 0) {
|
|
1884
|
+
const targetRow = source[physicalIndex];
|
|
1885
|
+
// 先展开分组父节点(分组在外层)
|
|
1886
|
+
await this.expandGroupAncestors(physicalIndex, source, dataStore);
|
|
1887
|
+
// 重新检查
|
|
1888
|
+
items = dataStore.store.get('items');
|
|
1889
|
+
virtualIndex = items.indexOf(physicalIndex);
|
|
1890
|
+
// 再展开树形父节点
|
|
1891
|
+
if (virtualIndex < 0) {
|
|
1892
|
+
await this.expandTreeAncestors(targetRow, source);
|
|
1893
|
+
// 最后检查
|
|
1894
|
+
items = dataStore.store.get('items');
|
|
1895
|
+
virtualIndex = items.indexOf(physicalIndex);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
if (virtualIndex < 0) {
|
|
1899
|
+
console.warn(`Row with ${propName}=${value} is hidden and cannot be expanded.`);
|
|
1900
|
+
return false;
|
|
1901
|
+
}
|
|
1902
|
+
await this.scrollToRow(virtualIndex);
|
|
1903
|
+
return true;
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* 展开树形结构的所有祖先节点
|
|
1907
|
+
*/
|
|
1908
|
+
async expandTreeAncestors(targetRow, source) {
|
|
1909
|
+
var _a, _b, _c;
|
|
1910
|
+
const treePlugin = this.pluginService.getByClass(TreeDataPlugin);
|
|
1911
|
+
if (!treePlugin || !((_a = this.additionalData) === null || _a === void 0 ? void 0 : _a.tree)) {
|
|
1912
|
+
return;
|
|
1913
|
+
}
|
|
1914
|
+
const { idField = 'id', parentIdField = 'parentId', rootParentId = '' } = this.additionalData.tree;
|
|
1915
|
+
// 收集所有祖先节点
|
|
1916
|
+
const ancestors = [];
|
|
1917
|
+
let currentParentId = targetRow[parentIdField];
|
|
1918
|
+
while (currentParentId !== undefined && currentParentId !== rootParentId) {
|
|
1919
|
+
const parentRow = source.find((row) => row[idField] === currentParentId);
|
|
1920
|
+
if (!parentRow)
|
|
1921
|
+
break;
|
|
1922
|
+
ancestors.unshift(parentRow);
|
|
1923
|
+
currentParentId = parentRow[parentIdField];
|
|
1924
|
+
}
|
|
1925
|
+
if (ancestors.length === 0) {
|
|
1926
|
+
return;
|
|
1927
|
+
}
|
|
1928
|
+
// 展开所有祖先
|
|
1929
|
+
const expandedRowIds = treePlugin.expandedRowIds;
|
|
1930
|
+
for (const ancestor of ancestors) {
|
|
1931
|
+
const ancestorId = ancestor[idField];
|
|
1932
|
+
if (!(expandedRowIds === null || expandedRowIds === void 0 ? void 0 : expandedRowIds.has(ancestorId))) {
|
|
1933
|
+
expandedRowIds === null || expandedRowIds === void 0 ? void 0 : expandedRowIds.add(ancestorId);
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
// 更新树形结构
|
|
1937
|
+
(_c = (_b = treePlugin).updateTree) === null || _c === void 0 ? void 0 : _c.call(_b);
|
|
1938
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* 展开分组的所有父分组
|
|
1942
|
+
*/
|
|
1943
|
+
async expandGroupAncestors(physicalIndex, source, dataStore) {
|
|
1944
|
+
var _a, _b, _c;
|
|
1945
|
+
const groupingPlugin = this.pluginService.getByClass(GroupingRowPlugin);
|
|
1946
|
+
if (!groupingPlugin || !((_a = this.grouping) === null || _a === void 0 ? void 0 : _a.props)) {
|
|
1947
|
+
return;
|
|
1948
|
+
}
|
|
1949
|
+
const GROUP_EXPANDED = '__rvgr-group-expanded';
|
|
1950
|
+
const PSEUDO_GROUP_ITEM_VALUE = '__rvgr-group-value';
|
|
1951
|
+
const GROUP_CHILDREN_INDICES = '__rvgr-children';
|
|
1952
|
+
const TRIMMED_GROUPING = 'grouping';
|
|
1953
|
+
const isGroupRow = (row) => row && row['__rvgr-depth'] !== undefined;
|
|
1954
|
+
// 查找所有包含目标行的折叠分组
|
|
1955
|
+
const allContainingGroups = [];
|
|
1956
|
+
const groupsToExpand = [];
|
|
1957
|
+
for (let i = physicalIndex - 1; i >= 0; i--) {
|
|
1958
|
+
const row = source[i];
|
|
1959
|
+
if (!isGroupRow(row)) {
|
|
1960
|
+
continue;
|
|
1961
|
+
}
|
|
1962
|
+
// 检查此分组是否包含目标行
|
|
1963
|
+
if (this.isRowInGroup(i, physicalIndex, source, row[PSEUDO_GROUP_ITEM_VALUE], row[GROUP_CHILDREN_INDICES])) {
|
|
1964
|
+
allContainingGroups.unshift(i);
|
|
1965
|
+
if (!row[GROUP_EXPANDED]) {
|
|
1966
|
+
groupsToExpand.unshift(i);
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
const targetGroupingTrimmed = !!((_c = (_b = dataStore.store.get('trimmed')) === null || _b === void 0 ? void 0 : _b[TRIMMED_GROUPING]) === null || _c === void 0 ? void 0 : _c[physicalIndex]);
|
|
1971
|
+
// 修复场景:目标行仍被 grouping trimmed,但路径分组都标记为已展开。
|
|
1972
|
+
// 这种情况下重放一次 doExpand,强制同步 grouping trimmed 状态。
|
|
1973
|
+
if (groupsToExpand.length === 0 && targetGroupingTrimmed && allContainingGroups.length > 0) {
|
|
1974
|
+
groupsToExpand.push(...allContainingGroups);
|
|
1975
|
+
}
|
|
1976
|
+
if (groupsToExpand.length === 0) {
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
// 动态导入展开服务
|
|
1980
|
+
const { doExpand } = await import('./tree-data.plugin-C2eXkf9_.js').then(function (n) { return n.u; });
|
|
1981
|
+
// 按层级从外到内展开
|
|
1982
|
+
for (const groupPhysicalIndex of groupsToExpand) {
|
|
1983
|
+
const currentSource = dataStore.store.get('source');
|
|
1984
|
+
const currentItems = dataStore.store.get('items');
|
|
1985
|
+
const vIndex = currentItems.indexOf(groupPhysicalIndex);
|
|
1986
|
+
if (vIndex < 0) {
|
|
1987
|
+
continue;
|
|
1988
|
+
}
|
|
1989
|
+
// 标记为展开
|
|
1990
|
+
currentSource[groupPhysicalIndex][GROUP_EXPANDED] = true;
|
|
1991
|
+
// 计算展开后的状态
|
|
1992
|
+
const result = doExpand(vIndex, currentSource, currentItems);
|
|
1993
|
+
if (result.items) {
|
|
1994
|
+
dataStore.store.set('items', result.items);
|
|
1995
|
+
}
|
|
1996
|
+
// 更新 trimmed
|
|
1997
|
+
const currentTrimmed = dataStore.store.get('trimmed');
|
|
1998
|
+
const newTrimmed = Object.assign(Object.assign({}, currentTrimmed[TRIMMED_GROUPING]), result.trimmed);
|
|
1999
|
+
await this.addTrimmed(newTrimmed, TRIMMED_GROUPING);
|
|
2000
|
+
await new Promise(resolve => setTimeout(resolve, 50));
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* 检查目标行是否在指定分组内
|
|
2005
|
+
*/
|
|
2006
|
+
isRowInGroup(groupIndex, targetIndex, source, groupValue, groupChildrenIndices) {
|
|
2007
|
+
if (Array.isArray(groupChildrenIndices)) {
|
|
2008
|
+
return groupChildrenIndices.includes(targetIndex);
|
|
2009
|
+
}
|
|
2010
|
+
const isGroupRow = (row) => row && row['__rvgr-depth'] !== undefined;
|
|
2011
|
+
const PSEUDO_GROUP_ITEM_VALUE = '__rvgr-group-value';
|
|
2012
|
+
for (let j = groupIndex + 1; j < source.length; j++) {
|
|
2013
|
+
if (j === targetIndex) {
|
|
2014
|
+
return true;
|
|
2015
|
+
}
|
|
2016
|
+
const nextRow = source[j];
|
|
2017
|
+
if (isGroupRow(nextRow)) {
|
|
2018
|
+
const nextValue = nextRow[PSEUDO_GROUP_ITEM_VALUE];
|
|
2019
|
+
if (!nextValue || !nextValue.startsWith(groupValue + ',')) {
|
|
2020
|
+
break;
|
|
2021
|
+
}
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
return false;
|
|
2025
|
+
}
|
|
2026
|
+
/** Update columns */
|
|
2027
|
+
async updateColumns(cols) {
|
|
2028
|
+
var _a;
|
|
2029
|
+
(_a = this.columnProvider) === null || _a === void 0 ? void 0 : _a.updateColumns(cols);
|
|
2030
|
+
}
|
|
2031
|
+
/** Add trimmed by type */
|
|
2032
|
+
async addTrimmed(trimmed, trimmedType = 'external', type = 'rgRow') {
|
|
2033
|
+
if (!this.dataProvider) {
|
|
2034
|
+
throw new Error('Not connected');
|
|
2035
|
+
}
|
|
2036
|
+
const event = this.beforetrimmed.emit({
|
|
2037
|
+
trimmed,
|
|
2038
|
+
trimmedType,
|
|
2039
|
+
type,
|
|
2040
|
+
});
|
|
2041
|
+
if (event.defaultPrevented) {
|
|
2042
|
+
return event;
|
|
2043
|
+
}
|
|
2044
|
+
this.dataProvider.setTrimmed({ [trimmedType]: event.detail.trimmed }, type);
|
|
2045
|
+
this.aftertrimmed.emit();
|
|
2046
|
+
return event;
|
|
2047
|
+
}
|
|
2048
|
+
/** Scrolls view port to coordinate */
|
|
2049
|
+
async scrollToCoordinate(cell) {
|
|
2050
|
+
var _a;
|
|
2051
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.scrollToCell(cell);
|
|
2052
|
+
}
|
|
2053
|
+
/** Open editor for cell. */
|
|
2054
|
+
async setCellEdit(rgRow, prop, rowSource = 'rgRow') {
|
|
2055
|
+
var _a;
|
|
2056
|
+
const rgCol = getColumnByProp(this.columns, prop);
|
|
2057
|
+
if (!rgCol) {
|
|
2058
|
+
return;
|
|
2059
|
+
}
|
|
2060
|
+
await timeout();
|
|
2061
|
+
const colGroup = rgCol.pin || 'rgCol';
|
|
2062
|
+
if (!this.columnProvider) {
|
|
2063
|
+
throw new Error('Not connected');
|
|
2064
|
+
}
|
|
2065
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.setEdit(rgRow, this.columnProvider.getColumnIndexByProp(prop, colGroup), colGroup, rowSource);
|
|
2066
|
+
}
|
|
2067
|
+
/** Set focus range. */
|
|
2068
|
+
async setCellsFocus(cellStart = { x: 0, y: 0 }, cellEnd = { x: 0, y: 0 }, colType = 'rgCol', rowType = 'rgRow') {
|
|
2069
|
+
var _a;
|
|
2070
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.setFocus(colType, rowType, cellStart, cellEnd);
|
|
2071
|
+
}
|
|
2072
|
+
/** Get data from source */
|
|
2073
|
+
async getSource(type = 'rgRow') {
|
|
2074
|
+
if (!this.dataProvider) {
|
|
2075
|
+
throw new Error('Not connected');
|
|
2076
|
+
}
|
|
2077
|
+
return this.dataProvider.stores[type].store.get('source');
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Get data from visible part of source
|
|
2081
|
+
* Trimmed/filtered rows will be excluded
|
|
2082
|
+
* @param type - type of source
|
|
2083
|
+
*/
|
|
2084
|
+
async getVisibleSource(type = 'rgRow') {
|
|
2085
|
+
if (!this.dataProvider) {
|
|
2086
|
+
throw new Error('Not connected');
|
|
2087
|
+
}
|
|
2088
|
+
return getVisibleSourceItem(this.dataProvider.stores[type].store);
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Provides access to rows internal store observer
|
|
2092
|
+
* Can be used for plugin support
|
|
2093
|
+
* @param type - type of source
|
|
2094
|
+
*/
|
|
2095
|
+
async getSourceStore(type = 'rgRow') {
|
|
2096
|
+
if (!this.dataProvider) {
|
|
2097
|
+
throw new Error('Not connected');
|
|
2098
|
+
}
|
|
2099
|
+
return this.dataProvider.stores[type].store;
|
|
2100
|
+
}
|
|
2101
|
+
/**
|
|
2102
|
+
* Provides access to column internal store observer
|
|
2103
|
+
* Can be used for plugin support
|
|
2104
|
+
* @param type - type of column
|
|
2105
|
+
*/
|
|
2106
|
+
async getColumnStore(type = 'rgCol') {
|
|
2107
|
+
if (!this.columnProvider) {
|
|
2108
|
+
throw new Error('Not connected');
|
|
2109
|
+
}
|
|
2110
|
+
return this.columnProvider.stores[type].store;
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Update column sorting
|
|
2114
|
+
* @param column - column prop and cellCompare
|
|
2115
|
+
* @param order - order to apply
|
|
2116
|
+
* @param additive - if false will replace current order
|
|
2117
|
+
*
|
|
2118
|
+
* later passed to SortingPlugin
|
|
2119
|
+
*/
|
|
2120
|
+
async updateColumnSorting(column, order, additive) {
|
|
2121
|
+
this.sortingconfigchanged.emit({
|
|
2122
|
+
columns: [{
|
|
2123
|
+
prop: column.prop,
|
|
2124
|
+
order,
|
|
2125
|
+
cellCompare: column.cellCompare,
|
|
2126
|
+
}],
|
|
2127
|
+
additive,
|
|
2128
|
+
});
|
|
2129
|
+
}
|
|
2130
|
+
/**
|
|
2131
|
+
* Clears column sorting
|
|
2132
|
+
*/
|
|
2133
|
+
async clearSorting() {
|
|
2134
|
+
this.sortingconfigchanged.emit({
|
|
2135
|
+
columns: [],
|
|
2136
|
+
});
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Receive all columns in data source
|
|
2140
|
+
*/
|
|
2141
|
+
async getColumns() {
|
|
2142
|
+
if (!this.columnProvider) {
|
|
2143
|
+
throw new Error('Not connected');
|
|
2144
|
+
}
|
|
2145
|
+
return this.columnProvider.getColumns();
|
|
2146
|
+
}
|
|
2147
|
+
/**
|
|
2148
|
+
* Clear current grid focus. Grid has no longer focus on it.
|
|
2149
|
+
*/
|
|
2150
|
+
async clearFocus() {
|
|
2151
|
+
var _a, _b;
|
|
2152
|
+
const focused = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
|
|
2153
|
+
const event = this.beforefocuslost.emit(focused);
|
|
2154
|
+
if (event.defaultPrevented) {
|
|
2155
|
+
return;
|
|
2156
|
+
}
|
|
2157
|
+
(_b = this.selectionStoreConnector) === null || _b === void 0 ? void 0 : _b.clearAll();
|
|
2158
|
+
}
|
|
2159
|
+
/**
|
|
2160
|
+
* Get all active plugins instances
|
|
2161
|
+
*/
|
|
2162
|
+
async getPlugins() {
|
|
2163
|
+
return this.pluginService.get();
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Get the currently focused cell.
|
|
2167
|
+
*/
|
|
2168
|
+
async getFocused() {
|
|
2169
|
+
var _a, _b;
|
|
2170
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused()) !== null && _b !== void 0 ? _b : null;
|
|
2171
|
+
}
|
|
2172
|
+
/**
|
|
2173
|
+
* Get size of content
|
|
2174
|
+
* Including all pinned data
|
|
2175
|
+
*/
|
|
2176
|
+
async getContentSize() {
|
|
2177
|
+
var _a;
|
|
2178
|
+
if (!this.dimensionProvider) {
|
|
2179
|
+
throw new Error('Not connected');
|
|
2180
|
+
}
|
|
2181
|
+
return (_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.getFullSize();
|
|
2182
|
+
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Get the currently selected Range.
|
|
2185
|
+
*/
|
|
2186
|
+
async getSelectedRange() {
|
|
2187
|
+
var _a, _b;
|
|
2188
|
+
return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange()) !== null && _b !== void 0 ? _b : null;
|
|
2189
|
+
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Refresh extra elements. Triggers re-rendering of extra elements and functions.
|
|
2192
|
+
* Part of extraElements and registerVNode methods.
|
|
2193
|
+
* Useful for plugins.
|
|
2194
|
+
*/
|
|
2195
|
+
async refreshExtraElements() {
|
|
2196
|
+
var _a;
|
|
2197
|
+
(_a = this.extraService) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
2198
|
+
}
|
|
2199
|
+
/**
|
|
2200
|
+
* Get all providers for grid
|
|
2201
|
+
* Useful for external grid integration
|
|
2202
|
+
*/
|
|
2203
|
+
async getProviders() {
|
|
2204
|
+
return this.getPluginData();
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Lock scrolling. Prevents the grid from responding to scroll events.
|
|
2208
|
+
*/
|
|
2209
|
+
async lockScroll() {
|
|
2210
|
+
this.disableScroll = true;
|
|
2211
|
+
}
|
|
2212
|
+
/**
|
|
2213
|
+
* Unlock scrolling. Allows the grid to respond to scroll events.
|
|
2214
|
+
*/
|
|
2215
|
+
async unlockScroll() {
|
|
2216
|
+
this.disableScroll = false;
|
|
2217
|
+
}
|
|
2218
|
+
/**
|
|
2219
|
+
* Get current scroll lock state.
|
|
2220
|
+
*/
|
|
2221
|
+
async isScrollLocked() {
|
|
2222
|
+
return this.disableScroll;
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* Hide rows by ID field value
|
|
2226
|
+
* @param ids - Array of ID values to hide
|
|
2227
|
+
* @param idField - ID field name, default 'id'
|
|
2228
|
+
* @param trimmedType - Trimmed type identifier, default 'byId'
|
|
2229
|
+
* @param type - Row type, default 'rgRow'
|
|
2230
|
+
* @returns Event with trimmed row indexes
|
|
2231
|
+
*/
|
|
2232
|
+
async hideRowsById(ids, idField = 'id', trimmedType = 'byId', type = 'rgRow') {
|
|
2233
|
+
if (!this.dataProvider) {
|
|
2234
|
+
throw new Error('Not connected');
|
|
2235
|
+
}
|
|
2236
|
+
const source = await this.getSource(type);
|
|
2237
|
+
const trimmed = {};
|
|
2238
|
+
// Find physical indexes by ID
|
|
2239
|
+
source.forEach((row, index) => {
|
|
2240
|
+
if (ids.includes(row[idField])) {
|
|
2241
|
+
trimmed[index] = true;
|
|
2242
|
+
}
|
|
2243
|
+
});
|
|
2244
|
+
return this.addTrimmed(trimmed, trimmedType, type);
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Show rows by ID field value (remove from trimmed)
|
|
2248
|
+
* @param ids - Array of ID values to show, if empty will show all rows
|
|
2249
|
+
* @param idField - ID field name, default 'id'
|
|
2250
|
+
* @param trimmedType - Trimmed type identifier, default 'byId'
|
|
2251
|
+
* @param type - Row type, default 'rgRow'
|
|
2252
|
+
*/
|
|
2253
|
+
async showRowsById(ids = [], idField = 'id', trimmedType = 'byId', type = 'rgRow') {
|
|
2254
|
+
if (!this.dataProvider) {
|
|
2255
|
+
throw new Error('Not connected');
|
|
2256
|
+
}
|
|
2257
|
+
if (ids.length === 0) {
|
|
2258
|
+
// Clear all trimmed rows of this type
|
|
2259
|
+
return this.addTrimmed({}, trimmedType, type);
|
|
2260
|
+
}
|
|
2261
|
+
const source = await this.getSource(type);
|
|
2262
|
+
const currentTrimmed = this.dataProvider.stores[type].store.get('trimmed');
|
|
2263
|
+
const typeTrimmed = currentTrimmed[trimmedType] || {};
|
|
2264
|
+
const newTrimmed = Object.assign({}, typeTrimmed);
|
|
2265
|
+
// Remove specified IDs from trimmed
|
|
2266
|
+
source.forEach((row, index) => {
|
|
2267
|
+
if (ids.includes(row[idField]) && newTrimmed[index]) {
|
|
2268
|
+
delete newTrimmed[index];
|
|
2269
|
+
}
|
|
2270
|
+
});
|
|
2271
|
+
return this.addTrimmed(newTrimmed, trimmedType, type);
|
|
2272
|
+
}
|
|
2273
|
+
/**
|
|
2274
|
+
* Delete rows by ID field value (physically remove from source)
|
|
2275
|
+
* @param ids - Array of ID values to delete
|
|
2276
|
+
* @param idField - ID field name, default 'id'
|
|
2277
|
+
* @param type - Row type, default 'rgRow'
|
|
2278
|
+
* @returns New source array after deletion
|
|
2279
|
+
*/
|
|
2280
|
+
async deleteRowsById(ids, idField = 'id', type = 'rgRow') {
|
|
2281
|
+
if (!this.dataProvider) {
|
|
2282
|
+
throw new Error('Not connected');
|
|
2283
|
+
}
|
|
2284
|
+
const source = await this.getSource(type);
|
|
2285
|
+
const newSource = source.filter((row) => !ids.includes(row[idField]));
|
|
2286
|
+
// Update the appropriate source property
|
|
2287
|
+
switch (type) {
|
|
2288
|
+
case 'rgRow':
|
|
2289
|
+
this.source = newSource;
|
|
2290
|
+
break;
|
|
2291
|
+
case 'rowPinStart':
|
|
2292
|
+
this.pinnedTopSource = newSource;
|
|
2293
|
+
break;
|
|
2294
|
+
case 'rowPinEnd':
|
|
2295
|
+
this.pinnedBottomSource = newSource;
|
|
2296
|
+
break;
|
|
2297
|
+
}
|
|
2298
|
+
return newSource;
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Delete rows by physical indexes
|
|
2302
|
+
* @param indexes - Array of physical row indexes to delete
|
|
2303
|
+
* @param type - Row type, default 'rgRow'
|
|
2304
|
+
* @returns New source array after deletion
|
|
2305
|
+
*/
|
|
2306
|
+
async deleteRowsByIndexes(indexes, type = 'rgRow') {
|
|
2307
|
+
if (!this.dataProvider) {
|
|
2308
|
+
throw new Error('Not connected');
|
|
2309
|
+
}
|
|
2310
|
+
const source = await this.getSource(type);
|
|
2311
|
+
const indexSet = new Set(indexes);
|
|
2312
|
+
const newSource = source.filter((_, index) => !indexSet.has(index));
|
|
2313
|
+
// Update the appropriate source property
|
|
2314
|
+
switch (type) {
|
|
2315
|
+
case 'rgRow':
|
|
2316
|
+
this.source = newSource;
|
|
2317
|
+
break;
|
|
2318
|
+
case 'rowPinStart':
|
|
2319
|
+
this.pinnedTopSource = newSource;
|
|
2320
|
+
break;
|
|
2321
|
+
case 'rowPinEnd':
|
|
2322
|
+
this.pinnedBottomSource = newSource;
|
|
2323
|
+
break;
|
|
2324
|
+
}
|
|
2325
|
+
return newSource;
|
|
2326
|
+
}
|
|
2327
|
+
mousedownHandle(event) {
|
|
2328
|
+
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
2329
|
+
const screenY = getPropertyFromEvent(event, 'screenY');
|
|
2330
|
+
if (screenX === null || screenY === null) {
|
|
2331
|
+
return;
|
|
2332
|
+
}
|
|
2333
|
+
this.clickTrackForFocusClear = screenX + screenY;
|
|
2334
|
+
}
|
|
2335
|
+
/**
|
|
2336
|
+
* To keep your elements from losing focus use mouseup/touchend e.preventDefault();
|
|
2337
|
+
*/
|
|
2338
|
+
async mouseupHandle(event) {
|
|
2339
|
+
var _a;
|
|
2340
|
+
const screenX = getPropertyFromEvent(event, 'screenX');
|
|
2341
|
+
const screenY = getPropertyFromEvent(event, 'screenY');
|
|
2342
|
+
if (screenX === null || screenY === null) {
|
|
2343
|
+
return;
|
|
2344
|
+
}
|
|
2345
|
+
if (event.defaultPrevented) {
|
|
2346
|
+
return;
|
|
2347
|
+
}
|
|
2348
|
+
const pos = screenX + screenY;
|
|
2349
|
+
// detect if mousemove then do nothing
|
|
2350
|
+
if (Math.abs(((_a = this.clickTrackForFocusClear) !== null && _a !== void 0 ? _a : 0) - pos) > 10) {
|
|
2351
|
+
return;
|
|
2352
|
+
}
|
|
2353
|
+
// Check if action finished inside the document
|
|
2354
|
+
// if event prevented, or it is current table don't clear focus
|
|
2355
|
+
const path = event.composedPath();
|
|
2356
|
+
if (!path.includes(this.element) &&
|
|
2357
|
+
!(this.element.shadowRoot && path.includes(this.element.shadowRoot))) {
|
|
2358
|
+
// Perform actions if the click is outside the component
|
|
2359
|
+
await this.clearFocus();
|
|
2360
|
+
}
|
|
2361
|
+
}
|
|
2362
|
+
// #endregion
|
|
2363
|
+
// #region Listeners
|
|
2364
|
+
/** Drag events */
|
|
2365
|
+
onRowDragStarted(e) {
|
|
2366
|
+
var _a;
|
|
2367
|
+
const dragStart = this.rowdragstart.emit(e.detail);
|
|
2368
|
+
if (dragStart.defaultPrevented) {
|
|
2369
|
+
e.preventDefault();
|
|
2370
|
+
return;
|
|
2371
|
+
}
|
|
2372
|
+
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.start(this.element, Object.assign(Object.assign({}, e.detail), dragStart.detail));
|
|
2373
|
+
}
|
|
2374
|
+
onRowDragEnd() {
|
|
2375
|
+
var _a;
|
|
2376
|
+
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.end();
|
|
2377
|
+
}
|
|
2378
|
+
onRowOrderChange(e) {
|
|
2379
|
+
var _a;
|
|
2380
|
+
(_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.changeOrder(e.detail);
|
|
2381
|
+
}
|
|
2382
|
+
onRowDrag({ detail }) {
|
|
2383
|
+
var _a;
|
|
2384
|
+
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.move(detail);
|
|
2385
|
+
}
|
|
2386
|
+
onRowMouseMove(e) {
|
|
2387
|
+
var _a;
|
|
2388
|
+
(_a = this.orderService) === null || _a === void 0 ? void 0 : _a.moveTip(e.detail);
|
|
2389
|
+
}
|
|
2390
|
+
async onCellEdit(e) {
|
|
2391
|
+
var _a;
|
|
2392
|
+
const { defaultPrevented, detail } = this.beforeedit.emit(e.detail);
|
|
2393
|
+
await timeout();
|
|
2394
|
+
// apply data
|
|
2395
|
+
if (!defaultPrevented) {
|
|
2396
|
+
(_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.setCellData(detail);
|
|
2397
|
+
// @feature: incrimental update for cells
|
|
2398
|
+
// this.dataProvider.setCellData(detail, false);
|
|
2399
|
+
// await this.setDataAt({
|
|
2400
|
+
// row: detail.rowIndex,
|
|
2401
|
+
// col: detail.colIndex,
|
|
2402
|
+
// rowType: detail.type,
|
|
2403
|
+
// colType: detail.colType,
|
|
2404
|
+
// });
|
|
2405
|
+
this.afteredit.emit(detail);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
onRangeEdit(e) {
|
|
2409
|
+
if (!this.dataProvider) {
|
|
2410
|
+
throw new Error('Not connected');
|
|
2411
|
+
}
|
|
2412
|
+
const { defaultPrevented, detail } = this.beforerangeedit.emit(e.detail);
|
|
2413
|
+
if (defaultPrevented) {
|
|
2414
|
+
e.preventDefault();
|
|
2415
|
+
return;
|
|
2416
|
+
}
|
|
2417
|
+
this.dataProvider.setRangeData(detail.data, detail.type);
|
|
2418
|
+
this.afteredit.emit(detail);
|
|
2419
|
+
}
|
|
2420
|
+
onRangeChanged(e) {
|
|
2421
|
+
const beforeange = this.beforerange.emit(e.detail);
|
|
2422
|
+
if (beforeange.defaultPrevented) {
|
|
2423
|
+
e.preventDefault();
|
|
2424
|
+
}
|
|
2425
|
+
const beforeFill = this.beforeautofill.emit(beforeange.detail);
|
|
2426
|
+
if (beforeFill.defaultPrevented) {
|
|
2427
|
+
e.preventDefault();
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
onRowDropped(e) {
|
|
2431
|
+
// e.cancelBubble = true;
|
|
2432
|
+
const { defaultPrevented } = this.roworderchanged.emit(e.detail);
|
|
2433
|
+
if (defaultPrevented) {
|
|
2434
|
+
e.preventDefault();
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
onHeaderClick(e) {
|
|
2438
|
+
const { defaultPrevented } = this.headerclick.emit(Object.assign(Object.assign({}, e.detail.column), { originalEvent: e.detail.originalEvent }));
|
|
2439
|
+
if (defaultPrevented) {
|
|
2440
|
+
e.preventDefault();
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
onCellFocus(e) {
|
|
2444
|
+
const { defaultPrevented } = this.beforecellfocus.emit(e.detail);
|
|
2445
|
+
if (!this.canFocus || defaultPrevented) {
|
|
2446
|
+
e.preventDefault();
|
|
2447
|
+
}
|
|
2448
|
+
}
|
|
2449
|
+
onCellClick(e) {
|
|
2450
|
+
this.cellclick.emit(e.detail);
|
|
2451
|
+
}
|
|
2452
|
+
// #endregion
|
|
2453
|
+
// #region Watchers
|
|
2454
|
+
columnTypesChanged() {
|
|
2455
|
+
// Column format change will trigger column structure update
|
|
2456
|
+
this.columnChanged(this.columns);
|
|
2457
|
+
}
|
|
2458
|
+
columnChanged(newVal = [], _prevVal = undefined, __watchName = 'columns', init = false) {
|
|
2459
|
+
if (!this.dimensionProvider || !this.columnProvider || (newVal === null || newVal === void 0 ? void 0 : newVal.length) < 1) {
|
|
2460
|
+
return;
|
|
2461
|
+
}
|
|
2462
|
+
const updateToken = ++this.columnsUpdateToken;
|
|
2463
|
+
this.element.setAttribute('data-columns-updating', String(updateToken));
|
|
2464
|
+
// console.log('[columns] update start', {
|
|
2465
|
+
// token: updateToken,
|
|
2466
|
+
// init,
|
|
2467
|
+
// time: performance.now(),
|
|
2468
|
+
// });
|
|
2469
|
+
const columnGather = getColumns(newVal, 0, this.columnTypes);
|
|
2470
|
+
// console.log('[columns] update snapshot', {
|
|
2471
|
+
// token: updateToken,
|
|
2472
|
+
// init,
|
|
2473
|
+
// counts: {
|
|
2474
|
+
// colPinStart: columnGather.columns.colPinStart.length,
|
|
2475
|
+
// rgCol: columnGather.columns.rgCol.length,
|
|
2476
|
+
// colPinEnd: columnGather.columns.colPinEnd.length,
|
|
2477
|
+
// },
|
|
2478
|
+
// time: performance.now(),
|
|
2479
|
+
// });
|
|
2480
|
+
const beforeSetEvent = this.beforecolumnsset.emit(columnGather);
|
|
2481
|
+
if (beforeSetEvent.defaultPrevented) {
|
|
2482
|
+
console.log('[columns] update prevented beforeSet', {
|
|
2483
|
+
token: updateToken,
|
|
2484
|
+
time: performance.now(),
|
|
2485
|
+
});
|
|
2486
|
+
this.finishColumnsUpdate(updateToken);
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
const version = ++this.columnsVersion;
|
|
2490
|
+
// 在应用新列之前,先设置表格总宽度
|
|
2491
|
+
this.dimensionProvider.setGridTotalWidth(this.element.clientWidth);
|
|
2492
|
+
// 同步更新所有 viewport 的数据
|
|
2493
|
+
this.dimensionProvider.applyNewColumns(beforeSetEvent.detail.columns, this.disableVirtualX, init, version);
|
|
2494
|
+
const beforeApplyEvent = this.beforecolumnapplied.emit(columnGather);
|
|
2495
|
+
if (beforeApplyEvent.defaultPrevented) {
|
|
2496
|
+
console.log('[columns] update prevented beforeApply', {
|
|
2497
|
+
token: updateToken,
|
|
2498
|
+
time: performance.now(),
|
|
2499
|
+
});
|
|
2500
|
+
this.finishColumnsUpdate(updateToken);
|
|
2501
|
+
return;
|
|
2502
|
+
}
|
|
2503
|
+
const columns = this.columnProvider.setColumns(beforeApplyEvent.detail, version);
|
|
2504
|
+
this.finishColumnsUpdate(updateToken);
|
|
2505
|
+
this.aftercolumnsset.emit({
|
|
2506
|
+
columns,
|
|
2507
|
+
order: Object.entries(beforeApplyEvent.detail.sort).reduce((acc, [prop, column]) => {
|
|
2508
|
+
acc[prop] = column.order;
|
|
2509
|
+
return acc;
|
|
2510
|
+
}, {}),
|
|
2511
|
+
});
|
|
2512
|
+
}
|
|
2513
|
+
finishColumnsUpdate(token) {
|
|
2514
|
+
requestAnimationFrame(() => {
|
|
2515
|
+
const current = this.element.getAttribute('data-columns-updating');
|
|
2516
|
+
if (current === String(token)) {
|
|
2517
|
+
this.syncMainViewportWidthAfterColumnsUpdate();
|
|
2518
|
+
this.element.removeAttribute('data-columns-updating');
|
|
2519
|
+
this.element.dispatchEvent(new CustomEvent('columnsupdateend', { detail: { token } }));
|
|
2520
|
+
this.columnsUpdateNonce++;
|
|
2521
|
+
console.log('[columns] update end', {
|
|
2522
|
+
token,
|
|
2523
|
+
time: performance.now(),
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
});
|
|
2527
|
+
}
|
|
2528
|
+
/**
|
|
2529
|
+
* Column updates can change pin area width and shrink/grow main viewport.
|
|
2530
|
+
* Re-sync rgCol client/virtual size before releasing columns update lock
|
|
2531
|
+
* to avoid one-frame stale visible-column range.
|
|
2532
|
+
*/
|
|
2533
|
+
syncMainViewportWidthAfterColumnsUpdate() {
|
|
2534
|
+
if (!this.viewportProvider || !this.dimensionProvider) {
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
const mainViewport = this.element.querySelector('revogr-viewport-scroll.rgCol');
|
|
2538
|
+
if (!(mainViewport instanceof HTMLElement)) {
|
|
2539
|
+
return;
|
|
2540
|
+
}
|
|
2541
|
+
const nextClientSize = mainViewport.clientWidth;
|
|
2542
|
+
if (!nextClientSize) {
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2545
|
+
const rgColViewport = this.viewportProvider.stores.rgCol.store;
|
|
2546
|
+
const patch = {};
|
|
2547
|
+
const currentClientSize = rgColViewport.get('clientSize');
|
|
2548
|
+
if (currentClientSize !== nextClientSize) {
|
|
2549
|
+
patch.clientSize = nextClientSize;
|
|
2550
|
+
}
|
|
2551
|
+
if (!this.disableVirtualX) {
|
|
2552
|
+
const currentVirtualSize = rgColViewport.get('virtualSize');
|
|
2553
|
+
if (currentVirtualSize !== nextClientSize) {
|
|
2554
|
+
patch.virtualSize = nextClientSize;
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
if (Object.keys(patch).length > 0) {
|
|
2558
|
+
this.viewportProvider.setViewport('rgCol', patch, { preserveItems: true });
|
|
2559
|
+
}
|
|
2560
|
+
this.dimensionProvider.setViewPortCoordinate({
|
|
2561
|
+
type: 'rgCol',
|
|
2562
|
+
force: true,
|
|
2563
|
+
});
|
|
2564
|
+
}
|
|
2565
|
+
finishDataUpdate(token) {
|
|
2566
|
+
requestAnimationFrame(() => {
|
|
2567
|
+
const current = this.element.getAttribute('data-rows-updating');
|
|
2568
|
+
if (current === String(token)) {
|
|
2569
|
+
this.element.removeAttribute('data-rows-updating');
|
|
2570
|
+
this.element.dispatchEvent(new CustomEvent('dataupdateend', { detail: { token } }));
|
|
2571
|
+
}
|
|
2572
|
+
});
|
|
2573
|
+
}
|
|
2574
|
+
disableVirtualXChanged(newVal = false, prevVal = false) {
|
|
2575
|
+
if (newVal === prevVal) {
|
|
2576
|
+
return;
|
|
2577
|
+
}
|
|
2578
|
+
this.columnChanged(this.columns);
|
|
2579
|
+
}
|
|
2580
|
+
rowSizeChanged(s) {
|
|
2581
|
+
if (!this.dimensionProvider) {
|
|
2582
|
+
return;
|
|
2583
|
+
}
|
|
2584
|
+
// clear existing data
|
|
2585
|
+
this.dimensionProvider.setSettings({ originItemSize: s }, 'rgRow');
|
|
2586
|
+
this.rowDefChanged(this.rowDefinitions, this.rowDefinitions, 'rowSize', true);
|
|
2587
|
+
}
|
|
2588
|
+
themeChanged(t, _, __ = 'theme', init = false) {
|
|
2589
|
+
if (!this.dimensionProvider) {
|
|
2590
|
+
return;
|
|
2591
|
+
}
|
|
2592
|
+
this.themeService.register(t);
|
|
2593
|
+
this.dimensionProvider.setSettings({ originItemSize: this.themeService.rowSize }, 'rgRow');
|
|
2594
|
+
this.dimensionProvider.setSettings({ originItemSize: this.colSize }, 'rgCol');
|
|
2595
|
+
// if theme change we need to reapply row size and reset viewport
|
|
2596
|
+
if (!init) {
|
|
2597
|
+
// clear existing data
|
|
2598
|
+
this.dimensionProvider.setSettings({ originItemSize: this.themeService.rowSize }, 'rgRow');
|
|
2599
|
+
this.rowDefChanged(
|
|
2600
|
+
// for cases when some custom size present and not
|
|
2601
|
+
this.rowDefinitions, this.rowDefinitions, 'theme', true);
|
|
2602
|
+
}
|
|
2603
|
+
this.afterthemechanged.emit(t);
|
|
2604
|
+
}
|
|
2605
|
+
dataSourceChanged(newVal = [], _, watchName) {
|
|
2606
|
+
if (!this.dataProvider) {
|
|
2607
|
+
return;
|
|
2608
|
+
}
|
|
2609
|
+
const dataToken = ++this.dataUpdateToken;
|
|
2610
|
+
this.element.setAttribute('data-rows-updating', String(dataToken));
|
|
2611
|
+
// 标记正在进行外部数据源更新(用于 grouping-overlay 区分更新来源)
|
|
2612
|
+
if (watchName === 'source') {
|
|
2613
|
+
this.element.setAttribute('data-source-updating', '');
|
|
2614
|
+
// 收集所有区域的渲染完成事件
|
|
2615
|
+
const renderedAreas = new Set();
|
|
2616
|
+
const checkAllRendered = (e) => {
|
|
2617
|
+
var _a, _b, _c;
|
|
2618
|
+
const detail = e.detail;
|
|
2619
|
+
const { type, colType } = detail;
|
|
2620
|
+
// 收集所有区域的渲染(包括不同的 colType)
|
|
2621
|
+
const areaKey = `${type}-${colType}`;
|
|
2622
|
+
renderedAreas.add(areaKey);
|
|
2623
|
+
// 检查是否所有主要区域都已渲染
|
|
2624
|
+
// 至少需要主数据区域的 rgRow 渲染完成(任意 colType)
|
|
2625
|
+
const hasMainData = renderedAreas.has('rgRow-rgCol') ||
|
|
2626
|
+
renderedAreas.has('rgRow-colPinStart') ||
|
|
2627
|
+
renderedAreas.has('rgRow-colPinEnd');
|
|
2628
|
+
// 如果有固定列,也需要等待它们渲染完成
|
|
2629
|
+
const hasLeftPin = renderedAreas.has('rgRow-colPinStart') ||
|
|
2630
|
+
renderedAreas.has('rowPinStart-colPinStart');
|
|
2631
|
+
const hasRightPin = renderedAreas.has('rgRow-colPinEnd') ||
|
|
2632
|
+
renderedAreas.has('rowPinStart-colPinEnd');
|
|
2633
|
+
// 判断是否所有区域都已渲染完成
|
|
2634
|
+
// 主数据区必须渲染,固定列如果存在也必须渲染
|
|
2635
|
+
if (hasMainData) {
|
|
2636
|
+
// 检查是否有固定列配置
|
|
2637
|
+
const hasLeftPinConfig = (_a = this.columns) === null || _a === void 0 ? void 0 : _a.some((col) => col.pin === 'colPinStart');
|
|
2638
|
+
const hasRightPinConfig = (_b = this.columns) === null || _b === void 0 ? void 0 : _b.some((col) => col.pin === 'colPinEnd');
|
|
2639
|
+
const hasNormalCol = (_c = this.columns) === null || _c === void 0 ? void 0 : _c.some((col) => !col.pin);
|
|
2640
|
+
// 如果配置了固定列,必须等待固定列也渲染完成
|
|
2641
|
+
const leftPinReady = !hasLeftPinConfig || hasLeftPin;
|
|
2642
|
+
const rightPinReady = !hasRightPinConfig || hasRightPin;
|
|
2643
|
+
const normalColReady = !hasNormalCol || renderedAreas.has('rgRow-rgCol');
|
|
2644
|
+
if (leftPinReady && rightPinReady && normalColReady) {
|
|
2645
|
+
// 移除标记和监听器
|
|
2646
|
+
this.element.removeAttribute('data-source-updating');
|
|
2647
|
+
this.element.removeEventListener('afterrender', checkAllRendered);
|
|
2648
|
+
/**
|
|
2649
|
+
* 每一帧检查 数据是否渲染
|
|
2650
|
+
* 1. 先检查是否有非冻结列,如果没有就检查左侧冻结,再如果检查右侧冻结;通过 this.columnProvider?.collection?.columns 下的 rgCol|colPinStart|colPinEnd 长度
|
|
2651
|
+
* 2. 如果有非冻结表格,就只检查 this.viewportProvider.stores?.rgCol?.store 的 items 长度
|
|
2652
|
+
* 3. 如果没有非冻结表格,就检查 colPinStart或colPinEnd 的items 长度
|
|
2653
|
+
* 4. itemsCount > 0 就表示已经渲染
|
|
2654
|
+
*/
|
|
2655
|
+
const checkColumns = () => {
|
|
2656
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
2657
|
+
let visibleItemsCount = 0;
|
|
2658
|
+
// 检查是否有非冻结列
|
|
2659
|
+
const hasRgCol = (((_d = (_c = (_b = (_a = this.columnProvider) === null || _a === void 0 ? void 0 : _a.collection) === null || _b === void 0 ? void 0 : _b.columns) === null || _c === void 0 ? void 0 : _c.rgCol) === null || _d === void 0 ? void 0 : _d.length) || 0) > 0;
|
|
2660
|
+
const hasColPinStart = (((_h = (_g = (_f = (_e = this.columnProvider) === null || _e === void 0 ? void 0 : _e.collection) === null || _f === void 0 ? void 0 : _f.columns) === null || _g === void 0 ? void 0 : _g.colPinStart) === null || _h === void 0 ? void 0 : _h.length) || 0) > 0;
|
|
2661
|
+
const hasColPinEnd = (((_m = (_l = (_k = (_j = this.columnProvider) === null || _j === void 0 ? void 0 : _j.collection) === null || _k === void 0 ? void 0 : _k.columns) === null || _l === void 0 ? void 0 : _l.colPinEnd) === null || _m === void 0 ? void 0 : _m.length) || 0) > 0;
|
|
2662
|
+
if (this.viewportProvider) {
|
|
2663
|
+
if (hasRgCol) {
|
|
2664
|
+
// 如果有非冻结列,只检查 rgCol 的 items
|
|
2665
|
+
const rgColVpStore = (_p = (_o = this.viewportProvider.stores) === null || _o === void 0 ? void 0 : _o.rgCol) === null || _p === void 0 ? void 0 : _p.store;
|
|
2666
|
+
if (rgColVpStore) {
|
|
2667
|
+
visibleItemsCount = ((_q = rgColVpStore.get('items')) === null || _q === void 0 ? void 0 : _q.length) || 0;
|
|
2668
|
+
// 如果为0,从DOM中获取子元素数量
|
|
2669
|
+
if (visibleItemsCount === 0) {
|
|
2670
|
+
const revogrData = this.element.querySelector('.revogr-viewport-scroll.rgCol .vertical-inner revogr-data');
|
|
2671
|
+
if (revogrData) {
|
|
2672
|
+
visibleItemsCount = revogrData.children.length;
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
else {
|
|
2678
|
+
// 如果没有非冻结列,检查冻结列:优先 colPinStart,然后 colPinEnd
|
|
2679
|
+
if (hasColPinStart) {
|
|
2680
|
+
const colPinStartVpStore = (_s = (_r = this.viewportProvider.stores) === null || _r === void 0 ? void 0 : _r.colPinStart) === null || _s === void 0 ? void 0 : _s.store;
|
|
2681
|
+
if (colPinStartVpStore) {
|
|
2682
|
+
visibleItemsCount = ((_t = colPinStartVpStore.get('items')) === null || _t === void 0 ? void 0 : _t.length) || 0;
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
// 如果 colPinStart 没有数据,继续检查 colPinEnd
|
|
2686
|
+
if (visibleItemsCount === 0 && hasColPinEnd) {
|
|
2687
|
+
const colPinEndVpStore = (_v = (_u = this.viewportProvider.stores) === null || _u === void 0 ? void 0 : _u.colPinEnd) === null || _v === void 0 ? void 0 : _v.store;
|
|
2688
|
+
if (colPinEndVpStore) {
|
|
2689
|
+
visibleItemsCount = ((_w = colPinEndVpStore.get('items')) === null || _w === void 0 ? void 0 : _w.length) || 0;
|
|
2690
|
+
}
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
if (visibleItemsCount > 0) {
|
|
2695
|
+
requestAnimationFrame(this.afterdatarendered.emit);
|
|
2696
|
+
}
|
|
2697
|
+
else {
|
|
2698
|
+
requestAnimationFrame(checkColumns);
|
|
2699
|
+
}
|
|
2700
|
+
};
|
|
2701
|
+
// 在这里
|
|
2702
|
+
requestAnimationFrame(checkColumns);
|
|
2703
|
+
// 设置1秒超时,如果1秒后还没有完成渲染,直接emit
|
|
2704
|
+
setTimeout(() => {
|
|
2705
|
+
this.afterdatarendered.emit();
|
|
2706
|
+
}, 1000);
|
|
2707
|
+
}
|
|
2708
|
+
}
|
|
2709
|
+
};
|
|
2710
|
+
this.element.addEventListener('afterrender', checkAllRendered);
|
|
2711
|
+
}
|
|
2712
|
+
let type = 'rgRow';
|
|
2713
|
+
switch (watchName) {
|
|
2714
|
+
case 'pinnedBottomSource':
|
|
2715
|
+
type = 'rowPinEnd';
|
|
2716
|
+
break;
|
|
2717
|
+
case 'pinnedTopSource':
|
|
2718
|
+
type = 'rowPinStart';
|
|
2719
|
+
break;
|
|
2720
|
+
case 'source':
|
|
2721
|
+
type = 'rgRow';
|
|
2722
|
+
// Update isSourceEmpty state to trigger re-render
|
|
2723
|
+
this.isSourceEmpty = !newVal || newVal.length === 0;
|
|
2724
|
+
/**
|
|
2725
|
+
* Applied for source only for cross compatability between plugins
|
|
2726
|
+
*/
|
|
2727
|
+
const beforesourceset = this.beforesourceset.emit({
|
|
2728
|
+
type,
|
|
2729
|
+
source: newVal,
|
|
2730
|
+
});
|
|
2731
|
+
newVal = beforesourceset.detail.source;
|
|
2732
|
+
break;
|
|
2733
|
+
}
|
|
2734
|
+
const beforesourceset = this.beforeanysource.emit({
|
|
2735
|
+
type,
|
|
2736
|
+
source: newVal,
|
|
2737
|
+
});
|
|
2738
|
+
const newSource = [...beforesourceset.detail.source];
|
|
2739
|
+
this.dataProvider.setData(newSource, type, this.disableVirtualY);
|
|
2740
|
+
/**
|
|
2741
|
+
* Applied for source only for cross compatability between plugins
|
|
2742
|
+
*/
|
|
2743
|
+
if (watchName === 'source') {
|
|
2744
|
+
this.aftersourceset.emit({
|
|
2745
|
+
type,
|
|
2746
|
+
source: newVal,
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
this.afteranysource.emit({
|
|
2750
|
+
type,
|
|
2751
|
+
source: newVal,
|
|
2752
|
+
});
|
|
2753
|
+
this.finishDataUpdate(dataToken);
|
|
2754
|
+
}
|
|
2755
|
+
disableVirtualYChanged(newVal = false, prevVal = false) {
|
|
2756
|
+
if (newVal === prevVal) {
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
this.dataSourceChanged(this.source, this.source, 'source');
|
|
2760
|
+
}
|
|
2761
|
+
rowDefChanged(after, before, _watchName, forceUpdate = true) {
|
|
2762
|
+
// in firefox it's triggered before init
|
|
2763
|
+
if (!this.dimensionProvider || !this.dataProvider) {
|
|
2764
|
+
return;
|
|
2765
|
+
}
|
|
2766
|
+
const { detail: { vals: newVal, oldVals: oldVal }, } = this.beforerowdefinition.emit({
|
|
2767
|
+
vals: after,
|
|
2768
|
+
oldVals: before,
|
|
2769
|
+
});
|
|
2770
|
+
// apply new values
|
|
2771
|
+
const newRows = rowDefinitionByType(newVal);
|
|
2772
|
+
// clear current defs
|
|
2773
|
+
if (oldVal) {
|
|
2774
|
+
const remove = rowDefinitionRemoveByType(oldVal);
|
|
2775
|
+
// clear all old data and drop sizes
|
|
2776
|
+
for (const t in remove) {
|
|
2777
|
+
if (remove.hasOwnProperty(t)) {
|
|
2778
|
+
const type = t;
|
|
2779
|
+
const store = this.dataProvider.stores[type];
|
|
2780
|
+
const sourceLength = store.store.get('source').length;
|
|
2781
|
+
this.dimensionProvider.clearSize(type, sourceLength);
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
// set new sizes
|
|
2786
|
+
rowTypes.forEach((t) => {
|
|
2787
|
+
var _a;
|
|
2788
|
+
const newSizes = newRows[t];
|
|
2789
|
+
// apply new sizes or force update
|
|
2790
|
+
if (newSizes || forceUpdate) {
|
|
2791
|
+
(_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setCustomSizes(t, (newSizes === null || newSizes === void 0 ? void 0 : newSizes.sizes) || {});
|
|
2792
|
+
}
|
|
2793
|
+
});
|
|
2794
|
+
}
|
|
2795
|
+
trimmedRowsChanged(newVal = {}) {
|
|
2796
|
+
this.addTrimmed(newVal);
|
|
2797
|
+
}
|
|
2798
|
+
/**
|
|
2799
|
+
* Grouping
|
|
2800
|
+
*/
|
|
2801
|
+
groupingChanged(newVal = {}) {
|
|
2802
|
+
var _a;
|
|
2803
|
+
(_a = this.pluginService.getByClass(GroupingRowPlugin)) === null || _a === void 0 ? void 0 : _a.setGrouping(newVal || {});
|
|
2804
|
+
this._hasGrouping = !!(newVal && Object.keys(newVal).length > 0);
|
|
2805
|
+
}
|
|
2806
|
+
get _hasGrouping() { return this._hasGroupingValue; }
|
|
2807
|
+
set _hasGrouping(val) { this._hasGroupingValue = val; }
|
|
2808
|
+
/**
|
|
2809
|
+
* Stretch Plugin Apply
|
|
2810
|
+
*/
|
|
2811
|
+
applyStretch(isStretch) {
|
|
2812
|
+
if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider) {
|
|
2813
|
+
return;
|
|
2814
|
+
}
|
|
2815
|
+
if (isStretch === 'false') {
|
|
2816
|
+
isStretch = false;
|
|
2817
|
+
}
|
|
2818
|
+
const pluginData = this.getPluginData();
|
|
2819
|
+
if (!pluginData) {
|
|
2820
|
+
return;
|
|
2821
|
+
}
|
|
2822
|
+
const stretch = this.pluginService.getByClass(StretchColumn);
|
|
2823
|
+
if ((typeof isStretch === 'boolean' && isStretch) || isStretch === 'true') {
|
|
2824
|
+
if (!stretch) {
|
|
2825
|
+
this.pluginService.add(new StretchColumn(this.element, pluginData));
|
|
2826
|
+
}
|
|
2827
|
+
else if (isStretchPlugin(stretch)) {
|
|
2828
|
+
stretch.applyStretch(this.columnProvider.getRawColumns());
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
else if (stretch) {
|
|
2832
|
+
this.pluginService.remove(stretch);
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
applyFilter(cfg) {
|
|
2836
|
+
this.filterconfigchanged.emit(cfg);
|
|
2837
|
+
}
|
|
2838
|
+
applySorting(cfg) {
|
|
2839
|
+
this.sortingconfigchanged.emit(cfg);
|
|
2840
|
+
}
|
|
2841
|
+
rowHeadersChange(rowHeaders) {
|
|
2842
|
+
this.rowheaderschanged.emit(rowHeaders);
|
|
2843
|
+
}
|
|
2844
|
+
/**
|
|
2845
|
+
* Register external VNodes
|
|
2846
|
+
*/
|
|
2847
|
+
registerOutsideVNodes(elements = []) {
|
|
2848
|
+
this.extraElements = elements;
|
|
2849
|
+
}
|
|
2850
|
+
additionalDataChanged(data) {
|
|
2851
|
+
this.additionaldatachanged.emit(data);
|
|
2852
|
+
}
|
|
2853
|
+
/**
|
|
2854
|
+
* Watch for RTL changes and reapply column ordering
|
|
2855
|
+
*/
|
|
2856
|
+
rtlChanged() {
|
|
2857
|
+
// The RTL plugin will handle the transformation automatically
|
|
2858
|
+
// Just trigger a column refresh to ensure the plugin processes the change
|
|
2859
|
+
this.columnChanged(this.columns);
|
|
2860
|
+
}
|
|
2861
|
+
/**
|
|
2862
|
+
* User can add plugins via plugins property
|
|
2863
|
+
*/
|
|
2864
|
+
pluginsChanged(plugins = [], prevPlugins) {
|
|
2865
|
+
this.pluginService.addUserPluginsAndCreate(this.element, plugins, prevPlugins, this.getPluginData());
|
|
2866
|
+
}
|
|
2867
|
+
// #endregion
|
|
2868
|
+
// #region Plugins
|
|
2869
|
+
setPlugins() {
|
|
2870
|
+
// remove old plugins if any
|
|
2871
|
+
this.removePlugins();
|
|
2872
|
+
// pass data provider to plugins
|
|
2873
|
+
const pluginData = this.getPluginData();
|
|
2874
|
+
if (!pluginData) {
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
// register system plugins
|
|
2878
|
+
this.setCorePlugins(pluginData);
|
|
2879
|
+
// register user plugins
|
|
2880
|
+
this.pluginsChanged(this.plugins);
|
|
2881
|
+
}
|
|
2882
|
+
setCorePlugins(pluginData) {
|
|
2883
|
+
if (this.accessible) {
|
|
2884
|
+
this.pluginService.add(new WCAGPlugin(this.element, pluginData));
|
|
2885
|
+
}
|
|
2886
|
+
// register RTL plugin
|
|
2887
|
+
this.pluginService.add(new RTLPlugin(this.element, pluginData));
|
|
2888
|
+
// register auto size plugin
|
|
2889
|
+
// 延迟创建:在 aftergridrender 事件中创建,确保所有属性都已设置
|
|
2890
|
+
const createAutoSizePlugin = () => {
|
|
2891
|
+
var _a;
|
|
2892
|
+
const config = ((_a = this.additionalData) === null || _a === void 0 ? void 0 : _a.autoSizeColumn) || this.autoSizeColumn;
|
|
2893
|
+
if (config && !this.pluginService.getByClass(AutoSizeColumnPlugin)) {
|
|
2894
|
+
this.pluginService.add(new AutoSizeColumnPlugin(this.element, pluginData, typeof config === 'object' ? config : undefined));
|
|
2895
|
+
}
|
|
2896
|
+
};
|
|
2897
|
+
this.element.addEventListener('aftergridrender', createAutoSizePlugin, { once: true });
|
|
2898
|
+
// register filter plugin
|
|
2899
|
+
if (this.filter) {
|
|
2900
|
+
this.pluginService.add(new FilterPlugin(this.element, pluginData, typeof this.filter === 'object' ? this.filter : undefined));
|
|
2901
|
+
}
|
|
2902
|
+
// register export plugin
|
|
2903
|
+
if (this.exporting) {
|
|
2904
|
+
this.pluginService.add(new ExportFilePlugin(this.element, pluginData));
|
|
2905
|
+
}
|
|
2906
|
+
// register sorting plugin
|
|
2907
|
+
this.pluginService.add(new SortingPlugin(this.element, pluginData));
|
|
2908
|
+
// register grouping plugin
|
|
2909
|
+
this.pluginService.add(new GroupingRowPlugin(this.element, pluginData));
|
|
2910
|
+
if (this.canMoveColumns) {
|
|
2911
|
+
this.pluginService.add(new ColumnMovePlugin(this.element, pluginData));
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
getPluginData() {
|
|
2915
|
+
if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {
|
|
2916
|
+
return;
|
|
2917
|
+
}
|
|
2918
|
+
// pass data provider to plugins
|
|
2919
|
+
const pluginData = {
|
|
2920
|
+
data: this.dataProvider,
|
|
2921
|
+
column: this.columnProvider,
|
|
2922
|
+
dimension: this.dimensionProvider,
|
|
2923
|
+
viewport: this.viewportProvider,
|
|
2924
|
+
selection: this.selectionStoreConnector,
|
|
2925
|
+
plugins: this.pluginService,
|
|
2926
|
+
};
|
|
2927
|
+
return pluginData;
|
|
2928
|
+
}
|
|
2929
|
+
removePlugins() {
|
|
2930
|
+
this.pluginService.destroy();
|
|
2931
|
+
}
|
|
2932
|
+
// #endregion
|
|
2933
|
+
// if reconnect to dom we need to set up plugins
|
|
2934
|
+
connectedCallback() {
|
|
2935
|
+
if (this.isInited) {
|
|
2936
|
+
this.setPlugins();
|
|
2937
|
+
}
|
|
2938
|
+
this.created.emit();
|
|
2939
|
+
}
|
|
2940
|
+
/**
|
|
2941
|
+
* Called once just after the component is first connected to the DOM.
|
|
2942
|
+
* Since this method is only called once, it's a good place to load data asynchronously and to setup the state
|
|
2943
|
+
* without triggering extra re-renders.
|
|
2944
|
+
* A promise can be returned, that can be used to wait for the first render().
|
|
2945
|
+
*/
|
|
2946
|
+
componentWillLoad() {
|
|
2947
|
+
var _a;
|
|
2948
|
+
// Initialize isSourceEmpty state
|
|
2949
|
+
this.isSourceEmpty = !this.source || this.source.length === 0;
|
|
2950
|
+
// #region Setup Providers
|
|
2951
|
+
this.viewportProvider = new ViewportProvider();
|
|
2952
|
+
this.themeService = new ThemeService({
|
|
2953
|
+
rowSize: this.rowSize,
|
|
2954
|
+
});
|
|
2955
|
+
this.dimensionProvider = new DimensionProvider(this.viewportProvider, {
|
|
2956
|
+
realSizeChanged: (k) => this.contentsizechanged.emit(k),
|
|
2957
|
+
});
|
|
2958
|
+
this.columnProvider = new ColumnDataProvider();
|
|
2959
|
+
this.selectionStoreConnector = new SelectionStoreConnector();
|
|
2960
|
+
this.dataProvider = new DataProvider(this.dimensionProvider);
|
|
2961
|
+
// #endregion
|
|
2962
|
+
this.registerOutsideVNodes(this.registerVNode);
|
|
2963
|
+
// init plugins
|
|
2964
|
+
this.setPlugins();
|
|
2965
|
+
// set data
|
|
2966
|
+
this.applyStretch(this.stretch);
|
|
2967
|
+
this.themeChanged(this.theme, undefined, undefined, true);
|
|
2968
|
+
this.columnChanged(this.columns, undefined, undefined, true);
|
|
2969
|
+
this.dataSourceChanged(this.source, undefined, 'source');
|
|
2970
|
+
this.dataSourceChanged(this.pinnedTopSource, undefined, 'pinnedTopSource');
|
|
2971
|
+
this.dataSourceChanged(this.pinnedBottomSource, undefined, 'pinnedBottomSource');
|
|
2972
|
+
if (Object.keys((_a = this.trimmedRows) !== null && _a !== void 0 ? _a : {}).length > 0) {
|
|
2973
|
+
this.trimmedRowsChanged(this.trimmedRows);
|
|
2974
|
+
}
|
|
2975
|
+
this.rowDefChanged(this.rowDefinitions);
|
|
2976
|
+
// init grouping
|
|
2977
|
+
if (this.grouping && Object.keys(this.grouping).length > 0) {
|
|
2978
|
+
this.groupingChanged(this.grouping);
|
|
2979
|
+
}
|
|
2980
|
+
// init scrolling service
|
|
2981
|
+
this.scrollingService = new GridScrollingService((e) => {
|
|
2982
|
+
var _a, _b, _c;
|
|
2983
|
+
// Check if scroll is disabled
|
|
2984
|
+
if (this.disableScroll) {
|
|
2985
|
+
return;
|
|
2986
|
+
}
|
|
2987
|
+
if (e.dimension === 'rgCol' && this.disableVirtualX) {
|
|
2988
|
+
(_a = this.dimensionProvider) === null || _a === void 0 ? void 0 : _a.setViewPortCoordinate({
|
|
2989
|
+
coordinate: 0,
|
|
2990
|
+
type: e.dimension,
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
else if (e.dimension === 'rgRow' && this.disableVirtualY) {
|
|
2994
|
+
(_b = this.dimensionProvider) === null || _b === void 0 ? void 0 : _b.setViewPortCoordinate({
|
|
2995
|
+
coordinate: 0,
|
|
2996
|
+
type: e.dimension,
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
else {
|
|
3000
|
+
(_c = this.dimensionProvider) === null || _c === void 0 ? void 0 : _c.setViewPortCoordinate({
|
|
3001
|
+
coordinate: e.coordinate,
|
|
3002
|
+
type: e.dimension,
|
|
3003
|
+
});
|
|
3004
|
+
}
|
|
3005
|
+
this.viewportscroll.emit(e);
|
|
3006
|
+
}, () => this.disableScroll);
|
|
3007
|
+
this.aftergridinit.emit();
|
|
3008
|
+
// set inited flag for connectedCallback
|
|
3009
|
+
this.isInited = true;
|
|
3010
|
+
}
|
|
3011
|
+
componentWillRender() {
|
|
3012
|
+
const event = this.beforegridrender.emit();
|
|
3013
|
+
if (event.defaultPrevented) {
|
|
3014
|
+
return false;
|
|
3015
|
+
}
|
|
3016
|
+
return Promise.all(this.jobsBeforeRender);
|
|
3017
|
+
}
|
|
3018
|
+
componentDidRender() {
|
|
3019
|
+
this.aftergridrender.emit();
|
|
3020
|
+
}
|
|
3021
|
+
render() {
|
|
3022
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
3023
|
+
// Use the state variable isSourceEmpty for reactivity
|
|
3024
|
+
const isSourceEmpty = this.isSourceEmpty;
|
|
3025
|
+
if (!this.dimensionProvider || !this.dataProvider || !this.columnProvider || !this.viewportProvider || !this.selectionStoreConnector) {
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
|
|
3029
|
+
// init viewport service helpers only when needed to avoid layout flash on column updates
|
|
3030
|
+
const shouldRecreateViewport = !this.viewport ||
|
|
3031
|
+
this.viewportContentHeight !== contentHeight ||
|
|
3032
|
+
this.viewportDisableVirtualX !== this.disableVirtualX ||
|
|
3033
|
+
this.viewportDisableVirtualY !== this.disableVirtualY;
|
|
3034
|
+
if (shouldRecreateViewport) {
|
|
3035
|
+
this.viewport = new ViewportService({
|
|
3036
|
+
columnProvider: this.columnProvider,
|
|
3037
|
+
dataProvider: this.dataProvider,
|
|
3038
|
+
dimensionProvider: this.dimensionProvider,
|
|
3039
|
+
viewportProvider: this.viewportProvider,
|
|
3040
|
+
scrollingService: this.scrollingService,
|
|
3041
|
+
orderService: this.orderService,
|
|
3042
|
+
selectionStoreConnector: this.selectionStoreConnector,
|
|
3043
|
+
disableVirtualX: this.disableVirtualX,
|
|
3044
|
+
disableVirtualY: this.disableVirtualY,
|
|
3045
|
+
resize: c => this.aftercolumnresize.emit(c),
|
|
3046
|
+
}, contentHeight);
|
|
3047
|
+
this.viewportContentHeight = contentHeight;
|
|
3048
|
+
this.viewportDisableVirtualX = this.disableVirtualX;
|
|
3049
|
+
this.viewportDisableVirtualY = this.disableVirtualY;
|
|
3050
|
+
}
|
|
3051
|
+
const viewport = this.viewport;
|
|
3052
|
+
if (!viewport) {
|
|
3053
|
+
return;
|
|
3054
|
+
}
|
|
3055
|
+
// #region ViewportSections
|
|
3056
|
+
/**
|
|
3057
|
+
* The code renders a viewport divided into sections.
|
|
3058
|
+
* It starts by rendering the pinned start, data, and pinned end sections.
|
|
3059
|
+
* Within each section, it renders columns along with their headers, pinned top, center data, and pinned bottom.
|
|
3060
|
+
* The code iterates over the columns and their data to generate the view port's HTML structure.
|
|
3061
|
+
*/
|
|
3062
|
+
const viewportSections = [];
|
|
3063
|
+
// Row headers setting
|
|
3064
|
+
if (this.rowHeaders && viewport.columns.length) {
|
|
3065
|
+
const anyView = viewport.columns[0];
|
|
3066
|
+
viewportSections.push(h("revogr-row-headers", { additionalData: this.additionalData, height: contentHeight, rowClass: this.rowClass, resize: this.resize, dataPorts: anyView.dataPorts, headerProp: anyView.headerProp, jobsBeforeRender: this.jobsBeforeRender, rowHeaderColumn: typeof this.rowHeaders === 'object' ? this.rowHeaders : undefined, onScrollview: ({ detail: e }) => this.scrollingService.proxyScroll(e, 'headerRow'), onRef: ({ detail: e }) => this.scrollingService.registerElement(e, 'headerRow') }));
|
|
3067
|
+
}
|
|
3068
|
+
// Viewport section render
|
|
3069
|
+
const isMobile = isMobileDevice();
|
|
3070
|
+
const viewPortHtml = [];
|
|
3071
|
+
// 检查是否有 colPinEnd 列
|
|
3072
|
+
const hasColPinEnd = ((_a = this.columnProvider) === null || _a === void 0 ? void 0 : _a.getColumns('colPinEnd').length) > 0;
|
|
3073
|
+
// 检查是否有主区域列
|
|
3074
|
+
const hasRgCol = ((_b = this.columnProvider) === null || _b === void 0 ? void 0 : _b.getColumns('rgCol').length) > 0;
|
|
3075
|
+
// 一次性读取所有区域的数据并构建 headerAreas,确保数据同步
|
|
3076
|
+
const headerAreas = [];
|
|
3077
|
+
for (let view of viewport.columns) {
|
|
3078
|
+
const colStore = (_e = (_d = (_c = this.columnProvider) === null || _c === void 0 ? void 0 : _c.stores) === null || _d === void 0 ? void 0 : _d[view.type]) === null || _e === void 0 ? void 0 : _e.store;
|
|
3079
|
+
const viewportItems = view.viewportCol.get('items');
|
|
3080
|
+
const colData = this.columnProvider.getColumns(view.type);
|
|
3081
|
+
const dimensionState = (_f = view.headerProp.dimensionCol) === null || _f === void 0 ? void 0 : _f.state;
|
|
3082
|
+
const groups = (_g = colStore === null || colStore === void 0 ? void 0 : colStore.get('groups')) !== null && _g !== void 0 ? _g : view.headerProp.groups;
|
|
3083
|
+
const groupingDepth = (_h = colStore === null || colStore === void 0 ? void 0 : colStore.get('groupingDepth')) !== null && _h !== void 0 ? _h : view.headerProp.groupingDepth;
|
|
3084
|
+
const selectionRange = (_k = (_j = view.columnSelectionStore) === null || _j === void 0 ? void 0 : _j.get('range')) !== null && _k !== void 0 ? _k : null;
|
|
3085
|
+
// 构建表头区域数据
|
|
3086
|
+
headerAreas.push({
|
|
3087
|
+
type: view.type,
|
|
3088
|
+
viewportCol: view.viewportCol,
|
|
3089
|
+
dimensionCol: view.headerProp.dimensionCol,
|
|
3090
|
+
selectionStore: view.columnSelectionStore,
|
|
3091
|
+
viewportItems,
|
|
3092
|
+
dimensionState,
|
|
3093
|
+
selectionRange,
|
|
3094
|
+
groups,
|
|
3095
|
+
groupingDepth,
|
|
3096
|
+
readonly: this.readonly,
|
|
3097
|
+
canResize: this.resize,
|
|
3098
|
+
resizeHandler: view.headerProp.resizeHandler,
|
|
3099
|
+
colData,
|
|
3100
|
+
colVersion: (_m = (_l = this.columnProvider.stores) === null || _l === void 0 ? void 0 : _l[view.type]) === null || _m === void 0 ? void 0 : _m.store.get('version'),
|
|
3101
|
+
columnFilter: !!this.filter,
|
|
3102
|
+
additionalData: this.additionalData,
|
|
3103
|
+
hasColPinEnd,
|
|
3104
|
+
hasRgCol,
|
|
3105
|
+
disableVirtualX: this.disableVirtualX,
|
|
3106
|
+
onHeaderresize: view.headerProp.onHeaderresize,
|
|
3107
|
+
});
|
|
3108
|
+
}
|
|
3109
|
+
// Render viewports column(horizontal sections)
|
|
3110
|
+
for (let view of viewport.columns) {
|
|
3111
|
+
const dimensionState = (_o = view.headerProp.dimensionCol) === null || _o === void 0 ? void 0 : _o.state;
|
|
3112
|
+
const realWidth = (_p = dimensionState === null || dimensionState === void 0 ? void 0 : dimensionState.realSize) !== null && _p !== void 0 ? _p : view.prop.contentWidth;
|
|
3113
|
+
const viewProp = Object.assign(Object.assign({}, view.prop), { contentWidth: realWidth, style: Object.assign(Object.assign({}, view.prop.style), { width: `${realWidth}px` }) });
|
|
3114
|
+
// Column headers - 使用空占位符,实际表头由统一组件渲染
|
|
3115
|
+
const dataViews = [
|
|
3116
|
+
h("div", { class: "header-placeholder", slot: HEADER_SLOT }),
|
|
3117
|
+
];
|
|
3118
|
+
// Render viewport data (vertical sections)
|
|
3119
|
+
view.dataPorts.forEach(data => {
|
|
3120
|
+
var _a, _b;
|
|
3121
|
+
const key = `${data.type}_${view.type}`;
|
|
3122
|
+
const lastCell = {
|
|
3123
|
+
x: view.viewportCol.get('realCount'),
|
|
3124
|
+
y: data.viewportRow.get('realCount'),
|
|
3125
|
+
};
|
|
3126
|
+
const dataView = (h("revogr-overlay-selection", Object.assign({}, data, { lastCell: lastCell, canDrag: this.canDrag && data.canDrag, isMobileDevice: isMobile, onSelectall: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.selectAll(); }, editors: this.editors, readonly: this.readonly, range: this.range, useClipboard: this.useClipboard, applyChangesOnClose: this.applyOnClose, additionalData: this.additionalData, slot: data.slot, onBeforenextvpfocus: (e) => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.beforeNextFocusCell(e.detail); }, onCanceledit: () => { var _a; return (_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEdit(false); }, onSetedit: ({ detail }) => {
|
|
3127
|
+
var _a;
|
|
3128
|
+
const event = this.beforeeditstart.emit(detail);
|
|
3129
|
+
if (!event.defaultPrevented) {
|
|
3130
|
+
(_a = this.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEdit(detail.val);
|
|
3131
|
+
}
|
|
3132
|
+
} }), h("revogr-data", Object.assign({}, data, { colType: view.type, key: key, readonly: this.readonly, range: this.range, rowClass: this.rowClass, rowSelectionStore: data.rowSelectionStore, additionalData: this.additionalData, jobsBeforeRender: this.jobsBeforeRender, paddingDepth: (_a = this.grouping) === null || _a === void 0 ? void 0 : _a.depthPadding, uniqueId: view.type === 'rgCol' ? (_b = this.pluginService.getByClass(ColumnManagePlugin)) === null || _b === void 0 ? void 0 : _b.getUniqueId() : undefined, hasColPinEnd: hasColPinEnd, hasRgCol: hasRgCol, slot: DATA_SLOT }), h("slot", { name: `data-${view.type}-${data.type}` })), h("revogr-temp-range", { selectionStore: data.selectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol }), h("revogr-focus", { colData: data.colData, dataStore: data.dataStore, focusTemplate: this.focusTemplate, rowType: data.type, colType: view.type, selectionStore: data.selectionStore, dimensionRow: data.dimensionRow, dimensionCol: data.dimensionCol, autoScrollToFocus: this.autoScrollToFocus }, h("slot", { name: `focus-${view.type}-${data.type}` }))));
|
|
3133
|
+
dataViews.push(dataView);
|
|
3134
|
+
});
|
|
3135
|
+
// Add viewport scroll in the end
|
|
3136
|
+
viewPortHtml.push(h("revogr-viewport-scroll", Object.assign({}, viewProp, { ref: el => this.scrollingService.registerElement(el, `${view.prop.key}`), onScrollviewport: e => this.scrollingService.proxyScroll(e.detail, `${view.prop.key}`), onScrollviewportsilent: e => this.scrollingService.scrollSilentService(e.detail, `${view.prop.key}`) }), dataViews));
|
|
3137
|
+
}
|
|
3138
|
+
viewportSections.push(viewPortHtml);
|
|
3139
|
+
// 添加统一表头组件,放在所有 viewport 之外作为独立层
|
|
3140
|
+
// 这样可以确保所有区域的表头在同一个渲染周期内更新
|
|
3141
|
+
viewportSections.push(h("revogr-header-unified", { areas: headerAreas, onBeforeheaderclick: (e) => this.headerclick.emit(e.detail) }));
|
|
3142
|
+
// Add grouping overlay viewport
|
|
3143
|
+
if (this.viewport) {
|
|
3144
|
+
const rgColView = this.viewport.columns.find(v => v.type === 'rgCol');
|
|
3145
|
+
const mainDataPort = rgColView === null || rgColView === void 0 ? void 0 : rgColView.dataPorts.find(d => d.type === 'rgRow');
|
|
3146
|
+
if (mainDataPort && rgColView) {
|
|
3147
|
+
const contentHeight = this.dimensionProvider.stores['rgRow'].store.get('realSize');
|
|
3148
|
+
// Get header row count (1 base row + grouping depth)
|
|
3149
|
+
const groupingDepth = rgColView.headerProp.groupingDepth || 0;
|
|
3150
|
+
const headerRowCount = 1 + groupingDepth;
|
|
3151
|
+
// Create header placeholders for each row
|
|
3152
|
+
const headerPlaceholders = [];
|
|
3153
|
+
// 如果只有一行,使用完整表头高度;如果超过一行,每行高度是表头高度 / 2
|
|
3154
|
+
const heightCalc = headerRowCount === 1
|
|
3155
|
+
? 'var(--rg-header-row-height, 45px)'
|
|
3156
|
+
: 'calc(var(--rg-header-row-height, 45px) / 2)';
|
|
3157
|
+
for (let i = 0; i < headerRowCount; i++) {
|
|
3158
|
+
headerPlaceholders.push(h("div", { class: "grouping-header-placeholder", key: `header-${i}`, style: { height: heightCalc } }, `header row ${i + 1}`));
|
|
3159
|
+
}
|
|
3160
|
+
viewportSections.unshift(h("revogr-viewport-scroll", { class: "grouping-overlay-viewport", contentWidth: 0, contentHeight: contentHeight, colType: "rgCol", key: "grouping-viewport", ref: el => this.scrollingService.registerElement(el, 'groupingOverlay'), onScrollviewport: e => this.scrollingService.proxyScroll(e.detail, 'groupingOverlay') }, h("div", { slot: HEADER_SLOT }, headerPlaceholders), h("revogr-grouping-overlay", { dataStore: mainDataPort.dataStore, colData: mainDataPort.colData, viewportRow: mainDataPort.viewportRow, viewportCol: mainDataPort.viewportCol, dimensionRow: mainDataPort.dimensionRow, type: "rgRow", colType: "rgCol", additionalData: this.additionalData, rowClass: this.rowClass, getGroupSelection: (_q = this.grouping) === null || _q === void 0 ? void 0 : _q.getGroupSelection, paddingDepth: (_r = this.grouping) === null || _r === void 0 ? void 0 : _r.depthPadding, slot: CONTENT_SLOT })));
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
// #endregion
|
|
3164
|
+
const typeRow = 'rgRow';
|
|
3165
|
+
const typeCol = 'rgCol';
|
|
3166
|
+
const viewports = this.viewportProvider.stores;
|
|
3167
|
+
const dimensions = this.dimensionProvider.stores;
|
|
3168
|
+
const verticalScroll = this.showScrollbar ? (h("revogr-scroll-virtual", { class: "vertical", dimension: typeRow, clientSize: viewports[typeRow].store.get('clientSize'), virtualSize: viewports[typeRow].store.get('virtualSize'), realSize: dimensions[typeRow].store.get('realSize'), ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) })) : null;
|
|
3169
|
+
const horizontalScroll = this.showScrollbar ? (h("revogr-scroll-virtual", { class: "horizontal", dimension: typeCol, clientSize: viewports[typeCol].store.get('clientSize'), virtualSize: viewports[typeCol].store.get('virtualSize'), realSize: dimensions[typeCol].store.get('realSize'), ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) })) : null;
|
|
3170
|
+
// Use the isSourceEmpty variable declared at the beginning of render
|
|
3171
|
+
const emptyPlaceholderEl = (isSourceEmpty && !this.hideEmpty) ? (h("div", { class: "empty-placeholder" }, this.emptyTemplate ? this.emptyTemplate(h) : h("slot", { name: "empty" }))) : null;
|
|
3172
|
+
return (h(Host, { dir: this.rtl ? 'rtl' : 'ltr' }, h("div", { class: "revo-grid-border-line" }), this.hideAttribution ? null : (h("revogr-attribution", { class: "attribution" })), h("slot", { name: "header" }), h("div", { class: "main-viewport", onClick: (e) => {
|
|
3173
|
+
var _a;
|
|
3174
|
+
if (e.currentTarget === e.target) {
|
|
3175
|
+
(_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
|
|
3176
|
+
}
|
|
3177
|
+
} }, h("div", { class: "viewports" }, h("slot", { name: "viewport" }), viewportSections, emptyPlaceholderEl, verticalScroll, h(OrderRenderer, { ref: e => (this.orderService = e) }))), horizontalScroll, h("revogr-extra", { ref: el => (this.extraService = el), nodes: this.extraElements }), h("slot", { name: "footer" })));
|
|
3178
|
+
}
|
|
3179
|
+
disconnectedCallback() {
|
|
3180
|
+
// Remove all plugins, to avoid memory leaks
|
|
3181
|
+
// and unexpected behaviour when the component is removed
|
|
3182
|
+
this.removePlugins();
|
|
3183
|
+
}
|
|
3184
|
+
get element() { return getElement(this); }
|
|
3185
|
+
static get watchers() { return {
|
|
3186
|
+
"columnTypes": ["columnTypesChanged"],
|
|
3187
|
+
"columns": ["columnChanged"],
|
|
3188
|
+
"disableVirtualX": ["disableVirtualXChanged"],
|
|
3189
|
+
"rowSize": ["rowSizeChanged"],
|
|
3190
|
+
"theme": ["themeChanged"],
|
|
3191
|
+
"source": ["dataSourceChanged"],
|
|
3192
|
+
"pinnedBottomSource": ["dataSourceChanged"],
|
|
3193
|
+
"pinnedTopSource": ["dataSourceChanged"],
|
|
3194
|
+
"disableVirtualY": ["disableVirtualYChanged"],
|
|
3195
|
+
"rowDefinitions": ["rowDefChanged"],
|
|
3196
|
+
"trimmedRows": ["trimmedRowsChanged"],
|
|
3197
|
+
"grouping": ["groupingChanged"],
|
|
3198
|
+
"stretch": ["applyStretch"],
|
|
3199
|
+
"filter": ["applyFilter"],
|
|
3200
|
+
"sorting": ["applySorting"],
|
|
3201
|
+
"rowHeaders": ["rowHeadersChange"],
|
|
3202
|
+
"registerVNode": ["registerOutsideVNodes"],
|
|
3203
|
+
"additionalData": ["additionalDataChanged"],
|
|
3204
|
+
"rtl": ["rtlChanged"],
|
|
3205
|
+
"plugins": ["pluginsChanged"]
|
|
3206
|
+
}; }
|
|
3207
|
+
};
|
|
3208
|
+
RevoGridComponent.style = revoGridStyleCss;
|
|
3209
|
+
|
|
3210
|
+
export { RevoGridComponent as revo_grid };
|
|
3211
|
+
//# sourceMappingURL=revo-grid.entry.js.map
|
|
3212
|
+
|
|
3213
|
+
//# sourceMappingURL=revo-grid.entry.js.map
|