@burdenoff/microfe-bigconsole 2026.1119.2 → 2026.1119.4

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.
Files changed (36) hide show
  1. package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
  2. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.d.ts +15 -0
  3. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +62 -0
  4. package/dist/bigconsole/components/widgets/WidgetWrapper.js +353 -351
  5. package/dist/bigconsole/components/widgets/chart/ChartWidget.js +131 -126
  6. package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +16 -0
  7. package/dist/bigconsole/components/widgets/chart/chartRows.js +33 -1
  8. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.d.ts +2 -20
  9. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +4 -3
  10. package/dist/bigconsole/components/widgets/metric-card/metricCardData.d.ts +48 -0
  11. package/dist/bigconsole/components/widgets/metric-card/metricCardData.js +96 -0
  12. package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +9 -2
  13. package/dist/bigconsole/components/widgets/metric-card/metricData.js +10 -69
  14. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
  15. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
  16. package/dist/bigconsole/customWidget/index.d.ts +2 -1
  17. package/dist/bigconsole/customWidget/index.js +1 -0
  18. package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
  19. package/dist/bigconsole/customWidget/proposalContract.js +37 -14
  20. package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
  21. package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
  22. package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
  23. package/dist/bigconsole/customWidget/proposalSource.js +197 -51
  24. package/dist/bigconsole/hooks/useParserOperations.js +80 -74
  25. package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
  26. package/dist/bigconsole/store/parserScope.d.ts +24 -0
  27. package/dist/bigconsole/store/parserScope.js +17 -0
  28. package/dist/bigconsole/store/parserStore.d.ts +3 -0
  29. package/dist/bigconsole/store/parserStore.js +70 -68
  30. package/dist/bigconsole/utils/applyGlobalFilters.d.ts +3 -1
  31. package/dist/bigconsole/utils/applyGlobalFilters.js +53 -4
  32. package/dist/bigconsole/utils/globalFilterMatching.d.ts +21 -3
  33. package/dist/bigconsole/utils/globalFilterMatching.js +14 -9
  34. package/dist/generated/wspace-operations.d.ts +10 -0
  35. package/dist/generated/wspace-operations.js +180 -110
  36. package/package.json +1 -1
@@ -5,50 +5,50 @@ import "../../contexts/index.js";
5
5
  import { ParserTypeBadge as r } from "./ParserTypeBadge.js";
6
6
  import { ParserStatusBadge as i } from "./ParserStatusBadge.js";
7
7
  import "../common/index.js";
