@burdenoff/microfe-bigconsole 2026.1001.4 → 2026.1001.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.d.ts.map +1 -1
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js +220 -161
- package/dist/bigconsole/components/dashboard/CreateDashboardDialog.js.map +1 -1
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.d.ts +11 -0
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.d.ts.map +1 -0
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js +208 -0
- package/dist/bigconsole/components/dashboard/TemplateInstallOptions.js.map +1 -0
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.d.ts +7 -0
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.d.ts.map +1 -0
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js +51 -0
- package/dist/bigconsole/components/dashboard/TemplateLayoutPreview.js.map +1 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +2 -0
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts.map +1 -1
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +91 -90
- package/dist/bigconsole/hooks/useStoreDashboardTemplates.js.map +1 -1
- package/dist/bigconsole/utils/dashboardTemplateContent.d.ts +10 -0
- package/dist/bigconsole/utils/dashboardTemplateContent.d.ts.map +1 -0
- package/dist/bigconsole/utils/dashboardTemplateContent.js +36 -0
- package/dist/bigconsole/utils/dashboardTemplateContent.js.map +1 -0
- package/dist/bigconsole/utils/templateInstallInputs.d.ts +5 -0
- package/dist/bigconsole/utils/templateInstallInputs.d.ts.map +1 -0
- package/dist/bigconsole/utils/templateInstallInputs.js +22 -0
- package/dist/bigconsole/utils/templateInstallInputs.js.map +1 -0
- package/dist/generated/global-operations.d.ts +1 -0
- package/dist/generated/global-operations.d.ts.map +1 -1
- package/dist/generated/global-operations.js +1 -0
- package/dist/generated/global-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,121 +1,161 @@
|
|
|
1
1
|
import { Section as e } from "../common/Section.js";
|
|
2
2
|
import "../common/index.js";
|
|
3
3
|
import t from "./StoreTemplatePicker.js";
|
|
4
|
-
import n from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { TemplateInstallOptions as n } from "./TemplateInstallOptions.js";
|
|
5
|
+
import { TemplateLayoutPreview as r } from "./TemplateLayoutPreview.js";
|
|
6
|
+
import { templateInputDefaults as i, templateInputError as ee } from "../../utils/templateInstallInputs.js";
|
|
7
|
+
import te from "../../hooks/useStoreDashboardTemplates.js";
|
|
8
|
+
import { memo as a, useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
9
|
+
import { Copy as ne, LayoutDashboard as re, Plus as u, Tag as ie, X as ae } from "lucide-react";
|
|
10
|
+
import { Badge as oe, Button as d, Dialog as se, DialogContent as ce, DialogDescription as le, DialogFooter as ue, DialogHeader as de, DialogTitle as f, Input as p, Spinner as m, Textarea as fe } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { Fragment as pe, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
12
|
+
import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
13
|
+
import { useActiveContext as he } from "@burdenoff/fe-libs/shared/providers/shell/ActiveContextProvider";
|
|
10
14
|
//#region src/bigconsole/components/dashboard/CreateDashboardDialog.tsx
|
|
11
|
-
var
|
|
12
|
-
let { t:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
var _ = a(function({ isOpen: a, isCreating: _ = !1, onClose: v, onCreate: y, showTemplates: b = !0, onTemplateInstalled: x }) {
|
|
16
|
+
let { t: S } = me(), { templates: ge, loading: _e, error: C, fetchTemplateContent: w, installTemplate: T } = te({ autoLoad: b }), [E, D] = l(!1), { workspaceId: O } = he(), k = c(O);
|
|
17
|
+
k.current = O;
|
|
18
|
+
let [ve, A] = l(null), [ye, be] = l(null), [j, M] = l(!1), [N, P] = l({}), [F, I] = l({}), [L, R] = l("blank"), [z, B] = l(""), [V, H] = l(""), [U, W] = l([]), [G, K] = l(""), [q, J] = l(null), [Y, X] = l(null), Z = c(null), Q = ye === `${q?.id}:${O}` ? ve : null;
|
|
19
|
+
s(() => {
|
|
20
|
+
a && (R("blank"), B(""), H(""), W([]), K(""), J(null), X(null), setTimeout(() => {
|
|
21
|
+
Z.current?.focus();
|
|
16
22
|
}, 100));
|
|
17
|
-
}, [
|
|
18
|
-
let $ =
|
|
19
|
-
let e =
|
|
20
|
-
e && !
|
|
21
|
-
}, [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
}, [a]);
|
|
24
|
+
let $ = o(() => {
|
|
25
|
+
let e = G.trim().toLowerCase();
|
|
26
|
+
e && !U.includes(e) && U.length < 10 && (W((t) => [...t, e]), K(""));
|
|
27
|
+
}, [G, U]);
|
|
28
|
+
s(() => {
|
|
29
|
+
let e = !1;
|
|
30
|
+
if (A(null), P({}), I({}), M(!!q), !(!q || !a)) return w(q.id).then((t) => {
|
|
31
|
+
e || (A(t), be(`${q.id}:${O}`), M(!1), I(t ? i(t.requiredInputs) : {}), t || X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed.")));
|
|
32
|
+
}), () => {
|
|
33
|
+
e = !0;
|
|
34
|
+
};
|
|
35
|
+
}, [
|
|
36
|
+
q,
|
|
37
|
+
w,
|
|
38
|
+
O,
|
|
39
|
+
a,
|
|
40
|
+
S
|
|
41
|
+
]);
|
|
42
|
+
let xe = o((e) => {
|
|
43
|
+
W((t) => t.filter((t) => t !== e));
|
|
44
|
+
}, []), Se = o((e) => {
|
|
45
|
+
e.key === "Enter" ? (e.preventDefault(), $()) : e.key === "Backspace" && !G && U.length > 0 && W((e) => e.slice(0, -1));
|
|
25
46
|
}, [
|
|
26
47
|
$,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]),
|
|
30
|
-
|
|
31
|
-
}, []),
|
|
32
|
-
if (e.preventDefault(),
|
|
33
|
-
|
|
48
|
+
G,
|
|
49
|
+
U.length
|
|
50
|
+
]), Ce = o((e) => {
|
|
51
|
+
J(e), X(null), B(e.name), H(e.description || "");
|
|
52
|
+
}, []), we = o(async (e) => {
|
|
53
|
+
if (e.preventDefault(), L === "template" && !q) {
|
|
54
|
+
X(S("bigconsole.dashboards.createDialog.error.selectTemplate", "Please select a template"));
|
|
34
55
|
return;
|
|
35
56
|
}
|
|
36
|
-
let t =
|
|
57
|
+
let t = z.trim();
|
|
37
58
|
if (!t) {
|
|
38
|
-
|
|
59
|
+
X(S("bigconsole.dashboards.createDialog.error.nameRequired", "Dashboard name is required")), Z.current?.focus();
|
|
39
60
|
return;
|
|
40
61
|
}
|
|
41
62
|
if (t.length < 3) {
|
|
42
|
-
|
|
63
|
+
X(S("bigconsole.dashboards.createDialog.error.nameTooShort", "Dashboard name must be at least 3 characters")), Z.current?.focus();
|
|
43
64
|
return;
|
|
44
65
|
}
|
|
45
66
|
if (t.length > 100) {
|
|
46
|
-
|
|
67
|
+
X(S("bigconsole.dashboards.createDialog.error.nameTooLong", "Dashboard name must be less than 100 characters")), Z.current?.focus();
|
|
47
68
|
return;
|
|
48
69
|
}
|
|
49
|
-
if (
|
|
50
|
-
|
|
70
|
+
if (X(null), L === "template" && q) {
|
|
71
|
+
D(!0);
|
|
51
72
|
try {
|
|
52
|
-
let e = await
|
|
73
|
+
let e = await w(q.id);
|
|
74
|
+
if (k.current !== O) {
|
|
75
|
+
X(S("bigconsole.dashboards.templateSetup.workspaceChanged", "The workspace changed. Review the template setup before creating your dashboard."));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
53
78
|
if (!e) {
|
|
54
|
-
|
|
79
|
+
X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed."));
|
|
55
80
|
return;
|
|
56
81
|
}
|
|
57
|
-
let n =
|
|
58
|
-
|
|
59
|
-
|
|
82
|
+
let n = ee(e.requiredInputs, F, S);
|
|
83
|
+
if (n) {
|
|
84
|
+
X(n);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
let r = await T({
|
|
88
|
+
templateId: q.id,
|
|
89
|
+
templateName: q.name,
|
|
60
90
|
content: e,
|
|
61
|
-
name: t
|
|
91
|
+
name: t,
|
|
92
|
+
description: V.trim(),
|
|
93
|
+
tags: U,
|
|
94
|
+
dataSinkBindings: Object.entries(N).filter(([, e]) => e).map(([e, t]) => ({
|
|
95
|
+
slot: e,
|
|
96
|
+
dataSinkId: t
|
|
97
|
+
})),
|
|
98
|
+
inputValues: F
|
|
62
99
|
});
|
|
63
|
-
if (!
|
|
64
|
-
|
|
100
|
+
if (!r.success) {
|
|
101
|
+
X(r.errorMessage ?? S("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
|
|
65
102
|
return;
|
|
66
103
|
}
|
|
67
|
-
|
|
68
|
-
dashboardId:
|
|
69
|
-
widgetsNeedingData:
|
|
70
|
-
}),
|
|
104
|
+
r.dashboardId && x?.({
|
|
105
|
+
dashboardId: r.dashboardId,
|
|
106
|
+
widgetsNeedingData: r.widgetsNeedingData
|
|
107
|
+
}), v();
|
|
71
108
|
} catch (e) {
|
|
72
|
-
|
|
109
|
+
X(e instanceof Error ? e.message : S("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
|
|
73
110
|
} finally {
|
|
74
|
-
|
|
111
|
+
D(!1);
|
|
75
112
|
}
|
|
76
113
|
return;
|
|
77
114
|
}
|
|
78
115
|
try {
|
|
79
|
-
await
|
|
116
|
+
await y({
|
|
80
117
|
name: t,
|
|
81
|
-
description:
|
|
118
|
+
description: V.trim(),
|
|
82
119
|
category: "CUSTOM",
|
|
83
|
-
tags:
|
|
120
|
+
tags: U.length > 0 ? U : void 0
|
|
84
121
|
});
|
|
85
122
|
} catch (e) {
|
|
86
|
-
|
|
123
|
+
X(e instanceof Error ? e.message : S("bigconsole.dashboards.createDialog.error.createFailed", "Failed to create dashboard. Please try again."));
|
|
87
124
|
}
|
|
88
125
|
}, [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
P,
|
|
126
|
+
z,
|
|
127
|
+
V,
|
|
128
|
+
U,
|
|
129
|
+
L,
|
|
130
|
+
q,
|
|
131
|
+
O,
|
|
132
|
+
N,
|
|
97
133
|
F,
|
|
98
|
-
|
|
99
|
-
|
|
134
|
+
y,
|
|
135
|
+
v,
|
|
136
|
+
w,
|
|
137
|
+
T,
|
|
138
|
+
x,
|
|
139
|
+
S
|
|
100
140
|
]);
|
|
101
|
-
return /* @__PURE__ */
|
|
102
|
-
open:
|
|
103
|
-
onOpenChange: (e) => !e && !
|
|
104
|
-
children: /* @__PURE__ */
|
|
141
|
+
return /* @__PURE__ */ h(se, {
|
|
142
|
+
open: a,
|
|
143
|
+
onOpenChange: (e) => !e && !_ && !E && v(),
|
|
144
|
+
children: /* @__PURE__ */ g(ce, {
|
|
105
145
|
style: {
|
|
106
|
-
maxWidth:
|
|
146
|
+
maxWidth: L === "template" ? "900px" : "480px",
|
|
107
147
|
width: "100%",
|
|
108
148
|
padding: 0
|
|
109
149
|
},
|
|
110
|
-
children: [/* @__PURE__ */
|
|
150
|
+
children: [/* @__PURE__ */ h(de, {
|
|
111
151
|
style: { padding: "var(--space-pagePadding) var(--space-pagePadding) 0" },
|
|
112
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ g("div", {
|
|
113
153
|
style: {
|
|
114
154
|
display: "flex",
|
|
115
155
|
alignItems: "center",
|
|
116
156
|
gap: "var(--space-formGap)"
|
|
117
157
|
},
|
|
118
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ h("div", {
|
|
119
159
|
style: {
|
|
120
160
|
display: "flex",
|
|
121
161
|
height: "var(--size-controlHeight-lg)",
|
|
@@ -126,7 +166,7 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
126
166
|
borderRadius: "var(--radius-card)",
|
|
127
167
|
backgroundColor: "var(--color-bg-accentSubtle)"
|
|
128
168
|
},
|
|
129
|
-
children: /* @__PURE__ */
|
|
169
|
+
children: /* @__PURE__ */ h(re, {
|
|
130
170
|
"aria-hidden": "true",
|
|
131
171
|
style: {
|
|
132
172
|
height: "var(--size-icon-lg)",
|
|
@@ -134,29 +174,29 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
134
174
|
color: "var(--color-action-primary-bg)"
|
|
135
175
|
}
|
|
136
176
|
})
|
|
137
|
-
}), /* @__PURE__ */
|
|
177
|
+
}), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(f, {
|
|
138
178
|
style: {
|
|
139
179
|
fontSize: "var(--font-size-heading-h4)",
|
|
140
180
|
fontWeight: "var(--font-weight-bold)",
|
|
141
181
|
color: "var(--color-text-primary)",
|
|
142
182
|
margin: 0
|
|
143
183
|
},
|
|
144
|
-
children:
|
|
145
|
-
}), /* @__PURE__ */
|
|
184
|
+
children: S("bigconsole.dashboards.createDialog.title", "Create New Dashboard")
|
|
185
|
+
}), /* @__PURE__ */ h(le, {
|
|
146
186
|
style: {
|
|
147
187
|
fontSize: "var(--font-size-body-sm)",
|
|
148
188
|
color: "var(--color-text-secondary)",
|
|
149
189
|
margin: "var(--space-controlGap) 0 0 0"
|
|
150
190
|
},
|
|
151
|
-
children:
|
|
191
|
+
children: S("bigconsole.dashboards.createDialog.subtitle", "Create a new dashboard to visualize your data")
|
|
152
192
|
})] })]
|
|
153
193
|
})
|
|
154
|
-
}), /* @__PURE__ */
|
|
155
|
-
onSubmit:
|
|
194
|
+
}), /* @__PURE__ */ g("form", {
|
|
195
|
+
onSubmit: we,
|
|
156
196
|
children: [
|
|
157
|
-
|
|
197
|
+
b && /* @__PURE__ */ h("div", {
|
|
158
198
|
style: { padding: "var(--space-pagePadding) var(--space-pagePadding) 0" },
|
|
159
|
-
children: /* @__PURE__ */
|
|
199
|
+
children: /* @__PURE__ */ g("div", {
|
|
160
200
|
role: "group",
|
|
161
201
|
"aria-label": "How to start",
|
|
162
202
|
style: {
|
|
@@ -167,10 +207,11 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
167
207
|
backgroundColor: "var(--color-bg-sunken)",
|
|
168
208
|
borderRadius: "var(--radius-button)"
|
|
169
209
|
},
|
|
170
|
-
children: [/* @__PURE__ */
|
|
210
|
+
children: [/* @__PURE__ */ g("button", {
|
|
171
211
|
type: "button",
|
|
212
|
+
disabled: _ || E,
|
|
172
213
|
onClick: () => {
|
|
173
|
-
|
|
214
|
+
R("blank"), J(null);
|
|
174
215
|
},
|
|
175
216
|
style: {
|
|
176
217
|
flex: 1,
|
|
@@ -181,21 +222,22 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
181
222
|
padding: "var(--space-controlGap) var(--space-formGap)",
|
|
182
223
|
borderRadius: "var(--radius-button)",
|
|
183
224
|
border: "none",
|
|
184
|
-
backgroundColor:
|
|
185
|
-
color:
|
|
186
|
-
fontWeight:
|
|
225
|
+
backgroundColor: L === "blank" ? "var(--color-bg-surface)" : "transparent",
|
|
226
|
+
color: L === "blank" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
|
|
227
|
+
fontWeight: L === "blank" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
|
|
187
228
|
fontSize: "var(--font-size-body-sm)",
|
|
188
229
|
cursor: "pointer",
|
|
189
|
-
boxShadow:
|
|
230
|
+
boxShadow: L === "blank" ? "var(--shadow-elevation-1)" : "none",
|
|
190
231
|
transition: "all 0.15s ease"
|
|
191
232
|
},
|
|
192
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ h(u, { style: {
|
|
193
234
|
height: "var(--size-icon-sm)",
|
|
194
235
|
width: "var(--size-icon-sm)"
|
|
195
|
-
} }),
|
|
196
|
-
}), /* @__PURE__ */
|
|
236
|
+
} }), S("bigconsole.dashboards.createDialog.tab.blank", "Blank Dashboard")]
|
|
237
|
+
}), /* @__PURE__ */ g("button", {
|
|
197
238
|
type: "button",
|
|
198
|
-
|
|
239
|
+
disabled: _ || E,
|
|
240
|
+
onClick: () => R("template"),
|
|
199
241
|
style: {
|
|
200
242
|
flex: 1,
|
|
201
243
|
display: "flex",
|
|
@@ -205,38 +247,55 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
205
247
|
padding: "var(--space-controlGap) var(--space-formGap)",
|
|
206
248
|
borderRadius: "var(--radius-button)",
|
|
207
249
|
border: "none",
|
|
208
|
-
backgroundColor:
|
|
209
|
-
color:
|
|
210
|
-
fontWeight:
|
|
250
|
+
backgroundColor: L === "template" ? "var(--color-bg-surface)" : "transparent",
|
|
251
|
+
color: L === "template" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
|
|
252
|
+
fontWeight: L === "template" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
|
|
211
253
|
fontSize: "var(--font-size-body-sm)",
|
|
212
254
|
cursor: "pointer",
|
|
213
|
-
boxShadow:
|
|
255
|
+
boxShadow: L === "template" ? "var(--shadow-elevation-1)" : "none",
|
|
214
256
|
transition: "all 0.15s ease"
|
|
215
257
|
},
|
|
216
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ h(ne, { style: {
|
|
217
259
|
height: "var(--size-icon-sm)",
|
|
218
260
|
width: "var(--size-icon-sm)"
|
|
219
|
-
} }),
|
|
261
|
+
} }), S("bigconsole.dashboards.createDialog.tab.template", "From Template")]
|
|
220
262
|
})]
|
|
221
263
|
})
|
|
222
264
|
}),
|
|
223
|
-
|
|
265
|
+
L === "template" && /* @__PURE__ */ h("div", {
|
|
224
266
|
style: {
|
|
225
267
|
padding: "var(--space-pagePadding)",
|
|
226
268
|
maxHeight: "400px",
|
|
227
269
|
overflowY: "auto"
|
|
228
270
|
},
|
|
229
|
-
children: /* @__PURE__ */
|
|
230
|
-
templates:
|
|
231
|
-
loading:
|
|
232
|
-
error:
|
|
233
|
-
selectedTemplateId:
|
|
234
|
-
onSelect:
|
|
271
|
+
children: /* @__PURE__ */ h(t, {
|
|
272
|
+
templates: ge,
|
|
273
|
+
loading: _e,
|
|
274
|
+
error: C,
|
|
275
|
+
selectedTemplateId: q?.id,
|
|
276
|
+
onSelect: Ce
|
|
235
277
|
})
|
|
236
278
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
279
|
+
L === "template" && q && /* @__PURE__ */ g("div", {
|
|
280
|
+
style: { padding: "var(--space-pagePadding)" },
|
|
281
|
+
children: [j && /* @__PURE__ */ h(m, {}), Q && /* @__PURE__ */ g(pe, { children: [/* @__PURE__ */ h(r, { content: Q }), /* @__PURE__ */ h(n, {
|
|
282
|
+
content: Q,
|
|
283
|
+
bindings: N,
|
|
284
|
+
onBindingChange: (e, t) => P((n) => ({
|
|
285
|
+
...n,
|
|
286
|
+
[e]: t
|
|
287
|
+
})),
|
|
288
|
+
inputValues: F,
|
|
289
|
+
onInputChange: (e, t) => I((n) => ({
|
|
290
|
+
...n,
|
|
291
|
+
[e]: t
|
|
292
|
+
})),
|
|
293
|
+
disabled: _ || E
|
|
294
|
+
})] })]
|
|
295
|
+
}),
|
|
296
|
+
/* @__PURE__ */ h("div", {
|
|
238
297
|
style: { padding: "var(--space-pagePadding)" },
|
|
239
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ g(e, {
|
|
240
299
|
headingLevel: 3,
|
|
241
300
|
emphasis: "bare",
|
|
242
301
|
padding: "none",
|
|
@@ -244,10 +303,10 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
244
303
|
description: "Name it now — everything else can change later.",
|
|
245
304
|
"data-testid": "create-dashboard-details",
|
|
246
305
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ g("div", {
|
|
248
307
|
style: { marginBottom: "var(--space-formGap)" },
|
|
249
308
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ g("label", {
|
|
251
310
|
htmlFor: "dashboard-name",
|
|
252
311
|
style: {
|
|
253
312
|
display: "block",
|
|
@@ -256,7 +315,7 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
256
315
|
color: "var(--color-text-primary)",
|
|
257
316
|
marginBottom: "var(--space-controlGap)"
|
|
258
317
|
},
|
|
259
|
-
children: [
|
|
318
|
+
children: [S("bigconsole.dashboards.createDialog.field.name", "Dashboard Name"), /* @__PURE__ */ h("span", {
|
|
260
319
|
style: {
|
|
261
320
|
color: "var(--color-status-error-text)",
|
|
262
321
|
marginLeft: "var(--space-controlGap)"
|
|
@@ -264,36 +323,36 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
264
323
|
children: "*"
|
|
265
324
|
})]
|
|
266
325
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
ref:
|
|
326
|
+
/* @__PURE__ */ h(p, {
|
|
327
|
+
ref: Z,
|
|
269
328
|
id: "dashboard-name",
|
|
270
329
|
type: "text",
|
|
271
|
-
value:
|
|
330
|
+
value: z,
|
|
272
331
|
onChange: (e) => {
|
|
273
|
-
|
|
332
|
+
B(e.target.value), Y && X(null);
|
|
274
333
|
},
|
|
275
|
-
placeholder:
|
|
276
|
-
disabled:
|
|
334
|
+
placeholder: S("bigconsole.dashboards.createDialog.field.namePlaceholder", "Enter dashboard name"),
|
|
335
|
+
disabled: _ || E,
|
|
277
336
|
style: {
|
|
278
337
|
height: "var(--size-controlHeight-md)",
|
|
279
338
|
fontSize: "var(--font-size-body-sm)",
|
|
280
|
-
borderColor:
|
|
339
|
+
borderColor: Y ? "var(--color-status-error-border)" : void 0
|
|
281
340
|
}
|
|
282
341
|
}),
|
|
283
|
-
|
|
342
|
+
Y && /* @__PURE__ */ h("p", {
|
|
284
343
|
style: {
|
|
285
344
|
fontSize: "var(--font-size-body-sm)",
|
|
286
345
|
color: "var(--color-status-error-text)",
|
|
287
346
|
marginTop: "var(--space-controlGap)",
|
|
288
347
|
fontWeight: "var(--font-weight-medium)"
|
|
289
348
|
},
|
|
290
|
-
children:
|
|
349
|
+
children: Y
|
|
291
350
|
})
|
|
292
351
|
]
|
|
293
352
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ g("div", {
|
|
295
354
|
style: { marginBottom: "var(--space-formGap)" },
|
|
296
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ g("label", {
|
|
297
356
|
htmlFor: "dashboard-description",
|
|
298
357
|
style: {
|
|
299
358
|
display: "block",
|
|
@@ -302,29 +361,29 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
302
361
|
color: "var(--color-text-primary)",
|
|
303
362
|
marginBottom: "var(--space-controlGap)"
|
|
304
363
|
},
|
|
305
|
-
children: [
|
|
364
|
+
children: [S("bigconsole.dashboards.createDialog.field.description", "Description"), /* @__PURE__ */ h("span", {
|
|
306
365
|
style: {
|
|
307
366
|
color: "var(--color-text-muted)",
|
|
308
367
|
fontWeight: "var(--font-weight-regular)",
|
|
309
368
|
marginLeft: "var(--space-controlGap)"
|
|
310
369
|
},
|
|
311
|
-
children:
|
|
370
|
+
children: S("bigconsole.dashboards.createDialog.field.optional", "(optional)")
|
|
312
371
|
})]
|
|
313
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ h(fe, {
|
|
314
373
|
id: "dashboard-description",
|
|
315
|
-
value:
|
|
316
|
-
onChange: (e) =>
|
|
317
|
-
placeholder:
|
|
374
|
+
value: V,
|
|
375
|
+
onChange: (e) => H(e.target.value),
|
|
376
|
+
placeholder: S("bigconsole.dashboards.createDialog.field.descriptionPlaceholder", "Enter a brief description for this dashboard"),
|
|
318
377
|
rows: 3,
|
|
319
|
-
disabled:
|
|
378
|
+
disabled: _ || E,
|
|
320
379
|
style: {
|
|
321
380
|
fontSize: "var(--font-size-body-sm)",
|
|
322
381
|
resize: "none"
|
|
323
382
|
}
|
|
324
383
|
})]
|
|
325
384
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
385
|
+
/* @__PURE__ */ g("div", { children: [
|
|
386
|
+
/* @__PURE__ */ g("label", {
|
|
328
387
|
htmlFor: "dashboard-tags",
|
|
329
388
|
style: {
|
|
330
389
|
display: "flex",
|
|
@@ -336,28 +395,28 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
336
395
|
marginBottom: "var(--space-controlGap)"
|
|
337
396
|
},
|
|
338
397
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ h(ie, { style: {
|
|
340
399
|
height: "var(--size-icon-sm)",
|
|
341
400
|
width: "var(--size-icon-sm)"
|
|
342
401
|
} }),
|
|
343
|
-
|
|
344
|
-
/* @__PURE__ */
|
|
402
|
+
S("bigconsole.dashboards.createDialog.field.tags", "Tags"),
|
|
403
|
+
/* @__PURE__ */ h("span", {
|
|
345
404
|
style: {
|
|
346
405
|
color: "var(--color-text-muted)",
|
|
347
406
|
fontWeight: "var(--font-weight-regular)"
|
|
348
407
|
},
|
|
349
|
-
children:
|
|
408
|
+
children: S("bigconsole.dashboards.createDialog.field.tagsOptional", "(optional, max 10)")
|
|
350
409
|
})
|
|
351
410
|
]
|
|
352
411
|
}),
|
|
353
|
-
|
|
412
|
+
U.length > 0 && /* @__PURE__ */ h("div", {
|
|
354
413
|
style: {
|
|
355
414
|
display: "flex",
|
|
356
415
|
flexWrap: "wrap",
|
|
357
416
|
gap: "var(--space-controlGap)",
|
|
358
417
|
marginBottom: "var(--space-controlGap)"
|
|
359
418
|
},
|
|
360
|
-
children:
|
|
419
|
+
children: U.map((e) => /* @__PURE__ */ g(oe, {
|
|
361
420
|
variant: "secondary",
|
|
362
421
|
style: {
|
|
363
422
|
display: "flex",
|
|
@@ -365,10 +424,10 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
365
424
|
gap: "4px",
|
|
366
425
|
paddingRight: "4px"
|
|
367
426
|
},
|
|
368
|
-
children: [e, /* @__PURE__ */
|
|
427
|
+
children: [e, /* @__PURE__ */ h("button", {
|
|
369
428
|
type: "button",
|
|
370
|
-
onClick: () =>
|
|
371
|
-
disabled:
|
|
429
|
+
onClick: () => xe(e),
|
|
430
|
+
disabled: _ || E,
|
|
372
431
|
style: {
|
|
373
432
|
display: "flex",
|
|
374
433
|
alignItems: "center",
|
|
@@ -383,53 +442,53 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
383
442
|
},
|
|
384
443
|
onMouseOver: (e) => e.currentTarget.style.opacity = "1",
|
|
385
444
|
onMouseOut: (e) => e.currentTarget.style.opacity = "0.7",
|
|
386
|
-
children: /* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ h(ae, { style: {
|
|
387
446
|
height: "12px",
|
|
388
447
|
width: "12px"
|
|
389
448
|
} })
|
|
390
449
|
})]
|
|
391
450
|
}, e))
|
|
392
451
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
452
|
+
/* @__PURE__ */ g("div", {
|
|
394
453
|
style: {
|
|
395
454
|
display: "flex",
|
|
396
455
|
gap: "var(--space-controlGap)"
|
|
397
456
|
},
|
|
398
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ h(p, {
|
|
399
458
|
id: "dashboard-tags",
|
|
400
459
|
type: "text",
|
|
401
|
-
value:
|
|
402
|
-
onChange: (e) =>
|
|
403
|
-
onKeyDown:
|
|
404
|
-
placeholder:
|
|
405
|
-
disabled:
|
|
460
|
+
value: G,
|
|
461
|
+
onChange: (e) => K(e.target.value),
|
|
462
|
+
onKeyDown: Se,
|
|
463
|
+
placeholder: U.length >= 10 ? S("bigconsole.dashboards.createDialog.field.tagsMaxReached", "Max tags reached") : S("bigconsole.dashboards.createDialog.field.tagsInputPlaceholder", "Type a tag and press Enter"),
|
|
464
|
+
disabled: _ || E || U.length >= 10,
|
|
406
465
|
style: {
|
|
407
466
|
flex: 1,
|
|
408
467
|
height: "var(--size-controlHeight-md)",
|
|
409
468
|
fontSize: "var(--font-size-body-sm)"
|
|
410
469
|
}
|
|
411
|
-
}), /* @__PURE__ */
|
|
470
|
+
}), /* @__PURE__ */ h(d, {
|
|
412
471
|
type: "button",
|
|
413
472
|
variant: "outline",
|
|
414
473
|
onClick: $,
|
|
415
|
-
disabled:
|
|
474
|
+
disabled: _ || E || !G.trim() || U.length >= 10,
|
|
416
475
|
style: { height: "var(--size-controlHeight-md)" },
|
|
417
|
-
children:
|
|
476
|
+
children: S("bigconsole.dashboards.createDialog.action.addTag", "Add")
|
|
418
477
|
})]
|
|
419
478
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ h("p", {
|
|
421
480
|
style: {
|
|
422
481
|
fontSize: "var(--font-size-xs)",
|
|
423
482
|
color: "var(--color-text-muted)",
|
|
424
483
|
marginTop: "var(--space-controlGap)"
|
|
425
484
|
},
|
|
426
|
-
children:
|
|
485
|
+
children: S("bigconsole.dashboards.createDialog.field.tagsHelp", "Press Enter to add a tag, or click Add")
|
|
427
486
|
})
|
|
428
487
|
] })
|
|
429
488
|
]
|
|
430
489
|
})
|
|
431
490
|
}),
|
|
432
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ g(ue, {
|
|
433
492
|
style: {
|
|
434
493
|
padding: "var(--space-formGap) var(--space-pagePadding)",
|
|
435
494
|
borderTop: "1px solid var(--color-border)",
|
|
@@ -438,40 +497,40 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
438
497
|
justifyContent: "flex-end",
|
|
439
498
|
gap: "var(--space-controlGap)"
|
|
440
499
|
},
|
|
441
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ h(d, {
|
|
442
501
|
type: "button",
|
|
443
502
|
variant: "outline",
|
|
444
|
-
onClick:
|
|
445
|
-
disabled:
|
|
503
|
+
onClick: v,
|
|
504
|
+
disabled: _ || E,
|
|
446
505
|
style: { height: "var(--size-controlHeight-md)" },
|
|
447
|
-
children:
|
|
448
|
-
}), /* @__PURE__ */
|
|
506
|
+
children: S("bigconsole.dashboards.createDialog.action.cancel", "Cancel")
|
|
507
|
+
}), /* @__PURE__ */ h(d, {
|
|
449
508
|
type: "submit",
|
|
450
|
-
disabled:
|
|
509
|
+
disabled: _ || E || !z.trim() || L === "template" && (!q || !Q || j),
|
|
451
510
|
style: {
|
|
452
511
|
height: "var(--size-controlHeight-md)",
|
|
453
512
|
backgroundColor: "var(--color-action-primary-bg)"
|
|
454
513
|
},
|
|
455
|
-
children:
|
|
514
|
+
children: _ || E ? /* @__PURE__ */ g("span", {
|
|
456
515
|
style: {
|
|
457
516
|
display: "flex",
|
|
458
517
|
alignItems: "center",
|
|
459
518
|
gap: "var(--space-iconGap)"
|
|
460
519
|
},
|
|
461
|
-
children: [/* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ h(m, { style: {
|
|
462
521
|
height: "var(--size-icon-sm)",
|
|
463
522
|
width: "var(--size-icon-sm)"
|
|
464
|
-
} }),
|
|
465
|
-
}) : /* @__PURE__ */
|
|
523
|
+
} }), S("bigconsole.dashboards.createDialog.action.creating", "Creating...")]
|
|
524
|
+
}) : /* @__PURE__ */ g("span", {
|
|
466
525
|
style: {
|
|
467
526
|
display: "flex",
|
|
468
527
|
alignItems: "center",
|
|
469
528
|
gap: "var(--space-iconGap)"
|
|
470
529
|
},
|
|
471
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ h(u, { style: {
|
|
472
531
|
height: "var(--size-icon-sm)",
|
|
473
532
|
width: "var(--size-icon-sm)"
|
|
474
|
-
} }),
|
|
533
|
+
} }), S("bigconsole.dashboards.createDialog.action.create", "Create Dashboard")]
|
|
475
534
|
})
|
|
476
535
|
})]
|
|
477
536
|
})
|
|
@@ -481,6 +540,6 @@ var T = r(function({ isOpen: r, isCreating: T = !1, onClose: E, onCreate: D, sho
|
|
|
481
540
|
});
|
|
482
541
|
});
|
|
483
542
|
//#endregion
|
|
484
|
-
export {
|
|
543
|
+
export { _ as default };
|
|
485
544
|
|
|
486
545
|
//# sourceMappingURL=CreateDashboardDialog.js.map
|