@revolist/revogrid 4.12.12 → 4.13.2

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.
Files changed (95) hide show
  1. package/dist/cjs/{column.drag.plugin-0ce0b39a.js → column.drag.plugin-0f367fe1.js} +2 -1
  2. package/dist/cjs/column.drag.plugin-0f367fe1.js.map +1 -0
  3. package/dist/cjs/column.service-b59380a3.js.map +1 -1
  4. package/dist/cjs/{sorting.sign-a1e9d97a.js → grouping.row.renderer-d6119ced.js} +6 -6
  5. package/dist/cjs/grouping.row.renderer-d6119ced.js.map +1 -0
  6. package/dist/cjs/index.cjs.js +7 -6
  7. package/dist/cjs/index.cjs.js.map +1 -1
  8. package/dist/cjs/revo-grid.cjs.entry.js +2 -2
  9. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  10. package/dist/cjs/revogr-data_4.cjs.entry.js +5 -5
  11. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  12. package/dist/cjs/revogr-filter-panel.cjs.entry.js +1 -1
  13. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  14. package/dist/collection/components/revoGrid/revo-grid-style.css +109 -197
  15. package/dist/collection/plugins/filter/filter.style.css +12 -25
  16. package/dist/collection/plugins/sorting/sorting.plugin.js +2 -0
  17. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  18. package/dist/collection/store/selection/selection.store.js.map +1 -1
  19. package/dist/esm/{column.drag.plugin-017c4fb3.js → column.drag.plugin-d201beb7.js} +2 -2
  20. package/dist/esm/{column.drag.plugin-017c4fb3.js.map → column.drag.plugin-d201beb7.js.map} +1 -1
  21. package/dist/esm/column.service-f39c0a1d.js.map +1 -1
  22. package/dist/esm/{sorting.sign-c02e3b12.js → grouping.row.renderer-95f32c6b.js} +6 -6
  23. package/dist/esm/grouping.row.renderer-95f32c6b.js.map +1 -0
  24. package/dist/esm/index.js +3 -3
  25. package/dist/esm/revo-grid.entry.js +2 -2
  26. package/dist/esm/revo-grid.entry.js.map +1 -1
  27. package/dist/esm/revogr-data_4.entry.js +1 -1
  28. package/dist/esm/revogr-filter-panel.entry.js +1 -1
  29. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  30. package/dist/revo-grid/app-globals-6b929fd8.js +8 -1
  31. package/dist/revo-grid/app-globals-6b929fd8.js.map +1 -1
  32. package/dist/revo-grid/column.drag.plugin-d201beb7.js +2522 -0
  33. package/dist/revo-grid/column.drag.plugin-d201beb7.js.map +1 -0
  34. package/dist/revo-grid/column.service-f39c0a1d.js +1293 -1
  35. package/dist/revo-grid/column.service-f39c0a1d.js.map +1 -1
  36. package/dist/revo-grid/debounce-b3166f78.js +491 -1
  37. package/dist/revo-grid/debounce-b3166f78.js.map +1 -1
  38. package/dist/revo-grid/dimension.helpers-5567e424.js +3608 -1
  39. package/dist/revo-grid/dimension.helpers-5567e424.js.map +1 -1
  40. package/dist/revo-grid/edit.utils-b59306be.js +13 -1
  41. package/dist/revo-grid/edit.utils-b59306be.js.map +1 -1
  42. package/dist/revo-grid/events-cf0893a3.js +38 -1
  43. package/dist/revo-grid/events-cf0893a3.js.map +1 -1
  44. package/dist/revo-grid/filter.button-84396156.js +34 -1
  45. package/dist/revo-grid/filter.button-84396156.js.map +1 -1
  46. package/dist/revo-grid/grouping.row.renderer-95f32c6b.js +65 -0
  47. package/dist/revo-grid/grouping.row.renderer-95f32c6b.js.map +1 -0
  48. package/dist/revo-grid/header-cell-renderer-31f53644.js +335 -1
  49. package/dist/revo-grid/header-cell-renderer-31f53644.js.map +1 -1
  50. package/dist/revo-grid/index-f6fae858.js +2090 -2
  51. package/dist/revo-grid/index-f6fae858.js.map +1 -1
  52. package/dist/revo-grid/index.esm.js +160 -1
  53. package/dist/revo-grid/index.esm.js.map +1 -1
  54. package/dist/revo-grid/key.utils-3632161b.js +85 -1
  55. package/dist/revo-grid/key.utils-3632161b.js.map +1 -1
  56. package/dist/revo-grid/resize-observer-83c9e167.js +501 -1
  57. package/dist/revo-grid/resize-observer-83c9e167.js.map +1 -1
  58. package/dist/revo-grid/revo-grid.entry.js +1943 -1
  59. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  60. package/dist/revo-grid/revo-grid.esm.js +21 -1
  61. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  62. package/dist/revo-grid/revogr-attribution_7.entry.js +1446 -1
  63. package/dist/revo-grid/revogr-attribution_7.entry.js.map +1 -1
  64. package/dist/revo-grid/revogr-clipboard_3.entry.js +455 -1
  65. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  66. package/dist/revo-grid/revogr-data_4.entry.js +960 -1
  67. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  68. package/dist/revo-grid/revogr-filter-panel.entry.js +340 -1
  69. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  70. package/dist/revo-grid/text-editor-e47e56c3.js +74 -1
  71. package/dist/revo-grid/text-editor-e47e56c3.js.map +1 -1
  72. package/dist/revo-grid/throttle-dec28f5b.js +229 -1
  73. package/dist/revo-grid/throttle-dec28f5b.js.map +1 -1
  74. package/dist/revo-grid/viewport.helpers-7e7f9dad.js +48 -1
  75. package/dist/revo-grid/viewport.helpers-7e7f9dad.js.map +1 -1
  76. package/dist/revo-grid/viewport.store-c18a25a6.js +402 -1
  77. package/dist/revo-grid/viewport.store-c18a25a6.js.map +1 -1
  78. package/dist/types/plugins/sorting/sorting.plugin.d.ts +2 -0
  79. package/dist/types/store/selection/selection.store.d.ts +1 -1
  80. package/hydrate/index.js +7 -7
  81. package/hydrate/index.mjs +7 -7
  82. package/package.json +1 -1
  83. package/standalone/column.service.js.map +1 -1
  84. package/standalone/index.js +1 -1
  85. package/standalone/revo-grid.js +2 -2
  86. package/standalone/revo-grid.js.map +1 -1
  87. package/standalone/revogr-filter-panel.js +1 -1
  88. package/standalone/revogr-filter-panel.js.map +1 -1
  89. package/dist/cjs/column.drag.plugin-0ce0b39a.js.map +0 -1
  90. package/dist/cjs/sorting.sign-a1e9d97a.js.map +0 -1
  91. package/dist/esm/sorting.sign-c02e3b12.js.map +0 -1
  92. package/dist/revo-grid/column.drag.plugin-017c4fb3.js +0 -5
  93. package/dist/revo-grid/column.drag.plugin-017c4fb3.js.map +0 -1
  94. package/dist/revo-grid/sorting.sign-c02e3b12.js +0 -5
  95. package/dist/revo-grid/sorting.sign-c02e3b12.js.map +0 -1
