@dmsi/wedgekit-react 0.0.25 → 0.0.27

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 (217) hide show
  1. package/dist/{chunk-KDEPZ6I7.js → chunk-2S2Z3L56.js} +5 -1
  2. package/dist/{chunk-TU55CHXU.js → chunk-4JLU7TAC.js} +3 -1
  3. package/dist/{chunk-Z2LOGSGE.js → chunk-4N2PED4P.js} +15 -3
  4. package/dist/{chunk-U42SKNR6.js → chunk-57WRM337.js} +68 -30
  5. package/dist/{chunk-ZFGGZXB6.js → chunk-AY7ELVQY.js} +5 -2
  6. package/dist/{chunk-I2UVVKQI.js → chunk-CHTO7PW4.js} +3 -2
  7. package/dist/{chunk-WIDBAFBU.js → chunk-FWPJ73IK.js} +3 -1
  8. package/dist/{chunk-5TLFMKSR.js → chunk-INYI65WW.js} +15 -5
  9. package/dist/{chunk-TJ44JJCB.js → chunk-J6LETUNM.js} +5 -2
  10. package/dist/{chunk-T6HZARR7.js → chunk-MZJS2ZAU.js} +6 -3
  11. package/dist/{chunk-ZCBSLV7U.js → chunk-O4M2GISS.js} +5 -2
  12. package/dist/{chunk-OUTEIXV4.js → chunk-OUSNH76S.js} +11 -3
  13. package/dist/{chunk-YDREJNAS.js → chunk-PDDZ5PMY.js} +18 -4
  14. package/dist/{chunk-4RD5ZF2V.js → chunk-QBIEU25R.js} +10 -4
  15. package/dist/chunk-QUPHLL7D.js +61 -0
  16. package/dist/{chunk-OISE6NMA.js → chunk-QV2EFOYF.js} +17 -6
  17. package/dist/{chunk-YZQNTOIF.js → chunk-QZGUMB7T.js} +10 -5
  18. package/dist/{chunk-S7R37IUP.js → chunk-S5K22XTH.js} +5 -2
  19. package/dist/{chunk-GCPJH5R6.js → chunk-S5KPS4IQ.js} +22 -7
  20. package/dist/{chunk-VELXLFMJ.js → chunk-SAMX4YGM.js} +4 -1
  21. package/dist/{chunk-TWP6YSFO.js → chunk-SKHSGGO3.js} +14 -6
  22. package/dist/chunk-TVDFTRGL.js +57 -0
  23. package/dist/{chunk-N32PXOA5.js → chunk-UT7XCBZF.js} +9 -4
  24. package/dist/{chunk-L4UM372R.js → chunk-VC3R5EUH.js} +3 -0
  25. package/dist/{chunk-UIQ733QP.js → chunk-VG4EPHJA.js} +7 -3
  26. package/dist/components/Breadcrumbs.cjs +29 -9
  27. package/dist/components/Breadcrumbs.js +29 -9
  28. package/dist/components/Button.cjs +6 -3
  29. package/dist/components/Button.js +1 -1
  30. package/dist/components/CalendarRange.cjs +11 -3
  31. package/dist/components/CalendarRange.js +1 -1
  32. package/dist/components/Caption.cjs +53 -9
  33. package/dist/components/Caption.js +53 -9
  34. package/dist/components/Checkbox.cjs +15 -6
  35. package/dist/components/Checkbox.js +2 -2
  36. package/dist/components/ContentTab.cjs +20 -7
  37. package/dist/components/ContentTab.js +2 -2
  38. package/dist/components/ContentTabs.cjs +32 -18
  39. package/dist/components/ContentTabs.js +14 -13
  40. package/dist/components/DMSiLogo.cjs +22 -4
  41. package/dist/components/DMSiLogo.js +9 -5
  42. package/dist/components/DataGrid.cjs +374 -243
  43. package/dist/components/DataGrid.js +283 -226
  44. package/dist/components/DataGridCell.cjs +79 -21
  45. package/dist/components/DataGridCell.js +7 -7
  46. package/dist/components/DataTable.cjs +197 -139
  47. package/dist/components/DataTable.js +197 -139
  48. package/dist/components/DateInput.cjs +36 -10
  49. package/dist/components/DateInput.js +7 -3
  50. package/dist/components/DateRangeInput.cjs +36 -10
  51. package/dist/components/DateRangeInput.js +7 -3
  52. package/dist/components/DebugJson.cjs +21 -13
  53. package/dist/components/DebugJson.js +21 -13
  54. package/dist/components/Display.cjs +5 -2
  55. package/dist/components/Display.js +1 -1
  56. package/dist/components/EditingContext.cjs +4 -1
  57. package/dist/components/EditingContext.js +4 -1
  58. package/dist/components/FilterGroup.cjs +102 -32
  59. package/dist/components/FilterGroup.js +41 -17
  60. package/dist/components/FullViewportBox.cjs +10 -2
  61. package/dist/components/FullViewportBox.js +10 -2
  62. package/dist/components/Grid.cjs +3 -1
  63. package/dist/components/Grid.js +3 -1
  64. package/dist/components/Heading.cjs +5 -2
  65. package/dist/components/Heading.js +1 -1
  66. package/dist/components/HorizontalDivider.cjs +2 -2
  67. package/dist/components/HorizontalDivider.js +2 -2
  68. package/dist/components/Input.cjs +21 -7
  69. package/dist/components/Input.js +2 -2
  70. package/dist/components/InputGroup.cjs +13 -6
  71. package/dist/components/InputGroup.js +9 -5
  72. package/dist/components/Label.cjs +5 -2
  73. package/dist/components/Label.js +1 -1
  74. package/dist/components/List.cjs +3 -2
  75. package/dist/components/List.js +3 -2
  76. package/dist/components/LogoAgilityTopBar.cjs +22 -4
  77. package/dist/components/LogoAgilityTopBar.js +9 -5
  78. package/dist/components/LogoDMSiTopBar.cjs +22 -4
  79. package/dist/components/LogoDMSiTopBar.js +1 -1
  80. package/dist/components/LogoMillworkTopBar.cjs +22 -4
  81. package/dist/components/LogoMillworkTopBar.js +9 -5
  82. package/dist/components/MainBar.cjs +2 -0
  83. package/dist/components/MainBar.js +2 -0
  84. package/dist/components/Menu.cjs +3 -0
  85. package/dist/components/Menu.js +1 -1
  86. package/dist/components/MenuOption.cjs +28 -7
  87. package/dist/components/MenuOption.js +3 -3
  88. package/dist/components/MobileDataGrid.cjs +101 -46
  89. package/dist/components/MobileDataGrid.js +23 -11
  90. package/dist/components/Modal.cjs +96 -51
  91. package/dist/components/Modal.js +19 -7
  92. package/dist/components/ModalButtons.cjs +43 -26
  93. package/dist/components/ModalButtons.js +2 -2
  94. package/dist/components/ModalContent.cjs +3 -1
  95. package/dist/components/ModalContent.js +1 -1
  96. package/dist/components/ModalHeader.cjs +40 -25
  97. package/dist/components/ModalHeader.js +3 -3
  98. package/dist/components/ModalScrim.cjs +3 -1
  99. package/dist/components/ModalScrim.js +1 -1
  100. package/dist/components/NavigationTab.cjs +9 -3
  101. package/dist/components/NavigationTab.js +2 -2
  102. package/dist/components/NavigationTabs.cjs +15 -7
  103. package/dist/components/NavigationTabs.js +8 -6
  104. package/dist/components/NestedMenu.cjs +28 -7
  105. package/dist/components/NestedMenu.js +3 -3
  106. package/dist/components/Notification.cjs +84 -38
  107. package/dist/components/Notification.js +8 -4
  108. package/dist/components/OptionPill.cjs +24 -6
  109. package/dist/components/OptionPill.js +3 -3
  110. package/dist/components/Paragraph.cjs +7 -3
  111. package/dist/components/Paragraph.js +1 -1
  112. package/dist/components/Password.cjs +33 -11
  113. package/dist/components/Password.js +14 -6
  114. package/dist/components/ProjectBar.cjs +3 -1
  115. package/dist/components/ProjectBar.js +3 -1
  116. package/dist/components/Radio.cjs +13 -7
  117. package/dist/components/Radio.js +7 -5
  118. package/dist/components/Search.cjs +34 -12
  119. package/dist/components/Search.js +3 -3
  120. package/dist/components/Select.cjs +25 -7
  121. package/dist/components/Select.js +3 -3
  122. package/dist/components/SideMenu.cjs +6 -1
  123. package/dist/components/SideMenu.js +6 -1
  124. package/dist/components/SideMenuGroup.cjs +96 -49
  125. package/dist/components/SideMenuGroup.js +31 -19
  126. package/dist/components/SideMenuItem.cjs +99 -43
  127. package/dist/components/SideMenuItem.js +32 -12
  128. package/dist/components/Stack.cjs +91 -30
  129. package/dist/components/Stack.js +1 -1
  130. package/dist/components/StatusPill.cjs +13 -6
  131. package/dist/components/StatusPill.js +9 -5
  132. package/dist/components/Stepper.cjs +35 -17
  133. package/dist/components/Stepper.js +11 -10
  134. package/dist/components/Subheader.cjs +5 -2
  135. package/dist/components/Subheader.js +1 -1
  136. package/dist/components/Surface.cjs +5 -2
  137. package/dist/components/Surface.js +5 -2
  138. package/dist/components/Swatch.cjs +1544 -1308
  139. package/dist/components/Swatch.js +1469 -1275
  140. package/dist/components/Textarea.cjs +5 -2
  141. package/dist/components/Textarea.js +5 -2
  142. package/dist/components/Theme.cjs +3 -2
  143. package/dist/components/Theme.js +1 -1
  144. package/dist/components/Time.cjs +98 -40
  145. package/dist/components/Time.js +18 -6
  146. package/dist/components/Toast.cjs +38 -15
  147. package/dist/components/Toast.js +23 -10
  148. package/dist/components/Tooltip.cjs +5 -4
  149. package/dist/components/Tooltip.js +1 -1
  150. package/dist/components/TopBar.cjs +16 -8
  151. package/dist/components/TopBar.js +12 -5
  152. package/package.json +1 -1
  153. package/src/components/Breadcrumbs.tsx +24 -15
  154. package/src/components/Button.tsx +7 -3
  155. package/src/components/CalendarRange.tsx +9 -0
  156. package/src/components/Caption.tsx +36 -6
  157. package/src/components/Checkbox.tsx +7 -2
  158. package/src/components/ContentTab.tsx +13 -3
  159. package/src/components/ContentTabs.tsx +11 -8
  160. package/src/components/DMSiLogo.tsx +2 -1
  161. package/src/components/DataGrid.tsx +85 -23
  162. package/src/components/DataGridCell.tsx +15 -2
  163. package/src/components/DataTable.tsx +64 -14
  164. package/src/components/DateInput.tsx +5 -1
  165. package/src/components/DateRangeInput.tsx +5 -1
  166. package/src/components/DebugJson.tsx +7 -3
  167. package/src/components/Display.tsx +3 -0
  168. package/src/components/EditingContext.tsx +8 -6
  169. package/src/components/FilterGroup.tsx +23 -3
  170. package/src/components/FullViewportBox.tsx +6 -1
  171. package/src/components/Grid.tsx +3 -0
  172. package/src/components/Heading.tsx +3 -0
  173. package/src/components/HorizontalDivider.tsx +4 -2
  174. package/src/components/Input.tsx +19 -10
  175. package/src/components/InputGroup.tsx +8 -4
  176. package/src/components/Label.tsx +3 -0
  177. package/src/components/Link.tsx +1 -0
  178. package/src/components/List.tsx +7 -1
  179. package/src/components/LogoAgilityTopBar.tsx +2 -1
  180. package/src/components/LogoDMSiTopBar.tsx +2 -1
  181. package/src/components/LogoMillworkTopBar.tsx +2 -1
  182. package/src/components/MainBar.tsx +3 -0
  183. package/src/components/Menu.tsx +3 -0
  184. package/src/components/MenuOption.tsx +72 -58
  185. package/src/components/MobileDataGrid.tsx +15 -4
  186. package/src/components/Modal.tsx +10 -1
  187. package/src/components/ModalButtons.tsx +12 -1
  188. package/src/components/ModalContent.tsx +3 -0
  189. package/src/components/ModalHeader.tsx +16 -6
  190. package/src/components/ModalScrim.tsx +3 -0
  191. package/src/components/NavigationTab.tsx +6 -3
  192. package/src/components/NavigationTabs.tsx +5 -2
  193. package/src/components/Notification.tsx +4 -0
  194. package/src/components/OptionPill.tsx +9 -1
  195. package/src/components/Paragraph.tsx +3 -0
  196. package/src/components/Password.tsx +9 -3
  197. package/src/components/ProjectBar.tsx +3 -0
  198. package/src/components/Radio.tsx +3 -2
  199. package/src/components/Search.tsx +56 -41
  200. package/src/components/Select.tsx +6 -1
  201. package/src/components/SideMenu.tsx +7 -1
  202. package/src/components/SideMenuGroup.tsx +13 -2
  203. package/src/components/SideMenuItem.tsx +15 -2
  204. package/src/components/Stack.tsx +8 -3
  205. package/src/components/StatusPill.tsx +4 -2
  206. package/src/components/Stepper.tsx +5 -5
  207. package/src/components/Subheader.tsx +3 -0
  208. package/src/components/Surface.tsx +3 -0
  209. package/src/components/Swatch.tsx +415 -140
  210. package/src/components/Textarea.tsx +6 -3
  211. package/src/components/Theme.tsx +3 -1
  212. package/src/components/Time.tsx +21 -5
  213. package/src/components/Toast.tsx +29 -14
  214. package/src/components/Tooltip.tsx +46 -32
  215. package/src/components/TopBar.tsx +7 -3
  216. package/dist/chunk-DBYSGYST.js +0 -47
  217. package/dist/chunk-UK3WG7HQ.js +0 -48
