impact-nova 1.7.4 → 1.7.5
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/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/sidebar.js +5 -5
- package/dist/components/ui/types/data-table-saved-views.types.d.ts +71 -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/createNewDocument.svg.js +2 -2
- package/dist/icons/assets/settings.svg.js +1 -1
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +91 -89
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -3,7 +3,7 @@ import * as n from "react";
|
|
|
3
3
|
import * as k from "@radix-ui/react-collapsible";
|
|
4
4
|
import { Slot as N } from "@radix-ui/react-slot";
|
|
5
5
|
import { cva as H } from "class-variance-authority";
|
|
6
|
-
import { ChevronRight as A,
|
|
6
|
+
import { ChevronRight as A, HamburgerOpen as L, HamburgerClosed as P } from "../../icons/index.js";
|
|
7
7
|
import { cn as l } from "../../lib/utils.js";
|
|
8
8
|
import { Button as j } from "./button.js";
|
|
9
9
|
import { Input as W } from "./input.js";
|
|
@@ -227,7 +227,7 @@ const ne = n.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a(
|
|
|
227
227
|
ref: e,
|
|
228
228
|
"data-sidebar": "header",
|
|
229
229
|
className: l(
|
|
230
|
-
"flex mt-
|
|
230
|
+
"flex mt-3 mb-[34px] items-center px-3 transition-all duration-200 ease-linear",
|
|
231
231
|
t
|
|
232
232
|
),
|
|
233
233
|
...r
|
|
@@ -240,7 +240,7 @@ const ie = n.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a(
|
|
|
240
240
|
ref: e,
|
|
241
241
|
"data-sidebar": "footer",
|
|
242
242
|
className: l(
|
|
243
|
-
"flex shrink-0 flex-col gap-2
|
|
243
|
+
"flex shrink-0 flex-col gap-2 pt-2 min-w-0 w-full overflow-x-hidden group-data-[state=collapsed]:px-0",
|
|
244
244
|
t
|
|
245
245
|
),
|
|
246
246
|
...r
|
|
@@ -252,7 +252,7 @@ const oe = n.forwardRef(({ className: t, ...r }, e) => /* @__PURE__ */ a(
|
|
|
252
252
|
{
|
|
253
253
|
ref: e,
|
|
254
254
|
"data-sidebar": "separator",
|
|
255
|
-
className: l("
|
|
255
|
+
className: l("w-auto bg-[#31416e]", t),
|
|
256
256
|
...r
|
|
257
257
|
}
|
|
258
258
|
));
|
|
@@ -471,7 +471,7 @@ const D = n.forwardRef(
|
|
|
471
471
|
);
|
|
472
472
|
D.displayName = "SidebarMenuCollapsible";
|
|
473
473
|
const pe = H(
|
|
474
|
-
"peer/menu-button flex w-full items-center gap-[22px] overflow-visible py-[14px] px-[
|
|
474
|
+
"peer/menu-button flex w-full items-center gap-[22px] overflow-visible py-[14px] px-[20px] text-left text-[14px] outline-none ring-navigation-ring transition-[width,height,padding,background-color] hover:bg-navigation-item-active hover:text-navigation-on-hover focus-visible:ring-2 disabled:pointer-events-none disabled:text-navigation-muted group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:text-navigation-muted aria-disabled:opacity-50 hover:aria-disabled:bg-transparent data-[active=true]:bg-navigation-item-active data-[active=true]:font-medium data-[active=true]:text-navigation-on-hover cursor-pointer group-data-[state=collapsed]:!w-[var(--sidebar-width-icon)] group-data-[state=collapsed]:!h-12 group-data-[state=collapsed]:!p-0 group-data-[state=collapsed]:!pl-[20px] [&>span:last-child]:truncate [&>svg]:size-5 [&>img]:size-5 [&>svg]:shrink-0 [&>svg]:text-inherit group-data-[state=collapsed]:[&>span]:hidden group-data-[state=collapsed]:[&>svg:not(:first-of-type)]:hidden [&>[data-sidebar=menu-button-chevron]]:ml-auto [&>[data-sidebar=menu-button-chevron]]:size-4 [&>[data-sidebar=menu-button-chevron]]:transition-transform [&>[data-sidebar=menu-button-chevron]]:duration-200 [&>[data-sidebar=menu-button-chevron]]:rotate-90 data-[state=open]:[&>[data-sidebar=menu-button-chevron]]:rotate-[270deg] before:absolute before:left-0 before:top-0 before:w-1 before:bg-success before:rounded-r-[4px] before:transition-[height] before:duration-200 before:linear before:z-20 data-[active=false]:before:h-0 data-[active=true]:before:h-full",
|
|
475
475
|
{
|
|
476
476
|
variants: {
|
|
477
477
|
variant: {
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
export interface SavedTableViewItem {
|
|
3
|
+
id: string;
|
|
4
|
+
viewName: string;
|
|
5
|
+
/** Used with view type badges (e.g. Personal / Global). */
|
|
6
|
+
viewType?: string;
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
isEditable?: boolean;
|
|
9
|
+
isDeletable?: boolean;
|
|
10
|
+
isDefaultView?: boolean;
|
|
11
|
+
/** When true, hide the default-view star control (legacy `notReqDefaultView`). */
|
|
12
|
+
hideDefaultStar?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface TableViewTypeOption {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/** Passed to callbacks so hosts can correlate with the active badge view. */
|
|
19
|
+
export interface DataTableSavedViewsActionContext {
|
|
20
|
+
/** View currently marked active in `views` (shown on the summary badge). */
|
|
21
|
+
activeView: SavedTableViewItem | null;
|
|
22
|
+
}
|
|
23
|
+
/** Passed to `onCancel` — includes pending row selection inside the menu. */
|
|
24
|
+
export interface DataTableSavedViewsCancelContext extends DataTableSavedViewsActionContext {
|
|
25
|
+
/** Row highlighted for Apply before the user canceled. */
|
|
26
|
+
pendingView: SavedTableViewItem | null;
|
|
27
|
+
}
|
|
28
|
+
export interface DataTableSavedViewsProps {
|
|
29
|
+
/**
|
|
30
|
+
* When false, renders nothing (legacy `isSaveViewEnabled`).
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
isSaveViewEnabled?: boolean;
|
|
34
|
+
/** Saved views to list in the menu. */
|
|
35
|
+
views: SavedTableViewItem[];
|
|
36
|
+
/**
|
|
37
|
+
* Summary label for the trigger badge when no active view is found in `views`.
|
|
38
|
+
* If omitted, uses the active view's `viewName` or i18n `notApplicable`.
|
|
39
|
+
*/
|
|
40
|
+
activeViewSummary?: string;
|
|
41
|
+
/** Extra badge filters after "All" (legacy `saveViewCustomFilter.options`). */
|
|
42
|
+
viewTypeOptions?: TableViewTypeOption[];
|
|
43
|
+
/** Controlled menu open state. */
|
|
44
|
+
menuOpen?: boolean;
|
|
45
|
+
/** @default false */
|
|
46
|
+
defaultMenuOpen?: boolean;
|
|
47
|
+
onMenuOpenChange?: (open: boolean) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Optional server-side search: receives debounced query; parent updates `views`.
|
|
50
|
+
* When provided, local client-side filtering by search text is skipped (see FilterSummary pattern).
|
|
51
|
+
*/
|
|
52
|
+
onSearch?: (query: string) => void;
|
|
53
|
+
isLoadingViews?: boolean;
|
|
54
|
+
/** Replace the scrollable list body entirely (legacy `customRenderSaveViewContent`). */
|
|
55
|
+
customListContent?: React.ReactNode;
|
|
56
|
+
/** Disable the Apply button (typically when `customListContent` is used). */
|
|
57
|
+
disableApply?: boolean;
|
|
58
|
+
className?: string;
|
|
59
|
+
/** Create/save flow; `activeView` is the baseline view (badge) when opening save. */
|
|
60
|
+
onSaveViewClick?: (context: DataTableSavedViewsActionContext) => void;
|
|
61
|
+
/** Apply pending row; `selectedView` matches the highlighted row (may be null). */
|
|
62
|
+
onApply?: (selectedView: SavedTableViewItem | null, context: DataTableSavedViewsActionContext) => void;
|
|
63
|
+
/** User closed the menu without applying; includes pending selection. */
|
|
64
|
+
onCancel?: (context: DataTableSavedViewsCancelContext) => void;
|
|
65
|
+
onEditView?: (view: SavedTableViewItem, context: DataTableSavedViewsActionContext) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Called after the user confirms delete in the destructive Prompt.
|
|
68
|
+
*/
|
|
69
|
+
onDeleteView?: (view: SavedTableViewItem, context: DataTableSavedViewsActionContext) => void;
|
|
70
|
+
onSetDefaultView?: (view: SavedTableViewItem, context: DataTableSavedViewsActionContext) => void;
|
|
71
|
+
}
|
|
@@ -116,6 +116,25 @@ export interface DataTableMessages {
|
|
|
116
116
|
numericK: string;
|
|
117
117
|
numericM: string;
|
|
118
118
|
numericB: string;
|
|
119
|
+
/** Saved table views (toolbar / settings sheet) */
|
|
120
|
+
savedViewsNotApplicable: string;
|
|
121
|
+
savedViewsOpenMenu: string;
|
|
122
|
+
savedViewsTitle: string;
|
|
123
|
+
savedViewsDefault: string;
|
|
124
|
+
savedViewsAll: string;
|
|
125
|
+
savedViewsSearchPlaceholder: string;
|
|
126
|
+
savedViewsEmptyList: string;
|
|
127
|
+
savedViewsCancel: string;
|
|
128
|
+
savedViewsApply: string;
|
|
129
|
+
savedViewsNoneYet: string;
|
|
130
|
+
savedViewsSave: string;
|
|
131
|
+
savedViewsEdit: string;
|
|
132
|
+
savedViewsDelete: string;
|
|
133
|
+
savedViewsDefaultAction: string;
|
|
134
|
+
savedViewsSetDefault: string;
|
|
135
|
+
savedViewsDeleteConfirmTitle: string;
|
|
136
|
+
savedViewsDeleteConfirmDescription: string;
|
|
137
|
+
savedViewsDeleteConfirmButton: string;
|
|
119
138
|
}
|
|
120
139
|
export interface AriaMessages {
|
|
121
140
|
close: string;
|
|
@@ -68,7 +68,7 @@ const e = {
|
|
|
68
68
|
unselectAll: "Unselect All",
|
|
69
69
|
clear: "Clear",
|
|
70
70
|
selectedCount: "Selected ({{count}})"
|
|
71
|
-
},
|
|
71
|
+
}, s = {
|
|
72
72
|
searchPlaceholder: "Search...",
|
|
73
73
|
apply: "Apply",
|
|
74
74
|
reset: "Reset",
|
|
@@ -99,8 +99,26 @@ const e = {
|
|
|
99
99
|
numericFull: "Full Number",
|
|
100
100
|
numericK: "In K (Thousands)",
|
|
101
101
|
numericM: "In M (Millions)",
|
|
102
|
-
numericB: "In B (Billions)"
|
|
103
|
-
|
|
102
|
+
numericB: "In B (Billions)",
|
|
103
|
+
savedViewsNotApplicable: "Not applicable",
|
|
104
|
+
savedViewsOpenMenu: "Open saved views",
|
|
105
|
+
savedViewsTitle: "Saved views",
|
|
106
|
+
savedViewsDefault: "Default",
|
|
107
|
+
savedViewsAll: "All",
|
|
108
|
+
savedViewsSearchPlaceholder: "Search here...",
|
|
109
|
+
savedViewsEmptyList: "No saved views match your filters.",
|
|
110
|
+
savedViewsCancel: "Cancel",
|
|
111
|
+
savedViewsApply: "Apply",
|
|
112
|
+
savedViewsNoneYet: "No views saved yet",
|
|
113
|
+
savedViewsSave: "Save View",
|
|
114
|
+
savedViewsEdit: "Edit view",
|
|
115
|
+
savedViewsDelete: "Delete view",
|
|
116
|
+
savedViewsDefaultAction: "Default view",
|
|
117
|
+
savedViewsSetDefault: "Set as default view",
|
|
118
|
+
savedViewsDeleteConfirmTitle: "Delete saved view?",
|
|
119
|
+
savedViewsDeleteConfirmDescription: 'This will permanently delete "{{viewName}}". You cannot undo this action.',
|
|
120
|
+
savedViewsDeleteConfirmButton: "Delete"
|
|
121
|
+
}, r = {
|
|
104
122
|
close: "Close",
|
|
105
123
|
breadcrumb: "breadcrumb",
|
|
106
124
|
remove: "Remove",
|
|
@@ -129,23 +147,23 @@ const e = {
|
|
|
129
147
|
deleteFilter: "Delete",
|
|
130
148
|
setAsDefault: "Set as default",
|
|
131
149
|
defaultFilter: "Default"
|
|
132
|
-
},
|
|
150
|
+
}, d = {
|
|
133
151
|
filtersAppliedCount: "{{count}} filters applied",
|
|
134
152
|
savedFiltersAvailableCount: "{{count}} Saved filters available",
|
|
135
153
|
tabContainsErrors: "This tab contains errors",
|
|
136
154
|
tabHasWarnings: "This tab has warnings",
|
|
137
155
|
additionalInfoAvailable: "Additional information available"
|
|
138
|
-
},
|
|
156
|
+
}, u = {
|
|
139
157
|
title: "Notifications",
|
|
140
158
|
description: "Notifications"
|
|
141
159
|
}, m = {
|
|
142
160
|
scrollLeft: "Scroll left",
|
|
143
161
|
scrollRight: "Scroll right"
|
|
144
|
-
},
|
|
162
|
+
}, f = {
|
|
145
163
|
viewMore: "View More",
|
|
146
164
|
viewLess: "View Less",
|
|
147
165
|
logout: "Logout"
|
|
148
|
-
},
|
|
166
|
+
}, h = {
|
|
149
167
|
stepOfTotal: "Step {{current}} of {{total}}"
|
|
150
168
|
}, p = {
|
|
151
169
|
title: "Advanced Filter",
|
|
@@ -191,24 +209,24 @@ const e = {
|
|
|
191
209
|
clickForDetails: "Click for details",
|
|
192
210
|
information: "Information",
|
|
193
211
|
noInformationAvailable: "No information available for this column."
|
|
194
|
-
},
|
|
212
|
+
}, v = {
|
|
195
213
|
calendar: e,
|
|
196
214
|
datePicker: t,
|
|
197
215
|
filter: a,
|
|
198
216
|
select: o,
|
|
199
|
-
nestedList:
|
|
217
|
+
nestedList: s,
|
|
200
218
|
dataTable: n,
|
|
201
|
-
aria:
|
|
219
|
+
aria: r,
|
|
202
220
|
prompt: i,
|
|
203
221
|
filterStrip: c,
|
|
204
|
-
filterPanel:
|
|
222
|
+
filterPanel: d,
|
|
205
223
|
advancedFilter: p,
|
|
206
224
|
gridHeader: S,
|
|
207
|
-
notificationPanel:
|
|
225
|
+
notificationPanel: u,
|
|
208
226
|
horizontalScroller: m,
|
|
209
|
-
sidebar:
|
|
210
|
-
stepper:
|
|
227
|
+
sidebar: f,
|
|
228
|
+
stepper: h
|
|
211
229
|
};
|
|
212
230
|
export {
|
|
213
|
-
|
|
231
|
+
v as defaultMessages
|
|
214
232
|
};
|