@revolist/revogrid 3.6.7 → 3.6.8
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/custom-element/_baseIteratee.js +3 -1
- package/custom-element/_baseIteratee.js.map +1 -0
- package/custom-element/columnService.js +6 -4
- package/custom-element/columnService.js.map +1 -0
- package/custom-element/consts.js +3 -1
- package/custom-element/consts.js.map +1 -0
- package/custom-element/data.store.js +55 -33
- package/custom-element/data.store.js.map +1 -0
- package/custom-element/debounce.js +3 -1
- package/custom-element/debounce.js.map +1 -0
- package/custom-element/dimension.helpers.js +3 -1
- package/custom-element/dimension.helpers.js.map +1 -0
- package/custom-element/each.js +2 -0
- package/custom-element/each.js.map +1 -0
- package/custom-element/filter.button.js +2 -0
- package/custom-element/filter.button.js.map +1 -0
- package/custom-element/identity.js +2 -0
- package/custom-element/identity.js.map +1 -0
- package/custom-element/index.d.ts +9 -16
- package/custom-element/index.js +4 -15
- package/custom-element/index.js.map +1 -0
- package/custom-element/isSymbol.js +3 -1
- package/custom-element/isSymbol.js.map +1 -0
- package/custom-element/keys.js +3 -1
- package/custom-element/keys.js.map +1 -0
- package/custom-element/localScrollService.js +2 -0
- package/custom-element/localScrollService.js.map +1 -0
- package/custom-element/resize-observer.js +2 -0
- package/custom-element/resize-observer.js.map +1 -0
- package/custom-element/revo-grid.js +29 -154
- package/custom-element/revo-grid.js.map +1 -0
- package/custom-element/revogr-clipboard.js +4 -4
- package/custom-element/revogr-clipboard.js.map +1 -0
- package/custom-element/revogr-data.js +2 -0
- package/custom-element/revogr-data.js.map +1 -0
- package/custom-element/revogr-data2.js +14 -3
- package/custom-element/revogr-data2.js.map +1 -0
- package/custom-element/revogr-edit.js +2 -0
- package/custom-element/revogr-edit.js.map +1 -0
- package/custom-element/revogr-edit2.js +7 -3
- package/custom-element/revogr-edit2.js.map +1 -0
- package/custom-element/revogr-filter-panel.js +10 -6
- package/custom-element/revogr-filter-panel.js.map +1 -0
- package/custom-element/revogr-focus.js +2 -0
- package/custom-element/revogr-focus.js.map +1 -0
- package/custom-element/revogr-focus2.js +8 -2
- package/custom-element/revogr-focus2.js.map +1 -0
- package/custom-element/revogr-header.js +2 -0
- package/custom-element/revogr-header.js.map +1 -0
- package/custom-element/revogr-header2.js +11 -3
- package/custom-element/revogr-header2.js.map +1 -0
- package/custom-element/revogr-order-editor.js +2 -0
- package/custom-element/revogr-order-editor.js.map +1 -0
- package/custom-element/revogr-order-editor2.js +8 -3
- package/custom-element/revogr-order-editor2.js.map +1 -0
- package/custom-element/revogr-overlay-selection.js +2 -0
- package/custom-element/revogr-overlay-selection.js.map +1 -0
- package/custom-element/revogr-overlay-selection2.js +42 -40
- package/custom-element/revogr-overlay-selection2.js.map +1 -0
- package/custom-element/revogr-row-headers.js +2 -0
- package/custom-element/revogr-row-headers.js.map +1 -0
- package/custom-element/revogr-row-headers2.js +9 -2
- package/custom-element/revogr-row-headers2.js.map +1 -0
- package/custom-element/revogr-scroll-virtual.js +2 -0
- package/custom-element/revogr-scroll-virtual.js.map +1 -0
- package/custom-element/revogr-scroll-virtual2.js +5 -2
- package/custom-element/revogr-scroll-virtual2.js.map +1 -0
- package/custom-element/revogr-temp-range.js +2 -0
- package/custom-element/revogr-temp-range.js.map +1 -0
- package/custom-element/revogr-temp-range2.js +8 -4
- package/custom-element/revogr-temp-range2.js.map +1 -0
- package/custom-element/revogr-viewport-scroll.js +2 -0
- package/custom-element/revogr-viewport-scroll.js.map +1 -0
- package/custom-element/revogr-viewport-scroll2.js +6 -11
- package/custom-element/revogr-viewport-scroll2.js.map +1 -0
- package/custom-element/selection.utils.js +2 -0
- package/custom-element/selection.utils.js.map +1 -0
- package/custom-element/themeService.js +65 -0
- package/custom-element/themeService.js.map +1 -0
- package/custom-element/toInteger.js +2 -0
- package/custom-element/toInteger.js.map +1 -0
- package/custom-element/toNumber.js +3 -1
- package/custom-element/toNumber.js.map +1 -0
- package/custom-element/utils.js +2 -0
- package/custom-element/utils.js.map +1 -0
- package/dist/cjs/{debounce-6cea2774.js → debounce-a0628875.js} +3 -1
- package/dist/cjs/debounce-a0628875.js.map +1 -0
- package/dist/cjs/{index-cb904e00.js → index-c209f988.js} +667 -315
- package/dist/cjs/index-c209f988.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -26
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/{resize-observer-bf327d6a.js → resize-observer-cc749e66.js} +2 -0
- package/dist/cjs/resize-observer-cc749e66.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.js +9 -60
- package/dist/cjs/revo-grid.cjs.js.map +1 -0
- package/dist/cjs/revo-grid_11.cjs.entry.js +169 -180
- package/dist/cjs/revo-grid_11.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-clipboard.cjs.entry.js +4 -3
- package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +11 -6
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -0
- package/dist/collection/collection-manifest.json +16 -16
- package/dist/collection/components/button/button.js +2 -1
- package/dist/collection/components/button/button.js.map +1 -0
- package/dist/collection/components/clipboard/revogr-clipboard.js +86 -80
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -0
- package/dist/collection/components/data/cellRenderer.js +5 -5
- package/dist/collection/components/data/cellRenderer.js.map +1 -0
- package/dist/collection/components/data/columnService.js +9 -8
- package/dist/collection/components/data/columnService.js.map +1 -0
- package/dist/collection/components/data/revogr-data.js +258 -226
- package/dist/collection/components/data/revogr-data.js.map +1 -0
- package/dist/collection/components/data/rowRenderer.js +2 -1
- package/dist/collection/components/data/rowRenderer.js.map +1 -0
- package/dist/collection/components/header/headerCellRenderer.js +6 -7
- package/dist/collection/components/header/headerCellRenderer.js.map +1 -0
- package/dist/collection/components/header/headerRenderer.js +7 -8
- package/dist/collection/components/header/headerRenderer.js.map +1 -0
- package/dist/collection/components/header/revogr-header.js +259 -233
- package/dist/collection/components/header/revogr-header.js.map +1 -0
- package/dist/collection/components/order/orderRenderer.js +3 -6
- package/dist/collection/components/order/orderRenderer.js.map +1 -0
- package/dist/collection/components/order/revogr-order-editor.js +279 -252
- package/dist/collection/components/order/revogr-order-editor.js.map +1 -0
- package/dist/collection/components/order/rowOrderService.js +2 -1
- package/dist/collection/components/order/rowOrderService.js.map +1 -0
- package/dist/collection/components/overlay/autofill.service.js +8 -7
- package/dist/collection/components/overlay/autofill.service.js.map +1 -0
- package/dist/collection/components/overlay/clipboard.service.js +4 -3
- package/dist/collection/components/overlay/clipboard.service.js.map +1 -0
- package/dist/collection/components/overlay/editors/edit.utils.js +2 -1
- package/dist/collection/components/overlay/editors/edit.utils.js.map +1 -0
- package/dist/collection/components/overlay/editors/text.js +4 -3
- package/dist/collection/components/overlay/editors/text.js.map +1 -0
- package/dist/collection/components/overlay/keyboard.service.js +6 -5
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -0
- package/dist/collection/components/overlay/revogr-edit.js +112 -96
- package/dist/collection/components/overlay/revogr-edit.js.map +1 -0
- package/dist/collection/components/overlay/revogr-overlay-selection.js +546 -482
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -0
- package/dist/collection/components/overlay/selection.utils.js +2 -1
- package/dist/collection/components/overlay/selection.utils.js.map +1 -0
- package/dist/collection/components/revo-grid/revo-grid-style.css +7 -13
- package/dist/collection/components/revo-grid/revo-grid.js +1668 -1638
- package/dist/collection/components/revo-grid/revo-grid.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.helpers.js +1 -0
- package/dist/collection/components/revo-grid/viewport.helpers.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.interfaces.js +1 -3
- package/dist/collection/components/revo-grid/viewport.interfaces.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.js +4 -7
- package/dist/collection/components/revo-grid/viewport.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.resize.service.js +3 -2
- package/dist/collection/components/revo-grid/viewport.resize.service.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.scrolling.service.js +1 -0
- package/dist/collection/components/revo-grid/viewport.scrolling.service.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.section.js +5 -7
- package/dist/collection/components/revo-grid/viewport.section.js.map +1 -0
- package/dist/collection/components/revo-grid/viewport.service.js +7 -6
- package/dist/collection/components/revo-grid/viewport.service.js.map +1 -0
- package/dist/collection/components/rowHeaders/revogr-row-headers.js +161 -147
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -0
- package/dist/collection/components/rowHeaders/row-header-render.js +1 -0
- package/dist/collection/components/rowHeaders/row-header-render.js.map +1 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +2 -4
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +172 -168
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -0
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js +159 -137
- package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +1 -0
- package/dist/collection/components/selection-focus/revogr-focus.js +153 -128
- package/dist/collection/components/selection-focus/revogr-focus.js.map +1 -0
- package/dist/collection/components/selection-temp-range/revogr-temp-range-style.css +1 -1
- package/dist/collection/components/selection-temp-range/revogr-temp-range.js +92 -77
- package/dist/collection/components/selection-temp-range/revogr-temp-range.js.map +1 -0
- package/dist/collection/global/global.js +3 -2
- package/dist/collection/global/global.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/plugins/autoSizeColumn.js +7 -6
- package/dist/collection/plugins/autoSizeColumn.js.map +1 -0
- package/dist/collection/plugins/basePlugin.js +1 -0
- package/dist/collection/plugins/basePlugin.js.map +1 -0
- package/dist/collection/plugins/dispatcher.js +1 -0
- package/dist/collection/plugins/dispatcher.js.map +1 -0
- package/dist/collection/plugins/export/csv.js +2 -1
- package/dist/collection/plugins/export/csv.js.map +1 -0
- package/dist/collection/plugins/export/export.plugin.js +6 -5
- package/dist/collection/plugins/export/export.plugin.js.map +1 -0
- package/dist/collection/plugins/export/types.js +1 -3
- package/dist/collection/plugins/export/types.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/equal.js +1 -0
- package/dist/collection/plugins/filter/conditions/equal.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js +1 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThan.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js +3 -2
- package/dist/collection/plugins/filter/conditions/number/greaterThanOrEqual.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/lessThan.js +1 -0
- package/dist/collection/plugins/filter/conditions/number/lessThan.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js +3 -2
- package/dist/collection/plugins/filter/conditions/number/lessThanOrEqual.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/set.js +1 -0
- package/dist/collection/plugins/filter/conditions/set.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/string/beginswith.js +1 -0
- package/dist/collection/plugins/filter/conditions/string/beginswith.js.map +1 -0
- package/dist/collection/plugins/filter/conditions/string/contains.js +1 -0
- package/dist/collection/plugins/filter/conditions/string/contains.js.map +1 -0
- package/dist/collection/plugins/filter/filter.button.js +7 -12
- package/dist/collection/plugins/filter/filter.button.js.map +1 -0
- package/dist/collection/plugins/filter/filter.plugin.js +5 -4
- package/dist/collection/plugins/filter/filter.plugin.js.map +1 -0
- package/dist/collection/plugins/filter/filter.pop.js +254 -238
- package/dist/collection/plugins/filter/filter.pop.js.map +1 -0
- package/dist/collection/plugins/filter/filter.service.js +9 -8
- package/dist/collection/plugins/filter/filter.service.js.map +1 -0
- package/dist/collection/plugins/filter/filter.style.css +2 -3
- package/dist/collection/plugins/filter/filter.types.js +1 -3
- package/dist/collection/plugins/filter/filter.types.js.map +1 -0
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +6 -5
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -0
- package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js +4 -3
- package/dist/collection/plugins/groupingColumn/grouping.col.plugin.js.map +1 -0
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +4 -3
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.const.js +2 -1
- package/dist/collection/plugins/groupingRow/grouping.const.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js +3 -2
- package/dist/collection/plugins/groupingRow/grouping.row.expand.service.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +14 -13
- package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +6 -10
- package/dist/collection/plugins/groupingRow/grouping.row.renderer.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.row.types.js +1 -3
- package/dist/collection/plugins/groupingRow/grouping.row.types.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.service.js +2 -1
- package/dist/collection/plugins/groupingRow/grouping.service.js.map +1 -0
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js +2 -1
- package/dist/collection/plugins/groupingRow/grouping.trimmed.service.js.map +1 -0
- package/dist/collection/plugins/moveColumn/columnDragPlugin.js +8 -7
- package/dist/collection/plugins/moveColumn/columnDragPlugin.js.map +1 -0
- package/dist/collection/plugins/moveColumn/columnOrderHandler.js +2 -1
- package/dist/collection/plugins/moveColumn/columnOrderHandler.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.plugin.js +8 -7
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -0
- package/dist/collection/plugins/sorting/sorting.sign.js +2 -1
- package/dist/collection/plugins/sorting/sorting.sign.js.map +1 -0
- package/dist/collection/plugins/stretchPlugin.js +4 -3
- package/dist/collection/plugins/stretchPlugin.js.map +1 -0
- package/dist/collection/plugins/trimmed/trimmed.plugin.js +1 -0
- package/dist/collection/plugins/trimmed/trimmed.plugin.js.map +1 -0
- package/dist/collection/services/cell.helpers.js +2 -1
- package/dist/collection/services/cell.helpers.js.map +1 -0
- package/dist/collection/services/column.data.provider.js +14 -13
- package/dist/collection/services/column.data.provider.js.map +1 -0
- package/dist/collection/services/data.provider.js +4 -3
- package/dist/collection/services/data.provider.js.map +1 -0
- package/dist/collection/services/dimension.provider.js +5 -4
- package/dist/collection/services/dimension.provider.js.map +1 -0
- package/dist/collection/services/localScrollService.js +2 -1
- package/dist/collection/services/localScrollService.js.map +1 -0
- package/dist/collection/services/resizable.directive.js +3 -4
- package/dist/collection/services/resizable.directive.js.map +1 -0
- package/dist/collection/services/selection.store.connector.js +3 -2
- package/dist/collection/services/selection.store.connector.js.map +1 -0
- package/dist/collection/services/viewport.provider.js +4 -3
- package/dist/collection/services/viewport.provider.js.map +1 -0
- package/dist/collection/store/dataSource/data.proxy.js +1 -0
- package/dist/collection/store/dataSource/data.proxy.js.map +1 -0
- package/dist/collection/store/dataSource/data.store.js +10 -9
- package/dist/collection/store/dataSource/data.store.js.map +1 -0
- package/dist/collection/store/dimension/dimension.helpers.js +5 -4
- package/dist/collection/store/dimension/dimension.helpers.js.map +1 -0
- package/dist/collection/store/dimension/dimension.store.js +9 -7
- package/dist/collection/store/dimension/dimension.store.js.map +1 -0
- package/dist/collection/store/selection/selection.helpers.js +2 -1
- package/dist/collection/store/selection/selection.helpers.js.map +1 -0
- package/dist/collection/store/selection/selection.store.js +4 -3
- package/dist/collection/store/selection/selection.store.js.map +1 -0
- package/dist/collection/store/selection/selection.store.service.js +2 -1
- package/dist/collection/store/selection/selection.store.service.js.map +1 -0
- package/dist/collection/store/storeTypes.js +1 -0
- package/dist/collection/store/storeTypes.js.map +1 -0
- package/dist/collection/store/viewPort/viewport.helpers.js +2 -1
- package/dist/collection/store/viewPort/viewport.helpers.js.map +1 -0
- package/dist/collection/store/viewPort/viewport.store.js +4 -3
- package/dist/collection/store/viewPort/viewport.store.js.map +1 -0
- package/dist/collection/themeManager/theme.compact.js +1 -0
- package/dist/collection/themeManager/theme.compact.js.map +1 -0
- package/dist/collection/themeManager/theme.default.js +1 -0
- package/dist/collection/themeManager/theme.default.js.map +1 -0
- package/dist/collection/themeManager/theme.material.js +1 -0
- package/dist/collection/themeManager/theme.material.js.map +1 -0
- package/dist/collection/themeManager/themeService.js +9 -8
- package/dist/collection/themeManager/themeService.js.map +1 -0
- package/dist/collection/utils/closestPolifill.js +1 -0
- package/dist/collection/utils/closestPolifill.js.map +1 -0
- package/dist/collection/utils/consts.js +1 -0
- package/dist/collection/utils/consts.js.map +1 -0
- package/dist/collection/utils/generateAlphabetHeader.js +1 -0
- package/dist/collection/utils/generateAlphabetHeader.js.map +1 -0
- package/dist/collection/utils/keyCodes.js +1 -0
- package/dist/collection/utils/keyCodes.js.map +1 -0
- package/dist/collection/utils/keyCodes.utils.js +4 -3
- package/dist/collection/utils/keyCodes.utils.js.map +1 -0
- package/dist/collection/utils/platform.js +1 -0
- package/dist/collection/utils/platform.js.map +1 -0
- package/dist/collection/utils/resizeObserver.js +1 -0
- package/dist/collection/utils/resizeObserver.js.map +1 -0
- package/dist/collection/utils/store.utils.js +1 -0
- package/dist/collection/utils/store.utils.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/esm/{debounce-e4e6dd45.js → debounce-cb7aac48.js} +3 -1
- package/dist/esm/debounce-cb7aac48.js.map +1 -0
- package/dist/esm/{index-6f753b3c.js → index-f21f8a13.js} +667 -311
- package/dist/esm/index-f21f8a13.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/loader.js +6 -26
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/{resize-observer-00c48d78.js → resize-observer-4f34a839.js} +2 -0
- package/dist/esm/resize-observer-4f34a839.js.map +1 -0
- package/dist/esm/revo-grid.js +7 -61
- package/dist/esm/revo-grid.js.map +1 -0
- package/dist/esm/revo-grid_11.entry.js +169 -180
- package/dist/esm/revo-grid_11.entry.js.map +1 -0
- package/dist/esm/revogr-clipboard.entry.js +4 -3
- package/dist/esm/revogr-clipboard.entry.js.map +1 -0
- package/dist/esm/revogr-filter-panel.entry.js +11 -6
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -0
- package/dist/esm-es5/{debounce-e4e6dd45.js → debounce-cb7aac48.js} +2 -1
- package/dist/esm-es5/debounce-cb7aac48.js.map +1 -0
- package/dist/esm-es5/index-f21f8a13.js +5 -0
- package/dist/esm-es5/index-f21f8a13.js.map +1 -0
- package/dist/esm-es5/index.js +1 -0
- package/dist/esm-es5/index.js.map +1 -0
- package/dist/esm-es5/loader.js +2 -1
- package/dist/esm-es5/loader.js.map +1 -0
- package/dist/esm-es5/{resize-observer-00c48d78.js → resize-observer-4f34a839.js} +2 -1
- package/dist/esm-es5/resize-observer-4f34a839.js.map +1 -0
- package/dist/esm-es5/revo-grid.js +2 -1
- package/dist/esm-es5/revo-grid.js.map +1 -0
- package/dist/esm-es5/revo-grid_11.entry.js +3 -2
- package/dist/esm-es5/revo-grid_11.entry.js.map +1 -0
- package/dist/esm-es5/revogr-clipboard.entry.js +3 -2
- package/dist/esm-es5/revogr-clipboard.entry.js.map +1 -0
- package/dist/esm-es5/revogr-filter-panel.entry.js +3 -2
- package/dist/esm-es5/revogr-filter-panel.entry.js.map +1 -0
- package/dist/revo-grid/{debounce-5a33c710.system.js → debounce-3aba7c4d.system.js} +2 -1
- package/dist/revo-grid/debounce-3aba7c4d.system.js.map +1 -0
- package/dist/revo-grid/debounce-cb7aac48.js +5 -0
- package/dist/revo-grid/debounce-cb7aac48.js.map +1 -0
- package/dist/revo-grid/index-20224007.system.js +6 -0
- package/dist/revo-grid/index-20224007.system.js.map +1 -0
- package/dist/revo-grid/index-f21f8a13.js +6 -0
- package/dist/revo-grid/index-f21f8a13.js.map +1 -0
- package/dist/revo-grid/index.esm.js +2 -0
- package/dist/revo-grid/index.esm.js.map +1 -0
- package/dist/revo-grid/index.system.js +2 -1
- package/dist/revo-grid/index.system.js.map +1 -0
- package/dist/revo-grid/{resize-observer-8af0bc0e.system.js → resize-observer-2a36c9e4.system.js} +2 -1
- package/dist/revo-grid/resize-observer-2a36c9e4.system.js.map +1 -0
- package/dist/revo-grid/resize-observer-4f34a839.js +5 -0
- package/dist/revo-grid/resize-observer-4f34a839.js.map +1 -0
- package/dist/revo-grid/revo-grid.esm.js +2 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -0
- package/dist/revo-grid/revo-grid.js +1 -7
- package/dist/revo-grid/revo-grid.system.js +2 -1
- package/dist/revo-grid/revo-grid.system.js.map +1 -0
- package/dist/revo-grid/revo-grid_11.entry.js +2 -1
- package/dist/revo-grid/revo-grid_11.entry.js.map +1 -0
- package/dist/revo-grid/revo-grid_11.system.entry.js +3 -2
- package/dist/revo-grid/revo-grid_11.system.entry.js.map +1 -0
- package/dist/revo-grid/revogr-clipboard.entry.js +2 -1
- package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -0
- package/dist/revo-grid/revogr-clipboard.system.entry.js +3 -2
- package/dist/revo-grid/revogr-clipboard.system.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +2 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.system.entry.js +3 -2
- package/dist/revo-grid/revogr-filter-panel.system.entry.js.map +1 -0
- package/dist/types/components/data/cellRenderer.d.ts +1 -1
- package/dist/types/components/data/columnService.d.ts +4 -4
- package/dist/types/components/header/headerCellRenderer.d.ts +1 -1
- package/dist/types/components/header/headerRenderer.d.ts +1 -1
- package/dist/types/components/order/orderRenderer.d.ts +1 -1
- package/dist/types/components/order/rowOrderService.d.ts +1 -1
- package/dist/types/components/overlay/autofill.service.d.ts +1 -1
- package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/types/components/overlay/editors/text.d.ts +1 -1
- package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +9 -3
- package/dist/types/components/overlay/selection.utils.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.interfaces.d.ts +5 -5
- package/dist/types/components/revo-grid/viewport.scrolling.service.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.section.d.ts +1 -1
- package/dist/types/components/revo-grid/viewport.service.d.ts +3 -3
- package/dist/types/components/rowHeaders/row-header-render.d.ts +1 -1
- package/dist/types/components.d.ts +26 -0
- package/dist/types/plugins/autoSizeColumn.d.ts +1 -1
- package/dist/types/plugins/dispatcher.d.ts +1 -1
- package/dist/types/plugins/export/csv.d.ts +1 -1
- package/dist/types/plugins/export/export.plugin.d.ts +1 -1
- package/dist/types/plugins/export/types.d.ts +2 -2
- package/dist/types/plugins/filter/filter.button.d.ts +1 -1
- package/dist/types/plugins/filter/filter.plugin.d.ts +6 -6
- package/dist/types/plugins/filter/filter.pop.d.ts +4 -4
- package/dist/types/plugins/filter/filter.service.d.ts +1 -1
- package/dist/types/plugins/filter/filter.types.d.ts +5 -5
- package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +1 -1
- package/dist/types/plugins/groupingColumn/grouping.col.plugin.d.ts +1 -1
- package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.row.renderer.d.ts +1 -1
- package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +5 -5
- package/dist/types/plugins/groupingRow/grouping.service.d.ts +1 -1
- package/dist/types/plugins/moveColumn/columnDragPlugin.d.ts +5 -5
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +1 -1
- package/dist/types/plugins/sorting/sorting.sign.d.ts +1 -1
- package/dist/types/plugins/trimmed/trimmed.plugin.d.ts +2 -2
- package/dist/types/services/column.data.provider.d.ts +4 -4
- package/dist/types/services/data.provider.d.ts +1 -1
- package/dist/types/services/dimension.provider.d.ts +2 -2
- package/dist/types/services/localScrollService.d.ts +1 -1
- package/dist/types/services/resizable.directive.d.ts +2 -2
- package/dist/types/services/selection.store.connector.d.ts +2 -2
- package/dist/types/services/viewport.provider.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +95 -20
- package/dist/types/store/dataSource/data.proxy.d.ts +1 -1
- package/dist/types/store/dataSource/data.store.d.ts +4 -4
- package/dist/types/store/dimension/dimension.helpers.d.ts +3 -3
- package/dist/types/store/selection/selection.store.d.ts +1 -1
- package/dist/types/store/viewPort/viewport.helpers.d.ts +2 -2
- package/loader/index.d.ts +10 -1
- package/loader/package.json +1 -0
- package/package.json +10 -10
- package/dist/cjs/css-shim-9f5bc84d.js +0 -9
- package/dist/cjs/dom-fcb646f0.js +0 -78
- package/dist/esm/css-shim-e1e1ea5e.js +0 -7
- package/dist/esm/dom-21bd1807.js +0 -76
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/css-shim-e1e1ea5e.js +0 -4
- package/dist/esm-es5/dom-21bd1807.js +0 -24
- package/dist/esm-es5/index-6f753b3c.js +0 -4
- package/dist/revo-grid/css-shim-bcf89cc0.system.js +0 -4
- package/dist/revo-grid/css-shim-e1e1ea5e.js +0 -4
- package/dist/revo-grid/debounce-726bdadb.js +0 -4
- package/dist/revo-grid/dom-21bd1807.js +0 -22
- package/dist/revo-grid/dom-726246e2.system.js +0 -24
- package/dist/revo-grid/index-f14b41a0.system.js +0 -5
- package/dist/revo-grid/index-f30d1de1.js +0 -5
- package/dist/revo-grid/resize-observer-00c48d78.js +0 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoSizeColumn.js","sourceRoot":"","sources":["../../src/plugins/autoSizeColumn.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,IAAI,MAAM,aAAa,CAAC;AAC/B,OAAO,M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,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;KACnC;IACD,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACxC,OAAO,EAAE,CAAC;EACZ,CAAC;EAED,OAAO;;IACL,KAAK,CAAC,OAAO,EAAE,CAAC;IAChB,MAAA,IAAI,CAAC,uBAAuB,0CAAE,MAAM,EAAE,CAAC;EACzC,CAAC;CACF","sourcesContent":["/**\n * Plugin module for revo-grid grid system\n * Add support for automatic column resize\n */\nimport each from 'lodash/each';\nimport reduce from 'lodash/reduce';\nimport BasePlugin from './basePlugin';\nimport { RevoGrid, Edition } from '../interfaces';\nimport ColumnDataProvider, { ColumnCollection } from '../services/column.data.provider';\nimport { DataProvider } from '../services/data.provider';\nimport { columnTypes } from '../store/storeTypes';\nimport DimensionProvider, { ColumnItems } from '../services/dimension.provider';\nimport { getSourceItem } from '../store/dataSource/data.store';\n\ninterface Column extends RevoGrid.ColumnRegular {\n index: number;\n}\n\ntype AutoSizeColumns = Record<RevoGrid.DimensionCols, ColumnRecords>;\ntype ColumnRecords = Record<any, Column>;\ntype SourceSetEvent = { type: RevoGrid.DimensionRows; source: RevoGrid.DataType[] };\ntype EditEvent = Edition.BeforeSaveDataDetails | Edition.BeforeRangeSaveDataDetails;\ntype Resolve = (cols: Partial<AutoSizeColumns>) => void;\ntype Reject = () => void;\n\nexport type AutoSizeColumnConfig = {\n // ui behavior mode\n mode?: ColumnAutoSizeMode;\n /**\n * autoSize for all columns\n * if allColumnes true all columns treated as autoSize, worse for performance\n * false by default\n */\n allColumns?: boolean;\n /**\n * assumption per characted size\n * by default defined as 8, can be changed in this config\n */\n letterBlockSize?: number;\n /** make size calculation exact\n * by default it based on assumption each character takes some space defined in letterBlockSize */\n preciseSize?: boolean;\n};\n\nconst LETTER_BLOCK_SIZE = 7;\n\nenum ColumnAutoSizeMode {\n // increases column width on header click according the largest text value\n headerClickAutosize = 'headerClickAutoSize',\n // increases column width on data set and text edit, decreases performance\n autoSizeOnTextOverlap = 'autoSizeOnTextOverlap',\n // increases and decreases column width based on all items sizes, worst for performance\n autoSizeAll = 'autoSizeAll',\n}\n\nexport default class AutoSizeColumn extends BasePlugin {\n private autoSizeColumns: Partial<AutoSizeColumns> | null = null;\n private readonly letterBlockSize: number;\n\n /** for config option when @preciseSize enabled */\n private readonly precsizeCalculationArea: HTMLElement;\n\n /** for edge case when no columns defined before data */\n private dataResolve: Resolve | null = null;\n private dataReject: Reject | null = null;\n\n constructor(\n revogrid: HTMLRevoGridElement,\n private providers: {\n dataProvider: DataProvider;\n dimensionProvider: DimensionProvider;\n columnProvider: ColumnDataProvider;\n },\n private config?: AutoSizeColumnConfig,\n ) {\n super(revogrid);\n this.letterBlockSize = config?.letterBlockSize || LETTER_BLOCK_SIZE;\n\n // create test container to check text width\n if (config?.preciseSize) {\n this.precsizeCalculationArea = this.initiatePresizeElement();\n revogrid.appendChild(this.precsizeCalculationArea);\n }\n\n const aftersourceset = ({ detail: { source } }: CustomEvent<SourceSetEvent>) => {\n this.setSource(source);\n };\n const afteredit = ({ detail }: CustomEvent<EditEvent>) => {\n this.afteredit(detail);\n };\n const afterEditAll = ({ detail }: CustomEvent<EditEvent>) => {\n this.afterEditAll(detail);\n };\n const beforecolumnsset = ({ detail: { columns } }: CustomEvent<ColumnCollection>) => {\n this.columnSet(columns);\n };\n const headerDblClick = ({ detail }: CustomEvent<RevoGrid.InitialHeaderClick>) => {\n const type = ColumnDataProvider.getColumnType(detail);\n const size = this.getColumnSize(detail.index, type);\n if (size) {\n this.providers.dimensionProvider.setDimensionSize(type, {\n [detail.index]: size,\n });\n }\n };\n this.addEventListener('beforecolumnsset', beforecolumnsset);\n switch (config?.mode) {\n case ColumnAutoSizeMode.autoSizeOnTextOverlap:\n this.addEventListener('aftersourceset', aftersourceset);\n this.addEventListener('afteredit', afteredit);\n break;\n case ColumnAutoSizeMode.autoSizeAll:\n this.addEventListener('aftersourceset', aftersourceset);\n this.addEventListener('afteredit', afterEditAll);\n break;\n default:\n this.addEventListener('headerdblClick', headerDblClick);\n break;\n }\n }\n\n private async setSource(source: RevoGrid.DataType[]): Promise<void> {\n let autoSize = this.autoSizeColumns;\n if (this.dataReject) {\n this.dataReject();\n this.clearPromise();\n }\n\n /** If data set first and no column provided await until get one */\n if (!autoSize) {\n const request = new Promise((resolve: Resolve, reject: Reject) => {\n this.dataResolve = resolve;\n this.dataReject = reject;\n });\n try {\n autoSize = await request;\n } catch (e) {\n return;\n }\n }\n\n // calculate sizes\n each(autoSize, (_v, type: RevoGrid.DimensionCols) => {\n const sizes: RevoGrid.ViewSettingSizeProp = {};\n each(autoSize[type], rgCol => {\n // calculate size\n rgCol.size = sizes[rgCol.index] = source.reduce((prev, rgRow) => Math.max(prev, this.getLength(rgRow[rgCol.prop])), this.getLength(rgCol.name || ''));\n });\n this.providers.dimensionProvider.setDimensionSize(type, sizes);\n });\n }\n\n private getLength(len?: any): number {\n const padding = 15;\n if (!len) {\n return 0;\n }\n try {\n const str = len.toString();\n\n /**if exact calculation required proxy with html element, slow operation */\n if (this.config?.preciseSize) {\n this.precsizeCalculationArea.innerText = str;\n return this.precsizeCalculationArea.scrollWidth + padding * 2;\n }\n return str.length * this.letterBlockSize + padding * 2;\n } catch (e) {\n return 0;\n }\n }\n\n private afteredit(e: EditEvent): void {\n let data: Record<string, RevoGrid.DataType>;\n if (this.isRangeEdit(e)) {\n data = e.data;\n } else {\n data = { 0: { [e.prop]: e.val } };\n }\n each(this.autoSizeColumns, (columns, type: RevoGrid.DimensionCols) => {\n const sizes: RevoGrid.ViewSettingSizeProp = {};\n\n each(columns, rgCol => {\n // calculate size\n const size = reduce(\n data,\n (prev: number | undefined, rgRow) => {\n if (typeof rgRow[rgCol.prop] === 'undefined') {\n return prev;\n }\n return Math.max(prev || 0, this.getLength(rgRow[rgCol.prop]));\n },\n undefined,\n );\n\n if (size && rgCol.size < size) {\n rgCol.size = sizes[rgCol.index] = size;\n }\n });\n\n this.providers.dimensionProvider.setDimensionSize(type, sizes);\n });\n }\n\n private afterEditAll(e: EditEvent): void {\n const props: Record<any, true> = {};\n if (this.isRangeEdit(e)) {\n each(e.data, r => each(r, (_v, p) => (props[p] = true)));\n } else {\n props[e.prop] = true;\n }\n each(this.autoSizeColumns, (columns, type: RevoGrid.DimensionCols) => {\n const sizes: RevoGrid.ViewSettingSizeProp = {};\n\n each(columns, rgCol => {\n if (props[rgCol.prop]) {\n const size = this.getColumnSize(rgCol.index, type);\n if (size) {\n sizes[rgCol.index] = size;\n }\n }\n });\n this.providers.dimensionProvider.setDimensionSize(type, sizes);\n });\n }\n\n private getColumnSize(index: number, type: RevoGrid.DimensionCols): number {\n const rgCol = this.autoSizeColumns[type][index];\n if (!rgCol) {\n return 0;\n }\n return reduce(\n this.providers.dataProvider.stores,\n (r, s) => {\n const perStore = reduce(\n s.store.get('items'),\n (prev, _row, i) => {\n const item = getSourceItem(s.store, i);\n return Math.max(prev || 0, this.getLength(item[rgCol.prop]));\n },\n 0,\n );\n return Math.max(r, perStore);\n },\n rgCol.size || 0,\n );\n }\n\n private columnSet(columns: ColumnItems): void {\n for (let t of columnTypes) {\n const type = t as RevoGrid.DimensionCols;\n const cols = columns[type];\n\n for (let i in cols) {\n if (cols[i].autoSize || this.config?.allColumns) {\n if (!this.autoSizeColumns) {\n this.autoSizeColumns = {};\n }\n if (!this.autoSizeColumns[type]) {\n this.autoSizeColumns[type] = {};\n }\n this.autoSizeColumns[type][i] = {\n ...cols[i],\n index: parseInt(i, 10),\n };\n }\n }\n }\n\n if (this.dataResolve) {\n this.dataResolve(this.autoSizeColumns);\n this.clearPromise();\n }\n }\n\n private clearPromise() {\n this.dataResolve = null;\n this.dataReject = null;\n }\n\n private isRangeEdit(e: EditEvent): e is Edition.BeforeRangeSaveDataDetails {\n return !!(e as Edition.BeforeRangeSaveDataDetails).data;\n }\n\n private initiatePresizeElement(): HTMLElement {\n const styleForFontTest: Partial<CSSStyleDeclaration> = {\n position: 'absolute',\n fontSize: '14px',\n height: '0',\n width: '0',\n whiteSpace: 'nowrap',\n top: '0',\n overflowX: 'scroll',\n };\n\n const el = document.createElement('div');\n for (let s in styleForFontTest) {\n el.style[s] = styleForFontTest[s];\n }\n el.classList.add('revo-test-container');\n return el;\n }\n\n destroy() {\n super.destroy();\n this.precsizeCalculationArea?.remove();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basePlugin.js","sourceRoot":"","sources":["../../src/plugins/basePlugin.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAgB,UAAU;EAEtC,YAAsB,QAA6B;IAA7B,aAAQ,GAAR,QAAQ,CAAqB;IADlC,kBAAa,GAA6C,EAAE,CAAC;EACxB,CAAC;EAC7C,gBAAgB,CAAC,IAAY,EAAE,IAA8B;IACrE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;EAClC,CAAC;EAES,mBAAmB,CAAC,IAAY;IACxC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAClE,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;EAClC,CAAC;EAES,IAAI,CAAC,SAAiB,EAAE,MAAY;IAC5C,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/E,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC;EACf,CAAC;EAES,kBAAkB;IAC1B,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,aAAa,EAAE;MACnC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;KAChC;EACH,CAAC;EAED,OAAO;IACL,IAAI,CAAC,kBAAkB,EAAE,CAAC;EAC5B,CAAC;CACF","sourcesContent":["import { RevoPlugin } from '../interfaces';\n\nexport default abstract class BasePlugin implements RevoPlugin.Plugin {\n private readonly subscriptions: Record<string, (e: CustomEvent) => void> = {};\n constructor(protected revogrid: HTMLRevoGridElement) {}\n protected addEventListener(name: string, func: (e: CustomEvent) => void) {\n this.revogrid.addEventListener(name, func);\n this.subscriptions[name] = func;\n }\n\n protected removeEventListener(type: string) {\n this.revogrid.removeEventListener(type, this.subscriptions[type]);\n delete this.subscriptions[type];\n }\n\n protected emit(eventName: string, detail?: any) {\n const event = new CustomEvent(eventName, { detail: detail, cancelable: true });\n this.revogrid.dispatchEvent(event);\n return event;\n }\n\n protected clearSubscriptions() {\n for (let type in this.subscriptions) {\n this.removeEventListener(type);\n }\n }\n\n destroy() {\n this.clearSubscriptions();\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/plugins/dispatcher.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,SAAiB,EACjB,MAAY;EAEZ,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE;IACvC,MAAM;IACN,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,IAAI;GACd,CAAC,CAAC;EACH,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,KAAK,CAAC,CAAC;EAC7B,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAC3B,CAA2B,EAC3B,SAAiB,EACjB,MAAY;EAEZ,CAAC,CAAC,cAAc,EAAE,CAAC;EACnB,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAgB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["type Target = HTMLElement | Element | null;\n/**\n * Dispatch custom event to element\n */\nexport function dispatch(\n target: Target,\n eventName: string,\n detail?: any\n): CustomEvent {\n const event = new CustomEvent(eventName, {\n detail,\n cancelable: true,\n bubbles: true,\n });\n target?.dispatchEvent(event);\n return event;\n}\n\n/**\n * Dispatch event by other event target\n */\nexport function dispatchOnEvent(\n e: MouseEvent | CustomEvent,\n eventName: string,\n detail?: any\n ): CustomEvent {\n e.preventDefault();\n return dispatch(e.target as Target, eventName, detail);\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import { getGroupingName, isGrouping } from
|
|
4
|
+
import { getGroupingName, isGrouping } from "../groupingRow/grouping.service";
|
|
5
5
|
const INITIAL = {
|
|
6
6
|
mime: 'text/csv',
|
|
7
7
|
fileKind: 'csv',
|
|
@@ -69,3 +69,4 @@ export default class ExportCsv {
|
|
|
69
69
|
return escape;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
//# sourceMappingURL=csv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv.js","sourceRoot":"","sources":["../../../src/plugins/export/csv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG9E,MAAM,OAAO,GAAc;EACzB,IAAI,EAAE,UAAU;EAChB,QAAQ,EAAE,KAAK;EACf,gBAAgB;EAChB,GAAG,EAAE,IAAI;EACT,eAAe,EAAE,GAAG;EACpB,YAAY,EAAE,MAAM;EACpB,QAAQ,EAAE,EAAE;CACb,CAAC;AAIF,iEAAiE;AACjE,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAChD,4DAA4D;AAC5D,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AAC1C,MAAM,SAAS,GAAG,M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M,CAAC;EAChB,CAAC;CACF","sourcesContent":["import { getGroupingName, isGrouping } from '../groupingRow/grouping.service';\nimport { CSVFormat, DataInput, Formatter } from './types';\n\nconst INITIAL: CSVFormat = {\n mime: 'text/csv',\n fileKind: 'csv',\n // BOM signature\n bom: true,\n columnDelimiter: ',',\n rowDelimiter: '\\r\\n',\n encoding: '',\n};\n\nexport type CSVFormatter = (options: Partial<CSVFormat>, data: DataInput) => string;\n\n// The ASCII character code 13 is called a Carriage Return or CR.\nconst CARRIAGE_RETURN = String.fromCharCode(13);\n// Chr(13) followed by a Chr(10) that compose a proper CRLF.\nconst LINE_FEED = String.fromCharCode(10);\nconst DOUBLE_QT = String.fromCharCode(34);\nconst NO_BREAK_SPACE = String.fromCharCode(0xfeff);\nconst escapeRegex = new RegExp('\"', 'g');\n\nexport default class ExportCsv implements Formatter {\n readonly options: Readonly<CSVFormat>;\n constructor(options: Partial<CSVFormat> = {}) {\n this.options = { ...INITIAL, ...options };\n }\n\n doExport({ data, headers, props }: DataInput) {\n let result = this.options.bom ? NO_BREAK_SPACE : '';\n\n // any header\n if (headers?.length > 0) {\n headers.forEach(header => {\n // ignore empty\n if (!header.length) {\n return;\n }\n result += this.prepareHeader(header, this.options.columnDelimiter);\n result += this.options.rowDelimiter;\n });\n }\n\n data.forEach((rgRow, index) => {\n if (index > 0) {\n result += this.options.rowDelimiter;\n }\n // support grouping\n if (isGrouping(rgRow)) {\n result += this.parseCell(getGroupingName(rgRow), this.options.columnDelimiter);\n return;\n }\n result += props.map(p => this.parseCell(rgRow[p], this.options.columnDelimiter)).join(this.options.columnDelimiter);\n });\n\n return result;\n }\n\n private prepareHeader(columnHeaders: string[], columnDelimiter: string) {\n let result = '';\n const newColumnHeaders = columnHeaders.map(v => this.parseCell(v, columnDelimiter, true));\n result += newColumnHeaders.join(columnDelimiter);\n return result;\n }\n\n private parseCell(value: any, columnDelimiter: string, force = false) {\n let escape = value;\n if (typeof value !== 'string') {\n escape = JSON.stringify(value);\n }\n const toEscape = [CARRIAGE_RETURN, DOUBLE_QT, LINE_FEED, columnDelimiter];\n if (typeof escape === 'undefined') {\n return '';\n }\n if (escape !== '' && (force || toEscape.some(i => escape.indexOf(i) >= 0))) {\n return `\"${escape.replace(escapeRegex, '\"\"')}\"`;\n }\n\n return escape;\n }\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import fill from
|
|
5
|
-
import { columnTypes, rowTypes } from
|
|
6
|
-
import { timeout } from
|
|
7
|
-
import BasePlugin from
|
|
8
|
-
import ExportCsv from
|
|
4
|
+
import fill from "lodash/fill";
|
|
5
|
+
import { columnTypes, rowTypes } from "../../store/storeTypes";
|
|
6
|
+
import { timeout } from "../../utils/utils";
|
|
7
|
+
import BasePlugin from "../basePlugin";
|
|
8
|
+
import ExportCsv from "./csv";
|
|
9
9
|
var ExportTypes;
|
|
10
10
|
(function (ExportTypes) {
|
|
11
11
|
ExportTypes["csv"] = "csv";
|
|
@@ -166,3 +166,4 @@ export default class ExportFilePlugin extends BasePlugin {
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
+
//# sourceMappingURL=export.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.plugin.js","sourceRoot":"","sources":["../../../src/plugins/export/export.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,aAAa,CAAC;AAK/B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,SAAS,MAAM,OAAO,CAAC;AAE9B,IAAK,WAEJ;AAFD,WAAK,WAAW;EACd,0BAAW,CAAA;AACb,CAAC,EAFI,WAAW,KAAX,WAAW,QAEf;AAID,MAAM,CAAC,O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AAsB,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;MACxG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IACH,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;MAC1B,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;MACb,OAAO,CAAC,CAAC;IACX,CAAC,EAAE,EAAE,CAAC,CAAC;EACT,CAAC;EAED,sDAAsD;EAC9C,SAAS,CAAC,IAAiB,EAAE,UAAwB,EAAE;IAC7D,QAAQ,IAAI,EAAE;MACZ,KAAK,WAAW,CAAC,GAAG;QAClB,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,CAAC;MAChC;QACE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;KACrC;EACH,CAAC;CACF","sourcesContent":["import fill from 'lodash/fill';\nimport { RevoGrid } from '../../interfaces';\nimport { Group, Groups } from '../../store/dataSource/data.store';\nimport { ColSource, CSVFormat, DataInput, Formatter } from './types';\n\nimport { columnTypes, rowTypes } from '../../store/storeTypes';\nimport { timeout } from '../../utils/utils';\nimport BasePlugin from '../basePlugin';\nimport ExportCsv from './csv';\n\nenum ExportTypes {\n csv = 'csv',\n}\n\nexport type ExportFormat = Partial<CSVFormat>;\n\nexport default class ExportFilePlugin extends BasePlugin {\n /** Exports string */\n async exportString(options: ExportFormat = {}, t: ExportTypes = ExportTypes.csv) {\n const data = await this.beforeexport();\n if (!data) {\n return null;\n }\n return this.formatter(t, options).doExport(data);\n }\n\n /** Exports Blob */\n async exportBlob(options: ExportFormat = {}, t: ExportTypes = ExportTypes.csv) {\n return await this.getBlob(this.formatter(t, options));\n }\n\n /** Export file */\n async exportFile(options: ExportFormat = {}, t: ExportTypes = ExportTypes.csv) {\n const formatter = this.formatter(t, options);\n const blob = await this.getBlob(formatter);\n\n // url\n const URL = window.URL || window.webkitURL;\n\n const a = document.createElement('a');\n const { filename, fileKind } = formatter.options;\n const name = `${filename}.${fileKind}`;\n const url = URL.createObjectURL(blob);\n\n a.style.display = 'none';\n a.setAttribute('href', url);\n a.setAttribute('download', name);\n this.revogrid.appendChild(a);\n a.dispatchEvent(new MouseEvent('click'));\n this.revogrid.removeChild(a);\n\n // delay for revoke, correct for some browsers\n await timeout(120);\n URL.revokeObjectURL(url);\n }\n\n /** Blob object */\n async getBlob(formatter: Formatter) {\n const type = `${formatter.options.mime};charset=${formatter.options.encoding}`;\n if (typeof Blob !== 'undefined') {\n const data = await this.beforeexport();\n if (!data) {\n return null;\n }\n return new Blob([formatter.doExport(data)], { type });\n }\n return null;\n }\n\n // before event\n private async beforeexport() {\n let data = await this.getData();\n const event: CustomEvent<{ data: DataInput }> = this.emit('beforeexport', { data });\n if (event.defaultPrevented) {\n return null;\n }\n return event.detail.data;\n }\n\n private async getData(): Promise<DataInput> {\n const data = await this.getSource();\n const colSource: ColSource[] = [];\n const colPromises: Promise<ColSource>[] = [];\n columnTypes.forEach((t, i) => {\n colPromises.push(this.getColPerSource(t).then(s => (colSource[i] = s)));\n });\n await Promise.all(colPromises);\n const columns: ColSource = {\n headers: [],\n props: [],\n };\n for (let source of colSource) {\n source.headers.forEach((h, i) => {\n if (!columns.headers[i]) {\n columns.headers[i] = [];\n }\n columns.headers[i].push(...h);\n });\n columns.props.push(...source.props);\n }\n return {\n data,\n ...columns,\n };\n }\n\n private async getColPerSource(t: RevoGrid.DimensionCols) {\n const store = await this.revogrid.getColumnStore(t);\n const source = store.get('source');\n const virtualIndexes = store.get('items');\n const depth = store.get('groupingDepth');\n const groups = store.get('groups');\n const colNames: string[] = [];\n const colProps: RevoGrid.ColumnProp[] = [];\n const visibleItems = virtualIndexes.reduce((r: Record<string, number>, v, virtualIndex) => {\n const prop = source[v].prop;\n colNames.push(source[v].name || '');\n colProps.push(prop);\n r[prop] = virtualIndex;\n return r;\n }, {});\n const rows: string[][] = this.getGroupHeaders(depth, groups, virtualIndexes, visibleItems);\n rows.push(colNames);\n return {\n headers: rows,\n props: colProps,\n };\n }\n\n private getGroupHeaders(depth: number, groups: Groups, items: number[], visibleItems: Record<string, number>) {\n const rows: string[][] = [];\n const template = fill(new Array(items.length), '');\n for (let d = 0; d < depth; d++) {\n const rgRow = [...template];\n rows.push(rgRow);\n if (!groups[d]) {\n continue;\n }\n const levelGroups = groups[d];\n\n // add names of groups\n levelGroups.forEach((group: Group) => {\n const minIndex = this.findGroupStartIndex(group.ids, visibleItems);\n if (typeof minIndex === 'number') {\n rgRow[minIndex] = group.name;\n }\n });\n }\n return rows;\n }\n\n private findGroupStartIndex(ids: (string | number)[], visibleItems: Record<string, number>): number | undefined {\n let min: number | undefined;\n ids.forEach(id => {\n const current = visibleItems[id];\n if (typeof current === 'number') {\n if (typeof min !== 'number' || min > current) {\n min = current;\n }\n }\n });\n return min;\n }\n\n private async getSource() {\n const data: RevoGrid.DataType[][] = [];\n const promisesData: Promise<number>[] = [];\n rowTypes.forEach(t => {\n const dataPart: RevoGrid.DataType[] = [];\n data.push(dataPart);\n const promise = this.revogrid.getVisibleSource(t).then((d: RevoGrid.DataType[]) => dataPart.push(...d));\n promisesData.push(promise);\n });\n await Promise.all(promisesData);\n return data.reduce((r, v) => {\n r.push(...v);\n return r;\n }, []);\n }\n\n // get correct class for future multiple types support\n private formatter(type: ExportTypes, options: ExportFormat = {}) {\n switch (type) {\n case ExportTypes.csv:\n return new ExportCsv(options);\n default:\n throw new Error('Unknown format');\n }\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/plugins/export/types.ts"],"names":[],"mappings":"","sourcesContent":["import { RevoGrid } from '../../interfaces';\n\nexport type ColSource = {\n headers: string[][];\n props: any[];\n};\nexport type DataInput = {\n data: RevoGrid.DataType[];\n} & ColSource;\n\nexport interface FormatterOptions {\n mime: string;\n encoding: string;\n}\n\nexport interface Formatter {\n options: FormatterOptions;\n doExport(data: DataInput): string;\n}\n\nexport interface CSVFormat extends FormatterOptions {\n fileKind: 'csv';\n bom: boolean;\n columnDelimiter: string;\n rowDelimiter: string;\n filename?: string;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equal.js","sourceRoot":"","sources":["../../../../src/plugins/filter/conditions/equal.ts"],"names":[],"mappings":"AAEA,MAAM,EAAE,GAAkB,CAAC,KAAyB,EAAE,KAA+B,EAAE,EAAE;EACvF,IAAI,OAAO,KAAK,KAAK,WAAW,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,EAAE;IAC9D,OAAO,IAAI,CAAC;GACb;EACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;GAC/B;EAED,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,iBAAiB,EAAE,CAAC;EACvD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;IAC1B,OAAO,IAAI,CAAC;GACb;EAED,OAAO,KAAK,CAAC,iBAAiB,EAAE,KAAK,SAAS,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAkB,CAAC,KAAyB,EAAE,KAA+B,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtH,KAAK,CAAC,KAAK,GAAG,OAAqB,CAAC;AACpC,EAAE,CAAC,KAAK,GAAG,OAAqB,CAAC;AACjC,eAAe,EAAE,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam, ExtraField } from '../filter.types';\n\nconst eq: LogicFunction = (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) => {\n if (typeof value === 'undefined' || (value === null && !extra)) {\n return true;\n }\n if (typeof value !== 'string') {\n value = JSON.stringify(value);\n }\n\n const filterVal = extra.toString().toLocaleLowerCase();\n if (filterVal.length === 0) {\n return true;\n }\n \n return value.toLocaleLowerCase() === filterVal;\n};\n\nexport const notEq: LogicFunction = (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) => !eq(value, extra);\nnotEq.extra = 'input' as ExtraField;\neq.extra = 'input' as ExtraField;\nexport default eq;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greaterThan.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/number/greaterThan.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAkB,UAAU,KAAyB,EAAE,KAA+B;EAChG,IAAI,cAAsB,CAAC;EAE3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,cAAc,GAAG,UAAU,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC,CAAC;IAC/C,OAAO,KAAK,GAAG,cAAc,CAAC;GAC/B;EACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC;AACvB,eAAe,MAAM,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\n\nconst gtThan: LogicFunction = function (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) {\n let conditionValue: number;\n\n if (typeof value === 'number') {\n conditionValue = parseFloat(extra?.toString());\n return value > conditionValue;\n }\n return false;\n};\n\ngtThan.extra = 'input';\nexport default gtThan;\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import eq from
|
|
5
|
-
import gt from
|
|
4
|
+
import eq from "../equal";
|
|
5
|
+
import gt from "./greaterThan";
|
|
6
6
|
const gtThanEq = function (value, extra) {
|
|
7
7
|
return eq(value, extra) || gt(value, extra);
|
|
8
8
|
};
|
|
9
9
|
gtThanEq.extra = 'input';
|
|
10
10
|
export default gtThanEq;
|
|
11
|
+
//# sourceMappingURL=greaterThanOrEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"greaterThanOrEqual.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/number/greaterThanOrEqual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,MAAM,eAAe,CAAC;AAE/B,MAAM,QAAQ,GAAkB,UAAU,KAAyB,EAAE,KAA+B;EAClG,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC;AACzB,eAAe,QAAQ,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\nimport eq from '../equal';\nimport gt from './greaterThan';\n\nconst gtThanEq: LogicFunction = function (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) {\n return eq(value, extra) || gt(value, extra);\n};\n\ngtThanEq.extra = 'input';\nexport default gtThanEq;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessThan.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/number/lessThan.ts"],"names":[],"mappings":"AAEA,MAAM,EAAE,GAAkB,UAAU,KAAyB,EAAE,KAA+B;EAC5F,IAAI,cAAsB,CAAC;EAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,cAAc,GAAG,UAAU,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,EAAE,CAAC,CAAC;IAC/C,OAAO,KAAK,GAAG,cAAc,CAAC;GAC/B;OAAM;IACL,OAAO,KAAK,CAAC;GACd;AACH,CAAC,CAAC;AAEF,EAAE,CAAC,KAAK,GAAG,OAAO,CAAC;AACnB,eAAe,EAAE,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\n\nconst lt: LogicFunction = function (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) {\n let conditionValue: number;\n if (typeof value === 'number') {\n conditionValue = parseFloat(extra?.toString());\n return value < conditionValue;\n } else {\n return false;\n }\n};\n\nlt.extra = 'input';\nexport default lt;\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import eq from
|
|
5
|
-
import lt from
|
|
4
|
+
import eq from "../equal";
|
|
5
|
+
import lt from "./lessThan";
|
|
6
6
|
const lsEq = function (value, extra) {
|
|
7
7
|
return eq(value, extra) || lt(value, extra);
|
|
8
8
|
};
|
|
9
9
|
lsEq.extra = 'input';
|
|
10
10
|
export default lsEq;
|
|
11
|
+
//# sourceMappingURL=lessThanOrEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lessThanOrEqual.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/number/lessThanOrEqual.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,MAAM,IAAI,GAAkB,UAAU,KAAyB,EAAE,KAA+B;EAC9F,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC,CAAC;AAEF,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC;AACrB,eAAe,IAAI,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\nimport eq from '../equal';\nimport lt from './lessThan';\n\nconst lsEq: LogicFunction = function (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) {\n return eq(value, extra) || lt(value, extra);\n};\n\nlsEq.extra = 'input';\nexport default lsEq;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.js","sourceRoot":"","sources":["../../../../src/plugins/filter/conditions/set.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAkB,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC;AAChH,MAAM,CAAC,MAAM,MAAM,GAAkB,CAAC,KAAyB,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAChF,eAAe,GAAG,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionParam } from '../filter.types';\n\nconst set: LogicFunction = (value: LogicFunctionParam) => !(value === '' || value === null || value === void 0);\nexport const notSet: LogicFunction = (value: LogicFunctionParam) => !set(value);\nexport default set;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"beginswith.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/string/beginswith.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAkB,CAAC,KAAyB,EAAE,KAA+B,EAAE,EAAE;EAC/F,IAAI,CAAC,KAAK,EAAE;IACV,OAAO,KAAK,CAAC;GACd;EACD,IAAI,CAAC,KAAK,EAAE;IACV,OAAO,IAAI,CAAC;GACb;EACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;GAC/B;EACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;IAC7B,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;GAC/B;EACD,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEF,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC;AAC3B,eAAe,UAAU,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\n\nconst beginsWith: LogicFunction = (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) => {\n if (!value) {\n return false;\n }\n if (!extra) {\n return true;\n }\n if (typeof value !== 'string') {\n value = JSON.stringify(value);\n }\n if (typeof extra !== 'string') {\n extra = JSON.stringify(extra);\n }\n return value.toLocaleLowerCase().indexOf(extra.toLocaleLowerCase()) === 0;\n};\n\nbeginsWith.extra = 'input';\nexport default beginsWith;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../../../../src/plugins/filter/conditions/string/contains.ts"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAkB,CAAC,KAAyB,EAAE,KAA+B,EAAE,EAAE;EAC7F,IAAI,CAAC,KAAK,EAAE;IACV,OAAO,KAAK,CAAC;GACd;EACD,IAAI,KAAK,EAAE;IACT,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;MAC7B,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;KAC/B;IACD,OAAO,KAAK,CAAC,iBAAiB,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;GAC/E;EACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAkB,CAAC,KAAyB,EAAE,KAA+B,EAAE,EAAE;EACvG,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACjC,CAAC,CAAC;AACF,WAAW,CAAC,KAAK,GAAG,OAAO,CAAC;AAC5B,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC;AACzB,eAAe,QAAQ,CAAC","sourcesContent":["import { LogicFunction, LogicFunctionExtraParam, LogicFunctionParam } from '../../filter.types';\n\nconst contains: LogicFunction = (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) => {\n if (!value) {\n return false;\n }\n if (extra) {\n if (typeof value !== 'string') {\n value = JSON.stringify(value);\n }\n return value.toLocaleLowerCase().indexOf(extra.toString().toLowerCase()) > -1;\n }\n return true;\n};\n\nexport const notContains: LogicFunction = (value: LogicFunctionParam, extra?: LogicFunctionExtraParam) => {\n return !contains(value, extra);\n};\nnotContains.extra = 'input';\ncontains.extra = 'input';\nexport default contains;\n"]}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import { h } from
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
5
|
export const FILTER_BUTTON_CLASS = 'rv-filter';
|
|
6
6
|
export const FILTER_BUTTON_ACTIVE = 'active';
|
|
7
7
|
export const FILTER_PROP = 'hasFilter';
|
|
8
8
|
export const AND_OR_BUTTON = 'and-or-button';
|
|
9
9
|
export const TRASH_BUTTON = 'trash-button';
|
|
10
10
|
export const FilterButton = ({ column }) => {
|
|
11
|
-
return (h("span", null,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} },
|
|
16
|
-
h("svg", { class: "filter-img", viewBox: "0 0 64 64" },
|
|
17
|
-
h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
|
|
18
|
-
h("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
|
|
11
|
+
return (h("span", null, h("button", { class: {
|
|
12
|
+
[FILTER_BUTTON_CLASS]: true,
|
|
13
|
+
[FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
|
|
14
|
+
} }, h("svg", { class: "filter-img", viewBox: "0 0 64 64" }, h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" }, h("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
|
|
19
15
|
};
|
|
20
16
|
export const TrashButton = () => {
|
|
21
|
-
return (h("div", { class: { [TRASH_BUTTON]: true } },
|
|
22
|
-
h("svg", { class: "trash-img", viewBox: "0 0 24 24" },
|
|
23
|
-
h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
17
|
+
return (h("div", { class: { [TRASH_BUTTON]: true } }, h("svg", { class: "trash-img", viewBox: "0 0 24 24" }, h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
|
|
24
18
|
};
|
|
25
19
|
export const AndOrButton = ({ isAnd }) => {
|
|
26
20
|
return h("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, isAnd ? 'and' : 'or');
|
|
@@ -31,3 +25,4 @@ export function isFilterBtn(e) {
|
|
|
31
25
|
}
|
|
32
26
|
return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
|
|
33
27
|
}
|
|
28
|
+
//# sourceMappingURL=filter.button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.button.js","sourceRoot":"","sources":["../../../src/plugins/filter/filter.button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;AAC/C,MAAM,CAAC,MAAM,o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AC,CAAc;EACxC,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE;IAC7C,OAAO,IAAI,CAAC;GACb;EACD,OAAO,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,OAAO,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { RevoGrid } from '../../interfaces';\n\nexport const FILTER_BUTTON_CLASS = 'rv-filter';\nexport const FILTER_BUTTON_ACTIVE = 'active';\nexport const FILTER_PROP = 'hasFilter';\nexport const AND_OR_BUTTON = 'and-or-button';\nexport const TRASH_BUTTON = 'trash-button';\n\ntype Props = {\n column: RevoGrid.ColumnRegular;\n};\nexport const FilterButton = ({ column }: Props) => {\n return (\n <span>\n <button\n class={{\n [FILTER_BUTTON_CLASS]: true,\n [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],\n }}\n >\n <svg class=\"filter-img\" viewBox=\"0 0 64 64\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z\" fill=\"currentColor\"></path>\n </g>\n </svg>\n </button>\n </span>\n );\n};\n\nexport const TrashButton = () => {\n return (\n <div class={{ [TRASH_BUTTON]: true }}>\n <svg class=\"trash-img\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z\" />\n </svg>\n </div>\n );\n};\nexport const AndOrButton = ({ isAnd }: any) => {\n return <button class={{ [AND_OR_BUTTON]: true, 'light revo-button': true }}>{isAnd ? 'and' : 'or'}</button>;\n};\n\nexport function isFilterBtn(e: HTMLElement) {\n if (e.classList.contains(FILTER_BUTTON_CLASS)) {\n return true;\n }\n return e?.closest(`.${FILTER_BUTTON_CLASS}`);\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import { h } from
|
|
5
|
-
import BasePlugin from
|
|
6
|
-
import { FILTER_PROP, isFilterBtn } from
|
|
7
|
-
import { filterEntities, filterNames, filterTypes } from
|
|
4
|
+
import { h } from "@stencil/core";
|
|
5
|
+
import BasePlugin from "../basePlugin";
|
|
6
|
+
import { FILTER_PROP, isFilterBtn } from "./filter.button";
|
|
7
|
+
import { filterEntities, filterNames, filterTypes } from "./filter.service";
|
|
8
8
|
export const FILTER_TRIMMED_TYPE = 'filter';
|
|
9
9
|
export default class FilterPlugin extends BasePlugin {
|
|
10
10
|
constructor(revogrid, uiid, config) {
|
|
@@ -257,3 +257,4 @@ export default class FilterPlugin extends BasePlugin {
|
|
|
257
257
|
return trimmed;
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
|
+
//# sourceMappingURL=filter.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter.plugin.js","sourceRoot":"","sources":["../../../src/plugins/filter/filter.plugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAc,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAiDxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,UAAU;EAQlD,YAAsB,QAA6B,EAAE,IAAY,EAAE,MAA2B;;IAC5F,KAAK,CAAC,QAAQ,CAAC,CAAC;IADI,aAAQ,GAAR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E;QAC3E,IAAI,wBAAwB,KAAK,WAAW,CAAC,MAAM;UAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC;OAC/E,CAAC,yBAAyB;IAC7B,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;EACjB,CAAC;CACF","sourcesContent":["import { h } from '@stencil/core';\nimport BasePlugin from '../basePlugin';\nimport { RevoGrid } from '../../interfaces';\nimport { FILTER_PROP, isFilterBtn } from './filter.button';\nimport { MultiFilterItem } from './filter.pop';\nimport { filterEntities, filterNames, FilterType, filterTypes } from './filter.service';\nimport { LogicFunction } from './filter.types';\n\ntype CustomFilter = {\n columnFilterType: string; // property defined in column filter: string/number/abstract/enum...etc\n name: string;\n func: LogicFunction;\n};\n\nexport type FilterCaptions = {\n title: string;\n save: string;\n reset: string;\n cancel: string;\n};\n\nexport type FilterLocalization = {\n captions: FilterCaptions;\n filterNames: Record<FilterType, string>;\n};\n\n/**\n * @typedef ColumnFilterConfig\n * @type {object}\n * @property {FilterCollection|undefined} collection - preserved filter data\n * @property {string[]|undefined} include - filters to be included, if defined everything else out of scope will be ignored\n * @property {Record<string, CustomFilter>|undefined} customFilters - hash map of {FilterType:CustomFilter}.\n * @property {FilterLocalization|undefined} localization - translation for filter popup captions.\n * @property {MultiFilterItem|undefined} multiFilterItems - data for multi filtering.\n * @property {boolean|undefined} disableDynamicFiltering - disables dynamic filtering.\n * A way to define your own filter types per column\n */\nexport type ColumnFilterConfig = {\n collection?: FilterCollection;\n include?: string[];\n customFilters?: Record<string, CustomFilter>;\n localization?: FilterLocalization;\n multiFilterItems?: MultiFilterItem;\n disableDynamicFiltering?: boolean;\n};\ntype HeaderEvent = CustomEvent<RevoGrid.ColumnRegular>;\ntype FilterCollectionItem = {\n filter: LogicFunction;\n type: FilterType;\n value?: any;\n};\n\nexport type FilterCollection = Record<RevoGrid.ColumnProp, FilterCollectionItem>;\n\nexport const FILTER_TRIMMED_TYPE = 'filter';\n\nexport default class FilterPlugin extends BasePlugin {\n private pop: HTMLRevogrFilterPanelElement;\n private filterCollection: FilterCollection = {};\n private multiFilterItems: MultiFilterItem = {};\n private possibleFilters: Record<string, string[]> = { ...filterTypes };\n private possibleFilterNames: Record<string, string> = { ...filterNames };\n private possibleFilterEntities: Record<string, LogicFunction> = { ...filterEntities };\n\n constructor(protected revogrid: HTMLRevoGridElement, uiid: string, config?: ColumnFilterConfig) {\n super(revogrid);\n if (config) {\n this.initConfig(config);\n }\n\n const headerclick = (e: HeaderEvent) => this.headerclick(e);\n\n const aftersourceset = async () => {\n const filterCollectionProps = Object.keys(this.filterCollection);\n if (filterCollectionProps.length > 0) {\n // handle old way of filtering by reworking FilterCollection to new MultiFilterItem\n filterCollectionProps.forEach((prop, index) => {\n if (!this.multiFilterItems[prop]) {\n this.multiFilterItems[prop] = [\n {\n id: index,\n type: this.filterCollection[prop].type,\n value: this.filterCollection[prop].value,\n relation: 'and',\n },\n ];\n }\n });\n }\n await this.runFiltering();\n };\n this.addEventListener('headerclick', headerclick);\n this.addEventListener('aftersourceset', aftersourceset);\n\n this.revogrid.registerVNode([\n <revogr-filter-panel\n uuid={`filter-${uiid}`}\n filterItems={this.multiFilterItems}\n filterNames={this.possibleFilterNames}\n filterEntities={this.possibleFilterEntities}\n filterCaptions={config?.localization?.captions}\n onFilterChange={e => this.onFilterChange(e.detail)}\n disableDynamicFiltering={config?.disableDynamicFiltering}\n ref={e => (this.pop = e)}\n />,\n ]);\n }\n\n private initConfig(config: ColumnFilterConfig) {\n if (config.collection) {\n this.filterCollection = { ...config.collection };\n }\n if (config.multiFilterItems) {\n this.multiFilterItems = { ...config.multiFilterItems };\n }\n if (config.customFilters) {\n for (let cType in config.customFilters) {\n const cFilter = config.customFilters[cType];\n if (!this.possibleFilters[cFilter.columnFilterType]) {\n this.possibleFilters[cFilter.columnFilterType] = [];\n }\n this.possibleFilters[cFilter.columnFilterType].push(cType);\n this.possibleFilterEntities[cType] = cFilter.func;\n this.possibleFilterNames[cType] = cFilter.name;\n }\n }\n\n /**\n * which filters has to be included/excluded\n * convinient way to exclude system filters\n */\n if (config.include) {\n const filters: Record<string, string[]> = {};\n\n for (let t in this.possibleFilters) {\n // validate filters, if appropriate function present\n const newTypes = this.possibleFilters[t].filter(f => config.include.indexOf(f) > -1);\n if (newTypes.length) {\n filters[t] = newTypes;\n }\n }\n // if any valid filters provided show them\n if (Object.keys(filters).length > 0) {\n this.possibleFilters = filters;\n }\n }\n\n if (config.localization) {\n if (config.localization.filterNames) {\n Object.entries(config.localization.filterNames).forEach(([k, v]) => {\n if (this.possibleFilterNames[k] != void 0) {\n this.possibleFilterNames[k] = v;\n }\n });\n }\n }\n }\n\n private async headerclick(e: HeaderEvent) {\n const el = e.detail.originalEvent?.target as HTMLElement;\n if (!isFilterBtn(el)) {\n return;\n }\n e.preventDefault();\n\n // close if same\n const changes = await this.pop.getChanges();\n if (changes && changes?.prop === e.detail.prop) {\n this.pop.show();\n return;\n }\n\n // filter button clicked, open filter dialog\n const gridPos = this.revogrid.getBoundingClientRect();\n const buttonPos = el.getBoundingClientRect();\n const prop = e.detail.prop;\n this.pop.filterTypes = this.getColumnFilter(e.detail.filter);\n this.pop.show({\n ...this.filterCollection[prop],\n x: buttonPos.x - gridPos.x,\n y: buttonPos.y - gridPos.y + buttonPos.height,\n prop,\n });\n }\n\n private getColumnFilter(type?: boolean | string | string[]): Record<string, string[]> {\n let filterType = 'string';\n if (!type) {\n return { [filterType]: this.possibleFilters[filterType] };\n }\n\n // if custom column filter\n if (this.isValidType(type)) {\n filterType = type;\n\n // if multiple filters applied\n } else if (typeof type === 'object' && type.length) {\n return type.reduce((r: Record<string, string[]>, multiType) => {\n if (this.isValidType(multiType)) {\n r[multiType] = this.possibleFilters[multiType];\n }\n return r;\n }, {});\n }\n return { [filterType]: this.possibleFilters[filterType] };\n }\n\n private isValidType(type: any): type is string {\n return !!(typeof type === 'string' && this.possibleFilters[type]);\n }\n\n // called on internal component change\n private async onFilterChange(filterItems: MultiFilterItem) {\n this.multiFilterItems = filterItems;\n this.runFiltering();\n }\n\n /**\n * Triggers grid filtering\n */\n async doFiltering(collection: FilterCollection, items: RevoGrid.DataType[], columns: RevoGrid.ColumnRegular[], filterItems: MultiFilterItem) {\n const columnsToUpdate: RevoGrid.ColumnRegular[] = [];\n\n columns.forEach(rgCol => {\n const column = { ...rgCol };\n const hasFilter = filterItems[column.prop];\n if (column[FILTER_PROP] && !hasFilter) {\n delete column[FILTER_PROP];\n columnsToUpdate.push(column);\n }\n if (!column[FILTER_PROP] && hasFilter) {\n columnsToUpdate.push(column);\n column[FILTER_PROP] = true;\n }\n });\n const itemsToFilter = this.getRowFilter(items, filterItems);\n // check is filter event prevented\n const { defaultPrevented, detail } = this.emit('beforefiltertrimmed', { collection, itemsToFilter, source: items, filterItems });\n if (defaultPrevented) {\n return;\n }\n\n // check is trimmed event prevented\n const isAddedEvent = await this.revogrid.addTrimmed(detail.itemsToFilter, FILTER_TRIMMED_TYPE);\n if (isAddedEvent.defaultPrevented) {\n return;\n }\n\n // applies the hasFilter to the columns to show filter icon\n await this.revogrid.updateColumns(columnsToUpdate);\n this.emit('afterFilterApply');\n }\n\n async clearFiltering() {\n this.multiFilterItems = {};\n await this.runFiltering();\n }\n\n private async runFiltering() {\n const collection: FilterCollection = {};\n\n // handle old filterCollection to return the first filter only (if any) from multiFilterItems\n const filterProps = Object.keys(this.multiFilterItems);\n\n for (const prop of filterProps) {\n // check if we have any filter for a column\n if (this.multiFilterItems[prop].length > 0) {\n const firstFilterItem = this.multiFilterItems[prop][0];\n collection[prop] = {\n filter: filterEntities[firstFilterItem.type],\n type: firstFilterItem.type,\n value: firstFilterItem.value,\n };\n }\n }\n\n this.filterCollection = collection;\n\n const { source, columns } = await this.getData();\n const { defaultPrevented, detail } = this.emit('beforefilterapply', { collection: this.filterCollection, source, columns, filterItems: this.multiFilterItems });\n if (defaultPrevented) {\n return;\n }\n this.doFiltering(detail.collection, detail.source, detail.columns, detail.filterItems);\n }\n\n private async getData() {\n const source = await this.revogrid.getSource();\n const columns = await this.revogrid.getColumns();\n return {\n source,\n columns,\n };\n }\n\n private getRowFilter(rows: RevoGrid.DataType[], filterItems: MultiFilterItem) {\n const propKeys = Object.keys(filterItems);\n\n const trimmed: Record<number, boolean> = {};\n let propFilterSatisfiedCount: number = 0;\n let lastFilterResults: boolean[] = [];\n\n // each rows\n rows.forEach((model, rowIndex) => {\n // working on all props\n for (const prop of propKeys) {\n const propFilters = filterItems[prop];\n\n propFilterSatisfiedCount = 0;\n lastFilterResults = [];\n\n // testing each filter for a prop\n for (const [filterIndex, filterData] of propFilters.entries()) {\n // the filter LogicFunction based on the type\n const filter = this.possibleFilterEntities[filterData.type];\n\n // THE MAGIC OF FILTERING IS HERE\n if (filterData.relation === 'or') {\n lastFilterResults = [];\n if (filter(model[prop], filterData.value)) {\n continue;\n }\n propFilterSatisfiedCount++;\n } else {\n // 'and' relation will need to know the next filter\n // so we save this current filter to include it in the next filter\n lastFilterResults.push(!filter(model[prop], filterData.value));\n\n // check first if we have a filter on the next index to pair it with this current filter\n const nextFilterData = propFilters[filterIndex + 1];\n // stop the sequence if there is no next filter or if the next filter is not an 'and' relation\n if (!nextFilterData || nextFilterData.relation !== 'and') {\n // let's just continue since for sure propFilterSatisfiedCount cannot be satisfied\n if (lastFilterResults.indexOf(true) === -1) {\n lastFilterResults = [];\n continue;\n }\n\n // we need to add all of the lastFilterResults since we need to satisfy all\n propFilterSatisfiedCount += lastFilterResults.length;\n lastFilterResults = [];\n }\n }\n } // end of propFilters forEach\n\n // add to the list of removed/trimmed rows of filter condition is satisfied\n if (propFilterSatisfiedCount === propFilters.length) trimmed[rowIndex] = true;\n } // end of for-of propKeys\n });\n return trimmed;\n }\n}\n"]}
|