@@ -267,13 +267,14 @@ var EditingProvider = ({ data, children }) => {
267
267
  });
268
268
  }
269
269
  };
270
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditingContext, { value: context, children });
270
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditingContext.Provider, { value: context, children });
271
271
  };
272
- var DataTable = ({ data }) => {
273
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditingProvider, { data, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataTableInternals, {}) });
272
+ var DataTable = ({ id, data }) => {
273
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EditingProvider, { data, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DataTableInternals, { id }) });
274
274
  };
275
275
  var DraggableTableHeader = ({
276
- header
276
+ header,
277
+ id
277
278
  }) => {
278
279
  var _a, _b, _c, _d;
279
280
  const { attributes, isDragging, listeners, setNodeRef, transform } = (0, import_sortable2.useSortable)({
@@ -291,6 +292,7 @@ var DraggableTableHeader = ({
291
292
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
292
293
  "th",
293
294
  {
295
+ id,
294
296
  colSpan: header.colSpan,
295
297
  ref: setNodeRef,
296
298
  style,
@@ -305,6 +307,7 @@ var DraggableTableHeader = ({
305
307
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
306
308
  "button",
307
309
  __spreadProps(__spreadValues(__spreadValues({
310
+ id: id ? `${id}-drag-handle` : void 0,
308
311
  className: "cursor-grab shrink-0"
309
312
  }, attributes), listeners), {
310
313
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-3 h-3" })
@@ -321,13 +324,26 @@ var DraggableTableHeader = ({
321
324
  title: header.column.getCanSort() ? header.column.getNextSortingOrder() === "asc" ? "Sort ascending" : header.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort" : void 0,
322
325
  children: [
323
326
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: (0, import_react_table.flexRender)(header.column.columnDef.header, header.getContext()) }),
324
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: header.column.getCanFilter() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Filter, { column: header.column }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "invisible", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Filter, { column: header.column }) }) })
327
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: header.column.getCanFilter() ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
328
+ Filter,
329
+ {
330
+ id: id ? `${id}-filter` : void 0,
331
+ column: header.column
332
+ }
333
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "invisible", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
334
+ Filter,
335
+ {
336
+ id: id ? `${id}-filter` : void 0,
337
+ column: header.column
338
+ }
339
+ ) }) })
325
340
  ]
