@burdenoff/microfe-bigconsole 2026.1110.7 → 2026.1111.1
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/bigconsole/components/parser/ExpressionEditor.js +1 -0
- package/dist/bigconsole/components/parser/ParserCard.d.ts +12 -1
- package/dist/bigconsole/components/parser/ParserCard.js +218 -232
- package/dist/bigconsole/components/widgets/table/TableConfig.js +256 -193
- package/dist/bigconsole/components/widgets/table/TableWidget.js +150 -150
- package/dist/bigconsole/components/widgets/table/tableSort.d.ts +12 -0
- package/dist/bigconsole/components/widgets/table/tableSort.js +12 -0
- package/dist/bigconsole/pages/DataParsersPage.js +153 -122
- package/dist/bigconsole/pages/ParserBuilderPage.js +559 -508
- package/dist/bigconsole/pages/ParserViewPage.js +324 -309
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.js +7 -0
- package/package.json +1 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { resolveDefaultSort as e } from "./tableSort.js";
|
|
2
|
+
import { memo as t, useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
|
+
import { useI18n as o } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
5
|
// src/bigconsole/components/widgets/table/TableConfig.tsx
|
|
5
|
-
var
|
|
6
|
+
var l = [
|
|
6
7
|
{
|
|
7
8
|
value: "gt",
|
|
8
9
|
labelKey: "bigconsole.widget.config.table.operator.gt",
|
|
@@ -48,7 +49,7 @@ var c = [
|
|
|
48
49
|
labelKey: "bigconsole.widget.config.table.operator.contains",
|
|
49
50
|
labelDefault: "contains"
|
|
50
51
|
}
|
|
51
|
-
],
|
|
52
|
+
], u = [
|
|
52
53
|
{
|
|
53
54
|
value: "danger",
|
|
54
55
|
labelKey: "bigconsole.widget.config.table.intent.danger",
|
|
@@ -74,46 +75,46 @@ var c = [
|
|
|
74
75
|
labelKey: "bigconsole.widget.config.table.intent.neutral",
|
|
75
76
|
labelDefault: "Neutral"
|
|
76
77
|
}
|
|
77
|
-
],
|
|
78
|
-
let { t:
|
|
78
|
+
], d = "px-2 py-1 text-xs text-text-primary bg-bg-surface border border-border-default rounded-md focus:outline-none focus:ring-2 focus:ring-action-primary-bg", f = t(function({ config: t, onChange: f }) {
|
|
79
|
+
let { t: p } = o(), m = i(() => (t.columns || []).map((e) => typeof e == "string" ? {
|
|
79
80
|
field: e,
|
|
80
81
|
header: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " ")
|
|
81
|
-
} : e), []), [
|
|
82
|
-
|
|
83
|
-
JSON.stringify(
|
|
84
|
-
...
|
|
85
|
-
columns:
|
|
82
|
+
} : e), []), [h, g] = a(m);
|
|
83
|
+
r(() => {
|
|
84
|
+
JSON.stringify(t.columns) !== JSON.stringify(h) && h.length > 0 && f({
|
|
85
|
+
...t,
|
|
86
|
+
columns: h
|
|
86
87
|
});
|
|
87
|
-
}, [
|
|
88
|
-
let
|
|
88
|
+
}, [h]), r(() => {
|
|
89
|
+
let e = (t.columns || []).map((e) => typeof e == "string" ? {
|
|
89
90
|
field: e,
|
|
90
91
|
header: e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " ")
|
|
91
92
|
} : e);
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
let
|
|
95
|
-
|
|
96
|
-
...
|
|
97
|
-
[
|
|
93
|
+
g(e);
|
|
94
|
+
}, [t.columns]);
|
|
95
|
+
let _ = n((e, n) => {
|
|
96
|
+
f({
|
|
97
|
+
...t,
|
|
98
|
+
[e]: n
|
|
98
99
|
});
|
|
99
|
-
}, [
|
|
100
|
-
|
|
100
|
+
}, [t, f]), v = n((e, t, n) => {
|
|
101
|
+
g((r) => {
|
|
101
102
|
let i = [...r];
|
|
102
103
|
return i[e] = {
|
|
103
104
|
...i[e],
|
|
104
105
|
[t]: n
|
|
105
106
|
}, i;
|
|
106
107
|
});
|
|
107
|
-
}, []),
|
|
108
|
-
|
|
108
|
+
}, []), y = n((e, t) => {
|
|
109
|
+
g((n) => {
|
|
109
110
|
let r = [...n];
|
|
110
111
|
return r[e] = {
|
|
111
112
|
...r[e],
|
|
112
113
|
conditionalRules: t
|
|
113
114
|
}, r;
|
|
114
115
|
});
|
|
115
|
-
}, []),
|
|
116
|
-
let t =
|
|
116
|
+
}, []), b = n((e) => {
|
|
117
|
+
let t = h[e]?.conditionalRules ?? [], n = {
|
|
117
118
|
operator: "gt",
|
|
118
119
|
value: 0,
|
|
119
120
|
style: {
|
|
@@ -122,15 +123,15 @@ var c = [
|
|
|
122
123
|
bold: !0
|
|
123
124
|
}
|
|
124
125
|
};
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
let r = (
|
|
126
|
+
y(e, [...t, n]);
|
|
127
|
+
}, [h, y]), x = n((e, t, n) => {
|
|
128
|
+
let r = (h[e]?.conditionalRules ?? []).map((e, r) => r === t ? {
|
|
128
129
|
...e,
|
|
129
130
|
...n
|
|
130
131
|
} : e);
|
|
131
|
-
|
|
132
|
-
}, [
|
|
133
|
-
let r = (
|
|
132
|
+
y(e, r);
|
|
133
|
+
}, [h, y]), S = n((e, t, n) => {
|
|
134
|
+
let r = (h[e]?.conditionalRules ?? []).map((e, r) => r === t ? {
|
|
134
135
|
...e,
|
|
135
136
|
style: {
|
|
136
137
|
...e.style,
|
|
@@ -138,84 +139,146 @@ var c = [
|
|
|
138
139
|
textColor: n
|
|
139
140
|
}
|
|
140
141
|
} : e);
|
|
141
|
-
|
|
142
|
-
}, [
|
|
143
|
-
let n =
|
|
144
|
-
|
|
145
|
-
}, [
|
|
146
|
-
|
|
142
|
+
y(e, r);
|
|
143
|
+
}, [h, y]), C = n((e, t) => {
|
|
144
|
+
let n = h[e]?.conditionalRules ?? [];
|
|
145
|
+
y(e, n.filter((e, n) => n !== t));
|
|
146
|
+
}, [h, y]), w = i(() => h.map((e) => ({
|
|
147
|
+
field: (e.key || e.field || "").trim(),
|
|
148
|
+
header: e.label || e.header || ""
|
|
149
|
+
})).filter((e) => e.field), [h]), T = e(t), E = T.column !== null && !w.some((e) => e.field === T.column), D = n((e) => {
|
|
150
|
+
f({
|
|
151
|
+
...t,
|
|
152
|
+
defaultSortColumn: e || void 0,
|
|
153
|
+
defaultSortDirection: e ? t.defaultSortDirection === "desc" ? "desc" : "asc" : void 0
|
|
154
|
+
});
|
|
155
|
+
}, [t, f]), O = n(() => {
|
|
156
|
+
g((e) => [...e, {
|
|
147
157
|
field: "",
|
|
148
158
|
header: ""
|
|
149
159
|
}]);
|
|
150
|
-
}, []),
|
|
151
|
-
|
|
160
|
+
}, []), k = n((e) => {
|
|
161
|
+
g((t) => t.filter((t, n) => n !== e));
|
|
152
162
|
}, []);
|
|
153
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ c("div", {
|
|
154
164
|
className: "min-w-0 space-y-form-gap",
|
|
155
165
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("label", {
|
|
157
167
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
158
|
-
children:
|
|
159
|
-
}), /* @__PURE__ */
|
|
160
|
-
value:
|
|
161
|
-
onChange: (e) =>
|
|
168
|
+
children: p("bigconsole.widget.config.table.pageSize.label", "Page Size")
|
|
169
|
+
}), /* @__PURE__ */ c("select", {
|
|
170
|
+
value: t.pageSize || 10,
|
|
171
|
+
onChange: (e) => _("pageSize", Number(e.target.value)),
|
|
162
172
|
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
163
173
|
children: [
|
|
164
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ s("option", {
|
|
165
175
|
value: 10,
|
|
166
|
-
children:
|
|
176
|
+
children: p("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 10 })
|
|
167
177
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ s("option", {
|
|
169
179
|
value: 25,
|
|
170
|
-
children:
|
|
180
|
+
children: p("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 25 })
|
|
171
181
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ s("option", {
|
|
173
183
|
value: 50,
|
|
174
|
-
children:
|
|
184
|
+
children: p("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 50 })
|
|
175
185
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ s("option", {
|
|
177
187
|
value: 100,
|
|
178
|
-
children:
|
|
188
|
+
children: p("bigconsole.widget.config.table.pageSize.rows", "{{count}} rows", { count: 100 })
|
|
179
189
|
})
|
|
180
190
|
]
|
|
181
191
|
})] }),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */ s("
|
|
192
|
+
/* @__PURE__ */ c("div", { children: [
|
|
193
|
+
/* @__PURE__ */ s("label", {
|
|
194
|
+
htmlFor: "table-default-sort-column",
|
|
195
|
+
className: "block text-sm font-medium text-text-primary mb-1",
|
|
196
|
+
children: p("bigconsole.widget.config.table.defaultSort.label", "Default sort")
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ s("p", {
|
|
199
|
+
className: "text-sm text-text-secondary mb-2",
|
|
200
|
+
children: p("bigconsole.widget.config.table.defaultSort.help", "The table starts sorted like this every time it opens. Viewers can still click a column title to sort differently.")
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ c("div", {
|
|
203
|
+
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
204
|
+
children: [/* @__PURE__ */ c("select", {
|
|
205
|
+
id: "table-default-sort-column",
|
|
206
|
+
value: T.column ?? "",
|
|
207
|
+
onChange: (e) => D(e.target.value),
|
|
208
|
+
disabled: w.length === 0 && !E,
|
|
209
|
+
"aria-label": p("bigconsole.widget.config.table.defaultSort.column", "Sort by"),
|
|
210
|
+
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n disabled:opacity-60\n ",
|
|
211
|
+
children: [
|
|
212
|
+
/* @__PURE__ */ s("option", {
|
|
213
|
+
value: "",
|
|
214
|
+
children: p("bigconsole.widget.config.table.defaultSort.none", "No default sort")
|
|
215
|
+
}),
|
|
216
|
+
E && T.column && /* @__PURE__ */ s("option", {
|
|
217
|
+
value: T.column,
|
|
218
|
+
children: T.column
|
|
219
|
+
}),
|
|
220
|
+
w.map((e) => /* @__PURE__ */ s("option", {
|
|
221
|
+
value: e.field,
|
|
222
|
+
children: e.header && e.header !== e.field ? `${e.header} (${e.field})` : e.field
|
|
223
|
+
}, e.field))
|
|
224
|
+
]
|
|
225
|
+
}), /* @__PURE__ */ c("select", {
|
|
226
|
+
value: T.direction ?? "asc",
|
|
227
|
+
onChange: (e) => _("defaultSortDirection", e.target.value === "desc" ? "desc" : "asc"),
|
|
228
|
+
disabled: T.column === null,
|
|
229
|
+
"aria-label": p("bigconsole.widget.config.table.defaultSort.direction", "Direction"),
|
|
230
|
+
className: "\n w-full px-3 py-2\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n disabled:opacity-60\n ",
|
|
231
|
+
children: [/* @__PURE__ */ s("option", {
|
|
232
|
+
value: "asc",
|
|
233
|
+
children: p("bigconsole.widget.config.table.defaultSort.asc", "Ascending (A to Z, low to high)")
|
|
234
|
+
}), /* @__PURE__ */ s("option", {
|
|
235
|
+
value: "desc",
|
|
236
|
+
children: p("bigconsole.widget.config.table.defaultSort.desc", "Descending (Z to A, high to low)")
|
|
237
|
+
})]
|
|
238
|
+
})]
|
|
239
|
+
}),
|
|
240
|
+
w.length === 0 && !E && /* @__PURE__ */ s("p", {
|
|
241
|
+
className: "text-sm text-text-secondary mt-2",
|
|
242
|
+
children: p("bigconsole.widget.config.table.defaultSort.needColumns", "Add columns below to choose the column to sort by.")
|
|
243
|
+
})
|
|
244
|
+
] }),
|
|
245
|
+
/* @__PURE__ */ c("div", { children: [
|
|
246
|
+
/* @__PURE__ */ c("div", {
|
|
184
247
|
className: "flex items-center justify-between mb-2",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ s("label", {
|
|
186
249
|
className: "text-sm font-medium text-text-primary",
|
|
187
|
-
children:
|
|
188
|
-
}), /* @__PURE__ */
|
|
250
|
+
children: p("bigconsole.widget.config.table.columns.label", "Columns")
|
|
251
|
+
}), /* @__PURE__ */ s("button", {
|
|
189
252
|
type: "button",
|
|
190
|
-
onClick:
|
|
253
|
+
onClick: O,
|
|
191
254
|
className: "\n text-sm text-action-primary-bg\n hover:text-action-primary-bgHover\n ",
|
|
192
|
-
children:
|
|
255
|
+
children: p("bigconsole.widget.config.table.columns.add", "+ Add Column")
|
|
193
256
|
})]
|
|
194
257
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ s("p", {
|
|
196
259
|
className: "text-sm text-text-secondary mb-3",
|
|
197
|
-
children:
|
|
260
|
+
children: p("bigconsole.widget.config.table.columns.replacementHelp", "Adding columns here replaces auto-generated columns. Only configured columns will be shown, in this order. In edit mode, drag table headers to reorder.")
|
|
198
261
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
262
|
+
/* @__PURE__ */ c("div", {
|
|
200
263
|
className: "space-y-3",
|
|
201
|
-
children: [
|
|
264
|
+
children: [h.map((e, t) => /* @__PURE__ */ c("div", {
|
|
202
265
|
className: "\n p-3\n bg-bg-sunken\n rounded-md\n space-y-2\n ",
|
|
203
266
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ c("div", {
|
|
205
268
|
className: "flex items-center justify-between",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
269
|
+
children: [/* @__PURE__ */ s("span", {
|
|
207
270
|
className: "text-xs text-text-secondary",
|
|
208
|
-
children:
|
|
209
|
-
}), /* @__PURE__ */
|
|
271
|
+
children: p("bigconsole.widget.config.table.columns.columnN", "Column {{index}}", { index: t + 1 })
|
|
272
|
+
}), /* @__PURE__ */ s("button", {
|
|
210
273
|
type: "button",
|
|
211
|
-
onClick: () =>
|
|
274
|
+
onClick: () => k(t),
|
|
212
275
|
className: "text-status-error-text hover:text-status-error-text/80",
|
|
213
|
-
children: /* @__PURE__ */
|
|
276
|
+
children: /* @__PURE__ */ s("svg", {
|
|
214
277
|
className: "w-4 h-4",
|
|
215
278
|
fill: "none",
|
|
216
279
|
stroke: "currentColor",
|
|
217
280
|
viewBox: "0 0 24 24",
|
|
218
|
-
children: /* @__PURE__ */
|
|
281
|
+
children: /* @__PURE__ */ s("path", {
|
|
219
282
|
strokeLinecap: "round",
|
|
220
283
|
strokeLinejoin: "round",
|
|
221
284
|
strokeWidth: 2,
|
|
@@ -224,166 +287,166 @@ var c = [
|
|
|
224
287
|
})
|
|
225
288
|
})]
|
|
226
289
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ c("div", {
|
|
228
291
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
229
|
-
children: [/* @__PURE__ */
|
|
292
|
+
children: [/* @__PURE__ */ s("input", {
|
|
230
293
|
type: "text",
|
|
231
294
|
value: e.field || "",
|
|
232
|
-
onChange: (e) =>
|
|
233
|
-
placeholder:
|
|
295
|
+
onChange: (e) => v(t, "field", e.target.value),
|
|
296
|
+
placeholder: p("bigconsole.widget.config.table.column.fieldPlaceholder", "Field name"),
|
|
234
297
|
className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
235
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ s("input", {
|
|
236
299
|
type: "text",
|
|
237
300
|
value: e.header || "",
|
|
238
|
-
onChange: (e) =>
|
|
239
|
-
placeholder:
|
|
301
|
+
onChange: (e) => v(t, "header", e.target.value),
|
|
302
|
+
placeholder: p("bigconsole.widget.config.table.column.headerPlaceholder", "Header label"),
|
|
240
303
|
className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n "
|
|
241
304
|
})]
|
|
242
305
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ c("div", {
|
|
244
307
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|
|
245
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ c("select", {
|
|
246
309
|
value: e.format || "text",
|
|
247
|
-
onChange: (e) =>
|
|
310
|
+
onChange: (e) => v(t, "format", e.target.value),
|
|
248
311
|
className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
249
312
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ s("option", {
|
|
251
314
|
value: "text",
|
|
252
|
-
children:
|
|
315
|
+
children: p("bigconsole.widget.config.table.format.text", "Text")
|
|
253
316
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ s("option", {
|
|
255
318
|
value: "number",
|
|
256
|
-
children:
|
|
319
|
+
children: p("bigconsole.widget.config.table.format.number", "Number")
|
|
257
320
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ s("option", {
|
|
259
322
|
value: "currency",
|
|
260
|
-
children:
|
|
323
|
+
children: p("bigconsole.widget.config.table.format.currency", "Currency")
|
|
261
324
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ s("option", {
|
|
263
326
|
value: "percentage",
|
|
264
|
-
children:
|
|
327
|
+
children: p("bigconsole.widget.config.table.format.percentage", "Percentage")
|
|
265
328
|
}),
|
|
266
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ s("option", {
|
|
267
330
|
value: "date",
|
|
268
|
-
children:
|
|
331
|
+
children: p("bigconsole.widget.config.table.format.date", "Date")
|
|
269
332
|
}),
|
|
270
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ s("option", {
|
|
271
334
|
value: "badge",
|
|
272
|
-
children:
|
|
335
|
+
children: p("bigconsole.widget.config.table.format.badge", "Badge")
|
|
273
336
|
})
|
|
274
337
|
]
|
|
275
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ c("select", {
|
|
276
339
|
value: e.align || "left",
|
|
277
|
-
onChange: (e) =>
|
|
340
|
+
onChange: (e) => v(t, "align", e.target.value),
|
|
278
341
|
className: "\n px-2 py-1\n text-sm text-text-primary\n bg-bg-surface\n border border-border-default\n rounded-md\n focus:outline-none focus:ring-2 focus:ring-action-primary-bg\n ",
|
|
279
342
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ s("option", {
|
|
281
344
|
value: "left",
|
|
282
|
-
children:
|
|
345
|
+
children: p("bigconsole.widget.config.table.align.left", "Left")
|
|
283
346
|
}),
|
|
284
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ s("option", {
|
|
285
348
|
value: "center",
|
|
286
|
-
children:
|
|
349
|
+
children: p("bigconsole.widget.config.table.align.center", "Center")
|
|
287
350
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ s("option", {
|
|
289
352
|
value: "right",
|
|
290
|
-
children:
|
|
353
|
+
children: p("bigconsole.widget.config.table.align.right", "Right")
|
|
291
354
|
})
|
|
292
355
|
]
|
|
293
356
|
})]
|
|
294
357
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ c("div", {
|
|
296
359
|
className: "pt-2 border-t border-border-default/60",
|
|
297
360
|
children: [
|
|
298
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ c("div", {
|
|
299
362
|
className: "flex items-center justify-between mb-1",
|
|
300
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ s("span", {
|
|
301
364
|
className: "text-xs font-medium text-text-secondary",
|
|
302
|
-
children:
|
|
303
|
-
}), /* @__PURE__ */
|
|
365
|
+
children: p("bigconsole.widget.config.table.conditionalFormatting.title", "Conditional formatting")
|
|
366
|
+
}), /* @__PURE__ */ s("button", {
|
|
304
367
|
type: "button",
|
|
305
|
-
onClick: () =>
|
|
368
|
+
onClick: () => b(t),
|
|
306
369
|
className: "text-xs text-action-primary-bg hover:text-action-primary-bgHover",
|
|
307
|
-
children:
|
|
370
|
+
children: p("bigconsole.widget.config.table.conditionalFormatting.addRule", "+ Add rule")
|
|
308
371
|
})]
|
|
309
372
|
}),
|
|
310
|
-
(e.conditionalRules?.length ?? 0) === 0 && /* @__PURE__ */
|
|
373
|
+
(e.conditionalRules?.length ?? 0) === 0 && /* @__PURE__ */ s("p", {
|
|
311
374
|
className: "text-xs text-text-secondary",
|
|
312
|
-
children:
|
|
375
|
+
children: p("bigconsole.widget.config.table.conditionalFormatting.noRules", "No rules — cell shows its plain value.")
|
|
313
376
|
}),
|
|
314
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ s("div", {
|
|
315
378
|
className: "space-y-2",
|
|
316
379
|
children: (e.conditionalRules ?? []).map((n, r) => {
|
|
317
|
-
let i = n.operator !== "isEmpty" && n.operator !== "isNotEmpty", a = i && n.valueType === "field",
|
|
318
|
-
return /* @__PURE__ */
|
|
380
|
+
let i = n.operator !== "isEmpty" && n.operator !== "isNotEmpty", a = i && n.valueType === "field", o = n.operator === "between" || n.operator === "outside", f = n.style?.bgColor ?? n.style?.textColor ?? "danger";
|
|
381
|
+
return /* @__PURE__ */ c("div", {
|
|
319
382
|
className: "p-2 bg-bg-surface rounded-md border border-border-default space-y-2",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ c("div", {
|
|
321
384
|
className: "flex items-center gap-2",
|
|
322
385
|
children: [
|
|
323
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ s("select", {
|
|
324
387
|
value: n.operator,
|
|
325
|
-
onChange: (e) =>
|
|
326
|
-
className: `${
|
|
327
|
-
children:
|
|
388
|
+
onChange: (e) => x(t, r, { operator: e.target.value }),
|
|
389
|
+
className: `${d} flex-1`,
|
|
390
|
+
children: l.map((e) => /* @__PURE__ */ s("option", {
|
|
328
391
|
value: e.value,
|
|
329
|
-
children:
|
|
392
|
+
children: p(e.labelKey, e.labelDefault)
|
|
330
393
|
}, e.value))
|
|
331
394
|
}),
|
|
332
|
-
i && /* @__PURE__ */
|
|
395
|
+
i && /* @__PURE__ */ c("select", {
|
|
333
396
|
value: a ? "field" : "constant",
|
|
334
|
-
onChange: (e) =>
|
|
397
|
+
onChange: (e) => x(t, r, e.target.value === "field" ? { valueType: "field" } : {
|
|
335
398
|
valueType: "constant",
|
|
336
399
|
fieldRef: void 0
|
|
337
400
|
}),
|
|
338
|
-
"aria-label":
|
|
339
|
-
className: `${
|
|
340
|
-
children: [/* @__PURE__ */
|
|
401
|
+
"aria-label": p("bigconsole.widget.config.table.rule.valueTypeLabel", "Compare to"),
|
|
402
|
+
className: `${d} w-20`,
|
|
403
|
+
children: [/* @__PURE__ */ s("option", {
|
|
341
404
|
value: "constant",
|
|
342
|
-
children:
|
|
343
|
-
}), /* @__PURE__ */
|
|
405
|
+
children: p("bigconsole.widget.config.table.rule.valueTypeConstant", "Value")
|
|
406
|
+
}), /* @__PURE__ */ s("option", {
|
|
344
407
|
value: "field",
|
|
345
|
-
children:
|
|
408
|
+
children: p("bigconsole.widget.config.table.rule.valueTypeField", "Field")
|
|
346
409
|
})]
|
|
347
410
|
}),
|
|
348
|
-
a ? /* @__PURE__ */
|
|
411
|
+
a ? /* @__PURE__ */ c("select", {
|
|
349
412
|
value: n.fieldRef ?? "",
|
|
350
|
-
onChange: (e) =>
|
|
413
|
+
onChange: (e) => x(t, r, {
|
|
351
414
|
valueType: "field",
|
|
352
415
|
fieldRef: e.target.value
|
|
353
416
|
}),
|
|
354
|
-
className: `${
|
|
355
|
-
children: [/* @__PURE__ */
|
|
417
|
+
className: `${d} w-28`,
|
|
418
|
+
children: [/* @__PURE__ */ s("option", {
|
|
356
419
|
value: "",
|
|
357
|
-
children:
|
|
358
|
-
}),
|
|
420
|
+
children: p("bigconsole.widget.config.table.rule.fieldRefPlaceholder", "Select field")
|
|
421
|
+
}), h.filter((t) => t.key !== e.key).map((e) => /* @__PURE__ */ s("option", {
|
|
359
422
|
value: e.key,
|
|
360
423
|
children: e.key
|
|
361
424
|
}, e.key))]
|
|
362
|
-
}) : /* @__PURE__ */
|
|
425
|
+
}) : /* @__PURE__ */ s("input", {
|
|
363
426
|
type: "text",
|
|
364
427
|
value: n.value ?? "",
|
|
365
|
-
onChange: (e) =>
|
|
366
|
-
placeholder:
|
|
367
|
-
className: `${
|
|
428
|
+
onChange: (e) => x(t, r, { value: e.target.value }),
|
|
429
|
+
placeholder: p("bigconsole.widget.config.table.rule.valuePlaceholder", "value"),
|
|
430
|
+
className: `${d} w-20`
|
|
368
431
|
}),
|
|
369
|
-
|
|
432
|
+
o && /* @__PURE__ */ s("input", {
|
|
370
433
|
type: "text",
|
|
371
434
|
value: n.value2 ?? "",
|
|
372
|
-
onChange: (e) =>
|
|
373
|
-
placeholder:
|
|
374
|
-
className: `${
|
|
435
|
+
onChange: (e) => x(t, r, { value2: e.target.value }),
|
|
436
|
+
placeholder: p("bigconsole.widget.config.table.rule.value2Placeholder", "and"),
|
|
437
|
+
className: `${d} w-20`
|
|
375
438
|
}),
|
|
376
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ s("button", {
|
|
377
440
|
type: "button",
|
|
378
|
-
onClick: () =>
|
|
441
|
+
onClick: () => C(t, r),
|
|
379
442
|
className: "text-status-error-text hover:text-status-error-text/80",
|
|
380
|
-
"aria-label":
|
|
381
|
-
children: /* @__PURE__ */
|
|
443
|
+
"aria-label": p("bigconsole.widget.config.table.rule.remove", "Remove rule"),
|
|
444
|
+
children: /* @__PURE__ */ s("svg", {
|
|
382
445
|
className: "w-3.5 h-3.5",
|
|
383
446
|
fill: "none",
|
|
384
447
|
stroke: "currentColor",
|
|
385
448
|
viewBox: "0 0 24 24",
|
|
386
|
-
children: /* @__PURE__ */
|
|
449
|
+
children: /* @__PURE__ */ s("path", {
|
|
387
450
|
strokeLinecap: "round",
|
|
388
451
|
strokeLinejoin: "round",
|
|
389
452
|
strokeWidth: 2,
|
|
@@ -392,27 +455,27 @@ var c = [
|
|
|
392
455
|
})
|
|
393
456
|
})
|
|
394
457
|
]
|
|
395
|
-
}), /* @__PURE__ */
|
|
458
|
+
}), /* @__PURE__ */ c("div", {
|
|
396
459
|
className: "flex items-center gap-2",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
398
|
-
value:
|
|
399
|
-
onChange: (e) =>
|
|
400
|
-
className: `${
|
|
401
|
-
children:
|
|
460
|
+
children: [/* @__PURE__ */ s("select", {
|
|
461
|
+
value: f,
|
|
462
|
+
onChange: (e) => S(t, r, e.target.value),
|
|
463
|
+
className: `${d} flex-1`,
|
|
464
|
+
children: u.map((e) => /* @__PURE__ */ s("option", {
|
|
402
465
|
value: e.value,
|
|
403
|
-
children:
|
|
466
|
+
children: p(e.labelKey, e.labelDefault)
|
|
404
467
|
}, e.value))
|
|
405
|
-
}), /* @__PURE__ */
|
|
468
|
+
}), /* @__PURE__ */ c("label", {
|
|
406
469
|
className: "flex items-center gap-1 text-xs text-text-primary",
|
|
407
|
-
children: [/* @__PURE__ */
|
|
470
|
+
children: [/* @__PURE__ */ s("input", {
|
|
408
471
|
type: "checkbox",
|
|
409
472
|
checked: n.style?.bold === !0,
|
|
410
|
-
onChange: (e) =>
|
|
473
|
+
onChange: (e) => x(t, r, { style: {
|
|
411
474
|
...n.style,
|
|
412
475
|
bold: e.target.checked
|
|
413
476
|
} }),
|
|
414
477
|
className: "w-3.5 h-3.5 text-action-primary-bg bg-bg-surface border-border-default rounded focus:ring-action-primary-bg"
|
|
415
|
-
}),
|
|
478
|
+
}), p("bigconsole.widget.config.table.rule.bold", "Bold")]
|
|
416
479
|
})]
|
|
417
480
|
})]
|
|
418
481
|
}, r);
|
|
@@ -421,79 +484,79 @@ var c = [
|
|
|
421
484
|
]
|
|
422
485
|
})
|
|
423
486
|
]
|
|
424
|
-
}, t)),
|
|
487
|
+
}, t)), h.length === 0 && /* @__PURE__ */ s("p", {
|
|
425
488
|
className: "text-sm text-text-secondary text-center py-4",
|
|
426
|
-
children:
|
|
489
|
+
children: p("bigconsole.widget.config.table.columns.empty", "No columns configured. Columns will be auto-generated from data.")
|
|
427
490
|
})]
|
|
428
491
|
})
|
|
429
492
|
] }),
|
|
430
|
-
/* @__PURE__ */
|
|
493
|
+
/* @__PURE__ */ c("div", {
|
|
431
494
|
role: "group",
|
|
432
495
|
"aria-label": "Display options",
|
|
433
496
|
className: "space-y-3 border-t border-[var(--color-border-subtle)] pt-form-gap",
|
|
434
497
|
children: [
|
|
435
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ s("p", {
|
|
436
499
|
className: "text-xs font-bold uppercase tracking-wider text-text-secondary",
|
|
437
500
|
children: "Display options"
|
|
438
501
|
}),
|
|
439
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ c("label", {
|
|
440
503
|
className: "flex items-center gap-3",
|
|
441
|
-
children: [/* @__PURE__ */
|
|
504
|
+
children: [/* @__PURE__ */ s("input", {
|
|
442
505
|
type: "checkbox",
|
|
443
|
-
checked:
|
|
444
|
-
onChange: (e) =>
|
|
506
|
+
checked: t.showSearch !== !1,
|
|
507
|
+
onChange: (e) => _("showSearch", e.target.checked),
|
|
445
508
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
446
|
-
}), /* @__PURE__ */
|
|
509
|
+
}), /* @__PURE__ */ s("span", {
|
|
447
510
|
className: "text-sm text-text-primary",
|
|
448
|
-
children:
|
|
511
|
+
children: p("bigconsole.widget.config.table.showSearch", "Show search box")
|
|
449
512
|
})]
|
|
450
513
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ c("label", {
|
|
452
515
|
className: "flex items-center gap-3",
|
|
453
|
-
children: [/* @__PURE__ */
|
|
516
|
+
children: [/* @__PURE__ */ s("input", {
|
|
454
517
|
type: "checkbox",
|
|
455
|
-
checked:
|
|
456
|
-
onChange: (e) =>
|
|
518
|
+
checked: t.showPagination !== !1,
|
|
519
|
+
onChange: (e) => _("showPagination", e.target.checked),
|
|
457
520
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
458
|
-
}), /* @__PURE__ */
|
|
521
|
+
}), /* @__PURE__ */ s("span", {
|
|
459
522
|
className: "text-sm text-text-primary",
|
|
460
|
-
children:
|
|
523
|
+
children: p("bigconsole.widget.config.table.showPagination", "Show pagination")
|
|
461
524
|
})]
|
|
462
525
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ c("label", {
|
|
464
527
|
className: "flex items-center gap-3",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ s("input", {
|
|
466
529
|
type: "checkbox",
|
|
467
|
-
checked:
|
|
468
|
-
onChange: (e) =>
|
|
530
|
+
checked: t.showExport !== !1,
|
|
531
|
+
onChange: (e) => _("showExport", e.target.checked),
|
|
469
532
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
470
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ s("span", {
|
|
471
534
|
className: "text-sm text-text-primary",
|
|
472
|
-
children:
|
|
535
|
+
children: p("bigconsole.widget.config.table.showExport", "Show export button")
|
|
473
536
|
})]
|
|
474
537
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ c("label", {
|
|
476
539
|
className: "flex items-center gap-3",
|
|
477
|
-
children: [/* @__PURE__ */
|
|
540
|
+
children: [/* @__PURE__ */ s("input", {
|
|
478
541
|
type: "checkbox",
|
|
479
|
-
checked:
|
|
480
|
-
onChange: (e) =>
|
|
542
|
+
checked: t.stickyHeader === !0,
|
|
543
|
+
onChange: (e) => _("stickyHeader", e.target.checked),
|
|
481
544
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
482
|
-
}), /* @__PURE__ */
|
|
545
|
+
}), /* @__PURE__ */ s("span", {
|
|
483
546
|
className: "text-sm text-text-primary",
|
|
484
|
-
children:
|
|
547
|
+
children: p("bigconsole.widget.config.table.stickyHeader", "Sticky header")
|
|
485
548
|
})]
|
|
486
549
|
}),
|
|
487
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ c("label", {
|
|
488
551
|
className: "flex items-center gap-3",
|
|
489
|
-
children: [/* @__PURE__ */
|
|
552
|
+
children: [/* @__PURE__ */ s("input", {
|
|
490
553
|
type: "checkbox",
|
|
491
|
-
checked:
|
|
492
|
-
onChange: (e) =>
|
|
554
|
+
checked: t.stripedRows === !0,
|
|
555
|
+
onChange: (e) => _("stripedRows", e.target.checked),
|
|
493
556
|
className: "\n w-4 h-4\n text-action-primary-bg\n bg-bg-surface\n border-border-default\n rounded\n focus:ring-action-primary-bg\n "
|
|
494
|
-
}), /* @__PURE__ */
|
|
557
|
+
}), /* @__PURE__ */ s("span", {
|
|
495
558
|
className: "text-sm text-text-primary",
|
|
496
|
-
children:
|
|
559
|
+
children: p("bigconsole.widget.config.table.stripedRows", "Striped rows")
|
|
497
560
|
})]
|
|
498
561
|
})
|
|
499
562
|
]
|
|
@@ -501,4 +564,4 @@ var c = [
|
|
|
501
564
|
]
|
|
502
565
|
});
|
|
503
566
|
});
|
|
504
|
-
export {
|
|
567
|
+
export { f as TableConfig, f as default };
|