@dmsi/wedgekit-react 2.0.0 → 2.0.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 (235) hide show
  1. package/dist/classNames.js +150 -0
  2. package/dist/components/AccessCard.js +63 -0
  3. package/dist/components/AccessCardGroup.js +73 -0
  4. package/dist/components/AccessChangerTabItem.js +51 -0
  5. package/dist/components/Accordion.js +99 -0
  6. package/dist/components/Alert.js +78 -0
  7. package/dist/components/Breadcrumbs.js +111 -0
  8. package/dist/components/Button.js +137 -0
  9. package/dist/components/CalendarRange.d.ts.map +1 -1
  10. package/dist/components/CalendarRange.js +406 -0
  11. package/dist/components/Caption.js +99 -0
  12. package/dist/components/Card.js +50 -0
  13. package/dist/components/Checkbox.js +108 -0
  14. package/dist/components/CompactImagesPreview.d.ts.map +1 -1
  15. package/dist/components/CompactImagesPreview.js +121 -0
  16. package/dist/components/ContentTab.js +68 -0
  17. package/dist/components/ContentTabs.js +96 -0
  18. package/dist/components/DMSiLogo.js +54 -0
  19. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.d.ts.map +1 -1
  20. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +28 -0
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.d.ts.map +1 -1
  22. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +80 -0
  23. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  24. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  25. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  26. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  27. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  28. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  29. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  30. package/dist/components/DataGrid/TableBody/index.js +161 -0
  31. package/dist/components/DataGrid/index.js +696 -0
  32. package/dist/components/DataGrid/utils.js +20 -0
  33. package/dist/components/DataGridCell.js +412 -0
  34. package/dist/components/DataTable.js +700 -0
  35. package/dist/components/DateInput.d.ts.map +1 -1
  36. package/dist/components/DateInput.js +194 -0
  37. package/dist/components/DateRangeInput.d.ts.map +1 -1
  38. package/dist/components/DateRangeInput.js +369 -0
  39. package/dist/components/DebugJson.js +28 -0
  40. package/dist/components/Display.js +46 -0
  41. package/dist/components/EditingContext.js +34 -0
  42. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  43. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  44. package/dist/components/EmblaCarousel/index.d.ts.map +1 -1
  45. package/dist/components/EmblaCarousel/index.js +154 -0
  46. package/dist/components/EmblaCarousel/usePrevNextButtons.d.ts.map +1 -1
  47. package/dist/components/EmblaCarousel/usePrevNextButtons.js +22 -0
  48. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.d.ts.map +1 -1
  49. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +16 -0
  50. package/dist/components/EmptyCartIcon.js +25 -0
  51. package/dist/components/FilterGroup.js +198 -0
  52. package/dist/components/FullViewportBox.js +19 -0
  53. package/dist/components/Grid.js +54 -0
  54. package/dist/components/Heading.js +50 -0
  55. package/dist/components/HorizontalDivider.js +20 -0
  56. package/dist/components/Icon.js +73 -0
  57. package/dist/components/ImagePlaceholder.d.ts.map +1 -1
  58. package/dist/components/ImagePlaceholder.js +23 -0
  59. package/dist/components/Input.js +469 -0
  60. package/dist/components/InputGroup.js +45 -0
  61. package/dist/components/Label.js +37 -0
  62. package/dist/components/Link.js +69 -0
  63. package/dist/components/List.js +12 -0
  64. package/dist/components/ListGroup.d.ts.map +1 -1
  65. package/dist/components/ListGroup.js +55 -0
  66. package/dist/components/LiveChatComponent.js +25 -0
  67. package/dist/components/LoadingScrim.js +22 -0
  68. package/dist/components/LogoAgilityTopBar.js +90 -0
  69. package/dist/components/LogoDMSiTopBar.js +54 -0
  70. package/dist/components/LogoMillworkTopBar.js +196 -0
  71. package/dist/components/MainBar.js +58 -0
  72. package/dist/components/MaxViewportBox.js +19 -0
  73. package/dist/components/Menu.js +202 -0
  74. package/dist/components/MenuOption.js +161 -0
  75. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  76. package/dist/components/MobileDataGrid/ColumnSelector/index.d.ts.map +1 -1
  77. package/dist/components/MobileDataGrid/ColumnSelector/index.js +101 -0
  78. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  79. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  80. package/dist/components/MobileDataGrid/GridContextProvider/index.d.ts.map +1 -1
  81. package/dist/components/MobileDataGrid/GridContextProvider/index.js +81 -0
  82. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.d.ts.map +1 -1
  83. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +12 -0
  84. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  85. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  86. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  87. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  88. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  89. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  90. package/dist/components/MobileDataGrid/index.js +78 -0
  91. package/dist/components/MobileNavMenu.js +173 -0
  92. package/dist/components/Modal.js +201 -0
  93. package/dist/components/ModalButtons.js +57 -0
  94. package/dist/components/ModalContent.js +24 -0
  95. package/dist/components/ModalHeader.js +74 -0
  96. package/dist/components/ModalScrim.js +32 -0
  97. package/dist/components/NavigationTab.js +72 -0
  98. package/dist/components/NavigationTabs.js +45 -0
  99. package/dist/components/NestedMenu.js +119 -0
  100. package/dist/components/Notification.js +91 -0
  101. package/dist/components/OptionPill.js +103 -0
  102. package/dist/components/OrderCheckIcon.js +28 -0
  103. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  104. package/dist/components/PDFViewer/PDFElement.js +77 -0
  105. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  106. package/dist/components/PDFViewer/PDFPage.js +28 -0
  107. package/dist/components/PDFViewer/index.js +124 -0
  108. package/dist/components/Pagination.js +117 -0
  109. package/dist/components/Paragraph.js +43 -0
  110. package/dist/components/Password.js +47 -0
  111. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  112. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
  113. package/dist/components/ProductImagePreview/MobileImageCarousel.js +147 -0
  114. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
  115. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +139 -0
  116. package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
  117. package/dist/components/ProductImagePreview/Thumbnail.js +47 -0
  118. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  119. package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
  120. package/dist/components/ProductImagePreview/index.js +190 -0
  121. package/dist/components/ProductImagePreview/useProductImagePreview.d.ts.map +1 -1
  122. package/dist/components/ProductImagePreview/useProductImagePreview.js +86 -0
  123. package/dist/components/ProjectBar.js +54 -0
  124. package/dist/components/Radio.js +113 -0
  125. package/dist/components/Search.js +89 -0
  126. package/dist/components/SearchResultImage/index.d.ts.map +1 -1
  127. package/dist/components/SearchResultImage/index.js +27 -0
  128. package/dist/components/Select.js +122 -0
  129. package/dist/components/SideMenu.js +24 -0
  130. package/dist/components/SideMenuGroup.js +80 -0
  131. package/dist/components/SideMenuItem.js +79 -0
  132. package/dist/components/SimpleTable.js +60 -0
  133. package/dist/components/SkeletonParagraph.js +24 -0
  134. package/dist/components/Spinner.js +30 -0
  135. package/dist/components/Stack.js +174 -0
  136. package/dist/components/StatusPill.js +44 -0
  137. package/dist/components/Stepper.js +138 -0
  138. package/dist/components/Subheader.js +41 -0
  139. package/dist/components/Surface.js +30 -0
  140. package/dist/components/Swatch.js +1498 -0
  141. package/dist/components/Textarea.js +106 -0
  142. package/dist/components/Theme.js +25 -0
  143. package/dist/components/Time.d.ts.map +1 -1
  144. package/dist/components/Time.js +226 -0
  145. package/dist/components/Toast.js +170 -0
  146. package/dist/components/Tooltip.js +102 -0
  147. package/dist/components/TopBar.js +119 -0
  148. package/dist/components/Upload.js +107 -0
  149. package/dist/components/WorldpayIframe.js +19 -0
  150. package/dist/hooks/useEditCell.d.ts.map +1 -1
  151. package/dist/hooks/useEditCell.js +24 -0
  152. package/dist/hooks/useInfiniteScroll.js +25 -0
  153. package/dist/hooks/useKeydown.d.ts.map +1 -1
  154. package/dist/hooks/useKeydown.js +21 -0
  155. package/dist/hooks/useMatchesMedia.d.ts.map +1 -1
  156. package/dist/hooks/useMatchesMedia.js +16 -0
  157. package/dist/hooks/useMenuSystem.js +186 -0
  158. package/dist/hooks/useMounted.js +9 -0
  159. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  160. package/dist/hooks/useTableLayout/storage.js +64 -0
  161. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  162. package/dist/index.js +249 -53839
  163. package/dist/lib/loadFonts.js +11 -0
  164. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  165. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  166. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  167. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  168. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  169. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  170. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  171. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  172. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  173. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  174. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  175. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  176. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  177. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  178. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  179. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  180. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  181. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  182. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  183. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  184. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  185. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  186. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  187. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  188. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  189. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  190. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  191. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  192. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  193. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  194. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  195. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  196. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  197. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  198. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  199. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  200. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  201. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  202. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  203. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  204. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  205. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  206. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  207. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  208. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  209. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  210. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  211. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  212. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  213. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  214. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  215. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  216. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  217. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  218. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  219. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  220. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  221. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  222. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  223. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  224. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  225. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  226. package/dist/static/no-results-image.png.js +4 -0
  227. package/dist/utils/date-patch-dashes.js +28 -0
  228. package/dist/utils/date.js +95 -0
  229. package/dist/utils/formatting.js +22 -0
  230. package/dist/utils/index.d.ts +1 -1
  231. package/dist/utils/index.js +4 -0
  232. package/dist/utils/mergeObjectArrays.js +18 -0
  233. package/dist/utils.js +20 -0
  234. package/package.json +1 -1
  235. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,20 @@
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import { clsx as i } from "../../node_modules/clsx/dist/clsx.js";
3
+ import { Icon as t } from "../Icon.js";
4
+ function c(r) {
5
+ if (r.key !== "ArrowDown" && r.key !== "ArrowUp") return;
6
+ r.preventDefault();
7
+ const e = r.key === "ArrowDown" ? r.currentTarget.nextElementSibling : r.currentTarget.previousElementSibling;
8
+ e instanceof HTMLTableRowElement && e.getAttribute("role") === "row" && e.focus();
9
+ }
10
+ function m(r, e = !1) {
11
+ const n = i(
12
+ "text-icon-on-action-primary-normal",
13
+ e && "invisible group-hover:visible"
14
+ );
15
+ return r === "asc" ? /* @__PURE__ */ o(t, { size: 16, className: n, name: "arrow_upward" }) : r === "desc" ? /* @__PURE__ */ o(t, { size: 16, className: n, name: "arrow_downward" }) : null;
16
+ }
17
+ export {
18
+ m as getSortIcon,
19
+ c as handleRowArrowKeyDown
20
+ };
@@ -0,0 +1,412 @@
1
+ "use client";
2
+ import { jsx as r, jsxs as W, Fragment as X } from "react/jsx-runtime";
3
+ import { useSortable as q } from "../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
4
+ import { CSS as J } from "../node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
5
+ import { clsx as v } from "../node_modules/clsx/dist/clsx.js";
6
+ import { memo as Y, useRef as V, useState as A, useEffect as B } from "react";
7
+ import { componentPadding as Z, paddingUsingComponentGap as ee } from "../classNames.js";
8
+ import { MenuOption as f } from "./MenuOption.js";
9
+ import { Menu as U } from "./Menu.js";
10
+ import { Icon as j } from "./Icon.js";
11
+ import { Search as ne } from "./Search.js";
12
+ import { useSubMenuSystem as te } from "../hooks/useMenuSystem.js";
13
+ const _ = Y(
14
+ ({
15
+ id: e,
16
+ type: d = "default",
17
+ component: o = "static",
18
+ children: m,
19
+ className: t,
20
+ locked: n = !1,
21
+ noPadding: g = !1,
22
+ paddedLeft: $ = !1,
23
+ style: w,
24
+ onClick: p,
25
+ onRightClick: C,
26
+ error: h,
27
+ warning: D,
28
+ pending: P,
29
+ center: k,
30
+ width: b,
31
+ minWidth: y,
32
+ disabled: F,
33
+ isLast: z,
34
+ testid: O,
35
+ ...H
36
+ }) => {
37
+ const L = d === "header" ? "th" : "td", c = V(null), [E, S] = A(!1), [M, x] = A(!1);
38
+ B(() => () => {
39
+ c.current && (clearTimeout(c.current), c.current = null);
40
+ }, []);
41
+ const G = (u) => {
42
+ x(!0), c.current = window.setTimeout(() => {
43
+ S(!0);
44
+ }, 500);
45
+ }, I = (u) => {
46
+ c.current && (clearTimeout(c.current), c.current = null);
47
+ const K = u.nativeEvent instanceof MouseEvent && u.nativeEvent.button === 2;
48
+ !E && p && !K && M && p(u), K && C && C(), S(!1), x(!1);
49
+ }, R = () => {
50
+ c.current && (clearTimeout(c.current), c.current = null);
51
+ }, T = d === "header" && !n && !["button"].includes(o) && "bg-brand-400 border-brand-200", N = n && !["button"].includes(o) && "bg-neutral-400 border-neutral-300", l = d === "header" && o !== "button" && o !== "icon" && !z && v("border-r"), a = o === "button" && v("border-r border-b border-border-primary-normal"), s = o === "icon" && v("border-l"), i = v(
52
+ l,
53
+ a,
54
+ T,
55
+ N,
56
+ s,
57
+ t,
58
+ "flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
59
+ "focus-within:!z-10",
60
+ "overflow-x-hidden",
61
+ "overflow-y-hidden",
62
+ o === "input" && "border",
63
+ o === "input" && !h && !D && "border-border-primary-normal",
64
+ o === "input" && !h && !D && P && "[&:not(:focus-within)]:border-background-warning-normal",
65
+ o === "input" && h && "border-border-primary-error",
66
+ o === "input" && D && "border-background-warning-normal",
67
+ !["button", "icon"].includes(o) && !g && Z,
68
+ $ && "pl-2",
69
+ o === "icon" && "border-l",
70
+ E && "!cursor-grabbing",
71
+ o === "checkbox" || k && "justify-center",
72
+ F && "!text-text-primary-disabled"
73
+ );
74
+ return /* @__PURE__ */ r(
75
+ L,
76
+ {
77
+ id: e,
78
+ "data-testid": O,
79
+ className: v("flex h-10", !b && "flex-1"),
80
+ style: { width: b, minWidth: y },
81
+ ...H,
82
+ "data-theme": d === "header" && !n ? "brand" : void 0,
83
+ children: /* @__PURE__ */ r(
84
+ "div",
85
+ {
86
+ className: i,
87
+ style: {
88
+ ...w
89
+ },
90
+ onMouseDown: G,
91
+ onMouseUp: I,
92
+ onMouseLeave: R,
93
+ onTouchStart: G,
94
+ onTouchEnd: I,
95
+ onTouchCancel: R,
96
+ onContextMenu: (u) => u.preventDefault(),
97
+ children: m
98
+ }
99
+ )
100
+ }
101
+ );
102
+ }
103
+ );
104
+ _.displayName = "DataGridCell";
105
+ function Q({
106
+ header: e,
107
+ children: d,
108
+ setNodeRef: o,
109
+ node: m,
110
+ id: t,
111
+ testid: n,
112
+ useMenuDefaultMinWidth: g,
113
+ allowUserGrouping: $,
114
+ ...w
115
+ }) {
116
+ const [p, C] = A(!1), [h, D] = A(
117
+ e.column.getFilterValue() ?? ""
118
+ ), P = V(null), k = V(!1), { column: b, getContext: y } = e, { id: F, setFilterValue: z } = b, {
119
+ menuRootRef: O,
120
+ isMenuActive: H,
121
+ registerSubMenu: L,
122
+ listeners: c,
123
+ mobileHide: E
124
+ } = te(m || P);
125
+ B(() => {
126
+ const l = y().table.options.initialState?.columnPinning, a = l?.left ?? [], s = l?.right ?? [];
127
+ k.current = [...a, ...s].includes(F);
128
+ }, [F, y]), B(() => {
129
+ const l = setTimeout(() => {
130
+ z(h);
131
+ }, 500);
132
+ return () => {
133
+ clearTimeout(l);
134
+ };
135
+ }, [h, z]);
136
+ const S = !!$ && b.getCanGroup(), M = b.getIsGrouped(), x = b.getGroupedIndex(), G = y().table.getState().grouping.length, I = (l) => {
137
+ y().table.setGrouping((a) => {
138
+ const s = a.indexOf(F), i = s + l;
139
+ if (s === -1 || i < 0 || i >= a.length)
140
+ return a;
141
+ const u = [...a];
142
+ return [u[s], u[i]] = [u[i], u[s]], u;
143
+ });
144
+ }, R = {
145
+ position: "relative",
146
+ whiteSpace: "nowrap",
147
+ minWidth: e.column.getSize(),
148
+ "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
149
+ "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
150
+ "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)",
151
+ ...w.style
152
+ };
153
+ return /* @__PURE__ */ W(
154
+ _,
155
+ {
156
+ id: t,
157
+ testid: n,
158
+ ref: o || P,
159
+ type: "header",
160
+ component: "header",
161
+ style: R,
162
+ minWidth: `${e.column.getSize()}px`,
163
+ onClick: e.column.getToggleSortingHandler(),
164
+ onRightClick: () => C(!p),
165
+ ...w,
166
+ children: [
167
+ d,
168
+ M && /* @__PURE__ */ r(
169
+ j,
170
+ {
171
+ name: "workspaces",
172
+ size: 16,
173
+ className: "shrink-0",
174
+ title: `Grouped (level ${x + 1})`,
175
+ "data-testid": n ? `${n}-grouped-indicator` : void 0
176
+ }
177
+ ),
178
+ (e.column.getCanFilter() || !k.current && e.column.getCanPin() || S) && /* @__PURE__ */ W(
179
+ U,
180
+ {
181
+ id: t ? `${t}-menu` : void 0,
182
+ testid: n ? `${n}-menu` : void 0,
183
+ ref: O,
184
+ positionTo: m || P,
185
+ show: p,
186
+ setShow: C,
187
+ mobileHide: E,
188
+ useDefaultMinWidth: g,
189
+ children: [
190
+ e.column.getCanFilter() && /* @__PURE__ */ r(
191
+ f,
192
+ {
193
+ id: t ? `${t}-filter-option` : void 0,
194
+ testid: n ? `${n}-filter-option` : void 0,
195
+ ...c,
196
+ subMenu: ({ menuId: l, subMenuLevel: a, ...s }) => /* @__PURE__ */ W(
197
+ U,
198
+ {
199
+ id: t ? `${t}-filter-submenu` : void 0,
200
+ testid: n ? `${n}-filter-submenu` : void 0,
201
+ ...s,
202
+ show: H(l, a),
203
+ ref: (i) => {
204
+ L(l, i);
205
+ },
206
+ useDefaultMinWidth: g,
207
+ children: [
208
+ /* @__PURE__ */ r("div", { className: v(ee), children: /* @__PURE__ */ r(
209
+ ne,
210
+ {
211
+ id: t ? `${t}-filter-search` : void 0,
212
+ testid: n ? `${n}-filter-search` : void 0,
213
+ onChange: (i) => {
214
+ D(i.target.value);
215
+ },
216
+ onKeyDown: (i) => {
217
+ [" ", "Space"].includes(i.key) && i.stopPropagation();
218
+ },
219
+ value: h ?? ""
220
+ }
221
+ ) }),
222
+ /* @__PURE__ */ r(
223
+ f,
224
+ {
225
+ id: t ? `${t}-filter-contains` : void 0,
226
+ testid: n ? `${n}-filter-contains` : void 0,
227
+ onClick: N,
228
+ before: T("includesString"),
229
+ children: "Contains"
230
+ }
231
+ ),
232
+ /* @__PURE__ */ r(
233
+ f,
234
+ {
235
+ id: t ? `${t}-filter-startswith` : void 0,
236
+ testid: n ? `${n}-filter-startswith` : void 0,
237
+ onClick: N,
238
+ before: T("startsWith"),
239
+ children: "Starts with"
240
+ }
241
+ ),
242
+ /* @__PURE__ */ r(
243
+ f,
244
+ {
245
+ id: t ? `${t}-filter-endswith` : void 0,
246
+ testid: n ? `${n}-filter-endswith` : void 0,
247
+ onClick: N,
248
+ before: T("endsWith"),
249
+ children: "Ends with"
250
+ }
251
+ )
252
+ ]
253
+ }
254
+ ),
255
+ children: "Filter"
256
+ }
257
+ ),
258
+ !k.current && e.column.getCanPin() && /* @__PURE__ */ r(
259
+ f,
260
+ {
261
+ onClick: () => {
262
+ C(!p);
263
+ },
264
+ ...c,
265
+ subMenu: ({ menuId: l, subMenuLevel: a, ...s }) => /* @__PURE__ */ W(
266
+ U,
267
+ {
268
+ ...s,
269
+ show: H(l, a),
270
+ ref: (i) => {
271
+ L(l, i);
272
+ },
273
+ children: [
274
+ /* @__PURE__ */ r(
275
+ f,
276
+ {
277
+ selected: e.column.getIsPinned() === "left",
278
+ onClick: () => {
279
+ e.column.getIsPinned() === "left" ? e.column.pin(!1) : e.column.pin("left");
280
+ },
281
+ after: e.column.getIsPinned() === "left" && /* @__PURE__ */ r(j, { name: "check" }),
282
+ children: "Left"
283
+ }
284
+ ),
285
+ /* @__PURE__ */ r(
286
+ f,
287
+ {
288
+ selected: e.column.getIsPinned() === "right",
289
+ onClick: () => {
290
+ e.column.getIsPinned() === "right" ? e.column.pin(!1) : e.column.pin("right");
291
+ },
292
+ after: e.column.getIsPinned() === "right" && /* @__PURE__ */ r(j, { name: "check" }),
293
+ children: "Right"
294
+ }
295
+ )
296
+ ]
297
+ }
298
+ ),
299
+ children: `Freeze [${e.column.columnDef.header}]`
300
+ }
301
+ ),
302
+ S && /* @__PURE__ */ r(
303
+ f,
304
+ {
305
+ id: t ? `${t}-group-option` : void 0,
306
+ testid: n ? `${n}-group-option` : void 0,
307
+ onClick: e.column.getToggleGroupingHandler(),
308
+ children: M ? "Remove group" : `Group by [${e.column.columnDef.header}]`
309
+ }
310
+ ),
311
+ S && M && G > 1 && /* @__PURE__ */ W(X, { children: [
312
+ /* @__PURE__ */ r(
313
+ f,
314
+ {
315
+ id: t ? `${t}-group-move-up` : void 0,
316
+ testid: n ? `${n}-group-move-up` : void 0,
317
+ disabled: x === 0,
318
+ onClick: () => I(-1),
319
+ children: "Move up"
320
+ }
321
+ ),
322
+ /* @__PURE__ */ r(
323
+ f,
324
+ {
325
+ id: t ? `${t}-group-move-down` : void 0,
326
+ testid: n ? `${n}-group-move-down` : void 0,
327
+ disabled: x === G - 1,
328
+ onClick: () => I(1),
329
+ children: "Move down"
330
+ }
331
+ )
332
+ ] })
333
+ ]
334
+ }
335
+ )
336
+ ]
337
+ }
338
+ );
339
+ function T(l) {
340
+ return /* @__PURE__ */ r(
341
+ j,
342
+ {
343
+ name: "check",
344
+ className: v(
345
+ e.column.columnDef.filterFn !== l && "text-transparent"
346
+ )
347
+ }
348
+ );
349
+ }
350
+ function N(l, a) {
351
+ let s = "includesString";
352
+ const i = e.column.columnDef.filterFn;
353
+ a?.toLowerCase() === "starts with" && (s = i === "startsWith" ? "auto" : "startsWith"), a?.toLowerCase() === "ends with" && (s = i === "endsWith" ? "auto" : "endsWith"), a?.toLowerCase() === "contains" && (s = i === "includesString" ? "auto" : "includesString"), e.column.columnDef.filterFn = s, e.column.setFilterValue(h);
354
+ }
355
+ }
356
+ Q.displayName = "DataCellHeader";
357
+ function oe({
358
+ header: e,
359
+ children: d,
360
+ ...o
361
+ }) {
362
+ const { attributes: m, isDragging: t, listeners: n, setNodeRef: g, transform: $, node: w } = q({
363
+ id: e.column.id
364
+ }), p = {
365
+ opacity: t ? 0.8 : 1,
366
+ position: "relative",
367
+ transform: J.Translate.toString($),
368
+ transition: "width transform 0.2s ease-in-out",
369
+ whiteSpace: "nowrap",
370
+ zIndex: t ? 1 : 0,
371
+ "--color-text-primary-normal": "var(--color-action-000)",
372
+ "--color-icon-on-action-primary-normal": "var(--color-action-000)",
373
+ userSelect: "none"
374
+ };
375
+ return /* @__PURE__ */ r(
376
+ Q,
377
+ {
378
+ header: e,
379
+ setNodeRef: g,
380
+ node: w,
381
+ style: p,
382
+ ...o,
383
+ ...m,
384
+ ...n,
385
+ children: d
386
+ }
387
+ );
388
+ }
389
+ oe.displayName = "DraggableCellHeader";
390
+ function re({
391
+ cell: e,
392
+ children: d,
393
+ ...o
394
+ }) {
395
+ const { isDragging: m, setNodeRef: t, transform: n } = q({
396
+ id: e.column.id
397
+ }), g = {
398
+ opacity: m ? 0.8 : 1,
399
+ position: "relative",
400
+ transform: J.Translate.toString(n),
401
+ transition: "width transform 0.2s ease-in-out",
402
+ zIndex: m ? 1 : 0
403
+ };
404
+ return /* @__PURE__ */ r(_, { style: g, ref: t, width: `${e.column.getSize()}px`, ...o, children: d });
405
+ }
406
+ re.displayName = "DragAlongCell";
407
+ export {
408
+ Q as DataCellHeader,
409
+ _ as DataGridCell,
410
+ re as DragAlongCell,
411
+ oe as DraggableCellHeader
412
+ };