326
341
  }
327
342
  ),
328
343
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
329
344
  "div",
330
345
  {
346
+ id: id ? `${id}-sort-button` : void 0,
331
347
  className: "shrink-0 cursor-pointer",
332
348
  onClick: header.column.getToggleSortingHandler(),
333
349
  children: (_d = {
@@ -342,7 +358,8 @@ var DraggableTableHeader = ({
342
358
  };
343
359
  var DragAlongCell = ({
344
360
  cell,
345
- setValue
361
+ setValue,
362
+ id
346
363
  }) => {
347
364
  var _a, _b, _c, _d;
348
365
  const { isDragging, setNodeRef, transform } = (0, import_sortable2.useSortable)({
@@ -359,6 +376,7 @@ var DragAlongCell = ({
359
376
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
360
377
  EditCell,
361
378
  {
379
+ id,
362
380
  ref: setNodeRef,
363
381
  style,
364
382
  cell,
@@ -373,7 +391,7 @@ var DragAlongCell = ({
373
391
  }
374
392
  );
375
393
  };
376
- var DataTableInternals = () => {
394
+ var DataTableInternals = ({ id }) => {
377
395
  const { data, setValue } = (0, import_react2.useContext)(EditingContext);
378
396
  const [columnOrder, setColumnOrder] = import_react2.default.useState(
379
397
  () => columns.map((c) => c.id)
@@ -438,36 +456,51 @@ var DataTableInternals = () => {
438
456
  modifiers: [import_modifiers.restrictToHorizontalAxis],
439
457
  onDragEnd: handleDragEnd,
440
458
  sensors,
441
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
442
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "border border-gray-300 rounded p-3 m-4 max-w-xl min-w-0", children: [
443
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mb-3 font-semibold", children: "Show/Hide Columns" }),
444
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-2", children: table.getAllColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
445
- "label",
446
- {
447
- className: "cursor-pointer flex flex-row items-center space-x-1",
448
- children: [
449
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
450
- Toggle,
451
- {
452
- enabled: column.getIsVisible(),
453
- onToggle: (checked) => column.getToggleVisibilityHandler()({
454
- target: { checked }
455
- })
456
- }
457
- ),
458
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block", children: column.columnDef.header })
459
- ]
460
- },
461
- column.id
462
- )) })
463
- ] }),
459
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id, children: [
460
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
461
+ "div",
462
+ {
463
+ id: id ? `${id}-column-visibility` : void 0,
464
+ className: "border border-gray-300 rounded p-3 m-4 max-w-xl min-w-0",
465
+ children: [
466
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mb-3 font-semibold", children: "Show/Hide Columns" }),
467
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-2", children: table.getAllColumns().map((column) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
468
+ "label",
469
+ {
470
+ className: "cursor-pointer flex flex-row items-center space-x-1",
471
+ children: [
472
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
473
+ Toggle,
474
+ {
475
+ id: id ? `${id}-toggle-${column.id}` : void 0,
476
+ enabled: column.getIsVisible(),
477
+ onToggle: (checked) => column.getToggleVisibilityHandler()({
478
+ target: { checked }
479
+ })
480
+ }
481
+ ),
482
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "block", children: column.columnDef.header })
483
+ ]
484
+ },
485
+ column.id
486
+ )) })
487
+ ]
488
+ }
489
+ ),
464
490
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-x-scroll scrollbar-thin", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("table", { className: "min-w-full divide-x divide-neutral-500", children: [
465
491
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
466
492
  import_sortable.SortableContext,
