@1771technologies/lytenyte-pro 2.0.0-dev.0 → 2.0.0-dev.2

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 (423) hide show
  1. package/dist/__play__/alpha.play.d.ts +3 -0
  2. package/dist/__play__/alpha.play.js +56 -0
  3. package/dist/__play__/basic-server-data/data.d.ts +10 -0
  4. package/dist/__play__/basic-server-data/data.js +17746 -0
  5. package/dist/__play__/basic-server-data/server.d.ts +36 -0
  6. package/dist/__play__/basic-server-data/server.js +105 -0
  7. package/dist/__play__/buttons.play.d.ts +4 -0
  8. package/dist/__play__/buttons.play.js +7 -0
  9. package/dist/__play__/inputs.play.d.ts +3 -0
  10. package/dist/__play__/inputs.play.js +13 -0
  11. package/dist/__play__/server.play.d.ts +3 -0
  12. package/dist/__play__/server.play.js +66 -0
  13. package/dist/__play__/tree.play.d.ts +3 -0
  14. package/dist/__play__/tree.play.js +47 -0
  15. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
  16. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
  17. package/dist/cell-selection/are-rects-equal.d.ts +2 -0
  18. package/dist/cell-selection/are-rects-equal.js +6 -0
  19. package/dist/cell-selection/bound-selection-rect.d.ts +3 -0
  20. package/dist/cell-selection/bound-selection-rect.js +16 -0
  21. package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
  22. package/dist/cell-selection/cell-selection-containers.js +86 -0
  23. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
  24. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
  25. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
  26. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
  27. package/dist/cell-selection/cell-style-row.d.ts +8 -0
  28. package/dist/cell-selection/cell-style-row.js +79 -0
  29. package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
  30. package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
  31. package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
  32. package/dist/cell-selection/deselect-rect-range.js +43 -0
  33. package/dist/cell-selection/expand-selection-down.d.ts +3 -0
  34. package/dist/cell-selection/expand-selection-down.js +78 -0
  35. package/dist/cell-selection/expand-selection-end.d.ts +3 -0
  36. package/dist/cell-selection/expand-selection-end.js +76 -0
  37. package/dist/cell-selection/expand-selection-start.d.ts +3 -0
  38. package/dist/cell-selection/expand-selection-start.js +73 -0
  39. package/dist/cell-selection/expand-selection-up.d.ts +3 -0
  40. package/dist/cell-selection/expand-selection-up.js +74 -0
  41. package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
  42. package/dist/cell-selection/full-width-start-end-index.js +4 -0
  43. package/dist/cell-selection/get-root-cell.d.ts +3 -0
  44. package/dist/cell-selection/get-root-cell.js +6 -0
  45. package/dist/cell-selection/index.d.ts +13 -0
  46. package/dist/cell-selection/index.js +13 -0
  47. package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
  48. package/dist/cell-selection/is-bottom-rect.js +4 -0
  49. package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
  50. package/dist/cell-selection/is-center-col-rect.js +3 -0
  51. package/dist/cell-selection/is-center-rect.d.ts +2 -0
  52. package/dist/cell-selection/is-center-rect.js +4 -0
  53. package/dist/cell-selection/is-end-rect.d.ts +5 -0
  54. package/dist/cell-selection/is-end-rect.js +3 -0
  55. package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
  56. package/dist/cell-selection/is-fully-within-rect.js +6 -0
  57. package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
  58. package/dist/cell-selection/is-overlapping-rect.js +5 -0
  59. package/dist/cell-selection/is-start-rect.d.ts +5 -0
  60. package/dist/cell-selection/is-start-rect.js +3 -0
  61. package/dist/cell-selection/is-top-rect.d.ts +2 -0
  62. package/dist/cell-selection/is-top-rect.js +3 -0
  63. package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
  64. package/dist/cell-selection/is-within-selection-rect.js +3 -0
  65. package/dist/cell-selection/split-cell-selection-rect.d.ts +47 -0
  66. package/dist/cell-selection/split-cell-selection-rect.js +88 -0
  67. package/dist/cell-selection/split-on-pivot.d.ts +3 -0
  68. package/dist/cell-selection/split-on-pivot.js +50 -0
  69. package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
  70. package/dist/cell-selection/update-additive-cell-selection.js +21 -0
  71. package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
  72. package/dist/cell-selection/use-edge-scroll.js +71 -0
  73. package/dist/components/checkbox/checkbox.d.ts +15 -0
  74. package/dist/components/checkbox/checkbox.js +42 -0
  75. package/dist/components/checkbox/checkbox.play.d.ts +2 -0
  76. package/dist/components/checkbox/checkbox.play.js +6 -0
  77. package/dist/components/column-manager/column-manager.d.ts +13 -0
  78. package/dist/components/column-manager/column-manager.js +47 -0
  79. package/dist/components/external/clsx.d.ts +2 -0
  80. package/dist/components/external/clsx.js +44 -0
  81. package/dist/components/external/floating-ui.d.ts +268 -0
  82. package/dist/components/external/floating-ui.js +1802 -0
  83. package/dist/components/headless/dialog/arrow.d.ts +6 -0
  84. package/dist/components/headless/dialog/arrow.js +16 -0
  85. package/dist/components/headless/dialog/close.d.ts +10 -0
  86. package/dist/components/headless/dialog/close.js +22 -0
  87. package/dist/components/headless/dialog/container.d.ts +5 -0
  88. package/dist/components/headless/dialog/container.js +221 -0
  89. package/dist/components/headless/dialog/context.d.ts +32 -0
  90. package/dist/components/headless/dialog/context.js +3 -0
  91. package/dist/components/headless/dialog/description.d.ts +9 -0
  92. package/dist/components/headless/dialog/description.js +20 -0
  93. package/dist/components/headless/dialog/index.parts.d.ts +30 -0
  94. package/dist/components/headless/dialog/index.parts.js +17 -0
  95. package/dist/components/headless/dialog/root.d.ts +32 -0
  96. package/dist/components/headless/dialog/root.js +75 -0
  97. package/dist/components/headless/dialog/title.d.ts +9 -0
  98. package/dist/components/headless/dialog/title.js +20 -0
  99. package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
  100. package/dist/components/headless/dialog/transform-origin.js +38 -0
  101. package/dist/components/headless/dialog/trigger.d.ts +10 -0
  102. package/dist/components/headless/dialog/trigger.js +24 -0
  103. package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
  104. package/dist/components/headless/dialog/use-dialog.js +12 -0
  105. package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
  106. package/dist/components/headless/menu/checkbox-item.js +42 -0
  107. package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
  108. package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
  109. package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
  110. package/dist/components/headless/menu/combo/combo-context.js +3 -0
  111. package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
  112. package/dist/components/headless/menu/combo/combo-input.js +58 -0
  113. package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
  114. package/dist/components/headless/menu/combo/combo-menu.js +24 -0
  115. package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
  116. package/dist/components/headless/menu/combo/combo-option.js +37 -0
  117. package/dist/components/headless/menu/container.d.ts +5 -0
  118. package/dist/components/headless/menu/container.js +19 -0
  119. package/dist/components/headless/menu/dom.d.ts +4 -0
  120. package/dist/components/headless/menu/dom.js +20 -0
  121. package/dist/components/headless/menu/index.d.ts +54 -0
  122. package/dist/components/headless/menu/index.js +39 -0
  123. package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
  124. package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
  125. package/dist/components/headless/menu/item/item.d.ts +9 -0
  126. package/dist/components/headless/menu/item/item.js +45 -0
  127. package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
  128. package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
  129. package/dist/components/headless/menu/menu-divider.d.ts +5 -0
  130. package/dist/components/headless/menu/menu-divider.js +6 -0
  131. package/dist/components/headless/menu/menu-group.d.ts +5 -0
  132. package/dist/components/headless/menu/menu-group.js +6 -0
  133. package/dist/components/headless/menu/menu-header.d.ts +5 -0
  134. package/dist/components/headless/menu/menu-header.js +6 -0
  135. package/dist/components/headless/menu/popover.d.ts +5 -0
  136. package/dist/components/headless/menu/popover.js +7 -0
  137. package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
  138. package/dist/components/headless/menu/radio-group/context.js +7 -0
  139. package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
  140. package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
  141. package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
  142. package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
  143. package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
  144. package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
  145. package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
  146. package/dist/components/headless/menu/submenu/submenu.js +55 -0
  147. package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
  148. package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
  149. package/dist/components/headless/menu/use-menu.d.ts +1 -0
  150. package/dist/components/headless/menu/use-menu.js +52 -0
  151. package/dist/components/headless/popover/container.d.ts +5 -0
  152. package/dist/components/headless/popover/container.js +7 -0
  153. package/dist/components/headless/popover/context.d.ts +6 -0
  154. package/dist/components/headless/popover/context.js +3 -0
  155. package/dist/components/headless/popover/index.d.ts +30 -0
  156. package/dist/components/headless/popover/index.js +17 -0
  157. package/dist/components/headless/popover/root.d.ts +6 -0
  158. package/dist/components/headless/popover/root.js +8 -0
  159. package/dist/components/headless/popover/trigger.d.ts +7 -0
  160. package/dist/components/headless/popover/trigger.js +11 -0
  161. package/dist/components/pill-manager/container.d.ts +5 -0
  162. package/dist/components/pill-manager/container.js +127 -0
  163. package/dist/components/pill-manager/expander.d.ts +9 -0
  164. package/dist/components/pill-manager/expander.js +21 -0
  165. package/dist/components/pill-manager/icons.d.ts +12 -0
  166. package/dist/components/pill-manager/icons.js +35 -0
  167. package/dist/components/pill-manager/index.d.ts +33 -0
  168. package/dist/components/pill-manager/index.js +13 -0
  169. package/dist/components/pill-manager/item.d.ts +10 -0
  170. package/dist/components/pill-manager/item.js +178 -0
  171. package/dist/components/pill-manager/label.d.ts +10 -0
  172. package/dist/components/pill-manager/label.js +31 -0
  173. package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
  174. package/dist/components/pill-manager/pill-manager.play.js +73 -0
  175. package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
  176. package/dist/components/pill-manager/pill-row.context.js +4 -0
  177. package/dist/components/pill-manager/pill-row.d.ts +12 -0
  178. package/dist/components/pill-manager/pill-row.js +22 -0
  179. package/dist/components/pill-manager/root.context.d.ts +40 -0
  180. package/dist/components/pill-manager/root.context.js +4 -0
  181. package/dist/components/pill-manager/root.d.ts +25 -0
  182. package/dist/components/pill-manager/root.js +33 -0
  183. package/dist/components/pill-manager/row-default.d.ts +3 -0
  184. package/dist/components/pill-manager/row-default.js +14 -0
  185. package/dist/components/pill-manager/types.d.ts +21 -0
  186. package/dist/components/pill-manager/types.js +1 -0
  187. package/dist/components/row-group-cell.d.ts +13 -0
  188. package/dist/components/row-group-cell.js +40 -0
  189. package/dist/components/select-all.d.ts +12 -0
  190. package/dist/components/select-all.js +34 -0
  191. package/dist/components/smart-select/chip-context.d.ts +8 -0
  192. package/dist/components/smart-select/chip-context.js +4 -0
  193. package/dist/components/smart-select/chip-remove.d.ts +1 -0
  194. package/dist/components/smart-select/chip-remove.js +13 -0
  195. package/dist/components/smart-select/chip.d.ts +13 -0
  196. package/dist/components/smart-select/chip.js +79 -0
  197. package/dist/components/smart-select/container.d.ts +1 -0
  198. package/dist/components/smart-select/container.js +13 -0
  199. package/dist/components/smart-select/context.d.ts +31 -0
  200. package/dist/components/smart-select/context.js +4 -0
  201. package/dist/components/smart-select/index.d.ts +30 -0
  202. package/dist/components/smart-select/index.js +19 -0
  203. package/dist/components/smart-select/option.d.ts +8 -0
  204. package/dist/components/smart-select/option.js +36 -0
  205. package/dist/components/smart-select/root.d.ts +17 -0
  206. package/dist/components/smart-select/root.js +165 -0
  207. package/dist/components/smart-select/smart-select.play.d.ts +2 -0
  208. package/dist/components/smart-select/smart-select.play.js +36 -0
  209. package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
  210. package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
  211. package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
  212. package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
  213. package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
  214. package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
  215. package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
  216. package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
  217. package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
  218. package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
  219. package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
  220. package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
  221. package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
  222. package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
  223. package/dist/components/smart-select/type.d.ts +44 -0
  224. package/dist/components/smart-select/type.js +1 -0
  225. package/dist/components/smart-select/use-async-options.d.ts +8 -0
  226. package/dist/components/smart-select/use-async-options.js +42 -0
  227. package/dist/components/tree-view/index.d.ts +4 -0
  228. package/dist/components/tree-view/index.js +2 -0
  229. package/dist/components/tree-view/root.d.ts +37 -0
  230. package/dist/components/tree-view/root.js +139 -0
  231. package/dist/components/tree-view/select-all.d.ts +7 -0
  232. package/dist/components/tree-view/select-all.js +22 -0
  233. package/dist/components/tree-view/tree-children.d.ts +2 -0
  234. package/dist/components/tree-view/tree-children.js +15 -0
  235. package/dist/components/tree-view/types.d.ts +31 -0
  236. package/dist/components/tree-view/types.js +1 -0
  237. package/dist/components/types.d.ts +4 -0
  238. package/dist/components/types.js +1 -0
  239. package/dist/components/virtual-from-coordinates.d.ts +2 -0
  240. package/dist/components/virtual-from-coordinates.js +15 -0
  241. package/dist/components.d.ts +16 -0
  242. package/dist/components.js +11 -0
  243. package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
  244. package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
  245. package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
  246. package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
  247. package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
  248. package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
  249. package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
  250. package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
  251. package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
  252. package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
  253. package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
  254. package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
  255. package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
  256. package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
  257. package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
  258. package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
  259. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
  260. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
  261. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
  262. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
  263. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
  264. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
  265. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
  266. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
  267. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
  268. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
  269. package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
  270. package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
  271. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
  272. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
  273. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
  274. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
  275. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
  276. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
  277. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
  278. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
  279. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
  280. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
  281. package/dist/data-source-client/use-client-data-source.d.ts +91 -0
  282. package/dist/data-source-client/use-client-data-source.js +169 -0
  283. package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
  284. package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
  285. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
  286. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
  287. package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
  288. package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
  289. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
  290. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
  291. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
  292. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
  293. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
  294. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
  295. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
  296. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
  297. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
  298. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
  299. package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
  300. package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
  301. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
  302. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
  303. package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
  304. package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
  305. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
  306. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
  307. package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
  308. package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
  309. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
  310. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
  311. package/dist/data-source-server/async-tree/types.d.ts +70 -0
  312. package/dist/data-source-server/async-tree/types.js +1 -0
  313. package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
  314. package/dist/data-source-server/range-tree/range-tree.js +102 -0
  315. package/dist/data-source-server/server-data.d.ts +73 -0
  316. package/dist/data-source-server/server-data.js +553 -0
  317. package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
  318. package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
  319. package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
  320. package/dist/data-source-server/source/use-on-view-change.js +13 -0
  321. package/dist/data-source-server/source/use-row-add.d.ts +3 -0
  322. package/dist/data-source-server/source/use-row-add.js +36 -0
  323. package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
  324. package/dist/data-source-server/source/use-row-by-id.js +8 -0
  325. package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
  326. package/dist/data-source-server/source/use-row-by-index.js +89 -0
  327. package/dist/data-source-server/source/use-row-children.d.ts +2 -0
  328. package/dist/data-source-server/source/use-row-children.js +16 -0
  329. package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
  330. package/dist/data-source-server/source/use-row-delete.js +39 -0
  331. package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
  332. package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
  333. package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
  334. package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
  335. package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
  336. package/dist/data-source-server/source/use-row-leafs.js +20 -0
  337. package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
  338. package/dist/data-source-server/source/use-row-parents.js +16 -0
  339. package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
  340. package/dist/data-source-server/source/use-row-siblings.js +15 -0
  341. package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
  342. package/dist/data-source-server/source/use-rows-between.js +20 -0
  343. package/dist/data-source-server/source/use-source-state.d.ts +28 -0
  344. package/dist/data-source-server/source/use-source-state.js +47 -0
  345. package/dist/data-source-server/source/use-source.d.ts +5 -0
  346. package/dist/data-source-server/source/use-source.js +66 -0
  347. package/dist/data-source-server/types.d.ts +42 -0
  348. package/dist/data-source-server/types.js +1 -0
  349. package/dist/data-source-server/use-server-data-source.d.ts +51 -0
  350. package/dist/data-source-server/use-server-data-source.js +192 -0
  351. package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
  352. package/dist/data-source-server/utils/get-node-depth.js +9 -0
  353. package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
  354. package/dist/data-source-server/utils/get-node-path.js +9 -0
  355. package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
  356. package/dist/data-source-server/utils/get-request-id.js +6 -0
  357. package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
  358. package/dist/data-source-tree/source/use-controlled-state.js +21 -0
  359. package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
  360. package/dist/data-source-tree/source/use-flattened.js +65 -0
  361. package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
  362. package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
  363. package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
  364. package/dist/data-source-tree/source/use-row-by-id.js +7 -0
  365. package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
  366. package/dist/data-source-tree/source/use-row-children.js +11 -0
  367. package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
  368. package/dist/data-source-tree/source/use-row-leafs.js +20 -0
  369. package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
  370. package/dist/data-source-tree/source/use-row-parents.js +16 -0
  371. package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
  372. package/dist/data-source-tree/source/use-row-siblings.js +12 -0
  373. package/dist/data-source-tree/source/use-tree.d.ts +3 -0
  374. package/dist/data-source-tree/source/use-tree.js +59 -0
  375. package/dist/data-source-tree/types.d.ts +16 -0
  376. package/dist/data-source-tree/types.js +1 -0
  377. package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
  378. package/dist/data-source-tree/use-tree-data-source.js +101 -0
  379. package/dist/data-source-tree/utils/is-object.d.ts +1 -0
  380. package/dist/data-source-tree/utils/is-object.js +3 -0
  381. package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
  382. package/dist/hooks/use-slot/get-element-ref.js +20 -0
  383. package/dist/hooks/use-slot/index.d.ts +3 -0
  384. package/dist/hooks/use-slot/index.js +1 -0
  385. package/dist/hooks/use-slot/merge-props.d.ts +4 -0
  386. package/dist/hooks/use-slot/merge-props.js +27 -0
  387. package/dist/hooks/use-slot/react-version.d.ts +3 -0
  388. package/dist/hooks/use-slot/react-version.js +5 -0
  389. package/dist/hooks/use-slot/types.d.ts +4 -0
  390. package/dist/hooks/use-slot/types.js +1 -0
  391. package/dist/hooks/use-slot/use-slot.d.ts +12 -0
  392. package/dist/hooks/use-slot/use-slot.js +28 -0
  393. package/dist/hooks/use-transitioned-open.d.ts +2 -0
  394. package/dist/hooks/use-transitioned-open.js +50 -0
  395. package/dist/index.d.ts +121 -0
  396. package/dist/index.js +23 -0
  397. package/dist/license/index.d.ts +1 -0
  398. package/dist/license/index.js +1 -0
  399. package/dist/license/license.d.ts +3 -0
  400. package/dist/license/license.js +215 -0
  401. package/dist/license/md5-hash.d.ts +9 -0
  402. package/dist/license/md5-hash.js +167 -0
  403. package/dist/license.d.ts +3 -0
  404. package/dist/license.js +214 -0
  405. package/dist/root/context.d.ts +16 -0
  406. package/dist/root/context.js +4 -0
  407. package/dist/root/hooks/use-pro-api.d.ts +2 -0
  408. package/dist/root/hooks/use-pro-api.js +8 -0
  409. package/dist/root/root.d.ts +15 -0
  410. package/dist/root/root.js +112 -0
  411. package/dist/types/api.d.ts +100 -0
  412. package/dist/types/api.js +1 -0
  413. package/dist/types/column.d.ts +73 -0
  414. package/dist/types/column.js +1 -0
  415. package/dist/types/events.d.ts +56 -0
  416. package/dist/types/events.js +1 -0
  417. package/dist/types/grid.d.ts +47 -0
  418. package/dist/types/grid.js +1 -0
  419. package/dist/types/index.d.ts +7 -0
  420. package/dist/types/index.js +1 -0
  421. package/dist/types/props.d.ts +187 -0
  422. package/dist/types/props.js +1 -0
  423. package/package.json +5 -5
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { useEvent } from "@1771technologies/lytenyte-core/internal";
4
+ import { Checkbox } from "../checkbox/checkbox.js";
5
+ export function SelectAll({ api, render, }) {
6
+ const s = api.useSelectionState();
7
+ const selected = useMemo(() => {
8
+ const selected = s.selected && s.children.size === 0;
9
+ return selected;
10
+ }, [s]);
11
+ const indeterminate = useMemo(() => {
12
+ return Boolean(s.children.size);
13
+ }, [s]);
14
+ const toggle = useEvent((b) => {
15
+ if (b != null)
16
+ return api.rowSelect({ selected: "all", deselect: !b });
17
+ api.rowSelect({ selected: "all", deselect: selected });
18
+ });
19
+ if (render)
20
+ return render({ indeterminate, selected, toggle });
21
+ return (_jsxs("div", { "data-ln-tree-view-cell": "leaf", style: { "--ln-row-depth": 0 }, children: [_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: () => toggle() }), "Select All"] }));
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { TreeViewChildParams, TreeViewItem } from "./types";
2
+ export declare function TreeChildren<T extends TreeViewItem>({ row, toggle, selectEnabled: selection, indeterminate, selected, handleSelect, dragProps, isOver, isBefore, }: TreeViewChildParams<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Checkbox } from "../checkbox/checkbox.js";
3
+ export function TreeChildren({ row, toggle, selectEnabled: selection, indeterminate, selected, handleSelect, dragProps, isOver, isBefore, }) {
4
+ const depth = row.depth;
5
+ const draggable = !!dragProps.draggable;
6
+ if (row.kind === "branch")
7
+ return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-view-cell-expanded": row.kind === "branch" && row.expanded, "data-ln-tree-view-cell-expandable": row.kind === "branch" ? row.expandable : undefined, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [row.kind === "branch" && row.expandable && (_jsx("button", { "data-ln-tree-view-cell-expander": true, "aria-label": "toggle the row group expansion state", onClick: () => toggle(), children: !row.loadingGroup && _jsx(CaretRight, {}) })), draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), selection && (_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: (e) => handleSelect({ target: e.target, shiftKey: e.shiftKey }) })), _jsx("div", { children: row.key })] }));
8
+ return (_jsxs("div", { "data-ln-tree-view-cell": row.kind, "data-ln-tree-over": isOver, "data-ln-tree-before": isBefore, style: { "--ln-row-depth": depth }, ...dragProps, children: [draggable && (_jsx("div", { children: _jsx(DragDots, {}) })), selection && (_jsx(Checkbox, { checked: selected, indeterminate: indeterminate, onClick: (e) => handleSelect({ target: e.target, shiftKey: e.shiftKey }) })), row.data.name ?? row.data.id] }));
9
+ }
10
+ function CaretRight() {
11
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentcolor", viewBox: "0 0 256 256", children: _jsx("path", { d: "M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z" }) }));
12
+ }
13
+ function DragDots() {
14
+ return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "currentcolor", viewBox: "0 0 256 256", children: _jsx("path", { d: "M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z" }) }));
15
+ }
@@ -0,0 +1,31 @@
1
+ import type { RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
2
+ import type { DragEvent } from "react";
3
+ export interface TreeViewItem {
4
+ readonly id: string;
5
+ readonly path: string[];
6
+ readonly name?: string;
7
+ }
8
+ export interface TreeViewChildParams<T extends TreeViewItem> {
9
+ readonly row: RowGroup | RowLeaf<T>;
10
+ readonly leafs: () => T[];
11
+ readonly toggle: (b?: boolean) => void;
12
+ readonly selected: boolean;
13
+ readonly indeterminate: boolean;
14
+ readonly selectEnabled: boolean;
15
+ readonly select: (b?: boolean) => void;
16
+ readonly handleSelect: (params: {
17
+ readonly target: EventTarget;
18
+ readonly shiftKey: boolean;
19
+ }) => void;
20
+ readonly dragProps: {
21
+ draggable?: boolean;
22
+ onDragStart?: (ev: DragEvent) => void;
23
+ };
24
+ readonly isOver: boolean;
25
+ readonly isBefore: boolean;
26
+ }
27
+ export interface TreeViewSelectAllParams {
28
+ readonly selected: boolean;
29
+ readonly indeterminate: boolean;
30
+ readonly toggle: (b?: boolean) => void;
31
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ import type { SlotComponent } from "../hooks/use-slot/types";
2
+ export type LnComponent<Props, State> = Props & {
3
+ render?: SlotComponent<State>;
4
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { VirtualTarget } from "../types";
2
+ export declare function virtualFromXY(x: number, y: number, context?: HTMLElement): VirtualTarget;
@@ -0,0 +1,15 @@
1
+ export function virtualFromXY(x, y, context) {
2
+ return {
3
+ contextElement: context,
4
+ getBoundingClientRect: () => ({
5
+ bottom: y,
6
+ left: x,
7
+ height: 0,
8
+ right: x,
9
+ top: y,
10
+ width: 0,
11
+ x,
12
+ y,
13
+ }),
14
+ };
15
+ }
@@ -0,0 +1,16 @@
1
+ export type { ViewportShadowsProps } from "@1771technologies/lytenyte-core/components";
2
+ export { ViewportShadows } from "@1771technologies/lytenyte-core/components";
3
+ export { RowGroupCell } from "./components/row-group-cell.js";
4
+ export type { SelectAllProps } from "./components/select-all.js";
5
+ export { SelectAll } from "./components/select-all.js";
6
+ export { PillManager } from "./components/pill-manager/index.js";
7
+ export { Dialog } from "./components/headless/dialog/index.parts.js";
8
+ export { Menu } from "./components/headless/menu/index.js";
9
+ export { Popover } from "./components/headless/popover/index.js";
10
+ export { SmartSelect } from "./components/smart-select/index.js";
11
+ export type { TreeViewItem, TreeViewProps, TreeViewChildParams, TreeViewSelectAllParams, } from "./components/tree-view/index.js";
12
+ export type { TreeViewApi } from "./components/tree-view/index.js";
13
+ export { TreeView, TreeChildren } from "./components/tree-view/index.js";
14
+ export type { ColumnManagerProps } from "./components/column-manager/column-manager.js";
15
+ export { ColumnManager } from "./components/column-manager/column-manager.js";
16
+ export { Checkbox } from "./components/checkbox/checkbox.js";
@@ -0,0 +1,11 @@
1
+ export { ViewportShadows } from "@1771technologies/lytenyte-core/components";
2
+ export { RowGroupCell } from "./components/row-group-cell.js";
3
+ export { SelectAll } from "./components/select-all.js";
4
+ export { PillManager } from "./components/pill-manager/index.js";
5
+ export { Dialog } from "./components/headless/dialog/index.parts.js";
6
+ export { Menu } from "./components/headless/menu/index.js";
7
+ export { Popover } from "./components/headless/popover/index.js";
8
+ export { SmartSelect } from "./components/smart-select/index.js";
9
+ export { TreeView, TreeChildren } from "./components/tree-view/index.js";
10
+ export { ColumnManager } from "./components/column-manager/column-manager.js";
11
+ export { Checkbox } from "./components/checkbox/checkbox.js";
@@ -0,0 +1,3 @@
1
+ import type { RowLeaf } from "@1771technologies/lytenyte-shared";
2
+ import type { GroupNode } from "./use-group-tree/use-group-tree";
3
+ export declare function getValidLeafs<T>(node: GroupNode<T>, leafs: RowLeaf<T>[], workingSet: number[]): RowLeaf<any>[];
@@ -0,0 +1,11 @@
1
+ export function getValidLeafs(node, leafs, workingSet) {
2
+ const rows = [];
3
+ for (let i = 0; i < node.leafs.length; i++) {
4
+ const x = node.leafs[i];
5
+ const workingIndex = workingSet[x];
6
+ const row = leafs[workingIndex];
7
+ if (node.leafIds.has(row.id))
8
+ rows.push(row);
9
+ }
10
+ return rows;
11
+ }
@@ -0,0 +1,13 @@
1
+ import type { UseClientDataSourceParams } from "../use-client-data-source.js";
2
+ import type { ControlledPivotState } from "./use-pivot/use-pivot-state.js";
3
+ export type SourceState = ReturnType<typeof useSourceState>;
4
+ export declare function useSourceState({ onRowGroupExpansionChange, rowGroupExpansions, rowGroupDefaultExpansion, }: UseClientDataSourceParams<any>, controlled: ControlledPivotState): {
5
+ expansions: {
6
+ [rowId: string]: boolean | undefined;
7
+ };
8
+ onExpansionsChange: (delta: Record<string, boolean | undefined>) => void;
9
+ expandedFn: (id: string, depth: number) => boolean;
10
+ pivotExpandedFn: (id: string, depth: number) => boolean;
11
+ pivotRowGroupExpansions: Record<string, boolean | undefined>;
12
+ onPivotExpansionsChange: (delta: Record<string, boolean | undefined>) => void;
13
+ };
@@ -0,0 +1,39 @@
1
+ import { useCallback } from "react";
2
+ import { useControlled, useEvent } from "@1771technologies/lytenyte-core/internal";
3
+ export function useSourceState({ onRowGroupExpansionChange, rowGroupExpansions, rowGroupDefaultExpansion = false, }, controlled) {
4
+ const [expansions, setExpansions] = useControlled({
5
+ controlled: rowGroupExpansions,
6
+ default: {},
7
+ });
8
+ const onExpansionsChange = useEvent((delta) => {
9
+ setExpansions({ ...expansions, ...delta });
10
+ onRowGroupExpansionChange?.({ ...expansions, ...delta });
11
+ });
12
+ const expandedFn = useCallback((id, depth) => {
13
+ const s = expansions[id];
14
+ if (s != null)
15
+ return s;
16
+ if (typeof rowGroupDefaultExpansion === "boolean")
17
+ return rowGroupDefaultExpansion;
18
+ return depth <= rowGroupDefaultExpansion;
19
+ }, [expansions, rowGroupDefaultExpansion]);
20
+ const onPivotExpansionsChange = useEvent((delta) => {
21
+ controlled.onPivotRowGroupChange({ ...controlled.pivotRowGroupExpansions, ...delta });
22
+ });
23
+ const pivotExpandedFn = useCallback((id, depth) => {
24
+ const s = controlled.pivotRowGroupExpansions[id];
25
+ if (s != null)
26
+ return s;
27
+ if (typeof rowGroupDefaultExpansion === "boolean")
28
+ return rowGroupDefaultExpansion;
29
+ return rowGroupDefaultExpansion >= depth;
30
+ }, [controlled.pivotRowGroupExpansions, rowGroupDefaultExpansion]);
31
+ return {
32
+ expansions,
33
+ onExpansionsChange,
34
+ expandedFn,
35
+ pivotExpandedFn,
36
+ pivotRowGroupExpansions: controlled.pivotRowGroupExpansions,
37
+ onPivotExpansionsChange,
38
+ };
39
+ }
@@ -0,0 +1,18 @@
1
+ import type { GridSpec } from "../../types/grid.js";
2
+ import type { UseClientDataSourceParams } from "../use-client-data-source.js";
3
+ import type { SourceState } from "./use-controlled-ds-state.js";
4
+ import { type LeafNodeTuple } from "@1771technologies/lytenyte-core/internal";
5
+ export declare function useFlattenedData<Spec extends GridSpec>(props: UseClientDataSourceParams<Spec>, [leafsTop, leafs, leafsBot, pinMap]: LeafNodeTuple<Spec["data"]>, { expandedFn }: SourceState): {
6
+ tree: import("./use-group-tree/use-group-tree.js").RootNode<Spec["data"]> | null;
7
+ maxDepth: number;
8
+ flatten: import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>[];
9
+ rowByIdRef: import("react").RefObject<Map<string, import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>>>;
10
+ rowByIndexRef: import("react").RefObject<Map<number, import("@1771technologies/lytenyte-shared").RowNode<Spec["data"]>>>;
11
+ rowIdToRowIndexRef: import("react").RefObject<Map<string, number>>;
12
+ leafIdsRef: import("react").RefObject<Map<string, import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>>>;
13
+ leafsTop: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
14
+ leafs: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
15
+ leafsBot: import("@1771technologies/lytenyte-shared").RowLeaf<Spec["data"]>[];
16
+ sorted: number[];
17
+ groupFn: import("@1771technologies/lytenyte-shared").GroupFn<Spec["data"]> | null;
18
+ };
@@ -0,0 +1,40 @@
1
+ import { useGroupTree } from "./use-group-tree/use-group-tree.js";
2
+ import { useFlattenedGroups } from "./use-flattened-groups.js";
3
+ import { useFlattenedPiece } from "./use-flattened-piece.js";
4
+ import { useAggregationFn, useFiltered, useFilterFn, useGroupFn, useSorted, useSortFn, } from "@1771technologies/lytenyte-core/internal";
5
+ import { useMemo, useRef } from "react";
6
+ const groupIdFallback = (p) => p.map((x) => (x == null ? "_null_" : x)).join("->");
7
+ export function useFlattenedData(props, [leafsTop, leafs, leafsBot, pinMap], { expandedFn }) {
8
+ const filterFn = useFilterFn(props.filter);
9
+ const sortFn = useSortFn(props.sort);
10
+ const groupFn = useGroupFn(props.group);
11
+ const aggFn = useAggregationFn(props.aggregate, props.aggregateFns);
12
+ const filtered = useFiltered(leafs, filterFn);
13
+ const [sorted, centerMap] = useSorted(leafs, sortFn, filtered);
14
+ const leafIds = useMemo(() => new Map([...centerMap, ...pinMap]), [centerMap, pinMap]);
15
+ const leafIdsRef = useRef(leafIds);
16
+ leafIdsRef.current = leafIds;
17
+ const tree = useGroupTree(leafs, sorted, groupFn, props.groupIdFn ?? groupIdFallback, props.rowGroupCollapseBehavior ?? "no-collapse", props.labelFilter, props.having, aggFn);
18
+ const [groupFlat, maxDepth] = useFlattenedGroups(tree, aggFn, leafs, sorted, sortFn, expandedFn, props.rowGroupSuppressLeafExpansion ?? false);
19
+ const { flatten, rowByIdRef, rowByIndexRef, rowIdToRowIndexRef } = useFlattenedPiece({
20
+ leafsTop,
21
+ leafsCenter: leafs,
22
+ leafsBot,
23
+ groupFlat,
24
+ centerIndices: sorted,
25
+ });
26
+ return {
27
+ tree,
28
+ maxDepth,
29
+ flatten,
30
+ rowByIdRef,
31
+ rowByIndexRef,
32
+ rowIdToRowIndexRef,
33
+ leafIdsRef,
34
+ leafsTop,
35
+ leafs,
36
+ leafsBot,
37
+ sorted,
38
+ groupFn,
39
+ };
40
+ }
@@ -0,0 +1,5 @@
1
+ import type { AggregationFn, RowLeaf, RowNode, SortFn } from "@1771technologies/lytenyte-shared";
2
+ import type { RootNode } from "./use-group-tree/use-group-tree";
3
+ type UseFlattenedGroupsReturn<T> = [rows: RowNode<T>[] | null, depth: number];
4
+ export declare function useFlattenedGroups<T>(root: RootNode<T> | null, agg: AggregationFn<T> | undefined | null, leafs: RowLeaf<T>[], workingSet: number[], sort: SortFn<T> | null | undefined, expandedFn: (id: string, depth: number) => boolean, suppressLeafExpansion: boolean, ignoreIsLast?: boolean): UseFlattenedGroupsReturn<T>;
5
+ export {};
@@ -0,0 +1,63 @@
1
+ import { useMemo } from "react";
2
+ import { getValidLeafs } from "./get-valid-leafs.js";
3
+ import { useSortFn } from "@1771technologies/lytenyte-core/internal";
4
+ export function useFlattenedGroups(root, agg, leafs, workingSet, sort, expandedFn, suppressLeafExpansion, ignoreIsLast = false) {
5
+ const sortFallbackDim = useMemo(() => [{ dim: { id: "__ln_group__" } }], []);
6
+ const sortFallback = useSortFn(sortFallbackDim);
7
+ const flat = useMemo(() => {
8
+ if (!root)
9
+ return [null, 0];
10
+ const flatList = [];
11
+ const ranges = [];
12
+ let maxDepth = 0;
13
+ function processRowsBetter(node, parent, start, isLast, depth = 0) {
14
+ maxDepth = Math.max(depth + 1, maxDepth);
15
+ const rows = nodeChildrenToRows(node, agg, leafs, workingSet, sort ?? sortFallback, isLast && !ignoreIsLast);
16
+ let offset = 0;
17
+ for (let i = 0; i < rows.length; i++) {
18
+ const row = rows[i];
19
+ const rowIndex = i + start + offset;
20
+ if (row.kind === "leaf") {
21
+ flatList.push(row);
22
+ continue;
23
+ }
24
+ flatList.push(row);
25
+ const notExpandable = suppressLeafExpansion && row.last;
26
+ row.expandable = !notExpandable;
27
+ if (!expandedFn(row.id, depth) || notExpandable) {
28
+ row.expanded = false;
29
+ continue;
30
+ }
31
+ row.expanded = true;
32
+ offset += processRowsBetter(row.__children, row, rowIndex + 1, row.last, depth + 1);
33
+ }
34
+ ranges.push({ parent, start, end: offset + start + node.size });
35
+ return offset + node.size;
36
+ }
37
+ processRowsBetter(root.children, null, 0, root.maxDepth <= 1);
38
+ return [flatList, maxDepth];
39
+ }, [agg, expandedFn, ignoreIsLast, leafs, root, sort, sortFallback, suppressLeafExpansion, workingSet]);
40
+ return flat;
41
+ }
42
+ const nodeChildrenToRows = (root, agg, leafs, workingSet, sort, isLast) => {
43
+ const values = root.values();
44
+ const rows = [];
45
+ for (const v of values) {
46
+ if (v.kind === "leaf") {
47
+ rows.push(v.row);
48
+ continue;
49
+ }
50
+ else {
51
+ const row = v.row;
52
+ if (row.__invalidate) {
53
+ const data = agg ? agg(getValidLeafs(v, leafs, workingSet)) : {};
54
+ row.data = data;
55
+ row.__invalidate = false;
56
+ }
57
+ rows.push(row);
58
+ }
59
+ }
60
+ if (!isLast && sort)
61
+ return rows.sort(sort);
62
+ return rows;
63
+ };
@@ -0,0 +1,14 @@
1
+ import type { RowNode } from "@1771technologies/lytenyte-shared";
2
+ export interface UseFlattenedPieceParams<T> {
3
+ leafsTop: RowNode<T>[];
4
+ leafsCenter: RowNode<T>[];
5
+ leafsBot: RowNode<T>[];
6
+ groupFlat: RowNode<T>[] | null;
7
+ centerIndices: number[];
8
+ }
9
+ export declare function useFlattenedPiece<T>({ leafsTop, leafsCenter, leafsBot, groupFlat, centerIndices, }: UseFlattenedPieceParams<T>): {
10
+ flatten: RowNode<T>[];
11
+ rowByIdRef: import("react").RefObject<Map<string, RowNode<T>>>;
12
+ rowByIndexRef: import("react").RefObject<Map<number, RowNode<T>>>;
13
+ rowIdToRowIndexRef: import("react").RefObject<Map<string, number>>;
14
+ };
@@ -0,0 +1,55 @@
1
+ import { useMemo, useRef } from "react";
2
+ export function useFlattenedPiece({ leafsTop, leafsCenter, leafsBot, groupFlat, centerIndices, }) {
3
+ const rowByIdRef = useRef(null);
4
+ const rowByIndexRef = useRef(null);
5
+ const rowIdToRowIndexRef = useRef(null);
6
+ const [flatten] = useMemo(() => {
7
+ const flat = [];
8
+ const byId = new Map();
9
+ const byIndex = new Map();
10
+ const byIdToIndex = new Map();
11
+ for (let i = 0; i < leafsTop.length; i++) {
12
+ const node = leafsTop[i];
13
+ flat.push(node);
14
+ byIndex.set(i, node);
15
+ byId.set(node.id, node);
16
+ byIdToIndex.set(node.id, i);
17
+ }
18
+ const offset = leafsTop.length;
19
+ if (groupFlat) {
20
+ for (let i = 0; i < groupFlat.length; i++) {
21
+ const rowIndex = i + offset;
22
+ const node = groupFlat[i];
23
+ flat.push(node);
24
+ byIndex.set(rowIndex, node);
25
+ byId.set(node.id, node);
26
+ byIdToIndex.set(node.id, rowIndex);
27
+ }
28
+ }
29
+ else {
30
+ for (let i = 0; i < centerIndices.length; i++) {
31
+ const rowIndex = i + offset;
32
+ const srcIndex = centerIndices[i];
33
+ const node = leafsCenter[srcIndex];
34
+ flat.push(node);
35
+ byIndex.set(rowIndex, node);
36
+ byId.set(node.id, node);
37
+ byIdToIndex.set(node.id, rowIndex);
38
+ }
39
+ }
40
+ const botOffset = offset + (groupFlat ? groupFlat.length : centerIndices.length);
41
+ for (let i = 0; i < leafsBot.length; i++) {
42
+ const rowIndex = i + botOffset;
43
+ const node = leafsBot[i];
44
+ flat.push(node);
45
+ byIndex.set(rowIndex, node);
46
+ byId.set(node.id, node);
47
+ byIdToIndex.set(node.id, rowIndex);
48
+ }
49
+ rowByIdRef.current = byId;
50
+ rowByIndexRef.current = byIndex;
51
+ rowIdToRowIndexRef.current = byIdToIndex;
52
+ return [flat];
53
+ }, [centerIndices, groupFlat, leafsBot, leafsCenter, leafsTop]);
54
+ return { flatten, rowByIdRef, rowByIndexRef, rowIdToRowIndexRef };
55
+ }
@@ -0,0 +1,2 @@
1
+ import type { GroupNode } from "./use-group-tree.js";
2
+ export declare const collapseChild: <T>(node: GroupNode<T>) => GroupNode<T> | import("./use-group-tree.js").LeafNode<T>;
@@ -0,0 +1,11 @@
1
+ export const collapseChild = (node) => {
2
+ const onlyChild = node.children.values().next().value;
3
+ const parentKey = node.key;
4
+ const parent = node.parent;
5
+ parent.children.set(parentKey, onlyChild);
6
+ Object.assign(onlyChild, { parent, key: parentKey });
7
+ const n = onlyChild.row;
8
+ n.parentId = parent.kind === "root" ? null : parent.id;
9
+ n.depth--;
10
+ return onlyChild;
11
+ };
@@ -0,0 +1,2 @@
1
+ import type { GroupNode, LeafNode } from "./use-group-tree.js";
2
+ export declare const collapseLast: <T>(node: GroupNode<T> | LeafNode<T>) => void;
@@ -0,0 +1,14 @@
1
+ import { collapseChild } from "./collapse-child.js";
2
+ export const collapseLast = (node) => {
3
+ if (node.kind === "leaf")
4
+ return;
5
+ if (node.last) {
6
+ if (node.children.size === 1)
7
+ collapseChild(node);
8
+ return;
9
+ }
10
+ const values = node.children.values();
11
+ for (const v of values) {
12
+ collapseLast(v);
13
+ }
14
+ };
@@ -0,0 +1,2 @@
1
+ import type { GroupNode, LeafNode } from "./use-group-tree.js";
2
+ export declare const collapse: <T>(node: GroupNode<T> | LeafNode<T>) => void;
@@ -0,0 +1,17 @@
1
+ import { collapseChild } from "./collapse-child.js";
2
+ export const collapse = (node) => {
3
+ if (node.kind === "leaf")
4
+ return;
5
+ // This node has multiple children. For each child we should call collapse, but this node
6
+ // itself will not be collapsed.
7
+ if (node.children.size > 1) {
8
+ const values = node.children.values();
9
+ for (const v of values) {
10
+ collapse(v);
11
+ }
12
+ return;
13
+ }
14
+ // If we've reached here it means that this node has a single child. This means we need to
15
+ // replace it in its parent.
16
+ collapse(collapseChild(node));
17
+ };
@@ -0,0 +1,31 @@
1
+ import type { AggregationFn, GroupFn, GroupIdFn, RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
2
+ import type { HavingFilterFn, LabelFilter } from "../../use-client-data-source.js";
3
+ export interface RootNode<T> {
4
+ readonly kind: "root";
5
+ readonly children: RootMap<T>;
6
+ readonly groupLookup: Map<string, GroupNode<T>>;
7
+ readonly maxDepth: number;
8
+ }
9
+ export interface LeafNode<T> {
10
+ readonly parent: GroupNode<T> | RootNode<T>;
11
+ readonly kind: "leaf";
12
+ readonly key: string | null | number;
13
+ readonly row: RowLeaf<T>;
14
+ }
15
+ export interface GroupNode<T> {
16
+ readonly kind: "branch";
17
+ readonly id: string;
18
+ readonly row: RowGroup & {
19
+ __children: Map<string | null | number, GroupNode<T> | LeafNode<T>>;
20
+ __invalidate: boolean;
21
+ };
22
+ readonly last: boolean;
23
+ readonly key: string | null | number;
24
+ readonly children: Map<string | null | number, GroupNode<T> | LeafNode<T>>;
25
+ readonly path: (string | null)[];
26
+ readonly leafs: number[];
27
+ leafIds: Set<string>;
28
+ readonly parent: GroupNode<T> | RootNode<T>;
29
+ }
30
+ export type RootMap<T> = Map<string | null | number, GroupNode<T> | LeafNode<T>>;
31
+ export declare function useGroupTree<T>(leafs: RowLeaf<T>[], workingSet: number[], group: GroupFn<T> | undefined | null, groupIdFn: GroupIdFn, rowGroupCollapseBehavior: "no-collapse" | "last-only" | "full-tree", labelFilter: (LabelFilter | null)[] | null | undefined, having: (HavingFilterFn | null)[] | null | undefined, agg: AggregationFn<T> | undefined | null): RootNode<T> | null;