@@ -1,5 +1,17 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import{N as o}from"./dimension.helpers-5567e424.js";function n(n){return!!(n===null||n===void 0?void 0:n.closest(`.${o}`))}function e(o){return typeof o==="function"&&typeof o.prototype==="object"}export{e as a,n as i};
4
+ import { N as EDIT_INPUT_WR } from './dimension.helpers-5567e424.js';
5
+
6
+ // is edit input
7
+ function isEditInput(el) {
8
+ return !!(el === null || el === void 0 ? void 0 : el.closest(`.${EDIT_INPUT_WR}`));
9
+ }
10
+ // Type guard for EditorCtrConstructible
11
+ function isEditorCtrConstructible(editor) {
12
+ return typeof editor === 'function' && typeof editor.prototype === 'object';
13
+ }
14
+
15
+ export { isEditorCtrConstructible as a, isEditInput as i };
16
+
5
17
  //# sourceMappingURL=edit.utils-b59306be.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isEditInput","el","closest","EDIT_INPUT_WR","isEditorCtrConstructible","editor","prototype"],"sources":["src/components/editors/edit.utils.ts"],"sourcesContent":["import { EDIT_INPUT_WR } from '../../utils/consts';\nimport {\n EditorCtrConstructible,\n} from '@type';\n// is edit input\nexport function isEditInput(el?: HTMLElement) {\n return !!el?.closest(`.${EDIT_INPUT_WR}`);\n}\n\n\n// Type guard for EditorCtrConstructible\nexport function isEditorCtrConstructible(\n editor: any,\n): editor is EditorCtrConstructible {\n return typeof editor === 'function' && typeof editor.prototype === 'object';\n}\n"],"mappings":";;;6DAKgBA,EAAYC,GAC1B,SAASA,IAAE,MAAFA,SAAE,SAAFA,EAAIC,QAAQ,IAAIC,KAC3B,C,SAIgBC,EACdC,GAEA,cAAcA,IAAW,mBAAqBA,EAAOC,YAAc,QACrE,Q","ignoreList":[]}
1
+ {"file":"edit.utils-b59306be.js","mappings":";;;;;AAIA;SACgB,WAAW,CAAC,EAAgB;IAC1C,OAAO,CAAC,EAAC,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,OAAO,CAAC,IAAI,aAAa,EAAE,CAAC,CAAA,CAAC;AAC5C,CAAC;AAGD;SACgB,wBAAwB,CACtC,MAAW;IAEX,OAAO,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC;AAC9E;;;;","names":[],"sources":["src/components/editors/edit.utils.ts"],"sourcesContent":["import { EDIT_INPUT_WR } from '../../utils/consts';\nimport {\n EditorCtrConstructible,\n} from '@type';\n// is edit input\nexport function isEditInput(el?: HTMLElement) {\n return !!el?.closest(`.${EDIT_INPUT_WR}`);\n}\n\n\n// Type guard for EditorCtrConstructible\nexport function isEditorCtrConstructible(\n editor: any,\n): editor is EditorCtrConstructible {\n return typeof editor === 'function' && typeof editor.prototype === 'object';\n}\n"],"version":3}
@@ -1,5 +1,42 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- function n(n){return!!n.touches}function r(n,r){if(r&&n){if(!(n.target instanceof Element&&n.target.classList.contains(r))){return false}}return true}function t(t,e,u){if(n(t)){if(t.touches.length>0){const n=t.touches[0];if(!r(n,u)){return null}return n[e]||0}return null}return t[e]||0}export{t as g,r as v};
4
+ function isTouch(e) {
5
+ return !!e.touches;
6
+ }
7
+ function verifyTouchTarget(touchEvent, focusClass) {
8
+ if (focusClass && touchEvent) {
9
+ if (!(touchEvent.target instanceof Element && touchEvent.target.classList.contains(focusClass))) {
10
+ return false;
11
+ }
12
+ }
13
+ return true;
14
+ }
15
+ /**
16
+ * Function to get the value of a specific property from a MouseEvent or TouchEvent object.
17
+ */
18
+ function getPropertyFromEvent(e, prop, focusClass // for touch events
19
+ ) {
20
+ // Check if the event is a touch event
21
+ if (isTouch(e)) {
22
+ // If the event has touches, get the first touch
23
+ if (e.touches.length > 0) {
24
+ const touchEvent = e.touches[0];
25
+ // Check if the target of the touch event is the specified element
26
+ if (!verifyTouchTarget(touchEvent, focusClass)) {
27
+ // If not, return null
28
+ return null;
29
+ }
30
+ // Get the value of the specified property from the touch event and return it
31
+ return touchEvent[prop] || 0;
32
+ }
33
+ // If there are no touches, return null
34
+ return null;
35
+ }
36
+ // If the event is not a touch event, get the value of the specified property from the event and return it
37
+ return e[prop] || 0;
38
+ }
39
+
40
+ export { getPropertyFromEvent as g, verifyTouchTarget as v };
41
+
5
42
  //# sourceMappingURL=events-cf0893a3.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isTouch","e","touches","verifyTouchTarget","touchEvent","focusClass","target","Element","classList","contains","getPropertyFromEvent","prop","length"],"sources":["src/utils/events.ts"],"sourcesContent":["function isTouch(e: MouseEvent | TouchEvent): e is TouchEvent {\n return !!(e as TouchEvent).touches;\n}\n\nexport function verifyTouchTarget(touchEvent?: Touch, focusClass?: string) {\n if (focusClass && touchEvent) {\n if (!(touchEvent.target instanceof Element && touchEvent.target.classList.contains(focusClass))) { \n return false;\n }\n }\n return true;\n}\n\n\n/**\n * Function to get the value of a specific property from a MouseEvent or TouchEvent object.\n */\nexport function getPropertyFromEvent(\n e: MouseEvent | TouchEvent,\n prop: keyof Pick<Touch, 'clientX' | 'clientY' | 'screenX' | 'screenY'>,\n focusClass?: string // for touch events\n): number | null {\n // Check if the event is a touch event\n if (isTouch(e)) {\n // If the event has touches, get the first touch\n if (e.touches.length > 0) {\n const touchEvent = e.touches[0];\n // Check if the target of the touch event is the specified element\n if (!verifyTouchTarget(touchEvent, focusClass)) {\n // If not, return null\n return null;\n }\n // Get the value of the specified property from the touch event and return it\n return (touchEvent[prop] as number) || 0;\n }\n // If there are no touches, return null\n return null;\n }\n // If the event is not a touch event, get the value of the specified property from the event and return it\n return e[prop] || 0;\n}\n"],"m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AAQ,UAAU,CAAC,IAAI,CAAY,IAAI,CAAC,CAAC;SAC1C;;QAED,OAAO,IAAI,CAAC;KACb;;IAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtB;;;;","names":[],"sources":["src/utils/events.ts"],"sourcesContent":["function isTouch(e: MouseEvent | TouchEvent): e is TouchEvent {\n return !!(e as TouchEvent).touches;\n}\n\nexport function verifyTouchTarget(touchEvent?: Touch, focusClass?: string) {\n if (focusClass && touchEvent) {\n if (!(touchEvent.target instanceof Element && touchEvent.target.classList.contains(focusClass))) { \n return false;\n }\n }\n return true;\n}\n\n\n/**\n * Function to get the value of a specific property from a MouseEvent or TouchEvent object.\n */\nexport function getPropertyFromEvent(\n e: MouseEvent | TouchEvent,\n prop: keyof Pick<Touch, 'clientX' | 'clientY' | 'screenX' | 'screenY'>,\n focusClass?: string // for touch events\n): number | null {\n // Check if the event is a touch event\n if (isTouch(e)) {\n // If the event has touches, get the first touch\n if (e.touches.length > 0) {\n const touchEvent = e.touches[0];\n // Check if the target of the touch event is the specified element\n if (!verifyTouchTarget(touchEvent, focusClass)) {\n // If not, return null\n return null;\n }\n // Get the value of the specified property from the touch event and return it\n return (touchEvent[prop] as number) || 0;\n }\n // If there are no touches, return null\n return null;\n }\n // If the event is not a touch event, get the value of the specified property from the event and return it\n return e[prop] || 0;\n}\n"],"version":3}