467
493
  {
468
494
  items: columnOrder,
469
495
  strategy: import_sortable.horizontalListSortingStrategy,
470
- children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DraggableTableHeader, { header }, header.id))
496
+ children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
497
+ DraggableTableHeader,
498
+ {
499
+ id: id ? `${id}-header-${header.id}` : void 0,
500
+ header
501
+ },
502
+ header.id
503
+ ))
471
504
  }
472
505
  ) }, headerGroup.id)) }),
473
506
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("tbody", { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -482,6 +515,7 @@ var DataTableInternals = () => {
482
515
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
483
516
  DragAlongCell,
484
517
  {
518
+ id: id ? `${id}-cell-${cell.id}` : void 0,
485
519
  cell,
486
520
  setValue
487
521
  },
@@ -494,132 +528,146 @@ var DataTableInternals = () => {
494
528
  row.id
495
529
  )) })
496
530
  ] }) }),
497
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-6 md:flex-row items-center md:gap-2 w-full justify-between p-2", children: [
498
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-row items-center", children: [
499
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
500
- "button",
501
- {
502
- className: (0, import_clsx.default)(
503
- "group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 rounded p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer border-r-0 rounded-r-none",
531
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
532
+ "div",
533
+ {
534
+ id: id ? `${id}-pagination` : void 0,
535
+ className: "flex flex-col gap-6 md:flex-row items-center md:gap-2 w-full justify-between p-2",
536
+ children: [
537
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-row items-center", children: [
538
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
539
+ "button",
504
540
  {
505
- "pointer-events-none": !table.getCanPreviousPage()
541
+ id: id ? `${id}-first-page` : void 0,
542
+ className: (0, import_clsx.default)(
543
+ "group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 rounded p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer border-r-0 rounded-r-none",
544
+ {
545
+ "pointer-events-none": !table.getCanPreviousPage()
546
+ }
547
+ ),
548
+ onClick: () => table.setPageIndex(0),
549
+ disabled: !table.getCanPreviousPage(),
550
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
506
551
  }
507
552
  ),
508
- onClick: () => table.setPageIndex(0),
509
- disabled: !table.getCanPreviousPage(),
510
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
511
- }
512
- ),
513
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
514
- "button",
515
- {
516
- className: (0, import_clsx.default)(
517
- "-mr-px group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer",
553
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
554
+ "button",
518
555
  {
519
- "pointer-events-none": !table.getCanPreviousPage()
556
+ id: id ? `${id}-prev-page` : void 0,
557
+ className: (0, import_clsx.default)(
558
+ "-mr-px group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer",
559
+ {
560
+ "pointer-events-none": !table.getCanPreviousPage()
561
+ }
562
+ ),
563
+ onClick: () => table.previousPage(),
564
+ disabled: !table.getCanPreviousPage(),
565
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
520
566
  }
521
567
  ),
522
- onClick: () => table.previousPage(),
523
- disabled: !table.getCanPreviousPage(),
524
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
525
- }
526
- ),
527
- Array.from({ length: Math.min(5, table.getPageCount()) }).map(
528
- (_, i) => {
529
- const current = table.getState().pagination.pageIndex;
530
- const index = current - 2 + i;
531
- const active = index === current;
532
- if (index < 0) return;
533
- if (index > table.getPageCount() - 1) return;
534
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
568
+ Array.from({ length: Math.min(5, table.getPageCount()) }).map(
569
+ (_, i) => {
570
+ const current = table.getState().pagination.pageIndex;
571
+ const index = current - 2 + i;
572
+ const active = index === current;
573
+ if (index < 0) return null;
574
+ if (index > table.getPageCount() - 1) return null;
575
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
576
+ "button",
577
+ {
578
+ id: id ? `${id}-page-${index + 1}` : void 0,
579
+ className: (0, import_clsx.default)(
580
+ "group h-8 w-8 border-y border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer flex items-center justify-center",
581
+ {
582
+ "bg-neutral-200 border-x": active,
583
+ "border-r-0": !active
584
+ }
585
+ ),
586
+ onClick: () => table.setPageIndex(index),
587
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_clsx.default)({}), children: index + 1 })
588
+ },
589
+ i
590
+ );
591
+ }
592
+ ),
593
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
535
594
  "button",
