impact-nova 1.7.4 → 1.7.6
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/ui/ag-grid-react/headers/components/truncated-text.d.ts +15 -0
- package/dist/components/ui/ag-grid-react/headers/components/truncated-text.js +27 -0
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +22 -15
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +47 -43
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button-group.d.ts +3 -0
- package/dist/components/ui/button-group.js +129 -78
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox.js +64 -53
- package/dist/components/ui/data-table/data-table-saved-views.d.ts +2 -0
- package/dist/components/ui/data-table/data-table-saved-views.js +348 -0
- package/dist/components/ui/data-table/data-table-view-options.d.ts +8 -0
- package/dist/components/ui/data-table/index.d.ts +2 -0
- package/dist/components/ui/data-table/index.js +16 -14
- package/dist/components/ui/date-picker/date-range-picker.js +239 -196
- package/dist/components/ui/date-picker/month-range-picker.js +226 -183
- package/dist/components/ui/date-picker/week-range-picker.js +265 -222
- package/dist/components/ui/dialog.js +6 -6
- package/dist/components/ui/filter-panel/filter-panel.js +15 -8
- package/dist/components/ui/filter-strip/filter-strip.js +8 -9
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +107 -43
- package/dist/components/ui/notification-panel/notification-panel.d.ts +4 -4
- package/dist/components/ui/notification-panel/notification-panel.js +78 -16
- package/dist/components/ui/radio-group.d.ts +3 -0
- package/dist/components/ui/radio-group.js +101 -52
- package/dist/components/ui/select/select.js +579 -554
- package/dist/components/ui/sidebar.js +5 -5
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +104 -58
- package/dist/components/ui/types/data-table-saved-views.types.d.ts +71 -0
- package/dist/components/ui/types/helper-text.types.d.ts +5 -0
- package/dist/components/ui/types/select.types.d.ts +6 -0
- package/dist/i18n/defaultMessages.d.ts +19 -0
- package/dist/i18n/defaultMessages.js +33 -15
- package/dist/i18n/locales/de.js +19 -1
- package/dist/i18n/locales/es.js +19 -1
- package/dist/i18n/locales/hi.js +19 -1
- package/dist/i18n/locales/kn.js +19 -1
- package/dist/icons/assets/blocks.svg.js +1 -1
- package/dist/icons/assets/drawBrush.svg.js +5 -0
- package/dist/icons/assets/info-badge.svg.js +5 -0
- package/dist/icons/assets/priority-alert.svg.js +5 -0
- package/dist/icons/assets/settings.svg.js +1 -1
- package/dist/icons/assets/webp/sales.webp.js +4 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +253 -245
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +91 -89
- package/package.json +1 -1
|
@@ -1,73 +1,84 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { Check as y, Minus as
|
|
5
|
-
import { cn as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { jsxs as m, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import * as l from "@radix-ui/react-checkbox";
|
|
4
|
+
import { Check as y, Minus as I } from "lucide-react";
|
|
5
|
+
import { cn as i } from "../../lib/utils.js";
|
|
6
|
+
const R = u.forwardRef(({ className: v, label: n, helperText: e, helperTextPosition: s = "absolute", isError: c, disabled: r, checked: t, defaultChecked: b, onCheckedChange: k, onKeyDown: p, ...f }, N) => {
|
|
7
|
+
const w = u.useId(), g = f.id || w, [o, x] = u.useState(
|
|
8
|
+
t !== void 0 ? t : b || !1
|
|
9
9
|
);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}, [
|
|
13
|
-
const
|
|
14
|
-
|
|
10
|
+
u.useEffect(() => {
|
|
11
|
+
t !== void 0 && x(t);
|
|
12
|
+
}, [t]);
|
|
13
|
+
const h = (a) => {
|
|
14
|
+
t === void 0 && x(a), k?.(a);
|
|
15
15
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
18
|
-
|
|
16
|
+
return /* @__PURE__ */ m("div", { className: "flex items-center", "data-component": "checkbox", "data-state": o === "indeterminate" ? "indeterminate" : o ? "checked" : "unchecked", "data-disabled": r || void 0, children: [
|
|
17
|
+
/* @__PURE__ */ d(
|
|
18
|
+
l.Root,
|
|
19
19
|
{
|
|
20
|
-
ref:
|
|
21
|
-
id:
|
|
22
|
-
className:
|
|
20
|
+
ref: N,
|
|
21
|
+
id: g,
|
|
22
|
+
className: i(
|
|
23
23
|
"peer h-4 w-4 shrink-0 rounded-[4px] border border-stroke-field bg-canvas-elevated ring-offset-canvas focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-brand data-[state=checked]:bg-accent data-[state=checked]:text-brand data-[state=indeterminate]:border-brand data-[state=indeterminate]:bg-accent data-[state=indeterminate]:text-brand mr-[7px]",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
c && "border-destructive focus-visible:ring-destructive",
|
|
25
|
+
r && "border-stroke text-disabled-foreground data-[state=checked]:bg-disabled-surface data-[state=checked]:text-disabled-foreground",
|
|
26
|
+
v
|
|
27
27
|
),
|
|
28
|
-
checked:
|
|
28
|
+
checked: t,
|
|
29
29
|
defaultChecked: b,
|
|
30
|
-
onCheckedChange:
|
|
31
|
-
disabled:
|
|
32
|
-
onKeyDown: (
|
|
33
|
-
|
|
30
|
+
onCheckedChange: h,
|
|
31
|
+
disabled: r,
|
|
32
|
+
onKeyDown: (a) => {
|
|
33
|
+
a.key === "Enter" && (a.preventDefault(), h(o === "indeterminate" ? !0 : !o)), p?.(a);
|
|
34
34
|
},
|
|
35
|
-
...
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
-
|
|
35
|
+
...f,
|
|
36
|
+
children: /* @__PURE__ */ m(
|
|
37
|
+
l.Indicator,
|
|
38
38
|
{
|
|
39
39
|
"data-checkbox": "indicator",
|
|
40
|
-
className:
|
|
40
|
+
className: i("flex items-center justify-center text-current group"),
|
|
41
41
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ d(y, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
|
|
43
|
+
/* @__PURE__ */ d(I, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
(n || e) && /* @__PURE__ */ m(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: i(
|
|
53
|
+
"grid gap-[6px] leading-none",
|
|
54
|
+
e && s === "absolute" && "relative",
|
|
55
|
+
!n && e && s === "absolute" && "min-h-5"
|
|
56
|
+
),
|
|
57
|
+
children: [
|
|
58
|
+
n && /* @__PURE__ */ m(
|
|
59
|
+
"label",
|
|
60
|
+
{
|
|
61
|
+
htmlFor: g,
|
|
62
|
+
className: i(
|
|
63
|
+
"text-sm font-medium leading-[20px] text-secondary-foreground peer-data-[state=checked]:text-content peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
64
|
+
c && "text-destructive",
|
|
65
|
+
r && "text-disabled-foreground"
|
|
66
|
+
),
|
|
67
|
+
children: [
|
|
68
|
+
n,
|
|
69
|
+
" ",
|
|
70
|
+
f.required && /* @__PURE__ */ d("span", { className: "text-destructive", children: "*" })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
58
73
|
),
|
|
59
|
-
children:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
o && /* @__PURE__ */ a("p", { className: s("text-sm text-content-muted", m && "text-destructive"), children: o })
|
|
67
|
-
] })
|
|
74
|
+
e && s === "absolute" && /* @__PURE__ */ d("p", { className: i("absolute left-0 top-full z-10 mt-1 min-w-0 max-w-full text-[12px] font-medium leading-[18px] text-navigation-muted", c && "text-destructive"), children: e }),
|
|
75
|
+
e && s === "flow" && /* @__PURE__ */ d("p", { className: i("text-[12px] font-medium leading-[18px] text-navigation-muted", c && "text-destructive"), children: e })
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
68
79
|
] });
|
|
69
80
|
});
|
|
70
|
-
|
|
81
|
+
R.displayName = l.Root.displayName;
|
|
71
82
|
export {
|
|
72
|
-
|
|
83
|
+
R as Checkbox
|
|
73
84
|
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { DataTableSavedViewsProps } from '../types/data-table-saved-views.types';
|
|
2
|
+
export declare const DataTableSavedViews: ({ isSaveViewEnabled, views, activeViewSummary, viewTypeOptions, menuOpen: menuOpenControlled, defaultMenuOpen, onMenuOpenChange, onSearch, isLoadingViews, customListContent, disableApply, className, onSaveViewClick, onApply, onCancel, onEditView, onDeleteView, onSetDefaultView, }: DataTableSavedViewsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { jsxs as l, Fragment as ne, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { ChevronDown as le, Star as w, Search as ie, Pencil as se, Trash2 as re, Bookmark as oe } from "lucide-react";
|
|
4
|
+
import { cn as T } from "../../../lib/utils.js";
|
|
5
|
+
import { Popover as de, PopoverTrigger as ce, PopoverContent as me } from "../popover.js";
|
|
6
|
+
import { Tooltip as I, TooltipTrigger as O, TooltipContent as _ } from "../tooltip.js";
|
|
7
|
+
import { Button as o } from "../button.js";
|
|
8
|
+
import { Badge as C } from "../badge.js";
|
|
9
|
+
import { Input as pe } from "../input.js";
|
|
10
|
+
import { Separator as ue } from "../separator.js";
|
|
11
|
+
import { Skeleton as fe } from "../skeleton.js";
|
|
12
|
+
import { Prompt as he } from "../prompt.js";
|
|
13
|
+
import { useImpactNovaI18n as xe } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
14
|
+
const Se = ({
|
|
15
|
+
isSaveViewEnabled: L = !0,
|
|
16
|
+
views: s,
|
|
17
|
+
activeViewSummary: F,
|
|
18
|
+
viewTypeOptions: Q,
|
|
19
|
+
menuOpen: k,
|
|
20
|
+
defaultMenuOpen: q = !1,
|
|
21
|
+
onMenuOpenChange: V,
|
|
22
|
+
onSearch: m,
|
|
23
|
+
isLoadingViews: K = !1,
|
|
24
|
+
customListContent: D,
|
|
25
|
+
disableApply: R = !1,
|
|
26
|
+
className: Y,
|
|
27
|
+
onSaveViewClick: G,
|
|
28
|
+
onApply: H,
|
|
29
|
+
onCancel: J,
|
|
30
|
+
onEditView: U,
|
|
31
|
+
onDeleteView: W,
|
|
32
|
+
onSetDefaultView: z
|
|
33
|
+
}) => {
|
|
34
|
+
const { t: a } = xe(), x = k !== void 0, [X, Z] = i.useState(
|
|
35
|
+
q
|
|
36
|
+
), p = x ? !!k : X, d = i.useCallback(
|
|
37
|
+
(e) => {
|
|
38
|
+
x || Z(e), V?.(e);
|
|
39
|
+
},
|
|
40
|
+
[x, V]
|
|
41
|
+
), [u, b] = i.useState("All"), [v, g] = i.useState(""), [f, S] = i.useState("");
|
|
42
|
+
i.useEffect(() => {
|
|
43
|
+
const e = window.setTimeout(() => S(v), 300);
|
|
44
|
+
return () => window.clearTimeout(e);
|
|
45
|
+
}, [v]), i.useEffect(() => {
|
|
46
|
+
m && m(f);
|
|
47
|
+
}, [f, m]);
|
|
48
|
+
const M = i.useMemo(
|
|
49
|
+
() => s.find((e) => e.isActive),
|
|
50
|
+
[s]
|
|
51
|
+
), r = M ?? null, P = F ?? M?.viewName ?? a("dataTable.savedViewsNotApplicable"), [y, N] = i.useState(null), [h, A] = i.useState(null);
|
|
52
|
+
i.useEffect(() => {
|
|
53
|
+
if (p) {
|
|
54
|
+
const e = s.find((c) => c.isActive);
|
|
55
|
+
N(e?.id ?? null), b("All"), g(""), S("");
|
|
56
|
+
}
|
|
57
|
+
}, [p, s]);
|
|
58
|
+
const E = i.useMemo(() => u === "All" ? s : s.filter((e) => e.viewType === u), [s, u]), j = i.useMemo(() => {
|
|
59
|
+
let e = E;
|
|
60
|
+
if (!m && f.trim()) {
|
|
61
|
+
const c = f.trim().toLowerCase();
|
|
62
|
+
e = e.filter((n) => n.viewName.toLowerCase().includes(c));
|
|
63
|
+
}
|
|
64
|
+
return e;
|
|
65
|
+
}, [E, f, m]), B = y === null ? null : s.find((e) => e.id === y) ?? null, $ = () => {
|
|
66
|
+
H?.(B, { activeView: r }), d(!1);
|
|
67
|
+
}, ee = () => {
|
|
68
|
+
J?.({ activeView: r, pendingView: B }), d(!1);
|
|
69
|
+
}, te = (e) => {
|
|
70
|
+
d(e), e || g("");
|
|
71
|
+
};
|
|
72
|
+
if (!L)
|
|
73
|
+
return null;
|
|
74
|
+
const ae = s.length > 0;
|
|
75
|
+
return /* @__PURE__ */ l(ne, { children: [
|
|
76
|
+
/* @__PURE__ */ l(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
"data-component": "data-table-saved-views",
|
|
80
|
+
className: T(
|
|
81
|
+
"mb-2 mx-4 rounded-lg bg-[linear-gradient(83.74deg,#F5F9EC_72.68%,#D7E5B2_108.88%)] flex min-w-0 flex-wrap items-center justify-between gap-2 px-2 py-3",
|
|
82
|
+
Y
|
|
83
|
+
),
|
|
84
|
+
children: [
|
|
85
|
+
ae ? /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:flex-initial", children: /* @__PURE__ */ l(de, { open: p, onOpenChange: te, children: [
|
|
86
|
+
/* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ l(
|
|
87
|
+
"button",
|
|
88
|
+
{
|
|
89
|
+
type: "button",
|
|
90
|
+
className: "flex min-w-0 max-w-full cursor-pointer items-center gap-1 rounded-md border-none bg-transparent p-0 text-left outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2",
|
|
91
|
+
"aria-expanded": p,
|
|
92
|
+
"aria-haspopup": "dialog",
|
|
93
|
+
"aria-label": a("dataTable.savedViewsOpenMenu"),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ l(I, { children: [
|
|
96
|
+
/* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ t(
|
|
97
|
+
C,
|
|
98
|
+
{
|
|
99
|
+
color: "success",
|
|
100
|
+
variant: "outline",
|
|
101
|
+
className: "max-w-[min(100%,200px)] shrink font-['Manrope']",
|
|
102
|
+
children: /* @__PURE__ */ t("span", { className: "truncate", children: P })
|
|
103
|
+
}
|
|
104
|
+
) }),
|
|
105
|
+
/* @__PURE__ */ t(_, { variant: "tertiary", side: "top", children: P })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
"span",
|
|
109
|
+
{
|
|
110
|
+
className: T(
|
|
111
|
+
"flex size-6 shrink-0 items-center justify-center rounded-md bg-white transition-transform duration-200",
|
|
112
|
+
p && "rotate-180"
|
|
113
|
+
),
|
|
114
|
+
"aria-hidden": !0,
|
|
115
|
+
children: /* @__PURE__ */ t(le, { className: "size-3.5 text-content-charcoal" })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
) }),
|
|
121
|
+
/* @__PURE__ */ t(
|
|
122
|
+
me,
|
|
123
|
+
{
|
|
124
|
+
align: "start",
|
|
125
|
+
className: "z-[110] w-[min(100vw-24px,280px)] p-0 shadow-[0_0_4px_0_rgba(0,0,0,0.12)]",
|
|
126
|
+
sideOffset: 8,
|
|
127
|
+
children: /* @__PURE__ */ l("div", { className: "flex flex-col py-2", children: [
|
|
128
|
+
/* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-2 px-3 pb-2", children: [
|
|
129
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: a("dataTable.savedViewsTitle") }),
|
|
130
|
+
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-content-tertiary font-['Manrope']", children: [
|
|
131
|
+
/* @__PURE__ */ t(w, { className: "size-3.5 text-badge-warning-ink" }),
|
|
132
|
+
a("dataTable.savedViewsDefault")
|
|
133
|
+
] })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ l("div", { className: "flex flex-wrap gap-1.5 px-3 pb-2", children: [
|
|
136
|
+
/* @__PURE__ */ t(
|
|
137
|
+
"button",
|
|
138
|
+
{
|
|
139
|
+
type: "button",
|
|
140
|
+
className: "border-none bg-transparent p-0",
|
|
141
|
+
onClick: () => b("All"),
|
|
142
|
+
children: /* @__PURE__ */ t(
|
|
143
|
+
C,
|
|
144
|
+
{
|
|
145
|
+
color: u === "All" ? "primary" : "neutral",
|
|
146
|
+
variant: "outline",
|
|
147
|
+
size: "sm",
|
|
148
|
+
className: "cursor-pointer font-['Manrope']",
|
|
149
|
+
children: a("dataTable.savedViewsAll")
|
|
150
|
+
}
|
|
151
|
+
)
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
Q?.map((e) => /* @__PURE__ */ t(
|
|
155
|
+
"button",
|
|
156
|
+
{
|
|
157
|
+
type: "button",
|
|
158
|
+
className: "border-none bg-transparent p-0",
|
|
159
|
+
onClick: () => b(e.value),
|
|
160
|
+
children: /* @__PURE__ */ t(
|
|
161
|
+
C,
|
|
162
|
+
{
|
|
163
|
+
color: u === e.value ? "primary" : "neutral",
|
|
164
|
+
variant: "outline",
|
|
165
|
+
size: "sm",
|
|
166
|
+
className: "cursor-pointer font-['Manrope']",
|
|
167
|
+
children: e.label
|
|
168
|
+
}
|
|
169
|
+
)
|
|
170
|
+
},
|
|
171
|
+
e.value
|
|
172
|
+
))
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ t("div", { className: "px-3 pb-2", children: /* @__PURE__ */ t(
|
|
175
|
+
pe,
|
|
176
|
+
{
|
|
177
|
+
size: "sm",
|
|
178
|
+
placeholder: a("dataTable.savedViewsSearchPlaceholder"),
|
|
179
|
+
value: v,
|
|
180
|
+
onChange: (e) => g(e.target.value),
|
|
181
|
+
prefix: /* @__PURE__ */ t(
|
|
182
|
+
ie,
|
|
183
|
+
{
|
|
184
|
+
className: "size-4 shrink-0 text-content-muted",
|
|
185
|
+
"aria-hidden": !0
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
className: "border-none shadow-none my-2 rounded-none",
|
|
189
|
+
"aria-label": a("dataTable.savedViewsSearchPlaceholder")
|
|
190
|
+
}
|
|
191
|
+
) }),
|
|
192
|
+
/* @__PURE__ */ t("div", { className: "min-h-[72px] px-1", children: D || (K ? /* @__PURE__ */ t("div", { className: "flex max-h-[160px] flex-col gap-2 overflow-y-auto px-2 py-1", children: [1, 2, 3, 4, 5].map((e) => /* @__PURE__ */ t(fe, { className: "h-9 w-full rounded-lg" }, e)) }) : j.length === 0 ? /* @__PURE__ */ t("div", { className: "flex min-h-[100px] flex-col items-center justify-center px-4 py-6 text-center", children: /* @__PURE__ */ t("span", { className: "text-sm leading-relaxed text-content-tertiary font-['Manrope']", children: a("dataTable.savedViewsEmptyList") }) }) : /* @__PURE__ */ t("div", { className: "flex max-h-[160px] flex-col overflow-y-auto", children: j.map((e) => {
|
|
193
|
+
const c = y === e.id;
|
|
194
|
+
return /* @__PURE__ */ l(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
role: "button",
|
|
198
|
+
tabIndex: 0,
|
|
199
|
+
className: T(
|
|
200
|
+
"mb-1 flex cursor-pointer items-center justify-between rounded-lg px-3 py-2 text-left text-sm font-medium font-['Manrope'] hover:bg-muted",
|
|
201
|
+
c && "bg-badge-info-muted text-badge-info-foreground",
|
|
202
|
+
!c && "text-foreground"
|
|
203
|
+
),
|
|
204
|
+
onClick: () => N(e.id),
|
|
205
|
+
onKeyDown: (n) => {
|
|
206
|
+
(n.key === "Enter" || n.key === " ") && (n.preventDefault(), N(e.id));
|
|
207
|
+
},
|
|
208
|
+
children: [
|
|
209
|
+
/* @__PURE__ */ l(I, { children: [
|
|
210
|
+
/* @__PURE__ */ t(O, { asChild: !0, children: /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: e.viewName }) }),
|
|
211
|
+
/* @__PURE__ */ t(_, { variant: "tertiary", side: "right", children: e.viewName })
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
214
|
+
e.isEditable ? /* @__PURE__ */ t(
|
|
215
|
+
o,
|
|
216
|
+
{
|
|
217
|
+
type: "button",
|
|
218
|
+
variant: "ghost",
|
|
219
|
+
size: "iconSm",
|
|
220
|
+
className: "text-foreground hover:text-content-charcoal",
|
|
221
|
+
"aria-label": a("dataTable.savedViewsEdit"),
|
|
222
|
+
onClick: (n) => {
|
|
223
|
+
n.stopPropagation(), n.preventDefault(), d(!1), U?.(e, { activeView: r });
|
|
224
|
+
},
|
|
225
|
+
children: /* @__PURE__ */ t(se, { className: "size-3.5" })
|
|
226
|
+
}
|
|
227
|
+
) : null,
|
|
228
|
+
e.isDeletable ? /* @__PURE__ */ t(
|
|
229
|
+
o,
|
|
230
|
+
{
|
|
231
|
+
type: "button",
|
|
232
|
+
variant: "ghost",
|
|
233
|
+
size: "iconSm",
|
|
234
|
+
className: "text-foreground hover:text-destructive",
|
|
235
|
+
"aria-label": a("dataTable.savedViewsDelete"),
|
|
236
|
+
onClick: (n) => {
|
|
237
|
+
n.stopPropagation(), n.preventDefault(), d(!1), A(e);
|
|
238
|
+
},
|
|
239
|
+
children: /* @__PURE__ */ t(re, { className: "size-3.5" })
|
|
240
|
+
}
|
|
241
|
+
) : null,
|
|
242
|
+
e.hideDefaultStar ? null : e.isDefaultView ? /* @__PURE__ */ t(
|
|
243
|
+
o,
|
|
244
|
+
{
|
|
245
|
+
type: "button",
|
|
246
|
+
variant: "ghost",
|
|
247
|
+
size: "iconSm",
|
|
248
|
+
className: "text-yellow-500 hover:text-yellow-600",
|
|
249
|
+
"aria-label": a(
|
|
250
|
+
"dataTable.savedViewsDefaultAction"
|
|
251
|
+
),
|
|
252
|
+
onClick: (n) => {
|
|
253
|
+
n.stopPropagation(), n.preventDefault(), z?.(e, { activeView: r });
|
|
254
|
+
},
|
|
255
|
+
children: /* @__PURE__ */ t(w, { className: "size-3.5 fill-current" })
|
|
256
|
+
}
|
|
257
|
+
) : /* @__PURE__ */ t(
|
|
258
|
+
o,
|
|
259
|
+
{
|
|
260
|
+
type: "button",
|
|
261
|
+
variant: "ghost",
|
|
262
|
+
size: "iconSm",
|
|
263
|
+
className: "text-yellow-500 hover:text-yellow-600",
|
|
264
|
+
"aria-label": a(
|
|
265
|
+
"dataTable.savedViewsSetDefault"
|
|
266
|
+
),
|
|
267
|
+
onClick: (n) => {
|
|
268
|
+
n.stopPropagation(), n.preventDefault(), z?.(e, { activeView: r });
|
|
269
|
+
},
|
|
270
|
+
children: /* @__PURE__ */ t(w, { className: "size-3.5" })
|
|
271
|
+
}
|
|
272
|
+
)
|
|
273
|
+
] })
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
e.id
|
|
277
|
+
);
|
|
278
|
+
}) })) }),
|
|
279
|
+
/* @__PURE__ */ t(ue, { className: "my-1" }),
|
|
280
|
+
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2 px-3 pt-1", children: [
|
|
281
|
+
/* @__PURE__ */ t(
|
|
282
|
+
o,
|
|
283
|
+
{
|
|
284
|
+
type: "button",
|
|
285
|
+
variant: "tertiary",
|
|
286
|
+
size: "md",
|
|
287
|
+
onClick: ee,
|
|
288
|
+
children: a("dataTable.savedViewsCancel")
|
|
289
|
+
}
|
|
290
|
+
),
|
|
291
|
+
/* @__PURE__ */ t(
|
|
292
|
+
o,
|
|
293
|
+
{
|
|
294
|
+
type: "button",
|
|
295
|
+
variant: "default",
|
|
296
|
+
size: "md",
|
|
297
|
+
disabled: R,
|
|
298
|
+
onClick: $,
|
|
299
|
+
children: a("dataTable.savedViewsApply")
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
] })
|
|
303
|
+
] })
|
|
304
|
+
}
|
|
305
|
+
)
|
|
306
|
+
] }) }) : /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-content-tertiary", children: [
|
|
307
|
+
/* @__PURE__ */ t(oe, { className: "size-4 shrink-0", "aria-hidden": !0 }),
|
|
308
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium font-['Manrope']", children: a("dataTable.savedViewsNoneYet") })
|
|
309
|
+
] }),
|
|
310
|
+
/* @__PURE__ */ t(
|
|
311
|
+
o,
|
|
312
|
+
{
|
|
313
|
+
type: "button",
|
|
314
|
+
variant: "tertiary",
|
|
315
|
+
size: "sm",
|
|
316
|
+
className: "shrink-0 font-['Manrope']",
|
|
317
|
+
onClick: () => {
|
|
318
|
+
d(!1), G?.({ activeView: r });
|
|
319
|
+
},
|
|
320
|
+
children: a("dataTable.savedViewsSave")
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
),
|
|
326
|
+
/* @__PURE__ */ t(
|
|
327
|
+
he,
|
|
328
|
+
{
|
|
329
|
+
variant: "destructive",
|
|
330
|
+
open: h !== null,
|
|
331
|
+
onOpenChange: (e) => {
|
|
332
|
+
e || A(null);
|
|
333
|
+
},
|
|
334
|
+
title: a("dataTable.savedViewsDeleteConfirmTitle"),
|
|
335
|
+
description: h ? a("dataTable.savedViewsDeleteConfirmDescription", {
|
|
336
|
+
viewName: h.viewName
|
|
337
|
+
}) : void 0,
|
|
338
|
+
confirmLabel: a("dataTable.savedViewsDeleteConfirmButton"),
|
|
339
|
+
onConfirm: () => {
|
|
340
|
+
h && W?.(h, { activeView: r });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
)
|
|
344
|
+
] });
|
|
345
|
+
};
|
|
346
|
+
export {
|
|
347
|
+
Se as DataTableSavedViews
|
|
348
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface DataTableViewOptionsProps {
|
|
3
|
+
enableTableSettings?: boolean;
|
|
4
|
+
enableContentDensity?: boolean;
|
|
5
|
+
trigger?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const DataTableViewOptions: ({ enableTableSettings, enableContentDensity, trigger, }: DataTableViewOptionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -5,3 +5,5 @@ export * from './data-table-context';
|
|
|
5
5
|
export * from './data-table-format-options';
|
|
6
6
|
export * from './data-table-sheet';
|
|
7
7
|
export * from './data-table-view-menu';
|
|
8
|
+
export * from './data-table-saved-views';
|
|
9
|
+
export type { SavedTableViewItem, TableViewTypeOption, DataTableSavedViewsProps, DataTableSavedViewsActionContext, DataTableSavedViewsCancelContext, } from '../types/data-table-saved-views.types';
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { DataTable as t, DataTableContent as T, DataTableToolbar as o } from "./data-table.js";
|
|
2
2
|
import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as D, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as l } from "./data-table-constants.js";
|
|
3
3
|
import { DataTableColumnList as n } from "./data-table-column-list.js";
|
|
4
|
-
import { DataTableContext as
|
|
5
|
-
import { DataTableFormatOptions as
|
|
6
|
-
import { DataTableSheet as x, DataTableSheetContent as f, DataTableSheetHeader as
|
|
7
|
-
import { DataTableViewMenuContent as
|
|
4
|
+
import { DataTableContext as S, useDataTable as m } from "./data-table-context.js";
|
|
5
|
+
import { DataTableFormatOptions as E } from "./data-table-format-options.js";
|
|
6
|
+
import { DataTableSheet as x, DataTableSheetContent as f, DataTableSheetHeader as V, DataTableSheetTrigger as u } from "./data-table-sheet.js";
|
|
7
|
+
import { DataTableViewMenuContent as C, DataTableViewMenuDensity as s, DataTableViewMenuSettingsItem as A, DataTableViewMenuTrigger as H, DataTableViewMenuViewportExpand as L } from "./data-table-view-menu.js";
|
|
8
|
+
import { DataTableSavedViews as g } from "./data-table-saved-views.js";
|
|
8
9
|
export {
|
|
9
10
|
D as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
|
|
10
11
|
t as DataTable,
|
|
11
12
|
n as DataTableColumnList,
|
|
12
13
|
T as DataTableContent,
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
S as DataTableContext,
|
|
15
|
+
E as DataTableFormatOptions,
|
|
16
|
+
g as DataTableSavedViews,
|
|
15
17
|
x as DataTableSheet,
|
|
16
18
|
f as DataTableSheetContent,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
V as DataTableSheetHeader,
|
|
20
|
+
u as DataTableSheetTrigger,
|
|
19
21
|
o as DataTableToolbar,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
C as DataTableViewMenuContent,
|
|
23
|
+
s as DataTableViewMenuDensity,
|
|
24
|
+
A as DataTableViewMenuSettingsItem,
|
|
25
|
+
H as DataTableViewMenuTrigger,
|
|
26
|
+
L as DataTableViewMenuViewportExpand,
|
|
25
27
|
l as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
|
|
26
|
-
|
|
28
|
+
m as useDataTable
|
|
27
29
|
};
|