impact-nova 2.5.16 → 2.6.0-alpha.0

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 (254) hide show
  1. package/README.md +27 -25
  2. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +28 -1
  3. package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.d.ts +0 -3
  4. package/dist/components/data/ag-grid-react/cell-renderers/date-display-renderer.js +31 -38
  5. package/dist/components/data/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  6. package/dist/components/data/ag-grid-react/chat/chat-capabilities.d.ts +9 -0
  7. package/dist/components/data/ag-grid-react/chat/chat-capabilities.js +22 -0
  8. package/dist/components/data/ag-grid-react/chat/chat-column.d.ts +20 -0
  9. package/dist/components/data/ag-grid-react/chat/chat-column.js +81 -0
  10. package/dist/components/data/ag-grid-react/chat/chat-composer.d.ts +10 -0
  11. package/dist/components/data/ag-grid-react/chat/chat-composer.js +352 -0
  12. package/dist/components/data/ag-grid-react/chat/chat-constants.d.ts +17 -0
  13. package/dist/components/data/ag-grid-react/chat/chat-constants.js +22 -0
  14. package/dist/components/data/ag-grid-react/chat/chat-format.d.ts +41 -0
  15. package/dist/components/data/ag-grid-react/chat/chat-format.js +94 -0
  16. package/dist/components/data/ag-grid-react/chat/chat-host.d.ts +10 -0
  17. package/dist/components/data/ag-grid-react/chat/chat-host.js +651 -0
  18. package/dist/components/data/ag-grid-react/chat/chat-host.types.d.ts +13 -0
  19. package/dist/components/data/ag-grid-react/chat/chat-html.d.ts +2 -0
  20. package/dist/components/data/ag-grid-react/chat/chat-html.js +40 -0
  21. package/dist/components/data/ag-grid-react/chat/chat-identity.d.ts +13 -0
  22. package/dist/components/data/ag-grid-react/chat/chat-identity.js +24 -0
  23. package/dist/components/data/ag-grid-react/chat/chat-menu.d.ts +13 -0
  24. package/dist/components/data/ag-grid-react/chat/chat-menu.js +15 -0
  25. package/dist/components/data/ag-grid-react/chat/chat-notify.d.ts +17 -0
  26. package/dist/components/data/ag-grid-react/chat/chat-notify.js +124 -0
  27. package/dist/components/data/ag-grid-react/chat/chat-persist.d.ts +13 -0
  28. package/dist/components/data/ag-grid-react/chat/chat-persist.js +34 -0
  29. package/dist/components/data/ag-grid-react/chat/chat-priority.d.ts +13 -0
  30. package/dist/components/data/ag-grid-react/chat/chat-priority.js +79 -0
  31. package/dist/components/data/ag-grid-react/chat/chat-summaries.d.ts +2 -0
  32. package/dist/components/data/ag-grid-react/chat/chat-summaries.js +24 -0
  33. package/dist/components/data/ag-grid-react/chat/chat-thread-ui.d.ts +72 -0
  34. package/dist/components/data/ag-grid-react/chat/chat-thread-ui.js +713 -0
  35. package/dist/components/data/ag-grid-react/chat/chat-toggle.d.ts +6 -0
  36. package/dist/components/data/ag-grid-react/chat/chat-toggle.js +25 -0
  37. package/dist/components/data/ag-grid-react/chat/chat-ui-actions.d.ts +13 -0
  38. package/dist/components/data/ag-grid-react/chat/chat-ui-actions.js +26 -0
  39. package/dist/components/data/ag-grid-react/chat/chat-window.d.ts +14 -0
  40. package/dist/components/data/ag-grid-react/chat/chat-window.js +82 -0
  41. package/dist/components/data/ag-grid-react/chat/chat-workspace.d.ts +91 -0
  42. package/dist/components/data/ag-grid-react/chat/chat-workspace.js +555 -0
  43. package/dist/components/data/ag-grid-react/chat/chat.types.d.ts +319 -0
  44. package/dist/components/data/ag-grid-react/chat/index.d.ts +6 -0
  45. package/dist/components/data/ag-grid-react/chat/index.js +24 -0
  46. package/dist/components/data/ag-grid-react/chat.story-data.d.ts +34 -0
  47. package/dist/components/data/ag-grid-react/chat.story-sources.d.ts +4 -0
  48. package/dist/components/data/ag-grid-react/comments/assets/comments-no-results.png.js +4 -0
  49. package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.d.ts +6 -0
  50. package/dist/components/data/ag-grid-react/comments/comment-mode-toggle.js +29 -0
  51. package/dist/components/data/ag-grid-react/comments/comments-actions-menu.d.ts +8 -0
  52. package/dist/components/data/ag-grid-react/comments/comments-actions-menu.js +18 -0
  53. package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.d.ts +18 -0
  54. package/dist/components/data/ag-grid-react/comments/comments-ag-grid-presence.js +16 -0
  55. package/dist/components/data/ag-grid-react/comments/comments-capabilities.d.ts +11 -0
  56. package/dist/components/data/ag-grid-react/comments/comments-capabilities.js +26 -0
  57. package/dist/components/data/ag-grid-react/comments/comments-constants.d.ts +12 -0
  58. package/dist/components/data/ag-grid-react/comments/comments-constants.js +21 -0
  59. package/dist/components/data/ag-grid-react/comments/comments-format.d.ts +20 -0
  60. package/dist/components/data/ag-grid-react/comments/comments-format.js +49 -0
  61. package/dist/components/data/ag-grid-react/comments/comments-generation.d.ts +14 -0
  62. package/dist/components/data/ag-grid-react/comments/comments-generation.js +18 -0
  63. package/dist/components/data/ag-grid-react/comments/comments-host.d.ts +10 -0
  64. package/dist/components/data/ag-grid-react/comments/comments-host.js +343 -0
  65. package/dist/components/data/ag-grid-react/comments/comments-host.types.d.ts +18 -0
  66. package/dist/components/data/ag-grid-react/comments/comments-identity.d.ts +7 -0
  67. package/dist/components/data/ag-grid-react/comments/comments-identity.js +20 -0
  68. package/dist/components/data/ag-grid-react/comments/comments-menu.d.ts +29 -0
  69. package/dist/components/data/ag-grid-react/comments/comments-menu.js +35 -0
  70. package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.d.ts +22 -0
  71. package/dist/components/data/ag-grid-react/comments/comments-overlay-anchor.js +98 -0
  72. package/dist/components/data/ag-grid-react/comments/comments-overlay.d.ts +21 -0
  73. package/dist/components/data/ag-grid-react/comments/comments-overlay.js +406 -0
  74. package/dist/components/data/ag-grid-react/comments/comments-panel.d.ts +9 -0
  75. package/dist/components/data/ag-grid-react/comments/comments-panel.js +272 -0
  76. package/dist/components/data/ag-grid-react/comments/comments-persist.d.ts +11 -0
  77. package/dist/components/data/ag-grid-react/comments/comments-persist.js +19 -0
  78. package/dist/components/data/ag-grid-react/comments/comments-reveal.d.ts +11 -0
  79. package/dist/components/data/ag-grid-react/comments/comments-reveal.js +31 -0
  80. package/dist/components/data/ag-grid-react/comments/comments-ui-actions.d.ts +18 -0
  81. package/dist/components/data/ag-grid-react/comments/comments-ui-actions.js +22 -0
  82. package/dist/components/data/ag-grid-react/comments/comments-window.d.ts +10 -0
  83. package/dist/components/data/ag-grid-react/comments/comments-window.js +62 -0
  84. package/dist/components/data/ag-grid-react/comments/comments.types.d.ts +178 -0
  85. package/dist/components/data/ag-grid-react/comments/index.d.ts +5 -0
  86. package/dist/components/data/ag-grid-react/comments/index.js +15 -0
  87. package/dist/components/data/ag-grid-react/comments-cell-renderers-showcase.d.ts +25 -0
  88. package/dist/components/data/ag-grid-react/comments.story-data.d.ts +37 -0
  89. package/dist/components/data/ag-grid-react/comments.story-sources.d.ts +11 -0
  90. package/dist/components/data/ag-grid-react/grid-cell-address.d.ts +21 -0
  91. package/dist/components/data/ag-grid-react/grid-cell-address.js +21 -0
  92. package/dist/components/data/ag-grid-react/grid-row-reveal.d.ts +34 -0
  93. package/dist/components/data/ag-grid-react/grid-row-reveal.js +33 -0
  94. package/dist/components/data/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +75 -65
  95. package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.d.ts +1 -1
  96. package/dist/components/data/ag-grid-react/headers/advanced-filter/column-filter-section.js +54 -54
  97. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +1 -1
  98. package/dist/components/data/ag-grid-react/headers/header-search-input.js +122 -119
  99. package/dist/components/data/ag-grid-react/headers/utils/date-utils.d.ts +2 -1
  100. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +25 -20
  101. package/dist/components/data/ag-grid-react/headers/utils/filter-utils.d.ts +1 -1
  102. package/dist/components/data/ag-grid-react/index.d.ts +1 -1
  103. package/dist/components/data/ag-grid-react/index.js +481 -254
  104. package/dist/components/data/ag-grid-react/notes/index.d.ts +2 -0
  105. package/dist/components/data/ag-grid-react/notes/index.js +1 -0
  106. package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.d.ts +25 -0
  107. package/dist/components/data/ag-grid-react/notes/notes-ag-grid-adapter.js +32 -0
  108. package/dist/components/data/ag-grid-react/notes/notes-constants.d.ts +2 -0
  109. package/dist/components/data/ag-grid-react/notes/notes-constants.js +4 -0
  110. package/dist/components/data/ag-grid-react/notes/notes.types.d.ts +12 -0
  111. package/dist/components/data/ag-grid-react/notes.story-sources.d.ts +7 -0
  112. package/dist/components/data/ag-grid-react/nova-system-column.d.ts +7 -0
  113. package/dist/components/data/ag-grid-react/nova-system-column.js +18 -0
  114. package/dist/components/data/ag-grid-react/theme.js +6 -2
  115. package/dist/components/data/ag-grid-react/value-formatter.types.d.ts +4 -0
  116. package/dist/components/data/ag-grid-react/value-formatters.d.ts +0 -19
  117. package/dist/components/data/ag-grid-react/value-formatters.js +88 -90
  118. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +0 -1
  119. package/dist/components/data/data-table/build-column-tree-from-grid.js +49 -53
  120. package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
  121. package/dist/components/data/data-table/data-table-column-apply.js +73 -84
  122. package/dist/components/data/data-table/data-table-column-def-pin.js +34 -31
  123. package/dist/components/data/data-table/data-table-column-list.js +64 -94
  124. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
  125. package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
  126. package/dist/components/data/data-table/data-table-context.js +5 -5
  127. package/dist/components/data/data-table/data-table-sheet-context.js +1 -1
  128. package/dist/components/data/data-table/data-table-sheet.js +2 -1
  129. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
  130. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
  131. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
  132. package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
  133. package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
  134. package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
  135. package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
  136. package/dist/components/data/nested-list/components/SortableItem.js +60 -62
  137. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
  138. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
  139. package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
  140. package/dist/components/data/nested-list/nested-list-constants.js +4 -10
  141. package/dist/components/data/nested-list/nested-list.js +336 -322
  142. package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
  143. package/dist/components/data-display/calendar/calendar-config.js +22 -21
  144. package/dist/components/data-display/calendar/calendar-day-button.js +21 -21
  145. package/dist/components/data-display/calendar/calendar-day-picker-view.js +36 -35
  146. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +3 -3
  147. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +50 -62
  148. package/dist/components/data-display/calendar/calendar.js +138 -137
  149. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +23 -22
  150. package/dist/components/data-display/calendar/use-calendar-i18n.d.ts +1 -0
  151. package/dist/components/data-display/calendar/use-calendar-i18n.js +10 -9
  152. package/dist/components/data-display/chart/chart.js +72 -72
  153. package/dist/components/data-display/chart/chart.utils.d.ts +1 -1
  154. package/dist/components/data-display/chart/chart.utils.js +40 -31
  155. package/dist/components/feedback/sheet/sheet.js +1 -1
  156. package/dist/components/feedback/toast/toast.d.ts +1 -1
  157. package/dist/components/feedback/toast/toast.variants.d.ts +1 -1
  158. package/dist/components/flows/filter-panel/filter-panel.d.ts +1 -1
  159. package/dist/components/flows/filter-panel/filter-panel.js +65 -64
  160. package/dist/components/flows/filter-panel/filter-panel.types.d.ts +1 -0
  161. package/dist/components/forms/date-picker/date-picker.js +125 -126
  162. package/dist/components/forms/date-picker/date-range-picker.js +191 -192
  163. package/dist/components/forms/date-picker/multi-date-picker.js +66 -67
  164. package/dist/components/forms/date-picker/multi-week-picker.js +82 -83
  165. package/dist/components/forms/date-picker/use-picker-i18n.d.ts +6 -0
  166. package/dist/components/forms/date-picker/use-picker-i18n.js +11 -0
  167. package/dist/components/forms/date-picker/week-picker.js +146 -147
  168. package/dist/components/forms/date-picker/week-range-picker.js +158 -159
  169. package/dist/components/ui/local-raster-icons/message3d.webp.js +4 -0
  170. package/dist/components/ui/local-raster-icons/rasterIcons.d.ts +1 -0
  171. package/dist/components/ui/local-raster-icons/rasterIcons.js +27 -25
  172. package/dist/form-react/Fields/WeekRangePicker.js +16 -16
  173. package/dist/i18n/defaultMessages.d.ts +144 -0
  174. package/dist/i18n/defaultMessages.js +161 -19
  175. package/dist/i18n/format/collator.d.ts +1 -0
  176. package/dist/i18n/format/collator.js +7 -0
  177. package/dist/i18n/format/date-pattern.d.ts +5 -0
  178. package/dist/i18n/format/date-pattern.js +20 -0
  179. package/dist/i18n/format/format-date.d.ts +9 -0
  180. package/dist/i18n/format/format-date.js +56 -0
  181. package/dist/i18n/format/format-number.d.ts +20 -0
  182. package/dist/i18n/format/format-number.js +68 -0
  183. package/dist/i18n/format/formatter-cache.d.ts +9 -0
  184. package/dist/i18n/format/formatter-cache.js +66 -0
  185. package/dist/i18n/format/index.d.ts +6 -0
  186. package/dist/i18n/format/parse-number.d.ts +6 -0
  187. package/dist/i18n/format/parse-number.js +53 -0
  188. package/dist/i18n/getDateFnsLocale.d.ts +5 -4
  189. package/dist/i18n/getDateFnsLocale.js +46 -16
  190. package/dist/i18n/i18n.types.d.ts +13 -0
  191. package/dist/i18n/impact-nova-i18n-context.d.ts +1 -1
  192. package/dist/i18n/impact-nova-i18n-context.js +33 -25
  193. package/dist/i18n/impact-nova-i18n-defaults.js +8 -6
  194. package/dist/i18n/index.d.ts +4 -1
  195. package/dist/i18n/index.js +41 -16
  196. package/dist/i18n/locale-config.d.ts +28 -0
  197. package/dist/i18n/locale-config.js +32 -0
  198. package/dist/i18n/locales/de.js +142 -0
  199. package/dist/i18n/locales/es.js +142 -0
  200. package/dist/i18n/locales/hi.js +142 -0
  201. package/dist/i18n/locales/kn.js +142 -0
  202. package/dist/i18n/week-start.d.ts +6 -0
  203. package/dist/i18n/week-start.js +30 -0
  204. package/dist/impact-nova-components.css +249 -0
  205. package/dist/impact-nova-tokens.scss +6 -0
  206. package/dist/impact-nova.css +1 -1
  207. package/dist/index.d.ts +1 -1
  208. package/dist/index.js +624 -601
  209. package/dist/llms/index.js +26 -2
  210. package/dist/llms/rules/ag-grid.js +1 -1
  211. package/dist/llms/rules/best-practices.js +1 -1
  212. package/dist/llms/rules/data-table-chat.js +1 -0
  213. package/dist/llms/rules/data-table-comments.js +1 -0
  214. package/dist/llms/rules/data-table-notes.js +1 -0
  215. package/dist/llms/rules/installation.js +1 -1
  216. package/dist/llms/rules/migration.js +1 -1
  217. package/dist/llms/rules/real-world-patterns.js +1 -1
  218. package/dist/llms/rules/requirements.js +1 -1
  219. package/dist/llms/rules/troubleshooting.js +1 -1
  220. package/dist/providers/app-providers.d.ts +3 -1
  221. package/dist/providers/app-providers.js +22 -11
  222. package/package.json +13 -1
  223. package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
  224. package/dist/components/data/data-table/column-picker-authority.js +0 -116
  225. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
  226. package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
  227. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
  228. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
  229. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
  230. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
  231. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
  232. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
  233. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
  234. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
  235. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
  236. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
  237. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
  238. package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
  239. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
  240. package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
  241. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
  242. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
  243. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
  244. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
  245. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
  246. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
  247. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
  248. package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
  249. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
  250. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
  251. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
  252. package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
  253. package/dist/lib/hash/fnv1a128.d.ts +0 -16
  254. package/dist/lib/hash/fnv1a128.js +0 -21
