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.
@@ -1,169 +1,274 @@
1
- import { jsxs as l, Fragment as le, jsx as a } from "react/jsx-runtime";
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 ie, Star as w, Search as se, Pencil as re, Trash2 as oe, Bookmark as de } from "lucide-react";
4
- import { cn as T } from "../../../lib/utils.js";
5
- import { Popover as ce, PopoverTrigger as me, PopoverContent as pe } from "../popover.js";
6
- import { Tooltip as _, TooltipTrigger as F, TooltipContent as L } from "../tooltip.js";
7
- import { Button as o } from "../button.js";
8
- import { Badge as C } from "../badge.js";
9
- import { Input as ue } from "../input.js";
10
- import { Separator as fe } from "../separator.js";
11
- import { Skeleton as k } from "../skeleton.js";
12
- import { Prompt as he } from "../prompt.js";
13
- import { useImpactNovaI18n as be } from "../../../i18n/ImpactNovaI18nContext.js";
14
- const Se = ({
15
- isSaveViewEnabled: Q = !0,
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: K,
19
- menuOpen: D,
20
- defaultMenuOpen: R = !1,
21
- onMenuOpenChange: V,
22
- onSearch: m,
23
- isLoadingViews: z = !1,
24
- customListContent: S,
25
- disableApply: Y = !1,
26
- className: G,
27
- onSaveViewClick: H,
28
- onApply: J,
29
- onCancel: U,
30
- onEditView: W,
31
- onDeleteView: X,
32
- onSetDefaultView: M
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 } = be(), b = D !== void 0, [Z, $] = i.useState(
35
- R
36
- ), p = b ? !!D : Z, d = i.useCallback(
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
- b || $(e), V?.(e);
41
+ T || de(e), j?.(e);
39
42
  },
40
- [b, V]
41
- ), [u, x] = i.useState("All"), [v, g] = i.useState(""), [f, P] = i.useState("");
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(() => P(v), 300);
46
+ const e = window.setTimeout(() => k(g), 300);
44
47
  return () => window.clearTimeout(e);
