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