@revolist/revogrid 4.9.1 → 4.9.3

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 (262) hide show
  1. package/dist/cjs/{base.plugin-d48d867d.js → base.plugin-bf5f43a0.js} +2 -2
  2. package/dist/cjs/{base.plugin-d48d867d.js.map → base.plugin-bf5f43a0.js.map} +1 -1
  3. package/dist/cjs/{column.service-6f691f50.js → column.service-01f4a6c7.js} +25 -6
  4. package/dist/cjs/column.service-01f4a6c7.js.map +1 -0
  5. package/dist/cjs/{dimension.helpers-e9d22516.js → dimension.helpers-a6788214.js} +10 -5
  6. package/dist/cjs/dimension.helpers-a6788214.js.map +1 -0
  7. package/dist/cjs/{header-cell-renderer-81a22b00.js → header-cell-renderer-3bc70679.js} +10 -8
  8. package/dist/cjs/header-cell-renderer-3bc70679.js.map +1 -0
  9. package/dist/cjs/index.cjs.js +4 -4
  10. package/dist/cjs/revo-grid.cjs.entry.js +81 -93
  11. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  12. package/dist/cjs/revogr-attribution_6.cjs.entry.js +71 -46
  13. package/dist/cjs/revogr-attribution_6.cjs.entry.js.map +1 -1
  14. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +12 -7
  15. package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
  16. package/dist/cjs/revogr-data_4.cjs.entry.js +45 -36
  17. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  18. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  19. package/dist/cjs/{selection.helpers-8fa19c04.js → selection.helpers-1a8c8d49.js} +32 -31
  20. package/dist/cjs/selection.helpers-1a8c8d49.js.map +1 -0
  21. package/dist/cjs/{throttle-bcc4740d.js → throttle-52be9e67.js} +4 -3
  22. package/dist/cjs/throttle-52be9e67.js.map +1 -0
  23. package/dist/cjs/{viewport.store-9cf01c71.js → viewport.store-35a3e7ee.js} +13 -9
  24. package/dist/cjs/viewport.store-35a3e7ee.js.map +1 -0
  25. package/dist/collection/components/clipboard/revogr-clipboard.js +68 -89
  26. package/dist/collection/components/clipboard/revogr-clipboard.js.map +1 -1
  27. package/dist/collection/components/data/cell-renderer.js +7 -4
  28. package/dist/collection/components/data/cell-renderer.js.map +1 -1
  29. package/dist/collection/components/data/column.service.js +1 -1
  30. package/dist/collection/components/data/column.service.js.map +1 -1
  31. package/dist/collection/components/data/revogr-data.js +1 -1
  32. package/dist/collection/components/data/revogr-data.js.map +1 -1
  33. package/dist/collection/components/editors/revogr-edit.js +6 -6
  34. package/dist/collection/components/editors/revogr-edit.js.map +1 -1
  35. package/dist/collection/components/editors/text-editor.js +3 -1
  36. package/dist/collection/components/editors/text-editor.js.map +1 -1
  37. package/dist/collection/components/header/header-renderer.js +2 -1
  38. package/dist/collection/components/header/header-renderer.js.map +1 -1
  39. package/dist/collection/components/header/resizable.directive.js +7 -5
  40. package/dist/collection/components/header/resizable.directive.js.map +1 -1
  41. package/dist/collection/components/header/resizable.element.js +1 -1
  42. package/dist/collection/components/header/resizable.element.js.map +1 -1
  43. package/dist/collection/components/overlay/autofill.service.js +11 -12
  44. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  45. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  46. package/dist/collection/components/overlay/revogr-overlay-selection.js +74 -39
  47. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  48. package/dist/collection/components/overlay/selection.utils.js +13 -5
  49. package/dist/collection/components/overlay/selection.utils.js.map +1 -1
  50. package/dist/collection/components/revoGrid/grid.helpers.js +10 -8
  51. package/dist/collection/components/revoGrid/grid.helpers.js.map +1 -1
  52. package/dist/collection/components/revoGrid/revo-grid.js +42 -42
  53. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  54. package/dist/collection/components/revoGrid/viewport.helpers.js +19 -0
  55. package/dist/collection/components/revoGrid/viewport.helpers.js.map +1 -1
  56. package/dist/collection/components/revoGrid/viewport.scrolling.service.js +4 -3
  57. package/dist/collection/components/revoGrid/viewport.scrolling.service.js.map +1 -1
  58. package/dist/collection/components/revoGrid/viewport.service.js +27 -37
  59. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  60. package/dist/collection/components/rowHeaders/revogr-row-headers.js +2 -2
  61. package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
  62. package/dist/collection/components/scroll/revogr-viewport-scroll.js +34 -29
  63. package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
  64. package/dist/collection/components/scrollable/autohide-scroll.plugin.js +1 -1
  65. package/dist/collection/components/scrollable/autohide-scroll.plugin.js.map +1 -1
  66. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +3 -3
  67. package/dist/collection/components/selectionFocus/revogr-focus.js +1 -1
  68. package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -1
  69. package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -1
  70. package/dist/collection/components/vnode/vnode-converter.js +6 -6
  71. package/dist/collection/components/vnode/vnode-converter.js.map +1 -1
  72. package/dist/collection/components/vnode/vnode.utils.js.map +1 -1
  73. package/dist/collection/global/global.js.map +1 -1
  74. package/dist/collection/plugins/export/export.plugin.js +2 -2
  75. package/dist/collection/plugins/export/export.plugin.js.map +1 -1
  76. package/dist/collection/plugins/filter/filter.panel.js +4 -4
  77. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js +1 -1
  78. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
  79. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +2 -2
  80. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
  81. package/dist/collection/plugins/groupingRow/grouping.service.js +1 -1
  82. package/dist/collection/plugins/groupingRow/grouping.service.js.map +1 -1
  83. package/dist/collection/plugins/moveColumn/column.drag.plugin.js +1 -1
  84. package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
  85. package/dist/collection/plugins/sorting/sorting.plugin.js +9 -12
  86. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  87. package/dist/collection/services/cell.helpers.js +3 -2
  88. package/dist/collection/services/cell.helpers.js.map +1 -1
  89. package/dist/collection/services/column.data.provider.js.map +1 -1
  90. package/dist/collection/services/data.provider.js.map +1 -1
  91. package/dist/collection/services/dimension.provider.js +2 -1
  92. package/dist/collection/services/dimension.provider.js.map +1 -1
  93. package/dist/collection/services/local.scroll.service.js +3 -2
  94. package/dist/collection/services/local.scroll.service.js.map +1 -1
  95. package/dist/collection/services/selection.store.connector.js +20 -16
  96. package/dist/collection/services/selection.store.connector.js.map +1 -1
  97. package/dist/collection/store/selection/selection.helpers.js +8 -12
  98. package/dist/collection/store/selection/selection.helpers.js.map +1 -1
  99. package/dist/collection/store/selection/selection.store.js +2 -1
  100. package/dist/collection/store/selection/selection.store.js.map +1 -1
  101. package/dist/collection/store/vp/viewport.helpers.js +10 -6
  102. package/dist/collection/store/vp/viewport.helpers.js.map +1 -1
  103. package/dist/collection/store/vp/viewport.store.js +1 -1
  104. package/dist/collection/store/vp/viewport.store.js.map +1 -1
  105. package/dist/collection/themeManager/theme.service.js +1 -1
  106. package/dist/collection/themeManager/theme.service.js.map +1 -1
  107. package/dist/collection/types/interfaces.js.map +1 -1
  108. package/dist/collection/types/selection.js.map +1 -1
  109. package/dist/collection/types/viewport.interfaces.js.map +1 -1
  110. package/dist/collection/utils/closest.polifill.js.map +1 -1
  111. package/dist/collection/utils/store.utils.js +9 -4
  112. package/dist/collection/utils/store.utils.js.map +1 -1
  113. package/dist/esm/{base.plugin-78393655.js → base.plugin-5e7a3c51.js} +2 -2
  114. package/dist/esm/{base.plugin-78393655.js.map → base.plugin-5e7a3c51.js.map} +1 -1
  115. package/dist/esm/{column.service-0e41057a.js → column.service-5d14e7e9.js} +25 -6
  116. package/dist/esm/column.service-5d14e7e9.js.map +1 -0
  117. package/dist/esm/{dimension.helpers-91398565.js → dimension.helpers-56298828.js} +10 -5
  118. package/dist/esm/dimension.helpers-56298828.js.map +1 -0
  119. package/dist/esm/{header-cell-renderer-6d8ac25d.js → header-cell-renderer-fc999784.js} +10 -8
  120. package/dist/esm/header-cell-renderer-fc999784.js.map +1 -0
  121. package/dist/esm/index.js +4 -4
  122. package/dist/esm/revo-grid.entry.js +81 -93
  123. package/dist/esm/revo-grid.entry.js.map +1 -1
  124. package/dist/esm/revogr-attribution_6.entry.js +71 -46
  125. package/dist/esm/revogr-attribution_6.entry.js.map +1 -1
  126. package/dist/esm/revogr-clipboard_3.entry.js +12 -7
  127. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  128. package/dist/esm/revogr-data_4.entry.js +45 -36
  129. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  130. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  131. package/dist/esm/{selection.helpers-50e9f09d.js → selection.helpers-accaad4a.js} +32 -31
  132. package/dist/esm/selection.helpers-accaad4a.js.map +1 -0
  133. package/dist/esm/{throttle-1b1dd9d2.js → throttle-7283692c.js} +4 -3
  134. package/dist/esm/throttle-7283692c.js.map +1 -0
  135. package/dist/esm/{viewport.store-bfd0b036.js → viewport.store-d8e03528.js} +13 -9
  136. package/dist/esm/viewport.store-d8e03528.js.map +1 -0
  137. package/dist/revo-grid/{base.plugin-78393655.js → base.plugin-5e7a3c51.js} +2 -2
  138. package/dist/revo-grid/column.service-5d14e7e9.js +5 -0
  139. package/dist/revo-grid/column.service-5d14e7e9.js.map +1 -0
  140. package/dist/revo-grid/{dimension.helpers-91398565.js → dimension.helpers-56298828.js} +2 -2
  141. package/dist/revo-grid/{dimension.helpers-91398565.js.map → dimension.helpers-56298828.js.map} +1 -1
  142. package/dist/revo-grid/header-cell-renderer-fc999784.js +5 -0
  143. package/dist/revo-grid/header-cell-renderer-fc999784.js.map +1 -0
  144. package/dist/revo-grid/index.esm.js +1 -1
  145. package/dist/revo-grid/revo-grid.entry.js +1 -1
  146. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  147. package/dist/revo-grid/revogr-attribution_6.entry.js +1 -1
  148. package/dist/revo-grid/revogr-attribution_6.entry.js.map +1 -1
  149. package/dist/revo-grid/revogr-clipboard_3.entry.js +1 -1
  150. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  151. package/dist/revo-grid/revogr-data_4.entry.js +1 -1
  152. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  153. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  154. package/dist/revo-grid/selection.helpers-accaad4a.js +5 -0
  155. package/dist/revo-grid/selection.helpers-accaad4a.js.map +1 -0
  156. package/dist/revo-grid/{throttle-1b1dd9d2.js → throttle-7283692c.js} +2 -2
  157. package/dist/revo-grid/throttle-7283692c.js.map +1 -0
  158. package/dist/revo-grid/viewport.store-d8e03528.js +5 -0
  159. package/dist/revo-grid/viewport.store-d8e03528.js.map +1 -0
  160. package/dist/types/components/clipboard/revogr-clipboard.d.ts +32 -24
  161. package/dist/types/components/data/column.service.d.ts +1 -1
  162. package/dist/types/components/data/row-highlight.plugin.d.ts +1 -1
  163. package/dist/types/components/editors/revogr-edit.d.ts +1 -1
  164. package/dist/types/components/editors/text-editor.d.ts +3 -3
  165. package/dist/types/components/header/header-renderer.d.ts +2 -2
  166. package/dist/types/components/header/resizable.directive.d.ts +2 -2
  167. package/dist/types/components/overlay/autofill.service.d.ts +9 -7
  168. package/dist/types/components/overlay/keyboard.service.d.ts +4 -4
  169. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +20 -11
  170. package/dist/types/components/overlay/selection.utils.d.ts +7 -4
  171. package/dist/types/components/revoGrid/revo-grid.d.ts +7 -6
  172. package/dist/types/components/revoGrid/viewport.helpers.d.ts +18 -3
  173. package/dist/types/components/revoGrid/viewport.scrolling.service.d.ts +1 -1
  174. package/dist/types/components/revoGrid/viewport.service.d.ts +2 -6
  175. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +6 -6
  176. package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +1 -1
  177. package/dist/types/components/vnode/vnode-converter.d.ts +1 -1
  178. package/dist/types/components/vnode/vnode.utils.d.ts +1 -1
  179. package/dist/types/components.d.ts +80 -54
  180. package/dist/types/plugins/column.auto-size.plugin.d.ts +2 -2
  181. package/dist/types/plugins/export/export.plugin.d.ts +3 -3
  182. package/dist/types/plugins/filter/filter.button.d.ts +1 -1
  183. package/dist/types/plugins/filter/filter.panel.d.ts +1 -1
  184. package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +1 -1
  185. package/dist/types/plugins/groupingRow/grouping.service.d.ts +3 -3
  186. package/dist/types/plugins/sorting/sorting.plugin.d.ts +8 -8
  187. package/dist/types/services/column.data.provider.d.ts +1 -1
  188. package/dist/types/services/data.provider.d.ts +1 -1
  189. package/dist/types/services/dimension.provider.d.ts +3 -2
  190. package/dist/types/services/selection.store.connector.d.ts +9 -9
  191. package/dist/types/store/selection/selection.helpers.d.ts +1 -1
  192. package/dist/types/store/selection/selection.store.d.ts +4 -4
  193. package/dist/types/store/vp/viewport.helpers.d.ts +2 -2
  194. package/dist/types/themeManager/theme.service.d.ts +1 -1
  195. package/dist/types/types/interfaces.d.ts +18 -1
  196. package/dist/types/types/viewport.interfaces.d.ts +2 -2
  197. package/dist/types/utils/store.utils.d.ts +7 -4
  198. package/hydrate/index.js +274 -215
  199. package/hydrate/index.mjs +274 -215
  200. package/package.json +1 -1
  201. package/standalone/column.service.js +33 -33
  202. package/standalone/column.service.js.map +1 -1
  203. package/standalone/data.store.js +2959 -7
  204. package/standalone/data.store.js.map +1 -1
  205. package/standalone/debounce.js +1 -1
  206. package/standalone/dimension.helpers.js +2 -2
  207. package/standalone/index.js.map +1 -1
  208. package/standalone/local.scroll.timer.js +3 -2
  209. package/standalone/local.scroll.timer.js.map +1 -1
  210. package/standalone/revo-grid.js +77 -90
  211. package/standalone/revo-grid.js.map +1 -1
  212. package/standalone/revogr-clipboard2.js +6 -3
  213. package/standalone/revogr-clipboard2.js.map +1 -1
  214. package/standalone/revogr-data2.js +7 -5
  215. package/standalone/revogr-data2.js.map +1 -1
  216. package/standalone/revogr-edit2.js +5 -3
  217. package/standalone/revogr-edit2.js.map +1 -1
  218. package/standalone/revogr-filter-panel.js.map +1 -1
  219. package/standalone/revogr-focus2.js +0 -1
  220. package/standalone/revogr-focus2.js.map +1 -1
  221. package/standalone/revogr-header2.js +12 -10
  222. package/standalone/revogr-header2.js.map +1 -1
  223. package/standalone/revogr-order-editor2.js +0 -1
  224. package/standalone/revogr-order-editor2.js.map +1 -1
  225. package/standalone/revogr-overlay-selection2.js +54 -38
  226. package/standalone/revogr-overlay-selection2.js.map +1 -1
  227. package/standalone/revogr-row-headers2.js +12 -9
  228. package/standalone/revogr-row-headers2.js.map +1 -1
  229. package/standalone/revogr-scroll-virtual2.js +1 -1
  230. package/standalone/revogr-scroll-virtual2.js.map +1 -1
  231. package/standalone/revogr-temp-range2.js.map +1 -1
  232. package/standalone/revogr-viewport-scroll2.js +47 -23
  233. package/standalone/revogr-viewport-scroll2.js.map +1 -1
  234. package/standalone/selection.utils.js +14 -6
  235. package/standalone/selection.utils.js.map +1 -1
  236. package/standalone/toNumber.js +1 -1
  237. package/standalone/vnode-converter.js +3 -3
  238. package/standalone/vnode-converter.js.map +1 -1
  239. package/dist/cjs/column.service-6f691f50.js.map +0 -1
  240. package/dist/cjs/dimension.helpers-e9d22516.js.map +0 -1
  241. package/dist/cjs/header-cell-renderer-81a22b00.js.map +0 -1
  242. package/dist/cjs/selection.helpers-8fa19c04.js.map +0 -1
  243. package/dist/cjs/throttle-bcc4740d.js.map +0 -1
  244. package/dist/cjs/viewport.store-9cf01c71.js.map +0 -1
  245. package/dist/esm/column.service-0e41057a.js.map +0 -1
  246. package/dist/esm/dimension.helpers-91398565.js.map +0 -1
  247. package/dist/esm/header-cell-renderer-6d8ac25d.js.map +0 -1
  248. package/dist/esm/selection.helpers-50e9f09d.js.map +0 -1
  249. package/dist/esm/throttle-1b1dd9d2.js.map +0 -1
  250. package/dist/esm/viewport.store-bfd0b036.js.map +0 -1
  251. package/dist/revo-grid/column.service-0e41057a.js +0 -5
  252. package/dist/revo-grid/column.service-0e41057a.js.map +0 -1
  253. package/dist/revo-grid/header-cell-renderer-6d8ac25d.js +0 -5
  254. package/dist/revo-grid/header-cell-renderer-6d8ac25d.js.map +0 -1
  255. package/dist/revo-grid/selection.helpers-50e9f09d.js +0 -5
  256. package/dist/revo-grid/selection.helpers-50e9f09d.js.map +0 -1
  257. package/dist/revo-grid/throttle-1b1dd9d2.js.map +0 -1
  258. package/dist/revo-grid/viewport.store-bfd0b036.js +0 -5
  259. package/dist/revo-grid/viewport.store-bfd0b036.js.map +0 -1
  260. package/standalone/_baseIteratee.js +0 -2956
  261. package/standalone/_baseIteratee.js.map +0 -1
  262. /package/dist/revo-grid/{base.plugin-78393655.js.map → base.plugin-5e7a3c51.js.map} +0 -0
