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,2096 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist OU ❤️
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* RowSelectPlugin - 行选择插件
|
|
6
|
+
*
|
|
7
|
+
* 功能说明:
|
|
8
|
+
* 1. 单选/多选:支持点击复选框选择单行,支持 Shift 键范围多选
|
|
9
|
+
* 2. 全选/取消全选:列头复选框支持全选当前可见行,半选状态显示
|
|
10
|
+
* 3. 树形选择:与 TreeDataPlugin 配合,支持选择父节点时自动选择/取消子节点
|
|
11
|
+
* 4. 选中状态同步:行选中后会在行元素上添加 selected 属性,方便 CSS 样式控制
|
|
12
|
+
* 5. 事件通知:选中状态变化时触发 rowselected 事件,包含选中数量等信息
|
|
13
|
+
*
|
|
14
|
+
* 使用方式:
|
|
15
|
+
* 1. 在列配置中添加 rowSelect: true 启用该列的复选框
|
|
16
|
+
* 2. 或使用 columnType 指定自定义的 CheckboxCellType
|
|
17
|
+
* 3. rowSelect 也可以是函数,根据行数据动态决定是否显示复选框
|
|
18
|
+
*/
|
|
19
|
+
import { BasePlugin } from "./base.plugin";
|
|
20
|
+
// ==================== 常量定义 ====================
|
|
21
|
+
/** 行数据类型数组 */
|
|
22
|
+
const ROW_TYPES = ['rowPinStart', 'rgRow', 'rowPinEnd'];
|
|
23
|
+
/** 视口类型数组 */
|
|
24
|
+
const VIEWPORT_TYPES = ['colPinStart', 'rgCol', 'colPinEnd'];
|
|
25
|
+
/** 选中属性名称 */
|
|
26
|
+
export const SELECTED_ATTRIBUTE = 'selected';
|
|
27
|
+
// ==================== 事件常量 ====================
|
|
28
|
+
/** 行选择点击事件 */
|
|
29
|
+
const ROW_SELECT_CLICK_EVENT = 'rowselectclick';
|
|
30
|
+
/** 全选事件 */
|
|
31
|
+
const ROW_ALL_SELECT_EVENT = 'rowallselect';
|
|
32
|
+
/** 列头渲染前事件 */
|
|
33
|
+
const BEFORE_HEADER_RENDER_EVENT = 'beforeheaderrender';
|
|
34
|
+
/** 单元格渲染前事件 */
|
|
35
|
+
const BEFORE_CELL_RENDER_EVENT = 'beforecellrender';
|
|
36
|
+
/** 行渲染前事件 */
|
|
37
|
+
const BEFORE_ROW_RENDER_EVENT = 'beforerowrender';
|
|
38
|
+
/** 树形行选择事件 */
|
|
39
|
+
const TREE_ROW_SELECT_EVENT = 'treerowselect';
|
|
40
|
+
/** 行选中状态变化事件 */
|
|
41
|
+
const ROW_SELECTED_EVENT = 'rowselected';
|
|
42
|
+
/** 滚动期间 wheel 选中态同步限频,避免每帧都触发属性写入 */
|
|
43
|
+
const WHEEL_SELECTION_SYNC_INTERVAL_ACTIVE = 64;
|
|
44
|
+
/** 视口滚动空闲判定 */
|
|
45
|
+
const VIEWPORT_SCROLL_IDLE_DELAY = 90;
|
|
46
|
+
/** hover 指针对齐限频,减少 mousemove 高频触发 RAF */
|
|
47
|
+
const HOVER_POINTER_SYNC_INTERVAL = 40;
|
|
48
|
+
/** 调试开关:临时停用 RowSelectPlugin 注入的所有样式逻辑 */
|
|
49
|
+
const ENABLE_ROW_SELECT_PLUGIN_STYLES = true;
|
|
50
|
+
const DEBUG_ROW_HIGHLIGHT_TRACE = false;
|
|
51
|
+
const ROW_HOVER_ACTIVE_CLASS = 'row-hover-active';
|
|
52
|
+
const ROW_HOVER_SELECTED_ACTIVE_CLASS = 'row-hover-selected-active';
|
|
53
|
+
const EMPTY_ROW_STYLE_FLAGS = {
|
|
54
|
+
highlighted: false,
|
|
55
|
+
background: false,
|
|
56
|
+
focused: false,
|
|
57
|
+
};
|
|
58
|
+
// ==================== 工具函数 ====================
|
|
59
|
+
/**
|
|
60
|
+
* 触发自定义事件
|
|
61
|
+
*/
|
|
62
|
+
function dispatchCustomEvent(originalEvent, eventName, detail) {
|
|
63
|
+
var _a;
|
|
64
|
+
const customEvent = new CustomEvent(eventName, {
|
|
65
|
+
detail,
|
|
66
|
+
bubbles: true,
|
|
67
|
+
cancelable: true,
|
|
68
|
+
});
|
|
69
|
+
(_a = originalEvent.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(customEvent);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 获取物理行索引
|
|
73
|
+
*/
|
|
74
|
+
function getPhysicalRowIndex(store, virtualIndex) {
|
|
75
|
+
const items = store.get('items');
|
|
76
|
+
return items[virtualIndex];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 创建单元格模板(包装器模式)
|
|
80
|
+
*/
|
|
81
|
+
function createCellTemplate(wrapper, ...templates) {
|
|
82
|
+
return (h, props, additionalData) => {
|
|
83
|
+
var _a;
|
|
84
|
+
wrapper(h, props, additionalData);
|
|
85
|
+
for (const template of templates) {
|
|
86
|
+
if (template) {
|
|
87
|
+
return template(h, props, additionalData);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return (_a = props.value) !== null && _a !== void 0 ? _a : '';
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* 获取默认单元格值模板
|
|
95
|
+
*/
|
|
96
|
+
function getDefaultCellValue(template) {
|
|
97
|
+
return template !== null && template !== void 0 ? template : ((_, props) => { var _a; return (_a = props.value) !== null && _a !== void 0 ? _a : ''; });
|
|
98
|
+
}
|
|
99
|
+
// ==================== CheckboxCellType ====================
|
|
100
|
+
/**
|
|
101
|
+
* 复选框单元格类型
|
|
102
|
+
* 提供复选框的单元格和列头模板
|
|
103
|
+
*/
|
|
104
|
+
export class CheckboxCellType {
|
|
105
|
+
constructor() {
|
|
106
|
+
this.readonly = true;
|
|
107
|
+
/**
|
|
108
|
+
* 单元格模板 - 渲染行复选框
|
|
109
|
+
*/
|
|
110
|
+
this.cellTemplate = (h, props) => h('input', {
|
|
111
|
+
type: 'checkbox',
|
|
112
|
+
checked: !!props.selected,
|
|
113
|
+
onClick(event) {
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
const detail = Object.assign(Object.assign({}, props), { originalEvent: event });
|
|
116
|
+
dispatchCustomEvent(event, ROW_SELECT_CLICK_EVENT, detail);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
/**
|
|
120
|
+
* 单元格属性
|
|
121
|
+
*/
|
|
122
|
+
this.cellProperties = () => ({
|
|
123
|
+
class: 'cell-checkbox',
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* 列属性
|
|
127
|
+
*/
|
|
128
|
+
this.columnProperties = () => ({
|
|
129
|
+
class: 'cell-checkbox',
|
|
130
|
+
});
|
|
131
|
+
/**
|
|
132
|
+
* 列头模板 - 渲染全选复选框
|
|
133
|
+
*/
|
|
134
|
+
this.columnTemplate = (h, props) => h('div', {
|
|
135
|
+
class: 'cell-header-checkbox-container',
|
|
136
|
+
}, h('input', {
|
|
137
|
+
ref(element) {
|
|
138
|
+
if (element) {
|
|
139
|
+
element.setAttribute('data-ref', 'ref');
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
type: 'checkbox',
|
|
143
|
+
checked: !!props.allSelected,
|
|
144
|
+
indeterminate: !props.allSelected && !!props.allIndeterminate,
|
|
145
|
+
onClick(event) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
if (!(event.target instanceof HTMLInputElement))
|
|
148
|
+
return;
|
|
149
|
+
const detail = {
|
|
150
|
+
type: props.providers.type,
|
|
151
|
+
selected: !!event.target.checked,
|
|
152
|
+
};
|
|
153
|
+
dispatchCustomEvent(event, ROW_ALL_SELECT_EVENT, detail);
|
|
154
|
+
},
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// ==================== RowSelectPlugin ====================
|
|
159
|
+
/**
|
|
160
|
+
* 行选择插件
|
|
161
|
+
* 实现表格行的单选和多选功能
|
|
162
|
+
*/
|
|
163
|
+
export class RowSelectPlugin extends BasePlugin {
|
|
164
|
+
constructor(revogrid, providers, config = {}) {
|
|
165
|
+
var _a;
|
|
166
|
+
super(revogrid, providers);
|
|
167
|
+
/** 高亮行的 ID 字段名 */
|
|
168
|
+
this.highlightIdField = 'id';
|
|
169
|
+
/** 行样式 ID 集合,按类型分组存储 */
|
|
170
|
+
this.rowStyleIds = new Map([
|
|
171
|
+
['highlight', new Set()],
|
|
172
|
+
['background', new Set()],
|
|
173
|
+
['focused', new Set()],
|
|
174
|
+
]);
|
|
175
|
+
/** Hover 同步状态 */
|
|
176
|
+
this.hoverSyncEnabled = false;
|
|
177
|
+
this.hoverRowType = null;
|
|
178
|
+
this.hoverPhysicalIndex = null;
|
|
179
|
+
this.hoverLastPointer = null;
|
|
180
|
+
this.hoverSyncProcessing = false;
|
|
181
|
+
this.hoverResyncTimer = null;
|
|
182
|
+
this.hoverResyncRaf = null;
|
|
183
|
+
this.hoverRenderBlocked = false;
|
|
184
|
+
this.hoverResyncPending = false;
|
|
185
|
+
this.hoverMouseDown = false;
|
|
186
|
+
this.hoverInteractionSuspended = false;
|
|
187
|
+
this.viewportScrollIdleTimer = null;
|
|
188
|
+
this.viewportScrolling = false;
|
|
189
|
+
this.pendingWheelSelectionSyncAfterScroll = false;
|
|
190
|
+
this.lastWheelSelectionSyncAt = 0;
|
|
191
|
+
this.lastHoverPointerSyncAt = 0;
|
|
192
|
+
this.cleanupHoverSync = null;
|
|
193
|
+
this.pendingSelectionAttributeSync = false;
|
|
194
|
+
this.selectionAttributeSyncRaf = null;
|
|
195
|
+
this.postRefreshSyncRaf = null;
|
|
196
|
+
this.wheelRowSelectionSyncRaf = null;
|
|
197
|
+
this.pendingSelectionRemapByType = new Map();
|
|
198
|
+
// 初始化选中集合
|
|
199
|
+
this.selected = (_a = config.initialSelected) !== null && _a !== void 0 ? _a : new Map();
|
|
200
|
+
ROW_TYPES.forEach((type) => {
|
|
201
|
+
if (!this.selected.has(type)) {
|
|
202
|
+
this.selected.set(type, new Set());
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
// 保存自定义模板和类型
|
|
206
|
+
this.customCheckboxTemplate = config.checkboxTemplate;
|
|
207
|
+
this.customHeaderCheckboxTemplate = config.headerCheckboxTemplate;
|
|
208
|
+
this.customCheckboxType = config.customCheckboxType;
|
|
209
|
+
this.treeConfig = config.tree;
|
|
210
|
+
this.selectedRowStyle = config.selectedRowStyle;
|
|
211
|
+
this.hoverRowStyle = config.hoverRowStyle;
|
|
212
|
+
this.highlightRowStyle = config.highlightRowStyle;
|
|
213
|
+
this.focusedRowStyle = config.focusedRowStyle;
|
|
214
|
+
this.highlightIdField = config.highlightIdField || 'id';
|
|
215
|
+
// 创建复选框单元格类型实例
|
|
216
|
+
this.checkboxCellType = new CheckboxCellType();
|
|
217
|
+
// 注入自定义样式
|
|
218
|
+
if (ENABLE_ROW_SELECT_PLUGIN_STYLES) {
|
|
219
|
+
this.injectCustomStyles();
|
|
220
|
+
}
|
|
221
|
+
// 监听过滤器应用事件,更新选中状态
|
|
222
|
+
this.addEventListener('afterfilterapply', () => {
|
|
223
|
+
this.blockHoverRender();
|
|
224
|
+
this.emitSelectionChange();
|
|
225
|
+
this.scheduleHoverResync();
|
|
226
|
+
});
|
|
227
|
+
// 渲染完成后兜底同步 hover,避免中间态闪烁
|
|
228
|
+
this.addEventListener('afterrender', () => {
|
|
229
|
+
const shouldResync = this.hoverResyncPending;
|
|
230
|
+
if (this.hoverRenderBlocked) {
|
|
231
|
+
this.hoverRenderBlocked = false;
|
|
232
|
+
}
|
|
233
|
+
if (this.pendingSelectionAttributeSync) {
|
|
234
|
+
this.queueSelectionAttributeSync();
|
|
235
|
+
}
|
|
236
|
+
else if (this.hasAnySelectedRows() || this.hasAnyRowStyles()) {
|
|
237
|
+
// 滚动虚拟渲染过程中,同步 wheel-capture-row 的 selected/行样式,避免“慢一拍”上色
|
|
238
|
+
this.queueWheelRowSelectionSync(true);
|
|
239
|
+
}
|
|
240
|
+
if (shouldResync && this.hoverSyncEnabled) {
|
|
241
|
+
if (this.hoverInteractionSuspended) {
|
|
242
|
+
this.hoverResyncPending = true;
|
|
243
|
+
}
|
|
244
|
+
else {
|
|
245
|
+
this.hoverResyncPending = false;
|
|
246
|
+
this.syncHoverFromPointer();
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
// 记录滚动活跃状态,用于限频 wheel-capture 的 selected 同步
|
|
251
|
+
this.addEventListener('scrollviewport', () => {
|
|
252
|
+
this.markViewportScrolling();
|
|
253
|
+
});
|
|
254
|
+
// 在 source 变更前后基于稳定 ID 重建选中索引,避免索引漂移导致选中错位
|
|
255
|
+
this.addEventListener('beforesourceset', (event) => {
|
|
256
|
+
var _a;
|
|
257
|
+
const rowType = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.type;
|
|
258
|
+
if (!rowType || !ROW_TYPES.includes(rowType)) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
this.capturePendingSelectionRemap(rowType);
|
|
262
|
+
this.clearAllHoverClass();
|
|
263
|
+
this.clearWheelCaptureVisualState();
|
|
264
|
+
this.clearRenderedRowStyleAttributes();
|
|
265
|
+
this.blockHoverRender();
|
|
266
|
+
this.pendingSelectionAttributeSync = true;
|
|
267
|
+
});
|
|
268
|
+
this.addEventListener('aftersourceset', (event) => {
|
|
269
|
+
var _a, _b;
|
|
270
|
+
const rowType = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.type;
|
|
271
|
+
if (!rowType || !ROW_TYPES.includes(rowType)) {
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const remapped = this.applyPendingSelectionRemap(rowType, (_b = event.detail) === null || _b === void 0 ? void 0 : _b.source);
|
|
275
|
+
this.updateSelectedRowsAttribute();
|
|
276
|
+
this.pendingSelectionAttributeSync = true;
|
|
277
|
+
this.blockHoverRender();
|
|
278
|
+
this.queueWheelRowSelectionSync(true);
|
|
279
|
+
if (remapped) {
|
|
280
|
+
this.emitSelectionChange();
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
// 监听行选择点击事件
|
|
284
|
+
this.addEventListener(ROW_SELECT_CLICK_EVENT, (event) => {
|
|
285
|
+
if (event.defaultPrevented)
|
|
286
|
+
return;
|
|
287
|
+
const { detail } = event;
|
|
288
|
+
const selectedSet = this.selected.get(detail.type);
|
|
289
|
+
if (!selectedSet)
|
|
290
|
+
return;
|
|
291
|
+
const dataStore = providers.data.stores[detail.type];
|
|
292
|
+
const physicalIndex = getPhysicalRowIndex(dataStore.store, detail.rowIndex);
|
|
293
|
+
const isShiftKey = detail.originalEvent.shiftKey;
|
|
294
|
+
// 处理 Shift 键多选
|
|
295
|
+
if (isShiftKey && this.lastSelectedIndex !== undefined) {
|
|
296
|
+
const startIndex = this.lastSelectedIndex;
|
|
297
|
+
const minIndex = Math.min(startIndex, physicalIndex);
|
|
298
|
+
const maxIndex = Math.max(startIndex, physicalIndex);
|
|
299
|
+
// 选中范围内的所有行
|
|
300
|
+
for (let i = minIndex; i <= maxIndex; i++) {
|
|
301
|
+
selectedSet.add(i);
|
|
302
|
+
}
|
|
303
|
+
this.lastSelectedIndex = physicalIndex;
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
// 单击切换选中状态
|
|
307
|
+
const willSelect = !selectedSet.has(physicalIndex);
|
|
308
|
+
if (willSelect) {
|
|
309
|
+
selectedSet.add(physicalIndex);
|
|
310
|
+
this.lastSelectedIndex = physicalIndex;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
selectedSet.delete(physicalIndex);
|
|
314
|
+
this.lastSelectedIndex = undefined;
|
|
315
|
+
}
|
|
316
|
+
// 如果配置了树形数据,处理父子节点联动
|
|
317
|
+
if (this.treeConfig) {
|
|
318
|
+
const source = dataStore.store.get('source');
|
|
319
|
+
const currentRow = source[physicalIndex];
|
|
320
|
+
if (currentRow) {
|
|
321
|
+
// 获取所有子节点
|
|
322
|
+
const childIndices = this.getChildrenIndices(source, currentRow);
|
|
323
|
+
console.log('🟢 复选框点击 - 树形联动:', {
|
|
324
|
+
parentIndex: physicalIndex,
|
|
325
|
+
parentRowKey: currentRow[this.treeConfig.idField],
|
|
326
|
+
willSelect,
|
|
327
|
+
childIndices,
|
|
328
|
+
childCount: childIndices.length,
|
|
329
|
+
});
|
|
330
|
+
// 同步子节点的选中状态
|
|
331
|
+
childIndices.forEach((childIndex) => {
|
|
332
|
+
if (willSelect) {
|
|
333
|
+
selectedSet.add(childIndex);
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
selectedSet.delete(childIndex);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
this.emitSelectionChange();
|
|
343
|
+
this.refreshViewports();
|
|
344
|
+
});
|
|
345
|
+
// 监听全选事件
|
|
346
|
+
this.addEventListener(ROW_ALL_SELECT_EVENT, (event) => {
|
|
347
|
+
const { detail } = event;
|
|
348
|
+
this.lastSelectedIndex = undefined;
|
|
349
|
+
ROW_TYPES.forEach((rowType) => {
|
|
350
|
+
const selectedSet = this.selected.get(rowType);
|
|
351
|
+
if (!selectedSet)
|
|
352
|
+
return;
|
|
353
|
+
const dataStore = providers.data.stores[rowType];
|
|
354
|
+
const source = dataStore.store.get('source');
|
|
355
|
+
const proxyItems = dataStore.store.get('proxyItems');
|
|
356
|
+
if (detail.selected) {
|
|
357
|
+
// 全选:批量添加所有非分组行的索引
|
|
358
|
+
const indicesToAdd = [];
|
|
359
|
+
proxyItems.forEach((itemIndex) => {
|
|
360
|
+
const rowData = source[itemIndex];
|
|
361
|
+
// 跳过分组行(分组行有 __rvgr-depth 标记)
|
|
362
|
+
if (rowData && rowData['__rvgr-depth'] !== undefined) {
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
indicesToAdd.push(itemIndex);
|
|
366
|
+
});
|
|
367
|
+
// 批量添加到 Set(比逐个 add 快很多)
|
|
368
|
+
indicesToAdd.forEach(index => selectedSet.add(index));
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
// 取消全选:直接清空 Set
|
|
372
|
+
selectedSet.clear();
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
this.emitSelectionChange();
|
|
376
|
+
this.refreshViewports();
|
|
377
|
+
});
|
|
378
|
+
// 监听列头渲染事件
|
|
379
|
+
this.addEventListener(BEFORE_HEADER_RENDER_EVENT, (event) => {
|
|
380
|
+
const columnData = event.detail.data;
|
|
381
|
+
if (this.isCheckboxColumn(columnData)) {
|
|
382
|
+
// 如果用户提供了自定义 columnType,使用自定义类型
|
|
383
|
+
const baseType = this.customCheckboxType || this.checkboxCellType;
|
|
384
|
+
event.detail.data = Object.assign(Object.assign(Object.assign({}, baseType), columnData), { columnTemplate: this.createHeaderTemplate(columnData) });
|
|
385
|
+
}
|
|
386
|
+
});
|
|
387
|
+
// 监听单元格渲染事件
|
|
388
|
+
this.addEventListener(BEFORE_CELL_RENDER_EVENT, (event) => {
|
|
389
|
+
const { detail } = event;
|
|
390
|
+
let column = detail.model.column;
|
|
391
|
+
if (this.isCheckboxColumn(column)) {
|
|
392
|
+
// 检查 rowSelect 是否为函数,如果是则调用判断是否显示
|
|
393
|
+
if (typeof column.rowSelect === 'function' && !column.rowSelect(detail.model)) {
|
|
394
|
+
// 不显示复选框
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
// 如果用户提供了自定义 columnType,使用自定义类型
|
|
398
|
+
const baseType = this.customCheckboxType || this.checkboxCellType;
|
|
399
|
+
column = Object.assign(Object.assign(Object.assign({}, baseType), column), { cellTemplate: createCellTemplate(this.cellTemplateWrapper.bind(this), this.createCellCheckboxTemplate(), getDefaultCellValue(column.cellTemplate)) });
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
detail.model = Object.assign(Object.assign({}, detail.model), { column });
|
|
403
|
+
});
|
|
404
|
+
// 监听行渲染事件 - 设置行的选中属性(包括行号列)
|
|
405
|
+
this.addEventListener(BEFORE_ROW_RENDER_EVENT, (event) => {
|
|
406
|
+
var _a, _b, _c, _d, _e, _f;
|
|
407
|
+
const { detail } = event;
|
|
408
|
+
const rowType = detail.rowType;
|
|
409
|
+
const isRowType = ROW_TYPES.includes(rowType);
|
|
410
|
+
const virtualIndex = detail.item.itemIndex;
|
|
411
|
+
const rowStore = isRowType ? this.providers.data.stores[rowType] : undefined;
|
|
412
|
+
const rowItems = rowStore === null || rowStore === void 0 ? void 0 : rowStore.store.get('items');
|
|
413
|
+
const physicalIndex = isRowType && Array.isArray(rowItems) ? rowItems[virtualIndex] : undefined;
|
|
414
|
+
const hasValidPhysicalIndex = Number.isInteger(physicalIndex);
|
|
415
|
+
const rowId = isRowType && hasValidPhysicalIndex
|
|
416
|
+
? this.getRowIdByPhysicalIndex(rowType, physicalIndex, this.highlightIdField)
|
|
417
|
+
: null;
|
|
418
|
+
const cleanupStaleAttrs = (attrs) => {
|
|
419
|
+
const nextAttrs = Object.assign({}, attrs);
|
|
420
|
+
delete nextAttrs[SELECTED_ATTRIBUTE];
|
|
421
|
+
delete nextAttrs['data-highlighted'];
|
|
422
|
+
delete nextAttrs['data-row-bg'];
|
|
423
|
+
delete nextAttrs['data-focused'];
|
|
424
|
+
const existingClass = nextAttrs.class;
|
|
425
|
+
if (typeof existingClass === 'string') {
|
|
426
|
+
const nextClass = existingClass
|
|
427
|
+
.replace(/\brow-hover-active\b/g, '')
|
|
428
|
+
.replace(/\brow-hover-selected-active\b/g, '')
|
|
429
|
+
.replace(/\s+/g, ' ')
|
|
430
|
+
.trim();
|
|
431
|
+
if (nextClass) {
|
|
432
|
+
nextAttrs.class = nextClass;
|
|
433
|
+
}
|
|
434
|
+
else if ('class' in nextAttrs) {
|
|
435
|
+
delete nextAttrs.class;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
else if (existingClass && typeof existingClass === 'object') {
|
|
439
|
+
nextAttrs.class = Object.assign(Object.assign({}, existingClass), { [ROW_HOVER_ACTIVE_CLASS]: false, [ROW_HOVER_SELECTED_ACTIVE_CLASS]: false });
|
|
440
|
+
}
|
|
441
|
+
return nextAttrs;
|
|
442
|
+
};
|
|
443
|
+
const setSelectedAttr = (attrs, isSelected) => {
|
|
444
|
+
if (isSelected) {
|
|
445
|
+
attrs[SELECTED_ATTRIBUTE] = 'true';
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
if (SELECTED_ATTRIBUTE in attrs) {
|
|
449
|
+
delete attrs[SELECTED_ATTRIBUTE];
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
const hasActiveHoverRow = this.hoverRowType !== null && this.hoverPhysicalIndex !== null;
|
|
453
|
+
const shouldProcessHoverClass = this.hoverSyncEnabled &&
|
|
454
|
+
!this.hoverInteractionSuspended &&
|
|
455
|
+
!!((_a = this.hoverRowStyle) === null || _a === void 0 ? void 0 : _a.backgroundColor) &&
|
|
456
|
+
hasActiveHoverRow;
|
|
457
|
+
const hasAnySelected = !!((_b = this.selected.get('rowPinStart')) === null || _b === void 0 ? void 0 : _b.size) ||
|
|
458
|
+
!!((_c = this.selected.get('rgRow')) === null || _c === void 0 ? void 0 : _c.size) ||
|
|
459
|
+
!!((_d = this.selected.get('rowPinEnd')) === null || _d === void 0 ? void 0 : _d.size);
|
|
460
|
+
const hasAnyRowStyle = this.hasAnyRowStyles();
|
|
461
|
+
if (isRowType && !hasValidPhysicalIndex) {
|
|
462
|
+
const prevAttrs = (detail.node.$attrs$ || {});
|
|
463
|
+
const attrs = cleanupStaleAttrs(detail.node.$attrs$ || {});
|
|
464
|
+
const hadHighlighted = this.isTruthyRowFlag(prevAttrs['data-highlighted']);
|
|
465
|
+
detail.node.$attrs$ = attrs;
|
|
466
|
+
if (hadHighlighted) {
|
|
467
|
+
this.logHighlightTrace('beforerowrender.cleanup.invalid-physical-index', {
|
|
468
|
+
rowType,
|
|
469
|
+
colType: detail.colType,
|
|
470
|
+
virtualIndex,
|
|
471
|
+
physicalIndex,
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (!hasAnySelected && !shouldProcessHoverClass && !hasAnyRowStyle) {
|
|
477
|
+
if (isRowType) {
|
|
478
|
+
const prevAttrs = (detail.node.$attrs$ || {});
|
|
479
|
+
const attrs = cleanupStaleAttrs(detail.node.$attrs$ || {});
|
|
480
|
+
const hadHighlighted = this.isTruthyRowFlag(prevAttrs['data-highlighted']);
|
|
481
|
+
detail.node.$attrs$ = attrs;
|
|
482
|
+
if (hadHighlighted) {
|
|
483
|
+
this.logHighlightTrace('beforerowrender.cleanup.no-style-state', {
|
|
484
|
+
rowType,
|
|
485
|
+
colType: detail.colType,
|
|
486
|
+
virtualIndex,
|
|
487
|
+
physicalIndex,
|
|
488
|
+
rowId,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const resolvedPhysicalIndex = physicalIndex;
|
|
495
|
+
const styleFlags = hasAnyRowStyle && isRowType
|
|
496
|
+
? this.getRowStyleFlags(rowType, resolvedPhysicalIndex)
|
|
497
|
+
: EMPTY_ROW_STYLE_FLAGS;
|
|
498
|
+
const syncHoverClass = (attrs) => {
|
|
499
|
+
const existingClass = attrs.class;
|
|
500
|
+
if (typeof existingClass === 'string') {
|
|
501
|
+
const nextClass = existingClass
|
|
502
|
+
.replace(/\brow-hover-active\b/g, '')
|
|
503
|
+
.replace(/\brow-hover-selected-active\b/g, '')
|
|
504
|
+
.replace(/\s+/g, ' ')
|
|
505
|
+
.trim();
|
|
506
|
+
attrs.class = nextClass || undefined;
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
if (existingClass && typeof existingClass === 'object') {
|
|
510
|
+
attrs.class = Object.assign(Object.assign({}, existingClass), { [ROW_HOVER_ACTIVE_CLASS]: false, [ROW_HOVER_SELECTED_ACTIVE_CLASS]: false });
|
|
511
|
+
}
|
|
512
|
+
};
|
|
513
|
+
// 处理数据行
|
|
514
|
+
if (isRowType && detail.colType !== 'rowHeaders') {
|
|
515
|
+
const prevAttrs = (detail.node.$attrs$ || {});
|
|
516
|
+
const prevHighlighted = this.isTruthyRowFlag(prevAttrs['data-highlighted']);
|
|
517
|
+
const isSelected = (_e = this.selected.get(detail.rowType)) === null || _e === void 0 ? void 0 : _e.has(resolvedPhysicalIndex);
|
|
518
|
+
const attrs = Object.assign({}, detail.node.$attrs$);
|
|
519
|
+
setSelectedAttr(attrs, !!isSelected);
|
|
520
|
+
this.applyRowStyleFlagsToAttrs(attrs, styleFlags, {
|
|
521
|
+
path: 'beforerowrender.dataRow.flags',
|
|
522
|
+
rowType,
|
|
523
|
+
colType: detail.colType,
|
|
524
|
+
virtualIndex,
|
|
525
|
+
physicalIndex: resolvedPhysicalIndex,
|
|
526
|
+
rowId,
|
|
527
|
+
});
|
|
528
|
+
syncHoverClass(attrs);
|
|
529
|
+
detail.node.$attrs$ = attrs;
|
|
530
|
+
const nextHighlighted = this.isTruthyRowFlag(attrs['data-highlighted']);
|
|
531
|
+
if (prevHighlighted !== nextHighlighted || nextHighlighted) {
|
|
532
|
+
this.logHighlightTrace('beforerowrender.dataRow.commit', {
|
|
533
|
+
rowType,
|
|
534
|
+
colType: detail.colType,
|
|
535
|
+
virtualIndex,
|
|
536
|
+
physicalIndex: resolvedPhysicalIndex,
|
|
537
|
+
rowId,
|
|
538
|
+
prevHighlighted,
|
|
539
|
+
nextHighlighted,
|
|
540
|
+
selected: !!isSelected,
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
// 处理行号列(rowHeaders)
|
|
545
|
+
if (detail.colType === 'rowHeaders') {
|
|
546
|
+
// 行号列的行索引与数据行相同
|
|
547
|
+
const rowType = detail.rowType;
|
|
548
|
+
if (ROW_TYPES.includes(rowType)) {
|
|
549
|
+
const prevAttrs = (detail.node.$attrs$ || {});
|
|
550
|
+
const prevHighlighted = this.isTruthyRowFlag(prevAttrs['data-highlighted']);
|
|
551
|
+
const rowId = this.getRowIdByPhysicalIndex(rowType, resolvedPhysicalIndex, this.highlightIdField);
|
|
552
|
+
const isSelected = (_f = this.selected.get(rowType)) === null || _f === void 0 ? void 0 : _f.has(resolvedPhysicalIndex);
|
|
553
|
+
const attrs = Object.assign({}, detail.node.$attrs$);
|
|
554
|
+
setSelectedAttr(attrs, !!isSelected);
|
|
555
|
+
this.applyRowStyleFlagsToAttrs(attrs, styleFlags, {
|
|
556
|
+
path: 'beforerowrender.rowHeaders.flags',
|
|
557
|
+
rowType,
|
|
558
|
+
colType: detail.colType,
|
|
559
|
+
virtualIndex,
|
|
560
|
+
physicalIndex: resolvedPhysicalIndex,
|
|
561
|
+
rowId,
|
|
562
|
+
});
|
|
563
|
+
syncHoverClass(attrs);
|
|
564
|
+
detail.node.$attrs$ = attrs;
|
|
565
|
+
const nextHighlighted = this.isTruthyRowFlag(attrs['data-highlighted']);
|
|
566
|
+
if (prevHighlighted !== nextHighlighted || nextHighlighted) {
|
|
567
|
+
this.logHighlightTrace('beforerowrender.rowHeaders.commit', {
|
|
568
|
+
rowType,
|
|
569
|
+
colType: detail.colType,
|
|
570
|
+
virtualIndex,
|
|
571
|
+
physicalIndex: resolvedPhysicalIndex,
|
|
572
|
+
rowId,
|
|
573
|
+
prevHighlighted,
|
|
574
|
+
nextHighlighted,
|
|
575
|
+
selected: !!isSelected,
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
// 监听树形行选择事件
|
|
582
|
+
this.addEventListener(TREE_ROW_SELECT_EVENT, (event) => {
|
|
583
|
+
const { detail } = event;
|
|
584
|
+
const selectedSet = this.selected.get(detail.type);
|
|
585
|
+
if (!selectedSet)
|
|
586
|
+
return;
|
|
587
|
+
// 切换父节点和子节点的选中状态
|
|
588
|
+
if (!selectedSet.has(detail.parentIndex)) {
|
|
589
|
+
// 如果父节点未选中,则选中父节点和所有子节点
|
|
590
|
+
selectedSet.add(detail.parentIndex);
|
|
591
|
+
detail.childrenIndices.forEach((childIndex) => selectedSet.add(childIndex));
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
// 如果父节点已选中,则取消选中父节点和所有子节点
|
|
595
|
+
detail.childrenIndices.forEach((childIndex) => selectedSet.delete(childIndex));
|
|
596
|
+
selectedSet.delete(detail.parentIndex);
|
|
597
|
+
}
|
|
598
|
+
this.emitSelectionChange();
|
|
599
|
+
this.refreshViewports();
|
|
600
|
+
});
|
|
601
|
+
// 监听分组展开/折叠事件,更新选中状态显示
|
|
602
|
+
this.addEventListener('groupexpandclick', () => {
|
|
603
|
+
this.clearAllHoverClass();
|
|
604
|
+
this.clearWheelCaptureVisualState();
|
|
605
|
+
this.clearRenderedRowStyleAttributes();
|
|
606
|
+
this.blockHoverRender();
|
|
607
|
+
this.pendingSelectionAttributeSync = true;
|
|
608
|
+
});
|
|
609
|
+
// 监听树形节点展开/折叠事件,更新选中状态显示
|
|
610
|
+
this.addEventListener('treenodetoggle', () => {
|
|
611
|
+
this.clearAllHoverClass();
|
|
612
|
+
this.clearWheelCaptureVisualState();
|
|
613
|
+
this.clearRenderedRowStyleAttributes();
|
|
614
|
+
this.blockHoverRender();
|
|
615
|
+
this.pendingSelectionAttributeSync = true;
|
|
616
|
+
});
|
|
617
|
+
// 树形/分组 trimmed 变更期间强制清理 hover,避免频繁展开收起后残留多行 hover
|
|
618
|
+
this.addEventListener('beforetrimmed', (event) => {
|
|
619
|
+
var _a, _b;
|
|
620
|
+
const trimmedType = (_a = event.detail) === null || _a === void 0 ? void 0 : _a.trimmedType;
|
|
621
|
+
const rowType = (_b = event.detail) === null || _b === void 0 ? void 0 : _b.type;
|
|
622
|
+
if (rowType && rowType !== 'rgRow') {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
if (trimmedType !== 'tree-collapsed' && trimmedType !== 'grouping') {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
this.clearAllHoverClass();
|
|
629
|
+
this.blockHoverRender();
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
// ==================== 公共方法 ====================
|
|
633
|
+
/**
|
|
634
|
+
* 获取所有选中行的索引
|
|
635
|
+
*/
|
|
636
|
+
getSelectedIndexes() {
|
|
637
|
+
return this.selected;
|
|
638
|
+
}
|
|
639
|
+
/**
|
|
640
|
+
* 获取选中行的数据
|
|
641
|
+
*/
|
|
642
|
+
getSelectedRows() {
|
|
643
|
+
const result = new Map();
|
|
644
|
+
this.selected.forEach((selectedSet, rowType) => {
|
|
645
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
646
|
+
const source = dataStore.store.get('source');
|
|
647
|
+
const rows = [];
|
|
648
|
+
selectedSet.forEach((physicalIndex) => {
|
|
649
|
+
if (source[physicalIndex]) {
|
|
650
|
+
rows.push(source[physicalIndex]);
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
result.set(rowType, rows);
|
|
654
|
+
});
|
|
655
|
+
return result;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* 清空所有选中
|
|
659
|
+
*/
|
|
660
|
+
clearSelection() {
|
|
661
|
+
this.selected.forEach((selectedSet) => selectedSet.clear());
|
|
662
|
+
this.lastSelectedIndex = undefined;
|
|
663
|
+
this.emitSelectionChange();
|
|
664
|
+
this.refreshViewports();
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* 全选所有行(触发全选事件)
|
|
668
|
+
*/
|
|
669
|
+
selectAll() {
|
|
670
|
+
// 触发全选事件
|
|
671
|
+
const event = new CustomEvent('rowallselect', {
|
|
672
|
+
detail: {
|
|
673
|
+
type: 'rgRow',
|
|
674
|
+
selected: true,
|
|
675
|
+
},
|
|
676
|
+
bubbles: true,
|
|
677
|
+
});
|
|
678
|
+
this.revogrid.dispatchEvent(event);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* 取消全选(触发取消全选事件)
|
|
682
|
+
*/
|
|
683
|
+
deselectAll() {
|
|
684
|
+
// 触发取消全选事件
|
|
685
|
+
const event = new CustomEvent('rowallselect', {
|
|
686
|
+
detail: {
|
|
687
|
+
type: 'rgRow',
|
|
688
|
+
selected: false,
|
|
689
|
+
},
|
|
690
|
+
bubbles: true,
|
|
691
|
+
});
|
|
692
|
+
this.revogrid.dispatchEvent(event);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* 选中指定行(支持树形联动)
|
|
696
|
+
*/
|
|
697
|
+
selectRows(rowType, indices) {
|
|
698
|
+
const selectedSet = this.selected.get(rowType);
|
|
699
|
+
if (!selectedSet)
|
|
700
|
+
return;
|
|
701
|
+
const indicesToSelect = [...indices];
|
|
702
|
+
// 如果配置了树形数据,处理父子节点联动
|
|
703
|
+
if (this.treeConfig) {
|
|
704
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
705
|
+
const source = dataStore.store.get('source');
|
|
706
|
+
indices.forEach((index) => {
|
|
707
|
+
const row = source[index];
|
|
708
|
+
if (row) {
|
|
709
|
+
const { idField, parentIdField } = this.treeConfig;
|
|
710
|
+
const parentId = row[idField];
|
|
711
|
+
console.log('🔵 selectRows - 父节点信息:', {
|
|
712
|
+
parentIndex: index,
|
|
713
|
+
idField,
|
|
714
|
+
parentIdField,
|
|
715
|
+
parentId,
|
|
716
|
+
parentRowData: row,
|
|
717
|
+
});
|
|
718
|
+
// 获取所有子节点
|
|
719
|
+
const childIndices = this.getChildrenIndices(source, row);
|
|
720
|
+
// 打印找到的子节点
|
|
721
|
+
childIndices.forEach(childIdx => {
|
|
722
|
+
const childRow = source[childIdx];
|
|
723
|
+
console.log('🔵 找到子节点:', {
|
|
724
|
+
childIndex: childIdx,
|
|
725
|
+
childParentId: childRow === null || childRow === void 0 ? void 0 : childRow[parentIdField],
|
|
726
|
+
childRowKey: childRow === null || childRow === void 0 ? void 0 : childRow.rowKey,
|
|
727
|
+
});
|
|
728
|
+
});
|
|
729
|
+
console.log('🔵 selectRows - 树形联动结果:', {
|
|
730
|
+
parentIndex: index,
|
|
731
|
+
childIndices,
|
|
732
|
+
childCount: childIndices.length,
|
|
733
|
+
});
|
|
734
|
+
indicesToSelect.push(...childIndices);
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
console.log('🔵 selectRows - 最终选中索引:', indicesToSelect);
|
|
739
|
+
indicesToSelect.forEach((index) => selectedSet.add(index));
|
|
740
|
+
this.emitSelectionChange();
|
|
741
|
+
this.refreshViewports();
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* 取消选中指定行(支持树形联动)
|
|
745
|
+
*/
|
|
746
|
+
deselectRows(rowType, indices) {
|
|
747
|
+
const selectedSet = this.selected.get(rowType);
|
|
748
|
+
if (!selectedSet)
|
|
749
|
+
return;
|
|
750
|
+
const indicesToDeselect = [...indices];
|
|
751
|
+
// 如果配置了树形数据,处理父子节点联动
|
|
752
|
+
if (this.treeConfig) {
|
|
753
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
754
|
+
const source = dataStore.store.get('source');
|
|
755
|
+
indices.forEach((index) => {
|
|
756
|
+
const row = source[index];
|
|
757
|
+
if (row) {
|
|
758
|
+
// 获取所有子节点
|
|
759
|
+
const childIndices = this.getChildrenIndices(source, row);
|
|
760
|
+
indicesToDeselect.push(...childIndices);
|
|
761
|
+
}
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
indicesToDeselect.forEach((index) => selectedSet.delete(index));
|
|
765
|
+
this.emitSelectionChange();
|
|
766
|
+
this.refreshViewports();
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* 获取选中行的指定字段值列表
|
|
770
|
+
* @param field 字段名,如 'id'、'key' 等
|
|
771
|
+
* @param rowType 行类型,默认 'rgRow'
|
|
772
|
+
* @returns 字段值数组
|
|
773
|
+
*/
|
|
774
|
+
getSelectedFieldValues(field, rowType = 'rgRow') {
|
|
775
|
+
const selectedSet = this.selected.get(rowType);
|
|
776
|
+
if (!selectedSet)
|
|
777
|
+
return [];
|
|
778
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
779
|
+
const source = dataStore.store.get('source');
|
|
780
|
+
const values = [];
|
|
781
|
+
selectedSet.forEach((physicalIndex) => {
|
|
782
|
+
const row = source[physicalIndex];
|
|
783
|
+
if (row && row[field] !== undefined) {
|
|
784
|
+
values.push(row[field]);
|
|
785
|
+
}
|
|
786
|
+
});
|
|
787
|
+
return values;
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* 获取所有选中行的数据(扁平数组)
|
|
791
|
+
* @param rowType 行类型,默认 'rgRow'
|
|
792
|
+
* @returns 选中行数据数组
|
|
793
|
+
*/
|
|
794
|
+
getSelectedData(rowType = 'rgRow') {
|
|
795
|
+
const selectedSet = this.selected.get(rowType);
|
|
796
|
+
if (!selectedSet)
|
|
797
|
+
return [];
|
|
798
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
799
|
+
const source = dataStore.store.get('source');
|
|
800
|
+
const rows = [];
|
|
801
|
+
selectedSet.forEach((physicalIndex) => {
|
|
802
|
+
if (source[physicalIndex]) {
|
|
803
|
+
rows.push(source[physicalIndex]);
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
return rows;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* 获取选中的根节点数据(过滤掉子节点)
|
|
810
|
+
* 用于树形数据场景,只返回顶层选中的节点
|
|
811
|
+
* @param rowType 行类型,默认 'rgRow'
|
|
812
|
+
* @returns 根节点数据数组
|
|
813
|
+
*/
|
|
814
|
+
getSelectedRootData(rowType = 'rgRow') {
|
|
815
|
+
if (!this.treeConfig) {
|
|
816
|
+
// 没有配置树形,返回所有选中数据
|
|
817
|
+
return this.getSelectedData(rowType);
|
|
818
|
+
}
|
|
819
|
+
const { idField, parentIdField, rootParentId } = this.treeConfig;
|
|
820
|
+
const selectedData = this.getSelectedData(rowType);
|
|
821
|
+
// 构建选中 ID 集合
|
|
822
|
+
const selectedIds = new Set(selectedData.map(row => row[idField]));
|
|
823
|
+
// 过滤:只保留父节点不在选中集合中的行(即根节点)
|
|
824
|
+
return selectedData.filter(row => {
|
|
825
|
+
const parentId = row[parentIdField];
|
|
826
|
+
// 如果父 ID 是根节点值,或者父节点不在选中集合中,则为根节点
|
|
827
|
+
return parentId === rootParentId || parentId === null || parentId === undefined || !selectedIds.has(parentId);
|
|
828
|
+
});
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* 获取选中根节点的指定字段值列表(过滤掉子节点)
|
|
832
|
+
* @param field 字段名,如 'id'、'key' 等
|
|
833
|
+
* @param rowType 行类型,默认 'rgRow'
|
|
834
|
+
* @returns 字段值数组
|
|
835
|
+
*/
|
|
836
|
+
getSelectedRootFieldValues(field, rowType = 'rgRow') {
|
|
837
|
+
const rootData = this.getSelectedRootData(rowType);
|
|
838
|
+
return rootData
|
|
839
|
+
.filter(row => row[field] !== undefined)
|
|
840
|
+
.map(row => row[field]);
|
|
841
|
+
}
|
|
842
|
+
/**
|
|
843
|
+
* 根据 ID 高亮某一行
|
|
844
|
+
* @param id 行的 ID 值
|
|
845
|
+
* @param idField 可选,ID 字段名,默认使用配置的 highlightIdField
|
|
846
|
+
* @deprecated 请使用 applyRowStyle('highlight', [id], idField) 代替
|
|
847
|
+
*/
|
|
848
|
+
highlightRowById(id, idField) {
|
|
849
|
+
this.applyRowStyle('highlight', [id], idField);
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* 清除行高亮
|
|
853
|
+
* @deprecated 请使用 clearRowStyle('highlight') 代替
|
|
854
|
+
*/
|
|
855
|
+
clearHighlight() {
|
|
856
|
+
this.clearRowStyle('highlight');
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* 获取当前高亮的行 ID
|
|
860
|
+
* @deprecated 请使用 getRowStyleIds('highlight') 代替
|
|
861
|
+
*/
|
|
862
|
+
getHighlightedRowId() {
|
|
863
|
+
const ids = this.rowStyleIds.get('highlight');
|
|
864
|
+
return ids && ids.size > 0 ? Array.from(ids)[0] : null;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* 获取当前高亮的行数据
|
|
868
|
+
* @param rowType 行类型,默认 'rgRow'
|
|
869
|
+
*/
|
|
870
|
+
getHighlightedRowData(rowType = 'rgRow') {
|
|
871
|
+
const highlightedId = this.getHighlightedRowId();
|
|
872
|
+
if (highlightedId === null)
|
|
873
|
+
return null;
|
|
874
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
875
|
+
const source = dataStore.store.get('source');
|
|
876
|
+
for (const row of source) {
|
|
877
|
+
if (row && row[this.highlightIdField] === highlightedId) {
|
|
878
|
+
return row;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* 为指定行应用样式(高亮或背景色)
|
|
885
|
+
* @param type 样式类型:'highlight' 使用高亮色,'background' 使用 hover 背景色
|
|
886
|
+
* @param ids 行的 ID 值数组
|
|
887
|
+
* @param idField 可选,ID 字段名,默认使用配置的 highlightIdField
|
|
888
|
+
*/
|
|
889
|
+
applyRowStyle(type, ids, idField) {
|
|
890
|
+
const styleSet = this.rowStyleIds.get(type);
|
|
891
|
+
if (!styleSet)
|
|
892
|
+
return;
|
|
893
|
+
const styleIdField = idField || this.highlightIdField;
|
|
894
|
+
if (type === 'highlight') {
|
|
895
|
+
this.logHighlightTrace('applyRowStyle.input', {
|
|
896
|
+
type,
|
|
897
|
+
ids,
|
|
898
|
+
idField: styleIdField,
|
|
899
|
+
beforeSize: styleSet.size,
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
if (type === 'focused') {
|
|
903
|
+
styleSet.clear();
|
|
904
|
+
const firstId = ids[0];
|
|
905
|
+
if (firstId !== undefined && firstId !== null) {
|
|
906
|
+
styleSet.add(firstId);
|
|
907
|
+
}
|
|
908
|
+
this.updateRowStyleAttribute(type, styleIdField);
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
ids.forEach((id) => styleSet.add(id));
|
|
912
|
+
if (type === 'highlight') {
|
|
913
|
+
this.logHighlightTrace('applyRowStyle.after-set', {
|
|
914
|
+
type,
|
|
915
|
+
ids,
|
|
916
|
+
idField: styleIdField,
|
|
917
|
+
afterSize: styleSet.size,
|
|
918
|
+
highlightedIds: Array.from(styleSet),
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
this.updateRowStyleAttribute(type, styleIdField);
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* 移除指定行的样式
|
|
925
|
+
* @param type 样式类型:'highlight' 或 'background'
|
|
926
|
+
* @param ids 行的 ID 值数组,如果不传则移除该类型所有行的样式
|
|
927
|
+
* @param idField 可选,ID 字段名,默认使用配置的 highlightIdField
|
|
928
|
+
*/
|
|
929
|
+
removeRowStyle(type, ids, idField) {
|
|
930
|
+
const styleSet = this.rowStyleIds.get(type);
|
|
931
|
+
if (!styleSet)
|
|
932
|
+
return;
|
|
933
|
+
const styleIdField = idField || this.highlightIdField;
|
|
934
|
+
if (type === 'highlight') {
|
|
935
|
+
this.logHighlightTrace('removeRowStyle.input', {
|
|
936
|
+
type,
|
|
937
|
+
ids,
|
|
938
|
+
idField: styleIdField,
|
|
939
|
+
beforeSize: styleSet.size,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
if (ids) {
|
|
943
|
+
ids.forEach((id) => styleSet.delete(id));
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
styleSet.clear();
|
|
947
|
+
}
|
|
948
|
+
if (type === 'highlight') {
|
|
949
|
+
this.logHighlightTrace('removeRowStyle.after-set', {
|
|
950
|
+
type,
|
|
951
|
+
ids,
|
|
952
|
+
idField: styleIdField,
|
|
953
|
+
afterSize: styleSet.size,
|
|
954
|
+
highlightedIds: Array.from(styleSet),
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
this.updateRowStyleAttribute(type, styleIdField);
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* 清除指定类型的所有行样式
|
|
961
|
+
* @param type 样式类型:'highlight' 或 'background'
|
|
962
|
+
*/
|
|
963
|
+
clearRowStyle(type) {
|
|
964
|
+
const styleSet = this.rowStyleIds.get(type);
|
|
965
|
+
if (!styleSet)
|
|
966
|
+
return;
|
|
967
|
+
if (type === 'highlight') {
|
|
968
|
+
this.logHighlightTrace('clearRowStyle.input', {
|
|
969
|
+
type,
|
|
970
|
+
beforeSize: styleSet.size,
|
|
971
|
+
highlightedIds: Array.from(styleSet),
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
styleSet.clear();
|
|
975
|
+
this.clearRowStyleAttribute(type);
|
|
976
|
+
this.refreshViewports();
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* 获取已应用样式的行 ID
|
|
980
|
+
* @param type 样式类型:'highlight' 或 'background'
|
|
981
|
+
*/
|
|
982
|
+
getRowStyleIds(type) {
|
|
983
|
+
return this.rowStyleIds.get(type) || new Set();
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* 清除所有行样式(高亮和背景色)
|
|
987
|
+
*/
|
|
988
|
+
clearAllRowStyles() {
|
|
989
|
+
this.rowStyleIds.forEach((styleSet, type) => {
|
|
990
|
+
styleSet.clear();
|
|
991
|
+
this.clearRowStyleAttribute(type);
|
|
992
|
+
});
|
|
993
|
+
this.refreshViewports();
|
|
994
|
+
}
|
|
995
|
+
// ==================== 私有方法 ====================
|
|
996
|
+
/**
|
|
997
|
+
* 注入自定义样式
|
|
998
|
+
*/
|
|
999
|
+
injectCustomStyles() {
|
|
1000
|
+
var _a, _b, _c, _d, _e, _f, _g, _j, _k, _l, _m;
|
|
1001
|
+
if (!ENABLE_ROW_SELECT_PLUGIN_STYLES) {
|
|
1002
|
+
return;
|
|
1003
|
+
}
|
|
1004
|
+
// 如果没有配置样式,则不注入
|
|
1005
|
+
if (!this.selectedRowStyle && !this.hoverRowStyle && !this.highlightRowStyle && !this.focusedRowStyle) {
|
|
1006
|
+
return;
|
|
1007
|
+
}
|
|
1008
|
+
// 创建 style 元素
|
|
1009
|
+
this.styleElement = document.createElement('style');
|
|
1010
|
+
this.styleElement.setAttribute('data-revogrid-row-select-styles', '');
|
|
1011
|
+
// 设置 CSS 变量到 revo-grid 元素
|
|
1012
|
+
if ((_a = this.selectedRowStyle) === null || _a === void 0 ? void 0 : _a.backgroundColor) {
|
|
1013
|
+
this.revogrid.style.setProperty('--revo-row-selected-bg', this.selectedRowStyle.backgroundColor);
|
|
1014
|
+
}
|
|
1015
|
+
if ((_b = this.highlightRowStyle) === null || _b === void 0 ? void 0 : _b.backgroundColor) {
|
|
1016
|
+
this.revogrid.style.setProperty('--revo-row-highlight-bg', this.highlightRowStyle.backgroundColor);
|
|
1017
|
+
}
|
|
1018
|
+
else if ((_c = this.selectedRowStyle) === null || _c === void 0 ? void 0 : _c.backgroundColor) {
|
|
1019
|
+
// 默认使用选中行的颜色
|
|
1020
|
+
this.revogrid.style.setProperty('--revo-row-highlight-bg', this.selectedRowStyle.backgroundColor);
|
|
1021
|
+
}
|
|
1022
|
+
if ((_d = this.focusedRowStyle) === null || _d === void 0 ? void 0 : _d.backgroundColor) {
|
|
1023
|
+
this.revogrid.style.setProperty('--revo-row-focused-bg', this.focusedRowStyle.backgroundColor);
|
|
1024
|
+
}
|
|
1025
|
+
if ((_e = this.hoverRowStyle) === null || _e === void 0 ? void 0 : _e.backgroundColor) {
|
|
1026
|
+
this.revogrid.style.setProperty('--revo-row-hover-bg', this.hoverRowStyle.backgroundColor);
|
|
1027
|
+
}
|
|
1028
|
+
let css = '';
|
|
1029
|
+
// wheel-capture 行默认透明,避免滚动虚拟渲染时短暂覆盖底层单元格/行背景导致闪烁
|
|
1030
|
+
css += `
|
|
1031
|
+
revo-grid .wheel-capture-row {
|
|
1032
|
+
background-color: transparent !important;
|
|
1033
|
+
}
|
|
1034
|
+
`;
|
|
1035
|
+
// 选中行样式 - 作用在真实数据行,避免 overlay 层覆盖单元格内容导致闪烁
|
|
1036
|
+
if ((_f = this.selectedRowStyle) === null || _f === void 0 ? void 0 : _f.backgroundColor) {
|
|
1037
|
+
css += `
|
|
1038
|
+
revo-grid revogr-data .rgRow:not(.groupingRow)[selected='true'],
|
|
1039
|
+
revo-grid revogr-data .rgRow:not(.groupingRow)[selected=''] {
|
|
1040
|
+
background-color: var(--revo-row-selected-bg) !important;
|
|
1041
|
+
}
|
|
1042
|
+
`;
|
|
1043
|
+
}
|
|
1044
|
+
// 高亮行样式 - 独立于选中状态
|
|
1045
|
+
if (((_g = this.highlightRowStyle) === null || _g === void 0 ? void 0 : _g.backgroundColor) || ((_j = this.selectedRowStyle) === null || _j === void 0 ? void 0 : _j.backgroundColor)) {
|
|
1046
|
+
css += `
|
|
1047
|
+
revo-grid revogr-data .rgRow:not(.groupingRow)[data-highlighted='true'] {
|
|
1048
|
+
background-color: var(--revo-row-highlight-bg) !important;
|
|
1049
|
+
}
|
|
1050
|
+
`;
|
|
1051
|
+
}
|
|
1052
|
+
// 聚焦行样式 - 独立样式,优先级最高
|
|
1053
|
+
if ((_k = this.focusedRowStyle) === null || _k === void 0 ? void 0 : _k.backgroundColor) {
|
|
1054
|
+
css += `
|
|
1055
|
+
revo-grid revogr-data .rgRow:not(.groupingRow)[data-focused='true'] {
|
|
1056
|
+
background-color: var(--revo-row-focused-bg) !important;
|
|
1057
|
+
}
|
|
1058
|
+
`;
|
|
1059
|
+
}
|
|
1060
|
+
// 未选中行 hover 样式 - 作用在真实数据行;分组行保留 overlay 路径
|
|
1061
|
+
if ((_l = this.hoverRowStyle) === null || _l === void 0 ? void 0 : _l.backgroundColor) {
|
|
1062
|
+
css += `
|
|
1063
|
+
revo-grid revogr-data .rgRow:not(.groupingRow).row-hover-active:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1064
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1065
|
+
}
|
|
1066
|
+
revo-grid revogr-grouping-overlay .rgRow.groupingRow.row-hover-active:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1067
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1068
|
+
}
|
|
1069
|
+
revo-grid .wheel-capture-row.row-hover-active:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1070
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1071
|
+
}
|
|
1072
|
+
/* 程序化应用背景色样式 - 沿用 hover 样式配置 */
|
|
1073
|
+
revo-grid revogr-data .rgRow:not(.groupingRow)[data-row-bg='true']:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1074
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1075
|
+
}
|
|
1076
|
+
revo-grid revogr-grouping-overlay .rgRow.groupingRow[data-row-bg='true']:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1077
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1078
|
+
}
|
|
1079
|
+
revo-grid .wheel-capture-row[data-row-bg='true']:not([selected='true']):not([selected='']):not([data-focused='true']) {
|
|
1080
|
+
background-color: var(--revo-row-hover-bg) !important;
|
|
1081
|
+
}
|
|
1082
|
+
/* 滚动期间临时禁用行层 pointer events,减少 pointerover 带来的样式重算 */
|
|
1083
|
+
revo-grid.row-hover-suspended revogr-grouping-overlay .rgRow,
|
|
1084
|
+
revo-grid.row-hover-suspended revogr-data .rgRow,
|
|
1085
|
+
revo-grid.row-hover-suspended .wheel-capture-row {
|
|
1086
|
+
pointer-events: none !important;
|
|
1087
|
+
}
|
|
1088
|
+
`;
|
|
1089
|
+
}
|
|
1090
|
+
this.styleElement.textContent = css;
|
|
1091
|
+
document.head.appendChild(this.styleElement);
|
|
1092
|
+
// 仅在启用 hover 样式时添加跨视口 hover 同步监听,避免不必要的滚动计算
|
|
1093
|
+
if ((_m = this.hoverRowStyle) === null || _m === void 0 ? void 0 : _m.backgroundColor) {
|
|
1094
|
+
this.setupHoverSync();
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* 设置 hover 同步(跨视口)
|
|
1099
|
+
* 通过添加/移除 row-hover-active 类实现跨视口的 hover 效果
|
|
1100
|
+
*/
|
|
1101
|
+
getRowTypeFromElement(row) {
|
|
1102
|
+
if (!row) {
|
|
1103
|
+
return null;
|
|
1104
|
+
}
|
|
1105
|
+
const container = row.closest('revogr-data, revogr-grouping-overlay');
|
|
1106
|
+
if (!container) {
|
|
1107
|
+
return null;
|
|
1108
|
+
}
|
|
1109
|
+
if (container.tagName === 'REVOGR-GROUPING-OVERLAY') {
|
|
1110
|
+
return 'rgRow';
|
|
1111
|
+
}
|
|
1112
|
+
const rawType = container.getAttribute('type') || container.type;
|
|
1113
|
+
if (rawType === 'rowHeaders') {
|
|
1114
|
+
return 'rgRow';
|
|
1115
|
+
}
|
|
1116
|
+
if (rawType && ROW_TYPES.includes(rawType)) {
|
|
1117
|
+
return rawType;
|
|
1118
|
+
}
|
|
1119
|
+
return null;
|
|
1120
|
+
}
|
|
1121
|
+
getPhysicalIndexFromRow(row, rowType) {
|
|
1122
|
+
const rowIndexAttr = row.getAttribute('data-rgRow');
|
|
1123
|
+
if (!rowIndexAttr) {
|
|
1124
|
+
return null;
|
|
1125
|
+
}
|
|
1126
|
+
const virtualIndex = Number(rowIndexAttr);
|
|
1127
|
+
if (Number.isNaN(virtualIndex)) {
|
|
1128
|
+
return null;
|
|
1129
|
+
}
|
|
1130
|
+
const store = this.providers.data.stores[rowType];
|
|
1131
|
+
if (!store) {
|
|
1132
|
+
return null;
|
|
1133
|
+
}
|
|
1134
|
+
const items = store.store.get('items');
|
|
1135
|
+
const physicalIndex = items[virtualIndex];
|
|
1136
|
+
return physicalIndex === undefined ? null : physicalIndex;
|
|
1137
|
+
}
|
|
1138
|
+
getVirtualIndexFromPhysical(rowType, physicalIndex) {
|
|
1139
|
+
const store = this.providers.data.stores[rowType];
|
|
1140
|
+
if (!store) {
|
|
1141
|
+
return null;
|
|
1142
|
+
}
|
|
1143
|
+
const items = store.store.get('items');
|
|
1144
|
+
const virtualIndex = items.indexOf(physicalIndex);
|
|
1145
|
+
return virtualIndex === -1 ? null : virtualIndex;
|
|
1146
|
+
}
|
|
1147
|
+
getRowElementsByVirtualIndex(rowType, virtualIndex) {
|
|
1148
|
+
const selectors = [
|
|
1149
|
+
`revogr-data[type="${rowType}"] .rgRow[data-rgRow="${virtualIndex}"]`,
|
|
1150
|
+
`.wheel-capture-row[data-rgRow="${virtualIndex}"]`,
|
|
1151
|
+
];
|
|
1152
|
+
if (rowType === 'rgRow') {
|
|
1153
|
+
selectors.push(`revogr-grouping-overlay .rgRow[data-rgRow="${virtualIndex}"]`);
|
|
1154
|
+
selectors.push(`revogr-data[type="rowHeaders"] .rgRow[data-rgRow="${virtualIndex}"]`);
|
|
1155
|
+
}
|
|
1156
|
+
const selector = selectors.join(', ');
|
|
1157
|
+
return this.revogrid.querySelectorAll(selector);
|
|
1158
|
+
}
|
|
1159
|
+
isRowSelected(rowType, physicalIndex) {
|
|
1160
|
+
var _a;
|
|
1161
|
+
return !!((_a = this.selected.get(rowType)) === null || _a === void 0 ? void 0 : _a.has(physicalIndex));
|
|
1162
|
+
}
|
|
1163
|
+
applyHoverClass(rowType, physicalIndex) {
|
|
1164
|
+
const virtualIndex = this.getVirtualIndexFromPhysical(rowType, physicalIndex);
|
|
1165
|
+
if (virtualIndex === null) {
|
|
1166
|
+
return false;
|
|
1167
|
+
}
|
|
1168
|
+
const isSelected = this.isRowSelected(rowType, physicalIndex);
|
|
1169
|
+
const allRowsWithSameIndex = this.getRowElementsByVirtualIndex(rowType, virtualIndex);
|
|
1170
|
+
allRowsWithSameIndex.forEach((row) => {
|
|
1171
|
+
row.classList.remove(isSelected ? ROW_HOVER_ACTIVE_CLASS : ROW_HOVER_SELECTED_ACTIVE_CLASS);
|
|
1172
|
+
row.classList.add(isSelected ? ROW_HOVER_SELECTED_ACTIVE_CLASS : ROW_HOVER_ACTIVE_CLASS);
|
|
1173
|
+
});
|
|
1174
|
+
return true;
|
|
1175
|
+
}
|
|
1176
|
+
clearAllHoverClass() {
|
|
1177
|
+
const allHoverRows = this.revogrid.querySelectorAll(`.rgRow.${ROW_HOVER_ACTIVE_CLASS}, .rgRow.${ROW_HOVER_SELECTED_ACTIVE_CLASS}, .wheel-capture-row.${ROW_HOVER_ACTIVE_CLASS}, .wheel-capture-row.${ROW_HOVER_SELECTED_ACTIVE_CLASS}`);
|
|
1178
|
+
allHoverRows.forEach((row) => {
|
|
1179
|
+
row.classList.remove(ROW_HOVER_ACTIVE_CLASS);
|
|
1180
|
+
row.classList.remove(ROW_HOVER_SELECTED_ACTIVE_CLASS);
|
|
1181
|
+
});
|
|
1182
|
+
this.hoverRowType = null;
|
|
1183
|
+
this.hoverPhysicalIndex = null;
|
|
1184
|
+
}
|
|
1185
|
+
clearWheelCaptureVisualState() {
|
|
1186
|
+
const wheelRows = this.revogrid.querySelectorAll('.wheel-capture-row');
|
|
1187
|
+
wheelRows.forEach((el) => {
|
|
1188
|
+
el.classList.remove(ROW_HOVER_ACTIVE_CLASS);
|
|
1189
|
+
el.classList.remove(ROW_HOVER_SELECTED_ACTIVE_CLASS);
|
|
1190
|
+
this.clearWheelCaptureSelectionState(el);
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
clearWheelCaptureSelectionState(el) {
|
|
1194
|
+
if (el.hasAttribute(SELECTED_ATTRIBUTE)) {
|
|
1195
|
+
el.removeAttribute(SELECTED_ATTRIBUTE);
|
|
1196
|
+
}
|
|
1197
|
+
if (el.hasAttribute('data-highlighted')) {
|
|
1198
|
+
el.removeAttribute('data-highlighted');
|
|
1199
|
+
}
|
|
1200
|
+
if (el.hasAttribute('data-row-bg')) {
|
|
1201
|
+
el.removeAttribute('data-row-bg');
|
|
1202
|
+
}
|
|
1203
|
+
if (el.hasAttribute('data-focused')) {
|
|
1204
|
+
el.removeAttribute('data-focused');
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
clearRenderedRowStyleAttributes() {
|
|
1208
|
+
const attrNames = ['data-highlighted', 'data-row-bg', 'data-focused'];
|
|
1209
|
+
attrNames.forEach((attrName) => {
|
|
1210
|
+
const styledRows = this.revogrid.querySelectorAll(`[${attrName}="true"]`);
|
|
1211
|
+
styledRows.forEach((el) => el.removeAttribute(attrName));
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
normalizeHoverClasses(expectedType, expectedPhysicalIndex) {
|
|
1215
|
+
this.clearAllHoverClass();
|
|
1216
|
+
if (expectedType && expectedPhysicalIndex !== null) {
|
|
1217
|
+
const applied = this.applyHoverClass(expectedType, expectedPhysicalIndex);
|
|
1218
|
+
if (applied) {
|
|
1219
|
+
this.hoverRowType = expectedType;
|
|
1220
|
+
this.hoverPhysicalIndex = expectedPhysicalIndex;
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1223
|
+
this.hoverRowType = null;
|
|
1224
|
+
this.hoverPhysicalIndex = null;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
else {
|
|
1228
|
+
this.hoverRowType = null;
|
|
1229
|
+
this.hoverPhysicalIndex = null;
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
updateHoverFromRow(row) {
|
|
1233
|
+
if (!row) {
|
|
1234
|
+
this.normalizeHoverClasses(null, null);
|
|
1235
|
+
return;
|
|
1236
|
+
}
|
|
1237
|
+
const rowType = this.getRowTypeFromElement(row);
|
|
1238
|
+
if (!rowType) {
|
|
1239
|
+
return;
|
|
1240
|
+
}
|
|
1241
|
+
const physicalIndex = this.getPhysicalIndexFromRow(row, rowType);
|
|
1242
|
+
if (physicalIndex === null) {
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
if (this.hoverRowType === rowType && this.hoverPhysicalIndex === physicalIndex) {
|
|
1246
|
+
return;
|
|
1247
|
+
}
|
|
1248
|
+
// 收敛为单一路径:先清空全部 hover,再应用当前目标,避免旧节点残留
|
|
1249
|
+
this.normalizeHoverClasses(rowType, physicalIndex);
|
|
1250
|
+
}
|
|
1251
|
+
syncHoverFromPointer() {
|
|
1252
|
+
if (this.hoverInteractionSuspended) {
|
|
1253
|
+
this.hoverResyncPending = true;
|
|
1254
|
+
return;
|
|
1255
|
+
}
|
|
1256
|
+
if (this.hoverMouseDown && this.hoverRowType && this.hoverPhysicalIndex !== null) {
|
|
1257
|
+
this.normalizeHoverClasses(this.hoverRowType, this.hoverPhysicalIndex);
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
if (!this.hoverLastPointer) {
|
|
1261
|
+
this.normalizeHoverClasses(null, null);
|
|
1262
|
+
return;
|
|
1263
|
+
}
|
|
1264
|
+
const element = document.elementFromPoint(this.hoverLastPointer.x, this.hoverLastPointer.y);
|
|
1265
|
+
if (!element || !this.revogrid.contains(element)) {
|
|
1266
|
+
const rect = this.revogrid.getBoundingClientRect();
|
|
1267
|
+
const isPointerInsideGrid = this.hoverLastPointer.x >= rect.left &&
|
|
1268
|
+
this.hoverLastPointer.x <= rect.right &&
|
|
1269
|
+
this.hoverLastPointer.y >= rect.top &&
|
|
1270
|
+
this.hoverLastPointer.y <= rect.bottom;
|
|
1271
|
+
if (isPointerInsideGrid && this.hoverRowType && this.hoverPhysicalIndex !== null) {
|
|
1272
|
+
this.normalizeHoverClasses(this.hoverRowType, this.hoverPhysicalIndex);
|
|
1273
|
+
return;
|
|
1274
|
+
}
|
|
1275
|
+
this.normalizeHoverClasses(null, null);
|
|
1276
|
+
return;
|
|
1277
|
+
}
|
|
1278
|
+
const row = element.closest('.rgRow');
|
|
1279
|
+
const rowType = this.getRowTypeFromElement(row);
|
|
1280
|
+
const physicalIndex = row && rowType ? this.getPhysicalIndexFromRow(row, rowType) : null;
|
|
1281
|
+
this.normalizeHoverClasses(rowType, physicalIndex);
|
|
1282
|
+
}
|
|
1283
|
+
blockHoverRender() {
|
|
1284
|
+
if (this.hoverRenderBlocked) {
|
|
1285
|
+
this.hoverResyncPending = true;
|
|
1286
|
+
return;
|
|
1287
|
+
}
|
|
1288
|
+
this.hoverRenderBlocked = true;
|
|
1289
|
+
this.hoverResyncPending = true;
|
|
1290
|
+
}
|
|
1291
|
+
queueHoverResync() {
|
|
1292
|
+
if (!this.hoverSyncEnabled) {
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
if (this.hoverInteractionSuspended) {
|
|
1296
|
+
this.hoverResyncPending = true;
|
|
1297
|
+
return;
|
|
1298
|
+
}
|
|
1299
|
+
if (this.hoverResyncRaf !== null) {
|
|
1300
|
+
cancelAnimationFrame(this.hoverResyncRaf);
|
|
1301
|
+
}
|
|
1302
|
+
this.hoverResyncRaf = requestAnimationFrame(() => {
|
|
1303
|
+
this.hoverResyncRaf = null;
|
|
1304
|
+
if (this.hoverRenderBlocked) {
|
|
1305
|
+
this.hoverResyncPending = true;
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
this.hoverResyncPending = false;
|
|
1309
|
+
this.syncHoverFromPointer();
|
|
1310
|
+
});
|
|
1311
|
+
}
|
|
1312
|
+
scheduleHoverResync(delay = 0) {
|
|
1313
|
+
if (!this.hoverSyncEnabled) {
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
if (this.hoverInteractionSuspended) {
|
|
1317
|
+
this.hoverResyncPending = true;
|
|
1318
|
+
return;
|
|
1319
|
+
}
|
|
1320
|
+
if (this.hoverResyncTimer) {
|
|
1321
|
+
clearTimeout(this.hoverResyncTimer);
|
|
1322
|
+
}
|
|
1323
|
+
if (this.hoverRenderBlocked) {
|
|
1324
|
+
this.hoverResyncPending = true;
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
this.hoverResyncTimer = setTimeout(() => {
|
|
1328
|
+
this.queueHoverResync();
|
|
1329
|
+
}, delay);
|
|
1330
|
+
}
|
|
1331
|
+
queueSelectionAttributeSync() {
|
|
1332
|
+
if (this.selectionAttributeSyncRaf !== null) {
|
|
1333
|
+
return;
|
|
1334
|
+
}
|
|
1335
|
+
this.selectionAttributeSyncRaf = requestAnimationFrame(() => {
|
|
1336
|
+
this.selectionAttributeSyncRaf = null;
|
|
1337
|
+
if (!this.pendingSelectionAttributeSync) {
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
this.pendingSelectionAttributeSync = false;
|
|
1341
|
+
this.updateSelectedAttributes();
|
|
1342
|
+
if (this.hasAnyRowStyles()) {
|
|
1343
|
+
this.rowStyleIds.forEach((styleSet, type) => {
|
|
1344
|
+
if (styleSet.size > 0) {
|
|
1345
|
+
this.updateRowStyleAttribute(type, this.highlightIdField);
|
|
1346
|
+
}
|
|
1347
|
+
});
|
|
1348
|
+
}
|
|
1349
|
+
this.scheduleHoverResync();
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
setHoverSuspendedClass(active) {
|
|
1353
|
+
this.revogrid.classList.toggle('row-hover-suspended', active);
|
|
1354
|
+
}
|
|
1355
|
+
setupHoverSync() {
|
|
1356
|
+
var _a;
|
|
1357
|
+
(_a = this.cleanupHoverSync) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1358
|
+
this.hoverSyncEnabled = true;
|
|
1359
|
+
const handleMouseDown = (e) => {
|
|
1360
|
+
if (this.viewportScrolling) {
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
this.hoverMouseDown = true;
|
|
1364
|
+
this.hoverLastPointer = { x: e.clientX, y: e.clientY };
|
|
1365
|
+
const target = e.target;
|
|
1366
|
+
const row = (target === null || target === void 0 ? void 0 : target.closest) ? target.closest('.rgRow') : null;
|
|
1367
|
+
this.updateHoverFromRow(row);
|
|
1368
|
+
};
|
|
1369
|
+
const handleMouseUp = (e) => {
|
|
1370
|
+
if (this.viewportScrolling) {
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
this.hoverMouseDown = false;
|
|
1374
|
+
this.hoverLastPointer = { x: e.clientX, y: e.clientY };
|
|
1375
|
+
if (this.hoverInteractionSuspended) {
|
|
1376
|
+
this.hoverResyncPending = true;
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
this.syncHoverFromPointer();
|
|
1380
|
+
};
|
|
1381
|
+
const handleMouseMove = (e) => {
|
|
1382
|
+
if (this.viewportScrolling) {
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
if (this.hoverInteractionSuspended) {
|
|
1386
|
+
this.hoverLastPointer = { x: e.clientX, y: e.clientY };
|
|
1387
|
+
this.hoverResyncPending = true;
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
const now = performance.now();
|
|
1391
|
+
if (now - this.lastHoverPointerSyncAt < HOVER_POINTER_SYNC_INTERVAL) {
|
|
1392
|
+
this.hoverLastPointer = { x: e.clientX, y: e.clientY };
|
|
1393
|
+
return;
|
|
1394
|
+
}
|
|
1395
|
+
this.lastHoverPointerSyncAt = now;
|
|
1396
|
+
if (this.hoverSyncProcessing)
|
|
1397
|
+
return;
|
|
1398
|
+
this.hoverSyncProcessing = true;
|
|
1399
|
+
this.hoverLastPointer = { x: e.clientX, y: e.clientY };
|
|
1400
|
+
requestAnimationFrame(() => {
|
|
1401
|
+
if (this.hoverRenderBlocked) {
|
|
1402
|
+
this.hoverSyncProcessing = false;
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
const target = e.target;
|
|
1406
|
+
const row = (target === null || target === void 0 ? void 0 : target.closest) ? target.closest('.rgRow') : null;
|
|
1407
|
+
this.updateHoverFromRow(row);
|
|
1408
|
+
this.hoverSyncProcessing = false;
|
|
1409
|
+
});
|
|
1410
|
+
};
|
|
1411
|
+
const handleMouseLeave = (e) => {
|
|
1412
|
+
if (this.viewportScrolling) {
|
|
1413
|
+
return;
|
|
1414
|
+
}
|
|
1415
|
+
if (this.hoverInteractionSuspended) {
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
if (this.hoverMouseDown) {
|
|
1419
|
+
return;
|
|
1420
|
+
}
|
|
1421
|
+
const relatedTarget = e.relatedTarget;
|
|
1422
|
+
if (relatedTarget && this.revogrid.contains(relatedTarget)) {
|
|
1423
|
+
return;
|
|
1424
|
+
}
|
|
1425
|
+
const pointer = { x: e.clientX, y: e.clientY };
|
|
1426
|
+
this.hoverLastPointer = pointer;
|
|
1427
|
+
requestAnimationFrame(() => {
|
|
1428
|
+
const element = document.elementFromPoint(pointer.x, pointer.y);
|
|
1429
|
+
if (element && this.revogrid.contains(element)) {
|
|
1430
|
+
const row = element.closest('.rgRow');
|
|
1431
|
+
this.updateHoverFromRow(row);
|
|
1432
|
+
return;
|
|
1433
|
+
}
|
|
1434
|
+
this.clearAllHoverClass();
|
|
1435
|
+
this.hoverLastPointer = null;
|
|
1436
|
+
});
|
|
1437
|
+
};
|
|
1438
|
+
this.revogrid.addEventListener('mousedown', handleMouseDown);
|
|
1439
|
+
document.addEventListener('mouseup', handleMouseUp);
|
|
1440
|
+
this.revogrid.addEventListener('mousemove', handleMouseMove);
|
|
1441
|
+
this.revogrid.addEventListener('mouseleave', handleMouseLeave);
|
|
1442
|
+
this.cleanupHoverSync = () => {
|
|
1443
|
+
this.revogrid.removeEventListener('mousedown', handleMouseDown);
|
|
1444
|
+
document.removeEventListener('mouseup', handleMouseUp);
|
|
1445
|
+
this.revogrid.removeEventListener('mousemove', handleMouseMove);
|
|
1446
|
+
this.revogrid.removeEventListener('mouseleave', handleMouseLeave);
|
|
1447
|
+
this.hoverMouseDown = false;
|
|
1448
|
+
this.hoverSyncProcessing = false;
|
|
1449
|
+
this.hoverInteractionSuspended = false;
|
|
1450
|
+
this.setHoverSuspendedClass(false);
|
|
1451
|
+
this.lastHoverPointerSyncAt = 0;
|
|
1452
|
+
};
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* 获取所有子节点的索引(递归)
|
|
1456
|
+
*/
|
|
1457
|
+
getChildrenIndices(source, parentRow) {
|
|
1458
|
+
if (!this.treeConfig)
|
|
1459
|
+
return [];
|
|
1460
|
+
const { idField, parentIdField } = this.treeConfig;
|
|
1461
|
+
const parentId = parentRow[idField];
|
|
1462
|
+
const childIndices = [];
|
|
1463
|
+
// 遍历所有行,找到子节点
|
|
1464
|
+
source.forEach((row, index) => {
|
|
1465
|
+
if (row[parentIdField] === parentId) {
|
|
1466
|
+
childIndices.push(index);
|
|
1467
|
+
// 递归获取子节点的子节点
|
|
1468
|
+
const grandChildIndices = this.getChildrenIndices(source, row);
|
|
1469
|
+
childIndices.push(...grandChildIndices);
|
|
1470
|
+
}
|
|
1471
|
+
});
|
|
1472
|
+
return childIndices;
|
|
1473
|
+
}
|
|
1474
|
+
isTruthyRowFlag(value) {
|
|
1475
|
+
return value === '' || value === true || value === 'true';
|
|
1476
|
+
}
|
|
1477
|
+
getRowIdByPhysicalIndex(rowType, physicalIndex, idField) {
|
|
1478
|
+
var _a;
|
|
1479
|
+
const source = (_a = this.providers.data.stores[rowType]) === null || _a === void 0 ? void 0 : _a.store.get('source');
|
|
1480
|
+
const rowData = source === null || source === void 0 ? void 0 : source[physicalIndex];
|
|
1481
|
+
return rowData ? rowData[idField] : null;
|
|
1482
|
+
}
|
|
1483
|
+
logHighlightTrace(event, payload) {
|
|
1484
|
+
if (!DEBUG_ROW_HIGHLIGHT_TRACE) {
|
|
1485
|
+
return;
|
|
1486
|
+
}
|
|
1487
|
+
console.log('[RowSelectPlugin][highlight]', event, payload);
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* 更新行样式属性
|
|
1491
|
+
*/
|
|
1492
|
+
updateRowStyleAttribute(type, idField) {
|
|
1493
|
+
if (type === 'highlight') {
|
|
1494
|
+
this.logHighlightTrace('updateRowStyleAttribute.start', {
|
|
1495
|
+
type,
|
|
1496
|
+
idField,
|
|
1497
|
+
highlightIds: Array.from(this.rowStyleIds.get(type) || []),
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
// 先清除该类型的所有样式
|
|
1501
|
+
this.clearRowStyleAttribute(type);
|
|
1502
|
+
const styleSet = this.rowStyleIds.get(type);
|
|
1503
|
+
if (!styleSet || styleSet.size === 0)
|
|
1504
|
+
return;
|
|
1505
|
+
const attrName = type === 'highlight' ? 'data-highlighted' : type === 'focused' ? 'data-focused' : 'data-row-bg';
|
|
1506
|
+
// 基于当前已渲染行反查 physicalIndex 与 rowData,避免虚拟索引切换窗口期误写导致闪烁
|
|
1507
|
+
const renderedRows = this.revogrid.querySelectorAll('.rgRow[data-rgRow]');
|
|
1508
|
+
renderedRows.forEach((el) => {
|
|
1509
|
+
const rowEl = el;
|
|
1510
|
+
const rowType = this.getRowTypeFromElement(rowEl);
|
|
1511
|
+
if (!rowType) {
|
|
1512
|
+
return;
|
|
1513
|
+
}
|
|
1514
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
1515
|
+
if (!dataStore) {
|
|
1516
|
+
return;
|
|
1517
|
+
}
|
|
1518
|
+
const physicalIndex = this.getPhysicalIndexFromRow(rowEl, rowType);
|
|
1519
|
+
if (physicalIndex === null) {
|
|
1520
|
+
return;
|
|
1521
|
+
}
|
|
1522
|
+
const source = dataStore.store.get('source');
|
|
1523
|
+
const rowData = source === null || source === void 0 ? void 0 : source[physicalIndex];
|
|
1524
|
+
if (!rowData) {
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
const rowId = rowData[idField];
|
|
1528
|
+
if (rowId === undefined || rowId === null) {
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
if (styleSet.has(rowId)) {
|
|
1532
|
+
const prevValue = rowEl.getAttribute(attrName);
|
|
1533
|
+
rowEl.setAttribute(attrName, 'true');
|
|
1534
|
+
if (type === 'highlight') {
|
|
1535
|
+
this.logHighlightTrace('updateRowStyleAttribute.set-row-attr', {
|
|
1536
|
+
attrName,
|
|
1537
|
+
rowType,
|
|
1538
|
+
virtualIndex: rowEl.getAttribute('data-rgRow'),
|
|
1539
|
+
physicalIndex,
|
|
1540
|
+
rowId,
|
|
1541
|
+
prevValue,
|
|
1542
|
+
nextValue: 'true',
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
}
|
|
1546
|
+
});
|
|
1547
|
+
// 更新 revo-grid 元素的属性
|
|
1548
|
+
if (type === 'highlight') {
|
|
1549
|
+
this.revogrid.setAttribute('data-highlighted-rows', JSON.stringify(Array.from(styleSet)));
|
|
1550
|
+
this.logHighlightTrace('updateRowStyleAttribute.set-grid-attr', {
|
|
1551
|
+
attrName: 'data-highlighted-rows',
|
|
1552
|
+
highlightIds: Array.from(styleSet),
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
else if (type === 'focused') {
|
|
1556
|
+
this.revogrid.setAttribute('data-focused-rows', JSON.stringify(Array.from(styleSet)));
|
|
1557
|
+
}
|
|
1558
|
+
else {
|
|
1559
|
+
this.revogrid.setAttribute('data-row-bg-ids', JSON.stringify(Array.from(styleSet)));
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* 清除行样式属性
|
|
1564
|
+
*/
|
|
1565
|
+
clearRowStyleAttribute(type) {
|
|
1566
|
+
const attrName = type === 'highlight' ? 'data-highlighted' : type === 'focused' ? 'data-focused' : 'data-row-bg';
|
|
1567
|
+
// 移除所有行的样式属性
|
|
1568
|
+
const styledRows = this.revogrid.querySelectorAll(`[${attrName}="true"]`);
|
|
1569
|
+
if (type === 'highlight') {
|
|
1570
|
+
this.logHighlightTrace('clearRowStyleAttribute.start', {
|
|
1571
|
+
attrName,
|
|
1572
|
+
rowCount: styledRows.length,
|
|
1573
|
+
});
|
|
1574
|
+
}
|
|
1575
|
+
styledRows.forEach((el) => {
|
|
1576
|
+
if (type === 'highlight') {
|
|
1577
|
+
const row = el;
|
|
1578
|
+
const rowType = this.getRowTypeFromElement(row);
|
|
1579
|
+
const physicalIndex = rowType ? this.getPhysicalIndexFromRow(row, rowType) : null;
|
|
1580
|
+
const rowId = rowType && physicalIndex !== null
|
|
1581
|
+
? this.getRowIdByPhysicalIndex(rowType, physicalIndex, this.highlightIdField)
|
|
1582
|
+
: null;
|
|
1583
|
+
this.logHighlightTrace('clearRowStyleAttribute.remove-row-attr', {
|
|
1584
|
+
attrName,
|
|
1585
|
+
rowType,
|
|
1586
|
+
virtualIndex: row.getAttribute('data-rgRow'),
|
|
1587
|
+
physicalIndex,
|
|
1588
|
+
rowId,
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
el.removeAttribute(attrName);
|
|
1592
|
+
});
|
|
1593
|
+
// 移除 revo-grid 元素的属性
|
|
1594
|
+
if (type === 'highlight') {
|
|
1595
|
+
this.revogrid.removeAttribute('data-highlighted-rows');
|
|
1596
|
+
this.logHighlightTrace('clearRowStyleAttribute.remove-grid-attr', {
|
|
1597
|
+
attrName: 'data-highlighted-rows',
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
else if (type === 'focused') {
|
|
1601
|
+
this.revogrid.removeAttribute('data-focused-rows');
|
|
1602
|
+
}
|
|
1603
|
+
else {
|
|
1604
|
+
this.revogrid.removeAttribute('data-row-bg-ids');
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
hasAnySelectedRows() {
|
|
1608
|
+
var _a, _b, _c;
|
|
1609
|
+
return (!!((_a = this.selected.get('rowPinStart')) === null || _a === void 0 ? void 0 : _a.size) ||
|
|
1610
|
+
!!((_b = this.selected.get('rgRow')) === null || _b === void 0 ? void 0 : _b.size) ||
|
|
1611
|
+
!!((_c = this.selected.get('rowPinEnd')) === null || _c === void 0 ? void 0 : _c.size));
|
|
1612
|
+
}
|
|
1613
|
+
hasAnyRowStyles() {
|
|
1614
|
+
var _a, _b, _c;
|
|
1615
|
+
return (!!((_a = this.rowStyleIds.get('highlight')) === null || _a === void 0 ? void 0 : _a.size) ||
|
|
1616
|
+
!!((_b = this.rowStyleIds.get('background')) === null || _b === void 0 ? void 0 : _b.size) ||
|
|
1617
|
+
!!((_c = this.rowStyleIds.get('focused')) === null || _c === void 0 ? void 0 : _c.size));
|
|
1618
|
+
}
|
|
1619
|
+
getRowStyleFlags(rowType, physicalIndex) {
|
|
1620
|
+
var _a, _b, _c, _d;
|
|
1621
|
+
const source = (_a = this.providers.data.stores[rowType]) === null || _a === void 0 ? void 0 : _a.store.get('source');
|
|
1622
|
+
const rowData = source === null || source === void 0 ? void 0 : source[physicalIndex];
|
|
1623
|
+
if (!rowData) {
|
|
1624
|
+
return {
|
|
1625
|
+
highlighted: false,
|
|
1626
|
+
background: false,
|
|
1627
|
+
focused: false,
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
const id = rowData[this.highlightIdField];
|
|
1631
|
+
if (id === undefined || id === null) {
|
|
1632
|
+
return {
|
|
1633
|
+
highlighted: false,
|
|
1634
|
+
background: false,
|
|
1635
|
+
focused: false,
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
return {
|
|
1639
|
+
highlighted: !!((_b = this.rowStyleIds.get('highlight')) === null || _b === void 0 ? void 0 : _b.has(id)),
|
|
1640
|
+
background: !!((_c = this.rowStyleIds.get('background')) === null || _c === void 0 ? void 0 : _c.has(id)),
|
|
1641
|
+
focused: !!((_d = this.rowStyleIds.get('focused')) === null || _d === void 0 ? void 0 : _d.has(id)),
|
|
1642
|
+
};
|
|
1643
|
+
}
|
|
1644
|
+
applyRowStyleFlagsToAttrs(attrs, flags, context) {
|
|
1645
|
+
const prevHighlighted = this.isTruthyRowFlag(attrs['data-highlighted']);
|
|
1646
|
+
const setFlag = (attrName, enabled) => {
|
|
1647
|
+
if (enabled) {
|
|
1648
|
+
attrs[attrName] = 'true';
|
|
1649
|
+
return;
|
|
1650
|
+
}
|
|
1651
|
+
if (attrName in attrs) {
|
|
1652
|
+
delete attrs[attrName];
|
|
1653
|
+
}
|
|
1654
|
+
};
|
|
1655
|
+
setFlag('data-highlighted', flags.highlighted);
|
|
1656
|
+
setFlag('data-row-bg', flags.background);
|
|
1657
|
+
setFlag('data-focused', flags.focused);
|
|
1658
|
+
const nextHighlighted = this.isTruthyRowFlag(attrs['data-highlighted']);
|
|
1659
|
+
if (prevHighlighted !== nextHighlighted || nextHighlighted) {
|
|
1660
|
+
this.logHighlightTrace('applyRowStyleFlagsToAttrs', Object.assign(Object.assign({}, context), { flags,
|
|
1661
|
+
prevHighlighted,
|
|
1662
|
+
nextHighlighted }));
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
/**
|
|
1666
|
+
* 判断是否为复选框列
|
|
1667
|
+
*/
|
|
1668
|
+
isCheckboxColumn(column) {
|
|
1669
|
+
var _a;
|
|
1670
|
+
if (column.columnType && ((_a = this.revogrid.columnTypes) === null || _a === void 0 ? void 0 : _a[column.columnType]) instanceof CheckboxCellType) {
|
|
1671
|
+
return true;
|
|
1672
|
+
}
|
|
1673
|
+
return !!column.rowSelect;
|
|
1674
|
+
}
|
|
1675
|
+
/**
|
|
1676
|
+
* 获取选中状态统计
|
|
1677
|
+
*/
|
|
1678
|
+
getSelectionStatus() {
|
|
1679
|
+
let isAllSelected = true;
|
|
1680
|
+
let hasAnySelected = false;
|
|
1681
|
+
let visibleSelectedCount = 0;
|
|
1682
|
+
let totalSelectedCount = 0;
|
|
1683
|
+
let totalRowCount = 0;
|
|
1684
|
+
this.selected.forEach((selectedSet, rowType) => {
|
|
1685
|
+
totalSelectedCount += selectedSet.size;
|
|
1686
|
+
const dataStore = this.providers.data.stores[rowType];
|
|
1687
|
+
const source = dataStore.store.get('source');
|
|
1688
|
+
// 使用 proxyItems(所有行,包括折叠的)来计算全选状态
|
|
1689
|
+
const proxyItems = dataStore.store.get('proxyItems');
|
|
1690
|
+
const items = dataStore.store.get('items');
|
|
1691
|
+
// 计算所有数据行(排除分组行)
|
|
1692
|
+
proxyItems.forEach((itemIndex) => {
|
|
1693
|
+
const rowData = source[itemIndex];
|
|
1694
|
+
// 跳过分组行(分组行有 __rvgr-depth 标记)
|
|
1695
|
+
if (rowData && rowData['__rvgr-depth'] !== undefined) {
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
totalRowCount++;
|
|
1699
|
+
if (selectedSet.has(itemIndex)) {
|
|
1700
|
+
hasAnySelected = true;
|
|
1701
|
+
}
|
|
1702
|
+
else {
|
|
1703
|
+
isAllSelected = false;
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
// 计算可见的选中行数
|
|
1707
|
+
items.forEach((itemIndex) => {
|
|
1708
|
+
const rowData = source[itemIndex];
|
|
1709
|
+
if (rowData && rowData['__rvgr-depth'] !== undefined) {
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
if (selectedSet.has(itemIndex)) {
|
|
1713
|
+
visibleSelectedCount++;
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
});
|
|
1717
|
+
// 如果没有数据行,则不应该显示为全选状态
|
|
1718
|
+
if (totalRowCount === 0) {
|
|
1719
|
+
isAllSelected = false;
|
|
1720
|
+
}
|
|
1721
|
+
return {
|
|
1722
|
+
isSelected: isAllSelected,
|
|
1723
|
+
anySelected: hasAnySelected,
|
|
1724
|
+
visibleSelectedItems: visibleSelectedCount,
|
|
1725
|
+
allSelectedItems: totalSelectedCount,
|
|
1726
|
+
hasData: totalRowCount > 0,
|
|
1727
|
+
};
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* 发出选中状态变化事件
|
|
1731
|
+
*/
|
|
1732
|
+
emitSelectionChange() {
|
|
1733
|
+
const status = this.getSelectionStatus();
|
|
1734
|
+
const detail = {
|
|
1735
|
+
selected: this.selected,
|
|
1736
|
+
count: status.allSelectedItems,
|
|
1737
|
+
allRowsCount: ROW_TYPES.reduce((total, type) => total + this.providers.data.stores[type].store.get('proxyItems').length, 0),
|
|
1738
|
+
visibleCount: status.visibleSelectedItems,
|
|
1739
|
+
visibleRowsCount: ROW_TYPES.reduce((total, type) => total + this.providers.data.stores[type].store.get('items').length, 0),
|
|
1740
|
+
};
|
|
1741
|
+
this.emit(ROW_SELECTED_EVENT, detail);
|
|
1742
|
+
}
|
|
1743
|
+
/**
|
|
1744
|
+
* 刷新视口以更新 UI
|
|
1745
|
+
*/
|
|
1746
|
+
updateSelectedRowsAttribute() {
|
|
1747
|
+
var _a;
|
|
1748
|
+
const selectedIndices = [];
|
|
1749
|
+
const rgSelectedIndices = [];
|
|
1750
|
+
this.selected.forEach((selectedSet) => {
|
|
1751
|
+
selectedSet.forEach((index) => selectedIndices.push(index));
|
|
1752
|
+
});
|
|
1753
|
+
(_a = this.selected.get('rgRow')) === null || _a === void 0 ? void 0 : _a.forEach((index) => rgSelectedIndices.push(index));
|
|
1754
|
+
this.revogrid.setAttribute('data-selected-rows', JSON.stringify(selectedIndices));
|
|
1755
|
+
this.revogrid.setAttribute('data-selected-rg-rows', JSON.stringify(rgSelectedIndices));
|
|
1756
|
+
}
|
|
1757
|
+
getSelectionKeyField(rowType) {
|
|
1758
|
+
var _a;
|
|
1759
|
+
if (rowType === 'rgRow' && ((_a = this.treeConfig) === null || _a === void 0 ? void 0 : _a.idField)) {
|
|
1760
|
+
return this.treeConfig.idField;
|
|
1761
|
+
}
|
|
1762
|
+
return this.highlightIdField;
|
|
1763
|
+
}
|
|
1764
|
+
isGroupingRowData(row) {
|
|
1765
|
+
return !!row && row['__rvgr-depth'] !== undefined;
|
|
1766
|
+
}
|
|
1767
|
+
capturePendingSelectionRemap(rowType) {
|
|
1768
|
+
var _a;
|
|
1769
|
+
const selectedSet = this.selected.get(rowType);
|
|
1770
|
+
if (!selectedSet || selectedSet.size === 0) {
|
|
1771
|
+
this.pendingSelectionRemapByType.delete(rowType);
|
|
1772
|
+
return;
|
|
1773
|
+
}
|
|
1774
|
+
const keyField = this.getSelectionKeyField(rowType);
|
|
1775
|
+
const source = (_a = this.providers.data.stores[rowType]) === null || _a === void 0 ? void 0 : _a.store.get('source');
|
|
1776
|
+
if (!(source === null || source === void 0 ? void 0 : source.length)) {
|
|
1777
|
+
this.pendingSelectionRemapByType.delete(rowType);
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
const keys = [];
|
|
1781
|
+
const rows = [];
|
|
1782
|
+
selectedSet.forEach((physicalIndex) => {
|
|
1783
|
+
const row = source[physicalIndex];
|
|
1784
|
+
if (!row || this.isGroupingRowData(row)) {
|
|
1785
|
+
return;
|
|
1786
|
+
}
|
|
1787
|
+
rows.push(row);
|
|
1788
|
+
const key = row[keyField];
|
|
1789
|
+
if (key === undefined || key === null) {
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
keys.push(key);
|
|
1793
|
+
});
|
|
1794
|
+
if (!keys.length && !rows.length) {
|
|
1795
|
+
this.pendingSelectionRemapByType.delete(rowType);
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
this.pendingSelectionRemapByType.set(rowType, {
|
|
1799
|
+
keyField,
|
|
1800
|
+
keys: Array.from(new Set(keys)),
|
|
1801
|
+
rows,
|
|
1802
|
+
});
|
|
1803
|
+
}
|
|
1804
|
+
applyPendingSelectionRemap(rowType, nextSource) {
|
|
1805
|
+
var _a, _b, _c;
|
|
1806
|
+
const pending = this.pendingSelectionRemapByType.get(rowType);
|
|
1807
|
+
this.pendingSelectionRemapByType.delete(rowType);
|
|
1808
|
+
if (!pending || (!((_a = pending.keys) === null || _a === void 0 ? void 0 : _a.length) && !((_b = pending.rows) === null || _b === void 0 ? void 0 : _b.length))) {
|
|
1809
|
+
return false;
|
|
1810
|
+
}
|
|
1811
|
+
const selectedSet = this.selected.get(rowType);
|
|
1812
|
+
if (!selectedSet) {
|
|
1813
|
+
return false;
|
|
1814
|
+
}
|
|
1815
|
+
const source = nextSource ||
|
|
1816
|
+
((_c = this.providers.data.stores[rowType]) === null || _c === void 0 ? void 0 : _c.store.get('source')) ||
|
|
1817
|
+
[];
|
|
1818
|
+
if (!source.length) {
|
|
1819
|
+
selectedSet.clear();
|
|
1820
|
+
this.lastSelectedIndex = undefined;
|
|
1821
|
+
return true;
|
|
1822
|
+
}
|
|
1823
|
+
const duplicateKeys = new Set();
|
|
1824
|
+
const keyToPhysicalIndex = new Map();
|
|
1825
|
+
const rowToPhysicalIndex = new Map();
|
|
1826
|
+
source.forEach((row, physicalIndex) => {
|
|
1827
|
+
if (!row || this.isGroupingRowData(row)) {
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1830
|
+
rowToPhysicalIndex.set(row, physicalIndex);
|
|
1831
|
+
const key = row[pending.keyField];
|
|
1832
|
+
if (key === undefined || key === null) {
|
|
1833
|
+
return;
|
|
1834
|
+
}
|
|
1835
|
+
if (keyToPhysicalIndex.has(key)) {
|
|
1836
|
+
duplicateKeys.add(key);
|
|
1837
|
+
keyToPhysicalIndex.delete(key);
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
if (!duplicateKeys.has(key)) {
|
|
1841
|
+
keyToPhysicalIndex.set(key, physicalIndex);
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
const nextSelected = new Set();
|
|
1845
|
+
pending.rows.forEach((row) => {
|
|
1846
|
+
const physicalIndex = rowToPhysicalIndex.get(row);
|
|
1847
|
+
if (physicalIndex !== undefined) {
|
|
1848
|
+
nextSelected.add(physicalIndex);
|
|
1849
|
+
}
|
|
1850
|
+
});
|
|
1851
|
+
pending.keys.forEach((key) => {
|
|
1852
|
+
if (duplicateKeys.has(key)) {
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
const physicalIndex = keyToPhysicalIndex.get(key);
|
|
1856
|
+
if (physicalIndex !== undefined) {
|
|
1857
|
+
nextSelected.add(physicalIndex);
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1860
|
+
selectedSet.clear();
|
|
1861
|
+
nextSelected.forEach((index) => selectedSet.add(index));
|
|
1862
|
+
if (this.lastSelectedIndex !== undefined && !selectedSet.has(this.lastSelectedIndex)) {
|
|
1863
|
+
this.lastSelectedIndex = undefined;
|
|
1864
|
+
}
|
|
1865
|
+
return true;
|
|
1866
|
+
}
|
|
1867
|
+
refreshViewports() {
|
|
1868
|
+
// 更新 revo-grid 元素的 data-selected-rows 属性
|
|
1869
|
+
this.updateSelectedRowsAttribute();
|
|
1870
|
+
// 刷新列视口
|
|
1871
|
+
VIEWPORT_TYPES.forEach((viewportType) => {
|
|
1872
|
+
const { store } = this.providers.viewport.stores[viewportType];
|
|
1873
|
+
store.set('items', [...store.get('items')]);
|
|
1874
|
+
});
|
|
1875
|
+
// 刷新 grouping-overlay 组件
|
|
1876
|
+
const groupingOverlays = this.revogrid.querySelectorAll('revogr-grouping-overlay');
|
|
1877
|
+
groupingOverlays.forEach((overlay) => {
|
|
1878
|
+
if (overlay.refresh) {
|
|
1879
|
+
overlay.refresh();
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
// 刷新后在下一帧同步样式和选中状态,避免 setTimeout 带来的“慢一拍”视觉延迟
|
|
1883
|
+
if (this.postRefreshSyncRaf !== null) {
|
|
1884
|
+
cancelAnimationFrame(this.postRefreshSyncRaf);
|
|
1885
|
+
}
|
|
1886
|
+
this.postRefreshSyncRaf = requestAnimationFrame(() => {
|
|
1887
|
+
this.postRefreshSyncRaf = null;
|
|
1888
|
+
// 重新应用行样式
|
|
1889
|
+
this.rowStyleIds.forEach((styleSet, type) => {
|
|
1890
|
+
if (styleSet.size > 0) {
|
|
1891
|
+
this.updateRowStyleAttribute(type, this.highlightIdField);
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
// 重新应用选中状态到DOM元素
|
|
1895
|
+
this.updateSelectedAttributes();
|
|
1896
|
+
});
|
|
1897
|
+
}
|
|
1898
|
+
markViewportScrolling() {
|
|
1899
|
+
this.viewportScrolling = true;
|
|
1900
|
+
this.hoverInteractionSuspended = true;
|
|
1901
|
+
this.setHoverSuspendedClass(true);
|
|
1902
|
+
this.hoverSyncProcessing = false;
|
|
1903
|
+
this.clearAllHoverClass();
|
|
1904
|
+
if (this.hoverResyncTimer) {
|
|
1905
|
+
clearTimeout(this.hoverResyncTimer);
|
|
1906
|
+
this.hoverResyncTimer = null;
|
|
1907
|
+
}
|
|
1908
|
+
if (this.hoverResyncRaf !== null) {
|
|
1909
|
+
cancelAnimationFrame(this.hoverResyncRaf);
|
|
1910
|
+
this.hoverResyncRaf = null;
|
|
1911
|
+
}
|
|
1912
|
+
if (this.viewportScrollIdleTimer) {
|
|
1913
|
+
clearTimeout(this.viewportScrollIdleTimer);
|
|
1914
|
+
}
|
|
1915
|
+
this.viewportScrollIdleTimer = setTimeout(() => {
|
|
1916
|
+
this.viewportScrollIdleTimer = null;
|
|
1917
|
+
this.viewportScrolling = false;
|
|
1918
|
+
this.hoverInteractionSuspended = false;
|
|
1919
|
+
this.setHoverSuspendedClass(false);
|
|
1920
|
+
if (this.pendingWheelSelectionSyncAfterScroll) {
|
|
1921
|
+
this.pendingWheelSelectionSyncAfterScroll = false;
|
|
1922
|
+
this.queueWheelRowSelectionSync(true);
|
|
1923
|
+
}
|
|
1924
|
+
if (this.hoverSyncEnabled && this.hoverLastPointer) {
|
|
1925
|
+
this.queueHoverResync();
|
|
1926
|
+
}
|
|
1927
|
+
}, VIEWPORT_SCROLL_IDLE_DELAY);
|
|
1928
|
+
}
|
|
1929
|
+
queueWheelRowSelectionSync(force = false) {
|
|
1930
|
+
if (force && !this.viewportScrolling) {
|
|
1931
|
+
this.updateWheelCaptureSelectedAttributes();
|
|
1932
|
+
return;
|
|
1933
|
+
}
|
|
1934
|
+
const now = performance.now();
|
|
1935
|
+
if (!force &&
|
|
1936
|
+
this.viewportScrolling &&
|
|
1937
|
+
now - this.lastWheelSelectionSyncAt < WHEEL_SELECTION_SYNC_INTERVAL_ACTIVE) {
|
|
1938
|
+
this.pendingWheelSelectionSyncAfterScroll = true;
|
|
1939
|
+
return;
|
|
1940
|
+
}
|
|
1941
|
+
if (this.wheelRowSelectionSyncRaf !== null) {
|
|
1942
|
+
if (this.viewportScrolling) {
|
|
1943
|
+
this.pendingWheelSelectionSyncAfterScroll = true;
|
|
1944
|
+
}
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
this.wheelRowSelectionSyncRaf = requestAnimationFrame(() => {
|
|
1948
|
+
this.wheelRowSelectionSyncRaf = null;
|
|
1949
|
+
this.lastWheelSelectionSyncAt = performance.now();
|
|
1950
|
+
this.updateWheelCaptureSelectedAttributes();
|
|
1951
|
+
});
|
|
1952
|
+
}
|
|
1953
|
+
updateWheelCaptureSelectedAttributes() {
|
|
1954
|
+
const wheelRows = this.revogrid.querySelectorAll('.wheel-capture-row');
|
|
1955
|
+
wheelRows.forEach((el) => this.clearWheelCaptureSelectionState(el));
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* 更新所有行的选中属性
|
|
1959
|
+
* 用于确保展开分组后,之前被折叠的行也能正确显示选中状态
|
|
1960
|
+
*/
|
|
1961
|
+
updateSelectedAttributes() {
|
|
1962
|
+
const rowElements = this.revogrid.querySelectorAll('.rgRow[data-rgRow]');
|
|
1963
|
+
rowElements.forEach((el) => {
|
|
1964
|
+
var _a;
|
|
1965
|
+
const row = el;
|
|
1966
|
+
const rowType = this.getRowTypeFromElement(row);
|
|
1967
|
+
if (!rowType) {
|
|
1968
|
+
return;
|
|
1969
|
+
}
|
|
1970
|
+
const physicalIndex = this.getPhysicalIndexFromRow(row, rowType);
|
|
1971
|
+
if (physicalIndex === null) {
|
|
1972
|
+
return;
|
|
1973
|
+
}
|
|
1974
|
+
const isSelected = !!((_a = this.selected.get(rowType)) === null || _a === void 0 ? void 0 : _a.has(physicalIndex));
|
|
1975
|
+
if (isSelected) {
|
|
1976
|
+
row.setAttribute(SELECTED_ATTRIBUTE, 'true');
|
|
1977
|
+
}
|
|
1978
|
+
else {
|
|
1979
|
+
row.removeAttribute(SELECTED_ATTRIBUTE);
|
|
1980
|
+
}
|
|
1981
|
+
});
|
|
1982
|
+
this.updateWheelCaptureSelectedAttributes();
|
|
1983
|
+
}
|
|
1984
|
+
/**
|
|
1985
|
+
* 创建列头模板
|
|
1986
|
+
*/
|
|
1987
|
+
createHeaderTemplate(columnData) {
|
|
1988
|
+
const originalTemplate = columnData.columnTemplate;
|
|
1989
|
+
const checkboxTemplate = this.checkboxCellType.columnTemplate;
|
|
1990
|
+
const customTemplate = this.customHeaderCheckboxTemplate;
|
|
1991
|
+
return (h, props, additionalData) => {
|
|
1992
|
+
const status = this.getSelectionStatus();
|
|
1993
|
+
// 如果有自定义模板,使用自定义模板
|
|
1994
|
+
if (customTemplate) {
|
|
1995
|
+
return customTemplate(h, {
|
|
1996
|
+
allSelected: status.isSelected,
|
|
1997
|
+
indeterminate: status.anySelected && !status.isSelected,
|
|
1998
|
+
onClick: (event) => {
|
|
1999
|
+
event.preventDefault();
|
|
2000
|
+
const detail = {
|
|
2001
|
+
type: props.providers.type,
|
|
2002
|
+
selected: !status.isSelected,
|
|
2003
|
+
};
|
|
2004
|
+
dispatchCustomEvent(event, ROW_ALL_SELECT_EVENT, detail);
|
|
2005
|
+
},
|
|
2006
|
+
// 传递完整的 props 和 additionalData,方便 Vue 组件使用
|
|
2007
|
+
props,
|
|
2008
|
+
additionalData,
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
const extendedProps = Object.assign(Object.assign({}, props), { allSelected: status.isSelected, allIndeterminate: status.anySelected });
|
|
2012
|
+
if (originalTemplate) {
|
|
2013
|
+
return originalTemplate(h, extendedProps, additionalData);
|
|
2014
|
+
}
|
|
2015
|
+
return checkboxTemplate(h, extendedProps);
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* 创建单元格复选框模板
|
|
2020
|
+
*/
|
|
2021
|
+
createCellCheckboxTemplate() {
|
|
2022
|
+
const defaultTemplate = this.checkboxCellType.cellTemplate;
|
|
2023
|
+
const customTemplate = this.customCheckboxTemplate;
|
|
2024
|
+
return (h, props, additionalData) => {
|
|
2025
|
+
// 如果有自定义模板,使用自定义模板
|
|
2026
|
+
if (customTemplate) {
|
|
2027
|
+
return customTemplate(h, {
|
|
2028
|
+
selected: !!props.selected,
|
|
2029
|
+
onClick: (event) => {
|
|
2030
|
+
event.preventDefault();
|
|
2031
|
+
const detail = Object.assign(Object.assign({}, props), { originalEvent: event });
|
|
2032
|
+
dispatchCustomEvent(event, ROW_SELECT_CLICK_EVENT, detail);
|
|
2033
|
+
},
|
|
2034
|
+
// 传递完整的 props 和 additionalData,方便 Vue 组件使用
|
|
2035
|
+
props,
|
|
2036
|
+
additionalData,
|
|
2037
|
+
});
|
|
2038
|
+
}
|
|
2039
|
+
return defaultTemplate(h, props, additionalData);
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* 单元格模板包装器 - 注入选中状态
|
|
2044
|
+
*/
|
|
2045
|
+
cellTemplateWrapper(_h, props) {
|
|
2046
|
+
var _a;
|
|
2047
|
+
const dataStore = this.providers.data.stores[props.providers.type];
|
|
2048
|
+
const physicalIndex = getPhysicalRowIndex(dataStore.store, props.rowIndex);
|
|
2049
|
+
const isSelected = (_a = this.selected.get(props.type)) === null || _a === void 0 ? void 0 : _a.has(physicalIndex);
|
|
2050
|
+
props.selected = !!isSelected;
|
|
2051
|
+
return '';
|
|
2052
|
+
}
|
|
2053
|
+
destroy() {
|
|
2054
|
+
var _a, _b;
|
|
2055
|
+
(_a = this.cleanupHoverSync) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
2056
|
+
this.cleanupHoverSync = null;
|
|
2057
|
+
if (this.hoverResyncTimer) {
|
|
2058
|
+
clearTimeout(this.hoverResyncTimer);
|
|
2059
|
+
this.hoverResyncTimer = null;
|
|
2060
|
+
}
|
|
2061
|
+
if (this.hoverResyncRaf !== null) {
|
|
2062
|
+
cancelAnimationFrame(this.hoverResyncRaf);
|
|
2063
|
+
this.hoverResyncRaf = null;
|
|
2064
|
+
}
|
|
2065
|
+
if (this.viewportScrollIdleTimer) {
|
|
2066
|
+
clearTimeout(this.viewportScrollIdleTimer);
|
|
2067
|
+
this.viewportScrollIdleTimer = null;
|
|
2068
|
+
}
|
|
2069
|
+
this.hoverInteractionSuspended = false;
|
|
2070
|
+
this.setHoverSuspendedClass(false);
|
|
2071
|
+
this.viewportScrolling = false;
|
|
2072
|
+
this.pendingWheelSelectionSyncAfterScroll = false;
|
|
2073
|
+
this.lastHoverPointerSyncAt = 0;
|
|
2074
|
+
if (this.selectionAttributeSyncRaf !== null) {
|
|
2075
|
+
cancelAnimationFrame(this.selectionAttributeSyncRaf);
|
|
2076
|
+
this.selectionAttributeSyncRaf = null;
|
|
2077
|
+
}
|
|
2078
|
+
if (this.postRefreshSyncRaf !== null) {
|
|
2079
|
+
cancelAnimationFrame(this.postRefreshSyncRaf);
|
|
2080
|
+
this.postRefreshSyncRaf = null;
|
|
2081
|
+
}
|
|
2082
|
+
if (this.wheelRowSelectionSyncRaf !== null) {
|
|
2083
|
+
cancelAnimationFrame(this.wheelRowSelectionSyncRaf);
|
|
2084
|
+
this.wheelRowSelectionSyncRaf = null;
|
|
2085
|
+
}
|
|
2086
|
+
this.pendingSelectionAttributeSync = false;
|
|
2087
|
+
this.pendingSelectionRemapByType.clear();
|
|
2088
|
+
if ((_b = this.styleElement) === null || _b === void 0 ? void 0 : _b.parentNode) {
|
|
2089
|
+
this.styleElement.parentNode.removeChild(this.styleElement);
|
|
2090
|
+
}
|
|
2091
|
+
this.styleElement = undefined;
|
|
2092
|
+
this.selected.clear();
|
|
2093
|
+
super.destroy();
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
//# sourceMappingURL=row-select.plugin.js.map
|