@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
@@ -46,7 +46,7 @@ class AutohideScrollPlugin {
46
46
  }
47
47
  }
48
48
 
49
- const revogrScrollStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:30px;background:none;color:#000;box-shadow:none}revogr-scroll-virtual[autohide]{position:absolute;z-index:100 !important}revogr-scroll-virtual[autohide].vertical{top:0;right:0}revogr-scroll-virtual[autohide].vertical:hover,revogr-scroll-virtual[autohide].vertical[visible]{min-width:20px !important}revogr-scroll-virtual[autohide].horizontal{bottom:0;left:0}revogr-scroll-virtual[autohide].horizontal:hover,revogr-scroll-virtual[autohide].horizontal[visible]{min-height:20px !important}revogr-scroll-virtual.vertical{overflow-y:auto;overflow-x:hidden;height:100%}revogr-scroll-virtual.vertical>div{width:1px}revogr-scroll-virtual.horizontal{overflow-x:auto;overflow-y:hidden;width:100%}revogr-scroll-virtual.horizontal>div{height:1px}";
49
+ const revogrScrollStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}revogr-scroll-virtual[autohide]{position:absolute;z-index:100 !important}revogr-scroll-virtual[autohide].vertical{top:0;right:0}revogr-scroll-virtual[autohide].vertical[visible]{min-width:20px !important}revogr-scroll-virtual[autohide].horizontal{bottom:0;left:0}revogr-scroll-virtual[autohide].horizontal[visible]{min-height:20px !important}revogr-scroll-virtual.vertical{overflow-y:auto;overflow-x:hidden;height:100%}revogr-scroll-virtual.vertical>div{width:1px}revogr-scroll-virtual.horizontal{overflow-x:auto;overflow-y:hidden;width:100%}revogr-scroll-virtual.horizontal>div{height:1px}";
50
50
  const RevogrScrollVirtualStyle0 = revogrScrollStyleCss;
51
51
 