8
- import { Fragment as a, memo as o, useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
9
- import { Plus as d } from "lucide-react";
10
- import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
8
+ import { Fragment as a, memo as o, useCallback as s, useEffect as c, useId as l, useMemo as u, useState as d } from "react";
9
+ import { Plus as f } from "lucide-react";
10
+ import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
12
  // src/bigconsole/components/parser/ParserSelector.tsx
13
- var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y border-[var(--color-border-default)]", _ = "text-xs font-semibold uppercase tracking-wide text-text-secondary", v = ({ className: e }) => /* @__PURE__ */ p("svg", {
13
+ var g = "default", _ = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y border-[var(--color-border-default)]", v = "text-xs font-semibold uppercase tracking-wide text-text-secondary", y = ({ className: e }) => /* @__PURE__ */ m("svg", {
14
14
  className: e,
15
15
  fill: "none",
16
16
  stroke: "currentColor",
17
17
  viewBox: "0 0 24 24",
18
- children: /* @__PURE__ */ p("path", {
18
+ children: /* @__PURE__ */ m("path", {
19
19
  strokeLinecap: "round",
20
20
  strokeLinejoin: "round",
21
21
  strokeWidth: 2,
22
22
  d: "M19 9l-7 7-7-7"
23
23
  })
24
- }), y = ({ className: e }) => /* @__PURE__ */ m("svg", {
24
+ }), b = ({ className: e }) => /* @__PURE__ */ h("svg", {
25
25
  className: e,
26
26
  fill: "none",
27
27
  stroke: "currentColor",
28
28
  viewBox: "0 0 24 24",
29
29
  children: [
30
- /* @__PURE__ */ p("path", {
30
+ /* @__PURE__ */ m("path", {
31
31
  strokeLinecap: "round",
32
32
  strokeLinejoin: "round",
33
33
  strokeWidth: 2,
34
34
  d: "M12 21a9 9 0 100-18 9 9 0 000 18z"
35
35
  }),
36
- /* @__PURE__ */ p("path", {
36
+ /* @__PURE__ */ m("path", {
37
37
  strokeLinecap: "round",
38
38
  strokeLinejoin: "round",
39
39
  strokeWidth: 2,
40
40
  d: "M3.6 9h16.8M3.6 15h16.8"
41
41
  }),
42
- /* @__PURE__ */ p("path", {
42
+ /* @__PURE__ */ m("path", {
43
43
  strokeLinecap: "round",
44
44
  strokeLinejoin: "round",
45
45
  strokeWidth: 2,
46
46
  d: "M12 3a15 15 0 014 9 15 15 0 01-4 9 15 15 0 01-4-9 15 15 0 014-9z"
47
47
  })
48
48
  ]
49
- }), b = o(function({ parser: e, isSelected: t, onSelect: a, isGlobal: o = !1 }) {
50
- let { t: s } = f();
51
- return /* @__PURE__ */ p("button", {
49
+ }), x = o(function({ parser: e, isSelected: t, onSelect: a, isGlobal: o = !1 }) {
50
+ let { t: s } = p();
51
+ return /* @__PURE__ */ m("button", {
52
52
  type: "button",
53
53
  onClick: () => a(e.id),
54
54
  className: `
@@ -60,35 +60,35 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
60
60
  ${n}
61
61
  ${t ? "bg-action-primary-bg/10" : ""}
62
62
  `,
63
- children: /* @__PURE__ */ m("div", {
63
+ children: /* @__PURE__ */ h("div", {
64
64
  className: "flex items-start justify-between gap-2",
65
- children: [/* @__PURE__ */ m("div", {
65
+ children: [/* @__PURE__ */ h("div", {
66
66
  className: "flex-1 min-w-0",
67
67
  children: [
68
- /* @__PURE__ */ m("div", {
68
+ /* @__PURE__ */ h("div", {
69
69
  className: "flex items-center gap-2 mb-1",
70
70
  children: [
71
- /* @__PURE__ */ p(r, {
71
+ /* @__PURE__ */ m(r, {
72
72
  type: e.type,
73
73
  size: "sm"
74
74
  }),
75
- /* @__PURE__ */ p("span", {
75
+ /* @__PURE__ */ m("span", {
76
76
  className: "text-sm font-medium text-text-primary truncate",
77
77
  children: e.name
78
78
  }),
79
- o && /* @__PURE__ */ m("span", {
79
+ o && /* @__PURE__ */ h("span", {
80
80
  className: "inline-flex items-center gap-1 px-1.5 py-0.5 text-xs bg-bg-sunken text-text-secondary rounded",
81
- children: [/* @__PURE__ */ p(y, { className: "w-3 h-3" }), s("bigconsole.parsers.selector.globalBadge", "Global")]
81
+ children: [/* @__PURE__ */ m(b, { className: "w-3 h-3" }), s("bigconsole.parsers.selector.globalBadge", "Global")]
82
82
  })
83
83
  ]
84
84
  }),
85
- e.description && /* @__PURE__ */ p("p", {
85
+ e.description && /* @__PURE__ */ m("p", {
86
86
  className: "text-xs text-text-secondary line-clamp-1 mb-1",
87
87
  children: e.description
88
88
  }),
89
- /* @__PURE__ */ p("div", {
89
+ /* @__PURE__ */ m("div", {
90
90
  className: "flex min-w-0 items-center gap-2 text-xs text-text-muted",
91
- children: /* @__PURE__ */ m("span", {
91
+ children: /* @__PURE__ */ h("span", {
92
92
  className: "truncate font-mono",
93
93
  children: [
94
94
  e.inputSinkKey,
@@ -98,9 +98,9 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
98
98
  })
99
99
  })
100
100
  ]
101
- }), /* @__PURE__ */ p("div", {
101
+ }), /* @__PURE__ */ m("div", {
102
102
  className: "shrink-0",
103
- children: /* @__PURE__ */ p(i, {
103
+ children: /* @__PURE__ */ m(i, {
104
104
  status: e.status,
105
105
  size: "sm",
106
106
  showIcon: !1
@@ -108,95 +108,95 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
108
108
  })]
109
109
  })
110
110
  });
111
- }), x = o(function({ consoleId: i, value: o, resolvedParser: y, onChange: x, filterType: S, filterStatus: C = "active", filterInputSinkKey: w, placeholder: T, disabled: E = !1, error: D = !1, errorMessage: O }) {
112
- let { t: k } = f(), [A, j] = u(!1), [M, N] = u(""), P = T ?? k("bigconsole.parsers.selector.placeholder", "Select a parser..."), F = e(), I = i === h, { parsers: L, loading: R, fetchParsers: z } = t({
111
+ }), S = o(function({ consoleId: i, value: o, resolvedParser: b, onChange: S, filterType: C, filterStatus: w = "active", filterInputSinkKey: T, placeholder: E, disabled: D = !1, error: O = !1, errorMessage: k }) {
112
+ let { t: A } = p(), [j, M] = d(!1), [N, P] = d(""), F = E ?? A("bigconsole.parsers.selector.placeholder", "Select a parser..."), I = e(), L = l(), R = i === g, { parsers: z, loading: B, fetchParsers: V } = t({
113
113
  consoleId: i,
114
- skipFetch: I
115
- }), { parsers: B, loading: V, fetchParsers: H } = t({
116
- consoleId: h,
117
- skipFetch: I
118
- }), U = l(() => {
119
- if (I) return L;
120
- let e = new Set(L.map((e) => e.id)), t = B.filter((t) => !e.has(t.id));
121
- return [...L, ...t];
114
+ skipFetch: R
115
+ }), { parsers: H, loading: U, fetchParsers: W } = t({
116
+ consoleId: g,
117
+ skipFetch: R
118
+ }), G = u(() => {
119
+ if (R) return z;
120
+ let e = new Set(z.map((e) => e.id)), t = H.filter((t) => !e.has(t.id));
121
+ return [...z, ...t];
122
122
  }, [
123
- L,
124
- B,
125
- I
126
- ]), W = R || V, G = l(() => U.filter((e) => {
127
- if (S && e.type !== S || C && e.status !== C || w && e.inputSinkKey !== w) return !1;
128
- if (M) {
129
- let t = M.toLowerCase();
123
+ z,
124
+ H,
125
+ R
126
+ ]), K = B || U, q = u(() => G.filter((e) => {
127
+ if (C && e.type !== C || w && e.status !== w || T && e.inputSinkKey !== T) return !1;
128
+ if (N) {
129
+ let t = N.toLowerCase();
130
130
  return e.name.toLowerCase().includes(t) || e.description?.toLowerCase().includes(t) || e.inputSinkKey.toLowerCase().includes(t) || e.outputKey.toLowerCase().includes(t);
131
131
  }
132
132
  return !0;
133
133
  }), [
134
- U,
135
- S,
134
+ G,
136
135
  C,
137
136
  w,
138
- M
139
- ]), { dashboardScopedParsers: K, globalScopedParsers: q } = l(() => ({
140
- dashboardScopedParsers: G.filter((e) => e.consoleId !== h),
141
- globalScopedParsers: G.filter((e) => e.consoleId === h)
142
- }), [G]), J = U.find((e) => e.id === o) ?? (y?.id === o ? y : void 0);
137
+ T,
138
+ N
139
+ ]), { dashboardScopedParsers: J, globalScopedParsers: Y } = u(() => ({
140
+ dashboardScopedParsers: q.filter((e) => e.consoleId !== g),
141
+ globalScopedParsers: q.filter((e) => e.consoleId === g)
142
+ }), [q]), X = G.find((e) => e.id === o) ?? (b?.id === o ? b : void 0);
143
143
  c(() => {
144
- i && (z({
145
- type: S,
146
- status: C ?? void 0
147
- }), I || H({
148
- type: S,
149
- status: C ?? void 0
144
+ i && (V({
145
+ type: C,
146
+ status: w ?? void 0
147
+ }), R || W({
148
+ type: C,
149
+ status: w ?? void 0
150
150
  }));
151
151
  }, [
152
152
  i,
153
- S,
154
153
  C,
155
154
  w,
156
- z,
157
- H,
158
- I
155
+ T,
156
+ V,
157
+ W,
158
+ R
159
159
  ]);
160
- let Y = s((e) => {
161
- x(e), j(!1), N("");
162
- }, [x]), X = s(() => {
163
- if (E) return;
164
- let e = !A;
165
- e && (z({
166
- type: S,
167
- status: C ?? void 0
168
- }), I || H({
169
- type: S,
170
- status: C ?? void 0
171
- })), j(e);
160
+ let Z = s((e) => {
161
+ S(e), M(!1), P("");
162
+ }, [S]), Q = s(() => {
163
+ if (D) return;
164
+ let e = !j;
165
+ e && (V({
166
+ type: C,
167
+ status: w ?? void 0
168
+ }), R || W({
169
+ type: C,
170
+ status: w ?? void 0
171
+ })), M(e);
172
172
  }, [
173
- E,
174
- A,
175
- z,
176
- H,
177
- S,
173
+ D,
174
+ j,
175
+ V,
176
+ W,
178
177
  C,
179
- I
180
- ]), Z = s(() => {
181
- j(!1);
182
- }, []), Q = s(() => {
183
- j(!1);
184
- let e = I ? "/parsers/new" : `/dashboards/${i}/parsers/new`;
185
- window.open(F(e), "_blank", "noopener,noreferrer");
178
+ w,
179
+ R
180
+ ]), $ = s(() => {
181
+ M(!1);
182
+ }, []), ee = s(() => {
183
+ M(!1);
184
+ let e = R ? "/parsers/new" : `/dashboards/${i}/parsers/new`;
185
+ window.open(I(e), "_blank", "noopener,noreferrer");
186
186
  }, [
187
- F,
187
+ I,
188
188
  i,
189
- I
189
+ R
190
190
  ]);
191
- return /* @__PURE__ */ m("div", {
191
+ return /* @__PURE__ */ h("div", {
192
192
  className: "relative",
193
193
  children: [
194
- /* @__PURE__ */ m("button", {
194
+ /* @__PURE__ */ h("button", {
195
195
  type: "button",
196
- onClick: X,
197
- disabled: E,
196
+ onClick: Q,
197
+ disabled: D,
198
198
  "aria-haspopup": "listbox",
199
- "aria-expanded": A,
199
+ "aria-expanded": j,
200
200
  className: `
201
201
  w-full min-w-0 min-h-control-md
202
202
  px-3 py-2
@@ -206,63 +206,63 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
206
206
  flex items-center justify-between gap-2
207
207
  motion-safe:transition-colors
208
208
  ${n}
209
- ${E ? "opacity-50 cursor-not-allowed" : "hover:border-action-primary-bg cursor-pointer"}
210
- ${D ? "border-status-error-border" : "border-[var(--color-border-default)]"}
211
- ${A ? "border-action-primary-bg ring-2 ring-action-primary-bg/20" : ""}
209
+ ${D ? "opacity-50 cursor-not-allowed" : "hover:border-action-primary-bg cursor-pointer"}
210
+ ${O ? "border-status-error-border" : "border-[var(--color-border-default)]"}
211
+ ${j ? "border-action-primary-bg ring-2 ring-action-primary-bg/20" : ""}
212
212
  `,
213
- children: [/* @__PURE__ */ p("div", {
213
+ children: [/* @__PURE__ */ m("div", {
214
214
  className: "flex-1 min-w-0",
215
- children: J ? /* @__PURE__ */ m("div", {
215
+ children: X ? /* @__PURE__ */ h("div", {
216
216
  className: "flex min-w-0 items-center gap-2",
217
- children: [/* @__PURE__ */ p(r, {
218
- type: J.type,
217
+ children: [/* @__PURE__ */ m(r, {
218
+ type: X.type,
219
219
  size: "sm"
220
- }), /* @__PURE__ */ p("span", {
220
+ }), /* @__PURE__ */ m("span", {
221
221
  className: "text-sm text-text-primary truncate",
222
- children: J.name
222
+ children: X.name
223
223
  })]
224
- }) : /* @__PURE__ */ p("span", {
224
+ }) : /* @__PURE__ */ m("span", {
225
225
  className: "text-sm text-text-muted",
226
- children: P
226
+ children: F
227
227
  })
228
- }), /* @__PURE__ */ p(v, {
228
+ }), /* @__PURE__ */ m(y, {
229
229
  "aria-hidden": "true",
230
- className: `w-4 h-4 shrink-0 text-text-secondary motion-safe:transition-transform ${A ? "transform rotate-180" : ""}`
230
+ className: `w-4 h-4 shrink-0 text-text-secondary motion-safe:transition-transform ${j ? "transform rotate-180" : ""}`
231
231
  })]
232
232
  }),
233
- D && O && /* @__PURE__ */ p("p", {
233
+ O && k && /* @__PURE__ */ m("p", {
234
234
  className: "mt-1 text-xs text-status-error-text",
235
- children: O
235
+ children: k
236
236
  }),
237
- A && /* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p("div", {
237
+ j && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
238
238
  className: "fixed inset-0 z-10",
239
- onClick: Z
240
- }), /* @__PURE__ */ m("div", {
241
- className: "absolute left-0 right-0 top-full mt-1 z-20 bg-bg-surface border border-[var(--color-border-default)] rounded-md shadow-lg max-h-80 flex flex-col overflow-hidden",
239
+ onClick: $
240
+ }), /* @__PURE__ */ h("div", {
241
+ className: `absolute left-0 right-0 top-full mt-1 z-20 bg-bg-surface border border-[var(--color-border-default)] rounded-md shadow-lg ${R ? "max-h-80" : "max-h-[21rem]"} flex flex-col overflow-hidden`,
242
242
  children: [
243
- /* @__PURE__ */ p("div", {
243
+ /* @__PURE__ */ m("div", {
244
244
  className: "p-2 border-b border-[var(--color-border-default)]",
245
- children: /* @__PURE__ */ p("input", {
245
+ children: /* @__PURE__ */ m("input", {
246
246
  type: "text",
247
- "aria-label": k("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
248
- placeholder: k("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
249
- value: M,
250
- onChange: (e) => N(e.target.value),
247
+ "aria-label": A("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
248
+ placeholder: A("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
249
+ value: N,
250
+ onChange: (e) => P(e.target.value),
251
251
  className: "\n w-full min-w-0 min-h-control-md px-3 py-2\n bg-bg-sunken\n border border-[var(--color-border-default)]\n rounded-md\n text-sm text-text-primary\n placeholder:text-text-muted\n focus:outline-none\n focus:border-action-primary-bg\n focus:ring-2\n focus:ring-action-primary-bg/20\n "
252
252
  })
253
253
  }),
254
- /* @__PURE__ */ p("div", {
254
+ /* @__PURE__ */ m("div", {
255
255
  className: "overflow-y-auto flex-1",
256
- children: W ? /* @__PURE__ */ p("div", {
256
+ children: K ? /* @__PURE__ */ m("div", {
257
257
  className: "p-4 text-center text-sm text-text-secondary",
258
- children: k("bigconsole.parsers.selector.loading", "Loading parsers...")
259
- }) : G.length === 0 ? /* @__PURE__ */ p("div", {
258
+ children: A("bigconsole.parsers.selector.loading", "Loading parsers...")
259
+ }) : q.length === 0 ? /* @__PURE__ */ m("div", {
260
260
  className: "p-4 text-center text-sm text-text-secondary",
261
- children: k("bigconsole.parsers.selector.empty", "No parsers found")
262
- }) : /* @__PURE__ */ m(a, { children: [
263
- /* @__PURE__ */ p("button", {
261
+ children: A("bigconsole.parsers.selector.empty", "No parsers found")
262
+ }) : /* @__PURE__ */ h(a, { children: [
263
+ /* @__PURE__ */ m("button", {
264
264
  type: "button",
265
- onClick: () => Y(null),
265
+ onClick: () => Z(null),
266
266
  className: `
267
267
  w-full min-h-control-md px-3 py-2
268
268
  text-left text-sm
@@ -271,48 +271,53 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
271
271
  focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface
272
272
  ${o === null ? "bg-action-primary-bg/10 text-action-primary-bg" : "text-text-secondary"}
273
273
  `,
274
- children: /* @__PURE__ */ p("span", {
274
+ children: /* @__PURE__ */ m("span", {
275
275
  className: "italic",
276
- children: k("bigconsole.parsers.selector.none", "None")
276
+ children: A("bigconsole.parsers.selector.none", "None")
277
277
  })
278
278
  }),
279
- K.length > 0 && /* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p("div", {
280
- className: g,
281
- children: /* @__PURE__ */ p("span", {
282
- className: _,
283
- children: k("bigconsole.parsers.selector.dashboardParsers", "Dashboard Parsers")
279
+ J.length > 0 && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
280
+ className: _,
281
+ children: /* @__PURE__ */ m("span", {
282
+ className: v,
283
+ children: A("bigconsole.parsers.selector.dashboardParsers", "Dashboard Parsers")
284
284
  })
285
- }), K.map((e) => /* @__PURE__ */ p(b, {
285
+ }), J.map((e) => /* @__PURE__ */ m(x, {
286
286
  parser: e,
287
287
  isSelected: o === e.id,
288
- onSelect: Y
288
+ onSelect: Z
289
289
  }, e.id))] }),
290
- q.length > 0 && /* @__PURE__ */ m(a, { children: [/* @__PURE__ */ p("div", {
291
- className: g,
292
- children: /* @__PURE__ */ p("span", {
293
- className: _,
294
- children: k("bigconsole.parsers.selector.globalParsers", "Global Parsers")
290
+ Y.length > 0 && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
291
+ className: _,
292
+ children: /* @__PURE__ */ m("span", {
293
+ className: v,
294
+ children: A("bigconsole.parsers.selector.globalParsers", "Global Parsers")
295
295
  })
296
- }), q.map((e) => /* @__PURE__ */ p(b, {
296
+ }), Y.map((e) => /* @__PURE__ */ m(x, {
297
297
  parser: e,
298
298
  isSelected: o === e.id,
299
- onSelect: Y,
299
+ onSelect: Z,
300
300
  isGlobal: !0
301
301
  }, e.id))] })
302
302
  ] })
303
303
  }),
304
- /* @__PURE__ */ p("div", {
304
+ /* @__PURE__ */ h("div", {
305
305
  className: "p-2 border-t border-border-default",
306
- children: /* @__PURE__ */ m("button", {
306
+ children: [/* @__PURE__ */ h("button", {
307
307
  type: "button",
308
- onClick: Q,
308
+ onClick: ee,
309
+ "aria-describedby": R ? void 0 : L,
309
310
  className: "\n w-full flex items-center gap-2\n px-3 py-2\n text-sm font-medium text-action-primary-bg\n rounded-md\n hover:bg-action-primary-bg/10\n transition-colors\n ",
310
- children: [/* @__PURE__ */ p(d, { className: "w-4 h-4" }), k("bigconsole.parsers.selector.createNew", "Create new parser")]
311
- })
311
+ children: [/* @__PURE__ */ m(f, { className: "w-4 h-4" }), R ? A("bigconsole.parsers.selector.createNew", "Create new parser") : A("bigconsole.parsers.selector.createNewForDashboard", "Create new parser for this dashboard")]
312
+ }), !R && /* @__PURE__ */ m("p", {
313
+ id: L,
314
+ className: "m-0 px-3 text-xs leading-4 text-text-muted",
315
+ children: A("bigconsole.parsers.selector.createNewDashboardHint", "Only this dashboard can use it.")
316
+ })]
312
317
  })
313
318
  ]
314
319
  })] })
315
320
  ]
316
321
  });
317
322
  });
318
- export { x as ParserSelector, x as default };
323
+ export { S as ParserSelector, S as default };
@@ -0,0 +1,15 @@
1
+ import { FC } from 'react';
2
+ import { InapplicableFilter } from '../../utils/globalFilterMatching';
3
+ type Translate = (key: string, defaultValue?: string, vars?: Record<string, string | number>) => string;
4
+ interface FilterNotAppliedNoticeProps {
5
+ filters: readonly InapplicableFilter[];
6
+ t: Translate;
7
+ /** Start expanded (tests and server rendering); viewers start collapsed. */
8
+ defaultExpanded?: boolean;
9
+ }
10
+ /** The full sentence explaining why one filter does not narrow the widget. */
11
+ export declare function filterNotAppliedReason(filter: InapplicableFilter, t: Translate): string;
12
+ /** The one-line summary shown while the notice is collapsed. */
13
+ export declare function filterNotAppliedSummary(filters: readonly InapplicableFilter[], t: Translate): string;
14
+ export declare const FilterNotAppliedNotice: FC<FilterNotAppliedNoticeProps>;
15
+ export {};
@@ -0,0 +1,62 @@
1
+ import { useId as e, useState as t } from "react";
2
+ import { ChevronDown as n, FilterX as r } from "lucide-react";
3
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
4
+ // src/bigconsole/components/widgets/FilterNotAppliedNotice.tsx
5
+ function o(e, t) {
6
+ let n = {
7
+ name: e.name,
8
+ field: e.field
9
+ };
10
+ return e.reason === "precomputedValue" ? t("bigconsole.widget.filterNotApplicablePrecomputed", "Filter '{{name}}' does not change this value: it is a precomputed figure, not calculated from rows.", n) : t("bigconsole.widget.filterNotApplicable", "Filter '{{name}}' does not apply to this widget (no field '{{field}}').", n);
11
+ }
12
+ function s(e, t) {
13
+ return e.length === 1 ? t("bigconsole.widget.filterNotAppliedSummary", "Filter '{{name}}' not applied", { name: e[0].name }) : t("bigconsole.widget.filterNotAppliedSummaryMany", "{{count}} filters not applied", { count: e.length });
14
+ }
15
+ var c = ({ filters: c, t: l, defaultExpanded: u = !1 }) => {
16
+ let [d, f] = t(u), p = e();
17
+ if (c.length === 0) return null;
18
+ let m = c.map((e) => ({
19
+ id: e.filterId,
20
+ text: o(e, l)
21
+ })), h = m.map((e) => e.text).join("\n");
22
+ return /* @__PURE__ */ a("div", {
23
+ role: "status",
24
+ "data-testid": "widget-filter-not-applicable",
25
+ className: "mx-3 mt-2 min-w-0 shrink-0 rounded bg-status-warning-bg-subtle text-xs text-status-warning-text",
26
+ children: [/* @__PURE__ */ a("button", {
27
+ type: "button",
28
+ "data-testid": "widget-filter-not-applicable-toggle",
29
+ "aria-expanded": d,
30
+ "aria-controls": p,
31
+ title: h,
32
+ onClick: (e) => {
33
+ e.stopPropagation(), f((e) => !e);
34
+ },
35
+ className: "flex w-full min-w-0 items-center gap-1.5 px-2 py-1 text-left",
36
+ children: [
37
+ /* @__PURE__ */ i(r, {
38
+ className: "h-icon-xs w-icon-xs shrink-0",
39
+ "aria-hidden": "true"
40
+ }),
41
+ /* @__PURE__ */ i("span", {
42
+ className: "min-w-0 flex-1 truncate",
43
+ children: s(c, l)
44
+ }),
45
+ /* @__PURE__ */ i(n, {
46
+ className: `h-icon-xs w-icon-xs shrink-0 transition-transform ${d ? "rotate-180" : ""}`,
47
+ "aria-hidden": "true"
48
+ })
49
+ ]
50
+ }), d ? /* @__PURE__ */ i("ul", {
51
+ id: p,
52
+ "data-testid": "widget-filter-not-applicable-details",
53
+ className: "space-y-0.5 px-2 pb-1",
54
+ children: m.map((e) => /* @__PURE__ */ i("li", { children: e.text }, e.id))
55
+ }) : /* @__PURE__ */ i("span", {
56
+ id: p,
57
+ className: "sr-only",
58
+ children: h
59
+ })]
60
+ });
61
+ };
62
+ export { c as FilterNotAppliedNotice, o as filterNotAppliedReason, s as filterNotAppliedSummary };