package/hydrate/index.js CHANGED
@@ -2311,8 +2311,10 @@ class Clipboard {
2311
2311
  }
2312
2312
  const clipboardData = this.getData(e);
2313
2313
  const isHTML = ((clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.types.indexOf('text/html')) || -1) > -1;
2314
- const data = isHTML ? clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text/html') : clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
2315
- const dataText = clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text');
2314
+ const data = (isHTML
2315
+ ? clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text/html')
2316
+ : clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
2317
+ const dataText = (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.getData('text')) || '';
2316
2318
  const beforePaste = this.beforePaste.emit({
2317
2319
  raw: data,
2318
2320
  dataText,
@@ -2421,7 +2423,8 @@ class Clipboard {
2421
2423
  return result;
2422
2424
  }
2423
2425
  getData(e) {
2424
- return e.clipboardData || (window === null || window === void 0 ? void 0 : window.clipboardData);
2426
+ return (e.clipboardData ||
2427
+ (window === null || window === void 0 ? void 0 : window.clipboardData));
2425
2428
  }
2426
2429
  static get cmpMeta() { return {
2427
2430
  "$flags$": 0,
@@ -6829,11 +6832,16 @@ function gatherTrimmedItems(trimmedItems) {
6829
6832
  return trimmed;
6830
6833
  }
6831
6834
 
6832
- /** Set stores data */
6835
+ /**
6836
+ * Sets the given data on the specified store.
6837
+ *
6838
+ * @param store - The store to set data on.
6839
+ * @param data - The data to set on the store.
6840
+ */
6833
6841
  function setStore(store, data) {
6834
- for (let key in data) {
6835
- store.set(key, data[key]);
6836
- }
6842
+ Object.entries(data).forEach(([key, value]) => {
6843
+ store.set(key, value);
6844
+ });
6837
6845
  }
6838
6846
 
6839
6847
  /**
@@ -7647,7 +7655,8 @@ class SelectionStore {
7647
7655
  setStore(this.store, { range, edit: null, tempRange: null });
7648
7656
  }
7649
7657
  setRange(start, end) {
7650
- this.setRangeArea(getRange(start, end));
7658
+ const range = getRange(start, end);
7659
+ this.setRangeArea(range);
7651
7660
  }
7652
7661
  setLastCell(lastCell) {
7653
7662
  setStore(this.store, { lastCell });
@@ -7746,7 +7755,7 @@ class SelectionStoreConnector {
7746
7755
  return this.columnStores[x];
7747
7756
  }
7748
7757
  this.columnStores[x] = new SelectionStore();
7749
- // build cross linking type to position
7758
+ // build cross-linking type to position
7750
7759
  this.storesByType[type] = x;
7751
7760
  this.storesXToType[x] = type;
7752
7761
  return this.columnStores[x];
@@ -7797,13 +7806,13 @@ class SelectionStoreConnector {
7797
7806
  (_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
7798
7807
  delete this.rowStores[y];
7799
7808
  delete this.columnStores[x];
7800
- // clear x cross link
7809
+ // clear x cross-link
7801
7810
  if (this.storesXToType[x]) {
7802
7811
  const type = this.storesXToType[x];
7803
7812
  delete this.storesXToType[x];
7804
7813
  delete this.storesByType[type];
7805
7814
  }
7806
- // clear y cross link
7815
+ // clear y cross-link
7807
7816
  if (this.storesYToType[y]) {
7808
7817
  const type = this.storesYToType[y];
7809
7818
  delete this.storesYToType[y];
@@ -7833,9 +7842,10 @@ class SelectionStoreConnector {
7833
7842
  return;
7834
7843
  }
7835
7844
  // Get the next store based on the current focus and the last cell.
7836
- const next = this.getNextStore(focus, this.focusedStore.position, this.focusedStore.entity.store.get('lastCell'));
7845
+ const lastCell = this.focusedStore.entity.store.get('lastCell');
7846
+ const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
7837
7847
  // Set the next focus cell in the store.
7838
- (_a = next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
7848
+ (_a = next === null || next === void 0 ? void 0 : next.store) === null || _a === void 0 ? void 0 : _a.setNextFocus(Object.assign(Object.assign({}, focus), next.item));
7839
7849
  }
7840
7850
  focusByCell(storePos, start, end) {
7841
7851
  const store = this.stores[storePos.y][storePos.x];
@@ -7848,15 +7858,17 @@ class SelectionStoreConnector {
7848
7858
  }
7849
7859
  // check for the focus in nearby store/viewport
7850
7860
  const lastCell = store.store.get('lastCell');
7851
- const next = this.getNextStore(focus, currentStorePointer, lastCell);
7861
+ const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
7852
7862
  // if next store present - update
7853
7863
  if (next === null || next === void 0 ? void 0 : next.store) {
7854
7864
  const item = Object.assign(Object.assign({}, focus), next.item);
7855
7865
  this.focus(next.store, { focus: item, end: item });
7856
7866
  return null;
7857
7867
  }
7858
- focus = cropCellToMax(focus, lastCell);
7859
- end = cropCellToMax(end, lastCell);
7868
+ if (lastCell) {
7869
+ focus = cropCellToMax(focus, lastCell);
7870
+ end = cropCellToMax(end, lastCell);
7871
+ }
7860
7872
  store.setFocus(focus, end);
7861
7873
  return focus;
7862
7874
  }
@@ -7893,10 +7905,9 @@ class SelectionStoreConnector {
7893
7905
  getNextStore(focus, currentStorePointer, lastCell) {
7894
7906
  // item in new store
7895
7907
  const nextItem = nextCell(focus, lastCell);
7896
- let nextStore = null;
7908
+ let nextStore;
7897
7909
  if (nextItem) {
7898
- for (let i in nextItem) {
7899
- let type = i;
7910
+ Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
7900
7911
  let stores;
7901
7912
  switch (type) {
7902
7913
  case 'x':
@@ -7906,20 +7917,20 @@ class SelectionStoreConnector {
7906
7917
  case 'y':
7907
7918
  // Get the Y stores for the current X coordinate of the current store pointer
7908
7919
  stores = this.getYStores(currentStorePointer.x);
7909
- stores = this.getYStores(currentStorePointer.x);
7910
7920
  break;
7911
7921
  }
7912
- if (nextItem[type] >= 0) {
7922
+ // Get the next store based on the item in the new store
7923
+ if (nextItemCoord >= 0) {
7913
7924
  nextStore = stores[++currentStorePointer[type]];
7914
7925
  }
7915
7926
  else {
7916
7927
  nextStore = stores[--currentStorePointer[type]];
7917
7928
  const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
7918
7929
  if (nextLastCell) {
7919
- nextItem[type] = nextLastCell[type] + nextItem[type];
7930
+ nextItem[type] = nextLastCell[type] + nextItemCoord;
7920
7931
  }
7921
7932
  }
7922
- }
7933
+ });
7923
7934
  }
7924
7935
  return {
7925
7936
  store: nextStore,
@@ -7951,7 +7962,9 @@ class SelectionStoreConnector {
7951
7962
  continue;
7952
7963
  }
7953
7964
  const lastCell = store.store.get('lastCell');
7954
- store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
7965
+ if (lastCell) {
7966
+ store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
7967
+ }
7955
7968
  }
7956
7969
  }
7957
7970
  }
@@ -7990,21 +8003,17 @@ function nextCell(cell, lastCell) {
7990
8003
  return null;
7991
8004
  }
7992
8005
  function cropCellToMax(cell, lastCell) {
7993
- const newCell = Object.assign({}, cell);
7994
- let types = ['x', 'y'];
7995
- // previous item check
7996
- for (let t of types) {
7997
- if (cell[t] < 0) {
7998
- newCell[t] = 0;
8006
+ const croppedCell = Object.assign({}, cell);
8007
+ const cellCoordinates = ['x', 'y'];
8008
+ for (const coordinate of cellCoordinates) {
8009
+ if (cell[coordinate] < 0) {
8010
+ croppedCell[coordinate] = 0;
7999
8011
  }
8000
- }
8001
- // next item check
8002
- for (let t of types) {
8003
- if (cell[t] >= lastCell[t]) {
8004
- newCell[t] = lastCell[t] - 1;
8012
+ else if (cell[coordinate] >= lastCell[coordinate]) {
8013
+ croppedCell[coordinate] = lastCell[coordinate] - 1;
8005
8014
  }
8006
8015
  }
8007
- return newCell;
8016
+ return croppedCell;
8008
8017
  }
8009
8018
  function getRange(start, end) {
8010
8019
  return start && end
@@ -8120,6 +8129,7 @@ function getItems(opt, currentSize = 0) {
8120
8129
  return items;
8121
8130
  }
8122
8131
  function recombineByOffset(offset, data) {
8132
+ var _a, _b;
8123
8133
  const newItems = [...data.items];
8124
8134
  const itemsCount = newItems.length;
8125
8135
  let newRange = {
@@ -8128,7 +8138,7 @@ function recombineByOffset(offset, data) {
8128
8138
  };
8129
8139
  // if offset out of revo-viewport, makes sense whole redraw
8130
8140
  if (offset > itemsCount) {
8131
- return null;
8141
+ return undefined;
8132
8142
  }
8133
8143
  // is direction of scroll positive
8134
8144
  if (data.positiveDirection) {
@@ -8167,19 +8177,21 @@ function recombineByOffset(offset, data) {
8167
8177
  let firstItem = getFirstItem(data);
8168
8178
  const end = newRange.end;
8169
8179
  for (let i = 0; i < offset; i++) {
8170
- const newIndex = firstItem.itemIndex - 1;
8180
+ const newIndex = ((_a = firstItem === null || firstItem === void 0 ? void 0 : firstItem.itemIndex) !== null && _a !== void 0 ? _a : 0) - 1;
8171
8181
  const size = getItemSize(newIndex, data.sizes, data.originItemSize);
8172
8182
  // new item index to recombine
8173
8183
  let newStart = end - i;
8174
8184
  newStart = (newStart < 0 ? itemsCount + newStart : newStart) % itemsCount;
8175
8185
  // item should always present, we do not create new item, we recombine them
8176
8186
  if (!newItems[newStart]) {
8177
- throw new Error('incorrect index');
8187
+ console.error('incorrect index');
8188
+ break;
8178
8189
  }
8179
8190
  // do recombination
8191
+ const firstItemStart = (_b = firstItem === null || firstItem === void 0 ? void 0 : firstItem.start) !== null && _b !== void 0 ? _b : 0;
8180
8192
  newItems[newStart] = firstItem = {
8181
- start: firstItem.start - size,
8182
- end: firstItem.start,
8193
+ start: firstItemStart - size,
8194
+ end: firstItemStart,
8183
8195
  itemIndex: newIndex,
8184
8196
  size: size,
8185
8197
  };
@@ -8215,11 +8227,12 @@ function isActiveRange(pos, realSize, first, last) {
8215
8227
  (pos > first.end && last.end === realSize));
8216
8228
  }
8217
8229
  function isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem) {
8230
+ var _a;
8218
8231
  // if no first item, means no items in viewport
8219
8232
  if (!firstItem) {
8220
8233
  return false;
8221
8234
  }
8222
- return virtualSize + pos > (lastItem === null || lastItem === void 0 ? void 0 : lastItem.end);
8235
+ return virtualSize + pos > ((_a = lastItem === null || lastItem === void 0 ? void 0 : lastItem.end) !== null && _a !== void 0 ? _a : 0);
8223
8236
  }
8224
8237
  function getFirstItem(s) {
8225
8238
  return s.items[s.start];
@@ -8362,7 +8375,7 @@ class ViewportStore {
8362
8375
  }
8363
8376
  else if (isActiveRangeOutsideLastItem(pos, virtualSize, firstItem, lastItem)) {
8364
8377
  const items = [...allItems.items];
8365
- // check is any item missing for full fill content
8378
+ // check is any item missing for fulfill content
8366
8379
  const missing = addMissingItems(firstItem, this.store.get('realCount'), virtualSize + pos - firstItem.start, allItems, {
8367
8380
  sizes: dimension.sizes,
8368
8381
  originItemSize: dimension.originItemSize,
@@ -8741,7 +8754,7 @@ function measureEqualDepth(groupA, groupB) {
8741
8754
  }
8742
8755
  function getParsedGroup(id) {
8743
8756
  const parseGroup = JSON.parse(id);
8744
- // extra precaution and type safe guard
8757
+ // extra precaution and type safeguard
8745
8758
  if (!Array.isArray(parseGroup)) {
8746
8759
  return null;
8747
8760
  }
@@ -8857,7 +8870,7 @@ class ColumnService {
8857
8870
  const data = this.rowDataModel(r, c);
8858
8871
  return readOnly(data);
8859
8872
  }
8860
- return readOnly;
8873
+ return !!readOnly;
8861
8874
  }
8862
8875
  mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
8863
8876
  const cellClass = {
@@ -9240,6 +9253,14 @@ function getPropertyFromEvent(e, prop, focusClass // for touch events
9240
9253
  return e[prop] || 0;
9241
9254
  }
9242
9255
 
9256
+ function collectModelsOfRange(data, store) {
9257
+ const models = {};
9258
+ for (let i in data) {
9259
+ const rowIndex = parseInt(i, 10);
9260
+ models[rowIndex] = getSourceItem(store, rowIndex);
9261
+ }
9262
+ return models;
9263
+ }
9243
9264
  function getFocusCellBasedOnEvent(e, data) {
9244
9265
  // If event default is prevented, return
9245
9266
  if (e.defaultPrevented) {
@@ -9290,18 +9311,18 @@ function getCurrentCell({ x, y }, { el, rows, cols }) {
9290
9311
  return { x: rgCol.itemIndex, y: rgRow.itemIndex };
9291
9312
  }
9292
9313
  function getCoordinate(range, focus, changes, isMulti = false) {
9293
- const updateCoordinate = (c) => {
9314
+ const updateCoordinate = (c, pos = 0) => {
9294
9315
  const start = { x: range.x, y: range.y };
9295
9316
  const end = isMulti ? { x: range.x1, y: range.y1 } : start;
9296
9317
  const point = end[c] > focus[c] ? end : start;
9297
- point[c] += changes[c];
9318
+ point[c] += pos;
9298
9319
  return { start, end };
9299
9320
  };
9300
9321
  if (changes.x) {
9301
- return updateCoordinate('x');
9322
+ return updateCoordinate('x', changes['x']);
9302
9323
  }
9303
9324
  if (changes.y) {
9304
- return updateCoordinate('y');
9325
+ return updateCoordinate('y', changes['y']);
9305
9326
  }
9306
9327
  return null;
9307
9328
  }
@@ -9705,8 +9726,9 @@ class AutoFillService {
9705
9726
  this.sv.setTempRange(null);
9706
9727
  }
9707
9728
  else {
9729
+ const area = getRange(this.autoFillInitial, this.autoFillLast);
9708
9730
  this.sv.setTempRange({
9709
- area: getRange(this.autoFillInitial, this.autoFillLast),
9731
+ area,
9710
9732
  type: this.autoFillType,
9711
9733
  });
9712
9734
  }
@@ -9741,7 +9763,7 @@ class AutoFillService {
9741
9763
  range,
9742
9764
  });
9743
9765
  // If data apply was not prevented, apply new range
9744
- if (!stopApply) {
9766
+ if (!stopApply && oldRange) {
9745
9767
  this.applyRangeWithData(newRange, oldRange);
9746
9768
  }
9747
9769
  else {
@@ -9767,28 +9789,26 @@ class AutoFillService {
9767
9789
  this.autoFillLast = null;
9768
9790
  this.autoFillStart = null;
9769
9791
  }
9770
- /** Trigger range apply events and handle responses */
9792
+ /**
9793
+ * Trigger range apply events and handle responses
9794
+ */
9771
9795
  onRangeApply(data, range) {
9772
- const models = {};
9773
- for (let rowIndex in data) {
9774
- models[rowIndex] = getSourceItem(this.sv.dataStore, parseInt(rowIndex, 10));
9775
- }
9776
9796
  this.sv.rangeDataApply({
9777
9797
  data,
9778
- models,
9798
+ models: collectModelsOfRange(data, this.sv.dataStore),
9779
9799
  type: this.sv.dataStore.get('type'),
9780
9800
  });
9781
9801
  this.sv.setRange(range);
9782
9802
  }
9783
9803
  /** Apply range and copy data during range application */
9784
- applyRangeWithData(newRange, oldRange) {
9804
+ applyRangeWithData(newRange, rangeToCopy) {
9785
9805
  const rangeData = {
9786
9806
  type: this.sv.dataStore.get('type'),
9787
9807
  colType: this.sv.columnService.type,
9788
9808
  newData: {},
9789
9809
  mapping: {},
9790
9810
  newRange,
9791
- oldRange,
9811
+ oldRange: rangeToCopy,
9792
9812
  };
9793
9813
  const { mapping, changed } = this.sv.columnService.getRangeData(rangeData, this.sv.columnService.columns);
9794
9814
  rangeData.newData = changed;
@@ -9855,7 +9875,6 @@ class OverlaySelection {
9855
9875
  this.beforeCellSave = createEvent(this, "beforecellsave", 7);
9856
9876
  this.keyboardService = null;
9857
9877
  this.autoFillService = null;
9858
- this.revogrEdit = null;
9859
9878
  this.unsubscribeSelectionStore = [];
9860
9879
  this.readonly = undefined;
9861
9880
  this.range = undefined;
@@ -9875,19 +9894,21 @@ class OverlaySelection {
9875
9894
  // #endregion
9876
9895
  // #region Listeners
9877
9896
  onMouseMove(e) {
9897
+ var _a;
9878
9898
  if (this.selectionStore.get('focus')) {
9879
- this.autoFillService.selectionMouseMove(e);
9899
+ (_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionMouseMove(e);
9880
9900
  }
9881
9901
  }
9882
9902
  /**
9883
- * Action finished inside of the document.
9903
+ * Action finished inside the document.
9884
9904
  * Pointer left document, clear any active operation.
9885
9905
  */
9886
9906
  onMouseUp() {
9887
- // Clear auto fill selection
9907
+ var _a;
9908
+ // Clear autofill selection
9888
9909
  // when pointer left document,
9889
9910
  // clear any active operation.
9890
- this.autoFillService.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
9911
+ (_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.clearAutoFillSelection(this.selectionStore.get('focus'), this.selectionStore.get('range'));
9891
9912
  }
9892
9913
  /**
9893
9914
  * Row drag started.
@@ -9931,10 +9952,10 @@ class OverlaySelection {
9931
9952
  // clear subscriptions
9932
9953
  this.unsubscribeSelectionStore.forEach(v => v());
9933
9954
  this.unsubscribeSelectionStore.length = 0;
9934
- this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => this.doFocus(v, v)));
9955
+ this.unsubscribeSelectionStore.push(s.onChange('nextFocus', (v) => v && this.doFocus(v, v)));
9935
9956
  this.keyboardService = new KeyboardService({
9936
9957
  selectionStore: s,
9937
- range: r => this.triggerRangeEvent(r),
9958
+ range: r => !!r && this.triggerRangeEvent(r),
9938
9959
  focus: (f, changes, focusNextViewport) => {
9939
9960
  if (focusNextViewport) {
9940
9961
  this.beforeNextViewportFocus.emit(f);
@@ -9951,7 +9972,8 @@ class OverlaySelection {
9951
9972
  this.doEdit(val);
9952
9973
  },
9953
9974
  cancel: async () => {
9954
- await this.revogrEdit.cancelChanges();
9975
+ var _a;
9976
+ await ((_a = this.revogrEdit) === null || _a === void 0 ? void 0 : _a.cancelChanges());
9955
9977
  this.closeEdit();
9956
9978
  },
9957
9979
  clearCell: () => !this.readonly && this.clearCell(),
@@ -9973,7 +9995,7 @@ class OverlaySelection {
9973
9995
  selectionChanged: e => this.selectionChange.emit(e),
9974
9996
  rangeCopy: e => this.beforeRangeCopyApply.emit(e),
9975
9997
  rangeDataApply: e => this.rangeEditApply.emit(e),
9976
- setRange: e => this.triggerRangeEvent(e),
9998
+ setRange: e => !!e && this.triggerRangeEvent(e),
9977
9999
  getData: () => this.getData(),
9978
10000
  });
9979
10001
  }
@@ -10035,6 +10057,7 @@ class OverlaySelection {
10035
10057
  } }));
10036
10058
  }
10037
10059
  render() {
10060
+ var _a;
10038
10061
  const nodes = [];
10039
10062
  const editCell = this.renderEditor();
10040
10063
  // Editor
@@ -10054,14 +10077,14 @@ class OverlaySelection {
10054
10077
  }
10055
10078
  // Autofill
10056
10079
  if (focus && !this.readonly && this.range) {
10057
- nodes.push(this.autoFillService.renderAutofill(range, focus));
10080
+ nodes.push((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.renderAutofill(range, focus));
10058
10081
  }
10059
10082
  // Order
10060
10083
  if (this.canDrag) {
10061
10084
  nodes.push(hAsync("revogr-order-editor", { ref: e => (this.orderEditor = e), dataStore: this.dataStore, dimensionRow: this.dimensionRow, dimensionCol: this.dimensionCol, parent: this.element, onRowdragstartinit: e => this.rowDragStart(e) }));
10062
10085
  }
10063
10086
  }
10064
- return (hAsync(Host, { key: '81dee4cfcce410cefb2bd9ff2661261472fc3a75', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, nodes, hAsync("slot", { key: '6ac75c388ae3fbc5539a27c3acd58178dd53d1af', name: "data" })));
10087
+ return (hAsync(Host, { key: '0767a5d015d0c8fe99444ef26b136a3a11792724', class: { mobile: this.isMobileDevice }, onDblClick: (e) => this.onElementDblClick(e), onMouseDown: (e) => this.onElementMouseDown(e), onTouchStart: (e) => this.onElementMouseDown(e, true) }, nodes, hAsync("slot", { key: '8551244579316e0d4ab61defa1c1c9bc1011f446', name: "data" })));
10065
10088
  }
10066
10089
  /**
10067
10090
  * Executes the focus operation on the specified range of cells.
@@ -10116,6 +10139,7 @@ class OverlaySelection {
10116
10139
  * Handle mouse down event on Host element
10117
10140
  */
10118
10141
  onElementMouseDown(e, touch = false) {
10142
+ var _a;
10119
10143
  // Get the target element from the event object
10120
10144
  const targetElement = e.target;
10121
10145
  // Ignore focus if clicked input
@@ -10132,7 +10156,7 @@ class OverlaySelection {
10132
10156
  this.focus(focusCell, this.range && e.shiftKey);
10133
10157
  // Initiate autofill selection
10134
10158
  if (this.range) {
10135
- this.autoFillService.selectionStart(targetElement, this.getData());
10159
+ targetElement && ((_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.selectionStart(targetElement, this.getData()));
10136
10160
  // Prevent default behavior for mouse events,
10137
10161
  // but only if target element is not a mobile input
10138
10162
  if (!touch) {
@@ -10152,18 +10176,21 @@ class OverlaySelection {
10152
10176
  var _a;
10153
10177
  if (this.canEdit()) {
10154
10178
  const focus = this.selectionStore.get('focus');
10179
+ if (!focus) {
10180
+ return;
10181
+ }
10155
10182
  const data = this.columnService.getSaveData(focus.y, focus.x);
10156
10183
  (_a = this.setEdit) === null || _a === void 0 ? void 0 : _a.emit(Object.assign(Object.assign({}, data), { val }));
10157
10184
  }
10158
10185
  }
10159
10186
  /**
10160
10187
  * Close editor event triggered
10161
- * @param details - if requires focus next
10188
+ * @param details - if it requires focus next
10162
10189
  */
10163
- closeEdit(e) {
10190
+ async closeEdit(e) {
10164
10191
  this.cancelEdit.emit();
10165
10192
  if (e === null || e === void 0 ? void 0 : e.detail) {
10166
- this.focusNext();
10193
+ await this.focusNext();
10167
10194
  }
10168
10195
  }
10169
10196
  /**
@@ -10183,6 +10210,7 @@ class OverlaySelection {
10183
10210
  return range;
10184
10211
  }
10185
10212
  onCopy(e) {
10213
+ var _a;
10186
10214
  const range = this.getRegion();
10187
10215
  const canCopyEvent = this.beforeCopyRegion.emit(range);
10188
10216
  if (canCopyEvent.defaultPrevented) {
@@ -10198,38 +10226,45 @@ class OverlaySelection {
10198
10226
  rangeData = event.detail.data;
10199
10227
  }
10200
10228
  }
10201
- this.clipboard.doCopy(e, rangeData);
10229
+ (_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.doCopy(e, rangeData);
10202
10230
  return true;
10203
10231
  }
10204
10232
  onPaste(data) {
10233
+ var _a;
10205
10234
  const focus = this.selectionStore.get('focus');
10206
10235
  const isEditing = this.selectionStore.get('edit') !== null;
10207
10236
  if (!focus || isEditing) {
10208
10237
  return;
10209
10238
  }
10210
10239
  let { changed, range } = this.columnService.getTransformedDataToApply(focus, data);
10211
- const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, range }, this.types));
10240
+ const { defaultPrevented: canPaste } = this.rangeClipboardPaste.emit(Object.assign({ data: changed, models: collectModelsOfRange(changed, this.dataStore), range }, this.types));
10212
10241
  if (canPaste) {
10213
10242
  return;
10214
10243
  }
10215
- this.autoFillService.onRangeApply(changed, range);
10244
+ (_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(changed, range);
10216
10245
  }
10217
10246
  async focusNext() {
10218
- const canFocus = await this.keyboardService.keyChangeSelection(new KeyboardEvent('keydown', {
10247
+ var _a;
10248
+ const canFocus = await ((_a = this.keyboardService) === null || _a === void 0 ? void 0 : _a.keyChangeSelection(new KeyboardEvent('keydown', {
10219
10249
  code: codesLetter.ARROW_DOWN,
10220
- }), this.range);
10250
+ }), this.range));
10221
10251
  if (!canFocus) {
10222
10252
  this.closeEdit();
10223
10253
  }
10224
10254
  }
10225
10255
  clearCell() {
10226
- if (this.selectionStore.get('range') &&
10227
- !isRangeSingleCell(this.selectionStore.get('range'))) {
10228
- const data = this.columnService.getRangeStaticData(this.selectionStore.get('range'), '');
10229
- this.autoFillService.onRangeApply(data, this.selectionStore.get('range'));
10256
+ var _a;
10257
+ const range = this.selectionStore.get('range');
10258
+ if (range &&
10259
+ !isRangeSingleCell(range)) {
10260
+ const data = this.columnService.getRangeStaticData(range, '');
10261
+ (_a = this.autoFillService) === null || _a === void 0 ? void 0 : _a.onRangeApply(data, range);
10230
10262
  }
10231
10263
  else if (this.canEdit()) {
10232
10264
  const focused = this.selectionStore.get('focus');
10265
+ if (!focused) {
10266
+ return;
10267
+ }
10233
10268
  const cell = this.columnService.getSaveData(focused.y, focused.x);
10234
10269
  this.cellEdit({
10235
10270
  rgRow: focused.y,
@@ -10266,7 +10301,10 @@ class OverlaySelection {
10266
10301
  const end = cell;
10267
10302
  const start = this.selectionStore.get('focus');
10268
10303
  if (isRangeEdit && start) {
10269
- return this.triggerRangeEvent(getRange(start, end));
10304
+ const range = getRange(start, end);
10305
+ if (range) {
10306
+ return this.triggerRangeEvent(range);
10307
+ }
10270
10308
  }
10271
10309
  return this.doFocus(cell, end);
10272
10310
  }
@@ -10327,6 +10365,7 @@ class TextEditor {
10327
10365
  constructor(column, saveCallback) {
10328
10366
  this.column = column;
10329
10367
  this.saveCallback = saveCallback;
10368
+ this.editInput = null;
10330
10369
  this.element = null;
10331
10370
  this.editCell = undefined;
10332
10371
  }
@@ -10357,7 +10396,8 @@ class TextEditor {
10357
10396
  * IMPORTANT: Prevent scroll glitches when editor is closed and focus is on current input element.
10358
10397
  */
10359
10398
  beforeDisconnect() {
10360
- this.editInput.blur();
10399
+ var _a;
10400
+ (_a = this.editInput) === null || _a === void 0 ? void 0 : _a.blur();
10361
10401
  }
10362
10402
  /**
10363
10403
  * Get value from input
@@ -10460,8 +10500,8 @@ class RevoEdit {
10460
10500
  }
10461
10501
  }
10462
10502
  componentWillRender() {
10463
- // Active editor present
10464
- if (this.currentEditor) {
10503
+ // Active editor present and not yet closed.
10504
+ if (this.currentEditor || !this.column) {
10465
10505
  return;
10466
10506
  }
10467
10507
  this.preventSaveOnClose = false;
@@ -11142,8 +11182,9 @@ class DimensionProvider {
11142
11182
  }
11143
11183
  /**
11144
11184
  * Sets dimension data and view port coordinate
11145
- * @param items - data/column items
11185
+ * @param itemCount
11146
11186
  * @param type - dimension type
11187
+ * @param noVirtual - disable virtual data
11147
11188
  */
11148
11189
  setData(itemCount, type, noVirtual = false) {
11149
11190
  this.setItemCount(itemCount, type);
@@ -11297,7 +11338,7 @@ class ThemeService {
11297
11338
  }
11298
11339
  }
11299
11340
  static getTheme(theme) {
11300
- if (allowedThemes.indexOf(theme) > -1) {
11341
+ if (theme && allowedThemes.indexOf(theme) > -1) {
11301
11342
  return theme;
11302
11343
  }
11303
11344
  return DEFAULT_THEME;
@@ -12153,10 +12194,6 @@ class SortingPlugin extends BasePlugin {
12153
12194
  constructor(revogrid, providers) {
12154
12195
  super(revogrid, providers);
12155
12196
  this.revogrid = revogrid;
12156
- // sorting order per column
12157
- this.sorting = null;
12158
- // sorting function per column, multiple columns sorting supported
12159
- this.sortingFunc = null;
12160
12197
  this.sortingPromise = null;
12161
12198
  this.postponeSort = debounce_1(async (order, comparison) => this.runSorting(order, comparison), 50);
12162
12199
  const beforeanysource = async ({ detail: { type }, }) => {
@@ -12170,7 +12207,7 @@ class SortingPlugin extends BasePlugin {
12170
12207
  }
12171
12208
  };
12172
12209
  const aftercolumnsset = async ({ detail: { order }, }) => {
12173
- const columns = await this.revogrid.getColumns();
12210
+ const columns = (await this.revogrid.getColumns());
12174
12211
  const sortingFunc = {};
12175
12212
  for (let prop in order) {
12176
12213
  const cmp = this.getComparer(ColumnDataProvider.getColumnByProp(columns, prop), order[prop]);
@@ -12216,6 +12253,7 @@ class SortingPlugin extends BasePlugin {
12216
12253
  * If additive - add to existing sorting, multiple columns can be sorted
12217
12254
  */
12218
12255
  async headerclick(column, index, additive) {
12256
+ var _a, _b;
12219
12257
  let order = this.getNextOrder(column.order);
12220
12258
  const beforeEvent = this.emit('beforesorting', { column, order, additive });
12221
12259
  if (beforeEvent.defaultPrevented) {
@@ -12256,8 +12294,8 @@ class SortingPlugin extends BasePlugin {
12256
12294
  this.sortingFunc = { [column.prop]: cmp };
12257
12295
  }
12258
12296
  else {
12259
- delete this.sorting[column.prop];
12260
- delete this.sortingFunc[column.prop];
12297
+ (_a = this.sorting) === null || _a === void 0 ? true : delete _a[column.prop];
12298
+ (_b = this.sortingFunc) === null || _b === void 0 ? true : delete _b[column.prop];
12261
12299
  }
12262
12300
  }
12263
12301
  this.startSorting(this.sorting, this.sortingFunc);
@@ -12273,8 +12311,8 @@ class SortingPlugin extends BasePlugin {
12273
12311
  async sort(sorting, sortingFunc, types = ['rgRow', 'rowPinStart', 'rowPinEnd']) {
12274
12312
  // if no sorting - reset
12275
12313
  if (!size_1(sorting)) {
12276
- this.sorting = null;
12277
- this.sortingFunc = null;
12314
+ this.sorting = undefined;
12315
+ this.sortingFunc = undefined;
12278
12316
  for (let type of types) {
12279
12317
  const store = await this.revogrid.getSourceStore(type);
12280
12318
  // row data
@@ -12319,10 +12357,10 @@ class SortingPlugin extends BasePlugin {
12319
12357
  return -1 * cmp(prop, a, b);
12320
12358
  };
12321
12359
  }
12322
- sortIndexByItems(indexes, source, sortingFunc) {
12360
+ sortIndexByItems(indexes, source, sortingFunc = {}) {
12323
12361
  // if no sorting - return unsorted indexes
12324
12362
  if (Object.entries(sortingFunc).length === 0) {
12325
- // Unsort indexes
12363
+ // Unsorted indexes
12326
12364
  return [...Array(indexes.length).keys()];
12327
12365
  }
12328
12366
  //
@@ -12338,7 +12376,7 @@ class SortingPlugin extends BasePlugin {
12338
12376
  * If the comparison function returns a non-zero value (sorted), it means that the items should be sorted based on the given property. In such a case, the function immediately returns the sorted value, indicating the order in which the items should be arranged.
12339
12377
  * If none of the comparison functions result in a non-zero value, indicating that the items are equal or should remain in the same order, the function eventually returns 0.
12340
12378
  */
12341
- const sorted = cmp(prop, itemA, itemB);
12379
+ const sorted = cmp === null || cmp === void 0 ? void 0 : cmp(prop, itemA, itemB);
12342
12380
  if (sorted) {
12343
12381
  return sorted;
12344
12382
  }
@@ -12588,13 +12626,13 @@ class ExportFilePlugin extends BasePlugin {
12588
12626
  /** Export file */
12589
12627
  async exportFile(options = {}, t = ExportTypes.csv) {
12590
12628
  const formatter = this.formatter(t, options);
12591
- const blob = await this.getBlob(formatter);
12592
12629
  // url
12593
12630
  const URL = window.URL || window.webkitURL;
12594
12631
  const a = document.createElement('a');
12595
12632
  const { filename, fileKind } = formatter.options;
12596
12633
  const name = `${filename}.${fileKind}`;
12597
- const url = URL.createObjectURL(blob);
12634
+ const blob = await this.getBlob(formatter);
12635
+ const url = blob ? URL.createObjectURL(blob) : '';
12598
12636
  a.style.display = 'none';
12599
12637
  a.setAttribute('href', url);
12600
12638
  a.setAttribute('download', name);
@@ -13019,7 +13057,7 @@ class GroupingRowPlugin extends BasePlugin {
13019
13057
  const { sourceWithGroups, depth, trimmed, oldNewIndexMap, childrenByGroup, } = gatherGrouping(source, ((_a = this.options) === null || _a === void 0 ? void 0 : _a.props) || [], Object.assign({ prevExpanded }, options));
13020
13058
  // setup source
13021
13059
  this.providers.data.setData(sourceWithGroups, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, { depth, customRenderer: options === null || options === void 0 ? void 0 : options.groupLabelTemplate }, true);
13022
- this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes, oldNewIndexMap);
13060
+ this.updateTrimmed(trimmed, childrenByGroup, oldNewIndexes !== null && oldNewIndexes !== void 0 ? oldNewIndexes : {}, oldNewIndexMap);
13023
13061
  }
13024
13062
  /**
13025
13063
  * Apply grouping on data set
@@ -13085,7 +13123,7 @@ class GroupingRowPlugin extends BasePlugin {
13085
13123
  this.providers.data.setData(source, GROUPING_ROW_TYPE, this.revogrid.disableVirtualY, undefined, true);
13086
13124
  this.updateTrimmed(undefined, undefined, oldNewIndexes);
13087
13125
  }
13088
- updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap, secondLevelMap) {
13126
+ updateTrimmed(trimmedGroup = {}, _childrenByGroup = {}, firstLevelMap = {}, secondLevelMap) {
13089
13127
  // map previously trimmed data
13090
13128
  const trimemedOptionsToUpgrade = processDoubleConversionTrimmed(this.trimmed, firstLevelMap, secondLevelMap);
13091
13129
  for (let type in trimemedOptionsToUpgrade) {
@@ -13123,6 +13161,25 @@ function getLastCell(data, rowType) {
13123
13161
  y: lastVisibleRowCount,
13124
13162
  };
13125
13163
  }
13164
+ function viewportDataPartition(data, type, slot, fixed) {
13165
+ return {
13166
+ colData: data.colStore,
13167
+ viewportCol: data.viewports[data.colType].store,
13168
+ viewportRow: data.viewports[type].store,
13169
+ // lastCell is the last real coordinate + 1
13170
+ lastCell: getLastCell(data, type),
13171
+ slot,
13172
+ type,
13173
+ canDrag: !fixed,
13174
+ position: data.position,
13175
+ dataStore: data.rowStores[type].store,
13176
+ dimensionCol: data.dimensions[data.colType].store,
13177
+ dimensionRow: data.dimensions[type].store,
13178
+ style: fixed
13179
+ ? { height: `${data.dimensions[type].store.get('realSize')}px` }
13180
+ : undefined,
13181
+ };
13182
+ }
13126
13183
 
13127
13184
  /** Collect Column data */
13128
13185
  function gatherColumnData(data) {
@@ -13205,11 +13262,9 @@ class ViewportService {
13205
13262
  segmentSelection.setLastCell(rgRow.lastCell);
13206
13263
  // register selection store for Row
13207
13264
  const rowSelectionStore = this.registerRow(rgRow.position.y, rgRow.type);
13208
- const rowDef = Object.assign(Object.assign({}, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
13265
+ const rowDef = Object.assign(Object.assign({ colType: val }, rgRow), { rowSelectionStore, segmentSelectionStore: segmentSelection.store, ref: (e) => config.selectionStoreConnector.registerSection(e), onSetrange: e => {
13209
13266
  segmentSelection.setRangeArea(e.detail);
13210
- }, onSettemprange: e => {
13211
- segmentSelection.setTempArea(e.detail);
13212
- }, onFocuscell: e => {
13267
+ }, onSettemprange: e => segmentSelection.setTempArea(e.detail), onFocuscell: e => {
13213
13268
  // todo: multi focus
13214
13269
  segmentSelection.clearFocus();
13215
13270
  config.selectionStoreConnector.focus(segmentSelection, e.detail);
@@ -13259,43 +13314,27 @@ class ViewportService {
13259
13314
  };
13260
13315
  // y position for selection
13261
13316
  let y = 0;
13262
- return rowTypes.reduce((r, type) => {
13317
+ return rowTypes.reduce((result, type) => {
13263
13318
  // filter out empty sources, we still need to return source to keep slot working
13264
13319
  const isPresent = data.viewports[type].store.get('realCount') || type === 'rgRow';
13265
13320
  const rgCol = Object.assign(Object.assign({}, data), { position: Object.assign(Object.assign({}, data.position), { y: isPresent ? y : EMPTY_INDEX }) });
13266
- r.push(this.dataPartition(rgCol, type, slots[type], type !== 'rgRow'));
13321
+ const partition = viewportDataPartition(rgCol, type, slots[type], type !== 'rgRow');
13322
+ result.push(partition);
13267
13323
  if (isPresent) {
13268
13324
  y++;
13269
13325
  }
13270
- return r;
13326
+ return result;
13271
13327
  }, []);
13272
13328
  }
13273
- dataPartition(data, type, slot, fixed) {
13274
- return {
13275
- colData: data.colStore,
13276
- viewportCol: data.viewports[data.colType].store,
13277
- viewportRow: data.viewports[type].store,
13278
- // lastCell is the last real coordinate + 1
13279
- lastCell: getLastCell(data, type),
13280
- slot,
13281
- type,
13282
- canDrag: !fixed,
13283
- position: data.position,
13284
- dataStore: data.rowStores[type].store,
13285
- dimensionCol: data.dimensions[data.colType].store,
13286
- dimensionRow: data.dimensions[type].store,
13287
- style: fixed
13288
- ? { height: `${data.dimensions[type].store.get('realSize')}px` }
13289
- : undefined,
13290
- };
13291
- }
13292
13329
  scrollToCell(cell) {
13293
13330
  for (let key in cell) {
13294
13331
  const coordinate = cell[key];
13295
- this.config.scrollingService.proxyScroll({
13296
- dimension: key === 'x' ? 'rgCol' : 'rgRow',
13297
- coordinate,
13298
- });
13332
+ if (typeof coordinate === 'number') {
13333
+ this.config.scrollingService.proxyScroll({
13334
+ dimension: key === 'x' ? 'rgCol' : 'rgRow',
13335
+ coordinate,
13336
+ });
13337
+ }
13299
13338
  }
13300
13339
  }
13301
13340
  /**
@@ -13331,22 +13370,30 @@ class ViewportService {
13331
13370
  }
13332
13371
  getStoreCoordinateByType(colType, rowType) {
13333
13372
  const stores = this.config.selectionStoreConnector.storesByType;
13334
- const storeCoordinate = {
13373
+ if (typeof stores[colType] === 'undefined' || typeof stores[rowType] === 'undefined') {
13374
+ return;
13375
+ }
13376
+ return {
13335
13377
  x: stores[colType],
13336
13378
  y: stores[rowType],
13337
13379
  };
13338
- return storeCoordinate;
13339
13380
  }
13340
13381
  setFocus(colType, rowType, start, end) {
13341
13382
  var _a;
13342
- (_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.focusByCell(this.getStoreCoordinateByType(colType, rowType), start, end);
13383
+ const coordinate = this.getStoreCoordinateByType(colType, rowType);
13384
+ if (coordinate) {
13385
+ (_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.focusByCell(coordinate, start, end);
13386
+ }
13343
13387
  }
13344
13388
  getSelectedRange() {
13345
13389
  return this.config.selectionStoreConnector.selectedRange;
13346
13390
  }
13347
13391
  setEdit(rowIndex, colIndex, colType, rowType) {
13348
13392
  var _a;
13349
- (_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEditByCell(this.getStoreCoordinateByType(colType, rowType), { x: colIndex, y: rowIndex });
13393
+ const coordinate = this.getStoreCoordinateByType(colType, rowType);
13394
+ if (coordinate) {
13395
+ (_a = this.config.selectionStoreConnector) === null || _a === void 0 ? void 0 : _a.setEditByCell(coordinate, { x: colIndex, y: rowIndex });
13396
+ }
13350
13397
  }
13351
13398
  }
13352
13399
 
@@ -13357,7 +13404,7 @@ class GridScrollingService {
13357
13404
  }
13358
13405
  async proxyScroll(e, key) {
13359
13406
  var _a;
13360
- let newEvent;
13407
+ let newEventPromise;
13361
13408
  let event = e;
13362
13409
  for (let elKey in this.elements) {
13363
13410
  // skip
@@ -13371,7 +13418,7 @@ class GridScrollingService {
13371
13418
  }
13372
13419
  for (let el of this.elements[elKey]) {
13373
13420
  if (el.changeScroll) {
13374
- newEvent = el.changeScroll(e);
13421
+ newEventPromise = el.changeScroll(e);
13375
13422
  }
13376
13423
  }
13377
13424
  }
@@ -13381,8 +13428,9 @@ class GridScrollingService {
13381
13428
  }
13382
13429
  }
13383
13430
  }
13431
+ const newEvent = await newEventPromise;
13384
13432
  if (newEvent) {
13385
- event = await newEvent;
13433
+ event = newEvent;
13386
13434
  }
13387
13435
  this.setViewport(event);
13388
13436
  }
@@ -13582,14 +13630,15 @@ function isStretchPlugin(plugin) {
13582
13630
  const rowDefinitionByType = (newVal = []) => {
13583
13631
  const result = {};
13584
13632
  for (const v of newVal) {
13585
- if (!result[v.type]) {
13586
- result[v.type] = {};
13633
+ let rowDefs = result[v.type];
13634
+ if (!rowDefs) {
13635
+ rowDefs = result[v.type] = {};
13587
13636
  }
13588
13637
  if (v.size) {
13589
- if (!result[v.type].sizes) {
13590
- result[v.type].sizes = {};
13638
+ if (!rowDefs.sizes) {
13639
+ rowDefs.sizes = {};
13591
13640
  }
13592
- result[v.type].sizes[v.index] = v.size;
13641
+ rowDefs.sizes[v.index] = v.size;
13593
13642
  }
13594
13643
  }
13595
13644
  return result;
@@ -13597,11 +13646,12 @@ const rowDefinitionByType = (newVal = []) => {
13597
13646
  const rowDefinitionRemoveByType = (oldVal = []) => {
13598
13647
  const result = {};
13599
13648
  for (const v of oldVal) {
13600
- if (!result[v.type]) {
13601
- result[v.type] = [];
13649
+ let rowDefs = result[v.type];
13650
+ if (!rowDefs) {
13651
+ rowDefs = result[v.type] = [];
13602
13652
  }
13603
13653
  if (v.size) {
13604
- result[v.type].push(v.index);
13654
+ rowDefs.push(v.index);
13605
13655
  }
13606
13656
  }
13607
13657
  return result;
@@ -13721,6 +13771,7 @@ const defaultProps = (props) => {
13721
13771
  };
13722
13772
  class ResizeDirective {
13723
13773
  constructor(initialProps, $event) {
13774
+ var _a, _b;
13724
13775
  this.initialProps = initialProps;
13725
13776
  this.$event = $event;
13726
13777
  this.mouseX = 0;
@@ -13735,8 +13786,8 @@ class ResizeDirective {
13735
13786
  this.mouseUpFunc = this.handleUp.bind(this);
13736
13787
  this.minW = this.props.minWidth;
13737
13788
  this.minH = this.props.minHeight;
13738
- this.maxW = this.props.maxWidth;
13739
- this.maxH = this.props.maxHeight;
13789
+ this.maxW = (_a = this.props.maxWidth) !== null && _a !== void 0 ? _a : 0;
13790
+ this.maxH = (_b = this.props.maxHeight) !== null && _b !== void 0 ? _b : 0;
13740
13791
  this.parent = { width: 0, height: 0 };
13741
13792
  this.resizeState = 0;
13742
13793
  }
@@ -13871,13 +13922,14 @@ class ResizeDirective {
13871
13922
  this.unbindMove();
13872
13923
  }
13873
13924
  setInitials({ clientX, clientY }, target) {
13925
+ var _a, _b, _c, _d;
13874
13926
  const computedStyle = getComputedStyle(this.$el);
13875
13927
  this.$el.classList.add('active');
13876
13928
  this.activeResizer = target;
13877
13929
  if (this.disableCalcMap & DISABLE_MASK.w) {
13878
13930
  this.mouseX = clientX;
13879
13931
  this.width = this.$el.clientWidth;
13880
- this.parent.width = this.$el.parentElement.clientWidth;
13932
+ this.parent.width = (_b = (_a = this.$el.parentElement) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0;
13881
13933
  // min width
13882
13934
  const minPaddingX = parseFloat(computedStyle.paddingLeft) +
13883
13935
  parseFloat(computedStyle.paddingRight);
@@ -13890,7 +13942,7 @@ class ResizeDirective {
13890
13942
  if (this.disableCalcMap & DISABLE_MASK.h) {
13891
13943
  this.mouseY = clientY;
13892
13944
  this.height = this.$el.clientHeight;
13893
- this.parent.height = this.$el.parentElement.clientHeight;
13945
+ this.parent.height = (_d = (_c = this.$el.parentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
13894
13946
  // min height
13895
13947
  const minPaddingY = parseFloat(computedStyle.paddingTop) +
13896
13948
  parseFloat(computedStyle.paddingBottom);
@@ -13908,7 +13960,7 @@ class ResizeDirective {
13908
13960
  this.activeResizer.removeAttribute('style');
13909
13961
  }
13910
13962
  this.$el.classList.remove('active');
13911
- this.activeResizer = null;
13963
+ this.activeResizer = undefined;
13912
13964
  }
13913
13965
  bindMove() {
13914
13966
  document.documentElement.addEventListener('mouseup', this.mouseUpFunc, true);
@@ -13957,7 +14009,7 @@ const ResizableElement = (props, children) => {
13957
14009
  }
13958
14010
  }
13959
14011
  }
13960
- return (hAsync("div", Object.assign({}, props, { ref: (e) => directive === null || directive === void 0 ? void 0 : directive.set(e) }),
14012
+ return (hAsync("div", Object.assign({}, props, { ref: (e) => e && (directive === null || directive === void 0 ? void 0 : directive.set(e)) }),
13961
14013
  children,
13962
14014
  resizeEls));
13963
14015
  };
@@ -14086,7 +14138,7 @@ class ColumnPlugin extends BasePlugin {
14086
14138
  }
14087
14139
  onMouseUp(e) {
14088
14140
  // apply new positions
14089
- if (this.dragData) {
14141
+ if (this.dragData && this.staticDragData) {
14090
14142
  let relativePos = getLeftRelative(e.x, this.dragData.gridRect.left, this.dragData.scrollOffset);
14091
14143
  if (relativePos < 0) {
14092
14144
  relativePos = 0;
@@ -14203,9 +14255,6 @@ class RevoGridComponent {
14203
14255
  this.aftergridinit = createEvent(this, "aftergridinit", 7);
14204
14256
  this.additionaldatachanged = createEvent(this, "additionaldatachanged", 7);
14205
14257
  this.afterthemechanged = createEvent(this, "afterthemechanged", 7);
14206
- // #endregion
14207
- // #region Listeners outside scope
14208
- this.clickTrackForFocusClear = null;
14209
14258
  this.extraElements = [];
14210
14259
  this.viewport = null;
14211
14260
  this.isInited = false;
@@ -14377,6 +14426,7 @@ class RevoGridComponent {
14377
14426
  * @param column - full column details to update
14378
14427
  * @param index - virtual column index
14379
14428
  * @param order - order to apply
14429
+ * @param additive - if false will replace current order
14380
14430
  */
14381
14431
  async updateColumnSorting(column, index, order, additive) {
14382
14432
  return this.columnProvider.updateColumnSorting(column, index, order, additive);
@@ -14415,8 +14465,8 @@ class RevoGridComponent {
14415
14465
  * Get the currently focused cell.
14416
14466
  */
14417
14467
  async getFocused() {
14418
- var _a;
14419
- return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused();
14468
+ var _a, _b;
14469
+ return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getFocused()) !== null && _b !== void 0 ? _b : null;
14420
14470
  }
14421
14471
  /**
14422
14472
  * Get size of content
@@ -14430,8 +14480,8 @@ class RevoGridComponent {
14430
14480
  * Get the currently selected Range.
14431
14481
  */
14432
14482
  async getSelectedRange() {
14433
- var _a;
14434
- return (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange();
14483
+ var _a, _b;
14484
+ return (_b = (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.getSelectedRange()) !== null && _b !== void 0 ? _b : null;
14435
14485
  }
14436
14486
  mousedownHandle(event) {
14437
14487
  const screenX = getPropertyFromEvent(event, 'screenX');
@@ -14444,7 +14494,8 @@ class RevoGridComponent {
14444
14494
  /**
14445
14495
  * To keep your elements from losing focus use mouseup/touchend e.preventDefault();
14446
14496
  */
14447
- mouseupHandle(event) {
14497
+ async mouseupHandle(event) {
14498
+ var _a;
14448
14499
  const screenX = getPropertyFromEvent(event, 'screenX');
14449
14500
  const screenY = getPropertyFromEvent(event, 'screenY');
14450
14501
  if (screenX === null || screenY === null) {
@@ -14455,16 +14506,16 @@ class RevoGridComponent {
14455
14506
  }
14456
14507
  const pos = screenX + screenY;
14457
14508
  // detect if mousemove then do nothing
14458
- if (Math.abs(this.clickTrackForFocusClear - pos) > 10) {
14509
+ if (Math.abs(((_a = this.clickTrackForFocusClear) !== null && _a !== void 0 ? _a : 0) - pos) > 10) {
14459
14510
  return;
14460
14511
  }
14461
- // Check if action finished inside of the document
14462
- // if event prevented or it is current table don't clear focus
14512
+ // Check if action finished inside the document
14513
+ // if event prevented, or it is current table don't clear focus
14463
14514
  const path = event.composedPath();
14464
14515
  if (!path.includes(this.element) &&
14465
- !path.includes(this.element.shadowRoot)) {
14516
+ !(this.element.shadowRoot && path.includes(this.element.shadowRoot))) {
14466
14517
  // Perform actions if the click is outside the component
14467
- this.clearFocus();
14518
+ await this.clearFocus();
14468
14519
  }
14469
14520
  }
14470
14521
  // #endregion
@@ -14674,15 +14725,12 @@ class RevoGridComponent {
14674
14725
  let grPlugin;
14675
14726
  for (let p of this.internalPlugins) {
14676
14727
  const isGrouping = p;
14677
- if (isGrouping.setGrouping) {
14728
+ if (!!isGrouping.setGrouping) {
14678
14729
  grPlugin = isGrouping;
14679
14730
  break;
14680
14731
  }
14681
14732
  }
14682
- if (!grPlugin) {
14683
- return;
14684
- }
14685
- grPlugin.setGrouping(newVal || {});
14733
+ grPlugin === null || grPlugin === void 0 ? void 0 : grPlugin.setGrouping(newVal || {});
14686
14734
  }
14687
14735
  /**
14688
14736
  * Stretch Plugin Apply
@@ -14766,7 +14814,7 @@ class RevoGridComponent {
14766
14814
  (_a = this.plugins) === null || _a === void 0 ? void 0 : _a.forEach(p => this.internalPlugins.push(new p(this.element, pluginData)));
14767
14815
  }
14768
14816
  removePlugins() {
14769
- this.internalPlugins.forEach(p => p.destroy());
14817
+ this.internalPlugins.forEach(p => { var _a; return (_a = p.destroy) === null || _a === void 0 ? void 0 : _a.call(p); });
14770
14818
  this.internalPlugins = [];
14771
14819
  }
14772
14820
  // #endregion
@@ -14866,7 +14914,7 @@ class RevoGridComponent {
14866
14914
  const headerProperties = Object.assign(Object.assign({}, view.headerProp), { type: view.type, additionalData: this.additionalData, viewportCol: view.viewportCol, selectionStore: view.columnSelectionStore, canResize: this.resize, readonly: this.readonly, columnFilter: !!this.filter });
14867
14915
  // Column headers
14868
14916
  const dataViews = [
14869
- hAsync("revogr-header", Object.assign({ key: 'ff8eefd6db3baf494c015a2ea573160d27739aa9' }, headerProperties, { slot: HEADER_SLOT })),
14917
+ hAsync("revogr-header", Object.assign({ key: 'b08c837765cf20c88cb5b253a876f0f442c31628' }, headerProperties, { slot: HEADER_SLOT })),
14870
14918
  ];
14871
14919
  // Render viewport data (vertical sections)
14872
14920
  view.dataPorts.forEach(data => {
@@ -14888,11 +14936,12 @@ class RevoGridComponent {
14888
14936
  const typeCol = 'rgCol';
14889
14937
  const viewports = this.viewportProvider.stores;
14890
14938
  const dimensions = this.dimensionProvider.stores;
14891
- return (hAsync(Host, { key: '21bbe81595f20f7bcb271f28c9c86feef472efec' }, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { key: '7a3092cd02305a0dfaa3b3d3160164001f0ed08b', class: "main-viewport", onClick: (e) => {
14939
+ return (hAsync(Host, { key: '057a2cf1a64aaeec12d2aca17b09316fb3cbfde6' }, this.hideAttribution ? null : (hAsync("revogr-attribution", { class: "attribution" })), hAsync("div", { key: 'e89e3d136d756f80421f42f47e09583985edb1bc', class: "main-viewport", onClick: (e) => {
14940
+ var _a;
14892
14941
  if (e.currentTarget === e.target) {
14893
- this.viewport.clearEdit();
14942
+ (_a = this.viewport) === null || _a === void 0 ? void 0 : _a.clearEdit();
14894
14943
  }
14895
- } }, hAsync("div", { key: 'ae1dfccbb72cc2a9f7fa370889746c702d106045', class: "viewports" }, hAsync("slot", { key: '0725b46d877fbb63fb513845cc1c7b86d0f856b8', name: "viewport" }), viewportSections, hAsync("revogr-scroll-virtual", { key: 'd41771f6ff459f1f6747ce496c8165b1dab44963', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), hAsync(OrderRenderer, { key: '2914421478450c9b198e0aade898ed342e4d7f6a', ref: e => (this.orderService = e) }))), hAsync("revogr-scroll-virtual", { key: 'bc1812c5ce54cda01e81cc06e28c69dc8e36fdf3', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
14944
+ } }, hAsync("div", { key: '177db78970907d36b8d56549386a18a683573944', class: "viewports" }, hAsync("slot", { key: '481d830a232b1969fcaa2519a5306fafaff58fb4', name: "viewport" }), viewportSections, hAsync("revogr-scroll-virtual", { key: '6a123b2e84bec95d7a63a73322fe167248e8415e', class: "vertical", dimension: typeRow, viewportStore: viewports[typeRow].store, dimensionStore: dimensions[typeRow].store, ref: el => this.scrollingService.registerElement(el, 'rowScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), hAsync(OrderRenderer, { key: 'fea1be24668f2039746fff93d0ab5e76d932a166', ref: e => (this.orderService = e) }))), hAsync("revogr-scroll-virtual", { key: '74c6e05c81b2782320755c910b098edf8858d6db', class: "horizontal", dimension: typeCol, viewportStore: viewports[typeCol].store, dimensionStore: dimensions[typeCol].store, ref: el => this.scrollingService.registerElement(el, 'colScroll'), onScrollvirtual: e => this.scrollingService.proxyScroll(e.detail) }), this.extraElements));
14896
14945
  }
14897
14946
  disconnectedCallback() {
14898
14947
  // Remove all plugins, to avoid memory leaks and unexpected behaviour when the component is removed
@@ -15104,10 +15153,13 @@ function renderCell(v) {
15104
15153
  // Row drag
15105
15154
  if (v.model.column.rowDrag &&
15106
15155
  isRowDragService(v.model.column.rowDrag, v.model)) {
15107
- els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => v.dragStartCell.emit({
15108
- originalEvent,
15109
- model: v.model,
15110
- }) },
15156
+ els.push(hAsync("span", { class: DRAGGABLE_CLASS, onMouseDown: originalEvent => {
15157
+ var _a;
15158
+ return (_a = v.dragStartCell) === null || _a === void 0 ? void 0 : _a.emit({
15159
+ originalEvent,
15160
+ model: v.model,
15161
+ });
15162
+ } },
15111
15163
  hAsync("span", { class: DRAG_ICON_CLASS })));
15112
15164
  }
15113
15165
  els.push(`${getCellData(v.model.model[v.model.prop])}`);
@@ -15741,7 +15793,8 @@ const HeaderRenderer = (p) => {
15741
15793
  },
15742
15794
  onResize: p.onResize,
15743
15795
  onDoubleClick(originalEvent) {
15744
- p.onDoubleClick({
15796
+ var _a;
15797
+ (_a = p.onDoubleClick) === null || _a === void 0 ? void 0 : _a.call(p, {
15745
15798
  column: p.data,
15746
15799
  index: p.column.itemIndex,
15747
15800
  originalEvent,
@@ -15806,7 +15859,7 @@ const ColumnGroupsRenderer = ({ additionalData, providers, depth, groups, visibl
15806
15859
  // coordinates
15807
15860
  const groupStart = getItemByIndex(dimensionCol, groupStartIndex).start;
15808
15861
  const groupEnd = getItemByIndex(dimensionCol, groupEndIndex).end;
15809
- groupRow.push(hAsync(GroupHeaderRenderer, { providers: providers, start: groupStart, end: groupEnd, group: group, active: active, canResize: canResize, onResize: e => onResize(e.changedX, groupStartIndex, groupEndIndex), additionalData: additionalData }));
15862
+ groupRow.push(hAsync(GroupHeaderRenderer, { providers: providers, start: groupStart, end: groupEnd, group: group, active: active, canResize: canResize, onResize: e => { var _a; return onResize((_a = e.changedX) !== null && _a !== void 0 ? _a : 0, groupStartIndex, groupEndIndex); }, additionalData: additionalData }));
15810
15863
  }
15811
15864
  }
15812
15865
  }
@@ -15973,7 +16026,7 @@ class RevogrRowHeaders {
15973
16026
  const viewportHeader = Object.assign(Object.assign({}, this.headerProp), { colData: typeof this.rowHeaderColumn === 'object' ? [this.rowHeaderColumn] : [], viewportCol: viewport.store, canResize: false, type: ROW_HEADER_TYPE,
15974
16027
  // parent,
15975
16028
  slot: HEADER_SLOT });
15976
- return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: 'efaaa386cb5ea8b848d42e3407dbde8ad99d1db8' }, viewportScroll, { "row-header": true }), hAsync("revogr-header", Object.assign({ key: '57fb6d08cd094f9b19145ff65c3ab805992fbb68' }, viewportHeader)), dataViews)));
16029
+ return (hAsync(Host, { class: { [ROW_HEADER_TYPE]: true }, key: ROW_HEADER_TYPE }, hAsync("revogr-viewport-scroll", Object.assign({ key: '743c1dbaed3edf679c0616a2b79171a43d94806f' }, viewportScroll, { "row-header": true }), hAsync("revogr-header", Object.assign({ key: '53f1f64b1358d7828a5e45807915740ef198df21' }, viewportHeader)), dataViews)));
15977
16030
  }
15978
16031
  static get cmpMeta() { return {
15979
16032
  "$flags$": 0,
@@ -16087,7 +16140,7 @@ class LocalScrollService {
16087
16140
  if (c < 0) {
16088
16141
  return NO_COORDINATE;
16089
16142
  }
16090
- if (c > param.maxSize) {
16143
+ if (typeof param.maxSize === 'number' && c > param.maxSize) {
16091
16144
  return param.maxSize;
16092
16145
  }
16093
16146
  return c;
@@ -16100,8 +16153,9 @@ class LocalScrollService {
16100
16153
  }
16101
16154
  /* convert virtual to real and back, scale range */
16102
16155
  convert(pos, param, toReal = true) {
16156
+ var _a;
16103
16157
  const minRange = param.clientSize;
16104
- const from = [0, param.virtualContentSize - minRange];
16158
+ const from = [0, ((_a = param.virtualContentSize) !== null && _a !== void 0 ? _a : minRange) - minRange];
16105
16159
  const to = [0, param.contentSize - param.virtualSize];
16106
16160
  if (toReal) {
16107
16161
  return scaleValue(pos, from, to);
@@ -16143,7 +16197,7 @@ class AutohideScrollPlugin {
16143
16197
  show(element, timeout) {
16144
16198
  clearTimeout(timeout);
16145
16199
  return Number(setTimeout(() => {
16146
- element.removeAttribute('visible');
16200
+ element === null || element === void 0 ? void 0 : element.removeAttribute('visible');
16147
16201
  }, 1000));
16148
16202
  }
16149
16203
  clear() {
@@ -16383,8 +16437,9 @@ class RevogrViewportScroll {
16383
16437
  * @param e
16384
16438
  */
16385
16439
  async changeScroll(e, silent = false) {
16440
+ var _a, _b;
16386
16441
  if (silent) {
16387
- if (e.coordinate) {
16442
+ if (e.coordinate && this.verticalScroll) {
16388
16443
  switch (e.dimension) {
16389
16444
  // for mobile devices to skip negative scroll loop. only on vertical scroll
16390
16445
  case 'rgRow':
@@ -16392,7 +16447,7 @@ class RevogrViewportScroll {
16392
16447
  break;
16393
16448
  }
16394
16449
  }
16395
- return null;
16450
+ return;
16396
16451
  }
16397
16452
  if (e.delta) {
16398
16453
  switch (e.dimension) {
@@ -16400,7 +16455,7 @@ class RevogrViewportScroll {
16400
16455
  e.coordinate = this.horizontalScroll.scrollLeft + e.delta;
16401
16456
  break;
16402
16457
  case 'rgRow':
16403
- e.coordinate = this.verticalScroll.scrollTop + e.delta;
16458
+ e.coordinate = ((_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0) + e.delta;
16404
16459
  break;
16405
16460
  }
16406
16461
  this.setScroll(e);
@@ -16448,11 +16503,13 @@ class RevogrViewportScroll {
16448
16503
  this.horizontalScroll.scrollLeft = e.coordinate;
16449
16504
  break;
16450
16505
  case 'rgRow':
16451
- // this will trigger on scroll event
16452
- this.verticalScroll.scrollTop = e.coordinate;
16453
- // for mobile devices to skip negative scroll loop. only on vertical scroll
16454
- if (this.verticalScroll.style.transform) {
16455
- this.verticalScroll.style.transform = '';
16506
+ if (this.verticalScroll) {
16507
+ // this will trigger on scroll event
16508
+ this.verticalScroll.scrollTop = e.coordinate;
16509
+ // for mobile devices to skip negative scroll loop. only on vertical scroll
16510
+ if (this.verticalScroll.style.transform) {
16511
+ this.verticalScroll.style.transform = '';
16512
+ }
16456
16513
  }
16457
16514
  break;
16458
16515
  }
@@ -16463,23 +16520,23 @@ class RevogrViewportScroll {
16463
16520
  // track horizontal viewport resize
16464
16521
  this.resizeService = new GridResizeService(this.horizontalScroll, {
16465
16522
  resize: entries => {
16466
- var _a, _b, _c;
16523
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
16467
16524
  let height = ((_a = entries[0]) === null || _a === void 0 ? void 0 : _a.contentRect.height) || 0;
16468
16525
  if (height) {
16469
- height -= this.header.clientHeight + this.footer.clientHeight;
16526
+ height -= ((_c = (_b = this.header) === null || _b === void 0 ? void 0 : _b.clientHeight) !== null && _c !== void 0 ? _c : 0) + ((_e = (_d = this.footer) === null || _d === void 0 ? void 0 : _d.clientHeight) !== null && _e !== void 0 ? _e : 0);
16470
16527
  }
16471
16528
  const els = {
16472
16529
  rgRow: {
16473
16530
  size: height,
16474
16531
  contentSize: this.contentHeight,
16475
- scroll: this.verticalScroll.scrollTop,
16532
+ scroll: (_f = this.verticalScroll) === null || _f === void 0 ? void 0 : _f.scrollTop,
16476
16533
  noScroll: false,
16477
16534
  },
16478
16535
  rgCol: {
16479
- size: ((_b = entries[0]) === null || _b === void 0 ? void 0 : _b.contentRect.width) || 0,
16536
+ size: ((_g = entries[0]) === null || _g === void 0 ? void 0 : _g.contentRect.width) || 0,
16480
16537
  contentSize: this.contentWidth,
16481
16538
  scroll: this.horizontalScroll.scrollLeft,
16482
- noScroll: this.colType !== 'rgCol' ? true : false,
16539
+ noScroll: this.colType !== 'rgCol',
16483
16540
  },
16484
16541
  };
16485
16542
  for (const [dim, item] of Object.entries(els)) {
@@ -16488,7 +16545,7 @@ class RevogrViewportScroll {
16488
16545
  if (item.noScroll) {
16489
16546
  continue;
16490
16547
  }
16491
- (_c = this.localScrollService) === null || _c === void 0 ? void 0 : _c.scroll(item.scroll, dimension, true);
16548
+ (_h = this.localScrollService) === null || _h === void 0 ? void 0 : _h.scroll((_j = item.scroll) !== null && _j !== void 0 ? _j : 0, dimension, true);
16492
16549
  // track scroll visibility on outer element change
16493
16550
  this.setScrollVisibility(dimension, item.size, item.contentSize);
16494
16551
  }
@@ -16518,10 +16575,10 @@ class RevogrViewportScroll {
16518
16575
  }
16519
16576
  // based on scroll visibility assign or remove class and event
16520
16577
  if (hasScroll) {
16521
- el.classList.add(`scroll-${type}`);
16578
+ el === null || el === void 0 ? void 0 : el.classList.add(`scroll-${type}`);
16522
16579
  }
16523
16580
  else {
16524
- el.classList.remove(`scroll-${type}`);
16581
+ el === null || el === void 0 ? void 0 : el.classList.remove(`scroll-${type}`);
16525
16582
  }
16526
16583
  this.scrollchange.emit({ type, hasScroll });
16527
16584
  }
@@ -16529,6 +16586,7 @@ class RevogrViewportScroll {
16529
16586
  this.resizeService.destroy();
16530
16587
  }
16531
16588
  async componentDidRender() {
16589
+ var _a, _b, _c, _d;
16532
16590
  // scroll update if number of rows changed
16533
16591
  if (this.contentHeight < this.oldValY && this.verticalScroll) {
16534
16592
  this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;
@@ -16541,7 +16599,7 @@ class RevogrViewportScroll {
16541
16599
  this.oldValX = this.contentWidth;
16542
16600
  this.localScrollService.setParams({
16543
16601
  contentSize: this.contentHeight,
16544
- clientSize: this.verticalScroll.clientHeight,
16602
+ clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
16545
16603
  virtualSize: 0,
16546
16604
  }, 'rgRow');
16547
16605
  this.localScrollService.setParams({
@@ -16549,11 +16607,11 @@ class RevogrViewportScroll {
16549
16607
  clientSize: this.horizontalScroll.clientWidth,
16550
16608
  virtualSize: 0,
16551
16609
  }, 'rgCol');
16552
- this.setScrollVisibility('rgRow', this.verticalScroll.clientHeight, this.contentHeight);
16610
+ this.setScrollVisibility('rgRow', (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0, this.contentHeight);
16553
16611
  this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
16554
16612
  }
16555
16613
  render() {
16556
- return (hAsync(Host, { key: '485d211d22fd720192de2206afef46545339902e', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'e3d17c747ec3f525c2947a6fa2e4652ed0f498d9', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, hAsync("div", { key: 'f8fb5652593c76f676d57762911af866f46ce31d', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '6d96653adf4d23208a6091dab42000235d696b48', name: HEADER_SLOT })), hAsync("div", { key: 'afcfcdaeacfe01fa3d8fabc30db36f5aecb24ad3', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: 'f6ba7b1d8621fcb2ea8565cdea6a75e6abca9d35', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, hAsync("slot", { key: 'e5377e124212312859b05431053bcd81543d8193', name: CONTENT_SLOT }))), hAsync("div", { key: '3e990a197388391d393c607c18441b363d60ab53', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: 'ae7eb7bde5e8798247b4d2a67ae622ba496c44f9', name: FOOTER_SLOT })))));
16614
+ return (hAsync(Host, { key: '8395ce30127f30fff81dc67bfe2f4c3b087b2007', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, hAsync("div", { key: 'efd2db0f5b22b394e93923926f86f2ab9bffb8e0', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, hAsync("div", { key: '2794c7187ec23ac45dab5f6cb3f20ba59102b2a7', class: "header-wrapper", ref: e => (this.header = e) }, hAsync("slot", { key: '1a344d7e5cf58d77818390e8d541de88a75399d0', name: HEADER_SLOT })), hAsync("div", { key: '2aeb56f4bf3f3fc60eaeaffd8c18565beaa127ca', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, hAsync("div", { key: '59482ef73d3c4617c2511b8613056bbc200cd089', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, hAsync("slot", { key: 'f318ab365e5f6eddcd2812a314f55cac0959c3b4', name: CONTENT_SLOT }))), hAsync("div", { key: '265c036107a8ed3d47b767fec10ae0225cc927cf', class: "footer-wrapper", ref: e => (this.footer = e) }, hAsync("slot", { key: '2aa7e178375b462e666cf067e075856f592714b6', name: FOOTER_SLOT })))));
16557
16615
  }
16558
16616
  /**
16559
16617
  * Extra layer for scroll event monitoring, where MouseWheel event is not passing
@@ -16596,10 +16654,11 @@ class RevogrViewportScroll {
16596
16654
  * @param e
16597
16655
  */
16598
16656
  onVerticalMouseWheel(type, delta, e) {
16599
- var _a, _b;
16657
+ var _a, _b, _c, _d;
16600
16658
  (_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
16601
- const pos = this.verticalScroll.scrollTop + e[delta];
16602
- (_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(pos, type, undefined, e[delta]);
16659
+ const scrollTop = (_c = (_b = this.verticalScroll) === null || _b === void 0 ? void 0 : _b.scrollTop) !== null && _c !== void 0 ? _c : 0;
16660
+ const pos = scrollTop + e[delta];
16661
+ (_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
16603
16662
  this.localScrollTimer.latestScrollUpdate(type);
16604
16663
  }
16605
16664
  /**
@@ -16656,9 +16715,9 @@ class VNodeToHtml {
16656
16715
  });
16657
16716
  }
16658
16717
  render() {
16659
- var _a;
16660
- this.vnodes = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this);
16661
- return (hAsync(Host, { key: '12ecb44c9ee03f85060c4dac3a090e2a0338c148', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
16718
+ var _a, _b;
16719
+ this.vnodes = (_b = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : null;
16720
+ return (hAsync(Host, { key: 'dcaa7c6bd2f1eef1dd9a7f95a723f8ec778681a0', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
16662
16721
  }
16663
16722
  get el() { return getElement(this); }
16664
16723
  static get cmpMeta() { return {