@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,20 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { clsx as i } from "../../node_modules/clsx/dist/clsx.js";
|
|
3
|
+
import { Icon as t } from "../Icon.js";
|
|
4
|
+
function c(r) {
|
|
5
|
+
if (r.key !== "ArrowDown" && r.key !== "ArrowUp") return;
|
|
6
|
+
r.preventDefault();
|
|
7
|
+
const e = r.key === "ArrowDown" ? r.currentTarget.nextElementSibling : r.currentTarget.previousElementSibling;
|
|
8
|
+
e instanceof HTMLTableRowElement && e.getAttribute("role") === "row" && e.focus();
|
|
9
|
+
}
|
|
10
|
+
function m(r, e = !1) {
|
|
11
|
+
const n = i(
|
|
12
|
+
"text-icon-on-action-primary-normal",
|
|
13
|
+
e && "invisible group-hover:visible"
|
|
14
|
+
);
|
|
15
|
+
return r === "asc" ? /* @__PURE__ */ o(t, { size: 16, className: n, name: "arrow_upward" }) : r === "desc" ? /* @__PURE__ */ o(t, { size: 16, className: n, name: "arrow_downward" }) : null;
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
m as getSortIcon,
|
|
19
|
+
c as handleRowArrowKeyDown
|
|
20
|
+
};
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as r, jsxs as W, Fragment as X } from "react/jsx-runtime";
|
|
3
|
+
import { useSortable as q } from "../node_modules/@dnd-kit/sortable/dist/sortable.esm.js";
|
|
4
|
+
import { CSS as J } from "../node_modules/@dnd-kit/utilities/dist/utilities.esm.js";
|
|
5
|
+
import { clsx as v } from "../node_modules/clsx/dist/clsx.js";
|
|
6
|
+
import { memo as Y, useRef as V, useState as A, useEffect as B } from "react";
|
|
7
|
+
import { componentPadding as Z, paddingUsingComponentGap as ee } from "../classNames.js";
|
|
8
|
+
import { MenuOption as f } from "./MenuOption.js";
|
|
9
|
+
import { Menu as U } from "./Menu.js";
|
|
10
|
+
import { Icon as j } from "./Icon.js";
|
|
11
|
+
import { Search as ne } from "./Search.js";
|
|
12
|
+
import { useSubMenuSystem as te } from "../hooks/useMenuSystem.js";
|
|
13
|
+
const _ = Y(
|
|
14
|
+
({
|
|
15
|
+
id: e,
|
|
16
|
+
type: d = "default",
|
|
17
|
+
component: o = "static",
|
|
18
|
+
children: m,
|
|
19
|
+
className: t,
|
|
20
|
+
locked: n = !1,
|
|
21
|
+
noPadding: g = !1,
|
|
22
|
+
paddedLeft: $ = !1,
|
|
23
|
+
style: w,
|
|
24
|
+
onClick: p,
|
|
25
|
+
onRightClick: C,
|
|
26
|
+
error: h,
|
|
27
|
+
warning: D,
|
|
28
|
+
pending: P,
|
|
29
|
+
center: k,
|
|
30
|
+
width: b,
|
|
31
|
+
minWidth: y,
|
|
32
|
+
disabled: F,
|
|
33
|
+
isLast: z,
|
|
34
|
+
testid: O,
|
|
35
|
+
...H
|
|
36
|
+
}) => {
|
|
37
|
+
const L = d === "header" ? "th" : "td", c = V(null), [E, S] = A(!1), [M, x] = A(!1);
|
|
38
|
+
B(() => () => {
|
|
39
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
40
|
+
}, []);
|
|
41
|
+
const G = (u) => {
|
|
42
|
+
x(!0), c.current = window.setTimeout(() => {
|
|
43
|
+
S(!0);
|
|
44
|
+
}, 500);
|
|
45
|
+
}, I = (u) => {
|
|
46
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
47
|
+
const K = u.nativeEvent instanceof MouseEvent && u.nativeEvent.button === 2;
|
|
48
|
+
!E && p && !K && M && p(u), K && C && C(), S(!1), x(!1);
|
|
49
|
+
}, R = () => {
|
|
50
|
+
c.current && (clearTimeout(c.current), c.current = null);
|
|
51
|
+
}, T = d === "header" && !n && !["button"].includes(o) && "bg-brand-400 border-brand-200", N = n && !["button"].includes(o) && "bg-neutral-400 border-neutral-300", l = d === "header" && o !== "button" && o !== "icon" && !z && v("border-r"), a = o === "button" && v("border-r border-b border-border-primary-normal"), s = o === "icon" && v("border-l"), i = v(
|
|
52
|
+
l,
|
|
53
|
+
a,
|
|
54
|
+
T,
|
|
55
|
+
N,
|
|
56
|
+
s,
|
|
57
|
+
t,
|
|
58
|
+
"flex flex-1 items-center gap-1 whitespace-nowrap h-10 relative text-text-primary-normal",
|
|
59
|
+
"focus-within:!z-10",
|
|
60
|
+
"overflow-x-hidden",
|
|
61
|
+
"overflow-y-hidden",
|
|
62
|
+
o === "input" && "border",
|
|
63
|
+
o === "input" && !h && !D && "border-border-primary-normal",
|
|
64
|
+
o === "input" && !h && !D && P && "[&:not(:focus-within)]:border-background-warning-normal",
|
|
65
|
+
o === "input" && h && "border-border-primary-error",
|
|
66
|
+
o === "input" && D && "border-background-warning-normal",
|
|
67
|
+
!["button", "icon"].includes(o) && !g && Z,
|
|
68
|
+
$ && "pl-2",
|
|
69
|
+
o === "icon" && "border-l",
|
|
70
|
+
E && "!cursor-grabbing",
|
|
71
|
+
o === "checkbox" || k && "justify-center",
|
|
72
|
+
F && "!text-text-primary-disabled"
|
|
73
|
+
);
|
|
74
|
+
return /* @__PURE__ */ r(
|
|
75
|
+
L,
|
|
76
|
+
{
|
|
77
|
+
id: e,
|
|
78
|
+
"data-testid": O,
|
|
79
|
+
className: v("flex h-10", !b && "flex-1"),
|
|
80
|
+
style: { width: b, minWidth: y },
|
|
81
|
+
...H,
|
|
82
|
+
"data-theme": d === "header" && !n ? "brand" : void 0,
|
|
83
|
+
children: /* @__PURE__ */ r(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
className: i,
|
|
87
|
+
style: {
|
|
88
|
+
...w
|
|
89
|
+
},
|
|
90
|
+
onMouseDown: G,
|
|
91
|
+
onMouseUp: I,
|
|
92
|
+
onMouseLeave: R,
|
|
93
|
+
onTouchStart: G,
|
|
94
|
+
onTouchEnd: I,
|
|
95
|
+
onTouchCancel: R,
|
|
96
|
+
onContextMenu: (u) => u.preventDefault(),
|
|
97
|
+
children: m
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
_.displayName = "DataGridCell";
|
|
105
|
+
function Q({
|
|
106
|
+
header: e,
|
|
107
|
+
children: d,
|
|
108
|
+
setNodeRef: o,
|
|
109
|
+
node: m,
|
|
110
|
+
id: t,
|
|
111
|
+
testid: n,
|
|
112
|
+
useMenuDefaultMinWidth: g,
|
|
113
|
+
allowUserGrouping: $,
|
|
114
|
+
...w
|
|
115
|
+
}) {
|
|
116
|
+
const [p, C] = A(!1), [h, D] = A(
|
|
117
|
+
e.column.getFilterValue() ?? ""
|
|
118
|
+
), P = V(null), k = V(!1), { column: b, getContext: y } = e, { id: F, setFilterValue: z } = b, {
|
|
119
|
+
menuRootRef: O,
|
|
120
|
+
isMenuActive: H,
|
|
121
|
+
registerSubMenu: L,
|
|
122
|
+
listeners: c,
|
|
123
|
+
mobileHide: E
|
|
124
|
+
} = te(m || P);
|
|
125
|
+
B(() => {
|
|
126
|
+
const l = y().table.options.initialState?.columnPinning, a = l?.left ?? [], s = l?.right ?? [];
|
|
127
|
+
k.current = [...a, ...s].includes(F);
|
|
128
|
+
}, [F, y]), B(() => {
|
|
129
|
+
const l = setTimeout(() => {
|
|
130
|
+
z(h);
|
|
131
|
+
}, 500);
|
|
132
|
+
return () => {
|
|
133
|
+
clearTimeout(l);
|
|
134
|
+
};
|
|
135
|
+
}, [h, z]);
|
|
136
|
+
const S = !!$ && b.getCanGroup(), M = b.getIsGrouped(), x = b.getGroupedIndex(), G = y().table.getState().grouping.length, I = (l) => {
|
|
137
|
+
y().table.setGrouping((a) => {
|
|
138
|
+
const s = a.indexOf(F), i = s + l;
|
|
139
|
+
if (s === -1 || i < 0 || i >= a.length)
|
|
140
|
+
return a;
|
|
141
|
+
const u = [...a];
|
|
142
|
+
return [u[s], u[i]] = [u[i], u[s]], u;
|
|
143
|
+
});
|
|
144
|
+
}, R = {
|
|
145
|
+
position: "relative",
|
|
146
|
+
whiteSpace: "nowrap",
|
|
147
|
+
minWidth: e.column.getSize(),
|
|
148
|
+
"--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
149
|
+
"--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
|
|
150
|
+
"--background-action-secondary-normal": "var(--color-text-brand-primary-normal)",
|
|
151
|
+
...w.style
|
|
152
|
+
};
|
|
153
|
+
return /* @__PURE__ */ W(
|
|
154
|
+
_,
|
|
155
|
+
{
|
|
156
|
+
id: t,
|
|
157
|
+
testid: n,
|
|
158
|
+
ref: o || P,
|
|
159
|
+
type: "header",
|
|
160
|
+
component: "header",
|
|
161
|
+
style: R,
|
|
162
|
+
minWidth: `${e.column.getSize()}px`,
|
|
163
|
+
onClick: e.column.getToggleSortingHandler(),
|
|
164
|
+
onRightClick: () => C(!p),
|
|
165
|
+
...w,
|
|
166
|
+
children: [
|
|
167
|
+
d,
|
|
168
|
+
M && /* @__PURE__ */ r(
|
|
169
|
+
j,
|
|
170
|
+
{
|
|
171
|
+
name: "workspaces",
|
|
172
|
+
size: 16,
|
|
173
|
+
className: "shrink-0",
|
|
174
|
+
title: `Grouped (level ${x + 1})`,
|
|
175
|
+
"data-testid": n ? `${n}-grouped-indicator` : void 0
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
(e.column.getCanFilter() || !k.current && e.column.getCanPin() || S) && /* @__PURE__ */ W(
|
|
179
|
+
U,
|
|
180
|
+
{
|
|
181
|
+
id: t ? `${t}-menu` : void 0,
|
|
182
|
+
testid: n ? `${n}-menu` : void 0,
|
|
183
|
+
ref: O,
|
|
184
|
+
positionTo: m || P,
|
|
185
|
+
show: p,
|
|
186
|
+
setShow: C,
|
|
187
|
+
mobileHide: E,
|
|
188
|
+
useDefaultMinWidth: g,
|
|
189
|
+
children: [
|
|
190
|
+
e.column.getCanFilter() && /* @__PURE__ */ r(
|
|
191
|
+
f,
|
|
192
|
+
{
|
|
193
|
+
id: t ? `${t}-filter-option` : void 0,
|
|
194
|
+
testid: n ? `${n}-filter-option` : void 0,
|
|
195
|
+
...c,
|
|
196
|
+
subMenu: ({ menuId: l, subMenuLevel: a, ...s }) => /* @__PURE__ */ W(
|
|
197
|
+
U,
|
|
198
|
+
{
|
|
199
|
+
id: t ? `${t}-filter-submenu` : void 0,
|
|
200
|
+
testid: n ? `${n}-filter-submenu` : void 0,
|
|
201
|
+
...s,
|
|
202
|
+
show: H(l, a),
|
|
203
|
+
ref: (i) => {
|
|
204
|
+
L(l, i);
|
|
205
|
+
},
|
|
206
|
+
useDefaultMinWidth: g,
|
|
207
|
+
children: [
|
|
208
|
+
/* @__PURE__ */ r("div", { className: v(ee), children: /* @__PURE__ */ r(
|
|
209
|
+
ne,
|
|
210
|
+
{
|
|
211
|
+
id: t ? `${t}-filter-search` : void 0,
|
|
212
|
+
testid: n ? `${n}-filter-search` : void 0,
|
|
213
|
+
onChange: (i) => {
|
|
214
|
+
D(i.target.value);
|
|
215
|
+
},
|
|
216
|
+
onKeyDown: (i) => {
|
|
217
|
+
[" ", "Space"].includes(i.key) && i.stopPropagation();
|
|
218
|
+
},
|
|
219
|
+
value: h ?? ""
|
|
220
|
+
}
|
|
221
|
+
) }),
|
|
222
|
+
/* @__PURE__ */ r(
|
|
223
|
+
f,
|
|
224
|
+
{
|
|
225
|
+
id: t ? `${t}-filter-contains` : void 0,
|
|
226
|
+
testid: n ? `${n}-filter-contains` : void 0,
|
|
227
|
+
onClick: N,
|
|
228
|
+
before: T("includesString"),
|
|
229
|
+
children: "Contains"
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ r(
|
|
233
|
+
f,
|
|
234
|
+
{
|
|
235
|
+
id: t ? `${t}-filter-startswith` : void 0,
|
|
236
|
+
testid: n ? `${n}-filter-startswith` : void 0,
|
|
237
|
+
onClick: N,
|
|
238
|
+
before: T("startsWith"),
|
|
239
|
+
children: "Starts with"
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ r(
|
|
243
|
+
f,
|
|
244
|
+
{
|
|
245
|
+
id: t ? `${t}-filter-endswith` : void 0,
|
|
246
|
+
testid: n ? `${n}-filter-endswith` : void 0,
|
|
247
|
+
onClick: N,
|
|
248
|
+
before: T("endsWith"),
|
|
249
|
+
children: "Ends with"
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
]
|
|
253
|
+
}
|
|
254
|
+
),
|
|
255
|
+
children: "Filter"
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
!k.current && e.column.getCanPin() && /* @__PURE__ */ r(
|
|
259
|
+
f,
|
|
260
|
+
{
|
|
261
|
+
onClick: () => {
|
|
262
|
+
C(!p);
|
|
263
|
+
},
|
|
264
|
+
...c,
|
|
265
|
+
subMenu: ({ menuId: l, subMenuLevel: a, ...s }) => /* @__PURE__ */ W(
|
|
266
|
+
U,
|
|
267
|
+
{
|
|
268
|
+
...s,
|
|
269
|
+
show: H(l, a),
|
|
270
|
+
ref: (i) => {
|
|
271
|
+
L(l, i);
|
|
272
|
+
},
|
|
273
|
+
children: [
|
|
274
|
+
/* @__PURE__ */ r(
|
|
275
|
+
f,
|
|
276
|
+
{
|
|
277
|
+
selected: e.column.getIsPinned() === "left",
|
|
278
|
+
onClick: () => {
|
|
279
|
+
e.column.getIsPinned() === "left" ? e.column.pin(!1) : e.column.pin("left");
|
|
280
|
+
},
|
|
281
|
+
after: e.column.getIsPinned() === "left" && /* @__PURE__ */ r(j, { name: "check" }),
|
|
282
|
+
children: "Left"
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
/* @__PURE__ */ r(
|
|
286
|
+
f,
|
|
287
|
+
{
|
|
288
|
+
selected: e.column.getIsPinned() === "right",
|
|
289
|
+
onClick: () => {
|
|
290
|
+
e.column.getIsPinned() === "right" ? e.column.pin(!1) : e.column.pin("right");
|
|
291
|
+
},
|
|
292
|
+
after: e.column.getIsPinned() === "right" && /* @__PURE__ */ r(j, { name: "check" }),
|
|
293
|
+
children: "Right"
|
|
294
|
+
}
|
|
295
|
+
)
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
children: `Freeze [${e.column.columnDef.header}]`
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
S && /* @__PURE__ */ r(
|
|
303
|
+
f,
|
|
304
|
+
{
|
|
305
|
+
id: t ? `${t}-group-option` : void 0,
|
|
306
|
+
testid: n ? `${n}-group-option` : void 0,
|
|
307
|
+
onClick: e.column.getToggleGroupingHandler(),
|
|
308
|
+
children: M ? "Remove group" : `Group by [${e.column.columnDef.header}]`
|
|
309
|
+
}
|
|
310
|
+
),
|
|
311
|
+
S && M && G > 1 && /* @__PURE__ */ W(X, { children: [
|
|
312
|
+
/* @__PURE__ */ r(
|
|
313
|
+
f,
|
|
314
|
+
{
|
|
315
|
+
id: t ? `${t}-group-move-up` : void 0,
|
|
316
|
+
testid: n ? `${n}-group-move-up` : void 0,
|
|
317
|
+
disabled: x === 0,
|
|
318
|
+
onClick: () => I(-1),
|
|
319
|
+
children: "Move up"
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
/* @__PURE__ */ r(
|
|
323
|
+
f,
|
|
324
|
+
{
|
|
325
|
+
id: t ? `${t}-group-move-down` : void 0,
|
|
326
|
+
testid: n ? `${n}-group-move-down` : void 0,
|
|
327
|
+
disabled: x === G - 1,
|
|
328
|
+
onClick: () => I(1),
|
|
329
|
+
children: "Move down"
|
|
330
|
+
}
|
|
331
|
+
)
|
|
332
|
+
] })
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
)
|
|
336
|
+
]
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
function T(l) {
|
|
340
|
+
return /* @__PURE__ */ r(
|
|
341
|
+
j,
|
|
342
|
+
{
|
|
343
|
+
name: "check",
|
|
344
|
+
className: v(
|
|
345
|
+
e.column.columnDef.filterFn !== l && "text-transparent"
|
|
346
|
+
)
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
function N(l, a) {
|
|
351
|
+
let s = "includesString";
|
|
352
|
+
const i = e.column.columnDef.filterFn;
|
|
353
|
+
a?.toLowerCase() === "starts with" && (s = i === "startsWith" ? "auto" : "startsWith"), a?.toLowerCase() === "ends with" && (s = i === "endsWith" ? "auto" : "endsWith"), a?.toLowerCase() === "contains" && (s = i === "includesString" ? "auto" : "includesString"), e.column.columnDef.filterFn = s, e.column.setFilterValue(h);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
Q.displayName = "DataCellHeader";
|
|
357
|
+
function oe({
|
|
358
|
+
header: e,
|
|
359
|
+
children: d,
|
|
360
|
+
...o
|
|
361
|
+
}) {
|
|
362
|
+
const { attributes: m, isDragging: t, listeners: n, setNodeRef: g, transform: $, node: w } = q({
|
|
363
|
+
id: e.column.id
|
|
364
|
+
}), p = {
|
|
365
|
+
opacity: t ? 0.8 : 1,
|
|
366
|
+
position: "relative",
|
|
367
|
+
transform: J.Translate.toString($),
|
|
368
|
+
transition: "width transform 0.2s ease-in-out",
|
|
369
|
+
whiteSpace: "nowrap",
|
|
370
|
+
zIndex: t ? 1 : 0,
|
|
371
|
+
"--color-text-primary-normal": "var(--color-action-000)",
|
|
372
|
+
"--color-icon-on-action-primary-normal": "var(--color-action-000)",
|
|
373
|
+
userSelect: "none"
|
|
374
|
+
};
|
|
375
|
+
return /* @__PURE__ */ r(
|
|
376
|
+
Q,
|
|
377
|
+
{
|
|
378
|
+
header: e,
|
|
379
|
+
setNodeRef: g,
|
|
380
|
+
node: w,
|
|
381
|
+
style: p,
|
|
382
|
+
...o,
|
|
383
|
+
...m,
|
|
384
|
+
...n,
|
|
385
|
+
children: d
|
|
386
|
+
}
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
oe.displayName = "DraggableCellHeader";
|
|
390
|
+
function re({
|
|
391
|
+
cell: e,
|
|
392
|
+
children: d,
|
|
393
|
+
...o
|
|
394
|
+
}) {
|
|
395
|
+
const { isDragging: m, setNodeRef: t, transform: n } = q({
|
|
396
|
+
id: e.column.id
|
|
397
|
+
}), g = {
|
|
398
|
+
opacity: m ? 0.8 : 1,
|
|
399
|
+
position: "relative",
|
|
400
|
+
transform: J.Translate.toString(n),
|
|
401
|
+
transition: "width transform 0.2s ease-in-out",
|
|
402
|
+
zIndex: m ? 1 : 0
|
|
403
|
+
};
|
|
404
|
+
return /* @__PURE__ */ r(_, { style: g, ref: t, width: `${e.column.getSize()}px`, ...o, children: d });
|
|
405
|
+
}
|
|
406
|
+
re.displayName = "DragAlongCell";
|
|
407
|
+
export {
|
|
408
|
+
Q as DataCellHeader,
|
|
409
|
+
_ as DataGridCell,
|
|
410
|
+
re as DragAlongCell,
|
|
411
|
+
oe as DraggableCellHeader
|
|
412
|
+
};
|