lsp-grid 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/README.md +34 -0
- package/dist/cjs/app-globals-Bfsg1bDt.js +16 -0
- package/dist/cjs/app-globals-Bfsg1bDt.js.map +1 -0
- package/dist/cjs/cell-renderer-DtuYp7tj.js +106 -0
- package/dist/cjs/cell-renderer-DtuYp7tj.js.map +1 -0
- package/dist/cjs/column.drag.plugin-BIptTmfz.js +2554 -0
- package/dist/cjs/column.drag.plugin-BIptTmfz.js.map +1 -0
- package/dist/cjs/column.service-BnVSAfcu.js +1391 -0
- package/dist/cjs/column.service-BnVSAfcu.js.map +1 -0
- package/dist/cjs/data.store-CrF4Nf9q.js +3615 -0
- package/dist/cjs/data.store-CrF4Nf9q.js.map +1 -0
- package/dist/cjs/debounce-DgeyTQM0.js +498 -0
- package/dist/cjs/debounce-DgeyTQM0.js.map +1 -0
- package/dist/cjs/edit.utils-Bw-E3Fj6.js +118 -0
- package/dist/cjs/edit.utils-Bw-E3Fj6.js.map +1 -0
- package/dist/cjs/events-D0Syn6ut.js +46 -0
- package/dist/cjs/events-D0Syn6ut.js.map +1 -0
- package/dist/cjs/filter.button-CaAAXq-6.js +49 -0
- package/dist/cjs/filter.button-CaAAXq-6.js.map +1 -0
- package/dist/cjs/header-cell-renderer-DhRJqZ-w.js +356 -0
- package/dist/cjs/header-cell-renderer-DhRJqZ-w.js.map +1 -0
- package/dist/cjs/index-VM40U6Gh.js +2549 -0
- package/dist/cjs/index-VM40U6Gh.js.map +1 -0
- package/dist/cjs/index.cjs.js +346 -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 +2187 -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-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.cjs.js.map +1 -0
- package/dist/cjs/revogr-attribution_7.cjs.entry.js +1463 -0
- package/dist/cjs/revogr-attribution_7.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 +456 -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 +948 -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-header-utils-DL640c7x.js +420 -0
- package/dist/cjs/row-header-utils-DL640c7x.js.map +1 -0
- package/dist/cjs/text-editor-DWChyeVV.js +81 -0
- package/dist/cjs/text-editor-DWChyeVV.js.map +1 -0
- package/dist/cjs/throttle-Bb1Bbfd1.js +278 -0
- package/dist/cjs/throttle-Bb1Bbfd1.js.map +1 -0
- package/dist/cjs/viewport.helpers-CI6uB8tu.js +59 -0
- package/dist/cjs/viewport.helpers-CI6uB8tu.js.map +1 -0
- package/dist/collection/collection-manifest.json +28 -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 +396 -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 +293 -0
- package/dist/collection/components/data/column.service.js.map +1 -0
- package/dist/collection/components/data/revogr-data-style.css +75 -0
- package/dist/collection/components/data/revogr-data.js +697 -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 +16 -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/header/header-cell-renderer.js +34 -0
- package/dist/collection/components/header/header-cell-renderer.js.map +1 -0
- package/dist/collection/components/header/header-group-renderer.js +25 -0
- package/dist/collection/components/header/header-group-renderer.js.map +1 -0
- package/dist/collection/components/header/header-renderer.js +61 -0
- package/dist/collection/components/header/header-renderer.js.map +1 -0
- package/dist/collection/components/header/resizable.directive.js +237 -0
- package/dist/collection/components/header/resizable.directive.js.map +1 -0
- package/dist/collection/components/header/resizable.element.js +38 -0
- package/dist/collection/components/header/resizable.element.js.map +1 -0
- package/dist/collection/components/header/revogr-header-style.css +144 -0
- package/dist/collection/components/header/revogr-header.js +573 -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 +224 -0
- package/dist/collection/components/overlay/autofill.service.js.map +1 -0
- package/dist/collection/components/overlay/keyboard.service.js +158 -0
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js +1515 -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 +567 -0
- package/dist/collection/components/revoGrid/revo-grid.js +3671 -0
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.helpers.js +49 -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 +90 -0
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -0
- package/dist/collection/components/revoGrid/viewport.service.js +237 -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 +69 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +601 -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 +295 -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 +400 -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.auto-size.plugin.js +225 -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/dispatcher.js +40 -0
- package/dist/collection/plugins/dispatcher.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/groupingRow/grouping.const.js +16 -0
- package/dist/collection/plugins/groupingRow/grouping.const.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +79 -0
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +245 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +38 -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 +178 -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 +15 -0
- package/dist/collection/plugins/index.js.map +1 -0
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js +175 -0
- package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -0
- package/dist/collection/plugins/moveColumn/order-column.handler.js +71 -0
- package/dist/collection/plugins/moveColumn/order-column.handler.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/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/services/cell.helpers.js +12 -0
- package/dist/collection/services/cell.helpers.js.map +1 -0
- package/dist/collection/services/column.data.provider.js +119 -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 +176 -0
- package/dist/collection/services/dimension.provider.js.map +1 -0
- package/dist/collection/services/local.scroll.service.js +124 -0
- package/dist/collection/services/local.scroll.service.js.map +1 -0
- package/dist/collection/services/local.scroll.timer.js +81 -0
- package/dist/collection/services/local.scroll.timer.js.map +1 -0
- package/dist/collection/services/selection.store.connector.js +307 -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 +144 -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 +35 -0
- package/dist/collection/store/dimension/dimension.recalculate.plugin.js.map +1 -0
- package/dist/collection/store/dimension/dimension.store.js +109 -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 +53 -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 +151 -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 +118 -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 +2 -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/browser.js +7 -0
- package/dist/collection/utils/browser.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 +153 -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 +140 -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 +90 -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-FBz64o-g.js +14 -0
- package/dist/esm/app-globals-FBz64o-g.js.map +1 -0
- package/dist/esm/cell-renderer-Ca_PCGjJ.js +98 -0
- package/dist/esm/cell-renderer-Ca_PCGjJ.js.map +1 -0
- package/dist/esm/column.drag.plugin-BtuUyB-2.js +2528 -0
- package/dist/esm/column.drag.plugin-BtuUyB-2.js.map +1 -0
- package/dist/esm/column.service-CTqFIQUy.js +1343 -0
- package/dist/esm/column.service-CTqFIQUy.js.map +1 -0
- package/dist/esm/data.store-B-lvmoFH.js +3553 -0
- package/dist/esm/data.store-B-lvmoFH.js.map +1 -0
- package/dist/esm/debounce-DTUQ1fY7.js +488 -0
- package/dist/esm/debounce-DTUQ1fY7.js.map +1 -0
- package/dist/esm/edit.utils-CyCANCLB.js +103 -0
- package/dist/esm/edit.utils-CyCANCLB.js.map +1 -0
- package/dist/esm/events-CKtYJJSv.js +43 -0
- package/dist/esm/events-CKtYJJSv.js.map +1 -0
- package/dist/esm/filter.button-CjABZQgg.js +39 -0
- package/dist/esm/filter.button-CjABZQgg.js.map +1 -0
- package/dist/esm/header-cell-renderer-DnjpJuXq.js +351 -0
- package/dist/esm/header-cell-renderer-DnjpJuXq.js.map +1 -0
- package/dist/esm/index-BAoInZ4V.js +2519 -0
- package/dist/esm/index-BAoInZ4V.js.map +1 -0
- package/dist/esm/index.js +181 -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 +2185 -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-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.js.map +1 -0
- package/dist/esm/revogr-attribution_7.entry.js +1455 -0
- package/dist/esm/revogr-attribution_7.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 +452 -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 +943 -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-header-utils-vnoLGj5A.js +407 -0
- package/dist/esm/row-header-utils-vnoLGj5A.js.map +1 -0
- package/dist/esm/text-editor-Cp7lwBZi.js +79 -0
- package/dist/esm/text-editor-Cp7lwBZi.js.map +1 -0
- package/dist/esm/throttle-DiUrHjcY.js +273 -0
- package/dist/esm/throttle-DiUrHjcY.js.map +1 -0
- package/dist/esm/viewport.helpers-Ch4AQMMg.js +53 -0
- package/dist/esm/viewport.helpers-Ch4AQMMg.js.map +1 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/revo-grid/app-globals-FBz64o-g.js +14 -0
- package/dist/revo-grid/app-globals-FBz64o-g.js.map +1 -0
- package/dist/revo-grid/cell-renderer-Ca_PCGjJ.js +98 -0
- package/dist/revo-grid/cell-renderer-Ca_PCGjJ.js.map +1 -0
- package/dist/revo-grid/column.drag.plugin-BtuUyB-2.js +2528 -0
- package/dist/revo-grid/column.drag.plugin-BtuUyB-2.js.map +1 -0
- package/dist/revo-grid/column.service-CTqFIQUy.js +1343 -0
- package/dist/revo-grid/column.service-CTqFIQUy.js.map +1 -0
- package/dist/revo-grid/data.store-B-lvmoFH.js +3553 -0
- package/dist/revo-grid/data.store-B-lvmoFH.js.map +1 -0
- package/dist/revo-grid/debounce-DTUQ1fY7.js +488 -0
- package/dist/revo-grid/debounce-DTUQ1fY7.js.map +1 -0
- package/dist/revo-grid/edit.utils-CyCANCLB.js +103 -0
- package/dist/revo-grid/edit.utils-CyCANCLB.js.map +1 -0
- package/dist/revo-grid/events-CKtYJJSv.js +43 -0
- package/dist/revo-grid/events-CKtYJJSv.js.map +1 -0
- package/dist/revo-grid/filter.button-CjABZQgg.js +39 -0
- package/dist/revo-grid/filter.button-CjABZQgg.js.map +1 -0
- package/dist/revo-grid/header-cell-renderer-DnjpJuXq.js +351 -0
- package/dist/revo-grid/header-cell-renderer-DnjpJuXq.js.map +1 -0
- package/dist/revo-grid/index-BAoInZ4V.js +2490 -0
- package/dist/revo-grid/index-BAoInZ4V.js.map +1 -0
- package/dist/revo-grid/index.esm.js +181 -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 +2185 -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-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.esm.js.map +1 -0
- package/dist/revo-grid/revogr-attribution_7.entry.js +1455 -0
- package/dist/revo-grid/revogr-attribution_7.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 +452 -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 +943 -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-header-utils-vnoLGj5A.js +407 -0
- package/dist/revo-grid/row-header-utils-vnoLGj5A.js.map +1 -0
- package/dist/revo-grid/text-editor-Cp7lwBZi.js +79 -0
- package/dist/revo-grid/text-editor-Cp7lwBZi.js.map +1 -0
- package/dist/revo-grid/throttle-DiUrHjcY.js +273 -0
- package/dist/revo-grid/throttle-DiUrHjcY.js.map +1 -0
- package/dist/revo-grid/viewport.helpers-Ch4AQMMg.js +53 -0
- package/dist/revo-grid/viewport.helpers-Ch4AQMMg.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 +61 -0
- package/dist/types/components/data/revogr-data.d.ts +107 -0
- package/dist/types/components/data/row-highlight.plugin.d.ts +10 -0
- package/dist/types/components/data/row-renderer.d.ts +12 -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/header/header-cell-renderer.d.ts +9 -0
- package/dist/types/components/header/header-group-renderer.d.ts +15 -0
- package/dist/types/components/header/header-renderer.d.ts +16 -0
- package/dist/types/components/header/resizable.directive.d.ts +55 -0
- package/dist/types/components/header/resizable.element.d.ts +5 -0
- package/dist/types/components/header/revogr-header.d.ts +90 -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 +28 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +278 -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 +686 -0
- package/dist/types/components/revoGrid/viewport.helpers.d.ts +39 -0
- package/dist/types/components/revoGrid/viewport.resize.service.d.ts +17 -0
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +20 -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 +117 -0
- package/dist/types/components/scrollable/autohide-scroll.plugin.d.ts +22 -0
- package/dist/types/components/scrollable/revogr-scroll-virtual.d.ts +43 -0
- package/dist/types/components/selectionFocus/revogr-focus.d.ts +58 -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 +2583 -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.auto-size.plugin.d.ts +55 -0
- package/dist/types/plugins/column.stretch.plugin.d.ts +20 -0
- package/dist/types/plugins/dispatcher.d.ts +20 -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/groupingRow/grouping.const.d.ts +12 -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 +103 -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 +11 -0
- package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +42 -0
- package/dist/types/plugins/moveColumn/order-column.handler.d.ts +16 -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/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 +66 -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 +79 -0
- package/dist/types/services/viewport.provider.d.ts +7 -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 +74 -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 +9 -0
- package/dist/types/store/dimension/dimension.store.d.ts +21 -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 +6 -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 +26 -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 +768 -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/browser.d.ts +1 -0
- package/dist/types/utils/closest.polifill.d.ts +0 -0
- package/dist/types/utils/column.utils.d.ts +52 -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 +13 -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 +33890 -0
- package/hydrate/index.mjs +33882 -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 +101 -0
- package/react/dist/index.d.ts +6191 -0
- package/react/dist/react-datagrid.js +260 -0
- package/react/dist/react-datagrid.umd.cjs +272 -0
- package/standalone/column.service.js +1345 -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 +3099 -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/index.d.ts +68 -0
- package/standalone/index.js +217 -0
- package/standalone/index.js.map +1 -0
- package/standalone/index2.js +140 -0
- package/standalone/index2.js.map +1 -0
- package/standalone/local.scroll.timer.js +207 -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 +4884 -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 +164 -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 +378 -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 +334 -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 +112 -0
- package/standalone/revogr-focus2.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 +707 -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 +972 -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 +520 -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 +184 -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 +421 -0
- package/standalone/revogr-viewport-scroll2.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,1455 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by LevelSkill.Pro
|
|
3
|
+
*/
|
|
4
|
+
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-BAoInZ4V.js';
|
|
5
|
+
import { k as getItemByIndex, b as getSourceItem, j as getItemByPosition, L as FOCUS_CLASS, W as codesLetter, w as timeout, R as RESIZE_INTERVAL, N as MOBILE_CLASS, O as CELL_HANDLER_CLASS, S as SELECTION_BORDER_CLASS, l as checkIsRightClick, D as DataStore, E as ROW_HEADER_TYPE, u as getScrollbarSize, T as TMP_SELECTION_BG_CLASS } from './data.store-B-lvmoFH.js';
|
|
6
|
+
import { g as getPropertyFromEvent, v as verifyTouchTarget } from './events-CKtYJJSv.js';
|
|
7
|
+
import { g as getRange, Q as ColumnService, x as getCellData, R as getCellEditor, a as isRangeSingleCell } from './column.service-CTqFIQUy.js';
|
|
8
|
+
import { c as isClear, d as isTab, f as isEnterKeyValue, h as isCopy, g as isCut, j as isPaste, l as isBack, k as isAll, m as isEditInput } from './edit.utils-CyCANCLB.js';
|
|
9
|
+
import { d as debounce } from './debounce-DTUQ1fY7.js';
|
|
10
|
+
import { V as ViewportStore, f as calculateRowHeaderSize } from './row-header-utils-vnoLGj5A.js';
|
|
11
|
+
import { H as HEADER_SLOT } from './viewport.helpers-Ch4AQMMg.js';
|
|
12
|
+
import { L as LocalScrollTimer, a as LocalScrollService, g as getContentSize, t as throttle } from './throttle-DiUrHjcY.js';
|
|
13
|
+
|
|
14
|
+
const Attribution = class {
|
|
15
|
+
constructor(hostRef) {
|
|
16
|
+
registerInstance(this, hostRef);
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, { key: '8330f680923c63a6e91e0db1258247f3957c47c0' }, h("a", { key: 'aa2fc1a308224fa509da9eb39eed5e3bf89680f6', href: "https://rv-grid.com/guide/attribution", target: "_blank", rel: "noopener noreferrer", title: "Made with \u2764\uFE0F by Revolist OU Team", class: "value" }, "RevoGrid")));
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const RevoGridExtra = class {
|
|
24
|
+
constructor(hostRef) {
|
|
25
|
+
registerInstance(this, hostRef);
|
|
26
|
+
/**
|
|
27
|
+
* Nodes to render
|
|
28
|
+
*/
|
|
29
|
+
this.nodes = [];
|
|
30
|
+
/**
|
|
31
|
+
* Force component to re-render
|
|
32
|
+
*/
|
|
33
|
+
this.update = 1;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Refreshes the extra component. Useful if you want to manually
|
|
37
|
+
* force the component to re-render.
|
|
38
|
+
*/
|
|
39
|
+
async refresh() {
|
|
40
|
+
this.update *= -1;
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
var _a;
|
|
44
|
+
return (_a = this.nodes) === null || _a === void 0 ? void 0 : _a.map(node => {
|
|
45
|
+
// Check if node is a function or a stencil component
|
|
46
|
+
// If function wrap it in a stencil component with the refresh function
|
|
47
|
+
if (typeof node === 'function') {
|
|
48
|
+
const config = {};
|
|
49
|
+
const getNodes = () => [node({ refresh: () => { var _a; return (_a = config.refresh) === null || _a === void 0 ? void 0 : _a.call(config); } })];
|
|
50
|
+
return (h("revogr-extra", { nodes: getNodes(), ref: (el) => {
|
|
51
|
+
if (el) {
|
|
52
|
+
// Update exclusively for current node
|
|
53
|
+
config.refresh = () => {
|
|
54
|
+
el.nodes = getNodes();
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
} }));
|
|
58
|
+
}
|
|
59
|
+
return node;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
function collectModelsOfRange(data, store) {
|
|
65
|
+
const models = {};
|
|
66
|
+
for (let i in data) {
|
|
67
|
+
const rowIndex = parseInt(i, 10);
|
|
68
|
+
models[rowIndex] = getSourceItem(store, rowIndex);
|
|
69
|
+
}
|
|
70
|
+
return models;
|
|
71
|
+
}
|
|
72
|
+
function getFocusCellBasedOnEvent(e, data) {
|
|
73
|
+
// If event default is prevented, return
|
|
74
|
+
if (e.defaultPrevented) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
// Get coordinates from event object
|
|
78
|
+
const x = getPropertyFromEvent(e, 'clientX');
|
|
79
|
+
const y = getPropertyFromEvent(e, 'clientY');
|
|
80
|
+
// If coordinates are not available, return
|
|
81
|
+
if (x === null || y === null) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
// Get current cell based on coordinates and data
|
|
85
|
+
const focusCell = getCurrentCell({ x, y }, data);
|
|
86
|
+
// If current cell is not available, return
|
|
87
|
+
if (isAfterLast(focusCell, data.lastCell)) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
return focusCell;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Calculate cell based on x, y position
|
|
94
|
+
*/
|
|
95
|
+
function getCurrentCell({ x, y }, { el, rows, cols }) {
|
|
96
|
+
// Get the bounding rectangle of the element
|
|
97
|
+
const { top, left, height, width } = el.getBoundingClientRect();
|
|
98
|
+
// Calculate the cell position relative to the element
|
|
99
|
+
let cellY = y - top;
|
|
100
|
+
let cellX = x - left;
|
|
101
|
+
// Limit the cell position to the element height
|
|
102
|
+
if (cellY >= height) {
|
|
103
|
+
cellY = height - 1;
|
|
104
|
+
}
|
|
105
|
+
// Limit the cell position to the element width
|
|
106
|
+
if (cellX >= width) {
|
|
107
|
+
cellX = width - 1;
|
|
108
|
+
}
|
|
109
|
+
// Get the row and column items based on the cell position
|
|
110
|
+
const rgRow = getItemByPosition(rows, cellY);
|
|
111
|
+
const rgCol = getItemByPosition(cols, cellX);
|
|
112
|
+
// Set the row and column index to 0 if they are before the first item
|
|
113
|
+
if (rgCol.itemIndex < 0) {
|
|
114
|
+
rgCol.itemIndex = 0;
|
|
115
|
+
}
|
|
116
|
+
if (rgRow.itemIndex < 0) {
|
|
117
|
+
rgRow.itemIndex = 0;
|
|
118
|
+
}
|
|
119
|
+
return { x: rgCol.itemIndex, y: rgRow.itemIndex };
|
|
120
|
+
}
|
|
121
|
+
function getCoordinate(range, focus, changes, isMulti = false) {
|
|
122
|
+
const updateCoordinate = (c, pos = 0) => {
|
|
123
|
+
const start = { x: range.x, y: range.y };
|
|
124
|
+
const end = isMulti ? { x: range.x1, y: range.y1 } : start;
|
|
125
|
+
const point = end[c] > focus[c] ? end : start;
|
|
126
|
+
point[c] += pos;
|
|
127
|
+
return { start, end };
|
|
128
|
+
};
|
|
129
|
+
if (changes.x) {
|
|
130
|
+
return updateCoordinate('x', changes['x']);
|
|
131
|
+
}
|
|
132
|
+
if (changes.y) {
|
|
133
|
+
return updateCoordinate('y', changes['y']);
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position
|
|
139
|
+
* or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position
|
|
140
|
+
*/
|
|
141
|
+
function isAfterLast({ x, y }, lastCell) {
|
|
142
|
+
return x >= lastCell.x || y >= lastCell.y;
|
|
143
|
+
}
|
|
144
|
+
/** check if out of range */
|
|
145
|
+
function isBeforeFirst({ x, y }) {
|
|
146
|
+
return x < 0 || y < 0;
|
|
147
|
+
}
|
|
148
|
+
/** Compare cells, only 1 coordinate difference is possible */
|
|
149
|
+
// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
150
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
151
|
+
// for (let k of c) {
|
|
152
|
+
// if (initial[k] !== last[k]) {
|
|
153
|
+
// return { [k]: 1 };
|
|
154
|
+
// }
|
|
155
|
+
// }
|
|
156
|
+
// return null;
|
|
157
|
+
// }
|
|
158
|
+
// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
|
|
159
|
+
// const cell: Partial<Cell> = {};
|
|
160
|
+
// const c: (keyof Cell)[] = ['x', 'y'];
|
|
161
|
+
// for (let k of c) {
|
|
162
|
+
// cell[k] = Math.abs(initial[k] - last[k]);
|
|
163
|
+
// }
|
|
164
|
+
// if (cell.x > cell.y) {
|
|
165
|
+
// return { x: 1 };
|
|
166
|
+
// }
|
|
167
|
+
// if (cell.y > cell.x) {
|
|
168
|
+
// return { y: 1 };
|
|
169
|
+
// }
|
|
170
|
+
// return null;
|
|
171
|
+
// }
|
|
172
|
+
function styleByCellProps(styles) {
|
|
173
|
+
return {
|
|
174
|
+
left: `${styles.left}px`,
|
|
175
|
+
top: `${styles.top}px`,
|
|
176
|
+
width: `${styles.width}px`,
|
|
177
|
+
height: `${styles.height}px`,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
|
|
181
|
+
const top = getItemByIndex(dimensionRow, y).start;
|
|
182
|
+
const left = getItemByIndex(dimensionCol, x).start;
|
|
183
|
+
const bottom = getItemByIndex(dimensionRow, y1).end;
|
|
184
|
+
const right = getItemByIndex(dimensionCol, x1).end;
|
|
185
|
+
return {
|
|
186
|
+
left,
|
|
187
|
+
right,
|
|
188
|
+
top,
|
|
189
|
+
bottom,
|
|
190
|
+
width: right - left,
|
|
191
|
+
height: bottom - top,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const revogrFocusStyleCss = "revogr-focus.focused-cell{box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset;position:absolute;pointer-events:none;z-index:9;display:block !important}";
|
|
196
|
+
|
|
197
|
+
const RevogrFocus$1 = class RevogrFocus {
|
|
198
|
+
constructor(hostRef) {
|
|
199
|
+
registerInstance(this, hostRef);
|
|
200
|
+
this.beforeFocusRender = createEvent(this, "beforefocusrender", 7);
|
|
201
|
+
this.beforeScrollIntoView = createEvent(this, "beforescrollintoview", 7);
|
|
202
|
+
this.afterFocus = createEvent(this, "afterfocus", 7);
|
|
203
|
+
/**
|
|
204
|
+
* Focus template custom function. Can be used to render custom focus layer.
|
|
205
|
+
*/
|
|
206
|
+
this.focusTemplate = null;
|
|
207
|
+
this.activeFocus = null;
|
|
208
|
+
}
|
|
209
|
+
componentDidRender() {
|
|
210
|
+
var _a, _b;
|
|
211
|
+
const currentFocus = this.selectionStore.get('focus');
|
|
212
|
+
if (((_a = this.activeFocus) === null || _a === void 0 ? void 0 : _a.x) === (currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.x) &&
|
|
213
|
+
((_b = this.activeFocus) === null || _b === void 0 ? void 0 : _b.y) === (currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.y)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
this.activeFocus = currentFocus;
|
|
217
|
+
if (currentFocus && this.el) {
|
|
218
|
+
const beforeScrollIn = this.beforeScrollIntoView.emit({ el: this.el });
|
|
219
|
+
if (!beforeScrollIn.defaultPrevented) {
|
|
220
|
+
this.el.scrollIntoView({
|
|
221
|
+
block: 'nearest',
|
|
222
|
+
inline: 'nearest',
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
const model = getSourceItem(this.dataStore, currentFocus.y);
|
|
226
|
+
const column = getSourceItem(this.colData, currentFocus.x);
|
|
227
|
+
this.afterFocus.emit({
|
|
228
|
+
model,
|
|
229
|
+
column,
|
|
230
|
+
rowType: this.rowType,
|
|
231
|
+
colType: this.colType,
|
|
232
|
+
rowIndex: currentFocus.y,
|
|
233
|
+
colIndex: currentFocus.x,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
render() {
|
|
238
|
+
var _a;
|
|
239
|
+
const editCell = this.selectionStore.get('edit');
|
|
240
|
+
if (editCell) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const focusCell = this.selectionStore.get('focus');
|
|
244
|
+
if (!focusCell) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const event = this.beforeFocusRender.emit({
|
|
248
|
+
range: Object.assign(Object.assign({}, focusCell), { x1: focusCell.x, y1: focusCell.y }),
|
|
249
|
+
rowType: this.rowType,
|
|
250
|
+
colType: this.colType,
|
|
251
|
+
rowDimension: Object.assign({}, this.dimensionRow.state),
|
|
252
|
+
colDimension: Object.assign({}, this.dimensionCol.state),
|
|
253
|
+
});
|
|
254
|
+
if (event.defaultPrevented) {
|
|
255
|
+
return h("slot", null);
|
|
256
|
+
}
|
|
257
|
+
const { detail } = event;
|
|
258
|
+
const cell = getCell(detail.range, event.detail.rowDimension, event.detail.colDimension);
|
|
259
|
+
const styles = styleByCellProps(cell);
|
|
260
|
+
const extra = (_a = this.focusTemplate) === null || _a === void 0 ? void 0 : _a.call(this, h, detail);
|
|
261
|
+
const props = {
|
|
262
|
+
class: { [FOCUS_CLASS]: true },
|
|
263
|
+
style: styles,
|
|
264
|
+
};
|
|
265
|
+
return (h(Host, Object.assign({}, props), h("slot", null), extra));
|
|
266
|
+
}
|
|
267
|
+
get el() { return getElement(this); }
|
|
268
|
+
};
|
|
269
|
+
RevogrFocus$1.style = revogrFocusStyleCss;
|
|
270
|
+
|
|
271
|
+
const DIRECTION_CODES = [
|
|
272
|
+
codesLetter.TAB,
|
|
273
|
+
codesLetter.ARROW_UP,
|
|
274
|
+
codesLetter.ARROW_DOWN,
|
|
275
|
+
codesLetter.ARROW_LEFT,
|
|
276
|
+
codesLetter.ARROW_RIGHT,
|
|
277
|
+
];
|
|
278
|
+
class KeyboardService {
|
|
279
|
+
constructor(sv) {
|
|
280
|
+
this.sv = sv;
|
|
281
|
+
}
|
|
282
|
+
async keyDown(e, canRange, isEditMode, { range, focus }) {
|
|
283
|
+
// IF EDIT MODE
|
|
284
|
+
if (isEditMode) {
|
|
285
|
+
switch (e.code) {
|
|
286
|
+
case codesLetter.ESCAPE:
|
|
287
|
+
this.sv.cancel();
|
|
288
|
+
break;
|
|
289
|
+
case codesLetter.TAB:
|
|
290
|
+
this.keyChangeSelection(e, canRange);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
// IF NOT EDIT MODE
|
|
296
|
+
// pressed clear key
|
|
297
|
+
if (range && isClear(e.code)) {
|
|
298
|
+
this.sv.clearCell();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
// below works with focus only
|
|
302
|
+
if (!focus) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
// tab key means same as arrow right
|
|
306
|
+
if (isTab(e.code)) {
|
|
307
|
+
this.keyChangeSelection(e, canRange);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
// pressed enter
|
|
311
|
+
if (isEnterKeyValue(e.key)) {
|
|
312
|
+
this.sv.change();
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
// copy operation
|
|
316
|
+
if (isCopy(e)) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
// cut operation
|
|
320
|
+
if (isCut(e)) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
// paste operation
|
|
324
|
+
if (isPaste(e)) {
|
|
325
|
+
this.sv.internalPaste();
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (isBack(e)) {
|
|
329
|
+
// rollback
|
|
330
|
+
e.preventDefault();
|
|
331
|
+
this.sv.rollback();
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
// select all
|
|
335
|
+
if (isAll(e)) {
|
|
336
|
+
e.preventDefault();
|
|
337
|
+
// if (canRange) {
|
|
338
|
+
// this.selectAll(e);
|
|
339
|
+
// }
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
// pressed letter key
|
|
343
|
+
if (e.key.length === 1) {
|
|
344
|
+
this.sv.change(e.key);
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
// pressed arrow, change selection position
|
|
348
|
+
if (await this.keyChangeSelection(e, canRange)) {
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
// private selectAll(e: KeyboardEvent) {
|
|
353
|
+
// const range = this.sv.selectionStore.get('range');
|
|
354
|
+
// const focus = this.sv.selectionStore.get('focus');
|
|
355
|
+
// // if no range or focus - do nothing
|
|
356
|
+
// if (!range || !focus) {
|
|
357
|
+
// return;
|
|
358
|
+
// }
|
|
359
|
+
// e.preventDefault();
|
|
360
|
+
// this.sv.selectAll();
|
|
361
|
+
// }
|
|
362
|
+
async keyChangeSelection(e, canRange) {
|
|
363
|
+
const data = this.changeDirectionKey(e, canRange);
|
|
364
|
+
if (!data) {
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
// this interval needed for several cases
|
|
368
|
+
// grid could be resized before next click
|
|
369
|
+
// at this case to avoid screen jump we use this interval
|
|
370
|
+
await timeout(RESIZE_INTERVAL + 30);
|
|
371
|
+
const range = this.sv.selectionStore.get('range');
|
|
372
|
+
const focus = this.sv.selectionStore.get('focus');
|
|
373
|
+
return this.keyPositionChange(data.changes, range, focus, data.isMulti);
|
|
374
|
+
}
|
|
375
|
+
keyPositionChange(changes, range, focus, isMulti = false) {
|
|
376
|
+
if (!range || !focus) {
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
const data = getCoordinate(range, focus, changes, isMulti);
|
|
380
|
+
if (!data) {
|
|
381
|
+
return false;
|
|
382
|
+
}
|
|
383
|
+
const eData = this.sv.getData();
|
|
384
|
+
if (isMulti) {
|
|
385
|
+
if (isAfterLast(data.end, eData.lastCell) || isBeforeFirst(data.start)) {
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
const range = getRange(data.start, data.end);
|
|
389
|
+
return this.sv.range(range);
|
|
390
|
+
}
|
|
391
|
+
return this.sv.focus(data.start, changes, isAfterLast(data.start, eData.lastCell)
|
|
392
|
+
? 1
|
|
393
|
+
: isBeforeFirst(data.start)
|
|
394
|
+
? -1
|
|
395
|
+
: 0);
|
|
396
|
+
}
|
|
397
|
+
/** Monitor key direction changes */
|
|
398
|
+
changeDirectionKey(e, canRange) {
|
|
399
|
+
const isMulti = canRange && e.shiftKey;
|
|
400
|
+
if (DIRECTION_CODES.includes(e.code)) {
|
|
401
|
+
e.preventDefault();
|
|
402
|
+
}
|
|
403
|
+
if (e.shiftKey) {
|
|
404
|
+
switch (e.code) {
|
|
405
|
+
case codesLetter.TAB:
|
|
406
|
+
return { changes: { x: -1 }, isMulti: false };
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
switch (e.code) {
|
|
410
|
+
case codesLetter.ARROW_UP:
|
|
411
|
+
return { changes: { y: -1 }, isMulti };
|
|
412
|
+
case codesLetter.ARROW_DOWN:
|
|
413
|
+
return { changes: { y: 1 }, isMulti };
|
|
414
|
+
case codesLetter.ARROW_LEFT:
|
|
415
|
+
return { changes: { x: -1 }, isMulti };
|
|
416
|
+
case codesLetter.TAB:
|
|
417
|
+
case codesLetter.ARROW_RIGHT:
|
|
418
|
+
return { changes: { x: 1 }, isMulti };
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
class AutoFillService {
|
|
424
|
+
constructor(sv) {
|
|
425
|
+
this.sv = sv;
|
|
426
|
+
this.autoFillType = null;
|
|
427
|
+
this.autoFillInitial = null;
|
|
428
|
+
this.autoFillStart = null;
|
|
429
|
+
this.autoFillLast = null;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Render autofill box
|
|
433
|
+
* @param range
|
|
434
|
+
* @param selectionFocus
|
|
435
|
+
*/
|
|
436
|
+
renderAutofill(range, selectionFocus, isMobile = false) {
|
|
437
|
+
let handlerStyle;
|
|
438
|
+
if (range) {
|
|
439
|
+
handlerStyle = getCell(range, this.sv.dimensionRow.state, this.sv.dimensionCol.state);
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
handlerStyle = getCell(Object.assign(Object.assign({}, selectionFocus), { x1: selectionFocus.x, y1: selectionFocus.y }), this.sv.dimensionRow.state, this.sv.dimensionCol.state);
|
|
443
|
+
}
|
|
444
|
+
return (h("div", { class: {
|
|
445
|
+
[CELL_HANDLER_CLASS]: true,
|
|
446
|
+
[MOBILE_CLASS]: isMobile,
|
|
447
|
+
}, style: {
|
|
448
|
+
left: `${handlerStyle.right}px`,
|
|
449
|
+
top: `${handlerStyle.bottom}px`,
|
|
450
|
+
}, onMouseDown: (e) => this.autoFillHandler(e), onTouchStart: (e) => this.autoFillHandler(e) }));
|
|
451
|
+
}
|
|
452
|
+
autoFillHandler(e, type = "AutoFill" /* AutoFillType.autoFill */) {
|
|
453
|
+
let target = null;
|
|
454
|
+
if (e.target instanceof Element) {
|
|
455
|
+
target = e.target;
|
|
456
|
+
}
|
|
457
|
+
if (!target) {
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
this.selectionStart(target, this.sv.getData(), type);
|
|
461
|
+
e.preventDefault();
|
|
462
|
+
}
|
|
463
|
+
get isAutoFill() {
|
|
464
|
+
return !!this.autoFillType;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Process mouse move events
|
|
468
|
+
*/
|
|
469
|
+
selectionMouseMove(e) {
|
|
470
|
+
// initiate mouse move debounce if not present
|
|
471
|
+
if (!this.onMouseMoveAutofill) {
|
|
472
|
+
this.onMouseMoveAutofill = debounce((e, data) => this.doAutofillMouseMove(e, data), 5);
|
|
473
|
+
}
|
|
474
|
+
if (this.isAutoFill) {
|
|
475
|
+
this.onMouseMoveAutofill(e, this.sv.getData());
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
getFocus(focus, range) {
|
|
479
|
+
// there was an issue that it was taking last cell from range but focus was out
|
|
480
|
+
if (!focus && range) {
|
|
481
|
+
focus = { x: range.x, y: range.y };
|
|
482
|
+
}
|
|
483
|
+
return focus || null;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Autofill logic:
|
|
487
|
+
* on mouse move apply based on previous direction (if present)
|
|
488
|
+
*/
|
|
489
|
+
doAutofillMouseMove(event, data) {
|
|
490
|
+
// if no initial - not started
|
|
491
|
+
if (!this.autoFillInitial) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
const x = getPropertyFromEvent(event, 'clientX', MOBILE_CLASS);
|
|
495
|
+
const y = getPropertyFromEvent(event, 'clientY', MOBILE_CLASS);
|
|
496
|
+
// skip touch
|
|
497
|
+
if (x === null || y === null) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
const current = getCurrentCell({ x, y }, data);
|
|
501
|
+
// first time or direction equal to start(same as first time)
|
|
502
|
+
if (!this.autoFillLast) {
|
|
503
|
+
if (!this.autoFillLast) {
|
|
504
|
+
this.autoFillLast = this.autoFillStart;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
// check if not the latest, if latest - do nothing
|
|
508
|
+
if (isAfterLast(current, data.lastCell)) {
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
this.autoFillLast = current;
|
|
512
|
+
const isSame = current.x === this.autoFillInitial.x &&
|
|
513
|
+
current.y === this.autoFillInitial.y;
|
|
514
|
+
// if same as initial - clear
|
|
515
|
+
if (isSame) {
|
|
516
|
+
this.sv.setTempRange(null);
|
|
517
|
+
}
|
|
518
|
+
else {
|
|
519
|
+
const area = getRange(this.autoFillInitial, this.autoFillLast);
|
|
520
|
+
this.sv.setTempRange({
|
|
521
|
+
area,
|
|
522
|
+
type: this.autoFillType,
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Range selection started
|
|
528
|
+
* Mode @param type:
|
|
529
|
+
* Can be triggered from MouseDown selection on element
|
|
530
|
+
* Or can be triggered on corner square drag
|
|
531
|
+
*/
|
|
532
|
+
selectionStart(target, data, type = "Selection" /* AutoFillType.selection */) {
|
|
533
|
+
/** Get cell by autofill element */
|
|
534
|
+
const { top, left } = target.getBoundingClientRect();
|
|
535
|
+
this.autoFillInitial = this.getFocus(data.focus, data.range);
|
|
536
|
+
this.autoFillType = type;
|
|
537
|
+
this.autoFillStart = getCurrentCell({ x: left, y: top }, data);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Clear current range selection on mouse up and mouse leave events
|
|
541
|
+
*/
|
|
542
|
+
clearAutoFillSelection(focus, oldRange) {
|
|
543
|
+
// If autofill was active, apply autofill values
|
|
544
|
+
if (this.autoFillInitial) {
|
|
545
|
+
// Fetch latest focus
|
|
546
|
+
this.autoFillInitial = this.getFocus(focus, oldRange);
|
|
547
|
+
// Apply range data if autofill mode is active
|
|
548
|
+
if (this.autoFillType === "AutoFill" /* AutoFillType.autoFill */) {
|
|
549
|
+
const range = getRange(this.autoFillInitial, this.autoFillLast);
|
|
550
|
+
// If range is present, apply data
|
|
551
|
+
if (range) {
|
|
552
|
+
const { defaultPrevented: stopApply, detail: { range: newRange }, } = this.sv.clearRangeDataApply({
|
|
553
|
+
range,
|
|
554
|
+
});
|
|
555
|
+
// If data apply was not prevented, apply new range
|
|
556
|
+
if (!stopApply && oldRange) {
|
|
557
|
+
this.applyRangeWithData(newRange, oldRange);
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
// If data apply was prevented, clear temporary range
|
|
561
|
+
this.sv.setTempRange(null);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
// If not autofill mode, apply range only
|
|
567
|
+
this.applyRangeOnly(this.autoFillInitial, this.autoFillLast);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
// Reset autofill state
|
|
571
|
+
this.resetAutoFillState();
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Reset autofill state
|
|
575
|
+
*/
|
|
576
|
+
resetAutoFillState() {
|
|
577
|
+
this.autoFillType = null;
|
|
578
|
+
this.autoFillInitial = null;
|
|
579
|
+
this.autoFillLast = null;
|
|
580
|
+
this.autoFillStart = null;
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Trigger range apply events and handle responses
|
|
584
|
+
*/
|
|
585
|
+
onRangeApply(newData, newRange, oldRange, copy = false, clear = false) {
|
|
586
|
+
this.sv.rangeDataApply({
|
|
587
|
+
data: newData,
|
|
588
|
+
models: collectModelsOfRange(newData, this.sv.dataStore),
|
|
589
|
+
type: this.sv.dataStore.get('type'),
|
|
590
|
+
oldRange,
|
|
591
|
+
newRange,
|
|
592
|
+
previousModels: null,
|
|
593
|
+
copy,
|
|
594
|
+
clearByKeyboard: clear,
|
|
595
|
+
});
|
|
596
|
+
this.sv.setRange(newRange);
|
|
597
|
+
}
|
|
598
|
+
/** Apply range and copy data during range application */
|
|
599
|
+
applyRangeWithData(newRange, rangeToCopy) {
|
|
600
|
+
const rangeData = {
|
|
601
|
+
type: this.sv.dataStore.get('type'),
|
|
602
|
+
colType: this.sv.columnService.type,
|
|
603
|
+
newData: {},
|
|
604
|
+
mapping: {},
|
|
605
|
+
newRange,
|
|
606
|
+
oldRange: rangeToCopy,
|
|
607
|
+
};
|
|
608
|
+
const { mapping, changed } = this.sv.columnService.getRangeData(rangeData, this.sv.columnService.columns);
|
|
609
|
+
rangeData.newData = changed;
|
|
610
|
+
rangeData.mapping = mapping;
|
|
611
|
+
let e = this.sv.selectionChanged(rangeData);
|
|
612
|
+
// if default prevented - clear range
|
|
613
|
+
if (e.defaultPrevented) {
|
|
614
|
+
this.sv.setTempRange(null);
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
e = this.sv.rangeCopy(rangeData);
|
|
618
|
+
if (e.defaultPrevented) {
|
|
619
|
+
this.sv.setRange(newRange);
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
this.onRangeApply(rangeData.newData, newRange, rangeToCopy);
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Update range selection only,
|
|
626
|
+
* no data change (mouse selection)
|
|
627
|
+
*/
|
|
628
|
+
applyRangeOnly(start, end) {
|
|
629
|
+
// no changes to apply
|
|
630
|
+
if (!start || !end) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
const newRange = getRange(start, end);
|
|
634
|
+
this.sv.setRange(newRange);
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const revogrOverlayStyleCss = "revogr-overlay-selection{display:block;position:relative;width:100%}revogr-overlay-selection .autofill-handle{position:absolute;width:14px;height:14px;margin-left:-13px;margin-top:-13px;z-index:10;cursor:crosshair}revogr-overlay-selection .autofill-handle::before{content:\"\";position:absolute;right:0;bottom:0;width:10px;height:10px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection.mobile .autofill-handle{position:absolute;width:30px;height:30px;margin-left:-29px;margin-top:-29px;z-index:10;cursor:crosshair}revogr-overlay-selection.mobile .autofill-handle::before{content:\"\";position:absolute;right:0;bottom:0;width:12px;height:12px;background:#0d63e8;border:1px solid white;box-sizing:border-box}revogr-overlay-selection .selection-border-range{position:absolute;pointer-events:none;z-index:9;box-shadow:-1px 0 0 #0d63e8 inset, 1px 0 0 #0d63e8 inset, 0 -1px 0 #0d63e8 inset, 0 1px 0 #0d63e8 inset}revogr-overlay-selection .selection-border-range .range-handlers{height:100%;background-color:transparent;width:75%;max-width:50px;min-width:20px;left:50%;transform:translateX(-50%);position:absolute}revogr-overlay-selection .selection-border-range .range-handlers>span{pointer-events:auto;height:20px;width:20px;position:absolute;left:50%;transform:translateX(-50%)}revogr-overlay-selection .selection-border-range .range-handlers>span:before,revogr-overlay-selection .selection-border-range .range-handlers>span:after{position:absolute;border-radius:5px;width:15px;height:5px;left:50%;transform:translateX(-50%);background-color:rgba(0, 0, 0, 0.2)}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child{top:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:first-child:before{content:\"\";top:0}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child{bottom:-7px}revogr-overlay-selection .selection-border-range .range-handlers>span:last-child:after{content:\"\";bottom:0}revogr-overlay-selection revogr-edit{z-index:10}";
|
|
639
|
+
|
|
640
|
+
const OverlaySelection = class {
|
|
641
|
+
constructor(hostRef) {
|
|
642
|
+
registerInstance(this, hostRef);
|
|
643
|
+
this.beforeCopyRegion = createEvent(this, "beforecopyregion", 7);
|
|
644
|
+
this.beforeRegionPaste = createEvent(this, "beforepasteregion", 7);
|
|
645
|
+
this.cellEditApply = createEvent(this, "celleditapply", 7);
|
|
646
|
+
this.beforeFocusCell = createEvent(this, "beforecellfocusinit", 7);
|
|
647
|
+
this.beforeNextViewportFocus = createEvent(this, "beforenextvpfocus", 7);
|
|
648
|
+
this.setEdit = createEvent(this, "setedit", 7);
|
|
649
|
+
this.beforeApplyRange = createEvent(this, "beforeapplyrange", 7);
|
|
650
|
+
this.beforeSetRange = createEvent(this, "beforesetrange", 7);
|
|
651
|
+
this.setRange = createEvent(this, "setrange", 7);
|
|
652
|
+
this.beforeEditRender = createEvent(this, "beforeeditrender", 7);
|
|
653
|
+
this.selectAll = createEvent(this, "selectall", 7);
|
|
654
|
+
this.cancelEdit = createEvent(this, "canceledit", 7);
|
|
655
|
+
this.rollback = createEvent(this, "rollback", 7);
|
|
656
|
+
this.setTempRange = createEvent(this, "settemprange", 7);
|
|
657
|
+
this.beforeSetTempRange = createEvent(this, "beforesettemprange", 7);
|
|
658
|
+
this.applyFocus = createEvent(this, "applyfocus", 7);
|
|
659
|
+
this.focusCell = createEvent(this, "focuscell", 7);
|
|
660
|
+
this.beforeRangeDataApply = createEvent(this, "beforerangedataapply", 7);
|
|
661
|
+
this.selectionChange = createEvent(this, "selectionchangeinit", 7);
|
|
662
|
+
this.beforeRangeCopyApply = createEvent(this, "beforerangecopyapply", 7);
|
|
663
|
+
this.rangeEditApply = createEvent(this, "rangeeditapply", 7);
|
|
664
|
+
this.rangeClipboardCopy = createEvent(this, "clipboardrangecopy", 7);
|
|
665
|
+
this.rangeClipboardPaste = createEvent(this, "clipboardrangepaste", 7);
|
|
666
|
+
this.beforeKeyDown = createEvent(this, "beforekeydown", 7);
|
|
667
|
+
this.beforeKeyUp = createEvent(this, "beforekeyup", 7);
|
|
668
|
+
this.beforeCellSave = createEvent(this, "beforecellsave", 7);
|
|
669
|
+
this.cellEditDone = createEvent(this, "celledit", 7);
|
|
670
|
+
/**
|
|
671
|
+
* If true applys changes when cell closes if not Escape.
|
|
672
|
+
*/
|
|
673
|
+
this.applyChangesOnClose = false;
|
|
674
|
+
this.keyboardService = null;
|
|
675
|
+
this.autoFillService = null;
|
|
676
|
+
this.unsubscribeSelectionStore = [];
|
|
677
|
+
}
|
|
678
|
+
// #endregion
|
|
679
|
+
// #region Listeners
|
|
680
|
+
onMouseMove(e) {
|
|
681
|
+
var _a;
|
|
682
|
+
if (this.selectionStore.get('focus')) {
|
|
683
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionMouseMove(e);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Action finished inside the document.
|
|
688
|
+
* Pointer left document, clear any active operation.
|
|
689
|
+
*/
|
|
690
|
+
onMouseUp() {
|
|
691
|
+
var _a;
|
|
692
|
+
// Clear autofill selection
|
|
693
|
+
// when pointer left document,
|
|
694
|
+
// clear any active operation.
|
|
695
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Row drag started.
|
|
699
|
+
* This event is fired when drag action started on cell.
|
|
700
|
+
*/
|
|
701
|
+
onCellDrag(e) {
|
|
702
|
+
var _a;
|
|
703
|
+
// Invoke drag start on order editor.
|
|
704
|
+
(_a = this.orderEditor) === null || _a === void 0 ? void 0 : _a.dragStart(e.detail);
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Get keyboard down from element.
|
|
708
|
+
* This event is fired when keyboard key is released.
|
|
709
|
+
*/
|
|
710
|
+
onKeyUp(e) {
|
|
711
|
+
// Emit before key up event.
|
|
712
|
+
this.beforeKeyUp.emit(Object.assign({ original: e }, this.getData()));
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Get keyboard down from element.
|
|
716
|
+
* This event is fired when keyboard key is pressed.
|
|
717
|
+
*/
|
|
718
|
+
onKeyDown(e) {
|
|
719
|
+
var _a;
|
|
720
|
+
// Emit before key down event and check if default prevention is set.
|
|
721
|
+
const proxy = this.beforeKeyDown.emit(Object.assign({ original: e }, this.getData()));
|
|
722
|
+
if (e.defaultPrevented || proxy.defaultPrevented) {
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
// Invoke key down on keyboard service.
|
|
726
|
+
(_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyDown(e, this.range, !!this.selectionStore.get('edit'), {
|
|
727
|
+
focus: this.selectionStore.get('focus'),
|
|
728
|
+
range: this.selectionStore.get('range'),
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
// #endregion
|
|
732
|
+
/**
|
|
733
|
+
* Selection & Keyboard
|
|
734
|
+
*/
|
|
735
|
+
selectionServiceSet(selectionStore) {
|
|
736
|
+
// clear subscriptions
|
|
737
|
+
this.unsubscribeSelectionStore.forEach(v => v());
|
|
738
|
+
this.unsubscribeSelectionStore.length = 0;
|
|
739
|
+
this.unsubscribeSelectionStore.push(selectionStore.onChange('nextFocus', v => v && this.doFocus(v, v)));
|
|
740
|
+
this.keyboardService = new KeyboardService({
|
|
741
|
+
selectionStore,
|
|
742
|
+
range: r => !!r && this.triggerRangeEvent(r),
|
|
743
|
+
focus: (f, changes, focusNextViewport) => {
|
|
744
|
+
if (focusNextViewport) {
|
|
745
|
+
this.beforeNextViewportFocus.emit(f);
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
else {
|
|
749
|
+
return this.doFocus(f, f, changes);
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
change: val => {
|
|
753
|
+
if (this.readonly) {
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
this.doEdit(val);
|
|
757
|
+
},
|
|
758
|
+
cancel: async () => {
|
|
759
|
+
var _a;
|
|
760
|
+
await ((_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.cancelChanges());
|
|
761
|
+
this.closeEdit();
|
|
762
|
+
},
|
|
763
|
+
clearCell: () => !this.readonly && this.clearCell(),
|
|
764
|
+
internalPaste: () => !this.readonly && this.beforeRegionPaste.emit(),
|
|
765
|
+
getData: () => this.getData(),
|
|
766
|
+
selectAll: () => this.selectAll.emit(),
|
|
767
|
+
rollback: () => this.rollback.emit(),
|
|
768
|
+
});
|
|
769
|
+
this.createAutoFillService();
|
|
770
|
+
}
|
|
771
|
+
/** Autofill */
|
|
772
|
+
createAutoFillService() {
|
|
773
|
+
this.autoFillService = new AutoFillService({
|
|
774
|
+
dimensionRow: this.dimensionRow,
|
|
775
|
+
dimensionCol: this.dimensionCol,
|
|
776
|
+
columnService: this.columnService,
|
|
777
|
+
dataStore: this.dataStore,
|
|
778
|
+
clearRangeDataApply: e => this.beforeRangeDataApply.emit(Object.assign(Object.assign(Object.assign({}, e), this.types), { rowDimension: Object.assign({}, this.dimensionRow.state), colDimension: Object.assign({}, this.dimensionCol.state) })),
|
|
779
|
+
setTempRange: e => {
|
|
780
|
+
const tempRangeEvent = this.beforeSetTempRange.emit(Object.assign(Object.assign({ tempRange: e }, this.getData()), this.types));
|
|
781
|
+
if (tempRangeEvent.defaultPrevented) {
|
|
782
|
+
return null;
|
|
783
|
+
}
|
|
784
|
+
return this.setTempRange.emit(tempRangeEvent.detail.tempRange);
|
|
785
|
+
},
|
|
786
|
+
selectionChanged: e => this.selectionChange.emit(e),
|
|
787
|
+
rangeCopy: e => this.beforeRangeCopyApply.emit(e),
|
|
788
|
+
rangeDataApply: e => this.rangeEditApply.emit(e),
|
|
789
|
+
setRange: e => !!e && this.triggerRangeEvent(e),
|
|
790
|
+
getData: () => this.getData(),
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
/** Columns */
|
|
794
|
+
columnServiceSet() {
|
|
795
|
+
var _a;
|
|
796
|
+
(_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
797
|
+
this.columnService = new ColumnService(this.dataStore, this.colData);
|
|
798
|
+
this.createAutoFillService();
|
|
799
|
+
}
|
|
800
|
+
connectedCallback() {
|
|
801
|
+
this.columnServiceSet();
|
|
802
|
+
this.selectionServiceSet(this.selectionStore);
|
|
803
|
+
}
|
|
804
|
+
disconnectedCallback() {
|
|
805
|
+
var _a;
|
|
806
|
+
// clear subscriptions
|
|
807
|
+
this.unsubscribeSelectionStore.forEach(v => v());
|
|
808
|
+
this.unsubscribeSelectionStore.length = 0;
|
|
809
|
+
(_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
810
|
+
}
|
|
811
|
+
async componentWillRender() {
|
|
812
|
+
var _a, _b;
|
|
813
|
+
const editCell = this.selectionStore.get('edit');
|
|
814
|
+
if (!editCell) {
|
|
815
|
+
await ((_b = (_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.beforeDisconnect) === null || _b === void 0 ? void 0 : _b.call(_a));
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
renderRange(range) {
|
|
819
|
+
const cell = getCell(range, this.dimensionRow.state, this.dimensionCol.state);
|
|
820
|
+
const styles = styleByCellProps(cell);
|
|
821
|
+
return [
|
|
822
|
+
h("div", { class: SELECTION_BORDER_CLASS, style: styles }, this.isMobileDevice && (h("div", { class: "range-handlers" }, h("span", { class: MOBILE_CLASS }), h("span", { class: MOBILE_CLASS })))),
|
|
823
|
+
];
|
|
824
|
+
}
|
|
825
|
+
renderEditor() {
|
|
826
|
+
// Check if edit access
|
|
827
|
+
const editCell = this.selectionStore.get('edit');
|
|
828
|
+
// Readonly or Editor closed
|
|
829
|
+
if (this.readonly || !editCell) {
|
|
830
|
+
return null;
|
|
831
|
+
}
|
|
832
|
+
const enteredOrModelValue = editCell.val ||
|
|
833
|
+
getCellData(this.columnService.rowDataModel(editCell.y, editCell.x).value);
|
|
834
|
+
const editable = Object.assign(Object.assign({}, editCell), this.columnService.getSaveData(editCell.y, editCell.x, enteredOrModelValue));
|
|
835
|
+
const renderEvent = this.beforeEditRender.emit(Object.assign(Object.assign({ range: Object.assign(Object.assign({}, editCell), { x1: editCell.x, y1: editCell.y }) }, this.types), { rowDimension: Object.assign({}, this.dimensionRow.state), colDimension: Object.assign({}, this.dimensionCol.state) }));
|
|
836
|
+
// Render prevented
|
|
837
|
+
if (renderEvent.defaultPrevented) {
|
|
838
|
+
return null;
|
|
839
|
+
}
|
|
840
|
+
const cell = getCell(renderEvent.detail.range, renderEvent.detail.rowDimension, renderEvent.detail.colDimension);
|
|
841
|
+
const styles = styleByCellProps(cell);
|
|
842
|
+
return (h("revogr-edit", { style: styles, ref: el => (this.revogrEdit = el), additionalData: this.additionalData, editCell: editable, saveOnClose: this.applyChangesOnClose, onCelleditinit: e => {
|
|
843
|
+
this.cellEditDone.emit(e.detail);
|
|
844
|
+
}, column: this.columnService.rowDataModel(editCell.y, editCell.x), editor: getCellEditor(this.columnService.columns[editCell.x], this.editors) }));
|
|
845
|
+
}
|
|
846
|
+
onEditCell(e) {
|
|
847
|
+
if (e.defaultPrevented) {
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
const saveEv = this.beforeCellSave.emit(e.detail);
|
|
851
|
+
if (!saveEv.defaultPrevented) {
|
|
852
|
+
this.cellEdit(saveEv.detail);
|
|
853
|
+
}
|
|
854
|
+
// if not clear navigate to next cell after edit
|
|
855
|
+
if (!saveEv.detail.preventFocus) {
|
|
856
|
+
this.focusNext();
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
render() {
|
|
860
|
+
var _a;
|
|
861
|
+
const nodes = [];
|
|
862
|
+
const editCell = this.renderEditor();
|
|
863
|
+
// Editor
|
|
864
|
+
if (editCell) {
|
|
865
|
+
nodes.push(editCell);
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
const range = this.selectionStore.get('range');
|
|
869
|
+
const focus = this.selectionStore.get('focus');
|
|
870
|
+
// Clipboard
|
|
871
|
+
if ((range || focus) && this.useClipboard) {
|
|
872
|
+
nodes.push(h("revogr-clipboard", { readonly: this.readonly, onCopyregion: e => this.onCopy(e.detail), onClearregion: () => !this.readonly && this.clearCell(), ref: e => (this.clipboard = e), onPasteregion: e => this.onPaste(e.detail) }));
|
|
873
|
+
}
|
|
874
|
+
// Range
|
|
875
|
+
if (range) {
|
|
876
|
+
nodes.push(...this.renderRange(range));
|
|
877
|
+
}
|
|
878
|
+
// Autofill
|
|
879
|
+
if (focus && !this.readonly && this.range) {
|
|
880
|
+
nodes.push((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.renderAutofill(range, focus, this.isMobileDevice));
|
|
881
|
+
}
|
|
882
|
+
// Order
|
|
883
|
+
if (this.canDrag) {
|
|
884
|
+
nodes.push(h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, rowType: this.types.rowType, onRowdragstartinit: e => this.rowDragStart(e) }));
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
return (h(Host, { key: '9ae8dde9bf2655659bff3fa2ce5cfcd29fe96be1', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true), onCloseedit: (e) => this.closeEdit(e),
|
|
888
|
+
// it's done to be able to throw events from different levels, not just from editor
|
|
889
|
+
onCelledit: (e) => this.onEditCell(e) }, nodes, h("slot", { key: '5a5b418ce5f22bfdc9e691346a89fc4759ed4190', name: "data" })));
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Executes the focus operation on the specified range of cells.
|
|
893
|
+
*/
|
|
894
|
+
doFocus(focus, end, changes) {
|
|
895
|
+
// 1. Trigger beforeFocus event
|
|
896
|
+
const { defaultPrevented } = this.beforeFocusCell.emit(this.columnService.getSaveData(focus.y, focus.x));
|
|
897
|
+
if (defaultPrevented) {
|
|
898
|
+
return false;
|
|
899
|
+
}
|
|
900
|
+
const evData = Object.assign(Object.assign({ range: Object.assign(Object.assign({}, focus), { x1: end.x, y1: end.y }), next: changes }, this.types), { rowDimension: Object.assign({}, this.dimensionRow.state), colDimension: Object.assign({}, this.dimensionCol.state) });
|
|
901
|
+
// 2. Trigger apply focus event
|
|
902
|
+
const applyEvent = this.applyFocus.emit(evData);
|
|
903
|
+
if (applyEvent.defaultPrevented) {
|
|
904
|
+
return false;
|
|
905
|
+
}
|
|
906
|
+
const { range } = applyEvent.detail;
|
|
907
|
+
// 3. Trigger focus event
|
|
908
|
+
return !this.focusCell.emit(Object.assign({ focus: {
|
|
909
|
+
x: range.x,
|
|
910
|
+
y: range.y,
|
|
911
|
+
}, end: {
|
|
912
|
+
x: range.x1,
|
|
913
|
+
y: range.y1,
|
|
914
|
+
} }, applyEvent.detail)).defaultPrevented;
|
|
915
|
+
}
|
|
916
|
+
triggerRangeEvent(range) {
|
|
917
|
+
const type = this.types.rowType;
|
|
918
|
+
// 1. Apply range
|
|
919
|
+
const applyEvent = this.beforeApplyRange.emit(Object.assign(Object.assign({ range: Object.assign({}, range) }, this.types), { rowDimension: Object.assign({}, this.dimensionRow.state), colDimension: Object.assign({}, this.dimensionCol.state) }));
|
|
920
|
+
if (applyEvent.defaultPrevented) {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
const data = this.columnService.getRangeTransformedToProps(applyEvent.detail.range, this.dataStore);
|
|
924
|
+
// 2. Before set range
|
|
925
|
+
let e = this.beforeSetRange.emit(data);
|
|
926
|
+
if (e.defaultPrevented) {
|
|
927
|
+
return false;
|
|
928
|
+
}
|
|
929
|
+
// 3. Set range
|
|
930
|
+
e = this.setRange.emit(Object.assign(Object.assign({}, applyEvent.detail.range), { type }));
|
|
931
|
+
if (e.defaultPrevented) {
|
|
932
|
+
return false;
|
|
933
|
+
}
|
|
934
|
+
return !e.defaultPrevented;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* Open Editor on DblClick
|
|
938
|
+
*/
|
|
939
|
+
onElementDblClick(e) {
|
|
940
|
+
// DblClick prevented outside - Editor will not open
|
|
941
|
+
if (e.defaultPrevented) {
|
|
942
|
+
return;
|
|
943
|
+
}
|
|
944
|
+
// Get data from the component
|
|
945
|
+
const data = this.getData();
|
|
946
|
+
const focusCell = getFocusCellBasedOnEvent(e, data);
|
|
947
|
+
if (!focusCell) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
this.doEdit();
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Handle mouse down event on Host element
|
|
954
|
+
*/
|
|
955
|
+
onElementMouseDown(e, touch = false) {
|
|
956
|
+
var _a;
|
|
957
|
+
// Get the target element from the event object
|
|
958
|
+
const targetElement = e.target;
|
|
959
|
+
// Ignore focus if clicked input
|
|
960
|
+
if (isEditInput(targetElement) || e.defaultPrevented) {
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
// Get data from the component
|
|
964
|
+
const data = this.getData();
|
|
965
|
+
const focusCell = getFocusCellBasedOnEvent(e, data);
|
|
966
|
+
if (!focusCell) {
|
|
967
|
+
return;
|
|
968
|
+
}
|
|
969
|
+
// Check if right click on selected range - do nothing
|
|
970
|
+
const isRightClick = checkIsRightClick(e);
|
|
971
|
+
const selectedRange = this.selectionStore.get('range');
|
|
972
|
+
let isClickOnSelectedRange = false;
|
|
973
|
+
if (isRightClick && selectedRange) {
|
|
974
|
+
const { x, x1, y, y1 } = selectedRange;
|
|
975
|
+
const evt = e.target;
|
|
976
|
+
if ((x !== x1 || y !== y1) &&
|
|
977
|
+
evt.dataset['rgcol'] &&
|
|
978
|
+
evt.dataset['rgrow']) {
|
|
979
|
+
const maxXCoord = Math.max(x, x1);
|
|
980
|
+
const minXCoord = Math.min(x, x1);
|
|
981
|
+
const maxYCoord = Math.max(y, y1);
|
|
982
|
+
const minYCoord = Math.min(y, y1);
|
|
983
|
+
isClickOnSelectedRange =
|
|
984
|
+
+evt.dataset['rgcol'] >= minXCoord &&
|
|
985
|
+
+evt.dataset['rgcol'] <= maxXCoord &&
|
|
986
|
+
+evt.dataset['rgrow'] >= minYCoord &&
|
|
987
|
+
+evt.dataset['rgrow'] <= maxYCoord;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
// Set focus on the current cell
|
|
991
|
+
this.focus(focusCell, this.range && e.shiftKey, isClickOnSelectedRange);
|
|
992
|
+
// Initiate autofill selection
|
|
993
|
+
if (this.range && !isClickOnSelectedRange) {
|
|
994
|
+
targetElement &&
|
|
995
|
+
((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionStart(targetElement, this.getData()));
|
|
996
|
+
// Prevent default behavior for mouse events,
|
|
997
|
+
// but only if target element is not a mobile input
|
|
998
|
+
if (!touch) ;
|
|
999
|
+
else if (verifyTouchTarget(e.touches[0], MOBILE_CLASS)) {
|
|
1000
|
+
// Prevent default behavior for touch events
|
|
1001
|
+
// if target element is a mobile input
|
|
1002
|
+
e.preventDefault();
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Start cell editing
|
|
1008
|
+
*/
|
|
1009
|
+
doEdit(val = '') {
|
|
1010
|
+
var _a;
|
|
1011
|
+
if (this.canEdit()) {
|
|
1012
|
+
const focus = this.selectionStore.get('focus');
|
|
1013
|
+
if (!focus) {
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
const data = this.columnService.getSaveData(focus.y, focus.x);
|
|
1017
|
+
(_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
/**
|
|
1021
|
+
* Close editor event triggered
|
|
1022
|
+
* @param details - if it requires focus next
|
|
1023
|
+
*/
|
|
1024
|
+
async closeEdit(e) {
|
|
1025
|
+
this.cancelEdit.emit();
|
|
1026
|
+
if (e === null || e === void 0 ? void 0 : e.detail) {
|
|
1027
|
+
await this.focusNext();
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Edit finished.
|
|
1032
|
+
* Close Editor and save.
|
|
1033
|
+
*/
|
|
1034
|
+
cellEdit(e) {
|
|
1035
|
+
const dataToSave = this.columnService.getSaveData(e.rgRow, e.rgCol, e.val);
|
|
1036
|
+
this.cellEditApply.emit(dataToSave);
|
|
1037
|
+
}
|
|
1038
|
+
getRegion() {
|
|
1039
|
+
const focus = this.selectionStore.get('focus');
|
|
1040
|
+
let range = this.selectionStore.get('range');
|
|
1041
|
+
if (!range) {
|
|
1042
|
+
range = getRange(focus, focus);
|
|
1043
|
+
}
|
|
1044
|
+
return range;
|
|
1045
|
+
}
|
|
1046
|
+
onCopy(e) {
|
|
1047
|
+
var _a;
|
|
1048
|
+
const range = this.getRegion();
|
|
1049
|
+
const canCopyEvent = this.beforeCopyRegion.emit(range);
|
|
1050
|
+
if (canCopyEvent.defaultPrevented) {
|
|
1051
|
+
return false;
|
|
1052
|
+
}
|
|
1053
|
+
let rangeData;
|
|
1054
|
+
if (range) {
|
|
1055
|
+
const { data, mapping } = this.columnService.copyRangeArray(range, this.dataStore);
|
|
1056
|
+
const event = this.rangeClipboardCopy.emit(Object.assign({ range,
|
|
1057
|
+
data,
|
|
1058
|
+
mapping }, this.types));
|
|
1059
|
+
if (!event.defaultPrevented) {
|
|
1060
|
+
rangeData = event.detail.data;
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
(_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.doCopy(e, rangeData);
|
|
1064
|
+
return true;
|
|
1065
|
+
}
|
|
1066
|
+
onPaste(data) {
|
|
1067
|
+
var _a;
|
|
1068
|
+
const focus = this.selectionStore.get('focus');
|
|
1069
|
+
const isEditing = this.selectionStore.get('edit') !== null;
|
|
1070
|
+
if (!focus || isEditing) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
let { changed, range } = this.columnService.getTransformedDataToApply(focus, data);
|
|
1074
|
+
const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
|
|
1075
|
+
if (canPaste) {
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range, range, true);
|
|
1079
|
+
}
|
|
1080
|
+
async focusNext() {
|
|
1081
|
+
var _a;
|
|
1082
|
+
const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
|
|
1083
|
+
code: codesLetter.ARROW_DOWN,
|
|
1084
|
+
}), this.range));
|
|
1085
|
+
if (!canFocus) {
|
|
1086
|
+
this.closeEdit();
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
clearCell() {
|
|
1090
|
+
var _a;
|
|
1091
|
+
const range = this.selectionStore.get('range');
|
|
1092
|
+
if (range && !isRangeSingleCell(range)) {
|
|
1093
|
+
const data = this.columnService.getRangeStaticData(range, '');
|
|
1094
|
+
(_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range, range, false, true);
|
|
1095
|
+
}
|
|
1096
|
+
else if (this.canEdit()) {
|
|
1097
|
+
const focused = this.selectionStore.get('focus');
|
|
1098
|
+
if (!focused) {
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
const cell = this.columnService.getSaveData(focused.y, focused.x);
|
|
1102
|
+
this.cellEdit({
|
|
1103
|
+
rgRow: focused.y,
|
|
1104
|
+
rgCol: focused.x,
|
|
1105
|
+
val: '',
|
|
1106
|
+
type: cell.type,
|
|
1107
|
+
prop: cell.prop,
|
|
1108
|
+
});
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
rowDragStart({ detail }) {
|
|
1112
|
+
detail.text = getCellData(this.columnService.rowDataModel(detail.cell.y, detail.cell.x).value);
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Verify if edit allowed.
|
|
1116
|
+
*/
|
|
1117
|
+
canEdit() {
|
|
1118
|
+
var _a;
|
|
1119
|
+
if (this.readonly) {
|
|
1120
|
+
return false;
|
|
1121
|
+
}
|
|
1122
|
+
const focus = this.selectionStore.get('focus');
|
|
1123
|
+
return focus && !((_a = this.columnService) === null || _a === void 0 ? void 0 : _a.isReadOnly(focus.y, focus.x));
|
|
1124
|
+
}
|
|
1125
|
+
get edited() {
|
|
1126
|
+
return this.selectionStore.get('edit');
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Sets the focus on a cell and optionally edits a range.
|
|
1130
|
+
*/
|
|
1131
|
+
focus(cell, isRangeEdit = false, isPrevent = false) {
|
|
1132
|
+
if (!cell || isPrevent)
|
|
1133
|
+
return false;
|
|
1134
|
+
const end = cell;
|
|
1135
|
+
const start = this.selectionStore.get('focus');
|
|
1136
|
+
if (isRangeEdit && start) {
|
|
1137
|
+
const range = getRange(start, end);
|
|
1138
|
+
if (range) {
|
|
1139
|
+
return this.triggerRangeEvent(range);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return this.doFocus(cell, end);
|
|
1143
|
+
}
|
|
1144
|
+
get types() {
|
|
1145
|
+
return {
|
|
1146
|
+
rowType: this.dataStore.get('type'),
|
|
1147
|
+
colType: this.columnService.type,
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Collect data
|
|
1152
|
+
*/
|
|
1153
|
+
getData() {
|
|
1154
|
+
return {
|
|
1155
|
+
el: this.element,
|
|
1156
|
+
rows: this.dimensionRow.state,
|
|
1157
|
+
cols: this.dimensionCol.state,
|
|
1158
|
+
lastCell: this.lastCell,
|
|
1159
|
+
focus: this.selectionStore.get('focus'),
|
|
1160
|
+
range: this.selectionStore.get('range'),
|
|
1161
|
+
edit: this.selectionStore.get('edit'),
|
|
1162
|
+
};
|
|
1163
|
+
}
|
|
1164
|
+
get element() { return getElement(this); }
|
|
1165
|
+
static get watchers() { return {
|
|
1166
|
+
"selectionStore": ["selectionServiceSet"],
|
|
1167
|
+
"dimensionRow": ["createAutoFillService"],
|
|
1168
|
+
"dimensionCol": ["createAutoFillService"],
|
|
1169
|
+
"dataStore": ["columnServiceSet"],
|
|
1170
|
+
"colData": ["columnServiceSet"]
|
|
1171
|
+
}; }
|
|
1172
|
+
};
|
|
1173
|
+
OverlaySelection.style = revogrOverlayStyleCss;
|
|
1174
|
+
|
|
1175
|
+
const RowHeaderRender = s => (__, { rowIndex: i }) => s + i;
|
|
1176
|
+
|
|
1177
|
+
const RevogrRowHeaders = class {
|
|
1178
|
+
constructor(hostRef) {
|
|
1179
|
+
registerInstance(this, hostRef);
|
|
1180
|
+
this.scrollViewport = createEvent(this, "scrollview", 3);
|
|
1181
|
+
this.elementToScroll = createEvent(this, "ref", 3);
|
|
1182
|
+
/**
|
|
1183
|
+
* Prevent rendering until job is done.
|
|
1184
|
+
* Can be used for initial rendering performance improvement.
|
|
1185
|
+
* When several plugins require initial rendering this will prevent double initial rendering.
|
|
1186
|
+
*/
|
|
1187
|
+
this.jobsBeforeRender = [];
|
|
1188
|
+
}
|
|
1189
|
+
render() {
|
|
1190
|
+
const dataViews = [];
|
|
1191
|
+
const viewport = new ViewportStore('colPinStart');
|
|
1192
|
+
/** render viewports rows */
|
|
1193
|
+
let totalLength = 1;
|
|
1194
|
+
// todo: this part could be optimized to avoid to often re-render dataPorts can be cached
|
|
1195
|
+
for (let data of this.dataPorts) {
|
|
1196
|
+
const itemCount = data.dataStore.get('items').length;
|
|
1197
|
+
// initiate row data
|
|
1198
|
+
const dataStore = new DataStore(data.type, Object.assign({}, data.dataStore.state));
|
|
1199
|
+
// initiate column data
|
|
1200
|
+
const colData = new DataStore('colPinStart');
|
|
1201
|
+
const column = Object.assign({ cellTemplate: RowHeaderRender(totalLength) }, this.rowHeaderColumn);
|
|
1202
|
+
colData.updateData([column]);
|
|
1203
|
+
dataViews.push(h("revogr-data", Object.assign({}, data, { colType: "rowHeaders", jobsBeforeRender: this.jobsBeforeRender, rowClass: this.rowClass, dataStore: dataStore.store, colData: colData.store, viewportCol: viewport.store, readonly: true, range: false })));
|
|
1204
|
+
totalLength += itemCount;
|
|
1205
|
+
}
|
|
1206
|
+
const colSize = calculateRowHeaderSize(totalLength, this.rowHeaderColumn);
|
|
1207
|
+
viewport.setViewport({
|
|
1208
|
+
realCount: 1,
|
|
1209
|
+
virtualSize: 0,
|
|
1210
|
+
items: [
|
|
1211
|
+
{
|
|
1212
|
+
size: colSize,
|
|
1213
|
+
start: 0,
|
|
1214
|
+
end: colSize,
|
|
1215
|
+
itemIndex: 0,
|
|
1216
|
+
},
|
|
1217
|
+
],
|
|
1218
|
+
});
|
|
1219
|
+
const viewportScroll = {
|
|
1220
|
+
contentHeight: this.height,
|
|
1221
|
+
contentWidth: 0,
|
|
1222
|
+
style: { minWidth: `${colSize}px` },
|
|
1223
|
+
colType: 'rowHeaders',
|
|
1224
|
+
ref: (el) => this.elementToScroll.emit(el),
|
|
1225
|
+
onScrollviewport: (e) => this.scrollViewport.emit(e.detail),
|
|
1226
|
+
};
|
|
1227
|
+
const viewportHeader = Object.assign(Object.assign({}, this.headerProp), {
|
|
1228
|
+
// groups not present on row headers
|
|
1229
|
+
groups: [], colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: ROW_HEADER_TYPE,
|
|
1230
|
+
// parent,
|
|
1231
|
+
slot: HEADER_SLOT
|
|
1232
|
+
});
|
|
1233
|
+
return (h(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, h("revogr-viewport-scroll", Object.assign({ key: '28984c9e3e4e84afc0acf66093f4f4f8b5846098' }, viewportScroll, { "row-header": true }), h("revogr-header", Object.assign({ key: 'c80b058075fdb384039a58827c2c498acdbe1cdf' }, viewportHeader)), dataViews)));
|
|
1234
|
+
}
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* Autohide scroll for MacOS when scroll is visible only for 1 sec
|
|
1239
|
+
*/
|
|
1240
|
+
class AutohideScrollPlugin {
|
|
1241
|
+
constructor(element) {
|
|
1242
|
+
this.element = element;
|
|
1243
|
+
this.autohideScrollTimeout = 0;
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* When scroll size updates set it up for autohide
|
|
1247
|
+
*/
|
|
1248
|
+
setScrollSize(s) {
|
|
1249
|
+
if (!s) {
|
|
1250
|
+
this.element.setAttribute('autohide', 'true');
|
|
1251
|
+
}
|
|
1252
|
+
else {
|
|
1253
|
+
this.element.removeAttribute('autohide');
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* On each scroll check if it's time to show
|
|
1258
|
+
*/
|
|
1259
|
+
checkScroll({ scrollSize, contentSize, virtualSize, }) {
|
|
1260
|
+
const hasScroll = contentSize > virtualSize;
|
|
1261
|
+
const isHidden = !scrollSize && hasScroll;
|
|
1262
|
+
if (isHidden) {
|
|
1263
|
+
this.element.setAttribute('visible', 'true');
|
|
1264
|
+
this.autohideScrollTimeout = this.show(this.element, this.autohideScrollTimeout);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
show(element, timeout) {
|
|
1268
|
+
clearTimeout(timeout);
|
|
1269
|
+
return Number(setTimeout(() => {
|
|
1270
|
+
element === null || element === void 0 ? void 0 : element.removeAttribute('visible');
|
|
1271
|
+
}, 1000));
|
|
1272
|
+
}
|
|
1273
|
+
clear() {
|
|
1274
|
+
clearTimeout(this.autohideScrollTimeout);
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
const revogrScrollStyleCss = "revogr-scroll-virtual[autohide]{position:absolute;z-index:100 !important}revogr-scroll-virtual[autohide].vertical{top:0;right:0}revogr-scroll-virtual[autohide].vertical[visible]{min-width:20px !important}revogr-scroll-virtual[autohide].horizontal{bottom:0;left:0}revogr-scroll-virtual[autohide].horizontal[visible]{min-height:20px !important}revogr-scroll-virtual.vertical{overflow-y:auto;overflow-x:hidden;height:100%}revogr-scroll-virtual.vertical>div{width:1px}revogr-scroll-virtual.horizontal{overflow-x:auto;overflow-y:hidden;width:100%}revogr-scroll-virtual.horizontal>div{height:1px}";
|
|
1279
|
+
|
|
1280
|
+
const RevogrScrollVirtual = class {
|
|
1281
|
+
constructor(hostRef) {
|
|
1282
|
+
registerInstance(this, hostRef);
|
|
1283
|
+
this.scrollVirtual = createEvent(this, "scrollvirtual", 7);
|
|
1284
|
+
/**
|
|
1285
|
+
* Scroll dimension (`X` - `rgCol` or `Y` - `rgRow`)
|
|
1286
|
+
*/
|
|
1287
|
+
this.dimension = 'rgRow';
|
|
1288
|
+
this.scrollSize = 0;
|
|
1289
|
+
}
|
|
1290
|
+
async setScroll(e) {
|
|
1291
|
+
var _a;
|
|
1292
|
+
if (this.dimension !== e.dimension) {
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
this.localScrollTimer.latestScrollUpdate(e.dimension);
|
|
1296
|
+
(_a = this.localScrollService) === null || _a === void 0 ? void 0 : _a.setScroll(e);
|
|
1297
|
+
if (e.coordinate) {
|
|
1298
|
+
this.autohideScrollPlugin.checkScroll({
|
|
1299
|
+
scrollSize: this.scrollSize,
|
|
1300
|
+
contentSize: this.realSize,
|
|
1301
|
+
virtualSize: this.virtualSize,
|
|
1302
|
+
});
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Update if `delta` exists in case we don't know current position or if it's external change
|
|
1307
|
+
*/
|
|
1308
|
+
async changeScroll(e) {
|
|
1309
|
+
if (e.delta) {
|
|
1310
|
+
switch (e.dimension) {
|
|
1311
|
+
case 'rgCol':
|
|
1312
|
+
e.coordinate = this.element.scrollLeft + e.delta;
|
|
1313
|
+
break;
|
|
1314
|
+
case 'rgRow':
|
|
1315
|
+
e.coordinate = this.element.scrollTop + e.delta;
|
|
1316
|
+
break;
|
|
1317
|
+
}
|
|
1318
|
+
this.setScroll(e);
|
|
1319
|
+
}
|
|
1320
|
+
return e;
|
|
1321
|
+
}
|
|
1322
|
+
connectedCallback() {
|
|
1323
|
+
this.autohideScrollPlugin = new AutohideScrollPlugin(this.element);
|
|
1324
|
+
this.localScrollTimer = new LocalScrollTimer('ontouchstart' in document.documentElement ? 0 : 10);
|
|
1325
|
+
this.localScrollService = new LocalScrollService({
|
|
1326
|
+
runScroll: e => this.scrollVirtual.emit(e),
|
|
1327
|
+
applyScroll: e => {
|
|
1328
|
+
this.localScrollTimer.setCoordinate(e);
|
|
1329
|
+
const type = e.dimension === 'rgRow' ? 'scrollTop' : 'scrollLeft';
|
|
1330
|
+
// this will trigger on scroll event
|
|
1331
|
+
this.element[type] = e.coordinate;
|
|
1332
|
+
},
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
disconnectedCallback() {
|
|
1336
|
+
this.autohideScrollPlugin.clear();
|
|
1337
|
+
}
|
|
1338
|
+
componentWillLoad() {
|
|
1339
|
+
this.scrollSize = getScrollbarSize(document);
|
|
1340
|
+
}
|
|
1341
|
+
componentDidRender() {
|
|
1342
|
+
let scrollSize = 0;
|
|
1343
|
+
if (this.dimension === 'rgRow') {
|
|
1344
|
+
scrollSize = this.element.scrollHeight > this.element.clientHeight ? this.scrollSize : 0;
|
|
1345
|
+
this.element.style.minWidth = `${scrollSize}px`;
|
|
1346
|
+
}
|
|
1347
|
+
else {
|
|
1348
|
+
scrollSize = this.element.scrollWidth > this.element.clientWidth ? this.scrollSize : 0;
|
|
1349
|
+
this.element.style.minHeight = `${scrollSize}px`;
|
|
1350
|
+
}
|
|
1351
|
+
this.autohideScrollPlugin.setScrollSize(scrollSize);
|
|
1352
|
+
this.localScrollService.setParams({
|
|
1353
|
+
contentSize: this.realSize,
|
|
1354
|
+
clientSize: this.dimension === 'rgRow' ? this.element.clientHeight : this.element.clientWidth,
|
|
1355
|
+
virtualSize: this.clientSize,
|
|
1356
|
+
}, this.dimension);
|
|
1357
|
+
}
|
|
1358
|
+
onScroll(e) {
|
|
1359
|
+
if (!(e.target instanceof Element)) {
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
const target = e.target;
|
|
1363
|
+
let type = 'scrollLeft';
|
|
1364
|
+
if (this.dimension === 'rgRow') {
|
|
1365
|
+
type = 'scrollTop';
|
|
1366
|
+
}
|
|
1367
|
+
const setScroll = () => {
|
|
1368
|
+
var _a;
|
|
1369
|
+
(_a = this.localScrollService) === null || _a === void 0 ? void 0 : _a.scroll(target[type] || 0, this.dimension);
|
|
1370
|
+
};
|
|
1371
|
+
// apply after throttling
|
|
1372
|
+
if (this.localScrollTimer.isReady(this.dimension, target[type])) {
|
|
1373
|
+
setScroll();
|
|
1374
|
+
}
|
|
1375
|
+
else {
|
|
1376
|
+
this.localScrollTimer.throttleLastScrollUpdate(this.dimension, target[type] || 0, () => setScroll());
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
render() {
|
|
1380
|
+
const size = getContentSize(this.realSize, this.dimension === 'rgRow' ? this.element.clientHeight : this.element.clientWidth, this.clientSize);
|
|
1381
|
+
return (h(Host, { key: '4860fd23ab394219bdd75e206016e464ca228691', onScroll: (e) => this.onScroll(e) }, h("div", { key: '3e622a835e5717cfde81948d22ee64f2582001e7', style: {
|
|
1382
|
+
[this.dimension === 'rgRow' ? 'height' : 'width']: `${size}px`,
|
|
1383
|
+
} })));
|
|
1384
|
+
}
|
|
1385
|
+
get element() { return getElement(this); }
|
|
1386
|
+
};
|
|
1387
|
+
RevogrScrollVirtual.style = revogrScrollStyleCss;
|
|
1388
|
+
|
|
1389
|
+
const revogrTempRangeStyleCss = ".temp-bg-range{display:block !important;position:absolute;pointer-events:none;z-index:9;border:1px solid rgb(255, 94, 0);box-sizing:border-box}.temp-bg-range.Selection{border:1px dashed gray}.temp-bg-range>div{width:1px;height:1px;position:absolute}.temp-bg-range>div.top{top:-1px}.temp-bg-range>div.bottom{bottom:-1px}.temp-bg-range>div.left{left:-1px}.temp-bg-range>div.right{right:-1px}";
|
|
1390
|
+
|
|
1391
|
+
const RevogrFocus = class {
|
|
1392
|
+
constructor(hostRef) {
|
|
1393
|
+
registerInstance(this, hostRef);
|
|
1394
|
+
this.onChange = throttle((e) => this.doChange(e), 300);
|
|
1395
|
+
}
|
|
1396
|
+
doChange(e) {
|
|
1397
|
+
e === null || e === void 0 ? void 0 : e.scrollIntoView({
|
|
1398
|
+
block: 'nearest',
|
|
1399
|
+
inline: 'nearest',
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
componentDidRender() {
|
|
1403
|
+
if (this.el) {
|
|
1404
|
+
this.onChange(this.el);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
render() {
|
|
1408
|
+
const data = this.selectionStore.get('tempRange');
|
|
1409
|
+
const type = this.selectionStore.get('tempRangeType');
|
|
1410
|
+
if (!data) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
let directionY = 'bottom';
|
|
1414
|
+
let derectionX = 'right';
|
|
1415
|
+
const range = this.getRange();
|
|
1416
|
+
if (!range) {
|
|
1417
|
+
return;
|
|
1418
|
+
}
|
|
1419
|
+
if (data.y < range.y) {
|
|
1420
|
+
directionY = 'top';
|
|
1421
|
+
}
|
|
1422
|
+
if (data.x < range.x) {
|
|
1423
|
+
derectionX = 'left';
|
|
1424
|
+
}
|
|
1425
|
+
const directionClass = `${derectionX} ${directionY}`;
|
|
1426
|
+
const cell = getCell(data, this.dimensionRow.state, this.dimensionCol.state);
|
|
1427
|
+
const styles = styleByCellProps(cell);
|
|
1428
|
+
const props = {
|
|
1429
|
+
class: {
|
|
1430
|
+
[TMP_SELECTION_BG_CLASS]: true,
|
|
1431
|
+
[type || '']: true,
|
|
1432
|
+
},
|
|
1433
|
+
style: styles,
|
|
1434
|
+
hidden: false
|
|
1435
|
+
};
|
|
1436
|
+
return (h(Host, Object.assign({}, props), h("div", { class: directionClass, ref: (e) => (this.el = e) })));
|
|
1437
|
+
}
|
|
1438
|
+
getRange() {
|
|
1439
|
+
const range = this.selectionStore.get('range');
|
|
1440
|
+
if (range) {
|
|
1441
|
+
return range;
|
|
1442
|
+
}
|
|
1443
|
+
const focus = this.selectionStore.get('focus');
|
|
1444
|
+
if (!focus) {
|
|
1445
|
+
return null;
|
|
1446
|
+
}
|
|
1447
|
+
return Object.assign(Object.assign({}, focus), { x1: focus.x, y1: focus.y });
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
RevogrFocus.style = revogrTempRangeStyleCss;
|
|
1451
|
+
|
|
1452
|
+
export { Attribution as revogr_attribution, RevoGridExtra as revogr_extra, RevogrFocus$1 as revogr_focus, OverlaySelection as revogr_overlay_selection, RevogrRowHeaders as revogr_row_headers, RevogrScrollVirtual as revogr_scroll_virtual, RevogrFocus as revogr_temp_range };
|
|
1453
|
+
//# sourceMappingURL=revogr-attribution.revogr-extra.revogr-focus.revogr-overlay-selection.revogr-row-headers.revogr-scroll-virtual.revogr-temp-range.entry.js.map
|
|
1454
|
+
|
|
1455
|
+
//# sourceMappingURL=revogr-attribution_7.entry.js.map
|