@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.
Files changed (243) hide show
  1. package/custom-element/columnService.js +1 -1
  2. package/custom-element/consts.js +2 -1
  3. package/custom-element/consts.js.map +1 -1
  4. package/custom-element/localScrollService.js +1 -1
  5. package/custom-element/localScrollService.js.map +1 -1
  6. package/custom-element/revo-grid.js +163 -97
  7. package/custom-element/revo-grid.js.map +1 -1
  8. package/custom-element/revogr-clipboard.js +24 -5
  9. package/custom-element/revogr-clipboard.js.map +1 -1
  10. package/custom-element/revogr-edit2.js +12 -6
  11. package/custom-element/revogr-edit2.js.map +1 -1
  12. package/custom-element/revogr-focus2.js +1 -1
  13. package/custom-element/revogr-focus2.js.map +1 -1
  14. package/custom-element/revogr-header2.js +25 -11
  15. package/custom-element/revogr-header2.js.map +1 -1
  16. package/custom-element/revogr-overlay-selection2.js +99 -32
  17. package/custom-element/revogr-overlay-selection2.js.map +1 -1
  18. package/custom-element/revogr-row-headers2.js +1 -2
  19. package/custom-element/revogr-row-headers2.js.map +1 -1
  20. package/custom-element/revogr-viewport-scroll2.js +39 -6
  21. package/custom-element/revogr-viewport-scroll2.js.map +1 -1
  22. package/dist/cjs/{debounce-525dd66c.js → debounce-f50730b6.js} +1 -38
  23. package/dist/cjs/debounce-f50730b6.js.map +1 -0
  24. package/dist/cjs/dispatcher-20520c70.js +21 -0
  25. package/dist/cjs/dispatcher-20520c70.js.map +1 -0
  26. package/dist/cjs/events-030618fc.js +459 -0
  27. package/dist/cjs/events-030618fc.js.map +1 -0
  28. package/dist/cjs/filter.button-6badec7a.js +44 -0
  29. package/dist/cjs/filter.button-6badec7a.js.map +1 -0
  30. package/dist/cjs/{index-aad39b7b.js → index-ee2ef5ae.js} +96 -36
  31. package/dist/cjs/index-ee2ef5ae.js.map +1 -0
  32. package/dist/cjs/index-effc94b9.js +3944 -0
  33. package/dist/cjs/index-effc94b9.js.map +1 -0
  34. package/dist/cjs/isString-3dde8d95.js +38 -0
  35. package/dist/cjs/isString-3dde8d95.js.map +1 -0
  36. package/dist/cjs/keyCodes.utils-d665ebed.js +271 -0
  37. package/dist/cjs/keyCodes.utils-d665ebed.js.map +1 -0
  38. package/dist/cjs/loader.cjs.js +3 -3
  39. package/dist/cjs/loader.cjs.js.map +1 -1
  40. package/dist/cjs/localScrollService-a81823c5.js +403 -0
  41. package/dist/cjs/localScrollService-a81823c5.js.map +1 -0
  42. package/dist/cjs/revo-grid.cjs.entry.js +3858 -0
  43. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -0
  44. package/dist/cjs/revo-grid.cjs.js +3 -3
  45. package/dist/cjs/revo-grid.cjs.js.map +1 -1
  46. package/dist/cjs/revogr-clipboard.cjs.entry.js +24 -6
  47. package/dist/cjs/revogr-clipboard.cjs.entry.js.map +1 -1
  48. package/dist/cjs/revogr-data_3.cjs.entry.js +1138 -0
  49. package/dist/cjs/revogr-data_3.cjs.entry.js.map +1 -0
  50. package/dist/cjs/revogr-edit_2.cjs.entry.js +325 -0
  51. package/dist/cjs/revogr-edit_2.cjs.entry.js.map +1 -0
  52. package/dist/cjs/revogr-filter-panel.cjs.entry.js +6 -5
  53. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  54. package/dist/cjs/revogr-focus_5.cjs.entry.js +1231 -0
  55. package/dist/cjs/revogr-focus_5.cjs.entry.js.map +1 -0
  56. package/dist/cjs/{revo-grid_11.cjs.entry.js → viewport.helpers-70ccec8f.js} +13978 -25269
  57. package/dist/cjs/viewport.helpers-70ccec8f.js.map +1 -0
  58. package/dist/collection/collection-manifest.json +1 -1
  59. package/dist/collection/components/clipboard/revogr-clipboard.d.ts +6 -2
  60. package/dist/collection/components/clipboard/revogr-clipboard.js +46 -5
  61. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  62. package/dist/collection/components/header/headerCellRenderer.d.ts +2 -1
  63. package/dist/collection/components/header/headerCellRenderer.js +1 -1
  64. package/dist/collection/components/header/headerCellRenderer.js.map +1 -1
  65. package/dist/collection/components/header/headerRenderer.d.ts +2 -2
  66. package/dist/collection/components/header/headerRenderer.js +1 -1
  67. package/dist/collection/components/header/headerRenderer.js.map +1 -1
  68. package/dist/collection/components/header/revogr-header.d.ts +15 -1
  69. package/dist/collection/components/header/revogr-header.js +34 -8
  70. package/dist/collection/components/header/revogr-header.js.map +1 -1
  71. package/dist/collection/components/overlay/autofill.service.d.ts +7 -3
  72. package/dist/collection/components/overlay/autofill.service.js +32 -12
  73. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  74. package/dist/collection/components/overlay/clipboard.service.d.ts +1 -1
  75. package/dist/collection/components/overlay/clipboard.service.js +2 -2
  76. package/dist/collection/components/overlay/clipboard.service.js.map +1 -1
  77. package/dist/collection/components/overlay/keyboard.service.js +2 -6
  78. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  79. package/dist/collection/components/overlay/revogr-edit.d.ts +8 -0
  80. package/dist/collection/components/overlay/revogr-edit.js +34 -9
  81. package/dist/collection/components/overlay/revogr-edit.js.map +1 -1
  82. package/dist/collection/components/overlay/revogr-overlay-selection.d.ts +32 -10
  83. package/dist/collection/components/overlay/revogr-overlay-selection.js +80 -12
  84. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  85. package/dist/collection/components/overlay/revogr-overlay-style.css +71 -4
  86. package/dist/collection/components/revoGrid/revo-grid.d.ts +15 -4
  87. package/dist/collection/components/revoGrid/revo-grid.js +60 -19
  88. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  89. package/dist/collection/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  90. package/dist/collection/components/revoGrid/viewport.scrolling.service.js +26 -4
  91. package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
  92. package/dist/collection/components/revoGrid/viewport.section.d.ts +3 -2
  93. package/dist/collection/components/revoGrid/viewport.section.js +8 -4
  94. package/dist/collection/components/revoGrid/viewport.section.js.map +1 -1
  95. package/dist/collection/components/revoGrid/viewport.service.d.ts +4 -0
  96. package/dist/collection/components/revoGrid/viewport.service.js +15 -3
  97. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  98. package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
  99. package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +3 -0
  100. package/dist/collection/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  101. package/dist/collection/components/scroll/revogr-viewport-scroll.js +64 -9
  102. package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
  103. package/dist/collection/components/selectionFocus/revogr-focus-style.css +1 -1
  104. package/dist/collection/components.d.ts +110 -6
  105. package/dist/collection/interfaces.d.ts +4 -1
  106. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  107. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +2 -2
  108. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
  109. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  110. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js +1 -1
  111. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
  112. package/dist/collection/plugins/sorting/sorting.plugin.d.ts +21 -13
  113. package/dist/collection/plugins/sorting/sorting.plugin.js +77 -70
  114. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  115. package/dist/collection/serve/controller.js +183 -0
  116. package/dist/collection/services/localScrollService.js +1 -1
  117. package/dist/collection/services/localScrollService.js.map +1 -1
  118. package/dist/collection/services/resizable.directive.d.ts +8 -7
  119. package/dist/collection/services/resizable.directive.js +13 -36
  120. package/dist/collection/services/resizable.directive.js.map +1 -1
  121. package/dist/collection/services/resizable.element.d.ts +4 -0
  122. package/dist/collection/services/resizable.element.js +39 -0
  123. package/dist/collection/services/resizable.element.js.map +1 -0
  124. package/dist/collection/stencil-public-runtime.d.ts +1 -0
  125. package/dist/collection/store/viewPort/viewport.store.js +0 -1
  126. package/dist/collection/store/viewPort/viewport.store.js.map +1 -1
  127. package/dist/collection/utils/consts.d.ts +1 -0
  128. package/dist/collection/utils/consts.js +1 -0
  129. package/dist/collection/utils/consts.js.map +1 -1
  130. package/dist/collection/utils/events.d.ts +2 -1
  131. package/dist/collection/utils/events.js +18 -2
  132. package/dist/collection/utils/events.js.map +1 -1
  133. package/dist/collection/utils/mobile.d.ts +1 -0
  134. package/dist/collection/utils/mobile.js +7 -0
  135. package/dist/collection/utils/mobile.js.map +1 -0
  136. package/dist/esm/{debounce-301fd4d2.js → debounce-820b5a8b.js} +2 -34
  137. package/dist/esm/debounce-820b5a8b.js.map +1 -0
  138. package/dist/esm/dispatcher-9e9c0233.js +19 -0
  139. package/dist/esm/dispatcher-9e9c0233.js.map +1 -0
  140. package/dist/esm/events-31272e5e.js +454 -0
  141. package/dist/esm/events-31272e5e.js.map +1 -0
  142. package/dist/esm/filter.button-21ce90ef.js +38 -0
  143. package/dist/esm/filter.button-21ce90ef.js.map +1 -0
  144. package/dist/esm/{index-5e90b19b.js → index-05947c5f.js} +97 -37
  145. package/dist/esm/index-05947c5f.js.map +1 -0
  146. package/dist/esm/index-728bf6e3.js +3889 -0
  147. package/dist/esm/index-728bf6e3.js.map +1 -0
  148. package/dist/esm/isString-d539060a.js +36 -0
  149. package/dist/esm/isString-d539060a.js.map +1 -0
  150. package/dist/esm/keyCodes.utils-c0064460.js +265 -0
  151. package/dist/esm/keyCodes.utils-c0064460.js.map +1 -0
  152. package/dist/esm/loader.js +4 -4
  153. package/dist/esm/loader.js.map +1 -1
  154. package/dist/esm/localScrollService-884d8952.js +400 -0
  155. package/dist/esm/localScrollService-884d8952.js.map +1 -0
  156. package/dist/esm/revo-grid.entry.js +3854 -0
  157. package/dist/esm/revo-grid.entry.js.map +1 -0
  158. package/dist/esm/revo-grid.js +4 -4
  159. package/dist/esm/revo-grid.js.map +1 -1
  160. package/dist/esm/revogr-clipboard.entry.js +24 -6
  161. package/dist/esm/revogr-clipboard.entry.js.map +1 -1
  162. package/dist/esm/revogr-data_3.entry.js +1132 -0
  163. package/dist/esm/revogr-data_3.entry.js.map +1 -0
  164. package/dist/esm/revogr-edit_2.entry.js +320 -0
  165. package/dist/esm/revogr-edit_2.entry.js.map +1 -0
  166. package/dist/esm/revogr-filter-panel.entry.js +3 -2
  167. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  168. package/dist/esm/revogr-focus_5.entry.js +1223 -0
  169. package/dist/esm/revogr-focus_5.entry.js.map +1 -0
  170. package/dist/esm/{revo-grid_11.entry.js → viewport.helpers-c08e729e.js} +13790 -25093
  171. package/dist/esm/viewport.helpers-c08e729e.js.map +1 -0
  172. package/dist/revo-grid/debounce-820b5a8b.js +5 -0
  173. package/dist/revo-grid/debounce-820b5a8b.js.map +1 -0
  174. package/dist/revo-grid/dispatcher-9e9c0233.js +5 -0
  175. package/dist/revo-grid/dispatcher-9e9c0233.js.map +1 -0
  176. package/dist/revo-grid/events-31272e5e.js +5 -0
  177. package/dist/revo-grid/events-31272e5e.js.map +1 -0
  178. package/dist/revo-grid/filter.button-21ce90ef.js +5 -0
  179. package/dist/revo-grid/filter.button-21ce90ef.js.map +1 -0
  180. package/dist/revo-grid/index-05947c5f.js +6 -0
  181. package/dist/revo-grid/index-05947c5f.js.map +1 -0
  182. package/dist/revo-grid/index-728bf6e3.js +5 -0
  183. package/dist/revo-grid/index-728bf6e3.js.map +1 -0
  184. package/dist/revo-grid/isString-d539060a.js +5 -0
  185. package/dist/revo-grid/isString-d539060a.js.map +1 -0
  186. package/dist/revo-grid/keyCodes.utils-c0064460.js +5 -0
  187. package/dist/revo-grid/keyCodes.utils-c0064460.js.map +1 -0
  188. package/dist/revo-grid/localScrollService-884d8952.js +5 -0
  189. package/dist/revo-grid/localScrollService-884d8952.js.map +1 -0
  190. package/dist/revo-grid/revo-grid.entry.js +5 -0
  191. package/dist/revo-grid/revo-grid.entry.js.map +1 -0
  192. package/dist/revo-grid/revo-grid.esm.js +1 -1
  193. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  194. package/dist/revo-grid/revogr-clipboard.entry.js +1 -1
  195. package/dist/revo-grid/revogr-clipboard.entry.js.map +1 -1
  196. package/dist/revo-grid/revogr-data_3.entry.js +5 -0
  197. package/dist/revo-grid/revogr-data_3.entry.js.map +1 -0
  198. package/dist/revo-grid/revogr-edit_2.entry.js +5 -0
  199. package/dist/revo-grid/revogr-edit_2.entry.js.map +1 -0
  200. package/dist/revo-grid/revogr-filter-panel.entry.js +1 -1
  201. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  202. package/dist/revo-grid/revogr-focus_5.entry.js +5 -0
  203. package/dist/revo-grid/revogr-focus_5.entry.js.map +1 -0
  204. package/dist/revo-grid/viewport.helpers-c08e729e.js +5 -0
  205. package/dist/revo-grid/viewport.helpers-c08e729e.js.map +1 -0
  206. package/dist/types/components/clipboard/revogr-clipboard.d.ts +6 -2
  207. package/dist/types/components/header/headerCellRenderer.d.ts +2 -1
  208. package/dist/types/components/header/headerRenderer.d.ts +2 -2
  209. package/dist/types/components/header/revogr-header.d.ts +15 -1
  210. package/dist/types/components/overlay/autofill.service.d.ts +7 -3
  211. package/dist/types/components/overlay/clipboard.service.d.ts +1 -1
  212. package/dist/types/components/overlay/revogr-edit.d.ts +8 -0
  213. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +32 -10
  214. package/dist/types/components/revoGrid/revo-grid.d.ts +15 -4
  215. package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +6 -2
  216. package/dist/types/components/revoGrid/viewport.section.d.ts +3 -2
  217. package/dist/types/components/revoGrid/viewport.service.d.ts +4 -0
  218. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +16 -5
  219. package/dist/types/components.d.ts +110 -6
  220. package/dist/types/interfaces.d.ts +4 -1
  221. package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +3 -2
  222. package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +2 -2
  223. package/dist/types/plugins/sorting/sorting.plugin.d.ts +21 -13
  224. package/dist/types/services/resizable.directive.d.ts +8 -7
  225. package/dist/types/services/resizable.element.d.ts +4 -0
  226. package/dist/types/stencil-public-runtime.d.ts +1 -0
  227. package/dist/types/utils/consts.d.ts +1 -0
  228. package/dist/types/utils/events.d.ts +2 -1
  229. package/dist/types/utils/mobile.d.ts +1 -0
  230. package/package.json +4 -3
  231. package/dist/cjs/debounce-525dd66c.js.map +0 -1
  232. package/dist/cjs/index-aad39b7b.js.map +0 -1
  233. package/dist/cjs/revo-grid_11.cjs.entry.js.map +0 -1
  234. package/dist/esm/debounce-301fd4d2.js.map +0 -1
  235. package/dist/esm/index-5e90b19b.js.map +0 -1
  236. package/dist/esm/revo-grid_11.entry.js.map +0 -1
  237. package/dist/revo-grid/debounce-301fd4d2.js +0 -5
  238. package/dist/revo-grid/debounce-301fd4d2.js.map +0 -1
  239. package/dist/revo-grid/index-5e90b19b.js +0 -6
  240. package/dist/revo-grid/index-5e90b19b.js.map +0 -1
  241. package/dist/revo-grid/revo-grid_11.entry.js +0 -5
  242. package/dist/revo-grid/revo-grid_11.entry.js.map +0 -1
  243. /package/dist/collection/{utilsExternal/generate-data.js → serve/data.js} +0 -0
