@dmsi/wedgekit-react 1.0.1 → 2.0.1

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 (282) hide show
  1. package/dist/classNames.d.ts +1 -0
  2. package/dist/classNames.d.ts.map +1 -1
  3. package/dist/classNames.js +150 -0
  4. package/dist/components/AccessCard.js +63 -0
  5. package/dist/components/AccessCardGroup.js +73 -0
  6. package/dist/components/AccessChangerTabItem.js +51 -0
  7. package/dist/components/Accordion.js +99 -0
  8. package/dist/components/Alert.d.ts.map +1 -1
  9. package/dist/components/Alert.js +78 -0
  10. package/dist/components/Breadcrumbs.js +111 -0
  11. package/dist/components/Button.js +137 -0
  12. package/dist/components/CalendarRange.js +405 -0
  13. package/dist/components/Caption.js +99 -0
  14. package/dist/components/Card.js +50 -0
  15. package/dist/components/Checkbox.js +108 -0
  16. package/dist/components/CompactImagesPreview.d.ts.map +1 -1
  17. package/dist/components/CompactImagesPreview.js +120 -0
  18. package/dist/components/ContentTab.js +68 -0
  19. package/dist/components/ContentTabs.js +96 -0
  20. package/dist/components/DMSiLogo.js +54 -0
  21. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
  22. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
  23. package/dist/components/DataGrid/PinnedColumns.d.ts +9 -2
  24. package/dist/components/DataGrid/PinnedColumns.d.ts.map +1 -1
  25. package/dist/components/DataGrid/PinnedColumns.js +165 -0
  26. package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts +18 -0
  27. package/dist/components/DataGrid/SummaryRow/SummaryCell.d.ts.map +1 -0
  28. package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
  29. package/dist/components/DataGrid/SummaryRow/aggregations.d.ts +39 -0
  30. package/dist/components/DataGrid/SummaryRow/aggregations.d.ts.map +1 -0
  31. package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
  32. package/dist/components/DataGrid/SummaryRow/index.d.ts +18 -0
  33. package/dist/components/DataGrid/SummaryRow/index.d.ts.map +1 -0
  34. package/dist/components/DataGrid/SummaryRow/index.js +86 -0
  35. package/dist/components/DataGrid/TableBody/GroupRow.d.ts +18 -0
  36. package/dist/components/DataGrid/TableBody/GroupRow.d.ts.map +1 -0
  37. package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
  38. package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
  39. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts +3 -2
  40. package/dist/components/DataGrid/TableBody/TableBodyRow.d.ts.map +1 -1
  41. package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
  42. package/dist/components/DataGrid/TableBody/index.d.ts +3 -1
  43. package/dist/components/DataGrid/TableBody/index.d.ts.map +1 -1
  44. package/dist/components/DataGrid/TableBody/index.js +161 -0
  45. package/dist/components/DataGrid/index.d.ts +1 -1
  46. package/dist/components/DataGrid/index.d.ts.map +1 -1
  47. package/dist/components/DataGrid/index.js +696 -0
  48. package/dist/components/DataGrid/types.d.ts +141 -1
  49. package/dist/components/DataGrid/types.d.ts.map +1 -1
  50. package/dist/components/DataGrid/utils.d.ts +2 -0
  51. package/dist/components/DataGrid/utils.d.ts.map +1 -1
  52. package/dist/components/DataGrid/utils.js +20 -0
  53. package/dist/components/DataGridCell.d.ts +5 -2
  54. package/dist/components/DataGridCell.d.ts.map +1 -1
  55. package/dist/components/DataGridCell.js +412 -0
  56. package/dist/components/DataTable.js +700 -0
  57. package/dist/components/DateInput.js +193 -0
  58. package/dist/components/DateRangeInput.js +368 -0
  59. package/dist/components/DebugJson.js +28 -0
  60. package/dist/components/Display.js +46 -0
  61. package/dist/components/EditingContext.js +34 -0
  62. package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
  63. package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
  64. package/dist/components/EmblaCarousel/index.js +153 -0
  65. package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
  66. package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
  67. package/dist/components/EmptyCartIcon.js +25 -0
  68. package/dist/components/FilterGroup.d.ts +5 -3
  69. package/dist/components/FilterGroup.d.ts.map +1 -1
  70. package/dist/components/FilterGroup.js +198 -0
  71. package/dist/components/FullViewportBox.js +19 -0
  72. package/dist/components/Grid.js +54 -0
  73. package/dist/components/Heading.js +50 -0
  74. package/dist/components/HorizontalDivider.js +20 -0
  75. package/dist/components/Icon.d.ts +5 -2
  76. package/dist/components/Icon.d.ts.map +1 -1
  77. package/dist/components/Icon.js +73 -0
  78. package/dist/components/ImagePlaceholder.js +22 -0
  79. package/dist/components/Input.d.ts +11 -9
  80. package/dist/components/Input.d.ts.map +1 -1
  81. package/dist/components/Input.js +469 -0
  82. package/dist/components/InputGroup.js +45 -0
  83. package/dist/components/Label.js +37 -0
  84. package/dist/components/Link.js +69 -0
  85. package/dist/components/List.js +12 -0
  86. package/dist/components/ListGroup.d.ts.map +1 -1
  87. package/dist/components/ListGroup.js +54 -0
  88. package/dist/components/LiveChatComponent.js +25 -0
  89. package/dist/components/LoadingScrim.js +22 -0
  90. package/dist/components/LogoAgilityTopBar.js +90 -0
  91. package/dist/components/LogoDMSiTopBar.js +54 -0
  92. package/dist/components/LogoMillworkTopBar.js +196 -0
  93. package/dist/components/MainBar.js +58 -0
  94. package/dist/components/MaxViewportBox.js +19 -0
  95. package/dist/components/Menu.d.ts.map +1 -1
  96. package/dist/components/Menu.js +202 -0
  97. package/dist/components/MenuOption.js +161 -0
  98. package/dist/components/MobileDataGrid/ColumnList.js +85 -0
  99. package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
  100. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
  101. package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
  102. package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
  103. package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
  104. package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
  105. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts +2 -1
  106. package/dist/components/MobileDataGrid/MobileDataGridCard/index.d.ts.map +1 -1
  107. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
  108. package/dist/components/MobileDataGrid/MobileDataGridHeader.d.ts.map +1 -1
  109. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
  110. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
  111. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.d.ts.map +1 -1
  112. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
  113. package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
  114. package/dist/components/MobileDataGrid/index.d.ts +1 -1
  115. package/dist/components/MobileDataGrid/index.d.ts.map +1 -1
  116. package/dist/components/MobileDataGrid/index.js +78 -0
  117. package/dist/components/MobileNavMenu.d.ts.map +1 -1
  118. package/dist/components/MobileNavMenu.js +173 -0
  119. package/dist/components/Modal.d.ts +1 -2
  120. package/dist/components/Modal.d.ts.map +1 -1
  121. package/dist/components/Modal.js +201 -0
  122. package/dist/components/ModalButtons.d.ts.map +1 -1
  123. package/dist/components/ModalButtons.js +57 -0
  124. package/dist/components/ModalContent.d.ts +1 -2
  125. package/dist/components/ModalContent.d.ts.map +1 -1
  126. package/dist/components/ModalContent.js +24 -0
  127. package/dist/components/ModalHeader.js +74 -0
  128. package/dist/components/ModalScrim.js +32 -0
  129. package/dist/components/NavigationTab.js +72 -0
  130. package/dist/components/NavigationTabs.js +45 -0
  131. package/dist/components/NestedMenu.d.ts.map +1 -1
  132. package/dist/components/NestedMenu.js +119 -0
  133. package/dist/components/Notification.js +91 -0
  134. package/dist/components/OptionPill.d.ts +2 -1
  135. package/dist/components/OptionPill.d.ts.map +1 -1
  136. package/dist/components/OptionPill.js +103 -0
  137. package/dist/components/OrderCheckIcon.js +28 -0
  138. package/dist/components/PDFViewer/DownloadIcon.js +25 -0
  139. package/dist/components/PDFViewer/PDFElement.js +77 -0
  140. package/dist/components/PDFViewer/PDFNavigation.js +64 -0
  141. package/dist/components/PDFViewer/PDFPage.js +28 -0
  142. package/dist/components/PDFViewer/index.d.ts.map +1 -1
  143. package/dist/components/PDFViewer/index.js +124 -0
  144. package/dist/components/Pagination.d.ts.map +1 -1
  145. package/dist/components/Pagination.js +117 -0
  146. package/dist/components/Paragraph.js +43 -0
  147. package/dist/components/Password.js +47 -0
  148. package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
  149. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts +2 -1
  150. package/dist/components/ProductImagePreview/MobileImageCarousel.d.ts.map +1 -1
  151. package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
  152. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts +2 -1
  153. package/dist/components/ProductImagePreview/ProductPrimaryImage.d.ts.map +1 -1
  154. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
  155. package/dist/components/ProductImagePreview/Thumbnail.d.ts +2 -1
  156. package/dist/components/ProductImagePreview/Thumbnail.d.ts.map +1 -1
  157. package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
  158. package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
  159. package/dist/components/ProductImagePreview/index.d.ts.map +1 -1
  160. package/dist/components/ProductImagePreview/index.js +189 -0
  161. package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
  162. package/dist/components/ProjectBar.d.ts +1 -1
  163. package/dist/components/ProjectBar.js +54 -0
  164. package/dist/components/Radio.js +113 -0
  165. package/dist/components/Search.js +89 -0
  166. package/dist/components/SearchResultImage/index.js +26 -0
  167. package/dist/components/Select.js +122 -0
  168. package/dist/components/SideMenu.js +24 -0
  169. package/dist/components/SideMenuGroup.js +80 -0
  170. package/dist/components/SideMenuItem.js +79 -0
  171. package/dist/components/SimpleTable.js +60 -0
  172. package/dist/components/SkeletonParagraph.js +24 -0
  173. package/dist/components/Spinner.d.ts +1 -1
  174. package/dist/components/Spinner.d.ts.map +1 -1
  175. package/dist/components/Spinner.js +30 -0
  176. package/dist/components/Stack.js +174 -0
  177. package/dist/components/StatusPill.js +44 -0
  178. package/dist/components/Stepper.js +138 -0
  179. package/dist/components/Subheader.d.ts +2 -1
  180. package/dist/components/Subheader.d.ts.map +1 -1
  181. package/dist/components/Subheader.js +41 -0
  182. package/dist/components/Surface.js +30 -0
  183. package/dist/components/Swatch.js +1498 -0
  184. package/dist/components/Textarea.js +106 -0
  185. package/dist/components/Theme.d.ts +1 -1
  186. package/dist/components/Theme.d.ts.map +1 -1
  187. package/dist/components/Theme.js +25 -0
  188. package/dist/components/Time.d.ts +2 -1
  189. package/dist/components/Time.d.ts.map +1 -1
  190. package/dist/components/Time.js +225 -0
  191. package/dist/components/Toast.d.ts +4 -3
  192. package/dist/components/Toast.d.ts.map +1 -1
  193. package/dist/components/Toast.js +170 -0
  194. package/dist/components/Tooltip.js +102 -0
  195. package/dist/components/TopBar.d.ts.map +1 -1
  196. package/dist/components/TopBar.js +119 -0
  197. package/dist/components/Upload.js +107 -0
  198. package/dist/components/WorldpayIframe.d.ts.map +1 -1
  199. package/dist/components/WorldpayIframe.js +19 -0
  200. package/dist/hooks/useEditCell.js +23 -0
  201. package/dist/hooks/useInfiniteScroll.js +25 -0
  202. package/dist/hooks/useKeydown.js +20 -0
  203. package/dist/hooks/useMatchesMedia.js +15 -0
  204. package/dist/hooks/useMenuSystem.js +186 -0
  205. package/dist/hooks/useMounted.js +9 -0
  206. package/dist/hooks/useTableLayout/computeColumns.js +59 -0
  207. package/dist/hooks/useTableLayout/storage.js +64 -0
  208. package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
  209. package/dist/index.js +249 -52864
  210. package/dist/lib/loadFonts.js +11 -0
  211. package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
  212. package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
  213. package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
  214. package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
  215. package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
  216. package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
  217. package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
  218. package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
  219. package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
  220. package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
  221. package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
  222. package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
  223. package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
  224. package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
  225. package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
  226. package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
  227. package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
  228. package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
  229. package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
  230. package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
  231. package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
  232. package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
  233. package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
  234. package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
  235. package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
  236. package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
  237. package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
  238. package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
  239. package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
  240. package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
  241. package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
  242. package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
  243. package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
  244. package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
  245. package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
  246. package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
  247. package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
  248. package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
  249. package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
  250. package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
  251. package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
  252. package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
  253. package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
  254. package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
  255. package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
  256. package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
  257. package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
  258. package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
  259. package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
  260. package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
  261. package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
  262. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
  263. package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
  264. package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
  265. package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
  266. package/dist/node_modules/clsx/dist/clsx.js +17 -0
  267. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
  268. package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
  269. package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
  270. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
  271. package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
  272. package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
  273. package/dist/static/no-results-image.png.js +4 -0
  274. package/dist/styles.css +1 -1
  275. package/dist/utils/date-patch-dashes.js +28 -0
  276. package/dist/utils/date.js +95 -0
  277. package/dist/utils/formatting.js +22 -0
  278. package/dist/utils/index.js +4 -0
  279. package/dist/utils/mergeObjectArrays.js +18 -0
  280. package/dist/utils.js +20 -0
  281. package/package.json +1 -1
  282. /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
