impact-nova 0.1.13 → 1.0.0
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/components/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +83 -87
- package/dist/components/ui/date-picker/date-range-picker.js +129 -125
- package/dist/components/ui/date-picker/month-picker.js +90 -93
- package/dist/components/ui/date-picker/month-range-picker.js +132 -129
- package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
- package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
- package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
- package/dist/components/ui/date-picker/week-picker.js +116 -112
- package/dist/components/ui/date-picker/week-range-picker.js +153 -142
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -5,6 +5,7 @@ const s = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
7
|
ref: r,
|
|
8
|
+
"data-component": "card",
|
|
8
9
|
className: t(
|
|
9
10
|
"rounded-xl border bg-card text-card-foreground shadow",
|
|
10
11
|
a
|
|
@@ -31,7 +32,7 @@ const c = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
|
31
32
|
}
|
|
32
33
|
));
|
|
33
34
|
c.displayName = "CardTitle";
|
|
34
|
-
const
|
|
35
|
+
const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
35
36
|
"div",
|
|
36
37
|
{
|
|
37
38
|
ref: r,
|
|
@@ -39,9 +40,9 @@ const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
|
39
40
|
...e
|
|
40
41
|
}
|
|
41
42
|
));
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
n.displayName = "CardDescription";
|
|
44
|
+
const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
|
|
45
|
+
m.displayName = "CardContent";
|
|
45
46
|
const f = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
@@ -53,8 +54,8 @@ const f = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
|
|
|
53
54
|
f.displayName = "CardFooter";
|
|
54
55
|
export {
|
|
55
56
|
s as Card,
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
m as CardContent,
|
|
58
|
+
n as CardDescription,
|
|
58
59
|
f as CardFooter,
|
|
59
60
|
i as CardHeader,
|
|
60
61
|
c as CardTitle
|
|
@@ -1,54 +1,70 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { Check as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
children: /* @__PURE__ */ t(
|
|
20
|
-
o.Indicator,
|
|
21
|
-
{
|
|
22
|
-
className: a("flex items-center justify-center text-current group"),
|
|
23
|
-
children: [
|
|
24
|
-
/* @__PURE__ */ e(b, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
|
|
25
|
-
/* @__PURE__ */ e(u, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
(r || d) && /* @__PURE__ */ t("div", { className: "grid gap-1.5 leading-none", children: [
|
|
32
|
-
r && /* @__PURE__ */ t(
|
|
33
|
-
"label",
|
|
1
|
+
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import * as m from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Check as y, Minus as N } from "lucide-react";
|
|
5
|
+
import { cn as r } from "../../lib/utils.js";
|
|
6
|
+
const w = i.forwardRef(({ className: f, label: s, helperText: c, isError: n, disabled: a, checked: e, defaultChecked: u, onCheckedChange: g, ...o }, p) => {
|
|
7
|
+
const k = i.useId(), h = o.id || k, [b, l] = i.useState(
|
|
8
|
+
e !== void 0 ? e : u || !1
|
|
9
|
+
);
|
|
10
|
+
i.useEffect(() => {
|
|
11
|
+
e !== void 0 && l(e);
|
|
12
|
+
}, [e]);
|
|
13
|
+
const v = (x) => {
|
|
14
|
+
e === void 0 && l(x), g?.(x);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ d("div", { className: "flex items-center", "data-component": "checkbox", "data-state": b === "indeterminate" ? "indeterminate" : b ? "checked" : "unchecked", "data-disabled": a || void 0, children: [
|
|
17
|
+
/* @__PURE__ */ t(
|
|
18
|
+
m.Root,
|
|
34
19
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
20
|
+
ref: p,
|
|
21
|
+
id: h,
|
|
22
|
+
className: r(
|
|
23
|
+
"peer h-4 w-4 shrink-0 rounded-[4px] border border-tertiary-border bg-white ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-accent data-[state=checked]:text-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-accent data-[state=indeterminate]:text-primary mr-[7px]",
|
|
24
|
+
n && "border-destructive focus-visible:ring-destructive",
|
|
25
|
+
a && "border-border text-disabled-text data-[state=checked]:bg-disabled-secondary-bg data-[state=checked]:text-disabled-text",
|
|
26
|
+
f
|
|
40
27
|
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
checked: e,
|
|
29
|
+
defaultChecked: u,
|
|
30
|
+
onCheckedChange: v,
|
|
31
|
+
disabled: a,
|
|
32
|
+
...o,
|
|
33
|
+
children: /* @__PURE__ */ d(
|
|
34
|
+
m.Indicator,
|
|
35
|
+
{
|
|
36
|
+
"data-checkbox": "indicator",
|
|
37
|
+
className: r("flex items-center justify-center text-current group"),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ t(y, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
|
|
40
|
+
/* @__PURE__ */ t(N, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
)
|
|
46
44
|
}
|
|
47
45
|
),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
(s || c) && /* @__PURE__ */ d("div", { className: "grid gap-1.5 leading-none", children: [
|
|
47
|
+
s && /* @__PURE__ */ d(
|
|
48
|
+
"label",
|
|
49
|
+
{
|
|
50
|
+
htmlFor: h,
|
|
51
|
+
className: r(
|
|
52
|
+
"text-sm font-medium leading-[20px] text-secondary-foreground peer-data-[state=checked]:text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
53
|
+
n && "text-destructive",
|
|
54
|
+
a && "text-disabled-text"
|
|
55
|
+
),
|
|
56
|
+
children: [
|
|
57
|
+
s,
|
|
58
|
+
" ",
|
|
59
|
+
o.required && /* @__PURE__ */ t("span", { className: "text-destructive", children: "*" })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
c && /* @__PURE__ */ t("p", { className: r("text-sm text-muted-foreground", n && "text-destructive"), children: c })
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
});
|
|
67
|
+
w.displayName = m.Root.displayName;
|
|
52
68
|
export {
|
|
53
|
-
|
|
69
|
+
w as Checkbox
|
|
54
70
|
};
|
|
@@ -8,6 +8,7 @@ declare const chipVariants: (props?: {
|
|
|
8
8
|
export interface ChipProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof chipVariants> {
|
|
9
9
|
onRemove?: () => void;
|
|
10
10
|
removable?: boolean;
|
|
11
|
+
asChild?: boolean;
|
|
11
12
|
}
|
|
12
13
|
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
14
|
export { Chip, chipVariants };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Slot as f } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as g } from "class-variance-authority";
|
|
5
|
+
import { Cross as x } from "../../icons/index.js";
|
|
6
|
+
import { cn as b } from "../../lib/utils.js";
|
|
7
|
+
const v = g(
|
|
7
8
|
"inline-flex items-center gap-1.5 px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
9
|
{
|
|
9
10
|
variants: {
|
|
@@ -30,31 +31,38 @@ const g = f(
|
|
|
30
31
|
shape: "pill"
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
),
|
|
34
|
-
({ className:
|
|
35
|
-
"div",
|
|
34
|
+
), h = m.forwardRef(
|
|
35
|
+
({ className: n, variant: r, size: e, shape: o, onRemove: a, removable: i, asChild: d = !1, children: s, ...p }, c) => /* @__PURE__ */ l(
|
|
36
|
+
d ? f : "div",
|
|
36
37
|
{
|
|
37
|
-
ref:
|
|
38
|
-
className:
|
|
39
|
-
|
|
38
|
+
ref: c,
|
|
39
|
+
className: b(v({ variant: r, size: e, shape: o }), n),
|
|
40
|
+
"data-component": "chip",
|
|
41
|
+
"data-variant": r ?? "default",
|
|
42
|
+
"data-size": e ?? "md",
|
|
43
|
+
"data-shape": o ?? "pill",
|
|
44
|
+
...p,
|
|
40
45
|
children: [
|
|
41
|
-
|
|
42
|
-
|
|
46
|
+
s,
|
|
47
|
+
i && /* @__PURE__ */ t(
|
|
43
48
|
"button",
|
|
44
49
|
{
|
|
45
50
|
type: "button",
|
|
46
|
-
onClick:
|
|
51
|
+
onClick: (u) => {
|
|
52
|
+
u.stopPropagation(), a?.();
|
|
53
|
+
},
|
|
47
54
|
className: "ml-1 p-1 rounded-full hover:bg-black/20 focus:outline-none focus:ring-2 focus:ring-ring",
|
|
48
55
|
"aria-label": "Remove",
|
|
49
|
-
|
|
56
|
+
"data-component": "chip-remove",
|
|
57
|
+
children: /* @__PURE__ */ t(x, { size: 8 })
|
|
50
58
|
}
|
|
51
59
|
)
|
|
52
60
|
]
|
|
53
61
|
}
|
|
54
62
|
)
|
|
55
63
|
);
|
|
56
|
-
|
|
64
|
+
h.displayName = "Chip";
|
|
57
65
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
66
|
+
h as Chip,
|
|
67
|
+
v as chipVariants
|
|
60
68
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
interface DataTableColumnListProps {
|
|
2
2
|
enableApplyDiscard?: boolean;
|
|
3
3
|
enableLazyHierarchy?: boolean;
|
|
4
|
+
showSearch?: boolean;
|
|
5
|
+
showSelectAll?: boolean;
|
|
6
|
+
showCollapse?: boolean;
|
|
4
7
|
}
|
|
5
|
-
export declare const DataTableColumnList: ({ enableApplyDiscard, enableLazyHierarchy }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const DataTableColumnList: ({ enableApplyDiscard, enableLazyHierarchy, showSearch, showSelectAll, showCollapse }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
9
|
export {};
|
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { NestedList as
|
|
5
|
-
import { SelectionMode as
|
|
6
|
-
function
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import { useState as N, useRef as b, useCallback as a, useEffect as T } from "react";
|
|
3
|
+
import { useDataTable as j } from "./data-table-context.js";
|
|
4
|
+
import { NestedList as P } from "../nested-list/nested-list.js";
|
|
5
|
+
import { SelectionMode as U } from "../types/nested-list.types.js";
|
|
6
|
+
function W(u) {
|
|
7
7
|
return "getChildren" in u && typeof u.getChildren == "function";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
return ((...
|
|
12
|
-
|
|
9
|
+
function _(u, h) {
|
|
10
|
+
let f = null;
|
|
11
|
+
return ((...S) => {
|
|
12
|
+
f && clearTimeout(f), f = setTimeout(() => u(...S), h);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const Q = ({
|
|
16
16
|
enableApplyDiscard: u = !1,
|
|
17
|
-
enableLazyHierarchy: h = !1
|
|
17
|
+
enableLazyHierarchy: h = !1,
|
|
18
|
+
showSearch: f = !0,
|
|
19
|
+
showSelectAll: S = !0,
|
|
20
|
+
showCollapse: I = !0
|
|
18
21
|
}) => {
|
|
19
|
-
const { gridApi: t } =
|
|
22
|
+
const { gridApi: t } = j(), [L, v] = N([]), [M, F] = N(!1), G = b(!1), R = b(/* @__PURE__ */ new Set()), k = b(/* @__PURE__ */ new Map()), x = a((r, l) => {
|
|
20
23
|
const n = (o, i) => {
|
|
21
|
-
if (
|
|
22
|
-
const e = o.getGroupId() || `${i.join("-")}-group`, c = [...i, e], d =
|
|
24
|
+
if (W(o)) {
|
|
25
|
+
const e = o.getGroupId() || `${i.join("-")}-group`, c = [...i, e], d = R.current.has(e), s = !h || d, p = [];
|
|
23
26
|
if (s) {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
const C = o.getChildren();
|
|
28
|
+
C && C.forEach((A) => {
|
|
29
|
+
p.push(n(A, c));
|
|
27
30
|
});
|
|
28
31
|
}
|
|
29
|
-
const
|
|
32
|
+
const z = p.length > 0 ? p.every((C) => C.checked) : !0;
|
|
30
33
|
return {
|
|
31
34
|
id: e,
|
|
32
35
|
label: o.getColGroupDef()?.headerName || "Column Group",
|
|
33
|
-
checked:
|
|
34
|
-
children:
|
|
36
|
+
checked: z,
|
|
37
|
+
children: p.length > 0 ? p : h ? [] : void 0,
|
|
35
38
|
category: "group"
|
|
36
39
|
};
|
|
37
40
|
} else {
|
|
38
|
-
const e = o.getColId(), c =
|
|
41
|
+
const e = o.getColId(), c = k.current.get(e), d = c ? !c.hide : o.isVisible();
|
|
39
42
|
return {
|
|
40
43
|
id: e,
|
|
41
44
|
label: o.getColDef().headerName || o.getColDef().field || e,
|
|
@@ -44,19 +47,19 @@ const B = ({
|
|
|
44
47
|
}
|
|
45
48
|
};
|
|
46
49
|
return n(r, l);
|
|
47
|
-
}, [h]),
|
|
48
|
-
if (!t ||
|
|
50
|
+
}, [h]), D = a((r, l) => r.map((n) => x(n, l)), [x]), m = a(() => {
|
|
51
|
+
if (!t || G.current)
|
|
49
52
|
return;
|
|
50
53
|
const r = t.getColumnState();
|
|
51
|
-
|
|
54
|
+
k.current = new Map(r.map((s) => [s.colId, s]));
|
|
52
55
|
const l = t.getColumnGroupState();
|
|
53
|
-
|
|
56
|
+
R.current = new Set(
|
|
54
57
|
l.filter((s) => s.open).map((s) => s.groupId)
|
|
55
58
|
);
|
|
56
|
-
const n = t.getLeftDisplayedColumnGroups() || [], o = t.getCenterDisplayedColumnGroups() || [], i = t.getRightDisplayedColumnGroups() || [], e =
|
|
59
|
+
const n = t.getLeftDisplayedColumnGroups() || [], o = t.getCenterDisplayedColumnGroups() || [], i = t.getRightDisplayedColumnGroups() || [], e = D(
|
|
57
60
|
[...n, ...i],
|
|
58
61
|
["frozen"]
|
|
59
|
-
), c =
|
|
62
|
+
), c = D(
|
|
60
63
|
o,
|
|
61
64
|
["scrollable"]
|
|
62
65
|
), d = [
|
|
@@ -77,11 +80,11 @@ const B = ({
|
|
|
77
80
|
isDragDisabled: !0
|
|
78
81
|
}
|
|
79
82
|
];
|
|
80
|
-
|
|
81
|
-
}, [t,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}, [m]),
|
|
83
|
+
v(d), F(!0);
|
|
84
|
+
}, [t, D]), E = b(null);
|
|
85
|
+
T(() => {
|
|
86
|
+
E.current = _(m, 150);
|
|
87
|
+
}, [m]), T(() => {
|
|
85
88
|
if (!t) return;
|
|
86
89
|
const r = setTimeout(() => m(), 0), l = [
|
|
87
90
|
"columnVisible",
|
|
@@ -91,13 +94,13 @@ const B = ({
|
|
|
91
94
|
"gridReady",
|
|
92
95
|
"columnGroupOpened"
|
|
93
96
|
], n = () => {
|
|
94
|
-
|
|
97
|
+
E.current?.();
|
|
95
98
|
};
|
|
96
99
|
return t.isDestroyed() || l.forEach((o) => t.addEventListener(o, n)), () => {
|
|
97
100
|
clearTimeout(r), t.isDestroyed() || l.forEach((o) => t.removeEventListener(o, n));
|
|
98
101
|
};
|
|
99
102
|
}, [t, m]);
|
|
100
|
-
const
|
|
103
|
+
const w = a((r) => {
|
|
101
104
|
const l = [], n = (o, i) => {
|
|
102
105
|
o.forEach((e) => {
|
|
103
106
|
if (e.id === "root-frozen") {
|
|
@@ -116,38 +119,39 @@ const B = ({
|
|
|
116
119
|
});
|
|
117
120
|
};
|
|
118
121
|
return n(r, null), l;
|
|
119
|
-
}, [t]),
|
|
122
|
+
}, [t]), g = a((r) => {
|
|
120
123
|
if (!t) return;
|
|
121
|
-
|
|
122
|
-
const l =
|
|
124
|
+
G.current = !0;
|
|
125
|
+
const l = w(r);
|
|
123
126
|
l.length > 0 && t.applyColumnState({
|
|
124
127
|
state: l,
|
|
125
128
|
applyOrder: !0
|
|
126
129
|
}), setTimeout(() => {
|
|
127
|
-
|
|
130
|
+
G.current = !1;
|
|
128
131
|
}, 300);
|
|
129
|
-
}, [t,
|
|
130
|
-
|
|
131
|
-
}, [
|
|
132
|
-
u ||
|
|
133
|
-
}, [u,
|
|
134
|
-
return
|
|
135
|
-
|
|
132
|
+
}, [t, w]), O = a((r) => {
|
|
133
|
+
g(r);
|
|
134
|
+
}, [g]), V = a((r) => {
|
|
135
|
+
u || g(r), v(r);
|
|
136
|
+
}, [u, g]);
|
|
137
|
+
return M ? /* @__PURE__ */ y("div", { className: "flex flex-col h-full bg-white", children: /* @__PURE__ */ y(
|
|
138
|
+
P,
|
|
136
139
|
{
|
|
137
|
-
items:
|
|
138
|
-
onChange:
|
|
139
|
-
onSubmit:
|
|
140
|
+
items: L,
|
|
141
|
+
onChange: V,
|
|
142
|
+
onSubmit: O,
|
|
140
143
|
enableApplyDiscard: u,
|
|
141
|
-
enableSearch:
|
|
142
|
-
enableSelectAll:
|
|
144
|
+
enableSearch: f,
|
|
145
|
+
enableSelectAll: S,
|
|
143
146
|
enableDragDrop: !0,
|
|
144
147
|
enableCollapse: !0,
|
|
145
|
-
|
|
148
|
+
enableGlobalCollapse: I,
|
|
149
|
+
selectionMode: U.CASCADE_DOWN,
|
|
146
150
|
searchPlaceholder: "Search columns...",
|
|
147
151
|
className: "h-full"
|
|
148
152
|
}
|
|
149
|
-
) }) : /* @__PURE__ */
|
|
153
|
+
) }) : /* @__PURE__ */ y("div", { className: "p-4 text-[13px] text-slate-400", children: "Loading columns..." });
|
|
150
154
|
};
|
|
151
155
|
export {
|
|
152
|
-
|
|
156
|
+
Q as DataTableColumnList
|
|
153
157
|
};
|
|
@@ -17,4 +17,4 @@ export declare const DataTableSheetHeader: ({ title, children, className }: {
|
|
|
17
17
|
export declare const DataTableSheetContent: ({ children, className }: {
|
|
18
18
|
children: React.ReactNode;
|
|
19
19
|
className?: string;
|
|
20
|
-
}) =>
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import m, { useState as x, createContext as b, useContext as v } from "react";
|
|
3
3
|
import { createPortal as w } from "react-dom";
|
|
4
4
|
import { X as g } from "lucide-react";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as c } from "../../../lib/utils.js";
|
|
6
6
|
import { Button as C } from "../button.js";
|
|
7
7
|
import { useDataTable as T } from "./data-table-context.js";
|
|
8
|
-
const
|
|
9
|
-
const e = v(
|
|
8
|
+
const u = b(null), d = () => {
|
|
9
|
+
const e = v(u);
|
|
10
10
|
if (!e)
|
|
11
11
|
throw new Error("useDataTableSheet must be used within DataTableSheet");
|
|
12
12
|
return e;
|
|
13
13
|
}, O = ({
|
|
14
14
|
children: e,
|
|
15
|
-
defaultOpen:
|
|
16
|
-
open:
|
|
17
|
-
onOpenChange:
|
|
15
|
+
defaultOpen: r = !1,
|
|
16
|
+
open: o,
|
|
17
|
+
onOpenChange: t
|
|
18
18
|
}) => {
|
|
19
|
-
const [
|
|
20
|
-
l || s(
|
|
19
|
+
const [a, s] = x(r), l = o !== void 0, p = l ? o : a, h = (f) => {
|
|
20
|
+
l || s(f), t?.(f);
|
|
21
21
|
};
|
|
22
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ n(u.Provider, { value: { open: p, setOpen: h }, children: e });
|
|
23
23
|
}, E = ({
|
|
24
24
|
children: e,
|
|
25
|
-
asChild:
|
|
25
|
+
asChild: r
|
|
26
26
|
}) => {
|
|
27
|
-
const { setOpen:
|
|
28
|
-
|
|
27
|
+
const { setOpen: o, open: t } = d(), a = (s) => {
|
|
28
|
+
o(!t);
|
|
29
29
|
};
|
|
30
|
-
if (
|
|
31
|
-
const s =
|
|
32
|
-
return
|
|
30
|
+
if (r) {
|
|
31
|
+
const s = m.Children.only(e);
|
|
32
|
+
return m.cloneElement(s, {
|
|
33
33
|
onClick: (l) => {
|
|
34
|
-
s.props.onClick?.(l),
|
|
34
|
+
s.props.onClick?.(l), a();
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
return /* @__PURE__ */
|
|
38
|
+
return /* @__PURE__ */ n(C, { variant: "outline", onClick: a, children: e });
|
|
39
39
|
}, P = ({
|
|
40
40
|
title: e,
|
|
41
|
-
children:
|
|
42
|
-
className:
|
|
41
|
+
children: r,
|
|
42
|
+
className: o
|
|
43
43
|
}) => {
|
|
44
|
-
const { setOpen:
|
|
45
|
-
return /* @__PURE__ */ i("div", { className:
|
|
46
|
-
/* @__PURE__ */
|
|
44
|
+
const { setOpen: t } = d();
|
|
45
|
+
return /* @__PURE__ */ i("div", { className: c("flex shrink-0 flex-row justify-between items-center px-4 py-3 mb-2 bg-[#eceefd]", o), children: [
|
|
46
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: e && /* @__PURE__ */ n("h2", { className: "font-[Manrope] font-bold text-base text-[#0d152c]", children: e }) }),
|
|
47
47
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
48
|
+
r,
|
|
49
|
+
/* @__PURE__ */ n(
|
|
50
50
|
"span",
|
|
51
51
|
{
|
|
52
52
|
role: "button",
|
|
53
53
|
className: "close_icon cursor-pointer flex items-center justify-center w-6 h-6 rounded-full hover:bg-slate-200/50 transition-colors",
|
|
54
|
-
onClick: () =>
|
|
55
|
-
children: /* @__PURE__ */
|
|
54
|
+
onClick: () => t(!1),
|
|
55
|
+
children: /* @__PURE__ */ n(g, { className: "h-4 w-4 text-slate-500" })
|
|
56
56
|
}
|
|
57
57
|
)
|
|
58
58
|
] })
|
|
59
59
|
] });
|
|
60
60
|
}, z = ({
|
|
61
61
|
children: e,
|
|
62
|
-
className:
|
|
62
|
+
className: r
|
|
63
63
|
}) => {
|
|
64
|
-
const { open:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
const { open: o } = d(), { sheetTarget: t } = T();
|
|
65
|
+
if (!o) return null;
|
|
66
|
+
const a = /* @__PURE__ */ n("div", { className: c(
|
|
67
|
+
"absolute inset-0 z-[35] flex justify-end overflow-hidden pointer-events-none",
|
|
68
|
+
!t && "fixed"
|
|
69
|
+
// Fallback to fixed if no target
|
|
70
|
+
), children: /* @__PURE__ */ i("div", { className: "flex h-[calc(100%+2px)] -my-px animate-in slide-in-from-right-[100%] duration-200 ease-in-out fade-in fill-mode-forwards", children: [
|
|
71
|
+
/* @__PURE__ */ n("div", { className: "w-[6px] bg-white border-l border-slate-200 shrink-0" }),
|
|
72
|
+
/* @__PURE__ */ n("div", { className: c(
|
|
73
|
+
"relative flex h-full w-[355px] flex-col overflow-y-auto bg-white border-t border-l border-slate-200 pointer-events-auto shadow-[0px_0px_4px_0px_rgba(0,0,0,0.12)]",
|
|
74
|
+
r
|
|
75
|
+
), children: e })
|
|
76
|
+
] }) });
|
|
77
|
+
return t ? w(a, t) : a;
|
|
75
78
|
};
|
|
76
79
|
export {
|
|
77
80
|
O as DataTableSheet,
|
|
@@ -3,33 +3,33 @@ import "react";
|
|
|
3
3
|
import { DropdownMenu as c, DropdownMenuTrigger as m, DropdownMenuContent as d, DropdownMenuItem as p, DropdownMenuSub as u, DropdownMenuSubTrigger as h, DropdownMenuSubContent as f, DropdownMenuRadioGroup as x, DropdownMenuRadioItem as t } from "../dropdown-menu.js";
|
|
4
4
|
import { Button as g } from "../button.js";
|
|
5
5
|
import { ThreeDots as D, Settings as N, Density as w, Stack as C, StackCompact as M, StackComfort as v } from "../../../icons/index.js";
|
|
6
|
-
import { useDataTable as
|
|
7
|
-
import { DataTableSheetTrigger as
|
|
6
|
+
import { useDataTable as S } from "./data-table-context.js";
|
|
7
|
+
import { DataTableSheetTrigger as b } from "./data-table-sheet.js";
|
|
8
8
|
const I = ({
|
|
9
9
|
enableTableSettings: r = !0,
|
|
10
|
-
enableContentDensity:
|
|
11
|
-
trigger:
|
|
10
|
+
enableContentDensity: s = !0,
|
|
11
|
+
trigger: n
|
|
12
12
|
}) => {
|
|
13
|
-
const { rowHeight:
|
|
13
|
+
const { rowHeight: l, setRowHeight: o } = S();
|
|
14
14
|
return /* @__PURE__ */ a(c, { children: [
|
|
15
|
-
/* @__PURE__ */ e(m, { asChild: !0, children:
|
|
16
|
-
/* @__PURE__ */ e(D, { size:
|
|
15
|
+
/* @__PURE__ */ e(m, { asChild: !0, children: n || /* @__PURE__ */ a(g, { variant: "secondary", size: "icon", "aria-label": "More", children: [
|
|
16
|
+
/* @__PURE__ */ e(D, { size: "sm" }),
|
|
17
17
|
/* @__PURE__ */ e("span", { className: "sr-only", children: "Open menu" })
|
|
18
18
|
] }) }),
|
|
19
|
-
/* @__PURE__ */ a(d, { align: "end", className: "w-[240px]
|
|
20
|
-
r && /* @__PURE__ */ e(
|
|
21
|
-
/* @__PURE__ */ e(N, { size:
|
|
19
|
+
/* @__PURE__ */ a(d, { align: "end", className: "w-[240px] flex flex-col gap-[2px]", children: [
|
|
20
|
+
r && /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "flex cursor-pointer gap-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
21
|
+
/* @__PURE__ */ e(N, { size: "sm", className: "text-slate-500" }),
|
|
22
22
|
/* @__PURE__ */ e("span", { children: "Table Settings" })
|
|
23
23
|
] }) }) }),
|
|
24
|
-
|
|
24
|
+
s && /* @__PURE__ */ a(u, { children: [
|
|
25
25
|
/* @__PURE__ */ a(h, { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
26
|
-
/* @__PURE__ */ e(w, { size:
|
|
26
|
+
/* @__PURE__ */ e(w, { size: "sm", className: "text-slate-500" }),
|
|
27
27
|
/* @__PURE__ */ e("span", { children: "Content density" })
|
|
28
28
|
] }),
|
|
29
|
-
/* @__PURE__ */ e(f, { className: "w-[190px]
|
|
29
|
+
/* @__PURE__ */ e(f, { className: "w-[190px]", children: /* @__PURE__ */ a(
|
|
30
30
|
x,
|
|
31
31
|
{
|
|
32
|
-
value:
|
|
32
|
+
value: l,
|
|
33
33
|
onValueChange: (i) => o(i),
|
|
34
34
|
className: "flex flex-col gap-0.5",
|
|
35
35
|
children: [
|
|
@@ -38,7 +38,7 @@ const I = ({
|
|
|
38
38
|
{
|
|
39
39
|
value: "default",
|
|
40
40
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
41
|
-
/* @__PURE__ */ e(C, { size:
|
|
41
|
+
/* @__PURE__ */ e(C, { size: "sm", className: "text-slate-500" }),
|
|
42
42
|
"Default"
|
|
43
43
|
] })
|
|
44
44
|
}
|
|
@@ -48,7 +48,7 @@ const I = ({
|
|
|
48
48
|
{
|
|
49
49
|
value: "compact",
|
|
50
50
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
51
|
-
/* @__PURE__ */ e(M, { size:
|
|
51
|
+
/* @__PURE__ */ e(M, { size: "sm", className: "text-slate-500" }),
|
|
52
52
|
"Compact"
|
|
53
53
|
] })
|
|
54
54
|
}
|
|
@@ -58,7 +58,7 @@ const I = ({
|
|
|
58
58
|
{
|
|
59
59
|
value: "comfort",
|
|
60
60
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
|
|
61
|
-
/* @__PURE__ */ e(v, { size:
|
|
61
|
+
/* @__PURE__ */ e(v, { size: "sm", className: "text-slate-500" }),
|
|
62
62
|
"Comfort"
|
|
63
63
|
] })
|
|
64
64
|
}
|