@revolist/revogrid 4.9.41 → 4.9.42

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 (403) hide show
  1. package/dist/cjs/app-globals-c0b20747.js.map +1 -1
  2. package/dist/cjs/{column.drag.plugin-fcd892ec.js → column.drag.plugin-a6ef25bf.js} +1034 -149
  3. package/dist/cjs/column.drag.plugin-a6ef25bf.js.map +1 -0
  4. package/dist/cjs/column.service-831e1c92.js +1321 -0
  5. package/dist/cjs/column.service-831e1c92.js.map +1 -0
  6. package/dist/cjs/{column.service-26c61ed6.js → dimension.helpers-1927ad24.js} +490 -1273
  7. package/dist/cjs/dimension.helpers-1927ad24.js.map +1 -0
  8. package/dist/cjs/{edit.utils-179c0800.js → edit.utils-e51411f6.js} +3 -3
  9. package/dist/cjs/{edit.utils-179c0800.js.map → edit.utils-e51411f6.js.map} +1 -1
  10. package/dist/cjs/{header-cell-renderer-d879d95e.js → header-cell-renderer-53ecdcdb.js} +2 -2
  11. package/dist/cjs/{header-cell-renderer-d879d95e.js.map → header-cell-renderer-53ecdcdb.js.map} +1 -1
  12. package/dist/cjs/index.cjs.js +127 -69
  13. package/dist/cjs/index.cjs.js.map +1 -1
  14. package/dist/cjs/key.utils-96d0bc42.js +101 -0
  15. package/dist/cjs/key.utils-96d0bc42.js.map +1 -0
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/cjs/revo-grid.cjs.entry.js +310 -941
  18. package/dist/cjs/revo-grid.cjs.entry.js.map +1 -1
  19. package/dist/cjs/revo-grid.cjs.js +1 -1
  20. package/dist/cjs/revogr-attribution_7.cjs.entry.js +100 -70
  21. package/dist/cjs/revogr-attribution_7.cjs.entry.js.map +1 -1
  22. package/dist/cjs/revogr-clipboard_3.cjs.entry.js +11 -10
  23. package/dist/cjs/revogr-clipboard_3.cjs.entry.js.map +1 -1
  24. package/dist/cjs/revogr-data_4.cjs.entry.js +88 -78
  25. package/dist/cjs/revogr-data_4.cjs.entry.js.map +1 -1
  26. package/dist/cjs/revogr-filter-panel.cjs.entry.js +33 -13
  27. package/dist/cjs/revogr-filter-panel.cjs.entry.js.map +1 -1
  28. package/dist/cjs/{text-editor-b756d6b3.js → text-editor-1afffaf1.js} +6 -6
  29. package/dist/cjs/text-editor-1afffaf1.js.map +1 -0
  30. package/dist/cjs/{throttle-a57f51f9.js → throttle-bb713c73.js} +4 -4
  31. package/dist/cjs/{throttle-a57f51f9.js.map → throttle-bb713c73.js.map} +1 -1
  32. package/dist/cjs/{row-header-utils-c37f76e4.js → viewport.store-69b45f22.js} +15 -14
  33. package/dist/cjs/viewport.store-69b45f22.js.map +1 -0
  34. package/dist/collection/components/attribution/revogr-attribution.js +1 -1
  35. package/dist/collection/components/attribution/revogr-attribution.js.map +1 -1
  36. package/dist/collection/components/data/cell-renderer.js +11 -9
  37. package/dist/collection/components/data/cell-renderer.js.map +1 -1
  38. package/dist/collection/components/data/column.service.js +7 -19
  39. package/dist/collection/components/data/column.service.js.map +1 -1
  40. package/dist/collection/components/data/revogr-data-style.css +10 -5
  41. package/dist/collection/components/data/revogr-data.js +50 -28
  42. package/dist/collection/components/data/revogr-data.js.map +1 -1
  43. package/dist/collection/components/data/row-highlight.plugin.js.map +1 -1
  44. package/dist/collection/components/data/row-renderer.js.map +1 -1
  45. package/dist/collection/components/editors/revogr-edit-style.css +8 -5
  46. package/dist/collection/components/editors/revogr-edit.js +2 -2
  47. package/dist/collection/components/editors/revogr-edit.js.map +1 -1
  48. package/dist/collection/components/editors/text-editor.js +2 -2
  49. package/dist/collection/components/editors/text-editor.js.map +1 -1
  50. package/dist/collection/components/extra/revogr-extra.js +44 -6
  51. package/dist/collection/components/extra/revogr-extra.js.map +1 -1
  52. package/dist/collection/components/header/header-cell-renderer.js.map +1 -1
  53. package/dist/collection/components/header/header-renderer.js.map +1 -1
  54. package/dist/collection/components/header/resizable.element.js.map +1 -1
  55. package/dist/collection/components/header/revogr-header-style.css +8 -5
  56. package/dist/collection/components/header/revogr-header.js +9 -9
  57. package/dist/collection/components/header/revogr-header.js.map +1 -1
  58. package/dist/collection/components/order/order-renderer.js.map +1 -1
  59. package/dist/collection/components/order/revogr-order-editor.js +12 -24
  60. package/dist/collection/components/order/revogr-order-editor.js.map +1 -1
  61. package/dist/collection/components/overlay/autofill.service.js +7 -5
  62. package/dist/collection/components/overlay/autofill.service.js.map +1 -1
  63. package/dist/collection/components/overlay/keyboard.service.js +1 -4
  64. package/dist/collection/components/overlay/keyboard.service.js.map +1 -1
  65. package/dist/collection/components/overlay/revogr-overlay-selection.js +88 -72
  66. package/dist/collection/components/overlay/revogr-overlay-selection.js.map +1 -1
  67. package/dist/collection/components/overlay/revogr-overlay-style.css +8 -5
  68. package/dist/collection/components/overlay/selection.utils.js.map +1 -1
  69. package/dist/collection/components/revoGrid/plugin.service.js +81 -0
  70. package/dist/collection/components/revoGrid/plugin.service.js.map +1 -0
  71. package/dist/collection/components/revoGrid/revo-grid-style.css +18 -11
  72. package/dist/collection/components/revoGrid/revo-grid.js +289 -140
  73. package/dist/collection/components/revoGrid/revo-grid.js.map +1 -1
  74. package/dist/collection/components/revoGrid/viewport.service.js +9 -9
  75. package/dist/collection/components/revoGrid/viewport.service.js.map +1 -1
  76. package/dist/collection/components/rowHeaders/revogr-row-headers.js +1 -1
  77. package/dist/collection/components/rowHeaders/revogr-row-headers.js.map +1 -1
  78. package/dist/collection/components/rowHeaders/row-header-render.js.map +1 -1
  79. package/dist/collection/components/scroll/revogr-viewport-scroll-style.css +8 -5
  80. package/dist/collection/components/scroll/revogr-viewport-scroll.js +26 -20
  81. package/dist/collection/components/scroll/revogr-viewport-scroll.js.map +1 -1
  82. package/dist/collection/components/scrollable/revogr-scroll-style.css +10 -7
  83. package/dist/collection/components/scrollable/revogr-scroll-virtual.js +10 -8
  84. package/dist/collection/components/scrollable/revogr-scroll-virtual.js.map +1 -1
  85. package/dist/collection/components/selectionFocus/revogr-focus-style.css +8 -5
  86. package/dist/collection/components/selectionFocus/revogr-focus.js +10 -10
  87. package/dist/collection/components/selectionFocus/revogr-focus.js.map +1 -1
  88. package/dist/collection/components/selectionTempRange/revogr-temp-range-style.css +8 -5
  89. package/dist/collection/components/selectionTempRange/revogr-temp-range.js +6 -6
  90. package/dist/collection/components/selectionTempRange/revogr-temp-range.js.map +1 -1
  91. package/dist/collection/components/vnode/vnode-converter.js +1 -1
  92. package/dist/collection/components/vnode/vnode-converter.js.map +1 -1
  93. package/dist/collection/components/vnode/vnode.utils.js.map +1 -1
  94. package/dist/collection/index.js.map +1 -1
  95. package/dist/collection/plugins/add-rows-on-paste.plugin.js +40 -0
  96. package/dist/collection/plugins/add-rows-on-paste.plugin.js.map +1 -0
  97. package/dist/collection/plugins/base.plugin.js.map +1 -1
  98. package/dist/collection/plugins/column.auto-size.plugin.js +1 -1
  99. package/dist/collection/plugins/column.auto-size.plugin.js.map +1 -1
  100. package/dist/collection/plugins/column.stretch.plugin.js +1 -1
  101. package/dist/collection/plugins/column.stretch.plugin.js.map +1 -1
  102. package/dist/collection/plugins/export/csv.js +1 -1
  103. package/dist/collection/plugins/export/csv.js.map +1 -1
  104. package/dist/collection/plugins/export/export.plugin.js +4 -2
  105. package/dist/collection/plugins/export/export.plugin.js.map +1 -1
  106. package/dist/collection/plugins/filter/filter.indexed.js +1 -0
  107. package/dist/collection/plugins/filter/filter.indexed.js.map +1 -1
  108. package/dist/collection/plugins/filter/filter.panel.js +35 -35
  109. package/dist/collection/plugins/filter/filter.panel.js.map +1 -1
  110. package/dist/collection/plugins/filter/filter.plugin.js +117 -77
  111. package/dist/collection/plugins/filter/filter.plugin.js.map +1 -1
  112. package/dist/collection/plugins/filter/filter.style.css +19 -5
  113. package/dist/collection/plugins/filter/filter.types.js.map +1 -1
  114. package/dist/collection/plugins/groupingColumn/columnGroupsRenderer.js.map +1 -1
  115. package/dist/collection/plugins/groupingColumn/headerGroupRenderer.js.map +1 -1
  116. package/dist/collection/plugins/groupingRow/grouping.const.js +1 -0
  117. package/dist/collection/plugins/groupingRow/grouping.const.js.map +1 -1
  118. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js +64 -79
  119. package/dist/collection/plugins/groupingRow/grouping.row.plugin.js.map +1 -1
  120. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js +3 -3
  121. package/dist/collection/plugins/groupingRow/grouping.row.renderer.js.map +1 -1
  122. package/dist/collection/plugins/groupingRow/grouping.row.types.js.map +1 -1
  123. package/dist/collection/plugins/groupingRow/grouping.service.js +40 -6
  124. package/dist/collection/plugins/groupingRow/grouping.service.js.map +1 -1
  125. package/dist/collection/plugins/index.js +2 -0
  126. package/dist/collection/plugins/index.js.map +1 -1
  127. package/dist/collection/plugins/moveColumn/column.drag.plugin.js +12 -6
  128. package/dist/collection/plugins/moveColumn/column.drag.plugin.js.map +1 -1
  129. package/dist/collection/plugins/sorting/sorting.func.js +42 -0
  130. package/dist/collection/plugins/sorting/sorting.func.js.map +1 -0
  131. package/dist/collection/plugins/sorting/sorting.plugin.js +71 -69
  132. package/dist/collection/plugins/sorting/sorting.plugin.js.map +1 -1
  133. package/dist/collection/plugins/sorting/sorting.types.js +2 -0
  134. package/dist/collection/plugins/sorting/sorting.types.js.map +1 -0
  135. package/dist/collection/serve/controller.js +32 -15
  136. package/dist/collection/serve/data.js +18 -11
  137. package/dist/collection/services/column.data.provider.js +5 -2
  138. package/dist/collection/services/column.data.provider.js.map +1 -1
  139. package/dist/collection/services/data.provider.js +18 -7
  140. package/dist/collection/services/data.provider.js.map +1 -1
  141. package/dist/collection/services/dimension.provider.js +32 -33
  142. package/dist/collection/services/dimension.provider.js.map +1 -1
  143. package/dist/collection/services/selection.store.connector.js +1 -1
  144. package/dist/collection/services/selection.store.connector.js.map +1 -1
  145. package/dist/collection/store/dataSource/data.proxy.js +9 -15
  146. package/dist/collection/store/dataSource/data.proxy.js.map +1 -1
  147. package/dist/collection/store/dataSource/data.store.js +1 -1
  148. package/dist/collection/store/dataSource/data.store.js.map +1 -1
  149. package/dist/collection/store/dataSource/trimmed.plugin.js +5 -8
  150. package/dist/collection/store/dataSource/trimmed.plugin.js.map +1 -1
  151. package/dist/collection/store/dimension/dimension.helpers.js +7 -9
  152. package/dist/collection/store/dimension/dimension.helpers.js.map +1 -1
  153. package/dist/collection/store/dimension/dimension.recalculate.plugin.js +35 -0
  154. package/dist/collection/store/dimension/dimension.recalculate.plugin.js.map +1 -0
  155. package/dist/collection/store/dimension/dimension.store.js +47 -67
  156. package/dist/collection/store/dimension/dimension.store.js.map +1 -1
  157. package/dist/collection/store/dimension/dimension.trim.plugin.js +61 -0
  158. package/dist/collection/store/dimension/dimension.trim.plugin.js.map +1 -0
  159. package/dist/collection/store/selection/selection.store.js +1 -1
  160. package/dist/collection/store/selection/selection.store.js.map +1 -1
  161. package/dist/collection/store/vp/viewport.store.js +4 -2
  162. package/dist/collection/store/vp/viewport.store.js.map +1 -1
  163. package/dist/collection/types/events.js +6 -2
  164. package/dist/collection/types/events.js.map +1 -1
  165. package/dist/collection/types/interfaces.js +4 -0
  166. package/dist/collection/types/interfaces.js.map +1 -1
  167. package/dist/collection/types/plugin.types.js.map +1 -1
  168. package/dist/collection/types/selection.js.map +1 -1
  169. package/dist/collection/types/viewport.interfaces.js.map +1 -1
  170. package/dist/collection/utils/column.utils.js +13 -3
  171. package/dist/collection/utils/column.utils.js.map +1 -1
  172. package/dist/esm/app-globals-3a760941.js.map +1 -1
  173. package/dist/esm/{column.drag.plugin-3cc77986.js → column.drag.plugin-50f49fa9.js} +1012 -130
  174. package/dist/esm/column.drag.plugin-50f49fa9.js.map +1 -0
  175. package/dist/esm/column.service-a6a7c415.js +1281 -0
  176. package/dist/esm/column.service-a6a7c415.js.map +1 -0
  177. package/dist/esm/{debounce-72878ced.js → debounce-b3166f78.js} +2 -2
  178. package/dist/esm/{debounce-72878ced.js.map → debounce-b3166f78.js.map} +1 -1
  179. package/dist/esm/{column.service-751345b2.js → dimension.helpers-d0d709c4.js} +450 -1234
  180. package/dist/esm/dimension.helpers-d0d709c4.js.map +1 -0
  181. package/dist/esm/{edit.utils-6fc686b9.js → edit.utils-0ae0db50.js} +2 -2
  182. package/dist/esm/{edit.utils-6fc686b9.js.map → edit.utils-0ae0db50.js.map} +1 -1
  183. package/dist/esm/{header-cell-renderer-32d2ed96.js → header-cell-renderer-36ecbdef.js} +2 -2
  184. package/dist/esm/{header-cell-renderer-32d2ed96.js.map → header-cell-renderer-36ecbdef.js.map} +1 -1
  185. package/dist/esm/index.js +52 -11
  186. package/dist/esm/index.js.map +1 -1
  187. package/dist/esm/{key.utils-17273f42.js → key.utils-7c3218d4.js} +2 -2
  188. package/dist/esm/{key.utils-17273f42.js.map → key.utils-7c3218d4.js.map} +1 -1
  189. package/dist/esm/loader.js +1 -1
  190. package/dist/esm/revo-grid.entry.js +246 -877
  191. package/dist/esm/revo-grid.entry.js.map +1 -1
  192. package/dist/esm/revo-grid.js +1 -1
  193. package/dist/esm/revogr-attribution_7.entry.js +63 -33
  194. package/dist/esm/revogr-attribution_7.entry.js.map +1 -1
  195. package/dist/esm/revogr-clipboard_3.entry.js +7 -6
  196. package/dist/esm/revogr-clipboard_3.entry.js.map +1 -1
  197. package/dist/esm/revogr-data_4.entry.js +60 -50
  198. package/dist/esm/revogr-data_4.entry.js.map +1 -1
  199. package/dist/esm/revogr-filter-panel.entry.js +34 -14
  200. package/dist/esm/revogr-filter-panel.entry.js.map +1 -1
  201. package/dist/esm/{text-editor-901c3eb8.js → text-editor-148a17c1.js} +5 -5
  202. package/dist/esm/text-editor-148a17c1.js.map +1 -0
  203. package/dist/esm/{throttle-138d69c3.js → throttle-394e489c.js} +3 -3
  204. package/dist/esm/{throttle-138d69c3.js.map → throttle-394e489c.js.map} +1 -1
  205. package/dist/esm/{row-header-utils-3dfbb81f.js → viewport.store-afa8c4fe.js} +11 -10
  206. package/dist/esm/viewport.store-afa8c4fe.js.map +1 -0
  207. package/dist/revo-grid/app-globals-3a760941.js +8 -1
  208. package/dist/revo-grid/app-globals-3a760941.js.map +1 -1
  209. package/dist/revo-grid/column.drag.plugin-50f49fa9.js +2541 -0
  210. package/dist/revo-grid/column.drag.plugin-50f49fa9.js.map +1 -0
  211. package/dist/revo-grid/column.service-a6a7c415.js +1281 -0
  212. package/dist/revo-grid/column.service-a6a7c415.js.map +1 -0
  213. package/dist/revo-grid/debounce-b3166f78.js +495 -0
  214. package/dist/revo-grid/debounce-b3166f78.js.map +1 -0
  215. package/dist/revo-grid/dimension.helpers-d0d709c4.js +3611 -0
  216. package/dist/revo-grid/dimension.helpers-d0d709c4.js.map +1 -0
  217. package/dist/revo-grid/edit.utils-0ae0db50.js +17 -0
  218. package/dist/revo-grid/edit.utils-0ae0db50.js.map +1 -0
  219. package/dist/revo-grid/events-cf0893a3.js +38 -1
  220. package/dist/revo-grid/events-cf0893a3.js.map +1 -1
  221. package/dist/revo-grid/filter.button-d40ab17b.js +34 -1
  222. package/dist/revo-grid/filter.button-d40ab17b.js.map +1 -1
  223. package/dist/revo-grid/header-cell-renderer-36ecbdef.js +339 -0
  224. package/dist/revo-grid/header-cell-renderer-36ecbdef.js.map +1 -0
  225. package/dist/revo-grid/index-a61f225b.js +1845 -2
  226. package/dist/revo-grid/index-a61f225b.js.map +1 -1
  227. package/dist/revo-grid/index.esm.js +160 -1
  228. package/dist/revo-grid/index.esm.js.map +1 -1
  229. package/dist/revo-grid/key.utils-7c3218d4.js +89 -0
  230. package/dist/revo-grid/key.utils-7c3218d4.js.map +1 -0
  231. package/dist/revo-grid/resize-observer-83c9e167.js +501 -1
  232. package/dist/revo-grid/resize-observer-83c9e167.js.map +1 -1
  233. package/dist/revo-grid/revo-grid.entry.js +1934 -1
  234. package/dist/revo-grid/revo-grid.entry.js.map +1 -1
  235. package/dist/revo-grid/revo-grid.esm.js +21 -1
  236. package/dist/revo-grid/revo-grid.esm.js.map +1 -1
  237. package/dist/revo-grid/revogr-attribution_7.entry.js +1431 -1
  238. package/dist/revo-grid/revogr-attribution_7.entry.js.map +1 -1
  239. package/dist/revo-grid/revogr-clipboard_3.entry.js +455 -1
  240. package/dist/revo-grid/revogr-clipboard_3.entry.js.map +1 -1
  241. package/dist/revo-grid/revogr-data_4.entry.js +974 -1
  242. package/dist/revo-grid/revogr-data_4.entry.js.map +1 -1
  243. package/dist/revo-grid/revogr-filter-panel.entry.js +340 -1
  244. package/dist/revo-grid/revogr-filter-panel.entry.js.map +1 -1
  245. package/dist/revo-grid/sorting.sign-1a675bf7.js +9 -1
  246. package/dist/revo-grid/sorting.sign-1a675bf7.js.map +1 -1
  247. package/dist/revo-grid/text-editor-148a17c1.js +80 -0
  248. package/dist/revo-grid/text-editor-148a17c1.js.map +1 -0
  249. package/dist/revo-grid/throttle-394e489c.js +230 -0
  250. package/dist/revo-grid/throttle-394e489c.js.map +1 -0
  251. package/dist/revo-grid/viewport.helpers-7e7f9dad.js +48 -1
  252. package/dist/revo-grid/viewport.helpers-7e7f9dad.js.map +1 -1
  253. package/dist/revo-grid/viewport.store-afa8c4fe.js +406 -0
  254. package/dist/revo-grid/viewport.store-afa8c4fe.js.map +1 -0
  255. package/dist/types/components/data/cell-renderer.d.ts +3 -5
  256. package/dist/types/components/data/column.service.d.ts +2 -3
  257. package/dist/types/components/data/revogr-data.d.ts +10 -6
  258. package/dist/types/components/data/row-highlight.plugin.d.ts +1 -1
  259. package/dist/types/components/data/row-renderer.d.ts +1 -1
  260. package/dist/types/components/editors/revogr-edit.d.ts +2 -2
  261. package/dist/types/components/editors/text-editor.d.ts +5 -6
  262. package/dist/types/components/extra/revogr-extra.d.ts +17 -3
  263. package/dist/types/components/header/header-cell-renderer.d.ts +1 -1
  264. package/dist/types/components/header/header-renderer.d.ts +2 -2
  265. package/dist/types/components/header/resizable.element.d.ts +1 -1
  266. package/dist/types/components/header/revogr-header.d.ts +2 -3
  267. package/dist/types/components/order/order-renderer.d.ts +1 -1
  268. package/dist/types/components/order/revogr-order-editor.d.ts +4 -10
  269. package/dist/types/components/overlay/autofill.service.d.ts +2 -2
  270. package/dist/types/components/overlay/keyboard.service.d.ts +1 -1
  271. package/dist/types/components/overlay/revogr-overlay-selection.d.ts +16 -13
  272. package/dist/types/components/overlay/selection.utils.d.ts +1 -1
  273. package/dist/types/components/revoGrid/plugin.service.d.ts +37 -0
  274. package/dist/types/components/revoGrid/revo-grid.d.ts +105 -61
  275. package/dist/types/components/revoGrid/viewport.service.d.ts +2 -2
  276. package/dist/types/components/rowHeaders/row-header-render.d.ts +2 -2
  277. package/dist/types/components/scroll/revogr-viewport-scroll.d.ts +2 -5
  278. package/dist/types/components/scrollable/revogr-scroll-virtual.d.ts +2 -3
  279. package/dist/types/components/selectionFocus/revogr-focus.d.ts +2 -2
  280. package/dist/types/components/selectionTempRange/revogr-temp-range.d.ts +2 -3
  281. package/dist/types/components/vnode/vnode-converter.d.ts +1 -1
  282. package/dist/types/components/vnode/vnode.utils.d.ts +2 -2
  283. package/dist/types/components.d.ts +191 -108
  284. package/dist/types/index.d.ts +1 -1
  285. package/dist/types/plugins/add-rows-on-paste.plugin.d.ts +14 -0
  286. package/dist/types/plugins/base.plugin.d.ts +3 -4
  287. package/dist/types/plugins/column.auto-size.plugin.d.ts +1 -1
  288. package/dist/types/plugins/column.stretch.plugin.d.ts +1 -1
  289. package/dist/types/plugins/export/csv.d.ts +1 -1
  290. package/dist/types/plugins/export/export.plugin.d.ts +4 -3
  291. package/dist/types/plugins/filter/filter.panel.d.ts +2 -2
  292. package/dist/types/plugins/filter/filter.plugin.d.ts +25 -7
  293. package/dist/types/plugins/filter/filter.types.d.ts +32 -10
  294. package/dist/types/plugins/groupingColumn/columnGroupsRenderer.d.ts +2 -2
  295. package/dist/types/plugins/groupingColumn/headerGroupRenderer.d.ts +3 -4
  296. package/dist/types/plugins/groupingRow/grouping.const.d.ts +3 -1
  297. package/dist/types/plugins/groupingRow/grouping.row.plugin.d.ts +15 -10
  298. package/dist/types/plugins/groupingRow/grouping.row.types.d.ts +38 -4
  299. package/dist/types/plugins/groupingRow/grouping.service.d.ts +9 -12
  300. package/dist/types/plugins/index.d.ts +2 -0
  301. package/dist/types/plugins/moveColumn/column.drag.plugin.d.ts +2 -2
  302. package/dist/types/plugins/sorting/sorting.func.d.ts +3 -0
  303. package/dist/types/plugins/sorting/sorting.plugin.d.ts +14 -13
  304. package/dist/types/plugins/sorting/sorting.types.d.ts +13 -0
  305. package/dist/types/services/column.data.provider.d.ts +5 -2
  306. package/dist/types/services/data.provider.d.ts +3 -1
  307. package/dist/types/services/dimension.provider.d.ts +9 -4
  308. package/dist/types/services/selection.store.connector.d.ts +4 -4
  309. package/dist/types/store/dataSource/data.proxy.d.ts +7 -9
  310. package/dist/types/store/dataSource/data.store.d.ts +2 -3
  311. package/dist/types/store/dataSource/trimmed.plugin.d.ts +1 -1
  312. package/dist/types/store/dimension/dimension.helpers.d.ts +1 -4
  313. package/dist/types/store/dimension/dimension.recalculate.plugin.d.ts +9 -0
  314. package/dist/types/store/dimension/dimension.store.d.ts +3 -2
  315. package/dist/types/store/dimension/dimension.trim.plugin.d.ts +13 -0
  316. package/dist/types/store/selection/selection.store.d.ts +1 -1
  317. package/dist/types/store/vp/viewport.store.d.ts +1 -1
  318. package/dist/types/types/events.d.ts +1 -1
  319. package/dist/types/types/interfaces.d.ts +36 -12
  320. package/dist/types/types/plugin.types.d.ts +17 -1
  321. package/dist/types/types/selection.d.ts +23 -17
  322. package/dist/types/types/viewport.interfaces.d.ts +1 -3
  323. package/dist/types/utils/column.utils.d.ts +1 -0
  324. package/hydrate/index.js +2490 -2135
  325. package/hydrate/index.mjs +2490 -2135
  326. package/package.json +20 -19
  327. package/readme.md +15 -17
  328. package/standalone/column.service.js +192 -160
  329. package/standalone/column.service.js.map +1 -1
  330. package/standalone/data.store.js +36 -25
  331. package/standalone/data.store.js.map +1 -1
  332. package/standalone/dimension.helpers.js +8 -10
  333. package/standalone/dimension.helpers.js.map +1 -1
  334. package/standalone/index.js +46 -6
  335. package/standalone/index.js.map +1 -1
  336. package/standalone/revo-grid.js +1275 -1022
  337. package/standalone/revo-grid.js.map +1 -1
  338. package/standalone/revogr-attribution2.js +1 -1
  339. package/standalone/revogr-attribution2.js.map +1 -1
  340. package/standalone/revogr-data2.js +26 -22
  341. package/standalone/revogr-data2.js.map +1 -1
  342. package/standalone/revogr-edit2.js +3 -3
  343. package/standalone/revogr-edit2.js.map +1 -1
  344. package/standalone/revogr-extra2.js +25 -4
  345. package/standalone/revogr-extra2.js.map +1 -1
  346. package/standalone/revogr-filter-panel.js +34 -14
  347. package/standalone/revogr-filter-panel.js.map +1 -1
  348. package/standalone/revogr-focus2.js +2 -1
  349. package/standalone/revogr-focus2.js.map +1 -1
  350. package/standalone/revogr-header2.js +6 -5
  351. package/standalone/revogr-header2.js.map +1 -1
  352. package/standalone/revogr-order-editor2.js +3 -0
  353. package/standalone/revogr-order-editor2.js.map +1 -1
  354. package/standalone/revogr-overlay-selection2.js +29 -17
  355. package/standalone/revogr-overlay-selection2.js.map +1 -1
  356. package/standalone/revogr-row-headers2.js +12 -9
  357. package/standalone/revogr-row-headers2.js.map +1 -1
  358. package/standalone/revogr-scroll-virtual2.js +6 -4
  359. package/standalone/revogr-scroll-virtual2.js.map +1 -1
  360. package/standalone/revogr-temp-range2.js +1 -1
  361. package/standalone/revogr-temp-range2.js.map +1 -1
  362. package/standalone/revogr-viewport-scroll2.js +27 -21
  363. package/standalone/revogr-viewport-scroll2.js.map +1 -1
  364. package/standalone/selection.utils.js +1 -0
  365. package/standalone/selection.utils.js.map +1 -1
  366. package/standalone/vnode-converter.js +1 -1
  367. package/standalone/vnode-converter.js.map +1 -1
  368. package/dist/cjs/column.drag.plugin-fcd892ec.js.map +0 -1
  369. package/dist/cjs/column.service-26c61ed6.js.map +0 -1
  370. package/dist/cjs/index-3ab26ab9.js +0 -513
  371. package/dist/cjs/index-3ab26ab9.js.map +0 -1
  372. package/dist/cjs/key.utils-f49d7bee.js +0 -101
  373. package/dist/cjs/key.utils-f49d7bee.js.map +0 -1
  374. package/dist/cjs/row-header-utils-c37f76e4.js.map +0 -1
  375. package/dist/cjs/text-editor-b756d6b3.js.map +0 -1
  376. package/dist/esm/column.drag.plugin-3cc77986.js.map +0 -1
  377. package/dist/esm/column.service-751345b2.js.map +0 -1
  378. package/dist/esm/index-1dcad6ef.js +0 -476
  379. package/dist/esm/index-1dcad6ef.js.map +0 -1
  380. package/dist/esm/row-header-utils-3dfbb81f.js.map +0 -1
  381. package/dist/esm/text-editor-901c3eb8.js.map +0 -1
  382. package/dist/revo-grid/column.drag.plugin-3cc77986.js +0 -5
  383. package/dist/revo-grid/column.drag.plugin-3cc77986.js.map +0 -1
  384. package/dist/revo-grid/column.service-751345b2.js +0 -5
  385. package/dist/revo-grid/column.service-751345b2.js.map +0 -1
  386. package/dist/revo-grid/debounce-72878ced.js +0 -5
  387. package/dist/revo-grid/debounce-72878ced.js.map +0 -1
  388. package/dist/revo-grid/edit.utils-6fc686b9.js +0 -5
  389. package/dist/revo-grid/edit.utils-6fc686b9.js.map +0 -1
  390. package/dist/revo-grid/header-cell-renderer-32d2ed96.js +0 -5
  391. package/dist/revo-grid/header-cell-renderer-32d2ed96.js.map +0 -1
  392. package/dist/revo-grid/index-1dcad6ef.js +0 -5
  393. package/dist/revo-grid/index-1dcad6ef.js.map +0 -1
  394. package/dist/revo-grid/key.utils-17273f42.js +0 -5
  395. package/dist/revo-grid/key.utils-17273f42.js.map +0 -1
  396. package/dist/revo-grid/row-header-utils-3dfbb81f.js +0 -5
  397. package/dist/revo-grid/row-header-utils-3dfbb81f.js.map +0 -1
  398. package/dist/revo-grid/text-editor-901c3eb8.js +0 -5
  399. package/dist/revo-grid/text-editor-901c3eb8.js.map +0 -1
  400. package/dist/revo-grid/throttle-138d69c3.js +0 -5
  401. package/dist/revo-grid/throttle-138d69c3.js.map +0 -1
  402. package/standalone/identity.js +0 -26
  403. package/standalone/identity.js.map +0 -1