52
52
  const RevogrScrollVirtual = /*@__PURE__*/ proxyCustomElement(class RevogrScrollVirtual extends HTMLElement {
@@ -135,7 +135,7 @@ const RevogrScrollVirtual = /*@__PURE__*/ proxyCustomElement(class RevogrScrollV
135
135
  this.localScrollService.setParams({
136
136
  contentSize: this.dimensionStore.get('realSize'),
137
137
  clientSize: this.size,
138
- virtualSize: this.viewportStore.get('virtualSize'),
138
+ virtualSize: this.viewportStore.get('clientSize'),
139
139
  }, this.dimension);
140
140
  }
141
141
  onScroll(e) {
@@ -155,8 +155,10 @@ const RevogrScrollVirtual = /*@__PURE__*/ proxyCustomElement(class RevogrScrollV
155
155
  }
156
156
  render() {
157
157
  const sizeType = this.dimension === 'rgRow' ? 'height' : 'width';
158
- return (h(Host, { key: '73aa9ba5bd17eea4d37eaecd63326fca29e4e231', onScroll: (e) => this.onScroll(e) }, h("div", { key: 'c57e42d782f693dc2a93e98f157ef60ebe09398c', style: {
159
- [sizeType]: `${getContentSize(this.dimensionStore.get('realSize'), this.size, this.viewportStore.get('virtualSize'))}px`,
158
+ const size = getContentSize(this.dimensionStore.get('realSize'), this.size, this.viewportStore.get('clientSize') // content viewport size
159
+ );
160
+ return (h(Host, { key: '2d11902403db45b805bde88b6fc40acff4b6b910', onScroll: (e) => this.onScroll(e) }, h("div", { key: '74978e90cbf66e3fb6dcc25bd5882346f1515c39', style: {
161
+ [sizeType]: `${size}px`,
160
162
  } })));
161
163
  }
162
164
  get element() { return this; }
@@ -1 +1 @@
1
- {"file":"revogr-scroll-virtual2.js","mappings":";;;;;;;AAEA;;;MAGa,oBAAoB;IAE/B,YAAoB,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;QADhC,0BAAqB,GAAG,CAAC,CAAC;KAEjC;;;;IAKD,aAAa,CAAC,CAAS;QACrB,IAAI,CAAC,CAAC,EAAE;YACN,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;SAC1C;KACF;;;;IAKD,WAAW,CAAC,EACV,UAAU,EACV,WAAW,EACX,WAAW,GAKZ;QACC,MAAM,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;QAC5C,MAAM,QAAQ,GAAG,CAAC,UAAU,IAAI,SAAS,CAAC;QAC1C,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YAC7C,IAAI,CAAC,qBAAqB,GAAG,IAAI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AAE;YACpE,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;SACpE;KACF;IAED,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;QACjE,QACE,EAAC,IAAI,qDAAC,QAAQ,EAAE,CAAC,CAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IACjD,4DACE,KAAK,EAAE;gBACL,CAAC,QAAQ,GAAG,GACV,cAAc,CACZ,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EACnC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CACtC,IAAI;aACR,GACD,CACG,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scrollable/autohide-scroll.plugin.ts","src/components/scrollable/revogr-scroll-style.scss?tag=revogr-scroll-virtual","src/components/scrollable/revogr-scroll-virtual.tsx"],"sourcesContent":["\n\n/**\n * Autohide scroll for MacOS when scroll is visible only for 1 sec\n */\nexport class AutohideScrollPlugin {\n private autohideScrollTimeout = 0;\n constructor(private element: HTMLElement) {\n }\n\n /**\n * When scroll size updates set it up for autohide\n */\n setScrollSize(s: number) {\n if (!s) {\n this.element.setAttribute('autohide', 'true');\n } else {\n this.element.removeAttribute('autohide');\n }\n }\n\n /**\n * On each scroll check if it's time to show\n */\n checkScroll({\n scrollSize,\n contentSize,\n virtualSize,\n }: {\n scrollSize: number;\n contentSize: number;\n virtualSize: number;\n }) {\n const hasScroll = contentSize > virtualSize;\n const isHidden = !scrollSize && hasScroll;\n if (isHidden) {\n this.element.setAttribute('visible', 'true');\n this.autohideScrollTimeout = this.show(\n this.element,\n this.autohideScrollTimeout,\n );\n }\n }\n\n private show(element?: HTMLElement, timeout?: number): number {\n clearTimeout(timeout);\n return Number(\n setTimeout(() => {\n element?.removeAttribute('visible');\n }, 1000),\n );\n }\n clear() {\n clearTimeout(this.autohideScrollTimeout);\n }\n}\n","revogr-scroll-virtual {\n $min-size: 20px;\n\n // show scroll only for 1 sec\n &[autohide] {\n position: absolute;\n z-index: 100 !important;\n\n &.vertical {\n top: 0;\n right: 0;\n\n &:hover, &[visible] {\n min-width: $min-size !important;\n }\n }\n\n &.horizontal {\n bottom: 0;\n left: 0;\n\n &:hover, &[visible] {\n min-height: $min-size !important;\n }\n }\n }\n\n &.vertical {\n overflow-y: auto;\n overflow-x: hidden;\n height: 100%;\n\n > div {\n width: 1px;\n }\n }\n\n &.horizontal {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n\n > div {\n height: 1px;\n }\n }\n}\n","import {\n Component,\n Element as StencilElement,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport LocalScrollService, { getContentSize } from '../../services/local.scroll.service';\nimport { getScrollbarSize } from '../../utils';\nimport { DimensionType } from '@type';\nimport {\n ViewportState,\n DimensionSettingsState,\n ViewPortScrollEvent,\n} from '@type';\nimport { AutohideScrollPlugin } from './autohide-scroll.plugin';\nimport { LocalScrollTimer } from '../../services/local.scroll.timer';\nimport { Observable } from '../../utils/store.utils';\n\n/**\n * Virtual scroll component\n */\n@Component({\n tag: 'revogr-scroll-virtual',\n styleUrl: 'revogr-scroll-style.scss',\n})\nexport class RevogrScrollVirtual {\n /**\n * Scroll dimension (`X` - `rgCol` or `Y` - `rgRow`)\n */\n @Prop() dimension: DimensionType = 'rgRow';\n\n /**\n * Viewport\n */\n @Prop() viewportStore!: Observable<ViewportState>;\n /**\n * Dimensions\n */\n @Prop() dimensionStore!: Observable<DimensionSettingsState>;\n\n /**\n * Scroll event\n */\n @Event({ eventName: 'scrollvirtual' })\n scrollVirtual: EventEmitter<ViewPortScrollEvent>;\n\n @StencilElement() element: HTMLElement;\n private autohideScrollPlugin: AutohideScrollPlugin;\n private scrollSize = 0;\n private localScrollService: LocalScrollService;\n private localScrollTimer: LocalScrollTimer;\n\n @Method()\n async setScroll(e: ViewPortScrollEvent): Promise<void> {\n if (this.dimension !== e.dimension) {\n return;\n }\n this.localScrollTimer.latestScrollUpdate(e.dimension);\n this.localScrollService?.setScroll(e);\n if (e.coordinate) {\n this.autohideScrollPlugin.checkScroll({\n scrollSize: this.scrollSize,\n contentSize: this.dimensionStore.get('realSize'),\n virtualSize: this.viewportStore.get('virtualSize'),\n });\n }\n }\n\n /**\n * Update if `delta` exists in case we don't know current position or if it's external change\n */\n @Method()\n async changeScroll(e: ViewPortScrollEvent): Promise<ViewPortScrollEvent> {\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.element.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = this.element.scrollTop + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n set size(s: number) {\n this.autohideScrollPlugin.setScrollSize(s);\n if (this.dimension === 'rgRow') {\n this.element.style.minWidth = `${s}px`;\n return;\n }\n this.element.style.minHeight = `${s}px`;\n }\n\n get size(): number {\n if (this.dimension === 'rgRow') {\n return this.element.clientHeight;\n }\n return this.element.clientWidth;\n }\n\n connectedCallback() {\n this.autohideScrollPlugin = new AutohideScrollPlugin(this.element);\n this.localScrollTimer = new LocalScrollTimer('ontouchstart' in document.documentElement ? 0 : 10);\n this.localScrollService = new LocalScrollService({\n runScroll: e => this.scrollVirtual.emit(e),\n applyScroll: e => {\n this.localScrollTimer.setCoordinate(e);\n const type = e.dimension === 'rgRow' ? 'scrollTop' : 'scrollLeft';\n // this will trigger on scroll event\n this.element[type] = e.coordinate;\n },\n });\n }\n\n disconnectedCallback() {\n this.autohideScrollPlugin.clear();\n }\n\n componentWillLoad() {\n this.scrollSize = getScrollbarSize(document);\n }\n\n componentDidRender() {\n const type = this.dimension === 'rgRow' ? 'scrollHeight' : 'scrollWidth';\n if (this.element[type] > this.size) {\n this.size = this.scrollSize;\n } else {\n this.size = 0;\n }\n this.localScrollService.setParams(\n {\n contentSize: this.dimensionStore.get('realSize'),\n clientSize: this.size,\n virtualSize: this.viewportStore.get('virtualSize'),\n },\n this.dimension,\n );\n }\n\n onScroll(e: MouseEvent) {\n if (!(e.target instanceof Element)) {\n return;\n }\n const target = e.target;\n let type: 'scrollLeft' | 'scrollTop' = 'scrollLeft';\n if (this.dimension === 'rgRow') {\n type = 'scrollTop';\n }\n // apply after throttling\n if (this.localScrollTimer.isReady(this.dimension, target[type] || 0)) {\n this.localScrollService?.scroll(target[type] || 0, this.dimension);\n }\n }\n\n render() {\n const sizeType = this.dimension === 'rgRow' ? 'height' : 'width';\n return (\n <Host onScroll={(e: MouseEvent) => this.onScroll(e)}>\n <div\n style={{\n [sizeType]: `${\n getContentSize(\n this.dimensionStore.get('realSize'),\n this.size,\n this.viewportStore.get('virtualSize')\n )}px`,\n }}\n />\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"revogr-scroll-virtual2.js","mappings":";;;;;;;AAEA;;;MAGa,oBAAoB;IAE/B,YAAoB,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;QADhC,0BAAqB,GAAG,CAAC,CAAC;KAEjC;;;;IAKD,aAAa,CAAC,CAAS;QACrB,IAAI,CAAC,CAAC,EAAE;YACN,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;SAC/C;aAAM;YACL,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;SAC1C;KACF;;;;IAKD,WAAW,CAAC,EACV,UAAU,EACV,WAAW,EACX,WAAW,GAKZ;QACC,MAAM,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;QAC5C,MAAM,QAAQ,GAAG,CAAC,UAAU,IAAI,SAAS,CAAC;QAC1C,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CA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AAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE;YACpE,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;SACpE;KACF;IAED,MAAM;QACJ,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;QACjE,MAAM,IAAI,GAAG,cAAc,CACzB,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EACnC,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC;SACrC,CAAC;QACF,QACE,EAAC,IAAI,qDAAC,QAAQ,EAAE,CAAC,CAAa,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IACjD,4DACE,KAAK,EAAE;gBACL,CAAC,QAAQ,GAAG,GAAG,IAAI,IAAI;aACxB,GACD,CACG,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/scrollable/autohide-scroll.plugin.ts","src/components/scrollable/revogr-scroll-style.scss?tag=revogr-scroll-virtual","src/components/scrollable/revogr-scroll-virtual.tsx"],"sourcesContent":["\n\n/**\n * Autohide scroll for MacOS when scroll is visible only for 1 sec\n */\nexport class AutohideScrollPlugin {\n private autohideScrollTimeout = 0;\n constructor(private element: HTMLElement) {\n }\n\n /**\n * When scroll size updates set it up for autohide\n */\n setScrollSize(s: number) {\n if (!s) {\n this.element.setAttribute('autohide', 'true');\n } else {\n this.element.removeAttribute('autohide');\n }\n }\n\n /**\n * On each scroll check if it's time to show\n */\n checkScroll({\n scrollSize,\n contentSize,\n virtualSize,\n }: {\n scrollSize: number;\n contentSize: number;\n virtualSize: number;\n }) {\n const hasScroll = contentSize > virtualSize;\n const isHidden = !scrollSize && hasScroll;\n if (isHidden) {\n this.element.setAttribute('visible', 'true');\n this.autohideScrollTimeout = this.show(\n this.element,\n this.autohideScrollTimeout,\n );\n }\n }\n\n private show(element?: HTMLElement, timeout?: number): number {\n clearTimeout(timeout);\n return Number(\n setTimeout(() => {\n element?.removeAttribute('visible');\n }, 1000),\n );\n }\n clear() {\n clearTimeout(this.autohideScrollTimeout);\n }\n}\n","revogr-scroll-virtual {\n $min-size: 20px;\n\n // show scroll only for 1 sec\n &[autohide] {\n position: absolute;\n z-index: 100 !important;\n\n &.vertical {\n top: 0;\n right: 0;\n\n &[visible] {\n min-width: $min-size !important;\n }\n }\n\n &.horizontal {\n bottom: 0;\n left: 0;\n\n &[visible] {\n min-height: $min-size !important;\n }\n }\n }\n\n &.vertical {\n overflow-y: auto;\n overflow-x: hidden;\n height: 100%;\n\n > div {\n width: 1px;\n }\n }\n\n &.horizontal {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n\n > div {\n height: 1px;\n }\n }\n}\n","import {\n Component,\n Element as StencilElement,\n Event,\n EventEmitter,\n h,\n Host,\n Method,\n Prop,\n} from '@stencil/core';\nimport LocalScrollService, { getContentSize } from '../../services/local.scroll.service';\nimport type {\n DimensionType,\n ViewportState,\n DimensionSettingsState,\n ViewPortScrollEvent,\n} from '@type';\nimport { AutohideScrollPlugin } from './autohide-scroll.plugin';\nimport { LocalScrollTimer } from '../../services/local.scroll.timer';\nimport { type Observable, getScrollbarSize } from '../../utils';\n\n/**\n * Virtual scroll component\n */\n@Component({\n tag: 'revogr-scroll-virtual',\n styleUrl: 'revogr-scroll-style.scss',\n})\nexport class RevogrScrollVirtual {\n /**\n * Scroll dimension (`X` - `rgCol` or `Y` - `rgRow`)\n */\n @Prop() dimension: DimensionType = 'rgRow';\n\n /**\n * Viewport\n */\n @Prop() viewportStore!: Observable<ViewportState>;\n /**\n * Dimensions\n */\n @Prop() dimensionStore!: Observable<DimensionSettingsState>;\n\n /**\n * Scroll event\n */\n @Event({ eventName: 'scrollvirtual' })\n scrollVirtual: EventEmitter<ViewPortScrollEvent>;\n\n @StencilElement() element: HTMLElement;\n private autohideScrollPlugin: AutohideScrollPlugin;\n private scrollSize = 0;\n private localScrollService: LocalScrollService;\n private localScrollTimer: LocalScrollTimer;\n\n @Method()\n async setScroll(e: ViewPortScrollEvent): Promise<void> {\n if (this.dimension !== e.dimension) {\n return;\n }\n this.localScrollTimer.latestScrollUpdate(e.dimension);\n this.localScrollService?.setScroll(e);\n if (e.coordinate) {\n this.autohideScrollPlugin.checkScroll({\n scrollSize: this.scrollSize,\n contentSize: this.dimensionStore.get('realSize'),\n virtualSize: this.viewportStore.get('virtualSize'),\n });\n }\n }\n\n /**\n * Update if `delta` exists in case we don't know current position or if it's external change\n */\n @Method()\n async changeScroll(e: ViewPortScrollEvent): Promise<ViewPortScrollEvent> {\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.element.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = this.element.scrollTop + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n set size(s: number) {\n this.autohideScrollPlugin.setScrollSize(s);\n if (this.dimension === 'rgRow') {\n this.element.style.minWidth = `${s}px`;\n return;\n }\n this.element.style.minHeight = `${s}px`;\n }\n\n get size(): number {\n if (this.dimension === 'rgRow') {\n return this.element.clientHeight;\n }\n return this.element.clientWidth;\n }\n\n connectedCallback() {\n this.autohideScrollPlugin = new AutohideScrollPlugin(this.element);\n this.localScrollTimer = new LocalScrollTimer('ontouchstart' in document.documentElement ? 0 : 10);\n this.localScrollService = new LocalScrollService({\n runScroll: e => this.scrollVirtual.emit(e),\n applyScroll: e => {\n this.localScrollTimer.setCoordinate(e);\n const type = e.dimension === 'rgRow' ? 'scrollTop' : 'scrollLeft';\n // this will trigger on scroll event\n this.element[type] = e.coordinate;\n },\n });\n }\n\n disconnectedCallback() {\n this.autohideScrollPlugin.clear();\n }\n\n componentWillLoad() {\n this.scrollSize = getScrollbarSize(document);\n }\n\n componentDidRender() {\n const type = this.dimension === 'rgRow' ? 'scrollHeight' : 'scrollWidth';\n if (this.element[type] > this.size) {\n this.size = this.scrollSize;\n } else {\n this.size = 0;\n }\n this.localScrollService.setParams(\n {\n contentSize: this.dimensionStore.get('realSize'),\n clientSize: this.size,\n virtualSize: this.viewportStore.get('clientSize'),\n },\n this.dimension,\n );\n }\n\n onScroll(e: MouseEvent) {\n if (!(e.target instanceof Element)) {\n return;\n }\n const target = e.target;\n let type: 'scrollLeft' | 'scrollTop' = 'scrollLeft';\n if (this.dimension === 'rgRow') {\n type = 'scrollTop';\n }\n // apply after throttling\n if (this.localScrollTimer.isReady(this.dimension, target[type] || 0)) {\n this.localScrollService?.scroll(target[type] || 0, this.dimension);\n }\n }\n\n render() {\n const sizeType = this.dimension === 'rgRow' ? 'height' : 'width';\n const size = getContentSize(\n this.dimensionStore.get('realSize'),\n this.size,\n this.viewportStore.get('clientSize') // content viewport size\n );\n return (\n <Host onScroll={(e: MouseEvent) => this.onScroll(e)}>\n <div\n style={{\n [sizeType]: `${size}px`,\n }}\n />\n </Host>\n );\n }\n}\n"],"version":3}
@@ -6,7 +6,7 @@ import { t as throttle } from './throttle.js';
6
6
  import { T as TMP_SELECTION_BG_CLASS } from './consts.js';
7
7
  import { a as getCell, s as styleByCellProps } from './selection.utils.js';
8
8
 
9
- const revogrTempRangeStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:30px;background:none;color:#000;box-shadow:none}.temp-bg-range{display:block !important;position:absolute;pointer-events:none;z-index:9;border:1px solid rgb(255, 94, 0);box-sizing:border-box}.temp-bg-range.Selection{border:1px dashed gray}.temp-bg-range>div{width:1px;height:1px;position:absolute}.temp-bg-range>div.top{top:-1px}.temp-bg-range>div.bottom{bottom:-1px}.temp-bg-range>div.left{left:-1px}.temp-bg-range>div.right{right:-1px}";
9
+ const revogrTempRangeStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}.temp-bg-range{display:block !important;position:absolute;pointer-events:none;z-index:9;border:1px solid rgb(255, 94, 0);box-sizing:border-box}.temp-bg-range.Selection{border:1px dashed gray}.temp-bg-range>div{width:1px;height:1px;position:absolute}.temp-bg-range>div.top{top:-1px}.temp-bg-range>div.bottom{bottom:-1px}.temp-bg-range>div.left{left:-1px}.temp-bg-range>div.right{right:-1px}";
10
10
  const RevogrTempRangeStyle0 = revogrTempRangeStyleCss;
11
11
 
12
12
  const RevogrFocus = /*@__PURE__*/ proxyCustomElement(class RevogrFocus extends HTMLElement {
@@ -1 +1 @@
1
- {"file":"revogr-temp-range2.js","mappings":";;;;;;;;AAAA,MAAM,uBAAuB,GAAG,yzMAAyzM,CAAC;AAC11M,8BAAe,uBAAuB;;MCczB,WAAW;;;;QAoBL,aAAQ,GAAG,QAAQ,CAAC,CAAC,CAAc,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;;;;;IAExE,QAAQ,CAAC,CAAc;QAC7B,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,CAAC;YAChB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;KACJ;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,EAAE,EAAE;YACX,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACxB;KACF;IAED,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR;QACD,IAAI,UAAU,GAAG,QAAQ,CAAC;QAC1B,IAAI,UAAU,GAAG,OAAO,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE;YACpB,UAAU,GAAG,KAAK,CAAC;SACpB;QACD,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE;YACpB,UAAU,GAAG,MAAM,CAAC;SACrB;QACD,MAAM,cAAc,GAAG,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EACvB,IAAI,CAAC,YAAY,CAAC,KAAK,EACvB,IAAI,CAAC,YAAY,CAAC,KAAK,CACxB,CAAC;QACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG;YACZ,KAAK,EAAE;gBACL,CAAC,sBAAsB,GAAG,IAAI;gBAC9B,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI;aACnB;YACD,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,KAAK;SACd,CAAC;QACF,QACE,EAAC,IAAI,oBAAK,KAAK,GACb,WAAK,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAI,CACpD,EACP;KACH;IAEO,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,KAAK,EAAE;YACT,OAAO,KAAK,CAAC;SACd;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QACD,uCACK,KAAK,KACR,EAAE,EAAE,KAAK,CAAC,CAAC,EACX,EAAE,EAAE,KAAK,CAAC,CAAC,IACX;KACH;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/selectionTempRange/revogr-temp-range-style.scss?tag=revogr-temp-range","src/components/selectionTempRange/revogr-temp-range.tsx"],"sourcesContent":[".temp-bg-range {\n display: block !important;\n position: absolute;\n pointer-events: none;\n z-index: 9;\n border: 1px solid rgb(255, 94, 0);\n box-sizing: border-box;\n\n &.Selection {\n border: 1px dashed gray;\n }\n\n > div {\n width: 1px;\n height: 1px;\n position: absolute;\n\n &.top {\n top: -1px;\n }\n\n &.bottom {\n bottom: -1px;\n }\n\n &.left {\n left: -1px;\n }\n\n &.right {\n right: -1px;\n }\n }\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport throttle from 'lodash/throttle';\nimport { TMP_SELECTION_BG_CLASS } from '../../utils/consts';\nimport { getCell, styleByCellProps } from '../overlay/selection.utils';\nimport { DimensionSettingsState } from '@type';\nimport { SelectionStoreState, RangeArea } from '@type';\nimport { Observable } from '../../utils/store.utils';\n\n/**\n * Temporary range selection component. Shows temporary range selection.\n */\n@Component({\n tag: 'revogr-temp-range',\n styleUrl: 'revogr-temp-range-style.scss',\n})\nexport class RevogrFocus {\n /**\n * Dynamic stores\n */\n\n /**\n * Selection store, shows current selection and focus\n */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n\n /**\n * Dimension row store\n */\n @Prop() dimensionRow: Observable<DimensionSettingsState>;\n /**\n * Dimension column store\n */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n\n el?: HTMLElement;\n private readonly onChange = throttle((e: HTMLElement) => this.doChange(e), 300);\n\n private doChange(e: HTMLElement) {\n e?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n }\n\n componentDidRender() {\n if (this.el) {\n this.onChange(this.el);\n }\n }\n\n render() {\n const data = this.selectionStore.get('tempRange');\n const type = this.selectionStore.get('tempRangeType');\n if (!data) {\n return;\n }\n let directionY = 'bottom';\n let derectionX = 'right';\n const range = this.getRange();\n if (!range) {\n return;\n }\n if (data.y < range.y) {\n directionY = 'top';\n }\n if (data.x < range.x) {\n derectionX = 'left';\n }\n const directionClass = `${derectionX} ${directionY}`;\n const cell = getCell(data,\n this.dimensionRow.state,\n this.dimensionCol.state\n );\n const styles = styleByCellProps(cell);\n const props = {\n class: {\n [TMP_SELECTION_BG_CLASS]: true,\n [type || '']: true,\n },\n style: styles,\n hidden: false\n };\n return (\n <Host {...props}>\n <div class={directionClass} ref={(e) => (this.el = e)} />\n </Host>\n );\n }\n\n private getRange(): RangeArea | null {\n const range = this.selectionStore.get('range');\n if (range) {\n return range;\n }\n const focus = this.selectionStore.get('focus');\n if (!focus) {\n return null;\n }\n return {\n ...focus,\n x1: focus.x,\n y1: focus.y,\n };\n }\n}\n"],"version":3}
1
+ {"file":"revogr-temp-range2.js","mappings":";;;;;;;;AAAA,MAAM,uBAAuB,GAAG,41MAA41M,CAAC;AAC73M,8BAAe,uBAAuB;;MCazB,WAAW;;;;QAoBL,aAAQ,GAAG,QAAQ,CAAC,CAAC,CAAc,KAAK,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;;;;;IAExE,QAAQ,CAAC,CAAc;QAC7B,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,cAAc,CAAC;YAChB,KAAK,EAAE,SAAS;YAChB,MAAM,EAAE,SAAS;SAClB,CAAC,CAAC;KACJ;IAED,kBAAkB;QAChB,IAAI,IAAI,CAAC,EAAE,EAAE;YACX,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;SACxB;KACF;IAED,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,EAAE;YACT,OAAO;SACR;QACD,IAAI,UAAU,GAAG,QAAQ,CAAC;QAC1B,IAAI,UAAU,GAAG,OAAO,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,EAAE;YACV,OAAO;SACR;QACD,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE;YACpB,UAAU,GAAG,KAAK,CAAC;SACpB;QACD,IAAI,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE;YACpB,UAAU,GAAG,MAAM,CAAC;SACrB;QACD,MAAM,cAAc,GAAG,GAAG,UAAU,IAAI,UAAU,EAAE,CAAC;QACrD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EACvB,IAAI,CAAC,YAAY,CAAC,KAAK,EACvB,IAAI,CAAC,YAAY,CAAC,KAAK,CACxB,CAAC;QACF,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG;YACZ,KAAK,EAAE;gBACL,CAAC,sBAAsB,GAAG,IAAI;gBAC9B,CAAC,IAAI,IAAI,EAAE,GAAG,IAAI;aACnB;YACD,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,KAAK;SACd,CAAC;QACF,QACE,EAAC,IAAI,oBAAK,KAAK,GACb,WAAK,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAI,CACpD,EACP;KACH;IAEO,QAAQ;QACd,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,KAAK,EAAE;YACT,OAAO,KAAK,CAAC;SACd;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,IAAI,CAAC;SACb;QACD,uCACK,KAAK,KACR,EAAE,EAAE,KAAK,CAAC,CAAC,EACX,EAAE,EAAE,KAAK,CAAC,CAAC,IACX;KACH;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/selectionTempRange/revogr-temp-range-style.scss?tag=revogr-temp-range","src/components/selectionTempRange/revogr-temp-range.tsx"],"sourcesContent":[".temp-bg-range {\n display: block !important;\n position: absolute;\n pointer-events: none;\n z-index: 9;\n border: 1px solid rgb(255, 94, 0);\n box-sizing: border-box;\n\n &.Selection {\n border: 1px dashed gray;\n }\n\n > div {\n width: 1px;\n height: 1px;\n position: absolute;\n\n &.top {\n top: -1px;\n }\n\n &.bottom {\n bottom: -1px;\n }\n\n &.left {\n left: -1px;\n }\n\n &.right {\n right: -1px;\n }\n }\n}\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport throttle from 'lodash/throttle';\nimport { TMP_SELECTION_BG_CLASS } from '../../utils/consts';\nimport { getCell, styleByCellProps } from '../overlay/selection.utils';\nimport { DimensionSettingsState, SelectionStoreState, RangeArea } from '@type';\nimport type { Observable } from '../../utils';\n\n/**\n * Temporary range selection component. Shows temporary range selection.\n */\n@Component({\n tag: 'revogr-temp-range',\n styleUrl: 'revogr-temp-range-style.scss',\n})\nexport class RevogrFocus {\n /**\n * Dynamic stores\n */\n\n /**\n * Selection store, shows current selection and focus\n */\n @Prop() selectionStore: Observable<SelectionStoreState>;\n\n /**\n * Dimension row store\n */\n @Prop() dimensionRow: Observable<DimensionSettingsState>;\n /**\n * Dimension column store\n */\n @Prop() dimensionCol: Observable<DimensionSettingsState>;\n\n el?: HTMLElement;\n private readonly onChange = throttle((e: HTMLElement) => this.doChange(e), 300);\n\n private doChange(e: HTMLElement) {\n e?.scrollIntoView({\n block: 'nearest',\n inline: 'nearest',\n });\n }\n\n componentDidRender() {\n if (this.el) {\n this.onChange(this.el);\n }\n }\n\n render() {\n const data = this.selectionStore.get('tempRange');\n const type = this.selectionStore.get('tempRangeType');\n if (!data) {\n return;\n }\n let directionY = 'bottom';\n let derectionX = 'right';\n const range = this.getRange();\n if (!range) {\n return;\n }\n if (data.y < range.y) {\n directionY = 'top';\n }\n if (data.x < range.x) {\n derectionX = 'left';\n }\n const directionClass = `${derectionX} ${directionY}`;\n const cell = getCell(data,\n this.dimensionRow.state,\n this.dimensionCol.state\n );\n const styles = styleByCellProps(cell);\n const props = {\n class: {\n [TMP_SELECTION_BG_CLASS]: true,\n [type || '']: true,\n },\n style: styles,\n hidden: false\n };\n return (\n <Host {...props}>\n <div class={directionClass} ref={(e) => (this.el = e)} />\n </Host>\n );\n }\n\n private getRange(): RangeArea | null {\n const range = this.selectionStore.get('range');\n if (range) {\n return range;\n }\n const focus = this.selectionStore.get('focus');\n if (!focus) {\n return null;\n }\n return {\n ...focus,\n x1: focus.x,\n y1: focus.y,\n };\n }\n}\n"],"version":3}
@@ -78,7 +78,7 @@ class GridResizeService {
78
78
  }
79
79
  }
80
80
 
81
- const revogrViewportScrollStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#6200ee;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037;border:1px solid #00772d}.revo-button.red{background-color:#E0662E;border:1px solid #d55920}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.light{border:1px solid #cedefa;line-height:30px;background:none;color:#000;box-shadow:none}.rowHeaders{z-index:2;font-size:10px;display:flex;height:100%}.rowHeaders revogr-data .rgCell{text-align:center}.rowHeaders .rgCell{padding:0 1em !important;min-width:100%}revogr-viewport-scroll{-ms-overflow-style:none;scrollbar-width:none;overflow-x:auto;overflow-y:hidden;position:relative;z-index:1;height:100%}revogr-viewport-scroll::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll.colPinStart,revogr-viewport-scroll.colPinEnd{z-index:2}revogr-viewport-scroll.colPinEnd:has(.active){overflow:visible}revogr-viewport-scroll.rgCol{flex-grow:1}revogr-viewport-scroll .content-wrapper{overflow:hidden}revogr-viewport-scroll .inner-content-table{display:flex;flex-direction:column;max-height:100%;width:100%;min-width:100%;position:relative;z-index:0}revogr-viewport-scroll .vertical-inner{overflow-y:auto;position:relative;width:100%;flex-grow:1;outline:none;-ms-overflow-style:none;scrollbar-width:none;}revogr-viewport-scroll .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll .vertical-inner revogr-data,revogr-viewport-scroll .vertical-inner revogr-overlay-selection{height:100%}";
81
+ const revogrViewportScrollStyleCss = ".revo-drag-icon{width:11px;opacity:0.8}.revo-drag-icon::before{content:\"::\"}.revo-alt-icon{-webkit-mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");mask-image:url(\"data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 383' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg%3E%3Cpath d='M192.4375,383 C197.424479,383 201.663411,381.254557 205.154297,377.763672 L205.154297,377.763672 L264.25,318.667969 C270.234375,312.683594 271.605794,306.075846 268.364258,298.844727 C265.122721,291.613607 259.51237,287.998047 251.533203,287.998047 L251.533203,287.998047 L213.382812,287.998047 L213.382812,212.445312 L288.935547,212.445312 L288.935547,250.595703 C288.935547,258.57487 292.551107,264.185221 299.782227,267.426758 C307.013346,270.668294 313.621094,269.296875 319.605469,263.3125 L319.605469,263.3125 L378.701172,204.216797 C382.192057,200.725911 383.9375,196.486979 383.9375,191.5 C383.9375,186.513021 382.192057,182.274089 378.701172,178.783203 L378.701172,178.783203 L319.605469,119.6875 C313.621094,114.201823 307.013346,112.955078 299.782227,115.947266 C292.551107,118.939453 288.935547,124.42513 288.935547,132.404297 L288.935547,132.404297 L288.935547,170.554688 L213.382812,170.554688 L213.382812,95.0019531 L251.533203,95.0019531 C259.51237,95.0019531 264.998047,91.3863932 267.990234,84.1552734 C270.982422,76.9241536 269.735677,70.3164062 264.25,64.3320312 L264.25,64.3320312 L205.154297,5.23632812 C201.663411,1.74544271 197.424479,0 192.4375,0 C187.450521,0 183.211589,1.74544271 179.720703,5.23632812 L179.720703,5.23632812 L120.625,64.3320312 C114.640625,70.3164062 113.269206,76.9241536 116.510742,84.1552734 C119.752279,91.3863932 125.36263,95.0019531 133.341797,95.0019531 L133.341797,95.0019531 L171.492188,95.0019531 L171.492188,170.554688 L95.9394531,170.554688 L95.9394531,132.404297 C95.9394531,124.42513 92.3238932,118.814779 85.0927734,115.573242 C77.8616536,112.331706 71.2539062,113.703125 65.2695312,119.6875 L65.2695312,119.6875 L6.17382812,178.783203 C2.68294271,182.274089 0.9375,186.513021 0.9375,191.5 C0.9375,196.486979 2.68294271,200.725911 6.17382812,204.216797 L6.17382812,204.216797 L65.2695312,263.3125 C71.2539062,268.798177 77.8616536,270.044922 85.0927734,267.052734 C92.3238932,264.060547 95.9394531,258.57487 95.9394531,250.595703 L95.9394531,250.595703 L95.9394531,212.445312 L171.492188,212.445312 L171.492188,287.998047 L133.341797,287.998047 C125.36263,287.998047 119.876953,291.613607 116.884766,298.844727 C113.892578,306.075846 115.139323,312.683594 120.625,318.667969 L120.625,318.667969 L179.720703,377.763672 C183.211589,381.254557 187.450521,383 192.4375,383 Z'%3E%3C/path%3E%3C/g%3E%3C/svg%3E\");width:11px;height:11px;background-size:cover;background-repeat:no-repeat}.arrow-down{position:absolute;right:5px;top:0}.arrow-down svg{width:8px;margin-top:5px;margin-left:5px;opacity:0.4}.cell-value-wrapper{margin-right:10px;overflow:hidden;text-overflow:ellipsis}.revo-button{position:relative;overflow:hidden;color:#fff;background-color:#4545ff;height:32px;line-height:32px;padding:0 15px;outline:0;border:0;border-radius:7px;box-sizing:border-box;cursor:pointer}.revo-button.green{background-color:#009037}.revo-button.red{background-color:#E0662E}.revo-button:disabled,.revo-button[disabled]{cursor:not-allowed !important;filter:opacity(0.35) !important}.revo-button.outline{border:1px solid #dbdbdb;line-height:30px;background:none;color:#000;box-shadow:none}revo-grid[theme^=dark] .revo-button.outline{border:1px solid #404040;color:#d8d8d8}.rowHeaders{z-index:2;font-size:10px;display:flex;height:100%}.rowHeaders revogr-data .rgCell{text-align:center}.rowHeaders .rgCell{padding:0 1em !important;min-width:100%}revogr-viewport-scroll{-ms-overflow-style:none;scrollbar-width:none;overflow-x:auto;overflow-y:hidden;position:relative;z-index:1;height:100%}revogr-viewport-scroll::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll.colPinStart,revogr-viewport-scroll.colPinEnd{z-index:2}revogr-viewport-scroll.colPinEnd:has(.active){overflow:visible}revogr-viewport-scroll.rgCol{flex-grow:1}revogr-viewport-scroll .content-wrapper{overflow:hidden}revogr-viewport-scroll .inner-content-table{display:flex;flex-direction:column;max-height:100%;width:100%;min-width:100%;position:relative;z-index:0}revogr-viewport-scroll .vertical-inner{overflow-y:auto;position:relative;width:100%;flex-grow:1;outline:none;-ms-overflow-style:none;scrollbar-width:none;}revogr-viewport-scroll .vertical-inner::-webkit-scrollbar{display:none;-webkit-appearance:none}revogr-viewport-scroll .vertical-inner revogr-data,revogr-viewport-scroll .vertical-inner revogr-overlay-selection{height:100%}";
82
82
  const RevogrViewportScrollStyle0 = revogrViewportScrollStyleCss;
83
83
 
84
84
  const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewportScroll extends HTMLElement {
@@ -89,8 +89,6 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
89
89
  this.resizeViewport = createEvent(this, "resizeviewport", 7);
90
90
  this.scrollchange = createEvent(this, "scrollchange", 7);
91
91
  this.silentScroll = createEvent(this, "scrollviewportsilent", 7);
92
- this.oldValY = this.contentHeight;
93
- this.oldValX = this.contentWidth;
94
92
  this.rowHeader = undefined;
95
93
  this.contentWidth = 0;
96
94
  this.contentHeight = 0;
@@ -252,20 +250,11 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
252
250
  this.scrollchange.emit({ type, hasScroll });
253
251
  }
254
252
  disconnectedCallback() {
255
- this.resizeService.destroy();
253
+ var _a;
254
+ (_a = this.resizeService) === null || _a === void 0 ? void 0 : _a.destroy();
256
255
  }
257
256
  async componentDidRender() {
258
257
  var _a, _b, _c, _d;
259
- // scroll update if number of rows changed
260
- if (this.contentHeight < this.oldValY && this.verticalScroll) {
261
- this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;
262
- }
263
- this.oldValY = this.contentHeight;
264
- // scroll update if number of cols changed
265
- if (this.contentWidth < this.oldValX) {
266
- this.horizontalScroll.scrollLeft += this.contentWidth - this.oldValX;
267
- }
268
- this.oldValX = this.contentWidth;
269
258
  this.localScrollService.setParams({
270
259
  contentSize: this.contentHeight,
271
260
  clientSize: (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
@@ -280,7 +269,7 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
280
269
  this.setScrollVisibility('rgCol', this.horizontalScroll.clientWidth, this.contentWidth);
281
270
  }
282
271
  render() {
283
- return (h(Host, { key: '5a7d07c999e59a8b96a99c87e50103acb4f18406', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '09ac58def608c3bc169ce12e09dd2dc2df1f90a2', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, h("div", { key: 'c370a3b8d5d2f4925b77020ac85d5f4d06b876e0', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: 'c5feeeaf90e42715bbf13619b2341d23257447fb', name: HEADER_SLOT })), h("div", { key: '7c04ffd6e7893db57f883a736d0a4932743863ea', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'da5db752025ddaaf626411b445b3b90b5b81cdc8', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, h("slot", { key: 'c5404f4628b68b4b18a6e9143c70e72c50616f9d', name: CONTENT_SLOT }))), h("div", { key: 'ee9e1b5dd297f220aed3efef4b53b4dd74a11837', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: '5ff132da3009d959a6e87fbbe3d22930f322c486', name: FOOTER_SLOT })))));
272
+ return (h(Host, { key: '9727a9c83d740d8184e12acc06b72c3f28c3b5ac', onWheel: this.horizontalMouseWheel, onScroll: (e) => this.applyScroll('rgCol', e) }, h("div", { key: '44551981dda7401ac9290d003b1ac7e7f55ee006', class: "inner-content-table", style: { width: `${this.contentWidth}px` } }, h("div", { key: '8b4962c352e81c343aed7136b7f7a9d71b10ed70', class: "header-wrapper", ref: e => (this.header = e) }, h("slot", { key: '789868b91507bc50c18dc99c6bec8f1e4699cbab', name: HEADER_SLOT })), h("div", { key: '0efb49db3fbcbe0bdfcfa24afad495c681de6218', class: "vertical-inner", ref: el => (this.verticalScroll = el), onWheel: this.verticalMouseWheel, onScroll: (e) => this.applyScroll('rgRow', e) }, h("div", { key: 'eef434a04062b364805702d73c0b28c9e44a27c5', class: "content-wrapper", style: { height: `${this.contentHeight}px` } }, h("slot", { key: '8490b9f01abebeeaa46da811e9ecdc62090ecb00', name: CONTENT_SLOT }))), h("div", { key: 'c3c133d6e73816e9e3c33d5091fc00f959977874', class: "footer-wrapper", ref: e => (this.footer = e) }, h("slot", { key: 'e4aae0a9eb10c750306a6bd4c222bcab6d1050e3', name: FOOTER_SLOT })))));
284
273
  }
285
274
  /**
286
275
  * Extra layer for scroll event monitoring, where MouseWheel event is not passing
@@ -323,11 +312,18 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
323
312
  * @param e
324
313
  */
325
314
  onVerticalMouseWheel(type, delta, e) {
326
- var _a, _b, _c, _d;
327
- (_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
328
- const scrollTop = (_c = (_b = this.verticalScroll) === null || _b === void 0 ? void 0 : _b.scrollTop) !== null && _c !== void 0 ? _c : 0;
315
+ var _a, _b, _c, _d, _e, _f, _g, _h;
316
+ const scrollTop = (_b = (_a = this.verticalScroll) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : 0;
317
+ const clientHeight = (_d = (_c = this.verticalScroll) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0;
318
+ const scrollHeight = (_f = (_e = this.verticalScroll) === null || _e === void 0 ? void 0 : _e.scrollHeight) !== null && _f !== void 0 ? _f : 0;
319
+ // Detect if the user has reached the bottom
320
+ const atBottom = (scrollTop + clientHeight >= scrollHeight) && e.deltaY > 0;
321
+ const atTop = scrollTop === 0 && e.deltaY < 0;
322
+ if (!atBottom && !atTop) {
323
+ (_g = e.preventDefault) === null || _g === void 0 ? void 0 : _g.call(e);
324
+ }
329
325
  const pos = scrollTop + e[delta];
330
- (_d = this.localScrollService) === null || _d === void 0 ? void 0 : _d.scroll(pos, type, undefined, e[delta]);
326
+ (_h = this.localScrollService) === null || _h === void 0 ? void 0 : _h.scroll(pos, type, undefined, e[delta]);
331
327
  this.localScrollTimer.latestScrollUpdate(type);
332
328
  }
333
329
  /**
@@ -338,8 +334,18 @@ const RevogrViewportScroll = /*@__PURE__*/ proxyCustomElement(class RevogrViewpo
338
334
  */
339
335
  onHorizontalMouseWheel(type, delta, e) {
340
336
  var _a, _b;
341
- (_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
342
- const pos = this.horizontalScroll.scrollLeft + e[delta];
337
+ if (!e.deltaX) {
338
+ return;
339
+ }
340
+ const { scrollLeft, scrollWidth, clientWidth } = this.horizontalScroll;
341
+ // Detect if the user has reached the right end
342
+ const atRight = (scrollLeft + clientWidth >= scrollWidth) && e.deltaX > 0;
343
+ // Detect if the user has reached the left end
344
+ const atLeft = scrollLeft === 0 && e.deltaX < 0;
345
+ if (!atRight && !atLeft) {
346
+ (_a = e.preventDefault) === null || _a === void 0 ? void 0 : _a.call(e);
347
+ }
348
+ const pos = scrollLeft + e[delta];
343
349
  (_b = this.localScrollService) === null || _b === void 0 ? void 0 : _b.scroll(pos, type, undefined, e[delta]);
344
350
  this.localScroll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AE,MAAM,CAC7B,UAAU,EACV,IAAI,EACJ,SAAS,EACT,SAAS,EACT,OAAO,CACR,CAAC;SACH;KACF;;;;;;;IAQO,oBAAoB,CAC1B,IAAmB,EACnB,KAAY,EACZ,CAAmB;;QAEnB,MAAA,CAAC,CAAC,cAAc,iDAAI,CAAC;QACrB,MAAM,SAAS,GAAG,MAAA,MAAA,IAAI,CAAC,cAAc,0CAAE,SAAS,mCAAI,CAAC,CAAC;QACtD,MAAM,GAAG,GAAG,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACjC,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChD;;;;;;;IAQO,sBAAsB,CAC5B,IAAmB,EACnB,KAAY,EACZ,CAAmB;;QAEnB,MAAA,CAAC,CAAC,cAAc,iDAAI,CAAC;QACrB,MAAM,GAAG,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACxD,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/revoGrid/viewport.helpers.ts","src/utils/resize-observer.polifill.ts","src/components/revoGrid/viewport.resize.service.ts","src/components/scroll/revogr-viewport-scroll-style.scss?tag=revogr-viewport-scroll","src/components/scroll/revogr-viewport-scroll.tsx"],"sourcesContent":["/**\n * Collects data for pinned columns in the required @ViewportProps format.\n */\n\nimport { DimensionRows, MultiDimensionType, SlotType, Cell, ViewportColumn } from '@type';\n\n/**\n * Represents the slot names for the viewport slots.\n */\nexport const HEADER_SLOT = 'header'; // Slot name for the header slot\nexport const FOOTER_SLOT = 'footer'; // Slot name for the footer slot\nexport const CONTENT_SLOT = 'content'; // Slot name for the content slot\nexport const DATA_SLOT = 'data'; // Slot name for the data slot\n\n/**\n * Returns the last visible cell in the viewport for a given row type.\n * Coordinates are not zero-based and are relative to the viewport.\n * If needed to be zero-based they can be adjusted by subtracting 1.\n */\nexport function getLastCell(\n data: ViewportColumn,\n rowType: MultiDimensionType,\n): Cell {\n // Get the last visible column count from the viewport column data.\n const lastVisibleColumnCount = data.viewports[data.colType].store.get('realCount');\n\n // Get the last visible row count for the given row type from the viewport column data.\n const lastVisibleRowCount = data.viewports[rowType].store.get('realCount');\n\n // Return the last visible cell with the last visible column count and row count.\n return {\n x: lastVisibleColumnCount,\n y: lastVisibleRowCount,\n };\n}\n\n\nexport function viewportDataPartition(\n data: ViewportColumn,\n type: DimensionRows,\n slot: SlotType,\n fixed?: boolean,\n) {\n return {\n colData: data.colStore,\n viewportCol: data.viewports[data.colType].store,\n viewportRow: data.viewports[type].store,\n // lastCell is the last real coordinate + 1\n lastCell: getLastCell(data, type),\n slot,\n type,\n canDrag: !fixed,\n position: data.position,\n dataStore: data.rowStores[type].store,\n dimensionCol: data.dimensions[data.colType].store,\n dimensionRow: data.dimensions[type].store,\n style: fixed\n ? { height: `${data.dimensions[type].store.get('realSize')}px` }\n : undefined,\n };\n}\n\nexport type VPPartition = ReturnType<typeof viewportDataPartition>;","export async function resizeObserver() {\n if (!('ResizeObserver' in window)) {\n const module = await import('@juggle/resize-observer');\n (window as Window & typeof globalThis).ResizeObserver = (module.ResizeObserver as unknown) as typeof ResizeObserver;\n }\n}\n","import throttle from 'lodash/throttle';\nimport { resizeObserver } from '../../utils/resize-observer.polifill';\ninterface Events {\n resize(entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver): void;\n}\nexport default class GridResizeService {\n private resizeObserver: ResizeObserver | null = null;\n private resize = throttle((e: ReadonlyArray<ResizeObserverEntry>, o: ResizeObserver) => this.events?.resize(e, o), 10);\n constructor(el: HTMLElement, private events: Events) {\n this.init(el);\n }\n\n async init(el: HTMLElement): Promise<void> {\n await resizeObserver();\n this.resizeObserver = new ResizeObserver(this.resize);\n this.resizeObserver?.observe(el);\n }\n\n public destroy() {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n}\n","@mixin noScroll {\n /* Hide scrollbar for IE and Edge */\n -ms-overflow-style: none;\n scrollbar-width: none; /* Firefox */\n /* Hide scrollbar for Chrome, Safari and Opera */\n &::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n}\n\n.rowHeaders {\n z-index: 2;\n font-size: 10px;\n display: flex;\n height: 100%;\n\n revogr-data .rgCell {\n text-align: center;\n }\n\n .rgCell {\n padding: 0 1em !important;\n min-width: 100%;\n }\n}\n\nrevogr-viewport-scroll {\n @include noScroll;\n\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n z-index: 1;\n height: 100%;\n\n &.colPinStart,\n &.colPinEnd {\n z-index: 2;\n }\n\n // make sure it would work\n &.colPinEnd:has(.active) {\n overflow: visible;\n }\n\n &.rgCol {\n flex-grow: 1;\n }\n\n .content-wrapper {\n overflow: hidden;\n }\n\n .inner-content-table {\n display: flex;\n flex-direction: column;\n max-height: 100%;\n width: 100%;\n min-width: 100%;\n position: relative;\n z-index: 0;\n }\n\n .vertical-inner {\n overflow-y: auto;\n position: relative;\n width: 100%;\n flex-grow: 1;\n outline: none; // avoid accessibility focus issue\n @include noScroll;\n\n revogr-data,\n revogr-overlay-selection {\n height: 100%;\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Method,\n Element,\n Prop,\n Host,\n Listen,\n} from '@stencil/core';\n\nimport GridResizeService from '../revoGrid/viewport.resize.service';\nimport LocalScrollService from '../../services/local.scroll.service';\nimport { LocalScrollTimer } from '../../services/local.scroll.timer';\nimport {\n CONTENT_SLOT,\n FOOTER_SLOT,\n HEADER_SLOT,\n} from '../revoGrid/viewport.helpers';\nimport { DimensionCols, DimensionType, ElementScroll } from '@type';\nimport { ScrollCoordinateEvent, ViewPortResizeEvent, ViewPortScrollEvent } from '@type';\n\ntype Delta = 'deltaX' | 'deltaY';\ntype LocalScrollEvent = {\n preventDefault(): void;\n} & { [x in Delta]: number };\n\n/**\n * Viewport scroll component for RevoGrid\n * @slot - content\n * @slot header - header\n * @slot footer - footer\n */\n@Component({\n tag: 'revogr-viewport-scroll',\n styleUrl: 'revogr-viewport-scroll-style.scss',\n})\nexport class RevogrViewportScroll implements ElementScroll {\n /**\n * Enable row header\n */\n @Prop() readonly rowHeader: boolean;\n\n /**\n * Width of inner content\n */\n @Prop() contentWidth = 0;\n /**\n * Height of inner content\n */\n @Prop() contentHeight = 0;\n\n @Prop() colType!: DimensionCols | 'rowHeaders';\n\n /**\n * Before scroll event\n */\n @Event({ eventName: 'scrollviewport', bubbles: true }) scrollViewport: EventEmitter<ViewPortScrollEvent>;\n /**\n * Viewport resize\n */\n @Event({ eventName: 'resizeviewport' }) resizeViewport: EventEmitter<ViewPortResizeEvent>;\n\n /**\n * Triggered on scroll change, can be used to get information about scroll visibility\n */\n @Event() scrollchange: EventEmitter<{\n type: DimensionType;\n hasScroll: boolean;\n }>;\n\n /**\n * Silently scroll to coordinate\n * Made to align negative coordinates for mobile devices\n */\n @Event({ eventName: 'scrollviewportsilent' }) silentScroll: EventEmitter<ViewPortScrollEvent>;\n\n @Element() horizontalScroll: HTMLElement;\n\n private oldValY = this.contentHeight;\n private oldValX = this.contentWidth;\n\n private verticalScroll?: HTMLElement;\n private header?: HTMLElement;\n private footer?: HTMLElement;\n\n /**\n * Static functions to bind wheel change\n */\n private horizontalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n private verticalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n\n private resizeService: GridResizeService;\n private localScrollService: LocalScrollService;\n private localScrollTimer: LocalScrollTimer;\n\n\n @Method() async setScroll(e: ViewPortScrollEvent) {\n this.localScrollTimer.latestScrollUpdate(e.dimension);\n this.localScrollService?.setScroll(e);\n }\n\n /**\n * update on delta in case we don't know existing position or external change\n * @param e\n */\n @Method() async changeScroll(\n e: ViewPortScrollEvent,\n silent = false,\n ) {\n if (silent) {\n if (e.coordinate && this.verticalScroll) {\n switch (e.dimension) {\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n case 'rgRow':\n this.verticalScroll.style.transform = `translateY(${-1 * e.coordinate}px)`;\n break;\n }\n }\n return;\n }\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.horizontalScroll.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = (this.verticalScroll?.scrollTop ?? 0) + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n /**\n * Dispatch this event to trigger vertical mouse wheel from plugins\n */\n @Listen('mousewheel-vertical') mousewheelVertical({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.verticalMouseWheel(e);\n }\n /**\n * Dispatch this event to trigger horizontal mouse wheel from plugins\n */\n @Listen('mousewheel-horizontal') mousewheelHorizontal({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.horizontalMouseWheel(e);\n }\n /**\n * Allows to use outside listener\n */\n @Listen('scroll-coordinate') scrollApply({\n detail: { type, coordinate },\n }: CustomEvent<ScrollCoordinateEvent>) {\n this.applyOnScroll(type, coordinate, true);\n }\n\n connectedCallback() {\n /**\n * Bind scroll functions for farther usage\n */\n // allow mousewheel for all devices including mobile\n this.verticalMouseWheel = this.onVerticalMouseWheel.bind(\n this,\n 'rgRow',\n 'deltaY',\n );\n this.horizontalMouseWheel = this.onHorizontalMouseWheel.bind(\n this,\n 'rgCol',\n 'deltaX',\n );\n this.localScrollTimer = new LocalScrollTimer('ontouchstart' in document.documentElement ? 0 : 10);\n /**\n * Create local scroll service\n */\n this.localScrollService = new LocalScrollService({\n // to improve safari smoothnes on scroll\n // skipAnimationFrame: isSafariDesktop(),\n runScroll: e => this.scrollViewport.emit(e),\n applyScroll: e => {\n this.localScrollTimer.setCoordinate(e);\n switch (e.dimension) {\n case 'rgCol':\n // this will trigger on scroll event\n this.horizontalScroll.scrollLeft = e.coordinate;\n break;\n case 'rgRow':\n if (this.verticalScroll) {\n // this will trigger on scroll event\n this.verticalScroll.scrollTop = e.coordinate;\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n if (this.verticalScroll.style.transform) {\n this.verticalScroll.style.transform = '';\n }\n }\n break;\n }\n },\n });\n }\n\n componentDidLoad() {\n // track horizontal viewport resize\n this.resizeService = new GridResizeService(this.horizontalScroll, {\n resize: entries => {\n let height = entries[0]?.contentRect.height || 0;\n if (height) {\n height -= (this.header?.clientHeight ?? 0) + (this.footer?.clientHeight ?? 0);\n }\n const els = {\n rgRow: {\n size: height,\n contentSize: this.contentHeight,\n scroll: this.verticalScroll?.scrollTop,\n noScroll: false,\n },\n rgCol: {\n size: entries[0]?.contentRect.width || 0,\n contentSize: this.contentWidth,\n scroll: this.horizontalScroll.scrollLeft,\n noScroll: this.colType !== 'rgCol',\n },\n };\n for (const [dim, item] of Object.entries(els)) {\n const dimension = dim as DimensionType;\n this.resizeViewport.emit({ dimension, size: item.size, rowHeader: this.rowHeader });\n if (item.noScroll) {\n continue;\n }\n this.localScrollService?.scroll(item.scroll ?? 0, dimension, true);\n // track scroll visibility on outer element change\n this.setScrollVisibility(dimension, item.size, item.contentSize);\n }\n },\n });\n }\n\n /**\n * Check if scroll present or not per type\n * Trigger this method on inner content size change or on outer element size change\n * If inner content bigger then outer size then scroll is present and mousewheel binding required\n * @param type - dimension type 'rgRow/y' or 'rgCol/x'\n * @param size - outer content size\n * @param innerContentSize - inner content size\n */\n setScrollVisibility(\n type: DimensionType,\n size: number,\n innerContentSize: number,\n ) {\n // test if scroll present\n const hasScroll = size < innerContentSize;\n let el: HTMLElement | undefined;\n // event reference for binding\n switch (type) {\n case 'rgCol':\n el = this.horizontalScroll;\n break;\n case 'rgRow':\n el = this.verticalScroll;\n break;\n }\n // based on scroll visibility assign or remove class and event\n if (hasScroll) {\n el?.classList.add(`scroll-${type}`);\n } else {\n el?.classList.remove(`scroll-${type}`);\n }\n this.scrollchange.emit({ type, hasScroll });\n }\n\n disconnectedCallback() {\n this.resizeService.destroy();\n }\n\n async componentDidRender() {\n // scroll update if number of rows changed\n if (this.contentHeight < this.oldValY && this.verticalScroll) {\n this.verticalScroll.scrollTop += this.contentHeight - this.oldValY;\n }\n this.oldValY = this.contentHeight;\n\n // scroll update if number of cols changed\n if (this.contentWidth < this.oldValX) {\n this.horizontalScroll.scrollLeft += this.contentWidth - this.oldValX;\n }\n this.oldValX = this.contentWidth;\n\n this.localScrollService.setParams(\n {\n contentSize: this.contentHeight,\n clientSize: this.verticalScroll?.clientHeight ?? 0,\n virtualSize: 0,\n },\n 'rgRow',\n );\n\n this.localScrollService.setParams(\n {\n contentSize: this.contentWidth,\n clientSize: this.horizontalScroll.clientWidth,\n virtualSize: 0,\n },\n 'rgCol',\n );\n this.setScrollVisibility(\n 'rgRow',\n this.verticalScroll?.clientHeight ?? 0,\n this.contentHeight,\n );\n this.setScrollVisibility(\n 'rgCol',\n this.horizontalScroll.clientWidth,\n this.contentWidth,\n );\n }\n\n render() {\n return (\n <Host\n onWheel={this.horizontalMouseWheel}\n onScroll={(e: UIEvent) => this.applyScroll('rgCol', e)}\n >\n <div\n class=\"inner-content-table\"\n style={{ width: `${this.contentWidth}px` }}\n >\n <div class=\"header-wrapper\" ref={e => (this.header = e)}>\n <slot name={HEADER_SLOT} />\n </div>\n <div\n class=\"vertical-inner\"\n ref={el => (this.verticalScroll = el)}\n onWheel={this.verticalMouseWheel}\n onScroll={(e: MouseEvent) => this.applyScroll('rgRow', e)}\n >\n <div\n class=\"content-wrapper\"\n style={{ height: `${this.contentHeight}px` }}\n >\n <slot name={CONTENT_SLOT} />\n </div>\n </div>\n <div class=\"footer-wrapper\" ref={e => (this.footer = e)}>\n <slot name={FOOTER_SLOT} />\n </div>\n </div>\n </Host>\n );\n }\n /**\n * Extra layer for scroll event monitoring, where MouseWheel event is not passing\n * We need to trigger scroll event in case there is no mousewheel event\n */\n @Method() async applyScroll(type: DimensionType, e: UIEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n let scroll = 0;\n switch (type) {\n case 'rgCol':\n scroll = e.target.scrollLeft;\n break;\n case 'rgRow':\n scroll = e.target.scrollTop;\n break;\n }\n\n // for mobile devices to skip negative scroll loop\n if (scroll < 0) {\n this.silentScroll.emit({ dimension: type, coordinate: scroll });\n return;\n }\n this.applyOnScroll(type, scroll);\n }\n\n /**\n * Applies change on scroll event only if mousewheel event happened some time ago\n */\n private applyOnScroll(\n type: DimensionType,\n coordinate: number,\n outside = false,\n ) {\n // apply after throttling\n if (this.localScrollTimer.isReady(type, coordinate)) {\n this.localScrollService?.scroll(\n coordinate,\n type,\n undefined,\n undefined,\n outside,\n );\n }\n }\n\n /**\n * On vertical mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onVerticalMouseWheel(\n type: DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault?.();\n const scrollTop = this.verticalScroll?.scrollTop ?? 0;\n const pos = scrollTop + e[delta];\n this.localScrollService?.scroll(pos, type, undefined, e[delta]);\n this.localScrollTimer.latestScrollUpdate(type);\n }\n\n /**\n * On horizontal mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onHorizontalMouseWheel(\n type: DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n e.preventDefault?.();\n const pos = this.horizontalScroll.scrollLeft + e[delta];\n this.localScrollService?.scroll(pos, type, undefined, e[delta]);\n this.localScrollTimer.latestScrollUpdate(type);\n }\n}\n"],"version":3}
1
+ {"file":"revogr-viewport-scroll2.js","mappings":";;;;;;;AAAA;;;AAMA;;;MAGa,WAAW,GAAG,SAAS;MACvB,WAAW,GAAG,SAAS;MACvB,YAAY,GAAG,UAAU;MACzB,SAAS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GAAG,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACjC,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChD;;;;;;;IAQO,sBAAsB,CAC5B,IAAmB,EACnB,KAAY,EACZ,CAAmB;;QAEnB,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE;YACb,OAAO;SACR;QACD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC;;QAGvE,MAAM,OAAO,GAAG,CAAC,UAAU,GAAG,WAAW,IAAI,WAAW,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;;QAG1E,MAAM,MAAM,GAAG,UAAU,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAChD,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE;YACvB,MAAA,CAAC,CAAC,cAAc,iDAAI,CAAC;SACtB;QACD,MAAM,GAAG,GAAG,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAClC,MAAA,IAAI,CAAC,kBAAkB,0CAAE,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/revoGrid/viewport.helpers.ts","src/utils/resize-observer.polifill.ts","src/components/revoGrid/viewport.resize.service.ts","src/components/scroll/revogr-viewport-scroll-style.scss?tag=revogr-viewport-scroll","src/components/scroll/revogr-viewport-scroll.tsx"],"sourcesContent":["/**\n * Collects data for pinned columns in the required @ViewportProps format.\n */\n\nimport { DimensionRows, MultiDimensionType, SlotType, Cell, ViewportColumn } from '@type';\n\n/**\n * Represents the slot names for the viewport slots.\n */\nexport const HEADER_SLOT = 'header'; // Slot name for the header slot\nexport const FOOTER_SLOT = 'footer'; // Slot name for the footer slot\nexport const CONTENT_SLOT = 'content'; // Slot name for the content slot\nexport const DATA_SLOT = 'data'; // Slot name for the data slot\n\n/**\n * Returns the last visible cell in the viewport for a given row type.\n * Coordinates are not zero-based and are relative to the viewport.\n * If needed to be zero-based they can be adjusted by subtracting 1.\n */\nexport function getLastCell(\n data: ViewportColumn,\n rowType: MultiDimensionType,\n): Cell {\n // Get the last visible column count from the viewport column data.\n const lastVisibleColumnCount = data.viewports[data.colType].store.get('realCount');\n\n // Get the last visible row count for the given row type from the viewport column data.\n const lastVisibleRowCount = data.viewports[rowType].store.get('realCount');\n\n // Return the last visible cell with the last visible column count and row count.\n return {\n x: lastVisibleColumnCount,\n y: lastVisibleRowCount,\n };\n}\n\n\nexport function viewportDataPartition(\n data: ViewportColumn,\n type: DimensionRows,\n slot: SlotType,\n fixed?: boolean,\n) {\n return {\n colData: data.colStore,\n viewportCol: data.viewports[data.colType].store,\n viewportRow: data.viewports[type].store,\n // lastCell is the last real coordinate + 1\n lastCell: getLastCell(data, type),\n slot,\n type,\n canDrag: !fixed,\n position: data.position,\n dataStore: data.rowStores[type].store,\n dimensionCol: data.dimensions[data.colType].store,\n dimensionRow: data.dimensions[type].store,\n style: fixed\n ? { height: `${data.dimensions[type].store.get('realSize')}px` }\n : undefined,\n };\n}\n\nexport type VPPartition = ReturnType<typeof viewportDataPartition>;","export async function resizeObserver() {\n if (!('ResizeObserver' in window)) {\n const module = await import('@juggle/resize-observer');\n (window as Window & typeof globalThis).ResizeObserver = (module.ResizeObserver as unknown) as typeof ResizeObserver;\n }\n}\n","import throttle from 'lodash/throttle';\nimport { resizeObserver } from '../../utils/resize-observer.polifill';\ninterface Events {\n resize(entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver): void;\n}\nexport default class GridResizeService {\n private resizeObserver: ResizeObserver | null = null;\n private resize = throttle((e: ReadonlyArray<ResizeObserverEntry>, o: ResizeObserver) => this.events?.resize(e, o), 10);\n constructor(el: HTMLElement, private events: Events) {\n this.init(el);\n }\n\n async init(el: HTMLElement): Promise<void> {\n await resizeObserver();\n this.resizeObserver = new ResizeObserver(this.resize);\n this.resizeObserver?.observe(el);\n }\n\n public destroy() {\n this.resizeObserver?.disconnect();\n this.resizeObserver = null;\n }\n}\n","@mixin noScroll {\n /* Hide scrollbar for IE and Edge */\n -ms-overflow-style: none;\n scrollbar-width: none; /* Firefox */\n /* Hide scrollbar for Chrome, Safari and Opera */\n &::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n}\n\n.rowHeaders {\n z-index: 2;\n font-size: 10px;\n display: flex;\n height: 100%;\n\n revogr-data .rgCell {\n text-align: center;\n }\n\n .rgCell {\n padding: 0 1em !important;\n min-width: 100%;\n }\n}\n\nrevogr-viewport-scroll {\n @include noScroll;\n\n overflow-x: auto;\n overflow-y: hidden;\n position: relative;\n z-index: 1;\n height: 100%;\n\n &.colPinStart,\n &.colPinEnd {\n z-index: 2;\n }\n\n // make sure it would work\n &.colPinEnd:has(.active) {\n overflow: visible;\n }\n\n &.rgCol {\n flex-grow: 1;\n }\n\n .content-wrapper {\n overflow: hidden;\n }\n\n .inner-content-table {\n display: flex;\n flex-direction: column;\n max-height: 100%;\n width: 100%;\n min-width: 100%;\n position: relative;\n z-index: 0;\n }\n\n .vertical-inner {\n overflow-y: auto;\n position: relative;\n width: 100%;\n flex-grow: 1;\n outline: none; // avoid accessibility focus issue\n @include noScroll;\n\n revogr-data,\n revogr-overlay-selection {\n height: 100%;\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Method,\n Element,\n Prop,\n Host,\n Listen,\n} from '@stencil/core';\n\nimport GridResizeService from '../revoGrid/viewport.resize.service';\nimport LocalScrollService from '../../services/local.scroll.service';\nimport { LocalScrollTimer } from '../../services/local.scroll.timer';\nimport {\n CONTENT_SLOT,\n FOOTER_SLOT,\n HEADER_SLOT,\n} from '../revoGrid/viewport.helpers';\nimport type {\n DimensionCols,\n DimensionType,\n ElementScroll,\n ScrollCoordinateEvent,\n ViewPortResizeEvent,\n ViewPortScrollEvent\n} from '@type';\n\ntype Delta = 'deltaX' | 'deltaY';\ntype LocalScrollEvent = {\n preventDefault(): void;\n} & { [x in Delta]: number };\n\n/**\n * Viewport scroll component for RevoGrid\n * @slot - content\n * @slot header - header\n * @slot footer - footer\n */\n@Component({\n tag: 'revogr-viewport-scroll',\n styleUrl: 'revogr-viewport-scroll-style.scss',\n})\nexport class RevogrViewportScroll implements ElementScroll {\n /**\n * Enable row header\n */\n @Prop() readonly rowHeader: boolean;\n\n /**\n * Width of inner content\n */\n @Prop() contentWidth = 0;\n /**\n * Height of inner content\n */\n @Prop() contentHeight = 0;\n\n @Prop() colType!: DimensionCols | 'rowHeaders';\n\n /**\n * Before scroll event\n */\n @Event({ eventName: 'scrollviewport', bubbles: true }) scrollViewport: EventEmitter<ViewPortScrollEvent>;\n /**\n * Viewport resize\n */\n @Event({ eventName: 'resizeviewport' }) resizeViewport: EventEmitter<ViewPortResizeEvent>;\n\n /**\n * Triggered on scroll change, can be used to get information about scroll visibility\n */\n @Event() scrollchange: EventEmitter<{\n type: DimensionType;\n hasScroll: boolean;\n }>;\n\n /**\n * Silently scroll to coordinate\n * Made to align negative coordinates for mobile devices\n */\n @Event({ eventName: 'scrollviewportsilent' }) silentScroll: EventEmitter<ViewPortScrollEvent>;\n\n @Element() horizontalScroll: HTMLElement;\n\n private verticalScroll?: HTMLElement;\n private header?: HTMLElement;\n private footer?: HTMLElement;\n\n /**\n * Static functions to bind wheel change\n */\n private horizontalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n private verticalMouseWheel: (e: Partial<LocalScrollEvent>) => void;\n\n private resizeService?: GridResizeService;\n private localScrollService: LocalScrollService;\n private localScrollTimer: LocalScrollTimer;\n\n\n @Method() async setScroll(e: ViewPortScrollEvent) {\n this.localScrollTimer.latestScrollUpdate(e.dimension);\n this.localScrollService?.setScroll(e);\n }\n\n /**\n * update on delta in case we don't know existing position or external change\n * @param e\n */\n @Method() async changeScroll(\n e: ViewPortScrollEvent,\n silent = false,\n ) {\n if (silent) {\n if (e.coordinate && this.verticalScroll) {\n switch (e.dimension) {\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n case 'rgRow':\n this.verticalScroll.style.transform = `translateY(${-1 * e.coordinate}px)`;\n break;\n }\n }\n return;\n }\n if (e.delta) {\n switch (e.dimension) {\n case 'rgCol':\n e.coordinate = this.horizontalScroll.scrollLeft + e.delta;\n break;\n case 'rgRow':\n e.coordinate = (this.verticalScroll?.scrollTop ?? 0) + e.delta;\n break;\n }\n this.setScroll(e);\n }\n return e;\n }\n\n /**\n * Dispatch this event to trigger vertical mouse wheel from plugins\n */\n @Listen('mousewheel-vertical') mousewheelVertical({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.verticalMouseWheel(e);\n }\n /**\n * Dispatch this event to trigger horizontal mouse wheel from plugins\n */\n @Listen('mousewheel-horizontal') mousewheelHorizontal({\n detail: e,\n }: CustomEvent<LocalScrollEvent>) {\n this.horizontalMouseWheel(e);\n }\n /**\n * Allows to use outside listener\n */\n @Listen('scroll-coordinate') scrollApply({\n detail: { type, coordinate },\n }: CustomEvent<ScrollCoordinateEvent>) {\n this.applyOnScroll(type, coordinate, true);\n }\n\n connectedCallback() {\n /**\n * Bind scroll functions for farther usage\n */\n // allow mousewheel for all devices including mobile\n this.verticalMouseWheel = this.onVerticalMouseWheel.bind(\n this,\n 'rgRow',\n 'deltaY',\n );\n this.horizontalMouseWheel = this.onHorizontalMouseWheel.bind(\n this,\n 'rgCol',\n 'deltaX',\n );\n this.localScrollTimer = new LocalScrollTimer('ontouchstart' in document.documentElement ? 0 : 10);\n /**\n * Create local scroll service\n */\n this.localScrollService = new LocalScrollService({\n // to improve safari smoothnes on scroll\n // skipAnimationFrame: isSafariDesktop(),\n runScroll: e => this.scrollViewport.emit(e),\n applyScroll: e => {\n this.localScrollTimer.setCoordinate(e);\n switch (e.dimension) {\n case 'rgCol':\n // this will trigger on scroll event\n this.horizontalScroll.scrollLeft = e.coordinate;\n break;\n case 'rgRow':\n if (this.verticalScroll) {\n // this will trigger on scroll event\n this.verticalScroll.scrollTop = e.coordinate;\n // for mobile devices to skip negative scroll loop. only on vertical scroll\n if (this.verticalScroll.style.transform) {\n this.verticalScroll.style.transform = '';\n }\n }\n break;\n }\n },\n });\n }\n\n componentDidLoad() {\n // track horizontal viewport resize\n this.resizeService = new GridResizeService(this.horizontalScroll, {\n resize: entries => {\n let height = entries[0]?.contentRect.height || 0;\n if (height) {\n height -= (this.header?.clientHeight ?? 0) + (this.footer?.clientHeight ?? 0);\n }\n const els = {\n rgRow: {\n size: height,\n contentSize: this.contentHeight,\n scroll: this.verticalScroll?.scrollTop,\n noScroll: false,\n },\n rgCol: {\n size: entries[0]?.contentRect.width || 0,\n contentSize: this.contentWidth,\n scroll: this.horizontalScroll.scrollLeft,\n noScroll: this.colType !== 'rgCol',\n },\n };\n for (const [dim, item] of Object.entries(els)) {\n const dimension = dim as DimensionType;\n this.resizeViewport.emit({ dimension, size: item.size, rowHeader: this.rowHeader });\n if (item.noScroll) {\n continue;\n }\n this.localScrollService?.scroll(item.scroll ?? 0, dimension, true);\n // track scroll visibility on outer element change\n this.setScrollVisibility(dimension, item.size, item.contentSize);\n }\n },\n });\n }\n\n /**\n * Check if scroll present or not per type\n * Trigger this method on inner content size change or on outer element size change\n * If inner content bigger then outer size then scroll is present and mousewheel binding required\n * @param type - dimension type 'rgRow/y' or 'rgCol/x'\n * @param size - outer content size\n * @param innerContentSize - inner content size\n */\n setScrollVisibility(\n type: DimensionType,\n size: number,\n innerContentSize: number,\n ) {\n // test if scroll present\n const hasScroll = size < innerContentSize;\n let el: HTMLElement | undefined;\n // event reference for binding\n switch (type) {\n case 'rgCol':\n el = this.horizontalScroll;\n break;\n case 'rgRow':\n el = this.verticalScroll;\n break;\n }\n // based on scroll visibility assign or remove class and event\n if (hasScroll) {\n el?.classList.add(`scroll-${type}`);\n } else {\n el?.classList.remove(`scroll-${type}`);\n }\n this.scrollchange.emit({ type, hasScroll });\n }\n\n disconnectedCallback() {\n this.resizeService?.destroy();\n }\n\n async componentDidRender() {\n this.localScrollService.setParams(\n {\n contentSize: this.contentHeight,\n clientSize: this.verticalScroll?.clientHeight ?? 0,\n virtualSize: 0,\n },\n 'rgRow',\n );\n\n this.localScrollService.setParams(\n {\n contentSize: this.contentWidth,\n clientSize: this.horizontalScroll.clientWidth,\n virtualSize: 0,\n },\n 'rgCol',\n );\n this.setScrollVisibility(\n 'rgRow',\n this.verticalScroll?.clientHeight ?? 0,\n this.contentHeight,\n );\n this.setScrollVisibility(\n 'rgCol',\n this.horizontalScroll.clientWidth,\n this.contentWidth,\n );\n }\n\n render() {\n return (\n <Host\n onWheel={this.horizontalMouseWheel}\n onScroll={(e: UIEvent) => this.applyScroll('rgCol', e)}\n >\n <div\n class=\"inner-content-table\"\n style={{ width: `${this.contentWidth}px` }}\n >\n <div class=\"header-wrapper\" ref={e => (this.header = e)}>\n <slot name={HEADER_SLOT} />\n </div>\n <div\n class=\"vertical-inner\"\n ref={el => (this.verticalScroll = el)}\n onWheel={this.verticalMouseWheel}\n onScroll={(e: MouseEvent) => this.applyScroll('rgRow', e)}\n >\n <div\n class=\"content-wrapper\"\n style={{ height: `${this.contentHeight}px` }}\n >\n <slot name={CONTENT_SLOT} />\n </div>\n </div>\n <div class=\"footer-wrapper\" ref={e => (this.footer = e)}>\n <slot name={FOOTER_SLOT} />\n </div>\n </div>\n </Host>\n );\n }\n /**\n * Extra layer for scroll event monitoring, where MouseWheel event is not passing\n * We need to trigger scroll event in case there is no mousewheel event\n */\n @Method() async applyScroll(type: DimensionType, e: UIEvent) {\n if (!(e.target instanceof HTMLElement)) {\n return;\n }\n let scroll = 0;\n switch (type) {\n case 'rgCol':\n scroll = e.target.scrollLeft;\n break;\n case 'rgRow':\n scroll = e.target.scrollTop;\n break;\n }\n\n // for mobile devices to skip negative scroll loop\n if (scroll < 0) {\n this.silentScroll.emit({ dimension: type, coordinate: scroll });\n return;\n }\n this.applyOnScroll(type, scroll);\n }\n\n /**\n * Applies change on scroll event only if mousewheel event happened some time ago\n */\n private applyOnScroll(\n type: DimensionType,\n coordinate: number,\n outside = false,\n ) {\n // apply after throttling\n if (this.localScrollTimer.isReady(type, coordinate)) {\n this.localScrollService?.scroll(\n coordinate,\n type,\n undefined,\n undefined,\n outside,\n );\n }\n }\n\n /**\n * On vertical mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onVerticalMouseWheel(\n type: DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n const scrollTop = this.verticalScroll?.scrollTop ?? 0;\n const clientHeight = this.verticalScroll?.clientHeight ?? 0;\n const scrollHeight = this.verticalScroll?.scrollHeight ?? 0;\n\n // Detect if the user has reached the bottom\n const atBottom = (scrollTop + clientHeight >= scrollHeight) && e.deltaY > 0;\n const atTop = scrollTop === 0 && e.deltaY < 0;\n if (!atBottom && !atTop) {\n e.preventDefault?.();\n }\n const pos = scrollTop + e[delta];\n this.localScrollService?.scroll(pos, type, undefined, e[delta]);\n this.localScrollTimer.latestScrollUpdate(type);\n }\n\n /**\n * On horizontal mousewheel event\n * @param type\n * @param delta\n * @param e\n */\n private onHorizontalMouseWheel(\n type: DimensionType,\n delta: Delta,\n e: LocalScrollEvent,\n ) {\n if (!e.deltaX) {\n return;\n }\n const { scrollLeft, scrollWidth, clientWidth } = this.horizontalScroll;\n\n // Detect if the user has reached the right end\n const atRight = (scrollLeft + clientWidth >= scrollWidth) && e.deltaX > 0;\n\n // Detect if the user has reached the left end\n const atLeft = scrollLeft === 0 && e.deltaX < 0;\n if (!atRight && !atLeft) {\n e.preventDefault?.();\n }\n const pos = scrollLeft + e[delta];\n this.localScrollService?.scroll(pos, type, undefined, e[delta]);\n this.localScrollTimer.latestScrollUpdate(type);\n }\n}\n"],"version":3}
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import { b as getSourceItem } from './data.store.js';
5
5
  import '@stencil/core/internal/client';
6
+ import './platform.js';
6
7
  import { g as getItemByPosition, a as getItemByIndex } from './dimension.helpers.js';
7
8
 
8
9
  function isTouch(e) {
@@ -1 +1 @@
1
- {"file":"selection.utils.js","mappings":";;;;;;;AAAA,SAAS,OAAO,CAAC,CAA0B;IACzC,OAAO,CAAC,CAAE,CAAgB,CAAC,OAAO,CAAC;AACrC,CAAC;SAEe,iBAAiB,CAAC,UAAkB,EAAE,UAAmB;IACvE,IAAI,UAAU,IAAI,UAAU,EAAE;QAC5B,IAAI,EAAE,UAAU,CAAC,MAAM,YAAY,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE;YAC/F,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAGD;;;SAGgB,oBAAoB,CAClC,CAA0B,EAC1B,IAAsE,EACtE,UAAmB;;;IAGnB,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE;;QAEd,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;YACxB,MAAM,UAAU,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;;YAEhC,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,EAAE;;gBAE9C,OAAO,IAAI,CAAC;aACb;;YAED,OAAQ,UAAU,CAAC,IAAI,CAAY,IAAI,CAAC,CAAC;SAC1C;;QAED,OAAO,IAAI,CAAC;KACb;;IAED,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtB;;SCVgB,oBAAoB,CAClC,IAAgB,EAChB,KAAwD;IAExD,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,IAAI,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G;QACH,MAAM;QACN,KAAK,EAAE,KAAK,GAAG,IAAI;QACnB,MAAM,EAAE,MAAM,GAAG,GAAG;KACrB,CAAC;AACJ;;;;","names":[],"sources":["src/utils/events.ts","src/components/overlay/selection.utils.ts"],"sourcesContent":["function isTouch(e: MouseEvent | TouchEvent): e is TouchEvent {\n return !!(e as TouchEvent).touches;\n}\n\nexport function verifyTouchTarget(touchEvent?: Touch, focusClass?: string) {\n if (focusClass && touchEvent) {\n if (!(touchEvent.target instanceof Element && touchEvent.target.classList.contains(focusClass))) { \n return false;\n }\n }\n return true;\n}\n\n\n/**\n * Function to get the value of a specific property from a MouseEvent or TouchEvent object.\n */\nexport function getPropertyFromEvent(\n e: MouseEvent | TouchEvent,\n prop: keyof Pick<Touch, 'clientX' | 'clientY' | 'screenX' | 'screenY'>,\n focusClass?: string // for touch events\n): number | null {\n // Check if the event is a touch event\n if (isTouch(e)) {\n // If the event has touches, get the first touch\n if (e.touches.length > 0) {\n const touchEvent = e.touches[0];\n // Check if the target of the touch event is the specified element\n if (!verifyTouchTarget(touchEvent, focusClass)) {\n // If not, return null\n return null;\n }\n // Get the value of the specified property from the touch event and return it\n return (touchEvent[prop] as number) || 0;\n }\n // If there are no touches, return null\n return null;\n }\n // If the event is not a touch event, get the value of the specified property from the event and return it\n return e[prop] || 0;\n}\n","import {\n DimensionIndexInput,\n DSourceState,\n getItemByIndex,\n getItemByPosition,\n getSourceItem,\n} from '@store';\nimport type {\n DimensionSettingsState,\n Cell,\n RangeArea,\n RangeAreaCss,\n DataLookup,\n DimensionRows,\n DataType,\n EditCellStore,\n} from '@type';\nimport { getPropertyFromEvent } from '../../utils/events';\nimport { Observable } from '../../utils/store.utils';\n\nexport type EventData = {\n el: HTMLElement;\n rows: DimensionSettingsState;\n cols: DimensionSettingsState;\n lastCell: Cell;\n focus: Cell | null;\n range: RangeArea | null;\n edit: EditCellStore | null;\n};\n\nexport function collectModelsOfRange(\n data: DataLookup,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n) {\n const models: Partial<DataLookup> = {};\n for (let i in data) {\n const rowIndex = parseInt(i, 10);\n models[rowIndex] = getSourceItem(store, rowIndex);\n }\n\n return models;\n}\n\nexport function getFocusCellBasedOnEvent(\n e: MouseEvent | TouchEvent,\n data: EventData,\n): Cell | null {\n // If event default is prevented, return\n if (e.defaultPrevented) {\n return null;\n }\n\n // Get coordinates from event object\n const x = getPropertyFromEvent(e, 'clientX');\n const y = getPropertyFromEvent(e, 'clientY');\n\n // If coordinates are not available, return\n if (x === null || y === null) {\n return null;\n }\n\n // Get current cell based on coordinates and data\n const focusCell = getCurrentCell({ x, y }, data);\n // If current cell is not available, return\n if (isAfterLast(focusCell, data.lastCell)) {\n return null;\n }\n\n return focusCell;\n}\n\n/**\n * Calculate cell based on x, y position\n */\nexport function getCurrentCell(\n { x, y }: Cell,\n { el, rows, cols }: Pick<EventData, 'el' | 'rows' | 'cols'>,\n): Cell {\n // Get the bounding rectangle of the element\n const { top, left, height, width } = el.getBoundingClientRect();\n\n // Calculate the cell position relative to the element\n let cellY = y - top;\n let cellX = x - left;\n\n // Limit the cell position to the element height\n if (cellY >= height) {\n cellY = height - 1;\n }\n\n // Limit the cell position to the element width\n if (cellX >= width) {\n cellX = width - 1;\n }\n\n // Get the row and column items based on the cell position\n const rgRow = getItemByPosition(rows, cellY);\n const rgCol = getItemByPosition(cols, cellX);\n\n // Set the row and column index to 0 if they are before the first item\n if (rgCol.itemIndex < 0) {\n rgCol.itemIndex = 0;\n }\n\n if (rgRow.itemIndex < 0) {\n rgRow.itemIndex = 0;\n }\n\n return { x: rgCol.itemIndex, y: rgRow.itemIndex };\n}\n\nexport function getCoordinate(\n range: RangeArea,\n focus: Cell,\n changes: Partial<Cell>,\n isMulti = false,\n) {\n const updateCoordinate = (c: keyof Cell, pos = 0) => {\n const start = { x: range.x, y: range.y };\n const end = isMulti ? { x: range.x1, y: range.y1 } : start;\n const point = end[c] > focus[c] ? end : start;\n point[c] += pos;\n return { start, end };\n };\n\n if (changes.x) {\n return updateCoordinate('x', changes['x']);\n }\n if (changes.y) {\n return updateCoordinate('y', changes['y']);\n }\n return null;\n}\n\n/**\n * Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position\n * or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position\n */\nexport function isAfterLast({ x, y }: Cell, lastCell: Cell) {\n return x >= lastCell.x || y >= lastCell.y;\n}\n\n/** check if out of range */\nexport function isBeforeFirst({ x, y }: Cell) {\n return x < 0 || y < 0;\n}\n\n/** Compare cells, only 1 coordinate difference is possible */\n// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// if (initial[k] !== last[k]) {\n// return { [k]: 1 };\n// }\n// }\n// return null;\n// }\n\n// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {\n// const cell: Partial<Cell> = {};\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// cell[k] = Math.abs(initial[k] - last[k]);\n// }\n// if (cell.x > cell.y) {\n// return { x: 1 };\n// }\n// if (cell.y > cell.x) {\n// return { y: 1 };\n// }\n// return null;\n// }\n\nexport function styleByCellProps(styles: { [key: string]: number }): RangeAreaCss {\n return {\n left: `${styles.left}px`,\n top: `${styles.top}px`,\n width: `${styles.width}px`,\n height: `${styles.height}px`,\n };\n}\n\nexport function getCell(\n { x, y, x1, y1 }: RangeArea,\n dimensionRow: Pick<\n DimensionIndexInput,\n 'indexToItem' | 'indexes' | 'originItemSize'\n >,\n dimensionCol: Pick<\n DimensionIndexInput,\n 'indexToItem' | 'indexes' | 'originItemSize'\n >,\n) {\n const top = getItemByIndex(dimensionRow, y).start;\n const left = getItemByIndex(dimensionCol, x).start;\n const bottom = getItemByIndex(dimensionRow, y1).end;\n const right = getItemByIndex(dimensionCol, x1).end;\n\n return {\n left,\n right,\n top,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n"],"version":3}
1
+ {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,CAAC,CAAC;AAC5C,CAAC;AAED;SACgB,aAAa,CAAC,EAAE,CAAC,EAAE,CAAC,EAAQ;IAC1C,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;SAEgB,gBAAgB,CAAC,MAAiC;IAChE,OAAO;QACL,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI;QACxB,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI;QACtB,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI;QAC1B,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,IAAI;KAC7B,CAAC;AACJ,CAAC;SAEe,OAAO,CACrB,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAa,EAC3B,YAGC,EACD,YAGC;IAED,MAAM,GAAG,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IAClD,MAAM,IAAI,GAAG,cAAc,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,MAAM,MAAM,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IACpD,MAAM,KAAK,GAAG,cAAc,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC;IAEnD,OAAO;QACL,IAAI;QACJ,KAAK;QACL,GAAG;QACH,MAAM;QACN,KAAK,EAAE,KAAK,GAAG,IAAI;QACnB,MAAM,EAAE,MAAM,GAAG,GAAG;KACrB,CAAC;AACJ;;;;","names":[],"sources":["src/utils/events.ts","src/components/overlay/selection.utils.ts"],"sourcesContent":["function isTouch(e: MouseEvent | TouchEvent): e is TouchEvent {\n return !!(e as TouchEvent).touches;\n}\n\nexport function verifyTouchTarget(touchEvent?: Touch, focusClass?: string) {\n if (focusClass && touchEvent) {\n if (!(touchEvent.target instanceof Element && touchEvent.target.classList.contains(focusClass))) { \n return false;\n }\n }\n return true;\n}\n\n\n/**\n * Function to get the value of a specific property from a MouseEvent or TouchEvent object.\n */\nexport function getPropertyFromEvent(\n e: MouseEvent | TouchEvent,\n prop: keyof Pick<Touch, 'clientX' | 'clientY' | 'screenX' | 'screenY'>,\n focusClass?: string // for touch events\n): number | null {\n // Check if the event is a touch event\n if (isTouch(e)) {\n // If the event has touches, get the first touch\n if (e.touches.length > 0) {\n const touchEvent = e.touches[0];\n // Check if the target of the touch event is the specified element\n if (!verifyTouchTarget(touchEvent, focusClass)) {\n // If not, return null\n return null;\n }\n // Get the value of the specified property from the touch event and return it\n return (touchEvent[prop] as number) || 0;\n }\n // If there are no touches, return null\n return null;\n }\n // If the event is not a touch event, get the value of the specified property from the event and return it\n return e[prop] || 0;\n}\n","import {\n DimensionIndexInput,\n DSourceState,\n getItemByIndex,\n getItemByPosition,\n getSourceItem,\n} from '@store';\nimport type {\n DimensionSettingsState,\n Cell,\n RangeArea,\n RangeAreaCss,\n DataLookup,\n DimensionRows,\n DataType,\n EditCellStore,\n} from '@type';\nimport { getPropertyFromEvent } from '../../utils/events';\nimport { Observable } from '../../utils';\n\nexport type EventData = {\n el: HTMLElement;\n rows: DimensionSettingsState;\n cols: DimensionSettingsState;\n lastCell: Cell;\n focus: Cell | null;\n range: RangeArea | null;\n edit: EditCellStore | null;\n};\n\nexport function collectModelsOfRange(\n data: DataLookup,\n store: Observable<DSourceState<DataType, DimensionRows>>,\n) {\n const models: Partial<DataLookup> = {};\n for (let i in data) {\n const rowIndex = parseInt(i, 10);\n models[rowIndex] = getSourceItem(store, rowIndex);\n }\n\n return models;\n}\n\nexport function getFocusCellBasedOnEvent(\n e: MouseEvent | TouchEvent,\n data: EventData,\n): Cell | null {\n // If event default is prevented, return\n if (e.defaultPrevented) {\n return null;\n }\n\n // Get coordinates from event object\n const x = getPropertyFromEvent(e, 'clientX');\n const y = getPropertyFromEvent(e, 'clientY');\n\n // If coordinates are not available, return\n if (x === null || y === null) {\n return null;\n }\n\n // Get current cell based on coordinates and data\n const focusCell = getCurrentCell({ x, y }, data);\n // If current cell is not available, return\n if (isAfterLast(focusCell, data.lastCell)) {\n return null;\n }\n\n return focusCell;\n}\n\n/**\n * Calculate cell based on x, y position\n */\nexport function getCurrentCell(\n { x, y }: Cell,\n { el, rows, cols }: Pick<EventData, 'el' | 'rows' | 'cols'>,\n): Cell {\n // Get the bounding rectangle of the element\n const { top, left, height, width } = el.getBoundingClientRect();\n\n // Calculate the cell position relative to the element\n let cellY = y - top;\n let cellX = x - left;\n\n // Limit the cell position to the element height\n if (cellY >= height) {\n cellY = height - 1;\n }\n\n // Limit the cell position to the element width\n if (cellX >= width) {\n cellX = width - 1;\n }\n\n // Get the row and column items based on the cell position\n const rgRow = getItemByPosition(rows, cellY);\n const rgCol = getItemByPosition(cols, cellX);\n\n // Set the row and column index to 0 if they are before the first item\n if (rgCol.itemIndex < 0) {\n rgCol.itemIndex = 0;\n }\n\n if (rgRow.itemIndex < 0) {\n rgRow.itemIndex = 0;\n }\n\n return { x: rgCol.itemIndex, y: rgRow.itemIndex };\n}\n\nexport function getCoordinate(\n range: RangeArea,\n focus: Cell,\n changes: Partial<Cell>,\n isMulti = false,\n) {\n const updateCoordinate = (c: keyof Cell, pos = 0) => {\n const start = { x: range.x, y: range.y };\n const end = isMulti ? { x: range.x1, y: range.y1 } : start;\n const point = end[c] > focus[c] ? end : start;\n point[c] += pos;\n return { start, end };\n };\n\n if (changes.x) {\n return updateCoordinate('x', changes['x']);\n }\n if (changes.y) {\n return updateCoordinate('y', changes['y']);\n }\n return null;\n}\n\n/**\n * Check if the x coordinate of the cell position is after or equal to the x coordinate of the last cell position\n * or if the y coordinate of the cell position is after or equal to the y coordinate of the last cell position\n */\nexport function isAfterLast({ x, y }: Cell, lastCell: Cell) {\n return x >= lastCell.x || y >= lastCell.y;\n}\n\n/** check if out of range */\nexport function isBeforeFirst({ x, y }: Cell) {\n return x < 0 || y < 0;\n}\n\n/** Compare cells, only 1 coordinate difference is possible */\n// export function getDirectionCoordinate(initial: Cell, last: Cell): Partial<Cell> | null {\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// if (initial[k] !== last[k]) {\n// return { [k]: 1 };\n// }\n// }\n// return null;\n// }\n\n// export function getLargestAxis(initial: Cell, last: Cell): Partial<Cell> | null {\n// const cell: Partial<Cell> = {};\n// const c: (keyof Cell)[] = ['x', 'y'];\n// for (let k of c) {\n// cell[k] = Math.abs(initial[k] - last[k]);\n// }\n// if (cell.x > cell.y) {\n// return { x: 1 };\n// }\n// if (cell.y > cell.x) {\n// return { y: 1 };\n// }\n// return null;\n// }\n\nexport function styleByCellProps(styles: { [key: string]: number }): RangeAreaCss {\n return {\n left: `${styles.left}px`,\n top: `${styles.top}px`,\n width: `${styles.width}px`,\n height: `${styles.height}px`,\n };\n}\n\nexport function getCell(\n { x, y, x1, y1 }: RangeArea,\n dimensionRow: Pick<\n DimensionIndexInput,\n 'indexToItem' | 'indexes' | 'originItemSize'\n >,\n dimensionCol: Pick<\n DimensionIndexInput,\n 'indexToItem' | 'indexes' | 'originItemSize'\n >,\n) {\n const top = getItemByIndex(dimensionRow, y).start;\n const left = getItemByIndex(dimensionCol, x).start;\n const bottom = getItemByIndex(dimensionRow, y1).end;\n const right = getItemByIndex(dimensionCol, x1).end;\n\n return {\n left,\n right,\n top,\n bottom,\n width: right - left,\n height: bottom - top,\n };\n}\n"],"version":3}
@@ -20,7 +20,7 @@ const VNodeToHtml = /*@__PURE__*/ proxyCustomElement(class VNodeToHtml extends H
20
20
  render() {
21
21
  var _a, _b;
22
22
  this.vnodes = (_b = (_a = this.redraw) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : null;
23
- return (h(Host, { key: '8d02c8cc7a2520cebce307c7f3e7e07107a0a494', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
23
+ return (h(Host, { key: '73a019dbc046a9d4504bc84a80868e8023d1f502', style: { visibility: 'hidden', position: 'absolute' } }, this.vnodes));
24
24
  }
25
25
  get el() { return this; }
26
26
  }, [0, "vnode-html", {
@@ -1 +1 @@
1
- {"file":"vnode-converter.js","mappings":";;;;;MAqBa,WAAW;;;;;QAKd,WAAM,GAAmB,EAAE,CAAC;sBAJiB,IAAI;;IAMzD,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;KACJ;IAED,MAAM;;QACJ,IAAI,CAAC,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,MAAM,oDAAI,mCAAI,IAAI,CAAC;QACtC,QACE,EAAC,IAAI,qDACH,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAEpD,IAAI,CAAC,MAAM,CACP,EACP;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/vnode/vnode-converter.tsx"],"sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n VNode,\n h,\n} from '@stencil/core';\n\n/**\n * VNode to html converter for stencil components.\n * Transform VNode to html string.\n */\n/**\n * @internal\n */\n@Component({\n tag: 'vnode-html',\n})\nexport class VNodeToHtml {\n @Prop() redraw: (() => VNode[]) | null | undefined = null;\n @Event() html: EventEmitter<{ html: string; vnodes: (VNode[]) | null }>;\n @Element() el: HTMLElement;\n\n private vnodes: VNode[] | null = [];\n\n componentDidRender() {\n this.html.emit({\n html: this.el.innerHTML,\n vnodes: this.vnodes,\n });\n }\n\n render() {\n this.vnodes = this.redraw?.() ?? null;\n return (\n <Host\n style={{ visibility: 'hidden', position: 'absolute' }}\n >\n {this.vnodes}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"vnode-converter.js","mappings":";;;;;MAqBa,WAAW;;;;;QAKd,WAAM,GAAmB,EAAE,CAAC;sBAJiB,IAAI;;IAMzD,kBAAkB;QAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACb,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,SAAS;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAC;KACJ;IAED,MAAM;;QACJ,IAAI,CAAC,MAAM,GAAG,MAAA,MAAA,IAAI,CAAC,MAAM,oDAAI,mCAAI,IAAI,CAAC;QACtC,QACE,EAAC,IAAI,qDACH,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAEpD,IAAI,CAAC,MAAM,CACP,EACP;KACH;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/vnode/vnode-converter.tsx"],"sourcesContent":["import {\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Prop,\n type VNode,\n h,\n} from '@stencil/core';\n\n/**\n * VNode to html converter for stencil components.\n * Transform VNode to html string.\n */\n/**\n * @internal\n */\n@Component({\n tag: 'vnode-html',\n})\nexport class VNodeToHtml {\n @Prop() redraw: (() => VNode[]) | null | undefined = null;\n @Event() html: EventEmitter<{ html: string; vnodes: (VNode[]) | null }>;\n @Element() el: HTMLElement;\n\n private vnodes: VNode[] | null = [];\n\n componentDidRender() {\n this.html.emit({\n html: this.el.innerHTML,\n vnodes: this.vnodes,\n });\n }\n\n render() {\n this.vnodes = this.redraw?.() ?? null;\n return (\n <Host\n style={{ visibility: 'hidden', position: 'absolute' }}\n >\n {this.vnodes}\n </Host>\n );\n }\n}\n"],"version":3}