@@ -1,5 +1,38 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import{h as t}from"./index-f6fae858.js";const s="rv-filter";const o="active";const n="hasFilter";const r="and-or-button";const e="trash-button";const l=({column:r})=>t("span",null,t("button",{class:{[s]:true,[o]:r&&!!r[n]}},t("svg",{class:"filter-img",viewBox:"0 0 64 64"},t("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},t("path",{d:"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z",fill:"currentColor"})))));const a=()=>t("div",{class:{[e]:true}},t("svg",{class:"trash-img",viewBox:"0 0 24 24"},t("path",{fill:"currentColor",d:"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z"})));const i=({text:s})=>t("button",{class:{[r]:true,"light revo-button":true}},s);function c(t){if(t.classList.contains(s)){return true}return t===null||t===void 0?void 0:t.closest(`.${s}`)}export{r as A,s as F,e as T,o as a,n as b,l as c,a as d,i as e,c as i};
4
+ import { h } from './index-f6fae858.js';
5
+
6
+ const FILTER_BUTTON_CLASS = 'rv-filter';
7
+ const FILTER_BUTTON_ACTIVE = 'active';
8
+ const FILTER_PROP = 'hasFilter';
9
+ const AND_OR_BUTTON = 'and-or-button';
10
+ const TRASH_BUTTON = 'trash-button';
11
+ const FilterButton = ({ column }) => {
12
+ return (h("span", null,
13
+ h("button", { class: {
14
+ [FILTER_BUTTON_CLASS]: true,
15
+ [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],
16
+ } },
17
+ h("svg", { class: "filter-img", viewBox: "0 0 64 64" },
18
+ h("g", { stroke: "none", "stroke-width": "1", fill: "none", "fill-rule": "evenodd" },
19
+ h("path", { d: "M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z", fill: "currentColor" }))))));
20
+ };
21
+ const TrashButton = () => {
22
+ return (h("div", { class: { [TRASH_BUTTON]: true } },
23
+ h("svg", { class: "trash-img", viewBox: "0 0 24 24" },
24
+ h("path", { fill: "currentColor", d: "M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" }))));
25
+ };
26
+ const AndOrButton = ({ text }) => {
27
+ return h("button", { class: { [AND_OR_BUTTON]: true, 'light revo-button': true } }, text);
28
+ };
29
+ function isFilterBtn(e) {
30
+ if (e.classList.contains(FILTER_BUTTON_CLASS)) {
31
+ return true;
32
+ }
33
+ return e === null || e === void 0 ? void 0 : e.closest(`.${FILTER_BUTTON_CLASS}`);
34
+ }
35
+
36
+ export { AND_OR_BUTTON as A, FILTER_BUTTON_CLASS as F, TRASH_BUTTON as T, FILTER_BUTTON_ACTIVE as a, FILTER_PROP as b, FilterButton as c, TrashButton as d, AndOrButton as e, isFilterBtn as i };
37
+
5
38
  //# sourceMappingURL=filter.button-84396156.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FILTER_BUTTON_CLASS","FILTER_BUTTON_ACTIVE","FILTER_PROP","AND_OR_BUTTON","TRASH_BUTTON","FilterButton","column","h","class","viewBox","stroke","fill","d","TrashButton","AndOrButton","text","isFilterBtn","e","classList","contains","closest"],"sources":["src/plugins/filter/filter.button.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { ColumnRegular } from '@type';\n\nexport const FILTER_BUTTON_CLASS = 'rv-filter';\nexport const FILTER_BUTTON_ACTIVE = 'active';\n\nexport const FILTER_PROP = 'hasFilter';\nexport const AND_OR_BUTTON = 'and-or-button';\nexport const TRASH_BUTTON = 'trash-button';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const FilterButton = ({ column }: Props) => {\n return (\n <span>\n <button\n class={{\n [FILTER_BUTTON_CLASS]: true,\n [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],\n }}\n >\n <svg class=\"filter-img\" viewBox=\"0 0 64 64\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z\" fill=\"currentColor\"></path>\n </g>\n </svg>\n </button>\n </span>\n );\n};\n\nexport const TrashButton = () => {\n return (\n <div class={{ [TRASH_BUTTON]: true }}>\n <svg class=\"trash-img\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z\" />\n </svg>\n </div>\n );\n};\nexport const AndOrButton = ({ text }: any) => {\n return <button class={{ [AND_OR_BUTTON]: true, 'light revo-button': true }}>{text}</button>;\n};\n\nexport function isFilterBtn(e: HTMLElement) {\n if (e.classList.contains(FILTER_BUTTON_CLASS)) {\n return true;\n }\n return e?.closest(`.${FILTER_BUTTON_CLASS}`);\n}\n"],"mappings":";;;8CAGaA,EAAsB,Y,MACtBC,EAAuB,S,MAEvBC,EAAc,Y,MACdC,EAAgB,gB,MAChBC,EAAe,e,MAKfC,EAAe,EAAGC,YAE3BC,EAAA,YACEA,EAAA,UACEC,MAAO,CACLR,CAACA,GAAsB,KACvBC,CAACA,GAAuBK,KAAYA,EAAOJ,KAG7CK,EAAA,OAAKC,MAAM,aAAaC,QAAQ,aAC9BF,EAAA,KAAGG,OAAO,OAAM,eAAc,IAAIC,KAAK,OAAM,YAAW,WACtDJ,EAAA,QAAMK,EAAE,4GAA4GD,KAAK,qB,MAQxHE,EAAc,IAEvBN,EAAA,OAAKC,MAAO,CAAEJ,CAACA,GAAe,OAC5BG,EAAA,OAAKC,MAAM,YAAYC,QAAQ,aAC7BF,EAAA,QAAMI,KAAK,eAAeC,EAAE,mH,MAKvBE,EAAc,EAAGC,UACrBR,EAAA,UAAQC,MAAO,CAAEL,CAACA,GAAgB,KAAM,oBAAqB,OAASY,G,SAG/DC,EAAYC,GAC1B,GAAIA,EAAEC,UAAUC,SAASnB,GAAsB,CAC7C,OAAO,I,CAET,OAAOiB,IAAC,MAADA,SAAC,SAADA,EAAGG,QAAQ,IAAIpB,IACxB,Q","ignoreList":[]}
1
+ {"file":"filter.button-84396156.js","mappings":";;;;;MAGa,mBAAmB,GAAG,YAAY;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umnRegular } from '@type';\n\nexport const FILTER_BUTTON_CLASS = 'rv-filter';\nexport const FILTER_BUTTON_ACTIVE = 'active';\n\nexport const FILTER_PROP = 'hasFilter';\nexport const AND_OR_BUTTON = 'and-or-button';\nexport const TRASH_BUTTON = 'trash-button';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const FilterButton = ({ column }: Props) => {\n return (\n <span>\n <button\n class={{\n [FILTER_BUTTON_CLASS]: true,\n [FILTER_BUTTON_ACTIVE]: column && !!column[FILTER_PROP],\n }}\n >\n <svg class=\"filter-img\" viewBox=\"0 0 64 64\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <path d=\"M43,48 L43,56 L21,56 L21,48 L43,48 Z M53,28 L53,36 L12,36 L12,28 L53,28 Z M64,8 L64,16 L0,16 L0,8 L64,8 Z\" fill=\"currentColor\"></path>\n </g>\n </svg>\n </button>\n </span>\n );\n};\n\nexport const TrashButton = () => {\n return (\n <div class={{ [TRASH_BUTTON]: true }}>\n <svg class=\"trash-img\" viewBox=\"0 0 24 24\">\n <path fill=\"currentColor\" d=\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z\" />\n </svg>\n </div>\n );\n};\nexport const AndOrButton = ({ text }: any) => {\n return <button class={{ [AND_OR_BUTTON]: true, 'light revo-button': true }}>{text}</button>;\n};\n\nexport function isFilterBtn(e: HTMLElement) {\n if (e.classList.contains(FILTER_BUTTON_CLASS)) {\n return true;\n }\n return e?.closest(`.${FILTER_BUTTON_CLASS}`);\n}\n"],"version":3}
@@ -0,0 +1,65 @@
1
+ /*!
2
+ * Built by Revolist OU ❤️
3
+ */
4
+ import { h } from './index-f6fae858.js';
5
+ import { y as DATA_ROW } from './dimension.helpers-5567e424.js';
6
+ import { k as GROUP_EXPAND_BTN, P as PSEUDO_GROUP_ITEM, f as GROUP_EXPANDED, G as GROUP_DEPTH } from './column.service-f39c0a1d.js';
7
+
8
+ const SortingSign = ({ column }) => {
9
+ var _a;
10
+ return h("i", { class: (_a = column === null || column === void 0 ? void 0 : column.order) !== null && _a !== void 0 ? _a : 'sort-off' });
11
+ };
12
+
13
+ const PADDING_DEPTH = 10;
14
+ const RowRenderer = ({ rowClass, index, size, start, depth }, cells) => {
15
+ const props = Object.assign({ [DATA_ROW]: index });
16
+ return (h("div", Object.assign({}, props, { class: `rgRow ${rowClass || ''}`, style: {
17
+ height: `${size}px`,
18
+ transform: `translateY(${start}px)`,
19
+ paddingLeft: depth ? `${PADDING_DEPTH * depth}px` : undefined,
20
+ } }), cells));
21
+ };
22
+
23
+ function expandEvent(e, model, virtualIndex) {
24
+ var _a;
25
+ const event = new CustomEvent('groupexpandclick', {
26
+ detail: {
27
+ model,
28
+ virtualIndex,
29
+ },
30
+ cancelable: true,
31
+ bubbles: true,
32
+ });
33
+ (_a = e.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
34
+ }
35
+ const GroupingRowRenderer = (props) => {
36
+ const { model, itemIndex, hasExpand, groupingCustomRenderer, providers } = props;
37
+ const name = model[PSEUDO_GROUP_ITEM];
38
+ const expanded = model[GROUP_EXPANDED];
39
+ const depth = parseInt(model[GROUP_DEPTH], 10) || 0;
40
+ if (!hasExpand) {
41
+ return h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }));
42
+ }
43
+ if (groupingCustomRenderer) {
44
+ return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }),
45
+ h("div", { onClick: e => expandEvent(e, model, itemIndex) }, groupingCustomRenderer(h, {
46
+ name,
47
+ model,
48
+ itemIndex,
49
+ expanded,
50
+ depth,
51
+ providers,
52
+ }))));
53
+ }
54
+ return (h(RowRenderer, Object.assign({}, props, { rowClass: "groupingRow", depth: depth }),
55
+ h("button", { class: { [GROUP_EXPAND_BTN]: true }, onClick: e => expandEvent(e, model, itemIndex) }, expandSvgIconVNode(expanded)),
56
+ name));
57
+ };
58
+ const expandSvgIconVNode = (expanded = false) => {
59
+ return (h("svg", { "aria-hidden": "true", style: { transform: `rotate(${!expanded ? -90 : 0}deg)` }, focusable: "false", viewBox: "0 0 448 512" },
60
+ h("path", { fill: "currentColor", d: "M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z" })));
61
+ };
62
+
63
+ export { GroupingRowRenderer as G, PADDING_DEPTH as P, RowRenderer as R, SortingSign as S, expandSvgIconVNode as a, expandEvent as e };
64
+
65
+ //# sourceMappingURL=grouping.row.renderer-95f32c6b.js.map
@@ -0,0 +1 @@
1
+ {"file":"grouping.row.renderer-95f32c6b.js","mappings":";;;;;;;MAMa,WAAW,GAAG,CAAC,EAAE,MAAM,EAAS;;IAC3C,OAAO,SAAG,KAAK,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,UAAU,GAAI,CAAC;AACnD;;MCIa,aAAa,GAAG,GAAG;MAE1B,WAAW,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAY,EAAE,KAAc;IACpF,MAAM,KAAK,iBACN,EAAE,CAAC,QAAQ,GAAG,KAAK,EAAE,CACzB,CAAC;IACF,QACE,2BACM,KAAK,IACT,KAAK,EAAE,SAAS,QAAQ,IAAI,EAAE,EAAE,EAChC,KAAK,EAAE;YACL,MAAM,EAAE,GAAG,IAAI,IAAI;YACnB,SAAS,EAAE,cAAc,KAAK,KAAK;YACnC,WAAW,EAAE,KAAK,GAAG,GAAG,aAAa,GAAG,KAAK,IAAI,GAAG,SAAS;SAC9D,KAEA,KAAK,CACF,EACN;AACJ;;SCZgB,WAA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AAI,EAAE,EACnC,OAAO,EAAE,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,IAE7C,kBAAkB,CAAC,QAAQ,CAAC,CACtB;QACR,IAAI,CACO,EACd;AACJ,EAAE;MAEW,kBAAkB,GAAG,CAAC,QAAQ,GAAG,KAAK;IACjD,QACE,0BACc,MAAM,EAClB,KAAK,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,QAAQ,GAAG,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,EACzD,SAAS,EAAC,OAAO,EACjB,OAAO,EAAC,aAAa;QAErB,YACE,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,yRAAyR,GACrR,CACJ,EACN;AACJ;;;;","names":[],"sources":["src/plugins/sorting/sorting.sign.tsx","src/components/data/row-renderer.tsx","src/plugins/groupingRow/grouping.row.renderer.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { ColumnRegular } from '@type';\n\ntype Props = {\n column: ColumnRegular;\n};\nexport const SortingSign = ({ column }: Props) => {\n return <i class={column?.order ?? 'sort-off'} />;\n};\n","import { h, type VNode } from '@stencil/core';\nimport { JSXBase } from '@stencil/core/internal';\nimport { DATA_ROW } from '../../utils/consts';\n\nexport interface RowProps extends JSXBase.HTMLAttributes {\n size: number;\n start: number;\n index: number;\n rowClass?: string;\n depth?: number;\n}\n\nexport const PADDING_DEPTH = 10;\n\nconst RowRenderer = ({ rowClass, index, size, start, depth }: RowProps, cells: VNode[]) => {\n const props = {\n ...{ [DATA_ROW]: index },\n };\n return (\n <div\n {...props}\n class={`rgRow ${rowClass || ''}`}\n style={{\n height: `${size}px`,\n transform: `translateY(${start}px)`,\n paddingLeft: depth ? `${PADDING_DEPTH * depth}px` : undefined,\n }}\n >\n {cells}\n </div>\n );\n};\n\nexport default RowRenderer;\n","import { h } from '@stencil/core';\nimport RowRenderer, { RowProps } from '../../components/data/row-renderer';\nimport {\n GROUP_DEPTH,\n GROUP_EXPANDED,\n GROUP_EXPAND_BTN,\n PSEUDO_GROUP_ITEM,\n} from './grouping.const';\nimport { GroupLabelTemplateFunc } from './grouping.row.types';\nimport { DataType, PositionItem, Providers } from '@type';\n\ninterface GroupRowPros extends RowProps {\n model: DataType;\n hasExpand: boolean;\n providers: Providers;\n groupingCustomRenderer?: GroupLabelTemplateFunc | null;\n}\nexport type RowGroupingProps = GroupRowPros & PositionItem;\n\nexport function expandEvent(e: MouseEvent, model: DataType, virtualIndex: number) {\n const event = new CustomEvent('groupexpandclick', {\n detail: {\n model,\n virtualIndex,\n },\n cancelable: true,\n bubbles: true,\n }) as CustomEvent<HTMLRevoGridElementEventMap['groupexpandclick']>;\n e.target?.dispatchEvent(event);\n}\n\nexport const GroupingRowRenderer = (props: RowGroupingProps) => {\n const { model, itemIndex, hasExpand, groupingCustomRenderer, providers } =\n props;\n const name = model[PSEUDO_GROUP_ITEM];\n const expanded = model[GROUP_EXPANDED];\n const depth = parseInt(model[GROUP_DEPTH], 10) || 0;\n\n if (!hasExpand) {\n return <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth} />;\n }\n\n if (groupingCustomRenderer) {\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <div onClick={e => expandEvent(e, model, itemIndex)}>\n {groupingCustomRenderer(h, {\n name,\n model,\n itemIndex,\n expanded,\n depth,\n providers,\n })}\n </div>\n </RowRenderer>\n );\n }\n\n return (\n <RowRenderer {...props} rowClass=\"groupingRow\" depth={depth}>\n <button\n class={{ [GROUP_EXPAND_BTN]: true }}\n onClick={e => expandEvent(e, model, itemIndex)}\n >\n {expandSvgIconVNode(expanded)}\n </button>\n {name}\n </RowRenderer>\n );\n};\n\nexport const expandSvgIconVNode = (expanded = false) => {\n return (\n <svg\n aria-hidden=\"true\"\n style={{ transform: `rotate(${!expanded ? -90 : 0}deg)` }}\n focusable=\"false\"\n viewBox=\"0 0 448 512\"\n >\n <path\n fill=\"currentColor\"\n d=\"M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.357-9.357 24.522-9.375 33.901-.04L224 284.505l154.745-154.021c9.379-9.335 24.544-9.317 33.901.04l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.372-24.569 9.372-33.942 0z\"\n ></path>\n </svg>\n );\n};\n\nexport default GroupingRowRenderer;\n"],"version":3}
@@ -1,5 +1,339 @@
1
1
  /*!
2
2
  * Built by Revolist OU ❤️
3
3
  */
