@revolist/revogrid 4.4.0-next.2 → 4.4.0-next.21
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/columnService.js +1 -1
- package/custom-element/consts.js +2 -1
- package/custom-element/consts.js.map +1 -1
- package/custom-element/localScrollService.js +1 -1
- package/custom-element/localScrollService.js.map +1 -1
- package/custom-element/revo-grid.js +163 -97
- package/custom-element/revo-grid.js.map +1 -1
- package/custom-element/revogr-clipboard.js +24 -5
- package/custom-element/revogr-clipboard.js.map +1 -1
- package/custom-element/revogr-edit2.js +12 -6
- package/custom-element/revogr-edit2.js.map +1 -1
- package/custom-element/revogr-focus2.js +1 -1
- package/custom-element/revogr-focus2.js.map +1 -1
- package/custom-element/revogr-header2.js +25 -11
- package/custom-element/revogr-header2.js.map +1 -1
- package/custom-element/revogr-overlay-selection2.js +99 -32
- package/custom-element/revogr-overlay-selection2.js.map +1 -1
- package/custom-element/revogr-row-headers2.js +1 -2
- package/custom-element/revogr-row-headers2.js.map +1 -1
- package/custom-element/revogr-viewport-scroll2.js +39 -6
- package/custom-element/revogr-viewport-scroll2.js.map +1 -1
- package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
- package/dist/cjs/debounce-f50730b6.js.map +1 -0
- package/dist/cjs/dispatcher-20520c70.js +21 -0
- package/dist/cjs/dispatcher-20520c70.js.map +1 -0
- package/dist/cjs/events-030618fc.js +459 -0
- package/dist/cjs/events-030618fc.js.map +1 -0
- package/dist/cjs/filter.button-6badec7a.js +44 -0
- package/dist/cjs/filter.button-6badec7a.js.map +1 -0
- package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
- package/dist/cjs/index-ee2ef5ae.js.map +1 -0
- package/dist/cjs/index-effc94b9.js +3944 -0
- package/dist/cjs/index-effc94b9.js.map +1 -0
- package/dist/cjs/isString-3dde8d95.js +38 -0
- package/dist/cjs/isString-3dde8d95.js.map +1 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
- package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/localScrollService-a81823c5.js +403 -0
- package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.entry.js +3858 -0
- package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
- package/dist/cjs/revo-grid.cjs.js +3 -3
- package/dist/cjs/revo-grid.cjs.js.map +1 -1
- package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
- package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
- package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
- package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
- package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
- package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
- package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
- package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
- package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
- package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
- package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
- package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/collection/components/header/headerCellRenderer.js +1 -1
- package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
- package/dist/collection/components/header/headerRenderer.d.ts +2 -2
- package/dist/collection/components/header/headerRenderer.js +1 -1
- package/dist/collection/components/header/headerRenderer.js.map +1 -1
- package/dist/collection/components/header/revogr-header.d.ts +15 -1
- package/dist/collection/components/header/revogr-header.js +34 -8
- package/dist/collection/components/header/revogr-header.js.map +1 -1
- package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
- package/dist/collection/components/overlay/autofill.service.js +32 -12
- package/dist/collection/components/overlay/autofill.service.js.map +1 -1
- package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/collection/components/overlay/clipboard.service.js +2 -2
- package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
- package/dist/collection/components/overlay/keyboard.service.js +2 -6
- package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
- package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/collection/components/overlay/revogr-edit.js +34 -9
- package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
- package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
- package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
- package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/collection/components/revoGrid/revo-grid.js +60 -19
- package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js +26 -4
- package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/collection/components/revoGrid/viewport.section.js +8 -4
- package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
- package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/collection/components/revoGrid/viewport.service.js +15 -3
- package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
- package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
- package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
- package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
- package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
- package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
- package/dist/collection/components.d.ts +110 -6
- package/dist/collection/interfaces.d.ts +4 -1
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
- package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
- package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
- package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
- package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
- package/dist/collection/serve/controller.js +183 -0
- package/dist/collection/services/localScrollService.js +1 -1
- package/dist/collection/services/localScrollService.js.map +1 -1
- package/dist/collection/services/resizable.directive.d.ts +8 -7
- package/dist/collection/services/resizable.directive.js +13 -36
- package/dist/collection/services/resizable.directive.js.map +1 -1
- package/dist/collection/services/resizable.element.d.ts +4 -0
- package/dist/collection/services/resizable.element.js +39 -0
- package/dist/collection/services/resizable.element.js.map +1 -0
- package/dist/collection/stencil-public-runtime.d.ts +1 -0
- package/dist/collection/store/viewPort/viewport.store.js +0 -1
- package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
- package/dist/collection/utils/consts.d.ts +1 -0
- package/dist/collection/utils/consts.js +1 -0
- package/dist/collection/utils/consts.js.map +1 -1
- package/dist/collection/utils/events.d.ts +2 -1
- package/dist/collection/utils/events.js +18 -2
- package/dist/collection/utils/events.js.map +1 -1
- package/dist/collection/utils/mobile.d.ts +1 -0
- package/dist/collection/utils/mobile.js +7 -0
- package/dist/collection/utils/mobile.js.map +1 -0
- package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
- package/dist/esm/debounce-820b5a8b.js.map +1 -0
- package/dist/esm/dispatcher-9e9c0233.js +19 -0
- package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
- package/dist/esm/events-31272e5e.js +454 -0
- package/dist/esm/events-31272e5e.js.map +1 -0
- package/dist/esm/filter.button-21ce90ef.js +38 -0
- package/dist/esm/filter.button-21ce90ef.js.map +1 -0
- package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
- package/dist/esm/index-05947c5f.js.map +1 -0
- package/dist/esm/index-728bf6e3.js +3889 -0
- package/dist/esm/index-728bf6e3.js.map +1 -0
- package/dist/esm/isString-d539060a.js +36 -0
- package/dist/esm/isString-d539060a.js.map +1 -0
- package/dist/esm/keyCodes.utils-c0064460.js +265 -0
- package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/localScrollService-884d8952.js +400 -0
- package/dist/esm/localScrollService-884d8952.js.map +1 -0
- package/dist/esm/revo-grid.entry.js +3854 -0
- package/dist/esm/revo-grid.entry.js.map +1 -0
- package/dist/esm/revo-grid.js +4 -4
- package/dist/esm/revo-grid.js.map +1 -1
- package/dist/esm/revogr-clipboard.entry.js +24 -6
- package/dist/esm/revogr-clipboard.entry.js.map +1 -1
- package/dist/esm/revogr-data_3.entry.js +1132 -0
- package/dist/esm/revogr-data_3.entry.js.map +1 -0
- package/dist/esm/revogr-edit_2.entry.js +320 -0
- package/dist/esm/revogr-edit_2.entry.js.map +1 -0
- package/dist/esm/revogr-filter-panel.entry.js +3 -2
- package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
- package/dist/esm/revogr-focus_5.entry.js +1223 -0
- package/dist/esm/revogr-focus_5.entry.js.map +1 -0
- package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
- package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/revo-grid/debounce-820b5a8b.js +5 -0
- package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
- package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
- package/dist/revo-grid/events-31272e5e.js +5 -0
- package/dist/revo-grid/events-31272e5e.js.map +1 -0
- package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
- package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
- package/dist/revo-grid/index-05947c5f.js +6 -0
- package/dist/revo-grid/index-05947c5f.js.map +1 -0
- package/dist/revo-grid/index-728bf6e3.js +5 -0
- package/dist/revo-grid/index-728bf6e3.js.map +1 -0
- package/dist/revo-grid/isString-d539060a.js +5 -0
- package/dist/revo-grid/isString-d539060a.js.map +1 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
- package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
- package/dist/revo-grid/localScrollService-884d8952.js +5 -0
- package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
- package/dist/revo-grid/revo-grid.entry.js +5 -0
- package/dist/revo-grid/revo-grid.entry.js.map +1 -0
- package/dist/revo-grid/revo-grid.esm.js +1 -1
- package/dist/revo-grid/revo-grid.esm.js.map +1 -1
- package/dist/revo-grid/revogr-clipboard.entry.js +1 -1
- package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
- package/dist/revo-grid/revogr-data_3.entry.js +5 -0
- package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
- package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
- package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
- package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
- package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
- package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
- package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
- package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
- package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
- package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
- package/dist/types/components/header/headerRenderer.d.ts +2 -2
- package/dist/types/components/header/revogr-header.d.ts +15 -1
- package/dist/types/components/overlay/autofill.service.d.ts +7 -3
- package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
- package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
- package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
- package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
- package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
- package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
- package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
- package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
- package/dist/types/components.d.ts +110 -6
- package/dist/types/interfaces.d.ts +4 -1
- package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
- package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
- package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
- package/dist/types/services/resizable.directive.d.ts +8 -7
- package/dist/types/services/resizable.element.d.ts +4 -0
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/consts.d.ts +1 -0
- package/dist/types/utils/events.d.ts +2 -1
- package/dist/types/utils/mobile.d.ts +1 -0
- package/package.json +4 -3
- package/dist/cjs/debounce-525dd66c.js.map +0 -1
- package/dist/cjs/index-aad39b7b.js.map +0 -1
- package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
- package/dist/esm/debounce-301fd4d2.js.map +0 -1
- package/dist/esm/index-5e90b19b.js.map +0 -1
- package/dist/esm/revo-grid_11.entry.js.map +0 -1
- package/dist/revo-grid/debounce-301fd4d2.js +0 -5
- package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
- package/dist/revo-grid/index-5e90b19b.js +0 -6
- package/dist/revo-grid/index-5e90b19b.js.map +0 -1
- package/dist/revo-grid/revo-grid_11.entry.js +0 -5
- package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
- /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built by Revolist
|
|
3
|
+
*/
|
|
4
|
+
import{h as t,r as i,c as s,H as e,g as o}from"./index-05947c5f.js";import{w as n,E as r,A as h,$ as l,y as a}from"./index-728bf6e3.js";import{b as C,e as d}from"./keyCodes.utils-c0064460.js";import{d as L}from"./debounce-820b5a8b.js";import"./isString-d539060a.js";class c{constructor(t,i){this.column=t;this.saveCallback=i;this.element=null;this.editCell=null}async componentDidRender(){var t;if(this.editInput){await n();(t=this.editInput)===null||t===void 0?void 0:t.focus()}}onKeyDown(t){const i=C(t.code);const s=d(t.code);if((s||i)&&t.target&&this.saveCallback&&!t.isComposing){this.editInput.blur();this.saveCallback(this.getValue(),s)}}getValue(){var t;return(t=this.editInput)===null||t===void 0?void 0:t.value}render(){var i;return t("input",{type:"text",value:((i=this.editCell)===null||i===void 0?void 0:i.val)||"",ref:t=>{this.editInput=t},onKeyDown:t=>this.onKeyDown(t)})}}const u=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}revogr-edit{display:block;position:absolute;background-color:#fff}revogr-edit input{height:100%;width:100%;box-sizing:border-box}revogr-edit revo-dropdown{height:100%}revogr-edit revo-dropdown.shrink fieldset legend>span{display:none}";const g=class{constructor(t){i(this,t);this.cellEdit=s(this,"cellEdit",7);this.closeEdit=s(this,"closeEdit",7);this.currentEditor=null;this.saveRunning=false;this.editCell=undefined;this.column=undefined;this.editor=undefined;this.saveOnClose=false;this.additionalData=undefined}async cancel(){this.saveRunning=true}onAutoSave(){this.saveRunning=true;const t=this.currentEditor.getValue&&this.currentEditor.getValue();if(this.currentEditor.beforeAutoSave){const i=this.currentEditor.beforeAutoSave(t);if(i===false){return}}this.onSave(t,true)}onSave(t,i){this.saveRunning=true;if(this.editCell){this.cellEdit.emit({rgCol:this.editCell.x,rgRow:this.editCell.y,type:this.editCell.type,prop:this.editCell.prop,val:t,preventFocus:i})}}componentWillRender(){if(this.currentEditor){return}this.saveRunning=false;if(this.editor){this.currentEditor=new this.editor(this.column,((t,i)=>{this.onSave(t,i)}),(t=>{this.saveRunning=true;this.closeEdit.emit(t)}));return}this.currentEditor=new c(this.column,((t,i)=>this.onSave(t,i)))}componentDidRender(){var t,i;if(!this.currentEditor){return}this.currentEditor.element=this.element.firstElementChild;(i=(t=this.currentEditor).componentDidRender)===null||i===void 0?void 0:i.call(t)}disconnectedCallback(){if(this.saveOnClose){if(!this.saveRunning){this.onAutoSave()}}this.saveRunning=false;if(!this.currentEditor){return}this.currentEditor.disconnectedCallback&&this.currentEditor.disconnectedCallback();if(this.currentEditor.element){this.currentEditor.element=null}this.currentEditor=null}render(){if(this.currentEditor){this.currentEditor.editCell=this.editCell;return t(e,{class:r},this.currentEditor.render(t,this.additionalData))}return""}get element(){return o(this)}};g.style=u;class p{constructor(t){this.config=t;this.currentCell=null;this.previousRow=null}endOrder(t,i){if(this.currentCell===null){return}const s=this.getCell(t,i);if(s.y!==this.currentCell.y){if(s.y<0){s.y=0}else if(s.y<this.currentCell.y){s.y++}this.config.positionChanged(this.currentCell.y,s.y)}this.clear()}startOrder(t,i){this.currentCell=this.getCell(t,i);return this.currentCell}move(t,i){const s=this.getRow(t,i);if(this.previousRow===s.itemIndex||s.itemIndex<-1){return null}this.previousRow=s.itemIndex;return s}clear(){this.currentCell=null;this.previousRow=null}getRow(t,{el:i,rows:s}){const{top:e}=i.getBoundingClientRect();const o=t-e;const n=h(s,o);const r={itemIndex:n.itemIndex,start:n.start+e,end:n.end+e};return r}getCell({x:t,y:i},{el:s,rows:e,cols:o}){const{top:n,left:r}=s.getBoundingClientRect();const l=i-n;const a=t-r;const C=h(e,l);const d=h(o,a);return{x:d.itemIndex,y:C.itemIndex}}}const v=class{constructor(t){i(this,t);this.internalRowDragStart=s(this,"internalRowDragStart",7);this.internalRowDragEnd=s(this,"internalRowDragEnd",7);this.internalRowDrag=s(this,"internalRowDrag",7);this.internalRowMouseMove=s(this,"internalRowMouseMove",7);this.initialRowDropped=s(this,"initialRowDropped",7);this.rowMoveFunc=L((t=>{const i=this.rowOrderService.move(t,this.getData());if(i!==null){this.internalRowDrag.emit(i)}}),5);this.parent=undefined;this.dimensionRow=undefined;this.dimensionCol=undefined;this.dataStore=undefined}onMouseOut(){this.clearOrder()}onMouseUp(t){this.endOrder(t)}async dragStart(t){t.originalEvent.preventDefault();if(this.moveFunc){this.clearOrder()}const i=this.getData();const s=this.rowOrderService.startOrder(t.originalEvent,i);const e=this.rowOrderService.getRow(t.originalEvent.y,i);const o=this.internalRowDragStart.emit({cell:s,text:l,pos:e,event:t.originalEvent});if(o.defaultPrevented){return}this.moveFunc=t=>this.move(t);document.addEventListener("mousemove",this.moveFunc)}async endOrder(t){this.rowOrderService.endOrder(t,this.getData());this.clearOrder()}async clearOrder(){this.rowOrderService.clear();document.removeEventListener("mousemove",this.moveFunc);this.moveFunc=null;this.internalRowDragEnd.emit()}move({x:t,y:i}){this.internalRowMouseMove.emit({x:t,y:i});this.rowMoveFunc(i)}connectedCallback(){this.rowOrderService=new p({positionChanged:(t,i)=>this.onPositionChanged(t,i)})}onPositionChanged(t,i){const s=this.initialRowDropped.emit({from:t,to:i});if(s.defaultPrevented){return}const e=[...this.dataStore.get("items")];const o=e.splice(t,1);e.splice(i,0,...o);a(this.dataStore,e)}getData(){return{el:this.parent,rows:this.dimensionRow.state,cols:this.dimensionCol.state}}};export{g as revogr_edit,v as revogr_order_editor};
|
|
5
|
+
//# sourceMappingURL=revogr-edit_2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TextEditor","constructor","column","saveCallback","this","element","editCell","async","editInput","timeout","_a","focus","onKeyDown","e","isEnter","isEnterKey","code","isKeyTab","isTab","target","isComposing","blur","getValue","value","render","h","type","val","ref","el","revogrEditStyleCss","RevoEdit","currentEditor","saveRunning","onAutoSave","beforeAutoSave","canSave","onSave","preventFocus","cellEdit","emit","rgCol","x","rgRow","y","prop","componentWillRender","editor","focusNext","closeEdit","componentDidRender","firstElementChild","_b","call","disconnectedCallback","saveOnClose","Host","class","EDIT_INPUT_WR","additionalData","RowOrderService","config","currentCell","previousRow","endOrder","data","newRow","getCell","positionChanged","clear","startOrder","move","getRow","itemIndex","rows","top","getBoundingClientRect","topRelative","getItemByPosition","absolutePosition","start","end","cols","left","leftRelative","OrderEditor","rowMoveFunc","debounce","rowOrderService","getData","internalRowDrag","onMouseOut","clearOrder","onMouseUp","originalEvent","preventDefault","moveFunc","cell","pos","dragStartEvent","internalRowDragStart","text","DRAGG_TEXT","event","defaultPrevented","document","addEventListener","removeEventListener","internalRowDragEnd","internalRowMouseMove","connectedCallback","f","t","onPositionChanged","from","to","dropEvent","initialRowDropped","items","dataStore","get","toMove","splice","setItems","parent","dimensionRow","state","dimensionCol"],"sources":["./src/components/overlay/editors/text.tsx","./src/components/overlay/revogr-edit-style.scss?tag=revogr-edit","./src/components/overlay/revogr-edit.tsx","./src/components/order/rowOrderService.ts","./src/components/order/revogr-order-editor.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { isEnterKey, isTab } from '../../../utils/keyCodes.utils';\nimport { Edition, RevoGrid } from '../../../interfaces';\nimport { timeout } from '../../../utils';\n\n/**\n * Callback triggered on cell editor save\n * Closes editor when called\n * @param preventFocus - if true editor will not be closed and next cell will not be focused\n */\nexport type SaveCallback = (value: Edition.SaveData, preventFocus: boolean) => void;\n\nexport class TextEditor implements Edition.EditorBase {\n private editInput!: HTMLInputElement;\n\n public element: Element | null = null;\n public editCell: Edition.EditCell | null = null;\n\n constructor(public column: RevoGrid.ColumnRegular, private saveCallback?: SaveCallback) {}\n\n async componentDidRender(): Promise<void> {\n if (this.editInput) {\n await timeout();\n this.editInput?.focus();\n }\n }\n\n private onKeyDown(e: KeyboardEvent): void {\n const isEnter = isEnterKey(e.code);\n const isKeyTab = isTab(e.code);\n\n if ((isKeyTab || isEnter) && e.target && this.saveCallback && !e.isComposing) {\n // blur is needed to avoid autoscroll\n this.editInput.blur();\n // request callback which will close cell after all\n this.saveCallback(this.getValue(), isKeyTab);\n }\n }\n \n getValue() {\n return this.editInput?.value;\n }\n\n // required\n render() {\n return (\n <input\n type=\"text\"\n value={this.editCell?.val || ''}\n ref={el => {\n this.editInput = el;\n }}\n onKeyDown={e => this.onKeyDown(e)}\n />\n );\n }\n}\n","revogr-edit {\n display: block;\n position: absolute;\n background-color: #fff;\n\n input {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n\n revo-dropdown {\n height: 100%;\n\n &.shrink {\n fieldset legend > span {\n display: none;\n }\n }\n }\n}\n","import { Component, Event, EventEmitter, Prop, h, Element, Host, Method } from '@stencil/core';\n\nimport { Edition, RevoGrid } from '../../interfaces';\nimport { EDIT_INPUT_WR } from '../../utils/consts';\nimport { TextEditor } from './editors/text';\n\n/**\n * Cell editor component\n */\n@Component({\n tag: 'revogr-edit',\n styleUrl: 'revogr-edit-style.scss',\n})\nexport class RevoEdit {\n @Element() element: HTMLElement;\n @Prop() editCell: Edition.EditCell;\n\n @Prop() column: RevoGrid.ColumnRegular | null;\n /** Custom editors register */\n @Prop() editor: Edition.EditorCtr | null;\n\n /** Save on editor close */\n @Prop() saveOnClose: boolean = false;\n /** Additional data to pass to renderer */\n @Prop() additionalData: any;\n\n /** Cell edit event */\n @Event() cellEdit: EventEmitter<Edition.SaveDataDetails>;\n\n /**\n * Close editor event\n * pass true if requires focus next\n */\n @Event() closeEdit: EventEmitter<boolean | undefined>;\n\n /** Edit session editor */\n private currentEditor: Edition.EditorBase | null = null;\n private saveRunning = false;\n\n @Method() async cancel() {\n this.saveRunning = true;\n }\n\n onAutoSave() {\n this.saveRunning = true;\n const val = this.currentEditor.getValue && this.currentEditor.getValue();\n // for editor plugin internal usage in case you want to stop save and use your own\n if (this.currentEditor.beforeAutoSave) {\n const canSave = this.currentEditor.beforeAutoSave(val);\n if (canSave === false) {\n return;\n }\n }\n this.onSave(val, true);\n }\n\n /**\n * Callback triggered on cell editor save\n * Closes editor when called\n * @param preventFocus - if true editor will not be closed and next cell will not be focused\n */\n onSave(val: Edition.SaveData, preventFocus?: boolean): void {\n this.saveRunning = true;\n if (this.editCell) {\n this.cellEdit.emit({\n rgCol: this.editCell.x,\n rgRow: this.editCell.y,\n type: this.editCell.type,\n prop: this.editCell.prop,\n val,\n preventFocus,\n });\n }\n }\n\n componentWillRender(): void {\n // we have active editor\n if (this.currentEditor) {\n return;\n }\n this.saveRunning = false;\n \n // custom editor usage\n // use TextEditor (editors/text.tsx) to create custom editor\n if (this.editor) {\n this.currentEditor = new this.editor(\n this.column,\n // save\n (e, preventFocus) => {\n this.onSave(e, preventFocus);\n },\n // cancel\n focusNext => {\n this.saveRunning = true;\n this.closeEdit.emit(focusNext);\n },\n );\n return;\n }\n // default text editor usage\n this.currentEditor = new TextEditor(this.column, (e, preventFocus) => this.onSave(e, preventFocus));\n }\n\n componentDidRender(): void {\n if (!this.currentEditor) {\n return;\n }\n this.currentEditor.element = this.element.firstElementChild;\n this.currentEditor.componentDidRender?.();\n }\n\n disconnectedCallback(): void {\n if (this.saveOnClose) {\n // shouldn't be cancelled by saveRunning\n // editor requires getValue to be able to save\n if (!this.saveRunning) {\n this.onAutoSave();\n }\n }\n\n this.saveRunning = false;\n if (!this.currentEditor) {\n return;\n }\n\n this.currentEditor.disconnectedCallback && this.currentEditor.disconnectedCallback();\n if (this.currentEditor.element) {\n this.currentEditor.element = null;\n }\n this.currentEditor = null;\n }\n\n render() {\n if (this.currentEditor) {\n this.currentEditor.editCell = this.editCell;\n return <Host class={EDIT_INPUT_WR}>{this.currentEditor.render(h, this.additionalData)}</Host>;\n }\n return '';\n }\n}\n","import { RevoGrid, Selection } from '../../interfaces';\nimport { getItemByPosition } from '../../store/dimension/dimension.helpers';\n\ntype EventData = { el: HTMLElement; rows: RevoGrid.DimensionSettingsState; cols: RevoGrid.DimensionSettingsState };\ninterface Config {\n positionChanged(from: number, to: number): void;\n}\n\nexport default class RowOrderService {\n private currentCell: Selection.Cell | null = null;\n private previousRow: number | null = null;\n\n constructor(private config: Config) {}\n\n /** Drag finished, calculate and apply changes */\n endOrder(e: MouseEvent, data: EventData): void {\n if (this.currentCell === null) {\n return;\n }\n const newRow = this.getCell(e, data);\n\n // if position changed\n if (newRow.y !== this.currentCell.y) {\n // rgRow dragged out table\n if (newRow.y < 0) {\n newRow.y = 0;\n }\n // rgRow dragged to the top\n else if (newRow.y < this.currentCell.y) {\n newRow.y++;\n }\n this.config.positionChanged(this.currentCell.y, newRow.y);\n }\n this.clear();\n }\n\n /** Drag started, reserve initial cell for farther use */\n startOrder(e: MouseEvent, data: EventData): Selection.Cell {\n this.currentCell = this.getCell(e, data);\n return this.currentCell;\n }\n\n move(y: number, data: EventData): RevoGrid.PositionItem | null {\n const rgRow = this.getRow(y, data);\n // if rgRow same as previous or below range (-1 = 0) do nothing\n if (this.previousRow === rgRow.itemIndex || rgRow.itemIndex < -1) {\n return null;\n }\n this.previousRow = rgRow.itemIndex;\n return rgRow;\n }\n\n /** Drag stopped, probably cursor outside of document area */\n clear(): void {\n this.currentCell = null;\n this.previousRow = null;\n }\n\n /** Calculate cell based on x, y position */\n getRow(y: number, { el, rows }: EventData): RevoGrid.PositionItem {\n const { top } = el.getBoundingClientRect();\n const topRelative = y - top;\n const rgRow = getItemByPosition(rows, topRelative);\n const absolutePosition = {\n itemIndex: rgRow.itemIndex,\n start: rgRow.start + top,\n end: rgRow.end + top,\n };\n return absolutePosition;\n }\n\n /** Calculate cell based on x, y position */\n getCell({ x, y }: Selection.Cell, { el, rows, cols }: EventData): Selection.Cell {\n const { top, left } = el.getBoundingClientRect();\n const topRelative = y - top;\n const leftRelative = x - left;\n const rgRow = getItemByPosition(rows, topRelative);\n const rgCol = getItemByPosition(cols, leftRelative);\n return { x: rgCol.itemIndex, y: rgRow.itemIndex };\n }\n}\n","import { Component, Method, Event, EventEmitter, Prop, Listen } from '@stencil/core';\nimport debounce from 'lodash/debounce';\n\nimport { DragStartEvent, Observable, RevoGrid, Selection } from '../../interfaces';\nimport { DataSourceState, setItems } from '../../store/dataSource/data.store';\nimport { DRAGG_TEXT } from '../../utils/consts';\nimport RowOrderService from './rowOrderService';\n\n@Component({ tag: 'revogr-order-editor' })\nexport class OrderEditor {\n private rowOrderService: RowOrderService;\n private moveFunc: ((e: Selection.Cell) => void) | null;\n private rowMoveFunc = debounce((y: number) => {\n const rgRow = this.rowOrderService.move(y, this.getData());\n if (rgRow !== null) {\n this.internalRowDrag.emit(rgRow);\n }\n }, 5);\n\n // --------------------------------------------------------------------------\n //\n // Properties\n //\n // --------------------------------------------------------------------------\n @Prop() parent: HTMLElement;\n @Prop() dimensionRow: Observable<RevoGrid.DimensionSettingsState>;\n @Prop() dimensionCol: Observable<RevoGrid.DimensionSettingsState>;\n\n /** Static stores, not expected to change during component lifetime */\n @Prop() dataStore: Observable<DataSourceState<RevoGrid.DataType, RevoGrid.DimensionRows>>;\n\n // --------------------------------------------------------------------------\n //\n // Events\n //\n // --------------------------------------------------------------------------\n\n /** Row drag started */\n @Event({ cancelable: true }) internalRowDragStart: EventEmitter<{\n cell: Selection.Cell;\n text: string;\n pos: RevoGrid.PositionItem;\n event: MouseEvent;\n }>;\n\n /** Row drag ended */\n @Event({ cancelable: true }) internalRowDragEnd: EventEmitter;\n\n /** Row move */\n @Event({ cancelable: true }) internalRowDrag: EventEmitter<RevoGrid.PositionItem>;\n\n /** Row mouse move */\n @Event({ cancelable: true }) internalRowMouseMove: EventEmitter<Selection.Cell>;\n\n /** Row dragged, new range ready to be applied */\n @Event({ cancelable: true }) initialRowDropped: EventEmitter<{ from: number; to: number }>;\n\n // --------------------------------------------------------------------------\n //\n // Listeners\n //\n // --------------------------------------------------------------------------\n\n @Listen('mouseleave', { target: 'document' })\n onMouseOut(): void {\n this.clearOrder();\n }\n\n /** Action finished inside of the document */\n @Listen('mouseup', { target: 'document' })\n onMouseUp(e: MouseEvent): void {\n this.endOrder(e);\n }\n\n // --------------------------------------------------------------------------\n //\n // Methods\n //\n // --------------------------------------------------------------------------\n\n @Method() async dragStart(e: DragStartEvent) {\n e.originalEvent.preventDefault();\n\n // extra check if previous ended\n if (this.moveFunc) {\n this.clearOrder();\n }\n\n const data = this.getData();\n const cell = this.rowOrderService.startOrder(e.originalEvent, data);\n const pos = this.rowOrderService.getRow(e.originalEvent.y, data);\n const dragStartEvent = this.internalRowDragStart.emit({ cell, text: DRAGG_TEXT, pos, event: e.originalEvent });\n if (dragStartEvent.defaultPrevented) {\n return;\n }\n\n this.moveFunc = (e: MouseEvent) => this.move(e);\n document.addEventListener('mousemove', this.moveFunc);\n }\n\n @Method() async endOrder(e: MouseEvent) {\n this.rowOrderService.endOrder(e, this.getData());\n this.clearOrder();\n }\n\n @Method() async clearOrder() {\n this.rowOrderService.clear();\n document.removeEventListener('mousemove', this.moveFunc);\n this.moveFunc = null;\n this.internalRowDragEnd.emit();\n }\n\n // --------------------------------------------------------------------------\n //\n // Component methods\n //\n // --------------------------------------------------------------------------\n\n move({ x, y }: { x: number; y: number }): void {\n this.internalRowMouseMove.emit({ x, y });\n this.rowMoveFunc(y);\n }\n\n connectedCallback(): void {\n this.rowOrderService = new RowOrderService({ positionChanged: (f, t) => this.onPositionChanged(f, t) });\n }\n\n private onPositionChanged(from: number, to: number) {\n const dropEvent = this.initialRowDropped.emit({ from, to });\n if (dropEvent.defaultPrevented) {\n return;\n }\n const items = [...this.dataStore.get('items')];\n const toMove = items.splice(from, 1);\n items.splice(to, 0, ...toMove);\n setItems(this.dataStore, items);\n }\n\n private getData() {\n return {\n el: this.parent,\n rows: this.dimensionRow.state,\n cols: this.dimensionCol.state,\n };\n }\n}\n"],"mappings":";;;gRAYaA,EAMXC,YAAmBC,EAAwCC,GAAxCC,KAAAF,SAAwCE,KAAAD,eAHpDC,KAAAC,QAA0B,KAC1BD,KAAAE,SAAoC,I,CAI3CC,2B,MACE,GAAIH,KAAKI,UAAW,OACZC,KACNC,EAAAN,KAAKI,aAAS,MAAAE,SAAA,SAAAA,EAAEC,O,EAIZC,UAAUC,GAChB,MAAMC,EAAUC,EAAWF,EAAEG,MAC7B,MAAMC,EAAWC,EAAML,EAAEG,MAEzB,IAAKC,GAAYH,IAAYD,EAAEM,QAAUf,KAAKD,eAAiBU,EAAEO,YAAa,CAE5EhB,KAAKI,UAAUa,OAEfjB,KAAKD,aAAaC,KAAKkB,WAAYL,E,EAIvCK,W,MACE,OAAOZ,EAAAN,KAAKI,aAAS,MAAAE,SAAA,SAAAA,EAAEa,K,CAIzBC,S,MACE,OACEC,EAAA,SACEC,KAAK,OACLH,QAAOb,EAAAN,KAAKE,YAAQ,MAAAI,SAAA,SAAAA,EAAEiB,MAAO,GAC7BC,IAAKC,IACHzB,KAAKI,UAAYqB,CAAE,EAErBjB,UAAWC,GAAKT,KAAKQ,UAAUC,I,ECpDvC,MAAMiB,EAAqB,80U,MCadC,EAAQ,M,iGAuBX3B,KAAA4B,cAA2C,KAC3C5B,KAAA6B,YAAc,M,qFAfS,M,8BAiBrB1B,eACRH,KAAK6B,YAAc,I,CAGrBC,aACE9B,KAAK6B,YAAc,KACnB,MAAMN,EAAMvB,KAAK4B,cAAcV,UAAYlB,K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AAatG,KAAK4F,S,CAGpCzF,eAAeM,GACvBT,KAAKoF,gBAAgBxB,SAASnD,EAAGT,KAAKqF,WACtCrF,KAAKwF,Y,CAGGrF,mBACRH,KAAKoF,gBAAgBnB,QACrBoC,SAASE,oBAAoB,YAAavG,KAAK4F,UAC/C5F,KAAK4F,SAAW,KAChB5F,KAAKwG,mBAAmBpE,M,CAS1B+B,MAAK7B,EAAEA,EAACE,EAAEA,IACRxC,KAAKyG,qBAAqBrE,KAAK,CAAEE,IAAGE,MACpCxC,KAAKkF,YAAY1C,E,CAGnBkE,oBACE1G,KAAKoF,gBAAkB,IAAI5B,EAAgB,CAAEQ,gBAAiB,CAAC2C,EAAGC,IAAM5G,KAAK6G,kBAAkBF,EAAGC,I,CAG5FC,kBAAkBC,EAAcC,GACtC,MAAMC,EAAYhH,KAAKiH,kBAAkB7E,KAAK,CAAE0E,OAAMC,OACtD,GAAIC,EAAUZ,iBAAkB,CAC9B,M,CAEF,MAAMc,EAAQ,IAAIlH,KAAKmH,UAAUC,IAAI,UACrC,MAAMC,EAASH,EAAMI,OAAOR,EAAM,GAClCI,EAAMI,OAAOP,EAAI,KAAMM,GACvBE,EAASvH,KAAKmH,UAAWD,E,CAGnB7B,UACN,MAAO,CACL5D,GAAIzB,KAAKwH,OACTlD,KAAMtE,KAAKyH,aAAaC,MACxB5C,KAAM9E,KAAK2H,aAAaD,M"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Built by Revolist
|
|
3
3
|
*/
|
|
4
|
-
import{h as t,r as i,c as e,H as s}from"./index-5e90b19b.js";import{j as r,h as o,A as n,T as l}from"./debounce-301fd4d2.js";const a=(i,e)=>t("button",Object.assign({},i,{class:Object.assign(Object.assign({},typeof i.class==="object"?i.class:i.class?{[i.class]:true}:""),{["revo-button"]:true})}),e);(function t(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=function(t){let i=this;do{if(Element.prototype.matches.call(i,t)){return i}i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}}})();const d=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}revogr-filter-panel{position:absolute;display:block;top:0;left:0;z-index:100;opacity:1;transform:none;background-color:#fff;transform-origin:62px 0px;box-shadow:0 5px 18px -2px rgba(0, 0, 0, 0.2);padding:10px;border-radius:4px;min-width:220px;text-align:left}revogr-filter-panel .filter-holder>div{display:flex;flex-direction:column}revogr-filter-panel label{color:gray;font-size:13px;font-weight:600;display:block;padding:8px 0}revogr-filter-panel select{width:100%}revogr-filter-panel input[type=text]{border:0;min-height:34px;margin:5px 0;background:#f3f3f3;border-radius:5px;padding:0 10px;box-sizing:border-box;width:100%}revogr-filter-panel button{margin-top:10px;margin-right:5px}revogr-filter-panel .filter-actions{text-align:right;margin-right:-5px}.rgHeaderCell:hover .rv-filter{transition:opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.rgHeaderCell:hover .rv-filter,.rgHeaderCell .rv-filter.active{opacity:1}.rgHeaderCell .rv-filter{height:24px;width:24px;background:none;border:0;opacity:0;visibility:visible;cursor:pointer;border-radius:4px}.rgHeaderCell .rv-filter.active{color:#10224a}.rgHeaderCell .rv-filter .filter-img{color:gray;width:11px}.select-css{display:block;font-family:sans-serif;font-weight:600;color:#444;line-height:1.3;padding:0.6em 1.4em 0.5em 0.8em;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid #f1f1f1;box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);background-repeat:no-repeat, repeat;background-position:right 0.7em top 50%, 0 0;background-size:0.65em auto, 100%;}.select-css::-ms-expand{display:none}.select-css:hover{border-color:rgb(197, 197, 197)}.select-css:focus{border-color:#f1f1f1;box-shadow:0 0 1px 3px rgba(59, 153, 252, 0.7);box-shadow:0 0 0 3px -moz-mac-focusring;color:#222;outline:none}.select-css option{font-weight:normal}.select-css:disabled,.select-css[aria-disabled=true]{color:gray;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%)}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:#f1f1f1}.multi-filter-list{margin-top:5px;margin-bottom:5px}.multi-filter-list div{white-space:nowrap}.multi-filter-list .multi-filter-list-action{display:flex;justify-content:space-between;align-items:center}.multi-filter-list .and-or-button{margin:0 0 0 10px;min-width:58px;cursor:pointer}.multi-filter-list .trash-button{margin:0 0 -2px 6px;cursor:pointer;width:22px;height:22px;color:gray;font-size:18px}.multi-filter-list .trash-button .trash-img{width:1em}.add-filter-divider{display:block;margin:0 -10px 10px -10px;border-bottom:1px solid #d9d9d9;height:10px;box-shadow:0 4px 5px rgba(0, 0, 0, 0.05)}.select-input{display:flex;justify-content:space-between;align-items:center}";const h="none";const c="multi-filter-list";const p="multi-filter-list-action";const f=class{constructor(t){i(this,t);this.filterChange=e(this,"filterChange",7);this.filterCaptionsInternal={title:"Filter by condition",save:"Save",reset:"Reset",cancel:"Close"};this.debouncedApplyFilter=r((()=>{this.filterChange.emit(this.filterItems)}),400);this.isFilterIdSet=false;this.filterId=0;this.currentFilterId=-1;this.currentFilterType=h;this.changes=undefined;this.uuid=undefined;this.filterItems={};this.filterTypes={};this.filterNames={};this.filterEntities={};this.filterCaptions=undefined;this.disableDynamicFiltering=false}onMouseDown(t){if(this.changes&&!t.defaultPrevented){const i=t.target;if(this.isOutside(i)&&!o(i)){this.changes=undefined}}}async show(t){this.changes=t;if(this.changes){this.changes.type=this.changes.type||h}}async getChanges(){return this.changes}componentWillRender(){if(!this.isFilterIdSet){this.isFilterIdSet=true;const t=Object.keys(this.filterItems);for(const i of t){this.filterId+=this.filterItems[i].length}}}renderSelectOptions(i,e=false){var s;const r=[];const o=(s=this.changes)===null||s===void 0?void 0:s.prop;if(!e){r.push(t("option",{selected:this.currentFilterType===h,value:h},o&&this.filterItems[o]&&this.filterItems[o].length>0?"Add more condition...":this.filterNames[h]))}for(let e in this.filterTypes){r.push(...this.filterTypes[e].map((e=>t("option",{value:e,selected:i===e},this.filterNames[e]))));r.push(t("option",{disabled:true}))}return r}renderExtra(i,e){const s=this.filterItems[i];if(!s)return"";if(this.filterEntities[s[e].type].extra!=="input")return"";return t("input",{id:`filter-input-${s[e].id}`,placeholder:"Enter value...",type:"text",value:s[e].value,onInput:this.onUserInput.bind(this,e,i),onKeyDown:t=>this.onKeyDown(t)})}getFilterItemsList(){var i;const e=(i=this.changes)===null||i===void 0?void 0:i.prop;if(!(e||e===0))return"";const s=this.filterItems[e]||[];return t("div",{key:this.filterId},s.map(((i,s)=>{let r;if(s!==this.filterItems[e].length-1){r=t("div",{onClick:()=>this.toggleFilterAndOr(i.id)},t(n,{isAnd:i.relation==="and"}))}return t("div",{key:i.id,class:c},t("div",{class:{"select-input":true}},t("select",{class:"select-css select-filter",onChange:t=>this.onFilterTypeChange(t,e,s)},this.renderSelectOptions(this.filterItems[e][s].type,true)),t("div",{class:p},r),t("div",{onClick:()=>this.onRemoveFilter(i.id)},t(l,null))),t("div",null,this.renderExtra(e,s)))})),s.length>0?t("div",{class:"add-filter-divider"}):"")}render(){if(!this.changes){return t(s,{style:{display:"none"}})}const i={display:"block",left:`${this.changes.x}px`,top:`${this.changes.y}px`};const e=Object.assign(this.filterCaptionsInternal,this.filterCaptions);return t(s,{style:i},t("label",null,e.title),t("div",{class:"filter-holder"},this.getFilterItemsList()),t("div",{class:"add-filter"},t("select",{id:"add-filter",class:"select-css",onChange:t=>this.onAddNewFilter(t)},this.renderSelectOptions(this.currentFilterType))),t("div",{class:"filter-actions"},this.disableDynamicFiltering&&t(a,{class:{red:true,save:true},onClick:()=>this.onSave()},e.save),t(a,{class:{red:true,reset:true},onClick:()=>this.onReset()},e.reset),t(a,{class:{light:true,cancel:true},onClick:()=>this.onCancel()},e.cancel)))}onFilterTypeChange(t,i,e){const s=t.target;const r=s.value;this.filterItems[i][e].type=r;this.filterId++;setTimeout((()=>{const t=document.getElementById("filter-input-"+this.filterItems[i][e].id);if(t)t.focus()}),0);if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}onAddNewFilter(t){const i=t.target;const e=i.value;this.currentFilterType=e;this.addNewFilterToProp();const s=document.getElementById("add-filter");if(s){s.value=h;this.currentFilterType=h}if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}addNewFilterToProp(){var t;const i=(t=this.changes)===null||t===void 0?void 0:t.prop;if(!(i||i===0))return;if(!this.filterItems[i]){this.filterItems[i]=[]}if(this.currentFilterType==="none")return;this.filterId++;this.currentFilterId=this.filterId;this.filterItems[i].push({id:this.currentFilterId,type:this.currentFilterType,value:"",relation:"and"});setTimeout((()=>{const t=document.getElementById("filter-input-"+this.currentFilterId);if(t)t.focus()}),0)}onUserInput(t,i,e){this.filterItems[i][t].value=e.target.value;if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}onKeyDown(t){if(t.key.toLowerCase()==="enter"){const t=document.getElementById("add-filter");if(t){t.value=h;this.currentFilterType=h;this.addNewFilterToProp();t.focus()}return}t.stopPropagation()}onSave(){this.filterChange.emit(this.filterItems)}onCancel(){this.changes=undefined}onReset(){this.assertChanges();delete this.filterItems[this.changes.prop];this.filterId++;this.filterChange.emit(this.filterItems)}onRemoveFilter(t){this.assertChanges();this.filterId++;const i=this.changes.prop;const e=this.filterItems[i];if(!e)return;const s=e.findIndex((i=>i.id===t));if(s===-1)return;e.splice(s,1);if(e.length===0)delete this.filterItems[i];if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}toggleFilterAndOr(t){this.assertChanges();this.filterId++;const i=this.changes.prop;const e=this.filterItems[i];if(!e)return;const s=e.findIndex((i=>i.id===t));if(s===-1)return;e[s].relation=e[s].relation==="and"?"or":"and";if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}assertChanges(){if(!this.changes){throw new Error("Changes required per edit")}}isOutside(t){const i=document.getElementById("add-filter");if(i)i.value=h;this.currentFilterType=h;this.changes.type=h;this.currentFilterId=-1;if(t.classList.contains(`[uuid="${this.uuid}"]`)){return false}return!(t===null||t===void 0?void 0:t.closest(`[uuid="${this.uuid}"]`))}};f.style=d;export{f as revogr_filter_panel};
|
|
4
|
+
import{h as t,r as i,c as e,H as s}from"./index-05947c5f.js";import{i as r,A as o,T as n}from"./filter.button-21ce90ef.js";import{d as l}from"./debounce-820b5a8b.js";const a=(i,e)=>t("button",Object.assign({},i,{class:Object.assign(Object.assign({},typeof i.class==="object"?i.class:i.class?{[i.class]:true}:""),{["revo-button"]:true})}),e);(function t(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=function(t){let i=this;do{if(Element.prototype.matches.call(i,t)){return i}i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}}})();const d=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}revogr-filter-panel{position:absolute;display:block;top:0;left:0;z-index:100;opacity:1;transform:none;background-color:#fff;transform-origin:62px 0px;box-shadow:0 5px 18px -2px rgba(0, 0, 0, 0.2);padding:10px;border-radius:4px;min-width:220px;text-align:left}revogr-filter-panel .filter-holder>div{display:flex;flex-direction:column}revogr-filter-panel label{color:gray;font-size:13px;font-weight:600;display:block;padding:8px 0}revogr-filter-panel select{width:100%}revogr-filter-panel input[type=text]{border:0;min-height:34px;margin:5px 0;background:#f3f3f3;border-radius:5px;padding:0 10px;box-sizing:border-box;width:100%}revogr-filter-panel button{margin-top:10px;margin-right:5px}revogr-filter-panel .filter-actions{text-align:right;margin-right:-5px}.rgHeaderCell:hover .rv-filter{transition:opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms}.rgHeaderCell:hover .rv-filter,.rgHeaderCell .rv-filter.active{opacity:1}.rgHeaderCell .rv-filter{height:24px;width:24px;background:none;border:0;opacity:0;visibility:visible;cursor:pointer;border-radius:4px}.rgHeaderCell .rv-filter.active{color:#10224a}.rgHeaderCell .rv-filter .filter-img{color:gray;width:11px}.select-css{display:block;font-family:sans-serif;font-weight:600;color:#444;line-height:1.3;padding:0.6em 1.4em 0.5em 0.8em;width:100%;max-width:100%;box-sizing:border-box;margin:0;border:1px solid #f1f1f1;box-shadow:transparent;border-radius:0.5em;appearance:none;background-color:#fff;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);background-repeat:no-repeat, repeat;background-position:right 0.7em top 50%, 0 0;background-size:0.65em auto, 100%;}.select-css::-ms-expand{display:none}.select-css:hover{border-color:rgb(197, 197, 197)}.select-css:focus{border-color:#f1f1f1;box-shadow:0 0 1px 3px rgba(59, 153, 252, 0.7);box-shadow:0 0 0 3px -moz-mac-focusring;color:#222;outline:none}.select-css option{font-weight:normal}.select-css:disabled,.select-css[aria-disabled=true]{color:gray;background-image:url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"), linear-gradient(to bottom, #ffffff 0%, #ffffff 100%)}.select-css:disabled:hover,.select-css[aria-disabled=true]{border-color:#f1f1f1}.multi-filter-list{margin-top:5px;margin-bottom:5px}.multi-filter-list div{white-space:nowrap}.multi-filter-list .multi-filter-list-action{display:flex;justify-content:space-between;align-items:center}.multi-filter-list .and-or-button{margin:0 0 0 10px;min-width:58px;cursor:pointer}.multi-filter-list .trash-button{margin:0 0 -2px 6px;cursor:pointer;width:22px;height:22px;color:gray;font-size:18px}.multi-filter-list .trash-button .trash-img{width:1em}.add-filter-divider{display:block;margin:0 -10px 10px -10px;border-bottom:1px solid #d9d9d9;height:10px;box-shadow:0 4px 5px rgba(0, 0, 0, 0.05)}.select-input{display:flex;justify-content:space-between;align-items:center}";const h="none";const c="multi-filter-list";const p="multi-filter-list-action";const f=class{constructor(t){i(this,t);this.filterChange=e(this,"filterChange",7);this.filterCaptionsInternal={title:"Filter by condition",save:"Save",reset:"Reset",cancel:"Close"};this.debouncedApplyFilter=l((()=>{this.filterChange.emit(this.filterItems)}),400);this.isFilterIdSet=false;this.filterId=0;this.currentFilterId=-1;this.currentFilterType=h;this.changes=undefined;this.uuid=undefined;this.filterItems={};this.filterTypes={};this.filterNames={};this.filterEntities={};this.filterCaptions=undefined;this.disableDynamicFiltering=false}onMouseDown(t){if(this.changes&&!t.defaultPrevented){const i=t.target;if(this.isOutside(i)&&!r(i)){this.changes=undefined}}}async show(t){this.changes=t;if(this.changes){this.changes.type=this.changes.type||h}}async getChanges(){return this.changes}componentWillRender(){if(!this.isFilterIdSet){this.isFilterIdSet=true;const t=Object.keys(this.filterItems);for(const i of t){this.filterId+=this.filterItems[i].length}}}renderSelectOptions(i,e=false){var s;const r=[];const o=(s=this.changes)===null||s===void 0?void 0:s.prop;if(!e){r.push(t("option",{selected:this.currentFilterType===h,value:h},o&&this.filterItems[o]&&this.filterItems[o].length>0?"Add more condition...":this.filterNames[h]))}for(let e in this.filterTypes){r.push(...this.filterTypes[e].map((e=>t("option",{value:e,selected:i===e},this.filterNames[e]))));r.push(t("option",{disabled:true}))}return r}renderExtra(i,e){const s=this.filterItems[i];if(!s)return"";if(this.filterEntities[s[e].type].extra!=="input")return"";return t("input",{id:`filter-input-${s[e].id}`,placeholder:"Enter value...",type:"text",value:s[e].value,onInput:this.onUserInput.bind(this,e,i),onKeyDown:t=>this.onKeyDown(t)})}getFilterItemsList(){var i;const e=(i=this.changes)===null||i===void 0?void 0:i.prop;if(!(e||e===0))return"";const s=this.filterItems[e]||[];return t("div",{key:this.filterId},s.map(((i,s)=>{let r;if(s!==this.filterItems[e].length-1){r=t("div",{onClick:()=>this.toggleFilterAndOr(i.id)},t(o,{isAnd:i.relation==="and"}))}return t("div",{key:i.id,class:c},t("div",{class:{"select-input":true}},t("select",{class:"select-css select-filter",onChange:t=>this.onFilterTypeChange(t,e,s)},this.renderSelectOptions(this.filterItems[e][s].type,true)),t("div",{class:p},r),t("div",{onClick:()=>this.onRemoveFilter(i.id)},t(n,null))),t("div",null,this.renderExtra(e,s)))})),s.length>0?t("div",{class:"add-filter-divider"}):"")}render(){if(!this.changes){return t(s,{style:{display:"none"}})}const i={display:"block",left:`${this.changes.x}px`,top:`${this.changes.y}px`};const e=Object.assign(this.filterCaptionsInternal,this.filterCaptions);return t(s,{style:i},t("label",null,e.title),t("div",{class:"filter-holder"},this.getFilterItemsList()),t("div",{class:"add-filter"},t("select",{id:"add-filter",class:"select-css",onChange:t=>this.onAddNewFilter(t)},this.renderSelectOptions(this.currentFilterType))),t("div",{class:"filter-actions"},this.disableDynamicFiltering&&t(a,{class:{red:true,save:true},onClick:()=>this.onSave()},e.save),t(a,{class:{red:true,reset:true},onClick:()=>this.onReset()},e.reset),t(a,{class:{light:true,cancel:true},onClick:()=>this.onCancel()},e.cancel)))}onFilterTypeChange(t,i,e){const s=t.target;const r=s.value;this.filterItems[i][e].type=r;this.filterId++;setTimeout((()=>{const t=document.getElementById("filter-input-"+this.filterItems[i][e].id);if(t)t.focus()}),0);if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}onAddNewFilter(t){const i=t.target;const e=i.value;this.currentFilterType=e;this.addNewFilterToProp();const s=document.getElementById("add-filter");if(s){s.value=h;this.currentFilterType=h}if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}addNewFilterToProp(){var t;const i=(t=this.changes)===null||t===void 0?void 0:t.prop;if(!(i||i===0))return;if(!this.filterItems[i]){this.filterItems[i]=[]}if(this.currentFilterType==="none")return;this.filterId++;this.currentFilterId=this.filterId;this.filterItems[i].push({id:this.currentFilterId,type:this.currentFilterType,value:"",relation:"and"});setTimeout((()=>{const t=document.getElementById("filter-input-"+this.currentFilterId);if(t)t.focus()}),0)}onUserInput(t,i,e){this.filterItems[i][t].value=e.target.value;if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}onKeyDown(t){if(t.key.toLowerCase()==="enter"){const t=document.getElementById("add-filter");if(t){t.value=h;this.currentFilterType=h;this.addNewFilterToProp();t.focus()}return}t.stopPropagation()}onSave(){this.filterChange.emit(this.filterItems)}onCancel(){this.changes=undefined}onReset(){this.assertChanges();delete this.filterItems[this.changes.prop];this.filterId++;this.filterChange.emit(this.filterItems)}onRemoveFilter(t){this.assertChanges();this.filterId++;const i=this.changes.prop;const e=this.filterItems[i];if(!e)return;const s=e.findIndex((i=>i.id===t));if(s===-1)return;e.splice(s,1);if(e.length===0)delete this.filterItems[i];if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}toggleFilterAndOr(t){this.assertChanges();this.filterId++;const i=this.changes.prop;const e=this.filterItems[i];if(!e)return;const s=e.findIndex((i=>i.id===t));if(s===-1)return;e[s].relation=e[s].relation==="and"?"or":"and";if(!this.disableDynamicFiltering)this.debouncedApplyFilter()}assertChanges(){if(!this.changes){throw new Error("Changes required per edit")}}isOutside(t){const i=document.getElementById("add-filter");if(i)i.value=h;this.currentFilterType=h;this.changes.type=h;this.currentFilterId=-1;if(t.classList.contains(`[uuid="${this.uuid}"]`)){return false}return!(t===null||t===void 0?void 0:t.closest(`[uuid="${this.uuid}"]`))}};f.style=d;export{f as revogr_filter_panel};
|
|
5
5
|
//# sourceMappingURL=revogr-filter-panel.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RevoButton","props","children","h","Object","assign","class","closest","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","el","this","call","parentElement","parentNode","nodeType","filterStyleCss","defaultType","FILTER_LIST_CLASS","FILTER_LIST_CLASS_ACTION","FilterPanel","filterCaptionsInternal","title","save","reset","cancel","debouncedApplyFilter","debounce","filterChange","emit","filterItems","onMouseDown","e","changes","defaultPrevented","target","isOutside","isFilterBtn","undefined","async","newEntity","type","componentWillRender","isFilterIdSet","keys","prop","filterId","length","renderSelectOptions","isDefaultTypeRemoved","options","_a","push","selected","currentFilterType","value","filterNames","gIndex","filterTypes","map","k","disabled","renderExtra","index","currentFilter","filterEntities","extra","id","placeholder","onInput","onUserInput","bind","onKeyDown","getFilterItemsList","propFilters","key","d","andOrButton","onClick","toggleFilterAndOr","AndOrButton","isAnd","relation","onChange","onFilterTypeChange","onRemoveFilter","TrashButton","render","Host","style","display","left","x","top","y","capts","filterCaptions","onAddNewFilter","disableDynamicFiltering","red","onSave","onReset","light","onCancel","setTimeout","input","document","getElementById","focus","addNewFilterToProp","select","currentFilterId","event","toLowerCase","stopPropagation","assertChanges","items","findIndex","splice","Error","classList","contains","uuid"],"sources":["./src/components/button/button.tsx","./src/utils/closestPolifill.ts","./src/plugins/filter/filter.style.scss?tag=revogr-filter-panel","./src/plugins/filter/filter.pop.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { JSXBase, VNode } from '@stencil/core/internal';\n\ninterface Props extends Partial<JSXBase.ButtonHTMLAttributes<HTMLButtonElement>> {}\n\nexport const RevoButton = (props: Props, children: VNode[]) => {\n return (\n <button\n {...props}\n class={{\n ...(typeof props.class === 'object' ? props.class : props.class ? { [props.class]: true } : ''),\n ['revo-button']: true,\n }}\n >\n {children}\n </button>\n );\n};\n","(function closest() {\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n ((Element.prototype as unknown) as { msMatchesSelector: (selectors: string) => boolean }).msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n if (!Element.prototype.closest) {\n Element.prototype.closest = function (s: string) {\n let el: HTMLElement | Element | (Node & ParentNode) = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n})();\n","revogr-filter-panel {\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n z-index: 100;\n\n opacity: 1;\n transform: none;\n background-color: #fff;\n transform-origin: 62px 0px;\n box-shadow: 0 5px 18px -2px rgba(black, 20%);\n padding: 10px;\n border-radius: 4px;\n\n min-width: 220px;\n text-align: left;\n\n .filter-holder > div {\n display: flex;\n flex-direction: column;\n }\n\n label {\n color: gray;\n font-size: 13px;\n font-weight: 600;\n display: block;\n padding: 8px 0;\n }\n\n select {\n width: 100%;\n }\n\n input[type=\"text\"] {\n border: 0;\n min-height: 34px;\n margin: 5px 0;\n background: #f3f3f3;\n border-radius: 5px;\n padding: 0 10px;\n box-sizing: border-box;\n width: 100%;\n }\n\n button {\n margin-top: 10px;\n margin-right: 5px;\n }\n\n\n .filter-actions {\n text-align: right;\n margin-right: -5px;\n }\n}\n\n.rgHeaderCell {\n &:hover .rv-filter {\n transition: opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n &:hover .rv-filter,\n .rv-filter.active {\n opacity: 1;\n }\n\n .rv-filter {\n $btn-size: 24px;\n height: $btn-size;\n width: $btn-size;\n background: none;\n border: 0;\n opacity: 0;\n visibility: visible;\n cursor: pointer;\n border-radius: 4px;\n\n &.active {\n color: #10224a;\n }\n\n .filter-img {\n $img-size: 11px;\n color: gray;\n width: $img-size;\n }\n }\n}\n\n.select-css {\n $gradient: \"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\";\n $linearGradient: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n $borderColor: #f1f1f1;\n\n display: block;\n font-family: sans-serif;\n font-weight: 600;\n color: #444;\n line-height: 1.3;\n padding: 0.6em 1.4em 0.5em 0.8em;\n width: 100%;\n max-width: 100%; /* useful when width is set to anything other than 100% */\n box-sizing: border-box;\n margin: 0;\n border: 1px solid $borderColor;\n box-shadow: transparent;\n border-radius: 0.5em;\n appearance: none;\n background-color: #fff;\n background-image: url($gradient), $linearGradient;\n background-repeat: no-repeat, repeat;\n /* arrow icon position (1em from the right, 50% vertical) , then gradient position*/\n background-position: right 0.7em top 50%, 0 0;\n /* icon size, then gradient */\n background-size: 0.65em auto, 100%;\n\n /* Hide arrow icon in IE browsers */\n &::-ms-expand {\n display: none;\n }\n /* Hover style */\n &:hover {\n border-color: rgb(197, 197, 197);\n }\n /* Focus style */\n &:focus {\n border-color: $borderColor;\n box-shadow: 0 0 1px 3px rgba(59, 153, 252, 0.7);\n box-shadow: 0 0 0 3px -moz-mac-focusring;\n color: #222;\n outline: none;\n }\n\n /* Set options to normal weight */\n option {\n font-weight: normal;\n }\n\n /* Disabled styles */\n &:disabled,\n &[aria-disabled=\"true\"] {\n color: gray;\n background-image: url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"),\n linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n }\n\n &:disabled:hover,\n &[aria-disabled=\"true\"] {\n border-color: $borderColor;\n }\n}\n\n.multi-filter-list {\n margin-top: 5px;\n margin-bottom: 5px;\n\n div {\n white-space: nowrap;\n }\n\n .multi-filter-list-action {\n display: flex;\n\n justify-content: space-between;\n align-items: center;\n }\n\n .and-or-button {\n margin: 0 0 0 10px;\n min-width: 58px;\n cursor: pointer;\n }\n .trash-button {\n $btn-remove-size: 22px;\n margin: 0 0 -2px 6px;\n cursor: pointer;\n\n width: $btn-remove-size;\n height: $btn-remove-size;\n color: gray;\n font-size: 18px;\n\n\n .trash-img {\n width: 1em;\n }\n }\n}\n\n.add-filter-divider {\n display: block;\n margin: 0 -10px 10px -10px;\n\n border-bottom: 1px solid #d9d9d9;\n height: 10px;\n box-shadow: 0 4px 5px rgb(0 0 0 / 5%);\n}\n\n.select-input {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}","import { Component, h, Host, Listen, Prop, State, Event, EventEmitter, VNode, Method } from '@stencil/core';\nimport { FilterType } from './filter.service';\nimport { RevoGrid } from '../../interfaces';\nimport { AndOrButton, isFilterBtn, TrashButton } from './filter.button';\nimport { RevoButton } from '../../components/button/button';\nimport '../../utils/closestPolifill';\nimport { LogicFunction } from './filter.types';\nimport { FilterCaptions } from './filter.plugin';\nimport debounce from 'lodash/debounce';\n\n/**\n * @typedef FilterItem\n * @type {object}\n * @property {ColumnProp} prop - column id\n * @property {FilterType} type - filter type definition\n * @property {any} value - value for additional filtering, text value or some id\n */\nexport type FilterItem = {\n prop?: RevoGrid.ColumnProp;\n type?: FilterType;\n value?: any;\n};\n\nexport type FilterData = {\n id: number;\n type: FilterType;\n value?: any;\n relation: 'and' | 'or';\n};\n\nexport type MultiFilterItem = {\n [prop: string]: FilterData[];\n};\n\nexport type ShowData = {\n x: number;\n y: number;\n} & FilterItem;\n\nconst defaultType: FilterType = 'none';\n\nconst FILTER_LIST_CLASS = 'multi-filter-list';\nconst FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';\n\n@Component({\n tag: 'revogr-filter-panel',\n styleUrl: 'filter.style.scss',\n})\nexport class FilterPanel {\n private filterCaptionsInternal: FilterCaptions = {\n title: 'Filter by condition',\n save: 'Save',\n reset: 'Reset',\n cancel: 'Close',\n };\n @State() isFilterIdSet = false;\n @State() filterId = 0;\n @State() currentFilterId: number = -1;\n @State() currentFilterType: FilterType = defaultType;\n @State() changes: ShowData | undefined;\n @Prop({ mutable: true, reflect: true }) uuid: string;\n @Prop() filterItems: MultiFilterItem = {};\n @Prop() filterTypes: Record<string, string[]> = {};\n @Prop() filterNames: Record<string, string> = {};\n @Prop() filterEntities: Record<string, LogicFunction> = {};\n @Prop() filterCaptions: FilterCaptions | undefined;\n @Prop() disableDynamicFiltering: boolean = false;\n @Event() filterChange: EventEmitter<MultiFilterItem>;\n @Listen('mousedown', { target: 'document' }) onMouseDown(e: MouseEvent): void {\n if (this.changes && !e.defaultPrevented) {\n const el = e.target as HTMLElement;\n if (this.isOutside(el) && !isFilterBtn(el)) {\n this.changes = undefined;\n }\n }\n }\n @Method() async show(newEntity?: ShowData) {\n this.changes = newEntity;\n if (this.changes) {\n this.changes.type = this.changes.type || defaultType;\n }\n }\n\n @Method() async getChanges() {\n return this.changes;\n }\n\n componentWillRender() {\n if (!this.isFilterIdSet) {\n this.isFilterIdSet = true;\n const filterItems = Object.keys(this.filterItems);\n for (const prop of filterItems) {\n // we set the proper filterId so there won't be any conflict when removing filters\n this.filterId += this.filterItems[prop].length;\n }\n }\n }\n\n renderSelectOptions(type: FilterType, isDefaultTypeRemoved = false) {\n const options: VNode[] = [];\n const prop = this.changes?.prop;\n\n if (!isDefaultTypeRemoved) {\n options.push(\n <option selected={this.currentFilterType === defaultType} value={defaultType}>\n {prop && this.filterItems[prop] && this.filterItems[prop].length > 0 ? 'Add more condition...' : this.filterNames[defaultType]}\n </option>,\n );\n }\n\n for (let gIndex in this.filterTypes) {\n options.push(\n ...this.filterTypes[gIndex].map(k => (\n <option value={k} selected={type === k}>\n {this.filterNames[k]}\n </option>\n )),\n );\n options.push(<option disabled></option>);\n }\n return options;\n }\n\n renderExtra(prop: RevoGrid.ColumnProp, index: number) {\n const currentFilter = this.filterItems[prop];\n\n if (!currentFilter) return '';\n\n if (this.filterEntities[currentFilter[index].type].extra !== 'input') return '';\n\n return (\n <input\n id={`filter-input-${currentFilter[index].id}`}\n placeholder=\"Enter value...\"\n type=\"text\"\n value={currentFilter[index].value}\n onInput={this.onUserInput.bind(this, index, prop)}\n onKeyDown={e => this.onKeyDown(e)}\n />\n );\n }\n\n getFilterItemsList() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return '';\n\n const propFilters = this.filterItems[prop] || [];\n return (\n <div key={this.filterId}>\n {propFilters.map((d, index) => {\n let andOrButton;\n\n // hide toggle button if there is only one filter and the last one\n if (index !== this.filterItems[prop].length - 1) {\n andOrButton = (\n <div onClick={() => this.toggleFilterAndOr(d.id)}>\n <AndOrButton isAnd={d.relation === 'and'} />\n </div>\n );\n }\n\n return (\n <div key={d.id} class={FILTER_LIST_CLASS}>\n <div class={{ 'select-input': true }}>\n <select class=\"select-css select-filter\" onChange={e => this.onFilterTypeChange(e, prop, index)}>\n {this.renderSelectOptions(this.filterItems[prop][index].type, true)}\n </select>\n <div class={FILTER_LIST_CLASS_ACTION}>{andOrButton}</div>\n <div onClick={() => this.onRemoveFilter(d.id)}>\n <TrashButton />\n </div>\n </div>\n <div>{this.renderExtra(prop, index)}</div>\n </div>\n );\n })}\n\n {propFilters.length > 0 ? <div class=\"add-filter-divider\"></div> : ''}\n </div>\n );\n }\n\n render() {\n if (!this.changes) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n const style = {\n display: 'block',\n left: `${this.changes.x}px`,\n top: `${this.changes.y}px`,\n };\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <Host style={style}>\n <label>{capts.title}</label>\n <div class=\"filter-holder\">{this.getFilterItemsList()}</div>\n\n <div class=\"add-filter\">\n <select id=\"add-filter\" class=\"select-css\" onChange={e => this.onAddNewFilter(e)}>\n {this.renderSelectOptions(this.currentFilterType)}\n </select>\n </div>\n <div class=\"filter-actions\">\n {this.disableDynamicFiltering &&\n <RevoButton class={{ red: true, save: true }} onClick={() => this.onSave()}>\n {capts.save}\n </RevoButton>\n }\n <RevoButton class={{ red: true, reset: true }} onClick={() => this.onReset()}>\n {capts.reset}\n </RevoButton>\n <RevoButton class={{ light: true, cancel: true }} onClick={() => this.onCancel()}>\n {capts.cancel}\n </RevoButton>\n </div>\n </Host>\n );\n }\n\n private onFilterTypeChange(e: Event, prop: RevoGrid.ColumnProp, index: number) {\n const el = e.target as HTMLSelectElement;\n const type = el.value as FilterType;\n\n this.filterItems[prop][index].type = type;\n\n // this re-renders the input to know if we need extra input\n this.filterId++;\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private debouncedApplyFilter = debounce(() => {\n this.filterChange.emit(this.filterItems);\n }, 400);\n\n private onAddNewFilter(e: Event) {\n const el = e.target as HTMLSelectElement;\n const type = el.value as FilterType;\n\n this.currentFilterType = type;\n this.addNewFilterToProp();\n\n // reset value after adding new filter\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n }\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private addNewFilterToProp() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return;\n\n if (!this.filterItems[prop]) {\n this.filterItems[prop] = [];\n }\n\n if (this.currentFilterType === 'none') return;\n\n this.filterId++;\n this.currentFilterId = this.filterId;\n\n this.filterItems[prop].push({\n id: this.currentFilterId,\n type: this.currentFilterType,\n value: '',\n relation: 'and',\n });\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.currentFilterId) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n }\n\n private onUserInput(index: number, prop: RevoGrid.ColumnProp, event: Event) {\n // update the value of the filter item\n this.filterItems[prop][index].value = (event.target as HTMLInputElement).value;\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private onKeyDown(e: KeyboardEvent) {\n if (e.key.toLowerCase() === 'enter') {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n this.addNewFilterToProp();\n select.focus();\n }\n return;\n }\n // keep event local, don't escalate farther to dom\n e.stopPropagation();\n }\n\n private onSave() {\n this.filterChange.emit(this.filterItems);\n }\n\n private onCancel() {\n this.changes = undefined;\n }\n\n private onReset() {\n this.assertChanges();\n\n delete this.filterItems[this.changes.prop];\n\n // this updates the DOM which is used by getFilterItemsList() key\n this.filterId++;\n\n this.filterChange.emit(this.filterItems);\n }\n\n private onRemoveFilter(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes.prop;\n\n const items = this.filterItems[prop];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n items.splice(index, 1);\n\n // let's remove the prop if no more filters so the filter icon will be removed\n if (items.length === 0) delete this.filterItems[prop];\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private toggleFilterAndOr(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes.prop;\n\n const items = this.filterItems[prop];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n\n items[index].relation = items[index].relation === 'and' ? 'or' : 'and';\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private assertChanges() {\n if (!this.changes) {\n throw new Error('Changes required per edit');\n }\n }\n\n private isOutside(e: HTMLElement | null) {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) select.value = defaultType;\n\n this.currentFilterType = defaultType;\n this.changes.type = defaultType;\n this.currentFilterId = -1;\n if (e.classList.contains(`[uuid=\"${this.uuid}\"]`)) {\n return false;\n }\n return !e?.closest(`[uuid=\"${this.uuid}\"]`);\n }\n}\n"],"mappings":";;;6HAKO,MAAMA,EAAa,CAACC,EAAcC,IAErCC,EAAA,SAAAC,OAAAC,OAAA,GACMJ,EAAK,CACTK,MAAKF,OAAAC,OAAAD,OAAAC,OAAA,UACQJ,EAAMK,QAAU,S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AW,SAAUpC,KAAKmB,YAAYe,GAEhD,IAAKlC,KAAKuF,wBAAyBvF,KAAKe,sB,CAGlCqD,kBAAkBZ,GACxBxD,KAAKwG,gBAGLxG,KAAKmC,WAEL,MAAMD,EAAOlC,KAAKsB,QAAQY,KAE1B,MAAMuE,EAAQzG,KAAKmB,YAAYe,GAC/B,IAAKuE,EAAO,OAEZ,MAAMrD,EAAQqD,EAAMC,WAAUzC,GAAKA,EAAET,KAAOA,IAC5C,GAAIJ,KAAW,EAAG,OAElBqD,EAAMrD,GAAOmB,SAAWkC,EAAMrD,GAAOmB,WAAa,MAAQ,KAAO,MACjE,IAAKvE,KAAKuF,wBAAyBvF,KAAKe,sB,CAGlCyF,gBACN,IAAKxG,KAAKsB,QAAS,CACjB,MAAM,IAAIsF,MAAM,4B,EAIZnF,UAAUJ,GAChB,MAAM8E,EAASJ,SAASC,eAAe,cACvC,GAAIG,EAAQA,EAAOvD,MAAQtC,EAE3BN,KAAK2C,kBAAoBrC,EACzBN,KAAKsB,QAAQQ,KAAOxB,EACpBN,KAAKoG,iBAAmB,EACxB,GAAI/E,EAAEwF,UAAUC,SAAS,UAAU9G,KAAK+G,UAAW,CACjD,OAAO,K,CAET,QAAQ1F,IAAC,MAADA,SAAC,SAADA,EAAG7B,QAAQ,UAAUQ,KAAK+G,U"}
|
|
1
|
+
{"version":3,"names":["RevoButton","props","children","h","Object","assign","class","closest","Element","prototype","matches","msMatchesSelector","webkitMatchesSelector","s","el","this","call","parentElement","parentNode","nodeType","filterStyleCss","defaultType","FILTER_LIST_CLASS","FILTER_LIST_CLASS_ACTION","FilterPanel","filterCaptionsInternal","title","save","reset","cancel","debouncedApplyFilter","debounce","filterChange","emit","filterItems","onMouseDown","e","changes","defaultPrevented","target","isOutside","isFilterBtn","undefined","async","newEntity","type","componentWillRender","isFilterIdSet","keys","prop","filterId","length","renderSelectOptions","isDefaultTypeRemoved","options","_a","push","selected","currentFilterType","value","filterNames","gIndex","filterTypes","map","k","disabled","renderExtra","index","currentFilter","filterEntities","extra","id","placeholder","onInput","onUserInput","bind","onKeyDown","getFilterItemsList","propFilters","key","d","andOrButton","onClick","toggleFilterAndOr","AndOrButton","isAnd","relation","onChange","onFilterTypeChange","onRemoveFilter","TrashButton","render","Host","style","display","left","x","top","y","capts","filterCaptions","onAddNewFilter","disableDynamicFiltering","red","onSave","onReset","light","onCancel","setTimeout","input","document","getElementById","focus","addNewFilterToProp","select","currentFilterId","event","toLowerCase","stopPropagation","assertChanges","items","findIndex","splice","Error","classList","contains","uuid"],"sources":["./src/components/button/button.tsx","./src/utils/closestPolifill.ts","./src/plugins/filter/filter.style.scss?tag=revogr-filter-panel","./src/plugins/filter/filter.pop.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { JSXBase, VNode } from '@stencil/core/internal';\n\ninterface Props extends Partial<JSXBase.ButtonHTMLAttributes<HTMLButtonElement>> {}\n\nexport const RevoButton = (props: Props, children: VNode[]) => {\n return (\n <button\n {...props}\n class={{\n ...(typeof props.class === 'object' ? props.class : props.class ? { [props.class]: true } : ''),\n ['revo-button']: true,\n }}\n >\n {children}\n </button>\n );\n};\n","(function closest() {\n if (!Element.prototype.matches) {\n Element.prototype.matches =\n ((Element.prototype as unknown) as { msMatchesSelector: (selectors: string) => boolean }).msMatchesSelector || Element.prototype.webkitMatchesSelector;\n }\n\n if (!Element.prototype.closest) {\n Element.prototype.closest = function (s: string) {\n let el: HTMLElement | Element | (Node & ParentNode) = this;\n\n do {\n if (Element.prototype.matches.call(el, s)) {\n return el;\n }\n el = el.parentElement || el.parentNode;\n } while (el !== null && el.nodeType === 1);\n return null;\n };\n }\n})();\n","revogr-filter-panel {\n position: absolute;\n display: block;\n top: 0;\n left: 0;\n z-index: 100;\n\n opacity: 1;\n transform: none;\n background-color: #fff;\n transform-origin: 62px 0px;\n box-shadow: 0 5px 18px -2px rgba(black, 20%);\n padding: 10px;\n border-radius: 4px;\n\n min-width: 220px;\n text-align: left;\n\n .filter-holder > div {\n display: flex;\n flex-direction: column;\n }\n\n label {\n color: gray;\n font-size: 13px;\n font-weight: 600;\n display: block;\n padding: 8px 0;\n }\n\n select {\n width: 100%;\n }\n\n input[type=\"text\"] {\n border: 0;\n min-height: 34px;\n margin: 5px 0;\n background: #f3f3f3;\n border-radius: 5px;\n padding: 0 10px;\n box-sizing: border-box;\n width: 100%;\n }\n\n button {\n margin-top: 10px;\n margin-right: 5px;\n }\n\n\n .filter-actions {\n text-align: right;\n margin-right: -5px;\n }\n}\n\n.rgHeaderCell {\n &:hover .rv-filter {\n transition: opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms, transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n }\n &:hover .rv-filter,\n .rv-filter.active {\n opacity: 1;\n }\n\n .rv-filter {\n $btn-size: 24px;\n height: $btn-size;\n width: $btn-size;\n background: none;\n border: 0;\n opacity: 0;\n visibility: visible;\n cursor: pointer;\n border-radius: 4px;\n\n &.active {\n color: #10224a;\n }\n\n .filter-img {\n $img-size: 11px;\n color: gray;\n width: $img-size;\n }\n }\n}\n\n.select-css {\n $gradient: \"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\";\n $linearGradient: linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n $borderColor: #f1f1f1;\n\n display: block;\n font-family: sans-serif;\n font-weight: 600;\n color: #444;\n line-height: 1.3;\n padding: 0.6em 1.4em 0.5em 0.8em;\n width: 100%;\n max-width: 100%; /* useful when width is set to anything other than 100% */\n box-sizing: border-box;\n margin: 0;\n border: 1px solid $borderColor;\n box-shadow: transparent;\n border-radius: 0.5em;\n appearance: none;\n background-color: #fff;\n background-image: url($gradient), $linearGradient;\n background-repeat: no-repeat, repeat;\n /* arrow icon position (1em from the right, 50% vertical) , then gradient position*/\n background-position: right 0.7em top 50%, 0 0;\n /* icon size, then gradient */\n background-size: 0.65em auto, 100%;\n\n /* Hide arrow icon in IE browsers */\n &::-ms-expand {\n display: none;\n }\n /* Hover style */\n &:hover {\n border-color: rgb(197, 197, 197);\n }\n /* Focus style */\n &:focus {\n border-color: $borderColor;\n box-shadow: 0 0 1px 3px rgba(59, 153, 252, 0.7);\n box-shadow: 0 0 0 3px -moz-mac-focusring;\n color: #222;\n outline: none;\n }\n\n /* Set options to normal weight */\n option {\n font-weight: normal;\n }\n\n /* Disabled styles */\n &:disabled,\n &[aria-disabled=\"true\"] {\n color: gray;\n background-image: url(\"data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22graytext%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E\"),\n linear-gradient(to bottom, #ffffff 0%, #ffffff 100%);\n }\n\n &:disabled:hover,\n &[aria-disabled=\"true\"] {\n border-color: $borderColor;\n }\n}\n\n.multi-filter-list {\n margin-top: 5px;\n margin-bottom: 5px;\n\n div {\n white-space: nowrap;\n }\n\n .multi-filter-list-action {\n display: flex;\n\n justify-content: space-between;\n align-items: center;\n }\n\n .and-or-button {\n margin: 0 0 0 10px;\n min-width: 58px;\n cursor: pointer;\n }\n .trash-button {\n $btn-remove-size: 22px;\n margin: 0 0 -2px 6px;\n cursor: pointer;\n\n width: $btn-remove-size;\n height: $btn-remove-size;\n color: gray;\n font-size: 18px;\n\n\n .trash-img {\n width: 1em;\n }\n }\n}\n\n.add-filter-divider {\n display: block;\n margin: 0 -10px 10px -10px;\n\n border-bottom: 1px solid #d9d9d9;\n height: 10px;\n box-shadow: 0 4px 5px rgb(0 0 0 / 5%);\n}\n\n.select-input {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}","import { Component, h, Host, Listen, Prop, State, Event, EventEmitter, VNode, Method } from '@stencil/core';\nimport { FilterType } from './filter.service';\nimport { RevoGrid } from '../../interfaces';\nimport { AndOrButton, isFilterBtn, TrashButton } from './filter.button';\nimport { RevoButton } from '../../components/button/button';\nimport '../../utils/closestPolifill';\nimport { LogicFunction } from './filter.types';\nimport { FilterCaptions } from './filter.plugin';\nimport debounce from 'lodash/debounce';\n\n/**\n * @typedef FilterItem\n * @type {object}\n * @property {ColumnProp} prop - column id\n * @property {FilterType} type - filter type definition\n * @property {any} value - value for additional filtering, text value or some id\n */\nexport type FilterItem = {\n prop?: RevoGrid.ColumnProp;\n type?: FilterType;\n value?: any;\n};\n\nexport type FilterData = {\n id: number;\n type: FilterType;\n value?: any;\n relation: 'and' | 'or';\n};\n\nexport type MultiFilterItem = {\n [prop: string]: FilterData[];\n};\n\nexport type ShowData = {\n x: number;\n y: number;\n} & FilterItem;\n\nconst defaultType: FilterType = 'none';\n\nconst FILTER_LIST_CLASS = 'multi-filter-list';\nconst FILTER_LIST_CLASS_ACTION = 'multi-filter-list-action';\n\n@Component({\n tag: 'revogr-filter-panel',\n styleUrl: 'filter.style.scss',\n})\nexport class FilterPanel {\n private filterCaptionsInternal: FilterCaptions = {\n title: 'Filter by condition',\n save: 'Save',\n reset: 'Reset',\n cancel: 'Close',\n };\n @State() isFilterIdSet = false;\n @State() filterId = 0;\n @State() currentFilterId: number = -1;\n @State() currentFilterType: FilterType = defaultType;\n @State() changes: ShowData | undefined;\n @Prop({ mutable: true, reflect: true }) uuid: string;\n @Prop() filterItems: MultiFilterItem = {};\n @Prop() filterTypes: Record<string, string[]> = {};\n @Prop() filterNames: Record<string, string> = {};\n @Prop() filterEntities: Record<string, LogicFunction> = {};\n @Prop() filterCaptions: FilterCaptions | undefined;\n @Prop() disableDynamicFiltering: boolean = false;\n @Event() filterChange: EventEmitter<MultiFilterItem>;\n @Listen('mousedown', { target: 'document' }) onMouseDown(e: MouseEvent): void {\n if (this.changes && !e.defaultPrevented) {\n const el = e.target as HTMLElement;\n if (this.isOutside(el) && !isFilterBtn(el)) {\n this.changes = undefined;\n }\n }\n }\n @Method() async show(newEntity?: ShowData) {\n this.changes = newEntity;\n if (this.changes) {\n this.changes.type = this.changes.type || defaultType;\n }\n }\n\n @Method() async getChanges() {\n return this.changes;\n }\n\n componentWillRender() {\n if (!this.isFilterIdSet) {\n this.isFilterIdSet = true;\n const filterItems = Object.keys(this.filterItems);\n for (const prop of filterItems) {\n // we set the proper filterId so there won't be any conflict when removing filters\n this.filterId += this.filterItems[prop].length;\n }\n }\n }\n\n renderSelectOptions(type: FilterType, isDefaultTypeRemoved = false) {\n const options: VNode[] = [];\n const prop = this.changes?.prop;\n\n if (!isDefaultTypeRemoved) {\n options.push(\n <option selected={this.currentFilterType === defaultType} value={defaultType}>\n {prop && this.filterItems[prop] && this.filterItems[prop].length > 0 ? 'Add more condition...' : this.filterNames[defaultType]}\n </option>,\n );\n }\n\n for (let gIndex in this.filterTypes) {\n options.push(\n ...this.filterTypes[gIndex].map(k => (\n <option value={k} selected={type === k}>\n {this.filterNames[k]}\n </option>\n )),\n );\n options.push(<option disabled></option>);\n }\n return options;\n }\n\n renderExtra(prop: RevoGrid.ColumnProp, index: number) {\n const currentFilter = this.filterItems[prop];\n\n if (!currentFilter) return '';\n\n if (this.filterEntities[currentFilter[index].type].extra !== 'input') return '';\n\n return (\n <input\n id={`filter-input-${currentFilter[index].id}`}\n placeholder=\"Enter value...\"\n type=\"text\"\n value={currentFilter[index].value}\n onInput={this.onUserInput.bind(this, index, prop)}\n onKeyDown={e => this.onKeyDown(e)}\n />\n );\n }\n\n getFilterItemsList() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return '';\n\n const propFilters = this.filterItems[prop] || [];\n return (\n <div key={this.filterId}>\n {propFilters.map((d, index) => {\n let andOrButton;\n\n // hide toggle button if there is only one filter and the last one\n if (index !== this.filterItems[prop].length - 1) {\n andOrButton = (\n <div onClick={() => this.toggleFilterAndOr(d.id)}>\n <AndOrButton isAnd={d.relation === 'and'} />\n </div>\n );\n }\n\n return (\n <div key={d.id} class={FILTER_LIST_CLASS}>\n <div class={{ 'select-input': true }}>\n <select class=\"select-css select-filter\" onChange={e => this.onFilterTypeChange(e, prop, index)}>\n {this.renderSelectOptions(this.filterItems[prop][index].type, true)}\n </select>\n <div class={FILTER_LIST_CLASS_ACTION}>{andOrButton}</div>\n <div onClick={() => this.onRemoveFilter(d.id)}>\n <TrashButton />\n </div>\n </div>\n <div>{this.renderExtra(prop, index)}</div>\n </div>\n );\n })}\n\n {propFilters.length > 0 ? <div class=\"add-filter-divider\"></div> : ''}\n </div>\n );\n }\n\n render() {\n if (!this.changes) {\n return <Host style={{ display: 'none' }}></Host>;\n }\n const style = {\n display: 'block',\n left: `${this.changes.x}px`,\n top: `${this.changes.y}px`,\n };\n\n const capts = Object.assign(this.filterCaptionsInternal, this.filterCaptions);\n\n return (\n <Host style={style}>\n <label>{capts.title}</label>\n <div class=\"filter-holder\">{this.getFilterItemsList()}</div>\n\n <div class=\"add-filter\">\n <select id=\"add-filter\" class=\"select-css\" onChange={e => this.onAddNewFilter(e)}>\n {this.renderSelectOptions(this.currentFilterType)}\n </select>\n </div>\n <div class=\"filter-actions\">\n {this.disableDynamicFiltering &&\n <RevoButton class={{ red: true, save: true }} onClick={() => this.onSave()}>\n {capts.save}\n </RevoButton>\n }\n <RevoButton class={{ red: true, reset: true }} onClick={() => this.onReset()}>\n {capts.reset}\n </RevoButton>\n <RevoButton class={{ light: true, cancel: true }} onClick={() => this.onCancel()}>\n {capts.cancel}\n </RevoButton>\n </div>\n </Host>\n );\n }\n\n private onFilterTypeChange(e: Event, prop: RevoGrid.ColumnProp, index: number) {\n const el = e.target as HTMLSelectElement;\n const type = el.value as FilterType;\n\n this.filterItems[prop][index].type = type;\n\n // this re-renders the input to know if we need extra input\n this.filterId++;\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.filterItems[prop][index].id) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private debouncedApplyFilter = debounce(() => {\n this.filterChange.emit(this.filterItems);\n }, 400);\n\n private onAddNewFilter(e: Event) {\n const el = e.target as HTMLSelectElement;\n const type = el.value as FilterType;\n\n this.currentFilterType = type;\n this.addNewFilterToProp();\n\n // reset value after adding new filter\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n }\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private addNewFilterToProp() {\n const prop = this.changes?.prop;\n if (!(prop || prop === 0)) return;\n\n if (!this.filterItems[prop]) {\n this.filterItems[prop] = [];\n }\n\n if (this.currentFilterType === 'none') return;\n\n this.filterId++;\n this.currentFilterId = this.filterId;\n\n this.filterItems[prop].push({\n id: this.currentFilterId,\n type: this.currentFilterType,\n value: '',\n relation: 'and',\n });\n\n // adding setTimeout will wait for the next tick DOM update then focus on input\n setTimeout(() => {\n const input = document.getElementById('filter-input-' + this.currentFilterId) as HTMLInputElement;\n if (input) input.focus();\n }, 0);\n }\n\n private onUserInput(index: number, prop: RevoGrid.ColumnProp, event: Event) {\n // update the value of the filter item\n this.filterItems[prop][index].value = (event.target as HTMLInputElement).value;\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private onKeyDown(e: KeyboardEvent) {\n if (e.key.toLowerCase() === 'enter') {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) {\n select.value = defaultType;\n this.currentFilterType = defaultType;\n this.addNewFilterToProp();\n select.focus();\n }\n return;\n }\n // keep event local, don't escalate farther to dom\n e.stopPropagation();\n }\n\n private onSave() {\n this.filterChange.emit(this.filterItems);\n }\n\n private onCancel() {\n this.changes = undefined;\n }\n\n private onReset() {\n this.assertChanges();\n\n delete this.filterItems[this.changes.prop];\n\n // this updates the DOM which is used by getFilterItemsList() key\n this.filterId++;\n\n this.filterChange.emit(this.filterItems);\n }\n\n private onRemoveFilter(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes.prop;\n\n const items = this.filterItems[prop];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n items.splice(index, 1);\n\n // let's remove the prop if no more filters so the filter icon will be removed\n if (items.length === 0) delete this.filterItems[prop];\n\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private toggleFilterAndOr(id: number) {\n this.assertChanges();\n\n // this is for reactivity issues for getFilterItemsList()\n this.filterId++;\n\n const prop = this.changes.prop;\n\n const items = this.filterItems[prop];\n if (!items) return;\n\n const index = items.findIndex(d => d.id === id);\n if (index === -1) return;\n\n items[index].relation = items[index].relation === 'and' ? 'or' : 'and';\n if (!this.disableDynamicFiltering) this.debouncedApplyFilter();\n }\n\n private assertChanges() {\n if (!this.changes) {\n throw new Error('Changes required per edit');\n }\n }\n\n private isOutside(e: HTMLElement | null) {\n const select = document.getElementById('add-filter') as HTMLSelectElement;\n if (select) select.value = defaultType;\n\n this.currentFilterType = defaultType;\n this.changes.type = defaultType;\n this.currentFilterId = -1;\n if (e.classList.contains(`[uuid=\"${this.uuid}\"]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,z as f,T as x}from"./index-728bf6e3.js";import{C as w,L as b}from"./localScrollService-884d8952.js";import{n as m,o as E,H as y,l as k}from"./viewport.helpers-c08e729e.js";import{i as S,c as F,a as M,b as j,d as R}from"./keyCodes.utils-c0064460.js";import{d as z}from"./debounce-820b5a8b.js";import{g as O,v as T,V as Z,c as D}from"./events-31272e5e.js";import"./isString-d539060a.js";function U({x:t,y:e},{el:i,rows:s,cols:o}){const{top:n,left:l,height:a,width:h}=i.getBoundingClientRect();let c=e-n;if(c>=a){c=a-1}let C=t-l;if(C>=h){C=h-1}const d=r(s,c);const g=r(o,C);if(g.itemIndex<0){g.itemIndex=0}if(d.itemIndex<0){d.itemIndex=0}return{x:g.itemIndex,y:d.itemIndex}}function A(t,e,i,s=false){const o=o=>{const r={x:t.x,y:t.y};const n=s?{x:t.x1,y:t.y1}:r;const l=n[o]>e[o]?n:r;l[o]+=i[o];return{start:r,end:n}};if(i.x){return o("x")}if(i.y){return o("y")}return null}function B({x:t,y:e},{lastCell:i}){return t>=i.x||e>=i.y}function P({x:t,y:e}){return t<0||e<0}function $(t){return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function _({x:t,y:e,x1:i,y1:s},o,r){const l=n(o,e).start;const a=n(r,t).start;const h=n(o,s).end;const c=n(r,i).end;return{left:a,right:c,top:l,bottom:h,width:c-a,height:h-l}}function H(t,e,i){const s=_(t,e,i);return $(s)}const W=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}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}";const X=class{constructor(i){t(this,i);this.beforeFocusRender=e(this,"before-focus-render",7);this.afterFocus=e(this,"afterfocus",7);this.selectionStore=undefined;this.dimensionRow=undefined;this.dimensionCol=undefined;this.dataStore=undefined;this.colData=undefined;this.colType=undefined;this.rowType=undefined;this.focusTemplate=null}changed(t,e){t===null||t===void 0?void 0:t.scrollIntoView({block:"nearest",inline:"nearest"});const i=l(this.dataStore,e.y);const s=l(this.colData,e.x);this.afterFocus.emit({model:i,column:s})}componentDidRender(){const t=this.selectionStore.get("focus");t&&this.el&&this.changed(this.el,t)}render(){const t=this.selectionStore.get("edit");if(t){return}const e=this.selectionStore.get("focus");if(e){const t=this.beforeFocusRender.emit({range:Object.assign(Object.assign({},e),{x1:e.x,y1:e.y}),rowType:this.rowType,colType:this.colType});if(t.defaultPrevented){return}const{detail:s}=t;const r=H(s.range,this.dimensionRow.state,this.dimensionCol.state);const n=this.focusTemplate&&this.focusTemplate(i,s);return i(o,{class:a,style:r},n)}}get el(){return s(this)}};X.style=W;class I{constructor(t,e){this.store=t;this.config=e;this.store=t}get edited(){return this.store.get("edit")}get focused(){return this.store.get("focus")}get ranged(){return this.store.get("range")}changeRange(t){return this.config.changeRange(t)}focus(t,e=false){if(!t){return false}let i=t;if(e){let t=this.store.get("focus");if(t){return this.config.changeRange(m(t,i))}}return this.config.focus(t,i)}}function K(t){return!!(t===null||t===void 0?void 0:t.closest(`.${h}`))}const V=[F.TAB,F.ARROW_UP,F.ARROW_DOWN,F.ARROW_LEFT,F.ARROW_RIGHT];class N{constructor(t){this.sv=t;this.ctrlDown=false}async keyDown(t,e){if(S(t.keyCode,navigator.platform)){this.ctrlDown=true}if(this.sv.selectionStoreService.edited){switch(t.code){case F.ESCAPE:this.sv.cancelEdit();break}return}if(this.sv.selectionStoreService.ranged&&M(t.code)){this.sv.clearCell();return}if(!this.sv.selectionStoreService.focused){return}if(F.TAB===t.code){this.keyChangeSelection(t,e);return}if(j(t.code)){this.sv.applyEdit();return}if(this.isCopy(t)){return}if(this.isCut(t)){return}if(this.isPaste(t)){this.sv.internalPaste();return}if(this.isAll(t)){if(e){this.selectAll(t)}return}if(R(t.keyCode)){this.sv.applyEdit(t.key);return}if(await this.keyChangeSelection(t,e)){return}}selectAll(t){const e=this.sv.selectionStore.get("range");const i=this.sv.selectionStore.get("focus");if(!e||!i){return}t.preventDefault();this.sv.selectAll()}async keyChangeSelection(t,e){const i=this.changeDirectionKey(t,e);if(!i){return false}await c(C+30);const s=this.sv.selectionStore.get("range");const o=this.sv.selectionStore.get("focus");return this.keyPositionChange(i.changes,s,o,i.isMulti)}keyPositionChange(t,e,i,s=false){if(!e||!i){return false}const o=A(e,i,t,s);if(!o){return false}if(s){const t=this.sv.getData();if(B(o.end,t)||P(o.start)){return false}const e=m(o.start,o.end);return this.sv.range(e)}return this.sv.focusNext(o.start,t)}keyUp(t){if(S(t.keyCode,navigator.platform)){this.ctrlDown=false}}isCut(t){return this.ctrlDown&&t.code==F.X}isCopy(t){return this.ctrlDown&&t.code==F.C}isPaste(t){return this.ctrlDown&&t.code==F.V}isAll(t){return this.ctrlDown&&t.code==F.A}changeDirectionKey(t,e){const i=e&&t.shiftKey;if(V.includes(t.code)){t.preventDefault()}switch(t.code){case F.ARROW_UP:return{changes:{y:-1},isMulti:i};case F.ARROW_DOWN:return{changes:{y:1},isMulti:i};case F.ARROW_LEFT:return{changes:{x:-1},isMulti:i};case F.TAB:case F.ARROW_RIGHT:return{changes:{x:1},isMulti:i}}}}var Y;(function(t){t["selection"]="Selection";t["autoFill"]="AutoFill"})(Y||(Y={}));class q{constructor(t){this.sv=t;this.autoFillType=null;this.autoFillInitial=null;this.autoFillStart=null;this.autoFillLast=null}renderAutofill(t,e){let s;if(t){s=_(t,this.sv.dimensionRow.state,this.sv.dimensionCol.state)}else{s=_(Object.assign(Object.assign({},e),{x1:e.x,y1:e.y}),this.sv.dimensionRow.state,this.sv.dimensionCol.state)}return i("div",{class:{[d]:true,[g]:true},style:{left:`${s.right}px`,top:`${s.bottom}px`},onMouseDown:t=>this.autoFillHandler(t),onTouchStart:t=>this.autoFillHandler(t)})}autoFillHandler(t,e=Y.autoFill){let i=null;if(t.target instanceof Element){i=t.target}if(!i){return}this.selectionStart(i,this.sv.getData(),e);t.preventDefault()}get isAutoFill(){return!!this.autoFillType}selectionMouseMove(t){if(!this.onMouseMoveAutofill){this.onMouseMoveAutofill=z(((t,e)=>this.doAutofillMouseMove(t,e)),5)}if(this.isAutoFill){this.onMouseMoveAutofill(t,this.sv.getData())}}getFocus(){let t=this.sv.selectionStoreService.focused;const e=this.sv.selectionStoreService.ranged;if(!t&&e){t={x:e.x,y:e.y}}return t||null}doAutofillMouseMove(t,e){if(!this.autoFillInitial){return}const i=O(t,"clientX",g);const s=O(t,"clientY",g);if(i===null||s===null){return}const o=U({x:i,y:s},e);if(!this.autoFillLast){if(!this.autoFillLast){this.autoFillLast=this.autoFillStart}}if(B(o,e)){return}this.autoFillLast=o;const r=o.x===this.autoFillInitial.x&&o.y===this.autoFillInitial.y;if(r){this.sv.setTempRange(null)}else{this.sv.setTempRange({area:m(this.autoFillInitial,this.autoFillLast),type:this.autoFillType})}}selectionStart(t,e,i=Y.selection){const{top:s,left:o}=t.getBoundingClientRect();this.autoFillInitial=this.getFocus();this.autoFillType=i;this.autoFillStart=U({x:o,y:s},e)}clearAutoFillSelection(){if(this.autoFillInitial){this.autoFillInitial=this.getFocus();if(this.autoFillType===Y.autoFill){const t=m(this.autoFillInitial,this.autoFillLast);if(t){const{defaultPrevented:e,detail:{range:i}}=this.sv.clearRangeDataApply({range:t});if(!e){this.applyRangeWithData(i)}else{this.sv.setTempRange(null)}}}else{this.applyRangeOnly(this.autoFillInitial,this.autoFillLast)}}this.autoFillType=null;this.autoFillInitial=null;this.autoFillLast=null;this.autoFillStart=null}onRangeApply(t,e){const i={};for(let e in t){i[e]=l(this.sv.dataStore,parseInt(e,10))}const{defaultPrevented:s,detail:o}=this.sv.rangeDataApply({data:t,models:i,type:this.sv.dataStore.get("type")});if(!s){this.sv.columnService.applyRangeData(o.data)}this.sv.setRange(e)}applyRangeWithData(t){const e=this.sv.selectionStoreService.ranged;const i={type:this.sv.dataStore.get("type"),newData:{},mapping:{},newRange:t,oldRange:e};const{mapping:s,changed:o}=this.sv.columnService.getRangeData(i,this.sv.columnService.columns);i.newData=o;i.mapping=s;let r=this.sv.selectionChanged(i);if(r.defaultPrevented){this.sv.setTempRange(null);return}r=this.sv.rangeCopy(i);if(r.defaultPrevented){this.sv.setRange(t);return}this.onRangeApply(i.newData,t)}applyRangeOnly(t,e){if(!t||!e){return}const i=m(t,e);this.sv.setRange(i)}}class G{constructor(t){this.sv=t}renderClipboard(t=false){return i("revogr-clipboard",{readonly:t,onCopyRegion:t=>this.onCopy(t.detail),onClearRegion:()=>this.sv.rangeClear(),ref:t=>this.clipboard=t,onPasteRegion:t=>this.onPaste(t.detail)})}getRegion(){const t=this.sv.selectionStoreService.focused;let e=this.sv.selectionStoreService.ranged;if(!e){e=m(t,t)}return e}onCopy(t){const e=this.getRegion();const i=this.sv.beforeCopy(e);if(i.defaultPrevented){return false}const s=this.sv.rangeCopy(e);this.clipboard.doCopy(t,s);return true}onPaste(t){const e=this.sv.selectionStoreService.focused;const i=this.sv.selectionStoreService.edited!==null;if(!e||i){return}let{changed:s,range:o}=this.sv.columnService.getTransformedDataToApply(e,t);const{defaultPrevented:r}=this.sv.beforePaste(s,o);if(r){return}this.sv.rangeApply(s,o)}}const J=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}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}";const Q=class{constructor(i){t(this,i);this.internalCopy=e(this,"internalCopy",7);this.internalPaste=e(this,"internalPaste",7);this.internalCellEdit=e(this,"internalCellEdit",7);this.beforeFocusCell=e(this,"beforeFocusCell",7);this.setEdit=e(this,"setEdit",7);this.beforeApplyRange=e(this,"before-apply-range",7);this.beforeSetRange=e(this,"before-set-range",7);this.beforeEditRender=e(this,"before-edit-render",7);this.setRange=e(this,"setRange",7);this.selectAll=e(this,"selectall",7);this.cancelEdit=e(this,"cancelEdit",7);this.setTempRange=e(this,"setTempRange",7);this.applyFocus=e(this,"applyFocus",7);this.focusCell=e(this,"focusCell",7);this.beforeRangeDataApply=e(this,"beforeRangeDataApply",7);this.internalSelectionChanged=e(this,"internalSelectionChanged",7);this.beforeRangeCopyApply=e(this,"beforeRangeCopyApply",7);this.internalRangeDataApply=e(this,"internalRangeDataApply",7);this.rangeClipboardCopy=e(this,"rangeClipboardCopy",7);this.rangeClipboardPaste=e(this,"rangeClipboardPaste",7);this.beforeCellSave=e(this,"before-cell-save",7);this.keyboardService=null;this.autoFillService=null;this.clipboardService=null;this.revogrEdit=null;this.readonly=undefined;this.range=undefined;this.canDrag=undefined;this.useClipboard=undefined;this.selectionStore=undefined;this.dimensionRow=undefined;this.dimensionCol=undefined;this.dataStore=undefined;this.colData=undefined;this.lastCell=undefined;this.editors=undefined;this.applyChangesOnClose=false;this.additionalData=undefined;this.isMobileDevice=undefined}onMouseMove(t){if(this.selectionStoreService.focused){this.autoFillService.selectionMouseMove(t)}}onMouseUp(){this.autoFillService.clearAutoFillSelection()}onCellDrag(t){var e;(e=this.orderEditor)===null||e===void 0?void 0:e.dragStart(t.detail)}onKeyUp(t){var e;(e=this.keyboardService)===null||e===void 0?void 0:e.keyUp(t)}onKeyDown(t){var e;if(t.defaultPrevented){return}(e=this.keyboardService)===null||e===void 0?void 0:e.keyDown(t,this.range)}selectionServiceSet(t){this.selectionStoreService=new I(t,{changeRange:t=>this.triggerRangeEvent(t),focus:(t,e)=>this.doFocus(t,e)});this.keyboardService=new N({selectionStoreService:this.selectionStoreService,selectionStore:t,range:t=>this.selectionStoreService.changeRange(t),focusNext:(t,e)=>this.doFocus(t,t,e),applyEdit:t=>{if(this.readonly){return}this.doEdit(t)},cancelEdit:async()=>{await this.revogrEdit.cancel();this.closeEdit()},clearCell:()=>!this.readonly&&this.clearCell(),internalPaste:()=>!this.readonly&&this.internalPaste.emit(),getData:()=>this.getData(),selectAll:()=>this.selectAll.emit()});this.createAutoFillService();this.createClipboardService()}createAutoFillService(){this.autoFillService=new q({selectionStoreService:this.selectionStoreService,dimensionRow:this.dimensionRow,dimensionCol:this.dimensionCol,columnService:this.columnService,dataStore:this.dataStore,clearRangeDataApply:t=>this.beforeRangeDataApply.emit(Object.assign(Object.assign({},t),this.types)),setTempRange:t=>this.setTempRange.emit(t),selectionChanged:t=>this.internalSelectionChanged.emit(t),rangeCopy:t=>this.beforeRangeCopyApply.emit(t),rangeDataApply:t=>this.internalRangeDataApply.emit(t),setRange:t=>this.triggerRangeEvent(t),getData:()=>this.getData()})}columnServiceSet(){var t;(t=this.columnService)===null||t===void 0?void 0:t.destroy();this.columnService=new w(this.dataStore,this.colData);this.createAutoFillService();this.createClipboardService()}createClipboardService(){this.clipboardService=new G({selectionStoreService:this.selectionStoreService,columnService:this.columnService,dataStore:this.dataStore,rangeApply:(t,e)=>this.autoFillService.onRangeApply(t,e),rangeCopy:t=>{if(!t){return undefined}const{data:e,mapping:i}=this.columnService.copyRangeArray(t,this.dataStore);const s=this.rangeClipboardCopy.emit(Object.assign({range:t,data:e,mapping:i},this.types));if(s.defaultPrevented){return undefined}return s.detail.data},rangeClear:()=>!this.readonly&&this.clearCell(),beforeCopy:t=>this.internalCopy.emit(t),beforePaste:(t,e)=>this.rangeClipboardPaste.emit(Object.assign({data:t,range:e},this.types))})}connectedCallback(){this.columnServiceSet();this.selectionServiceSet(this.selectionStore)}disconnectedCallback(){var t;(t=this.columnService)===null||t===void 0?void 0:t.destroy()}renderRange(t){const e=H(t,this.dimensionRow.state,this.dimensionCol.state);return[i("div",{class:L,style:e},this.isMobileDevice&&i("div",{class:"range-handlers"},i("span",{class:g}),i("span",{class:g})))]}renderEditCell(){const t=this.selectionStore.get("edit");if(this.readonly||!t){return null}const e=t.val||this.columnService.getCellData(t.y,t.x);const s=Object.assign(Object.assign({},t),this.columnService.getSaveData(t.y,t.x,e));const o=this.beforeEditRender.emit(Object.assign({range:Object.assign(Object.assign({},t),{x1:t.x,y1:t.y})},this.types));if(o.defaultPrevented){return null}const{detail:{range:r}}=o;const n=H(r,this.dimensionRow.state,this.dimensionCol.state);return i("revogr-edit",{ref:t=>{this.revogrEdit=t},onCellEdit:t=>{const e=this.beforeCellSave.emit(t.detail);if(!e.defaultPrevented){this.cellEdit(e.detail)}if(!e.detail.preventFocus){this.focusNext()}},onCloseEdit:t=>this.closeEdit(t),editCell:s,saveOnClose:this.applyChangesOnClose,column:this.columnService.columns[t.x],editor:this.columnService.getCellEditor(t.y,t.x,this.editors),additionalData:this.additionalData,style:n})}render(){const t=[];const e=this.renderEditCell();if(e){t.push(e)}else{const e=this.selectionStoreService.ranged;const s=this.selectionStoreService.focused;if((e||s)&&this.useClipboard){t.push(this.clipboardService.renderClipboard(this.readonly))}if(e){t.push(...this.renderRange(e))}if(s&&!this.readonly&&this.range){t.push(this.autoFillService.renderAutofill(e,s))}if(this.canDrag){t.push(i("revogr-order-editor",{ref:t=>this.orderEditor=t,dataStore:this.dataStore,dimensionRow:this.dimensionRow,dimensionCol:this.dimensionCol,parent:this.element,onInternalRowDragStart:t=>this.onRowDragStart(t)}))}}return i(o,{class:{mobile:this.isMobileDevice},onDblClick:t=>{if(!t.defaultPrevented){this.doEdit()}},onMouseDown:t=>this.onElementMouseDown(t),onTouchStart:t=>this.onElementMouseDown(t,true)},t,i("slot",{name:"data"}))}doFocus(t,e,i){const{defaultPrevented:s}=this.beforeFocusCell.emit(this.columnService.getSaveData(t.y,t.x));if(s){return false}const o=Object.assign({range:Object.assign(Object.assign({},t),{x1:e.x,y1:e.y}),next:i},this.types);const r=this.applyFocus.emit(o);if(r.defaultPrevented){return false}const{range:n}=r.detail;return!this.focusCell.emit(Object.assign({focus:{x:n.x,y:n.y},end:{x:n.x1,y:n.y1}},r.detail)).defaultPrevented}triggerRangeEvent(t){const e=this.types.rowType;const i=this.beforeApplyRange.emit(Object.assign({range:Object.assign({},t)},this.types));if(i.defaultPrevented){return false}const s=this.columnService.getRangeTransformedToProps(i.detail.range,this.dataStore);let o=this.beforeSetRange.emit(s);o=this.setRange.emit(Object.assign(Object.assign({},i.detail.range),{type:e}));if(o.defaultPrevented){return false}return!o.defaultPrevented}onElementMouseDown(t,e=false){if(K(t.target)){return}const i=this.getData();if(t.defaultPrevented){return}const s=O(t,"clientX");const o=O(t,"clientY");if(s===null||o===null){return}const r=U({x:s,y:o},i);this.selectionStoreService.focus(r,this.range&&t.shiftKey);if(this.range){this.autoFillService.selectionStart(t.target,i);if(!e){t.preventDefault()}else if(T(t.touches[0],g)){t.preventDefault()}}}doEdit(t=""){var e;if(this.canEdit()){const i=this.selectionStore.get("focus");const s=this.columnService.getSaveData(i.y,i.x);(e=this.setEdit)===null||e===void 0?void 0:e.emit(Object.assign(Object.assign({},s),{val:t}))}}closeEdit(t){this.cancelEdit.emit();if(t===null||t===void 0?void 0:t.detail){this.focusNext()}}cellEdit(t){const e=this.columnService.getSaveData(t.rgRow,t.rgCol,t.val);this.internalCellEdit.emit(e)}async focusNext(){const t=await this.keyboardService.keyChangeSelection(new KeyboardEvent("keydown",{code:F.ARROW_DOWN}),this.range);if(!t){this.closeEdit()}}clearCell(){if(this.selectionStoreService.ranged&&!E(this.selectionStoreService.ranged)){const t=this.columnService.getRangeStaticData(this.selectionStoreService.ranged,"");this.autoFillService.onRangeApply(t,this.selectionStoreService.ranged)}else if(this.canEdit()){const t=this.selectionStoreService.focused;const e=this.columnService.getSaveData(t.y,t.x);this.cellEdit({rgRow:t.y,rgCol:t.x,val:"",type:e.type,prop:e.prop})}}onRowDragStart({detail:t}){t.text=this.columnService.getCellData(t.cell.y,t.cell.x)}canEdit(){var t;if(this.readonly){return false}const e=this.selectionStoreService.focused;return e&&!((t=this.columnService)===null||t===void 0?void 0:t.isReadOnly(e.y,e.x))}get types(){return{rowType:this.dataStore.get("type"),colType:this.columnService.type}}getData(){return{el:this.element,rows:this.dimensionRow.state,cols:this.dimensionCol.state,lastCell:this.lastCell}}get element(){return s(this)}static get watchers(){return{selectionStore:["selectionServiceSet"],dimensionRow:["createAutoFillService"],dimensionCol:["createAutoFillService"],dataStore:["columnServiceSet"],colData:["columnServiceSet"]}}};Q.style=J;const tt=t=>(e,{rowIndex:i})=>t+i;const et=class{constructor(i){t(this,i);this.scrollViewport=e(this,"scrollViewport",3);this.elementToScroll=e(this,"elementToScroll",3);this.height=undefined;this.dataPorts=undefined;this.headerProp=undefined;this.uiid=undefined;this.rowClass=undefined;this.resize=undefined;this.rowHeaderColumn=undefined;this.additionalData=undefined}render(){const t=[];const e=new Z("colPinStart");let s=1;for(let o of this.dataPorts){const r=o.dataStore.get("items").length;const n=new u(o.type);n.updateData(o.dataStore.get("source"));const l=new u("colPinStart");const a=Object.assign({cellTemplate:tt(s)},this.rowHeaderColumn);l.updateData([a]);const h=Object.assign(Object.assign({},o),{rowClass:this.rowClass,dataStore:n.store,colData:l.store,viewportCol:e.store,readonly:true,range:false});t.push(i("revogr-data",Object.assign({},h)));s+=r}const r=D(s,this.rowHeaderColumn);e.setViewport({realCount:1,virtualSize:0,items:[{size:r,start:0,end:r,itemIndex:0}]});const n=`${this.uiid}-rowHeaders`;const l={[v]:n,contentHeight:this.height,contentWidth:0,style:{minWidth:`${r}px`},ref:t=>this.elementToScroll.emit(t),onScrollViewport:t=>this.scrollViewport.emit(t.detail)};const a=Object.assign(Object.assign({},this.headerProp),{colData:typeof this.rowHeaderColumn==="object"?[this.rowHeaderColumn]:[],viewportCol:e.store,canResize:false,type:p,parent:n,slot:y});return i(o,{class:{[p]:true},key:p},i("revogr-viewport-scroll",Object.assign({},l),i("revogr-header",Object.assign({},a)),t))}};const it=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}revogr-scroll-virtual[auto-hide]{position:absolute;z-index:100}revogr-scroll-virtual[auto-hide].vertical{right:0;top:0}revogr-scroll-virtual[auto-hide].vertical:hover{min-width:20px}revogr-scroll-virtual[auto-hide].horizontal{bottom:0;left:0}revogr-scroll-virtual[auto-hide].horizontal:hover{min-height:20px}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}";const st=class{constructor(i){t(this,i);this.scrollVirtual=e(this,"scrollVirtual",7);this.scrollSize=0;this.isAutoHide=false;this.autoHideTimeout=0;this.dimension="rgRow";this.viewportStore=undefined;this.dimensionStore=undefined}async setScroll(t){var e;if(this.dimension!==t.dimension){return}(e=this.scrollService)===null||e===void 0?void 0:e.setScroll(t)}async changeScroll(t){if(t.delta){switch(t.dimension){case"rgCol":t.coordinate=this.element.scrollLeft+t.delta;break;case"rgRow":t.coordinate=this.element.scrollTop+t.delta;break}this.setScroll(t)}return t}set size(t){if(this.dimension==="rgRow"){this.element.style.minWidth=`${t}px`;return}this.element.style.minHeight=`${t}px`}get size(){if(this.dimension==="rgRow"){return this.element.clientHeight}return this.element.clientWidth}connectedCallback(){this.scrollService=new b({beforeScroll:t=>this.scrollVirtual.emit(t),afterScroll:t=>{const e=t.dimension==="rgRow"?"scrollTop":"scrollLeft";this.element[e]=t.coordinate}})}disconnectedCallback(){clearTimeout(this.autoHideTimeout)}componentWillLoad(){this.scrollSize=f(document);this.isAutoHide=!this.scrollSize}componentDidRender(){const t=this.dimension==="rgRow"?"scrollHeight":"scrollWidth";if(this.element[t]>this.size){this.size=this.scrollSize}else{this.size=0}this.scrollService.setParams({contentSize:this.dimensionStore.get("realSize"),clientSize:this.size,virtualSize:this.viewportStore.get("virtualSize")},this.dimension)}onScroll(t){var e;let i="scrollLeft";if(this.dimension==="rgRow"){i="scrollTop"}if(this.isAutoHide){this.size=20;this.autoHideTimeout=this.autoHide(this.autoHideTimeout)}const s=t.target;(e=this.scrollService)===null||e===void 0?void 0:e.scroll(s[i]||0,this.dimension)}autoHide(t){clearTimeout(t);return setTimeout((()=>{this.size=0}),6e3)}render(){const t=this.dimension==="rgRow"?"height":"width";return i(o,Object.assign({},{"auto-hide":this.isAutoHide},{onScroll:t=>this.onScroll(t)}),i("div",{style:{[t]:`${this.extContentSize(this.viewportStore.get("virtualSize"),this.dimensionStore.get("realSize"))}px`}}))}extContentSize(t,e){return b.getVirtualContentSize(e,this.size,t)}get element(){return s(this)}};st.style=it;const ot=".revo-drag-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 438 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M421.875,70.40625 C426.432292,70.40625 430.175781,68.9414062 433.105469,66.0117188 C436.035156,63.0820312 437.5,59.3385417 437.5,54.78125 L437.5,54.78125 L437.5,15.71875 C437.5,11.1614583 436.035156,7.41796875 433.105469,4.48828125 C430.175781,1.55859375 426.432292,0.09375 421.875,0.09375 L421.875,0.09375 L15.625,0.09375 C11.0677083,0.09375 7.32421875,1.55859375 4.39453125,4.48828125 C1.46484375,7.41796875 0,11.1614583 0,15.71875 L0,15.71875 L0,54.78125 C0,59.3385417 1.46484375,63.0820312 4.39453125,66.0117188 C7.32421875,68.9414062 11.0677083,70.40625 15.625,70.40625 L15.625,70.40625 L421.875,70.40625 Z M421.875,226.65625 C426.432292,226.65625 430.175781,225.191406 433.105469,222.261719 C436.035156,219.332031 437.5,215.588542 437.5,211.03125 L437.5,211.03125 L437.5,171.96875 C437.5,167.411458 436.035156,163.667969 433.105469,160.738281 C430.175781,157.808594 426.432292,156.34375 421.875,156.34375 L421.875,156.34375 L15.625,156.34375 C11.0677083,156.34375 7.32421875,157.808594 4.39453125,160.738281 C1.46484375,163.667969 0,167.411458 0,171.96875 L0,171.96875 L0,211.03125 C0,215.588542 1.46484375,219.332031 4.39453125,222.261719 C7.32421875,225.191406 11.0677083,226.65625 15.625,226.65625 L15.625,226.65625 L421.875,226.65625 Z M421.875,382.90625 C426.432292,382.90625 430.175781,381.441406 433.105469,378.511719 C436.035156,375.582031 437.5,371.838542 437.5,367.28125 L437.5,367.28125 L437.5,328.21875 C437.5,323.661458 436.035156,319.917969 433.105469,316.988281 C430.175781,314.058594 426.432292,312.59375 421.875,312.59375 L421.875,312.59375 L15.625,312.59375 C11.0677083,312.59375 7.32421875,314.058594 4.39453125,316.988281 C1.46484375,319.917969 0,323.661458 0,328.21875 L0,328.21875 L0,367.28125 C0,371.838542 1.46484375,375.582031 4.39453125,378.511719 C7.32421875,381.441406 11.0677083,382.90625 15.625,382.90625 L15.625,382.90625 L421.875,382.90625 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:7px;background-size:cover;background-repeat:no-repeat}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:34px;line-height:34px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#2ee072;border:1px solid #20d565}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:2px solid #cedefa;line-height:32px;background:none;color:#4876ca;box-shadow:none}.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}";const rt=class{constructor(e){t(this,e);this.onChange=k.throttle((t=>this.doChange(t)),300);this.selectionStore=undefined;this.dimensionRow=undefined;this.dimensionCol=undefined}doChange(t){t===null||t===void 0?void 0:t.scrollIntoView({block:"nearest",inline:"nearest"})}componentDidRender(){if(this.el){this.onChange(this.el)}}render(){const t=this.selectionStore.get("tempRange");const e=this.selectionStore.get("tempRangeType");if(!t){return}let s="bottom";let r="right";const n=this.getRange();if(!n){return}if(t.y<n.y){s="top"}if(t.x<n.x){r="left"}const l=`${r} ${s}`;const a=H(t,this.dimensionRow.state,this.dimensionCol.state);return i(o,{class:{[x]:true,[e||""]:true},style:a,hidden:false},i("div",{class:l,ref:t=>this.el=t}))}getRange(){const t=this.selectionStore.get("range");if(t){return t}const e=this.selectionStore.get("focus");if(!e){return null}return Object.assign(Object.assign({},e),{x1:e.x,y1:e.y})}};rt.style=ot;export{X as revogr_focus,Q as revogr_overlay_selection,et as revogr_row_headers,st as revogr_scroll_virtual,rt as revogr_temp_range};
|
|
5
|
+
//# sourceMappingURL=revogr-focus_5.entry.js.map
|