impact-nova 1.7.13 → 1.7.14
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/index.js +85 -78
- package/dist/components/ui/data-table/data-table-saved-views.js +261 -223
- package/dist/components/ui/types/data-table-saved-views.types.d.ts +2 -2
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +1 -0
- package/dist/i18n/locales/de.js +1 -0
- package/dist/i18n/locales/es.js +1 -0
- package/dist/i18n/locales/hi.js +1 -0
- package/dist/i18n/locales/kn.js +1 -0
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,169 +1,274 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as n, Fragment as H, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as i from "react";
|
|
3
|
-
import { ChevronDown as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Popover as
|
|
6
|
-
import { Tooltip as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Badge as
|
|
9
|
-
import { Input as
|
|
10
|
-
import { Separator as
|
|
11
|
-
import { Skeleton as
|
|
12
|
-
import { Prompt as
|
|
13
|
-
import { useImpactNovaI18n as
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
import { ChevronDown as be, Star as P, Search as xe, Bookmark as ve, Pencil as ge, Trash2 as ye } from "lucide-react";
|
|
4
|
+
import { cn as N } from "../../../lib/utils.js";
|
|
5
|
+
import { Popover as Ne, PopoverTrigger as we, PopoverContent as Te } from "../popover.js";
|
|
6
|
+
import { Tooltip as J, TooltipTrigger as W, TooltipContent as X } from "../tooltip.js";
|
|
7
|
+
import { Button as d } from "../button.js";
|
|
8
|
+
import { Badge as B } from "../badge.js";
|
|
9
|
+
import { Input as Ce } from "../input.js";
|
|
10
|
+
import { Separator as Z } from "../separator.js";
|
|
11
|
+
import { Skeleton as O } from "../skeleton.js";
|
|
12
|
+
import { Prompt as Ve } from "../prompt.js";
|
|
13
|
+
import { useImpactNovaI18n as ke } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
14
|
+
function De(h) {
|
|
15
|
+
return h.id === "-1" ? "system" : h.isDefaultView ? "default" : h.isActive ? "active" : "other";
|
|
16
|
+
}
|
|
17
|
+
const Se = ["default", "active", "system"], Fe = ({
|
|
18
|
+
isSaveViewEnabled: h = !0,
|
|
16
19
|
views: s,
|
|
17
20
|
activeViewSummary: q,
|
|
18
|
-
viewTypeOptions:
|
|
19
|
-
menuOpen:
|
|
20
|
-
defaultMenuOpen:
|
|
21
|
-
onMenuOpenChange:
|
|
22
|
-
onSearch:
|
|
23
|
-
isLoadingViews:
|
|
24
|
-
customListContent:
|
|
25
|
-
disableApply:
|
|
26
|
-
className:
|
|
27
|
-
onSaveViewClick:
|
|
28
|
-
onApply:
|
|
29
|
-
onCancel:
|
|
30
|
-
onEditView:
|
|
31
|
-
onDeleteView:
|
|
32
|
-
onSetDefaultView:
|
|
21
|
+
viewTypeOptions: ee,
|
|
22
|
+
menuOpen: E,
|
|
23
|
+
defaultMenuOpen: te = !1,
|
|
24
|
+
onMenuOpenChange: j,
|
|
25
|
+
onSearch: w,
|
|
26
|
+
isLoadingViews: I = !1,
|
|
27
|
+
customListContent: R,
|
|
28
|
+
disableApply: ae = !1,
|
|
29
|
+
className: ne,
|
|
30
|
+
onSaveViewClick: ie,
|
|
31
|
+
onApply: le,
|
|
32
|
+
onCancel: re,
|
|
33
|
+
onEditView: se,
|
|
34
|
+
onDeleteView: oe,
|
|
35
|
+
onSetDefaultView: _
|
|
33
36
|
}) => {
|
|
34
|
-
const { t } =
|
|
35
|
-
|
|
36
|
-
),
|
|
37
|
+
const { t: a } = ke(), T = E !== void 0, [ce, de] = i.useState(
|
|
38
|
+
te
|
|
39
|
+
), m = T ? !!E : ce, u = i.useCallback(
|
|
37
40
|
(e) => {
|
|
38
|
-
|
|
41
|
+
T || de(e), j?.(e);
|
|
39
42
|
},
|
|
40
|
-
[
|
|
41
|
-
), [
|
|
43
|
+
[T, j]
|
|
44
|
+
), [b, C] = i.useState("All"), [g, V] = i.useState(""), [L, k] = i.useState("");
|
|
42
45
|
i.useEffect(() => {
|
|
43
|
-
const e = window.setTimeout(() =>
|
|
46
|
+
const e = window.setTimeout(() => k(g), 300);
|
|
44
47
|
return () => window.clearTimeout(e);
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
const
|
|
48
|
+
}, [g]), i.useEffect(() => {
|
|
49
|
+
w && w(L);
|
|
50
|
+
}, [L, w]);
|
|
51
|
+
const F = i.useMemo(
|
|
49
52
|
() => s.find((e) => e.isActive),
|
|
50
53
|
[s]
|
|
51
|
-
),
|
|
54
|
+
), c = F ?? null, Q = q ?? F?.viewName ?? a("dataTable.savedViewsNotApplicable"), [D, S] = i.useState(null), [x, U] = i.useState(null), Y = i.useRef(!1);
|
|
52
55
|
i.useEffect(() => {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
const e = m && !Y.current;
|
|
57
|
+
if (Y.current = m, e) {
|
|
58
|
+
const l = s.find((o) => o.isActive);
|
|
59
|
+
S(l?.id ?? null), C("All"), V(""), k("");
|
|
56
60
|
}
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
}, [m, s]);
|
|
62
|
+
const v = i.useMemo(() => b === "All" ? s : s.filter((e) => e.viewType === b), [s, b]), p = g.trim().toLowerCase(), y = i.useCallback(
|
|
63
|
+
(e, l) => l ? (e.viewName ?? "").trim().toLowerCase().includes(l) : !0,
|
|
64
|
+
[]
|
|
65
|
+
), M = i.useMemo(() => {
|
|
66
|
+
let e = v;
|
|
67
|
+
return p && (e = e.filter((l) => y(l, p))), e;
|
|
68
|
+
}, [v, p, y]), f = i.useMemo(() => {
|
|
69
|
+
if (v.length === 0) return [];
|
|
70
|
+
const e = Object.groupBy(v, De);
|
|
71
|
+
return Se.flatMap((l) => {
|
|
72
|
+
const o = e[l]?.[0];
|
|
73
|
+
return o ? p && !y(o, p) ? [] : [o] : [];
|
|
74
|
+
});
|
|
75
|
+
}, [v, p, y]), z = i.useMemo(() => {
|
|
76
|
+
const e = new Set(f.map((l) => l.id));
|
|
77
|
+
return M.filter((l) => !e.has(l.id));
|
|
78
|
+
}, [M, f]), $ = D === null ? null : s.find((e) => e.id === D) ?? null, me = () => {
|
|
79
|
+
le?.($, { activeView: c }), u(!1);
|
|
80
|
+
}, ue = () => {
|
|
81
|
+
re?.({ activeView: c, pendingView: $ }), u(!1);
|
|
82
|
+
}, pe = (e) => {
|
|
83
|
+
u(e), e || (V(""), k(""));
|
|
71
84
|
};
|
|
72
|
-
if (!
|
|
85
|
+
if (!h)
|
|
73
86
|
return null;
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
/* @__PURE__ */
|
|
87
|
+
const fe = s.length > 0, K = (e, l, o) => {
|
|
88
|
+
const A = D === e.id, G = l === "priority" && !!e.isActive, he = l === "list" && !!e.isActive;
|
|
89
|
+
return /* @__PURE__ */ n(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
role: "button",
|
|
93
|
+
tabIndex: 0,
|
|
94
|
+
className: N(
|
|
95
|
+
"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",
|
|
96
|
+
G && !A && "bg-primary/10 dark:bg-primary/15",
|
|
97
|
+
A && "bg-badge-info-muted text-badge-info-foreground",
|
|
98
|
+
!A && !G && "text-foreground"
|
|
99
|
+
),
|
|
100
|
+
onClick: () => S(e.id),
|
|
101
|
+
onKeyDown: (r) => {
|
|
102
|
+
(r.key === "Enter" || r.key === " ") && (r.preventDefault(), S(e.id));
|
|
103
|
+
},
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ n(J, { children: [
|
|
106
|
+
/* @__PURE__ */ t(W, { asChild: !0, children: /* @__PURE__ */ t(
|
|
107
|
+
"span",
|
|
108
|
+
{
|
|
109
|
+
className: N(
|
|
110
|
+
"min-w-0 flex-1 truncate",
|
|
111
|
+
he && "underline decoration-primary decoration-2 underline-offset-2"
|
|
112
|
+
),
|
|
113
|
+
children: e.viewName
|
|
114
|
+
}
|
|
115
|
+
) }),
|
|
116
|
+
/* @__PURE__ */ t(X, { variant: "tertiary", side: "right", children: e.viewName })
|
|
117
|
+
] }),
|
|
118
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-0.5", children: [
|
|
119
|
+
e.isEditable ? /* @__PURE__ */ t(
|
|
120
|
+
d,
|
|
121
|
+
{
|
|
122
|
+
type: "button",
|
|
123
|
+
variant: "ghost",
|
|
124
|
+
size: "iconSm",
|
|
125
|
+
className: "text-foreground hover:text-content-charcoal",
|
|
126
|
+
"aria-label": a("dataTable.savedViewsEdit"),
|
|
127
|
+
onClick: (r) => {
|
|
128
|
+
r.stopPropagation(), r.preventDefault(), u(!1), se?.(e, { activeView: c });
|
|
129
|
+
},
|
|
130
|
+
children: /* @__PURE__ */ t(ge, { className: "size-3.5" })
|
|
131
|
+
}
|
|
132
|
+
) : null,
|
|
133
|
+
e.isDeletable ? /* @__PURE__ */ t(
|
|
134
|
+
d,
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
variant: "ghost",
|
|
138
|
+
size: "iconSm",
|
|
139
|
+
className: "text-foreground hover:text-destructive",
|
|
140
|
+
"aria-label": a("dataTable.savedViewsDelete"),
|
|
141
|
+
onClick: (r) => {
|
|
142
|
+
r.stopPropagation(), r.preventDefault(), u(!1), U(e);
|
|
143
|
+
},
|
|
144
|
+
children: /* @__PURE__ */ t(ye, { className: "size-3.5" })
|
|
145
|
+
}
|
|
146
|
+
) : null,
|
|
147
|
+
e.hideDefaultStar ? null : e.isDefaultView ? /* @__PURE__ */ t(
|
|
148
|
+
d,
|
|
149
|
+
{
|
|
150
|
+
type: "button",
|
|
151
|
+
variant: "ghost",
|
|
152
|
+
size: "iconSm",
|
|
153
|
+
className: "text-yellow-500 hover:text-yellow-600",
|
|
154
|
+
"aria-label": a("dataTable.savedViewsDefaultAction"),
|
|
155
|
+
onClick: (r) => {
|
|
156
|
+
r.stopPropagation(), r.preventDefault(), _?.(e, { activeView: c });
|
|
157
|
+
},
|
|
158
|
+
children: /* @__PURE__ */ t(P, { className: "size-3.5 fill-current" })
|
|
159
|
+
}
|
|
160
|
+
) : /* @__PURE__ */ t(
|
|
161
|
+
d,
|
|
162
|
+
{
|
|
163
|
+
type: "button",
|
|
164
|
+
variant: "ghost",
|
|
165
|
+
size: "iconSm",
|
|
166
|
+
className: "text-yellow-500 hover:text-yellow-600",
|
|
167
|
+
"aria-label": a("dataTable.savedViewsSetDefault"),
|
|
168
|
+
onClick: (r) => {
|
|
169
|
+
r.stopPropagation(), r.preventDefault(), _?.(e, { activeView: c });
|
|
170
|
+
},
|
|
171
|
+
children: /* @__PURE__ */ t(P, { className: "size-3.5" })
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] })
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
o
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
return /* @__PURE__ */ n(H, { children: [
|
|
181
|
+
/* @__PURE__ */ n(
|
|
77
182
|
"div",
|
|
78
183
|
{
|
|
79
184
|
"data-component": "data-table-saved-views",
|
|
80
|
-
className:
|
|
185
|
+
className: N(
|
|
81
186
|
"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
|
-
|
|
187
|
+
ne
|
|
83
188
|
),
|
|
84
189
|
children: [
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
] }) :
|
|
89
|
-
/* @__PURE__ */
|
|
190
|
+
I ? /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [
|
|
191
|
+
/* @__PURE__ */ t(O, { className: "h-6 w-24 rounded-full bg-black/10" }),
|
|
192
|
+
/* @__PURE__ */ t(O, { className: "h-6 w-6 rounded-md bg-black/10" })
|
|
193
|
+
] }) : fe ? /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:flex-initial", children: /* @__PURE__ */ n(Ne, { open: m, onOpenChange: pe, children: [
|
|
194
|
+
/* @__PURE__ */ t(we, { asChild: !0, children: /* @__PURE__ */ n(
|
|
90
195
|
"button",
|
|
91
196
|
{
|
|
92
197
|
type: "button",
|
|
93
198
|
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",
|
|
94
|
-
"aria-expanded":
|
|
199
|
+
"aria-expanded": m,
|
|
95
200
|
"aria-haspopup": "dialog",
|
|
96
|
-
"aria-label":
|
|
201
|
+
"aria-label": a("dataTable.savedViewsOpenMenu"),
|
|
97
202
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
203
|
+
/* @__PURE__ */ n(J, { children: [
|
|
204
|
+
/* @__PURE__ */ t(W, { asChild: !0, children: /* @__PURE__ */ t(
|
|
205
|
+
B,
|
|
101
206
|
{
|
|
102
207
|
color: "success",
|
|
103
208
|
variant: "outline",
|
|
104
209
|
className: "max-w-[min(100%,200px)] shrink font-['Manrope']",
|
|
105
|
-
children: /* @__PURE__ */
|
|
210
|
+
children: /* @__PURE__ */ t("span", { className: "truncate", children: Q })
|
|
106
211
|
}
|
|
107
212
|
) }),
|
|
108
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ t(X, { variant: "tertiary", side: "top", children: Q })
|
|
109
214
|
] }),
|
|
110
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ t(
|
|
111
216
|
"span",
|
|
112
217
|
{
|
|
113
|
-
className:
|
|
218
|
+
className: N(
|
|
114
219
|
"flex size-6 shrink-0 items-center justify-center rounded-md bg-white transition-transform duration-200",
|
|
115
|
-
|
|
220
|
+
m && "rotate-180"
|
|
116
221
|
),
|
|
117
222
|
"aria-hidden": !0,
|
|
118
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ t(be, { className: "size-3.5 text-content-charcoal" })
|
|
119
224
|
}
|
|
120
225
|
)
|
|
121
226
|
]
|
|
122
227
|
}
|
|
123
228
|
) }),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
|
|
229
|
+
/* @__PURE__ */ t(
|
|
230
|
+
Te,
|
|
126
231
|
{
|
|
127
232
|
align: "start",
|
|
128
233
|
className: "z-[110] w-[min(100vw-24px,280px)] p-0 shadow-[0_0_4px_0_rgba(0,0,0,0.12)] overflow-visible",
|
|
129
234
|
sideOffset: 8,
|
|
130
|
-
children: /* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
235
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col py-2", children: [
|
|
236
|
+
/* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-2 px-3 pb-2", children: [
|
|
237
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: a("dataTable.savedViewsTitle") }),
|
|
238
|
+
/* @__PURE__ */ n("div", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-content-tertiary font-['Manrope']", children: [
|
|
239
|
+
/* @__PURE__ */ t(P, { className: "size-3.5 text-badge-warning-ink" }),
|
|
240
|
+
a("dataTable.savedViewsDefault")
|
|
136
241
|
] })
|
|
137
242
|
] }),
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ n("div", { className: "flex flex-wrap gap-1.5 px-3 pb-2", children: [
|
|
244
|
+
/* @__PURE__ */ t(
|
|
140
245
|
"button",
|
|
141
246
|
{
|
|
142
247
|
type: "button",
|
|
143
248
|
className: "border-none bg-transparent p-0",
|
|
144
|
-
onClick: () =>
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
-
|
|
249
|
+
onClick: () => C("All"),
|
|
250
|
+
children: /* @__PURE__ */ t(
|
|
251
|
+
B,
|
|
147
252
|
{
|
|
148
|
-
color:
|
|
253
|
+
color: b === "All" ? "primary" : "neutral",
|
|
149
254
|
variant: "outline",
|
|
150
255
|
size: "sm",
|
|
151
256
|
className: "cursor-pointer font-['Manrope']",
|
|
152
|
-
children:
|
|
257
|
+
children: a("dataTable.savedViewsAll")
|
|
153
258
|
}
|
|
154
259
|
)
|
|
155
260
|
}
|
|
156
261
|
),
|
|
157
|
-
|
|
262
|
+
ee?.map((e) => /* @__PURE__ */ t(
|
|
158
263
|
"button",
|
|
159
264
|
{
|
|
160
265
|
type: "button",
|
|
161
266
|
className: "border-none bg-transparent p-0",
|
|
162
|
-
onClick: () =>
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
|
|
267
|
+
onClick: () => C(e.value),
|
|
268
|
+
children: /* @__PURE__ */ t(
|
|
269
|
+
B,
|
|
165
270
|
{
|
|
166
|
-
color:
|
|
271
|
+
color: b === e.value ? "primary" : "neutral",
|
|
167
272
|
variant: "outline",
|
|
168
273
|
size: "sm",
|
|
169
274
|
className: "cursor-pointer font-['Manrope']",
|
|
@@ -174,178 +279,111 @@ const Se = ({
|
|
|
174
279
|
e.value
|
|
175
280
|
))
|
|
176
281
|
] }),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
|
|
282
|
+
/* @__PURE__ */ t("div", { className: "px-3 pb-2", children: /* @__PURE__ */ t(
|
|
283
|
+
Ce,
|
|
179
284
|
{
|
|
180
285
|
size: "sm",
|
|
181
|
-
placeholder:
|
|
182
|
-
value:
|
|
183
|
-
onChange: (e) =>
|
|
184
|
-
prefix: /* @__PURE__ */
|
|
185
|
-
|
|
286
|
+
placeholder: a("dataTable.savedViewsSearchPlaceholder"),
|
|
287
|
+
value: g,
|
|
288
|
+
onChange: (e) => V(e.target.value),
|
|
289
|
+
prefix: /* @__PURE__ */ t(
|
|
290
|
+
xe,
|
|
186
291
|
{
|
|
187
292
|
className: "size-4 shrink-0 text-content-muted",
|
|
188
293
|
"aria-hidden": !0
|
|
189
294
|
}
|
|
190
295
|
),
|
|
191
296
|
className: "border-none shadow-none my-2 rounded-none",
|
|
192
|
-
"aria-label":
|
|
297
|
+
"aria-label": a("dataTable.savedViewsSearchPlaceholder")
|
|
193
298
|
}
|
|
194
299
|
) }),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
{
|
|
220
|
-
type: "button",
|
|
221
|
-
variant: "ghost",
|
|
222
|
-
size: "iconSm",
|
|
223
|
-
className: "text-foreground hover:text-content-charcoal",
|
|
224
|
-
"aria-label": t("dataTable.savedViewsEdit"),
|
|
225
|
-
onClick: (n) => {
|
|
226
|
-
n.stopPropagation(), n.preventDefault(), d(!1), W?.(e, { activeView: r });
|
|
227
|
-
},
|
|
228
|
-
children: /* @__PURE__ */ a(re, { className: "size-3.5" })
|
|
229
|
-
}
|
|
230
|
-
) : null,
|
|
231
|
-
e.isDeletable ? /* @__PURE__ */ a(
|
|
232
|
-
o,
|
|
233
|
-
{
|
|
234
|
-
type: "button",
|
|
235
|
-
variant: "ghost",
|
|
236
|
-
size: "iconSm",
|
|
237
|
-
className: "text-foreground hover:text-destructive",
|
|
238
|
-
"aria-label": t("dataTable.savedViewsDelete"),
|
|
239
|
-
onClick: (n) => {
|
|
240
|
-
n.stopPropagation(), n.preventDefault(), d(!1), j(e);
|
|
241
|
-
},
|
|
242
|
-
children: /* @__PURE__ */ a(oe, { className: "size-3.5" })
|
|
243
|
-
}
|
|
244
|
-
) : null,
|
|
245
|
-
e.hideDefaultStar ? null : e.isDefaultView ? /* @__PURE__ */ a(
|
|
246
|
-
o,
|
|
247
|
-
{
|
|
248
|
-
type: "button",
|
|
249
|
-
variant: "ghost",
|
|
250
|
-
size: "iconSm",
|
|
251
|
-
className: "text-yellow-500 hover:text-yellow-600",
|
|
252
|
-
"aria-label": t(
|
|
253
|
-
"dataTable.savedViewsDefaultAction"
|
|
254
|
-
),
|
|
255
|
-
onClick: (n) => {
|
|
256
|
-
n.stopPropagation(), n.preventDefault(), M?.(e, { activeView: r });
|
|
257
|
-
},
|
|
258
|
-
children: /* @__PURE__ */ a(w, { className: "size-3.5 fill-current" })
|
|
259
|
-
}
|
|
260
|
-
) : /* @__PURE__ */ a(
|
|
261
|
-
o,
|
|
262
|
-
{
|
|
263
|
-
type: "button",
|
|
264
|
-
variant: "ghost",
|
|
265
|
-
size: "iconSm",
|
|
266
|
-
className: "text-yellow-500 hover:text-yellow-600",
|
|
267
|
-
"aria-label": t(
|
|
268
|
-
"dataTable.savedViewsSetDefault"
|
|
269
|
-
),
|
|
270
|
-
onClick: (n) => {
|
|
271
|
-
n.stopPropagation(), n.preventDefault(), M?.(e, { activeView: r });
|
|
272
|
-
},
|
|
273
|
-
children: /* @__PURE__ */ a(w, { className: "size-3.5" })
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
] })
|
|
277
|
-
]
|
|
278
|
-
},
|
|
279
|
-
e.id
|
|
280
|
-
);
|
|
281
|
-
}) })) }),
|
|
282
|
-
/* @__PURE__ */ a(fe, { className: "my-1" }),
|
|
283
|
-
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2 px-3 pt-1", children: [
|
|
284
|
-
/* @__PURE__ */ a(
|
|
285
|
-
o,
|
|
300
|
+
/* @__PURE__ */ t("div", { className: "min-h-[72px] px-1", children: R || (I ? /* @__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(O, { className: "h-9 w-full rounded-lg" }, e)) }) : M.length === 0 && f.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__ */ n("div", { className: "flex max-h-[220px] flex-col gap-0 overflow-y-auto", children: [
|
|
301
|
+
f.length > 0 ? /* @__PURE__ */ t("div", { className: "flex flex-col px-1 pb-1 ", children: f.map(
|
|
302
|
+
(e) => K(
|
|
303
|
+
e,
|
|
304
|
+
"priority",
|
|
305
|
+
`priority-${e.id}`
|
|
306
|
+
)
|
|
307
|
+
) }) : null,
|
|
308
|
+
f.length > 0 && z.length > 0 ? /* @__PURE__ */ t(Z, { className: "bg-[#D9DDE7] mb-2" }) : null,
|
|
309
|
+
z.length > 0 ? /* @__PURE__ */ n(H, { children: [
|
|
310
|
+
/* @__PURE__ */ t("div", { className: "px-3 pb-1.5 pt-0.5 text-xs font-medium tracking-wide text-[#B4BAC7] font-['Manrope']", children: a("dataTable.savedViewsAllSavedViews") }),
|
|
311
|
+
/* @__PURE__ */ t("div", { className: "flex flex-col px-1 pb-1", children: z.map(
|
|
312
|
+
(e) => K(
|
|
313
|
+
e,
|
|
314
|
+
"list",
|
|
315
|
+
`list-${e.id}`
|
|
316
|
+
)
|
|
317
|
+
) })
|
|
318
|
+
] }) : null
|
|
319
|
+
] })) }),
|
|
320
|
+
/* @__PURE__ */ t(Z, { className: "my-1" }),
|
|
321
|
+
/* @__PURE__ */ n("div", { className: "flex justify-end gap-2 px-3 pt-1", children: [
|
|
322
|
+
/* @__PURE__ */ t(
|
|
323
|
+
d,
|
|
286
324
|
{
|
|
287
325
|
type: "button",
|
|
288
326
|
variant: "tertiary",
|
|
289
327
|
size: "md",
|
|
290
|
-
onClick:
|
|
291
|
-
children:
|
|
328
|
+
onClick: ue,
|
|
329
|
+
children: a("dataTable.savedViewsCancel")
|
|
292
330
|
}
|
|
293
331
|
),
|
|
294
|
-
/* @__PURE__ */
|
|
295
|
-
|
|
332
|
+
/* @__PURE__ */ t(
|
|
333
|
+
d,
|
|
296
334
|
{
|
|
297
335
|
type: "button",
|
|
298
336
|
variant: "default",
|
|
299
337
|
size: "md",
|
|
300
|
-
disabled:
|
|
301
|
-
onClick:
|
|
302
|
-
children:
|
|
338
|
+
disabled: ae,
|
|
339
|
+
onClick: me,
|
|
340
|
+
children: a("dataTable.savedViewsApply")
|
|
303
341
|
}
|
|
304
342
|
)
|
|
305
343
|
] })
|
|
306
344
|
] })
|
|
307
345
|
}
|
|
308
346
|
)
|
|
309
|
-
] }) }) : /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
347
|
+
] }) }) : /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-content-tertiary", children: [
|
|
348
|
+
/* @__PURE__ */ t(ve, { className: "size-4 shrink-0", "aria-hidden": !0 }),
|
|
349
|
+
/* @__PURE__ */ t("span", { className: "text-sm font-medium font-['Manrope']", children: a("dataTable.savedViewsNoneYet") })
|
|
312
350
|
] }),
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
|
|
351
|
+
/* @__PURE__ */ t(
|
|
352
|
+
d,
|
|
315
353
|
{
|
|
316
354
|
type: "button",
|
|
317
355
|
variant: "tertiary",
|
|
318
356
|
size: "sm",
|
|
319
357
|
className: "shrink-0 font-['Manrope']",
|
|
320
358
|
onClick: () => {
|
|
321
|
-
|
|
359
|
+
u(!1), ie?.({ activeView: c });
|
|
322
360
|
},
|
|
323
|
-
children:
|
|
361
|
+
children: a("dataTable.savedViewsSave")
|
|
324
362
|
}
|
|
325
363
|
)
|
|
326
364
|
]
|
|
327
365
|
}
|
|
328
366
|
),
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
|
|
367
|
+
/* @__PURE__ */ t(
|
|
368
|
+
Ve,
|
|
331
369
|
{
|
|
332
370
|
variant: "destructive",
|
|
333
|
-
open:
|
|
371
|
+
open: x !== null,
|
|
334
372
|
onOpenChange: (e) => {
|
|
335
|
-
e ||
|
|
373
|
+
e || U(null);
|
|
336
374
|
},
|
|
337
|
-
title:
|
|
338
|
-
description:
|
|
339
|
-
viewName:
|
|
375
|
+
title: a("dataTable.savedViewsDeleteConfirmTitle"),
|
|
376
|
+
description: x ? a("dataTable.savedViewsDeleteConfirmDescription", {
|
|
377
|
+
viewName: x.viewName
|
|
340
378
|
}) : void 0,
|
|
341
|
-
confirmLabel:
|
|
379
|
+
confirmLabel: a("dataTable.savedViewsDeleteConfirmButton"),
|
|
342
380
|
onConfirm: () => {
|
|
343
|
-
|
|
381
|
+
x && oe?.(x, { activeView: c });
|
|
344
382
|
}
|
|
345
383
|
}
|
|
346
384
|
)
|
|
347
385
|
] });
|
|
348
386
|
};
|
|
349
387
|
export {
|
|
350
|
-
|
|
388
|
+
Fe as DataTableSavedViews
|
|
351
389
|
};
|
|
@@ -46,8 +46,8 @@ export interface DataTableSavedViewsProps {
|
|
|
46
46
|
defaultMenuOpen?: boolean;
|
|
47
47
|
onMenuOpenChange?: (open: boolean) => void;
|
|
48
48
|
/**
|
|
49
|
-
* Optional
|
|
50
|
-
*
|
|
49
|
+
* Optional hook when the debounced search text changes (e.g. refetch). The list is still
|
|
50
|
+
* filtered by view name in the component for reliable UX.
|
|
51
51
|
*/
|
|
52
52
|
onSearch?: (query: string) => void;
|
|
53
53
|
isLoadingViews?: boolean;
|
|
@@ -122,6 +122,8 @@ export interface DataTableMessages {
|
|
|
122
122
|
savedViewsTitle: string;
|
|
123
123
|
savedViewsDefault: string;
|
|
124
124
|
savedViewsAll: string;
|
|
125
|
+
/** Section heading above the full list of views */
|
|
126
|
+
savedViewsAllSavedViews: string;
|
|
125
127
|
savedViewsSearchPlaceholder: string;
|
|
126
128
|
savedViewsEmptyList: string;
|
|
127
129
|
savedViewsCancel: string;
|