unifyedx-storybook-new 0.1.91 → 0.1.95
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/unifyedx-storybook-new.css +1 -1
- package/dist/unifyedx-storybook-new.css.br +0 -0
- package/dist/unifyedx-storybook-new.css.gz +0 -0
- package/dist/unifyedx-storybook-new.es.js +372 -369
- package/dist/unifyedx-storybook-new.es.js.br +0 -0
- package/dist/unifyedx-storybook-new.es.js.gz +0 -0
- package/dist/{vendor-C8vzJvk7.js → vendor-YVj7HSWs.js} +4091 -4070
- package/dist/vendor-YVj7HSWs.js.br +0 -0
- package/dist/vendor-YVj7HSWs.js.gz +0 -0
- package/dist/{vendor-lodash-CvM7_34d.js → vendor-lodash-DkNZMlHW.js} +1 -1
- package/dist/vendor-lodash-DkNZMlHW.js.br +0 -0
- package/dist/vendor-lodash-DkNZMlHW.js.gz +0 -0
- package/package.json +5 -4
- package/dist/vendor-C8vzJvk7.js.br +0 -0
- package/dist/vendor-C8vzJvk7.js.gz +0 -0
- package/dist/vendor-lodash-CvM7_34d.js.br +0 -0
- package/dist/vendor-lodash-CvM7_34d.js.gz +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
2
|
import re, { useState as L, useMemo as ne, useId as Qe, Fragment as J, useEffect as Q, useCallback as K, useRef as ue } from "react";
|
|
3
|
-
import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, b as Me, f as Be, d as pa, D as ga, F as
|
|
4
|
-
import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as
|
|
3
|
+
import { a as W, U as lt, X as ge, P as _, L as ot, C as Le, b as Me, f as Be, d as pa, D as ga, F as it, e as ct, h as dt, T as Pe, u as ut, i as mt, I as ht, j as pt, k as gt, l as yt, m as ft, n as bt, S as ya, o as fa, M as vt, p as Nt, q as ba, r as xt, A as kt, s as wt, E as Ct, t as St, v as Dt, w as $t, x as Ft, y as va, z as Tt, B as Na, G as xa, H as At, J as Et, K as Rt, N as Oe, O as Xe, Q as Ze, R as It, V as zt, W as ka, Y as Bt, Z as ea, _ as Pt, $ as Ot, a0 as wa, a1 as Lt, a2 as Mt, a3 as Vt, a4 as Ut, a5 as qt, a6 as jt, a7 as Gt, a8 as _t, a9 as Yt, aa as Wt, ab as Jt, ac as Qt, ad as Xt, ae as Zt, af as Ht } from "./vendor-YVj7HSWs.js";
|
|
4
|
+
import { Popover as Kt, PopoverButton as er, PopoverPanel as ar, Transition as oe, Dialog as me, TransitionChild as pe, DialogPanel as ke, DialogTitle as Ve, TabGroup as tr, TabList as rr, Tab as ae, TabPanels as nr, RadioGroup as Te, Listbox as X, ListboxButton as sr, ListboxOptions as lr, ListboxOption as or, SwitchGroup as ir, Switch as Ye, Menu as cr, MenuButton as dr, Portal as ur, MenuItems as mr, MenuItem as hr, DialogBackdrop as pr } from "@headlessui/react";
|
|
5
5
|
import { motion as te, AnimatePresence as fe } from "framer-motion";
|
|
6
|
-
import { d as gr } from "./vendor-lodash-
|
|
6
|
+
import { d as gr } from "./vendor-lodash-DkNZMlHW.js";
|
|
7
7
|
import { useFloating as Ca, offset as Sa, flip as Da, shift as $a, autoUpdate as Fa, useClick as yr, useDismiss as fr, useInteractions as br, FloatingPortal as vr } from "@floating-ui/react";
|
|
8
8
|
import We, { debounce as Nr } from "lodash";
|
|
9
9
|
import { toast as le, ToastContainer as xr, Slide as kr } from "react-toastify";
|
|
@@ -15,7 +15,7 @@ const Or = (t) => {
|
|
|
15
15
|
r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
|
|
16
16
|
return r >>> 0;
|
|
17
17
|
}, Lr = (t) => {
|
|
18
|
-
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20,
|
|
18
|
+
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Or(r), n = (o % 360 + 37 * s) % 360, u = 55 + (o >>> 8) % 20, i = 30 + (o >>> 16) % 10, c = 86 + (o >>> 24) % 8, y = `hsl(${n}, ${u}%, ${c}%)`, b = `hsl(${n}, ${u}%, ${i}%)`;
|
|
19
19
|
return { bg: y, text: b };
|
|
20
20
|
}, Mr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), Ta = ({
|
|
21
21
|
src: t,
|
|
@@ -27,9 +27,9 @@ const Or = (t) => {
|
|
|
27
27
|
textColor: n,
|
|
28
28
|
// ✅ New prop for text/icon color
|
|
29
29
|
className: u,
|
|
30
|
-
...
|
|
30
|
+
...i
|
|
31
31
|
}) => {
|
|
32
|
-
const [
|
|
32
|
+
const [c, y] = L(!1), b = ne(() => Lr(r), []), N = t && !c, a = !N && r, w = !N && !r, m = W(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
@@ -37,7 +37,7 @@ const Or = (t) => {
|
|
|
37
37
|
return /* @__PURE__ */ l("div", { className: m, style: {
|
|
38
38
|
backgroundColor: g,
|
|
39
39
|
color: $
|
|
40
|
-
}, ...
|
|
40
|
+
}, ...i, children: [
|
|
41
41
|
N && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
@@ -51,12 +51,12 @@ const Or = (t) => {
|
|
|
51
51
|
w && /* @__PURE__ */ e("span", { className: "avatar-icon", children: /* @__PURE__ */ e(lt, {}) })
|
|
52
52
|
] });
|
|
53
53
|
}, Wn = ({ children: t, max: r = 4, truncatedMessage: s = "Members", ...o }) => {
|
|
54
|
-
const n = re.Children.toArray(t), u = n.slice(0, r),
|
|
54
|
+
const n = re.Children.toArray(t), u = n.slice(0, r), i = n.length - r;
|
|
55
55
|
return /* @__PURE__ */ l("div", { className: "avatar-group-container", ...o, children: [
|
|
56
56
|
u,
|
|
57
|
-
|
|
57
|
+
i > 0 && /* @__PURE__ */ l("div", { className: "avatar-container avatar--size-medium avatar-excess", children: [
|
|
58
58
|
"+",
|
|
59
|
-
|
|
59
|
+
i,
|
|
60
60
|
" ",
|
|
61
61
|
s
|
|
62
62
|
] })
|
|
@@ -70,8 +70,8 @@ const Or = (t) => {
|
|
|
70
70
|
icon: o,
|
|
71
71
|
onRemove: n,
|
|
72
72
|
bgColor: u,
|
|
73
|
-
textColor:
|
|
74
|
-
className:
|
|
73
|
+
textColor: i,
|
|
74
|
+
className: c,
|
|
75
75
|
...y
|
|
76
76
|
}) => {
|
|
77
77
|
const b = W(
|
|
@@ -79,11 +79,11 @@ const Or = (t) => {
|
|
|
79
79
|
`badge--variant-${r}`,
|
|
80
80
|
`badge--size-${s}`,
|
|
81
81
|
{ "badge--with-remove": !!n },
|
|
82
|
-
|
|
82
|
+
c
|
|
83
83
|
);
|
|
84
|
-
return /* @__PURE__ */ l("span", { className: b, style: u &&
|
|
84
|
+
return /* @__PURE__ */ l("span", { className: b, style: u && i ? {
|
|
85
85
|
backgroundColor: u,
|
|
86
|
-
color:
|
|
86
|
+
color: i,
|
|
87
87
|
borderColor: "#ff0000"
|
|
88
88
|
} : {}, ...y, children: [
|
|
89
89
|
o && /* @__PURE__ */ e(o, { className: "badge-icon" }),
|
|
@@ -145,8 +145,8 @@ const Ur = {
|
|
|
145
145
|
className: n = "",
|
|
146
146
|
// ✅ Default is now empty
|
|
147
147
|
loader: u = !1,
|
|
148
|
-
category:
|
|
149
|
-
icon:
|
|
148
|
+
category: i = "primary",
|
|
149
|
+
icon: c,
|
|
150
150
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
151
|
disabled: y = !1,
|
|
152
152
|
size: b = "medium",
|
|
@@ -156,10 +156,10 @@ const Ur = {
|
|
|
156
156
|
onClick: w,
|
|
157
157
|
...m
|
|
158
158
|
}) => {
|
|
159
|
-
const g = y || u, $ =
|
|
159
|
+
const g = y || u, $ = c && !N, O = W(
|
|
160
160
|
"btn-base",
|
|
161
161
|
Ur[b],
|
|
162
|
-
qr[
|
|
162
|
+
qr[i],
|
|
163
163
|
{
|
|
164
164
|
"is-loading": u,
|
|
165
165
|
"btn-icon-only": $
|
|
@@ -178,7 +178,7 @@ const Ur = {
|
|
|
178
178
|
"aria-label": o || $ && r || (typeof N == "string" ? N : void 0),
|
|
179
179
|
...m,
|
|
180
180
|
children: u ? /* @__PURE__ */ e(ot, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
|
|
181
|
-
|
|
181
|
+
c && /* @__PURE__ */ e(c, { size: b === "large" ? 20 : 16 }),
|
|
182
182
|
N,
|
|
183
183
|
a,
|
|
184
184
|
" "
|
|
@@ -215,8 +215,8 @@ const Ur = {
|
|
|
215
215
|
className: o,
|
|
216
216
|
ref: n,
|
|
217
217
|
checked: u,
|
|
218
|
-
onChange:
|
|
219
|
-
...
|
|
218
|
+
onChange: i,
|
|
219
|
+
...c
|
|
220
220
|
}) => {
|
|
221
221
|
const y = Qe(), b = r || y;
|
|
222
222
|
return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
|
|
@@ -229,8 +229,8 @@ const Ur = {
|
|
|
229
229
|
ref: n,
|
|
230
230
|
className: "checkbox-input",
|
|
231
231
|
checked: u,
|
|
232
|
-
onChange:
|
|
233
|
-
...
|
|
232
|
+
onChange: i,
|
|
233
|
+
...c
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
236
|
/* @__PURE__ */ e(
|
|
@@ -255,14 +255,14 @@ const Ur = {
|
|
|
255
255
|
placeholder: o = "Select a date",
|
|
256
256
|
label: n,
|
|
257
257
|
error: u,
|
|
258
|
-
disabled:
|
|
259
|
-
className:
|
|
258
|
+
disabled: i = !1,
|
|
259
|
+
className: c,
|
|
260
260
|
...y
|
|
261
261
|
}) => {
|
|
262
262
|
const b = (N) => {
|
|
263
263
|
N.stopPropagation(), N.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
|
-
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper",
|
|
265
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", c), children: [
|
|
266
266
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
|
|
267
267
|
/* @__PURE__ */ l(Ea, { children: [
|
|
268
268
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -273,9 +273,9 @@ const Ur = {
|
|
|
273
273
|
type: "button",
|
|
274
274
|
className: W("datepicker-trigger", {
|
|
275
275
|
"datepicker-trigger--error": !!u,
|
|
276
|
-
"datepicker-trigger--disabled":
|
|
276
|
+
"datepicker-trigger--disabled": i
|
|
277
277
|
}),
|
|
278
|
-
disabled:
|
|
278
|
+
disabled: i,
|
|
279
279
|
"aria-label": t ? `Selected date is ${Be(t, "PPP")}` : o,
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
|
|
@@ -283,7 +283,7 @@ const Ur = {
|
|
|
283
283
|
]
|
|
284
284
|
}
|
|
285
285
|
),
|
|
286
|
-
t && s && !
|
|
286
|
+
t && s && !i && /* @__PURE__ */ e(
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
@@ -301,7 +301,7 @@ const Ur = {
|
|
|
301
301
|
selected: t,
|
|
302
302
|
onSelect: r,
|
|
303
303
|
initialFocus: !0,
|
|
304
|
-
disabled:
|
|
304
|
+
disabled: i,
|
|
305
305
|
...y
|
|
306
306
|
}
|
|
307
307
|
) })
|
|
@@ -315,8 +315,8 @@ const Ur = {
|
|
|
315
315
|
placeholder: o = "Select a date range",
|
|
316
316
|
label: n,
|
|
317
317
|
error: u,
|
|
318
|
-
disabled:
|
|
319
|
-
className:
|
|
318
|
+
disabled: i = !1,
|
|
319
|
+
className: c,
|
|
320
320
|
...y
|
|
321
321
|
}) => {
|
|
322
322
|
const b = t?.from, N = t?.to, a = (m) => {
|
|
@@ -326,7 +326,7 @@ const Ur = {
|
|
|
326
326
|
" - ",
|
|
327
327
|
Be(N, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
329
|
-
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper",
|
|
329
|
+
return /* @__PURE__ */ l("div", { className: W("datepicker-wrapper", c), children: [
|
|
330
330
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
|
|
331
331
|
/* @__PURE__ */ l(Ea, { children: [
|
|
332
332
|
/* @__PURE__ */ e(Ra, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -337,9 +337,9 @@ const Ur = {
|
|
|
337
337
|
type: "button",
|
|
338
338
|
className: W("datepicker-trigger", {
|
|
339
339
|
"datepicker-trigger--error": !!u,
|
|
340
|
-
"datepicker-trigger--disabled":
|
|
340
|
+
"datepicker-trigger--disabled": i
|
|
341
341
|
}),
|
|
342
|
-
disabled:
|
|
342
|
+
disabled: i,
|
|
343
343
|
"aria-label": b && N ? `Selected range is ${w}` : o,
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ e(pa, { className: "datepicker-icon" }),
|
|
@@ -347,7 +347,7 @@ const Ur = {
|
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
b && s && !
|
|
350
|
+
b && s && !i && /* @__PURE__ */ e(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
type: "button",
|
|
@@ -366,7 +366,7 @@ const Ur = {
|
|
|
366
366
|
onSelect: r,
|
|
367
367
|
numberOfMonths: 2,
|
|
368
368
|
initialFocus: !0,
|
|
369
|
-
disabled:
|
|
369
|
+
disabled: i,
|
|
370
370
|
...y
|
|
371
371
|
}
|
|
372
372
|
) })
|
|
@@ -591,7 +591,7 @@ const Ur = {
|
|
|
591
591
|
}, sa = ({ extension: t, size: r = 36 }) => {
|
|
592
592
|
const s = (t || "").toLowerCase(), o = _r[s];
|
|
593
593
|
return o ? /* @__PURE__ */ e("div", { style: { width: r }, className: "flex-shrink-0", children: /* @__PURE__ */ e(
|
|
594
|
-
|
|
594
|
+
it,
|
|
595
595
|
{
|
|
596
596
|
extension: s,
|
|
597
597
|
...o,
|
|
@@ -607,7 +607,7 @@ const Ur = {
|
|
|
607
607
|
{
|
|
608
608
|
style: { width: r, height: r },
|
|
609
609
|
className: "flex items-center justify-center bg-gray-100 rounded-sm border border-gray-300",
|
|
610
|
-
children: /* @__PURE__ */ e(
|
|
610
|
+
children: /* @__PURE__ */ e(ct, { className: "text-gray-400", size: r * 0.75 })
|
|
611
611
|
}
|
|
612
612
|
);
|
|
613
613
|
}, la = (t, r = 2) => {
|
|
@@ -624,8 +624,8 @@ const Ur = {
|
|
|
624
624
|
isDragActive: n,
|
|
625
625
|
open: u,
|
|
626
626
|
// --- Form and File State ---
|
|
627
|
-
validFiles:
|
|
628
|
-
rejectedFiles:
|
|
627
|
+
validFiles: i = [],
|
|
628
|
+
rejectedFiles: c = [],
|
|
629
629
|
handleRemoveValidFile: y,
|
|
630
630
|
handleRemoveRejectedFile: b,
|
|
631
631
|
handleSubmit: N,
|
|
@@ -635,7 +635,7 @@ const Ur = {
|
|
|
635
635
|
title: m = "Upload Files",
|
|
636
636
|
subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
|
-
const $ =
|
|
638
|
+
const $ = i.length > 0 || c.length > 0;
|
|
639
639
|
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: J, children: /* @__PURE__ */ l(
|
|
640
640
|
me,
|
|
641
641
|
{
|
|
@@ -714,7 +714,7 @@ const Ur = {
|
|
|
714
714
|
$ && /* @__PURE__ */ l("div", { className: "file-list-container", children: [
|
|
715
715
|
/* @__PURE__ */ e("h3", { children: "Upload Queue" }),
|
|
716
716
|
/* @__PURE__ */ l("ul", { className: "file-list", children: [
|
|
717
|
-
|
|
717
|
+
i.map((O, R) => /* @__PURE__ */ l(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item",
|
|
@@ -744,7 +744,7 @@ const Ur = {
|
|
|
744
744
|
},
|
|
745
745
|
`${O.name}-${R}`
|
|
746
746
|
)),
|
|
747
|
-
|
|
747
|
+
c.map(({ file: O, message: R }, S) => /* @__PURE__ */ l(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -794,7 +794,7 @@ const Ur = {
|
|
|
794
794
|
type: "submit",
|
|
795
795
|
label: a ? "Uploading..." : "Upload Files",
|
|
796
796
|
loader: a,
|
|
797
|
-
disabled:
|
|
797
|
+
disabled: i.length === 0 || a
|
|
798
798
|
}
|
|
799
799
|
)
|
|
800
800
|
] })
|
|
@@ -814,10 +814,10 @@ const Ur = {
|
|
|
814
814
|
resetFilters: o,
|
|
815
815
|
filterConfig: n = [],
|
|
816
816
|
initialFormikValues: u,
|
|
817
|
-
fetchCreatedOrUpdatedByUsers:
|
|
817
|
+
fetchCreatedOrUpdatedByUsers: i = async () => []
|
|
818
818
|
// Mockable fetcher
|
|
819
819
|
}) => {
|
|
820
|
-
const [
|
|
820
|
+
const [c, y] = L({
|
|
821
821
|
createdBy: [],
|
|
822
822
|
updatedBy: []
|
|
823
823
|
}), [b, N] = L({
|
|
@@ -857,7 +857,7 @@ const Ur = {
|
|
|
857
857
|
}, {}), [n, a.values]), m = Object.values(w).filter(Boolean).length, g = async (S, B) => {
|
|
858
858
|
try {
|
|
859
859
|
N((E) => ({ ...E, [S]: !0 }));
|
|
860
|
-
const P = await
|
|
860
|
+
const P = await i(S, B);
|
|
861
861
|
y((E) => ({ ...E, [S]: P }));
|
|
862
862
|
} catch (P) {
|
|
863
863
|
console.error(`Error fetching ${S} users:`, P);
|
|
@@ -866,7 +866,7 @@ const Ur = {
|
|
|
866
866
|
}
|
|
867
867
|
}, $ = (S) => {
|
|
868
868
|
const B = n[S].key, P = n[S].url;
|
|
869
|
-
n[S].type === "multiselect-users" &&
|
|
869
|
+
n[S].type === "multiselect-users" && c[B].length === 0 && !b[B] && g(B, P);
|
|
870
870
|
}, O = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
872
|
}, R = (S) => {
|
|
@@ -938,7 +938,7 @@ const Ur = {
|
|
|
938
938
|
] })
|
|
939
939
|
] });
|
|
940
940
|
case "multiselect-users":
|
|
941
|
-
const V =
|
|
941
|
+
const V = c[S] || [], U = b[S];
|
|
942
942
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
943
943
|
/* @__PURE__ */ l("div", { className: "filter-operator-group", children: [
|
|
944
944
|
/* @__PURE__ */ e("label", { className: "filter-label", children: "Operator:" }),
|
|
@@ -979,7 +979,7 @@ const Ur = {
|
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
982
|
+
V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
|
|
983
983
|
/* @__PURE__ */ e(
|
|
984
984
|
"input",
|
|
985
985
|
{
|
|
@@ -1117,14 +1117,17 @@ const Ur = {
|
|
|
1117
1117
|
},
|
|
1118
1118
|
children: [
|
|
1119
1119
|
/* @__PURE__ */ e(rr, { className: "filter-tabs-list", children: n.map((S) => /* @__PURE__ */ l(ae, { className: "filter-tab-item", children: [
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1120
|
+
/* @__PURE__ */ e("div", { className: "filter-selection-horizontal-indicator" }),
|
|
1121
|
+
/* @__PURE__ */ l("div", { className: "filter-lbl-indicator-wrapper", children: [
|
|
1122
|
+
S.label,
|
|
1123
|
+
w[S.key] && /* @__PURE__ */ e(
|
|
1124
|
+
"span",
|
|
1125
|
+
{
|
|
1126
|
+
className: "filter-active-indicator",
|
|
1127
|
+
title: "Filter active"
|
|
1128
|
+
}
|
|
1129
|
+
)
|
|
1130
|
+
] })
|
|
1128
1131
|
] }, S.key)) }),
|
|
1129
1132
|
/* @__PURE__ */ e(nr, { className: "filter-tabs-panels", children: n.map((S) => /* @__PURE__ */ e(
|
|
1130
1133
|
ae.Panel,
|
|
@@ -1183,11 +1186,11 @@ const Ur = {
|
|
|
1183
1186
|
icon: o,
|
|
1184
1187
|
error: n,
|
|
1185
1188
|
className: u,
|
|
1186
|
-
ref:
|
|
1189
|
+
ref: i,
|
|
1187
1190
|
// ✅ 'ref' is now received directly as a prop
|
|
1188
|
-
...
|
|
1191
|
+
...c
|
|
1189
1192
|
}) => {
|
|
1190
|
-
const y = r ||
|
|
1193
|
+
const y = r || c.name;
|
|
1191
1194
|
return /* @__PURE__ */ l("div", { className: `input-wrapper ${u || ""}`, children: [
|
|
1192
1195
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "input-label", children: t }),
|
|
1193
1196
|
/* @__PURE__ */ l("div", { className: "input-field-container", children: [
|
|
@@ -1197,12 +1200,12 @@ const Ur = {
|
|
|
1197
1200
|
{
|
|
1198
1201
|
id: y,
|
|
1199
1202
|
type: s,
|
|
1200
|
-
ref:
|
|
1203
|
+
ref: i,
|
|
1201
1204
|
className: W("input-field", {
|
|
1202
1205
|
"input-field--error": !!n,
|
|
1203
1206
|
"input-field--with-icon": !!o
|
|
1204
1207
|
}),
|
|
1205
|
-
...
|
|
1208
|
+
...c
|
|
1206
1209
|
}
|
|
1207
1210
|
)
|
|
1208
1211
|
] }),
|
|
@@ -1234,12 +1237,12 @@ const Ur = {
|
|
|
1234
1237
|
// For the description/body content
|
|
1235
1238
|
primaryButtonText: n = "Confirm",
|
|
1236
1239
|
secondaryButtonText: u = "Cancel",
|
|
1237
|
-
variant:
|
|
1240
|
+
variant: i = "info",
|
|
1238
1241
|
// 'info', 'warning', 'delete'
|
|
1239
|
-
loading:
|
|
1242
|
+
loading: c = !1,
|
|
1240
1243
|
buttonProps: y = {}
|
|
1241
1244
|
}) => {
|
|
1242
|
-
const b = oa[
|
|
1245
|
+
const b = oa[i] || oa.info, N = b.icon, a = () => {
|
|
1243
1246
|
r({ primary: !0, secondary: !1 });
|
|
1244
1247
|
}, w = () => {
|
|
1245
1248
|
r({ primary: !1, secondary: !0 });
|
|
@@ -1306,14 +1309,14 @@ const Ur = {
|
|
|
1306
1309
|
onItemsPerPageChange: n,
|
|
1307
1310
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1308
1311
|
}) => {
|
|
1309
|
-
const
|
|
1312
|
+
const i = Math.ceil(r / s), [c, y] = L(t);
|
|
1310
1313
|
Q(() => {
|
|
1311
1314
|
y(t);
|
|
1312
1315
|
}, [t]);
|
|
1313
1316
|
const b = Math.min((t - 1) * s + 1, r), N = Math.min(t * s, r), a = (w) => {
|
|
1314
1317
|
w.preventDefault();
|
|
1315
|
-
let m = parseInt(
|
|
1316
|
-
isNaN(m) || m < 1 ? m = 1 : m >
|
|
1318
|
+
let m = parseInt(c, 10);
|
|
1319
|
+
isNaN(m) || m < 1 ? m = 1 : m > i && (m = i), y(m), m !== t && o(m);
|
|
1317
1320
|
};
|
|
1318
1321
|
return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
|
|
1319
1322
|
/* @__PURE__ */ l("div", { className: "pagination-left", children: [
|
|
@@ -1363,7 +1366,7 @@ const Ur = {
|
|
|
1363
1366
|
{
|
|
1364
1367
|
type: "number",
|
|
1365
1368
|
className: "page-input",
|
|
1366
|
-
value:
|
|
1369
|
+
value: c,
|
|
1367
1370
|
onChange: (w) => y(w.target.value),
|
|
1368
1371
|
onBlur: a,
|
|
1369
1372
|
"aria-label": `Current page, Page ${t}`
|
|
@@ -1371,7 +1374,7 @@ const Ur = {
|
|
|
1371
1374
|
),
|
|
1372
1375
|
/* @__PURE__ */ l("span", { className: "page-input-total", children: [
|
|
1373
1376
|
"of ",
|
|
1374
|
-
|
|
1377
|
+
i
|
|
1375
1378
|
] })
|
|
1376
1379
|
] }),
|
|
1377
1380
|
/* @__PURE__ */ e(
|
|
@@ -1379,7 +1382,7 @@ const Ur = {
|
|
|
1379
1382
|
{
|
|
1380
1383
|
className: "pagination-button",
|
|
1381
1384
|
onClick: () => o(t + 1),
|
|
1382
|
-
disabled: t ===
|
|
1385
|
+
disabled: t === i,
|
|
1383
1386
|
children: /* @__PURE__ */ e(Le, { size: 16 })
|
|
1384
1387
|
}
|
|
1385
1388
|
),
|
|
@@ -1387,8 +1390,8 @@ const Ur = {
|
|
|
1387
1390
|
"button",
|
|
1388
1391
|
{
|
|
1389
1392
|
className: "pagination-button",
|
|
1390
|
-
onClick: () => o(
|
|
1391
|
-
disabled: t ===
|
|
1393
|
+
onClick: () => o(i),
|
|
1394
|
+
disabled: t === i,
|
|
1392
1395
|
children: /* @__PURE__ */ e(ft, { size: 16 })
|
|
1393
1396
|
}
|
|
1394
1397
|
)
|
|
@@ -1411,31 +1414,31 @@ const Ur = {
|
|
|
1411
1414
|
onChange: s,
|
|
1412
1415
|
className: "radiogroup-container",
|
|
1413
1416
|
...u,
|
|
1414
|
-
children: o.map((
|
|
1417
|
+
children: o.map((i) => /* @__PURE__ */ e(
|
|
1415
1418
|
Te.Option,
|
|
1416
1419
|
{
|
|
1417
|
-
value:
|
|
1418
|
-
className: ({ active:
|
|
1419
|
-
"radiogroup-option--active":
|
|
1420
|
+
value: i.value,
|
|
1421
|
+
className: ({ active: c, checked: y }) => W("radiogroup-option", {
|
|
1422
|
+
"radiogroup-option--active": c,
|
|
1420
1423
|
"radiogroup-option--checked": y,
|
|
1421
1424
|
"radiogroup-option--error": !!n
|
|
1422
1425
|
}),
|
|
1423
|
-
children: ({ checked:
|
|
1426
|
+
children: ({ checked: c }) => /* @__PURE__ */ l(ee, { children: [
|
|
1424
1427
|
/* @__PURE__ */ l("div", { className: "radiogroup-option-content", children: [
|
|
1425
|
-
/* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children:
|
|
1426
|
-
|
|
1428
|
+
/* @__PURE__ */ e(Te.Label, { as: "p", className: "option-label", children: i.label }),
|
|
1429
|
+
i.description && /* @__PURE__ */ e(
|
|
1427
1430
|
Te.Description,
|
|
1428
1431
|
{
|
|
1429
1432
|
as: "span",
|
|
1430
1433
|
className: "option-description",
|
|
1431
|
-
children:
|
|
1434
|
+
children: i.description
|
|
1432
1435
|
}
|
|
1433
1436
|
)
|
|
1434
1437
|
] }),
|
|
1435
|
-
|
|
1438
|
+
c && /* @__PURE__ */ e("div", { className: "option-checkmark", children: /* @__PURE__ */ e(bt, { size: 20 }) })
|
|
1436
1439
|
] })
|
|
1437
1440
|
},
|
|
1438
|
-
|
|
1441
|
+
i.value
|
|
1439
1442
|
))
|
|
1440
1443
|
}
|
|
1441
1444
|
),
|
|
@@ -1448,9 +1451,9 @@ const Ur = {
|
|
|
1448
1451
|
label: n = "Search",
|
|
1449
1452
|
// Added a default label for accessibility
|
|
1450
1453
|
customClass: u = "",
|
|
1451
|
-
...
|
|
1454
|
+
...i
|
|
1452
1455
|
}) => {
|
|
1453
|
-
const [
|
|
1456
|
+
const [c, y] = L(t);
|
|
1454
1457
|
Q(() => {
|
|
1455
1458
|
y(t);
|
|
1456
1459
|
}, [t]);
|
|
@@ -1460,9 +1463,9 @@ const Ur = {
|
|
|
1460
1463
|
}, s),
|
|
1461
1464
|
[s, r]
|
|
1462
1465
|
);
|
|
1463
|
-
Q(() => (
|
|
1466
|
+
Q(() => (c !== t && b(c), () => {
|
|
1464
1467
|
b.cancel();
|
|
1465
|
-
}), [
|
|
1468
|
+
}), [c, b, t]);
|
|
1466
1469
|
const N = (a) => {
|
|
1467
1470
|
y(a.target.value);
|
|
1468
1471
|
};
|
|
@@ -1477,9 +1480,9 @@ const Ur = {
|
|
|
1477
1480
|
placeholder: o,
|
|
1478
1481
|
type: "search",
|
|
1479
1482
|
name: "search",
|
|
1480
|
-
value:
|
|
1483
|
+
value: c,
|
|
1481
1484
|
onChange: N,
|
|
1482
|
-
...
|
|
1485
|
+
...i
|
|
1483
1486
|
}
|
|
1484
1487
|
)
|
|
1485
1488
|
] });
|
|
@@ -1492,22 +1495,22 @@ const Ur = {
|
|
|
1492
1495
|
options: o = [],
|
|
1493
1496
|
placeholder: n = "Select an option...",
|
|
1494
1497
|
disabled: u = !1,
|
|
1495
|
-
error:
|
|
1496
|
-
ref:
|
|
1498
|
+
error: i,
|
|
1499
|
+
ref: c,
|
|
1497
1500
|
// From RHF's <Controller>
|
|
1498
1501
|
showSearch: y = !0
|
|
1499
1502
|
}) => {
|
|
1500
1503
|
const [b, N] = L(""), a = b === "" ? o : o.filter(
|
|
1501
1504
|
(m) => m.label.toLowerCase().includes(b.toLowerCase())
|
|
1502
1505
|
), w = o.find((m) => r?.id ? m.id === r.id : m.id === r || m.value === r);
|
|
1503
|
-
return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref:
|
|
1506
|
+
return /* @__PURE__ */ e(X, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: c, children: [
|
|
1504
1507
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1505
1508
|
/* @__PURE__ */ l("div", { className: "select-button-container", children: [
|
|
1506
1509
|
/* @__PURE__ */ l(
|
|
1507
1510
|
sr,
|
|
1508
1511
|
{
|
|
1509
1512
|
className: W("select-button", {
|
|
1510
|
-
"select-button--error": !!
|
|
1513
|
+
"select-button--error": !!i
|
|
1511
1514
|
}),
|
|
1512
1515
|
children: [
|
|
1513
1516
|
/* @__PURE__ */ e("span", { className: "select-value-display", children: w ? w.label : /* @__PURE__ */ e("span", { className: "placeholder", children: n }) }),
|
|
@@ -1561,7 +1564,7 @@ const Ur = {
|
|
|
1561
1564
|
}
|
|
1562
1565
|
)
|
|
1563
1566
|
] }),
|
|
1564
|
-
|
|
1567
|
+
i && /* @__PURE__ */ e("p", { className: "select-error-message", children: i })
|
|
1565
1568
|
] }) });
|
|
1566
1569
|
}, Wr = () => {
|
|
1567
1570
|
const [t, r] = L(window.location.pathname);
|
|
@@ -1579,12 +1582,12 @@ const Ur = {
|
|
|
1579
1582
|
return s;
|
|
1580
1583
|
return null;
|
|
1581
1584
|
}, Pa = ({ item: t, isCollapsed: r, level: s = 0 }) => {
|
|
1582
|
-
const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u,
|
|
1585
|
+
const { pathname: o } = Wr(), n = t.href || t.url || t.path, [u, i] = L(!1), c = t.icon;
|
|
1583
1586
|
Q(() => {
|
|
1584
|
-
Ke([t], o) &&
|
|
1587
|
+
Ke([t], o) && i(!0);
|
|
1585
1588
|
}, [t, o]);
|
|
1586
1589
|
const y = o === n, b = !y && !!Ke([t], o), N = (a) => {
|
|
1587
|
-
a.preventDefault(),
|
|
1590
|
+
a.preventDefault(), i(!u);
|
|
1588
1591
|
};
|
|
1589
1592
|
return /* @__PURE__ */ l(
|
|
1590
1593
|
"div",
|
|
@@ -1606,7 +1609,7 @@ const Ur = {
|
|
|
1606
1609
|
}),
|
|
1607
1610
|
"aria-current": y ? "page" : void 0,
|
|
1608
1611
|
children: [
|
|
1609
|
-
|
|
1612
|
+
c && /* @__PURE__ */ e(c, { className: "nav-icon", "aria-hidden": "true" }),
|
|
1610
1613
|
/* @__PURE__ */ e("span", { className: "nav-label", children: t.label || t.name }),
|
|
1611
1614
|
t.children && /* @__PURE__ */ e(
|
|
1612
1615
|
"button",
|
|
@@ -1657,8 +1660,8 @@ const Ur = {
|
|
|
1657
1660
|
isMobileOpen: o = !1,
|
|
1658
1661
|
onToggleMobile: n,
|
|
1659
1662
|
logoSmall: u,
|
|
1660
|
-
logoLarge:
|
|
1661
|
-
user:
|
|
1663
|
+
logoLarge: i,
|
|
1664
|
+
user: c = { name: "", email: "" }
|
|
1662
1665
|
}) => /* @__PURE__ */ l(ee, { children: [
|
|
1663
1666
|
o && /* @__PURE__ */ e(
|
|
1664
1667
|
"div",
|
|
@@ -1678,7 +1681,7 @@ const Ur = {
|
|
|
1678
1681
|
"aria-label": "Main navigation",
|
|
1679
1682
|
children: [
|
|
1680
1683
|
/* @__PURE__ */ l("div", { className: "sidebar-header", children: [
|
|
1681
|
-
/* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u :
|
|
1684
|
+
/* @__PURE__ */ e("div", { className: "sidebar-logo", children: r ? u : i }),
|
|
1682
1685
|
!r && /* @__PURE__ */ l("div", { className: "sidebar-search-container", children: [
|
|
1683
1686
|
/* @__PURE__ */ e(ya, { className: "sidebar-search-icon" }),
|
|
1684
1687
|
/* @__PURE__ */ e(
|
|
@@ -1703,10 +1706,10 @@ const Ur = {
|
|
|
1703
1706
|
] }),
|
|
1704
1707
|
/* @__PURE__ */ e("nav", { className: "sidebar-nav", "aria-label": "Primary", children: /* @__PURE__ */ e("ul", { className: "sidebar-nav-list", children: t.map((y) => /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(Pa, { item: y, isCollapsed: r }) }, y.label || y.name)) }) }),
|
|
1705
1708
|
/* @__PURE__ */ l("div", { className: "sidebar-footer", children: [
|
|
1706
|
-
/* @__PURE__ */ e(Ta, { src:
|
|
1709
|
+
/* @__PURE__ */ e(Ta, { src: c.avatar, name: c.name, size: "medium" }),
|
|
1707
1710
|
/* @__PURE__ */ l("div", { className: "user-info", children: [
|
|
1708
|
-
/* @__PURE__ */ e("span", { className: "user-name", children:
|
|
1709
|
-
/* @__PURE__ */ e("span", { className: "user-email", children:
|
|
1711
|
+
/* @__PURE__ */ e("span", { className: "user-name", children: c.name }),
|
|
1712
|
+
/* @__PURE__ */ e("span", { className: "user-email", children: c.email })
|
|
1710
1713
|
] }),
|
|
1711
1714
|
/* @__PURE__ */ e(
|
|
1712
1715
|
"button",
|
|
@@ -1765,19 +1768,19 @@ const Ur = {
|
|
|
1765
1768
|
ref: n,
|
|
1766
1769
|
maxLength: u,
|
|
1767
1770
|
// ✅ New prop for max length
|
|
1768
|
-
showCharCount:
|
|
1771
|
+
showCharCount: i = !1,
|
|
1769
1772
|
// ✅ New prop to control visibility
|
|
1770
|
-
...
|
|
1773
|
+
...c
|
|
1771
1774
|
}) => {
|
|
1772
|
-
const y = r ||
|
|
1773
|
-
|
|
1775
|
+
const y = r || c.name, [b, N] = L(
|
|
1776
|
+
c.value?.length || c.defaultValue?.length || 0
|
|
1774
1777
|
), a = (m) => {
|
|
1775
|
-
N(m.target.value.length),
|
|
1778
|
+
N(m.target.value.length), c.onChange && c.onChange(m);
|
|
1776
1779
|
}, w = u - b;
|
|
1777
1780
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1778
1781
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
1779
1782
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
|
|
1780
|
-
|
|
1783
|
+
i && u && /* @__PURE__ */ l("span", { className: "char-counter", children: [
|
|
1781
1784
|
w,
|
|
1782
1785
|
" characters remaining"
|
|
1783
1786
|
] })
|
|
@@ -1792,7 +1795,7 @@ const Ur = {
|
|
|
1792
1795
|
}),
|
|
1793
1796
|
maxLength: u,
|
|
1794
1797
|
onChange: a,
|
|
1795
|
-
...
|
|
1798
|
+
...c
|
|
1796
1799
|
}
|
|
1797
1800
|
),
|
|
1798
1801
|
s && /* @__PURE__ */ e("p", { className: "textarea-error-message", children: s })
|
|
@@ -1805,7 +1808,7 @@ const Ur = {
|
|
|
1805
1808
|
error: n,
|
|
1806
1809
|
...u
|
|
1807
1810
|
}) => /* @__PURE__ */ l("div", { className: "switch-container", children: [
|
|
1808
|
-
/* @__PURE__ */ l(
|
|
1811
|
+
/* @__PURE__ */ l(ir, { as: "div", className: "switch-group", children: [
|
|
1809
1812
|
t && o === "left" && /* @__PURE__ */ e(Ye.Label, { className: "switch-label", passive: !0, children: t }),
|
|
1810
1813
|
/* @__PURE__ */ e(
|
|
1811
1814
|
Ye,
|
|
@@ -1834,20 +1837,20 @@ const Ur = {
|
|
|
1834
1837
|
// 'top', 'bottom', 'left', 'right'
|
|
1835
1838
|
className: u,
|
|
1836
1839
|
// For external styling of the tooltip itself
|
|
1837
|
-
...
|
|
1840
|
+
...i
|
|
1838
1841
|
}) => {
|
|
1839
|
-
const
|
|
1842
|
+
const c = re.useId();
|
|
1840
1843
|
return /* @__PURE__ */ l(ee, { children: [
|
|
1841
|
-
re.cloneElement(t, { "data-tooltip-id":
|
|
1844
|
+
re.cloneElement(t, { "data-tooltip-id": c }),
|
|
1842
1845
|
/* @__PURE__ */ e(
|
|
1843
1846
|
xt,
|
|
1844
1847
|
{
|
|
1845
|
-
id:
|
|
1848
|
+
id: c,
|
|
1846
1849
|
content: r,
|
|
1847
1850
|
place: n,
|
|
1848
1851
|
variant: s,
|
|
1849
1852
|
className: `custom-tooltip custom-tooltip--size-${o} ${u || ""}`,
|
|
1850
|
-
...
|
|
1853
|
+
...i
|
|
1851
1854
|
}
|
|
1852
1855
|
)
|
|
1853
1856
|
] });
|
|
@@ -1871,8 +1874,8 @@ const Ur = {
|
|
|
1871
1874
|
currentStep: o,
|
|
1872
1875
|
direction: n = 1,
|
|
1873
1876
|
stepProps: u = {},
|
|
1874
|
-
title:
|
|
1875
|
-
description:
|
|
1877
|
+
title: i,
|
|
1878
|
+
description: c,
|
|
1876
1879
|
showProgress: y = !0,
|
|
1877
1880
|
closeOnOverlayClick: b = !0
|
|
1878
1881
|
}) => {
|
|
@@ -1921,8 +1924,8 @@ const Ur = {
|
|
|
1921
1924
|
}
|
|
1922
1925
|
),
|
|
1923
1926
|
/* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
|
|
1924
|
-
/* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children:
|
|
1925
|
-
|
|
1927
|
+
/* @__PURE__ */ e(me.Title, { as: "h3", className: "wizard-title", children: i }),
|
|
1928
|
+
c && /* @__PURE__ */ e(me.Description, { className: "wizard-description", children: c })
|
|
1926
1929
|
] })
|
|
1927
1930
|
] }),
|
|
1928
1931
|
/* @__PURE__ */ e(
|
|
@@ -1982,19 +1985,19 @@ const Ur = {
|
|
|
1982
1985
|
save: o,
|
|
1983
1986
|
cancel: n,
|
|
1984
1987
|
tertiary: u,
|
|
1985
|
-
fullHeight:
|
|
1988
|
+
fullHeight: i = !1,
|
|
1986
1989
|
// A clearer prop name
|
|
1987
|
-
...
|
|
1990
|
+
...c
|
|
1988
1991
|
}) => {
|
|
1989
1992
|
const y = W(
|
|
1990
1993
|
"page-layout",
|
|
1991
1994
|
{
|
|
1992
1995
|
"page-layout--with-footer": r,
|
|
1993
|
-
"page-layout--full-height":
|
|
1996
|
+
"page-layout--full-height": i
|
|
1994
1997
|
},
|
|
1995
|
-
|
|
1998
|
+
c.className
|
|
1996
1999
|
);
|
|
1997
|
-
return /* @__PURE__ */ l("div", { className: y, ...
|
|
2000
|
+
return /* @__PURE__ */ l("div", { className: y, ...c, children: [
|
|
1998
2001
|
/* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
|
|
1999
2002
|
r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
|
|
2000
2003
|
u?.show && /* @__PURE__ */ e(
|
|
@@ -2055,7 +2058,7 @@ const Ur = {
|
|
|
2055
2058
|
whileElementsMounted: Fa,
|
|
2056
2059
|
middleware: [Sa(5), Da(), $a({ padding: 5 })]
|
|
2057
2060
|
});
|
|
2058
|
-
return /* @__PURE__ */ l(
|
|
2061
|
+
return /* @__PURE__ */ l(cr, { as: "div", className: "options-menu-wrapper", children: [
|
|
2059
2062
|
/* @__PURE__ */ e(dr, { ref: o.setReference, className: "options-menu-trigger", children: /* @__PURE__ */ e(s, { size: 20 }) }),
|
|
2060
2063
|
/* @__PURE__ */ e(ur, { children: /* @__PURE__ */ e(
|
|
2061
2064
|
oe,
|
|
@@ -2075,11 +2078,11 @@ const Ur = {
|
|
|
2075
2078
|
className: "options-menu-panel",
|
|
2076
2079
|
children: t.map((u) => /* @__PURE__ */ l("div", { className: "options-menu-item-wrapper", children: [
|
|
2077
2080
|
u.dividerBefore && /* @__PURE__ */ e("div", { className: "menu-divider" }),
|
|
2078
|
-
/* @__PURE__ */ e(hr, { children: ({ active:
|
|
2081
|
+
/* @__PURE__ */ e(hr, { children: ({ active: i }) => /* @__PURE__ */ l(
|
|
2079
2082
|
"button",
|
|
2080
2083
|
{
|
|
2081
2084
|
onClick: () => r(u),
|
|
2082
|
-
className: `options-menu-item ${
|
|
2085
|
+
className: `options-menu-item ${i ? "active bg-gray-200 text-gray-900" : ""}`,
|
|
2083
2086
|
disabled: u.disabled,
|
|
2084
2087
|
children: [
|
|
2085
2088
|
u.icon && /* @__PURE__ */ e("span", { className: "item-icon", children: u.icon }),
|
|
@@ -2235,8 +2238,8 @@ function tn(t) {
|
|
|
2235
2238
|
return console.log("Error reading JSON from localStorage"), null;
|
|
2236
2239
|
}
|
|
2237
2240
|
}
|
|
2238
|
-
function
|
|
2239
|
-
const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "",
|
|
2241
|
+
function ia() {
|
|
2242
|
+
const t = tn("userProfile") || {}, r = localStorage.getItem("access_token") || t.accessToken || "", s = localStorage.getItem("siteId") || t.siteId || "", o = t.tenant || "", n = t.tenantdomain || "", u = t.username || t.displayName || "", i = t.email || "";
|
|
2240
2243
|
return {
|
|
2241
2244
|
Authorization: r ? `Bearer ${r}` : void 0,
|
|
2242
2245
|
"x-tenant-id": o || void 0,
|
|
@@ -2244,19 +2247,19 @@ function ca() {
|
|
|
2244
2247
|
"site-id": s || void 0,
|
|
2245
2248
|
"Content-Type": "application/json",
|
|
2246
2249
|
"principal-user": u || void 0,
|
|
2247
|
-
"x-user-email":
|
|
2250
|
+
"x-user-email": i || void 0
|
|
2248
2251
|
};
|
|
2249
2252
|
}
|
|
2250
2253
|
function rn(t) {
|
|
2251
2254
|
if (t && t.isAxiosError) {
|
|
2252
|
-
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null,
|
|
2255
|
+
const { response: r, config: s, message: o } = t, n = r?.status ?? null, u = r?.statusText ?? null, i = r?.data ?? null, c = typeof i == "string" && i || i?.message || i?.msg || i?.error || i?.errors?.[0]?.message || null;
|
|
2253
2256
|
return {
|
|
2254
2257
|
ok: !1,
|
|
2255
2258
|
status: n,
|
|
2256
2259
|
statusText: u,
|
|
2257
|
-
code:
|
|
2258
|
-
message:
|
|
2259
|
-
details:
|
|
2260
|
+
code: i?.code || null,
|
|
2261
|
+
message: c || o || "Request failed",
|
|
2262
|
+
details: i || null,
|
|
2260
2263
|
request: {
|
|
2261
2264
|
url: s?.url || null,
|
|
2262
2265
|
method: s?.method || null,
|
|
@@ -2296,12 +2299,12 @@ function nn({
|
|
|
2296
2299
|
);
|
|
2297
2300
|
function o({ open: b = !1, customHeader: N = {} } = {}) {
|
|
2298
2301
|
if (b) {
|
|
2299
|
-
const { Authorization: a, ...w } =
|
|
2302
|
+
const { Authorization: a, ...w } = ia();
|
|
2300
2303
|
return {
|
|
2301
2304
|
headers: { ...w, ...r, ...N }
|
|
2302
2305
|
};
|
|
2303
2306
|
}
|
|
2304
|
-
return { headers: { ...
|
|
2307
|
+
return { headers: { ...ia(), ...N } };
|
|
2305
2308
|
}
|
|
2306
2309
|
async function n(b, N, a = !1, w = {}) {
|
|
2307
2310
|
return s.get(b, {
|
|
@@ -2313,10 +2316,10 @@ function nn({
|
|
|
2313
2316
|
const m = { ...o({ open: a, customHeader: w }) };
|
|
2314
2317
|
return N !== void 0 && (m.data = N), s.delete(b, m);
|
|
2315
2318
|
}
|
|
2316
|
-
async function
|
|
2319
|
+
async function i(b, N = {}, a = !1, w = {}) {
|
|
2317
2320
|
return s.post(b, N, o({ open: a, customHeader: w }));
|
|
2318
2321
|
}
|
|
2319
|
-
async function
|
|
2322
|
+
async function c(b, N = {}, a = !1, w = {}) {
|
|
2320
2323
|
return s.put(b, N, o({ open: a, customHeader: w }));
|
|
2321
2324
|
}
|
|
2322
2325
|
async function y(b, N = {}, a = !1, w = {}) {
|
|
@@ -2327,8 +2330,8 @@ function nn({
|
|
|
2327
2330
|
// exported in case you want advanced usage
|
|
2328
2331
|
axiosGet: n,
|
|
2329
2332
|
axiosDelete: u,
|
|
2330
|
-
axiosPost:
|
|
2331
|
-
axiosPut:
|
|
2333
|
+
axiosPost: i,
|
|
2334
|
+
axiosPut: c,
|
|
2332
2335
|
axiosPatch: y
|
|
2333
2336
|
};
|
|
2334
2337
|
}
|
|
@@ -2359,7 +2362,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2359
2362
|
type: "User",
|
|
2360
2363
|
avatarUrl: r?.profileImage || Re(n)
|
|
2361
2364
|
};
|
|
2362
|
-
}),
|
|
2365
|
+
}), ca = (t) => {
|
|
2363
2366
|
try {
|
|
2364
2367
|
const r = JSON.parse(t);
|
|
2365
2368
|
return Array.isArray(r) ? r : [];
|
|
@@ -2410,10 +2413,10 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2410
2413
|
if (Array.isArray(s))
|
|
2411
2414
|
o = s;
|
|
2412
2415
|
else if (typeof s == "string")
|
|
2413
|
-
o =
|
|
2416
|
+
o = ca(s.trim());
|
|
2414
2417
|
else if (s && typeof s == "object") {
|
|
2415
2418
|
const n = s.data;
|
|
2416
|
-
Array.isArray(n) ? o = n : typeof n == "string" && (o =
|
|
2419
|
+
Array.isArray(n) ? o = n : typeof n == "string" && (o = ca(n.trim()));
|
|
2417
2420
|
}
|
|
2418
2421
|
return cn(o);
|
|
2419
2422
|
}
|
|
@@ -2439,9 +2442,9 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2439
2442
|
}) => {
|
|
2440
2443
|
const n = t.slice(0, 2), u = [];
|
|
2441
2444
|
t.length > 0 && u.push(t[0].name), r.length > 0 && u.push(r[0].name), s.length > 0 && u.length < 2 && u.push(s[0].name);
|
|
2442
|
-
const
|
|
2445
|
+
const i = t.length + r.length + s.length, c = i - u.length;
|
|
2443
2446
|
let y = u.join(", ");
|
|
2444
|
-
return
|
|
2447
|
+
return c > 0 && (y += ` and ${c} others`), i === 0 ? /* @__PURE__ */ e(
|
|
2445
2448
|
"div",
|
|
2446
2449
|
{
|
|
2447
2450
|
className: "flex items-center justify-between p-3 border border-dashed border-gray-400 rounded-lg hover:bg-gray-50",
|
|
@@ -2486,9 +2489,9 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2486
2489
|
existingShares: o = { users: [], groups: [], roles: [] },
|
|
2487
2490
|
calledBy: n,
|
|
2488
2491
|
showExistingShares: u = !1,
|
|
2489
|
-
onFinalSubmit:
|
|
2492
|
+
onFinalSubmit: i = () => {
|
|
2490
2493
|
},
|
|
2491
|
-
isChanged:
|
|
2494
|
+
isChanged: c = !1
|
|
2492
2495
|
}) => {
|
|
2493
2496
|
const [y, b] = L(da[0]), [N, a] = L(""), w = ta(N, 400), [m, g] = L([]), [$, O] = L(/* @__PURE__ */ new Set()), [R, S] = L(!1), [B, P] = L(ua[0]), {
|
|
2494
2497
|
control: E,
|
|
@@ -2531,7 +2534,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2531
2534
|
type: I.type.toLowerCase()
|
|
2532
2535
|
}))
|
|
2533
2536
|
};
|
|
2534
|
-
|
|
2537
|
+
i(C, o);
|
|
2535
2538
|
} else if (n === se.INTEREST) {
|
|
2536
2539
|
const C = T.pendingInvites.map((I) => ({
|
|
2537
2540
|
identity: I.id,
|
|
@@ -2542,7 +2545,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2542
2545
|
userName: I.name,
|
|
2543
2546
|
interestId: t?.data?.id
|
|
2544
2547
|
}));
|
|
2545
|
-
|
|
2548
|
+
i(C, o);
|
|
2546
2549
|
} else if (n === se.ARTICLE) {
|
|
2547
2550
|
const C = {
|
|
2548
2551
|
entity: t,
|
|
@@ -2552,9 +2555,9 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2552
2555
|
type: I.type.toLowerCase()
|
|
2553
2556
|
}))
|
|
2554
2557
|
};
|
|
2555
|
-
|
|
2558
|
+
i(C, o);
|
|
2556
2559
|
} else
|
|
2557
|
-
|
|
2560
|
+
i(T, o);
|
|
2558
2561
|
setTimeout(() => {
|
|
2559
2562
|
s();
|
|
2560
2563
|
}, 1e3);
|
|
@@ -2575,7 +2578,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2575
2578
|
default:
|
|
2576
2579
|
return "Add User, Groups or Roles test";
|
|
2577
2580
|
}
|
|
2578
|
-
}, M = ne(() => $.size === 0 && !
|
|
2581
|
+
}, M = ne(() => $.size === 0 && !c, [$, c]);
|
|
2579
2582
|
return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2580
2583
|
/* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2581
2584
|
/* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
|
|
@@ -2875,13 +2878,13 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2875
2878
|
{ name: "Can manage", icon: xa, value: "edit" },
|
|
2876
2879
|
{ name: "Remove", icon: zt, isDestructive: !0, value: "remove" }
|
|
2877
2880
|
], hn = ({ item: t, allowedPermissions: r, onPermissionChange: s }) => {
|
|
2878
|
-
const [o, n] = L(!1), { refs: u, floatingStyles:
|
|
2881
|
+
const [o, n] = L(!1), { refs: u, floatingStyles: i, context: c } = Ca({
|
|
2879
2882
|
open: o,
|
|
2880
2883
|
onOpenChange: n,
|
|
2881
2884
|
middleware: [Sa(8), Da(), $a({ padding: 8 })],
|
|
2882
2885
|
whileElementsMounted: Fa,
|
|
2883
2886
|
placement: "bottom-end"
|
|
2884
|
-
}), y = yr(
|
|
2887
|
+
}), y = yr(c), b = fr(c), { getReferenceProps: N, getFloatingProps: a } = br([
|
|
2885
2888
|
y,
|
|
2886
2889
|
b
|
|
2887
2890
|
]), w = Je.find((g) => g.name === t.permission || g.value === t.permission) || Je[0];
|
|
@@ -2918,7 +2921,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2918
2921
|
X.Options,
|
|
2919
2922
|
{
|
|
2920
2923
|
ref: u.setFloating,
|
|
2921
|
-
style:
|
|
2924
|
+
style: i,
|
|
2922
2925
|
...a(),
|
|
2923
2926
|
static: !0,
|
|
2924
2927
|
className: "z-50 w-48 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",
|
|
@@ -2963,19 +2966,19 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2963
2966
|
existingShares: n,
|
|
2964
2967
|
allowedPermissions: u
|
|
2965
2968
|
}) => {
|
|
2966
|
-
const [
|
|
2967
|
-
users:
|
|
2969
|
+
const [i, c] = L(n), [y, b] = L(0), [N, a] = L(""), w = ta(N, 300), m = {
|
|
2970
|
+
users: i.users.filter(
|
|
2968
2971
|
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2969
2972
|
),
|
|
2970
|
-
groups:
|
|
2973
|
+
groups: i.groups.filter(
|
|
2971
2974
|
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2972
2975
|
),
|
|
2973
|
-
roles:
|
|
2976
|
+
roles: i.roles.filter(
|
|
2974
2977
|
(R) => R.name.toLowerCase().includes(w.toLowerCase())
|
|
2975
2978
|
)
|
|
2976
2979
|
}, g = async (R, S, B, P) => {
|
|
2977
2980
|
const E = S.value;
|
|
2978
|
-
|
|
2981
|
+
c(E === "Remove" ? (V) => ({
|
|
2979
2982
|
...V,
|
|
2980
2983
|
[B]: V[B].filter((U) => U.id !== R.id)
|
|
2981
2984
|
}) : (V) => ({
|
|
@@ -2992,7 +2995,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
2992
2995
|
/* @__PURE__ */ l(
|
|
2993
2996
|
"button",
|
|
2994
2997
|
{
|
|
2995
|
-
onClick: () => r(
|
|
2998
|
+
onClick: () => r(i),
|
|
2996
2999
|
className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 hover:cursor-pointer p-2 rounded-md hover:bg-gray-100",
|
|
2997
3000
|
children: [
|
|
2998
3001
|
/* @__PURE__ */ e(ka, { className: "h-5 w-5" }),
|
|
@@ -3139,7 +3142,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
3139
3142
|
onClose: s,
|
|
3140
3143
|
members: o
|
|
3141
3144
|
}) => {
|
|
3142
|
-
const [n, u] = L(!0), [
|
|
3145
|
+
const [n, u] = L(!0), [i, c] = L(""), y = ta(i, 300), b = o.filter(
|
|
3143
3146
|
(m) => m.name.toLowerCase().includes(y.toLowerCase())
|
|
3144
3147
|
), N = {
|
|
3145
3148
|
hidden: { opacity: 0 },
|
|
@@ -3232,8 +3235,8 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
3232
3235
|
/* @__PURE__ */ e("div", { className: "p-4 border-b border-gray-200 flex-shrink-0", children: /* @__PURE__ */ e(
|
|
3233
3236
|
he,
|
|
3234
3237
|
{
|
|
3235
|
-
onDebouncedChange:
|
|
3236
|
-
value:
|
|
3238
|
+
onDebouncedChange: c,
|
|
3239
|
+
value: i,
|
|
3237
3240
|
placeholder: "Search members..."
|
|
3238
3241
|
}
|
|
3239
3242
|
) }),
|
|
@@ -3256,8 +3259,8 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
3256
3259
|
calledBy: n,
|
|
3257
3260
|
onClose: u = () => {
|
|
3258
3261
|
},
|
|
3259
|
-
showExistingShares:
|
|
3260
|
-
allowedPermissions:
|
|
3262
|
+
showExistingShares: i = !0,
|
|
3263
|
+
allowedPermissions: c = [],
|
|
3261
3264
|
...y
|
|
3262
3265
|
}) => {
|
|
3263
3266
|
const [b, N] = L(de.INVITE), [a, w] = L(t), [m, g] = L(null), [$, O] = L(!1), [R, S] = L([]), [B, P] = L(de.MANAGE), E = () => {
|
|
@@ -3304,7 +3307,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
3304
3307
|
onOpenMembers: U,
|
|
3305
3308
|
existingShares: a,
|
|
3306
3309
|
calledBy: n,
|
|
3307
|
-
allowedPermissions:
|
|
3310
|
+
allowedPermissions: c
|
|
3308
3311
|
}
|
|
3309
3312
|
)
|
|
3310
3313
|
},
|
|
@@ -3350,7 +3353,7 @@ const we = nn(), $e = we.axiosGet, sn = we.axiosDelete, Fe = we.axiosPost, ln =
|
|
|
3350
3353
|
onClose: E,
|
|
3351
3354
|
existingShares: a,
|
|
3352
3355
|
calledBy: n,
|
|
3353
|
-
showExistingShares:
|
|
3356
|
+
showExistingShares: i,
|
|
3354
3357
|
onFinalSubmit: (p) => {
|
|
3355
3358
|
s(p, a);
|
|
3356
3359
|
},
|
|
@@ -3376,8 +3379,8 @@ function qe({
|
|
|
3376
3379
|
onBlur: n = () => {
|
|
3377
3380
|
},
|
|
3378
3381
|
placeholder: u = "Select options",
|
|
3379
|
-
error:
|
|
3380
|
-
displayLimit:
|
|
3382
|
+
error: i = null,
|
|
3383
|
+
displayLimit: c = 3,
|
|
3381
3384
|
selectionLimit: y = -1,
|
|
3382
3385
|
// NEW: search behavior
|
|
3383
3386
|
searchMode: b = "client",
|
|
@@ -3405,7 +3408,7 @@ function qe({
|
|
|
3405
3408
|
const U = b === "client" ? V : r, j = () => {
|
|
3406
3409
|
if (!E.length)
|
|
3407
3410
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3408
|
-
const p = E.slice(0,
|
|
3411
|
+
const p = E.slice(0, c), f = E.length - c;
|
|
3409
3412
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3410
3413
|
p.map((k) => /* @__PURE__ */ e(
|
|
3411
3414
|
"span",
|
|
@@ -3439,12 +3442,12 @@ function qe({
|
|
|
3439
3442
|
X.Button,
|
|
3440
3443
|
{
|
|
3441
3444
|
"aria-labelledby": $,
|
|
3442
|
-
"aria-invalid": !!
|
|
3443
|
-
"aria-describedby":
|
|
3445
|
+
"aria-invalid": !!i,
|
|
3446
|
+
"aria-describedby": i ? O : void 0,
|
|
3444
3447
|
onBlur: n,
|
|
3445
3448
|
className: Ae(
|
|
3446
3449
|
"relative w-full min-h-[38px] cursor-default rounded-md bg-white py-1.5 pl-3 pr-10 text-left text-gray-900 shadow-sm ring-1 ring-inset focus:outline-none focus:ring-2 focus:ring-gray-600 sm:text-sm sm:leading-6",
|
|
3447
|
-
|
|
3450
|
+
i ? "ring-red-500" : "ring-gray-300"
|
|
3448
3451
|
),
|
|
3449
3452
|
children: [
|
|
3450
3453
|
/* @__PURE__ */ e("span", { className: "block truncate", children: j() }),
|
|
@@ -3510,7 +3513,7 @@ function qe({
|
|
|
3510
3513
|
] })
|
|
3511
3514
|
}
|
|
3512
3515
|
),
|
|
3513
|
-
|
|
3516
|
+
i && /* @__PURE__ */ e("p", { id: O, className: "mt-1 text-sm text-red-600", children: i })
|
|
3514
3517
|
] })
|
|
3515
3518
|
] }) });
|
|
3516
3519
|
}
|
|
@@ -3556,15 +3559,15 @@ qe.defaultProps = {
|
|
|
3556
3559
|
getOptionId: (t) => String(t.id),
|
|
3557
3560
|
getOptionLabel: (t) => t.name
|
|
3558
3561
|
};
|
|
3559
|
-
const
|
|
3562
|
+
const is = ({
|
|
3560
3563
|
isOpen: t = !1,
|
|
3561
3564
|
setIsOpen: r,
|
|
3562
3565
|
content: s,
|
|
3563
3566
|
header: o = { title: "", customHeader: null, isCrossShow: !0 },
|
|
3564
3567
|
footer: n = { show: !0, customFooter: null },
|
|
3565
3568
|
primaryAction: u = { onSubmit: null, label: "Save", loader: !1, disabled: !1 },
|
|
3566
|
-
secondaryAction:
|
|
3567
|
-
dialogPanelClass:
|
|
3569
|
+
secondaryAction: i = { onCancel: null, label: "Cancel" },
|
|
3570
|
+
dialogPanelClass: c = ""
|
|
3568
3571
|
}) => {
|
|
3569
3572
|
const y = (N) => {
|
|
3570
3573
|
N.target === N.currentTarget && r(!1);
|
|
@@ -3588,7 +3591,7 @@ const cs = ({
|
|
|
3588
3591
|
/* @__PURE__ */ e("div", { className: "fixed inset-0 overflow-y-auto", children: /* @__PURE__ */ e("div", { className: "flex min-h-full items-center justify-center p-4", children: /* @__PURE__ */ l(
|
|
3589
3592
|
ke,
|
|
3590
3593
|
{
|
|
3591
|
-
className: `${
|
|
3594
|
+
className: `${c} relative bg-white align-middle w-full lg:w-[36rem] mx-5 lg:mx-0 transform overflow-hidden rounded-2xl text-left shadow-xl lg:min-w-[36rem] md:min-w-96 transition-all`,
|
|
3592
3595
|
onClick: b,
|
|
3593
3596
|
children: [
|
|
3594
3597
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
@@ -3605,15 +3608,15 @@ const cs = ({
|
|
|
3605
3608
|
}
|
|
3606
3609
|
),
|
|
3607
3610
|
n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
|
|
3608
|
-
|
|
3611
|
+
i?.onCancel && /* @__PURE__ */ e(
|
|
3609
3612
|
Z,
|
|
3610
3613
|
{
|
|
3611
3614
|
"data-testid": "cancel-button",
|
|
3612
|
-
label:
|
|
3615
|
+
label: i?.label,
|
|
3613
3616
|
loader: !1,
|
|
3614
3617
|
ariaLabel: "Cancel Button",
|
|
3615
3618
|
className: "p-3 mr-3 secondaryButton !w-[70px]",
|
|
3616
|
-
onClick: () =>
|
|
3619
|
+
onClick: () => i?.onCancel(),
|
|
3617
3620
|
category: "secondary"
|
|
3618
3621
|
}
|
|
3619
3622
|
),
|
|
@@ -3660,8 +3663,8 @@ function vn({
|
|
|
3660
3663
|
onToggle: o,
|
|
3661
3664
|
onSelect: n,
|
|
3662
3665
|
onCreateChild: u,
|
|
3663
|
-
onRename:
|
|
3664
|
-
onDelete:
|
|
3666
|
+
onRename: i,
|
|
3667
|
+
onDelete: c,
|
|
3665
3668
|
renderActions: y,
|
|
3666
3669
|
// optional override
|
|
3667
3670
|
dragId: b,
|
|
@@ -3670,7 +3673,7 @@ function vn({
|
|
|
3670
3673
|
}) {
|
|
3671
3674
|
const { setNodeRef: w, isOver: m } = Pt({ id: N }), { attributes: g, listeners: $, setNodeRef: O, transform: R, isDragging: S } = Ot({ id: b }), B = R ? { transform: `translate3d(${Math.round(R.x)}px, ${Math.round(R.y)}px, 0)` } : void 0, [P, E] = L(!1), [V, U] = L(t.name), j = () => {
|
|
3672
3675
|
const p = V.trim();
|
|
3673
|
-
E(!1), p && p !== t.name ?
|
|
3676
|
+
E(!1), p && p !== t.name ? i?.(t, p) : U(t.name);
|
|
3674
3677
|
}, v = ne(() => /* @__PURE__ */ e(
|
|
3675
3678
|
Xr,
|
|
3676
3679
|
{
|
|
@@ -3680,10 +3683,10 @@ function vn({
|
|
|
3680
3683
|
{ action: "delete", label: "Delete" }
|
|
3681
3684
|
],
|
|
3682
3685
|
onSelect: (f) => {
|
|
3683
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" &&
|
|
3686
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && c?.(t);
|
|
3684
3687
|
}
|
|
3685
3688
|
}
|
|
3686
|
-
), [t, u,
|
|
3689
|
+
), [t, u, c]);
|
|
3687
3690
|
return /* @__PURE__ */ l(
|
|
3688
3691
|
"div",
|
|
3689
3692
|
{
|
|
@@ -3713,7 +3716,7 @@ function vn({
|
|
|
3713
3716
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3714
3717
|
onCreateChild: () => u?.(t),
|
|
3715
3718
|
onRename: () => E(!0),
|
|
3716
|
-
onDelete: () =>
|
|
3719
|
+
onDelete: () => c?.(t)
|
|
3717
3720
|
}) : v })
|
|
3718
3721
|
]
|
|
3719
3722
|
}
|
|
@@ -3722,48 +3725,48 @@ function vn({
|
|
|
3722
3725
|
const Nn = (t) => String(t.id ?? t._id), xn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", kn = (t) => t.name ?? t.label ?? "", wn = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
|
|
3723
3726
|
function Cn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
3724
3727
|
const u = /* @__PURE__ */ new Map();
|
|
3725
|
-
t.forEach((
|
|
3726
|
-
const y = s(
|
|
3728
|
+
t.forEach((c) => {
|
|
3729
|
+
const y = s(c);
|
|
3727
3730
|
u.set(y, {
|
|
3728
|
-
...
|
|
3731
|
+
...c,
|
|
3729
3732
|
id: y,
|
|
3730
|
-
name: n(
|
|
3731
|
-
parentId: o(
|
|
3733
|
+
name: n(c),
|
|
3734
|
+
parentId: o(c) || r,
|
|
3732
3735
|
children: []
|
|
3733
3736
|
});
|
|
3734
3737
|
});
|
|
3735
|
-
const
|
|
3736
|
-
return u.forEach((
|
|
3737
|
-
const y =
|
|
3738
|
-
y !== r && u.has(y) ? u.get(y).children.push(
|
|
3739
|
-
}), { roots:
|
|
3738
|
+
const i = [];
|
|
3739
|
+
return u.forEach((c) => {
|
|
3740
|
+
const y = c.parentId || r;
|
|
3741
|
+
y !== r && u.has(y) ? u.get(y).children.push(c) : i.push(c);
|
|
3742
|
+
}), { roots: i, byId: u };
|
|
3740
3743
|
}
|
|
3741
3744
|
function Sn(t, { rootId: r, getId: s, getName: o }) {
|
|
3742
3745
|
const n = /* @__PURE__ */ new Map();
|
|
3743
|
-
function u(
|
|
3744
|
-
const b = s(
|
|
3745
|
-
...
|
|
3746
|
+
function u(c, y) {
|
|
3747
|
+
const b = s(c), N = {
|
|
3748
|
+
...c,
|
|
3746
3749
|
id: b,
|
|
3747
|
-
name: o(
|
|
3750
|
+
name: o(c),
|
|
3748
3751
|
parentId: y || r,
|
|
3749
|
-
children: (
|
|
3752
|
+
children: (c.children || []).map((a) => u(a, b))
|
|
3750
3753
|
};
|
|
3751
3754
|
return n.set(b, N), N;
|
|
3752
3755
|
}
|
|
3753
|
-
return { roots: t.map((
|
|
3756
|
+
return { roots: t.map((c) => u(c, null)), byId: n };
|
|
3754
3757
|
}
|
|
3755
3758
|
const De = (t) => t.map((r) => ({ ...r, children: De(r.children || []) }));
|
|
3756
3759
|
function Dn(t, r) {
|
|
3757
3760
|
let s = null;
|
|
3758
3761
|
function o(u) {
|
|
3759
|
-
return u.map((
|
|
3760
|
-
if (
|
|
3761
|
-
return s =
|
|
3762
|
-
if (
|
|
3763
|
-
const
|
|
3764
|
-
if (
|
|
3762
|
+
return u.map((i) => {
|
|
3763
|
+
if (i.id === r)
|
|
3764
|
+
return s = i, null;
|
|
3765
|
+
if (i.children?.length) {
|
|
3766
|
+
const c = o(i.children);
|
|
3767
|
+
if (c !== i.children) return { ...i, children: c };
|
|
3765
3768
|
}
|
|
3766
|
-
return
|
|
3769
|
+
return i;
|
|
3767
3770
|
}).filter(Boolean);
|
|
3768
3771
|
}
|
|
3769
3772
|
return { newRoots: o(t), removed: s };
|
|
@@ -3774,8 +3777,8 @@ function $n(t, r, s) {
|
|
|
3774
3777
|
if (u.id === r)
|
|
3775
3778
|
return { ...u, children: [...u.children || [], { ...s, parentId: r }] };
|
|
3776
3779
|
if (u.children?.length) {
|
|
3777
|
-
const
|
|
3778
|
-
if (
|
|
3780
|
+
const i = o(u.children);
|
|
3781
|
+
if (i !== u.children) return { ...u, children: i };
|
|
3779
3782
|
}
|
|
3780
3783
|
return u;
|
|
3781
3784
|
});
|
|
@@ -3792,15 +3795,15 @@ function Ja(t, r, s = null) {
|
|
|
3792
3795
|
}
|
|
3793
3796
|
return null;
|
|
3794
3797
|
}
|
|
3795
|
-
function
|
|
3798
|
+
function cs({
|
|
3796
3799
|
data: t = [],
|
|
3797
3800
|
rootId: r = "root",
|
|
3798
3801
|
title: s = "Folders",
|
|
3799
3802
|
getId: o = Nn,
|
|
3800
3803
|
getParent: n = xn,
|
|
3801
3804
|
getName: u = kn,
|
|
3802
|
-
onSelect:
|
|
3803
|
-
onCreateRoot:
|
|
3805
|
+
onSelect: i,
|
|
3806
|
+
onCreateRoot: c,
|
|
3804
3807
|
onCreateChild: y,
|
|
3805
3808
|
onRename: b,
|
|
3806
3809
|
onDelete: N,
|
|
@@ -3844,14 +3847,14 @@ function is({
|
|
|
3844
3847
|
const M = Math.max(0, Math.floor(-z / g));
|
|
3845
3848
|
if (M > 0) {
|
|
3846
3849
|
let H = D;
|
|
3847
|
-
for (let
|
|
3848
|
-
const
|
|
3849
|
-
if (!
|
|
3850
|
-
if (!
|
|
3850
|
+
for (let ie = 0; ie < M; ie++) {
|
|
3851
|
+
const ce = Ja(P, H, null);
|
|
3852
|
+
if (!ce) break;
|
|
3853
|
+
if (!ce.parentId) {
|
|
3851
3854
|
A = r;
|
|
3852
3855
|
break;
|
|
3853
3856
|
}
|
|
3854
|
-
A =
|
|
3857
|
+
A = ce.parentId, H = ce.parentId;
|
|
3855
3858
|
}
|
|
3856
3859
|
}
|
|
3857
3860
|
if (m && A === r) {
|
|
@@ -3873,7 +3876,7 @@ function is({
|
|
|
3873
3876
|
depth: F,
|
|
3874
3877
|
expanded: !!O[z.id],
|
|
3875
3878
|
onToggle: () => B(z.id),
|
|
3876
|
-
onSelect:
|
|
3879
|
+
onSelect: i,
|
|
3877
3880
|
onCreateChild: y,
|
|
3878
3881
|
onRename: b,
|
|
3879
3882
|
onDelete: N,
|
|
@@ -3885,7 +3888,7 @@ function is({
|
|
|
3885
3888
|
),
|
|
3886
3889
|
O[z.id] && z.children?.length > 0 ? h(z.children, F + 1) : null
|
|
3887
3890
|
] }, z.id)),
|
|
3888
|
-
[O, g, y, N, b,
|
|
3891
|
+
[O, g, y, N, b, i, w, B]
|
|
3889
3892
|
);
|
|
3890
3893
|
return re.useMemo(() => {
|
|
3891
3894
|
if (!j) return null;
|
|
@@ -3902,12 +3905,12 @@ function is({
|
|
|
3902
3905
|
}, [j, P]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3903
3906
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3904
3907
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3905
|
-
/* @__PURE__ */ e("button", { className: "tv-btn", onClick:
|
|
3908
|
+
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
|
|
3906
3909
|
] }),
|
|
3907
3910
|
/* @__PURE__ */ l("div", { className: "tv-root-row", children: [
|
|
3908
3911
|
/* @__PURE__ */ e(wa, { size: 16, className: "tv-folder-ic" }),
|
|
3909
3912
|
/* @__PURE__ */ e("strong", { children: "ROOT" }),
|
|
3910
|
-
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick:
|
|
3913
|
+
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
|
|
3911
3914
|
] }),
|
|
3912
3915
|
/* @__PURE__ */ e(
|
|
3913
3916
|
Vt,
|
|
@@ -3933,8 +3936,8 @@ const ds = ({
|
|
|
3933
3936
|
containerClassName: o = "",
|
|
3934
3937
|
listClassName: n = "",
|
|
3935
3938
|
panelClassName: u = "",
|
|
3936
|
-
tabClassName:
|
|
3937
|
-
...
|
|
3939
|
+
tabClassName: i,
|
|
3940
|
+
...c
|
|
3938
3941
|
// Pass remaining props to Tab.Group
|
|
3939
3942
|
}) => {
|
|
3940
3943
|
const y = s === "vertical", b = (w) => ye(
|
|
@@ -3943,8 +3946,8 @@ const ds = ({
|
|
|
3943
3946
|
), N = (w) => ye(
|
|
3944
3947
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3945
3948
|
w ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3946
|
-
), a = ({ selected: w }) =>
|
|
3947
|
-
return /* @__PURE__ */ e(ae.Group, { vertical: y, ...
|
|
3949
|
+
), a = ({ selected: w }) => i ? typeof i == "function" ? i(w) : i : y ? b(w) : N(w);
|
|
3950
|
+
return /* @__PURE__ */ e(ae.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: ye("flex gap-4", o), children: [
|
|
3948
3951
|
/* @__PURE__ */ e(ae.List, { className: ye("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((w) => /* @__PURE__ */ e(ae, { className: a, children: w.label }, w.key)) }),
|
|
3949
3952
|
/* @__PURE__ */ e(ae.Panels, { unmount: !r, className: ye("flex-1", u), children: t.map((w) => /* @__PURE__ */ e(ae.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: w.content }) }, w.key)) })
|
|
3950
3953
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
@@ -3954,7 +3957,7 @@ const ds = ({
|
|
|
3954
3957
|
};
|
|
3955
3958
|
function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
3956
3959
|
console.log(t);
|
|
3957
|
-
const [n, u] = re.useState(t), [
|
|
3960
|
+
const [n, u] = re.useState(t), [i, c] = re.useState(() => {
|
|
3958
3961
|
const a = r && r[t.key] || {};
|
|
3959
3962
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3960
3963
|
}), y = ue(r);
|
|
@@ -3962,16 +3965,16 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3962
3965
|
if (y.current !== r) {
|
|
3963
3966
|
y.current = r;
|
|
3964
3967
|
const a = r && r[t.key] || {};
|
|
3965
|
-
console.log("Updated Section data for", t.key, a),
|
|
3968
|
+
console.log("Updated Section data for", t.key, a), c(a);
|
|
3966
3969
|
}
|
|
3967
|
-
}, [r, t.key]), console.log("Section data",
|
|
3968
|
-
const b = ue(
|
|
3970
|
+
}, [r, t.key]), console.log("Section data", i);
|
|
3971
|
+
const b = ue(i);
|
|
3969
3972
|
Q(() => {
|
|
3970
|
-
b.current !==
|
|
3971
|
-
}, [n.key,
|
|
3973
|
+
b.current !== i && s && typeof s == "function" && (b.current = i, s(n.key, i));
|
|
3974
|
+
}, [n.key, i, s]);
|
|
3972
3975
|
const N = (a) => {
|
|
3973
3976
|
if (!a.dependsOn) return !0;
|
|
3974
|
-
const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ =
|
|
3977
|
+
const { field: w, value: m, operator: g = "equals" } = a.dependsOn, $ = i[w];
|
|
3975
3978
|
switch (g) {
|
|
3976
3979
|
case "equals":
|
|
3977
3980
|
return $ === m;
|
|
@@ -4030,10 +4033,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4030
4033
|
name: a.key,
|
|
4031
4034
|
defaultValue: a.default,
|
|
4032
4035
|
placeholder: a.placeholder,
|
|
4033
|
-
value:
|
|
4036
|
+
value: i[a.key] || "",
|
|
4034
4037
|
onChange: (m) => {
|
|
4035
|
-
const g = { ...
|
|
4036
|
-
|
|
4038
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4039
|
+
c(g), s && s(n.key, g);
|
|
4037
4040
|
},
|
|
4038
4041
|
required: a.required,
|
|
4039
4042
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4049,10 +4052,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4049
4052
|
name: a.key,
|
|
4050
4053
|
defaultValue: a.default,
|
|
4051
4054
|
placeholder: a.placeholder,
|
|
4052
|
-
value:
|
|
4055
|
+
value: i[a.key] || "",
|
|
4053
4056
|
onChange: (m) => {
|
|
4054
|
-
const g = { ...
|
|
4055
|
-
|
|
4057
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4058
|
+
c(g), s && s(n.key, g);
|
|
4056
4059
|
},
|
|
4057
4060
|
rows: 3,
|
|
4058
4061
|
required: a.required,
|
|
@@ -4070,10 +4073,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4070
4073
|
name: a.key,
|
|
4071
4074
|
defaultValue: a.default,
|
|
4072
4075
|
placeholder: a.placeholder,
|
|
4073
|
-
value:
|
|
4076
|
+
value: i[a.key] || "",
|
|
4074
4077
|
onChange: (m) => {
|
|
4075
|
-
const g = { ...
|
|
4076
|
-
|
|
4078
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4079
|
+
c(g), s && s(n.key, g);
|
|
4077
4080
|
},
|
|
4078
4081
|
required: a.required,
|
|
4079
4082
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4087,10 +4090,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4087
4090
|
Aa,
|
|
4088
4091
|
{
|
|
4089
4092
|
name: a.key,
|
|
4090
|
-
checked: !!(
|
|
4093
|
+
checked: !!(i[a.key] || a.default),
|
|
4091
4094
|
onChange: (m) => {
|
|
4092
|
-
const g = { ...
|
|
4093
|
-
|
|
4095
|
+
const g = { ...i, [a.key]: m };
|
|
4096
|
+
c(g), s && s(n.key, g);
|
|
4094
4097
|
},
|
|
4095
4098
|
label: a.placeholder || a.label,
|
|
4096
4099
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4105,10 +4108,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4105
4108
|
{
|
|
4106
4109
|
name: a.key,
|
|
4107
4110
|
defaultValue: a.default,
|
|
4108
|
-
value:
|
|
4111
|
+
value: i[a.key] || "",
|
|
4109
4112
|
onChange: (m) => {
|
|
4110
|
-
const g = { ...
|
|
4111
|
-
|
|
4113
|
+
const g = { ...i, [a.key]: m };
|
|
4114
|
+
c(g);
|
|
4112
4115
|
},
|
|
4113
4116
|
options: a.options || [],
|
|
4114
4117
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4127,10 +4130,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4127
4130
|
name: a.key,
|
|
4128
4131
|
defaultValue: a.default,
|
|
4129
4132
|
placeholder: a.placeholder || "Enter email address",
|
|
4130
|
-
value:
|
|
4133
|
+
value: i[a.key] || "",
|
|
4131
4134
|
onChange: (m) => {
|
|
4132
|
-
const g = { ...
|
|
4133
|
-
|
|
4135
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4136
|
+
c(g), s && s(n.key, g);
|
|
4134
4137
|
},
|
|
4135
4138
|
required: a.required,
|
|
4136
4139
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4147,10 +4150,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4147
4150
|
name: a.key,
|
|
4148
4151
|
defaultValue: a.default,
|
|
4149
4152
|
placeholder: a.placeholder || "Enter URL",
|
|
4150
|
-
value:
|
|
4153
|
+
value: i[a.key] || "",
|
|
4151
4154
|
onChange: (m) => {
|
|
4152
|
-
const g = { ...
|
|
4153
|
-
|
|
4155
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4156
|
+
c(g), s && s(n.key, g);
|
|
4154
4157
|
},
|
|
4155
4158
|
required: a.required,
|
|
4156
4159
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4167,10 +4170,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4167
4170
|
name: a.key,
|
|
4168
4171
|
defaultValue: a.default,
|
|
4169
4172
|
placeholder: a.placeholder || "Enter password",
|
|
4170
|
-
value:
|
|
4173
|
+
value: i[a.key] || "",
|
|
4171
4174
|
onChange: (m) => {
|
|
4172
|
-
const g = { ...
|
|
4173
|
-
|
|
4175
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4176
|
+
c(g), s && s(n.key, g);
|
|
4174
4177
|
},
|
|
4175
4178
|
required: a.required,
|
|
4176
4179
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4183,10 +4186,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4183
4186
|
/* @__PURE__ */ e(
|
|
4184
4187
|
qe,
|
|
4185
4188
|
{
|
|
4186
|
-
selectedItems:
|
|
4189
|
+
selectedItems: i[a.key] || [],
|
|
4187
4190
|
onSelectionChange: (m) => {
|
|
4188
|
-
const g = { ...
|
|
4189
|
-
|
|
4191
|
+
const g = { ...i, [a.key]: m };
|
|
4192
|
+
c(g), s && s(n.key, g);
|
|
4190
4193
|
},
|
|
4191
4194
|
options: a.options || [],
|
|
4192
4195
|
placeholder: a.placeholder || `Select ${a.label}`,
|
|
@@ -4200,11 +4203,11 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4200
4203
|
/* @__PURE__ */ e(
|
|
4201
4204
|
Ma,
|
|
4202
4205
|
{
|
|
4203
|
-
checked: typeof
|
|
4206
|
+
checked: typeof i[a.key] == "boolean" ? i[a.key] : a.default,
|
|
4204
4207
|
onChange: (m) => {
|
|
4205
4208
|
console.log("Toggle changed:", a.key, m);
|
|
4206
|
-
const g = { ...
|
|
4207
|
-
|
|
4209
|
+
const g = { ...i, [a.key]: m };
|
|
4210
|
+
c(g), s && s(n.key, g);
|
|
4208
4211
|
},
|
|
4209
4212
|
label: a.placeholder || a.label,
|
|
4210
4213
|
disabled: a.disabled ? a.disabled : !1
|
|
@@ -4216,10 +4219,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4216
4219
|
za,
|
|
4217
4220
|
{
|
|
4218
4221
|
label: a.label,
|
|
4219
|
-
value:
|
|
4222
|
+
value: i[a.key] ? new Date(i[a.key]) : null,
|
|
4220
4223
|
onChange: (m) => {
|
|
4221
|
-
const g = { ...
|
|
4222
|
-
|
|
4224
|
+
const g = { ...i, [a.key]: m ? m.toISOString().split("T")[0] : "" };
|
|
4225
|
+
c(g), s && s(n.key, g);
|
|
4223
4226
|
},
|
|
4224
4227
|
placeholder: a.placeholder || "Select date",
|
|
4225
4228
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4231,10 +4234,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4231
4234
|
Gr,
|
|
4232
4235
|
{
|
|
4233
4236
|
label: a.label,
|
|
4234
|
-
value:
|
|
4237
|
+
value: i[a.key] || { from: null, to: null },
|
|
4235
4238
|
onChange: (m) => {
|
|
4236
|
-
const g = { ...
|
|
4237
|
-
|
|
4239
|
+
const g = { ...i, [a.key]: m };
|
|
4240
|
+
c(g), s && s(n.key, g);
|
|
4238
4241
|
},
|
|
4239
4242
|
placeholder: a.placeholder || "Select date range",
|
|
4240
4243
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4246,10 +4249,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4246
4249
|
/* @__PURE__ */ e(
|
|
4247
4250
|
Ba,
|
|
4248
4251
|
{
|
|
4249
|
-
selectedValue: typeof
|
|
4252
|
+
selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
|
|
4250
4253
|
onValueChange: (m) => {
|
|
4251
|
-
const g = { ...
|
|
4252
|
-
|
|
4254
|
+
const g = { ...i, [a.key]: m };
|
|
4255
|
+
c(g), s && s(n.key, g);
|
|
4253
4256
|
},
|
|
4254
4257
|
options: a.options || [],
|
|
4255
4258
|
disabled: a.disabled ? a.disabled : !1,
|
|
@@ -4267,10 +4270,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4267
4270
|
id: `${a.key}-${m.value}`,
|
|
4268
4271
|
name: a.key,
|
|
4269
4272
|
value: m.value,
|
|
4270
|
-
checked:
|
|
4273
|
+
checked: i[a.key] === m.value,
|
|
4271
4274
|
onChange: (g) => {
|
|
4272
|
-
const $ = { ...
|
|
4273
|
-
|
|
4275
|
+
const $ = { ...i, [a.key]: g.target.value };
|
|
4276
|
+
c($), s && s(n.key, $);
|
|
4274
4277
|
},
|
|
4275
4278
|
disabled: a.disabled
|
|
4276
4279
|
}
|
|
@@ -4286,10 +4289,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4286
4289
|
/* @__PURE__ */ e(
|
|
4287
4290
|
he,
|
|
4288
4291
|
{
|
|
4289
|
-
value:
|
|
4292
|
+
value: i[a.key] || "",
|
|
4290
4293
|
onChange: (m) => {
|
|
4291
|
-
const g = { ...
|
|
4292
|
-
|
|
4294
|
+
const g = { ...i, [a.key]: m };
|
|
4295
|
+
c(g), s && s(n.key, g);
|
|
4293
4296
|
},
|
|
4294
4297
|
placeholder: a.placeholder || `Search ${a.label}`,
|
|
4295
4298
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4305,10 +4308,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4305
4308
|
name: a.key,
|
|
4306
4309
|
defaultValue: a.default,
|
|
4307
4310
|
placeholder: a.placeholder || "Select date and time",
|
|
4308
|
-
value:
|
|
4311
|
+
value: i[a.key] || "",
|
|
4309
4312
|
onChange: (m) => {
|
|
4310
|
-
const g = { ...
|
|
4311
|
-
|
|
4313
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4314
|
+
c(g), s && s(n.key, g);
|
|
4312
4315
|
},
|
|
4313
4316
|
required: a.required,
|
|
4314
4317
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4324,10 +4327,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4324
4327
|
name: a.key,
|
|
4325
4328
|
defaultValue: a.default,
|
|
4326
4329
|
placeholder: a.placeholder || "Select time",
|
|
4327
|
-
value:
|
|
4330
|
+
value: i[a.key] || "",
|
|
4328
4331
|
onChange: (m) => {
|
|
4329
|
-
const g = { ...
|
|
4330
|
-
|
|
4332
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4333
|
+
c(g), s && s(n.key, g);
|
|
4331
4334
|
},
|
|
4332
4335
|
required: a.required,
|
|
4333
4336
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4342,10 +4345,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4342
4345
|
type: "color",
|
|
4343
4346
|
name: a.key,
|
|
4344
4347
|
defaultValue: a.default || "#000000",
|
|
4345
|
-
value:
|
|
4348
|
+
value: i[a.key] || "#000000",
|
|
4346
4349
|
onChange: (m) => {
|
|
4347
|
-
const g = { ...
|
|
4348
|
-
|
|
4350
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4351
|
+
c(g), s && s(n.key, g);
|
|
4349
4352
|
},
|
|
4350
4353
|
className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
4351
4354
|
}
|
|
@@ -4359,10 +4362,10 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4359
4362
|
type: "range",
|
|
4360
4363
|
name: a.key,
|
|
4361
4364
|
defaultValue: a.default || a.min || 0,
|
|
4362
|
-
value:
|
|
4365
|
+
value: i[a.key] || a.min || 0,
|
|
4363
4366
|
onChange: (m) => {
|
|
4364
|
-
const g = { ...
|
|
4365
|
-
|
|
4367
|
+
const g = { ...i, [a.key]: m.target.value };
|
|
4368
|
+
c(g), s && s(n.key, g);
|
|
4366
4369
|
},
|
|
4367
4370
|
min: a.min || 0,
|
|
4368
4371
|
max: a.max || 100,
|
|
@@ -4374,7 +4377,7 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4374
4377
|
/* @__PURE__ */ e("span", { children: a.min || 0 }),
|
|
4375
4378
|
/* @__PURE__ */ l("span", { children: [
|
|
4376
4379
|
"Current: ",
|
|
4377
|
-
|
|
4380
|
+
i[a.key] || a.min || 0
|
|
4378
4381
|
] }),
|
|
4379
4382
|
/* @__PURE__ */ e("span", { children: a.max || 100 })
|
|
4380
4383
|
] }),
|
|
@@ -4387,8 +4390,8 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4387
4390
|
type: "file",
|
|
4388
4391
|
name: a.key,
|
|
4389
4392
|
onChange: (m) => {
|
|
4390
|
-
const g = m.target.files[0], $ = { ...
|
|
4391
|
-
|
|
4393
|
+
const g = m.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
|
|
4394
|
+
c($), s && s(n.key, $);
|
|
4392
4395
|
},
|
|
4393
4396
|
accept: a.accept,
|
|
4394
4397
|
className: `w-full ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4401,11 +4404,11 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4401
4404
|
Qa,
|
|
4402
4405
|
{
|
|
4403
4406
|
endpoints: a.endpoints || {},
|
|
4404
|
-
initialData:
|
|
4407
|
+
initialData: i[a.key] || a.initialData || [],
|
|
4405
4408
|
className: a.className || "",
|
|
4406
4409
|
onCollectionChange: (m) => {
|
|
4407
|
-
const g = { ...
|
|
4408
|
-
|
|
4410
|
+
const g = { ...i, [a.key]: m };
|
|
4411
|
+
c(g), s && s(n.key, g);
|
|
4409
4412
|
},
|
|
4410
4413
|
showSearch: a.showSearch !== !1,
|
|
4411
4414
|
allowAdd: a.allowAdd !== !1,
|
|
@@ -4433,7 +4436,7 @@ function Fn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4433
4436
|
const Tn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4434
4437
|
function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
4435
4438
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4436
|
-
const [n, u] = L(t), [
|
|
4439
|
+
const [n, u] = L(t), [i, c] = L(null), [y, b] = L(null);
|
|
4437
4440
|
console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
|
|
4438
4441
|
const [N, a] = L(() => {
|
|
4439
4442
|
const v = r && r[n.key] || [], p = v.length > 0 ? v : [{ id: 0 }];
|
|
@@ -4713,7 +4716,7 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4713
4716
|
{
|
|
4714
4717
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4715
4718
|
onClick: () => {
|
|
4716
|
-
b(v.key),
|
|
4719
|
+
b(v.key), c(h);
|
|
4717
4720
|
},
|
|
4718
4721
|
children: F.length > 0 ? "Edit" : "Assign"
|
|
4719
4722
|
}
|
|
@@ -4818,17 +4821,17 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4818
4821
|
}, []), j = K((v) => {
|
|
4819
4822
|
console.log("[DataTableRenderer] handleAddAudience called with:", v), a((p) => {
|
|
4820
4823
|
const f = [...p];
|
|
4821
|
-
if (
|
|
4824
|
+
if (i !== null && y && f[i]) {
|
|
4822
4825
|
const k = v.pendingInvites || [], d = k.filter((F) => F.type === "User"), h = k.filter((F) => F.type === "Group"), x = k.filter((F) => F.type === "Role");
|
|
4823
|
-
f[
|
|
4824
|
-
users: [...f[
|
|
4825
|
-
groups: [...f[
|
|
4826
|
-
roles: [...f[
|
|
4827
|
-
}, console.log("[DataTableRenderer] Updated audience data:", f[
|
|
4826
|
+
f[i][y] = {
|
|
4827
|
+
users: [...f[i][y]?.users || [], ...d],
|
|
4828
|
+
groups: [...f[i][y]?.groups || [], ...h],
|
|
4829
|
+
roles: [...f[i][y]?.roles || [], ...x]
|
|
4830
|
+
}, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
|
|
4828
4831
|
}
|
|
4829
4832
|
return f;
|
|
4830
|
-
}),
|
|
4831
|
-
}, [
|
|
4833
|
+
}), c(null), b(null);
|
|
4834
|
+
}, [i, y]);
|
|
4832
4835
|
return /* @__PURE__ */ l("div", { children: [
|
|
4833
4836
|
/* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
|
|
4834
4837
|
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4883,18 +4886,18 @@ function An({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4883
4886
|
p
|
|
4884
4887
|
)) })
|
|
4885
4888
|
] }) }),
|
|
4886
|
-
|
|
4887
|
-
const v = N[
|
|
4888
|
-
users: N[
|
|
4889
|
-
groups: N[
|
|
4890
|
-
roles: N[
|
|
4889
|
+
i !== null && (() => {
|
|
4890
|
+
const v = N[i] && N[i][y] ? {
|
|
4891
|
+
users: N[i][y].users || [],
|
|
4892
|
+
groups: N[i][y].groups || [],
|
|
4893
|
+
roles: N[i][y].roles || []
|
|
4891
4894
|
} : { users: [], groups: [], roles: [] };
|
|
4892
|
-
return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[
|
|
4895
|
+
return console.log("[DataTableRenderer] Opening modal with existing data:", v), console.log("[DataTableRenderer] Row data:", N[i]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
|
|
4893
4896
|
fn,
|
|
4894
4897
|
{
|
|
4895
4898
|
isOpen: !0,
|
|
4896
4899
|
onClose: () => {
|
|
4897
|
-
|
|
4900
|
+
c(null), b(null);
|
|
4898
4901
|
},
|
|
4899
4902
|
onFinalSubmit: j,
|
|
4900
4903
|
existingShares: v,
|
|
@@ -4966,8 +4969,8 @@ const ma = () => {
|
|
|
4966
4969
|
showSearch: o = !0,
|
|
4967
4970
|
allowAdd: n = !0,
|
|
4968
4971
|
allowEdit: u = !0,
|
|
4969
|
-
allowDelete:
|
|
4970
|
-
allowReorder:
|
|
4972
|
+
allowDelete: i = !0,
|
|
4973
|
+
allowReorder: c = !0,
|
|
4971
4974
|
initialData: y = null
|
|
4972
4975
|
// Add prop for initial demo data
|
|
4973
4976
|
}) => {
|
|
@@ -5039,18 +5042,18 @@ const ma = () => {
|
|
|
5039
5042
|
console.log(A), le.error("Failed to save collection");
|
|
5040
5043
|
}
|
|
5041
5044
|
}, p = async (D) => {
|
|
5042
|
-
if (
|
|
5045
|
+
if (i)
|
|
5043
5046
|
try {
|
|
5044
5047
|
await sn(`${t.collectionUpdate}/${D.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
|
|
5045
5048
|
} catch (A) {
|
|
5046
5049
|
console.log(A), le.error("Failed to delete collection");
|
|
5047
5050
|
}
|
|
5048
5051
|
}, f = (D, A, M) => {
|
|
5049
|
-
if (!
|
|
5052
|
+
if (!c || !A || !M || A === M) return D;
|
|
5050
5053
|
const T = D.findIndex((H) => H.id === A), C = D.findIndex((H) => H.id === M);
|
|
5051
5054
|
if (T === -1 || C === -1) return D;
|
|
5052
5055
|
const I = [...D], [G] = I.splice(T, 1);
|
|
5053
|
-
return I.splice(C, 0, G), I.map((H,
|
|
5056
|
+
return I.splice(C, 0, G), I.map((H, ie) => ({ ...H, order: ie + 1 }));
|
|
5054
5057
|
}, k = async (D) => {
|
|
5055
5058
|
const A = D.map((M) => ({
|
|
5056
5059
|
id: M.id,
|
|
@@ -5063,7 +5066,7 @@ const ma = () => {
|
|
|
5063
5066
|
console.log(M), le.error("Failed to save order", { autoClose: 2500 });
|
|
5064
5067
|
}
|
|
5065
5068
|
}, d = (D, A) => {
|
|
5066
|
-
|
|
5069
|
+
c && (D.dataTransfer.effectAllowed = "move", D.dataTransfer.setData("text/plain", String(A)), O(A));
|
|
5067
5070
|
}, h = (D) => {
|
|
5068
5071
|
$ && D !== R && S(D);
|
|
5069
5072
|
}, x = (D) => {
|
|
@@ -5161,7 +5164,7 @@ const ma = () => {
|
|
|
5161
5164
|
] })
|
|
5162
5165
|
] }) : /* @__PURE__ */ l(ee, { children: [
|
|
5163
5166
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5164
|
-
|
|
5167
|
+
c && /* @__PURE__ */ e(
|
|
5165
5168
|
"span",
|
|
5166
5169
|
{
|
|
5167
5170
|
role: "button",
|
|
@@ -5185,7 +5188,7 @@ const ma = () => {
|
|
|
5185
5188
|
children: /* @__PURE__ */ e(_t, { color: "#767676" })
|
|
5186
5189
|
}
|
|
5187
5190
|
),
|
|
5188
|
-
|
|
5191
|
+
i && /* @__PURE__ */ e(
|
|
5189
5192
|
"span",
|
|
5190
5193
|
{
|
|
5191
5194
|
className: M === 0 && !D.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
@@ -5206,14 +5209,14 @@ const ma = () => {
|
|
|
5206
5209
|
label: o = "Manage Collections",
|
|
5207
5210
|
description: n = "",
|
|
5208
5211
|
endpoints: u = {},
|
|
5209
|
-
initialData:
|
|
5210
|
-
showSearch:
|
|
5212
|
+
initialData: i = null,
|
|
5213
|
+
showSearch: c = !0,
|
|
5211
5214
|
allowAdd: y = !0,
|
|
5212
5215
|
allowEdit: b = !0,
|
|
5213
5216
|
allowDelete: N = !0,
|
|
5214
5217
|
allowReorder: a = !0,
|
|
5215
5218
|
className: w = ""
|
|
5216
|
-
} = t, m = r?.[t.key] ||
|
|
5219
|
+
} = t, m = r?.[t.key] || i || [], g = Array.isArray(m) ? m : [];
|
|
5217
5220
|
return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5218
5221
|
(o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
5219
5222
|
o && /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 mb-1", children: o }),
|
|
@@ -5228,7 +5231,7 @@ const ma = () => {
|
|
|
5228
5231
|
onCollectionChange: (O) => {
|
|
5229
5232
|
s && s(t.key, O);
|
|
5230
5233
|
},
|
|
5231
|
-
showSearch:
|
|
5234
|
+
showSearch: c,
|
|
5232
5235
|
allowAdd: y,
|
|
5233
5236
|
allowEdit: b,
|
|
5234
5237
|
allowDelete: N,
|
|
@@ -5259,7 +5262,7 @@ function Bn({
|
|
|
5259
5262
|
onCancel: o,
|
|
5260
5263
|
onSave: n
|
|
5261
5264
|
}) {
|
|
5262
|
-
const [u,
|
|
5265
|
+
const [u, i] = re.useState(r), [c, y] = re.useState(null), [b, N] = L(!1), [a, w] = L(!1), [m, g] = L({}), $ = `${be()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, O = $, [R, S] = L(1), B = (f) => {
|
|
5263
5266
|
if (!r || !r.configuration)
|
|
5264
5267
|
return f;
|
|
5265
5268
|
const k = {}, d = f?.configuration || {};
|
|
@@ -5334,7 +5337,7 @@ function Bn({
|
|
|
5334
5337
|
N(!1);
|
|
5335
5338
|
}
|
|
5336
5339
|
};
|
|
5337
|
-
r && (
|
|
5340
|
+
r && (i(r), t ? f() : P());
|
|
5338
5341
|
}, [r, R, t, s]);
|
|
5339
5342
|
const E = (f, k) => {
|
|
5340
5343
|
y((d) => ({
|
|
@@ -5346,16 +5349,16 @@ function Bn({
|
|
|
5346
5349
|
});
|
|
5347
5350
|
}, V = () => {
|
|
5348
5351
|
const f = {};
|
|
5349
|
-
return !u || !
|
|
5352
|
+
return !u || !c || u.configuration.forEach((k) => {
|
|
5350
5353
|
if (k.type === "section")
|
|
5351
5354
|
k.fields.forEach((d) => {
|
|
5352
5355
|
if (d.required) {
|
|
5353
|
-
const h =
|
|
5356
|
+
const h = c[k.key]?.[d.key];
|
|
5354
5357
|
(!h || typeof h == "string" && h.trim() === "") && (f[k.key] || (f[k.key] = {}), f[k.key][d.key] = `${d.label} is required`);
|
|
5355
5358
|
}
|
|
5356
5359
|
});
|
|
5357
5360
|
else if (k.type === "datatable") {
|
|
5358
|
-
const d =
|
|
5361
|
+
const d = c[k.key];
|
|
5359
5362
|
Array.isArray(d) && d.forEach((h, x) => {
|
|
5360
5363
|
k.fields.forEach((F) => {
|
|
5361
5364
|
if (F.required) {
|
|
@@ -5383,11 +5386,11 @@ function Bn({
|
|
|
5383
5386
|
try {
|
|
5384
5387
|
w(!0);
|
|
5385
5388
|
const d = {};
|
|
5386
|
-
|
|
5389
|
+
c && Object.keys(c).forEach((x) => {
|
|
5387
5390
|
const F = r?.configuration?.find(
|
|
5388
5391
|
(z) => z.key === x && z.type === "datatable"
|
|
5389
5392
|
);
|
|
5390
|
-
F && Array.isArray(
|
|
5393
|
+
F && Array.isArray(c[x]) ? d[x] = c[x].map((z) => {
|
|
5391
5394
|
const q = { id: z.id || 0 };
|
|
5392
5395
|
return F.fields && F.fields.forEach((D) => {
|
|
5393
5396
|
if (D.fieldtype === "audience") {
|
|
@@ -5400,13 +5403,13 @@ function Bn({
|
|
|
5400
5403
|
} else
|
|
5401
5404
|
q[D.key] = z[D.key] || "";
|
|
5402
5405
|
}), q;
|
|
5403
|
-
}) : d[x] =
|
|
5406
|
+
}) : d[x] = c[x];
|
|
5404
5407
|
});
|
|
5405
5408
|
let h = await Fe(O, d);
|
|
5406
5409
|
if (console.log(), h && h.status != "fail") {
|
|
5407
5410
|
g({});
|
|
5408
5411
|
const x = h.message || "Configuration has been saved successfully";
|
|
5409
|
-
ve.success(x), n && typeof n == "function" && n(
|
|
5412
|
+
ve.success(x), n && typeof n == "function" && n(c);
|
|
5410
5413
|
} else
|
|
5411
5414
|
throw ve.error(h?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5412
5415
|
} catch (d) {
|
|
@@ -5428,7 +5431,7 @@ function Bn({
|
|
|
5428
5431
|
return /* @__PURE__ */ e("div", { className: "min-h-screen flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-gray-500", children: "No configuration available" }) });
|
|
5429
5432
|
const p = r?.configuration || u?.configuration;
|
|
5430
5433
|
return Q(() => {
|
|
5431
|
-
s && r ? (!
|
|
5434
|
+
s && r ? (!c || Object.keys(c).length === 0) && P() : s && !r && P();
|
|
5432
5435
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5433
5436
|
/* @__PURE__ */ l(
|
|
5434
5437
|
"div",
|
|
@@ -5444,7 +5447,7 @@ function Bn({
|
|
|
5444
5447
|
d,
|
|
5445
5448
|
{
|
|
5446
5449
|
item: f,
|
|
5447
|
-
data:
|
|
5450
|
+
data: c,
|
|
5448
5451
|
updateHandler: E,
|
|
5449
5452
|
validationErrors: m
|
|
5450
5453
|
},
|
|
@@ -5482,7 +5485,7 @@ const us = ({
|
|
|
5482
5485
|
appid: r = "Configuration-Page",
|
|
5483
5486
|
disableApi: s = !1
|
|
5484
5487
|
}) => {
|
|
5485
|
-
const [o, n] = L(0), [u,
|
|
5488
|
+
const [o, n] = L(0), [u, i] = L(!1), [c, y] = L(r), {
|
|
5486
5489
|
pageHeader: b = {},
|
|
5487
5490
|
appletHeader: N = {},
|
|
5488
5491
|
breadcrumb: a = [],
|
|
@@ -5535,9 +5538,9 @@ const us = ({
|
|
|
5535
5538
|
label: p.text,
|
|
5536
5539
|
href: p.href || "#"
|
|
5537
5540
|
})), R = K(() => {
|
|
5538
|
-
console.log("handleCancelRequest called - showing modal"),
|
|
5541
|
+
console.log("handleCancelRequest called - showing modal"), i(!0);
|
|
5539
5542
|
}, []), S = K((p) => {
|
|
5540
|
-
|
|
5543
|
+
i(!1), p.primary ? (console.log("User confirmed cancel - navigating back"), window.history.back()) : console.log("User cancelled the cancel action - modal closed, data preserved");
|
|
5541
5544
|
}, []), B = () => {
|
|
5542
5545
|
for (const p of g)
|
|
5543
5546
|
if (p.type === "section" && p.fields) {
|
|
@@ -5559,7 +5562,7 @@ const us = ({
|
|
|
5559
5562
|
subHeading: "Application configuration and details",
|
|
5560
5563
|
tags: [],
|
|
5561
5564
|
...N,
|
|
5562
|
-
heading:
|
|
5565
|
+
heading: c
|
|
5563
5566
|
// Ensure displayname always overrides config heading
|
|
5564
5567
|
}, V = {
|
|
5565
5568
|
about: "This application provides comprehensive functionality for your organization.",
|
|
@@ -5715,8 +5718,8 @@ const hs = ({
|
|
|
5715
5718
|
apiRef: n,
|
|
5716
5719
|
// preferred
|
|
5717
5720
|
onAdd: u,
|
|
5718
|
-
onFilterOpen:
|
|
5719
|
-
addBtnText:
|
|
5721
|
+
onFilterOpen: i,
|
|
5722
|
+
addBtnText: c = "Add",
|
|
5720
5723
|
// Feature toggles
|
|
5721
5724
|
showSearch: y = !0,
|
|
5722
5725
|
showColumnChooser: b = !0,
|
|
@@ -5817,7 +5820,7 @@ const hs = ({
|
|
|
5817
5820
|
Z,
|
|
5818
5821
|
{
|
|
5819
5822
|
icon: Wt,
|
|
5820
|
-
onClick:
|
|
5823
|
+
onClick: i,
|
|
5821
5824
|
size: "small",
|
|
5822
5825
|
ariaLabel: "Filters",
|
|
5823
5826
|
category: "secondary",
|
|
@@ -5872,12 +5875,12 @@ const hs = ({
|
|
|
5872
5875
|
$ && u && /* @__PURE__ */ e(
|
|
5873
5876
|
Z,
|
|
5874
5877
|
{
|
|
5875
|
-
label:
|
|
5878
|
+
label: c,
|
|
5876
5879
|
icon: Ht,
|
|
5877
5880
|
onClick: u,
|
|
5878
5881
|
size: "small",
|
|
5879
5882
|
ariaLabel: "Add New",
|
|
5880
|
-
title:
|
|
5883
|
+
title: c
|
|
5881
5884
|
}
|
|
5882
5885
|
)
|
|
5883
5886
|
] })
|
|
@@ -5892,8 +5895,8 @@ function ps(t) {
|
|
|
5892
5895
|
pageIndex: n = 1,
|
|
5893
5896
|
// 1-based
|
|
5894
5897
|
pageSize: u = 10,
|
|
5895
|
-
allowPaging:
|
|
5896
|
-
allowSorting:
|
|
5898
|
+
allowPaging: i = !0,
|
|
5899
|
+
allowSorting: c = !0,
|
|
5897
5900
|
allowFiltering: y = !1,
|
|
5898
5901
|
allowGrouping: b = !1,
|
|
5899
5902
|
allowReordering: N = !0,
|
|
@@ -5918,8 +5921,8 @@ function ps(t) {
|
|
|
5918
5921
|
...d
|
|
5919
5922
|
} = v || {}, h = ne(() => {
|
|
5920
5923
|
const C = [wr];
|
|
5921
|
-
return
|
|
5922
|
-
}, [
|
|
5924
|
+
return c && C.push(Cr), y && C.push(Sr), b && C.push(Dr), $ && C.push($r), w && C.push(Fr), m && C.push(Tr), g && C.push(Ar), a && C.push(Er), N && C.push(Rr), C.push(Ir), C;
|
|
5925
|
+
}, [c, y, b, $, w, m, g, a, N]), x = ne(() => {
|
|
5923
5926
|
const C = () => p.current, I = (G, H) => {
|
|
5924
5927
|
!H && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${G} requested but related service/feature is disabled.`);
|
|
5925
5928
|
};
|
|
@@ -5960,20 +5963,20 @@ function ps(t) {
|
|
|
5960
5963
|
pageSizes: !0,
|
|
5961
5964
|
...f || {}
|
|
5962
5965
|
}), [n, u, s, f]), q = ne(() => {
|
|
5963
|
-
if (!
|
|
5966
|
+
if (!c || !k) return;
|
|
5964
5967
|
const C = (k.columns || []).map((I) => ({
|
|
5965
5968
|
...I,
|
|
5966
5969
|
direction: F(I.direction || I.dir)
|
|
5967
5970
|
}));
|
|
5968
5971
|
return { allowUnsort: !0, ...k, columns: C };
|
|
5969
|
-
}, [k,
|
|
5970
|
-
const I = p.current, G = C?.requestType, H = G === "paging" ? "paging" : G === "sorting" ? "sorting" : G === "searching" ? "searching" : G === "filtering" ? "filtering" : G === "grouping" ? "grouping" : G === "reorder" ? "reorder" : G === "columnstate" ? "columnstate" : "other",
|
|
5972
|
+
}, [k, c]), D = (C) => {
|
|
5973
|
+
const I = p.current, G = C?.requestType, H = G === "paging" ? "paging" : G === "sorting" ? "sorting" : G === "searching" ? "searching" : G === "filtering" ? "filtering" : G === "grouping" ? "grouping" : G === "reorder" ? "reorder" : G === "columnstate" ? "columnstate" : "other", ie = C?.pageSize ?? I?.pageSettings?.pageSize ?? u, ce = C?.currentPage ?? I?.pageSettings?.currentPage ?? n, je = C?.columnName && C?.direction ? [{ field: C.columnName, dir: F(C.direction) }] : (I?.sortSettings?.columns || []).map((Ce) => ({
|
|
5971
5974
|
field: Ce.field,
|
|
5972
5975
|
dir: F(Ce.direction ?? Ce.dir)
|
|
5973
5976
|
})), Ge = C?.searchString ?? "", _e = C?.columns ?? I?.filterSettings?.columns ?? [];
|
|
5974
5977
|
return {
|
|
5975
5978
|
reason: H,
|
|
5976
|
-
page: { index:
|
|
5979
|
+
page: { index: ce, size: ie, skip: (ce - 1) * ie, take: ie },
|
|
5977
5980
|
sort: je,
|
|
5978
5981
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
5979
5982
|
search: Ge,
|
|
@@ -5988,8 +5991,8 @@ function ps(t) {
|
|
|
5988
5991
|
ref: p,
|
|
5989
5992
|
dataSource: r,
|
|
5990
5993
|
height: O,
|
|
5991
|
-
allowPaging:
|
|
5992
|
-
allowSorting:
|
|
5994
|
+
allowPaging: i,
|
|
5995
|
+
allowSorting: c,
|
|
5993
5996
|
allowFiltering: y,
|
|
5994
5997
|
allowGrouping: b,
|
|
5995
5998
|
allowReordering: N,
|
|
@@ -6016,8 +6019,8 @@ function ps(t) {
|
|
|
6016
6019
|
return S && C.push(/* @__PURE__ */ e(ra, { type: "checkbox", width: "50" }, "__checkbox__")), B.forEach((I, G) => {
|
|
6017
6020
|
const {
|
|
6018
6021
|
field: H,
|
|
6019
|
-
headerText:
|
|
6020
|
-
width:
|
|
6022
|
+
headerText: ie,
|
|
6023
|
+
width: ce,
|
|
6021
6024
|
textAlign: je = "Left",
|
|
6022
6025
|
template: Ge,
|
|
6023
6026
|
isPrimaryKey: _e,
|
|
@@ -6037,8 +6040,8 @@ function ps(t) {
|
|
|
6037
6040
|
ra,
|
|
6038
6041
|
{
|
|
6039
6042
|
field: H,
|
|
6040
|
-
headerText:
|
|
6041
|
-
width:
|
|
6043
|
+
headerText: ie,
|
|
6044
|
+
width: ce,
|
|
6042
6045
|
textAlign: je,
|
|
6043
6046
|
template: Ge,
|
|
6044
6047
|
isPrimaryKey: _e,
|
|
@@ -6072,7 +6075,7 @@ export {
|
|
|
6072
6075
|
Vr as Button,
|
|
6073
6076
|
Aa as Checkbox,
|
|
6074
6077
|
ps as CustomDataGrid,
|
|
6075
|
-
|
|
6078
|
+
is as CustomDialog,
|
|
6076
6079
|
hs as CustomGridToolbar,
|
|
6077
6080
|
ds as CustomTab,
|
|
6078
6081
|
za as DatePicker,
|
|
@@ -6099,7 +6102,7 @@ export {
|
|
|
6099
6102
|
ms as ToastProvider,
|
|
6100
6103
|
Ma as ToggleSwitch,
|
|
6101
6104
|
es as Tooltip,
|
|
6102
|
-
|
|
6105
|
+
cs as TreeView,
|
|
6103
6106
|
Z as UnifyedCoreButton,
|
|
6104
6107
|
as as WizardModal,
|
|
6105
6108
|
Ga as adGroupsListSearchApi,
|