@@ -0,0 +1,1281 @@
1
+ /*!
2
+ * Built by Revolist OU ❤️
3
+ */
4
+ import { a3 as keys, a0 as isArrayLike, a4 as baseIteratee, Y as isArray, W as createStore, w as setStore, P as GRID_INTERNALS, _ as isIterateeCall, Z as toInteger, a as getVisibleSourceItem, C as CELL_CLASS, z as DISABLED_CLASS, b as getSourceItem } from './dimension.helpers-d0d709c4.js';
5
+ import './index-a61f225b.js';
6
+
7
+ /**
8
+ * A specialized version of `_.reduce` for arrays without support for
9
+ * iteratee shorthands.
10
+ *
11
+ * @private
12
+ * @param {Array} [array] The array to iterate over.
13
+ * @param {Function} iteratee The function invoked per iteration.
14
+ * @param {*} [accumulator] The initial value.
15
+ * @param {boolean} [initAccum] Specify using the first element of `array` as
16
+ * the initial value.
17
+ * @returns {*} Returns the accumulated value.
18
+ */
19
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
20
+ var index = -1,
21
+ length = array == null ? 0 : array.length;
22
+
23
+ if (initAccum && length) {
24
+ accumulator = array[++index];
25
+ }
26
+ while (++index < length) {
27
+ accumulator = iteratee(accumulator, array[index], index, array);
28
+ }
29
+ return accumulator;
30
+ }
31
+
32
+ /**
33
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
34
+ *
35
+ * @private
36
+ * @param {boolean} [fromRight] Specify iterating from right to left.
37
+ * @returns {Function} Returns the new base function.
38
+ */
39
+ function createBaseFor(fromRight) {
40
+ return function(object, iteratee, keysFunc) {
41
+ var index = -1,
42
+ iterable = Object(object),
43
+ props = keysFunc(object),
44
+ length = props.length;
45
+
46
+ while (length--) {
47
+ var key = props[fromRight ? length : ++index];
48
+ if (iteratee(iterable[key], key, iterable) === false) {
49
+ break;
50
+ }
51
+ }
52
+ return object;
53
+ };
54
+ }
55
+
56
+ /**
57
+ * The base implementation of `baseForOwn` which iterates over `object`
58
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
59
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
60
+ *
61
+ * @private
62
+ * @param {Object} object The object to iterate over.
63
+ * @param {Function} iteratee The function invoked per iteration.
64
+ * @param {Function} keysFunc The function to get the keys of `object`.
65
+ * @returns {Object} Returns `object`.
66
+ */
67
+ var baseFor = createBaseFor();
68
+
69
+ const baseFor$1 = baseFor;
70
+
71
+ /**
72
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
73
+ *
74
+ * @private
75
+ * @param {Object} object The object to iterate over.
76
+ * @param {Function} iteratee The function invoked per iteration.
77
+ * @returns {Object} Returns `object`.
78
+ */
79
+ function baseForOwn(object, iteratee) {
80
+ return object && baseFor$1(object, iteratee, keys);
81
+ }
82
+
83
+ /**
84
+ * Creates a `baseEach` or `baseEachRight` function.
85
+ *
86
+ * @private
87
+ * @param {Function} eachFunc The function to iterate over a collection.
88
+ * @param {boolean} [fromRight] Specify iterating from right to left.
89
+ * @returns {Function} Returns the new base function.
90
+ */
91
+ function createBaseEach(eachFunc, fromRight) {
92
+ return function(collection, iteratee) {
93
+ if (collection == null) {
94
+ return collection;
95
+ }
96
+ if (!isArrayLike(collection)) {
97
+ return eachFunc(collection, iteratee);
98
+ }
99
+ var length = collection.length,
100
+ index = fromRight ? length : -1,
101
+ iterable = Object(collection);
102
+
103
+ while ((fromRight ? index-- : ++index < length)) {
104
+ if (iteratee(iterable[index], index, iterable) === false) {
105
+ break;
106
+ }
107
+ }
108
+ return collection;
109
+ };
110
+ }
111
+
112
+ /**
113
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
114
+ *
115
+ * @private
116
+ * @param {Array|Object} collection The collection to iterate over.
117
+ * @param {Function} iteratee The function invoked per iteration.
118
+ * @returns {Array|Object} Returns `collection`.
119
+ */
120
+ var baseEach = createBaseEach(baseForOwn);
121
+
122
+ const baseEach$1 = baseEach;
123
+
124
+ /**
125
+ * The base implementation of `_.reduce` and `_.reduceRight`, without support
126
+ * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
127
+ *
128
+ * @private
129
+ * @param {Array|Object} collection The collection to iterate over.
130
+ * @param {Function} iteratee The function invoked per iteration.
131
+ * @param {*} accumulator The initial value.
132
+ * @param {boolean} initAccum Specify using the first or last element of
133
+ * `collection` as the initial value.
134
+ * @param {Function} eachFunc The function to iterate over `collection`.
135
+ * @returns {*} Returns the accumulated value.
136
+ */
137
+ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
138
+ eachFunc(collection, function(value, index, collection) {
139
+ accumulator = initAccum
140
+ ? (initAccum = false, value)
141
+ : iteratee(accumulator, value, index, collection);
142
+ });
143
+ return accumulator;
144
+ }
145
+
146
+ /**
147
+ * Reduces `collection` to a value which is the accumulated result of running
148
+ * each element in `collection` thru `iteratee`, where each successive
149
+ * invocation is supplied the return value of the previous. If `accumulator`
150
+ * is not given, the first element of `collection` is used as the initial
151
+ * value. The iteratee is invoked with four arguments:
152
+ * (accumulator, value, index|key, collection).
153
+ *
154
+ * Many lodash methods are guarded to work as iteratees for methods like
155
+ * `_.reduce`, `_.reduceRight`, and `_.transform`.
156
+ *
157
+ * The guarded methods are:
158
+ * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
159
+ * and `sortBy`
160
+ *
161
+ * @static
162
+ * @memberOf _
163
+ * @since 0.1.0
164
+ * @category Collection
165
+ * @param {Array|Object} collection The collection to iterate over.
166
+ * @param {Function} [iteratee=_.identity] The function invoked per iteration.
167
+ * @param {*} [accumulator] The initial value.
168
+ * @returns {*} Returns the accumulated value.
169
+ * @see _.reduceRight
170
+ * @example
171
+ *
172
+ * _.reduce([1, 2], function(sum, n) {
173
+ * return sum + n;
174
+ * }, 0);
175
+ * // => 3
176
+ *
177
+ * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
178
+ * (result[value] || (result[value] = [])).push(key);
179
+ * return result;
180
+ * }, {});
181
+ * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
182
+ */
183
+ function reduce(collection, iteratee, accumulator) {
184
+ var func = isArray(collection) ? arrayReduce : baseReduce,
185
+ initAccum = arguments.length < 3;
186
+
187
+ return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach$1);
188
+ }
189
+
190
+ function getCellData(val) {
191
+ if (typeof val === 'undefined' || val === null) {
192
+ return '';
193
+ }
194
+ return val;
195
+ }
196
+ function getCellRaw(model, column) {
197
+ if (!column) {
198
+ return;
199
+ }
200
+ if (column.cellParser) {
201
+ return column.cellParser(model, column);
202
+ }
203
+ return model[column.prop];
204
+ }
205
+ function getCellDataParsed(model, column) {
206
+ return getCellData(getCellRaw(model, column));
207
+ }
208
+ /**
209
+ * Get column type from column data
210
+ */
211
+ function getColumnType(rgCol) {
212
+ if (rgCol.pin) {
213
+ return rgCol.pin;
214
+ }
215
+ return 'rgCol';
216
+ }
217
+ function getColumnSizes(cols) {
218
+ const res = {};
219
+ for (const [i, c] of cols.entries()) {
220
+ if (c.size) {
221
+ res[i] = c.size;
222
+ }
223
+ }
224
+ return res;
225
+ }
226
+ /**
227
+ * Check if column is grouping column
228
+ */
229
+ function isColGrouping(colData) {
230
+ return !!colData.children;
231
+ }
232
+ /**
233
+ * This function is used to create a collection of columns.
234
+ */
235
+ function getColumns(columns, level = 0, types) {
236
+ const collection = {
237
+ // columns as they are in stores per type
238
+ columns: {
239
+ rgCol: [],
240
+ colPinStart: [],
241
+ colPinEnd: [],
242
+ },
243
+ // columns indexed by prop for quick access
244
+ columnByProp: {},
245
+ // column grouping
246
+ columnGrouping: {
247
+ rgCol: [],
248
+ colPinStart: [],
249
+ colPinEnd: [],
250
+ },
251
+ // max depth level for column grouping
252
+ maxLevel: level,
253
+ // sorting
254
+ sort: {},
255
+ };
256
+ return reduce(columns, (res, colData) => {
257
+ // Grouped column
258
+ if (isColGrouping(colData)) {
259
+ res = gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
260
+ return res;
261
+ }
262
+ // Column type
263
+ const columnDefinitionFromType = colData.columnType && (types === null || types === void 0 ? void 0 : types[colData.columnType]);
264
+ // Regular column
265
+ const regularColumn = Object.assign(Object.assign({}, columnDefinitionFromType), colData);
266
+ // Regular column, no Pin
267
+ if (!regularColumn.pin) {
268
+ res.columns.rgCol.push(regularColumn);
269
+ // Pin
270
+ }
271
+ else {
272
+ res.columns[regularColumn.pin].push(regularColumn);
273
+ }
274
+ if (regularColumn.order) {
275
+ res.sort[regularColumn.prop] = regularColumn;
276
+ }
277
+ // it's possible that some columns have same prop, but better to avoid it
278
+ if (!res.columnByProp[regularColumn.prop]) {
279
+ res.columnByProp[regularColumn.prop] = [];
280
+ }
281
+ res.columnByProp[regularColumn.prop].push(regularColumn);
282
+ // trigger setup hook if present
283
+ regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
284
+ return res;
285
+ }, collection);
286
+ }
287
+ function gatherGroup(res, colData, collection, level = 0) {
288
+ // group template
289
+ const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
290
+ // check columns for update
291
+ for (let k in collection.columns) {
292
+ const key = k;
293
+ const resultItem = res.columns[key];
294
+ const collectionItem = collection.columns[key];
295
+ // if column data
296
+ if (isArray(resultItem) && isArray(collectionItem)) {
297
+ // fill columns
298
+ resultItem.push(...collectionItem);
299
+ // fill grouping
300
+ if (collectionItem.length) {
301
+ res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
302
+ }
303
+ }
304
+ }
305
+ // merge column groupings
306
+ for (let k in collection.columnGrouping) {
307
+ const key = k;
308
+ const collectionItem = collection.columnGrouping[key];
309
+ res.columnGrouping[key].push(...collectionItem);
310
+ }
311
+ res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
312
+ res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
313
+ res.columnByProp = Object.assign(Object.assign({}, res.columnByProp), collection.columnByProp);
314
+ return res;
315
+ }
316
+ function findColumn(columns, prop) {
317
+ for (const c of columns) {
318
+ if (isColGrouping(c)) {
319
+ const found = findColumn(c.children, prop);
320
+ if (found) {
321
+ return found;
322
+ }
323
+ }
324
+ else if (c.prop === prop) {
325
+ return c;
326
+ }
327
+ }
328
+ return undefined;
329
+ }
330
+ function getColumnByProp(columns, prop) {
331
+ return findColumn(columns, prop);
332
+ }
333
+
334
+ /**
335
+ * Selection store
336
+ */
337
+ function defaultState() {
338
+ return {
339
+ range: null,
340
+ tempRange: null,
341
+ tempRangeType: null,
342
+ focus: null,
343
+ edit: null,
344
+ lastCell: null,
345
+ nextFocus: null,
346
+ };
347
+ }
348
+ class SelectionStore {
349
+ constructor() {
350
+ this.unsubscribe = [];
351
+ this.store = createStore(defaultState());
352
+ this.store.on('set', (key, newVal) => {
353
+ if (key === 'tempRange' && !newVal) {
354
+ this.store.set('tempRangeType', null);
355
+ }
356
+ });
357
+ }
358
+ onChange(propName, cb) {
359
+ this.unsubscribe.push(this.store.onChange(propName, cb));
360
+ }
361
+ clearFocus() {
362
+ setStore(this.store, { focus: null, range: null, edit: null, tempRange: null });
363
+ }
364
+ setFocus(focus, end) {
365
+ if (!end) {
366
+ setStore(this.store, { focus });
367
+ }
368
+ else {
369
+ setStore(this.store, {
370
+ focus,
371
+ range: getRange(focus, end),
372
+ edit: null,
373
+ tempRange: null,
374
+ });
375
+ }
376
+ }
377
+ setNextFocus(focus) {
378
+ setStore(this.store, { nextFocus: focus });
379
+ }
380
+ setTempArea(range) {
381
+ setStore(this.store, { tempRange: range === null || range === void 0 ? void 0 : range.area, tempRangeType: range === null || range === void 0 ? void 0 : range.type, edit: null });
382
+ }
383
+ clearTemp() {
384
+ setStore(this.store, { tempRange: null });
385
+ }
386
+ /** Can be applied from selection change or from simple keyboard change clicks */
387
+ setRangeArea(range) {
388
+ setStore(this.store, { range, edit: null, tempRange: null });
389
+ }
390
+ setRange(start, end) {
391
+ const range = getRange(start, end);
392
+ this.setRangeArea(range);
393
+ }
394
+ setLastCell(lastCell) {
395
+ setStore(this.store, { lastCell });
396
+ }
397
+ setEdit(val) {
398
+ const focus = this.store.get('focus');
399
+ if (focus && typeof val === 'string') {
400
+ setStore(this.store, {
401
+ edit: { x: focus.x, y: focus.y, val },
402
+ });
403
+ return;
404
+ }
405
+ setStore(this.store, { edit: null });
406
+ }
407
+ dispose() {
408
+ this.unsubscribe.forEach(f => f());
409
+ this.store.dispose();
410
+ }
411
+ }
412
+
413
+ const EMPTY_INDEX = -1;
414
+ class SelectionStoreConnector {
415
+ constructor() {
416
+ // dirty flag required to cleanup whole store in case visibility of panels changed
417
+ this.dirty = false;
418
+ this.stores = {};
419
+ this.columnStores = {};
420
+ this.rowStores = {};
421
+ /**
422
+ * Helpers for data conversion
423
+ */
424
+ this.storesByType = {};
425
+ this.storesXToType = {};
426
+ this.storesYToType = {};
427
+ this.sections = [];
428
+ }
429
+ get focusedStore() {
430
+ var _a;
431
+ for (let y in this.stores) {
432
+ for (let x in this.stores[y]) {
433
+ const focused = (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.store.get('focus');
434
+ if (focused) {
435
+ return {
436
+ entity: this.stores[y][x],
437
+ cell: focused,
438
+ position: {
439
+ x: parseInt(x, 10),
440
+ y: parseInt(y, 10),
441
+ },
442
+ };
443
+ }
444
+ }
445
+ }
446
+ return null;
447
+ }
448
+ get edit() {
449
+ var _a;
450
+ return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('edit');
451
+ }
452
+ get focused() {
453
+ var _a;
454
+ return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('focus');
455
+ }
456
+ get selectedRange() {
457
+ var _a;
458
+ return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('range');
459
+ }
460
+ registerSection(e) {
461
+ if (!e) {
462
+ this.sections.length = 0;
463
+ // some elements removed, rebuild stores
464
+ this.dirty = true;
465
+ return;
466
+ }
467
+ if (this.sections.indexOf(e) === -1) {
468
+ this.sections.push(e);
469
+ }
470
+ }
471
+ // check if require to cleanup all stores
472
+ beforeUpdate() {
473
+ if (this.dirty) {
474
+ for (let y in this.stores) {
475
+ for (let x in this.stores[y]) {
476
+ this.stores[y][x].dispose();
477
+ }
478
+ }
479
+ this.dirty = false;
480
+ }
481
+ }
482
+ registerColumn(x, type) {
483
+ // if hidden just create store but no operations needed
484
+ if (isHiddenStore(x)) {
485
+ return new SelectionStore();
486
+ }
487
+ if (this.columnStores[x]) {
488
+ return this.columnStores[x];
489
+ }
490
+ this.columnStores[x] = new SelectionStore();
491
+ // build cross-linking type to position
492
+ this.storesByType[type] = x;
493
+ this.storesXToType[x] = type;
494
+ return this.columnStores[x];
495
+ }
496
+ registerRow(y, type) {
497
+ // if hidden just create store
498
+ if (isHiddenStore(y)) {
499
+ return new SelectionStore();
500
+ }
501
+ if (this.rowStores[y]) {
502
+ return this.rowStores[y];
503
+ }
504
+ this.rowStores[y] = new SelectionStore();
505
+ // build cross linking type to position
506
+ this.storesByType[type] = y;
507
+ this.storesYToType[y] = type;
508
+ return this.rowStores[y];
509
+ }
510
+ /**
511
+ * Cross store proxy, based on multiple dimensions
512
+ */
513
+ register({ x, y }) {
514
+ var _a, _b;
515
+ // if hidden just create store
516
+ if (isHiddenStore(x) || isHiddenStore(y)) {
517
+ return new SelectionStore();
518
+ }
519
+ if (!this.stores[y]) {
520
+ this.stores[y] = {};
521
+ }
522
+ if (this.stores[y][x]) {
523
+ // Store already registered. Do not register twice
524
+ return this.stores[y][x];
525
+ }
526
+ this.stores[y][x] = new SelectionStore();
527
+ // proxy update, column store trigger only range area
528
+ (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.onChange('range', c => {
529
+ this.columnStores[x].setRangeArea(c);
530
+ this.rowStores[y].setRangeArea(c);
531
+ });
532
+ // clean up on remove
533
+ (_b = this.stores[y][x]) === null || _b === void 0 ? void 0 : _b.store.on('dispose', () => this.destroy(x, y));
534
+ return this.stores[y][x];
535
+ }
536
+ destroy(x, y) {
537
+ var _a, _b;
538
+ (_a = this.columnStores[x]) === null || _a === void 0 ? void 0 : _a.dispose();
539
+ (_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
540
+ delete this.rowStores[y];
541
+ delete this.columnStores[x];
542
+ // clear x cross-link
543
+ if (this.storesXToType[x]) {
544
+ const type = this.storesXToType[x];
545
+ delete this.storesXToType[x];
546
+ delete this.storesByType[type];
547
+ }
548
+ // clear y cross-link
549
+ if (this.storesYToType[y]) {
550
+ const type = this.storesYToType[y];
551
+ delete this.storesYToType[y];
552
+ delete this.storesByType[type];
553
+ }
554
+ if (this.stores[y]) {
555
+ delete this.stores[y][x];
556
+ }
557
+ // clear empty rows
558
+ if (!Object.keys(this.stores[y] || {}).length) {
559
+ delete this.stores[y];
560
+ }
561
+ }
562
+ setEditByCell(storePos, editCell) {
563
+ this.focusByCell(storePos, editCell, editCell);
564
+ this.setEdit('');
565
+ }
566
+ /**
567
+ * Sets the next focus cell before the current one.
568
+ *
569
+ * @param focus - The cell to set as the next focus.
570
+ */
571
+ beforeNextFocusCell(focus) {
572
+ var _a;
573
+ // If there is no focused store, return early.
574
+ if (!this.focusedStore) {
575
+ return;
576
+ }
577
+ // Get the next store based on the current focus and the last cell.
578
+ const lastCell = this.focusedStore.entity.store.get('lastCell');
579
+ const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
580
+ // Set the next focus cell in the store.
581
+ (_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));
582
+ }
583
+ focusByCell(storePos, start, end) {
584
+ const store = this.stores[storePos.y][storePos.x];
585
+ this.focus(store, { focus: start, end });
586
+ }
587
+ focus(store, { focus, end }) {
588
+ const currentStorePointer = this.getCurrentStorePointer(store);
589
+ if (!currentStorePointer) {
590
+ return null;
591
+ }
592
+ // check for the focus in nearby store/viewport
593
+ const lastCell = store.store.get('lastCell');
594
+ const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
595
+ // if next store present - update
596
+ if (next === null || next === void 0 ? void 0 : next.store) {
597
+ const item = Object.assign(Object.assign({}, focus), next.item);
598
+ this.focus(next.store, { focus: item, end: item });
599
+ return null;
600
+ }
601
+ if (lastCell) {
602
+ focus = cropCellToMax(focus, lastCell);
603
+ end = cropCellToMax(end, lastCell);
604
+ }
605
+ store.setFocus(focus, end);
606
+ return focus;
607
+ }
608
+ /**
609
+ * Retrieves the current store pointer based on the active store.
610
+ * Clears focus from all stores except the active one.
611
+ */
612
+ getCurrentStorePointer(store) {
613
+ let currentStorePointer;
614
+ // Iterate through all stores
615
+ for (let y in this.stores) {
616
+ for (let x in this.stores[y]) {
617
+ const s = this.stores[y][x];
618
+ // Clear focus from stores other than the active one
619
+ if (s !== store) {
620
+ s.clearFocus();
621
+ }
622
+ else {
623
+ // Update the current store pointer with the active store coordinates
624
+ currentStorePointer = {
625
+ x: parseInt(x, 10),
626
+ y: parseInt(y, 10)
627
+ };
628
+ }
629
+ }
630
+ }
631
+ return currentStorePointer;
632
+ }
633
+ /**
634
+ * Retrieves the next store based on the focus cell and current store pointer.
635
+ * If the next store exists, returns an object with the next store and the item in the new store.
636
+ * If the next store does not exist, returns null.
637
+ */
638
+ getNextStore(focus, currentStorePointer, lastCell) {
639
+ // item in new store
640
+ const nextItem = nextCell(focus, lastCell);
641
+ let nextStore;
642
+ if (nextItem) {
643
+ Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
644
+ let stores;
645
+ switch (type) {
646
+ case 'x':
647
+ // Get the X stores for the current Y coordinate of the current store pointer
648
+ stores = this.getXStores(currentStorePointer.y);
649
+ break;
650
+ case 'y':
651
+ // Get the Y stores for the current X coordinate of the current store pointer
652
+ stores = this.getYStores(currentStorePointer.x);
653
+ break;
654
+ }
655
+ // Get the next store based on the item in the new store
656
+ if (nextItemCoord >= 0) {
657
+ nextStore = stores[++currentStorePointer[type]];
658
+ }
659
+ else {
660
+ nextStore = stores[--currentStorePointer[type]];
661
+ const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
662
+ if (nextLastCell) {
663
+ nextItem[type] = nextLastCell[type] + nextItemCoord;
664
+ }
665
+ }
666
+ });
667
+ }
668
+ return {
669
+ store: nextStore,
670
+ item: nextItem,
671
+ };
672
+ }
673
+ clearAll() {
674
+ var _a;
675
+ for (let y in this.stores) {
676
+ for (let x in this.stores[y]) {
677
+ (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.clearFocus();
678
+ }
679
+ }
680
+ }
681
+ setEdit(val) {
682
+ if (!this.focusedStore) {
683
+ return;
684
+ }
685
+ this.focusedStore.entity.setEdit(val);
686
+ }
687
+ /**
688
+ * Select all cells across all stores
689
+ */
690
+ selectAll() {
691
+ for (let y in this.stores) {
692
+ for (let x in this.stores[y]) {
693
+ const store = this.stores[y][x];
694
+ if (!store) {
695
+ continue;
696
+ }
697
+ const lastCell = store.store.get('lastCell');
698
+ if (lastCell) {
699
+ store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
700
+ }
701
+ }
702
+ }
703
+ }
704
+ getXStores(y) {
705
+ return this.stores[y];
706
+ }
707
+ getYStores(x) {
708
+ const stores = {};
709
+ for (let i in this.stores) {
710
+ stores[i] = this.stores[i][x];
711
+ }
712
+ return stores;
713
+ }
714
+ }
715
+
716
+ function isHiddenStore(pos) {
717
+ return pos === EMPTY_INDEX;
718
+ }
719
+ function nextCell(cell, lastCell) {
720
+ const nextItem = {};
721
+ let types = ['x', 'y'];
722
+ // previous item check
723
+ for (let t of types) {
724
+ if (cell[t] < 0) {
725
+ nextItem[t] = cell[t];
726
+ return nextItem;
727
+ }
728
+ }
729
+ // next item check
730
+ for (let t of types) {
731
+ if (cell[t] >= lastCell[t]) {
732
+ nextItem[t] = cell[t] - lastCell[t];
733
+ return nextItem;
734
+ }
735
+ }
736
+ return null;
737
+ }
738
+ function cropCellToMax(cell, lastCell) {
739
+ const croppedCell = Object.assign({}, cell);
740
+ const cellCoordinates = ['x', 'y'];
741
+ for (const coordinate of cellCoordinates) {
742
+ if (cell[coordinate] < 0) {
743
+ croppedCell[coordinate] = 0;
744
+ }
745
+ else if (cell[coordinate] >= lastCell[coordinate]) {
746
+ croppedCell[coordinate] = lastCell[coordinate] - 1;
747
+ }
748
+ }
749
+ return croppedCell;
750
+ }
751
+ function getRange(start, end) {
752
+ return start && end
753
+ ? {
754
+ x: Math.min(start.x, end.x),
755
+ y: Math.min(start.y, end.y),
756
+ x1: Math.max(start.x, end.x),
757
+ y1: Math.max(start.y, end.y),
758
+ }
759
+ : null;
760
+ }
761
+ function isRangeSingleCell(a) {
762
+ return a.x === a.x1 && a.y === a.y1;
763
+ }
764
+
765
+ const GROUP_DEPTH = `${GRID_INTERNALS}-depth`;
766
+ const PSEUDO_GROUP_ITEM = `${GRID_INTERNALS}-name`;
767
+ const PSEUDO_GROUP_ITEM_ID = `${GRID_INTERNALS}-id`;
768
+ const PSEUDO_GROUP_ITEM_VALUE = `${GRID_INTERNALS}-value`;
769
+ const PSEUDO_GROUP_COLUMN = `${GRID_INTERNALS}-column`;
770
+ const GROUP_EXPANDED = `${GRID_INTERNALS}-expanded`;
771
+ const GROUP_COLUMN_PROP = `${GRID_INTERNALS}-prop`;
772
+ const GROUP_ORIGINAL_INDEX = `${GRID_INTERNALS}-original-index`;
773
+ const GROUP_EXPAND_BTN = `group-expand`;
774
+ const GROUPING_ROW_TYPE = 'rgRow';
775
+
776
+ function getGroupValueDefault(item, prop) {
777
+ return item[prop] || null;
778
+ }
779
+ // get source based on proxy item collection to preserve rgRow order
780
+ function getSource(source, items, withoutGrouping = false) {
781
+ let index = 0;
782
+ const result = {
783
+ source: [],
784
+ prevExpanded: {},
785
+ oldNewIndexes: {},
786
+ };
787
+ // order important here, expected parent is first, then others
788
+ items.forEach(i => {
789
+ const model = source[i];
790
+ if (!withoutGrouping) {
791
+ result.source.push(model);
792
+ return;
793
+ }
794
+ // grouping filter
795
+ if (isGrouping(model)) {
796
+ if (getExpanded(model)) {
797
+ result.prevExpanded[model[PSEUDO_GROUP_ITEM_VALUE]] = true;
798
+ }
799
+ }
800
+ else {
801
+ result.source.push(model);
802
+ result.oldNewIndexes[i] = index;
803
+ index++;
804
+ }
805
+ });
806
+ return result;
807
+ }
808
+ function getExpanded(model = {}) {
809
+ return model[GROUP_EXPANDED];
810
+ }
811
+ /**
812
+ * Gather data for grouping
813
+ * @param array - flat data array
814
+ * @param columnProps - ids of groups
815
+ * @param expanded - potentially expanded items if present
816
+ */
817
+ function gatherGrouping(array, columnProps, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
818
+ const groupedItems = new Map();
819
+ array.forEach((item, originalIndex) => {
820
+ const groupLevelValues = columnProps.map(groupId => getGroupValue(item, groupId));
821
+ const lastLevelValue = groupLevelValues.pop();
822
+ let currentGroupLevel = groupedItems;
823
+ groupLevelValues.forEach(value => {
824
+ if (!currentGroupLevel.has(value)) {
825
+ currentGroupLevel.set(value, new Map());
826
+ }
827
+ currentGroupLevel = currentGroupLevel.get(value);
828
+ });
829
+ if (!currentGroupLevel.has(lastLevelValue)) {
830
+ currentGroupLevel.set(lastLevelValue, []);
831
+ }
832
+ const lastLevelItems = currentGroupLevel.get(lastLevelValue);
833
+ lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
834
+ });
835
+ let itemIndex = -1;
836
+ const groupingDepth = columnProps.length;
837
+ // collapse all groups in the beginning
838
+ const trimmed = {};
839
+ // index mapping
840
+ const oldNewIndexMap = {};
841
+ // check if group header exists
842
+ const pseudoGroupTest = {};
843
+ const sourceWithGroups = [];
844
+ function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
845
+ const depth = parentIds.length;
846
+ groupedValues.forEach((innerGroupedValues, groupId) => {
847
+ const levelIds = [...parentIds, groupId];
848
+ const mergedIds = levelIds.join(',');
849
+ const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
850
+ sourceWithGroups.push({
851
+ [PSEUDO_GROUP_ITEM]: groupId,
852
+ [GROUP_DEPTH]: depth,
853
+ [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
854
+ [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
855
+ [GROUP_EXPANDED]: isGroupExpanded,
856
+ [GROUP_COLUMN_PROP]: columnProps[depth],
857
+ [columnProps[depth]]: groupId,
858
+ });
859
+ itemIndex += 1;
860
+ if (!isGroupExpanded && depth) {
861
+ trimmed[itemIndex] = true;
862
+ }
863
+ if (Array.isArray(innerGroupedValues)) {
864
+ innerGroupedValues.forEach(value => {
865
+ itemIndex += 1;
866
+ if (!isGroupExpanded) {
867
+ trimmed[itemIndex] = true;
868
+ }
869
+ oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
870
+ const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
871
+ pseudoGroupTestIds.forEach(pseudoGroupTestId => {
872
+ if (!pseudoGroupTest[pseudoGroupTestId]) {
873
+ pseudoGroupTest[pseudoGroupTestId] = [];
874
+ }
875
+ pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
876
+ });
877
+ });
878
+ sourceWithGroups.push(...innerGroupedValues);
879
+ }
880
+ else {
881
+ flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
882
+ }
883
+ });
884
+ }
885
+ flattenGroupMaps(groupedItems, [], true);
886
+ return {
887
+ sourceWithGroups, // updates source mirror
888
+ depth: groupingDepth, // largest depth for grouping
889
+ trimmed, // used for expand/collapse grouping values
890
+ oldNewIndexMap, // used for mapping old values to new
891
+ childrenByGroup: pseudoGroupTest, // used to get child items in group
892
+ };
893
+ }
894
+ function getGroupingName(rgRow) {
895
+ return rgRow && rgRow[PSEUDO_GROUP_ITEM];
896
+ }
897
+ function isGrouping(rgRow) {
898
+ return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
899
+ }
900
+ function isGroupingColumn(column) {
901
+ return typeof (column === null || column === void 0 ? void 0 : column[PSEUDO_GROUP_COLUMN]) !== 'undefined';
902
+ }
903
+ function measureEqualDepth(groupA, groupB) {
904
+ const ln = groupA.length;
905
+ let i = 0;
906
+ for (; i < ln; i++) {
907
+ if (groupA[i] !== groupB[i]) {
908
+ return i;
909
+ }
910
+ }
911
+ return i;
912
+ }
913
+ function getParsedGroup(id) {
914
+ const parseGroup = JSON.parse(id);
915
+ // extra precaution and type safeguard
916
+ if (!Array.isArray(parseGroup)) {
917
+ return null;
918
+ }
919
+ return parseGroup;
920
+ }
921
+ // check if items is child of current clicked group
922
+ function isSameGroup(currentGroup, currentModel, nextModel) {
923
+ const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);
924
+ if (!nextGroup) {
925
+ return false;
926
+ }
927
+ const depth = measureEqualDepth(currentGroup, nextGroup);
928
+ return currentModel[GROUP_DEPTH] < depth;
929
+ }
930
+
931
+ /**
932
+ * The base implementation of `_.slice` without an iteratee call guard.
933
+ *
934
+ * @private
935
+ * @param {Array} array The array to slice.
936
+ * @param {number} [start=0] The start position.
937
+ * @param {number} [end=array.length] The end position.
938
+ * @returns {Array} Returns the slice of `array`.
939
+ */
940
+ function baseSlice(array, start, end) {
941
+ var index = -1,
942
+ length = array.length;
943
+
944
+ if (start < 0) {
945
+ start = -start > length ? 0 : (length + start);
946
+ }
947
+ end = end > length ? length : end;
948
+ if (end < 0) {
949
+ end += length;
950
+ }
951
+ length = start > end ? 0 : ((end - start) >>> 0);
952
+ start >>>= 0;
953
+
954
+ var result = Array(length);
955
+ while (++index < length) {
956
+ result[index] = array[index + start];
957
+ }
958
+ return result;
959
+ }
960
+
961
+ /**
962
+ * Creates a slice of `array` from `start` up to, but not including, `end`.
963
+ *
964
+ * **Note:** This method is used instead of
965
+ * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
966
+ * returned.
967
+ *
968
+ * @static
969
+ * @memberOf _
970
+ * @since 3.0.0
971
+ * @category Array
972
+ * @param {Array} array The array to slice.
973
+ * @param {number} [start=0] The start position.
974
+ * @param {number} [end=array.length] The end position.
975
+ * @returns {Array} Returns the slice of `array`.
976
+ */
977
+ function slice(array, start, end) {
978
+ var length = array == null ? 0 : array.length;
979
+ if (!length) {
980
+ return [];
981
+ }
982
+ if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
983
+ start = 0;
984
+ end = length;
985
+ }
986
+ else {
987
+ start = start == null ? 0 : toInteger(start);
988
+ end = end === undefined ? length : toInteger(end);
989
+ }
990
+ return baseSlice(array, start, end);
991
+ }
992
+
993
+ class ColumnService {
994
+ get columns() {
995
+ return getVisibleSourceItem(this.source);
996
+ }
997
+ constructor(dataStore, source) {
998
+ this.dataStore = dataStore;
999
+ this.source = source;
1000
+ this.unsubscribe = [];
1001
+ this.hasGrouping = false;
1002
+ this.unsubscribe.push(source.onChange('source', s => this.checkGrouping(s)));
1003
+ this.checkGrouping(source.get('source'));
1004
+ this.type = source.get('type');
1005
+ }
1006
+ checkGrouping(cols) {
1007
+ for (let rgCol of cols) {
1008
+ if (isGroupingColumn(rgCol)) {
1009
+ this.hasGrouping = true;
1010
+ return;
1011
+ }
1012
+ this.hasGrouping = false;
1013
+ }
1014
+ }
1015
+ isReadOnly(r, c) {
1016
+ var _a;
1017
+ const readOnly = (_a = this.columns[c]) === null || _a === void 0 ? void 0 : _a.readonly;
1018
+ if (typeof readOnly === 'function') {
1019
+ const data = this.rowDataModel(r, c);
1020
+ return readOnly(data);
1021
+ }
1022
+ return !!readOnly;
1023
+ }
1024
+ mergeProperties(r, c, defaultProps, schemaModel) {
1025
+ var _a, _b;
1026
+ const props = Object.assign({}, defaultProps);
1027
+ props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
1028
+ ? { [props.class]: true }
1029
+ : props.class)), { [CELL_CLASS]: true, [DISABLED_CLASS]: this.isReadOnly(r, c) });
1030
+ const extra = (_b = (_a = schemaModel.column) === null || _a === void 0 ? void 0 : _a.cellProperties) === null || _b === void 0 ? void 0 : _b.call(_a, schemaModel);
1031
+ if (!extra) {
1032
+ return props;
1033
+ }
1034
+ return doPropMerge(props, extra);
1035
+ }
1036
+ getRowClass(r, prop) {
1037
+ const model = getSourceItem(this.dataStore, r) || {};
1038
+ return model[prop] || '';
1039
+ }
1040
+ getSaveData(rowIndex, colIndex, val) {
1041
+ const data = this.rowDataModel(rowIndex, colIndex);
1042
+ if (typeof val === 'undefined') {
1043
+ val = getCellData(data.value);
1044
+ }
1045
+ return Object.assign(Object.assign({}, data), { val });
1046
+ }
1047
+ getCellEditor(_r, c, editors) {
1048
+ var _a;
1049
+ const editor = (_a = this.columns[c]) === null || _a === void 0 ? void 0 : _a.editor;
1050
+ if (!editor) {
1051
+ return undefined;
1052
+ }
1053
+ // reference
1054
+ if (typeof editor === 'string') {
1055
+ return editors[editor];
1056
+ }
1057
+ return editor;
1058
+ }
1059
+ /**
1060
+ * Get cell data model for given rowIndex and colIndex
1061
+ * Used to pass data to editor/renderer
1062
+ */
1063
+ rowDataModel(rowIndex, colIndex) {
1064
+ const column = this.columns[colIndex];
1065
+ const prop = column === null || column === void 0 ? void 0 : column.prop;
1066
+ const model = getSourceItem(this.dataStore, rowIndex) || {};
1067
+ const type = this.dataStore.get('type');
1068
+ return {
1069
+ prop,
1070
+ model,
1071
+ data: this.dataStore.get('source'),
1072
+ column,
1073
+ rowIndex,
1074
+ colIndex,
1075
+ colType: this.type,
1076
+ type,
1077
+ value: getCellRaw(model, column),
1078
+ };
1079
+ }
1080
+ getRangeData(d, columns) {
1081
+ var _a;
1082
+ const changed = {};
1083
+ // get original length sizes
1084
+ const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;
1085
+ const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;
1086
+ const mapping = {};
1087
+ // rows
1088
+ for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
1089
+ // copy original data link
1090
+ const oldRowIndex = d.oldRange.y + (i % copyRowLength);
1091
+ const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};
1092
+ // columns
1093
+ for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
1094
+ // check if old range area
1095
+ if (rowIndex >= d.oldRange.y &&
1096
+ rowIndex <= d.oldRange.y1 &&
1097
+ colIndex >= d.oldRange.x &&
1098
+ colIndex <= d.oldRange.x1) {
1099
+ continue;
1100
+ }
1101
+ // requested column beyond range
1102
+ if (!this.columns[colIndex]) {
1103
+ continue;
1104
+ }
1105
+ const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
1106
+ const copyColIndex = d.oldRange.x + (j % copyColLength);
1107
+ const copyColumnProp = columns[copyColIndex].prop;
1108
+ /** if can write */
1109
+ if (!this.isReadOnly(rowIndex, colIndex)) {
1110
+ /** to show before save */
1111
+ if (!changed[rowIndex]) {
1112
+ changed[rowIndex] = {};
1113
+ }
1114
+ changed[rowIndex][prop] = copyRow[copyColumnProp];
1115
+ /** Generate mapping object */
1116
+ if (!mapping[rowIndex]) {
1117
+ mapping[rowIndex] = {};
1118
+ }
1119
+ mapping[rowIndex][prop] = {
1120
+ colIndex: copyColIndex,
1121
+ colProp: copyColumnProp,
1122
+ rowIndex: oldRowIndex,
1123
+ };
1124
+ }
1125
+ }
1126
+ }
1127
+ return {
1128
+ changed,
1129
+ mapping,
1130
+ };
1131
+ }
1132
+ getTransformedDataToApply(start, data) {
1133
+ const changed = {};
1134
+ const copyRowLength = data.length;
1135
+ const colLength = this.columns.length;
1136
+ const rowLength = this.dataStore.get('items').length;
1137
+ // rows
1138
+ let rowIndex = start.y;
1139
+ let maxCol = 0;
1140
+ for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
1141
+ // copy original data link
1142
+ const copyRow = data[i % copyRowLength];
1143
+ const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
1144
+ // columns
1145
+ let colIndex = start.x;
1146
+ for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {
1147
+ const p = this.columns[colIndex].prop;
1148
+ const currentCol = j % colLength;
1149
+ /** if can write */
1150
+ if (!this.isReadOnly(rowIndex, colIndex)) {
1151
+ /** to show before save */
1152
+ if (!changed[rowIndex]) {
1153
+ changed[rowIndex] = {};
1154
+ }
1155
+ changed[rowIndex][p] = copyRow[currentCol];
1156
+ }
1157
+ }
1158
+ maxCol = Math.max(maxCol, colIndex - 1);
1159
+ }
1160
+ const range = getRange(start, {
1161
+ y: rowIndex - 1,
1162
+ x: maxCol,
1163
+ });
1164
+ return {
1165
+ changed,
1166
+ range,
1167
+ };
1168
+ }
1169
+ getRangeStaticData(d, value) {
1170
+ const changed = {};
1171
+ // rows
1172
+ for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
1173
+ // columns
1174
+ for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
1175
+ // requested column beyond range
1176
+ if (!this.columns[colIndex]) {
1177
+ continue;
1178
+ }
1179
+ const p = this.columns[colIndex].prop;
1180
+ /** if can write */
1181
+ if (!this.isReadOnly(rowIndex, colIndex)) {
1182
+ /** to show before save */
1183
+ if (!changed[rowIndex]) {
1184
+ changed[rowIndex] = {};
1185
+ }
1186
+ changed[rowIndex][p] = value;
1187
+ }
1188
+ }
1189
+ }
1190
+ return changed;
1191
+ }
1192
+ getRangeTransformedToProps(d, store) {
1193
+ var _a;
1194
+ const area = [];
1195
+ const type = this.dataStore.get('type');
1196
+ // rows
1197
+ for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
1198
+ // columns
1199
+ for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
1200
+ const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
1201
+ area.push({
1202
+ prop,
1203
+ rowIndex,
1204
+ colIndex,
1205
+ model: getSourceItem(store, rowIndex),
1206
+ type,
1207
+ colType: this.type,
1208
+ });
1209
+ }
1210
+ }
1211
+ return area;
1212
+ }
1213
+ copyRangeArray(range, store) {
1214
+ const cols = [...this.columns];
1215
+ const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);
1216
+ const toCopy = [];
1217
+ const mapping = {};
1218
+ // rows indexes
1219
+ for (let i = range.y; i <= range.y1; i++) {
1220
+ const rgRow = [];
1221
+ mapping[i] = {};
1222
+ // columns indexes
1223
+ for (let prop of props) {
1224
+ const item = getSourceItem(store, i);
1225
+ // if no item - skip
1226
+ if (!item) {
1227
+ continue;
1228
+ }
1229
+ const val = item[prop];
1230
+ rgRow.push(val);
1231
+ mapping[i][prop] = val;
1232
+ }
1233
+ toCopy.push(rgRow);
1234
+ }
1235
+ return {
1236
+ data: toCopy,
1237
+ mapping,
1238
+ };
1239
+ }
1240
+ destroy() {
1241
+ this.unsubscribe.forEach(f => f());
1242
+ }
1243
+ }
1244
+ /**
1245
+ * Checks if the given rowDrag is a service for dragging rows.
1246
+ */
1247
+ function isRowDragService(rowDrag, model) {
1248
+ if (typeof rowDrag === 'function') {
1249
+ return rowDrag(model);
1250
+ }
1251
+ return !!rowDrag;
1252
+ }
1253
+ function mergeClasses(class1 = {}, class2 = {}) {
1254
+ if (typeof class1 === 'string') {
1255
+ class1 = { [class1]: true };
1256
+ }
1257
+ if (typeof class2 === 'string') {
1258
+ class2 = { [class2]: true };
1259
+ }
1260
+ return Object.assign(Object.assign({}, class1), class2);
1261
+ }
1262
+ function doPropMerge(existing, extra) {
1263
+ // if className is provided - remove it from props it messing with stencil
1264
+ if (extra.className) {
1265
+ extra.class = mergeClasses(extra.class, extra.className);
1266
+ delete extra.className;
1267
+ }
1268
+ let props = Object.assign(Object.assign({}, extra), existing);
1269
+ // extend existing props
1270
+ if (extra.class) {
1271
+ props.class = mergeClasses(props.class, extra.class);
1272
+ }
1273
+ if (extra.style) {
1274
+ props.style = Object.assign(Object.assign({}, extra.style), props.style);
1275
+ }
1276
+ return props;
1277
+ }
1278
+
1279
+ export { PSEUDO_GROUP_ITEM_VALUE as A, GROUPING_ROW_TYPE as B, PSEUDO_GROUP_COLUMN as C, doPropMerge as D, EMPTY_INDEX as E, SelectionStoreConnector as F, GROUP_EXPANDED as G, ColumnService as H, GROUP_EXPAND_BTN as I, PSEUDO_GROUP_ITEM as J, isRowDragService as K, PSEUDO_GROUP_ITEM_ID as P, SelectionStore as S, isRangeSingleCell as a, getSource as b, cropCellToMax as c, getExpanded as d, gatherGrouping as e, getGroupingName as f, getRange as g, isGrouping as h, isHiddenStore as i, isGroupingColumn as j, getParsedGroup as k, isSameGroup as l, measureEqualDepth as m, nextCell as n, getCellData as o, getCellRaw as p, getCellDataParsed as q, getColumnType as r, getColumnSizes as s, isColGrouping as t, getColumns as u, gatherGroup as v, getColumnByProp as w, reduce as x, baseEach$1 as y, GROUP_DEPTH as z };
1280
+
1281
+ //# sourceMappingURL=column.service-a6a7c415.js.map