536
595
  {
596
+ id: id ? `${id}-next-page` : void 0,
537
597
  className: (0, import_clsx.default)(
538
- "group h-8 w-8 border-y border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer flex items-center justify-center",
598
+ "-ml-px group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer border-r-0 group",
539
599
  {
540
- "bg-neutral-200 border-x": active,
541
- "border-r-0": !active
600
+ "pointer-events-none": !table.getCanNextPage()
542
601
  }
543
602
  ),
544
- onClick: () => table.setPageIndex(index),
545
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_clsx.default)({}), children: index + 1 })
546
- },
547
- i
548
- );
549
- }
550
- ),
551
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
552
- "button",
553
- {
554
- className: (0, import_clsx.default)(
555
- "-ml-px group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer border-r-0 group",
556
- {
557
- "pointer-events-none": !table.getCanNextPage()
603
+ onClick: () => table.nextPage(),
604
+ disabled: !table.getCanNextPage(),
605
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400 " })
558
606
  }
559
607
  ),
560
- onClick: () => table.nextPage(),
561
- disabled: !table.getCanNextPage(),
562
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400 " })
563
- }
564
- ),
565
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
566
- "button",
567
- {
568
- className: (0, import_clsx.default)(
569
- "group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 rounded rounded-l-none p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer",
608
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
609
+ "button",
570
610
  {
571
- "pointer-events-none": !table.getCanNextPage()
611
+ id: id ? `${id}-last-page` : void 0,
612
+ className: (0, import_clsx.default)(
613
+ "group flex items-center justify-center h-8 w-8 border border-gray-500/50 text-gray-700 rounded rounded-l-none p-1 hover:bg-dmsi-blue hover:text-white transition-colors cursor-pointer",
614
+ {
615
+ "pointer-events-none": !table.getCanNextPage()
616
+ }
617
+ ),
618
+ onClick: () => table.setPageIndex(table.getPageCount() - 1),
619
+ disabled: !table.getCanNextPage(),
620
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
572
621
  }
573
- ),
574
- onClick: () => table.setPageIndex(table.getPageCount() - 1),
575
- disabled: !table.getCanNextPage(),
576
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
577
- }
578
- )
579
- ] }),
580
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-row items-center gap-6", children: [
581
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1", children: [
582
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Page" }),
583
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
584
- table.getState().pagination.pageIndex + 1,
585
- " of",
586
- " ",
587
- table.getPageCount()
588
- ] })
589
- ] }),
590
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-2", children: [
591
- "Page:",
622
+ )
623
+ ] }),
624
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-row items-center gap-6", children: [
625
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-1", children: [
626
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "Page" }),
627
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("strong", { children: [
628
+ table.getState().pagination.pageIndex + 1,
629
+ " of",
630
+ " ",
631
+ table.getPageCount()
632
+ ] })
633
+ ] }),
634
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "flex items-center gap-2", children: [
635
+ "Page:",
636
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
637
+ "input",
638
+ {
639
+ id: id ? `${id}-page-input` : void 0,
640
+ type: "number",
641
+ min: "1",
642
+ max: table.getPageCount(),
643
+ defaultValue: table.getState().pagination.pageIndex + 1,
644
+ onChange: (e) => {
645
+ const page = e.target.value ? Number(e.target.value) - 1 : 0;
646
+ table.setPageIndex(page);
647
+ },
648
+ className: "border border-gray-500 px-2 py-1 rounded w-16"
649
+ }
650
+ )
651
+ ] })
652
+ ] }),
592
653
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
593
- "input",
654
+ "select",
594
655
  {
595
- type: "number",
596
- min: "1",
597
- max: table.getPageCount(),
598
- defaultValue: table.getState().pagination.pageIndex + 1,
656
+ id: id ? `${id}-pagesize-select` : void 0,
657
+ className: "border border-gray-500 px-2 py-1 rounded",
658
+ value: table.getState().pagination.pageSize,
599
659
  onChange: (e) => {
600
- const page = e.target.value ? Number(e.target.value) - 1 : 0;
601
- table.setPageIndex(page);
660
+ table.setPageSize(Number(e.target.value));
602
661
  },
603
- className: "border border-gray-500 px-2 py-1 rounded w-16"
662
+ children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: pageSize, children: [
663
+ "Show ",
664
+ pageSize
665
+ ] }, pageSize))
604
666
  }
