@nice2dev/ui 1.3.15 → 1.3.17
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/CHANGELOG.md +90 -0
- package/dist/{NiceDataGrid-BwiBkE3u.cjs → NiceDataGrid-aNPAHsWy.cjs} +1 -1
- package/dist/NiceEventOrchestrator.doc-Dwtq2s_L.cjs +6 -0
- package/dist/{NiceForm-Cxvh2O6y.cjs → NiceForm-BtRBLffD.cjs} +1 -1
- package/dist/{NiceMention-CYTx04JY.cjs → NiceMention-CMqAGvO0.cjs} +1 -1
- package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +1 -0
- package/dist/{NicePagination-CKsAP38Q.cjs → NicePagination-D7XxeNFz.cjs} +1 -1
- package/dist/{NiceSavedQueryPanel-CN1rCPFs.cjs → NiceSavedQueryPanel-JHrSlHAV.cjs} +1 -1
- package/dist/{NiceScheduler-K8ZAqFCQ.cjs → NiceScheduler-2TwOZq-y.cjs} +1 -1
- package/dist/{core-lazy-DfNWyf__.cjs → core-lazy-Cda-D35m.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/docs/NiceEventOrchestrator.doc.json.mjs +19 -19
- package/dist/editors/inputs/NiceNumberInput.mjs +27 -27
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +220 -220
- package/dist/index.d.ts +129 -62
- package/dist/index.mjs +912 -910
- package/dist/lazy.cjs +1 -1
- package/dist/navigation/NiceFirstRunPreferences.mjs +55 -54
- package/dist/navigation/NiceNavShell.mjs +429 -429
- package/dist/navigation/NiceSetupWizard.mjs +333 -317
- package/dist/navigation/NiceSidebarNav.mjs +1111 -1039
- package/dist/navigation/menuBuilderModel.mjs +1 -1
- package/dist/navigation/sidebarColors.mjs +67 -39
- package/dist/navigation/sidebarNavTypes.mjs +16 -14
- package/dist/navigation/sidebarPrefs/NiceSidebarPrefsDisplay.mjs +120 -42
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +32 -6
- package/dist/{no-code-BQqK8mvU.cjs → no-code-B3BHeyG-.cjs} +1 -1
- package/dist/no-code.cjs +1 -1
- package/dist/style.css +2 -2
- package/dist/tools/NiceThemeDesigner.mjs +1359 -900
- package/dist/tools/NiceThemePreview.mjs +18 -18
- package/dist/tools/themeCatalog.mjs +50 -0
- package/dist/workflow/NiceWorkflowDesigner.mjs +452 -898
- package/package.json +5 -5
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +0 -6
- package/dist/NiceModuleLifecyclePanel-DHHAjwQx.cjs +0 -1
|
@@ -1,321 +1,337 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { useRovingFocus as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { NiceButton as
|
|
5
|
-
import { NiceSpinner as
|
|
6
|
-
import { NiceLanguagePicker as
|
|
7
|
-
import { NiceThemePicker as
|
|
8
|
-
import { NiceConfirmDialog as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const C =
|
|
1
|
+
import { jsx as i, jsxs as s, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useRovingFocus as _i, useNiceAccessMode as fi, useNiceTranslation as wi, useControlId as vi, useIntent as zi, useInputHints as bi, NiceIcon as S, NiceThemeProvider as gi } from "@nice2dev/ui-core";
|
|
3
|
+
import { forwardRef as Ni, useRef as R, useState as b, useMemo as T, useEffect as le, useCallback as m, useContext as xi, createContext as ki } from "react";
|
|
4
|
+
import { NiceButton as Ge } from "../buttons/NiceButton.mjs";
|
|
5
|
+
import { NiceSpinner as Si } from "../display/NiceSpinner.mjs";
|
|
6
|
+
import { NiceLanguagePicker as Ci } from "../editors/pickers/NiceLanguagePicker.mjs";
|
|
7
|
+
import { NiceThemePicker as Ii } from "../editors/pickers/NiceThemePicker.mjs";
|
|
8
|
+
import { NiceConfirmDialog as yi } from "../feedback/NiceConfirmDialog.mjs";
|
|
9
|
+
const $i = [], Qe = /* @__PURE__ */ ki(null);
|
|
10
|
+
function Fi() {
|
|
11
|
+
const C = xi(Qe);
|
|
12
12
|
if (!C)
|
|
13
13
|
throw new Error("useSetupWizard must be used within NiceSetupWizard");
|
|
14
14
|
return C;
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
/* @__PURE__ */
|
|
16
|
+
const Li = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), ji = /* @__PURE__ */ Object.assign(
|
|
17
|
+
/* @__PURE__ */ Ni(
|
|
18
18
|
({
|
|
19
|
-
steps: C =
|
|
20
|
-
initialValues:
|
|
19
|
+
steps: C = $i,
|
|
20
|
+
initialValues: oe = {},
|
|
21
21
|
activeStep: f,
|
|
22
|
-
completedSteps:
|
|
23
|
-
layout:
|
|
24
|
-
size:
|
|
25
|
-
defaultQuickMode:
|
|
26
|
-
allowQuickModeToggle:
|
|
27
|
-
showStepNumbers:
|
|
28
|
-
showProgress:
|
|
29
|
-
showEstimatedTime:
|
|
30
|
-
allowStepClick:
|
|
31
|
-
showReviewStep:
|
|
22
|
+
completedSteps: Ve,
|
|
23
|
+
layout: q = "horizontal",
|
|
24
|
+
size: P = "md",
|
|
25
|
+
defaultQuickMode: Je = !1,
|
|
26
|
+
allowQuickModeToggle: ue = !0,
|
|
27
|
+
showStepNumbers: Ye = !0,
|
|
28
|
+
showProgress: Ue = !0,
|
|
29
|
+
showEstimatedTime: pe = !1,
|
|
30
|
+
allowStepClick: Xe = !0,
|
|
31
|
+
showReviewStep: me = !1,
|
|
32
32
|
persistKey: h,
|
|
33
|
-
animation:
|
|
34
|
-
theme:
|
|
35
|
-
branding:
|
|
36
|
-
showLanguagePicker:
|
|
37
|
-
languagePickerProps:
|
|
38
|
-
showThemePicker:
|
|
39
|
-
themePickerProps:
|
|
40
|
-
showRestart:
|
|
41
|
-
onRestart:
|
|
42
|
-
restart:
|
|
43
|
-
header:
|
|
44
|
-
footer:
|
|
45
|
-
onStepChange:
|
|
33
|
+
animation: he = "slide",
|
|
34
|
+
theme: _e,
|
|
35
|
+
branding: V,
|
|
36
|
+
showLanguagePicker: fe = !1,
|
|
37
|
+
languagePickerProps: Ze,
|
|
38
|
+
showThemePicker: we = !1,
|
|
39
|
+
themePickerProps: Ke,
|
|
40
|
+
showRestart: J = !1,
|
|
41
|
+
onRestart: Y,
|
|
42
|
+
restart: g = {},
|
|
43
|
+
header: ve,
|
|
44
|
+
footer: ze,
|
|
45
|
+
onStepChange: be,
|
|
46
46
|
onValuesChange: W,
|
|
47
47
|
onComplete: E,
|
|
48
|
-
onCancel:
|
|
48
|
+
onCancel: U,
|
|
49
49
|
labels: p = {},
|
|
50
|
-
accessMode:
|
|
51
|
-
height:
|
|
52
|
-
loading:
|
|
53
|
-
loadingText:
|
|
54
|
-
loadingIndicator:
|
|
55
|
-
id:
|
|
56
|
-
className:
|
|
57
|
-
style:
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
orientation:
|
|
50
|
+
accessMode: ei,
|
|
51
|
+
height: ge,
|
|
52
|
+
loading: X = !1,
|
|
53
|
+
loadingText: ii,
|
|
54
|
+
loadingIndicator: ni,
|
|
55
|
+
id: Ne,
|
|
56
|
+
className: ti,
|
|
57
|
+
style: xe
|
|
58
|
+
}, $) => {
|
|
59
|
+
const ke = R(null);
|
|
60
|
+
_i(ke, {
|
|
61
|
+
orientation: q === "vertical" ? "vertical" : "horizontal",
|
|
62
62
|
wrap: !0,
|
|
63
63
|
activateOnMove: !0
|
|
64
64
|
});
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
65
|
+
const Z = fi(ei, Ne), Se = Z === "hidden", { t: d } = wi(), Ce = vi(Ne), [L, ai] = b(Je), F = T(() => L ? C.filter((e) => !e.quickModeSkip) : C, [C, L]), r = T(() => {
|
|
66
|
+
if (!me)
|
|
67
67
|
return F;
|
|
68
68
|
const e = {
|
|
69
69
|
id: "__review__",
|
|
70
|
-
title: p.review ??
|
|
70
|
+
title: p.review ?? d("wizard.review", "Review"),
|
|
71
71
|
icon: /* @__PURE__ */ i(S, { name: "clipboard", size: 16 }),
|
|
72
|
-
content: (
|
|
73
|
-
/* @__PURE__ */ i("h3", { children:
|
|
74
|
-
F.filter((a) => a.summary).map((a) => /* @__PURE__ */
|
|
72
|
+
content: (n) => /* @__PURE__ */ s("div", { className: "nice-setup-wizard__review", children: [
|
|
73
|
+
/* @__PURE__ */ i("h3", { children: d("wizard.reviewTitle", "Review Your Setup") }),
|
|
74
|
+
F.filter((a) => a.summary).map((a) => /* @__PURE__ */ s("div", { className: "nice-setup-wizard__review-section", children: [
|
|
75
75
|
/* @__PURE__ */ i("h4", { children: a.title }),
|
|
76
|
-
a.summary?.(
|
|
76
|
+
a.summary?.(n.values)
|
|
77
77
|
] }, a.id))
|
|
78
78
|
] })
|
|
79
79
|
};
|
|
80
80
|
return [...F, e];
|
|
81
|
-
}, [F,
|
|
81
|
+
}, [F, me, p.review, d]), [u, Ie] = b(() => {
|
|
82
82
|
if (h)
|
|
83
83
|
try {
|
|
84
84
|
const e = localStorage.getItem(h);
|
|
85
85
|
if (e)
|
|
86
|
-
return { ...
|
|
86
|
+
return { ...oe, ...JSON.parse(e) };
|
|
87
87
|
} catch {
|
|
88
88
|
}
|
|
89
|
-
return
|
|
90
|
-
}), [
|
|
89
|
+
return oe;
|
|
90
|
+
}), [w, ye] = b(() => {
|
|
91
91
|
if (f)
|
|
92
92
|
return f;
|
|
93
93
|
if (h)
|
|
94
94
|
try {
|
|
95
95
|
const e = localStorage.getItem(`${h}_step`);
|
|
96
|
-
if (e &&
|
|
96
|
+
if (e && r.some((n) => n.id === e))
|
|
97
97
|
return e;
|
|
98
98
|
} catch {
|
|
99
99
|
}
|
|
100
|
-
return
|
|
101
|
-
}), [
|
|
100
|
+
return r[0]?.id ?? "";
|
|
101
|
+
}), [K, $e] = b(() => /* @__PURE__ */ new Set([w])), [B, Le] = b({}), [Be, j] = b(!1), [Me, Oe] = b(!1), ee = R(!1), [Re, ie] = b("next"), [ri, ne] = b(!1), Te = r.findIndex((e) => e.id === w), o = Te >= 0 ? Te : r.length > 0 ? 0 : -1, t = r[o], M = o === 0, te = o === r.length - 1, k = r.some((e) => e.final) ? !!t?.final : te && t?.final !== !1, N = T(() => {
|
|
102
102
|
const e = /* @__PURE__ */ new Map();
|
|
103
|
-
for (const
|
|
104
|
-
|
|
103
|
+
for (const n of r)
|
|
104
|
+
n.numbered !== !1 && e.set(n.id, e.size + 1);
|
|
105
105
|
return e;
|
|
106
|
-
}, [
|
|
107
|
-
|
|
108
|
-
if (f === void 0 || f ===
|
|
106
|
+
}, [r]), ci = r.slice(0, o + 1).filter((e) => e.numbered !== !1).length, A = N.size > 0 ? ci / N.size * 100 : 0, qe = R(f);
|
|
107
|
+
le(() => {
|
|
108
|
+
if (f === void 0 || f === qe.current)
|
|
109
109
|
return;
|
|
110
|
-
const e =
|
|
111
|
-
e < 0 || (
|
|
112
|
-
e >
|
|
113
|
-
),
|
|
114
|
-
}, [f,
|
|
115
|
-
h && (localStorage.setItem(h, JSON.stringify(u)), localStorage.setItem(`${h}_step`,
|
|
116
|
-
}, [u,
|
|
117
|
-
const
|
|
118
|
-
(e,
|
|
119
|
-
|
|
120
|
-
const l = { ...a, [e]:
|
|
110
|
+
const e = r.findIndex((n) => n.id === f);
|
|
111
|
+
e < 0 || (qe.current = f, f !== w && (ie(
|
|
112
|
+
e > r.findIndex((n) => n.id === w) ? "next" : "prev"
|
|
113
|
+
), ye(f), $e((n) => new Set(n).add(f))));
|
|
114
|
+
}, [f, r, w]), le(() => {
|
|
115
|
+
h && (localStorage.setItem(h, JSON.stringify(u)), localStorage.setItem(`${h}_step`, w));
|
|
116
|
+
}, [u, w, h]);
|
|
117
|
+
const ae = m(
|
|
118
|
+
(e, n) => {
|
|
119
|
+
Ie((a) => {
|
|
120
|
+
const l = { ...a, [e]: n };
|
|
121
121
|
return W?.(l), l;
|
|
122
122
|
});
|
|
123
123
|
},
|
|
124
124
|
[W]
|
|
125
|
-
),
|
|
125
|
+
), Pe = m(
|
|
126
126
|
(e) => {
|
|
127
|
-
|
|
128
|
-
const a = { ...
|
|
127
|
+
Ie((n) => {
|
|
128
|
+
const a = { ...n, ...e };
|
|
129
129
|
return W?.(a), a;
|
|
130
130
|
});
|
|
131
131
|
},
|
|
132
132
|
[W]
|
|
133
|
-
), x = m((e,
|
|
134
|
-
|
|
135
|
-
}, []),
|
|
136
|
-
|
|
137
|
-
const a = { ...
|
|
133
|
+
), x = m((e, n) => {
|
|
134
|
+
Le((a) => ({ ...a, [e]: n }));
|
|
135
|
+
}, []), O = m((e) => {
|
|
136
|
+
Le((n) => {
|
|
137
|
+
const a = { ...n };
|
|
138
138
|
return delete a[e], a;
|
|
139
139
|
});
|
|
140
|
-
}, []), b = m(
|
|
140
|
+
}, []), D = R(null), [si, di] = b(0), v = m(
|
|
141
141
|
(e) => {
|
|
142
|
-
const
|
|
143
|
-
|
|
142
|
+
const n = r.findIndex((a) => a.id === e);
|
|
143
|
+
n >= 0 && (D.current = null, ie(n > o ? "next" : "prev"), ye(e), $e((a) => new Set(a).add(e)), be?.(e, n));
|
|
144
144
|
},
|
|
145
|
-
[
|
|
146
|
-
),
|
|
147
|
-
(e,
|
|
148
|
-
[u,
|
|
149
|
-
),
|
|
150
|
-
if (!(!
|
|
151
|
-
if (
|
|
152
|
-
|
|
145
|
+
[r, o, be]
|
|
146
|
+
), I = m(
|
|
147
|
+
(e, n) => e.nextStep ? typeof e.nextStep == "function" ? e.nextStep(u) : e.nextStep : r[n + 1]?.id ?? "",
|
|
148
|
+
[u, r]
|
|
149
|
+
), H = m(async () => {
|
|
150
|
+
if (!(!t || t.canProceed === !1)) {
|
|
151
|
+
if (t.validate) {
|
|
152
|
+
j(!0);
|
|
153
153
|
try {
|
|
154
|
-
const e = await
|
|
154
|
+
const e = await t.validate(u);
|
|
155
155
|
if (e) {
|
|
156
|
-
x(
|
|
156
|
+
x(t.id, e), j(!1);
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
O(t.id);
|
|
160
160
|
} catch (e) {
|
|
161
|
-
x(
|
|
161
|
+
x(t.id, String(e)), j(!1);
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
j(!1);
|
|
165
165
|
}
|
|
166
|
-
if (
|
|
167
|
-
for (const e of
|
|
166
|
+
if (t.fields) {
|
|
167
|
+
for (const e of t.fields) {
|
|
168
168
|
if (e.required && !u[e.id]) {
|
|
169
|
-
x(
|
|
169
|
+
x(t.id, `${e.label} ${d("wizard.isRequired", "is required")}`);
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
172
|
if (e.validation?.custom) {
|
|
173
|
-
const
|
|
174
|
-
if (
|
|
175
|
-
x(
|
|
173
|
+
const n = e.validation.custom(u[e.id]);
|
|
174
|
+
if (n) {
|
|
175
|
+
x(t.id, n);
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
O(t.id);
|
|
181
181
|
}
|
|
182
182
|
if (k) {
|
|
183
|
-
if (
|
|
183
|
+
if (ee.current)
|
|
184
184
|
return;
|
|
185
|
-
|
|
185
|
+
ee.current = !0, Oe(!0);
|
|
186
186
|
try {
|
|
187
187
|
await E?.(u), h && (localStorage.removeItem(h), localStorage.removeItem(`${h}_step`));
|
|
188
188
|
} catch (e) {
|
|
189
|
-
x(
|
|
189
|
+
x(t.id, e instanceof Error ? e.message : String(e));
|
|
190
190
|
} finally {
|
|
191
|
-
|
|
191
|
+
ee.current = !1, Oe(!1);
|
|
192
192
|
}
|
|
193
193
|
} else {
|
|
194
|
-
const e =
|
|
195
|
-
e &&
|
|
194
|
+
const e = I(t, o);
|
|
195
|
+
e && r.some((n) => n.id === e) ? v(e) : (D.current = t.id, di((n) => n + 1));
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}, [
|
|
199
|
-
|
|
199
|
+
t,
|
|
200
200
|
u,
|
|
201
201
|
k,
|
|
202
202
|
o,
|
|
203
203
|
E,
|
|
204
204
|
h,
|
|
205
|
-
|
|
205
|
+
d,
|
|
206
206
|
x,
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
207
|
+
O,
|
|
208
|
+
v,
|
|
209
|
+
I,
|
|
210
|
+
r
|
|
211
|
+
]);
|
|
212
|
+
le(() => {
|
|
213
|
+
const e = D.current;
|
|
214
|
+
if (e === null)
|
|
215
|
+
return;
|
|
216
|
+
if (e !== w) {
|
|
217
|
+
D.current = null;
|
|
212
218
|
return;
|
|
213
|
-
const e = n?.prevStep ?? d[o - 1]?.id;
|
|
214
|
-
e && (ee("prev"), b(e));
|
|
215
|
-
}, [B, n, o, d, b]), ae = m(() => {
|
|
216
|
-
if (n?.optional && !k) {
|
|
217
|
-
const e = j(n, o);
|
|
218
|
-
e && b(e);
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
const n = r.findIndex((l) => l.id === e);
|
|
221
|
+
if (n < 0)
|
|
222
|
+
return;
|
|
223
|
+
const a = I(r[n], n);
|
|
224
|
+
a && r.some((l) => l.id === a) && v(a);
|
|
225
|
+
}, [r, w, I, v, si]);
|
|
226
|
+
const G = m(() => {
|
|
227
|
+
if (M || t?.canGoBack === !1)
|
|
228
|
+
return;
|
|
229
|
+
const e = t?.prevStep ?? r[o - 1]?.id;
|
|
230
|
+
e && (ie("prev"), v(e));
|
|
231
|
+
}, [M, t, o, r, v]), re = m(() => {
|
|
232
|
+
if (t?.optional && !k) {
|
|
233
|
+
const e = I(t, o);
|
|
234
|
+
e && v(e);
|
|
235
|
+
}
|
|
236
|
+
}, [t, k, o, I, v]), We = m(() => {
|
|
221
237
|
E?.(u);
|
|
222
|
-
}, [E, u]),
|
|
223
|
-
|
|
224
|
-
}, [
|
|
225
|
-
|
|
226
|
-
}, [
|
|
227
|
-
|
|
228
|
-
}, []),
|
|
238
|
+
}, [E, u]), ce = m(() => {
|
|
239
|
+
U?.();
|
|
240
|
+
}, [U]), li = m(() => {
|
|
241
|
+
g.skipConfirm ? Y?.() : ne(!0);
|
|
242
|
+
}, [g.skipConfirm, Y]), se = m(() => {
|
|
243
|
+
ai((e) => !e);
|
|
244
|
+
}, []), y = T(
|
|
229
245
|
() => ({
|
|
230
246
|
values: u,
|
|
231
|
-
setValue:
|
|
232
|
-
setValues:
|
|
233
|
-
currentStep:
|
|
247
|
+
setValue: ae,
|
|
248
|
+
setValues: Pe,
|
|
249
|
+
currentStep: t,
|
|
234
250
|
currentIndex: o,
|
|
235
|
-
totalSteps:
|
|
236
|
-
visitedSteps:
|
|
237
|
-
errors:
|
|
251
|
+
totalSteps: r.length,
|
|
252
|
+
visitedSteps: K,
|
|
253
|
+
errors: B,
|
|
238
254
|
setError: x,
|
|
239
|
-
clearError:
|
|
240
|
-
goNext:
|
|
241
|
-
goPrev:
|
|
242
|
-
goTo:
|
|
243
|
-
skip:
|
|
255
|
+
clearError: O,
|
|
256
|
+
goNext: H,
|
|
257
|
+
goPrev: G,
|
|
258
|
+
goTo: v,
|
|
259
|
+
skip: re,
|
|
244
260
|
complete: We,
|
|
245
|
-
cancel:
|
|
246
|
-
isFirst:
|
|
247
|
-
isLast:
|
|
248
|
-
isQuickMode:
|
|
249
|
-
toggleQuickMode:
|
|
250
|
-
progress:
|
|
251
|
-
t:
|
|
261
|
+
cancel: ce,
|
|
262
|
+
isFirst: M,
|
|
263
|
+
isLast: te,
|
|
264
|
+
isQuickMode: L,
|
|
265
|
+
toggleQuickMode: se,
|
|
266
|
+
progress: A,
|
|
267
|
+
t: d
|
|
252
268
|
}),
|
|
253
269
|
[
|
|
254
270
|
u,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
271
|
+
ae,
|
|
272
|
+
Pe,
|
|
273
|
+
t,
|
|
258
274
|
o,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
275
|
+
r.length,
|
|
276
|
+
K,
|
|
277
|
+
B,
|
|
262
278
|
x,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
ae,
|
|
268
|
-
We,
|
|
279
|
+
O,
|
|
280
|
+
H,
|
|
281
|
+
G,
|
|
282
|
+
v,
|
|
269
283
|
re,
|
|
270
|
-
|
|
271
|
-
ne,
|
|
272
|
-
$,
|
|
284
|
+
We,
|
|
273
285
|
ce,
|
|
274
|
-
|
|
275
|
-
|
|
286
|
+
M,
|
|
287
|
+
te,
|
|
288
|
+
L,
|
|
289
|
+
se,
|
|
290
|
+
A,
|
|
291
|
+
d
|
|
276
292
|
]
|
|
277
|
-
), Ee =
|
|
278
|
-
if (!
|
|
293
|
+
), Ee = T(() => {
|
|
294
|
+
if (!pe)
|
|
279
295
|
return null;
|
|
280
|
-
const
|
|
296
|
+
const n = r.map((a) => a.estimatedTime).filter(Boolean).map((a) => {
|
|
281
297
|
const l = a.match(/(\d+)\s*(min|sec|s|m)/i);
|
|
282
298
|
if (!l)
|
|
283
299
|
return 0;
|
|
284
300
|
const _ = parseInt(l[1], 10);
|
|
285
301
|
return l[2].toLowerCase().startsWith("m") ? _ : _ / 60;
|
|
286
302
|
}).reduce((a, l) => a + l, 0);
|
|
287
|
-
return
|
|
288
|
-
}, [
|
|
303
|
+
return n > 0 ? `~${Math.ceil(n)} min` : null;
|
|
304
|
+
}, [r, pe]), de = R(null), oi = m(
|
|
289
305
|
(e) => {
|
|
290
|
-
|
|
306
|
+
de.current = e, typeof $ == "function" ? $(e) : $ && ($.current = e);
|
|
291
307
|
},
|
|
292
|
-
[
|
|
308
|
+
[$]
|
|
293
309
|
);
|
|
294
|
-
|
|
310
|
+
zi(
|
|
295
311
|
["sectionPrev", "sectionNext"],
|
|
296
312
|
(e) => {
|
|
297
|
-
e.intent === "sectionNext" ?
|
|
313
|
+
e.intent === "sectionNext" ? H() : G();
|
|
298
314
|
},
|
|
299
|
-
{ ref:
|
|
315
|
+
{ ref: de, enabled: !Se && !!t }
|
|
300
316
|
);
|
|
301
|
-
const Fe = !
|
|
302
|
-
if (
|
|
303
|
-
|
|
317
|
+
const Fe = !M && t?.canGoBack !== !1, je = t?.canProceed !== !1;
|
|
318
|
+
if (bi(
|
|
319
|
+
de,
|
|
304
320
|
[
|
|
305
|
-
...Fe ? [{ intent: "sectionPrev", label: p.prev ??
|
|
306
|
-
...
|
|
321
|
+
...Fe ? [{ intent: "sectionPrev", label: p.prev ?? d("wizard.prev", "Back") }] : [],
|
|
322
|
+
...je ? [
|
|
307
323
|
{
|
|
308
324
|
intent: "sectionNext",
|
|
309
|
-
label:
|
|
325
|
+
label: t?.nextLabel ?? (k ? p.finish ?? d("wizard.finish", "Finish") : p.next ?? d("wizard.next", "Continue"))
|
|
310
326
|
}
|
|
311
327
|
] : []
|
|
312
328
|
],
|
|
313
|
-
{ enabled: !!
|
|
314
|
-
), !
|
|
329
|
+
{ enabled: !!t && !X }
|
|
330
|
+
), !t && !X)
|
|
315
331
|
return null;
|
|
316
|
-
const
|
|
317
|
-
const a = e.id ===
|
|
318
|
-
return /* @__PURE__ */
|
|
332
|
+
const ui = (e, n) => {
|
|
333
|
+
const a = e.id === w, l = !a && (!!Ve?.includes(e.id) || K.has(e.id) && n < o), _ = !a && !l, z = !!B[e.id], c = Xe && (l || n <= o);
|
|
334
|
+
return /* @__PURE__ */ s(
|
|
319
335
|
"button",
|
|
320
336
|
{
|
|
321
337
|
type: "button",
|
|
@@ -327,18 +343,18 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
327
343
|
a && "nice-setup-wizard__step-indicator--active",
|
|
328
344
|
l && "nice-setup-wizard__step-indicator--completed",
|
|
329
345
|
_ && "nice-setup-wizard__step-indicator--pending",
|
|
330
|
-
|
|
346
|
+
z && "nice-setup-wizard__step-indicator--error"
|
|
331
347
|
].filter(Boolean).join(" "),
|
|
332
|
-
onClick: () =>
|
|
333
|
-
disabled: !
|
|
348
|
+
onClick: () => c && v(e.id),
|
|
349
|
+
disabled: !c,
|
|
334
350
|
children: [
|
|
335
|
-
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__step-marker", children:
|
|
336
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__step-marker", children: z ? "!" : l ? /* @__PURE__ */ i(S, { name: "check", size: 14 }) : Ye && e.numbered !== !1 ? N.get(e.id) : e.icon || /* @__PURE__ */ i(S, { name: "circle", size: 12 }) }),
|
|
352
|
+
/* @__PURE__ */ s("span", { className: "nice-setup-wizard__step-info", children: [
|
|
337
353
|
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__step-title", children: e.title }),
|
|
338
354
|
e.subtitle && /* @__PURE__ */ i("span", { className: "nice-setup-wizard__step-subtitle", children: e.subtitle }),
|
|
339
|
-
e.optional && /* @__PURE__ */
|
|
355
|
+
e.optional && /* @__PURE__ */ s("span", { className: "nice-setup-wizard__step-optional", children: [
|
|
340
356
|
"(",
|
|
341
|
-
p.optional ??
|
|
357
|
+
p.optional ?? d("wizard.optional", "optional"),
|
|
342
358
|
")"
|
|
343
359
|
] })
|
|
344
360
|
] }),
|
|
@@ -347,79 +363,79 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
347
363
|
},
|
|
348
364
|
e.id
|
|
349
365
|
);
|
|
350
|
-
},
|
|
366
|
+
}, pi = (e) => {
|
|
351
367
|
if (e.showWhen && !e.showWhen(u))
|
|
352
368
|
return null;
|
|
353
|
-
const
|
|
369
|
+
const n = u[e.id] ?? e.defaultValue ?? "", a = (c) => ae(e.id, c);
|
|
354
370
|
if (e.render)
|
|
355
371
|
return /* @__PURE__ */ i(
|
|
356
372
|
"div",
|
|
357
373
|
{
|
|
358
374
|
className: `nice-setup-wizard__field${e.fullWidth ? " nice-setup-wizard__field--full" : ""}`,
|
|
359
|
-
children: e.render({ value:
|
|
375
|
+
children: e.render({ value: n, onChange: a, field: e })
|
|
360
376
|
},
|
|
361
377
|
e.id
|
|
362
378
|
);
|
|
363
|
-
const l = `${
|
|
379
|
+
const l = `${Ce}-${e.id}`, _ = {
|
|
364
380
|
id: l,
|
|
365
|
-
disabled: e.disabled ||
|
|
381
|
+
disabled: e.disabled || Z === "disabled" || Z === "readOnly",
|
|
366
382
|
placeholder: e.placeholder,
|
|
367
383
|
required: e.required
|
|
368
384
|
};
|
|
369
|
-
let
|
|
385
|
+
let z;
|
|
370
386
|
switch (e.type) {
|
|
371
387
|
case "textarea":
|
|
372
|
-
|
|
388
|
+
z = /* @__PURE__ */ i(
|
|
373
389
|
"textarea",
|
|
374
390
|
{
|
|
375
391
|
..._,
|
|
376
392
|
className: "nice-setup-wizard__input nice-setup-wizard__textarea",
|
|
377
|
-
value: String(
|
|
378
|
-
onChange: (
|
|
393
|
+
value: String(n),
|
|
394
|
+
onChange: (c) => a(c.target.value),
|
|
379
395
|
rows: 4
|
|
380
396
|
}
|
|
381
397
|
);
|
|
382
398
|
break;
|
|
383
399
|
case "select":
|
|
384
|
-
|
|
400
|
+
z = /* @__PURE__ */ s(
|
|
385
401
|
"select",
|
|
386
402
|
{
|
|
387
403
|
..._,
|
|
388
404
|
className: "nice-setup-wizard__input nice-setup-wizard__select",
|
|
389
|
-
value: String(
|
|
390
|
-
onChange: (
|
|
405
|
+
value: String(n),
|
|
406
|
+
onChange: (c) => a(c.target.value),
|
|
391
407
|
children: [
|
|
392
|
-
/* @__PURE__ */ i("option", { value: "", children: e.placeholder ||
|
|
393
|
-
e.options?.map((
|
|
408
|
+
/* @__PURE__ */ i("option", { value: "", children: e.placeholder || d("wizard.select", "Select...") }),
|
|
409
|
+
e.options?.map((c) => /* @__PURE__ */ i("option", { value: c.value, children: c.label }, c.value))
|
|
394
410
|
]
|
|
395
411
|
}
|
|
396
412
|
);
|
|
397
413
|
break;
|
|
398
414
|
case "radio":
|
|
399
|
-
|
|
415
|
+
z = /* @__PURE__ */ i("div", { className: "nice-setup-wizard__radio-group", children: e.options?.map((c) => /* @__PURE__ */ s("label", { className: "nice-setup-wizard__radio-label", children: [
|
|
400
416
|
/* @__PURE__ */ i(
|
|
401
417
|
"input",
|
|
402
418
|
{
|
|
403
419
|
type: "radio",
|
|
404
420
|
name: l,
|
|
405
|
-
value:
|
|
406
|
-
checked:
|
|
407
|
-
onChange: () => a(
|
|
421
|
+
value: c.value,
|
|
422
|
+
checked: n === c.value,
|
|
423
|
+
onChange: () => a(c.value),
|
|
408
424
|
disabled: _.disabled
|
|
409
425
|
}
|
|
410
426
|
),
|
|
411
|
-
|
|
412
|
-
/* @__PURE__ */ i("span", { children:
|
|
413
|
-
] },
|
|
427
|
+
c.icon && /* @__PURE__ */ i("span", { className: "nice-setup-wizard__radio-icon", children: c.icon }),
|
|
428
|
+
/* @__PURE__ */ i("span", { children: c.label })
|
|
429
|
+
] }, c.value)) });
|
|
414
430
|
break;
|
|
415
431
|
case "checkbox":
|
|
416
|
-
|
|
432
|
+
z = /* @__PURE__ */ s("label", { className: "nice-setup-wizard__checkbox-label", children: [
|
|
417
433
|
/* @__PURE__ */ i(
|
|
418
434
|
"input",
|
|
419
435
|
{
|
|
420
436
|
type: "checkbox",
|
|
421
|
-
checked: !!
|
|
422
|
-
onChange: (
|
|
437
|
+
checked: !!n,
|
|
438
|
+
onChange: (c) => a(c.target.checked),
|
|
423
439
|
disabled: _.disabled
|
|
424
440
|
}
|
|
425
441
|
),
|
|
@@ -427,19 +443,19 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
427
443
|
] });
|
|
428
444
|
break;
|
|
429
445
|
case "switch":
|
|
430
|
-
|
|
446
|
+
z = /* @__PURE__ */ s("label", { className: "nice-setup-wizard__switch-label", children: [
|
|
431
447
|
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__switch-text", children: e.label }),
|
|
432
|
-
/* @__PURE__ */
|
|
448
|
+
/* @__PURE__ */ s(
|
|
433
449
|
"span",
|
|
434
450
|
{
|
|
435
|
-
className: `nice-setup-wizard__switch${
|
|
451
|
+
className: `nice-setup-wizard__switch${n ? " nice-setup-wizard__switch--on" : ""}`,
|
|
436
452
|
children: [
|
|
437
453
|
/* @__PURE__ */ i(
|
|
438
454
|
"input",
|
|
439
455
|
{
|
|
440
456
|
type: "checkbox",
|
|
441
|
-
checked: !!
|
|
442
|
-
onChange: (
|
|
457
|
+
checked: !!n,
|
|
458
|
+
onChange: (c) => a(c.target.checked),
|
|
443
459
|
disabled: _.disabled
|
|
444
460
|
}
|
|
445
461
|
),
|
|
@@ -451,31 +467,31 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
451
467
|
] });
|
|
452
468
|
break;
|
|
453
469
|
case "slider":
|
|
454
|
-
|
|
470
|
+
z = /* @__PURE__ */ s("div", { className: "nice-setup-wizard__slider-wrapper", children: [
|
|
455
471
|
/* @__PURE__ */ i(
|
|
456
472
|
"input",
|
|
457
473
|
{
|
|
458
474
|
type: "range",
|
|
459
475
|
..._,
|
|
460
476
|
className: "nice-setup-wizard__slider",
|
|
461
|
-
value: Number(
|
|
477
|
+
value: Number(n) || e.validation?.min || 0,
|
|
462
478
|
min: e.validation?.min,
|
|
463
479
|
max: e.validation?.max,
|
|
464
|
-
onChange: (
|
|
480
|
+
onChange: (c) => a(Number(c.target.value))
|
|
465
481
|
}
|
|
466
482
|
),
|
|
467
|
-
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__slider-value", children: String(
|
|
483
|
+
/* @__PURE__ */ i("span", { className: "nice-setup-wizard__slider-value", children: String(n ?? "") })
|
|
468
484
|
] });
|
|
469
485
|
break;
|
|
470
486
|
default:
|
|
471
|
-
|
|
487
|
+
z = /* @__PURE__ */ i(
|
|
472
488
|
"input",
|
|
473
489
|
{
|
|
474
490
|
type: e.type === "custom" ? "text" : e.type,
|
|
475
491
|
..._,
|
|
476
492
|
className: "nice-setup-wizard__input",
|
|
477
|
-
value: String(
|
|
478
|
-
onChange: (
|
|
493
|
+
value: String(n),
|
|
494
|
+
onChange: (c) => a(c.target.value),
|
|
479
495
|
minLength: e.validation?.minLength,
|
|
480
496
|
maxLength: e.validation?.maxLength,
|
|
481
497
|
min: e.validation?.min,
|
|
@@ -484,106 +500,106 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
484
500
|
}
|
|
485
501
|
);
|
|
486
502
|
}
|
|
487
|
-
return /* @__PURE__ */
|
|
503
|
+
return /* @__PURE__ */ s(
|
|
488
504
|
"div",
|
|
489
505
|
{
|
|
490
506
|
className: `nice-setup-wizard__field${e.fullWidth ? " nice-setup-wizard__field--full" : ""}`,
|
|
491
507
|
children: [
|
|
492
|
-
e.type !== "checkbox" && e.type !== "switch" && /* @__PURE__ */
|
|
508
|
+
e.type !== "checkbox" && e.type !== "switch" && /* @__PURE__ */ s("label", { htmlFor: l, className: "nice-setup-wizard__label", children: [
|
|
493
509
|
e.label,
|
|
494
510
|
e.required && /* @__PURE__ */ i("span", { className: "nice-setup-wizard__required", children: "*" })
|
|
495
511
|
] }),
|
|
496
|
-
|
|
512
|
+
z,
|
|
497
513
|
e.description && /* @__PURE__ */ i("span", { className: "nice-setup-wizard__field-desc", children: e.description })
|
|
498
514
|
]
|
|
499
515
|
},
|
|
500
516
|
e.id
|
|
501
517
|
);
|
|
502
|
-
},
|
|
503
|
-
if (
|
|
518
|
+
}, mi = () => t.fields ? /* @__PURE__ */ i("div", { className: "nice-setup-wizard__fields", children: t.fields.map(pi) }) : t.content ? typeof t.content == "function" ? t.content(y) : t.content : null;
|
|
519
|
+
if (Se)
|
|
504
520
|
return null;
|
|
505
|
-
const
|
|
521
|
+
const Ae = fe || we || J, De = g.label ?? d("wizard.restart", "Start over"), hi = X || !t, He = /* @__PURE__ */ i(Qe.Provider, { value: y, children: /* @__PURE__ */ s(
|
|
506
522
|
"div",
|
|
507
523
|
{
|
|
508
|
-
ref:
|
|
509
|
-
id:
|
|
524
|
+
ref: oi,
|
|
525
|
+
id: Ce,
|
|
510
526
|
className: [
|
|
511
527
|
"nice-setup-wizard",
|
|
512
|
-
`nice-setup-wizard--${
|
|
513
|
-
`nice-size-${
|
|
514
|
-
|
|
515
|
-
|
|
528
|
+
`nice-setup-wizard--${q}`,
|
|
529
|
+
`nice-size-${P}`,
|
|
530
|
+
he !== "none" && `nice-setup-wizard--anim-${he}`,
|
|
531
|
+
ti
|
|
516
532
|
].filter(Boolean).join(" "),
|
|
517
|
-
style:
|
|
533
|
+
style: ge != null ? { height: ge, minHeight: 0, maxHeight: "none", boxSizing: "border-box", ...xe } : xe,
|
|
518
534
|
children: [
|
|
519
|
-
(
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
535
|
+
(V || ve || ue || Ae) && /* @__PURE__ */ s("header", { className: "nice-setup-wizard__header", children: [
|
|
536
|
+
V && /* @__PURE__ */ i("div", { className: "nice-setup-wizard__branding", children: V }),
|
|
537
|
+
Ae && /* @__PURE__ */ s("div", { className: "nice-setup-wizard__header-controls", children: [
|
|
538
|
+
fe && /* @__PURE__ */ i(Ci, { compact: !0, variant: "ghost", ...Ze }),
|
|
539
|
+
we && /* @__PURE__ */ i(Ii, { compact: !0, variant: "ghost", ...Ke }),
|
|
540
|
+
J && /* @__PURE__ */ i(
|
|
525
541
|
"button",
|
|
526
542
|
{
|
|
527
543
|
type: "button",
|
|
528
544
|
className: "nice-setup-wizard__icon-btn nice-setup-wizard__restart",
|
|
529
|
-
onClick:
|
|
530
|
-
title:
|
|
531
|
-
"aria-label":
|
|
532
|
-
children:
|
|
545
|
+
onClick: li,
|
|
546
|
+
title: De,
|
|
547
|
+
"aria-label": De,
|
|
548
|
+
children: g.icon ?? Li
|
|
533
549
|
}
|
|
534
550
|
)
|
|
535
551
|
] }),
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
/* @__PURE__ */ i("input", { type: "checkbox", checked:
|
|
539
|
-
/* @__PURE__ */ i("span", { children: p.quickMode ??
|
|
552
|
+
ve,
|
|
553
|
+
ue && /* @__PURE__ */ s("label", { className: "nice-setup-wizard__quick-toggle", children: [
|
|
554
|
+
/* @__PURE__ */ i("input", { type: "checkbox", checked: L, onChange: se }),
|
|
555
|
+
/* @__PURE__ */ i("span", { children: p.quickMode ?? d("wizard.quickMode", "Quick Setup") })
|
|
540
556
|
] }),
|
|
541
557
|
Ee && /* @__PURE__ */ i("span", { className: "nice-setup-wizard__time", children: Ee })
|
|
542
558
|
] }),
|
|
543
|
-
|
|
544
|
-
/* @__PURE__ */ i("div", { className: "nice-setup-wizard__loading-indicator", "aria-hidden": "true", children:
|
|
545
|
-
/* @__PURE__ */ i("div", { className: "nice-setup-wizard__loading-text", children:
|
|
546
|
-
] }) : /* @__PURE__ */
|
|
547
|
-
|
|
548
|
-
|
|
559
|
+
hi ? /* @__PURE__ */ s("div", { className: "nice-setup-wizard__loading", role: "status", "aria-busy": "true", children: [
|
|
560
|
+
/* @__PURE__ */ i("div", { className: "nice-setup-wizard__loading-indicator", "aria-hidden": "true", children: ni ?? /* @__PURE__ */ i(Si, { size: "lg" }) }),
|
|
561
|
+
/* @__PURE__ */ i("div", { className: "nice-setup-wizard__loading-text", children: ii ?? d("wizard.loading", "Loading…") })
|
|
562
|
+
] }) : /* @__PURE__ */ s(Q, { children: [
|
|
563
|
+
q !== "minimal" && /* @__PURE__ */ i("nav", { className: "nice-setup-wizard__nav", ref: ke, role: "tablist", children: r.map(ui) }),
|
|
564
|
+
Ue && /* @__PURE__ */ i("div", { className: "nice-setup-wizard__progress", children: /* @__PURE__ */ i(
|
|
549
565
|
"div",
|
|
550
566
|
{
|
|
551
567
|
className: "nice-setup-wizard__progress-bar",
|
|
552
|
-
style: { width: `${
|
|
568
|
+
style: { width: `${A}%` },
|
|
553
569
|
role: "progressbar",
|
|
554
|
-
"aria-valuenow":
|
|
570
|
+
"aria-valuenow": A,
|
|
555
571
|
"aria-valuemin": 0,
|
|
556
572
|
"aria-valuemax": 100
|
|
557
573
|
}
|
|
558
574
|
) }),
|
|
559
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ s(
|
|
560
576
|
"div",
|
|
561
577
|
{
|
|
562
578
|
className: [
|
|
563
579
|
"nice-setup-wizard__content",
|
|
564
|
-
|
|
565
|
-
|
|
580
|
+
Re === "next" && "nice-setup-wizard__content--slide-next",
|
|
581
|
+
Re === "prev" && "nice-setup-wizard__content--slide-prev"
|
|
566
582
|
].filter(Boolean).join(" "),
|
|
567
583
|
role: "tabpanel",
|
|
568
584
|
children: [
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
585
|
+
t.description && /* @__PURE__ */ i("p", { className: "nice-setup-wizard__step-description", children: t.description }),
|
|
586
|
+
mi(),
|
|
587
|
+
B[t.id] && /* @__PURE__ */ i("div", { className: "nice-setup-wizard__error", role: "alert", children: B[t.id] })
|
|
572
588
|
]
|
|
573
589
|
},
|
|
574
|
-
|
|
590
|
+
w
|
|
575
591
|
),
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
592
|
+
/* @__PURE__ */ s("footer", { className: "nice-setup-wizard__footer", children: [
|
|
593
|
+
/* @__PURE__ */ s("div", { className: "nice-setup-wizard__actions-left", children: [
|
|
594
|
+
U && /* @__PURE__ */ i("button", { type: "button", className: "nice-btn nice-btn--text", onClick: ce, children: p.cancel ?? d("wizard.cancel", "Cancel") }),
|
|
595
|
+
t.optional && !k && /* @__PURE__ */ i("button", { type: "button", className: "nice-btn nice-btn--text", onClick: re, children: p.skip ?? d("wizard.skip", "Skip") }),
|
|
596
|
+
t.actions?.filter((e) => e.position === "left").map((e) => /* @__PURE__ */ s(
|
|
581
597
|
"button",
|
|
582
598
|
{
|
|
583
599
|
type: "button",
|
|
584
600
|
className: `nice-btn nice-btn--${e.variant || "outlined"}`,
|
|
585
|
-
onClick: () => e.onClick(
|
|
586
|
-
disabled: e.disabled?.(
|
|
601
|
+
onClick: () => e.onClick(y),
|
|
602
|
+
disabled: e.disabled?.(y),
|
|
587
603
|
children: [
|
|
588
604
|
e.icon,
|
|
589
605
|
" ",
|
|
@@ -593,14 +609,14 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
593
609
|
e.id
|
|
594
610
|
))
|
|
595
611
|
] }),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
|
|
612
|
+
/* @__PURE__ */ s("div", { className: "nice-setup-wizard__actions-right", children: [
|
|
613
|
+
t.actions?.filter((e) => e.position !== "left").map((e) => /* @__PURE__ */ s(
|
|
598
614
|
"button",
|
|
599
615
|
{
|
|
600
616
|
type: "button",
|
|
601
617
|
className: `nice-btn nice-btn--${e.variant || "outlined"}`,
|
|
602
|
-
onClick: () => e.onClick(
|
|
603
|
-
disabled: e.disabled?.(
|
|
618
|
+
onClick: () => e.onClick(y),
|
|
619
|
+
disabled: e.disabled?.(y),
|
|
604
620
|
children: [
|
|
605
621
|
e.icon,
|
|
606
622
|
" ",
|
|
@@ -609,25 +625,25 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
609
625
|
},
|
|
610
626
|
e.id
|
|
611
627
|
)),
|
|
612
|
-
Fe && /* @__PURE__ */ i(
|
|
628
|
+
Fe && /* @__PURE__ */ i(Ge, { variant: "outline", size: P, onClick: G, children: p.prev ?? /* @__PURE__ */ s(Q, { children: [
|
|
613
629
|
/* @__PURE__ */ i(S, { name: "arrow-left", size: 14 }),
|
|
614
630
|
" ",
|
|
615
|
-
|
|
631
|
+
d("wizard.prev", "Back")
|
|
616
632
|
] }) }),
|
|
617
633
|
/* @__PURE__ */ i(
|
|
618
|
-
|
|
634
|
+
Ge,
|
|
619
635
|
{
|
|
620
636
|
variant: "primary",
|
|
621
|
-
size:
|
|
622
|
-
onClick:
|
|
623
|
-
disabled:
|
|
624
|
-
loading:
|
|
625
|
-
children:
|
|
626
|
-
|
|
637
|
+
size: P,
|
|
638
|
+
onClick: H,
|
|
639
|
+
disabled: Be || Me || !je,
|
|
640
|
+
loading: Be || Me,
|
|
641
|
+
children: t.nextLabel ?? (k ? p.finish ?? /* @__PURE__ */ s(Q, { children: [
|
|
642
|
+
d("wizard.finish", "Finish"),
|
|
627
643
|
" ",
|
|
628
644
|
/* @__PURE__ */ i(S, { name: "check", size: 14 })
|
|
629
|
-
] }) : p.next ?? /* @__PURE__ */
|
|
630
|
-
|
|
645
|
+
] }) : p.next ?? /* @__PURE__ */ s(Q, { children: [
|
|
646
|
+
d("wizard.next", "Continue"),
|
|
631
647
|
" ",
|
|
632
648
|
/* @__PURE__ */ i(S, { name: "arrow-right", size: 14 })
|
|
633
649
|
] }))
|
|
@@ -635,37 +651,37 @@ const Ii = /* @__PURE__ */ i(S, { name: "refresh", size: 18 }), Fi = /* @__PURE_
|
|
|
635
651
|
)
|
|
636
652
|
] })
|
|
637
653
|
] }),
|
|
638
|
-
|
|
639
|
-
|
|
654
|
+
ze && /* @__PURE__ */ i("div", { className: "nice-setup-wizard__custom-footer", children: ze }),
|
|
655
|
+
q === "minimal" && N.has(t.id) && /* @__PURE__ */ i("div", { className: "nice-setup-wizard__minimal-indicator", children: p.stepOf ? p.stepOf.replace("{current}", String(N.get(t.id))).replace("{total}", String(N.size)) : `${N.get(t.id)} / ${N.size}` })
|
|
640
656
|
] }),
|
|
641
|
-
|
|
642
|
-
|
|
657
|
+
J && !g.skipConfirm && /* @__PURE__ */ i(
|
|
658
|
+
yi,
|
|
643
659
|
{
|
|
644
|
-
visible:
|
|
660
|
+
visible: ri,
|
|
645
661
|
variant: "warning",
|
|
646
|
-
size:
|
|
647
|
-
header:
|
|
648
|
-
message:
|
|
662
|
+
size: P,
|
|
663
|
+
header: g.confirmTitle ?? d("wizard.restartConfirmTitle", "Start setup over?"),
|
|
664
|
+
message: g.confirmMessage ?? d(
|
|
649
665
|
"wizard.restartConfirmMessage",
|
|
650
666
|
"This will discard your progress and restart the setup from the beginning."
|
|
651
667
|
),
|
|
652
|
-
acceptLabel:
|
|
653
|
-
rejectLabel:
|
|
668
|
+
acceptLabel: g.confirmLabel ?? d("wizard.restartConfirmAccept", "Yes, start over"),
|
|
669
|
+
rejectLabel: g.cancelLabel ?? d("wizard.restartConfirmReject", "Cancel"),
|
|
654
670
|
onAccept: () => {
|
|
655
|
-
|
|
671
|
+
ne(!1), Y?.();
|
|
656
672
|
},
|
|
657
|
-
onReject: () =>
|
|
673
|
+
onReject: () => ne(!1)
|
|
658
674
|
}
|
|
659
675
|
)
|
|
660
676
|
]
|
|
661
677
|
}
|
|
662
678
|
) });
|
|
663
|
-
return
|
|
679
|
+
return _e != null ? /* @__PURE__ */ i(gi, { theme: _e, children: He }) : He;
|
|
664
680
|
}
|
|
665
681
|
),
|
|
666
682
|
{ displayName: "NiceSetupWizard" }
|
|
667
683
|
);
|
|
668
684
|
export {
|
|
669
|
-
|
|
670
|
-
|
|
685
|
+
ji as NiceSetupWizard,
|
|
686
|
+
Fi as useSetupWizard
|
|
671
687
|
};
|