@@ -0,0 +1,165 @@
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import { flexRender as D } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
3
+ import { Checkbox as N } from "../Checkbox.js";
4
+ import { DataCellHeader as T, DataGridCell as j } from "../DataGridCell.js";
5
+ import { Subheader as p } from "../Subheader.js";
6
+ import { Tooltip as P } from "../Tooltip.js";
7
+ import { clsx as h } from "../../node_modules/clsx/dist/clsx.js";
8
+ import { getSortIcon as w } from "./utils.js";
9
+ import V from "react";
10
+ import { TableBody as A } from "./TableBody/index.js";
11
+ import { ColumnSelectorHeaderCell as O } from "./ColumnSelectorHeaderCell/index.js";
12
+ import { SummaryRow as G } from "./SummaryRow/index.js";
13
+ function Y({
14
+ id: m,
15
+ pinDirection: r = "left",
16
+ table: e,
17
+ centerHeader: x,
18
+ allSelectedAcrossPages: v,
19
+ someSelectedAcrossPages: y,
20
+ toggleSelectAllAcrossPages: S,
21
+ testid: i,
22
+ enableColumnSelector: c,
23
+ toggleColumnVisibility: C,
24
+ resetColumnVisibility: R,
25
+ summaryRow: a,
26
+ filteredRows: k,
27
+ allRows: H,
28
+ totalRowCount: I,
29
+ allowUserGrouping: z,
30
+ ...s
31
+ }) {
32
+ const g = r === "left" ? e.getLeftHeaderGroups() : e.getRightHeaderGroups(), n = i ? `${r}-pinned-${i}` : void 0;
33
+ if (!(!(g[0]?.headers.length > 0) && !c))
34
+ return /* @__PURE__ */ d(
35
+ "table",
36
+ {
37
+ className: h(
38
+ "flex flex-col min-h-min sticky z-20",
39
+ r === "left" ? "left-0" : "right-0"
40
+ ),
41
+ "data-testid": n,
42
+ children: [
43
+ /* @__PURE__ */ t("thead", { className: "sticky top-0 z-20 grid", children: g.map((u) => /* @__PURE__ */ d(
44
+ "tr",
45
+ {
46
+ "data-testid": n ? `${n}-header-row-${u.id}` : void 0,
47
+ className: "flex w-full",
48
+ children: [
49
+ u.headers.map((o) => {
50
+ if (!o)
51
+ return;
52
+ const $ = e.getRowModel().rows[0]?.getValue(o.column.id), f = o.column.columnDef.meta?.align ?? (typeof $ == "number" ? "right" : "left");
53
+ if (typeof o.column.columnDef.header == "string") {
54
+ const b = o.column.columnDef.meta?.headerWidth;
55
+ return /* @__PURE__ */ d(
56
+ T,
57
+ {
58
+ locked: !0,
59
+ testid: n ? `${n}-header-${o.id}` : void 0,
60
+ header: o,
61
+ center: x,
62
+ allowUserGrouping: z,
63
+ width: b ?? `${o.column.getSize()}px`,
64
+ className: h(
65
+ o.column.getCanSort() ? "cursor-pointer" : "cursor-grab",
66
+ "group",
67
+ {
68
+ "justify-start": f === "left",
69
+ "justify-end": f === "right"
70
+ }
71
+ ),
72
+ children: [
73
+ /* @__PURE__ */ t(
74
+ P,
75
+ {
76
+ showOnTruncation: !0,
77
+ message: o.column.columnDef.header,
78
+ position: "bottom",
79
+ children: /* @__PURE__ */ t(p, { as: "p", addOverflow: !0, tall: !0, children: o.column.columnDef.header })
80
+ }
81
+ ),
82
+ w(o.column.getIsSorted()),
83
+ !o.column.getIsSorted() && o.column.getCanSort() && !e.getState().columnSizingInfo.isResizingColumn && w(o.column.getNextSortingOrder(), !0),
84
+ o.column.getSortIndex() !== -1 && e.getState().sorting.length > 1 && /* @__PURE__ */ t(p, { tall: !0, children: o.column.getSortIndex() + 1 }),
85
+ !o.column.columnDef.meta?.locked && /* @__PURE__ */ t(
86
+ "div",
87
+ {
88
+ onDoubleClick: (l) => {
89
+ l.stopPropagation(), o.column.resetSize();
90
+ },
91
+ onMouseDown: (l) => {
92
+ l.stopPropagation(), o.getResizeHandler()(l);
93
+ },
94
+ onTouchStart: (l) => {
95
+ l.stopPropagation(), o.getResizeHandler()(l);
96
+ },
97
+ className: "absolute right-0 inset-y-0 w-4 cursor-col-resize",
98
+ children: /* @__PURE__ */ t("div", { className: "absolute right-0 inset-y-0 w-px bg-black pointer-events-none" })
99
+ }
100
+ )
101
+ ]
102
+ },
103
+ o.id
104
+ );
105
+ }
106
+ return /* @__PURE__ */ t(V.Fragment, { children: o.column.columnDef.meta?.checkbox ? /* @__PURE__ */ t(j, { type: "header", component: "checkbox", locked: !0, children: /* @__PURE__ */ t(
107
+ N,
108
+ {
109
+ checked: v,
110
+ indeterminate: y,
111
+ onChange: S
112
+ }
113
+ ) }) : D(
114
+ o.column.columnDef.header,
115
+ o.getContext()
116
+ ) }, o.id);
117
+ }),
118
+ c && /* @__PURE__ */ t(
119
+ O,
120
+ {
121
+ id: m ? `${m}-column-selector` : void 0,
122
+ testid: i ? `${i}-column-selector` : void 0,
123
+ table: e,
124
+ toggleColumnVisibility: C ?? (() => {
125
+ }),
126
+ resetColumnVisibility: R ?? (() => {
127
+ })
128
+ }
129
+ )
130
+ ]
131
+ },
132
+ u.id
133
+ )) }),
134
+ /* @__PURE__ */ t(
135
+ A,
136
+ {
137
+ testid: n,
138
+ ...s,
139
+ table: e,
140
+ locked: !c || r === "right",
141
+ pinDirection: r,
142
+ hoveredRowId: s.hoveredRowId,
143
+ setHoveredRowId: s.setHoveredRowId
144
+ }
145
+ ),
146
+ a && /* @__PURE__ */ t(
147
+ G,
148
+ {
149
+ id: m,
150
+ testid: n,
151
+ table: e,
152
+ summaryConfig: a,
153
+ filteredRows: k ?? [],
154
+ allRows: H ?? [],
155
+ totalRowCount: I ?? 0,
156
+ locked: r
157
+ }
158
+ )
159
+ ]
160
+ }
161
+ );
162
+ }
163
+ export {
164
+ Y as PinnedColumns
165
+ };
@@ -0,0 +1,18 @@
1
+ import { SummaryCellDef } from '../types';
2
+ import { SummaryTemplateColumnInfo } from './aggregations';
3
+ interface SummaryCellProps<T> {
4
+ id?: string;
5
+ testid?: string;
6
+ /** Resolved definition for this cell — undefined renders a blank cell. */
7
+ cellDef?: SummaryCellDef<T>;
8
+ columnId: string;
9
+ filteredRows: T[];
10
+ allRows: T[];
11
+ totalRowCount: number;
12
+ colSpan?: number;
13
+ width: string;
14
+ getColumn: (columnId: string) => SummaryTemplateColumnInfo<T> | undefined;
15
+ }
16
+ export declare function SummaryCell<T>({ id, testid, cellDef, columnId, filteredRows, allRows, totalRowCount, colSpan, width, getColumn, }: SummaryCellProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=SummaryCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SummaryCell.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/SummaryRow/SummaryCell.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAiB,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,UAAU,gBAAgB,CAAC,CAAC;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,yBAAyB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC3E;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,EAC7B,EAAE,EACF,MAAM,EACN,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,aAAa,EACb,OAAO,EACP,KAAK,EACL,SAAS,GACV,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CA6CrB"}
@@ -0,0 +1,51 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { clsx as g } from "../../../node_modules/clsx/dist/clsx.js";
3
+ import { typography as h } from "../../../classNames.js";
4
+ import { DataGridCell as y } from "../../DataGridCell.js";
5
+ import { Label as f } from "../../Label.js";
6
+ import { Tooltip as v } from "../../Tooltip.js";
7
+ import { parseTemplate as b } from "./aggregations.js";
8
+ function G({
9
+ id: s,
10
+ testid: p,
11
+ cellDef: r,
12
+ columnId: n,
13
+ filteredRows: a,
14
+ allRows: d,
15
+ totalRowCount: l,
16
+ colSpan: e,
17
+ width: u,
18
+ getColumn: c
19
+ }) {
20
+ const o = r?.align ?? "left", m = r?.render ? r.render({ filteredRows: a, allRows: d, columnId: n }) : void 0, i = !r?.render && r?.template ? b(r.template, {
21
+ filteredRows: a,
22
+ totalRowCount: l,
23
+ columnId: n,
24
+ getColumn: c
25
+ }) : void 0;
26
+ return /* @__PURE__ */ t(
27
+ y,
28
+ {
29
+ id: s,
30
+ testid: p,
31
+ type: "summary",
32
+ width: u,
33
+ colSpan: e && e > 1 ? e : void 0,
34
+ className: g("bg-background-grouped-primary-normal", {
35
+ "justify-start": o === "left",
36
+ "justify-end": o === "right",
37
+ "justify-center": o === "center"
38
+ }),
39
+ children: i !== void 0 ? /* @__PURE__ */ t(v, { showOnTruncation: !0, message: i, position: "bottom", children: /* @__PURE__ */ t(f, { className: "!leading-6 whitespace-nowrap overflow-hidden text-ellipsis", children: i }) }) : m !== void 0 ? (
40
+ // A custom render result is an arbitrary ReactNode the consumer fully
41
+ // controls, so no truncation/tooltip wrapper is applied — but it still
42
+ // gets the same base typography as every other summary cell so a
43
+ // consumer's un-styled text matches the rest of the row by default.
44
+ /* @__PURE__ */ t("span", { className: h.label, children: m })
45
+ ) : null
46
+ }
47
+ );
48
+ }
49
+ export {
50
+ G as SummaryCell
51
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Sums a numeric accessor across a set of rows.
3
+ *
4
+ * Returns `undefined` (not `0`) if any row's value fails to parse as a
5
+ * number, per the non-numeric guard — callers should render a blank cell
6
+ * in that case rather than a misleading "0".
7
+ *
8
+ * The result is rounded to 2 decimal places to avoid floating point noise
9
+ * from repeated addition (e.g. 0.1 + 0.2 !== 0.3).
10
+ */
11
+ export declare function computeSum<T>(rows: T[], accessor: (row: T) => unknown): number | undefined;
12
+ /** Returns the number of rows — trivial, but kept alongside computeSum for symmetry with the template token API. */
13
+ export declare function computeCount<T>(rows: T[]): number;
14
+ export interface SummaryTemplateColumnInfo<T> {
15
+ /** Reads this column's raw value from a row. */
16
+ accessor: (row: T) => unknown;
17
+ /** The column's `meta.format`, if any (e.g. "currency"). */
18
+ format?: string;
19
+ }
20
+ export interface SummaryTemplateContext<T> {
21
+ /** Rows visible after active filters. */
22
+ filteredRows: T[];
23
+ /** Total row count regardless of active filters (e.g. the totalRowCount prop). */
24
+ totalRowCount: number;
25
+ /** The column ID this template belongs to — used when a token omits an explicit column id (e.g. {sum}). */
26
+ columnId: string;
27
+ /** Resolves accessor + format metadata for a given column ID. Returns undefined if the column can't be found. */
28
+ getColumn: (columnId: string) => SummaryTemplateColumnInfo<T> | undefined;
29
+ }
30
+ /**
31
+ * Replaces {count}, {total}, {sum}, and {sum,columnId} tokens in a template
32
+ * string with computed values. Unknown tokens and columns resolve to an
33
+ * empty string rather than throwing, so a misconfigured template degrades
34
+ * gracefully instead of breaking the grid.
35
+ */
36
+ export declare function parseTemplate<T>(template: string, context: SummaryTemplateContext<T>): string;
37
+ /** Builds the default "{count} Records" / "{count} of {total} Records" label. */
38
+ export declare function buildDefaultSummaryTemplate(filteredCount: number, totalCount: number): string;
39
+ //# sourceMappingURL=aggregations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregations.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/SummaryRow/aggregations.ts"],"names":[],"mappings":"AAwBA;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,IAAI,EAAE,CAAC,EAAE,EACT,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,GAC5B,MAAM,GAAG,SAAS,CAQpB;AAED,oHAAoH;AACpH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAEjD;AAED,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,gDAAgD;IAChD,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,OAAO,CAAC;IAC9B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,yCAAyC;IACzC,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,kFAAkF;IAClF,aAAa,EAAE,MAAM,CAAC;IACtB,2GAA2G;IAC3G,QAAQ,EAAE,MAAM,CAAC;IACjB,iHAAiH;IACjH,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,yBAAyB,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;CAC3E;AAID;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,MAAM,CA0BR;AAED,iFAAiF;AACjF,wBAAgB,2BAA2B,CACzC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,MAAM,CAIR"}
@@ -0,0 +1,55 @@
1
+ import { formatCurrencyDisplay as s } from "../../../utils/formatting.js";
2
+ function m(r) {
3
+ if (typeof r == "number")
4
+ return Number.isFinite(r) ? r : void 0;
5
+ if (typeof r == "string") {
6
+ const t = r.trim().replace(/,/g, "");
7
+ if (t === "") return 0;
8
+ const n = Number(t);
9
+ return Number.isFinite(n) ? n : void 0;
10
+ }
11
+ if (r == null) return 0;
12
+ }
13
+ function f(r, t) {
14
+ let n = 0;
15
+ for (const o of r) {
16
+ const e = m(t(o));
17
+ if (e === void 0) return;
18
+ n += e;
19
+ }
20
+ return Math.round(n * 100) / 100;
21
+ }
22
+ function a(r) {
23
+ return r.length;
24
+ }
25
+ const d = /\{(count|total|sum)(?:,([^}]+))?\}/g;
26
+ function p(r, t) {
27
+ return r.replace(
28
+ d,
29
+ (n, o, e) => {
30
+ switch (o) {
31
+ case "count":
32
+ return String(a(t.filteredRows));
33
+ case "total":
34
+ return String(t.totalRowCount);
35
+ case "sum": {
36
+ const c = e ?? t.columnId, u = t.getColumn(c);
37
+ if (!u) return "";
38
+ const i = f(t.filteredRows, u.accessor);
39
+ return i === void 0 ? "" : u.format === "currency" ? s(String(i)) : String(i);
40
+ }
41
+ default:
42
+ return "";
43
+ }
44
+ }
45
+ );
46
+ }
47
+ function g(r, t) {
48
+ return r === t ? `${r} Records` : `${r} of ${t} Records`;
49
+ }
50
+ export {
51
+ g as buildDefaultSummaryTemplate,
52
+ a as computeCount,
53
+ f as computeSum,
54
+ p as parseTemplate
55
+ };
@@ -0,0 +1,18 @@
1
+ import { RowData, Table } from '@tanstack/react-table';
2
+ import { DataGridSummaryRowConfig } from '../types';
3
+ interface SummaryRowProps<T extends RowData> {
4
+ id?: string;
5
+ testid?: string;
6
+ table: Table<T>;
7
+ summaryConfig: true | DataGridSummaryRowConfig<T>;
8
+ /** Rows visible after active filters — drives {count} and {sum}. */
9
+ filteredRows: T[];
10
+ /** All loaded rows regardless of active filters — passed through to custom `render` callbacks. */
11
+ allRows: T[];
12
+ /** Total row count regardless of filter, e.g. across server-side pages — drives {total}. */
13
+ totalRowCount: number;
14
+ locked: "left" | "right" | false;
15
+ }
16
+ export declare function SummaryRow<T extends RowData>({ id, testid, table, summaryConfig, filteredRows, allRows, totalRowCount, locked, }: SummaryRowProps<T>): import("react/jsx-runtime").JSX.Element | null;
17
+ export {};
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/SummaryRow/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAIpD,UAAU,eAAe,CAAC,CAAC,SAAS,OAAO;IACzC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAChB,aAAa,EAAE,IAAI,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAClD,oEAAoE;IACpE,YAAY,EAAE,CAAC,EAAE,CAAC;IAClB,kGAAkG;IAClG,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,4FAA4F;IAC5F,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;CAClC;AAYD,wBAAgB,UAAU,CAAC,CAAC,SAAS,OAAO,EAAE,EAC5C,EAAE,EACF,MAAM,EACN,KAAK,EACL,aAAa,EACb,YAAY,EACZ,OAAO,EACP,aAAa,EACb,MAAM,GACP,EAAE,eAAe,CAAC,CAAC,CAAC,kDAoHpB"}
@@ -0,0 +1,86 @@
1
+ import { jsx as C } from "react/jsx-runtime";
2
+ import { clsx as v } from "../../../node_modules/clsx/dist/clsx.js";
3
+ import { SummaryCell as x } from "./SummaryCell.js";
4
+ import { buildDefaultSummaryTemplate as D } from "./aggregations.js";
5
+ function b(m, o, n) {
6
+ return `${m.slice(o, o + n).reduce((u, a) => u + a.getSize(), 0)}px`;
7
+ }
8
+ function N({
9
+ id: m,
10
+ testid: o,
11
+ table: n,
12
+ summaryConfig: s,
13
+ filteredRows: c,
14
+ allRows: u,
15
+ totalRowCount: a,
16
+ locked: l
17
+ }) {
18
+ const i = l === "left" ? n.getLeftLeafColumns() : l === "right" ? n.getRightLeafColumns() : n.getCenterLeafColumns();
19
+ if (i.length === 0) return null;
20
+ const $ = [
21
+ ...n.getLeftLeafColumns(),
22
+ ...n.getCenterLeafColumns(),
23
+ ...n.getRightLeafColumns()
24
+ ].find(
25
+ (e) => !e.columnDef.meta?.checkbox
26
+ )?.id, S = (e) => {
27
+ const r = n.getColumn(e);
28
+ if (r?.accessorFn)
29
+ return {
30
+ // AccessorFn's second (index) argument is essentially never used by
31
+ // consumer-defined accessors in practice; summary aggregation has no
32
+ // meaningful row index, so 0 is passed.
33
+ accessor: (d) => r.accessorFn(d, 0),
34
+ format: r.columnDef.meta?.format
35
+ };
36
+ };
37
+ let f = 0;
38
+ return /* @__PURE__ */ C(
39
+ "tfoot",
40
+ {
41
+ className: v("sticky bottom-0 grid", l ? "z-20" : "z-10"),
42
+ "data-testid": o ? `${o}-summary-footer` : void 0,
43
+ children: /* @__PURE__ */ C(
44
+ "tr",
45
+ {
46
+ id: m,
47
+ className: "flex w-full border-t border-border-primary-normal bg-background-grouped-primary-normal",
48
+ "data-testid": o ? `${o}-summary-row` : void 0,
49
+ children: i.map((e, r) => {
50
+ if (f > 0)
51
+ return f -= 1, null;
52
+ const d = e.columnDef.meta?.checkbox, y = e.id === $, h = d ? void 0 : s === !0 ? y ? {
53
+ template: D(
54
+ c.length,
55
+ a
56
+ )
57
+ } : void 0 : s.cells[e.id], p = i.length - r, g = h?.colSpan ?? 1, t = Math.min(g, p);
58
+ g > p && console.warn(
59
+ `DataGrid summaryRow: colSpan of ${g} on column "${e.id}" exceeds the ${p} column(s) remaining in the ${l || "center"} section. Clamping to ${t}.`
60
+ ), t > 1 && (f = t - 1);
61
+ const L = t > 1 ? b(i, r, t) : `${e.getSize()}px`;
62
+ return /* @__PURE__ */ C(
63
+ x,
64
+ {
65
+ id: m ? `${m}-summary-cell-${e.id}` : void 0,
66
+ testid: o ? `${o}-summary-cell-${e.id}` : void 0,
67
+ cellDef: h,
68
+ columnId: e.id,
69
+ filteredRows: c,
70
+ allRows: u,
71
+ totalRowCount: a,
72
+ colSpan: t > 1 ? t : void 0,
73
+ width: L,
74
+ getColumn: S
75
+ },
76
+ e.id
77
+ );
78
+ })
79
+ }
80
+ )
81
+ }
82
+ );
83
+ }
84
+ export {
85
+ N as SummaryRow
86
+ };
@@ -0,0 +1,18 @@
1
+ import { Row, RowData } from '@tanstack/react-table';
2
+ import { VirtualItem, Virtualizer } from '@tanstack/react-virtual';
3
+ interface GroupRowProps<T extends RowData> {
4
+ id?: string;
5
+ testid?: string;
6
+ row: Row<T>;
7
+ virtualRow: VirtualItem;
8
+ showFilterRow: boolean;
9
+ locked: "left" | "right" | false;
10
+ groupRowMode?: "spanning" | "columns";
11
+ groupSelectionMode?: "group" | "row" | "both";
12
+ columnVirtualizer?: Virtualizer<HTMLDivElement, HTMLTableCellElement>;
13
+ virtualPaddingLeft?: number;
14
+ virtualPaddingRight?: number;
15
+ }
16
+ export declare function GroupRow<T extends RowData>({ id, testid, row, virtualRow, showFilterRow, locked, groupRowMode, groupSelectionMode, columnVirtualizer, virtualPaddingLeft, virtualPaddingRight, }: GroupRowProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=GroupRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GroupRow.d.ts","sourceRoot":"","sources":["../../../../src/components/DataGrid/TableBody/GroupRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAUnE,UAAU,aAAa,CAAC,CAAC,SAAS,OAAO;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IACjC,YAAY,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,kBAAkB,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC9C,iBAAiB,CAAC,EAAE,WAAW,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC;IACtE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAmCD,wBAAgB,QAAQ,CAAC,CAAC,SAAS,OAAO,EAAE,EAC1C,EAAE,EACF,MAAM,EACN,GAAG,EACH,UAAU,EACV,aAAa,EACb,MAAM,EACN,YAAyB,EACzB,kBAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACpB,EAAE,aAAa,CAAC,CAAC,CAAC,2CAsVlB"}