605
667
  )
606
- ] })
607
- ] }),
608
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
609
- "select",
610
- {
611
- className: "border border-gray-500 px-2 py-1 rounded",
612
- value: table.getState().pagination.pageSize,
613
- onChange: (e) => {
614
- table.setPageSize(Number(e.target.value));
615
- },
616
- children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("option", { value: pageSize, children: [
617
- "Show ",
618
- pageSize
619
- ] }, pageSize))
620
- }
621
- )
622
- ] })
668
+ ]
669
+ }
670
+ )
623
671
  ] })
624
672
  }
625
673
  );
@@ -629,7 +677,8 @@ function EditCell({
629
677
  cell,
630
678
  setValue,
631
679
  style,
632
- ref
680
+ ref,
681
+ id
633
682
  }) {
634
683
  var _a, _b;
635
684
  const [editing, setEditing] = (0, import_react2.useState)(false);
@@ -656,6 +705,7 @@ function EditCell({
656
705
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
657
706
  "td",
658
707
  {
708
+ id,
659
709
  className: (0, import_clsx.default)(
660
710
  className,
661
711
  (_b = (_a = cell.column.columnDef.meta) == null ? void 0 : _a.className) != null ? _b : "",
@@ -668,6 +718,7 @@ function EditCell({
668
718
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
669
719
  "input",
670
720
  {
721
+ id: id ? `${id}-input` : void 0,
671
722
  type: "text",
672
723
  value: editedValue,
673
724
  onChange: onEditValue,
@@ -679,6 +730,7 @@ function EditCell({
679
730
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
680
731
  "button",
681
732
  {
733
+ id: id ? `${id}-save-button` : void 0,
682
734
  onClick: onStopEdit,
683
735
  className: "border cursor-pointer px-2 py-0.5 rounded flex items-center justify-center w-12 border-dmsi-blue text-dmsi-blue bg-white",
684
736
  children: "Save"
@@ -701,15 +753,16 @@ function EditCell({
701
753
  cell.id
702
754
  );
703
755
  }
704
- function Filter({ column }) {
756
+ function Filter({ column, id }) {
705
757
  var _a, _b, _c, _d, _e;
706
758
  const columnFilterValue = column.getFilterValue();
707
759
  const { filterVariant } = (_a = column.columnDef.meta) != null ? _a : {};
708
- return filterVariant === "range" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
760
+ return filterVariant === "range" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { id, children: [
709
761
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex space-x-2", children: [
710
762
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
711
763
  "input",
712
764
  {
765
+ id: id ? `${id}-min` : void 0,
713
766
  className: "block w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-neutral-400 sm:text-sm/6",
714
767
  type: "number",
715
768
  value: (_b = columnFilterValue == null ? void 0 : columnFilterValue[0]) != null ? _b : "",
@@ -724,6 +777,7 @@ function Filter({ column }) {
724
777
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
725
778
  "input",
726
779
  {
780
+ id: id ? `${id}-max` : void 0,
727
781
  className: "block w-full rounded-md bg-white px-3 py-0.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-neutral-400 sm:text-sm/6",
728
782
  type: "number",
729
783
  value: (_c = columnFilterValue == null ? void 0 : columnFilterValue[1]) != null ? _c : "",
@@ -740,6 +794,7 @@ function Filter({ column }) {
740
794
  ] }) : filterVariant === "select" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
741
795
  "select",
742
796
  {
797
+ id,
743
798
  className: "block min-w-36 w-full rounded-md bg-white px-2 py-2 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-neutral-400 sm:text-sm/6",
744
799
  onChange: (e) => column.setFilterValue(e.target.value),
745
800
  value: columnFilterValue == null ? void 0 : columnFilterValue.toString(),
@@ -753,6 +808,7 @@ function Filter({ column }) {
753
808
  ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
754
809
  "input",
755
810
  {
811
+ id,
756
812
  className: "block min-w-36 w-full rounded-md bg-white px-3 py-1.5 text-base text-gray-900 outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline-2 focus:-outline-offset-2 focus:outline-neutral-400 sm:text-sm/6",
757
813
  onChange: (e) => column.setFilterValue(e.target.value),
758
814
  placeholder: (_e = (_d = column.columnDef.header) == null ? void 0 : _d.toString()) != null ? _e : "...",
@@ -765,11 +821,13 @@ function Filter({ column }) {
765
821
  import_react3.Switch.displayName = "Switch";
766
822
  function Toggle({
767
823
  enabled,
768
- onToggle
824
+ onToggle,
825
+ id
769
826
  }) {
770
827
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
771
828
  import_react3.Switch,
772
829
  {
830
+ id,
773
831
  checked: enabled,
774
832
  onChange: onToggle,
775
833
  className: "group relative flex h-4 w-7 cursor-pointer rounded-full p-0.5 transition-colors duration-200 ease-in-out focus:outline-none data-[focus]:outline-1 data-[focus]:outline-white bg-neutral-900/10 data-[checked]:bg-dmsi-blue",