45
- }, [v]), i.useEffect(() => {
46
- m && m(f);
47
- }, [f, m]);
48
- const A = i.useMemo(
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
- ), r = A ?? null, E = q ?? A?.viewName ?? t("dataTable.savedViewsNotApplicable"), [N, y] = i.useState(null), [h, j] = i.useState(null);
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
- if (p) {
54
- const e = s.find((c) => c.isActive);
55
- y(e?.id ?? null), x("All"), g(""), P("");
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
- }, [p, s]);
58
- const B = i.useMemo(() => u === "All" ? s : s.filter((e) => e.viewType === u), [s, u]), I = i.useMemo(() => {
59
- let e = B;
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
- }, [B, f, m]), O = N === null ? null : s.find((e) => e.id === N) ?? null, ee = () => {
66
- J?.(O, { activeView: r }), d(!1);
67
- }, ae = () => {
68
- U?.({ activeView: r, pendingView: O }), d(!1);
69
- }, te = (e) => {
70
- d(e), e || g("");
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 (!Q)
85
+ if (!h)
73
86
  return null;
74
- const ne = s.length > 0;
75
- return /* @__PURE__ */ l(le, { children: [
76
- /* @__PURE__ */ l(
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: T(
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
- G
187
+ ne
83
188
  ),
84
189
  children: [
85
- z ? /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [
86
- /* @__PURE__ */ a(k, { className: "h-6 w-24 rounded-full bg-black/10" }),
87
- /* @__PURE__ */ a(k, { className: "h-6 w-6 rounded-md bg-black/10" })
88
- ] }) : ne ? /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 items-center gap-1 sm:flex-initial", children: /* @__PURE__ */ l(ce, { open: p, onOpenChange: te, children: [
89
- /* @__PURE__ */ a(me, { asChild: !0, children: /* @__PURE__ */ l(
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": p,
199
+ "aria-expanded": m,
95
200
  "aria-haspopup": "dialog",
96
- "aria-label": t("dataTable.savedViewsOpenMenu"),
201
+ "aria-label": a("dataTable.savedViewsOpenMenu"),
97
202
  children: [
98
- /* @__PURE__ */ l(_, { children: [
99
- /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a(
100
- C,
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__ */ a("span", { className: "truncate", children: E })
210
+ children: /* @__PURE__ */ t("span", { className: "truncate", children: Q })
106
211
  }
107
212
  ) }),
108
- /* @__PURE__ */ a(L, { variant: "tertiary", side: "top", children: E })
213
+ /* @__PURE__ */ t(X, { variant: "tertiary", side: "top", children: Q })
109
214
  ] }),
110
- /* @__PURE__ */ a(
215
+ /* @__PURE__ */ t(
111
216
  "span",
112
217
  {
113
- className: T(
218
+ className: N(
114
219
  "flex size-6 shrink-0 items-center justify-center rounded-md bg-white transition-transform duration-200",
115
- p && "rotate-180"
220
+ m && "rotate-180"
116
221
  ),
117
222
  "aria-hidden": !0,
118
- children: /* @__PURE__ */ a(ie, { className: "size-3.5 text-content-charcoal" })
223
+ children: /* @__PURE__ */ t(be, { className: "size-3.5 text-content-charcoal" })
119
224
  }
120
225
  )
121
226
  ]
122
227
  }
123
228
  ) }),
124
- /* @__PURE__ */ a(
125
- pe,
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__ */ l("div", { className: "flex flex-col py-2", children: [
131
- /* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-2 px-3 pb-2", children: [
132
- /* @__PURE__ */ a("span", { className: "text-sm font-medium text-content-charcoal font-['Manrope']", children: t("dataTable.savedViewsTitle") }),
133
- /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-content-tertiary font-['Manrope']", children: [
134
- /* @__PURE__ */ a(w, { className: "size-3.5 text-badge-warning-ink" }),
135
- t("dataTable.savedViewsDefault")
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__ */ l("div", { className: "flex flex-wrap gap-1.5 px-3 pb-2", children: [
139
- /* @__PURE__ */ a(
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: () => x("All"),
145
- children: /* @__PURE__ */ a(
146
- C,
249
+ onClick: () => C("All"),
250
+ children: /* @__PURE__ */ t(
251
+ B,
147
252
  {
148
- color: u === "All" ? "primary" : "neutral",
253
+ color: b === "All" ? "primary" : "neutral",
149
254
  variant: "outline",
150
255
  size: "sm",
151
256
  className: "cursor-pointer font-['Manrope']",
152
- children: t("dataTable.savedViewsAll")
257
+ children: a("dataTable.savedViewsAll")
153
258
  }
154
259
  )
155
260
  }
156
261
  ),
157
- K?.map((e) => /* @__PURE__ */ a(
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: () => x(e.value),
163
- children: /* @__PURE__ */ a(
164
- C,
267
+ onClick: () => C(e.value),
268
+ children: /* @__PURE__ */ t(
269
+ B,
165
270
  {
166
- color: u === e.value ? "primary" : "neutral",
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__ */ a("div", { className: "px-3 pb-2", children: /* @__PURE__ */ a(
178
- ue,
282
+ /* @__PURE__ */ t("div", { className: "px-3 pb-2", children: /* @__PURE__ */ t(
283
+ Ce,
179
284
  {
180
285
  size: "sm",
181
- placeholder: t("dataTable.savedViewsSearchPlaceholder"),
182
- value: v,
183
- onChange: (e) => g(e.target.value),
184
- prefix: /* @__PURE__ */ a(
185
- se,
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": t("dataTable.savedViewsSearchPlaceholder")
297
+ "aria-label": a("dataTable.savedViewsSearchPlaceholder")
193
298
  }
194
299
  ) }),
195
- /* @__PURE__ */ a("div", { className: "min-h-[72px] px-1", children: S || (z ? /* @__PURE__ */ a("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__ */ a(k, { className: "h-9 w-full rounded-lg" }, e)) }) : I.length === 0 ? /* @__PURE__ */ a("div", { className: "flex min-h-[100px] flex-col items-center justify-center px-4 py-6 text-center", children: /* @__PURE__ */ a("span", { className: "text-sm leading-relaxed text-content-tertiary font-['Manrope']", children: t("dataTable.savedViewsEmptyList") }) }) : /* @__PURE__ */ a("div", { className: "flex max-h-[160px] flex-col overflow-y-auto", children: I.map((e) => {
196
- const c = N === e.id;
197
- return /* @__PURE__ */ l(
198
- "div",
199
- {
200
- role: "button",
201
- tabIndex: 0,
202
- className: T(
203
- "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",
204
- c && "bg-badge-info-muted text-badge-info-foreground",
205
- !c && "text-foreground"
206
- ),
207
- onClick: () => y(e.id),
208
- onKeyDown: (n) => {
209
- (n.key === "Enter" || n.key === " ") && (n.preventDefault(), y(e.id));
210
- },
211
- children: [
212
- /* @__PURE__ */ l(_, { children: [
213
- /* @__PURE__ */ a(F, { asChild: !0, children: /* @__PURE__ */ a("span", { className: "min-w-0 flex-1 truncate", children: e.viewName }) }),
214
- /* @__PURE__ */ a(L, { variant: "tertiary", side: "right", children: e.viewName })
215
- ] }),
216
- /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-0.5", children: [
217
- e.isEditable ? /* @__PURE__ */ a(
218
- o,
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: ae,
291
- children: t("dataTable.savedViewsCancel")
328
+ onClick: ue,
329
+ children: a("dataTable.savedViewsCancel")
292
330
  }
293
331
  ),
294
- /* @__PURE__ */ a(
295
- o,
332
+ /* @__PURE__ */ t(
333
+ d,
296
334
  {
297
335
  type: "button",
298
336
  variant: "default",
299
337
  size: "md",
300
- disabled: Y,
301
- onClick: ee,
302
- children: t("dataTable.savedViewsApply")
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__ */ l("div", { className: "flex min-w-0 flex-1 items-center gap-2 text-content-tertiary", children: [
310
- /* @__PURE__ */ a(de, { className: "size-4 shrink-0", "aria-hidden": !0 }),
311
- /* @__PURE__ */ a("span", { className: "text-sm font-medium font-['Manrope']", children: t("dataTable.savedViewsNoneYet") })
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__ */ a(
314
- o,
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
- d(!1), H?.({ activeView: r });
359
+ u(!1), ie?.({ activeView: c });
322
360
  },
323
- children: t("dataTable.savedViewsSave")
361
+ children: a("dataTable.savedViewsSave")
324
362
  }
325
363
  )
326
364
  ]
327
365
  }
328
366
  ),
329
- /* @__PURE__ */ a(
330
- he,
367
+ /* @__PURE__ */ t(
368
+ Ve,
331
369
  {
332
370
  variant: "destructive",
333
- open: h !== null,
371
+ open: x !== null,
334
372
  onOpenChange: (e) => {
335
- e || j(null);
373
+ e || U(null);
336
374
  },
337
- title: t("dataTable.savedViewsDeleteConfirmTitle"),
338
- description: h ? t("dataTable.savedViewsDeleteConfirmDescription", {
339
- viewName: h.viewName
375
+ title: a("dataTable.savedViewsDeleteConfirmTitle"),
376
+ description: x ? a("dataTable.savedViewsDeleteConfirmDescription", {
377
+ viewName: x.viewName
340
378
  }) : void 0,
341
- confirmLabel: t("dataTable.savedViewsDeleteConfirmButton"),
379
+ confirmLabel: a("dataTable.savedViewsDeleteConfirmButton"),
342
380
  onConfirm: () => {
343
- h && X?.(h, { activeView: r });
381
+ x && oe?.(x, { activeView: c });
344
382
  }
345
383
  }
346
384
  )
347
385
  ] });
348
386
  };
349
387
  export {
350
- Se as DataTableSavedViews
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 server-side search: receives debounced query; parent updates `views`.
50
- * When provided, local client-side filtering by search text is skipped (see FilterSummary pattern).
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;