@@ -0,0 +1,1231 @@
1
+ /*!
2
+ * Built by Revolist
3
+ */
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ const index$1 = require('./index-ee2ef5ae.js');
9
+ const index = require('./index-effc94b9.js');
10
+ const localScrollService = require('./localScrollService-a81823c5.js');
11
+ const viewport_helpers = require('./viewport.helpers-70ccec8f.js');
12
+ const keyCodes_utils = require('./keyCodes.utils-d665ebed.js');
13
+ const debounce = require('./debounce-f50730b6.js');
14
+ const events = require('./events-030618fc.js');
15
+ require('./isString-3dde8d95.js');
16
+
17
+ /** Calculate cell based on x, y position */
18
+ function getCurrentCell({ x, y }, { el, rows, cols }) {
19
+ const { top, left, height, width } = el.getBoundingClientRect();
20
+ let cellY = y - top;
21
+ // limit to element height
22
+ if (cellY >= height) {
23
+ cellY = height - 1;
24
+ }
25
+ let cellX = x - left;
26
+ // limit to element width
27
+ if (cellX >= width) {
28
+ cellX = width - 1;
29
+ }
30
+ const rgRow = index.getItemByPosition(rows, cellY);
31
+ const rgCol = index.getItemByPosition(cols, cellX);
32
+ // before first
33
+ if (rgCol.itemIndex < 0) {
34
+ rgCol.itemIndex = 0;
35
+ }
36
+ // before first
37
+ if (rgRow.itemIndex < 0) {
38
+ rgRow.itemIndex = 0;
39
+ }
40
+ return { x: rgCol.itemIndex, y: rgRow.itemIndex };
41
+ }
42
+ function getCoordinate(range, focus, changes, isMulti = false) {
43
+ const updateCoordinate = (c) => {
44
+ const start = { x: range.x, y: range.y };
45
+ const end = isMulti ? { x: range.x1, y: range.y1 } : start;
46
+ const point = end[c] > focus[c] ? end : start;
47
+ point[c] += changes[c];
48
+ return { start, end };
49
+ };
50
+ if (changes.x) {
51
+ return updateCoordinate('x');
52
+ }
53
+ if (changes.y) {
54
+ return updateCoordinate('y');
55
+ }
56
+ return null;
57
+ }
58
+ /** check if out of range */
59
+ function isAfterLast({ x, y }, { lastCell }) {
60
+ return x >= lastCell.x || y >= lastCell.y;
61
+ }
62
+ /** check if out of range */
63
+ function isBeforeFirst({ x, y }) {
64
+ return x < 0 || y < 0;
65
+ }
66
+ /** Compare cells, only 1 coordinate difference is possible */
67
+ // export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {
68
+ // const c: (keyof Cell)[] = ['x', 'y'];
69
+ // for (let k of c) {
70
+ // if (initial[k] !== last[k]) {
71
+ // return { [k]: 1 };
72
+ // }
73
+ // }
74
+ // return null;
75
+ // }
76
+ // export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {
77
+ // const cell: Partial<Cell> = {};
78
+ // const c: (keyof Cell)[] = ['x', 'y'];
79
+ // for (let k of c) {
80
+ // cell[k] = Math.abs(initial[k] - last[k]);
81
+ // }
82
+ // if (cell.x > cell.y) {
83
+ // return { x: 1 };
84
+ // }
85
+ // if (cell.y > cell.x) {
86
+ // return { y: 1 };
87
+ // }
88
+ // return null;
89
+ // }
90
+ function styleByCellProps(styles) {
91
+ return {
92
+ left: `${styles.left}px`,
93
+ top: `${styles.top}px`,
94
+ width: `${styles.width}px`,
95
+ height: `${styles.height}px`,
96
+ };
97
+ }
98
+ function getCell({ x, y, x1, y1 }, dimensionRow, dimensionCol) {
99
+ const top = index.getItemByIndex(dimensionRow, y).start;
100
+ const left = index.getItemByIndex(dimensionCol, x).start;
101
+ const bottom = index.getItemByIndex(dimensionRow, y1).end;
102
+ const right = index.getItemByIndex(dimensionCol, x1).end;
103
+ return {
104
+ left,
105
+ right,
106
+ top,
107
+ bottom,
108
+ width: right - left,
109
+ height: bottom - top,
110
+ };
111
+ }
112
+ function getElStyle(range, dimensionRow, dimensionCol) {
113
+ const styles = getCell(range, dimensionRow, dimensionCol);
114
+ return styleByCellProps(styles);
115
+ }
116
+
117
+ const revogrFocusStyleCss = ".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}";
118
+
119
+ const RevogrFocus$1 = class {
120
+ constructor(hostRef) {
121
+ index$1.registerInstance(this, hostRef);
122
+ this.beforeFocusRender = index$1.createEvent(this, "before-focus-render", 7);
123
+ this.afterFocus = index$1.createEvent(this, "afterfocus", 7);
124
+ this.selectionStore = undefined;
125
+ this.dimensionRow = undefined;
126
+ this.dimensionCol = undefined;
127
+ this.dataStore = undefined;
128
+ this.colData = undefined;
129
+ this.colType = undefined;
130
+ this.rowType = undefined;
131
+ this.focusTemplate = null;
132
+ }
133
+ changed(e, focus) {
134
+ e === null || e === void 0 ? void 0 : e.scrollIntoView({
135
+ block: 'nearest',
136
+ inline: 'nearest',
137
+ });
138
+ const model = index.getSourceItem(this.dataStore, focus.y);
139
+ const column = index.getSourceItem(this.colData, focus.x);
140
+ this.afterFocus.emit({
141
+ model,
142
+ column
143
+ });
144
+ }
145
+ componentDidRender() {
146
+ const currentFocus = this.selectionStore.get('focus');
147
+ currentFocus && this.el && this.changed(this.el, currentFocus);
148
+ }
149
+ render() {
150
+ const editCell = this.selectionStore.get('edit');
151
+ if (editCell) {
152
+ return;
153
+ }
154
+ const data = this.selectionStore.get('focus');
155
+ if (data) {
156
+ const event = this.beforeFocusRender.emit({
157
+ range: Object.assign(Object.assign({}, data), { x1: data.x, y1: data.y }),
158
+ rowType: this.rowType,
159
+ colType: this.colType,
160
+ });
161
+ if (event.defaultPrevented) {
162
+ return;
163
+ }
164
+ const { detail } = event;
165
+ const style = getElStyle(detail.range, this.dimensionRow.state, this.dimensionCol.state);
166
+ const extra = this.focusTemplate && this.focusTemplate(index$1.h, detail);
167
+ return index$1.h(index$1.Host, { class: index.FOCUS_CLASS, style: style }, extra);
168
+ }
169
+ }
170
+ get el() { return index$1.getElement(this); }
171
+ };
172
+ RevogrFocus$1.style = revogrFocusStyleCss;
173
+
174
+ class SelectionStoreService {
175
+ constructor(store, config) {
176
+ this.store = store;
177
+ this.config = config;
178
+ this.store = store;
179
+ }
180
+ get edited() {
181
+ return this.store.get('edit');
182
+ }
183
+ get focused() {
184
+ return this.store.get('focus');
185
+ }
186
+ get ranged() {
187
+ return this.store.get('range');
188
+ }
189
+ changeRange(range) {
190
+ return this.config.changeRange(range);
191
+ }
192
+ focus(cell, isMulti = false) {
193
+ if (!cell) {
194
+ return false;
195
+ }
196
+ let end = cell;
197
+ // range edit
198
+ if (isMulti) {
199
+ let start = this.store.get('focus');
200
+ if (start) {
201
+ return this.config.changeRange(viewport_helpers.getRange(start, end));
202
+ }
203
+ }
204
+ // single focus
205
+ return this.config.focus(cell, end);
206
+ }
207
+ }
208
+
209
+ // is edit input
210
+ function isEditInput(el) {
211
+ return !!(el === null || el === void 0 ? void 0 : el.closest(`.${index.EDIT_INPUT_WR}`));
212
+ }
213
+
214
+ const DIRECTION_CODES = [
215
+ keyCodes_utils.codesLetter.TAB,
216
+ keyCodes_utils.codesLetter.ARROW_UP,
217
+ keyCodes_utils.codesLetter.ARROW_DOWN,
218
+ keyCodes_utils.codesLetter.ARROW_LEFT,
219
+ keyCodes_utils.codesLetter.ARROW_RIGHT,
220
+ ];
221
+ class KeyboardService {
222
+ constructor(sv) {
223
+ this.sv = sv;
224
+ this.ctrlDown = false;
225
+ }
226
+ async keyDown(e, canRange) {
227
+ if (keyCodes_utils.isCtrlKey(e.keyCode, navigator.platform)) {
228
+ this.ctrlDown = true;
229
+ }
230
+ // IF EDIT MODE
231
+ if (this.sv.selectionStoreService.edited) {
232
+ switch (e.code) {
233
+ case keyCodes_utils.codesLetter.ESCAPE:
234
+ this.sv.cancelEdit();
235
+ break;
236
+ }
237
+ return;
238
+ }
239
+ // IF NOT EDIT MODE
240
+ // pressed clear key
241
+ if (this.sv.selectionStoreService.ranged && keyCodes_utils.isClear(e.code)) {
242
+ this.sv.clearCell();
243
+ return;
244
+ }
245
+ // below works with focus only
246
+ if (!this.sv.selectionStoreService.focused) {
247
+ return;
248
+ }
249
+ // tab key means same as arrow right
250
+ if (keyCodes_utils.codesLetter.TAB === e.code) {
251
+ this.keyChangeSelection(e, canRange);
252
+ return;
253
+ }
254
+ // pressed enter
255
+ if (keyCodes_utils.isEnterKey(e.code)) {
256
+ this.sv.applyEdit();
257
+ return;
258
+ }
259
+ // copy operation
260
+ if (this.isCopy(e)) {
261
+ return;
262
+ }
263
+ // cut operation
264
+ if (this.isCut(e)) {
265
+ return;
266
+ }
267
+ // paste operation
268
+ if (this.isPaste(e)) {
269
+ this.sv.internalPaste();
270
+ return;
271
+ }
272
+ // select all
273
+ if (this.isAll(e)) {
274
+ if (canRange) {
275
+ this.selectAll(e);
276
+ }
277
+ return;
278
+ }
279
+ // pressed letter key
280
+ if (keyCodes_utils.isLetterKey(e.keyCode)) {
281
+ this.sv.applyEdit(e.key);
282
+ return;
283
+ }
284
+ // pressed arrow, change selection position
285
+ if (await this.keyChangeSelection(e, canRange)) {
286
+ return;
287
+ }
288
+ }
289
+ selectAll(e) {
290
+ const range = this.sv.selectionStore.get('range');
291
+ const focus = this.sv.selectionStore.get('focus');
292
+ // if no range or focus - do nothing
293
+ if (!range || !focus) {
294
+ return;
295
+ }
296
+ e.preventDefault();
297
+ this.sv.selectAll();
298
+ }
299
+ async keyChangeSelection(e, canRange) {
300
+ const data = this.changeDirectionKey(e, canRange);
301
+ if (!data) {
302
+ return false;
303
+ }
304
+ // this interval needed for several cases
305
+ // grid could be resized before next click
306
+ // at this case to avoid screen jump we use this interval
307
+ await index.timeout(index.RESIZE_INTERVAL + 30);
308
+ const range = this.sv.selectionStore.get('range');
309
+ const focus = this.sv.selectionStore.get('focus');
310
+ return this.keyPositionChange(data.changes, range, focus, data.isMulti);
311
+ }
312
+ keyPositionChange(changes, range, focus, isMulti = false) {
313
+ if (!range || !focus) {
314
+ return false;
315
+ }
316
+ const data = getCoordinate(range, focus, changes, isMulti);
317
+ if (!data) {
318
+ return false;
319
+ }
320
+ if (isMulti) {
321
+ const eData = this.sv.getData();
322
+ if (isAfterLast(data.end, eData) || isBeforeFirst(data.start)) {
323
+ return false;
324
+ }
325
+ const range = viewport_helpers.getRange(data.start, data.end);
326
+ return this.sv.range(range);
327
+ }
328
+ return this.sv.focusNext(data.start, changes);
329
+ }
330
+ keyUp(e) {
331
+ if (keyCodes_utils.isCtrlKey(e.keyCode, navigator.platform)) {
332
+ this.ctrlDown = false;
333
+ }
334
+ }
335
+ isCut(e) {
336
+ return this.ctrlDown && e.code == keyCodes_utils.codesLetter.X;
337
+ }
338
+ isCopy(e) {
339
+ return this.ctrlDown && e.code == keyCodes_utils.codesLetter.C;
340
+ }
341
+ isPaste(e) {
342
+ return this.ctrlDown && e.code == keyCodes_utils.codesLetter.V;
343
+ }
344
+ isAll(e) {
345
+ return this.ctrlDown && e.code == keyCodes_utils.codesLetter.A;
346
+ }
347
+ /** Monitor key direction changes */
348
+ changeDirectionKey(e, canRange) {
349
+ const isMulti = canRange && e.shiftKey;
350
+ if (DIRECTION_CODES.includes(e.code)) {
351
+ e.preventDefault();
352
+ }
353
+ switch (e.code) {
354
+ case keyCodes_utils.codesLetter.ARROW_UP:
355
+ return { changes: { y: -1 }, isMulti };
356
+ case keyCodes_utils.codesLetter.ARROW_DOWN:
357
+ return { changes: { y: 1 }, isMulti };
358
+ case keyCodes_utils.codesLetter.ARROW_LEFT:
359
+ return { changes: { x: -1 }, isMulti };
360
+ case keyCodes_utils.codesLetter.TAB:
361
+ case keyCodes_utils.codesLetter.ARROW_RIGHT:
362
+ return { changes: { x: 1 }, isMulti };
363
+ }
364
+ }
365
+ }
366
+
367
+ var AutoFillType;
368
+ (function (AutoFillType) {
369
+ AutoFillType["selection"] = "Selection";
370
+ AutoFillType["autoFill"] = "AutoFill";
371
+ })(AutoFillType || (AutoFillType = {}));
372
+ class AutoFillService {
373
+ constructor(sv) {
374
+ this.sv = sv;
375
+ this.autoFillType = null;
376
+ this.autoFillInitial = null;
377
+ this.autoFillStart = null;
378
+ this.autoFillLast = null;
379
+ }
380
+ /**
381
+ * Render autofill box
382
+ * @param range
383
+ * @param selectionFocus
384
+ */
385
+ renderAutofill(range, selectionFocus) {
386
+ let handlerStyle;
387
+ if (range) {
388
+ handlerStyle = getCell(range, this.sv.dimensionRow.state, this.sv.dimensionCol.state);
389
+ }
390
+ else {
391
+ handlerStyle = getCell(Object.assign(Object.assign({}, selectionFocus), { x1: selectionFocus.x, y1: selectionFocus.y }), this.sv.dimensionRow.state, this.sv.dimensionCol.state);
392
+ }
393
+ return (index$1.h("div", { class: {
394
+ [index.CELL_HANDLER_CLASS]: true,
395
+ [index.MOBILE_CLASS]: true,
396
+ }, style: { left: `${handlerStyle.right}px`, top: `${handlerStyle.bottom}px` }, onMouseDown: (e) => this.autoFillHandler(e), onTouchStart: (e) => this.autoFillHandler(e) }));
397
+ }
398
+ autoFillHandler(e, type = AutoFillType.autoFill) {
399
+ let target = null;
400
+ if (e.target instanceof Element) {
401
+ target = e.target;
402
+ }
403
+ if (!target) {
404
+ return;
405
+ }
406
+ this.selectionStart(target, this.sv.getData(), type);
407
+ e.preventDefault();
408
+ }
409
+ get isAutoFill() {
410
+ return !!this.autoFillType;
411
+ }
412
+ /** Process mouse move events */
413
+ selectionMouseMove(e) {
414
+ // initiate mouse move debounce if not present
415
+ if (!this.onMouseMoveAutofill) {
416
+ this.onMouseMoveAutofill = debounce.debounce_1((e, data) => this.doAutofillMouseMove(e, data), 5);
417
+ }
418
+ if (this.isAutoFill) {
419
+ this.onMouseMoveAutofill(e, this.sv.getData());
420
+ }
421
+ }
422
+ getFocus() {
423
+ let focus = this.sv.selectionStoreService.focused;
424
+ const range = this.sv.selectionStoreService.ranged;
425
+ // there was an issue that it was taking last cell from range but focus was out
426
+ if (!focus && range) {
427
+ focus = { x: range.x, y: range.y };
428
+ }
429
+ return focus || null;
430
+ }
431
+ /**
432
+ * Autofill logic:
433
+ * on mouse move apply based on previous direction (if present)
434
+ */
435
+ doAutofillMouseMove(event, data) {
436
+ // if no initial - not started
437
+ if (!this.autoFillInitial) {
438
+ return;
439
+ }
440
+ const x = events.getFromEvent(event, 'clientX', index.MOBILE_CLASS);
441
+ const y = events.getFromEvent(event, 'clientY', index.MOBILE_CLASS);
442
+ // skip touch
443
+ if (x === null || y === null) {
444
+ return;
445
+ }
446
+ const current = getCurrentCell({ x, y }, data);
447
+ // first time or direction equal to start(same as first time)
448
+ if (!this.autoFillLast) {
449
+ if (!this.autoFillLast) {
450
+ this.autoFillLast = this.autoFillStart;
451
+ }
452
+ }
453
+ // check if not the latest, if latest - do nothing
454
+ if (isAfterLast(current, data)) {
455
+ return;
456
+ }
457
+ this.autoFillLast = current;
458
+ const isSame = current.x === this.autoFillInitial.x && current.y === this.autoFillInitial.y;
459
+ // if same as initial - clear
460
+ if (isSame) {
461
+ this.sv.setTempRange(null);
462
+ }
463
+ else {
464
+ this.sv.setTempRange({
465
+ area: viewport_helpers.getRange(this.autoFillInitial, this.autoFillLast),
466
+ type: this.autoFillType,
467
+ });
468
+ }
469
+ }
470
+ /**
471
+ * Range selection started
472
+ * Mode @param type:
473
+ * Can be triggered from MouseDown selection on element
474
+ * Or can be triggered on corner square drag
475
+ */
476
+ selectionStart(target, data, type = AutoFillType.selection) {
477
+ /** Get cell by autofill element */
478
+ const { top, left } = target.getBoundingClientRect();
479
+ this.autoFillInitial = this.getFocus();
480
+ this.autoFillType = type;
481
+ this.autoFillStart = getCurrentCell({ x: left, y: top }, data);
482
+ }
483
+ /**
484
+ * Clear current range selection
485
+ * on mouse up and mouse leave events
486
+ */
487
+ clearAutoFillSelection() {
488
+ // Apply autofill values on mouse up if present
489
+ if (this.autoFillInitial) {
490
+ // Get latest
491
+ this.autoFillInitial = this.getFocus();
492
+ // Apply range data if present
493
+ if (this.autoFillType === AutoFillType.autoFill) {
494
+ const range = viewport_helpers.getRange(this.autoFillInitial, this.autoFillLast);
495
+ if (range) {
496
+ const { defaultPrevented: stopApply, detail: { range: newRange } } = this.sv.clearRangeDataApply({
497
+ range,
498
+ });
499
+ if (!stopApply) {
500
+ this.applyRangeWithData(newRange);
501
+ }
502
+ else {
503
+ // if prevented - clear temp range
504
+ this.sv.setTempRange(null);
505
+ }
506
+ }
507
+ }
508
+ else {
509
+ this.applyRangeOnly(this.autoFillInitial, this.autoFillLast);
510
+ }
511
+ }
512
+ this.autoFillType = null;
513
+ this.autoFillInitial = null;
514
+ this.autoFillLast = null;
515
+ this.autoFillStart = null;
516
+ }
517
+ /** Trigger range apply events and handle responses */
518
+ onRangeApply(data, range) {
519
+ const models = {};
520
+ for (let rowIndex in data) {
521
+ models[rowIndex] = index.getSourceItem(this.sv.dataStore, parseInt(rowIndex, 10));
522
+ }
523
+ const { defaultPrevented: stopRange, detail, } = this.sv.rangeDataApply({
524
+ data,
525
+ models,
526
+ type: this.sv.dataStore.get('type'),
527
+ });
528
+ if (!stopRange) {
529
+ this.sv.columnService.applyRangeData(detail.data);
530
+ }
531
+ this.sv.setRange(range);
532
+ }
533
+ /** Apply range and copy data during range application */
534
+ applyRangeWithData(newRange) {
535
+ const oldRange = this.sv.selectionStoreService.ranged;
536
+ const rangeData = {
537
+ type: this.sv.dataStore.get('type'),
538
+ newData: {},
539
+ mapping: {},
540
+ newRange,
541
+ oldRange,
542
+ };
543
+ const { mapping, changed } = this.sv.columnService.getRangeData(rangeData, this.sv.columnService.columns);
544
+ rangeData.newData = changed;
545
+ rangeData.mapping = mapping;
546
+ let e = this.sv.selectionChanged(rangeData);
547
+ // if default prevented - clear range
548
+ if (e.defaultPrevented) {
549
+ this.sv.setTempRange(null);
550
+ return;
551
+ }
552
+ e = this.sv.rangeCopy(rangeData);
553
+ if (e.defaultPrevented) {
554
+ this.sv.setRange(newRange);
555
+ return;
556
+ }
557
+ this.onRangeApply(rangeData.newData, newRange);
558
+ }
559
+ /**
560
+ * Update range selection only,
561
+ * no data change (mouse selection)
562
+ */
563
+ applyRangeOnly(start, end) {
564
+ // no changes to apply
565
+ if (!start || !end) {
566
+ return;
567
+ }
568
+ const newRange = viewport_helpers.getRange(start, end);
569
+ this.sv.setRange(newRange);
570
+ }
571
+ }
572
+
573
+ class ClipboardService {
574
+ constructor(sv) {
575
+ this.sv = sv;
576
+ }
577
+ renderClipboard(readonly = false) {
578
+ return index$1.h("revogr-clipboard", { readonly: readonly, onCopyRegion: e => this.onCopy(e.detail), onClearRegion: () => this.sv.rangeClear(), ref: e => (this.clipboard = e), onPasteRegion: e => this.onPaste(e.detail) });
579
+ }
580
+ getRegion() {
581
+ const focus = this.sv.selectionStoreService.focused;
582
+ let range = this.sv.selectionStoreService.ranged;
583
+ if (!range) {
584
+ range = viewport_helpers.getRange(focus, focus);
585
+ }
586
+ return range;
587
+ }
588
+ onCopy(e) {
589
+ const range = this.getRegion();
590
+ const canCopyEvent = this.sv.beforeCopy(range);
591
+ if (canCopyEvent.defaultPrevented) {
592
+ return false;
593
+ }
594
+ const data = this.sv.rangeCopy(range);
595
+ this.clipboard.doCopy(e, data);
596
+ return true;
597
+ }
598
+ onPaste(data) {
599
+ const focus = this.sv.selectionStoreService.focused;
600
+ const isEditing = this.sv.selectionStoreService.edited !== null;
601
+ if (!focus || isEditing) {
602
+ return;
603
+ }
604
+ let { changed, range } = this.sv.columnService.getTransformedDataToApply(focus, data);
605
+ const { defaultPrevented: canPaste } = this.sv.beforePaste(changed, range);
606
+ if (canPaste) {
607
+ return;
608
+ }
609
+ this.sv.rangeApply(changed, range);
610
+ }
611
+ }
612
+
613
+ const revogrOverlayStyleCss = ".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}";
614
+
615
+ const OverlaySelection = class {
616
+ constructor(hostRef) {
617
+ index$1.registerInstance(this, hostRef);
618
+ this.internalCopy = index$1.createEvent(this, "internalCopy", 7);
619
+ this.internalPaste = index$1.createEvent(this, "internalPaste", 7);
620
+ this.internalCellEdit = index$1.createEvent(this, "internalCellEdit", 7);
621
+ this.beforeFocusCell = index$1.createEvent(this, "beforeFocusCell", 7);
622
+ this.setEdit = index$1.createEvent(this, "setEdit", 7);
623
+ this.beforeApplyRange = index$1.createEvent(this, "before-apply-range", 7);
624
+ this.beforeSetRange = index$1.createEvent(this, "before-set-range", 7);
625
+ this.beforeEditRender = index$1.createEvent(this, "before-edit-render", 7);
626
+ this.setRange = index$1.createEvent(this, "setRange", 7);
627
+ this.selectAll = index$1.createEvent(this, "selectall", 7);
628
+ this.cancelEdit = index$1.createEvent(this, "cancelEdit", 7);
629
+ this.setTempRange = index$1.createEvent(this, "setTempRange", 7);
630
+ this.applyFocus = index$1.createEvent(this, "applyFocus", 7);
631
+ this.focusCell = index$1.createEvent(this, "focusCell", 7);
632
+ this.beforeRangeDataApply = index$1.createEvent(this, "beforeRangeDataApply", 7);
633
+ this.internalSelectionChanged = index$1.createEvent(this, "internalSelectionChanged", 7);
634
+ this.beforeRangeCopyApply = index$1.createEvent(this, "beforeRangeCopyApply", 7);
635
+ this.internalRangeDataApply = index$1.createEvent(this, "internalRangeDataApply", 7);
636
+ this.rangeClipboardCopy = index$1.createEvent(this, "rangeClipboardCopy", 7);
637
+ this.rangeClipboardPaste = index$1.createEvent(this, "rangeClipboardPaste", 7);
638
+ this.beforeCellSave = index$1.createEvent(this, "before-cell-save", 7);
639
+ this.keyboardService = null;
640
+ this.autoFillService = null;
641
+ this.clipboardService = null;
642
+ this.revogrEdit = null;
643
+ this.readonly = undefined;
644
+ this.range = undefined;
645
+ this.canDrag = undefined;
646
+ this.useClipboard = undefined;
647
+ this.selectionStore = undefined;
648
+ this.dimensionRow = undefined;
649
+ this.dimensionCol = undefined;
650
+ this.dataStore = undefined;
651
+ this.colData = undefined;
652
+ this.lastCell = undefined;
653
+ this.editors = undefined;
654
+ this.applyChangesOnClose = false;
655
+ this.additionalData = undefined;
656
+ this.isMobileDevice = undefined;
657
+ }
658
+ // --------------------------------------------------------------------------
659
+ //
660
+ // Listeners
661
+ //
662
+ // --------------------------------------------------------------------------
663
+ onMouseMove(e) {
664
+ if (this.selectionStoreService.focused) {
665
+ this.autoFillService.selectionMouseMove(e);
666
+ }
667
+ }
668
+ /** Action finished inside of the document */
669
+ /** Pointer left document, clear any active operation */
670
+ onMouseUp() {
671
+ this.autoFillService.clearAutoFillSelection();
672
+ }
673
+ /** Row drag started */
674
+ onCellDrag(e) {
675
+ var _a;
676
+ (_a = this.orderEditor) === null || _a === void 0 ? void 0 : _a.dragStart(e.detail);
677
+ }
678
+ /** Get keyboard down from element */
679
+ onKeyUp(e) {
680
+ var _a;
681
+ (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyUp(e);
682
+ }
683
+ /** Get keyboard down from element */
684
+ onKeyDown(e) {
685
+ var _a;
686
+ if (e.defaultPrevented) {
687
+ return;
688
+ }
689
+ (_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyDown(e, this.range);
690
+ }
691
+ // selection & keyboard
692
+ selectionServiceSet(s) {
693
+ this.selectionStoreService = new SelectionStoreService(s, {
694
+ changeRange: range => this.triggerRangeEvent(range),
695
+ focus: (focus, end) => this.doFocus(focus, end),
696
+ });
697
+ this.keyboardService = new KeyboardService({
698
+ selectionStoreService: this.selectionStoreService,
699
+ selectionStore: s,
700
+ range: r => this.selectionStoreService.changeRange(r),
701
+ focusNext: (f, next) => this.doFocus(f, f, next),
702
+ applyEdit: val => {
703
+ if (this.readonly) {
704
+ return;
705
+ }
706
+ this.doEdit(val);
707
+ },
708
+ cancelEdit: async () => {
709
+ await this.revogrEdit.cancel();
710
+ this.closeEdit();
711
+ },
712
+ clearCell: () => !this.readonly && this.clearCell(),
713
+ internalPaste: () => !this.readonly && this.internalPaste.emit(),
714
+ getData: () => this.getData(),
715
+ selectAll: () => this.selectAll.emit(),
716
+ });
717
+ this.createAutoFillService();
718
+ this.createClipboardService();
719
+ }
720
+ // autofill
721
+ createAutoFillService() {
722
+ this.autoFillService = new AutoFillService({
723
+ selectionStoreService: this.selectionStoreService,
724
+ dimensionRow: this.dimensionRow,
725
+ dimensionCol: this.dimensionCol,
726
+ columnService: this.columnService,
727
+ dataStore: this.dataStore,
728
+ clearRangeDataApply: e => this.beforeRangeDataApply.emit(Object.assign(Object.assign({}, e), this.types)),
729
+ setTempRange: e => this.setTempRange.emit(e),
730
+ selectionChanged: e => this.internalSelectionChanged.emit(e),
731
+ rangeCopy: e => this.beforeRangeCopyApply.emit(e),
732
+ rangeDataApply: e => this.internalRangeDataApply.emit(e),
733
+ setRange: e => this.triggerRangeEvent(e),
734
+ getData: () => this.getData(),
735
+ });
736
+ }
737
+ // columns
738
+ columnServiceSet() {
739
+ var _a;
740
+ (_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
741
+ this.columnService = new localScrollService.ColumnService(this.dataStore, this.colData);
742
+ this.createAutoFillService();
743
+ this.createClipboardService();
744
+ }
745
+ // clipboard
746
+ createClipboardService() {
747
+ this.clipboardService = new ClipboardService({
748
+ selectionStoreService: this.selectionStoreService,
749
+ columnService: this.columnService,
750
+ dataStore: this.dataStore,
751
+ rangeApply: (d, r) => this.autoFillService.onRangeApply(d, r),
752
+ rangeCopy: range => {
753
+ if (!range) {
754
+ return undefined;
755
+ }
756
+ const { data, mapping } = this.columnService.copyRangeArray(range, this.dataStore);
757
+ const event = this.rangeClipboardCopy.emit(Object.assign({ range,
758
+ data,
759
+ mapping }, this.types));
760
+ if (event.defaultPrevented) {
761
+ return undefined;
762
+ }
763
+ return event.detail.data;
764
+ },
765
+ rangeClear: () => !this.readonly && this.clearCell(),
766
+ beforeCopy: range => this.internalCopy.emit(range),
767
+ beforePaste: (data, range) => {
768
+ return this.rangeClipboardPaste.emit(Object.assign({ data,
769
+ range }, this.types));
770
+ },
771
+ });
772
+ }
773
+ connectedCallback() {
774
+ this.columnServiceSet();
775
+ this.selectionServiceSet(this.selectionStore);
776
+ }
777
+ disconnectedCallback() {
778
+ var _a;
779
+ (_a = this.columnService) === null || _a === void 0 ? void 0 : _a.destroy();
780
+ }
781
+ renderRange(range) {
782
+ const style = getElStyle(range, this.dimensionRow.state, this.dimensionCol.state);
783
+ return [
784
+ index$1.h("div", { class: index.SELECTION_BORDER_CLASS, style: style }, this.isMobileDevice && index$1.h("div", { class: "range-handlers" }, index$1.h("span", { class: index.MOBILE_CLASS }), index$1.h("span", { class: index.MOBILE_CLASS })))
785
+ ];
786
+ }
787
+ renderEditCell() {
788
+ // if can edit
789
+ const editCell = this.selectionStore.get('edit');
790
+ if (this.readonly || !editCell) {
791
+ return null;
792
+ }
793
+ const val = editCell.val || this.columnService.getCellData(editCell.y, editCell.x);
794
+ const editable = Object.assign(Object.assign({}, editCell), this.columnService.getSaveData(editCell.y, editCell.x, val));
795
+ const renderEvent = this.beforeEditRender.emit(Object.assign({ range: Object.assign(Object.assign({}, editCell), { x1: editCell.x, y1: editCell.y }) }, this.types));
796
+ if (renderEvent.defaultPrevented) {
797
+ return null;
798
+ }
799
+ const { detail: { range }, } = renderEvent;
800
+ const style = getElStyle(range, this.dimensionRow.state, this.dimensionCol.state);
801
+ return (index$1.h("revogr-edit", { ref: el => {
802
+ this.revogrEdit = el;
803
+ }, onCellEdit: e => {
804
+ const saveEv = this.beforeCellSave.emit(e.detail);
805
+ if (!saveEv.defaultPrevented) {
806
+ this.cellEdit(saveEv.detail);
807
+ }
808
+ // if not clear navigate to next cell after edit
809
+ if (!saveEv.detail.preventFocus) {
810
+ this.focusNext();
811
+ }
812
+ }, onCloseEdit: e => this.closeEdit(e), editCell: editable, saveOnClose: this.applyChangesOnClose, column: this.columnService.columns[editCell.x], editor: this.columnService.getCellEditor(editCell.y, editCell.x, this.editors), additionalData: this.additionalData, style: style }));
813
+ }
814
+ render() {
815
+ const els = [];
816
+ const editCell = this.renderEditCell();
817
+ if (editCell) {
818
+ els.push(editCell);
819
+ }
820
+ else {
821
+ const range = this.selectionStoreService.ranged;
822
+ const selectionFocus = this.selectionStoreService.focused;
823
+ if ((range || selectionFocus) && this.useClipboard) {
824
+ els.push(this.clipboardService.renderClipboard(this.readonly));
825
+ }
826
+ if (range) {
827
+ els.push(...this.renderRange(range));
828
+ }
829
+ if (selectionFocus && !this.readonly && this.range) {
830
+ els.push(this.autoFillService.renderAutofill(range, selectionFocus));
831
+ }
832
+ if (this.canDrag) {
833
+ els.push(index$1.h("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, onInternalRowDragStart: e => this.onRowDragStart(e) }));
834
+ }
835
+ }
836
+ return (index$1.h(index$1.Host, { class: { mobile: this.isMobileDevice },
837
+ // run edit on dblclick
838
+ onDblClick: (e) => {
839
+ // if dblclick prevented outside edit will not start
840
+ if (!e.defaultPrevented) {
841
+ this.doEdit();
842
+ }
843
+ }, onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, els, index$1.h("slot", { name: "data" })));
844
+ }
845
+ doFocus(focus, end, next) {
846
+ const { defaultPrevented } = this.beforeFocusCell.emit(this.columnService.getSaveData(focus.y, focus.x));
847
+ if (defaultPrevented) {
848
+ return false;
849
+ }
850
+ const evData = Object.assign({ range: Object.assign(Object.assign({}, focus), { x1: end.x, y1: end.y }), next }, this.types);
851
+ const applyEvent = this.applyFocus.emit(evData);
852
+ if (applyEvent.defaultPrevented) {
853
+ return false;
854
+ }
855
+ const { range } = applyEvent.detail;
856
+ return !this.focusCell.emit(Object.assign({ focus: {
857
+ x: range.x,
858
+ y: range.y,
859
+ }, end: {
860
+ x: range.x1,
861
+ y: range.y1,
862
+ } }, applyEvent.detail)).defaultPrevented;
863
+ }
864
+ triggerRangeEvent(range) {
865
+ const type = this.types.rowType;
866
+ const applyEvent = this.beforeApplyRange.emit(Object.assign({ range: Object.assign({}, range) }, this.types));
867
+ if (applyEvent.defaultPrevented) {
868
+ return false;
869
+ }
870
+ const data = this.columnService.getRangeTransformedToProps(applyEvent.detail.range, this.dataStore);
871
+ let e = this.beforeSetRange.emit(data);
872
+ e = this.setRange.emit(Object.assign(Object.assign({}, applyEvent.detail.range), { type }));
873
+ if (e.defaultPrevented) {
874
+ return false;
875
+ }
876
+ return !e.defaultPrevented;
877
+ }
878
+ onElementMouseDown(e, touch = false) {
879
+ // Ignore focus if clicked input
880
+ if (isEditInput(e.target)) {
881
+ return;
882
+ }
883
+ const data = this.getData();
884
+ if (e.defaultPrevented) {
885
+ return;
886
+ }
887
+ const x = events.getFromEvent(e, 'clientX');
888
+ const y = events.getFromEvent(e, 'clientY');
889
+ // skip touch
890
+ if (x === null || y === null) {
891
+ return;
892
+ }
893
+ // Regular cell click
894
+ const focusCell = getCurrentCell({ x, y }, data);
895
+ this.selectionStoreService.focus(focusCell, this.range && e.shiftKey);
896
+ // Initiate autofill selection
897
+ if (this.range) {
898
+ this.autoFillService.selectionStart(e.target, data);
899
+ if (!touch) {
900
+ e.preventDefault();
901
+ }
902
+ else if (events.verifyTouchTarget(e.touches[0], index.MOBILE_CLASS)) {
903
+ e.preventDefault();
904
+ }
905
+ }
906
+ }
907
+ /**
908
+ * Start cell editing
909
+ */
910
+ doEdit(val = '') {
911
+ var _a;
912
+ if (this.canEdit()) {
913
+ const editCell = this.selectionStore.get('focus');
914
+ const data = this.columnService.getSaveData(editCell.y, editCell.x);
915
+ (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
916
+ }
917
+ }
918
+ /**
919
+ * Close editor event triggered
920
+ * @param details - if requires focus next
921
+ */
922
+ closeEdit(e) {
923
+ this.cancelEdit.emit();
924
+ if (e === null || e === void 0 ? void 0 : e.detail) {
925
+ this.focusNext();
926
+ }
927
+ }
928
+ /** Edit finished, close cell and save */
929
+ cellEdit(e) {
930
+ const dataToSave = this.columnService.getSaveData(e.rgRow, e.rgCol, e.val);
931
+ this.internalCellEdit.emit(dataToSave);
932
+ }
933
+ async focusNext() {
934
+ const canFocus = await this.keyboardService.keyChangeSelection(new KeyboardEvent('keydown', {
935
+ code: keyCodes_utils.codesLetter.ARROW_DOWN,
936
+ }), this.range);
937
+ if (!canFocus) {
938
+ this.closeEdit();
939
+ }
940
+ }
941
+ clearCell() {
942
+ if (this.selectionStoreService.ranged && !viewport_helpers.isRangeSingleCell(this.selectionStoreService.ranged)) {
943
+ const data = this.columnService.getRangeStaticData(this.selectionStoreService.ranged, '');
944
+ this.autoFillService.onRangeApply(data, this.selectionStoreService.ranged);
945
+ }
946
+ else if (this.canEdit()) {
947
+ const focused = this.selectionStoreService.focused;
948
+ const cell = this.columnService.getSaveData(focused.y, focused.x);
949
+ this.cellEdit({
950
+ rgRow: focused.y,
951
+ rgCol: focused.x,
952
+ val: '',
953
+ type: cell.type,
954
+ prop: cell.prop,
955
+ });
956
+ }
957
+ }
958
+ onRowDragStart({ detail }) {
959
+ detail.text = this.columnService.getCellData(detail.cell.y, detail.cell.x);
960
+ }
961
+ /** Check if edit possible */
962
+ canEdit() {
963
+ var _a;
964
+ if (this.readonly) {
965
+ return false;
966
+ }
967
+ const editCell = this.selectionStoreService.focused;
968
+ return editCell && !((_a = this.columnService) === null || _a === void 0 ? void 0 : _a.isReadOnly(editCell.y, editCell.x));
969
+ }
970
+ get types() {
971
+ return {
972
+ rowType: this.dataStore.get('type'),
973
+ colType: this.columnService.type,
974
+ };
975
+ }
976
+ /** Collect data from element */
977
+ getData() {
978
+ return {
979
+ el: this.element,
980
+ rows: this.dimensionRow.state,
981
+ cols: this.dimensionCol.state,
982
+ lastCell: this.lastCell,
983
+ };
984
+ }
985
+ get element() { return index$1.getElement(this); }
986
+ static get watchers() { return {
987
+ "selectionStore": ["selectionServiceSet"],
988
+ "dimensionRow": ["createAutoFillService"],
989
+ "dimensionCol": ["createAutoFillService"],
990
+ "dataStore": ["columnServiceSet"],
991
+ "colData": ["columnServiceSet"]
992
+ }; }
993
+ };
994
+ OverlaySelection.style = revogrOverlayStyleCss;
995
+
996
+ const RowHeaderRender = s => (__, { rowIndex: i }) => s + i;
997
+
998
+ const RevogrRowHeaders = class {
999
+ constructor(hostRef) {
1000
+ index$1.registerInstance(this, hostRef);
1001
+ this.scrollViewport = index$1.createEvent(this, "scrollViewport", 3);
1002
+ this.elementToScroll = index$1.createEvent(this, "elementToScroll", 3);
1003
+ this.height = undefined;
1004
+ this.dataPorts = undefined;
1005
+ this.headerProp = undefined;
1006
+ this.uiid = undefined;
1007
+ this.rowClass = undefined;
1008
+ this.resize = undefined;
1009
+ this.rowHeaderColumn = undefined;
1010
+ this.additionalData = undefined;
1011
+ }
1012
+ render() {
1013
+ const dataViews = [];
1014
+ const viewport = new events.ViewportStore('colPinStart');
1015
+ /** render viewports rows */
1016
+ let totalLength = 1;
1017
+ for (let data of this.dataPorts) {
1018
+ const itemCount = data.dataStore.get('items').length;
1019
+ // initiate row data
1020
+ const dataStore = new index.DataStore(data.type);
1021
+ dataStore.updateData(data.dataStore.get('source'));
1022
+ // initiate column data
1023
+ const colData = new index.DataStore('colPinStart');
1024
+ const column = Object.assign({ cellTemplate: RowHeaderRender(totalLength) }, this.rowHeaderColumn);
1025
+ colData.updateData([column]);
1026
+ const viewData = Object.assign(Object.assign({}, data), { rowClass: this.rowClass, dataStore: dataStore.store, colData: colData.store, viewportCol: viewport.store, readonly: true, range: false });
1027
+ dataViews.push(index$1.h("revogr-data", Object.assign({}, viewData)));
1028
+ totalLength += itemCount;
1029
+ }
1030
+ const colSize = events.calculateRowHeaderSize(totalLength, this.rowHeaderColumn);
1031
+ viewport.setViewport({
1032
+ realCount: 1,
1033
+ virtualSize: 0,
1034
+ items: [
1035
+ {
1036
+ size: colSize,
1037
+ start: 0,
1038
+ end: colSize,
1039
+ itemIndex: 0,
1040
+ },
1041
+ ],
1042
+ });
1043
+ const parent = `${this.uiid}-rowHeaders`;
1044
+ const viewportScroll = {
1045
+ [index.UUID]: parent,
1046
+ contentHeight: this.height,
1047
+ contentWidth: 0,
1048
+ style: { minWidth: `${colSize}px` },
1049
+ ref: (el) => this.elementToScroll.emit(el),
1050
+ onScrollViewport: (e) => this.scrollViewport.emit(e.detail),
1051
+ };
1052
+ const viewportHeader = Object.assign(Object.assign({}, this.headerProp), { colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: index.ROW_HEADER_TYPE, parent, slot: viewport_helpers.HEADER_SLOT });
1053
+ return (index$1.h(index$1.Host, { class: { [index.ROW_HEADER_TYPE]: true }, key: index.ROW_HEADER_TYPE }, index$1.h("revogr-viewport-scroll", Object.assign({}, viewportScroll), index$1.h("revogr-header", Object.assign({}, viewportHeader)), dataViews)));
1054
+ }
1055
+ };
1056
+
1057
+ const revogrScrollStyleCss = ".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}";
1058
+
1059
+ const RevogrScrollVirtual = class {
1060
+ constructor(hostRef) {
1061
+ index$1.registerInstance(this, hostRef);
1062
+ this.scrollVirtual = index$1.createEvent(this, "scrollVirtual", 7);
1063
+ this.scrollSize = 0;
1064
+ this.isAutoHide = false;
1065
+ this.autoHideTimeout = 0;
1066
+ this.dimension = 'rgRow';
1067
+ this.viewportStore = undefined;
1068
+ this.dimensionStore = undefined;
1069
+ }
1070
+ async setScroll(e) {
1071
+ var _a;
1072
+ if (this.dimension !== e.dimension) {
1073
+ return;
1074
+ }
1075
+ (_a = this.scrollService) === null || _a === void 0 ? void 0 : _a.setScroll(e);
1076
+ }
1077
+ // update on delta in case we don't know existing position or external change
1078
+ async changeScroll(e) {
1079
+ if (e.delta) {
1080
+ switch (e.dimension) {
1081
+ case 'rgCol':
1082
+ e.coordinate = this.element.scrollLeft + e.delta;
1083
+ break;
1084
+ case 'rgRow':
1085
+ e.coordinate = this.element.scrollTop + e.delta;
1086
+ break;
1087
+ }
1088
+ this.setScroll(e);
1089
+ }
1090
+ return e;
1091
+ }
1092
+ set size(s) {
1093
+ if (this.dimension === 'rgRow') {
1094
+ this.element.style.minWidth = `${s}px`;
1095
+ return;
1096
+ }
1097
+ this.element.style.minHeight = `${s}px`;
1098
+ }
1099
+ get size() {
1100
+ if (this.dimension === 'rgRow') {
1101
+ return this.element.clientHeight;
1102
+ }
1103
+ return this.element.clientWidth;
1104
+ }
1105
+ connectedCallback() {
1106
+ this.scrollService = new localScrollService.LocalScrollService({
1107
+ beforeScroll: e => this.scrollVirtual.emit(e),
1108
+ afterScroll: e => {
1109
+ const type = e.dimension === 'rgRow' ? 'scrollTop' : 'scrollLeft';
1110
+ this.element[type] = e.coordinate;
1111
+ },
1112
+ });
1113
+ }
1114
+ disconnectedCallback() {
1115
+ clearTimeout(this.autoHideTimeout);
1116
+ }
1117
+ componentWillLoad() {
1118
+ this.scrollSize = index.getScrollbarWidth(document);
1119
+ this.isAutoHide = !this.scrollSize;
1120
+ }
1121
+ componentDidRender() {
1122
+ const type = this.dimension === 'rgRow' ? 'scrollHeight' : 'scrollWidth';
1123
+ if (this.element[type] > this.size) {
1124
+ this.size = this.scrollSize;
1125
+ }
1126
+ else {
1127
+ this.size = 0;
1128
+ }
1129
+ this.scrollService.setParams({
1130
+ contentSize: this.dimensionStore.get('realSize'),
1131
+ clientSize: this.size,
1132
+ virtualSize: this.viewportStore.get('virtualSize'),
1133
+ }, this.dimension);
1134
+ }
1135
+ onScroll(e) {
1136
+ var _a;
1137
+ let type = 'scrollLeft';
1138
+ if (this.dimension === 'rgRow') {
1139
+ type = 'scrollTop';
1140
+ }
1141
+ if (this.isAutoHide) {
1142
+ this.size = 20;
1143
+ this.autoHideTimeout = this.autoHide(this.autoHideTimeout);
1144
+ }
1145
+ const target = e.target;
1146
+ (_a = this.scrollService) === null || _a === void 0 ? void 0 : _a.scroll(target[type] || 0, this.dimension);
1147
+ }
1148
+ autoHide(timeout) {
1149
+ clearTimeout(timeout);
1150
+ return setTimeout(() => {
1151
+ this.size = 0;
1152
+ }, 6000);
1153
+ }
1154
+ render() {
1155
+ const sizeType = this.dimension === 'rgRow' ? 'height' : 'width';
1156
+ return (index$1.h(index$1.Host, Object.assign({}, { 'auto-hide': this.isAutoHide }, { onScroll: (e) => this.onScroll(e) }), index$1.h("div", { style: { [sizeType]: `${this.extContentSize(this.viewportStore.get('virtualSize'), this.dimensionStore.get('realSize'))}px` } })));
1157
+ }
1158
+ extContentSize(vsize, contentSize) {
1159
+ return localScrollService.LocalScrollService.getVirtualContentSize(contentSize, this.size, vsize);
1160
+ }
1161
+ get element() { return index$1.getElement(this); }
1162
+ };
1163
+ RevogrScrollVirtual.style = revogrScrollStyleCss;
1164
+
1165
+ const revogrTempRangeStyleCss = ".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}";
1166
+
1167
+ const RevogrFocus = class {
1168
+ constructor(hostRef) {
1169
+ index$1.registerInstance(this, hostRef);
1170
+ this.onChange = viewport_helpers.lodash.throttle((e) => this.doChange(e), 300);
1171
+ this.selectionStore = undefined;
1172
+ this.dimensionRow = undefined;
1173
+ this.dimensionCol = undefined;
1174
+ }
1175
+ doChange(e) {
1176
+ e === null || e === void 0 ? void 0 : e.scrollIntoView({
1177
+ block: 'nearest',
1178
+ inline: 'nearest',
1179
+ });
1180
+ }
1181
+ componentDidRender() {
1182
+ if (this.el) {
1183
+ this.onChange(this.el);
1184
+ }
1185
+ }
1186
+ render() {
1187
+ const data = this.selectionStore.get('tempRange');
1188
+ const type = this.selectionStore.get('tempRangeType');
1189
+ if (!data) {
1190
+ return;
1191
+ }
1192
+ let directionY = 'bottom';
1193
+ let derectionX = 'right';
1194
+ const range = this.getRange();
1195
+ if (!range) {
1196
+ return;
1197
+ }
1198
+ if (data.y < range.y) {
1199
+ directionY = 'top';
1200
+ }
1201
+ if (data.x < range.x) {
1202
+ derectionX = 'left';
1203
+ }
1204
+ const directionClass = `${derectionX} ${directionY}`;
1205
+ const style = getElStyle(data, this.dimensionRow.state, this.dimensionCol.state);
1206
+ return (index$1.h(index$1.Host, { class: {
1207
+ [index.TMP_SELECTION_BG_CLASS]: true,
1208
+ [type || '']: true,
1209
+ }, style: style, hidden: false }, index$1.h("div", { class: directionClass, ref: (e) => (this.el = e) })));
1210
+ }
1211
+ getRange() {
1212
+ const range = this.selectionStore.get('range');
1213
+ if (range) {
1214
+ return range;
1215
+ }
1216
+ const focus = this.selectionStore.get('focus');
1217
+ if (!focus) {
1218
+ return null;
1219
+ }
1220
+ return Object.assign(Object.assign({}, focus), { x1: focus.x, y1: focus.y });
1221
+ }
1222
+ };
1223
+ RevogrFocus.style = revogrTempRangeStyleCss;
1224
+
1225
+ exports.revogr_focus = RevogrFocus$1;
1226
+ exports.revogr_overlay_selection = OverlaySelection;
1227
+ exports.revogr_row_headers = RevogrRowHeaders;
1228
+ exports.revogr_scroll_virtual = RevogrScrollVirtual;
1229
+ exports.revogr_temp_range = RevogrFocus;
1230
+
1231
+ //# sourceMappingURL=revogr-focus_5.cjs.entry.js.map