@dmsi/wedgekit-react 0.0.26 → 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.
- package/dist/{chunk-KDEPZ6I7.js → chunk-2S2Z3L56.js} +5 -1
- package/dist/{chunk-TU55CHXU.js → chunk-4JLU7TAC.js} +3 -1
- package/dist/{chunk-Z2LOGSGE.js → chunk-4N2PED4P.js} +15 -3
- package/dist/{chunk-U42SKNR6.js → chunk-57WRM337.js} +68 -30
- package/dist/{chunk-ZFGGZXB6.js → chunk-AY7ELVQY.js} +5 -2
- package/dist/{chunk-I2UVVKQI.js → chunk-CHTO7PW4.js} +3 -2
- package/dist/{chunk-WIDBAFBU.js → chunk-FWPJ73IK.js} +3 -1
- package/dist/{chunk-5TLFMKSR.js → chunk-INYI65WW.js} +15 -5
- package/dist/{chunk-TJ44JJCB.js → chunk-J6LETUNM.js} +5 -2
- package/dist/{chunk-T6HZARR7.js → chunk-MZJS2ZAU.js} +6 -3
- package/dist/{chunk-ZCBSLV7U.js → chunk-O4M2GISS.js} +5 -2
- package/dist/{chunk-OUTEIXV4.js → chunk-OUSNH76S.js} +11 -3
- package/dist/{chunk-YDREJNAS.js → chunk-PDDZ5PMY.js} +18 -4
- package/dist/{chunk-4RD5ZF2V.js → chunk-QBIEU25R.js} +10 -4
- package/dist/chunk-QUPHLL7D.js +61 -0
- package/dist/{chunk-OISE6NMA.js → chunk-QV2EFOYF.js} +17 -6
- package/dist/{chunk-YZQNTOIF.js → chunk-QZGUMB7T.js} +10 -5
- package/dist/{chunk-S7R37IUP.js → chunk-S5K22XTH.js} +5 -2
- package/dist/{chunk-GCPJH5R6.js → chunk-S5KPS4IQ.js} +22 -7
- package/dist/{chunk-VELXLFMJ.js → chunk-SAMX4YGM.js} +4 -1
- package/dist/{chunk-TWP6YSFO.js → chunk-SKHSGGO3.js} +14 -6
- package/dist/chunk-TVDFTRGL.js +57 -0
- package/dist/{chunk-N32PXOA5.js → chunk-UT7XCBZF.js} +9 -4
- package/dist/{chunk-L4UM372R.js → chunk-VC3R5EUH.js} +3 -0
- package/dist/{chunk-UIQ733QP.js → chunk-VG4EPHJA.js} +7 -3
- package/dist/components/Breadcrumbs.cjs +29 -9
- package/dist/components/Breadcrumbs.js +29 -9
- package/dist/components/Button.cjs +6 -3
- package/dist/components/Button.js +1 -1
- package/dist/components/CalendarRange.cjs +11 -3
- package/dist/components/CalendarRange.js +1 -1
- package/dist/components/Caption.cjs +53 -9
- package/dist/components/Caption.js +53 -9
- package/dist/components/Checkbox.cjs +15 -6
- package/dist/components/Checkbox.js +2 -2
- package/dist/components/ContentTab.cjs +20 -7
- package/dist/components/ContentTab.js +2 -2
- package/dist/components/ContentTabs.cjs +32 -18
- package/dist/components/ContentTabs.js +14 -13
- package/dist/components/DMSiLogo.cjs +22 -4
- package/dist/components/DMSiLogo.js +9 -5
- package/dist/components/DataGrid.cjs +374 -243
- package/dist/components/DataGrid.js +283 -226
- package/dist/components/DataGridCell.cjs +79 -21
- package/dist/components/DataGridCell.js +7 -7
- package/dist/components/DataTable.cjs +197 -139
- package/dist/components/DataTable.js +197 -139
- package/dist/components/DateInput.cjs +36 -10
- package/dist/components/DateInput.js +7 -3
- package/dist/components/DateRangeInput.cjs +36 -10
- package/dist/components/DateRangeInput.js +7 -3
- package/dist/components/DebugJson.cjs +21 -13
- package/dist/components/DebugJson.js +21 -13
- package/dist/components/Display.cjs +5 -2
- package/dist/components/Display.js +1 -1
- package/dist/components/EditingContext.cjs +4 -1
- package/dist/components/EditingContext.js +4 -1
- package/dist/components/FilterGroup.cjs +102 -32
- package/dist/components/FilterGroup.js +41 -17
- package/dist/components/FullViewportBox.cjs +10 -2
- package/dist/components/FullViewportBox.js +10 -2
- package/dist/components/Grid.cjs +3 -1
- package/dist/components/Grid.js +3 -1
- package/dist/components/Heading.cjs +5 -2
- package/dist/components/Heading.js +1 -1
- package/dist/components/HorizontalDivider.cjs +2 -2
- package/dist/components/HorizontalDivider.js +2 -2
- package/dist/components/Input.cjs +21 -7
- package/dist/components/Input.js +2 -2
- package/dist/components/InputGroup.cjs +13 -6
- package/dist/components/InputGroup.js +9 -5
- package/dist/components/Label.cjs +5 -2
- package/dist/components/Label.js +1 -1
- package/dist/components/List.cjs +3 -2
- package/dist/components/List.js +3 -2
- package/dist/components/LogoAgilityTopBar.cjs +22 -4
- package/dist/components/LogoAgilityTopBar.js +9 -5
- package/dist/components/LogoDMSiTopBar.cjs +22 -4
- package/dist/components/LogoDMSiTopBar.js +1 -1
- package/dist/components/LogoMillworkTopBar.cjs +22 -4
- package/dist/components/LogoMillworkTopBar.js +9 -5
- package/dist/components/MainBar.cjs +2 -0
- package/dist/components/MainBar.js +2 -0
- package/dist/components/Menu.cjs +3 -0
- package/dist/components/Menu.js +1 -1
- package/dist/components/MenuOption.cjs +28 -7
- package/dist/components/MenuOption.js +3 -3
- package/dist/components/MobileDataGrid.cjs +101 -46
- package/dist/components/MobileDataGrid.js +23 -11
- package/dist/components/Modal.cjs +96 -51
- package/dist/components/Modal.js +19 -7
- package/dist/components/ModalButtons.cjs +43 -26
- package/dist/components/ModalButtons.js +2 -2
- package/dist/components/ModalContent.cjs +3 -1
- package/dist/components/ModalContent.js +1 -1
- package/dist/components/ModalHeader.cjs +40 -25
- package/dist/components/ModalHeader.js +3 -3
- package/dist/components/ModalScrim.cjs +3 -1
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/NavigationTab.cjs +9 -3
- package/dist/components/NavigationTab.js +2 -2
- package/dist/components/NavigationTabs.cjs +15 -7
- package/dist/components/NavigationTabs.js +8 -6
- package/dist/components/NestedMenu.cjs +28 -7
- package/dist/components/NestedMenu.js +3 -3
- package/dist/components/Notification.cjs +84 -38
- package/dist/components/Notification.js +8 -4
- package/dist/components/OptionPill.cjs +24 -6
- package/dist/components/OptionPill.js +3 -3
- package/dist/components/Paragraph.cjs +7 -3
- package/dist/components/Paragraph.js +1 -1
- package/dist/components/Password.cjs +33 -11
- package/dist/components/Password.js +14 -6
- package/dist/components/ProjectBar.cjs +3 -1
- package/dist/components/ProjectBar.js +3 -1
- package/dist/components/Radio.cjs +13 -7
- package/dist/components/Radio.js +7 -5
- package/dist/components/Search.cjs +34 -12
- package/dist/components/Search.js +3 -3
- package/dist/components/Select.cjs +25 -7
- package/dist/components/Select.js +3 -3
- package/dist/components/SideMenu.cjs +6 -1
- package/dist/components/SideMenu.js +6 -1
- package/dist/components/SideMenuGroup.cjs +96 -49
- package/dist/components/SideMenuGroup.js +31 -19
- package/dist/components/SideMenuItem.cjs +99 -43
- package/dist/components/SideMenuItem.js +32 -12
- package/dist/components/Stack.cjs +91 -30
- package/dist/components/Stack.js +1 -1
- package/dist/components/StatusPill.cjs +13 -6
- package/dist/components/StatusPill.js +9 -5
- package/dist/components/Stepper.cjs +35 -17
- package/dist/components/Stepper.js +11 -10
- package/dist/components/Subheader.cjs +5 -2
- package/dist/components/Subheader.js +1 -1
- package/dist/components/Surface.cjs +5 -2
- package/dist/components/Surface.js +5 -2
- package/dist/components/Swatch.cjs +1544 -1308
- package/dist/components/Swatch.js +1469 -1275
- package/dist/components/Textarea.cjs +5 -2
- package/dist/components/Textarea.js +5 -2
- package/dist/components/Theme.cjs +3 -2
- package/dist/components/Theme.js +1 -1
- package/dist/components/Time.cjs +98 -40
- package/dist/components/Time.js +18 -6
- package/dist/components/Toast.cjs +38 -15
- package/dist/components/Toast.js +23 -10
- package/dist/components/Tooltip.cjs +5 -4
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/TopBar.cjs +16 -8
- package/dist/components/TopBar.js +12 -5
- package/package.json +1 -1
- package/src/components/Breadcrumbs.tsx +24 -15
- package/src/components/Button.tsx +7 -3
- package/src/components/CalendarRange.tsx +9 -0
- package/src/components/Caption.tsx +36 -6
- package/src/components/Checkbox.tsx +7 -2
- package/src/components/ContentTab.tsx +13 -3
- package/src/components/ContentTabs.tsx +11 -8
- package/src/components/DMSiLogo.tsx +2 -1
- package/src/components/DataGrid.tsx +85 -23
- package/src/components/DataGridCell.tsx +15 -2
- package/src/components/DataTable.tsx +64 -14
- package/src/components/DateInput.tsx +5 -1
- package/src/components/DateRangeInput.tsx +5 -1
- package/src/components/DebugJson.tsx +7 -3
- package/src/components/Display.tsx +3 -0
- package/src/components/EditingContext.tsx +8 -6
- package/src/components/FilterGroup.tsx +23 -3
- package/src/components/FullViewportBox.tsx +6 -1
- package/src/components/Grid.tsx +3 -0
- package/src/components/Heading.tsx +3 -0
- package/src/components/HorizontalDivider.tsx +4 -2
- package/src/components/Input.tsx +19 -10
- package/src/components/InputGroup.tsx +8 -4
- package/src/components/Label.tsx +3 -0
- package/src/components/Link.tsx +1 -0
- package/src/components/List.tsx +7 -1
- package/src/components/LogoAgilityTopBar.tsx +2 -1
- package/src/components/LogoDMSiTopBar.tsx +2 -1
- package/src/components/LogoMillworkTopBar.tsx +2 -1
- package/src/components/MainBar.tsx +3 -0
- package/src/components/Menu.tsx +3 -0
- package/src/components/MenuOption.tsx +72 -58
- package/src/components/MobileDataGrid.tsx +15 -4
- package/src/components/Modal.tsx +10 -1
- package/src/components/ModalButtons.tsx +12 -1
- package/src/components/ModalContent.tsx +3 -0
- package/src/components/ModalHeader.tsx +16 -6
- package/src/components/ModalScrim.tsx +3 -0
- package/src/components/NavigationTab.tsx +6 -3
- package/src/components/NavigationTabs.tsx +5 -2
- package/src/components/Notification.tsx +4 -0
- package/src/components/OptionPill.tsx +9 -1
- package/src/components/Paragraph.tsx +3 -0
- package/src/components/Password.tsx +9 -3
- package/src/components/ProjectBar.tsx +3 -0
- package/src/components/Radio.tsx +3 -2
- package/src/components/Search.tsx +56 -41
- package/src/components/Select.tsx +6 -1
- package/src/components/SideMenu.tsx +7 -1
- package/src/components/SideMenuGroup.tsx +13 -2
- package/src/components/SideMenuItem.tsx +15 -2
- package/src/components/Stack.tsx +8 -3
- package/src/components/StatusPill.tsx +4 -2
- package/src/components/Stepper.tsx +5 -5
- package/src/components/Subheader.tsx +3 -0
- package/src/components/Surface.tsx +3 -0
- package/src/components/Swatch.tsx +415 -140
- package/src/components/Textarea.tsx +6 -3
- package/src/components/Theme.tsx +3 -1
- package/src/components/Time.tsx +21 -5
- package/src/components/Toast.tsx +29 -14
- package/src/components/Tooltip.tsx +46 -32
- package/src/components/TopBar.tsx +7 -3
- package/dist/chunk-DBYSGYST.js +0 -47
- package/dist/chunk-UK3WG7HQ.js +0 -48
|
@@ -196,13 +196,14 @@ var EditingProvider = ({ data, children }) => {
|
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
return /* @__PURE__ */ jsx(EditingContext, { value: context, children });
|
|
199
|
+
return /* @__PURE__ */ jsx(EditingContext.Provider, { value: context, children });
|
|
200
200
|
};
|
|
201
|
-
var DataTable = ({ data }) => {
|
|
202
|
-
return /* @__PURE__ */ jsx(EditingProvider, { data, children: /* @__PURE__ */ jsx(DataTableInternals, {}) });
|
|
201
|
+
var DataTable = ({ id, data }) => {
|
|
202
|
+
return /* @__PURE__ */ jsx(EditingProvider, { data, children: /* @__PURE__ */ jsx(DataTableInternals, { id }) });
|
|
203
203
|
};
|
|
204
204
|
var DraggableTableHeader = ({
|
|
205
|
-
header
|
|
205
|
+
header,
|
|
206
|
+
id
|
|
206
207
|
}) => {
|
|
207
208
|
var _a, _b, _c, _d;
|
|
208
209
|
const { attributes, isDragging, listeners, setNodeRef, transform } = useSortable({
|
|
@@ -220,6 +221,7 @@ var DraggableTableHeader = ({
|
|
|
220
221
|
return /* @__PURE__ */ jsx(
|
|
221
222
|
"th",
|
|
222
223
|
{
|
|
224
|
+
id,
|
|
223
225
|
colSpan: header.colSpan,
|
|
224
226
|
ref: setNodeRef,
|
|
225
227
|
style,
|
|
@@ -234,6 +236,7 @@ var DraggableTableHeader = ({
|
|
|
234
236
|
/* @__PURE__ */ jsx(
|
|
235
237
|
"button",
|
|
236
238
|
__spreadProps(__spreadValues(__spreadValues({
|
|
239
|
+
id: id ? `${id}-drag-handle` : void 0,
|
|
237
240
|
className: "cursor-grab shrink-0"
|
|
238
241
|
}, attributes), listeners), {
|
|
239
242
|
children: /* @__PURE__ */ jsx("i", { className: "w-3 h-3" })
|
|
@@ -250,13 +253,26 @@ var DraggableTableHeader = ({
|
|
|
250
253
|
title: header.column.getCanSort() ? header.column.getNextSortingOrder() === "asc" ? "Sort ascending" : header.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort" : void 0,
|
|
251
254
|
children: [
|
|
252
255
|
/* @__PURE__ */ jsx("div", { children: flexRender(header.column.columnDef.header, header.getContext()) }),
|
|
253
|
-
/* @__PURE__ */ jsx("div", { children: header.column.getCanFilter() ? /* @__PURE__ */ jsx(
|
|
256
|
+
/* @__PURE__ */ jsx("div", { children: header.column.getCanFilter() ? /* @__PURE__ */ jsx(
|
|
257
|
+
Filter,
|
|
258
|
+
{
|
|
259
|
+
id: id ? `${id}-filter` : void 0,
|
|
260
|
+
column: header.column
|
|
261
|
+
}
|
|
262
|
+
) : /* @__PURE__ */ jsx("div", { className: "invisible", children: /* @__PURE__ */ jsx(
|
|
263
|
+
Filter,
|
|
264
|
+
{
|
|
265
|
+
id: id ? `${id}-filter` : void 0,
|
|
266
|
+
column: header.column
|
|
267
|
+
}
|
|
268
|
+
) }) })
|
|
254
269
|
]
|
|
255
270
|
}
|
|
256
271
|
),
|
|
257
272
|
/* @__PURE__ */ jsx(
|
|
258
273
|
"div",
|
|
259
274
|
{
|
|
275
|
+
id: id ? `${id}-sort-button` : void 0,
|
|
260
276
|
className: "shrink-0 cursor-pointer",
|
|
261
277
|
onClick: header.column.getToggleSortingHandler(),
|
|
262
278
|
children: (_d = {
|
|
@@ -271,7 +287,8 @@ var DraggableTableHeader = ({
|
|
|
271
287
|
};
|
|
272
288
|
var DragAlongCell = ({
|
|
273
289
|
cell,
|
|
274
|
-
setValue
|
|
290
|
+
setValue,
|
|
291
|
+
id
|
|
275
292
|
}) => {
|
|
276
293
|
var _a, _b, _c, _d;
|
|
277
294
|
const { isDragging, setNodeRef, transform } = useSortable({
|
|
@@ -288,6 +305,7 @@ var DragAlongCell = ({
|
|
|
288
305
|
return /* @__PURE__ */ jsx(
|
|
289
306
|
EditCell,
|
|
290
307
|
{
|
|
308
|
+
id,
|
|
291
309
|
ref: setNodeRef,
|
|
292
310
|
style,
|
|
293
311
|
cell,
|
|
@@ -302,7 +320,7 @@ var DragAlongCell = ({
|
|
|
302
320
|
}
|
|
303
321
|
);
|
|
304
322
|
};
|
|
305
|
-
var DataTableInternals = () => {
|
|
323
|
+
var DataTableInternals = ({ id }) => {
|
|
306
324
|
const { data, setValue } = useContext(EditingContext);
|
|
307
325
|
const [columnOrder, setColumnOrder] = React.useState(
|
|
308
326
|
() => columns.map((c) => c.id)
|
|
@@ -367,36 +385,51 @@ var DataTableInternals = () => {
|
|
|
367
385
|
modifiers: [restrictToHorizontalAxis],
|
|
368
386
|
onDragEnd: handleDragEnd,
|
|
369
387
|
sensors,
|
|
370
|
-
children: /* @__PURE__ */ jsxs("div", { children: [
|
|
371
|
-
/* @__PURE__ */ jsxs(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
children:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
388
|
+
children: /* @__PURE__ */ jsxs("div", { id, children: [
|
|
389
|
+
/* @__PURE__ */ jsxs(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
id: id ? `${id}-column-visibility` : void 0,
|
|
393
|
+
className: "border border-gray-300 rounded p-3 m-4 max-w-xl min-w-0",
|
|
394
|
+
children: [
|
|
395
|
+
/* @__PURE__ */ jsx("p", { className: "mb-3 font-semibold", children: "Show/Hide Columns" }),
|
|
396
|
+
/* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-2", children: table.getAllColumns().map((column) => /* @__PURE__ */ jsxs(
|
|
397
|
+
"label",
|
|
398
|
+
{
|
|
399
|
+
className: "cursor-pointer flex flex-row items-center space-x-1",
|
|
400
|
+
children: [
|
|
401
|
+
/* @__PURE__ */ jsx(
|
|
402
|
+
Toggle,
|
|
403
|
+
{
|
|
404
|
+
id: id ? `${id}-toggle-${column.id}` : void 0,
|
|
405
|
+
enabled: column.getIsVisible(),
|
|
406
|
+
onToggle: (checked) => column.getToggleVisibilityHandler()({
|
|
407
|
+
target: { checked }
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ jsx("span", { className: "block", children: column.columnDef.header })
|
|
412
|
+
]
|
|
413
|
+
},
|
|
414
|
+
column.id
|
|
415
|
+
)) })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
),
|
|
393
419
|
/* @__PURE__ */ jsx("div", { className: "overflow-x-scroll scrollbar-thin", children: /* @__PURE__ */ jsxs("table", { className: "min-w-full divide-x divide-neutral-500", children: [
|
|
394
420
|
/* @__PURE__ */ jsx("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
395
421
|
SortableContext,
|
|
396
422
|
{
|
|
397
423
|
items: columnOrder,
|
|
398
424
|
strategy: horizontalListSortingStrategy,
|
|
399
|
-
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
425
|
+
children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
|
|
426
|
+
DraggableTableHeader,
|
|
427
|
+
{
|
|
428
|
+
id: id ? `${id}-header-${header.id}` : void 0,
|
|
429
|
+
header
|
|
430
|
+
},
|
|
431
|
+
header.id
|
|
432
|
+
))
|
|
400
433
|
}
|
|
401
434
|
) }, headerGroup.id)) }),
|
|
402
435
|
/* @__PURE__ */ jsx("tbody", { children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
|
|
@@ -411,6 +444,7 @@ var DataTableInternals = () => {
|
|
|
411
444
|
children: /* @__PURE__ */ jsx(
|
|
412
445
|
DragAlongCell,
|
|
413
446
|
{
|
|
447
|
+
id: id ? `${id}-cell-${cell.id}` : void 0,
|
|
414
448
|
cell,
|
|
415
449
|
setValue
|
|
416
450
|
},
|
|
@@ -423,132 +457,146 @@ var DataTableInternals = () => {
|
|
|
423
457
|
row.id
|
|
424
458
|
)) })
|
|
425
459
|
] }) }),
|
|
426
|
-
/* @__PURE__ */ jsxs(
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
460
|
+
/* @__PURE__ */ jsxs(
|
|
461
|
+
"div",
|
|
462
|
+
{
|
|
463
|
+
id: id ? `${id}-pagination` : void 0,
|
|
464
|
+
className: "flex flex-col gap-6 md:flex-row items-center md:gap-2 w-full justify-between p-2",
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center", children: [
|
|
467
|
+
/* @__PURE__ */ jsx(
|
|
468
|
+
"button",
|
|
433
469
|
{
|
|
434
|
-
|
|
470
|
+
id: id ? `${id}-first-page` : void 0,
|
|
471
|
+
className: clsx(
|
|
472
|
+
"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",
|
|
473
|
+
{
|
|
474
|
+
"pointer-events-none": !table.getCanPreviousPage()
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
onClick: () => table.setPageIndex(0),
|
|
478
|
+
disabled: !table.getCanPreviousPage(),
|
|
479
|
+
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
|
|
435
480
|
}
|
|
436
481
|
),
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
|
|
440
|
-
}
|
|
441
|
-
),
|
|
442
|
-
/* @__PURE__ */ jsx(
|
|
443
|
-
"button",
|
|
444
|
-
{
|
|
445
|
-
className: clsx(
|
|
446
|
-
"-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",
|
|
482
|
+
/* @__PURE__ */ jsx(
|
|
483
|
+
"button",
|
|
447
484
|
{
|
|
448
|
-
|
|
485
|
+
id: id ? `${id}-prev-page` : void 0,
|
|
486
|
+
className: clsx(
|
|
487
|
+
"-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",
|
|
488
|
+
{
|
|
489
|
+
"pointer-events-none": !table.getCanPreviousPage()
|
|
490
|
+
}
|
|
491
|
+
),
|
|
492
|
+
onClick: () => table.previousPage(),
|
|
493
|
+
disabled: !table.getCanPreviousPage(),
|
|
494
|
+
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
|
|
449
495
|
}
|
|
450
496
|
),
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
497
|
+
Array.from({ length: Math.min(5, table.getPageCount()) }).map(
|
|
498
|
+
(_, i) => {
|
|
499
|
+
const current = table.getState().pagination.pageIndex;
|
|
500
|
+
const index = current - 2 + i;
|
|
501
|
+
const active = index === current;
|
|
502
|
+
if (index < 0) return null;
|
|
503
|
+
if (index > table.getPageCount() - 1) return null;
|
|
504
|
+
return /* @__PURE__ */ jsx(
|
|
505
|
+
"button",
|
|
506
|
+
{
|
|
507
|
+
id: id ? `${id}-page-${index + 1}` : void 0,
|
|
508
|
+
className: clsx(
|
|
509
|
+
"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",
|
|
510
|
+
{
|
|
511
|
+
"bg-neutral-200 border-x": active,
|
|
512
|
+
"border-r-0": !active
|
|
513
|
+
}
|
|
514
|
+
),
|
|
515
|
+
onClick: () => table.setPageIndex(index),
|
|
516
|
+
children: /* @__PURE__ */ jsx("span", { className: clsx({}), children: index + 1 })
|
|
517
|
+
},
|
|
518
|
+
i
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
),
|
|
522
|
+
/* @__PURE__ */ jsx(
|
|
464
523
|
"button",
|
|
465
524
|
{
|
|
525
|
+
id: id ? `${id}-next-page` : void 0,
|
|
466
526
|
className: clsx(
|
|
467
|
-
"group h-8 w-8 border
|
|
527
|
+
"-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",
|
|
468
528
|
{
|
|
469
|
-
"
|
|
470
|
-
"border-r-0": !active
|
|
529
|
+
"pointer-events-none": !table.getCanNextPage()
|
|
471
530
|
}
|
|
472
531
|
),
|
|
473
|
-
onClick: () => table.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
i
|
|
477
|
-
);
|
|
478
|
-
}
|
|
479
|
-
),
|
|
480
|
-
/* @__PURE__ */ jsx(
|
|
481
|
-
"button",
|
|
482
|
-
{
|
|
483
|
-
className: clsx(
|
|
484
|
-
"-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",
|
|
485
|
-
{
|
|
486
|
-
"pointer-events-none": !table.getCanNextPage()
|
|
532
|
+
onClick: () => table.nextPage(),
|
|
533
|
+
disabled: !table.getCanNextPage(),
|
|
534
|
+
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400 " })
|
|
487
535
|
}
|
|
488
536
|
),
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400 " })
|
|
492
|
-
}
|
|
493
|
-
),
|
|
494
|
-
/* @__PURE__ */ jsx(
|
|
495
|
-
"button",
|
|
496
|
-
{
|
|
497
|
-
className: clsx(
|
|
498
|
-
"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",
|
|
537
|
+
/* @__PURE__ */ jsx(
|
|
538
|
+
"button",
|
|
499
539
|
{
|
|
500
|
-
|
|
540
|
+
id: id ? `${id}-last-page` : void 0,
|
|
541
|
+
className: clsx(
|
|
542
|
+
"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",
|
|
543
|
+
{
|
|
544
|
+
"pointer-events-none": !table.getCanNextPage()
|
|
545
|
+
}
|
|
546
|
+
),
|
|
547
|
+
onClick: () => table.setPageIndex(table.getPageCount() - 1),
|
|
548
|
+
disabled: !table.getCanNextPage(),
|
|
549
|
+
children: /* @__PURE__ */ jsx("i", { className: "w-4 h-4 group-disabled:stroke-gray-400" })
|
|
501
550
|
}
|
|
502
|
-
)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
"
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
551
|
+
)
|
|
552
|
+
] }),
|
|
553
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-6", children: [
|
|
554
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
|
|
555
|
+
/* @__PURE__ */ jsx("div", { children: "Page" }),
|
|
556
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
557
|
+
table.getState().pagination.pageIndex + 1,
|
|
558
|
+
" of",
|
|
559
|
+
" ",
|
|
560
|
+
table.getPageCount()
|
|
561
|
+
] })
|
|
562
|
+
] }),
|
|
563
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
564
|
+
"Page:",
|
|
565
|
+
/* @__PURE__ */ jsx(
|
|
566
|
+
"input",
|
|
567
|
+
{
|
|
568
|
+
id: id ? `${id}-page-input` : void 0,
|
|
569
|
+
type: "number",
|
|
570
|
+
min: "1",
|
|
571
|
+
max: table.getPageCount(),
|
|
572
|
+
defaultValue: table.getState().pagination.pageIndex + 1,
|
|
573
|
+
onChange: (e) => {
|
|
574
|
+
const page = e.target.value ? Number(e.target.value) - 1 : 0;
|
|
575
|
+
table.setPageIndex(page);
|
|
576
|
+
},
|
|
577
|
+
className: "border border-gray-500 px-2 py-1 rounded w-16"
|
|
578
|
+
}
|
|
579
|
+
)
|
|
580
|
+
] })
|
|
581
|
+
] }),
|
|
521
582
|
/* @__PURE__ */ jsx(
|
|
522
|
-
"
|
|
583
|
+
"select",
|
|
523
584
|
{
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
defaultValue: table.getState().pagination.pageIndex + 1,
|
|
585
|
+
id: id ? `${id}-pagesize-select` : void 0,
|
|
586
|
+
className: "border border-gray-500 px-2 py-1 rounded",
|
|
587
|
+
value: table.getState().pagination.pageSize,
|
|
528
588
|
onChange: (e) => {
|
|
529
|
-
|
|
530
|
-
table.setPageIndex(page);
|
|
589
|
+
table.setPageSize(Number(e.target.value));
|
|
531
590
|
},
|
|
532
|
-
|
|
591
|
+
children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsxs("option", { value: pageSize, children: [
|
|
592
|
+
"Show ",
|
|
593
|
+
pageSize
|
|
594
|
+
] }, pageSize))
|
|
533
595
|
}
|
|
534
596
|
)
|
|
535
|
-
]
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"select",
|
|
539
|
-
{
|
|
540
|
-
className: "border border-gray-500 px-2 py-1 rounded",
|
|
541
|
-
value: table.getState().pagination.pageSize,
|
|
542
|
-
onChange: (e) => {
|
|
543
|
-
table.setPageSize(Number(e.target.value));
|
|
544
|
-
},
|
|
545
|
-
children: [10, 20, 30, 40, 50].map((pageSize) => /* @__PURE__ */ jsxs("option", { value: pageSize, children: [
|
|
546
|
-
"Show ",
|
|
547
|
-
pageSize
|
|
548
|
-
] }, pageSize))
|
|
549
|
-
}
|
|
550
|
-
)
|
|
551
|
-
] })
|
|
597
|
+
]
|
|
598
|
+
}
|
|
599
|
+
)
|
|
552
600
|
] })
|
|
553
601
|
}
|
|
554
602
|
);
|
|
@@ -558,7 +606,8 @@ function EditCell({
|
|
|
558
606
|
cell,
|
|
559
607
|
setValue,
|
|
560
608
|
style,
|
|
561
|
-
ref
|
|
609
|
+
ref,
|
|
610
|
+
id
|
|
562
611
|
}) {
|
|
563
612
|
var _a, _b;
|
|
564
613
|
const [editing, setEditing] = useState(false);
|
|
@@ -585,6 +634,7 @@ function EditCell({
|
|
|
585
634
|
return /* @__PURE__ */ jsxs(
|
|
586
635
|
"td",
|
|
587
636
|
{
|
|
637
|
+
id,
|
|
588
638
|
className: clsx(
|
|
589
639
|
className,
|
|
590
640
|
(_b = (_a = cell.column.columnDef.meta) == null ? void 0 : _a.className) != null ? _b : "",
|
|
@@ -597,6 +647,7 @@ function EditCell({
|
|
|
597
647
|
/* @__PURE__ */ jsx(
|
|
598
648
|
"input",
|
|
599
649
|
{
|
|
650
|
+
id: id ? `${id}-input` : void 0,
|
|
600
651
|
type: "text",
|
|
601
652
|
value: editedValue,
|
|
602
653
|
onChange: onEditValue,
|
|
@@ -608,6 +659,7 @@ function EditCell({
|
|
|
608
659
|
/* @__PURE__ */ jsx(
|
|
609
660
|
"button",
|
|
610
661
|
{
|
|
662
|
+
id: id ? `${id}-save-button` : void 0,
|
|
611
663
|
onClick: onStopEdit,
|
|
612
664
|
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",
|
|
613
665
|
children: "Save"
|
|
@@ -630,15 +682,16 @@ function EditCell({
|
|
|
630
682
|
cell.id
|
|
631
683
|
);
|
|
632
684
|
}
|
|
633
|
-
function Filter({ column }) {
|
|
685
|
+
function Filter({ column, id }) {
|
|
634
686
|
var _a, _b, _c, _d, _e;
|
|
635
687
|
const columnFilterValue = column.getFilterValue();
|
|
636
688
|
const { filterVariant } = (_a = column.columnDef.meta) != null ? _a : {};
|
|
637
|
-
return filterVariant === "range" ? /* @__PURE__ */ jsxs("div", { children: [
|
|
689
|
+
return filterVariant === "range" ? /* @__PURE__ */ jsxs("div", { id, children: [
|
|
638
690
|
/* @__PURE__ */ jsxs("div", { className: "flex space-x-2", children: [
|
|
639
691
|
/* @__PURE__ */ jsx(
|
|
640
692
|
"input",
|
|
641
693
|
{
|
|
694
|
+
id: id ? `${id}-min` : void 0,
|
|
642
695
|
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",
|
|
643
696
|
type: "number",
|
|
644
697
|
value: (_b = columnFilterValue == null ? void 0 : columnFilterValue[0]) != null ? _b : "",
|
|
@@ -653,6 +706,7 @@ function Filter({ column }) {
|
|
|
653
706
|
/* @__PURE__ */ jsx(
|
|
654
707
|
"input",
|
|
655
708
|
{
|
|
709
|
+
id: id ? `${id}-max` : void 0,
|
|
656
710
|
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",
|
|
657
711
|
type: "number",
|
|
658
712
|
value: (_c = columnFilterValue == null ? void 0 : columnFilterValue[1]) != null ? _c : "",
|
|
@@ -669,6 +723,7 @@ function Filter({ column }) {
|
|
|
669
723
|
] }) : filterVariant === "select" ? /* @__PURE__ */ jsxs(
|
|
670
724
|
"select",
|
|
671
725
|
{
|
|
726
|
+
id,
|
|
672
727
|
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",
|
|
673
728
|
onChange: (e) => column.setFilterValue(e.target.value),
|
|
674
729
|
value: columnFilterValue == null ? void 0 : columnFilterValue.toString(),
|
|
@@ -682,6 +737,7 @@ function Filter({ column }) {
|
|
|
682
737
|
) : /* @__PURE__ */ jsx(
|
|
683
738
|
"input",
|
|
684
739
|
{
|
|
740
|
+
id,
|
|
685
741
|
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",
|
|
686
742
|
onChange: (e) => column.setFilterValue(e.target.value),
|
|
687
743
|
placeholder: (_e = (_d = column.columnDef.header) == null ? void 0 : _d.toString()) != null ? _e : "...",
|
|
@@ -694,11 +750,13 @@ function Filter({ column }) {
|
|
|
694
750
|
Switch.displayName = "Switch";
|
|
695
751
|
function Toggle({
|
|
696
752
|
enabled,
|
|
697
|
-
onToggle
|
|
753
|
+
onToggle,
|
|
754
|
+
id
|
|
698
755
|
}) {
|
|
699
756
|
return /* @__PURE__ */ jsx(
|
|
700
757
|
Switch,
|
|
701
758
|
{
|
|
759
|
+
id,
|
|
702
760
|
checked: enabled,
|
|
703
761
|
onChange: onToggle,
|
|
704
762
|
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",
|