@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
@@ -4,19 +4,16 @@
4
4
  'use strict';
5
5
 
6
6
  const debounce$1 = require('./debounce-ec7a04b4.js');
7
- const index = require('./index-3ab26ab9.js');
8
- const index$1 = require('./index-10d10c55.js');
7
+ const index = require('./index-10d10c55.js');
9
8
 
9
+ /**
10
+ * Todo:
11
+ * Refactor proxy plugin: when items changed outside proxy get recalculated
12
+ */
10
13
  /**
11
14
  * Proxy plugin for data source.
12
- * This plugin is used to sort the data source.
13
- * It keeps the order of the items but does not modify the final source.
14
- * It is also used to filter the items in the data source.
15
- * The `set` method takes a key and a new value as arguments.
16
- * If the key is 'proxyItems' it will filter the items in the data source according to the new value.
17
- * The new value should be an array of numbers representing the indexes of the items that should be visible.
18
- * The method will return a new array of numbers with the indexes of the items that should be visible.
19
- * The method will also update the 'items' property of the store with the new array.
15
+ *
16
+ * This plugin is used keep sortint in the data source, even when trimming is applied sorting has to be preserved.
20
17
  */
21
18
  const proxyPlugin = (store) => ({
22
19
  /**
@@ -27,11 +24,11 @@ const proxyPlugin = (store) => ({
27
24
  * The method will also update the 'items' property of the store with the new array.
28
25
  */
29
26
  set(k, newVal) {
30
- if (!isProxy(k)) {
27
+ if (k !== 'proxyItems') {
31
28
  return;
32
29
  }
33
30
  /**
34
- * Getting existing collection of items
31
+ * Getting existing collection of items (trimmed and filtered)
35
32
  * Mark indexes as visible
36
33
  */
37
34
  const oldItems = store.get('items').reduce((r, v) => {
@@ -39,8 +36,7 @@ const proxyPlugin = (store) => ({
39
36
  return r;
40
37
  }, new Set());
41
38
  /**
42
- * Check if new values where present in items
43
- * Filter item collection according presense
39
+ * Check if new values where present in items, keep filtering and trimming
44
40
  */
45
41
  const newItems = newVal.reduce((r, i) => {
46
42
  if (oldItems.has(i)) {
@@ -51,9 +47,6 @@ const proxyPlugin = (store) => ({
51
47
  store.set('items', newItems);
52
48
  },
53
49
  });
54
- function isProxy(k) {
55
- return k === 'proxyItems';
56
- }
57
50
 
58
51
  /**
59
52
  * The base implementation of `_.findIndex` and `_.findLastIndex` without
@@ -2462,6 +2455,26 @@ function baseMatchesProperty(path, srcValue) {
2462
2455
  };
2463
2456
  }
2464
2457
 
2458
+ /**
2459
+ * This method returns the first argument it receives.
2460
+ *
2461
+ * @static
2462
+ * @since 0.1.0
2463
+ * @memberOf _
2464
+ * @category Util
2465
+ * @param {*} value Any value.
2466
+ * @returns {*} Returns `value`.
2467
+ * @example
2468
+ *
2469
+ * var object = { 'a': 1 };
2470
+ *
2471
+ * console.log(_.identity(object) === object);
2472
+ * // => true
2473
+ */
2474
+ function identity(value) {
2475
+ return value;
2476
+ }
2477
+
2465
2478
  /**
2466
2479
  * The base implementation of `_.property` without support for deep paths.
2467
2480
  *
@@ -2528,7 +2541,7 @@ function baseIteratee(value) {
2528
2541
  return value;
2529
2542
  }
2530
2543
  if (value == null) {
2531
- return index.identity;
2544
+ return identity;
2532
2545
  }
2533
2546
  if (typeof value == 'object') {
2534
2547
  return isArray$1(value)
@@ -2777,9 +2790,9 @@ function createRange(fromRight) {
2777
2790
  * _.range(0);
2778
2791
  * // => []
2779
2792
  */
2780
- var range = createRange();
2793
+ var range$1 = createRange();
2781
2794
 
2782
- const range$1 = range;
2795
+ const range$2 = range$1;
2783
2796
 
2784
2797
  const appendToMap = (map, propName, value) => {
2785
2798
  const items = map.get(propName);
@@ -2819,7 +2832,7 @@ const cleanupElements = debounce((map) => {
2819
2832
  }
2820
2833
  }, 2000);
2821
2834
  const stencilSubscription = () => {
2822
- if (typeof index$1.getRenderingRef !== 'function') {
2835
+ if (typeof index.getRenderingRef !== 'function') {
2823
2836
  // If we are not in a stencil project, we do nothing.
2824
2837
  // This function is not really exported by @stencil/core.
2825
2838
  return {};
@@ -2828,7 +2841,7 @@ const stencilSubscription = () => {
2828
2841
  return {
2829
2842
  dispose: () => elmsToUpdate.clear(),
2830
2843
  get: (propName) => {
2831
- const elm = index$1.getRenderingRef();
2844
+ const elm = index.getRenderingRef();
2832
2845
  if (elm) {
2833
2846
  appendToMap(elmsToUpdate, propName, elm);
2834
2847
  }
@@ -2836,12 +2849,12 @@ const stencilSubscription = () => {
2836
2849
  set: (propName) => {
2837
2850
  const elements = elmsToUpdate.get(propName);
2838
2851
  if (elements) {
2839
- elmsToUpdate.set(propName, elements.filter(index$1.forceUpdate));
2852
+ elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
2840
2853
  }
2841
2854
  cleanupElements(elmsToUpdate);
2842
2855
  },
2843
2856
  reset: () => {
2844
- elmsToUpdate.forEach((elms) => elms.forEach(index$1.forceUpdate));
2857
+ elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
2845
2858
  cleanupElements(elmsToUpdate);
2846
2859
  },
2847
2860
  };
@@ -2979,18 +2992,15 @@ const createStore = (defaultState, shouldUpdate) => {
2979
2992
  const trimmedPlugin = (store) => ({
2980
2993
  set(k, newVal) {
2981
2994
  switch (k) {
2982
- case 'trimmed':
2995
+ case 'trimmed': {
2996
+ // full sorted items list
2983
2997
  const proxy = store.get('proxyItems');
2984
2998
  const trimmed = gatherTrimmedItems(newVal);
2985
- const newItems = proxy.reduce((result, v) => {
2986
- // check if present in new trimmed remove from items (filter)
2987
- if (!trimmed[v]) {
2988
- result.push(v);
2989
- }
2990
- return result;
2991
- }, []);
2999
+ const newItems = proxy.filter(v => !trimmed[v]);
3000
+ // set trimmed items in store
2992
3001
  store.set('items', newItems);
2993
3002
  break;
3003
+ }
2994
3004
  }
2995
3005
  },
2996
3006
  });
@@ -3017,6 +3027,233 @@ function setStore(store, data) {
3017
3027
  });
3018
3028
  }
3019
3029
 
3030
+ const MIN_COL_SIZE = 30;
3031
+ const RESIZE_INTERVAL = 40;
3032
+ const DATA_COL = 'data-rgCol';
3033
+ const DATA_ROW = 'data-rgRow';
3034
+ const DISABLED_CLASS = 'disabled';
3035
+ const CELL_CLASS = 'rgCell';
3036
+ const ROW_HEADER_TYPE = 'rowHeaders';
3037
+ const HEADER_CLASS = 'rgHeaderCell';
3038
+ const HEADER_SORTABLE_CLASS = 'sortable';
3039
+ const HEADER_ROW_CLASS = 'header-rgRow';
3040
+ const HEADER_ACTUAL_ROW_CLASS = 'actual-rgRow';
3041
+ const DRAG_ICON_CLASS = 'revo-drag-icon';
3042
+ const DRAGGABLE_CLASS = 'revo-draggable';
3043
+ const FOCUS_CLASS = 'focused-cell';
3044
+ const SELECTION_BORDER_CLASS = 'selection-border-range';
3045
+ const MOBILE_CLASS = 'mobile-handler';
3046
+ const TMP_SELECTION_BG_CLASS = 'temp-bg-range';
3047
+ const CELL_HANDLER_CLASS = 'autofill-handle';
3048
+ const EDIT_INPUT_WR = 'edit-input-wrapper';
3049
+ const DRAGG_TEXT = 'Draggable item';
3050
+ const GRID_INTERNALS = '__rvgr';
3051
+ const ROW_FOCUSED_CLASS = 'focused-rgRow';
3052
+
3053
+ var codes;
3054
+ (function (codes) {
3055
+ codes[codes["MOUSE_LEFT"] = 1] = "MOUSE_LEFT";
3056
+ codes[codes["MOUSE_RIGHT"] = 3] = "MOUSE_RIGHT";
3057
+ codes[codes["MOUSE_MIDDLE"] = 2] = "MOUSE_MIDDLE";
3058
+ codes[codes["BACKSPACE"] = 8] = "BACKSPACE";
3059
+ codes[codes["COMMA"] = 188] = "COMMA";
3060
+ codes[codes["INSERT"] = 45] = "INSERT";
3061
+ codes[codes["DELETE"] = 46] = "DELETE";
3062
+ codes[codes["END"] = 35] = "END";
3063
+ codes[codes["ENTER"] = 13] = "ENTER";
3064
+ codes[codes["ESCAPE"] = 27] = "ESCAPE";
3065
+ codes[codes["CONTROL"] = 17] = "CONTROL";
3066
+ codes[codes["COMMAND_LEFT"] = 91] = "COMMAND_LEFT";
3067
+ codes[codes["COMMAND_RIGHT"] = 93] = "COMMAND_RIGHT";
3068
+ codes[codes["COMMAND_FIREFOX"] = 224] = "COMMAND_FIREFOX";
3069
+ codes[codes["ALT"] = 18] = "ALT";
3070
+ codes[codes["HOME"] = 36] = "HOME";
3071
+ codes[codes["PAGE_DOWN"] = 34] = "PAGE_DOWN";
3072
+ codes[codes["PAGE_UP"] = 33] = "PAGE_UP";
3073
+ codes[codes["PERIOD"] = 190] = "PERIOD";
3074
+ codes[codes["SPACE"] = 32] = "SPACE";
3075
+ codes[codes["SHIFT"] = 16] = "SHIFT";
3076
+ codes[codes["CAPS_LOCK"] = 20] = "CAPS_LOCK";
3077
+ codes[codes["TAB"] = 9] = "TAB";
3078
+ codes[codes["ARROW_RIGHT"] = 39] = "ARROW_RIGHT";
3079
+ codes[codes["ARROW_LEFT"] = 37] = "ARROW_LEFT";
3080
+ codes[codes["ARROW_UP"] = 38] = "ARROW_UP";
3081
+ codes[codes["ARROW_DOWN"] = 40] = "ARROW_DOWN";
3082
+ codes[codes["F1"] = 112] = "F1";
3083
+ codes[codes["F2"] = 113] = "F2";
3084
+ codes[codes["F3"] = 114] = "F3";
3085
+ codes[codes["F4"] = 115] = "F4";
3086
+ codes[codes["F5"] = 116] = "F5";
3087
+ codes[codes["F6"] = 117] = "F6";
3088
+ codes[codes["F7"] = 118] = "F7";
3089
+ codes[codes["F8"] = 119] = "F8";
3090
+ codes[codes["F9"] = 120] = "F9";
3091
+ codes[codes["F10"] = 121] = "F10";
3092
+ codes[codes["F11"] = 122] = "F11";
3093
+ codes[codes["F12"] = 123] = "F12";
3094
+ codes[codes["A"] = 65] = "A";
3095
+ codes[codes["C"] = 67] = "C";
3096
+ codes[codes["D"] = 68] = "D";
3097
+ codes[codes["F"] = 70] = "F";
3098
+ codes[codes["L"] = 76] = "L";
3099
+ codes[codes["O"] = 79] = "O";
3100
+ codes[codes["P"] = 80] = "P";
3101
+ codes[codes["S"] = 83] = "S";
3102
+ codes[codes["V"] = 86] = "V";
3103
+ codes[codes["X"] = 88] = "X";
3104
+ })(codes || (codes = {}));
3105
+ exports.codesLetter = void 0;
3106
+ (function (codesLetter) {
3107
+ codesLetter["ENTER"] = "Enter";
3108
+ codesLetter["ENTER_NUM"] = "NumpadEnter";
3109
+ codesLetter["A"] = "KeyA";
3110
+ codesLetter["C"] = "KeyC";
3111
+ codesLetter["X"] = "KeyX";
3112
+ codesLetter["V"] = "KeyV";
3113
+ codesLetter["ESCAPE"] = "Escape";
3114
+ codesLetter["TAB"] = "Tab";
3115
+ codesLetter["BACKSPACE"] = "Backspace";
3116
+ codesLetter["DELETE"] = "Delete";
3117
+ codesLetter["ARROW_RIGHT"] = "ArrowRight";
3118
+ codesLetter["ARROW_LEFT"] = "ArrowLeft";
3119
+ codesLetter["ARROW_UP"] = "ArrowUp";
3120
+ codesLetter["ARROW_DOWN"] = "ArrowDown";
3121
+ codesLetter["SHIFT"] = "Shift";
3122
+ })(exports.codesLetter || (exports.codesLetter = {}));
3123
+ exports.keyValues = void 0;
3124
+ (function (keyValues) {
3125
+ keyValues["ENTER"] = "Enter";
3126
+ keyValues["TAB"] = "Tab";
3127
+ })(exports.keyValues || (exports.keyValues = {}));
3128
+ const KeyCodesEnum = codes;
3129
+
3130
+ var osPlatform;
3131
+ (function (osPlatform) {
3132
+ osPlatform["mac"] = "Mac";
3133
+ })(osPlatform || (osPlatform = {}));
3134
+ const OsPlatform = osPlatform;
3135
+
3136
+ /* Generate range on size
3137
+ */
3138
+ function range(size, startAt = 0) {
3139
+ const res = [];
3140
+ const end = startAt + size;
3141
+ for (let i = startAt; i < end; i++) {
3142
+ res.push(i);
3143
+ }
3144
+ return res;
3145
+ }
3146
+ /* Find index position in array */
3147
+ function findPositionInArray(el, compareFn) {
3148
+ return (function (arr) {
3149
+ let m = 0;
3150
+ let n = arr.length - 1;
3151
+ while (m <= n) {
3152
+ const k = (n + m) >> 1;
3153
+ const cmp = compareFn(el, arr[k]);
3154
+ if (cmp > 0) {
3155
+ m = k + 1;
3156
+ }
3157
+ else if (cmp < 0) {
3158
+ n = k - 1;
3159
+ }
3160
+ else {
3161
+ return k;
3162
+ }
3163
+ }
3164
+ return -m - 1;
3165
+ })(this);
3166
+ }
3167
+ /**
3168
+ * Sorted push
3169
+ */
3170
+ function pushSorted(arr, el, fn) {
3171
+ arr.splice(findPositionInArray.bind(arr)(el, fn), 0, el);
3172
+ return arr;
3173
+ }
3174
+ // (arr1[index1] < arr2[index2])
3175
+ function simpleCompare(el1, el2) {
3176
+ return el1 < el2;
3177
+ }
3178
+ /**
3179
+ * Merge sorted array helper function
3180
+ */
3181
+ function mergeSortedArray(arr1, arr2, compareFn = simpleCompare) {
3182
+ const merged = [];
3183
+ let index1 = 0;
3184
+ let index2 = 0;
3185
+ let current = 0;
3186
+ while (current < arr1.length + arr2.length) {
3187
+ let isArr1Depleted = index1 >= arr1.length;
3188
+ let isArr2Depleted = index2 >= arr2.length;
3189
+ if (!isArr1Depleted && (isArr2Depleted || compareFn(arr1[index1], arr2[index2]))) {
3190
+ merged[current] = arr1[index1];
3191
+ index1++;
3192
+ }
3193
+ else {
3194
+ merged[current] = arr2[index2];
3195
+ index2++;
3196
+ }
3197
+ current++;
3198
+ }
3199
+ return merged;
3200
+ }
3201
+ /**
3202
+ * Calculate system scrollbar size
3203
+ */
3204
+ function getScrollbarSize(document) {
3205
+ // Create a temporary div container and append it to the body
3206
+ const container = document.createElement('div');
3207
+ // Apply styling to ensure the div is scrollable
3208
+ container.style.overflow = 'scroll';
3209
+ container.style.visibility = 'hidden'; // make sure the container isn't visible
3210
+ container.style.position = 'absolute';
3211
+ container.style.top = '-9999px'; // move it out of the screen
3212
+ container.style.width = '50px'; // arbitrary width
3213
+ container.style.height = '50px'; // arbitrary height
3214
+ // Append the div to the body
3215
+ document.body.appendChild(container);
3216
+ // Calculate the width of the scrollbar
3217
+ const scrollbarWidth = container.offsetWidth - container.clientWidth;
3218
+ // Remove the div from the body after calculation
3219
+ document.body.removeChild(container);
3220
+ // Return the calculated width of the scrollbar
3221
+ return scrollbarWidth;
3222
+ }
3223
+ /* Scale a value between 2 ranges
3224
+ *
3225
+ * Sample:
3226
+ * // 55 from a 0-100 range to a 0-1000 range (Ranges don't have to be positive)
3227
+ * const n = scaleValue(55, [0,100], [0,1000]);
3228
+ *
3229
+ * Ranges of two values
3230
+ * @from
3231
+ * @to
3232
+ *
3233
+ * ~~ return value does the equivalent of Math.floor but faster.
3234
+ */
3235
+ function scaleValue(value, from, to) {
3236
+ return ((to[1] - to[0]) * (value - from[0])) / (from[1] - from[0]) + to[0];
3237
+ }
3238
+ /**
3239
+ * Async timeout
3240
+ */
3241
+ async function timeout(delay = 0) {
3242
+ await new Promise((r) => {
3243
+ setTimeout(() => r(), delay);
3244
+ });
3245
+ }
3246
+ /**
3247
+ * Type script mixins
3248
+ */
3249
+ function applyMixins(derivedCtor, constructors) {
3250
+ constructors.forEach(baseCtor => {
3251
+ Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
3252
+ Object.defineProperty(derivedCtor.prototype, name, Object.getOwnPropertyDescriptor(baseCtor.prototype, name) || Object.create(null));
3253
+ });
3254
+ });
3255
+ }
3256
+
3020
3257
  /**
3021
3258
  * Data store
3022
3259
  * Manage the state of a data source and provide methods for updating, adding, and refreshing the data.
@@ -3042,7 +3279,7 @@ class DataStore {
3042
3279
  }
3043
3280
  // clear items
3044
3281
  this.store.set('items', []);
3045
- const items = range$1(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
3282
+ const items = range$2(0, (source === null || source === void 0 ? void 0 : source.length) || 0);
3046
3283
  // set proxy first
3047
3284
  setStore(this.store, {
3048
3285
  source,
@@ -3152,1305 +3389,285 @@ function getSourceItemVirtualIndexByProp(store, prop) {
3152
3389
  return items.indexOf(physicalIndex);
3153
3390
  }
3154
3391
 
3155
- /**
3156
- * A specialized version of `_.reduce` for arrays without support for
3157
- * iteratee shorthands.
3158
- *
3159
- * @private
3160
- * @param {Array} [array] The array to iterate over.
3161
- * @param {Function} iteratee The function invoked per iteration.
3162
- * @param {*} [accumulator] The initial value.
3163
- * @param {boolean} [initAccum] Specify using the first element of `array` as
3164
- * the initial value.
3165
- * @returns {*} Returns the accumulated value.
3166
- */
3167
- function arrayReduce(array, iteratee, accumulator, initAccum) {
3168
- var index = -1,
3169
- length = array == null ? 0 : array.length;
3170
-
3171
- if (initAccum && length) {
3172
- accumulator = array[++index];
3173
- }
3174
- while (++index < length) {
3175
- accumulator = iteratee(accumulator, array[index], index, array);
3176
- }
3177
- return accumulator;
3178
- }
3392
+ /** Used as references for the maximum length and index of an array. */
3393
+ var MAX_ARRAY_LENGTH$1 = 4294967295,
3394
+ MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH$1 - 1;
3179
3395
 
3180
- /**
3181
- * Creates a base function for methods like `_.forIn` and `_.forOwn`.
3182
- *
3183
- * @private
3184
- * @param {boolean} [fromRight] Specify iterating from right to left.
3185
- * @returns {Function} Returns the new base function.
3186
- */
3187
- function createBaseFor(fromRight) {
3188
- return function(object, iteratee, keysFunc) {
3189
- var index = -1,
3190
- iterable = Object(object),
3191
- props = keysFunc(object),
3192
- length = props.length;
3193
-
3194
- while (length--) {
3195
- var key = props[fromRight ? length : ++index];
3196
- if (iteratee(iterable[key], key, iterable) === false) {
3197
- break;
3198
- }
3396
+ /* Built-in method references for those with the same name as other `lodash` methods. */
3397
+ var nativeFloor = Math.floor,
3398
+ nativeMin = Math.min;
3399
+
3400
+ /**
3401
+ * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
3402
+ * which invokes `iteratee` for `value` and each element of `array` to compute
3403
+ * their sort ranking. The iteratee is invoked with one argument; (value).
3404
+ *
3405
+ * @private
3406
+ * @param {Array} array The sorted array to inspect.
3407
+ * @param {*} value The value to evaluate.
3408
+ * @param {Function} iteratee The iteratee invoked per element.
3409
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3410
+ * @returns {number} Returns the index at which `value` should be inserted
3411
+ * into `array`.
3412
+ */
3413
+ function baseSortedIndexBy(array, value, iteratee, retHighest) {
3414
+ var low = 0,
3415
+ high = array == null ? 0 : array.length;
3416
+ if (high === 0) {
3417
+ return 0;
3418
+ }
3419
+
3420
+ value = iteratee(value);
3421
+ var valIsNaN = value !== value,
3422
+ valIsNull = value === null,
3423
+ valIsSymbol = debounce$1.isSymbol(value),
3424
+ valIsUndefined = value === undefined;
3425
+
3426
+ while (low < high) {
3427
+ var mid = nativeFloor((low + high) / 2),
3428
+ computed = iteratee(array[mid]),
3429
+ othIsDefined = computed !== undefined,
3430
+ othIsNull = computed === null,
3431
+ othIsReflexive = computed === computed,
3432
+ othIsSymbol = debounce$1.isSymbol(computed);
3433
+
3434
+ if (valIsNaN) {
3435
+ var setLow = retHighest || othIsReflexive;
3436
+ } else if (valIsUndefined) {
3437
+ setLow = othIsReflexive && (retHighest || othIsDefined);
3438
+ } else if (valIsNull) {
3439
+ setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
3440
+ } else if (valIsSymbol) {
3441
+ setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
3442
+ } else if (othIsNull || othIsSymbol) {
3443
+ setLow = false;
3444
+ } else {
3445
+ setLow = retHighest ? (computed <= value) : (computed < value);
3199
3446
  }
3200
- return object;
3201
- };
3447
+ if (setLow) {
3448
+ low = mid + 1;
3449
+ } else {
3450
+ high = mid;
3451
+ }
3452
+ }
3453
+ return nativeMin(high, MAX_ARRAY_INDEX);
3202
3454
  }
3203
3455
 
3204
- /**
3205
- * The base implementation of `baseForOwn` which iterates over `object`
3206
- * properties returned by `keysFunc` and invokes `iteratee` for each property.
3207
- * Iteratee functions may exit iteration early by explicitly returning `false`.
3208
- *
3209
- * @private
3210
- * @param {Object} object The object to iterate over.
3211
- * @param {Function} iteratee The function invoked per iteration.
3212
- * @param {Function} keysFunc The function to get the keys of `object`.
3213
- * @returns {Object} Returns `object`.
3214
- */
3215
- var baseFor = createBaseFor();
3216
-
3217
- const baseFor$1 = baseFor;
3456
+ /** Used as references for the maximum length and index of an array. */
3457
+ var MAX_ARRAY_LENGTH = 4294967295,
3458
+ HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
3218
3459
 
3219
3460
  /**
3220
- * The base implementation of `_.forOwn` without support for iteratee shorthands.
3461
+ * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
3462
+ * performs a binary search of `array` to determine the index at which `value`
3463
+ * should be inserted into `array` in order to maintain its sort order.
3221
3464
  *
3222
3465
  * @private
3223
- * @param {Object} object The object to iterate over.
3224
- * @param {Function} iteratee The function invoked per iteration.
3225
- * @returns {Object} Returns `object`.
3466
+ * @param {Array} array The sorted array to inspect.
3467
+ * @param {*} value The value to evaluate.
3468
+ * @param {boolean} [retHighest] Specify returning the highest qualified index.
3469
+ * @returns {number} Returns the index at which `value` should be inserted
3470
+ * into `array`.
3226
3471
  */
3227
- function baseForOwn(object, iteratee) {
3228
- return object && baseFor$1(object, iteratee, keys);
3229
- }
3472
+ function baseSortedIndex(array, value, retHighest) {
3473
+ var low = 0,
3474
+ high = array == null ? low : array.length;
3230
3475
 
3231
- /**
3232
- * Creates a `baseEach` or `baseEachRight` function.
3233
- *
3234
- * @private
3235
- * @param {Function} eachFunc The function to iterate over a collection.
3236
- * @param {boolean} [fromRight] Specify iterating from right to left.
3237
- * @returns {Function} Returns the new base function.
3238
- */
3239
- function createBaseEach(eachFunc, fromRight) {
3240
- return function(collection, iteratee) {
3241
- if (collection == null) {
3242
- return collection;
3243
- }
3244
- if (!isArrayLike(collection)) {
3245
- return eachFunc(collection, iteratee);
3246
- }
3247
- var length = collection.length,
3248
- index = fromRight ? length : -1,
3249
- iterable = Object(collection);
3476
+ if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
3477
+ while (low < high) {
3478
+ var mid = (low + high) >>> 1,
3479
+ computed = array[mid];
3250
3480
 
3251
- while ((fromRight ? index-- : ++index < length)) {
3252
- if (iteratee(iterable[index], index, iterable) === false) {
3253
- break;
3481
+ if (computed !== null && !debounce$1.isSymbol(computed) &&
3482
+ (retHighest ? (computed <= value) : (computed < value))) {
3483
+ low = mid + 1;
3484
+ } else {
3485
+ high = mid;
3254
3486
  }
3255
3487
  }
3256
- return collection;
3257
- };
3258
- }
3259
-
3260
- /**
3261
- * The base implementation of `_.forEach` without support for iteratee shorthands.
3262
- *
3263
- * @private
3264
- * @param {Array|Object} collection The collection to iterate over.
3265
- * @param {Function} iteratee The function invoked per iteration.
3266
- * @returns {Array|Object} Returns `collection`.
3267
- */
3268
- var baseEach = createBaseEach(baseForOwn);
3269
-
3270
- const baseEach$1 = baseEach;
3271
-
3272
- /**
3273
- * The base implementation of `_.reduce` and `_.reduceRight`, without support
3274
- * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
3275
- *
3276
- * @private
3277
- * @param {Array|Object} collection The collection to iterate over.
3278
- * @param {Function} iteratee The function invoked per iteration.
3279
- * @param {*} accumulator The initial value.
3280
- * @param {boolean} initAccum Specify using the first or last element of
3281
- * `collection` as the initial value.
3282
- * @param {Function} eachFunc The function to iterate over `collection`.
3283
- * @returns {*} Returns the accumulated value.
3284
- */
3285
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
3286
- eachFunc(collection, function(value, index, collection) {
3287
- accumulator = initAccum
3288
- ? (initAccum = false, value)
3289
- : iteratee(accumulator, value, index, collection);
3290
- });
3291
- return accumulator;
3488
+ return high;
3489
+ }
3490
+ return baseSortedIndexBy(array, value, identity, retHighest);
3292
3491
  }
3293
3492
 
3294
3493
  /**
3295
- * Reduces `collection` to a value which is the accumulated result of running
3296
- * each element in `collection` thru `iteratee`, where each successive
3297
- * invocation is supplied the return value of the previous. If `accumulator`
3298
- * is not given, the first element of `collection` is used as the initial
3299
- * value. The iteratee is invoked with four arguments:
3300
- * (accumulator, value, index|key, collection).
3301
- *
3302
- * Many lodash methods are guarded to work as iteratees for methods like
3303
- * `_.reduce`, `_.reduceRight`, and `_.transform`.
3304
- *
3305
- * The guarded methods are:
3306
- * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
3307
- * and `sortBy`
3494
+ * Uses a binary search to determine the lowest index at which `value`
3495
+ * should be inserted into `array` in order to maintain its sort order.
3308
3496
  *
3309
3497
  * @static
3310
3498
  * @memberOf _
3311
3499
  * @since 0.1.0
3312
- * @category Collection
3313
- * @param {Array|Object} collection The collection to iterate over.
3314
- * @param {Function} [iteratee=_.identity] The function invoked per iteration.
3315
- * @param {*} [accumulator] The initial value.
3316
- * @returns {*} Returns the accumulated value.
3317
- * @see _.reduceRight
3500
+ * @category Array
3501
+ * @param {Array} array The sorted array to inspect.
3502
+ * @param {*} value The value to evaluate.
3503
+ * @returns {number} Returns the index at which `value` should be inserted
3504
+ * into `array`.
3318
3505
  * @example
3319
3506
  *
3320
- * _.reduce([1, 2], function(sum, n) {
3321
- * return sum + n;
3322
- * }, 0);
3323
- * // => 3
3324
- *
3325
- * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
3326
- * (result[value] || (result[value] = [])).push(key);
3327
- * return result;
3328
- * }, {});
3329
- * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
3507
+ * _.sortedIndex([30, 50], 40);
3508
+ * // => 1
3330
3509
  */
3331
- function reduce(collection, iteratee, accumulator) {
3332
- var func = isArray$1(collection) ? arrayReduce : baseReduce,
3333
- initAccum = arguments.length < 3;
3334
-
3335
- return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach$1);
3510
+ function sortedIndex(array, value) {
3511
+ return baseSortedIndex(array, value);
3336
3512
  }
3337
3513
 
3338
3514
  /**
3339
- * Selection store
3515
+ * Pre-calculation
3516
+ * Dimension custom sizes for each cell
3517
+ * Keeps only changed sizes, skips origin size
3340
3518
  */
3341
- function defaultState() {
3342
- return {
3343
- range: null,
3344
- tempRange: null,
3345
- tempRangeType: null,
3346
- focus: null,
3347
- edit: null,
3348
- lastCell: null,
3349
- nextFocus: null,
3350
- };
3351
- }
3352
- class SelectionStore {
3353
- constructor() {
3354
- this.unsubscribe = [];
3355
- this.store = createStore(defaultState());
3356
- this.store.on('set', (key, newVal) => {
3357
- if (key === 'tempRange' && !newVal) {
3358
- this.store.set('tempRangeType', null);
3359
- }
3360
- });
3361
- }
3362
- onChange(propName, cb) {
3363
- this.unsubscribe.push(this.store.onChange(propName, cb));
3364
- }
3365
- clearFocus() {
3366
- setStore(this.store, { focus: null, range: null, edit: null, tempRange: null });
3367
- }
3368
- setFocus(focus, end) {
3369
- if (!end) {
3370
- setStore(this.store, { focus });
3371
- }
3372
- else {
3373
- setStore(this.store, {
3374
- focus,
3375
- range: getRange(focus, end),
3376
- edit: null,
3377
- tempRange: null,
3378
- });
3379
- }
3380
- }
3381
- setNextFocus(focus) {
3382
- setStore(this.store, { nextFocus: focus });
3383
- }
3384
- setTempArea(range) {
3385
- 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 });
3386
- }
3387
- clearTemp() {
3388
- setStore(this.store, { tempRange: null });
3389
- }
3390
- /** Can be applied from selection change or from simple keyboard change clicks */
3391
- setRangeArea(range) {
3392
- setStore(this.store, { range, edit: null, tempRange: null });
3393
- }
3394
- setRange(start, end) {
3395
- const range = getRange(start, end);
3396
- this.setRangeArea(range);
3397
- }
3398
- setLastCell(lastCell) {
3399
- setStore(this.store, { lastCell });
3400
- }
3401
- setEdit(val) {
3402
- const focus = this.store.get('focus');
3403
- if (focus && typeof val === 'string') {
3404
- setStore(this.store, {
3405
- edit: { x: focus.x, y: focus.y, val },
3406
- });
3407
- return;
3408
- }
3409
- setStore(this.store, { edit: null });
3410
- }
3411
- dispose() {
3412
- this.unsubscribe.forEach(f => f());
3413
- this.store.dispose();
3414
- }
3415
- }
3416
-
3417
- const EMPTY_INDEX = -1;
3418
- class SelectionStoreConnector {
3419
- constructor() {
3420
- // dirty flag required to cleanup whole store in case visibility of panels changed
3421
- this.dirty = false;
3422
- this.stores = {};
3423
- this.columnStores = {};
3424
- this.rowStores = {};
3425
- /**
3426
- * Helpers for data conversion
3427
- */
3428
- this.storesByType = {};
3429
- this.storesXToType = {};
3430
- this.storesYToType = {};
3431
- this.sections = [];
3432
- }
3433
- get focusedStore() {
3434
- var _a;
3435
- for (let y in this.stores) {
3436
- for (let x in this.stores[y]) {
3437
- const focused = (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.store.get('focus');
3438
- if (focused) {
3439
- return {
3440
- entity: this.stores[y][x],
3441
- cell: focused,
3442
- position: {
3443
- x: parseInt(x, 10),
3444
- y: parseInt(y, 10),
3445
- },
3446
- };
3447
- }
3448
- }
3449
- }
3450
- return null;
3451
- }
3452
- get edit() {
3453
- var _a;
3454
- return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('edit');
3455
- }
3456
- get focused() {
3457
- var _a;
3458
- return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('focus');
3459
- }
3460
- get selectedRange() {
3461
- var _a;
3462
- return (_a = this.focusedStore) === null || _a === void 0 ? void 0 : _a.entity.store.get('range');
3463
- }
3464
- registerSection(e) {
3465
- if (!e) {
3466
- this.sections.length = 0;
3467
- // some elements removed, rebuild stores
3468
- this.dirty = true;
3469
- return;
3470
- }
3471
- if (this.sections.indexOf(e) === -1) {
3472
- this.sections.push(e);
3473
- }
3474
- }
3475
- // check if require to cleanup all stores
3476
- beforeUpdate() {
3477
- if (this.dirty) {
3478
- for (let y in this.stores) {
3479
- for (let x in this.stores[y]) {
3480
- this.stores[y][x].dispose();
3481
- }
3482
- }
3483
- this.dirty = false;
3484
- }
3485
- }
3486
- registerColumn(x, type) {
3487
- // if hidden just create store but no operations needed
3488
- if (isHiddenStore(x)) {
3489
- return new SelectionStore();
3490
- }
3491
- if (this.columnStores[x]) {
3492
- return this.columnStores[x];
3493
- }
3494
- this.columnStores[x] = new SelectionStore();
3495
- // build cross-linking type to position
3496
- this.storesByType[type] = x;
3497
- this.storesXToType[x] = type;
3498
- return this.columnStores[x];
3499
- }
3500
- registerRow(y, type) {
3501
- // if hidden just create store
3502
- if (isHiddenStore(y)) {
3503
- return new SelectionStore();
3504
- }
3505
- if (this.rowStores[y]) {
3506
- return this.rowStores[y];
3507
- }
3508
- this.rowStores[y] = new SelectionStore();
3509
- // build cross linking type to position
3510
- this.storesByType[type] = y;
3511
- this.storesYToType[y] = type;
3512
- return this.rowStores[y];
3513
- }
3514
- /**
3515
- * Cross store proxy, based on multiple dimensions
3516
- */
3517
- register({ x, y }) {
3518
- var _a, _b;
3519
- // if hidden just create store
3520
- if (isHiddenStore(x) || isHiddenStore(y)) {
3521
- return new SelectionStore();
3522
- }
3523
- if (!this.stores[y]) {
3524
- this.stores[y] = {};
3525
- }
3526
- if (this.stores[y][x]) {
3527
- // Store already registered. Do not register twice
3528
- return this.stores[y][x];
3529
- }
3530
- this.stores[y][x] = new SelectionStore();
3531
- // proxy update, column store trigger only range area
3532
- (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.onChange('range', c => {
3533
- this.columnStores[x].setRangeArea(c);
3534
- this.rowStores[y].setRangeArea(c);
3535
- });
3536
- // clean up on remove
3537
- (_b = this.stores[y][x]) === null || _b === void 0 ? void 0 : _b.store.on('dispose', () => this.destroy(x, y));
3538
- return this.stores[y][x];
3539
- }
3540
- destroy(x, y) {
3541
- var _a, _b;
3542
- (_a = this.columnStores[x]) === null || _a === void 0 ? void 0 : _a.dispose();
3543
- (_b = this.rowStores[y]) === null || _b === void 0 ? void 0 : _b.dispose();
3544
- delete this.rowStores[y];
3545
- delete this.columnStores[x];
3546
- // clear x cross-link
3547
- if (this.storesXToType[x]) {
3548
- const type = this.storesXToType[x];
3549
- delete this.storesXToType[x];
3550
- delete this.storesByType[type];
3551
- }
3552
- // clear y cross-link
3553
- if (this.storesYToType[y]) {
3554
- const type = this.storesYToType[y];
3555
- delete this.storesYToType[y];
3556
- delete this.storesByType[type];
3557
- }
3558
- if (this.stores[y]) {
3559
- delete this.stores[y][x];
3560
- }
3561
- // clear empty rows
3562
- if (!Object.keys(this.stores[y] || {}).length) {
3563
- delete this.stores[y];
3564
- }
3565
- }
3566
- setEditByCell(storePos, editCell) {
3567
- this.focusByCell(storePos, editCell, editCell);
3568
- this.setEdit('');
3569
- }
3570
- /**
3571
- * Sets the next focus cell before the current one.
3572
- *
3573
- * @param focus - The cell to set as the next focus.
3574
- */
3575
- beforeNextFocusCell(focus) {
3576
- var _a;
3577
- // If there is no focused store, return early.
3578
- if (!this.focusedStore) {
3579
- return;
3580
- }
3581
- // Get the next store based on the current focus and the last cell.
3582
- const lastCell = this.focusedStore.entity.store.get('lastCell');
3583
- const next = lastCell && this.getNextStore(focus, this.focusedStore.position, lastCell);
3584
- // Set the next focus cell in the store.
3585
- (_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));
3586
- }
3587
- focusByCell(storePos, start, end) {
3588
- const store = this.stores[storePos.y][storePos.x];
3589
- this.focus(store, { focus: start, end });
3590
- }
3591
- focus(store, { focus, end }) {
3592
- const currentStorePointer = this.getCurrentStorePointer(store);
3593
- if (!currentStorePointer) {
3594
- return null;
3595
- }
3596
- // check for the focus in nearby store/viewport
3597
- const lastCell = store.store.get('lastCell');
3598
- const next = lastCell && this.getNextStore(focus, currentStorePointer, lastCell);
3599
- // if next store present - update
3600
- if (next === null || next === void 0 ? void 0 : next.store) {
3601
- const item = Object.assign(Object.assign({}, focus), next.item);
3602
- this.focus(next.store, { focus: item, end: item });
3603
- return null;
3604
- }
3605
- if (lastCell) {
3606
- focus = cropCellToMax(focus, lastCell);
3607
- end = cropCellToMax(end, lastCell);
3608
- }
3609
- store.setFocus(focus, end);
3610
- return focus;
3611
- }
3612
- /**
3613
- * Retrieves the current store pointer based on the active store.
3614
- * Clears focus from all stores except the active one.
3615
- */
3616
- getCurrentStorePointer(store) {
3617
- let currentStorePointer;
3618
- // Iterate through all stores
3619
- for (let y in this.stores) {
3620
- for (let x in this.stores[y]) {
3621
- const s = this.stores[y][x];
3622
- // Clear focus from stores other than the active one
3623
- if (s !== store) {
3624
- s.clearFocus();
3625
- }
3626
- else {
3627
- // Update the current store pointer with the active store coordinates
3628
- currentStorePointer = {
3629
- x: parseInt(x, 10),
3630
- y: parseInt(y, 10)
3631
- };
3632
- }
3633
- }
3634
- }
3635
- return currentStorePointer;
3636
- }
3637
- /**
3638
- * Retrieves the next store based on the focus cell and current store pointer.
3639
- * If the next store exists, returns an object with the next store and the item in the new store.
3640
- * If the next store does not exist, returns null.
3641
- */
3642
- getNextStore(focus, currentStorePointer, lastCell) {
3643
- // item in new store
3644
- const nextItem = nextCell(focus, lastCell);
3645
- let nextStore;
3646
- if (nextItem) {
3647
- Object.entries(nextItem).forEach(([type, nextItemCoord]) => {
3648
- let stores;
3649
- switch (type) {
3650
- case 'x':
3651
- // Get the X stores for the current Y coordinate of the current store pointer
3652
- stores = this.getXStores(currentStorePointer.y);
3653
- break;
3654
- case 'y':
3655
- // Get the Y stores for the current X coordinate of the current store pointer
3656
- stores = this.getYStores(currentStorePointer.x);
3657
- break;
3658
- }
3659
- // Get the next store based on the item in the new store
3660
- if (nextItemCoord >= 0) {
3661
- nextStore = stores[++currentStorePointer[type]];
3662
- }
3663
- else {
3664
- nextStore = stores[--currentStorePointer[type]];
3665
- const nextLastCell = nextStore === null || nextStore === void 0 ? void 0 : nextStore.store.get('lastCell');
3666
- if (nextLastCell) {
3667
- nextItem[type] = nextLastCell[type] + nextItemCoord;
3668
- }
3669
- }
3670
- });
3671
- }
3672
- return {
3673
- store: nextStore,
3674
- item: nextItem,
3519
+ function calculateDimensionData(originItemSize, newSizes = {}) {
3520
+ const positionIndexes = [];
3521
+ const positionIndexToItem = {};
3522
+ const indexToItem = {};
3523
+ // prepare order sorted new sizes and calculate changed real size
3524
+ const newIndexes = Object.keys(newSizes).map(Number).sort((a, b) => a - b);
3525
+ let previous;
3526
+ for (let i = 0; i < newIndexes.length; i++) {
3527
+ const itemIndex = newIndexes[i];
3528
+ const newItem = {
3529
+ itemIndex,
3530
+ start: 0,
3531
+ end: 0,
3675
3532
  };
3676
- }
3677
- clearAll() {
3678
- var _a;
3679
- for (let y in this.stores) {
3680
- for (let x in this.stores[y]) {
3681
- (_a = this.stores[y][x]) === null || _a === void 0 ? void 0 : _a.clearFocus();
3682
- }
3683
- }
3684
- }
3685
- setEdit(val) {
3686
- if (!this.focusedStore) {
3687
- return;
3688
- }
3689
- this.focusedStore.entity.setEdit(val);
3690
- }
3691
- /**
3692
- * Select all cells across all stores
3693
- */
3694
- selectAll() {
3695
- for (let y in this.stores) {
3696
- for (let x in this.stores[y]) {
3697
- const store = this.stores[y][x];
3698
- if (!store) {
3699
- continue;
3700
- }
3701
- const lastCell = store.store.get('lastCell');
3702
- if (lastCell) {
3703
- store.setRange({ x: 0, y: 0 }, { x: lastCell.x - 1, y: lastCell.y - 1 });
3704
- }
3705
- }
3706
- }
3707
- }
3708
- getXStores(y) {
3709
- return this.stores[y];
3710
- }
3711
- getYStores(x) {
3712
- const stores = {};
3713
- for (let i in this.stores) {
3714
- stores[i] = this.stores[i][x];
3715
- }
3716
- return stores;
3717
- }
3718
- }
3719
-
3720
- function isHiddenStore(pos) {
3721
- return pos === EMPTY_INDEX;
3722
- }
3723
- function nextCell(cell, lastCell) {
3724
- const nextItem = {};
3725
- let types = ['x', 'y'];
3726
- // previous item check
3727
- for (let t of types) {
3728
- if (cell[t] < 0) {
3729
- nextItem[t] = cell[t];
3730
- return nextItem;
3731
- }
3732
- }
3733
- // next item check
3734
- for (let t of types) {
3735
- if (cell[t] >= lastCell[t]) {
3736
- nextItem[t] = cell[t] - lastCell[t];
3737
- return nextItem;
3738
- }
3739
- }
3740
- return null;
3741
- }
3742
- function cropCellToMax(cell, lastCell) {
3743
- const croppedCell = Object.assign({}, cell);
3744
- const cellCoordinates = ['x', 'y'];
3745
- for (const coordinate of cellCoordinates) {
3746
- if (cell[coordinate] < 0) {
3747
- croppedCell[coordinate] = 0;
3748
- }
3749
- else if (cell[coordinate] >= lastCell[coordinate]) {
3750
- croppedCell[coordinate] = lastCell[coordinate] - 1;
3751
- }
3752
- }
3753
- return croppedCell;
3754
- }
3755
- function getRange(start, end) {
3756
- return start && end
3757
- ? {
3758
- x: Math.min(start.x, end.x),
3759
- y: Math.min(start.y, end.y),
3760
- x1: Math.max(start.x, end.x),
3761
- y1: Math.max(start.y, end.y),
3762
- }
3763
- : null;
3764
- }
3765
- function isRangeSingleCell(a) {
3766
- return a.x === a.x1 && a.y === a.y1;
3767
- }
3768
-
3769
- function getCellData(val) {
3770
- if (typeof val === 'undefined' || val === null) {
3771
- return '';
3772
- }
3773
- return val;
3774
- }
3775
- function getCellDataParsed(model, column) {
3776
- const val = column.cellParser ? column.cellParser(model, column) : model[column.prop];
3777
- return getCellData(val);
3778
- }
3779
- /**
3780
- * Get column type from column data
3781
- */
3782
- function getColumnType(rgCol) {
3783
- if (rgCol.pin) {
3784
- return rgCol.pin;
3785
- }
3786
- return 'rgCol';
3787
- }
3788
- function getColumnSizes(cols) {
3789
- const res = {};
3790
- for (const [i, c] of cols.entries()) {
3791
- if (c.size) {
3792
- res[i] = c.size;
3793
- }
3794
- }
3795
- return res;
3796
- }
3797
- /**
3798
- * Check if column is grouping column
3799
- */
3800
- function isColGrouping(colData) {
3801
- return !!colData.children;
3802
- }
3803
- /**
3804
- * This function is used to create a collection of columns.
3805
- */
3806
- function getColumns(columns, level = 0, types) {
3807
- const collection = {
3808
- // columns as they are in stores per type
3809
- columns: {
3810
- rgCol: [],
3811
- colPinStart: [],
3812
- colPinEnd: [],
3813
- },
3814
- // columns indexed by prop for quick access
3815
- columnByProp: {},
3816
- // column grouping
3817
- columnGrouping: {
3818
- rgCol: [],
3819
- colPinStart: [],
3820
- colPinEnd: [],
3821
- },
3822
- // max depth level for column grouping
3823
- maxLevel: level,
3824
- // sorting
3825
- sort: {},
3826
- };
3827
- return reduce(columns, (res, colData) => {
3828
- // Grouped column
3829
- if (isColGrouping(colData)) {
3830
- return gatherGroup(res, colData, getColumns(colData.children, level + 1, types), level);
3831
- }
3832
- // Column type
3833
- const columnDefinitionFromType = colData.columnType && (types === null || types === void 0 ? void 0 : types[colData.columnType]);
3834
- // Regular column
3835
- const regularColumn = Object.assign(Object.assign({}, columnDefinitionFromType), colData);
3836
- // Regular column, no Pin
3837
- if (!regularColumn.pin) {
3838
- res.columns.rgCol.push(regularColumn);
3839
- // Pin
3533
+ // if previous item was changed too
3534
+ if (previous) {
3535
+ const itemsBetween = (itemIndex - previous.itemIndex - 1) * originItemSize;
3536
+ newItem.start = itemsBetween + previous.end;
3840
3537
  }
3841
3538
  else {
3842
- res.columns[regularColumn.pin].push(regularColumn);
3843
- }
3844
- if (regularColumn.order) {
3845
- res.sort[regularColumn.prop] = regularColumn;
3846
- }
3847
- // it's possible that some columns have same prop, but better to avoid it
3848
- if (!res.columnByProp[regularColumn.prop]) {
3849
- res.columnByProp[regularColumn.prop] = [];
3850
- }
3851
- res.columnByProp[regularColumn.prop].push(regularColumn);
3852
- // trigger setup hook if present
3853
- regularColumn.beforeSetup && regularColumn.beforeSetup(regularColumn);
3854
- return res;
3855
- }, collection);
3856
- }
3857
- function gatherGroup(res, colData, collection, level = 0) {
3858
- // group template
3859
- const group = Object.assign(Object.assign({}, colData), { level, ids: [] });
3860
- // check columns for update
3861
- for (let k in collection.columns) {
3862
- const key = k;
3863
- const resultItem = res.columns[key];
3864
- const collectionItem = collection.columns[key];
3865
- // if column data
3866
- if (isArray$1(resultItem) && isArray$1(collectionItem)) {
3867
- // fill columns
3868
- resultItem.push(...collectionItem);
3869
- // fill grouping
3870
- if (collectionItem.length) {
3871
- res.columnGrouping[key].push(Object.assign(Object.assign({}, group), { ids: collectionItem.map(item => item.prop) }));
3872
- }
3539
+ newItem.start = itemIndex * originItemSize;
3873
3540
  }
3541
+ newItem.end = newItem.start + newSizes[itemIndex];
3542
+ positionIndexes.push(newItem.start);
3543
+ indexToItem[itemIndex] = positionIndexToItem[i] = newItem;
3544
+ previous = newItem;
3874
3545
  }
3875
- // merge column groupings
3876
- for (let k in collection.columnGrouping) {
3877
- const key = k;
3878
- const collectionItem = collection.columnGrouping[key];
3879
- res.columnGrouping[key].push(...collectionItem);
3880
- }
3881
- res.maxLevel = Math.max(res.maxLevel, collection.maxLevel);
3882
- res.sort = Object.assign(Object.assign({}, res.sort), collection.sort);
3883
- return res;
3884
- }
3885
- function findColumn(columns, prop) {
3886
- for (const c of columns) {
3887
- if (isColGrouping(c)) {
3888
- const found = findColumn(c.children, prop);
3889
- if (found) {
3890
- return found;
3891
- }
3892
- }
3893
- else if (c.prop === prop) {
3894
- return c;
3895
- }
3896
- }
3897
- return undefined;
3898
- }
3899
- function getColumnByProp(columns, prop) {
3900
- return findColumn(columns, prop);
3901
- }
3902
-
3903
- const GROUP_DEPTH = `${index.GRID_INTERNALS}-depth`;
3904
- const PSEUDO_GROUP_ITEM = `${index.GRID_INTERNALS}-name`;
3905
- const PSEUDO_GROUP_ITEM_ID = `${index.GRID_INTERNALS}-id`;
3906
- const PSEUDO_GROUP_ITEM_VALUE = `${index.GRID_INTERNALS}-value`;
3907
- const PSEUDO_GROUP_COLUMN = `${index.GRID_INTERNALS}-column`;
3908
- const GROUP_EXPANDED = `${index.GRID_INTERNALS}-expanded`;
3909
- const GROUP_ORIGINAL_INDEX = `${index.GRID_INTERNALS}-original-index`;
3910
- const GROUP_EXPAND_BTN = `group-expand`;
3911
- const GROUP_EXPAND_EVENT = `groupexpandclick`;
3912
- const GROUPING_ROW_TYPE = 'rgRow';
3913
-
3914
- function getGroupValueDefault(item, prop) {
3915
- return item[prop] || null;
3916
- }
3917
- /**
3918
- * Gather data for grouping
3919
- * @param array - flat data array
3920
- * @param groupIds - ids of groups
3921
- * @param expanded - potentially expanded items if present
3922
- */
3923
- function gatherGrouping(array, groupIds, { prevExpanded, expandedAll, getGroupValue = getGroupValueDefault, }) {
3924
- const groupedItems = new Map();
3925
- array.forEach((item, originalIndex) => {
3926
- const groupLevelValues = groupIds.map(groupId => getGroupValue(item, groupId));
3927
- const lastLevelValue = groupLevelValues.pop();
3928
- let currentGroupLevel = groupedItems;
3929
- groupLevelValues.forEach(value => {
3930
- if (!currentGroupLevel.has(value)) {
3931
- currentGroupLevel.set(value, new Map());
3932
- }
3933
- currentGroupLevel = currentGroupLevel.get(value);
3934
- });
3935
- if (!currentGroupLevel.has(lastLevelValue)) {
3936
- currentGroupLevel.set(lastLevelValue, []);
3937
- }
3938
- const lastLevelItems = currentGroupLevel.get(lastLevelValue);
3939
- lastLevelItems.push(Object.assign(Object.assign({}, item), { [GROUP_ORIGINAL_INDEX]: originalIndex }));
3940
- });
3941
- let itemIndex = -1;
3942
- const groupingDepth = groupIds.length;
3943
- // collapse all groups in the beginning
3944
- const trimmed = {};
3945
- // index mapping
3946
- const oldNewIndexMap = {};
3947
- // check if group header exists
3948
- const pseudoGroupTest = {};
3949
- const sourceWithGroups = [];
3950
- function flattenGroupMaps(groupedValues, parentIds, isExpanded) {
3951
- const depth = parentIds.length;
3952
- groupedValues.forEach((innerGroupedValues, groupId) => {
3953
- const levelIds = [...parentIds, groupId];
3954
- const mergedIds = levelIds.join(',');
3955
- const isGroupExpanded = isExpanded && (!!expandedAll || !!(prevExpanded === null || prevExpanded === void 0 ? void 0 : prevExpanded[mergedIds]));
3956
- sourceWithGroups.push({
3957
- [PSEUDO_GROUP_ITEM]: groupId,
3958
- [GROUP_DEPTH]: depth,
3959
- [PSEUDO_GROUP_ITEM_ID]: JSON.stringify(levelIds),
3960
- [PSEUDO_GROUP_ITEM_VALUE]: mergedIds,
3961
- [GROUP_EXPANDED]: isGroupExpanded,
3962
- });
3963
- itemIndex += 1;
3964
- if (!isGroupExpanded && depth) {
3965
- trimmed[itemIndex] = true;
3966
- }
3967
- if (Array.isArray(innerGroupedValues)) {
3968
- innerGroupedValues.forEach(value => {
3969
- itemIndex += 1;
3970
- if (!isGroupExpanded) {
3971
- trimmed[itemIndex] = true;
3972
- }
3973
- oldNewIndexMap[value[GROUP_ORIGINAL_INDEX]] = itemIndex;
3974
- const pseudoGroupTestIds = levelIds.map((_value, index) => levelIds.slice(0, index + 1).join(','));
3975
- pseudoGroupTestIds.forEach(pseudoGroupTestId => {
3976
- if (!pseudoGroupTest[pseudoGroupTestId]) {
3977
- pseudoGroupTest[pseudoGroupTestId] = [];
3978
- }
3979
- pseudoGroupTest[pseudoGroupTestId].push(itemIndex);
3980
- });
3981
- });
3982
- sourceWithGroups.push(...innerGroupedValues);
3983
- }
3984
- else {
3985
- flattenGroupMaps(innerGroupedValues, levelIds, isGroupExpanded);
3986
- }
3987
- });
3988
- }
3989
- flattenGroupMaps(groupedItems, [], true);
3990
3546
  return {
3991
- sourceWithGroups, // updates source mirror
3992
- depth: groupingDepth, // largest depth for grouping
3993
- trimmed, // used for expand/collapse grouping values
3994
- oldNewIndexMap, // used for mapping old values to new
3995
- childrenByGroup: pseudoGroupTest, // used to get child items in group
3547
+ indexes: newIndexes,
3548
+ positionIndexes: [...positionIndexes],
3549
+ positionIndexToItem: Object.assign({}, positionIndexToItem),
3550
+ indexToItem,
3996
3551
  };
3997
3552
  }
3998
- function getGroupingName(rgRow) {
3999
- return rgRow && rgRow[PSEUDO_GROUP_ITEM];
4000
- }
4001
- function isGrouping(rgRow) {
4002
- return typeof (rgRow === null || rgRow === void 0 ? void 0 : rgRow[PSEUDO_GROUP_ITEM]) !== 'undefined';
4003
- }
4004
- function isGroupingColumn(column) {
4005
- return column && typeof column[PSEUDO_GROUP_COLUMN] !== 'undefined';
4006
- }
4007
- function measureEqualDepth(groupA, groupB) {
4008
- const ln = groupA.length;
4009
- let i = 0;
4010
- for (; i < ln; i++) {
4011
- if (groupA[i] !== groupB[i]) {
4012
- return i;
4013
- }
4014
- }
4015
- return i;
4016
- }
4017
- function getParsedGroup(id) {
4018
- const parseGroup = JSON.parse(id);
4019
- // extra precaution and type safeguard
4020
- if (!Array.isArray(parseGroup)) {
4021
- return null;
4022
- }
4023
- return parseGroup;
4024
- }
4025
- // check if items is child of current clicked group
4026
- function isSameGroup(currentGroup, currentModel, nextModel) {
4027
- const nextGroup = getParsedGroup(nextModel[PSEUDO_GROUP_ITEM_ID]);
4028
- if (!nextGroup) {
4029
- return false;
4030
- }
4031
- const depth = measureEqualDepth(currentGroup, nextGroup);
4032
- return currentModel[GROUP_DEPTH] < depth;
4033
- }
4034
-
4035
3553
  /**
4036
- * The base implementation of `_.slice` without an iteratee call guard.
4037
- *
4038
- * @private
4039
- * @param {Array} array The array to slice.
4040
- * @param {number} [start=0] The start position.
4041
- * @param {number} [end=array.length] The end position.
4042
- * @returns {Array} Returns the slice of `array`.
3554
+ * Calculate item by position
4043
3555
  */
4044
- function baseSlice(array, start, end) {
4045
- var index = -1,
4046
- length = array.length;
4047
-
4048
- if (start < 0) {
4049
- start = -start > length ? 0 : (length + start);
4050
- }
4051
- end = end > length ? length : end;
4052
- if (end < 0) {
4053
- end += length;
4054
- }
4055
- length = start > end ? 0 : ((end - start) >>> 0);
4056
- start >>>= 0;
4057
-
4058
- var result = Array(length);
4059
- while (++index < length) {
4060
- result[index] = array[index + start];
4061
- }
4062
- return result;
4063
- }
4064
-
4065
- /**
4066
- * Creates a slice of `array` from `start` up to, but not including, `end`.
4067
- *
4068
- * **Note:** This method is used instead of
4069
- * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
4070
- * returned.
4071
- *
4072
- * @static
4073
- * @memberOf _
4074
- * @since 3.0.0
4075
- * @category Array
4076
- * @param {Array} array The array to slice.
4077
- * @param {number} [start=0] The start position.
4078
- * @param {number} [end=array.length] The end position.
4079
- * @returns {Array} Returns the slice of `array`.
4080
- */
4081
- function slice(array, start, end) {
4082
- var length = array == null ? 0 : array.length;
4083
- if (!length) {
4084
- return [];
4085
- }
4086
- if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
4087
- start = 0;
4088
- end = length;
4089
- }
4090
- else {
4091
- start = start == null ? 0 : toInteger(start);
4092
- end = end === undefined ? length : toInteger(end);
4093
- }
4094
- return baseSlice(array, start, end);
4095
- }
4096
-
4097
- class ColumnService {
4098
- get columns() {
4099
- return getVisibleSourceItem(this.source);
4100
- }
4101
- constructor(dataStore, source) {
4102
- this.dataStore = dataStore;
4103
- this.source = source;
4104
- this.unsubscribe = [];
4105
- this.hasGrouping = false;
4106
- this.unsubscribe.push(source.onChange('source', s => this.checkGrouping(s)));
4107
- this.checkGrouping(source.get('source'));
4108
- this.type = source.get('type');
4109
- }
4110
- checkGrouping(cols) {
4111
- for (let rgCol of cols) {
4112
- if (isGroupingColumn(rgCol)) {
4113
- this.hasGrouping = true;
4114
- return;
4115
- }
4116
- this.hasGrouping = false;
4117
- }
4118
- }
4119
- isReadOnly(r, c) {
4120
- var _a;
4121
- const readOnly = (_a = this.columns[c]) === null || _a === void 0 ? void 0 : _a.readonly;
4122
- if (typeof readOnly === 'function') {
4123
- const data = this.rowDataModel(r, c);
4124
- return readOnly(data);
4125
- }
4126
- return !!readOnly;
4127
- }
4128
- mergeProperties(r, c, defaultProps, model, extraPropsFunc) {
4129
- const props = Object.assign({}, defaultProps);
4130
- props.class = Object.assign(Object.assign({}, (typeof props.class === 'string'
4131
- ? { [props.class]: true }
4132
- : props.class)), { [index.CELL_CLASS]: true, [index.DISABLED_CLASS]: this.isReadOnly(r, c) });
4133
- const extra = extraPropsFunc === null || extraPropsFunc === void 0 ? void 0 : extraPropsFunc(model);
4134
- if (!extra) {
4135
- return props;
4136
- }
4137
- return doPropMerge(props, extra);
4138
- }
4139
- getRowClass(r, prop) {
4140
- const model = getSourceItem(this.dataStore, r) || {};
4141
- return model[prop] || '';
4142
- }
4143
- getCellData(r, c) {
4144
- const data = this.rowDataModel(r, c);
4145
- return getCellData(data.model[data.prop]);
4146
- }
4147
- getSaveData(rowIndex, colIndex, val) {
4148
- const data = this.rowDataModel(rowIndex, colIndex);
4149
- if (typeof val === 'undefined') {
4150
- val = getCellData(data.model[data.prop]);
4151
- }
4152
- return {
4153
- prop: data.prop,
4154
- rowIndex,
4155
- colIndex,
4156
- val,
4157
- model: data.model,
4158
- colType: this.type,
4159
- type: this.dataStore.get('type'),
4160
- };
4161
- }
4162
- getCellEditor(_r, c, editors) {
4163
- var _a;
4164
- const editor = (_a = this.columns[c]) === null || _a === void 0 ? void 0 : _a.editor;
4165
- if (!editor) {
4166
- return undefined;
4167
- }
4168
- // reference
4169
- if (typeof editor === 'string') {
4170
- return editors[editor];
4171
- }
4172
- return editor;
4173
- }
4174
- /**
4175
- * Get cell data model for given rowIndex and colIndex
4176
- * Used to pass data to editor/renderer
4177
- */
4178
- rowDataModel(rowIndex, colIndex) {
4179
- const column = this.columns[colIndex];
4180
- const prop = column === null || column === void 0 ? void 0 : column.prop;
4181
- const model = getSourceItem(this.dataStore, rowIndex) || {};
4182
- const value = model[prop];
4183
- const type = this.dataStore.get('type');
4184
- return {
4185
- prop,
4186
- model,
4187
- data: this.dataStore.get('source'),
4188
- column,
4189
- rowIndex,
4190
- colIndex,
4191
- colType: this.type,
4192
- type,
4193
- value,
4194
- };
4195
- }
4196
- getRangeData(d, columns) {
4197
- var _a;
4198
- const changed = {};
4199
- // get original length sizes
4200
- const copyColLength = d.oldRange.x1 - d.oldRange.x + 1;
4201
- const copyRowLength = d.oldRange.y1 - d.oldRange.y + 1;
4202
- const mapping = {};
4203
- // rows
4204
- for (let rowIndex = d.newRange.y, i = 0; rowIndex < d.newRange.y1 + 1; rowIndex++, i++) {
4205
- // copy original data link
4206
- const oldRowIndex = d.oldRange.y + (i % copyRowLength);
4207
- const copyRow = getSourceItem(this.dataStore, oldRowIndex) || {};
4208
- // columns
4209
- for (let colIndex = d.newRange.x, j = 0; colIndex < d.newRange.x1 + 1; colIndex++, j++) {
4210
- // check if old range area
4211
- if (rowIndex >= d.oldRange.y &&
4212
- rowIndex <= d.oldRange.y1 &&
4213
- colIndex >= d.oldRange.x &&
4214
- colIndex <= d.oldRange.x1) {
4215
- continue;
4216
- }
4217
- // requested column beyond range
4218
- if (!this.columns[colIndex]) {
4219
- continue;
4220
- }
4221
- const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
4222
- const copyColIndex = d.oldRange.x + (j % copyColLength);
4223
- const copyColumnProp = columns[copyColIndex].prop;
4224
- /** if can write */
4225
- if (!this.isReadOnly(rowIndex, colIndex)) {
4226
- /** to show before save */
4227
- if (!changed[rowIndex]) {
4228
- changed[rowIndex] = {};
4229
- }
4230
- changed[rowIndex][prop] = copyRow[copyColumnProp];
4231
- /** Generate mapping object */
4232
- if (!mapping[rowIndex]) {
4233
- mapping[rowIndex] = {};
4234
- }
4235
- mapping[rowIndex][prop] = {
4236
- colIndex: copyColIndex,
4237
- colProp: copyColumnProp,
4238
- rowIndex: oldRowIndex,
4239
- };
4240
- }
4241
- }
4242
- }
4243
- return {
4244
- changed,
4245
- mapping,
4246
- };
4247
- }
4248
- getTransformedDataToApply(start, data) {
4249
- const changed = {};
4250
- const copyRowLength = data.length;
4251
- const colLength = this.columns.length;
4252
- const rowLength = this.dataStore.get('items').length;
4253
- // rows
4254
- let rowIndex = start.y;
4255
- let maxCol = 0;
4256
- for (let i = 0; rowIndex < rowLength && i < copyRowLength; rowIndex++, i++) {
4257
- // copy original data link
4258
- const copyRow = data[i % copyRowLength];
4259
- const copyColLength = (copyRow === null || copyRow === void 0 ? void 0 : copyRow.length) || 0;
4260
- // columns
4261
- let colIndex = start.x;
4262
- for (let j = 0; colIndex < colLength && j < copyColLength; colIndex++, j++) {
4263
- const p = this.columns[colIndex].prop;
4264
- const currentCol = j % colLength;
4265
- /** if can write */
4266
- if (!this.isReadOnly(rowIndex, colIndex)) {
4267
- /** to show before save */
4268
- if (!changed[rowIndex]) {
4269
- changed[rowIndex] = {};
4270
- }
4271
- changed[rowIndex][p] = copyRow[currentCol];
4272
- }
4273
- }
4274
- maxCol = Math.max(maxCol, colIndex - 1);
4275
- }
4276
- const range = getRange(start, {
4277
- y: rowIndex - 1,
4278
- x: maxCol,
4279
- });
4280
- return {
4281
- changed,
4282
- range,
4283
- };
4284
- }
4285
- getRangeStaticData(d, value) {
4286
- const changed = {};
4287
- // rows
4288
- for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
4289
- // columns
4290
- for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
4291
- // requested column beyond range
4292
- if (!this.columns[colIndex]) {
4293
- continue;
4294
- }
4295
- const p = this.columns[colIndex].prop;
4296
- /** if can write */
4297
- if (!this.isReadOnly(rowIndex, colIndex)) {
4298
- /** to show before save */
4299
- if (!changed[rowIndex]) {
4300
- changed[rowIndex] = {};
4301
- }
4302
- changed[rowIndex][p] = value;
4303
- }
4304
- }
4305
- }
4306
- return changed;
4307
- }
4308
- getRangeTransformedToProps(d, store) {
4309
- var _a;
4310
- const area = [];
4311
- const type = this.dataStore.get('type');
4312
- // rows
4313
- for (let rowIndex = d.y, i = 0; rowIndex < d.y1 + 1; rowIndex++, i++) {
4314
- // columns
4315
- for (let colIndex = d.x, j = 0; colIndex < d.x1 + 1; colIndex++, j++) {
4316
- const prop = (_a = this.columns[colIndex]) === null || _a === void 0 ? void 0 : _a.prop;
4317
- area.push({
4318
- prop,
4319
- rowIndex,
4320
- colIndex,
4321
- model: getSourceItem(store, rowIndex),
4322
- type,
4323
- colType: this.type,
4324
- });
4325
- }
4326
- }
4327
- return area;
4328
- }
4329
- copyRangeArray(range, store) {
4330
- const cols = [...this.columns];
4331
- const props = slice(cols, range.x, range.x1 + 1).map(v => v.prop);
4332
- const toCopy = [];
4333
- const mapping = {};
4334
- // rows indexes
4335
- for (let i = range.y; i <= range.y1; i++) {
4336
- const rgRow = [];
4337
- mapping[i] = {};
4338
- // columns indexes
4339
- for (let prop of props) {
4340
- const item = getSourceItem(store, i);
4341
- // if no item - skip
4342
- if (!item) {
4343
- continue;
4344
- }
4345
- const val = item[prop];
4346
- rgRow.push(val);
4347
- mapping[i][prop] = val;
4348
- }
4349
- toCopy.push(rgRow);
4350
- }
4351
- return {
4352
- data: toCopy,
4353
- mapping,
4354
- };
4355
- }
4356
- destroy() {
4357
- this.unsubscribe.forEach(f => f());
4358
- }
4359
- }
4360
- /**
4361
- * Checks if the given rowDrag is a service for dragging rows.
4362
- */
4363
- function isRowDragService(rowDrag, model) {
4364
- if (typeof rowDrag === 'function') {
4365
- return rowDrag(model);
4366
- }
4367
- return !!rowDrag;
4368
- }
4369
- function mergeClasses(class1 = {}, class2 = {}) {
4370
- if (typeof class1 === 'string') {
4371
- class1 = { [class1]: true };
4372
- }
4373
- if (typeof class2 === 'string') {
4374
- class2 = { [class2]: true };
4375
- }
4376
- return Object.assign(Object.assign({}, class1), class2);
4377
- }
4378
- function doPropMerge(existing, extra) {
4379
- // if className is provided - remove it from props it messing with stencil
4380
- if (extra.className) {
4381
- extra.class = mergeClasses(extra.class, extra.className);
4382
- delete extra.className;
4383
- }
4384
- let props = Object.assign(Object.assign({}, extra), existing);
4385
- // extend existing props
4386
- if (extra.class) {
4387
- props.class = mergeClasses(props.class, extra.class);
4388
- }
4389
- if (extra.style) {
4390
- props.style = Object.assign(Object.assign({}, extra.style), props.style);
4391
- }
4392
- return props;
4393
- }
4394
-
4395
- exports.ColumnService = ColumnService;
3556
+ const getItemByPosition = ({ indexes, positionIndexes, originItemSize, positionIndexToItem, }, pos) => {
3557
+ const item = {
3558
+ itemIndex: 0,
3559
+ start: 0,
3560
+ end: 0,
3561
+ };
3562
+ const currentPlace = indexes.length ? sortedIndex(positionIndexes, pos) : 0;
3563
+ // not found or first index
3564
+ if (!currentPlace) {
3565
+ item.itemIndex = Math.floor(pos / originItemSize);
3566
+ item.start = item.itemIndex * originItemSize;
3567
+ item.end = item.start + originItemSize;
3568
+ return item;
3569
+ }
3570
+ const positionItem = positionIndexToItem[currentPlace - 1];
3571
+ // if item has specified size
3572
+ if (positionItem.end > pos) {
3573
+ return positionItem;
3574
+ }
3575
+ // special size item was present before
3576
+ const relativePos = pos - positionItem.end;
3577
+ const relativeIndex = Math.floor(relativePos / originItemSize);
3578
+ item.itemIndex = positionItem.itemIndex + 1 + relativeIndex;
3579
+ item.start = positionItem.end + relativeIndex * originItemSize;
3580
+ item.end = item.start + originItemSize;
3581
+ return item;
3582
+ };
3583
+ function getItemByIndex(dimension, index) {
3584
+ let item = {
3585
+ itemIndex: index,
3586
+ start: 0,
3587
+ end: 0,
3588
+ };
3589
+ // if item has specified size
3590
+ if (dimension.indexToItem[index]) {
3591
+ return dimension.indexToItem[index];
3592
+ }
3593
+ const currentPlace = dimension.indexes.length
3594
+ ? sortedIndex(dimension.indexes, index)
3595
+ : 0;
3596
+ // not found or first index
3597
+ if (!currentPlace) {
3598
+ item.start = item.itemIndex * dimension.originItemSize;
3599
+ item.end = item.start + dimension.originItemSize;
3600
+ return item;
3601
+ }
3602
+ // special size item was present before
3603
+ const positionItem = dimension.indexToItem[dimension.indexes[currentPlace - 1]];
3604
+ item.start =
3605
+ positionItem.end +
3606
+ (index - positionItem.itemIndex - 1) * dimension.originItemSize;
3607
+ item.end = item.start + dimension.originItemSize;
3608
+ return item;
3609
+ }
3610
+
3611
+ exports.CELL_CLASS = CELL_CLASS;
3612
+ exports.CELL_HANDLER_CLASS = CELL_HANDLER_CLASS;
3613
+ exports.DATA_COL = DATA_COL;
3614
+ exports.DATA_ROW = DATA_ROW;
3615
+ exports.DISABLED_CLASS = DISABLED_CLASS;
3616
+ exports.DRAGGABLE_CLASS = DRAGGABLE_CLASS;
3617
+ exports.DRAGG_TEXT = DRAGG_TEXT;
3618
+ exports.DRAG_ICON_CLASS = DRAG_ICON_CLASS;
4396
3619
  exports.DataStore = DataStore;
4397
- exports.EMPTY_INDEX = EMPTY_INDEX;
4398
- exports.GROUPING_ROW_TYPE = GROUPING_ROW_TYPE;
4399
- exports.GROUP_DEPTH = GROUP_DEPTH;
4400
- exports.GROUP_EXPANDED = GROUP_EXPANDED;
4401
- exports.GROUP_EXPAND_BTN = GROUP_EXPAND_BTN;
4402
- exports.GROUP_EXPAND_EVENT = GROUP_EXPAND_EVENT;
4403
- exports.PSEUDO_GROUP_COLUMN = PSEUDO_GROUP_COLUMN;
4404
- exports.PSEUDO_GROUP_ITEM = PSEUDO_GROUP_ITEM;
4405
- exports.PSEUDO_GROUP_ITEM_ID = PSEUDO_GROUP_ITEM_ID;
4406
- exports.PSEUDO_GROUP_ITEM_VALUE = PSEUDO_GROUP_ITEM_VALUE;
4407
- exports.SelectionStore = SelectionStore;
4408
- exports.SelectionStoreConnector = SelectionStoreConnector;
4409
- exports.baseEach = baseEach$1;
3620
+ exports.EDIT_INPUT_WR = EDIT_INPUT_WR;
3621
+ exports.FOCUS_CLASS = FOCUS_CLASS;
3622
+ exports.GRID_INTERNALS = GRID_INTERNALS;
3623
+ exports.HEADER_ACTUAL_ROW_CLASS = HEADER_ACTUAL_ROW_CLASS;
3624
+ exports.HEADER_CLASS = HEADER_CLASS;
3625
+ exports.HEADER_ROW_CLASS = HEADER_ROW_CLASS;
3626
+ exports.HEADER_SORTABLE_CLASS = HEADER_SORTABLE_CLASS;
3627
+ exports.KeyCodesEnum = KeyCodesEnum;
3628
+ exports.MIN_COL_SIZE = MIN_COL_SIZE;
3629
+ exports.MOBILE_CLASS = MOBILE_CLASS;
3630
+ exports.OsPlatform = OsPlatform;
3631
+ exports.RESIZE_INTERVAL = RESIZE_INTERVAL;
3632
+ exports.ROW_FOCUSED_CLASS = ROW_FOCUSED_CLASS;
3633
+ exports.ROW_HEADER_TYPE = ROW_HEADER_TYPE;
3634
+ exports.SELECTION_BORDER_CLASS = SELECTION_BORDER_CLASS;
3635
+ exports.TMP_SELECTION_BG_CLASS = TMP_SELECTION_BG_CLASS;
3636
+ exports.applyMixins = applyMixins;
4410
3637
  exports.baseIteratee = baseIteratee;
4411
3638
  exports.baseKeys = baseKeys;
4412
3639
  exports.baseProperty = baseProperty;
3640
+ exports.calculateDimensionData = calculateDimensionData;
4413
3641
  exports.createStore = createStore;
4414
- exports.cropCellToMax = cropCellToMax;
4415
- exports.doPropMerge = doPropMerge;
4416
3642
  exports.findIndex = findIndex;
4417
- exports.gatherGroup = gatherGroup;
4418
- exports.gatherGrouping = gatherGrouping;
3643
+ exports.findPositionInArray = findPositionInArray;
4419
3644
  exports.gatherTrimmedItems = gatherTrimmedItems;
4420
- exports.getCellData = getCellData;
4421
- exports.getCellDataParsed = getCellDataParsed;
4422
- exports.getColumnByProp = getColumnByProp;
4423
- exports.getColumnSizes = getColumnSizes;
4424
- exports.getColumnType = getColumnType;
4425
- exports.getColumns = getColumns;
4426
- exports.getGroupingName = getGroupingName;
3645
+ exports.getItemByIndex = getItemByIndex;
3646
+ exports.getItemByPosition = getItemByPosition;
4427
3647
  exports.getNative = getNative;
4428
- exports.getParsedGroup = getParsedGroup;
4429
3648
  exports.getPhysical = getPhysical;
4430
- exports.getRange = getRange;
3649
+ exports.getScrollbarSize = getScrollbarSize;
4431
3650
  exports.getSourceItem = getSourceItem;
4432
3651
  exports.getSourceItemVirtualIndexByProp = getSourceItemVirtualIndexByProp;
4433
3652
  exports.getSourcePhysicalIndex = getSourcePhysicalIndex;
4434
3653
  exports.getTag = getTag$1;
4435
3654
  exports.getVisibleSourceItem = getVisibleSourceItem;
3655
+ exports.identity = identity;
4436
3656
  exports.isArray = isArray$1;
4437
3657
  exports.isArrayLike = isArrayLike;
4438
- exports.isColGrouping = isColGrouping;
4439
- exports.isGrouping = isGrouping;
4440
- exports.isGroupingColumn = isGroupingColumn;
4441
- exports.isHiddenStore = isHiddenStore;
4442
3658
  exports.isIterateeCall = isIterateeCall;
4443
- exports.isRangeSingleCell = isRangeSingleCell;
4444
- exports.isRowDragService = isRowDragService;
4445
- exports.isSameGroup = isSameGroup;
4446
- exports.nextCell = nextCell;
3659
+ exports.keys = keys;
3660
+ exports.mergeSortedArray = mergeSortedArray;
4447
3661
  exports.proxyPlugin = proxyPlugin;
4448
- exports.reduce = reduce;
3662
+ exports.pushSorted = pushSorted;
3663
+ exports.range = range;
3664
+ exports.scaleValue = scaleValue;
4449
3665
  exports.setItems = setItems;
4450
3666
  exports.setSourceByPhysicalIndex = setSourceByPhysicalIndex;
4451
3667
  exports.setSourceByVirtualIndex = setSourceByVirtualIndex;
4452
3668
  exports.setStore = setStore;
3669
+ exports.timeout = timeout;
4453
3670
  exports.toInteger = toInteger;
4454
3671
  exports.trimmedPlugin = trimmedPlugin;
4455
3672
 
4456
- //# sourceMappingURL=column.service-26c61ed6.js.map
3673
+ //# sourceMappingURL=dimension.helpers-1927ad24.js.map