@dmsi/wedgekit-react 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/classNames.js +150 -0
- package/dist/components/AccessCard.js +63 -0
- package/dist/components/AccessCardGroup.js +73 -0
- package/dist/components/AccessChangerTabItem.js +51 -0
- package/dist/components/Accordion.js +99 -0
- package/dist/components/Alert.js +78 -0
- package/dist/components/Breadcrumbs.js +111 -0
- package/dist/components/Button.js +137 -0
- package/dist/components/CalendarRange.js +405 -0
- package/dist/components/Caption.js +99 -0
- package/dist/components/Card.js +50 -0
- package/dist/components/Checkbox.js +108 -0
- package/dist/components/CompactImagesPreview.js +120 -0
- package/dist/components/ContentTab.js +68 -0
- package/dist/components/ContentTabs.js +96 -0
- package/dist/components/DMSiLogo.js +54 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +27 -0
- package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +79 -0
- package/dist/components/DataGrid/PinnedColumns.js +165 -0
- package/dist/components/DataGrid/SummaryRow/SummaryCell.js +51 -0
- package/dist/components/DataGrid/SummaryRow/aggregations.js +55 -0
- package/dist/components/DataGrid/SummaryRow/index.js +86 -0
- package/dist/components/DataGrid/TableBody/GroupRow.js +243 -0
- package/dist/components/DataGrid/TableBody/LoadingCell.js +33 -0
- package/dist/components/DataGrid/TableBody/TableBodyRow.js +136 -0
- package/dist/components/DataGrid/TableBody/index.js +161 -0
- package/dist/components/DataGrid/index.js +696 -0
- package/dist/components/DataGrid/utils.js +20 -0
- package/dist/components/DataGridCell.js +412 -0
- package/dist/components/DataTable.js +700 -0
- package/dist/components/DateInput.js +193 -0
- package/dist/components/DateRangeInput.js +368 -0
- package/dist/components/DebugJson.js +28 -0
- package/dist/components/Display.js +46 -0
- package/dist/components/EditingContext.js +34 -0
- package/dist/components/EmblaCarousel/ArrowButtons.js +83 -0
- package/dist/components/EmblaCarousel/SelectedSnapDisplay.js +12 -0
- package/dist/components/EmblaCarousel/index.js +153 -0
- package/dist/components/EmblaCarousel/usePrevNextButtons.js +21 -0
- package/dist/components/EmblaCarousel/useSelectedSnapDisplay.js +15 -0
- package/dist/components/EmptyCartIcon.js +25 -0
- package/dist/components/FilterGroup.js +198 -0
- package/dist/components/FullViewportBox.js +19 -0
- package/dist/components/Grid.js +54 -0
- package/dist/components/Heading.js +50 -0
- package/dist/components/HorizontalDivider.js +20 -0
- package/dist/components/Icon.js +73 -0
- package/dist/components/ImagePlaceholder.js +22 -0
- package/dist/components/Input.js +469 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.js +37 -0
- package/dist/components/Link.js +69 -0
- package/dist/components/List.js +12 -0
- package/dist/components/ListGroup.js +54 -0
- package/dist/components/LiveChatComponent.js +25 -0
- package/dist/components/LoadingScrim.js +22 -0
- package/dist/components/LogoAgilityTopBar.js +90 -0
- package/dist/components/LogoDMSiTopBar.js +54 -0
- package/dist/components/LogoMillworkTopBar.js +196 -0
- package/dist/components/MainBar.js +58 -0
- package/dist/components/MaxViewportBox.js +19 -0
- package/dist/components/Menu.js +202 -0
- package/dist/components/MenuOption.js +161 -0
- package/dist/components/MobileDataGrid/ColumnList.js +85 -0
- package/dist/components/MobileDataGrid/ColumnSelector/index.js +100 -0
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.d.ts.map +1 -1
- package/dist/components/MobileDataGrid/GridContextProvider/GridContext.js +6 -0
- package/dist/components/MobileDataGrid/GridContextProvider/index.js +80 -0
- package/dist/components/MobileDataGrid/GridContextProvider/useGridContext.js +11 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/MobileDataGridColumn.js +18 -0
- package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +130 -0
- package/dist/components/MobileDataGrid/MobileDataGridHeader.js +67 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +42 -0
- package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +58 -0
- package/dist/components/MobileDataGrid/dataGridReducer.js +28 -0
- package/dist/components/MobileDataGrid/index.js +78 -0
- package/dist/components/MobileNavMenu.js +173 -0
- package/dist/components/Modal.js +201 -0
- package/dist/components/ModalButtons.js +57 -0
- package/dist/components/ModalContent.js +24 -0
- package/dist/components/ModalHeader.js +74 -0
- package/dist/components/ModalScrim.js +32 -0
- package/dist/components/NavigationTab.js +72 -0
- package/dist/components/NavigationTabs.js +45 -0
- package/dist/components/NestedMenu.js +119 -0
- package/dist/components/Notification.js +91 -0
- package/dist/components/OptionPill.js +103 -0
- package/dist/components/OrderCheckIcon.js +28 -0
- package/dist/components/PDFViewer/DownloadIcon.js +25 -0
- package/dist/components/PDFViewer/PDFElement.js +77 -0
- package/dist/components/PDFViewer/PDFNavigation.js +64 -0
- package/dist/components/PDFViewer/PDFPage.js +28 -0
- package/dist/components/PDFViewer/index.js +124 -0
- package/dist/components/Pagination.js +117 -0
- package/dist/components/Paragraph.js +43 -0
- package/dist/components/Password.js +47 -0
- package/dist/components/ProductImagePreview/CarouselPagination.js +48 -0
- package/dist/components/ProductImagePreview/MobileImageCarousel.js +146 -0
- package/dist/components/ProductImagePreview/ProductPrimaryImage.js +138 -0
- package/dist/components/ProductImagePreview/Thumbnail.js +46 -0
- package/dist/components/ProductImagePreview/ZoomWindow.js +74 -0
- package/dist/components/ProductImagePreview/index.js +189 -0
- package/dist/components/ProductImagePreview/useProductImagePreview.js +85 -0
- package/dist/components/ProjectBar.js +54 -0
- package/dist/components/Radio.js +113 -0
- package/dist/components/Search.js +89 -0
- package/dist/components/SearchResultImage/index.js +26 -0
- package/dist/components/Select.js +122 -0
- package/dist/components/SideMenu.js +24 -0
- package/dist/components/SideMenuGroup.js +80 -0
- package/dist/components/SideMenuItem.js +79 -0
- package/dist/components/SimpleTable.js +60 -0
- package/dist/components/SkeletonParagraph.js +24 -0
- package/dist/components/Spinner.js +30 -0
- package/dist/components/Stack.js +174 -0
- package/dist/components/StatusPill.js +44 -0
- package/dist/components/Stepper.js +138 -0
- package/dist/components/Subheader.js +41 -0
- package/dist/components/Surface.js +30 -0
- package/dist/components/Swatch.js +1498 -0
- package/dist/components/Textarea.js +106 -0
- package/dist/components/Theme.js +25 -0
- package/dist/components/Time.js +225 -0
- package/dist/components/Toast.js +170 -0
- package/dist/components/Tooltip.js +102 -0
- package/dist/components/TopBar.js +119 -0
- package/dist/components/Upload.js +107 -0
- package/dist/components/WorldpayIframe.js +19 -0
- package/dist/hooks/useEditCell.js +23 -0
- package/dist/hooks/useInfiniteScroll.js +25 -0
- package/dist/hooks/useKeydown.js +20 -0
- package/dist/hooks/useMatchesMedia.js +15 -0
- package/dist/hooks/useMenuSystem.js +186 -0
- package/dist/hooks/useMounted.js +9 -0
- package/dist/hooks/useTableLayout/computeColumns.js +59 -0
- package/dist/hooks/useTableLayout/storage.js +64 -0
- package/dist/hooks/useTableLayout/useTableLayout.js +163 -0
- package/dist/index.js +249 -53839
- package/dist/lib/loadFonts.js +11 -0
- package/dist/node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js +56 -0
- package/dist/node_modules/@dnd-kit/core/dist/core.esm.js +2299 -0
- package/dist/node_modules/@dnd-kit/modifiers/dist/modifiers.esm.js +13 -0
- package/dist/node_modules/@dnd-kit/sortable/dist/sortable.esm.js +367 -0
- package/dist/node_modules/@dnd-kit/utilities/dist/utilities.esm.js +235 -0
- package/dist/node_modules/@headlessui/react/dist/components/description/description.js +45 -0
- package/dist/node_modules/@headlessui/react/dist/components/keyboard.js +4 -0
- package/dist/node_modules/@headlessui/react/dist/components/label/label.js +62 -0
- package/dist/node_modules/@headlessui/react/dist/components/switch/switch.js +56 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-active-press.js +33 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-controllable.js +10 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-default-value.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-disposables.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-event.js +9 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-iso-morphic-effect.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-latest-value.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-resolve-button-type.js +12 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-slot.js +7 -0
- package/dist/node_modules/@headlessui/react/dist/hooks/use-sync-refs.js +16 -0
- package/dist/node_modules/@headlessui/react/dist/internal/disabled.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/internal/form-fields.js +35 -0
- package/dist/node_modules/@headlessui/react/dist/internal/hidden.js +13 -0
- package/dist/node_modules/@headlessui/react/dist/internal/id.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/bugs.js +19 -0
- package/dist/node_modules/@headlessui/react/dist/utils/class-names.js +6 -0
- package/dist/node_modules/@headlessui/react/dist/utils/disposables.js +40 -0
- package/dist/node_modules/@headlessui/react/dist/utils/dom.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/env.js +34 -0
- package/dist/node_modules/@headlessui/react/dist/utils/form.js +32 -0
- package/dist/node_modules/@headlessui/react/dist/utils/match.js +11 -0
- package/dist/node_modules/@headlessui/react/dist/utils/micro-task.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/owner.js +8 -0
- package/dist/node_modules/@headlessui/react/dist/utils/render.js +126 -0
- package/dist/node_modules/@js-temporal/polyfill/dist/index.esm.js +3913 -0
- package/dist/node_modules/@mikecousins/react-pdf/dist/index.js +83 -0
- package/dist/node_modules/@react-aria/focus/dist/useFocusRing.js +38 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocus.js +31 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusVisible.js +99 -0
- package/dist/node_modules/@react-aria/interactions/dist/useFocusWithin.js +59 -0
- package/dist/node_modules/@react-aria/interactions/dist/useHover.js +86 -0
- package/dist/node_modules/@react-aria/interactions/dist/utils.js +68 -0
- package/dist/node_modules/@react-aria/utils/dist/DOMFunctions.js +32 -0
- package/dist/node_modules/@react-aria/utils/dist/domHelpers.js +15 -0
- package/dist/node_modules/@react-aria/utils/dist/focusWithoutScrolling.js +45 -0
- package/dist/node_modules/@react-aria/utils/dist/isVirtualEvent.js +7 -0
- package/dist/node_modules/@react-aria/utils/dist/openLink.js +28 -0
- package/dist/node_modules/@react-aria/utils/dist/platform.js +47 -0
- package/dist/node_modules/@react-aria/utils/dist/useGlobalListeners.js +34 -0
- package/dist/node_modules/@react-aria/utils/dist/useLayoutEffect.js +6 -0
- package/dist/node_modules/@react-stately/flags/dist/import.js +7 -0
- package/dist/node_modules/@tanstack/react-table/build/lib/index.js +94 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.js +38 -0
- package/dist/node_modules/@tanstack/table-core/build/lib/index.js +1954 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/index.js +575 -0
- package/dist/node_modules/@tanstack/virtual-core/dist/esm/utils.js +52 -0
- package/dist/node_modules/clsx/dist/clsx.js +17 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1204 -0
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +126 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +24 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +35 -0
- package/dist/node_modules/jsbi/dist/jsbi.js +1040 -0
- package/dist/node_modules/react-use/esm/usePrevious.js +10 -0
- package/dist/static/no-results-image.png.js +4 -0
- package/dist/utils/date-patch-dashes.js +28 -0
- package/dist/utils/date.js +95 -0
- package/dist/utils/formatting.js +22 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/mergeObjectArrays.js +18 -0
- package/dist/utils.js +20 -0
- package/package.json +1 -1
- /package/dist/{pdf-l6QfMa5e.js → node_modules/pdfjs-dist/build/pdf.js} +0 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Icon as C } from "../../Icon.js";
|
|
3
|
+
import { Paragraph as x } from "../../Paragraph.js";
|
|
4
|
+
import { Stack as t } from "../../Stack.js";
|
|
5
|
+
import { useGridContext as $ } from "../GridContextProvider/useGridContext.js";
|
|
6
|
+
import { Checkbox as k } from "../../Checkbox.js";
|
|
7
|
+
import { clsx as z } from "../../../node_modules/clsx/dist/clsx.js";
|
|
8
|
+
import { MobileDataGridColumn as v } from "./MobileDataGridColumn.js";
|
|
9
|
+
import { Subheader as G } from "../../Subheader.js";
|
|
10
|
+
import { layoutGroupGap as N, layoutPaddingX as P, paddingYUsingLayoutGroupGap as S } from "../../../classNames.js";
|
|
11
|
+
function L({
|
|
12
|
+
renderLink: c,
|
|
13
|
+
renderChevron: g = !0,
|
|
14
|
+
data: i,
|
|
15
|
+
enableRowSelection: h,
|
|
16
|
+
selected: p,
|
|
17
|
+
rowActions: l,
|
|
18
|
+
index: u
|
|
19
|
+
}) {
|
|
20
|
+
const m = $(), { id: a, testid: d, visibleColumns: f, getId: s, handleRowSelect: b, openRowDetail: y } = m;
|
|
21
|
+
return /* @__PURE__ */ n(
|
|
22
|
+
"li",
|
|
23
|
+
{
|
|
24
|
+
id: a ? `${a}-card-${s(i)}` : void 0,
|
|
25
|
+
"data-testid": d ? `${d}-card-${s(i)}` : void 0,
|
|
26
|
+
className: z(
|
|
27
|
+
"flex flex-col",
|
|
28
|
+
"last:rounded-b",
|
|
29
|
+
"hover:bg-action-100 cursor-pointer list-none",
|
|
30
|
+
p ? "bg-action-100" : u % 2 === 0 ? "bg-background-grouped-primary-normal" : "bg-background-grouped-secondary-normal",
|
|
31
|
+
N,
|
|
32
|
+
P,
|
|
33
|
+
S
|
|
34
|
+
),
|
|
35
|
+
onClick: (e) => {
|
|
36
|
+
const r = e.target.tagName;
|
|
37
|
+
r === "INPUT" || r === "SELECT" || r === "BUTTON" || r === "TEXTAREA" || y(i);
|
|
38
|
+
},
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ n(t, { sizing: "component", children: [
|
|
41
|
+
/* @__PURE__ */ n(t, { horizontal: !0, horizontalMobile: !0, items: "center", justify: "between", children: [
|
|
42
|
+
h && /* @__PURE__ */ o(
|
|
43
|
+
t,
|
|
44
|
+
{
|
|
45
|
+
sizing: "component",
|
|
46
|
+
padding: !0,
|
|
47
|
+
width: "fit",
|
|
48
|
+
style: { paddingLeft: 0, paddingRight: 8 },
|
|
49
|
+
onClick: (e) => e.stopPropagation(),
|
|
50
|
+
children: /* @__PURE__ */ o(
|
|
51
|
+
k,
|
|
52
|
+
{
|
|
53
|
+
id: a ? `${a}-${s(i)}-select-checkbox` : void 0,
|
|
54
|
+
testid: d ? `${d}-${s(i)}-select-checkbox` : void 0,
|
|
55
|
+
checked: p,
|
|
56
|
+
onChange: () => b(i)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
t,
|
|
63
|
+
{
|
|
64
|
+
sizing: "component",
|
|
65
|
+
padding: !0,
|
|
66
|
+
onClick: (e) => e.stopPropagation(),
|
|
67
|
+
style: { paddingInline: 0 },
|
|
68
|
+
children: c ? c(i) : /* @__PURE__ */ o(G, { children: String(i[m.primaryKey] ?? "") })
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ o(
|
|
72
|
+
t,
|
|
73
|
+
{
|
|
74
|
+
horizontal: !0,
|
|
75
|
+
horizontalMobile: !0,
|
|
76
|
+
items: "center",
|
|
77
|
+
justify: "end",
|
|
78
|
+
sizing: "component",
|
|
79
|
+
onClick: (e) => e.stopPropagation(),
|
|
80
|
+
children: l && (typeof l == "function" ? l(i) : l)
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ o(t, { sizing: "layout-group", children: f.filter((e) => e.meta?.visible !== !1 && !e.id?.startsWith("__")).map(
|
|
85
|
+
(e, r) => e.meta?.useCustomRenderer && e.meta.mobileCell && e.id ? /* @__PURE__ */ n(
|
|
86
|
+
"div",
|
|
87
|
+
{
|
|
88
|
+
className: "grid grid-cols-2 gap-2 items-center flex-1",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ n(
|
|
91
|
+
x,
|
|
92
|
+
{
|
|
93
|
+
color: "text-secondary-normal",
|
|
94
|
+
className: "text-left",
|
|
95
|
+
children: [
|
|
96
|
+
e.header?.toString(),
|
|
97
|
+
":"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
" ",
|
|
102
|
+
/* @__PURE__ */ o(
|
|
103
|
+
e.meta.mobileCell,
|
|
104
|
+
{
|
|
105
|
+
column: e,
|
|
106
|
+
row: i,
|
|
107
|
+
cellValue: i[e.id]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
`${e.id}-${r}`
|
|
113
|
+
) : /* @__PURE__ */ o(
|
|
114
|
+
v,
|
|
115
|
+
{
|
|
116
|
+
column: e,
|
|
117
|
+
data: i
|
|
118
|
+
},
|
|
119
|
+
`${e.id}-${r}`
|
|
120
|
+
)
|
|
121
|
+
) })
|
|
122
|
+
] }),
|
|
123
|
+
g && /* @__PURE__ */ o(t, { items: "center", justify: "center", horizontal: !0, horizontalMobile: !0, children: /* @__PURE__ */ o("span", { className: "text-icon-primary-normal", children: /* @__PURE__ */ o(C, { name: "keyboard_arrow_down" }) }) })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
L as MobileDataGridCard
|
|
130
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox as u } from "../Checkbox.js";
|
|
3
|
+
import { Heading3 as g } from "../Heading.js";
|
|
4
|
+
import { Stack as c } from "../Stack.js";
|
|
5
|
+
import { Theme as b } from "../Theme.js";
|
|
6
|
+
import { ColumnSelector as x } from "./ColumnSelector/index.js";
|
|
7
|
+
import { useGridContext as y } from "./GridContextProvider/useGridContext.js";
|
|
8
|
+
function j({
|
|
9
|
+
header: t,
|
|
10
|
+
enableColumnSelector: a,
|
|
11
|
+
enableRowSelection: m
|
|
12
|
+
}) {
|
|
13
|
+
const l = y(), {
|
|
14
|
+
id: r,
|
|
15
|
+
testid: o,
|
|
16
|
+
selectedRowIds: i,
|
|
17
|
+
data: d,
|
|
18
|
+
primaryKey: n,
|
|
19
|
+
columns: s,
|
|
20
|
+
handleRowSelectAll: h
|
|
21
|
+
} = l;
|
|
22
|
+
return typeof t > "u" && !n ? null : typeof t == "function" ? /* @__PURE__ */ e(t, { ...l }) : typeof t == "string" || n ? /* @__PURE__ */ e(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
id: r ? `${r}-header` : void 0,
|
|
26
|
+
"data-testid": o ? `${o}-header` : void 0,
|
|
27
|
+
className: "sticky top-0",
|
|
28
|
+
children: /* @__PURE__ */ e(b, { theme: "brand", children: /* @__PURE__ */ p(
|
|
29
|
+
c,
|
|
30
|
+
{
|
|
31
|
+
horizontal: !0,
|
|
32
|
+
horizontalMobile: !0,
|
|
33
|
+
items: "center",
|
|
34
|
+
justify: "between",
|
|
35
|
+
backgroundColor: "background-primary-normal",
|
|
36
|
+
children: [
|
|
37
|
+
m && /* @__PURE__ */ e("div", { className: "p-mobile-component-padding border-r border-brand-200 max-w-fit self-stretch flex items-center", children: /* @__PURE__ */ e(
|
|
38
|
+
u,
|
|
39
|
+
{
|
|
40
|
+
id: r ? `${r}-select-all-checkbox` : void 0,
|
|
41
|
+
testid: o ? `${o}-select-all-checkbox` : void 0,
|
|
42
|
+
checked: i.length === d.length,
|
|
43
|
+
indeterminate: !!i.length && i.length !== d.length,
|
|
44
|
+
onChange: h
|
|
45
|
+
}
|
|
46
|
+
) }),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
c,
|
|
49
|
+
{
|
|
50
|
+
horizontal: !0,
|
|
51
|
+
horizontalMobile: !0,
|
|
52
|
+
items: "center",
|
|
53
|
+
sizing: "component",
|
|
54
|
+
padding: !0,
|
|
55
|
+
children: /* @__PURE__ */ e(g, { as: "span", color: "text-primary-normal", children: typeof t == "string" ? t : s.find((f) => f.id === n)?.header?.toString() })
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
a && /* @__PURE__ */ e(x, {})
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
) })
|
|
62
|
+
}
|
|
63
|
+
) : null;
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
j as MobileDataGridHeader
|
|
67
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Paragraph as l } from "../../Paragraph.js";
|
|
3
|
+
import { Stack as d } from "../../Stack.js";
|
|
4
|
+
import { useGridContext as m } from "../GridContextProvider/useGridContext.js";
|
|
5
|
+
import { MobileDataGridColumn as n } from "../MobileDataGridCard/MobileDataGridColumn.js";
|
|
6
|
+
function h() {
|
|
7
|
+
const a = m(), { columns: s, currentRow: r } = a;
|
|
8
|
+
return r ? /* @__PURE__ */ e(d, { sizing: "layout-group", children: s.filter((t) => !t.id?.startsWith("__")).map(
|
|
9
|
+
(t, i) => t.meta?.useCustomRenderer && t.meta.mobileCell && t.id ? /* @__PURE__ */ o(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: "grid grid-cols-2 gap-2 items-center flex-1",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ o(l, { color: "text-secondary-normal", className: "text-left", children: [
|
|
15
|
+
t.header?.toString(),
|
|
16
|
+
":"
|
|
17
|
+
] }),
|
|
18
|
+
" ",
|
|
19
|
+
/* @__PURE__ */ e(
|
|
20
|
+
t.meta.mobileCell,
|
|
21
|
+
{
|
|
22
|
+
column: t,
|
|
23
|
+
row: r,
|
|
24
|
+
cellValue: r?.[t.id]
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
`${t.id}-${i}`
|
|
30
|
+
) : /* @__PURE__ */ e(
|
|
31
|
+
n,
|
|
32
|
+
{
|
|
33
|
+
column: t,
|
|
34
|
+
data: r
|
|
35
|
+
},
|
|
36
|
+
`${t.id}-${i}`
|
|
37
|
+
)
|
|
38
|
+
) }) : null;
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
h as ModalContent
|
|
42
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as o, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { Button as r } from "../../Button.js";
|
|
3
|
+
import { Heading2 as m } from "../../Heading.js";
|
|
4
|
+
import { Icon as d } from "../../Icon.js";
|
|
5
|
+
import { Modal as u } from "../../Modal.js";
|
|
6
|
+
import { Stack as f } from "../../Stack.js";
|
|
7
|
+
import { useGridContext as p } from "../GridContextProvider/useGridContext.js";
|
|
8
|
+
import { ModalContent as h } from "./ModalContent.js";
|
|
9
|
+
function I() {
|
|
10
|
+
const n = p(), {
|
|
11
|
+
id: t,
|
|
12
|
+
testid: i,
|
|
13
|
+
isRowDetailOpen: l,
|
|
14
|
+
currentRow: s,
|
|
15
|
+
primaryKey: c,
|
|
16
|
+
closeRowDetail: e
|
|
17
|
+
} = n;
|
|
18
|
+
return /* @__PURE__ */ o(
|
|
19
|
+
u,
|
|
20
|
+
{
|
|
21
|
+
open: l,
|
|
22
|
+
onClose: e,
|
|
23
|
+
hideCloseIcon: !0,
|
|
24
|
+
size: "medium",
|
|
25
|
+
className: "!p-0",
|
|
26
|
+
headerIcon: /* @__PURE__ */ a(
|
|
27
|
+
f,
|
|
28
|
+
{
|
|
29
|
+
horizontal: !0,
|
|
30
|
+
horizontalMobile: !0,
|
|
31
|
+
items: "center",
|
|
32
|
+
justify: "between",
|
|
33
|
+
width: "full",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ o(m, { children: s?.[c ?? "id"] ?? "Grid Detail" }),
|
|
36
|
+
/* @__PURE__ */ o(
|
|
37
|
+
r,
|
|
38
|
+
{
|
|
39
|
+
id: t ? `${t}-close-button` : void 0,
|
|
40
|
+
testid: i ? `${i}-close-button` : void 0,
|
|
41
|
+
iconOnly: !0,
|
|
42
|
+
variant: "tertiary",
|
|
43
|
+
onClick: e,
|
|
44
|
+
leftIcon: /* @__PURE__ */ o("span", { className: "text-icon-primary-normal contents", children: /* @__PURE__ */ o(d, { name: "close", size: 24 }) })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
customActions: /* @__PURE__ */ o(r, { onClick: e, className: "w-full", children: "Close" }),
|
|
51
|
+
showButtons: !0,
|
|
52
|
+
children: /* @__PURE__ */ o("div", { className: "bg-white max-h-full flex flex-col flex-grow-1", children: /* @__PURE__ */ o(h, {}) })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
I as RowDetailModalProvider
|
|
58
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function p(d, r) {
|
|
2
|
+
const { type: t, payload: i } = r;
|
|
3
|
+
let e = null;
|
|
4
|
+
switch (r.type === "INSERT" && r.pos === "INDEX" && (e = r.index), r.type === "UPDATE" && (e = r.index ?? d.filter(({ id: n }) => !!n).findIndex(({ id: n }) => n === r.id)), t) {
|
|
5
|
+
case "SET":
|
|
6
|
+
return [...i];
|
|
7
|
+
case "UPDATE":
|
|
8
|
+
if (typeof e != "number" || e < 0)
|
|
9
|
+
throw new Error("action.(id | index) must be provided.");
|
|
10
|
+
return [
|
|
11
|
+
...d.slice(0, e),
|
|
12
|
+
{
|
|
13
|
+
...d[e],
|
|
14
|
+
...i,
|
|
15
|
+
meta: {
|
|
16
|
+
...d[e].meta ?? {},
|
|
17
|
+
...i.meta ?? {}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
...d.slice(e + 1)
|
|
21
|
+
];
|
|
22
|
+
default:
|
|
23
|
+
throw new Error("Action type not implemented.");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
p as dataGridReducer
|
|
28
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as o, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { MobileDataGridHeader as x } from "./MobileDataGridHeader.js";
|
|
3
|
+
import { GridContextProvider as y } from "./GridContextProvider/index.js";
|
|
4
|
+
import { RowDetailModalProvider as D } from "./RowDetailModalProvider/index.js";
|
|
5
|
+
import { ColumnList as G } from "./ColumnList.js";
|
|
6
|
+
import { Stack as M } from "../Stack.js";
|
|
7
|
+
function L(i) {
|
|
8
|
+
const {
|
|
9
|
+
columns: t,
|
|
10
|
+
data: d,
|
|
11
|
+
renderLink: n,
|
|
12
|
+
renderChevron: l,
|
|
13
|
+
getId: m,
|
|
14
|
+
id: a,
|
|
15
|
+
testid: f,
|
|
16
|
+
enableColumnSelector: s,
|
|
17
|
+
enableRowSelection: e,
|
|
18
|
+
header: h,
|
|
19
|
+
withBorder: u = !0,
|
|
20
|
+
footer: c,
|
|
21
|
+
onRowSelect: p,
|
|
22
|
+
numberOfColumnsToShow: w,
|
|
23
|
+
primaryKey: b,
|
|
24
|
+
hideHeader: v,
|
|
25
|
+
rowActions: C,
|
|
26
|
+
rounded: S = !0
|
|
27
|
+
} = i;
|
|
28
|
+
return /* @__PURE__ */ o(
|
|
29
|
+
y,
|
|
30
|
+
{
|
|
31
|
+
initialColumns: t,
|
|
32
|
+
id: a,
|
|
33
|
+
testid: f,
|
|
34
|
+
data: d,
|
|
35
|
+
getId: m,
|
|
36
|
+
onRowSelect: p,
|
|
37
|
+
numberOfColumnsToShow: w,
|
|
38
|
+
primaryKey: b,
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ o(
|
|
41
|
+
M,
|
|
42
|
+
{
|
|
43
|
+
height: "full",
|
|
44
|
+
rounded: S,
|
|
45
|
+
overflowX: "hidden",
|
|
46
|
+
overflowY: "hidden",
|
|
47
|
+
className: u ? "border border-border-primary-normal" : void 0,
|
|
48
|
+
children: [
|
|
49
|
+
!v && /* @__PURE__ */ r(
|
|
50
|
+
x,
|
|
51
|
+
{
|
|
52
|
+
header: h,
|
|
53
|
+
enableColumnSelector: s,
|
|
54
|
+
enableRowSelection: e
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ r(
|
|
58
|
+
G,
|
|
59
|
+
{
|
|
60
|
+
withBorder: !1,
|
|
61
|
+
renderLink: n,
|
|
62
|
+
renderChevron: l,
|
|
63
|
+
enableRowSelection: e,
|
|
64
|
+
footer: c,
|
|
65
|
+
rowActions: C
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ r(D, {})
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
L as MobileDataGrid
|
|
78
|
+
};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as a, Fragment as N, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { useState as g, useRef as $, useLayoutEffect as I, useEffect as w } from "react";
|
|
4
|
+
import { createPortal as j } from "react-dom";
|
|
5
|
+
import { NestedMenu as A } from "./NestedMenu.js";
|
|
6
|
+
import { MenuOption as D } from "./MenuOption.js";
|
|
7
|
+
import { Icon as m } from "./Icon.js";
|
|
8
|
+
import { Stack as k } from "./Stack.js";
|
|
9
|
+
import { Button as H } from "./Button.js";
|
|
10
|
+
import { Heading1 as L } from "./Heading.js";
|
|
11
|
+
import { Theme as R } from "./Theme.js";
|
|
12
|
+
import { useMounted as X } from "../hooks/useMounted.js";
|
|
13
|
+
import { useKeydown as Y } from "../hooks/useKeydown.js";
|
|
14
|
+
import { findDocumentRoot as K } from "../utils.js";
|
|
15
|
+
import { clsx as v } from "../node_modules/clsx/dist/clsx.js";
|
|
16
|
+
function te({
|
|
17
|
+
id: c,
|
|
18
|
+
testid: o,
|
|
19
|
+
currentMenu: i,
|
|
20
|
+
open: r,
|
|
21
|
+
onClose: l,
|
|
22
|
+
onNavigate: h,
|
|
23
|
+
direction: b = "left",
|
|
24
|
+
footer: E,
|
|
25
|
+
hideFooterOnSubMenu: x = !1,
|
|
26
|
+
theme: C = "brand",
|
|
27
|
+
pinnedSubMenuEntry: M
|
|
28
|
+
}) {
|
|
29
|
+
const [s, d] = g(
|
|
30
|
+
null
|
|
31
|
+
), [y, u] = g(0), z = X(), p = $(null), S = {
|
|
32
|
+
transform: r ? "translateX(0)" : b === "right" ? "translateX(100%)" : "translateX(-100%)"
|
|
33
|
+
};
|
|
34
|
+
I(() => {
|
|
35
|
+
r && (d(null), u(0));
|
|
36
|
+
}, [r]), Y(
|
|
37
|
+
{
|
|
38
|
+
ArrowUp: () => {
|
|
39
|
+
const e = i.subEntries?.length || 0;
|
|
40
|
+
e !== 0 && u((t) => t <= 0 ? e - 1 : t - 1);
|
|
41
|
+
},
|
|
42
|
+
ArrowDown: () => {
|
|
43
|
+
const e = i.subEntries?.length || 0;
|
|
44
|
+
e !== 0 && u((t) => t >= e - 1 ? 0 : t + 1);
|
|
45
|
+
},
|
|
46
|
+
"Enter/Space": () => {
|
|
47
|
+
const e = (i.subEntries || [])[y];
|
|
48
|
+
e && f(
|
|
49
|
+
e,
|
|
50
|
+
e.subEntries?.length ? "subEntry" : e.onClick ? "onClick" : void 0
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
r && !s
|
|
55
|
+
), w(() => {
|
|
56
|
+
if (!r) return;
|
|
57
|
+
const e = window.scrollY, t = document.body;
|
|
58
|
+
return t.style.position = "fixed", t.style.top = `-${e}px`, t.style.left = "0", t.style.right = "0", t.style.overflow = "hidden", t.style.width = "100%", () => {
|
|
59
|
+
t.style.position = "", t.style.top = "", t.style.left = "", t.style.right = "", t.style.overflow = "", t.style.width = "", window.scrollTo(0, e);
|
|
60
|
+
};
|
|
61
|
+
}, [r]), w(() => {
|
|
62
|
+
const e = (t) => {
|
|
63
|
+
t.key === "Escape" && l();
|
|
64
|
+
};
|
|
65
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
66
|
+
}, [l]);
|
|
67
|
+
function f(e, t) {
|
|
68
|
+
if (!e) {
|
|
69
|
+
d(null);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (e.subEntries?.length && t !== "onClick") {
|
|
73
|
+
d(e);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (e.onClick && t === "onClick") {
|
|
77
|
+
h?.(e), e.onClick();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
e.url && (h?.(e), l());
|
|
81
|
+
}
|
|
82
|
+
return z ? j(
|
|
83
|
+
/* @__PURE__ */ a(N, { children: [
|
|
84
|
+
/* @__PURE__ */ n(
|
|
85
|
+
"div",
|
|
86
|
+
{
|
|
87
|
+
className: v(
|
|
88
|
+
"fixed inset-0 z-40 bg-black/50",
|
|
89
|
+
"transition-opacity duration-300",
|
|
90
|
+
r ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
91
|
+
),
|
|
92
|
+
onClick: l,
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ a(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
id: c,
|
|
100
|
+
"data-testid": o,
|
|
101
|
+
ref: p,
|
|
102
|
+
role: "dialog",
|
|
103
|
+
"aria-modal": "true",
|
|
104
|
+
className: v(
|
|
105
|
+
"fixed top-0 z-50 h-dvh w-full max-w-sm flex flex-col",
|
|
106
|
+
"bg-background-grouped-primary-normal overflow-hidden",
|
|
107
|
+
"transition-transform duration-300 ease-in-out",
|
|
108
|
+
b === "right" ? "right-0" : "left-0"
|
|
109
|
+
),
|
|
110
|
+
style: S,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ n(R, { theme: C, children: /* @__PURE__ */ a(
|
|
113
|
+
k,
|
|
114
|
+
{
|
|
115
|
+
horizontal: !0,
|
|
116
|
+
horizontalMobile: !0,
|
|
117
|
+
padding: !0,
|
|
118
|
+
sizing: "layout",
|
|
119
|
+
items: "center",
|
|
120
|
+
justify: "between",
|
|
121
|
+
backgroundColor: "background-primary-normal",
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ n(L, { color: "text-primary-normal", children: s?.label ?? i.label }),
|
|
124
|
+
/* @__PURE__ */ n(
|
|
125
|
+
H,
|
|
126
|
+
{
|
|
127
|
+
id: c ? `${c}-close-button` : void 0,
|
|
128
|
+
testid: o ? `${o}-close-button` : void 0,
|
|
129
|
+
iconOnly: !0,
|
|
130
|
+
leftIcon: /* @__PURE__ */ n(m, { className: "icon", name: "close", size: 24 }),
|
|
131
|
+
variant: "tertiary",
|
|
132
|
+
onClick: l
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
) }),
|
|
138
|
+
/* @__PURE__ */ a(k, { justify: "between", overflowY: "auto", grow: !0, children: [
|
|
139
|
+
/* @__PURE__ */ n("div", { className: "my-4", children: s ? /* @__PURE__ */ n(
|
|
140
|
+
A,
|
|
141
|
+
{
|
|
142
|
+
testid: o ? `${o}-nested-menu` : void 0,
|
|
143
|
+
currentMenu: s,
|
|
144
|
+
onMenuClick: f,
|
|
145
|
+
pinnedEntry: M
|
|
146
|
+
}
|
|
147
|
+
) : (i.subEntries ?? []).map((e, t) => /* @__PURE__ */ n(
|
|
148
|
+
D,
|
|
149
|
+
{
|
|
150
|
+
testid: o ? `${o}-${e.id}` : void 0,
|
|
151
|
+
selected: y === t,
|
|
152
|
+
onClick: () => f(
|
|
153
|
+
e,
|
|
154
|
+
e.subEntries?.length ? "subEntry" : e.onClick ? "onClick" : void 0
|
|
155
|
+
),
|
|
156
|
+
before: e.icon ? /* @__PURE__ */ n(m, { name: e.icon }) : void 0,
|
|
157
|
+
after: e.subEntries?.length ? /* @__PURE__ */ n(m, { name: "chevron_right", className: "icon", size: 24 }) : void 0,
|
|
158
|
+
children: e.label
|
|
159
|
+
},
|
|
160
|
+
e.id
|
|
161
|
+
)) }),
|
|
162
|
+
(!x || !s) && E
|
|
163
|
+
] })
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }),
|
|
168
|
+
K(p.current)
|
|
169
|
+
) : null;
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
te as MobileNavMenu
|
|
173
|
+
};
|