4
- import{h as t}from"./index-f6fae858.js";import{J as i}from"./column.service-f39c0a1d.js";function s(t,i,s){const e=new CustomEvent(i,{detail:s,cancelable:true,bubbles:true});t===null||t===void 0?void 0:t.dispatchEvent(e);return e}function e(t,i,e){t.preventDefault();return s(t.target,i,e)}var h;(function(t){t["start"]="resize:start";t["move"]="resize:move";t["end"]="resize:end"})(h||(h={}));const o={"resizable-r":{bit:1,cursor:"ew-resize"},"resizable-rb":{bit:3,cursor:"se-resize"},"resizable-b":{bit:2,cursor:"s-resize"},"resizable-lb":{bit:6,cursor:"sw-resize"},"resizable-l":{bit:4,cursor:"w-resize"},"resizable-lt":{bit:12,cursor:"nw-resize"},"resizable-t":{bit:8,cursor:"n-resize"},"resizable-rt":{bit:9,cursor:"ne-resize"}};const n={l:1,t:2,w:4,h:8};const l=t=>Object.assign(Object.assign({},t),{fitParent:t.fitParent||false,active:t.active||[],disableAttributes:t.disableAttributes||[],minWidth:t.minWidth||0,minHeight:t.minHeight||0});class r{constructor(t,i){var s,e;this.initialProps=t;this.$event=i;this.mouseX=0;this.mouseY=0;this.width=0;this.height=0;this.changeX=0;this.changeY=0;this.disableCalcMap=15;this.props=l(t);this.mouseMoveFunc=this.handleMove.bind(this);this.mouseUpFunc=this.handleUp.bind(this);this.minW=this.props.minWidth;this.minH=this.props.minHeight;this.maxW=(s=this.props.maxWidth)!==null&&s!==void 0?s:0;this.maxH=(e=this.props.maxHeight)!==null&&e!==void 0?e:0;this.parent={width:0,height:0};this.resizeState=0}set(t){this.$el=t;this.props.disableAttributes.forEach((t=>{switch(t){case"l":this.disableCalcMap&=~n.l;break;case"t":this.disableCalcMap&=~n.t;break;case"w":this.disableCalcMap&=~n.w;break;case"h":this.disableCalcMap&=~n.h}}))}emitEvent(t,i){var s;if(!this.$event){return}const e=(s=this.activeResizer)===null||s===void 0?void 0:s.classList.contains("resizable-l");this.$event(Object.assign({eventName:t,width:this.width+this.changeX*(e?-1:1),height:this.height+this.changeY,changedX:this.changeX,changedY:this.changeY},i))}static isTouchEvent(t){var i;const s=t;return((i=s.touches)===null||i===void 0?void 0:i.length)>=0}handleMove(t){var i;if(!this.resizeState){return}let s,e;if(r.isTouchEvent(t)){s=t.touches[0].clientY;e=t.touches[0].clientX}else{s=t.clientY;e=t.clientX}let l=this.resizeState&o["resizable-r"].bit||this.resizeState&o["resizable-l"].bit;let c=this.resizeState&o["resizable-t"].bit||this.resizeState&o["resizable-b"].bit;if(c&&this.disableCalcMap&n.h){let t=s-this.mouseY;let i=this.changeY+t;const e=this.height+i;if(e<this.minH){i=-(this.height-this.minH)}if(this.maxH&&e>this.maxH){i=this.maxH-this.height}this.changeY=i;this.mouseY=s;if(this.activeResizer){this.activeResizer.style.bottom=`${-this.changeY}px`}}if(l&&this.disableCalcMap&n.w){const t=(i=this.activeResizer)===null||i===void 0?void 0:i.classList.contains("resizable-l");let s=e-this.mouseX;let h=this.changeX+s;const o=this.width+h*(t?-1:1);if(o<this.minW){h=-(this.width-this.minW)}if(this.maxW&&o>this.maxW){h=this.maxW-this.width}this.changeX=h;this.mouseX=e;if(this.activeResizer){if(!t){this.activeResizer.style.right=`${-this.changeX}px`}else{this.activeResizer.style.left=`${this.changeX}px`}}}this.emitEvent(h.move)}handleDown(t){if(t.defaultPrevented){return}t.preventDefault();this.dropInitial();for(let i in o){const s=t.target;if(this.$el.contains(s)&&(s===null||s===void 0?void 0:s.classList.contains(i))){document.body.style.cursor=o[i].cursor;if(r.isTouchEvent(t)){this.setInitials(t.touches[0],s)}else{t.preventDefault&&t.preventDefault();this.setInitials(t,s)}this.resizeState=o[i].bit;const e=h.start;this.emitEvent(e);break}}this.bindMove()}handleUp(t){t.preventDefault();if(this.resizeState!==0){this.resizeState=0;document.body.style.cursor="";const t=h.end;this.emitEvent(t)}this.dropInitial();this.unbindMove()}setInitials({clientX:t,clientY:i},s){var e,h,o,l;const r=getComputedStyle(this.$el);this.$el.classList.add("active");this.activeResizer=s;if(this.disableCalcMap&n.w){this.mouseX=t;this.width=this.$el.clientWidth;this.parent.width=(h=(e=this.$el.parentElement)===null||e===void 0?void 0:e.clientWidth)!==null&&h!==void 0?h:0;const i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight);this.minW=Math.max(i,this.initialProps.minWidth||0);if(this.initialProps.maxWidth){this.maxW=Math.max(this.width,this.initialProps.maxWidth)}}if(this.disableCalcMap&n.h){this.mouseY=i;this.height=this.$el.clientHeight;this.parent.height=(l=(o=this.$el.parentElement)===null||o===void 0?void 0:o.clientHeight)!==null&&l!==void 0?l:0;const t=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom);this.minH=Math.max(t,this.initialProps.minHeight||0);if(this.initialProps.maxHeight){this.maxH=Math.max(this.height,this.initialProps.maxHeight)}}}dropInitial(){this.changeX=this.changeY=this.minW=this.minH;this.width=this.height=0;if(this.activeResizer){this.activeResizer.removeAttribute("style")}this.$el.classList.remove("active");this.activeResizer=undefined}bindMove(){document.documentElement.addEventListener("mouseup",this.mouseUpFunc,true);document.documentElement.addEventListener("touchend",this.mouseUpFunc,true);document.documentElement.addEventListener("mousemove",this.mouseMoveFunc,true);document.documentElement.addEventListener("touchmove",this.mouseMoveFunc,true);document.documentElement.addEventListener("mouseleave",this.mouseUpFunc)}unbindMove(){document.documentElement.removeEventListener("mouseup",this.mouseUpFunc,true);document.documentElement.removeEventListener("touchend",this.mouseUpFunc,true);document.documentElement.removeEventListener("mousemove",this.mouseMoveFunc,true);document.documentElement.removeEventListener("touchmove",this.mouseMoveFunc,true);document.documentElement.removeEventListener("mouseleave",this.mouseUpFunc)}}const c=(i,s)=>{const e=[];const o=i.canResize&&new r(i,(t=>{var s;if(t.eventName===h.end){(s=i.onResize)===null||s===void 0?void 0:s.call(i,t)}}))||null;if(i.active){if(i.canResize){for(let s in i.active){e.push(t("div",{onClick:t=>t.preventDefault(),onDblClick:t=>{var s;t.preventDefault();(s=i.onDblClick)===null||s===void 0?void 0:s.call(i,t)},onMouseDown:t=>o===null||o===void 0?void 0:o.handleDown(t),onTouchStart:t=>o===null||o===void 0?void 0:o.handleDown(t),class:`resizable resizable-${i.active[s]}`}))}}else{for(let s in i.active){e.push(t("div",{onClick:t=>t.preventDefault(),onTouchStart:t=>t.preventDefault(),onDblClick:t=>{var s;t.preventDefault();(s=i.onDblClick)===null||s===void 0?void 0:s.call(i,t)},class:`no-resize resizable resizable-${i.active[s]}`}))}}}return t("div",Object.assign({},i,{ref:t=>t&&(o===null||o===void 0?void 0:o.set(t))}),s,e)};const u="columnclick";const a=({data:e,props:h,additionalData:o},n)=>{let l=(e===null||e===void 0?void 0:e.name)||"";let r=h;if(e===null||e===void 0?void 0:e.columnTemplate){l=e.columnTemplate(t,e,o)}if(e===null||e===void 0?void 0:e.columnProperties){const t=e.columnProperties(e);if(t){r=i(h,t)}}const a=Object.assign(Object.assign({},r),{onMouseDown(t){s(t.currentTarget,u,{data:e,event:t})}});return t(c,Object.assign({},a),t("div",{class:"header-content"},l),n)};export{a as H,u as O,e as a,s as d};
4
+ import { h } from './index-f6fae858.js';
5
+ import { J as doPropMerge } from './column.service-f39c0a1d.js';
6
+
7
+ /**
8
+ * Dispatches a custom event to a specified target element.
9
+ *
10
+ * @param target - The target element to dispatch the event to.
11
+ * @param eventName - The name of the custom event.
12
+ * @param detail - Optional. The detail of the custom event.
13
+ * @returns The custom event that was dispatched.
14
+ */
15
+ function dispatch(target, eventName, detail) {
16
+ // Create a new CustomEvent with the specified event name and detail.
17
+ const event = new CustomEvent(eventName, {
18
+ detail,
19
+ cancelable: true, // Indicates whether the event can be canceled.
20
+ bubbles: true, // Indicates whether the event bubbles up through the DOM.
21
+ });
22
+ // Dispatch the event on the target element.
23
+ target === null || target === void 0 ? void 0 : target.dispatchEvent(event);
24
+ // Return the custom event that was dispatched.
25
+ return event;
26
+ }
27
+ /**
28
+ * Dispatches a custom event based on an existing event object and prevents the default behavior of the original event.
29
+ *
30
+ * @param e - The original event object containing the target and preventDefault method.
31
+ * @param eventName - The name of the custom event.
32
+ * @param detail - Optional. The detail of the custom event.
33
+ * @returns The custom event that was dispatched.
34
+ */
35
+ function dispatchByEvent(e, // The original event object containing the target and preventDefault method.
36
+ eventName, // The name of the custom event.
37
+ detail) {
38
+ // Prevent the default behavior of the original event.
39
+ e.preventDefault();
40
+ // Dispatch the custom event to the target element specified in the original event object.
41
+ return dispatch(e.target, eventName, detail);
42
+ }
43
+
44
+ var ResizeEvents;
45
+ (function (ResizeEvents) {
46
+ ResizeEvents["start"] = "resize:start";
47
+ ResizeEvents["move"] = "resize:move";
48
+ ResizeEvents["end"] = "resize:end";
49
+ })(ResizeEvents || (ResizeEvents = {}));
50
+ const RESIZE_MASK = {
51
+ 'resizable-r': { bit: 0b0001, cursor: 'ew-resize' },
52
+ 'resizable-rb': { bit: 0b0011, cursor: 'se-resize' },
53
+ 'resizable-b': { bit: 0b0010, cursor: 's-resize' },
54
+ 'resizable-lb': { bit: 0b0110, cursor: 'sw-resize' },
55
+ 'resizable-l': { bit: 0b0100, cursor: 'w-resize' },
56
+ 'resizable-lt': { bit: 0b1100, cursor: 'nw-resize' },
57
+ 'resizable-t': { bit: 0b1000, cursor: 'n-resize' },
58
+ 'resizable-rt': { bit: 0b1001, cursor: 'ne-resize' },
59
+ };
60
+ const DISABLE_MASK = {
61
+ l: 0b0001,
62
+ t: 0b0010,
63
+ w: 0b0100,
64
+ h: 0b1000,
65
+ };
66
+ const defaultProps = (props) => {
67
+ return Object.assign(Object.assign({}, props), { fitParent: props.fitParent || false, active: props.active || [], disableAttributes: props.disableAttributes || [], minWidth: props.minWidth || 0, minHeight: props.minHeight || 0 });
68
+ };
69
+ class ResizeDirective {
70
+ constructor(initialProps, $event) {
71
+ var _a, _b;
72
+ this.initialProps = initialProps;
73
+ this.$event = $event;
74
+ this.mouseX = 0;
75
+ this.mouseY = 0;
76
+ this.width = 0;
77
+ this.height = 0;
78
+ this.changeX = 0;
79
+ this.changeY = 0;
80
+ this.disableCalcMap = 0b1111;
81
+ this.props = defaultProps(initialProps);
82
+ this.mouseMoveFunc = this.handleMove.bind(this);
83
+ this.mouseUpFunc = this.handleUp.bind(this);
84
+ this.minW = this.props.minWidth;
85
+ this.minH = this.props.minHeight;
86
+ this.maxW = (_a = this.props.maxWidth) !== null && _a !== void 0 ? _a : 0;
87
+ this.maxH = (_b = this.props.maxHeight) !== null && _b !== void 0 ? _b : 0;
88
+ this.parent = { width: 0, height: 0 };
89
+ this.resizeState = 0;
90
+ }
91
+ set($el) {
92
+ this.$el = $el;
93
+ this.props.disableAttributes.forEach(attr => {
94
+ switch (attr) {
95
+ case 'l':
96
+ this.disableCalcMap &= ~DISABLE_MASK.l;
97
+ break;
98
+ case 't':
99
+ this.disableCalcMap &= ~DISABLE_MASK.t;
100
+ break;
101
+ case 'w':
102
+ this.disableCalcMap &= ~DISABLE_MASK.w;
103
+ break;
104
+ case 'h':
105
+ this.disableCalcMap &= ~DISABLE_MASK.h;
106
+ }
107
+ });
108
+ }
109
+ emitEvent(eventName, additionalOptions) {
110
+ var _a;
111
+ if (!this.$event) {
112
+ return;
113
+ }
114
+ const isLeft = (_a = this.activeResizer) === null || _a === void 0 ? void 0 : _a.classList.contains('resizable-l');
115
+ this.$event(Object.assign({ eventName, width: this.width + this.changeX * (isLeft ? -1 : 1), height: this.height + this.changeY, changedX: this.changeX, changedY: this.changeY }, additionalOptions));
116
+ }
117
+ static isTouchEvent(e) {
118
+ var _a;
119
+ const event = e;
120
+ return ((_a = event.touches) === null || _a === void 0 ? void 0 : _a.length) >= 0;
121
+ }
122
+ handleMove(event) {
123
+ var _a;
124
+ if (!this.resizeState) {
125
+ return;
126
+ }
127
+ let eventY, eventX;
128
+ if (ResizeDirective.isTouchEvent(event)) {
129
+ eventY = event.touches[0].clientY;
130
+ eventX = event.touches[0].clientX;
131
+ }
132
+ else {
133
+ eventY = event.clientY;
134
+ eventX = event.clientX;
135
+ }
136
+ let isX = this.resizeState & RESIZE_MASK['resizable-r'].bit ||
137
+ this.resizeState & RESIZE_MASK['resizable-l'].bit;
138
+ let isY = this.resizeState & RESIZE_MASK['resizable-t'].bit ||
139
+ this.resizeState & RESIZE_MASK['resizable-b'].bit;
140
+ if (isY && this.disableCalcMap & DISABLE_MASK.h) {
141
+ let diffY = eventY - this.mouseY;
142
+ let changedY = this.changeY + diffY;
143
+ const newHeight = this.height + changedY;
144
+ // if overcrossed min height
145
+ if (newHeight < this.minH) {
146
+ changedY = -(this.height - this.minH);
147
+ }
148
+ // if overcrossed max heiht
149
+ if (this.maxH && newHeight > this.maxH) {
150
+ changedY = this.maxH - this.height;
151
+ }
152
+ this.changeY = changedY;
153
+ this.mouseY = eventY;
154
+ if (this.activeResizer) {
155
+ this.activeResizer.style.bottom = `${-this.changeY}px`;
156
+ }
157
+ }
158
+ if (isX && this.disableCalcMap & DISABLE_MASK.w) {
159
+ const isLeft = (_a = this.activeResizer) === null || _a === void 0 ? void 0 : _a.classList.contains('resizable-l');
160
+ let diffX = eventX - this.mouseX;
161
+ let changedX = this.changeX + diffX;
162
+ const newWidth = this.width + changedX * (isLeft ? -1 : 1);
163
+ // if overcrossed min width
164
+ if (newWidth < this.minW) {
165
+ changedX = -(this.width - this.minW);
166
+ }
167
+ // if overcrossed max width
168
+ if (this.maxW && newWidth > this.maxW) {
169
+ changedX = this.maxW - this.width;
170
+ }
171
+ this.changeX = changedX;
172
+ this.mouseX = eventX;
173
+ if (this.activeResizer) {
174
+ if (!isLeft) {
175
+ this.activeResizer.style.right = `${-this.changeX}px`;
176
+ }
177
+ else {
178
+ this.activeResizer.style.left = `${this.changeX}px`;
179
+ }
180
+ }
181
+ }
182
+ this.emitEvent(ResizeEvents.move);
183
+ }
184
+ handleDown(event) {
185
+ if (event.defaultPrevented) {
186
+ return;
187
+ }
188
+ // stop other events if resize in progress
189
+ event.preventDefault();
190
+ this.dropInitial();
191
+ for (let elClass in RESIZE_MASK) {
192
+ const target = event.target;
193
+ if (this.$el.contains(target) && (target === null || target === void 0 ? void 0 : target.classList.contains(elClass))) {
194
+ document.body.style.cursor = RESIZE_MASK[elClass].cursor;
195
+ if (ResizeDirective.isTouchEvent(event)) {
196
+ this.setInitials(event.touches[0], target);
197
+ }
198
+ else {
199
+ event.preventDefault && event.preventDefault();
200
+ this.setInitials(event, target);
201
+ }
202
+ this.resizeState = RESIZE_MASK[elClass].bit;
203
+ const eventName = ResizeEvents.start;
204
+ this.emitEvent(eventName);
205
+ break;
206
+ }
207
+ }
208
+ this.bindMove();
209
+ }
210
+ handleUp(e) {
211
+ e.preventDefault();
212
+ if (this.resizeState !== 0) {
213
+ this.resizeState = 0;
214
+ document.body.style.cursor = '';
215
+ const eventName = ResizeEvents.end;
216
+ this.emitEvent(eventName);
217
+ }
218
+ this.dropInitial();
219
+ this.unbindMove();
220
+ }
221
+ setInitials({ clientX, clientY }, target) {
222
+ var _a, _b, _c, _d;
223
+ const computedStyle = getComputedStyle(this.$el);
224
+ this.$el.classList.add('active');
225
+ this.activeResizer = target;
226
+ if (this.disableCalcMap & DISABLE_MASK.w) {
227
+ this.mouseX = clientX;
228
+ this.width = this.$el.clientWidth;
229
+ this.parent.width = (_b = (_a = this.$el.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
230
+ // min width
231
+ const minPaddingX = parseFloat(computedStyle.paddingLeft) +
232
+ parseFloat(computedStyle.paddingRight);
233
+ this.minW = Math.max(minPaddingX, this.initialProps.minWidth || 0);
234
+ // max width
235
+ if (this.initialProps.maxWidth) {
236
+ this.maxW = Math.max(this.width, this.initialProps.maxWidth);
237
+ }
238
+ }
239
+ if (this.disableCalcMap & DISABLE_MASK.h) {
240
+ this.mouseY = clientY;
241
+ this.height = this.$el.clientHeight;
242
+ this.parent.height = (_d = (_c = this.$el.parentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
243
+ // min height
244
+ const minPaddingY = parseFloat(computedStyle.paddingTop) +
245
+ parseFloat(computedStyle.paddingBottom);
246
+ this.minH = Math.max(minPaddingY, this.initialProps.minHeight || 0);
247
+ // max height
248
+ if (this.initialProps.maxHeight) {
249
+ this.maxH = Math.max(this.height, this.initialProps.maxHeight);
250
+ }
251
+ }
252
+ }
253
+ dropInitial() {
254
+ this.changeX = this.changeY = this.minW = this.minH;
255
+ this.width = this.height = 0;
256
+ if (this.activeResizer) {
257
+ this.activeResizer.removeAttribute('style');
258
+ }
259
+ this.$el.classList.remove('active');
260
+ this.activeResizer = undefined;
261
+ }
262
+ bindMove() {
263
+ document.documentElement.addEventListener('mouseup', this.mouseUpFunc, true);
264
+ document.documentElement.addEventListener('touchend', this.mouseUpFunc, true);
265
+ document.documentElement.addEventListener('mousemove', this.mouseMoveFunc, true);
266
+ document.documentElement.addEventListener('touchmove', this.mouseMoveFunc, true);
267
+ document.documentElement.addEventListener('mouseleave', this.mouseUpFunc);
268
+ }
269
+ unbindMove() {
270
+ document.documentElement.removeEventListener('mouseup', this.mouseUpFunc, true);
271
+ document.documentElement.removeEventListener('touchend', this.mouseUpFunc, true);
272
+ document.documentElement.removeEventListener('mousemove', this.mouseMoveFunc, true);
273
+ document.documentElement.removeEventListener('touchmove', this.mouseMoveFunc, true);
274
+ document.documentElement.removeEventListener('mouseleave', this.mouseUpFunc);
275
+ }
276
+ }
277
+
278
+ const ResizableElement = (props, children) => {
279
+ const resizeEls = [];
280
+ const directive = (props.canResize &&
281
+ new ResizeDirective(props, e => {
282
+ var _a;
283
+ if (e.eventName === ResizeEvents.end) {
284
+ (_a = props.onResize) === null || _a === void 0 ? void 0 : _a.call(props, e);
285
+ }
286
+ })) ||
287
+ null;
288
+ if (props.active) {
289
+ if (props.canResize) {
290
+ for (let p in props.active) {
291
+ resizeEls.push(h("div", { onClick: e => e.preventDefault(), onDblClick: e => {
292
+ var _a;
293
+ e.preventDefault();
294
+ (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
295
+ }, onMouseDown: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), onTouchStart: (e) => directive === null || directive === void 0 ? void 0 : directive.handleDown(e), class: `resizable resizable-${props.active[p]}` }));
296
+ }
297
+ }
298
+ else {
299
+ for (let p in props.active) {
300
+ resizeEls.push(h("div", { onClick: e => e.preventDefault(), onTouchStart: (e) => e.preventDefault(), onDblClick: e => {
301
+ var _a;
302
+ e.preventDefault();
303
+ (_a = props.onDblClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
304
+ }, class: `no-resize resizable resizable-${props.active[p]}` }));
305
+ }
306
+ }
307
+ }
308
+ return (h("div", Object.assign({}, props, { ref: e => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
309
+ children,
310
+ resizeEls));
311
+ };
312
+
313
+ const ON_COLUMN_CLICK = 'columnclick';
314
+ const HeaderCellRenderer = ({ data, props, additionalData }, children) => {
315
+ let colTemplate = (data === null || data === void 0 ? void 0 : data.name) || '';
316
+ let cellProps = props;
317
+ if (data === null || data === void 0 ? void 0 : data.columnTemplate) {
318
+ colTemplate = data.columnTemplate(h, data, additionalData);
319
+ }
320
+ if (data === null || data === void 0 ? void 0 : data.columnProperties) {
321
+ const extra = data.columnProperties(data);
322
+ if (extra) {
323
+ cellProps = doPropMerge(props, extra);
324
+ }
325
+ }
326
+ const resizeProps = Object.assign(Object.assign({}, cellProps), { onMouseDown(e) {
327
+ dispatch(e.currentTarget, ON_COLUMN_CLICK, {
328
+ data,
329
+ event: e,
330
+ });
331
+ } });
332
+ return (h(ResizableElement, Object.assign({}, resizeProps),
333
+ h("div", { class: "header-content" }, colTemplate),
334
+ children));
335
+ };
336
+
337
+ export { HeaderCellRenderer as H, ON_COLUMN_CLICK as O, dispatchByEvent as a, dispatch as d };
338
+
5
339
  //# sourceMappingURL=header-cell-renderer-31f53644.js.map