@dmsi/wedgekit-react 0.0.414 → 0.0.417
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-3HBYDOYE.js +114 -0
- package/dist/{chunk-JIMJIJOF.js → chunk-5TGP5EFM.js} +2 -2
- package/dist/{chunk-2HMCS25C.js → chunk-6LHBY2IH.js} +1 -1
- package/dist/{chunk-6I5LZ2ZC.js → chunk-7AXHAWJX.js} +3 -3
- package/dist/{chunk-MQX7GFLX.js → chunk-CAQWLY5V.js} +24 -6
- package/dist/{chunk-QQ5G773N.js → chunk-DCLNAUC4.js} +1 -1
- package/dist/{chunk-GB4ZTUQV.js → chunk-DTW7JCBR.js} +36 -0
- package/dist/{chunk-OBY5EH47.js → chunk-HYJIDHAK.js} +6 -6
- package/dist/{chunk-LZGYABCX.js → chunk-IMOIZFJZ.js} +8 -8
- package/dist/chunk-KBJZUVLM.js +65 -0
- package/dist/{chunk-AA6GE3TH.js → chunk-LUPHOXAQ.js} +1 -1
- package/dist/chunk-NRNWEQD7.js +66 -0
- package/dist/{chunk-44TDIHUP.js → chunk-P3MIP2FD.js} +1 -1
- package/dist/chunk-PQWWVBSR.js +61 -0
- package/dist/{chunk-ERW5DEIO.js → chunk-RQLWSLVE.js} +1 -1
- package/dist/chunk-TYAQWVIM.js +159 -0
- package/dist/{chunk-KZZKQLKF.js → chunk-W55J2KJZ.js} +1 -1
- package/dist/chunk-Y2GK27RX.js +79 -0
- package/dist/components/Accordion.cjs +74 -2
- package/dist/components/Accordion.js +3 -3
- package/dist/components/CalendarRange.cjs +232 -53
- package/dist/components/CalendarRange.css +178 -65
- package/dist/components/CalendarRange.js +25 -17
- package/dist/components/Card.cjs +38 -2
- package/dist/components/Card.js +1 -1
- package/dist/components/CompactImagesPreview.cjs +59 -5
- package/dist/components/CompactImagesPreview.js +2 -2
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +190 -11
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +25 -17
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +200 -21
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +178 -65
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +25 -17
- package/dist/components/DataGrid/PinnedColumns.cjs +215 -36
- package/dist/components/DataGrid/PinnedColumns.css +178 -65
- package/dist/components/DataGrid/PinnedColumns.js +25 -17
- package/dist/components/DataGrid/TableBody/LoadingCell.cjs +191 -12
- package/dist/components/DataGrid/TableBody/LoadingCell.css +178 -65
- package/dist/components/DataGrid/TableBody/LoadingCell.js +25 -17
- package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +197 -18
- package/dist/components/DataGrid/TableBody/TableBodyRow.css +178 -65
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +25 -17
- package/dist/components/DataGrid/TableBody/index.cjs +212 -33
- package/dist/components/DataGrid/TableBody/index.css +178 -65
- package/dist/components/DataGrid/TableBody/index.js +25 -17
- package/dist/components/DataGrid/index.cjs +301 -122
- package/dist/components/DataGrid/index.css +178 -65
- package/dist/components/DataGrid/index.js +25 -17
- package/dist/components/DataGrid/utils.cjs +191 -12
- package/dist/components/DataGrid/utils.css +178 -65
- package/dist/components/DataGrid/utils.js +25 -17
- package/dist/components/DateInput.cjs +251 -72
- package/dist/components/DateInput.css +178 -65
- package/dist/components/DateInput.js +25 -17
- package/dist/components/DateRangeInput.cjs +251 -72
- package/dist/components/DateRangeInput.css +178 -65
- package/dist/components/DateRangeInput.js +25 -17
- package/dist/components/Grid.cjs +81 -76
- package/dist/components/Grid.js +1 -1
- package/dist/components/ListGroup.cjs +553 -0
- package/dist/components/ListGroup.js +11 -0
- package/dist/components/MobileDataGrid/ColumnList.cjs +36 -0
- package/dist/components/MobileDataGrid/ColumnList.js +3 -3
- package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +198 -19
- package/dist/components/MobileDataGrid/ColumnSelector/index.css +178 -65
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +25 -17
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +36 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
- package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +242 -27
- package/dist/components/MobileDataGrid/MobileDataGridHeader.css +178 -65
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +25 -17
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +36 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +5 -5
- package/dist/components/MobileDataGrid/index.cjs +742 -527
- package/dist/components/MobileDataGrid/index.css +178 -65
- package/dist/components/MobileDataGrid/index.js +25 -17
- package/dist/components/Modal.js +2 -2
- package/dist/components/Notification.cjs +36 -0
- package/dist/components/Notification.js +1 -1
- package/dist/components/PDFViewer/PDFElement.cjs +36 -0
- package/dist/components/PDFViewer/PDFElement.js +2 -2
- package/dist/components/PDFViewer/PDFNavigation.cjs +36 -0
- package/dist/components/PDFViewer/PDFNavigation.js +2 -2
- package/dist/components/PDFViewer/index.cjs +36 -0
- package/dist/components/PDFViewer/index.js +8 -111
- package/dist/components/Pagination.cjs +427 -0
- package/dist/components/Pagination.js +10 -0
- package/dist/components/ProductImagePreview/index.cjs +139 -127
- package/dist/components/ProductImagePreview/index.js +5 -5
- package/dist/components/SideMenuGroup.cjs +36 -0
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +36 -0
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/SimpleTable.cjs +521 -0
- package/dist/components/SimpleTable.js +10 -0
- package/dist/components/Stack.cjs +36 -0
- package/dist/components/Stack.js +1 -1
- package/dist/components/Swatch.cjs +36 -0
- package/dist/components/Swatch.js +1 -1
- package/dist/components/Time.cjs +36 -0
- package/dist/components/Time.js +1 -1
- package/dist/components/Tooltip.cjs +1 -1
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Upload.cjs +36 -0
- package/dist/components/Upload.js +1 -1
- package/dist/components/index.cjs +739 -131
- package/dist/components/index.css +178 -65
- package/dist/components/index.js +37 -17
- package/dist/index.css +178 -65
- package/package.json +1 -1
- package/src/components/Card.tsx +60 -2
- package/src/components/CompactImagesPreview.tsx +54 -30
- package/src/components/Grid.tsx +59 -91
- package/src/components/ListGroup.tsx +82 -0
- package/src/components/Pagination.tsx +182 -0
- package/src/components/SimpleTable.tsx +77 -0
- package/src/components/Stack.tsx +76 -0
- package/src/components/Tooltip.tsx +4 -3
- package/src/components/index.ts +4 -0
- package/dist/chunk-ER6RCOH3.js +0 -97
- package/dist/chunk-EZCH4PQS.js +0 -29
- package/dist/{chunk-D6YCMQPO.js → chunk-SBCFBHNG.js} +3 -3
|
@@ -496,6 +496,10 @@ var Stack = (_a) => {
|
|
|
496
496
|
padding,
|
|
497
497
|
paddingX,
|
|
498
498
|
paddingY,
|
|
499
|
+
paddingBottom,
|
|
500
|
+
paddingTop,
|
|
501
|
+
paddingLeft,
|
|
502
|
+
paddingRight,
|
|
499
503
|
margin,
|
|
500
504
|
marginX,
|
|
501
505
|
marginY,
|
|
@@ -511,6 +515,10 @@ var Stack = (_a) => {
|
|
|
511
515
|
height,
|
|
512
516
|
maxHeight,
|
|
513
517
|
borderColor,
|
|
518
|
+
borderTopColor,
|
|
519
|
+
borderRightColor,
|
|
520
|
+
borderBottomColor,
|
|
521
|
+
borderLeftColor,
|
|
514
522
|
backgroundColor,
|
|
515
523
|
sizing = "none",
|
|
516
524
|
overflowY = "inherit",
|
|
@@ -536,6 +544,10 @@ var Stack = (_a) => {
|
|
|
536
544
|
"padding",
|
|
537
545
|
"paddingX",
|
|
538
546
|
"paddingY",
|
|
547
|
+
"paddingBottom",
|
|
548
|
+
"paddingTop",
|
|
549
|
+
"paddingLeft",
|
|
550
|
+
"paddingRight",
|
|
539
551
|
"margin",
|
|
540
552
|
"marginX",
|
|
541
553
|
"marginY",
|
|
@@ -551,6 +563,10 @@ var Stack = (_a) => {
|
|
|
551
563
|
"height",
|
|
552
564
|
"maxHeight",
|
|
553
565
|
"borderColor",
|
|
566
|
+
"borderTopColor",
|
|
567
|
+
"borderRightColor",
|
|
568
|
+
"borderBottomColor",
|
|
569
|
+
"borderLeftColor",
|
|
554
570
|
"backgroundColor",
|
|
555
571
|
"sizing",
|
|
556
572
|
"overflowY",
|
|
@@ -586,6 +602,10 @@ var Stack = (_a) => {
|
|
|
586
602
|
width: width !== void 0 && typeof width === "number" ? `${width}px` : void 0,
|
|
587
603
|
minWidth: minWidth !== void 0 ? `${minWidth}px` : void 0,
|
|
588
604
|
border: borderColor ? `1px solid var(--color-${borderColor})` : void 0,
|
|
605
|
+
borderTop: borderTopColor ? `1px solid var(--color-${borderTopColor})` : void 0,
|
|
606
|
+
borderRight: borderRightColor ? `1px solid var(--color-${borderRightColor})` : void 0,
|
|
607
|
+
borderBottom: borderBottomColor ? `1px solid var(--color-${borderBottomColor})` : void 0,
|
|
608
|
+
borderLeft: borderLeftColor ? `1px solid var(--color-${borderLeftColor})` : void 0,
|
|
589
609
|
backgroundColor: backgroundColor ? `var(--color-${backgroundColor})` : void 0,
|
|
590
610
|
flexGrow: flexGrow !== void 0 ? flexGrow : void 0,
|
|
591
611
|
flexShrink: flexShrink !== void 0 ? flexShrink : void 0,
|
|
@@ -625,6 +645,22 @@ var Stack = (_a) => {
|
|
|
625
645
|
paddingY && sizing === "layout" && "py-mobile-layout-padding desktop:py-desktop-layout-padding compact:py-desktop-compact-layout-padding",
|
|
626
646
|
paddingY && sizing === "layout-group" && paddingYUsingLayoutGroupGap,
|
|
627
647
|
paddingY && sizing === "component" && "py-mobile-component-padding desktop:py-desktop-component-padding compact:py-desktop-compact-component-padding",
|
|
648
|
+
paddingBottom && sizing === "container" && "pb-mobile-container-padding desktop:pb-desktop-container-padding compact:pb-desktop-compact-container-padding",
|
|
649
|
+
paddingBottom && sizing === "layout" && "pb-mobile-layout-padding desktop:pb-desktop-layout-padding compact:pb-desktop-compact-layout-padding",
|
|
650
|
+
paddingBottom && sizing === "layout-group" && "pb-mobile-layout-group-padding desktop:pb-desktop-layout-group-padding compact:pb-desktop-compact-layout-group-padding",
|
|
651
|
+
paddingBottom && sizing === "component" && "pb-mobile-component-padding desktop:pb-desktop-component-padding compact:pb-desktop-compact-component-padding",
|
|
652
|
+
paddingTop && sizing === "container" && "pt-mobile-container-padding desktop:pt-desktop-container-padding compact:pt-desktop-compact-container-padding",
|
|
653
|
+
paddingTop && sizing === "layout" && "pt-mobile-layout-padding desktop:pt-desktop-layout-padding compact:pt-desktop-compact-layout-padding",
|
|
654
|
+
paddingTop && sizing === "layout-group" && "pt-mobile-layout-group-padding desktop:pt-desktop-layout-group-padding compact:pt-desktop-compact-layout-group-padding",
|
|
655
|
+
paddingTop && sizing === "component" && "pt-mobile-component-padding desktop:pt-desktop-component-padding compact:pt-desktop-compact-component-padding",
|
|
656
|
+
paddingLeft && sizing === "container" && "pl-mobile-container-padding desktop:pl-desktop-container-padding compact:pl-desktop-compact-container-padding",
|
|
657
|
+
paddingLeft && sizing === "layout" && "pl-mobile-layout-padding desktop:pl-desktop-layout-padding compact:pl-desktop-compact-layout-padding",
|
|
658
|
+
paddingLeft && sizing === "layout-group" && "pl-mobile-layout-group-padding desktop:pl-desktop-layout-group-padding compact:pl-desktop-compact-layout-group-padding",
|
|
659
|
+
paddingLeft && sizing === "component" && "pl-mobile-component-padding desktop:pl-desktop-component-padding compact:pl-desktop-compact-component-padding",
|
|
660
|
+
paddingRight && sizing === "container" && "pr-mobile-container-padding desktop:pr-desktop-container-padding compact:pr-desktop-compact-container-padding",
|
|
661
|
+
paddingRight && sizing === "layout" && "pr-mobile-layout-padding desktop:pr-desktop-layout-padding compact:pr-desktop-compact-layout-padding",
|
|
662
|
+
paddingRight && sizing === "layout-group" && "pr-mobile-layout-group-padding desktop:pr-desktop-layout-group-padding compact:pr-desktop-compact-layout-group-padding",
|
|
663
|
+
paddingRight && sizing === "component" && "pr-mobile-component-padding desktop:pr-desktop-component-padding compact:pr-desktop-compact-component-padding",
|
|
628
664
|
margin && sizing === "container" && "m-mobile-container-padding desktop:m-desktop-container-padding compact:m-compact-container-padding",
|
|
629
665
|
marginX && sizing === "container" && "mx-mobile-container-padding desktop:mx-desktop-container-padding compact:mx-compact-container-padding",
|
|
630
666
|
marginTop && sizing === "container" && "mt-mobile-container-padding desktop:mt-desktop-container-padding compact:mt-compact-container-padding",
|
|
@@ -670,7 +706,7 @@ function Theme({
|
|
|
670
706
|
}
|
|
671
707
|
|
|
672
708
|
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
673
|
-
var
|
|
709
|
+
var import_react36 = require("react");
|
|
674
710
|
|
|
675
711
|
// src/components/DataGridCell.tsx
|
|
676
712
|
var import_sortable = require("@dnd-kit/sortable");
|
|
@@ -4237,7 +4273,7 @@ var Tooltip = ({
|
|
|
4237
4273
|
id,
|
|
4238
4274
|
"data-testid": testid,
|
|
4239
4275
|
ref,
|
|
4240
|
-
className: "relative inline-grid grid-cols-[auto_1fr] items-center",
|
|
4276
|
+
className: "relative inline-grid grid-cols-[auto_1fr] items-center cursor-pointer",
|
|
4241
4277
|
onMouseEnter: handleMouseEnter,
|
|
4242
4278
|
onMouseLeave: handleMouseLeave,
|
|
4243
4279
|
children: [
|
|
@@ -4768,12 +4804,11 @@ var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
|
4768
4804
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4769
4805
|
|
|
4770
4806
|
// src/components/Grid.tsx
|
|
4771
|
-
var import_react26 = require("react");
|
|
4772
4807
|
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4773
4808
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4774
4809
|
|
|
4775
4810
|
// src/components/ProductImagePreview/ProductPrimaryImage.tsx
|
|
4776
|
-
var
|
|
4811
|
+
var import_react26 = require("react");
|
|
4777
4812
|
|
|
4778
4813
|
// src/components/Spinner.tsx
|
|
4779
4814
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
@@ -4809,7 +4844,7 @@ Spinner.displayName = "Spinner";
|
|
|
4809
4844
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4810
4845
|
|
|
4811
4846
|
// src/components/ProductImagePreview/ZoomWindow.tsx
|
|
4812
|
-
var
|
|
4847
|
+
var import_react27 = require("react");
|
|
4813
4848
|
|
|
4814
4849
|
// src/components/Surface.tsx
|
|
4815
4850
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
@@ -4854,26 +4889,206 @@ var import_clsx32 = require("clsx");
|
|
|
4854
4889
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4855
4890
|
|
|
4856
4891
|
// src/components/ProductImagePreview/MobileImageCarousel.tsx
|
|
4857
|
-
var
|
|
4892
|
+
var import_react28 = require("react");
|
|
4858
4893
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4859
4894
|
|
|
4860
4895
|
// src/components/ProductImagePreview/useProductImagePreview.ts
|
|
4861
|
-
var
|
|
4896
|
+
var import_react29 = require("react");
|
|
4862
4897
|
|
|
4863
4898
|
// src/components/ProductImagePreview/index.tsx
|
|
4864
4899
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4865
4900
|
|
|
4866
4901
|
// src/components/CompactImagesPreview.tsx
|
|
4867
|
-
var
|
|
4902
|
+
var import_react30 = require("react");
|
|
4868
4903
|
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4869
4904
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4870
4905
|
|
|
4871
|
-
// src/components/
|
|
4906
|
+
// src/components/SimpleTable.tsx
|
|
4907
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4872
4908
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
4909
|
+
|
|
4910
|
+
// src/components/PDFViewer/index.tsx
|
|
4911
|
+
var import_react33 = require("react");
|
|
4912
|
+
|
|
4913
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4914
|
+
var import_react_pdf2 = require("@mikecousins/react-pdf");
|
|
4915
|
+
var import_react32 = require("react");
|
|
4916
|
+
|
|
4917
|
+
// src/components/PDFViewer/PDFPage.tsx
|
|
4918
|
+
var import_react_pdf = require("@mikecousins/react-pdf");
|
|
4919
|
+
var import_react31 = require("react");
|
|
4920
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
4921
|
+
|
|
4922
|
+
// src/components/PDFViewer/PDFElement.tsx
|
|
4923
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4924
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
4925
|
+
|
|
4926
|
+
// src/components/PDFViewer/DownloadIcon.tsx
|
|
4927
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
4928
|
+
|
|
4929
|
+
// src/components/PDFViewer/PDFNavigation.tsx
|
|
4930
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
4931
|
+
|
|
4932
|
+
// src/components/PDFViewer/index.tsx
|
|
4933
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
4934
|
+
|
|
4935
|
+
// src/components/ListGroup.tsx
|
|
4936
|
+
var import_react34 = require("react");
|
|
4937
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4938
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
4939
|
+
|
|
4940
|
+
// src/components/Pagination.tsx
|
|
4941
|
+
var import_react35 = require("react");
|
|
4942
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4943
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
4944
|
+
var Pagination = ({
|
|
4945
|
+
totalPages,
|
|
4946
|
+
currentPage,
|
|
4947
|
+
onPageChange,
|
|
4948
|
+
id,
|
|
4949
|
+
testid,
|
|
4950
|
+
className,
|
|
4951
|
+
disabled
|
|
4952
|
+
}) => {
|
|
4953
|
+
const goTo = (0, import_react35.useCallback)(
|
|
4954
|
+
(page) => {
|
|
4955
|
+
if (disabled) return;
|
|
4956
|
+
onPageChange(page);
|
|
4957
|
+
},
|
|
4958
|
+
[onPageChange, disabled]
|
|
4959
|
+
);
|
|
4960
|
+
const handleKey = (e) => {
|
|
4961
|
+
if (disabled) return;
|
|
4962
|
+
if (e.key === "ArrowLeft") {
|
|
4963
|
+
e.preventDefault();
|
|
4964
|
+
goTo(currentPage - 1);
|
|
4965
|
+
} else if (e.key === "ArrowRight") {
|
|
4966
|
+
e.preventDefault();
|
|
4967
|
+
goTo(currentPage + 1);
|
|
4968
|
+
}
|
|
4969
|
+
};
|
|
4970
|
+
const pageTokens = (0, import_react35.useMemo)(() => {
|
|
4971
|
+
if (totalPages <= 5) {
|
|
4972
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
4973
|
+
}
|
|
4974
|
+
const pages = /* @__PURE__ */ new Set();
|
|
4975
|
+
pages.add(1);
|
|
4976
|
+
pages.add(totalPages);
|
|
4977
|
+
if (currentPage <= 3) {
|
|
4978
|
+
pages.add(2);
|
|
4979
|
+
pages.add(3);
|
|
4980
|
+
pages.add(4);
|
|
4981
|
+
} else if (currentPage >= totalPages - 2) {
|
|
4982
|
+
pages.add(totalPages - 1);
|
|
4983
|
+
pages.add(totalPages - 2);
|
|
4984
|
+
pages.add(totalPages - 3);
|
|
4985
|
+
} else {
|
|
4986
|
+
pages.add(currentPage - 1);
|
|
4987
|
+
pages.add(currentPage);
|
|
4988
|
+
pages.add(currentPage + 1);
|
|
4989
|
+
}
|
|
4990
|
+
const sorted = Array.from(pages).sort((a, b) => a - b);
|
|
4991
|
+
const tokens = [];
|
|
4992
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
4993
|
+
const value = sorted[i];
|
|
4994
|
+
const prev = sorted[i - 1];
|
|
4995
|
+
if (i > 0) {
|
|
4996
|
+
if (value - prev === 2) {
|
|
4997
|
+
tokens.push(prev + 1);
|
|
4998
|
+
} else if (value - prev > 2) {
|
|
4999
|
+
tokens.push("ellipsis");
|
|
5000
|
+
}
|
|
5001
|
+
}
|
|
5002
|
+
tokens.push(value);
|
|
5003
|
+
}
|
|
5004
|
+
return tokens;
|
|
5005
|
+
}, [totalPages, currentPage]);
|
|
5006
|
+
if (totalPages <= 1) return null;
|
|
5007
|
+
const buttonClass = (0, import_clsx37.default)(
|
|
5008
|
+
"cursor-pointer disabled:cursor-default",
|
|
5009
|
+
paddingUsingComponentGap,
|
|
5010
|
+
"w-8 h-8",
|
|
5011
|
+
"flex items-center justify-center",
|
|
5012
|
+
"bg-transparent",
|
|
5013
|
+
"box-content",
|
|
5014
|
+
"hover:bg-background-grouped-secondary-normal",
|
|
5015
|
+
"focus:bg-background-grouped-secondary-normal focus:outline-0",
|
|
5016
|
+
"disabled:bg-transparent disabled:text-text-action-primary-disabled"
|
|
5017
|
+
);
|
|
5018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
5019
|
+
"nav",
|
|
5020
|
+
{
|
|
5021
|
+
id,
|
|
5022
|
+
"data-testid": testid,
|
|
5023
|
+
"aria-label": "Pagination",
|
|
5024
|
+
onKeyDown: handleKey,
|
|
5025
|
+
className: (0, import_clsx37.default)(
|
|
5026
|
+
"flex items-center",
|
|
5027
|
+
"border border-border-primary-normal",
|
|
5028
|
+
"bg-background-grouped-primary-normal",
|
|
5029
|
+
"rounded-sm",
|
|
5030
|
+
className
|
|
5031
|
+
),
|
|
5032
|
+
children: [
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5034
|
+
"button",
|
|
5035
|
+
{
|
|
5036
|
+
disabled: disabled || currentPage <= 1,
|
|
5037
|
+
"aria-label": "Previous page",
|
|
5038
|
+
onClick: () => goTo(currentPage - 1),
|
|
5039
|
+
className: (0, import_clsx37.default)(buttonClass, "border-r-1 border-border-primary-normal"),
|
|
5040
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: "keyboard_arrow_left" })
|
|
5041
|
+
}
|
|
5042
|
+
),
|
|
5043
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("ul", { className: (0, import_clsx37.default)("flex items-center"), children: pageTokens.map((token, index) => {
|
|
5044
|
+
if (token === "ellipsis") {
|
|
5045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5046
|
+
"li",
|
|
5047
|
+
{
|
|
5048
|
+
className: "w-8 h-8 select-none text-text-action-primary-disabled",
|
|
5049
|
+
children: "\u2026"
|
|
5050
|
+
},
|
|
5051
|
+
`ellipsis-${index}`
|
|
5052
|
+
);
|
|
5053
|
+
}
|
|
5054
|
+
const selected = token === currentPage;
|
|
5055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5056
|
+
"button",
|
|
5057
|
+
{
|
|
5058
|
+
"aria-label": `Page ${token}`,
|
|
5059
|
+
"aria-current": selected ? "page" : void 0,
|
|
5060
|
+
disabled,
|
|
5061
|
+
onClick: () => goTo(token),
|
|
5062
|
+
className: (0, import_clsx37.default)(
|
|
5063
|
+
buttonClass,
|
|
5064
|
+
selected && "border-x-1 bg-background-grouped-secondary-normal border-border-primary-normal"
|
|
5065
|
+
),
|
|
5066
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Subheader, { align: "center", weight: "bold", children: token })
|
|
5067
|
+
}
|
|
5068
|
+
) }, token);
|
|
5069
|
+
}) }),
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
5071
|
+
"button",
|
|
5072
|
+
{
|
|
5073
|
+
disabled: disabled || currentPage >= totalPages,
|
|
5074
|
+
"aria-label": "Next page",
|
|
5075
|
+
onClick: () => goTo(currentPage + 1),
|
|
5076
|
+
className: (0, import_clsx37.default)(buttonClass, "border-l-1 border-border-primary-normal"),
|
|
5077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Icon, { name: "keyboard_arrow_right" })
|
|
5078
|
+
}
|
|
5079
|
+
)
|
|
5080
|
+
]
|
|
5081
|
+
}
|
|
5082
|
+
);
|
|
5083
|
+
};
|
|
5084
|
+
Pagination.displayName = "Pagination";
|
|
5085
|
+
|
|
5086
|
+
// src/components/MobileDataGrid/ColumnSelector/index.tsx
|
|
5087
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
4873
5088
|
function ColumnSelector() {
|
|
4874
5089
|
const context = useGridContext();
|
|
4875
|
-
const ref = (0,
|
|
4876
|
-
const [show, setShow] = (0,
|
|
5090
|
+
const ref = (0, import_react36.useRef)(null);
|
|
5091
|
+
const [show, setShow] = (0, import_react36.useState)(false);
|
|
4877
5092
|
const {
|
|
4878
5093
|
columns,
|
|
4879
5094
|
id,
|
|
@@ -4884,13 +5099,13 @@ function ColumnSelector() {
|
|
|
4884
5099
|
resetColumnVisibility,
|
|
4885
5100
|
dispatch
|
|
4886
5101
|
} = context;
|
|
4887
|
-
const toggleColumnVisibility = (0,
|
|
5102
|
+
const toggleColumnVisibility = (0, import_react36.useCallback)(
|
|
4888
5103
|
(index, visible) => {
|
|
4889
5104
|
dispatch({ type: "UPDATE", index, payload: { meta: { visible } } });
|
|
4890
5105
|
},
|
|
4891
5106
|
[dispatch]
|
|
4892
5107
|
);
|
|
4893
|
-
return /* @__PURE__ */ (0,
|
|
5108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4894
5109
|
"div",
|
|
4895
5110
|
{
|
|
4896
5111
|
id: id ? `${id}-column-selector` : void 0,
|
|
@@ -4898,7 +5113,7 @@ function ColumnSelector() {
|
|
|
4898
5113
|
className: "text-text-secondary-normal border-l border-brand-200 p-mobile-container-padding",
|
|
4899
5114
|
ref,
|
|
4900
5115
|
children: [
|
|
4901
|
-
/* @__PURE__ */ (0,
|
|
5116
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4902
5117
|
Button,
|
|
4903
5118
|
{
|
|
4904
5119
|
id: id ? `${id}-button` : void 0,
|
|
@@ -4907,10 +5122,10 @@ function ColumnSelector() {
|
|
|
4907
5122
|
variant: "navigation",
|
|
4908
5123
|
iconOnly: true,
|
|
4909
5124
|
size: 24,
|
|
4910
|
-
leftIcon: /* @__PURE__ */ (0,
|
|
5125
|
+
leftIcon: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Icon, { name: "tune" })
|
|
4911
5126
|
}
|
|
4912
5127
|
),
|
|
4913
|
-
/* @__PURE__ */ (0,
|
|
5128
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
4914
5129
|
Menu,
|
|
4915
5130
|
{
|
|
4916
5131
|
id: id ? `${id}-menu` : void 0,
|
|
@@ -4921,7 +5136,7 @@ function ColumnSelector() {
|
|
|
4921
5136
|
setShow,
|
|
4922
5137
|
calculateMinMaxHeight: true,
|
|
4923
5138
|
children: [
|
|
4924
|
-
/* @__PURE__ */ (0,
|
|
5139
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4925
5140
|
Button,
|
|
4926
5141
|
{
|
|
4927
5142
|
id: id ? `${id}-reset-button` : void 0,
|
|
@@ -4939,11 +5154,11 @@ function ColumnSelector() {
|
|
|
4939
5154
|
return (_a = x.meta) == null ? void 0 : _a.inVisibilityMenu;
|
|
4940
5155
|
}).map((column) => {
|
|
4941
5156
|
var _a, _b, _c;
|
|
4942
|
-
return /* @__PURE__ */ (0,
|
|
5157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4943
5158
|
MenuOption,
|
|
4944
5159
|
{
|
|
4945
5160
|
testid: testid ? `${testid}-option-${column.id}` : void 0,
|
|
4946
|
-
children: /* @__PURE__ */ (0,
|
|
5161
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
4947
5162
|
Checkbox,
|
|
4948
5163
|
{
|
|
4949
5164
|
id: id ? `${id}-checkbox-${column.id}` : void 0,
|
|
@@ -4973,7 +5188,7 @@ function ColumnSelector() {
|
|
|
4973
5188
|
}
|
|
4974
5189
|
|
|
4975
5190
|
// src/components/MobileDataGrid/MobileDataGridHeader.tsx
|
|
4976
|
-
var
|
|
5191
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
4977
5192
|
function MobileDataGridHeader({
|
|
4978
5193
|
header: Header,
|
|
4979
5194
|
enableColumnSelector,
|
|
@@ -4991,15 +5206,15 @@ function MobileDataGridHeader({
|
|
|
4991
5206
|
handleRowSelectAll
|
|
4992
5207
|
} = ctx;
|
|
4993
5208
|
if (typeof Header === "undefined" && !primaryKey) return null;
|
|
4994
|
-
if (typeof Header === "function") return /* @__PURE__ */ (0,
|
|
5209
|
+
if (typeof Header === "function") return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Header, __spreadValues({}, ctx));
|
|
4995
5210
|
if (typeof Header === "string" || primaryKey)
|
|
4996
|
-
return /* @__PURE__ */ (0,
|
|
5211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
4997
5212
|
"div",
|
|
4998
5213
|
{
|
|
4999
5214
|
id: id ? `${id}-header` : void 0,
|
|
5000
5215
|
"data-testid": testid ? `${testid}-header` : void 0,
|
|
5001
5216
|
className: "sticky top-0",
|
|
5002
|
-
children: /* @__PURE__ */ (0,
|
|
5217
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Theme, { theme: "brand", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
5003
5218
|
Stack,
|
|
5004
5219
|
{
|
|
5005
5220
|
horizontal: true,
|
|
@@ -5008,7 +5223,7 @@ function MobileDataGridHeader({
|
|
|
5008
5223
|
justify: "between",
|
|
5009
5224
|
backgroundColor: "background-primary-normal",
|
|
5010
5225
|
children: [
|
|
5011
|
-
enableRowSelection && /* @__PURE__ */ (0,
|
|
5226
|
+
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit h-full", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5012
5227
|
Checkbox,
|
|
5013
5228
|
{
|
|
5014
5229
|
id: id ? `${id}-select-all-checkbox` : void 0,
|
|
@@ -5018,7 +5233,7 @@ function MobileDataGridHeader({
|
|
|
5018
5233
|
onChange: handleRowSelectAll
|
|
5019
5234
|
}
|
|
5020
5235
|
) }),
|
|
5021
|
-
/* @__PURE__ */ (0,
|
|
5236
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
5022
5237
|
Stack,
|
|
5023
5238
|
{
|
|
5024
5239
|
horizontal: true,
|
|
@@ -5026,10 +5241,10 @@ function MobileDataGridHeader({
|
|
|
5026
5241
|
items: "center",
|
|
5027
5242
|
sizing: "component",
|
|
5028
5243
|
padding: true,
|
|
5029
|
-
children: /* @__PURE__ */ (0,
|
|
5244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Heading3, { as: "span", color: "text-primary-normal", children: typeof Header === "string" ? Header : (_b = (_a = columns.find((col) => col.id === primaryKey)) == null ? void 0 : _a.header) == null ? void 0 : _b.toString() })
|
|
5030
5245
|
}
|
|
5031
5246
|
),
|
|
5032
|
-
enableColumnSelector && /* @__PURE__ */ (0,
|
|
5247
|
+
enableColumnSelector && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(ColumnSelector, {})
|
|
5033
5248
|
]
|
|
5034
5249
|
}
|
|
5035
5250
|
) })
|