@@ -1,128 +0,0 @@
1
- import { useState as B, useRef as d, useEffect as w, useCallback as a } from "react";
2
- import { resolveVirtualDropTarget as M, clampPointerToScrollBounds as F } from "../nested-list-virtual-drop.js";
3
- function V({
4
- items: S,
5
- scrollElementRef: s,
6
- virtualizer: L,
7
- estimateRowSize: y,
8
- onDrop: h,
9
- collapsedItems: D = {}
10
- }) {
11
- const [v, C] = B(null), f = d(null), p = d(S), x = d(L), X = d(y), b = d(D), c = d(null), g = d(null), E = d(null);
12
- w(() => {
13
- p.current = S;
14
- }), w(() => {
15
- x.current = L;
16
- }), w(() => {
17
- X.current = y;
18
- }), w(() => {
19
- b.current = D;
20
- });
21
- const I = a((e, r) => {
22
- const n = s.current;
23
- return n ? M({
24
- clientX: e,
25
- clientY: r,
26
- scrollElement: n,
27
- items: p.current,
28
- virtualizer: x.current,
29
- estimateRowSize: X.current,
30
- offsetCacheHolder: E,
31
- collapsedItems: b.current
32
- }) : null;
33
- }, [s]), m = a(() => {
34
- f.current = null, C(null), g.current = null, c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
35
- }, []), R = a(() => {
36
- const e = f.current;
37
- e?.dropTarget && e.draggedId !== e.dropTarget.overId && h(e.draggedId, e.dropTarget.overId, e.dropTarget.insertAfter);
38
- }, [h]), P = a((e, r) => {
39
- const n = f.current;
40
- if (!n)
41
- return;
42
- const t = s.current, o = t?.getBoundingClientRect(), i = o ? F(e, r, o) : {
43
- pointerX: e,
44
- pointerY: r,
45
- isInsideScrollContainer: !0
46
- }, l = I(e, r), u = i.isInsideScrollContainer ? null : n.dropTarget, T = {
47
- ...n,
48
- dropTarget: l ?? u,
49
- pointerX: i.pointerX,
50
- pointerY: i.pointerY,
51
- isPointerInsideScrollContainer: i.isInsideScrollContainer
52
- };
53
- f.current = T, C(T), t && o && (r < o.top + 40 ? t.scrollTop -= 8 : r > o.bottom - 40 && (t.scrollTop += 8));
54
- }, [I, s]), Y = a(() => {
55
- c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
56
- const e = g.current;
57
- e && (P(e.clientX, e.clientY), g.current = null);
58
- }, [P]), A = a((e, r) => {
59
- g.current = { clientX: e, clientY: r }, c.current === null && (c.current = requestAnimationFrame(() => {
60
- c.current = null;
61
- const n = g.current;
62
- n && (P(n.clientX, n.clientY), g.current = null);
63
- }));
64
- }, [P]), k = a((e, r) => {
65
- const n = p.current.findIndex((T) => T.item.id === r), t = p.current[n]?.item;
66
- if (!t || n === -1 || t.isDragDisabled || t.category === "structure")
67
- return;
68
- e.preventDefault(), E.current = null, s.current?.setPointerCapture(e.pointerId);
69
- const o = s.current?.getBoundingClientRect(), i = o ? F(e.clientX, e.clientY, o) : {
70
- pointerX: e.clientX,
71
- pointerY: e.clientY,
72
- isInsideScrollContainer: !0
73
- }, l = I(e.clientX, e.clientY) ?? {
74
- overId: r,
75
- insertAfter: !1,
76
- flatIndex: n
77
- }, u = {
78
- draggedId: r,
79
- draggedItem: t,
80
- dropTarget: l,
81
- pointerX: i.pointerX,
82
- pointerY: i.pointerY,
83
- isPointerInsideScrollContainer: i.isInsideScrollContainer
84
- };
85
- f.current = u, C(u);
86
- }, [I, s]);
87
- w(() => {
88
- if (!v)
89
- return;
90
- const e = (u) => {
91
- A(u.clientX, u.clientY);
92
- }, r = () => {
93
- Y(), R(), m();
94
- }, n = () => {
95
- m();
96
- }, t = () => {
97
- m();
98
- }, o = (u) => {
99
- u.key === "Escape" && m();
100
- };
101
- window.addEventListener("pointermove", e), window.addEventListener("pointerup", r), window.addEventListener("pointercancel", n), window.addEventListener("keydown", o);
102
- const i = s.current;
103
- i?.addEventListener("lostpointercapture", t);
104
- const l = document.createElement("style");
105
- return l.setAttribute("data-virtual-drag-cursor", "true"), l.textContent = "body, body * { cursor: grabbing !important; }", document.head.appendChild(l), () => {
106
- window.removeEventListener("pointermove", e), window.removeEventListener("pointerup", r), window.removeEventListener("pointercancel", n), window.removeEventListener("keydown", o), i?.removeEventListener("lostpointercapture", t), l.remove(), c.current !== null && (cancelAnimationFrame(c.current), c.current = null);
107
- };
108
- }, [v, R, m, Y, A, s]);
109
- const U = a((e, r) => {
110
- const n = p.current.findIndex((i) => i.item.id === e);
111
- if (n === -1)
112
- return;
113
- const t = r === "up" ? Math.max(0, n - 1) : Math.min(p.current.length - 1, n + 1);
114
- if (t === n)
115
- return;
116
- const o = p.current[t];
117
- o && h(e, o.item.id, r === "down");
118
- }, [h]);
119
- return {
120
- dragSession: v,
121
- handlePointerDown: k,
122
- handleKeyboardReorder: U,
123
- isDragging: v !== null
124
- };
125
- }
126
- export {
127
- V as useVirtualNestedListDrag
128
- };
@@ -1,11 +0,0 @@
1
- import { NestedListItem } from './nested-list.types';
2
- export declare function filterNestedListItemsBySearch(items: NestedListItem[], searchText: string): NestedListItem[];
3
- export declare function updateNestedListParentCheckedState(items: NestedListItem[]): NestedListItem[];
4
- export declare function extractNestedListCategories(items: NestedListItem[], getCategory?: (item: NestedListItem) => string | undefined): string[];
5
- export declare function filterNestedListItemsByCategories(items: NestedListItem[], selectedCategories: Set<string>, getCategory?: (item: NestedListItem) => string | undefined): NestedListItem[];
6
- export type FlattenedNestedListRow = {
7
- item: NestedListItem;
8
- level: number;
9
- indentLevel: number;
10
- };
11
- export declare function flattenNestedListTree(items: NestedListItem[], collapsedItems: Record<string, boolean>, activeId: string | null, level?: number, indentLevel?: number): FlattenedNestedListRow[];
@@ -1,74 +0,0 @@
1
- function l(o, r) {
2
- if (!r || typeof r != "string")
3
- return o;
4
- const c = r.toLowerCase(), t = [];
5
- return o.forEach((n) => {
6
- const s = n.label.toLowerCase().includes(c), e = n.children ? l(n.children, r) : void 0;
7
- (s || e && e.length > 0) && t.push({
8
- ...n,
9
- children: e || n.children
10
- });
11
- }), t;
12
- }
13
- function i(o) {
14
- return o.map((r) => {
15
- if (r.children && r.children.length > 0) {
16
- const c = i(r.children), t = c.every((n) => n.checked);
17
- return {
18
- ...r,
19
- checked: t,
20
- children: c
21
- };
22
- }
23
- return r;
24
- });
25
- }
26
- function f(o, r) {
27
- const c = /* @__PURE__ */ new Set(), t = (n) => {
28
- n.forEach((s) => {
29
- const e = r ? r(s) : s.category;
30
- e && c.add(e), s.children && t(s.children);
31
- });
32
- };
33
- return t(o), Array.from(c).sort();
34
- }
35
- function u(o, r, c) {
36
- if (r.size === 0)
37
- return o;
38
- const t = [];
39
- return o.forEach((n) => {
40
- const s = c ? c(n) : n.category, e = s && r.has(s), d = n.children ? u(n.children, r, c) : void 0;
41
- (e || d && d.length > 0) && t.push({
42
- ...n,
43
- children: d
44
- });
45
- }), t;
46
- }
47
- function a(o, r, c, t = 0, n = 0) {
48
- const s = [];
49
- return o.forEach((e) => {
50
- if (s.push({
51
- item: e,
52
- level: t,
53
- indentLevel: e.category === "structure" ? 0 : n
54
- }), !r[e.id] && e.children && e.children.length > 0 && e.id !== c) {
55
- const h = e.category === "structure" ? 0 : n + 1;
56
- s.push(
57
- ...a(
58
- e.children,
59
- r,
60
- c,
61
- t + 1,
62
- h
63
- )
64
- );
65
- }
66
- }), s;
67
- }
68
- export {
69
- f as extractNestedListCategories,
70
- u as filterNestedListItemsByCategories,
71
- l as filterNestedListItemsBySearch,
72
- a as flattenNestedListTree,
73
- i as updateNestedListParentCheckedState
74
- };
@@ -1,31 +0,0 @@
1
- import { DragEndEvent } from '@dnd-kit/core';
2
- import { NestedListItem } from './nested-list.types';
3
- export { NESTED_LIST_SECTION_IDS } from './nested-list-constants';
4
- export declare function getSectionIdFromDroppable(droppableId: string): string | null;
5
- export declare function findNestedListItemById(items: NestedListItem[], id: string): NestedListItem | undefined;
6
- export declare function findNestedListItemLevel(items: NestedListItem[], itemId: string, currentLevel?: number): number | null;
7
- export declare function findNestedListParentId(items: NestedListItem[], itemId: string, parentId?: string | null): string | null;
8
- export interface ApplyNestedListDropOptions {
9
- activeId: string;
10
- overId: string;
11
- insertAfter: boolean;
12
- collapsedItems?: Record<string, boolean>;
13
- canDrag?: (item: NestedListItem, level: number) => boolean;
14
- isValidDropTarget?: (options: {
15
- activeItemId: string;
16
- overItemId: string;
17
- items: NestedListItem[];
18
- insertAfter?: boolean;
19
- }) => boolean;
20
- }
21
- export declare function applyNestedListDrop(prevItems: NestedListItem[], options: ApplyNestedListDropOptions): NestedListItem[];
22
- export declare function applyNestedListDragEndEvent(prevItems: NestedListItem[], event: DragEndEvent, options?: {
23
- collapsedItems?: Record<string, boolean>;
24
- canDrag?: (item: NestedListItem, level: number) => boolean;
25
- isValidDropTarget?: (options: {
26
- activeItemId: string;
27
- overItemId: string;
28
- items: NestedListItem[];
29
- insertAfter?: boolean;
30
- }) => boolean;
31
- }): NestedListItem[];
@@ -1,209 +0,0 @@
1
- import { arrayMove as C } from "@dnd-kit/sortable";
2
- import { NESTED_LIST_SECTION_IDS as O } from "./nested-list-constants.js";
3
- const N = "droppable-";
4
- function A(n) {
5
- if (n.startsWith(N)) {
6
- const c = n.slice(N.length);
7
- if (O.has(c)) return c;
8
- }
9
- return null;
10
- }
11
- function D(n, c) {
12
- for (const e of n) {
13
- if (e.id === c) return e;
14
- if (e.children) {
15
- const r = D(e.children, c);
16
- if (r) return r;
17
- }
18
- }
19
- }
20
- function P(n, c, e = 0) {
21
- for (const r of n) {
22
- if (r.id === c) return e;
23
- if (r.children) {
24
- const t = P(r.children, c, e + 1);
25
- if (t !== null) return t;
26
- }
27
- }
28
- return null;
29
- }
30
- function I(n, c, e = null) {
31
- for (const r of n) {
32
- if (r.id === c) return e;
33
- if (r.children) {
34
- const t = I(r.children, c, r.id);
35
- if (t !== null) return t;
36
- }
37
- }
38
- return null;
39
- }
40
- function R(n, c) {
41
- for (const e of n) {
42
- if (e.id === c) return null;
43
- if (e.children && D(e.children, c))
44
- return e.id;
45
- }
46
- return null;
47
- }
48
- function _(n, c, e) {
49
- return n.map((r) => {
50
- if (r.children && r.children.length > 0) {
51
- const t = r.children.findIndex((i) => i.id === c), l = r.children.findIndex((i) => i.id === e);
52
- return t !== -1 && l !== -1 ? {
53
- ...r,
54
- children: C(r.children, t, l)
55
- } : {
56
- ...r,
57
- children: _(r.children, c, e)
58
- };
59
- }
60
- return r;
61
- });
62
- }
63
- function v(n, c, e, r) {
64
- return n.map((t) => {
65
- if (t.children && t.children.length > 0) {
66
- const l = t.children.findIndex((d) => d.id === c), i = t.children.findIndex((d) => d.id === e);
67
- if (l !== -1 && i !== -1) {
68
- let d = i;
69
- return r ? d = l < i ? i : i + 1 : d = l < i ? i - 1 : i, d = Math.max(0, Math.min(d, t.children.length - 1)), {
70
- ...t,
71
- children: C(t.children, l, d)
72
- };
73
- }
74
- return {
75
- ...t,
76
- children: v(
77
- t.children,
78
- c,
79
- e,
80
- r
81
- )
82
- };
83
- }
84
- return t;
85
- });
86
- }
87
- function G(n, c, e) {
88
- const r = I(n, e);
89
- if (!r) return null;
90
- const t = n.findIndex((i) => i.id === r), l = n.findIndex((i) => i.id === c);
91
- return t !== -1 && l !== -1 ? C(n, l, t) : null;
92
- }
93
- function V(n, c, e) {
94
- const r = n.findIndex((l) => l.id === c), t = n.findIndex((l) => l.id === e);
95
- return r !== -1 && t !== -1 ? C(n, r, t) : null;
96
- }
97
- function y(n, c, e, r, t) {
98
- const l = D(n, c);
99
- if (!l) return null;
100
- const i = (u) => u.filter((o) => o.id !== c).map(
101
- (o) => o.children ? { ...o, children: i(o.children) } : o
102
- ).filter((o) => !(o.children && o.children.length === 0 && o.category === "group")), d = D(n, e), a = !l.children || l.children.length === 0, f = !!(d?.children && d.children.length > 0), h = t[e] === !0, g = a && f && !h && r, L = (u) => {
103
- for (let o = 0; o < u.length; o += 1) {
104
- if (u[o].id === e) {
105
- if (g) {
106
- const F = {
107
- ...u[o],
108
- children: [l, ...u[o].children || []]
109
- }, E = [...u];
110
- return E[o] = F, { nodes: E, inserted: !0 };
111
- }
112
- const T = [...u], S = r ? o + 1 : o;
113
- return T.splice(S, 0, l), { nodes: T, inserted: !0 };
114
- }
115
- if (u[o].children) {
116
- const T = L(u[o].children);
117
- if (T.inserted) {
118
- const S = [...u];
119
- return S[o] = { ...u[o], children: T.nodes }, { nodes: S, inserted: !0 };
120
- }
121
- }
122
- }
123
- return { nodes: u, inserted: !1 };
124
- }, s = i(n), { nodes: x, inserted: B } = L(s);
125
- return B ? x : null;
126
- }
127
- function M(n, c, e) {
128
- const r = D(n, c);
129
- if (!r) return n;
130
- const t = (l) => l.filter((i) => i.id !== c).map(
131
- (i) => i.children ? { ...i, children: t(i.children) } : i
132
- );
133
- return n.map((l) => {
134
- let i = l.children ? t(l.children) : [];
135
- return l.id === e && (i = [r, ...i]), { ...l, children: i };
136
- });
137
- }
138
- function W(n, c) {
139
- const {
140
- activeId: e,
141
- overId: r,
142
- insertAfter: t,
143
- collapsedItems: l = {},
144
- canDrag: i,
145
- isValidDropTarget: d
146
- } = c;
147
- if (!r || e === r || d && !d({
148
- activeItemId: e,
149
- overItemId: r,
150
- items: n,
151
- insertAfter: t
152
- }))
153
- return n;
154
- if (i) {
155
- const s = D(n, e), x = P(n, e);
156
- if (s && x !== null && !i(s, x))
157
- return n;
158
- }
159
- const a = A(r);
160
- if (a)
161
- return M(n, e, a);
162
- const f = P(n, e), h = P(n, r), g = I(n, e), L = I(n, r);
163
- if (O.has(r) && f !== null && f > 0)
164
- return M(n, e, r);
165
- if (f === 0 && h !== null && h > 0)
166
- return G(n, e, r) ?? n;
167
- if (f === null || h === null)
168
- return n;
169
- if (f > 0 && h > 0 && g !== L) {
170
- const s = R(n, e), x = R(n, r);
171
- return y(
172
- n,
173
- e,
174
- r,
175
- t,
176
- l
177
- ) ?? n;
178
- }
179
- return f === 0 ? V(n, e, r) ?? n : g === L ? v(n, e, r, t) : _(n, e, r);
180
- }
181
- function w(n, c, e = {}) {
182
- const { active: r, over: t } = c;
183
- if (!t || r.id === t.id)
184
- return n;
185
- const l = r.id, i = t.id, d = r.rect?.current?.translated, a = t.rect;
186
- let f = !1;
187
- if (d && a) {
188
- const s = d.top + d.height / 2, x = a.top + a.height / 2;
189
- f = s > x;
190
- }
191
- const h = P(n, l), g = P(n, i), L = h !== null && g !== null && h > 0 && g > 0 && !!(d && a);
192
- return W(n, {
193
- activeId: l,
194
- overId: i,
195
- insertAfter: L ? f : !1,
196
- collapsedItems: e.collapsedItems,
197
- canDrag: e.canDrag,
198
- isValidDropTarget: e.isValidDropTarget
199
- });
200
- }
201
- export {
202
- O as NESTED_LIST_SECTION_IDS,
203
- w as applyNestedListDragEndEvent,
204
- W as applyNestedListDrop,
205
- D as findNestedListItemById,
206
- P as findNestedListItemLevel,
207
- I as findNestedListParentId,
208
- A as getSectionIdFromDroppable
209
- };
@@ -1,26 +0,0 @@
1
- import { FlatVirtualRowModel, NestedListItem } from './nested-list.types';
2
- import { FlattenedNestedListRow } from './nested-list-display-utils';
3
- export declare function computeFlatVirtualHeaderSelection(flatVirtualRowModel: FlatVirtualRowModel): {
4
- allChecked: boolean;
5
- someChecked: boolean;
6
- };
7
- export declare function findFlatVirtualRowIndexByItemId(flatVirtualRowModel: FlatVirtualRowModel, itemId: string): number;
8
- export interface ResolveVirtualDropReorderOptions {
9
- activeId: string;
10
- overId: string;
11
- insertAfter: boolean;
12
- flatVirtualRowModel: FlatVirtualRowModel | null;
13
- displayItems: FlattenedNestedListRow[];
14
- onVirtualReorder?: (fromIndex: number, toIndex: number) => void;
15
- }
16
- export declare function resolveVirtualDropReorderIndices(options: ResolveVirtualDropReorderOptions): {
17
- fromIndex: number;
18
- toIndex: number;
19
- } | null;
20
- export interface FlatVirtualToggleChange {
21
- itemId: string;
22
- checked: boolean;
23
- }
24
- export declare function resolveFlatVirtualToggleChange(flatVirtualRowModel: FlatVirtualRowModel, sectionItems: NestedListItem[], itemId: string): FlatVirtualToggleChange | null;
25
- export declare function triggerFlatVirtualSelectAll(flatVirtualRowModel: FlatVirtualRowModel | null, allChecked: boolean, onFlatVirtualSelectAll?: (shouldSelectAll: boolean) => void): boolean;
26
- export declare function triggerFlatVirtualItemToggle(flatVirtualRowModel: FlatVirtualRowModel | null, sectionItems: NestedListItem[], itemId: string, onItemToggle?: (changes: FlatVirtualToggleChange[]) => void): boolean;
@@ -1,67 +0,0 @@
1
- import { NESTED_LIST_ROOT_FROZEN_ID as g, NESTED_LIST_ROOT_SCROLLABLE_ID as x } from "./nested-list-constants.js";
2
- function h(r) {
3
- let t = !0, e = !1;
4
- for (let n = 0; n < r.rowCount; n += 1) {
5
- const o = r.getRowAt(n);
6
- if (o.item.category !== "structure" && (o.item.checked ? e = !0 : t = !1, e && !t))
7
- break;
8
- }
9
- return { allChecked: t && e, someChecked: e };
10
- }
11
- function I(r, t) {
12
- for (let e = 0; e < r.rowCount; e += 1)
13
- if (r.getRowAt(e).item.id === t)
14
- return e;
15
- return -1;
16
- }
17
- function w(r) {
18
- const {
19
- activeId: t,
20
- overId: e,
21
- insertAfter: n,
22
- flatVirtualRowModel: o,
23
- displayItems: l,
24
- onVirtualReorder: a
25
- } = r;
26
- if (!a)
27
- return null;
28
- if (o) {
29
- const i = I(o, t), s = I(o, e), f = n ? s + 1 : s;
30
- return i !== -1 && f !== -1 && i !== f ? { fromIndex: i, toIndex: f } : null;
31
- }
32
- const u = l.findIndex((i) => i.item.id === t), d = l.findIndex((i) => i.item.id === e), c = n ? d + 1 : d;
33
- return u !== -1 && c !== -1 && u !== c ? { fromIndex: u, toIndex: c } : null;
34
- }
35
- function m(r, t, e) {
36
- if (e === g || e === x) {
37
- const n = t.find((o) => o.id === e);
38
- return { itemId: e, checked: !(n?.checked ?? !1) };
39
- }
40
- for (let n = 0; n < r.rowCount; n += 1) {
41
- const o = r.getRowAt(n);
42
- if (o.item.id === e)
43
- return { itemId: e, checked: !o.item.checked };
44
- }
45
- return null;
46
- }
47
- function k(r, t, e) {
48
- return !r || !e ? !1 : (e(!t), !0);
49
- }
50
- function C(r, t, e, n) {
51
- if (!r)
52
- return !1;
53
- const o = m(
54
- r,
55
- t,
56
- e
57
- );
58
- return o ? (n?.([o]), !0) : !1;
59
- }
60
- export {
61
- h as computeFlatVirtualHeaderSelection,
62
- I as findFlatVirtualRowIndexByItemId,
63
- m as resolveFlatVirtualToggleChange,
64
- w as resolveVirtualDropReorderIndices,
65
- C as triggerFlatVirtualItemToggle,
66
- k as triggerFlatVirtualSelectAll
67
- };
@@ -1,4 +0,0 @@
1
- import { NestedListItem, SelectionMode } from './nested-list.types';
2
- export declare function findNestedListItemById(items: NestedListItem[], targetId: string): NestedListItem | null;
3
- export declare function collectNestedListGroupItemIds(itemsToCollect: NestedListItem[]): string[];
4
- export declare function updateNestedListParentsUpward(items: NestedListItem[], targetItemId: string, selectionMode: SelectionMode): NestedListItem[];
@@ -1,43 +0,0 @@
1
- import { SelectionMode as h } from "./nested-list.types.js";
2
- function o(c, n) {
3
- for (const r of c) {
4
- if (r.id === n)
5
- return r;
6
- if (r.children) {
7
- const d = o(r.children, n);
8
- if (d)
9
- return d;
10
- }
11
- }
12
- return null;
13
- }
14
- function l(c) {
15
- const n = [];
16
- return c.forEach((r) => {
17
- r.children && r.children.length > 0 && (n.push(r.id), n.push(...l(r.children)));
18
- }), n;
19
- }
20
- function a(c, n, r) {
21
- if (r === h.INDEPENDENT)
22
- return c;
23
- const d = (u, e) => u.id === e ? !0 : u.children ? u.children.some((t) => d(t, e)) : !1, f = (u) => u.map((e) => {
24
- if (e.id === n)
25
- return e;
26
- if (e.children && d(e, n)) {
27
- const t = f(e.children);
28
- let i;
29
- return r === h.CASCADE_UP_DOWN ? i = t.some((s) => s.checked) : i = t.every((s) => s.checked), {
30
- ...e,
31
- checked: i,
32
- children: t
33
- };
34
- }
35
- return e;
36
- });
37
- return f(c);
38
- }
39
- export {
40
- l as collectNestedListGroupItemIds,
41
- o as findNestedListItemById,
42
- a as updateNestedListParentsUpward
43
- };
@@ -1,3 +0,0 @@
1
- import { FlatNestedListRow } from './nested-list-virtual-drop';
2
- import { FlatVirtualRowModel } from './nested-list.types';
3
- export declare function createLazyFlatRowList(flatVirtualRowModel: FlatVirtualRowModel): FlatNestedListRow[];
@@ -1,34 +0,0 @@
1
- function u(e) {
2
- const s = {
3
- length: e.rowCount,
4
- findIndex: (o) => {
5
- for (let n = 0; n < e.rowCount; n += 1) {
6
- const t = e.getRowAt(n);
7
- if (o(t, n, s))
8
- return n;
9
- }
10
- return -1;
11
- },
12
- slice: (o = 0, n = e.rowCount) => {
13
- const t = [];
14
- for (let r = o; r < n; r += 1)
15
- t.push(e.getRowAt(r));
16
- return t;
17
- }
18
- };
19
- return new Proxy(s, {
20
- get(o, n) {
21
- if (n === "length")
22
- return e.rowCount;
23
- if (n in o) {
24
- const t = o[n];
25
- return typeof t == "function" ? t.bind(o) : t;
26
- }
27
- if (typeof n == "string" && /^\d+$/.test(n))
28
- return e.getRowAt(Number(n));
29
- }
30
- });
31
- }
32
- export {
33
- u as createLazyFlatRowList
34
- };
@@ -1,9 +0,0 @@
1
- import { NestedListItem } from './nested-list.types';
2
- /** Empty section header + dashed drop zone (measured in column picker). */
3
- export declare const NESTED_LIST_EMPTY_SECTION_ROW_PX = 68;
4
- /** root-scrollable header only when children render as separate flat rows. */
5
- export declare const NESTED_LIST_SCROLLABLE_HEADER_ROW_PX = 37;
6
- /** root-frozen header only when children render as separate flat rows. */
7
- export declare const NESTED_LIST_FROZEN_HEADER_ROW_PX = 25;
8
- export declare function estimateNestedListRowHeight(item: NestedListItem | undefined): number;
9
- export declare function sumNestedListRowHeightsUpTo(items: NestedListItem[], endIndexExclusive: number): number;
@@ -1,14 +0,0 @@
1
- import { NESTED_LIST_VIRTUAL_ROW_ESTIMATE_PX as t, NESTED_LIST_ROOT_SCROLLABLE_ID as _ } from "./nested-list-constants.js";
2
- const E = 68, e = 37, n = 25;
3
- function u(r) {
4
- return r.category !== "structure" || r.data?.hasVirtualColumnChildren === !0 ? !1 : !r.children || r.children.length === 0;
5
- }
6
- function T(r) {
7
- return r ? r.category === "structure" ? u(r) ? E : r.id === _ ? e : n : t : t;
8
- }
9
- export {
10
- E as NESTED_LIST_EMPTY_SECTION_ROW_PX,
11
- n as NESTED_LIST_FROZEN_HEADER_ROW_PX,
12
- e as NESTED_LIST_SCROLLABLE_HEADER_ROW_PX,
13
- T as estimateNestedListRowHeight
14
- };