unifyedx-storybook-new 0.2.15 → 0.2.16
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.
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import ae, { useState as B, useMemo as ce, useId as ea, Fragment as
|
|
3
|
-
import { a as
|
|
4
|
-
import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as
|
|
2
|
+
import ae, { useState as B, useMemo as ce, useId as ea, Fragment as Q, useEffect as X, useCallback as K, useRef as ue } from "react";
|
|
3
|
+
import { a as J, U as ut, X as ye, P as _, L as mt, C as je, b as Ge, f as Ue, d as va, D as Na, F as ht, e as pt, h as gt, T as Ve, u as yt, i as ft, I as bt, j as vt, k as Nt, l as xt, m as kt, n as wt, S as xa, o as ka, M as Ct, p as St, q as wa, r as Dt, A as Ft, E as $t, s as Tt, t as At, v as Et, w as Rt, x as Ca, y as It, z as Sa, B as Da, G as zt, H as Pt, J as Bt, K as qe, N as aa, O as ta, Q as Lt, R as Ot, V as Fa, W as Mt, Y as sa, Z as Ut, _ as Vt, $ as $a, a0 as qt, a1 as jt, a2 as Gt, a3 as _t, a4 as Wt, a5 as Yt, a6 as Jt, a7 as Qt, a8 as Xt, a9 as Zt, aa as Ht, ab as Kt, ac as er, ad as ar, ae as tr } from "./vendor-zgKTz69B.js";
|
|
4
|
+
import { Popover as rr, PopoverButton as nr, PopoverPanel as sr, Transition as oe, Dialog as me, TransitionChild as ge, DialogPanel as Se, DialogTitle as _e, TabGroup as lr, TabList as or, Tab as re, TabPanels as ir, RadioGroup as ze, Listbox as Z, ListboxButton as cr, ListboxOptions as dr, ListboxOption as ur, SwitchGroup as mr, Switch as Ze, Menu as hr, MenuButton as pr, Portal as gr, MenuItems as yr, MenuItem as fr, DialogBackdrop as br } from "@headlessui/react";
|
|
5
5
|
import { motion as ne, AnimatePresence as be } from "framer-motion";
|
|
6
6
|
import { d as vr } from "./vendor-lodash-BD0xlZyL.js";
|
|
7
7
|
import { useFloating as Ta, offset as Aa, flip as Ea, shift as Ra, autoUpdate as Ia, useClick as Nr, useDismiss as xr, useInteractions as kr, FloatingPortal as wr } from "@floating-ui/react";
|
|
8
8
|
import He, { debounce as Cr } from "lodash";
|
|
9
9
|
import { toast as le, ToastContainer as Sr, Slide as Dr } from "react-toastify";
|
|
10
10
|
import "react-toastify/dist/ReactToastify.css";
|
|
11
|
-
import { P as
|
|
11
|
+
import { P as Fr, S as $r, F as Tr, G as Ar, a as Er, E as Rr, b as Ir, C as zr, R as Pr, c as Br, d as Lr, e as Or, f as Mr, I as Ur, g as ia } from "./vendor-syncfusion-DGcZfoFG.js";
|
|
12
12
|
const Vr = (t) => {
|
|
13
13
|
let r = 2166136261;
|
|
14
14
|
for (let s = 0; s < t.length; s++)
|
|
15
15
|
r ^= t.charCodeAt(s), r += (r << 1) + (r << 4) + (r << 7) + (r << 8) + (r << 24);
|
|
16
16
|
return r >>> 0;
|
|
17
17
|
}, qr = (t) => {
|
|
18
|
-
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(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}%)`,
|
|
19
|
-
return { bg: y, text:
|
|
18
|
+
const r = (t ?? "").trim().toLowerCase(), s = parseInt((r.match(/\d+$/) ?? [0])[0], 10) || 0, o = Vr(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}%)`, v = `hsl(${n}, ${u}%, ${i}%)`;
|
|
19
|
+
return { bg: y, text: v };
|
|
20
20
|
}, jr = (t = "") => t.split(" ").map((r) => r[0]).slice(0, 2).join("").toUpperCase(), za = ({
|
|
21
21
|
src: t,
|
|
22
22
|
name: r,
|
|
@@ -29,16 +29,16 @@ const Vr = (t) => {
|
|
|
29
29
|
className: u,
|
|
30
30
|
...i
|
|
31
31
|
}) => {
|
|
32
|
-
const [c, y] = B(!1),
|
|
32
|
+
const [c, y] = B(!1), v = ce(() => qr(r), []), x = t && !c, a = !x && r, k = !x && !r, h = J(
|
|
33
33
|
"avatar-container",
|
|
34
34
|
`avatar--size-${s}`,
|
|
35
35
|
u
|
|
36
|
-
), g =
|
|
37
|
-
return /* @__PURE__ */ l("div", { className:
|
|
36
|
+
), g = x ? "transparent" : o || v.bg, $ = n || v.text;
|
|
37
|
+
return /* @__PURE__ */ l("div", { className: h, style: {
|
|
38
38
|
backgroundColor: g,
|
|
39
39
|
color: $
|
|
40
40
|
}, ...i, children: [
|
|
41
|
-
|
|
41
|
+
x && /* @__PURE__ */ e(
|
|
42
42
|
"img",
|
|
43
43
|
{
|
|
44
44
|
src: t,
|
|
@@ -74,14 +74,14 @@ const Vr = (t) => {
|
|
|
74
74
|
className: c,
|
|
75
75
|
...y
|
|
76
76
|
}) => {
|
|
77
|
-
const
|
|
77
|
+
const v = J(
|
|
78
78
|
"badge",
|
|
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:
|
|
84
|
+
return /* @__PURE__ */ l("span", { className: v, style: u && i ? {
|
|
85
85
|
backgroundColor: u,
|
|
86
86
|
color: i,
|
|
87
87
|
borderColor: "#ff0000"
|
|
@@ -120,15 +120,15 @@ const Vr = (t) => {
|
|
|
120
120
|
};
|
|
121
121
|
Gr.propTypes = {
|
|
122
122
|
/** Is this the principal call to action on the page? */
|
|
123
|
-
primary:
|
|
123
|
+
primary: _.bool,
|
|
124
124
|
/** What background color to use */
|
|
125
|
-
backgroundColor:
|
|
125
|
+
backgroundColor: _.string,
|
|
126
126
|
/** How large should the button be? */
|
|
127
|
-
size:
|
|
127
|
+
size: _.oneOf(["small", "medium", "large"]),
|
|
128
128
|
/** Button contents */
|
|
129
|
-
label:
|
|
129
|
+
label: _.string.isRequired,
|
|
130
130
|
/** Optional click handler */
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: _.func
|
|
132
132
|
};
|
|
133
133
|
const _r = {
|
|
134
134
|
small: "btn-sm",
|
|
@@ -137,7 +137,7 @@ const _r = {
|
|
|
137
137
|
}, Wr = {
|
|
138
138
|
primary: "btn-primary",
|
|
139
139
|
secondary: "btn-secondary"
|
|
140
|
-
},
|
|
140
|
+
}, H = ({
|
|
141
141
|
dataTestId: t,
|
|
142
142
|
title: r,
|
|
143
143
|
type: s = "button",
|
|
@@ -149,16 +149,16 @@ const _r = {
|
|
|
149
149
|
icon: c,
|
|
150
150
|
// Renamed for clarity, expecting a component type e.g., CheckCircle
|
|
151
151
|
disabled: y = !1,
|
|
152
|
-
size:
|
|
153
|
-
label:
|
|
152
|
+
size: v = "medium",
|
|
153
|
+
label: x,
|
|
154
154
|
children: a,
|
|
155
155
|
// ✅ Add children to the props list
|
|
156
156
|
onClick: k,
|
|
157
|
-
...
|
|
157
|
+
...h
|
|
158
158
|
}) => {
|
|
159
|
-
const g = y || u, $ = c && !
|
|
159
|
+
const g = y || u, $ = c && !x, L = J(
|
|
160
160
|
"btn-base",
|
|
161
|
-
_r[
|
|
161
|
+
_r[v],
|
|
162
162
|
Wr[i],
|
|
163
163
|
{
|
|
164
164
|
"is-loading": u,
|
|
@@ -174,12 +174,12 @@ const _r = {
|
|
|
174
174
|
className: L,
|
|
175
175
|
disabled: g,
|
|
176
176
|
onClick: k,
|
|
177
|
-
title: r || $ && o || (typeof
|
|
178
|
-
"aria-label": o || $ && r || (typeof
|
|
179
|
-
...
|
|
177
|
+
title: r || $ && o || (typeof x == "string" ? x : void 0),
|
|
178
|
+
"aria-label": o || $ && r || (typeof x == "string" ? x : void 0),
|
|
179
|
+
...h,
|
|
180
180
|
children: u ? /* @__PURE__ */ e(mt, { className: "loader-spin", "data-testid": "button-loader" }) : /* @__PURE__ */ l(ee, { children: [
|
|
181
|
-
c && /* @__PURE__ */ e(c, { size:
|
|
182
|
-
|
|
181
|
+
c && /* @__PURE__ */ e(c, { size: v === "large" ? 20 : 16 }),
|
|
182
|
+
x,
|
|
183
183
|
a,
|
|
184
184
|
" "
|
|
185
185
|
] })
|
|
@@ -218,13 +218,13 @@ const _r = {
|
|
|
218
218
|
onChange: i,
|
|
219
219
|
...c
|
|
220
220
|
}) => {
|
|
221
|
-
const y = ea(),
|
|
221
|
+
const y = ea(), v = r || y;
|
|
222
222
|
return /* @__PURE__ */ l("div", { className: `checkbox-container ${o || ""}`, children: [
|
|
223
|
-
/* @__PURE__ */ l("label", { htmlFor:
|
|
223
|
+
/* @__PURE__ */ l("label", { htmlFor: v, className: "checkbox-wrapper", children: [
|
|
224
224
|
/* @__PURE__ */ e(
|
|
225
225
|
"input",
|
|
226
226
|
{
|
|
227
|
-
id:
|
|
227
|
+
id: v,
|
|
228
228
|
type: "checkbox",
|
|
229
229
|
ref: n,
|
|
230
230
|
className: "checkbox-input",
|
|
@@ -236,7 +236,7 @@ const _r = {
|
|
|
236
236
|
/* @__PURE__ */ e(
|
|
237
237
|
"div",
|
|
238
238
|
{
|
|
239
|
-
className:
|
|
239
|
+
className: J("checkbox-box", {
|
|
240
240
|
"checkbox-box--checked": u,
|
|
241
241
|
"checkbox-box--error": !!s
|
|
242
242
|
}),
|
|
@@ -259,10 +259,10 @@ const _r = {
|
|
|
259
259
|
className: c,
|
|
260
260
|
...y
|
|
261
261
|
}) => {
|
|
262
|
-
const
|
|
263
|
-
|
|
262
|
+
const v = (x) => {
|
|
263
|
+
x.stopPropagation(), x.preventDefault(), s?.();
|
|
264
264
|
};
|
|
265
|
-
return /* @__PURE__ */ l("div", { className:
|
|
265
|
+
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", c), children: [
|
|
266
266
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "datepicker-input", children: n }),
|
|
267
267
|
/* @__PURE__ */ l(Ba, { children: [
|
|
268
268
|
/* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -271,7 +271,7 @@ const _r = {
|
|
|
271
271
|
{
|
|
272
272
|
id: "datepicker-input",
|
|
273
273
|
type: "button",
|
|
274
|
-
className:
|
|
274
|
+
className: J("datepicker-trigger", {
|
|
275
275
|
"datepicker-trigger--error": !!u,
|
|
276
276
|
"datepicker-trigger--disabled": i
|
|
277
277
|
}),
|
|
@@ -287,7 +287,7 @@ const _r = {
|
|
|
287
287
|
"button",
|
|
288
288
|
{
|
|
289
289
|
type: "button",
|
|
290
|
-
onClick:
|
|
290
|
+
onClick: v,
|
|
291
291
|
className: "datepicker-clear-button",
|
|
292
292
|
"aria-label": "Clear selected date",
|
|
293
293
|
children: /* @__PURE__ */ e(ye, { size: 16 })
|
|
@@ -319,14 +319,14 @@ const _r = {
|
|
|
319
319
|
className: c,
|
|
320
320
|
...y
|
|
321
321
|
}) => {
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
}, k =
|
|
325
|
-
Ue(
|
|
322
|
+
const v = t?.from, x = t?.to, a = (h) => {
|
|
323
|
+
h.stopPropagation(), h.preventDefault(), s?.();
|
|
324
|
+
}, k = v && x ? /* @__PURE__ */ l(ee, { children: [
|
|
325
|
+
Ue(v, "MMM d, y"),
|
|
326
326
|
" - ",
|
|
327
|
-
Ue(
|
|
327
|
+
Ue(x, "MMM d, y")
|
|
328
328
|
] }) : /* @__PURE__ */ e("span", { className: "datepicker-placeholder", children: o });
|
|
329
|
-
return /* @__PURE__ */ l("div", { className:
|
|
329
|
+
return /* @__PURE__ */ l("div", { className: J("datepicker-wrapper", c), children: [
|
|
330
330
|
n && /* @__PURE__ */ e("label", { className: "datepicker-label", htmlFor: "daterangepicker-input", children: n }),
|
|
331
331
|
/* @__PURE__ */ l(Ba, { children: [
|
|
332
332
|
/* @__PURE__ */ e(La, { asChild: !0, children: /* @__PURE__ */ l("div", { className: "datepicker-input-container", children: [
|
|
@@ -335,19 +335,19 @@ const _r = {
|
|
|
335
335
|
{
|
|
336
336
|
id: "daterangepicker-input",
|
|
337
337
|
type: "button",
|
|
338
|
-
className:
|
|
338
|
+
className: J("datepicker-trigger", {
|
|
339
339
|
"datepicker-trigger--error": !!u,
|
|
340
340
|
"datepicker-trigger--disabled": i
|
|
341
341
|
}),
|
|
342
342
|
disabled: i,
|
|
343
|
-
"aria-label":
|
|
343
|
+
"aria-label": v && x ? `Selected range is ${k}` : o,
|
|
344
344
|
children: [
|
|
345
345
|
/* @__PURE__ */ e(va, { className: "datepicker-icon" }),
|
|
346
346
|
/* @__PURE__ */ e("span", { className: "datepicker-value", children: k })
|
|
347
347
|
]
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
|
|
350
|
+
v && s && !i && /* @__PURE__ */ e(
|
|
351
351
|
"button",
|
|
352
352
|
{
|
|
353
353
|
type: "button",
|
|
@@ -627,16 +627,16 @@ const _r = {
|
|
|
627
627
|
validFiles: i = [],
|
|
628
628
|
rejectedFiles: c = [],
|
|
629
629
|
handleRemoveValidFile: y,
|
|
630
|
-
handleRemoveRejectedFile:
|
|
631
|
-
handleSubmit:
|
|
630
|
+
handleRemoveRejectedFile: v,
|
|
631
|
+
handleSubmit: x,
|
|
632
632
|
isSubmitting: a,
|
|
633
633
|
formErrors: k,
|
|
634
634
|
// --- UI Text ---
|
|
635
|
-
title:
|
|
635
|
+
title: h = "Upload Files",
|
|
636
636
|
subHeading: g = "Supports PNG, JPG, PDF. Max size: 50MB."
|
|
637
637
|
}) => {
|
|
638
638
|
const $ = i.length > 0 || c.length > 0;
|
|
639
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
639
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(
|
|
640
640
|
me,
|
|
641
641
|
{
|
|
642
642
|
as: "div",
|
|
@@ -647,7 +647,7 @@ const _r = {
|
|
|
647
647
|
/* @__PURE__ */ e(
|
|
648
648
|
ge,
|
|
649
649
|
{
|
|
650
|
-
as:
|
|
650
|
+
as: Q,
|
|
651
651
|
enter: "ease-out duration-300",
|
|
652
652
|
enterFrom: "opacity-0",
|
|
653
653
|
enterTo: "opacity-100",
|
|
@@ -660,7 +660,7 @@ const _r = {
|
|
|
660
660
|
/* @__PURE__ */ e("div", { className: "dialog-positioner", children: /* @__PURE__ */ e(
|
|
661
661
|
ge,
|
|
662
662
|
{
|
|
663
|
-
as:
|
|
663
|
+
as: Q,
|
|
664
664
|
enter: "ease-out duration-300",
|
|
665
665
|
enterFrom: "opacity-0 scale-95",
|
|
666
666
|
enterTo: "opacity-100 scale-100",
|
|
@@ -674,9 +674,9 @@ const _r = {
|
|
|
674
674
|
onClick: (L) => L.stopPropagation(),
|
|
675
675
|
children: [
|
|
676
676
|
/* @__PURE__ */ e("input", { ...o() }),
|
|
677
|
-
/* @__PURE__ */ l("form", { onSubmit:
|
|
677
|
+
/* @__PURE__ */ l("form", { onSubmit: x, className: "form-wrapper", children: [
|
|
678
678
|
/* @__PURE__ */ l("div", { className: "dialog-header", children: [
|
|
679
|
-
/* @__PURE__ */ e(_e, { as: "h3", className: "dialog-title-text", children:
|
|
679
|
+
/* @__PURE__ */ e(_e, { as: "h3", className: "dialog-title-text", children: h }),
|
|
680
680
|
/* @__PURE__ */ e(
|
|
681
681
|
"button",
|
|
682
682
|
{
|
|
@@ -714,7 +714,7 @@ const _r = {
|
|
|
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
|
-
i.map((L,
|
|
717
|
+
i.map((L, O) => /* @__PURE__ */ l(
|
|
718
718
|
"li",
|
|
719
719
|
{
|
|
720
720
|
className: "file-item",
|
|
@@ -735,16 +735,16 @@ const _r = {
|
|
|
735
735
|
"button",
|
|
736
736
|
{
|
|
737
737
|
type: "button",
|
|
738
|
-
onClick: () => y(
|
|
738
|
+
onClick: () => y(O),
|
|
739
739
|
className: "remove-file-button",
|
|
740
740
|
children: /* @__PURE__ */ e(Ve, { size: 16 })
|
|
741
741
|
}
|
|
742
742
|
)
|
|
743
743
|
]
|
|
744
744
|
},
|
|
745
|
-
`${L.name}-${
|
|
745
|
+
`${L.name}-${O}`
|
|
746
746
|
)),
|
|
747
|
-
c.map(({ file: L, message:
|
|
747
|
+
c.map(({ file: L, message: O }, C) => /* @__PURE__ */ l(
|
|
748
748
|
"li",
|
|
749
749
|
{
|
|
750
750
|
className: "file-item file-item--rejected",
|
|
@@ -759,14 +759,14 @@ const _r = {
|
|
|
759
759
|
/* @__PURE__ */ l("div", { children: [
|
|
760
760
|
/* @__PURE__ */ e("p", { className: "file-item-name", children: L.name }),
|
|
761
761
|
/* @__PURE__ */ e("p", { className: "file-item-size", children: ua(L.size) }),
|
|
762
|
-
/* @__PURE__ */ e("p", { className: "rejection-reason", children:
|
|
762
|
+
/* @__PURE__ */ e("p", { className: "rejection-reason", children: O })
|
|
763
763
|
] })
|
|
764
764
|
] }),
|
|
765
765
|
/* @__PURE__ */ e(
|
|
766
766
|
"button",
|
|
767
767
|
{
|
|
768
768
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
769
|
+
onClick: () => v(C),
|
|
770
770
|
className: "remove-file-button",
|
|
771
771
|
children: /* @__PURE__ */ e(Ve, { size: 16 })
|
|
772
772
|
}
|
|
@@ -780,7 +780,7 @@ const _r = {
|
|
|
780
780
|
] }),
|
|
781
781
|
/* @__PURE__ */ l("div", { className: "dialog-footer", children: [
|
|
782
782
|
/* @__PURE__ */ e(
|
|
783
|
-
|
|
783
|
+
H,
|
|
784
784
|
{
|
|
785
785
|
type: "button",
|
|
786
786
|
category: "secondary",
|
|
@@ -789,7 +789,7 @@ const _r = {
|
|
|
789
789
|
}
|
|
790
790
|
),
|
|
791
791
|
/* @__PURE__ */ e(
|
|
792
|
-
|
|
792
|
+
H,
|
|
793
793
|
{
|
|
794
794
|
type: "submit",
|
|
795
795
|
label: a ? "Uploading..." : "Upload Files",
|
|
@@ -820,7 +820,7 @@ const _r = {
|
|
|
820
820
|
const [c, y] = B({
|
|
821
821
|
createdBy: [],
|
|
822
822
|
updatedBy: []
|
|
823
|
-
}), [
|
|
823
|
+
}), [v, x] = B({
|
|
824
824
|
createdBy: !1,
|
|
825
825
|
updatedBy: !1
|
|
826
826
|
}), a = yt({
|
|
@@ -828,51 +828,51 @@ const _r = {
|
|
|
828
828
|
// Deep copy
|
|
829
829
|
onSubmit: (C) => {
|
|
830
830
|
const T = {};
|
|
831
|
-
Object.keys(C).forEach((
|
|
832
|
-
T[
|
|
833
|
-
operator: C[
|
|
834
|
-
values: Array.isArray(C[
|
|
835
|
-
range: C[
|
|
831
|
+
Object.keys(C).forEach((I) => {
|
|
832
|
+
T[I] = {
|
|
833
|
+
operator: C[I].operator || "in",
|
|
834
|
+
values: Array.isArray(C[I].values) ? C[I].values : [],
|
|
835
|
+
range: C[I].range || null
|
|
836
836
|
};
|
|
837
837
|
}), console.log("[storybook filter] Applied Filters:", T), typeof s == "function" && s({
|
|
838
838
|
filters: T,
|
|
839
|
-
activeCount:
|
|
839
|
+
activeCount: h
|
|
840
840
|
}), r();
|
|
841
841
|
},
|
|
842
842
|
enableReinitialize: !0
|
|
843
843
|
}), k = ce(() => n.reduce((C, T) => {
|
|
844
|
-
const
|
|
845
|
-
let
|
|
846
|
-
if (
|
|
844
|
+
const I = T.key, E = a.values[I];
|
|
845
|
+
let V = !1;
|
|
846
|
+
if (E)
|
|
847
847
|
switch (T.type) {
|
|
848
848
|
case "multiselect":
|
|
849
849
|
case "multiselect-users":
|
|
850
|
-
|
|
850
|
+
V = Array.isArray(E.values) && E.values.length > 0;
|
|
851
851
|
break;
|
|
852
852
|
case "date":
|
|
853
|
-
(
|
|
853
|
+
(E.range && E.range !== "" || Array.isArray(E.values) && E.values.length > 0) && (V = !0);
|
|
854
854
|
break;
|
|
855
855
|
}
|
|
856
|
-
return C[
|
|
857
|
-
}, {}), [n, a.values]),
|
|
856
|
+
return C[I] = V, C;
|
|
857
|
+
}, {}), [n, a.values]), h = Object.values(k).filter(Boolean).length, g = async (C, T) => {
|
|
858
858
|
try {
|
|
859
|
-
|
|
860
|
-
const
|
|
861
|
-
y((
|
|
862
|
-
} catch (
|
|
863
|
-
console.error(`Error fetching ${C} users:`,
|
|
859
|
+
x((E) => ({ ...E, [C]: !0 }));
|
|
860
|
+
const I = await i(C, T);
|
|
861
|
+
y((E) => ({ ...E, [C]: I }));
|
|
862
|
+
} catch (I) {
|
|
863
|
+
console.error(`Error fetching ${C} users:`, I);
|
|
864
864
|
} finally {
|
|
865
|
-
|
|
865
|
+
x((I) => ({ ...I, [C]: !1 }));
|
|
866
866
|
}
|
|
867
867
|
}, $ = (C) => {
|
|
868
|
-
const T = n[C].key,
|
|
869
|
-
n[C].type === "multiselect-users" && c[T].length === 0 && !
|
|
868
|
+
const T = n[C].key, I = n[C].url;
|
|
869
|
+
n[C].type === "multiselect-users" && c[T].length === 0 && !v[T] && g(T, I);
|
|
870
870
|
}, L = () => {
|
|
871
871
|
a.resetForm(), y({ createdBy: [], updatedBy: [] }), o();
|
|
872
|
-
},
|
|
873
|
-
const T = n.find((
|
|
872
|
+
}, O = (C) => {
|
|
873
|
+
const T = n.find((V) => V.key === C);
|
|
874
874
|
if (!T) return null;
|
|
875
|
-
const
|
|
875
|
+
const I = a.values[C] || u[C], E = Array.isArray(I.values) ? I.values : [];
|
|
876
876
|
switch (T.type) {
|
|
877
877
|
case "multiselect":
|
|
878
878
|
return /* @__PURE__ */ l("div", { className: "filter-panel-content", children: [
|
|
@@ -881,7 +881,7 @@ const _r = {
|
|
|
881
881
|
/* @__PURE__ */ e(
|
|
882
882
|
"select",
|
|
883
883
|
{
|
|
884
|
-
value:
|
|
884
|
+
value: I.operator || "in",
|
|
885
885
|
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
886
886
|
className: "filter-select",
|
|
887
887
|
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
@@ -896,10 +896,10 @@ const _r = {
|
|
|
896
896
|
type: "checkbox",
|
|
897
897
|
id: `select-all-${C}`,
|
|
898
898
|
className: "filter-checkbox-input",
|
|
899
|
-
checked: T.options.length > 0 &&
|
|
899
|
+
checked: T.options.length > 0 && E.length === T.options.length,
|
|
900
900
|
onChange: (d) => {
|
|
901
|
-
const
|
|
902
|
-
a.setFieldValue(`${C}.values`,
|
|
901
|
+
const m = d.target.checked ? T.options.map((b) => b.value) : [];
|
|
902
|
+
a.setFieldValue(`${C}.values`, m);
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
905
|
),
|
|
@@ -919,10 +919,10 @@ const _r = {
|
|
|
919
919
|
type: "checkbox",
|
|
920
920
|
id: `${C}-${d.value}`,
|
|
921
921
|
className: "filter-checkbox-input",
|
|
922
|
-
checked:
|
|
923
|
-
onChange: (
|
|
924
|
-
const
|
|
925
|
-
a.setFieldValue(`${C}.values`,
|
|
922
|
+
checked: E.includes(d.value),
|
|
923
|
+
onChange: (m) => {
|
|
924
|
+
const b = m.target.checked ? [...E, d.value] : E.filter((D) => D !== d.value);
|
|
925
|
+
a.setFieldValue(`${C}.values`, b);
|
|
926
926
|
}
|
|
927
927
|
}
|
|
928
928
|
),
|
|
@@ -938,21 +938,21 @@ const _r = {
|
|
|
938
938
|
] })
|
|
939
939
|
] });
|
|
940
940
|
case "multiselect-users":
|
|
941
|
-
const
|
|
941
|
+
const V = c[C] || [], q = v[C];
|
|
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:" }),
|
|
945
945
|
/* @__PURE__ */ e(
|
|
946
946
|
"select",
|
|
947
947
|
{
|
|
948
|
-
value:
|
|
948
|
+
value: I.operator || "in",
|
|
949
949
|
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
950
950
|
className: "filter-select",
|
|
951
951
|
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Includes" : "Excludes" }, d))
|
|
952
952
|
}
|
|
953
953
|
)
|
|
954
954
|
] }),
|
|
955
|
-
|
|
955
|
+
q ? /* @__PURE__ */ e("div", { className: "loading-spinner", children: /* @__PURE__ */ e("div", {}) }) : /* @__PURE__ */ e("div", { className: "filter-checkbox-list", children: V.length > 0 ? /* @__PURE__ */ l(ee, { children: [
|
|
956
956
|
/* @__PURE__ */ l("div", { className: "filter-checkbox-item", children: [
|
|
957
957
|
/* @__PURE__ */ e(
|
|
958
958
|
"input",
|
|
@@ -960,12 +960,12 @@ const _r = {
|
|
|
960
960
|
type: "checkbox",
|
|
961
961
|
id: `select-all-users-${C}`,
|
|
962
962
|
className: "filter-checkbox-input",
|
|
963
|
-
checked:
|
|
963
|
+
checked: V.length > 0 && E.length === V.length,
|
|
964
964
|
onChange: (d) => {
|
|
965
|
-
const
|
|
965
|
+
const m = d.target.checked ? V.map((b) => b.email) : [];
|
|
966
966
|
a.setFieldValue(
|
|
967
967
|
`${C}.values`,
|
|
968
|
-
|
|
968
|
+
m
|
|
969
969
|
);
|
|
970
970
|
}
|
|
971
971
|
}
|
|
@@ -979,19 +979,19 @@ const _r = {
|
|
|
979
979
|
}
|
|
980
980
|
)
|
|
981
981
|
] }),
|
|
982
|
-
|
|
982
|
+
V.map((d) => /* @__PURE__ */ l("div", { className: "filter-checkbox-item createdby", children: [
|
|
983
983
|
/* @__PURE__ */ e(
|
|
984
984
|
"input",
|
|
985
985
|
{
|
|
986
986
|
type: "checkbox",
|
|
987
987
|
id: `${C}-${d.email}`,
|
|
988
988
|
className: "filter-checkbox-input",
|
|
989
|
-
checked:
|
|
990
|
-
onChange: (
|
|
991
|
-
const
|
|
989
|
+
checked: E.includes(d.email),
|
|
990
|
+
onChange: (m) => {
|
|
991
|
+
const b = m.target.checked ? [...E, d.email] : E.filter((D) => D !== d.email);
|
|
992
992
|
a.setFieldValue(
|
|
993
993
|
`${C}.values`,
|
|
994
|
-
|
|
994
|
+
b
|
|
995
995
|
);
|
|
996
996
|
}
|
|
997
997
|
}
|
|
@@ -1011,8 +1011,8 @@ const _r = {
|
|
|
1011
1011
|
] }) : /* @__PURE__ */ e("div", { className: "text-center py-4 text-gray-500 text-sm", children: "No users loaded." }) })
|
|
1012
1012
|
] });
|
|
1013
1013
|
case "date":
|
|
1014
|
-
const
|
|
1015
|
-
startDate:
|
|
1014
|
+
const G = I.values || [], [N, p] = G, f = N && p, w = {
|
|
1015
|
+
startDate: N instanceof Date ? N : /* @__PURE__ */ new Date(),
|
|
1016
1016
|
// Fallback to today
|
|
1017
1017
|
endDate: p instanceof Date ? p : /* @__PURE__ */ new Date(),
|
|
1018
1018
|
// Fallback to today
|
|
@@ -1024,7 +1024,7 @@ const _r = {
|
|
|
1024
1024
|
/* @__PURE__ */ e(
|
|
1025
1025
|
"select",
|
|
1026
1026
|
{
|
|
1027
|
-
value:
|
|
1027
|
+
value: I.operator,
|
|
1028
1028
|
onChange: (d) => a.setFieldValue(`${C}.operator`, d.target.value),
|
|
1029
1029
|
className: "filter-select",
|
|
1030
1030
|
children: T.operators.map((d) => /* @__PURE__ */ e("option", { value: d, children: d === "in" ? "Is" : "Is not" }, d))
|
|
@@ -1050,10 +1050,10 @@ const _r = {
|
|
|
1050
1050
|
{
|
|
1051
1051
|
ranges: [w],
|
|
1052
1052
|
onChange: (d) => {
|
|
1053
|
-
const { startDate:
|
|
1053
|
+
const { startDate: m, endDate: b } = d.selection;
|
|
1054
1054
|
a.setFieldValue(`${C}.values`, [
|
|
1055
|
-
|
|
1056
|
-
|
|
1055
|
+
m,
|
|
1056
|
+
b
|
|
1057
1057
|
]);
|
|
1058
1058
|
},
|
|
1059
1059
|
showSelectionPreview: !0,
|
|
@@ -1068,11 +1068,11 @@ const _r = {
|
|
|
1068
1068
|
return null;
|
|
1069
1069
|
}
|
|
1070
1070
|
};
|
|
1071
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1071
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: r, children: [
|
|
1072
1072
|
/* @__PURE__ */ e(
|
|
1073
1073
|
ge,
|
|
1074
1074
|
{
|
|
1075
|
-
as:
|
|
1075
|
+
as: Q,
|
|
1076
1076
|
enter: "ease-out duration-300",
|
|
1077
1077
|
enterFrom: "opacity-0",
|
|
1078
1078
|
enterTo: "opacity-100",
|
|
@@ -1085,7 +1085,7 @@ const _r = {
|
|
|
1085
1085
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(
|
|
1086
1086
|
ge,
|
|
1087
1087
|
{
|
|
1088
|
-
as:
|
|
1088
|
+
as: Q,
|
|
1089
1089
|
enter: "ease-out duration-300",
|
|
1090
1090
|
enterFrom: "opacity-0 translate-x-full",
|
|
1091
1091
|
enterTo: "opacity-100 translate-x-0",
|
|
@@ -1140,7 +1140,7 @@ const _r = {
|
|
|
1140
1140
|
animate: { opacity: 1, x: 0 },
|
|
1141
1141
|
transition: { duration: 0.3 },
|
|
1142
1142
|
className: "h-full",
|
|
1143
|
-
children:
|
|
1143
|
+
children: O(C.key)
|
|
1144
1144
|
},
|
|
1145
1145
|
C.key
|
|
1146
1146
|
)
|
|
@@ -1169,7 +1169,7 @@ const _r = {
|
|
|
1169
1169
|
children: [
|
|
1170
1170
|
"Apply Filters",
|
|
1171
1171
|
" ",
|
|
1172
|
-
|
|
1172
|
+
h > 0 ? `(${h})` : ""
|
|
1173
1173
|
]
|
|
1174
1174
|
}
|
|
1175
1175
|
)
|
|
@@ -1179,7 +1179,7 @@ const _r = {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
) }) })
|
|
1181
1181
|
] }) });
|
|
1182
|
-
},
|
|
1182
|
+
}, Y = ({
|
|
1183
1183
|
label: t,
|
|
1184
1184
|
id: r,
|
|
1185
1185
|
type: s = "text",
|
|
@@ -1201,7 +1201,7 @@ const _r = {
|
|
|
1201
1201
|
id: y,
|
|
1202
1202
|
type: s,
|
|
1203
1203
|
ref: i,
|
|
1204
|
-
className:
|
|
1204
|
+
className: J("input-field", {
|
|
1205
1205
|
"input-field--error": !!n,
|
|
1206
1206
|
"input-field--with-icon": !!o
|
|
1207
1207
|
}),
|
|
@@ -1243,19 +1243,19 @@ const _r = {
|
|
|
1243
1243
|
// 'info', 'warning', 'delete'
|
|
1244
1244
|
loading: c = !1,
|
|
1245
1245
|
buttonProps: y = {},
|
|
1246
|
-
size:
|
|
1246
|
+
size: v
|
|
1247
1247
|
// Add size prop
|
|
1248
1248
|
}) => {
|
|
1249
|
-
const
|
|
1249
|
+
const x = ma[i] || ma.info, a = x.icon, k = () => {
|
|
1250
1250
|
r({ primary: !0, secondary: !1 });
|
|
1251
|
-
},
|
|
1251
|
+
}, h = () => {
|
|
1252
1252
|
r({ primary: !1, secondary: !0 });
|
|
1253
1253
|
};
|
|
1254
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as:
|
|
1254
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: t, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "modal-dialog", onClose: () => r({}), children: [
|
|
1255
1255
|
/* @__PURE__ */ e(
|
|
1256
1256
|
ge,
|
|
1257
1257
|
{
|
|
1258
|
-
as:
|
|
1258
|
+
as: Q,
|
|
1259
1259
|
enter: "ease-out duration-300",
|
|
1260
1260
|
enterFrom: "opacity-0",
|
|
1261
1261
|
enterTo: "opacity-100",
|
|
@@ -1268,16 +1268,16 @@ const _r = {
|
|
|
1268
1268
|
/* @__PURE__ */ e("div", { className: "modal-positioner", children: /* @__PURE__ */ e(
|
|
1269
1269
|
ge,
|
|
1270
1270
|
{
|
|
1271
|
-
as:
|
|
1271
|
+
as: Q,
|
|
1272
1272
|
enter: "ease-out duration-300",
|
|
1273
1273
|
enterFrom: "opacity-0 scale-95",
|
|
1274
1274
|
enterTo: "opacity-100 scale-100",
|
|
1275
1275
|
leave: "ease-in duration-200",
|
|
1276
1276
|
leaveFrom: "opacity-100 scale-100",
|
|
1277
1277
|
leaveTo: "opacity-0 scale-95",
|
|
1278
|
-
children: /* @__PURE__ */ l(Se, { className:
|
|
1278
|
+
children: /* @__PURE__ */ l(Se, { className: v === "large" ? "modal-panel modal-panel--large" : "modal-panel", children: [
|
|
1279
1279
|
/* @__PURE__ */ l("div", { className: "modal-content-wrapper", children: [
|
|
1280
|
-
/* @__PURE__ */ e("div", { className: `modal-icon-container ${
|
|
1280
|
+
/* @__PURE__ */ e("div", { className: `modal-icon-container ${x.iconClass}`, children: /* @__PURE__ */ e(a, { size: 24, "aria-hidden": "true" }) }),
|
|
1281
1281
|
/* @__PURE__ */ l("div", { className: "modal-text-content", children: [
|
|
1282
1282
|
/* @__PURE__ */ e(_e, { as: "h3", className: "modal-title", children: s }),
|
|
1283
1283
|
/* @__PURE__ */ e("div", { className: "modal-description", children: o })
|
|
@@ -1285,15 +1285,15 @@ const _r = {
|
|
|
1285
1285
|
] }),
|
|
1286
1286
|
(n || u) && /* @__PURE__ */ l("div", { className: "modal-footer", children: [
|
|
1287
1287
|
u && /* @__PURE__ */ e(
|
|
1288
|
-
|
|
1288
|
+
H,
|
|
1289
1289
|
{
|
|
1290
|
-
onClick:
|
|
1290
|
+
onClick: h,
|
|
1291
1291
|
label: u,
|
|
1292
1292
|
category: "secondary"
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
1295
|
n && /* @__PURE__ */ e(
|
|
1296
|
-
|
|
1296
|
+
H,
|
|
1297
1297
|
{
|
|
1298
1298
|
onClick: k,
|
|
1299
1299
|
label: n,
|
|
@@ -1314,13 +1314,13 @@ const _r = {
|
|
|
1314
1314
|
itemsPerPageOptions: u = [10, 15, 20]
|
|
1315
1315
|
}) => {
|
|
1316
1316
|
const i = Math.ceil(r / s), [c, y] = B(t);
|
|
1317
|
-
|
|
1317
|
+
X(() => {
|
|
1318
1318
|
y(t);
|
|
1319
1319
|
}, [t]);
|
|
1320
|
-
const
|
|
1320
|
+
const v = Math.min((t - 1) * s + 1, r), x = Math.min(t * s, r), a = (k) => {
|
|
1321
1321
|
k.preventDefault();
|
|
1322
|
-
let
|
|
1323
|
-
isNaN(
|
|
1322
|
+
let h = parseInt(c, 10);
|
|
1323
|
+
isNaN(h) || h < 1 ? h = 1 : h > i && (h = i), y(h), h !== t && o(h);
|
|
1324
1324
|
};
|
|
1325
1325
|
return /* @__PURE__ */ l("div", { className: "pagination-container", children: [
|
|
1326
1326
|
/* @__PURE__ */ l("div", { className: "pagination-left", children: [
|
|
@@ -1336,9 +1336,9 @@ const _r = {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
),
|
|
1338
1338
|
/* @__PURE__ */ l("span", { className: "pagination-info", children: [
|
|
1339
|
-
|
|
1339
|
+
v,
|
|
1340
1340
|
"-",
|
|
1341
|
-
|
|
1341
|
+
x,
|
|
1342
1342
|
" of ",
|
|
1343
1343
|
r,
|
|
1344
1344
|
" items"
|
|
@@ -1422,7 +1422,7 @@ const _r = {
|
|
|
1422
1422
|
ze.Option,
|
|
1423
1423
|
{
|
|
1424
1424
|
value: i.value,
|
|
1425
|
-
className: ({ active: c, checked: y }) =>
|
|
1425
|
+
className: ({ active: c, checked: y }) => J("radiogroup-option", {
|
|
1426
1426
|
"radiogroup-option--active": c,
|
|
1427
1427
|
"radiogroup-option--checked": y,
|
|
1428
1428
|
"radiogroup-option--error": !!n
|
|
@@ -1458,19 +1458,19 @@ const _r = {
|
|
|
1458
1458
|
...i
|
|
1459
1459
|
}) => {
|
|
1460
1460
|
const [c, y] = B(t);
|
|
1461
|
-
|
|
1461
|
+
X(() => {
|
|
1462
1462
|
y(t);
|
|
1463
1463
|
}, [t]);
|
|
1464
|
-
const
|
|
1464
|
+
const v = K(
|
|
1465
1465
|
vr((a) => {
|
|
1466
1466
|
r?.(a);
|
|
1467
1467
|
}, s),
|
|
1468
1468
|
[s, r]
|
|
1469
1469
|
);
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
}), [c,
|
|
1473
|
-
const
|
|
1470
|
+
X(() => (c !== t && v(c), () => {
|
|
1471
|
+
v.cancel();
|
|
1472
|
+
}), [c, v, t]);
|
|
1473
|
+
const x = (a) => {
|
|
1474
1474
|
y(a.target.value);
|
|
1475
1475
|
};
|
|
1476
1476
|
return /* @__PURE__ */ l("div", { className: `search-bar-wrapper ${u}`, children: [
|
|
@@ -1485,7 +1485,7 @@ const _r = {
|
|
|
1485
1485
|
type: "search",
|
|
1486
1486
|
name: "search",
|
|
1487
1487
|
value: c,
|
|
1488
|
-
onChange:
|
|
1488
|
+
onChange: x,
|
|
1489
1489
|
...i
|
|
1490
1490
|
}
|
|
1491
1491
|
)
|
|
@@ -1504,16 +1504,16 @@ const _r = {
|
|
|
1504
1504
|
// From RHF's <Controller>
|
|
1505
1505
|
showSearch: y = !0
|
|
1506
1506
|
}) => {
|
|
1507
|
-
const [
|
|
1508
|
-
(
|
|
1509
|
-
), k = o.find((
|
|
1510
|
-
return /* @__PURE__ */ e(
|
|
1507
|
+
const [v, x] = B(""), a = v === "" ? o : o.filter(
|
|
1508
|
+
(h) => h.label.toLowerCase().includes(v.toLowerCase())
|
|
1509
|
+
), k = o.find((h) => r?.id ? h.id === r.id : h.id === r || h.value === r);
|
|
1510
|
+
return /* @__PURE__ */ e(Z, { value: r, onChange: s, disabled: u, children: /* @__PURE__ */ l("div", { className: "select-wrapper", ref: c, children: [
|
|
1511
1511
|
t && /* @__PURE__ */ e("label", { className: "select-label", children: t }),
|
|
1512
1512
|
/* @__PURE__ */ l("div", { className: "select-button-container", children: [
|
|
1513
1513
|
/* @__PURE__ */ l(
|
|
1514
1514
|
cr,
|
|
1515
1515
|
{
|
|
1516
|
-
className:
|
|
1516
|
+
className: J("select-button", {
|
|
1517
1517
|
"select-button--error": !!i
|
|
1518
1518
|
}),
|
|
1519
1519
|
children: [
|
|
@@ -1532,24 +1532,24 @@ const _r = {
|
|
|
1532
1532
|
y && /* @__PURE__ */ e("div", { className: "search-input-wrapper", children: /* @__PURE__ */ e(
|
|
1533
1533
|
he,
|
|
1534
1534
|
{
|
|
1535
|
-
value:
|
|
1536
|
-
onDebouncedChange:
|
|
1535
|
+
value: v,
|
|
1536
|
+
onDebouncedChange: x,
|
|
1537
1537
|
placeholder: "Search..."
|
|
1538
1538
|
}
|
|
1539
1539
|
) }),
|
|
1540
|
-
/* @__PURE__ */ e("div", { className: "select-options-list", children: a.length === 0 &&
|
|
1540
|
+
/* @__PURE__ */ e("div", { className: "select-options-list", children: a.length === 0 && v !== "" ? /* @__PURE__ */ e("div", { className: "no-results", children: "No results found." }) : a.map((h) => /* @__PURE__ */ e(
|
|
1541
1541
|
ur,
|
|
1542
1542
|
{
|
|
1543
1543
|
className: ({ active: g }) => `select-option ${g ? "active" : ""}`,
|
|
1544
|
-
value:
|
|
1544
|
+
value: h,
|
|
1545
1545
|
children: ({ selected: g }) => /* @__PURE__ */ l(ee, { children: [
|
|
1546
1546
|
/* @__PURE__ */ l("div", { className: "option-content", children: [
|
|
1547
|
-
|
|
1547
|
+
h.icon && /* @__PURE__ */ e(h.icon, { className: "option-icon" }),
|
|
1548
1548
|
/* @__PURE__ */ e(
|
|
1549
1549
|
"span",
|
|
1550
1550
|
{
|
|
1551
1551
|
className: `option-label ${g ? "selected" : ""}`,
|
|
1552
|
-
children:
|
|
1552
|
+
children: h.label
|
|
1553
1553
|
}
|
|
1554
1554
|
)
|
|
1555
1555
|
] }),
|
|
@@ -1562,7 +1562,7 @@ const _r = {
|
|
|
1562
1562
|
) : null
|
|
1563
1563
|
] })
|
|
1564
1564
|
},
|
|
1565
|
-
|
|
1565
|
+
h.id || h.value || h.label
|
|
1566
1566
|
)) })
|
|
1567
1567
|
] })
|
|
1568
1568
|
}
|
|
@@ -1572,7 +1572,7 @@ const _r = {
|
|
|
1572
1572
|
] }) });
|
|
1573
1573
|
}, Hr = () => {
|
|
1574
1574
|
const [t, r] = B(window.location.pathname);
|
|
1575
|
-
return
|
|
1575
|
+
return X(() => {
|
|
1576
1576
|
const s = () => {
|
|
1577
1577
|
r(window.location.pathname);
|
|
1578
1578
|
};
|
|
@@ -1587,17 +1587,17 @@ const _r = {
|
|
|
1587
1587
|
return null;
|
|
1588
1588
|
}, Va = ({ item: t, isCollapsed: r, level: s = 0 }) => {
|
|
1589
1589
|
const { pathname: o } = Hr(), n = t.href || t.url || t.path, [u, i] = B(!1), c = t.icon;
|
|
1590
|
-
|
|
1590
|
+
X(() => {
|
|
1591
1591
|
na([t], o) && i(!0);
|
|
1592
1592
|
}, [t, o]);
|
|
1593
|
-
const y = o === n,
|
|
1593
|
+
const y = o === n, v = !y && !!na([t], o), x = (a) => {
|
|
1594
1594
|
a.preventDefault(), i(!u);
|
|
1595
1595
|
};
|
|
1596
1596
|
return /* @__PURE__ */ l(
|
|
1597
1597
|
"div",
|
|
1598
1598
|
{
|
|
1599
|
-
className:
|
|
1600
|
-
"nav-item-container--parent-active":
|
|
1599
|
+
className: J("nav-item-container", {
|
|
1600
|
+
"nav-item-container--parent-active": v,
|
|
1601
1601
|
[`nav-item-container--level-${s}`]: s > 0
|
|
1602
1602
|
}),
|
|
1603
1603
|
children: [
|
|
@@ -1607,7 +1607,7 @@ const _r = {
|
|
|
1607
1607
|
href: n,
|
|
1608
1608
|
target: t.target,
|
|
1609
1609
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1610
|
-
className:
|
|
1610
|
+
className: J("nav-item", {
|
|
1611
1611
|
"nav-item--active": y,
|
|
1612
1612
|
"nav-item--collapsed": r
|
|
1613
1613
|
}),
|
|
@@ -1619,13 +1619,13 @@ const _r = {
|
|
|
1619
1619
|
"button",
|
|
1620
1620
|
{
|
|
1621
1621
|
className: "nav-chevron-button",
|
|
1622
|
-
onClick:
|
|
1622
|
+
onClick: x,
|
|
1623
1623
|
"aria-expanded": u,
|
|
1624
1624
|
"aria-label": u ? "Collapse menu" : "Expand menu",
|
|
1625
1625
|
children: /* @__PURE__ */ e(
|
|
1626
1626
|
wa,
|
|
1627
1627
|
{
|
|
1628
|
-
className:
|
|
1628
|
+
className: J("nav-chevron", {
|
|
1629
1629
|
"nav-chevron--open": u
|
|
1630
1630
|
})
|
|
1631
1631
|
}
|
|
@@ -1638,7 +1638,7 @@ const _r = {
|
|
|
1638
1638
|
t.children && /* @__PURE__ */ e(
|
|
1639
1639
|
"div",
|
|
1640
1640
|
{
|
|
1641
|
-
className:
|
|
1641
|
+
className: J("sub-menu", {
|
|
1642
1642
|
"sub-menu--open": u,
|
|
1643
1643
|
"sub-menu--collapsed": r
|
|
1644
1644
|
}),
|
|
@@ -1678,7 +1678,7 @@ const _r = {
|
|
|
1678
1678
|
/* @__PURE__ */ l(
|
|
1679
1679
|
"aside",
|
|
1680
1680
|
{
|
|
1681
|
-
className:
|
|
1681
|
+
className: J("sidebar", {
|
|
1682
1682
|
"sidebar--collapsed": r,
|
|
1683
1683
|
"sidebar--mobile-open": o
|
|
1684
1684
|
}),
|
|
@@ -1736,7 +1736,7 @@ const _r = {
|
|
|
1736
1736
|
className: s,
|
|
1737
1737
|
...o
|
|
1738
1738
|
}) => {
|
|
1739
|
-
const n =
|
|
1739
|
+
const n = J(
|
|
1740
1740
|
"spinner",
|
|
1741
1741
|
`spinner--size-${t}`,
|
|
1742
1742
|
`spinner--color-${r}`,
|
|
@@ -1776,11 +1776,11 @@ const _r = {
|
|
|
1776
1776
|
// ✅ New prop to control visibility
|
|
1777
1777
|
...c
|
|
1778
1778
|
}) => {
|
|
1779
|
-
const y = r || c.name, [
|
|
1779
|
+
const y = r || c.name, [v, x] = B(
|
|
1780
1780
|
c.value?.length || c.defaultValue?.length || 0
|
|
1781
|
-
), a = (
|
|
1782
|
-
|
|
1783
|
-
}, k = u -
|
|
1781
|
+
), a = (h) => {
|
|
1782
|
+
x(h.target.value.length), c.onChange && c.onChange(h);
|
|
1783
|
+
}, k = u - v;
|
|
1784
1784
|
return /* @__PURE__ */ l("div", { className: `textarea-wrapper ${o || ""}`, children: [
|
|
1785
1785
|
/* @__PURE__ */ l("div", { className: "textarea-header", children: [
|
|
1786
1786
|
t && /* @__PURE__ */ e("label", { htmlFor: y, className: "textarea-label", children: t }),
|
|
@@ -1794,7 +1794,7 @@ const _r = {
|
|
|
1794
1794
|
{
|
|
1795
1795
|
id: y,
|
|
1796
1796
|
ref: n,
|
|
1797
|
-
className:
|
|
1797
|
+
className: J("textarea-field", {
|
|
1798
1798
|
"textarea-field--error": !!s
|
|
1799
1799
|
}),
|
|
1800
1800
|
maxLength: u,
|
|
@@ -1819,7 +1819,7 @@ const _r = {
|
|
|
1819
1819
|
{
|
|
1820
1820
|
checked: r,
|
|
1821
1821
|
onChange: s,
|
|
1822
|
-
className:
|
|
1822
|
+
className: J("switch-element", {
|
|
1823
1823
|
// Renamed from switch-wrapper
|
|
1824
1824
|
"switch-element--error": !!n
|
|
1825
1825
|
}),
|
|
@@ -1881,21 +1881,21 @@ const _r = {
|
|
|
1881
1881
|
title: i,
|
|
1882
1882
|
description: c,
|
|
1883
1883
|
showProgress: y = !0,
|
|
1884
|
-
closeOnOverlayClick:
|
|
1884
|
+
closeOnOverlayClick: v = !0
|
|
1885
1885
|
}) => {
|
|
1886
|
-
const
|
|
1887
|
-
return /* @__PURE__ */ e(oe, { show: t, as:
|
|
1886
|
+
const x = s[o], a = Object.keys(s), k = a.indexOf(o), h = (k + 1) / a.length * 100, g = k > 0 && u.onBack;
|
|
1887
|
+
return /* @__PURE__ */ e(oe, { show: t, as: Q, children: /* @__PURE__ */ l(
|
|
1888
1888
|
me,
|
|
1889
1889
|
{
|
|
1890
1890
|
as: "div",
|
|
1891
1891
|
className: "wizard-dialog",
|
|
1892
|
-
onClose:
|
|
1892
|
+
onClose: v ? r : () => {
|
|
1893
1893
|
},
|
|
1894
1894
|
children: [
|
|
1895
1895
|
/* @__PURE__ */ e(
|
|
1896
1896
|
ge,
|
|
1897
1897
|
{
|
|
1898
|
-
as:
|
|
1898
|
+
as: Q,
|
|
1899
1899
|
enter: "ease-out duration-300",
|
|
1900
1900
|
enterFrom: "opacity-0",
|
|
1901
1901
|
enterTo: "opacity-100",
|
|
@@ -1908,7 +1908,7 @@ const _r = {
|
|
|
1908
1908
|
/* @__PURE__ */ e("div", { className: "wizard-container", children: /* @__PURE__ */ e("div", { className: "wizard-positioner", children: /* @__PURE__ */ e(
|
|
1909
1909
|
ge,
|
|
1910
1910
|
{
|
|
1911
|
-
as:
|
|
1911
|
+
as: Q,
|
|
1912
1912
|
enter: "transform transition ease-in-out duration-500",
|
|
1913
1913
|
enterFrom: "translate-x-full",
|
|
1914
1914
|
enterTo: "translate-x-0",
|
|
@@ -1924,7 +1924,7 @@ const _r = {
|
|
|
1924
1924
|
onClick: u.onBack,
|
|
1925
1925
|
className: "wizard-back-button",
|
|
1926
1926
|
"aria-label": "Go back to previous step",
|
|
1927
|
-
children: /* @__PURE__ */ e(
|
|
1927
|
+
children: /* @__PURE__ */ e(Ft, { size: 20 })
|
|
1928
1928
|
}
|
|
1929
1929
|
),
|
|
1930
1930
|
/* @__PURE__ */ l("div", { className: "wizard-header-text", children: [
|
|
@@ -1946,7 +1946,7 @@ const _r = {
|
|
|
1946
1946
|
"div",
|
|
1947
1947
|
{
|
|
1948
1948
|
className: "wizard-progress-bar",
|
|
1949
|
-
style: { width: `${
|
|
1949
|
+
style: { width: `${h}%` }
|
|
1950
1950
|
}
|
|
1951
1951
|
) }),
|
|
1952
1952
|
/* @__PURE__ */ e("div", { className: "wizard-body", children: /* @__PURE__ */ e(
|
|
@@ -1970,7 +1970,7 @@ const _r = {
|
|
|
1970
1970
|
},
|
|
1971
1971
|
className: "wizard-step-motion-wrapper",
|
|
1972
1972
|
style: { overflowX: "hidden" },
|
|
1973
|
-
children:
|
|
1973
|
+
children: x && /* @__PURE__ */ e(x, { ...u })
|
|
1974
1974
|
},
|
|
1975
1975
|
o
|
|
1976
1976
|
)
|
|
@@ -1993,7 +1993,7 @@ const _r = {
|
|
|
1993
1993
|
// A clearer prop name
|
|
1994
1994
|
...c
|
|
1995
1995
|
}) => {
|
|
1996
|
-
const y =
|
|
1996
|
+
const y = J(
|
|
1997
1997
|
"page-layout",
|
|
1998
1998
|
{
|
|
1999
1999
|
"page-layout--with-footer": r,
|
|
@@ -2005,7 +2005,7 @@ const _r = {
|
|
|
2005
2005
|
/* @__PURE__ */ e("div", { className: "page-layout-content", children: t }),
|
|
2006
2006
|
r && /* @__PURE__ */ e("footer", { className: "page-layout-footer", children: s || /* @__PURE__ */ l("div", { className: "footer-actions", children: [
|
|
2007
2007
|
u?.show && /* @__PURE__ */ e(
|
|
2008
|
-
|
|
2008
|
+
H,
|
|
2009
2009
|
{
|
|
2010
2010
|
category: "secondary",
|
|
2011
2011
|
label: u.label || "Tertiary",
|
|
@@ -2013,7 +2013,7 @@ const _r = {
|
|
|
2013
2013
|
}
|
|
2014
2014
|
),
|
|
2015
2015
|
n?.show && /* @__PURE__ */ e(
|
|
2016
|
-
|
|
2016
|
+
H,
|
|
2017
2017
|
{
|
|
2018
2018
|
category: "secondary",
|
|
2019
2019
|
label: n.label || "Cancel",
|
|
@@ -2021,7 +2021,7 @@ const _r = {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
),
|
|
2023
2023
|
o?.show && /* @__PURE__ */ e(
|
|
2024
|
-
|
|
2024
|
+
H,
|
|
2025
2025
|
{
|
|
2026
2026
|
category: "primary",
|
|
2027
2027
|
label: o.label || "Save",
|
|
@@ -2056,7 +2056,7 @@ const _r = {
|
|
|
2056
2056
|
] }), an = ({
|
|
2057
2057
|
options: t = [],
|
|
2058
2058
|
onSelect: r,
|
|
2059
|
-
triggerIcon: s =
|
|
2059
|
+
triggerIcon: s = $t
|
|
2060
2060
|
}) => {
|
|
2061
2061
|
const { refs: o, floatingStyles: n } = Ta({
|
|
2062
2062
|
whileElementsMounted: Ia,
|
|
@@ -2067,7 +2067,7 @@ const _r = {
|
|
|
2067
2067
|
/* @__PURE__ */ e(gr, { children: /* @__PURE__ */ e(
|
|
2068
2068
|
oe,
|
|
2069
2069
|
{
|
|
2070
|
-
as:
|
|
2070
|
+
as: Q,
|
|
2071
2071
|
enter: "transition ease-out duration-100",
|
|
2072
2072
|
enterFrom: "transform opacity-0 scale-95",
|
|
2073
2073
|
enterTo: "transform opacity-100 scale-100",
|
|
@@ -2293,41 +2293,41 @@ function dn({
|
|
|
2293
2293
|
// timeout: 20000,
|
|
2294
2294
|
});
|
|
2295
2295
|
s.interceptors.response.use(
|
|
2296
|
-
(
|
|
2297
|
-
message:
|
|
2296
|
+
(v) => v?.data ?? {
|
|
2297
|
+
message: v?.statusText || "Request succeeded"
|
|
2298
2298
|
},
|
|
2299
|
-
(
|
|
2300
|
-
const
|
|
2301
|
-
return t && (a === 401 || a === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(
|
|
2299
|
+
(v) => {
|
|
2300
|
+
const x = cn(v), a = x.status;
|
|
2301
|
+
return t && (a === 401 || a === 403) && (window.location.href.includes("/login") || (window.historyPath = window.location.pathname, localStorage.clear(), sessionStorage.clear(), window.location.href = "/login")), Promise.reject(x);
|
|
2302
2302
|
}
|
|
2303
2303
|
);
|
|
2304
|
-
function o({ open:
|
|
2305
|
-
if (
|
|
2304
|
+
function o({ open: v = !1, customHeader: x = {} } = {}) {
|
|
2305
|
+
if (v) {
|
|
2306
2306
|
const { Authorization: a, ...k } = ha();
|
|
2307
2307
|
return {
|
|
2308
|
-
headers: { ...k, ...r, ...
|
|
2308
|
+
headers: { ...k, ...r, ...x }
|
|
2309
2309
|
};
|
|
2310
2310
|
}
|
|
2311
|
-
return { headers: { ...ha(), ...
|
|
2311
|
+
return { headers: { ...ha(), ...x } };
|
|
2312
2312
|
}
|
|
2313
|
-
async function n(
|
|
2314
|
-
return s.get(
|
|
2315
|
-
params:
|
|
2313
|
+
async function n(v, x, a = !1, k = {}) {
|
|
2314
|
+
return s.get(v, {
|
|
2315
|
+
params: x,
|
|
2316
2316
|
...o({ open: a, customHeader: k })
|
|
2317
2317
|
});
|
|
2318
2318
|
}
|
|
2319
|
-
async function u(
|
|
2320
|
-
const
|
|
2321
|
-
return
|
|
2319
|
+
async function u(v, x, a = !1, k = {}) {
|
|
2320
|
+
const h = { ...o({ open: a, customHeader: k }) };
|
|
2321
|
+
return x !== void 0 && (h.data = x), s.delete(v, h);
|
|
2322
2322
|
}
|
|
2323
|
-
async function i(
|
|
2324
|
-
return s.post(
|
|
2323
|
+
async function i(v, x = {}, a = !1, k = {}) {
|
|
2324
|
+
return s.post(v, x, o({ open: a, customHeader: k }));
|
|
2325
2325
|
}
|
|
2326
|
-
async function c(
|
|
2327
|
-
return s.put(
|
|
2326
|
+
async function c(v, x = {}, a = !1, k = {}) {
|
|
2327
|
+
return s.put(v, x, o({ open: a, customHeader: k }));
|
|
2328
2328
|
}
|
|
2329
|
-
async function y(
|
|
2330
|
-
return s.patch(
|
|
2329
|
+
async function y(v, x = {}, a = !1, k = {}) {
|
|
2330
|
+
return s.patch(v, x, o({ open: a, customHeader: k }));
|
|
2331
2331
|
}
|
|
2332
2332
|
return {
|
|
2333
2333
|
instance: s,
|
|
@@ -2426,7 +2426,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2426
2426
|
}
|
|
2427
2427
|
}, oa = (t, r) => {
|
|
2428
2428
|
const [s, o] = B(t);
|
|
2429
|
-
return
|
|
2429
|
+
return X(
|
|
2430
2430
|
() => {
|
|
2431
2431
|
const n = Cr(() => {
|
|
2432
2432
|
o(t);
|
|
@@ -2461,15 +2461,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2461
2461
|
className: "flex items-center justify-between p-3 border border-gray-300 rounded-lg hover:bg-gray-50 hover:cursor-pointer transition-colors duration-150",
|
|
2462
2462
|
children: [
|
|
2463
2463
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
2464
|
-
/* @__PURE__ */ e("div", { className: "flex items-center", children: n.map((
|
|
2464
|
+
/* @__PURE__ */ e("div", { className: "flex items-center", children: n.map((v, x) => /* @__PURE__ */ e(
|
|
2465
2465
|
"img",
|
|
2466
2466
|
{
|
|
2467
|
-
src:
|
|
2468
|
-
alt:
|
|
2469
|
-
className: `w-10 h-10 rounded-full border-2 border-white ${
|
|
2470
|
-
style: { zIndex:
|
|
2467
|
+
src: v.avatarUrl || `https://avatar.vercel.sh/${v.name}.svg?text=${v?.name?.charAt(0) || "U"}`,
|
|
2468
|
+
alt: v.name,
|
|
2469
|
+
className: `w-10 h-10 rounded-full border-2 border-white ${x > 0 ? "-ml-4" : ""}`,
|
|
2470
|
+
style: { zIndex: x }
|
|
2471
2471
|
},
|
|
2472
|
-
|
|
2472
|
+
v.id || x
|
|
2473
2473
|
)) }),
|
|
2474
2474
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-800 truncate", children: y })
|
|
2475
2475
|
] }),
|
|
@@ -2497,80 +2497,80 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2497
2497
|
},
|
|
2498
2498
|
isChanged: c = !1
|
|
2499
2499
|
}) => {
|
|
2500
|
-
const [y,
|
|
2501
|
-
control:
|
|
2502
|
-
handleSubmit:
|
|
2503
|
-
watch:
|
|
2504
|
-
formState: { errors:
|
|
2500
|
+
const [y, v] = B(ga[0]), [x, a] = B(""), k = oa(x, 400), [h, g] = B([]), [$, L] = B(/* @__PURE__ */ new Set()), [O, C] = B(!1), [T, I] = B(ya[0]), {
|
|
2501
|
+
control: E,
|
|
2502
|
+
handleSubmit: V,
|
|
2503
|
+
watch: q,
|
|
2504
|
+
formState: { errors: G, isSubmitting: N }
|
|
2505
2505
|
} = zt({
|
|
2506
2506
|
defaultValues: { pendingInvites: [] },
|
|
2507
2507
|
resolver: Lt(yn)
|
|
2508
2508
|
}), { fields: p, append: f, remove: w, update: d } = Pt({
|
|
2509
|
-
control:
|
|
2509
|
+
control: E,
|
|
2510
2510
|
name: "pendingInvites"
|
|
2511
|
-
}),
|
|
2512
|
-
|
|
2513
|
-
k.length > 1 ? (C(!0), hn(y.name, k).then((
|
|
2514
|
-
g(
|
|
2515
|
-
}).catch((
|
|
2511
|
+
}), m = q("pendingInvites");
|
|
2512
|
+
X(() => {
|
|
2513
|
+
k.length > 1 ? (C(!0), hn(y.name, k).then((F) => {
|
|
2514
|
+
g(F);
|
|
2515
|
+
}).catch((F) => console.error("Search failed:", F)).finally(() => C(!1))) : (g([]), L(/* @__PURE__ */ new Set()));
|
|
2516
2516
|
}, [k, y]);
|
|
2517
|
-
const
|
|
2518
|
-
L((
|
|
2519
|
-
const
|
|
2520
|
-
return
|
|
2517
|
+
const b = (F) => {
|
|
2518
|
+
L((z) => {
|
|
2519
|
+
const U = new Set(z);
|
|
2520
|
+
return U.has(F) ? U.delete(F) : U.add(F), U;
|
|
2521
2521
|
});
|
|
2522
|
-
},
|
|
2523
|
-
|
|
2524
|
-
p.find((
|
|
2522
|
+
}, D = () => {
|
|
2523
|
+
h.filter((F) => $.has(F.id)).forEach((F) => {
|
|
2524
|
+
p.find((z) => z.id === F.id) || f({ ...F, permission: T.name });
|
|
2525
2525
|
}), L(/* @__PURE__ */ new Set()), a("");
|
|
2526
|
-
},
|
|
2527
|
-
|
|
2528
|
-
(
|
|
2526
|
+
}, R = (F) => {
|
|
2527
|
+
I(F), p.forEach(
|
|
2528
|
+
(z, U) => d(U, { ...p[U], permission: F.name })
|
|
2529
2529
|
);
|
|
2530
|
-
},
|
|
2530
|
+
}, j = async (F) => {
|
|
2531
2531
|
try {
|
|
2532
2532
|
if (n === se.DRIVE) {
|
|
2533
|
-
const
|
|
2533
|
+
const z = {
|
|
2534
2534
|
entity: t,
|
|
2535
|
-
userGroupRolesObj:
|
|
2536
|
-
id:
|
|
2537
|
-
permission:
|
|
2538
|
-
type:
|
|
2535
|
+
userGroupRolesObj: F.pendingInvites.map((U) => ({
|
|
2536
|
+
id: U.id,
|
|
2537
|
+
permission: U.permission,
|
|
2538
|
+
type: U.type.toLowerCase()
|
|
2539
2539
|
}))
|
|
2540
2540
|
};
|
|
2541
|
-
i(
|
|
2541
|
+
i(z, o);
|
|
2542
2542
|
} else if (n === se.INTEREST) {
|
|
2543
|
-
const
|
|
2544
|
-
identity:
|
|
2545
|
-
type:
|
|
2543
|
+
const z = F.pendingInvites.map((U) => ({
|
|
2544
|
+
identity: U.id,
|
|
2545
|
+
type: U.type.toLowerCase(),
|
|
2546
2546
|
opt: !0,
|
|
2547
2547
|
lock: !1,
|
|
2548
2548
|
moderator: !1,
|
|
2549
|
-
userName:
|
|
2549
|
+
userName: U.name,
|
|
2550
2550
|
interestId: t?.data?.id
|
|
2551
2551
|
}));
|
|
2552
|
-
i(
|
|
2552
|
+
i(z, o);
|
|
2553
2553
|
} else if (n === se.ARTICLE) {
|
|
2554
|
-
const
|
|
2554
|
+
const z = {
|
|
2555
2555
|
entity: t,
|
|
2556
|
-
userGroupRolesObj:
|
|
2557
|
-
id:
|
|
2558
|
-
permission:
|
|
2559
|
-
type:
|
|
2556
|
+
userGroupRolesObj: F.pendingInvites.map((U) => ({
|
|
2557
|
+
id: U.id,
|
|
2558
|
+
permission: U.permission,
|
|
2559
|
+
type: U.type.toLowerCase()
|
|
2560
2560
|
}))
|
|
2561
2561
|
};
|
|
2562
|
-
i(
|
|
2562
|
+
i(z, o);
|
|
2563
2563
|
} else
|
|
2564
|
-
i(
|
|
2564
|
+
i(F, o);
|
|
2565
2565
|
setTimeout(() => {
|
|
2566
2566
|
s();
|
|
2567
2567
|
}, 1e3);
|
|
2568
|
-
} catch (
|
|
2569
|
-
throw console.error("Failed to submit invites:",
|
|
2568
|
+
} catch (z) {
|
|
2569
|
+
throw console.error("Failed to submit invites:", z), z;
|
|
2570
2570
|
}
|
|
2571
|
-
},
|
|
2572
|
-
const
|
|
2573
|
-
return
|
|
2571
|
+
}, S = (F) => {
|
|
2572
|
+
const z = o[y.code].find((U) => U.name === F.name && U.permission !== "remove") || m.find((U) => U.name === F.name);
|
|
2573
|
+
return z ? `${z.permission}` : "";
|
|
2574
2574
|
}, A = () => {
|
|
2575
2575
|
switch (n) {
|
|
2576
2576
|
case se.DRIVE:
|
|
@@ -2582,8 +2582,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2582
2582
|
default:
|
|
2583
2583
|
return "Add User, Groups or Roles test";
|
|
2584
2584
|
}
|
|
2585
|
-
};
|
|
2586
|
-
return
|
|
2585
|
+
}, M = ce(() => (console.log("InviteFlow - isChanged:", c, "pendingInvites.length:", m.length), m.length === 0 && !c), [m.length, c]);
|
|
2586
|
+
return /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-white", children: [
|
|
2587
2587
|
/* @__PURE__ */ l("header", { className: "flex items-center justify-between p-4 border-b border-gray-300 flex-shrink-0", children: [
|
|
2588
2588
|
/* @__PURE__ */ e(me.Title, { className: " text-gray-900 !mb-0 text-lg font-semibold", children: A() }),
|
|
2589
2589
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-4", children: [
|
|
@@ -2605,15 +2605,15 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2605
2605
|
(n === se.DRIVE || u) && /* @__PURE__ */ e(
|
|
2606
2606
|
gn,
|
|
2607
2607
|
{
|
|
2608
|
-
users: o.users.filter((
|
|
2609
|
-
groups: o.groups.filter((
|
|
2610
|
-
roles: o.roles.filter((
|
|
2608
|
+
users: o.users.filter((F) => F.permission !== "remove"),
|
|
2609
|
+
groups: o.groups.filter((F) => F.permission !== "remove"),
|
|
2610
|
+
roles: o.roles.filter((F) => F.permission !== "remove"),
|
|
2611
2611
|
onClick: r
|
|
2612
2612
|
}
|
|
2613
2613
|
),
|
|
2614
2614
|
/* @__PURE__ */ l("div", { className: "relative grid grid-cols-3 gap-2 items-start", children: [
|
|
2615
|
-
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(
|
|
2616
|
-
/* @__PURE__ */ l(
|
|
2615
|
+
/* @__PURE__ */ e("div", { className: "col-span-1", children: /* @__PURE__ */ e(Z, { value: y, onChange: v, children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2616
|
+
/* @__PURE__ */ l(Z.Button, { className: "relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2617
2617
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2618
2618
|
/* @__PURE__ */ e(y.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2619
2619
|
/* @__PURE__ */ e("span", { className: "truncate", children: y.name })
|
|
@@ -2623,35 +2623,35 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2623
2623
|
/* @__PURE__ */ e(
|
|
2624
2624
|
oe,
|
|
2625
2625
|
{
|
|
2626
|
-
as:
|
|
2626
|
+
as: Q,
|
|
2627
2627
|
leave: "transition ease-in duration-100",
|
|
2628
2628
|
leaveFrom: "opacity-100",
|
|
2629
2629
|
leaveTo: "opacity-0",
|
|
2630
|
-
children: /* @__PURE__ */ e(
|
|
2631
|
-
|
|
2630
|
+
children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ga.map((F) => /* @__PURE__ */ e(
|
|
2631
|
+
Z.Option,
|
|
2632
2632
|
{
|
|
2633
|
-
value:
|
|
2634
|
-
className: ({ active:
|
|
2635
|
-
children: ({ selected:
|
|
2633
|
+
value: F,
|
|
2634
|
+
className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2635
|
+
children: ({ selected: z }) => /* @__PURE__ */ l(ee, { children: [
|
|
2636
2636
|
/* @__PURE__ */ l(
|
|
2637
2637
|
"span",
|
|
2638
2638
|
{
|
|
2639
|
-
className: `${
|
|
2639
|
+
className: `${z ? "font-medium" : "font-normal"} flex items-center`,
|
|
2640
2640
|
children: [
|
|
2641
2641
|
/* @__PURE__ */ e(
|
|
2642
|
-
|
|
2642
|
+
F.icon,
|
|
2643
2643
|
{
|
|
2644
|
-
className: `h-5 w-5 mr-2 ${
|
|
2644
|
+
className: `h-5 w-5 mr-2 ${z ? "text-white" : "text-gray-400"}`
|
|
2645
2645
|
}
|
|
2646
2646
|
),
|
|
2647
|
-
|
|
2647
|
+
F.name
|
|
2648
2648
|
]
|
|
2649
2649
|
}
|
|
2650
2650
|
),
|
|
2651
|
-
|
|
2651
|
+
z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-white", children: /* @__PURE__ */ e(ta, { className: "h-5 w-5" }) })
|
|
2652
2652
|
] })
|
|
2653
2653
|
},
|
|
2654
|
-
|
|
2654
|
+
F.id
|
|
2655
2655
|
)) })
|
|
2656
2656
|
}
|
|
2657
2657
|
)
|
|
@@ -2660,11 +2660,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2660
2660
|
he,
|
|
2661
2661
|
{
|
|
2662
2662
|
placeholder: `Search by ${y.name.toLowerCase()}...`,
|
|
2663
|
-
onDebouncedChange: (
|
|
2664
|
-
value:
|
|
2663
|
+
onDebouncedChange: (F) => a(F),
|
|
2664
|
+
value: x
|
|
2665
2665
|
}
|
|
2666
2666
|
) }),
|
|
2667
|
-
/* @__PURE__ */ e(be, { children: (
|
|
2667
|
+
/* @__PURE__ */ e(be, { children: (h?.length > 0 || O) && /* @__PURE__ */ e(
|
|
2668
2668
|
ne.div,
|
|
2669
2669
|
{
|
|
2670
2670
|
initial: { opacity: 0, y: -10 },
|
|
@@ -2672,41 +2672,41 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2672
2672
|
exit: { opacity: 0, y: -10 },
|
|
2673
2673
|
transition: { duration: 0.2 },
|
|
2674
2674
|
className: "absolute top-full mt-2 w-full col-span-3 bg-white border border-gray-300 rounded-lg shadow-lg z-10",
|
|
2675
|
-
children:
|
|
2676
|
-
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children:
|
|
2677
|
-
const
|
|
2675
|
+
children: O ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-gray-500", children: "Loading..." }) : /* @__PURE__ */ l(ee, { children: [
|
|
2676
|
+
/* @__PURE__ */ e("div", { className: "max-h-60 overflow-y-auto p-2 space-y-1", children: h.map((F) => {
|
|
2677
|
+
const z = S(F);
|
|
2678
2678
|
return /* @__PURE__ */ l(
|
|
2679
2679
|
"div",
|
|
2680
2680
|
{
|
|
2681
|
-
onClick: () =>
|
|
2682
|
-
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${
|
|
2681
|
+
onClick: () => z ? null : b(F.id),
|
|
2682
|
+
className: `flex items-center gap-3 p-2 rounded-md hover:bg-blue-50 ${z ? " hover:cursor-not-allowed" : "hover:cursor-pointer"}`,
|
|
2683
2683
|
children: [
|
|
2684
2684
|
/* @__PURE__ */ e(
|
|
2685
2685
|
"input",
|
|
2686
2686
|
{
|
|
2687
2687
|
type: "checkbox",
|
|
2688
|
-
checked: $.has(
|
|
2688
|
+
checked: $.has(F.id),
|
|
2689
2689
|
readOnly: !0,
|
|
2690
2690
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",
|
|
2691
|
-
disabled: !!
|
|
2691
|
+
disabled: !!z
|
|
2692
2692
|
}
|
|
2693
2693
|
),
|
|
2694
2694
|
/* @__PURE__ */ e(
|
|
2695
2695
|
"img",
|
|
2696
2696
|
{
|
|
2697
|
-
src:
|
|
2698
|
-
alt:
|
|
2697
|
+
src: F.avatarUrl || `https://avatar.vercel.sh/${F.name}.svg?text=${F.name.charAt(0)}`,
|
|
2698
|
+
alt: F.name,
|
|
2699
2699
|
className: "w-8 h-8 rounded-full"
|
|
2700
2700
|
}
|
|
2701
2701
|
),
|
|
2702
|
-
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children:
|
|
2703
|
-
|
|
2704
|
-
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children:
|
|
2702
|
+
/* @__PURE__ */ e("span", { className: "text-md font-medium text-gray-800 truncate", children: F.name }),
|
|
2703
|
+
z ? /* @__PURE__ */ l(ee, { children: [
|
|
2704
|
+
/* @__PURE__ */ e("span", { className: "text-sm px-[12px] py-[2px] border border-dashed rounded-xl bg-teal-100 text-teal-700", children: z }),
|
|
2705
2705
|
/* @__PURE__ */ e("span", { className: "text-sm text-gray-400", children: "Already added" })
|
|
2706
2706
|
] }) : ""
|
|
2707
2707
|
]
|
|
2708
2708
|
},
|
|
2709
|
-
|
|
2709
|
+
F.id
|
|
2710
2710
|
);
|
|
2711
2711
|
}) }),
|
|
2712
2712
|
/* @__PURE__ */ l("div", { className: "flex justify-end gap-2 p-2 border-t border-gray-300", children: [
|
|
@@ -2721,7 +2721,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2721
2721
|
/* @__PURE__ */ e(
|
|
2722
2722
|
"button",
|
|
2723
2723
|
{
|
|
2724
|
-
onClick:
|
|
2724
|
+
onClick: D,
|
|
2725
2725
|
disabled: $.size === 0,
|
|
2726
2726
|
className: "px-3 py-1 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:bg-blue-300 disabled:cursor-not-allowed hover:cursor-pointer",
|
|
2727
2727
|
children: "Add"
|
|
@@ -2746,12 +2746,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2746
2746
|
")"
|
|
2747
2747
|
] }),
|
|
2748
2748
|
n === se.DRIVE && /* @__PURE__ */ e(
|
|
2749
|
-
|
|
2749
|
+
Z,
|
|
2750
2750
|
{
|
|
2751
2751
|
value: T,
|
|
2752
|
-
onChange:
|
|
2752
|
+
onChange: R,
|
|
2753
2753
|
children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
2754
|
-
/* @__PURE__ */ l(
|
|
2754
|
+
/* @__PURE__ */ l(Z.Button, { className: "relative w-full border border-gray-300 bg-white rounded-md shadow-sm pl-3 pr-10 py-2 text-left hover:cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm", children: [
|
|
2755
2755
|
/* @__PURE__ */ l("span", { className: "flex items-center", children: [
|
|
2756
2756
|
/* @__PURE__ */ e(T.icon, { className: "h-5 w-5 text-gray-400 mr-2" }),
|
|
2757
2757
|
/* @__PURE__ */ l("span", { className: "truncate", children: [
|
|
@@ -2764,33 +2764,33 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2764
2764
|
/* @__PURE__ */ e(
|
|
2765
2765
|
oe,
|
|
2766
2766
|
{
|
|
2767
|
-
as:
|
|
2767
|
+
as: Q,
|
|
2768
2768
|
leave: "transition ease-in duration-100",
|
|
2769
2769
|
leaveFrom: "opacity-100",
|
|
2770
2770
|
leaveTo: "opacity-0",
|
|
2771
|
-
children: /* @__PURE__ */ e(
|
|
2772
|
-
|
|
2771
|
+
children: /* @__PURE__ */ e(Z.Options, { className: "absolute z-10 mt-1 w-auto min-w-full bg-white shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: ya.map((F) => /* @__PURE__ */ e(
|
|
2772
|
+
Z.Option,
|
|
2773
2773
|
{
|
|
2774
|
-
value:
|
|
2775
|
-
className: ({ active:
|
|
2776
|
-
children: ({ selected:
|
|
2774
|
+
value: F,
|
|
2775
|
+
className: ({ active: z }) => `${z ? "text-white bg-blue-600" : "text-gray-900"} hover:cursor-pointer select-none relative py-2 pl-10`,
|
|
2776
|
+
children: ({ selected: z, active: U }) => /* @__PURE__ */ l(ee, { children: [
|
|
2777
2777
|
/* @__PURE__ */ l(
|
|
2778
2778
|
"span",
|
|
2779
2779
|
{
|
|
2780
|
-
className: `${
|
|
2780
|
+
className: `${z ? "font-medium" : "font-normal"} flex items-center`,
|
|
2781
2781
|
children: [
|
|
2782
2782
|
/* @__PURE__ */ e(
|
|
2783
|
-
|
|
2783
|
+
F.icon,
|
|
2784
2784
|
{
|
|
2785
|
-
className: `h-5 w-5 mr-2 ${
|
|
2785
|
+
className: `h-5 w-5 mr-2 ${U ? "text-white" : "text-gray-400"}`
|
|
2786
2786
|
}
|
|
2787
2787
|
),
|
|
2788
2788
|
"Can ",
|
|
2789
|
-
|
|
2789
|
+
F.name
|
|
2790
2790
|
]
|
|
2791
2791
|
}
|
|
2792
2792
|
),
|
|
2793
|
-
|
|
2793
|
+
z && /* @__PURE__ */ e("span", { className: "absolute inset-y-0 left-0 flex items-center pl-3 text-blue-600", children: /* @__PURE__ */ e(
|
|
2794
2794
|
ta,
|
|
2795
2795
|
{
|
|
2796
2796
|
className: "h-5 w-5",
|
|
@@ -2799,7 +2799,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2799
2799
|
) })
|
|
2800
2800
|
] })
|
|
2801
2801
|
},
|
|
2802
|
-
|
|
2802
|
+
F.id
|
|
2803
2803
|
)) })
|
|
2804
2804
|
}
|
|
2805
2805
|
)
|
|
@@ -2807,7 +2807,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2807
2807
|
}
|
|
2808
2808
|
)
|
|
2809
2809
|
] }),
|
|
2810
|
-
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((
|
|
2810
|
+
/* @__PURE__ */ e("div", { className: "space-y-2", children: /* @__PURE__ */ e(be, { children: p.map((F, z) => /* @__PURE__ */ l(
|
|
2811
2811
|
ne.div,
|
|
2812
2812
|
{
|
|
2813
2813
|
layout: !0,
|
|
@@ -2821,21 +2821,21 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2821
2821
|
/* @__PURE__ */ e(
|
|
2822
2822
|
"img",
|
|
2823
2823
|
{
|
|
2824
|
-
src:
|
|
2824
|
+
src: F.avatarUrl || `https://avatar.vercel.sh/${F.name}.svg?text=${F.name.charAt(0)}`,
|
|
2825
2825
|
className: "w-8 h-8 rounded-full flex-shrink-0"
|
|
2826
2826
|
}
|
|
2827
2827
|
),
|
|
2828
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children:
|
|
2828
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-sm text-gray-800 truncate", children: F.name })
|
|
2829
2829
|
] }),
|
|
2830
2830
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
|
|
2831
2831
|
n === se.DRIVE && /* @__PURE__ */ l("span", { className: "text-sm text-gray-500", children: [
|
|
2832
2832
|
"can ",
|
|
2833
|
-
|
|
2833
|
+
F.permission
|
|
2834
2834
|
] }),
|
|
2835
2835
|
/* @__PURE__ */ e(
|
|
2836
2836
|
"button",
|
|
2837
2837
|
{
|
|
2838
|
-
onClick: () => w(
|
|
2838
|
+
onClick: () => w(z),
|
|
2839
2839
|
className: "text-gray-400 hover:text-red-500 hover:cursor-pointer",
|
|
2840
2840
|
children: /* @__PURE__ */ e(qe, { className: "h-5 w-5" })
|
|
2841
2841
|
}
|
|
@@ -2843,7 +2843,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2843
2843
|
] })
|
|
2844
2844
|
]
|
|
2845
2845
|
},
|
|
2846
|
-
|
|
2846
|
+
F.id
|
|
2847
2847
|
)) }) })
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
@@ -2851,9 +2851,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2851
2851
|
] }),
|
|
2852
2852
|
/* @__PURE__ */ e("footer", { className: "p-4 border-t border-gray-300 flex-shrink-0", children: /* @__PURE__ */ l("div", { className: "flex justify-between items-center", children: [
|
|
2853
2853
|
/* @__PURE__ */ l("p", { className: "text-sm text-gray-600", children: [
|
|
2854
|
-
|
|
2854
|
+
m.length,
|
|
2855
2855
|
" invitation",
|
|
2856
|
-
|
|
2856
|
+
m.length !== 1 ? "s" : "",
|
|
2857
2857
|
" selected"
|
|
2858
2858
|
] }),
|
|
2859
2859
|
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
@@ -2868,10 +2868,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2868
2868
|
/* @__PURE__ */ e(
|
|
2869
2869
|
"button",
|
|
2870
2870
|
{
|
|
2871
|
-
onClick: () =>
|
|
2872
|
-
disabled:
|
|
2871
|
+
onClick: () => V(j)(),
|
|
2872
|
+
disabled: N || M,
|
|
2873
2873
|
className: "px-4 py-2 text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-sm hover:bg-blue-700 hover:cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-blue-300 disabled:cursor-not-allowed",
|
|
2874
|
-
children:
|
|
2874
|
+
children: N ? "Inviting..." : n === se.DRIVE ? "Send Invites" : "Add"
|
|
2875
2875
|
}
|
|
2876
2876
|
)
|
|
2877
2877
|
] })
|
|
@@ -2888,21 +2888,21 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2888
2888
|
middleware: [Aa(8), Ea(), Ra({ padding: 8 })],
|
|
2889
2889
|
whileElementsMounted: Ia,
|
|
2890
2890
|
placement: "bottom-end"
|
|
2891
|
-
}), y = Nr(c),
|
|
2891
|
+
}), y = Nr(c), v = xr(c), { getReferenceProps: x, getFloatingProps: a } = kr([
|
|
2892
2892
|
y,
|
|
2893
|
-
|
|
2893
|
+
v
|
|
2894
2894
|
]), k = Ke.find((g) => g.name === t.permission || g.value === t.permission) || Ke[0];
|
|
2895
2895
|
return (
|
|
2896
2896
|
// FIX: The <Listbox> component now wraps both the button and the portal.
|
|
2897
2897
|
// This provides the necessary context for both children.
|
|
2898
|
-
/* @__PURE__ */ l(
|
|
2898
|
+
/* @__PURE__ */ l(Z, { value: k, onChange: (g) => {
|
|
2899
2899
|
s(g), n(!1);
|
|
2900
2900
|
}, children: [
|
|
2901
2901
|
/* @__PURE__ */ l(
|
|
2902
|
-
|
|
2902
|
+
Z.Button,
|
|
2903
2903
|
{
|
|
2904
2904
|
ref: u.setReference,
|
|
2905
|
-
...
|
|
2905
|
+
...x(),
|
|
2906
2906
|
className: "relative min-w-[120px] text-left text-sm p-2 border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-opacity-75 hover:cursor-pointer",
|
|
2907
2907
|
children: [
|
|
2908
2908
|
/* @__PURE__ */ e("span", { className: "block truncate", children: t.permission }),
|
|
@@ -2913,7 +2913,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2913
2913
|
/* @__PURE__ */ e(wr, { children: /* @__PURE__ */ e(
|
|
2914
2914
|
oe,
|
|
2915
2915
|
{
|
|
2916
|
-
as:
|
|
2916
|
+
as: Q,
|
|
2917
2917
|
show: o,
|
|
2918
2918
|
enter: "transition ease-out duration-100",
|
|
2919
2919
|
enterFrom: "transform opacity-0 scale-95",
|
|
@@ -2922,7 +2922,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2922
2922
|
leaveFrom: "transform opacity-100 scale-100",
|
|
2923
2923
|
leaveTo: "transform opacity-0 scale-95",
|
|
2924
2924
|
children: /* @__PURE__ */ e(
|
|
2925
|
-
|
|
2925
|
+
Z.Options,
|
|
2926
2926
|
{
|
|
2927
2927
|
ref: u.setFloating,
|
|
2928
2928
|
style: i,
|
|
@@ -2930,7 +2930,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2930
2930
|
static: !0,
|
|
2931
2931
|
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",
|
|
2932
2932
|
children: Ke.filter((g) => r.includes(g.value)).map((g) => /* @__PURE__ */ e(
|
|
2933
|
-
|
|
2933
|
+
Z.Option,
|
|
2934
2934
|
{
|
|
2935
2935
|
className: ({
|
|
2936
2936
|
active: $
|
|
@@ -2970,7 +2970,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2970
2970
|
existingShares: n,
|
|
2971
2971
|
allowedPermissions: u
|
|
2972
2972
|
}) => {
|
|
2973
|
-
const [i, c] = B(n), [y,
|
|
2973
|
+
const [i, c] = B(n), [y, v] = B(0), [x, a] = B(""), k = oa(x, 300), h = {
|
|
2974
2974
|
users: i.users.filter(
|
|
2975
2975
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2976
2976
|
),
|
|
@@ -2980,24 +2980,22 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
2980
2980
|
roles: i.roles.filter(
|
|
2981
2981
|
(C) => C.name.toLowerCase().includes(k.toLowerCase())
|
|
2982
2982
|
)
|
|
2983
|
-
}, g = async (C, T,
|
|
2984
|
-
const
|
|
2985
|
-
c((
|
|
2986
|
-
...
|
|
2987
|
-
[
|
|
2988
|
-
(
|
|
2983
|
+
}, g = async (C, T, I, E) => {
|
|
2984
|
+
const V = T.value;
|
|
2985
|
+
c((q) => ({
|
|
2986
|
+
...q,
|
|
2987
|
+
[I]: q[I].map(
|
|
2988
|
+
(G) => G.id === C.id ? { ...G, permission: V } : G
|
|
2989
2989
|
)
|
|
2990
2990
|
}));
|
|
2991
2991
|
}, $ = () => {
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
});
|
|
3000
|
-
}, L = ["users", "groups", "roles"], M = ["Users", "Groups", "Roles"];
|
|
2992
|
+
const C = {
|
|
2993
|
+
users: i.users.filter((T) => T.permission !== "remove"),
|
|
2994
|
+
groups: i.groups.filter((T) => T.permission !== "remove"),
|
|
2995
|
+
roles: i.roles.filter((T) => T.permission !== "remove")
|
|
2996
|
+
};
|
|
2997
|
+
r(C);
|
|
2998
|
+
}, L = ["users", "groups", "roles"], O = ["Users", "Groups", "Roles"];
|
|
3001
2999
|
return (
|
|
3002
3000
|
// The main structure remains the same...
|
|
3003
3001
|
/* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-gray-50", children: [
|
|
@@ -3008,7 +3006,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3008
3006
|
onClick: () => r(i),
|
|
3009
3007
|
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",
|
|
3010
3008
|
children: [
|
|
3011
|
-
/* @__PURE__ */ e(
|
|
3009
|
+
/* @__PURE__ */ e(Fa, { className: "h-5 w-5" }),
|
|
3012
3010
|
" Back"
|
|
3013
3011
|
]
|
|
3014
3012
|
}
|
|
@@ -3024,9 +3022,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3024
3022
|
)
|
|
3025
3023
|
] }),
|
|
3026
3024
|
/* @__PURE__ */ l("div", { className: "flex flex-col flex-grow", children: [
|
|
3027
|
-
/* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange:
|
|
3025
|
+
/* @__PURE__ */ l(re.Group, { selectedIndex: y, onChange: v, children: [
|
|
3028
3026
|
/* @__PURE__ */ l("div", { className: "p-4 bg-white border-b border-gray-300", children: [
|
|
3029
|
-
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children:
|
|
3027
|
+
/* @__PURE__ */ e(re.List, { className: "flex space-x-1 bg-gray-100 p-1 rounded-lg", children: O.map((C) => /* @__PURE__ */ e(
|
|
3030
3028
|
re,
|
|
3031
3029
|
{
|
|
3032
3030
|
className: ({
|
|
@@ -3042,8 +3040,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3042
3040
|
he,
|
|
3043
3041
|
{
|
|
3044
3042
|
onDebouncedChange: a,
|
|
3045
|
-
value:
|
|
3046
|
-
placeholder: `Search in ${
|
|
3043
|
+
value: x,
|
|
3044
|
+
placeholder: `Search in ${O[y]}...`
|
|
3047
3045
|
}
|
|
3048
3046
|
) })
|
|
3049
3047
|
] }),
|
|
@@ -3054,11 +3052,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3054
3052
|
animate: { y: 0, opacity: 1 },
|
|
3055
3053
|
exit: { y: -10, opacity: 0 },
|
|
3056
3054
|
transition: { duration: 0.2 },
|
|
3057
|
-
children: /* @__PURE__ */ e(re.Panels, { as:
|
|
3055
|
+
children: /* @__PURE__ */ e(re.Panels, { as: Q, children: L.map((C) => /* @__PURE__ */ e(
|
|
3058
3056
|
re.Panel,
|
|
3059
3057
|
{
|
|
3060
3058
|
className: "space-y-3 focus:outline-none",
|
|
3061
|
-
children: /* @__PURE__ */ e(be, { children:
|
|
3059
|
+
children: /* @__PURE__ */ e(be, { children: h[C].length > 0 ? h[C].map((T) => /* @__PURE__ */ l(
|
|
3062
3060
|
ne.div,
|
|
3063
3061
|
{
|
|
3064
3062
|
layout: !0,
|
|
@@ -3101,9 +3099,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3101
3099
|
{
|
|
3102
3100
|
item: T,
|
|
3103
3101
|
allowedPermissions: u,
|
|
3104
|
-
onPermissionChange: (
|
|
3102
|
+
onPermissionChange: (I) => g(
|
|
3105
3103
|
T,
|
|
3106
|
-
|
|
3104
|
+
I,
|
|
3107
3105
|
C
|
|
3108
3106
|
)
|
|
3109
3107
|
}
|
|
@@ -3123,10 +3121,10 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3123
3121
|
/* @__PURE__ */ e(Ca, { className: "h-12 w-12 text-gray-400" }),
|
|
3124
3122
|
/* @__PURE__ */ l("h3", { className: "mt-2 text-sm font-medium text-gray-900", children: [
|
|
3125
3123
|
"No ",
|
|
3126
|
-
|
|
3124
|
+
O[y],
|
|
3127
3125
|
" Found"
|
|
3128
3126
|
] }),
|
|
3129
|
-
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children:
|
|
3127
|
+
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-500", children: x ? `No results for "${x}"` : `There are no ${O[y].toLowerCase()} with access.` })
|
|
3130
3128
|
]
|
|
3131
3129
|
}
|
|
3132
3130
|
)
|
|
@@ -3162,9 +3160,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3162
3160
|
onClose: s,
|
|
3163
3161
|
members: o
|
|
3164
3162
|
}) => {
|
|
3165
|
-
const [n, u] = B(!0), [i, c] = B(""), y = oa(i, 300),
|
|
3166
|
-
(
|
|
3167
|
-
),
|
|
3163
|
+
const [n, u] = B(!0), [i, c] = B(""), y = oa(i, 300), v = o.filter(
|
|
3164
|
+
(h) => h.name.toLowerCase().includes(y.toLowerCase())
|
|
3165
|
+
), x = {
|
|
3168
3166
|
hidden: { opacity: 0 },
|
|
3169
3167
|
visible: {
|
|
3170
3168
|
opacity: 1,
|
|
@@ -3178,8 +3176,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3178
3176
|
exit: { opacity: 0, x: -20 }
|
|
3179
3177
|
}, k = () => n ? (
|
|
3180
3178
|
// Show 5 skeleton items while loading
|
|
3181
|
-
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((
|
|
3182
|
-
) :
|
|
3179
|
+
/* @__PURE__ */ e("div", { children: Array.from({ length: 5 }).map((h, g) => /* @__PURE__ */ e(Nn, {}, g)) })
|
|
3180
|
+
) : v.length === 0 ? /* @__PURE__ */ l(
|
|
3183
3181
|
ne.div,
|
|
3184
3182
|
{
|
|
3185
3183
|
initial: { opacity: 0, scale: 0.95 },
|
|
@@ -3194,11 +3192,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3194
3192
|
) : /* @__PURE__ */ e(
|
|
3195
3193
|
ne.ul,
|
|
3196
3194
|
{
|
|
3197
|
-
variants:
|
|
3195
|
+
variants: x,
|
|
3198
3196
|
initial: "hidden",
|
|
3199
3197
|
animate: "visible",
|
|
3200
3198
|
className: "divide-y divide-gray-200",
|
|
3201
|
-
children: /* @__PURE__ */ e(be, { children:
|
|
3199
|
+
children: /* @__PURE__ */ e(be, { children: v.map((h) => /* @__PURE__ */ l(
|
|
3202
3200
|
ne.li,
|
|
3203
3201
|
{
|
|
3204
3202
|
layout: !0,
|
|
@@ -3209,20 +3207,20 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3209
3207
|
/* @__PURE__ */ e(
|
|
3210
3208
|
"img",
|
|
3211
3209
|
{
|
|
3212
|
-
src:
|
|
3210
|
+
src: h.avatarUrl || `https://avatar.vercel.sh/${h.name}.svg?text=${h.name.charAt(
|
|
3213
3211
|
0
|
|
3214
3212
|
)}`,
|
|
3215
|
-
alt:
|
|
3213
|
+
alt: h.name,
|
|
3216
3214
|
className: "w-10 h-10 rounded-full flex-shrink-0"
|
|
3217
3215
|
}
|
|
3218
3216
|
),
|
|
3219
3217
|
/* @__PURE__ */ l("div", { className: "overflow-hidden", children: [
|
|
3220
|
-
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children:
|
|
3221
|
-
|
|
3218
|
+
/* @__PURE__ */ e("p", { className: "font-medium text-gray-900 truncate", children: h.name }),
|
|
3219
|
+
h.email && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 truncate", children: h.email })
|
|
3222
3220
|
] })
|
|
3223
3221
|
]
|
|
3224
3222
|
},
|
|
3225
|
-
|
|
3223
|
+
h._id
|
|
3226
3224
|
)) })
|
|
3227
3225
|
}
|
|
3228
3226
|
);
|
|
@@ -3234,7 +3232,7 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3234
3232
|
onClick: r,
|
|
3235
3233
|
className: "flex items-center gap-1 text-sm font-medium text-gray-600 hover:text-gray-900 p-2 rounded-md hover:bg-gray-100 hover:cursor-pointer",
|
|
3236
3234
|
children: [
|
|
3237
|
-
/* @__PURE__ */ e(
|
|
3235
|
+
/* @__PURE__ */ e(Fa, { className: "h-5 w-5" }),
|
|
3238
3236
|
" Back"
|
|
3239
3237
|
]
|
|
3240
3238
|
}
|
|
@@ -3283,11 +3281,11 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3283
3281
|
allowedPermissions: c = [],
|
|
3284
3282
|
...y
|
|
3285
3283
|
}) => {
|
|
3286
|
-
const [
|
|
3287
|
-
|
|
3288
|
-
},
|
|
3289
|
-
|
|
3290
|
-
},
|
|
3284
|
+
const [v, x] = B(de.INVITE), [a, k] = B(t), [h, g] = B(null), [$, L] = B(!1), [O, C] = B([]), [T, I] = B(de.MANAGE), E = () => {
|
|
3285
|
+
x(de.INVITE), g(null), u();
|
|
3286
|
+
}, V = () => {
|
|
3287
|
+
x(de.MANAGE);
|
|
3288
|
+
}, q = async ({ id: p, name: f, type: w }) => {
|
|
3291
3289
|
if (w === "groups") {
|
|
3292
3290
|
try {
|
|
3293
3291
|
const d = await Ee(`${Oe.getMembersForGroup(f)}`);
|
|
@@ -3296,19 +3294,18 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3296
3294
|
}
|
|
3297
3295
|
C(resp);
|
|
3298
3296
|
}
|
|
3299
|
-
g({ id: p, type: w, name: f }),
|
|
3300
|
-
},
|
|
3301
|
-
k(p);
|
|
3302
|
-
const f =
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
);
|
|
3306
|
-
L(f), N(b === de.MEMBERS ? T : de.INVITE);
|
|
3297
|
+
g({ id: p, type: w, name: f }), I(v), x(de.MEMBERS);
|
|
3298
|
+
}, G = (p) => {
|
|
3299
|
+
console.log("changedExistingShares", p), k(p);
|
|
3300
|
+
const f = He.mapValues(t, (m) => m.map((b) => ({ id: b.id, permission: b.permission })).sort((b, D) => b.id - D.id)), w = He.mapValues(p, (m) => m.map((b) => ({ id: b.id, permission: b.permission })).sort((b, D) => b.id - D.id));
|
|
3301
|
+
console.log("Existing data:", f), console.log("Changed data:", w);
|
|
3302
|
+
const d = !He.isEqual(f, w);
|
|
3303
|
+
console.log("hasPermissionChanged:", d), L(d), x(v === de.MEMBERS ? T : de.INVITE);
|
|
3307
3304
|
};
|
|
3308
|
-
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as:
|
|
3305
|
+
return /* @__PURE__ */ e(oe, { appear: !0, show: r, as: Q, children: /* @__PURE__ */ l(me, { as: "div", className: "relative z-50", onClose: E, children: [
|
|
3309
3306
|
/* @__PURE__ */ e("div", { className: "filter-modal-overlay", "aria-hidden": "true" }),
|
|
3310
3307
|
/* @__PURE__ */ e("div", { className: "filter-modal-container", children: /* @__PURE__ */ e("div", { className: "filter-modal-positioner", children: /* @__PURE__ */ e(Se, { className: "filter-modal-panel", style: { background: "white" }, children: (() => {
|
|
3311
|
-
switch (
|
|
3308
|
+
switch (v) {
|
|
3312
3309
|
case de.MANAGE:
|
|
3313
3310
|
return /* @__PURE__ */ e(
|
|
3314
3311
|
ne.div,
|
|
@@ -3322,9 +3319,9 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3322
3319
|
vn,
|
|
3323
3320
|
{
|
|
3324
3321
|
entity: o,
|
|
3325
|
-
onBack:
|
|
3326
|
-
onClose:
|
|
3327
|
-
onOpenMembers:
|
|
3322
|
+
onBack: G,
|
|
3323
|
+
onClose: E,
|
|
3324
|
+
onOpenMembers: q,
|
|
3328
3325
|
existingShares: a,
|
|
3329
3326
|
calledBy: n,
|
|
3330
3327
|
allowedPermissions: c
|
|
@@ -3345,12 +3342,12 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3345
3342
|
children: /* @__PURE__ */ e(
|
|
3346
3343
|
xn,
|
|
3347
3344
|
{
|
|
3348
|
-
entity:
|
|
3349
|
-
onBack:
|
|
3350
|
-
onClose:
|
|
3345
|
+
entity: h,
|
|
3346
|
+
onBack: G,
|
|
3347
|
+
onClose: E,
|
|
3351
3348
|
calledBy: n,
|
|
3352
3349
|
existingShares: a,
|
|
3353
|
-
members:
|
|
3350
|
+
members: O
|
|
3354
3351
|
}
|
|
3355
3352
|
)
|
|
3356
3353
|
},
|
|
@@ -3369,8 +3366,8 @@ const De = dn(), Ee = De.axiosGet, un = De.axiosDelete, Re = De.axiosPost, mn =
|
|
|
3369
3366
|
fn,
|
|
3370
3367
|
{
|
|
3371
3368
|
entity: o,
|
|
3372
|
-
onManage:
|
|
3373
|
-
onClose:
|
|
3369
|
+
onManage: V,
|
|
3370
|
+
onClose: E,
|
|
3374
3371
|
existingShares: a,
|
|
3375
3372
|
calledBy: n,
|
|
3376
3373
|
showExistingShares: i,
|
|
@@ -3403,32 +3400,32 @@ function Ye({
|
|
|
3403
3400
|
displayLimit: c = 3,
|
|
3404
3401
|
selectionLimit: y = -1,
|
|
3405
3402
|
// NEW: search behavior
|
|
3406
|
-
searchMode:
|
|
3403
|
+
searchMode: v = "client",
|
|
3407
3404
|
// "client" | "server"
|
|
3408
|
-
onSearch:
|
|
3405
|
+
onSearch: x,
|
|
3409
3406
|
// (query: string) => void (required if searchMode==="server")
|
|
3410
3407
|
serverLoading: a = !1,
|
|
3411
3408
|
minSearchChars: k = 2,
|
|
3412
3409
|
// NEW: mappers (id/label keys)
|
|
3413
|
-
getOptionId:
|
|
3410
|
+
getOptionId: h = ($) => String($.id),
|
|
3414
3411
|
getOptionLabel: g = ($) => $.name
|
|
3415
3412
|
}) {
|
|
3416
|
-
const $ = ea(), L = ea(), [
|
|
3413
|
+
const $ = ea(), L = ea(), [O, C] = B(""), T = ue(""), I = ce(() => {
|
|
3417
3414
|
const p = /* @__PURE__ */ new Map();
|
|
3418
|
-
for (const f of r) p.set(
|
|
3415
|
+
for (const f of r) p.set(h(f), f);
|
|
3419
3416
|
return p;
|
|
3420
|
-
}, [r,
|
|
3421
|
-
if (!
|
|
3422
|
-
const p =
|
|
3417
|
+
}, [r, h]), E = ce(() => Array.isArray(s) ? s.map((p) => p && typeof p == "object" ? I.get(h(p)) || null : I.get(String(p))).filter(Boolean) : [], [s, I, h]), V = ce(() => {
|
|
3418
|
+
if (!O) return r;
|
|
3419
|
+
const p = O.toLowerCase();
|
|
3423
3420
|
return r.filter((f) => g(f).toLowerCase().includes(p));
|
|
3424
|
-
}, [r,
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
}, [
|
|
3428
|
-
const
|
|
3429
|
-
if (!
|
|
3421
|
+
}, [r, O, g]);
|
|
3422
|
+
X(() => {
|
|
3423
|
+
v === "server" && O.length >= k && O !== T.current && (T.current = O, x && x(O));
|
|
3424
|
+
}, [O, v, k, x]);
|
|
3425
|
+
const q = v === "client" ? V : r, G = () => {
|
|
3426
|
+
if (!E.length)
|
|
3430
3427
|
return /* @__PURE__ */ e("span", { className: "text-gray-500", children: u });
|
|
3431
|
-
const p =
|
|
3428
|
+
const p = E.slice(0, c), f = E.length - c;
|
|
3432
3429
|
return /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2", children: [
|
|
3433
3430
|
p.map((w) => /* @__PURE__ */ e(
|
|
3434
3431
|
"span",
|
|
@@ -3436,7 +3433,7 @@ function Ye({
|
|
|
3436
3433
|
className: "px-2 py-1 text-xs font-medium text-white bg-gray-800 rounded-full",
|
|
3437
3434
|
children: g(w)
|
|
3438
3435
|
},
|
|
3439
|
-
|
|
3436
|
+
h(w)
|
|
3440
3437
|
)),
|
|
3441
3438
|
f > 0 && /* @__PURE__ */ l("span", { className: "px-2 py-1 text-xs font-medium text-gray-600 bg-gray-200 rounded-full", children: [
|
|
3442
3439
|
"+",
|
|
@@ -3445,12 +3442,12 @@ function Ye({
|
|
|
3445
3442
|
] })
|
|
3446
3443
|
] });
|
|
3447
3444
|
};
|
|
3448
|
-
return /* @__PURE__ */ e(
|
|
3449
|
-
const f = Array.from(new Set(p.map((w) =>
|
|
3445
|
+
return /* @__PURE__ */ e(Z, { value: E, onChange: (p) => {
|
|
3446
|
+
const f = Array.from(new Set(p.map((w) => h(w))));
|
|
3450
3447
|
y !== -1 && f.length > y || o(f);
|
|
3451
3448
|
}, multiple: !0, by: "id", children: ({ open: p }) => /* @__PURE__ */ l("div", { children: [
|
|
3452
3449
|
/* @__PURE__ */ e(
|
|
3453
|
-
|
|
3450
|
+
Z.Label,
|
|
3454
3451
|
{
|
|
3455
3452
|
id: $,
|
|
3456
3453
|
className: "block text-sm font-medium leading-6 text-gray-900",
|
|
@@ -3459,7 +3456,7 @@ function Ye({
|
|
|
3459
3456
|
),
|
|
3460
3457
|
/* @__PURE__ */ l("div", { className: "relative mt-2", children: [
|
|
3461
3458
|
/* @__PURE__ */ l(
|
|
3462
|
-
|
|
3459
|
+
Z.Button,
|
|
3463
3460
|
{
|
|
3464
3461
|
"aria-labelledby": $,
|
|
3465
3462
|
"aria-invalid": !!i,
|
|
@@ -3470,7 +3467,7 @@ function Ye({
|
|
|
3470
3467
|
i ? "ring-red-500" : "ring-gray-300"
|
|
3471
3468
|
),
|
|
3472
3469
|
children: [
|
|
3473
|
-
/* @__PURE__ */ e("span", { className: "block truncate", children:
|
|
3470
|
+
/* @__PURE__ */ e("span", { className: "block truncate", children: G() }),
|
|
3474
3471
|
/* @__PURE__ */ e("span", { className: "absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none", children: /* @__PURE__ */ e(ka, { className: "w-5 h-5 text-gray-400", "aria-hidden": "true" }) })
|
|
3475
3472
|
]
|
|
3476
3473
|
}
|
|
@@ -3478,48 +3475,48 @@ function Ye({
|
|
|
3478
3475
|
/* @__PURE__ */ e(
|
|
3479
3476
|
oe,
|
|
3480
3477
|
{
|
|
3481
|
-
as:
|
|
3478
|
+
as: Q,
|
|
3482
3479
|
show: p,
|
|
3483
3480
|
leave: "transition ease-in duration-100",
|
|
3484
3481
|
leaveFrom: "opacity-100",
|
|
3485
3482
|
leaveTo: "opacity-0",
|
|
3486
|
-
children: /* @__PURE__ */ l(
|
|
3483
|
+
children: /* @__PURE__ */ l(Z.Options, { className: "absolute z-10 w-full py-1 mt-1 overflow-auto text-base bg-white rounded-md shadow-lg max-h-60 ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm", children: [
|
|
3487
3484
|
/* @__PURE__ */ e("div", { className: "p-2 sticky top-0 bg-white z-20 shadow-sm", children: /* @__PURE__ */ e(
|
|
3488
3485
|
he,
|
|
3489
3486
|
{
|
|
3490
|
-
value:
|
|
3487
|
+
value: O,
|
|
3491
3488
|
onDebouncedChange: C,
|
|
3492
|
-
placeholder:
|
|
3489
|
+
placeholder: v === "server" ? `Search (min ${k})…` : "Search options…"
|
|
3493
3490
|
}
|
|
3494
3491
|
) }),
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
const w =
|
|
3492
|
+
v === "server" && a && /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: "Loading…" }),
|
|
3493
|
+
q.length === 0 && !a ? /* @__PURE__ */ e("div", { className: "py-2 px-3 text-gray-500", children: v === "server" ? O.length < k ? `Type at least ${k} characters to search.` : "No results." : "No options found." }) : q.map((f) => {
|
|
3494
|
+
const w = h(f), d = g(f), m = E.some((D) => h(D) === w), b = y !== -1 && E.length >= y && !m;
|
|
3498
3495
|
return /* @__PURE__ */ e(
|
|
3499
|
-
|
|
3496
|
+
Z.Option,
|
|
3500
3497
|
{
|
|
3501
3498
|
value: f,
|
|
3502
|
-
disabled:
|
|
3503
|
-
className: ({ active:
|
|
3504
|
-
|
|
3499
|
+
disabled: b,
|
|
3500
|
+
className: ({ active: D }) => Pe(
|
|
3501
|
+
b ? " text-gray-400 bg-white cursor-not-allowed" : D ? " bg-gray-200 text-gray-900" : " text-gray-900",
|
|
3505
3502
|
" relative cursor-default select-none py-2 pl-3 pr-9"
|
|
3506
3503
|
),
|
|
3507
|
-
children: ({ selected:
|
|
3504
|
+
children: ({ selected: D, active: R }) => /* @__PURE__ */ l(ee, { children: [
|
|
3508
3505
|
/* @__PURE__ */ e(
|
|
3509
3506
|
"span",
|
|
3510
3507
|
{
|
|
3511
3508
|
className: Pe(
|
|
3512
|
-
|
|
3509
|
+
D ? "font-semibold" : "font-normal",
|
|
3513
3510
|
"block truncate"
|
|
3514
3511
|
),
|
|
3515
3512
|
children: d
|
|
3516
3513
|
}
|
|
3517
3514
|
),
|
|
3518
|
-
|
|
3515
|
+
D && /* @__PURE__ */ e(
|
|
3519
3516
|
"span",
|
|
3520
3517
|
{
|
|
3521
3518
|
className: Pe(
|
|
3522
|
-
|
|
3519
|
+
R ? " text-gray-900" : " text-gray-600",
|
|
3523
3520
|
" absolute inset-y-0 right-0 flex items-center pr-4"
|
|
3524
3521
|
),
|
|
3525
3522
|
children: /* @__PURE__ */ e(Ge, { className: "w-5 h-5", "aria-hidden": "true" })
|
|
@@ -3538,28 +3535,28 @@ function Ye({
|
|
|
3538
3535
|
] }) });
|
|
3539
3536
|
}
|
|
3540
3537
|
Ye.propTypes = {
|
|
3541
|
-
label:
|
|
3542
|
-
options:
|
|
3543
|
-
|
|
3544
|
-
id:
|
|
3545
|
-
name:
|
|
3538
|
+
label: _.string.isRequired,
|
|
3539
|
+
options: _.arrayOf(
|
|
3540
|
+
_.shape({
|
|
3541
|
+
id: _.oneOfType([_.string, _.number]),
|
|
3542
|
+
name: _.string
|
|
3546
3543
|
})
|
|
3547
3544
|
),
|
|
3548
|
-
selected:
|
|
3549
|
-
onChange:
|
|
3550
|
-
onBlur:
|
|
3551
|
-
placeholder:
|
|
3552
|
-
error:
|
|
3553
|
-
displayLimit:
|
|
3554
|
-
selectionLimit:
|
|
3545
|
+
selected: _.array,
|
|
3546
|
+
onChange: _.func,
|
|
3547
|
+
onBlur: _.func,
|
|
3548
|
+
placeholder: _.string,
|
|
3549
|
+
error: _.string,
|
|
3550
|
+
displayLimit: _.number,
|
|
3551
|
+
selectionLimit: _.number,
|
|
3555
3552
|
// NEW
|
|
3556
|
-
searchMode:
|
|
3557
|
-
onSearch:
|
|
3553
|
+
searchMode: _.oneOf(["client", "server"]),
|
|
3554
|
+
onSearch: _.func,
|
|
3558
3555
|
// required when searchMode="server"
|
|
3559
|
-
serverLoading:
|
|
3560
|
-
minSearchChars:
|
|
3561
|
-
getOptionId:
|
|
3562
|
-
getOptionLabel:
|
|
3556
|
+
serverLoading: _.bool,
|
|
3557
|
+
minSearchChars: _.number,
|
|
3558
|
+
getOptionId: _.func,
|
|
3559
|
+
getOptionLabel: _.func
|
|
3563
3560
|
};
|
|
3564
3561
|
Ye.defaultProps = {
|
|
3565
3562
|
options: [],
|
|
@@ -3589,10 +3586,10 @@ const hs = ({
|
|
|
3589
3586
|
secondaryAction: i = { onCancel: null, label: "Cancel" },
|
|
3590
3587
|
dialogPanelClass: c = ""
|
|
3591
3588
|
}) => {
|
|
3592
|
-
const y = (
|
|
3593
|
-
|
|
3594
|
-
},
|
|
3595
|
-
|
|
3589
|
+
const y = (x) => {
|
|
3590
|
+
x.target === x.currentTarget && r(!1);
|
|
3591
|
+
}, v = (x) => {
|
|
3592
|
+
x.stopPropagation();
|
|
3596
3593
|
};
|
|
3597
3594
|
return /* @__PURE__ */ l(
|
|
3598
3595
|
me,
|
|
@@ -3612,7 +3609,7 @@ const hs = ({
|
|
|
3612
3609
|
Se,
|
|
3613
3610
|
{
|
|
3614
3611
|
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`,
|
|
3615
|
-
onClick:
|
|
3612
|
+
onClick: v,
|
|
3616
3613
|
children: [
|
|
3617
3614
|
/* @__PURE__ */ l("div", { className: "flex justify-between items-center border-b border-gray-200 p-6 flex-shrink-0", children: [
|
|
3618
3615
|
o?.customHeader && o.customHeader,
|
|
@@ -3623,13 +3620,13 @@ const hs = ({
|
|
|
3623
3620
|
"div",
|
|
3624
3621
|
{
|
|
3625
3622
|
className: "px-5 mb-5",
|
|
3626
|
-
onClick:
|
|
3623
|
+
onClick: v,
|
|
3627
3624
|
children: s
|
|
3628
3625
|
}
|
|
3629
3626
|
),
|
|
3630
3627
|
n?.show && !n?.customFooter && /* @__PURE__ */ l("div", { className: "border-t flex justify-end border-gray-200 p-6 flex-shrink-0", children: [
|
|
3631
3628
|
i?.onCancel && /* @__PURE__ */ e(
|
|
3632
|
-
|
|
3629
|
+
H,
|
|
3633
3630
|
{
|
|
3634
3631
|
"data-testid": "cancel-button",
|
|
3635
3632
|
label: i?.label,
|
|
@@ -3641,7 +3638,7 @@ const hs = ({
|
|
|
3641
3638
|
}
|
|
3642
3639
|
),
|
|
3643
3640
|
u?.onSubmit && /* @__PURE__ */ e(
|
|
3644
|
-
|
|
3641
|
+
H,
|
|
3645
3642
|
{
|
|
3646
3643
|
label: u?.label,
|
|
3647
3644
|
loader: u?.loader,
|
|
@@ -3687,14 +3684,14 @@ function Cn({
|
|
|
3687
3684
|
onDelete: c,
|
|
3688
3685
|
renderActions: y,
|
|
3689
3686
|
// optional override
|
|
3690
|
-
dragId:
|
|
3691
|
-
dropId:
|
|
3687
|
+
dragId: v,
|
|
3688
|
+
dropId: x,
|
|
3692
3689
|
indent: a = 24
|
|
3693
3690
|
}) {
|
|
3694
|
-
const { setNodeRef: k, isOver:
|
|
3695
|
-
const p =
|
|
3696
|
-
|
|
3697
|
-
},
|
|
3691
|
+
const { setNodeRef: k, isOver: h } = Ut({ id: x }), { attributes: g, listeners: $, setNodeRef: L, transform: O, isDragging: C } = Vt({ id: v }), T = O ? { transform: `translate3d(${Math.round(O.x)}px, ${Math.round(O.y)}px, 0)` } : void 0, [I, E] = B(!1), [V, q] = B(t.name), G = () => {
|
|
3692
|
+
const p = V.trim();
|
|
3693
|
+
E(!1), p && p !== t.name ? i?.(t, p) : q(t.name);
|
|
3694
|
+
}, N = ce(() => /* @__PURE__ */ e(
|
|
3698
3695
|
an,
|
|
3699
3696
|
{
|
|
3700
3697
|
options: [
|
|
@@ -3703,7 +3700,7 @@ function Cn({
|
|
|
3703
3700
|
{ action: "delete", label: "Delete" }
|
|
3704
3701
|
],
|
|
3705
3702
|
onSelect: (f) => {
|
|
3706
|
-
f.action === "create" ? u?.(t) : f.action === "rename" ?
|
|
3703
|
+
f.action === "create" ? u?.(t) : f.action === "rename" ? E(!0) : f.action === "delete" && c?.(t);
|
|
3707
3704
|
}
|
|
3708
3705
|
}
|
|
3709
3706
|
), [t, u, c]);
|
|
@@ -3711,38 +3708,38 @@ function Cn({
|
|
|
3711
3708
|
"div",
|
|
3712
3709
|
{
|
|
3713
3710
|
ref: k,
|
|
3714
|
-
className: `tv-row ${
|
|
3711
|
+
className: `tv-row ${h ? "tv-drop-over" : ""} ${C ? "dragging" : ""}`,
|
|
3715
3712
|
style: { ...T, paddingLeft: 8 + r * a },
|
|
3716
3713
|
onClick: (p) => {
|
|
3717
3714
|
p.target.closest(".tv-toggle") || p.target.tagName === "INPUT" || n?.(t);
|
|
3718
3715
|
},
|
|
3719
3716
|
children: [
|
|
3720
3717
|
/* @__PURE__ */ e("button", { className: "tv-toggle", onClick: o, "aria-label": "toggle", children: t.children?.length ? s ? /* @__PURE__ */ e(wa, { size: 16 }) : /* @__PURE__ */ e(je, { size: 16 }) : /* @__PURE__ */ e("span", { className: "tv-spacer" }) }),
|
|
3721
|
-
/* @__PURE__ */ e(
|
|
3722
|
-
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children:
|
|
3718
|
+
/* @__PURE__ */ e($a, { size: 16, className: "tv-folder-ic" }),
|
|
3719
|
+
/* @__PURE__ */ e("div", { className: "tv-name", ref: L, children: I ? /* @__PURE__ */ e(
|
|
3723
3720
|
"input",
|
|
3724
3721
|
{
|
|
3725
3722
|
className: "tv-input",
|
|
3726
|
-
value:
|
|
3727
|
-
onChange: (p) =>
|
|
3728
|
-
onBlur:
|
|
3723
|
+
value: V,
|
|
3724
|
+
onChange: (p) => q(p.target.value),
|
|
3725
|
+
onBlur: G,
|
|
3729
3726
|
onKeyDown: (p) => {
|
|
3730
|
-
p.key === "Enter" &&
|
|
3727
|
+
p.key === "Enter" && G(), p.key === "Escape" && (E(!1), q(t.name));
|
|
3731
3728
|
},
|
|
3732
3729
|
autoFocus: !0
|
|
3733
3730
|
}
|
|
3734
|
-
) : /* @__PURE__ */ e("span", { onDoubleClick: () =>
|
|
3731
|
+
) : /* @__PURE__ */ e("span", { onDoubleClick: () => E(!0), children: t.name }) }),
|
|
3735
3732
|
/* @__PURE__ */ e(wn, { listeners: $, attributes: g }),
|
|
3736
3733
|
/* @__PURE__ */ e("div", { className: "tv-actions", children: y ? y(t, {
|
|
3737
3734
|
onCreateChild: () => u?.(t),
|
|
3738
|
-
onRename: () =>
|
|
3735
|
+
onRename: () => E(!0),
|
|
3739
3736
|
onDelete: () => c?.(t)
|
|
3740
|
-
}) :
|
|
3737
|
+
}) : N })
|
|
3741
3738
|
]
|
|
3742
3739
|
}
|
|
3743
3740
|
);
|
|
3744
3741
|
}
|
|
3745
|
-
const Sn = (t) => String(t.id ?? t._id), Dn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root",
|
|
3742
|
+
const Sn = (t) => String(t.id ?? t._id), Dn = (t) => t.parent !== void 0 ? String(t.parent) : t.parentId != null ? String(t.parentId) : "root", Fn = (t) => t.name ?? t.label ?? "", $n = (t) => Array.isArray(t) && t.some((r) => Array.isArray(r.children));
|
|
3746
3743
|
function Tn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
3747
3744
|
const u = /* @__PURE__ */ new Map();
|
|
3748
3745
|
t.forEach((c) => {
|
|
@@ -3764,14 +3761,14 @@ function Tn(t, { rootId: r, getId: s, getParent: o, getName: n }) {
|
|
|
3764
3761
|
function An(t, { rootId: r, getId: s, getName: o }) {
|
|
3765
3762
|
const n = /* @__PURE__ */ new Map();
|
|
3766
3763
|
function u(c, y) {
|
|
3767
|
-
const
|
|
3764
|
+
const v = s(c), x = {
|
|
3768
3765
|
...c,
|
|
3769
|
-
id:
|
|
3766
|
+
id: v,
|
|
3770
3767
|
name: o(c),
|
|
3771
3768
|
parentId: y || r,
|
|
3772
|
-
children: (c.children || []).map((a) => u(a,
|
|
3769
|
+
children: (c.children || []).map((a) => u(a, v))
|
|
3773
3770
|
};
|
|
3774
|
-
return n.set(
|
|
3771
|
+
return n.set(v, x), x;
|
|
3775
3772
|
}
|
|
3776
3773
|
return { roots: t.map((c) => u(c, null)), byId: n };
|
|
3777
3774
|
}
|
|
@@ -3821,54 +3818,54 @@ function ps({
|
|
|
3821
3818
|
title: s = "Folders",
|
|
3822
3819
|
getId: o = Sn,
|
|
3823
3820
|
getParent: n = Dn,
|
|
3824
|
-
getName: u =
|
|
3821
|
+
getName: u = Fn,
|
|
3825
3822
|
onSelect: i,
|
|
3826
3823
|
onCreateRoot: c,
|
|
3827
3824
|
onCreateChild: y,
|
|
3828
|
-
onRename:
|
|
3829
|
-
onDelete:
|
|
3825
|
+
onRename: v,
|
|
3826
|
+
onDelete: x,
|
|
3830
3827
|
onMove: a,
|
|
3831
3828
|
renderActions: k,
|
|
3832
|
-
disableMoveToRoot:
|
|
3829
|
+
disableMoveToRoot: h = !1,
|
|
3833
3830
|
// ← allow root moves by default now
|
|
3834
3831
|
indentUnit: g = 24
|
|
3835
3832
|
}) {
|
|
3836
|
-
const { roots: $ } = ce(() =>
|
|
3837
|
-
t.map((
|
|
3833
|
+
const { roots: $ } = ce(() => $n(t) ? An(t, { rootId: r, getId: o, getName: u }) : Tn(
|
|
3834
|
+
t.map((b) => ({ ...b })),
|
|
3838
3835
|
{ rootId: r, getId: o, getParent: n, getName: u }
|
|
3839
|
-
), [t, r, o, n, u]), [L,
|
|
3840
|
-
const
|
|
3841
|
-
return (function
|
|
3842
|
-
|
|
3843
|
-
|
|
3836
|
+
), [t, r, o, n, u]), [L, O] = B({}), C = K((b) => {
|
|
3837
|
+
const D = {};
|
|
3838
|
+
return (function R(j) {
|
|
3839
|
+
j.forEach((S) => {
|
|
3840
|
+
D[S.id] = !0, S.children?.length && R(S.children);
|
|
3844
3841
|
});
|
|
3845
|
-
})(
|
|
3842
|
+
})(b), D;
|
|
3846
3843
|
}, []);
|
|
3847
3844
|
ae.useEffect(() => {
|
|
3848
|
-
|
|
3845
|
+
O(C($));
|
|
3849
3846
|
}, [$, C]);
|
|
3850
3847
|
const T = K(
|
|
3851
|
-
(
|
|
3848
|
+
(b) => O((D) => ({ ...D, [b]: !D[b] })),
|
|
3852
3849
|
[]
|
|
3853
|
-
), [
|
|
3854
|
-
ae.useEffect(() =>
|
|
3855
|
-
const
|
|
3850
|
+
), [I, E] = B(() => Ae($));
|
|
3851
|
+
ae.useEffect(() => E(Ae($)), [$]);
|
|
3852
|
+
const V = qt(
|
|
3856
3853
|
jt(Yt, { activationConstraint: { delay: 250, tolerance: 5 } })
|
|
3857
|
-
),
|
|
3858
|
-
}, w = ({ delta:
|
|
3859
|
-
p.current =
|
|
3854
|
+
), q = ue(null), [G, N] = B(null), p = ue(0), f = () => {
|
|
3855
|
+
}, w = ({ delta: b }) => {
|
|
3856
|
+
p.current = b?.x ?? 0;
|
|
3860
3857
|
}, d = K(
|
|
3861
|
-
({ active:
|
|
3862
|
-
const
|
|
3863
|
-
if (p.current = 0,
|
|
3864
|
-
const
|
|
3865
|
-
if (!
|
|
3866
|
-
let A =
|
|
3867
|
-
const
|
|
3868
|
-
if (
|
|
3869
|
-
let ie =
|
|
3870
|
-
for (let xe = 0; xe <
|
|
3871
|
-
const P = Ka(
|
|
3858
|
+
({ active: b, over: D }) => {
|
|
3859
|
+
const R = p.current;
|
|
3860
|
+
if (p.current = 0, N(null), !b || !D) return;
|
|
3861
|
+
const j = String(b.id).replace(/^drag-/, ""), S = String(D.id).replace(/^drop-/, "");
|
|
3862
|
+
if (!j || !S || j === S) return;
|
|
3863
|
+
let A = S;
|
|
3864
|
+
const M = Math.max(0, Math.floor(-R / g));
|
|
3865
|
+
if (M > 0) {
|
|
3866
|
+
let ie = S;
|
|
3867
|
+
for (let xe = 0; xe < M; xe++) {
|
|
3868
|
+
const P = Ka(I, ie, null);
|
|
3872
3869
|
if (!P) break;
|
|
3873
3870
|
if (!P.parentId) {
|
|
3874
3871
|
A = r;
|
|
@@ -3877,58 +3874,58 @@ function ps({
|
|
|
3877
3874
|
A = P.parentId, ie = P.parentId;
|
|
3878
3875
|
}
|
|
3879
3876
|
}
|
|
3880
|
-
if (
|
|
3881
|
-
|
|
3877
|
+
if (h && A === r) {
|
|
3878
|
+
E(Ae($));
|
|
3882
3879
|
return;
|
|
3883
3880
|
}
|
|
3884
|
-
const
|
|
3885
|
-
if (!
|
|
3886
|
-
const Ne = Rn(
|
|
3887
|
-
|
|
3881
|
+
const F = Ae(I), { newRoots: z, removed: U } = En(F, j);
|
|
3882
|
+
if (!U) return;
|
|
3883
|
+
const Ne = Rn(z, A, U);
|
|
3884
|
+
E(Ne), a?.({ sourceId: j, destParentId: A, newTree: Ne });
|
|
3888
3885
|
},
|
|
3889
|
-
[
|
|
3890
|
-
),
|
|
3891
|
-
(
|
|
3886
|
+
[I, $, r, h, g, a]
|
|
3887
|
+
), m = K(
|
|
3888
|
+
(b, D = 0) => b.map((R) => /* @__PURE__ */ l(ae.Fragment, { children: [
|
|
3892
3889
|
/* @__PURE__ */ e(
|
|
3893
3890
|
Cn,
|
|
3894
3891
|
{
|
|
3895
|
-
node:
|
|
3896
|
-
depth:
|
|
3897
|
-
expanded: !!L[
|
|
3898
|
-
onToggle: () => T(
|
|
3892
|
+
node: R,
|
|
3893
|
+
depth: D,
|
|
3894
|
+
expanded: !!L[R.id],
|
|
3895
|
+
onToggle: () => T(R.id),
|
|
3899
3896
|
onSelect: i,
|
|
3900
3897
|
onCreateChild: y,
|
|
3901
|
-
onRename:
|
|
3902
|
-
onDelete:
|
|
3898
|
+
onRename: v,
|
|
3899
|
+
onDelete: x,
|
|
3903
3900
|
renderActions: k,
|
|
3904
|
-
dragId: `drag-${
|
|
3905
|
-
dropId: `drop-${
|
|
3901
|
+
dragId: `drag-${R.id}`,
|
|
3902
|
+
dropId: `drop-${R.id}`,
|
|
3906
3903
|
indent: g
|
|
3907
3904
|
}
|
|
3908
3905
|
),
|
|
3909
|
-
L[
|
|
3910
|
-
] },
|
|
3911
|
-
[L, g, y,
|
|
3906
|
+
L[R.id] && R.children?.length > 0 ? m(R.children, D + 1) : null
|
|
3907
|
+
] }, R.id)),
|
|
3908
|
+
[L, g, y, x, v, i, k, T]
|
|
3912
3909
|
);
|
|
3913
3910
|
return ae.useMemo(() => {
|
|
3914
|
-
if (!
|
|
3915
|
-
const
|
|
3916
|
-
function
|
|
3917
|
-
for (const
|
|
3918
|
-
if (
|
|
3919
|
-
const
|
|
3920
|
-
if (
|
|
3911
|
+
if (!G) return null;
|
|
3912
|
+
const b = String(G).replace(/^drag-/, "");
|
|
3913
|
+
function D(R) {
|
|
3914
|
+
for (const j of R) {
|
|
3915
|
+
if (j.id === b) return j;
|
|
3916
|
+
const S = j.children?.length ? D(j.children) : null;
|
|
3917
|
+
if (S) return S;
|
|
3921
3918
|
}
|
|
3922
3919
|
return null;
|
|
3923
3920
|
}
|
|
3924
|
-
return
|
|
3925
|
-
}, [
|
|
3921
|
+
return D(I);
|
|
3922
|
+
}, [G, I]), /* @__PURE__ */ l("div", { className: "tv", children: [
|
|
3926
3923
|
s !== !1 && /* @__PURE__ */ l("div", { className: "tv-header", children: [
|
|
3927
3924
|
/* @__PURE__ */ e("div", { className: "tv-title", children: s }),
|
|
3928
3925
|
/* @__PURE__ */ e("button", { className: "tv-btn", onClick: c, children: "+ New folder" })
|
|
3929
3926
|
] }),
|
|
3930
3927
|
/* @__PURE__ */ l("div", { className: "tv-root-row", children: [
|
|
3931
|
-
/* @__PURE__ */ e(
|
|
3928
|
+
/* @__PURE__ */ e($a, { size: 16, className: "tv-folder-ic" }),
|
|
3932
3929
|
/* @__PURE__ */ e("strong", { children: "ROOT" }),
|
|
3933
3930
|
/* @__PURE__ */ e("button", { className: "tv-icon", title: "Create top-level", onClick: c, children: "+" })
|
|
3934
3931
|
] }),
|
|
@@ -3936,12 +3933,12 @@ function ps({
|
|
|
3936
3933
|
Gt,
|
|
3937
3934
|
{
|
|
3938
3935
|
collisionDetection: Wt,
|
|
3939
|
-
sensors:
|
|
3936
|
+
sensors: V,
|
|
3940
3937
|
onDragStart: f,
|
|
3941
3938
|
onDragMove: w,
|
|
3942
3939
|
onDragEnd: d,
|
|
3943
3940
|
modifiers: [_t],
|
|
3944
|
-
children: /* @__PURE__ */ e("div", { ref:
|
|
3941
|
+
children: /* @__PURE__ */ e("div", { ref: q, className: "tv-list", children: m(I, 0) })
|
|
3945
3942
|
}
|
|
3946
3943
|
)
|
|
3947
3944
|
] });
|
|
@@ -3960,13 +3957,13 @@ const gs = ({
|
|
|
3960
3957
|
...c
|
|
3961
3958
|
// Pass remaining props to Tab.Group
|
|
3962
3959
|
}) => {
|
|
3963
|
-
const y = s === "vertical",
|
|
3960
|
+
const y = s === "vertical", v = (k) => fe(
|
|
3964
3961
|
"text-left text-sm rounded-md px-2 py-1.5 focus:outline-none",
|
|
3965
3962
|
k ? "bg-indigo-50 text-indigo-700" : "text-slate-600 hover:bg-slate-50 hover:text-indigo-700"
|
|
3966
|
-
),
|
|
3963
|
+
), x = (k) => fe(
|
|
3967
3964
|
"py-2 -mb-px text-sm font-medium focus:outline-none border-b-2",
|
|
3968
3965
|
k ? "border-indigo-600 text-indigo-700" : "border-transparent text-slate-600 hover:text-indigo-700"
|
|
3969
|
-
), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ?
|
|
3966
|
+
), a = ({ selected: k }) => i ? typeof i == "function" ? i(k) : i : y ? v(k) : x(k);
|
|
3970
3967
|
return /* @__PURE__ */ e(re.Group, { vertical: y, ...c, children: y ? /* @__PURE__ */ l("div", { className: fe("flex gap-4", o), children: [
|
|
3971
3968
|
/* @__PURE__ */ e(re.List, { className: fe("w-[150px] flex flex-col gap-1 border-r border-gray-300 pr-2", n), children: t.map((k) => /* @__PURE__ */ e(re, { className: a, children: k.label }, k.key)) }),
|
|
3972
3969
|
/* @__PURE__ */ e(re.Panels, { unmount: !r, className: fe("flex-1", u), children: t.map((k) => /* @__PURE__ */ e(re.Panel, { className: "focus:outline-none", children: /* @__PURE__ */ e("div", { className: "[overflow-anchor:none]", children: k.content }) }, k.key)) })
|
|
@@ -3981,33 +3978,33 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
3981
3978
|
const a = r && r[t.key] || {};
|
|
3982
3979
|
return console.log("Initial Section data for", t.key, a), a;
|
|
3983
3980
|
}), y = ue(r);
|
|
3984
|
-
|
|
3981
|
+
X(() => {
|
|
3985
3982
|
if (y.current !== r) {
|
|
3986
3983
|
y.current = r;
|
|
3987
3984
|
const a = r && r[t.key] || {};
|
|
3988
3985
|
console.log("Updated Section data for", t.key, a), c(a);
|
|
3989
3986
|
}
|
|
3990
3987
|
}, [r, t.key]), console.log("Section data", i);
|
|
3991
|
-
const
|
|
3992
|
-
|
|
3993
|
-
|
|
3988
|
+
const v = ue(i);
|
|
3989
|
+
X(() => {
|
|
3990
|
+
v.current !== i && s && typeof s == "function" && (v.current = i, s(n.key, i));
|
|
3994
3991
|
}, [n.key, i, s]);
|
|
3995
|
-
const
|
|
3992
|
+
const x = (a) => {
|
|
3996
3993
|
if (!a.dependsOn) return !0;
|
|
3997
|
-
const { field: k, value:
|
|
3994
|
+
const { field: k, value: h, operator: g = "equals" } = a.dependsOn, $ = i[k];
|
|
3998
3995
|
switch (g) {
|
|
3999
3996
|
case "equals":
|
|
4000
|
-
return $ ===
|
|
3997
|
+
return $ === h;
|
|
4001
3998
|
case "notEquals":
|
|
4002
|
-
return $ !==
|
|
3999
|
+
return $ !== h;
|
|
4003
4000
|
case "contains":
|
|
4004
|
-
return Array.isArray($) && $.includes(
|
|
4001
|
+
return Array.isArray($) && $.includes(h);
|
|
4005
4002
|
case "notContains":
|
|
4006
|
-
return !Array.isArray($) || !$.includes(
|
|
4003
|
+
return !Array.isArray($) || !$.includes(h);
|
|
4007
4004
|
case "greaterThan":
|
|
4008
|
-
return Number($) > Number(
|
|
4005
|
+
return Number($) > Number(h);
|
|
4009
4006
|
case "lessThan":
|
|
4010
|
-
return Number($) < Number(
|
|
4007
|
+
return Number($) < Number(h);
|
|
4011
4008
|
case "isEmpty":
|
|
4012
4009
|
return !$ || Array.isArray($) && $.length === 0;
|
|
4013
4010
|
case "isNotEmpty":
|
|
@@ -4029,7 +4026,7 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4029
4026
|
}
|
|
4030
4027
|
),
|
|
4031
4028
|
/* @__PURE__ */ e("p", { style: { fontSize: "14px", marginBottom: "10px" }, children: n.description }),
|
|
4032
|
-
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, k) =>
|
|
4029
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: n.fields.map((a, k) => x(a) && /* @__PURE__ */ l("div", { style: { marginBottom: "10px" }, children: [
|
|
4033
4030
|
/* @__PURE__ */ l(
|
|
4034
4031
|
"label",
|
|
4035
4032
|
{
|
|
@@ -4047,15 +4044,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4047
4044
|
),
|
|
4048
4045
|
a.fieldtype === "text" && /* @__PURE__ */ l("div", { children: [
|
|
4049
4046
|
/* @__PURE__ */ e(
|
|
4050
|
-
|
|
4047
|
+
Y,
|
|
4051
4048
|
{
|
|
4052
4049
|
type: "text",
|
|
4053
4050
|
name: a.key,
|
|
4054
4051
|
defaultValue: a.default,
|
|
4055
4052
|
placeholder: a.placeholder,
|
|
4056
4053
|
value: i[a.key] || "",
|
|
4057
|
-
onChange: (
|
|
4058
|
-
const g = { ...i, [a.key]:
|
|
4054
|
+
onChange: (h) => {
|
|
4055
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4059
4056
|
c(g), s && s(n.key, g);
|
|
4060
4057
|
},
|
|
4061
4058
|
required: a.required,
|
|
@@ -4073,8 +4070,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4073
4070
|
defaultValue: a.default,
|
|
4074
4071
|
placeholder: a.placeholder,
|
|
4075
4072
|
value: i[a.key] || "",
|
|
4076
|
-
onChange: (
|
|
4077
|
-
const g = { ...i, [a.key]:
|
|
4073
|
+
onChange: (h) => {
|
|
4074
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4078
4075
|
c(g), s && s(n.key, g);
|
|
4079
4076
|
},
|
|
4080
4077
|
rows: 3,
|
|
@@ -4087,15 +4084,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4087
4084
|
] }),
|
|
4088
4085
|
a.fieldtype === "number" && /* @__PURE__ */ l("div", { children: [
|
|
4089
4086
|
/* @__PURE__ */ e(
|
|
4090
|
-
|
|
4087
|
+
Y,
|
|
4091
4088
|
{
|
|
4092
4089
|
type: "number",
|
|
4093
4090
|
name: a.key,
|
|
4094
4091
|
defaultValue: a.default,
|
|
4095
4092
|
placeholder: a.placeholder,
|
|
4096
4093
|
value: i[a.key] || "",
|
|
4097
|
-
onChange: (
|
|
4098
|
-
const g = { ...i, [a.key]:
|
|
4094
|
+
onChange: (h) => {
|
|
4095
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4099
4096
|
c(g), s && s(n.key, g);
|
|
4100
4097
|
},
|
|
4101
4098
|
required: a.required,
|
|
@@ -4111,8 +4108,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4111
4108
|
{
|
|
4112
4109
|
name: a.key,
|
|
4113
4110
|
checked: !!(i[a.key] || a.default),
|
|
4114
|
-
onChange: (
|
|
4115
|
-
const g = { ...i, [a.key]:
|
|
4111
|
+
onChange: (h) => {
|
|
4112
|
+
const g = { ...i, [a.key]: h };
|
|
4116
4113
|
c(g), s && s(n.key, g);
|
|
4117
4114
|
},
|
|
4118
4115
|
label: a.placeholder || a.label,
|
|
@@ -4129,8 +4126,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4129
4126
|
name: a.key,
|
|
4130
4127
|
defaultValue: a.default,
|
|
4131
4128
|
value: i[a.key] || "",
|
|
4132
|
-
onChange: (
|
|
4133
|
-
const g = { ...i, [a.key]:
|
|
4129
|
+
onChange: (h) => {
|
|
4130
|
+
const g = { ...i, [a.key]: h };
|
|
4134
4131
|
c(g);
|
|
4135
4132
|
},
|
|
4136
4133
|
options: a.options || [],
|
|
@@ -4144,15 +4141,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4144
4141
|
] }),
|
|
4145
4142
|
a.fieldtype === "email" && /* @__PURE__ */ l("div", { children: [
|
|
4146
4143
|
/* @__PURE__ */ e(
|
|
4147
|
-
|
|
4144
|
+
Y,
|
|
4148
4145
|
{
|
|
4149
4146
|
type: "email",
|
|
4150
4147
|
name: a.key,
|
|
4151
4148
|
defaultValue: a.default,
|
|
4152
4149
|
placeholder: a.placeholder || "Enter email address",
|
|
4153
4150
|
value: i[a.key] || "",
|
|
4154
|
-
onChange: (
|
|
4155
|
-
const g = { ...i, [a.key]:
|
|
4151
|
+
onChange: (h) => {
|
|
4152
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4156
4153
|
c(g), s && s(n.key, g);
|
|
4157
4154
|
},
|
|
4158
4155
|
required: a.required,
|
|
@@ -4164,15 +4161,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4164
4161
|
] }),
|
|
4165
4162
|
a.fieldtype === "url" && /* @__PURE__ */ l("div", { children: [
|
|
4166
4163
|
/* @__PURE__ */ e(
|
|
4167
|
-
|
|
4164
|
+
Y,
|
|
4168
4165
|
{
|
|
4169
4166
|
type: "url",
|
|
4170
4167
|
name: a.key,
|
|
4171
4168
|
defaultValue: a.default,
|
|
4172
4169
|
placeholder: a.placeholder || "Enter URL",
|
|
4173
4170
|
value: i[a.key] || "",
|
|
4174
|
-
onChange: (
|
|
4175
|
-
const g = { ...i, [a.key]:
|
|
4171
|
+
onChange: (h) => {
|
|
4172
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4176
4173
|
c(g), s && s(n.key, g);
|
|
4177
4174
|
},
|
|
4178
4175
|
required: a.required,
|
|
@@ -4184,15 +4181,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4184
4181
|
] }),
|
|
4185
4182
|
a.fieldtype === "password" && /* @__PURE__ */ l("div", { children: [
|
|
4186
4183
|
/* @__PURE__ */ e(
|
|
4187
|
-
|
|
4184
|
+
Y,
|
|
4188
4185
|
{
|
|
4189
4186
|
type: "password",
|
|
4190
4187
|
name: a.key,
|
|
4191
4188
|
defaultValue: a.default,
|
|
4192
4189
|
placeholder: a.placeholder || "Enter password",
|
|
4193
4190
|
value: i[a.key] || "",
|
|
4194
|
-
onChange: (
|
|
4195
|
-
const g = { ...i, [a.key]:
|
|
4191
|
+
onChange: (h) => {
|
|
4192
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4196
4193
|
c(g), s && s(n.key, g);
|
|
4197
4194
|
},
|
|
4198
4195
|
required: a.required,
|
|
@@ -4207,8 +4204,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4207
4204
|
Ye,
|
|
4208
4205
|
{
|
|
4209
4206
|
selectedItems: i[a.key] || [],
|
|
4210
|
-
onSelectionChange: (
|
|
4211
|
-
const g = { ...i, [a.key]:
|
|
4207
|
+
onSelectionChange: (h) => {
|
|
4208
|
+
const g = { ...i, [a.key]: h };
|
|
4212
4209
|
c(g), s && s(n.key, g);
|
|
4213
4210
|
},
|
|
4214
4211
|
options: a.options || [],
|
|
@@ -4224,9 +4221,9 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4224
4221
|
Ga,
|
|
4225
4222
|
{
|
|
4226
4223
|
checked: typeof i[a.key] == "boolean" ? i[a.key] : a.default,
|
|
4227
|
-
onChange: (
|
|
4228
|
-
console.log("Toggle changed:", a.key,
|
|
4229
|
-
const g = { ...i, [a.key]:
|
|
4224
|
+
onChange: (h) => {
|
|
4225
|
+
console.log("Toggle changed:", a.key, h);
|
|
4226
|
+
const g = { ...i, [a.key]: h };
|
|
4230
4227
|
c(g), s && s(n.key, g);
|
|
4231
4228
|
},
|
|
4232
4229
|
label: a.placeholder || a.label,
|
|
@@ -4240,8 +4237,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4240
4237
|
{
|
|
4241
4238
|
label: a.label,
|
|
4242
4239
|
value: i[a.key] ? new Date(i[a.key]) : null,
|
|
4243
|
-
onChange: (
|
|
4244
|
-
const g = { ...i, [a.key]:
|
|
4240
|
+
onChange: (h) => {
|
|
4241
|
+
const g = { ...i, [a.key]: h ? h.toISOString().split("T")[0] : "" };
|
|
4245
4242
|
c(g), s && s(n.key, g);
|
|
4246
4243
|
},
|
|
4247
4244
|
placeholder: a.placeholder || "Select date",
|
|
@@ -4255,8 +4252,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4255
4252
|
{
|
|
4256
4253
|
label: a.label,
|
|
4257
4254
|
value: i[a.key] || { from: null, to: null },
|
|
4258
|
-
onChange: (
|
|
4259
|
-
const g = { ...i, [a.key]:
|
|
4255
|
+
onChange: (h) => {
|
|
4256
|
+
const g = { ...i, [a.key]: h };
|
|
4260
4257
|
c(g), s && s(n.key, g);
|
|
4261
4258
|
},
|
|
4262
4259
|
placeholder: a.placeholder || "Select date range",
|
|
@@ -4270,8 +4267,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4270
4267
|
Ua,
|
|
4271
4268
|
{
|
|
4272
4269
|
selectedValue: typeof i[a.key] < "u" ? i[a.key] : a.default || "",
|
|
4273
|
-
onValueChange: (
|
|
4274
|
-
const g = { ...i, [a.key]:
|
|
4270
|
+
onValueChange: (h) => {
|
|
4271
|
+
const g = { ...i, [a.key]: h };
|
|
4275
4272
|
c(g), s && s(n.key, g);
|
|
4276
4273
|
},
|
|
4277
4274
|
options: a.options || [],
|
|
@@ -4282,15 +4279,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4282
4279
|
o[n.key]?.[a.key] && /* @__PURE__ */ e("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: o[n.key][a.key] })
|
|
4283
4280
|
] }),
|
|
4284
4281
|
a.fieldtype === "native-radio" && /* @__PURE__ */ l("div", { className: "native-radiogroup-container", children: [
|
|
4285
|
-
(a.options || []).map((
|
|
4282
|
+
(a.options || []).map((h) => /* @__PURE__ */ l("div", { className: "native-radio-option", children: [
|
|
4286
4283
|
/* @__PURE__ */ e(
|
|
4287
4284
|
"input",
|
|
4288
4285
|
{
|
|
4289
4286
|
type: "radio",
|
|
4290
|
-
id: `${a.key}-${
|
|
4287
|
+
id: `${a.key}-${h.value}`,
|
|
4291
4288
|
name: a.key,
|
|
4292
|
-
value:
|
|
4293
|
-
checked: i[a.key] ===
|
|
4289
|
+
value: h.value,
|
|
4290
|
+
checked: i[a.key] === h.value,
|
|
4294
4291
|
onChange: (g) => {
|
|
4295
4292
|
const $ = { ...i, [a.key]: g.target.value };
|
|
4296
4293
|
c($), s && s(n.key, $);
|
|
@@ -4298,11 +4295,11 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4298
4295
|
disabled: a.disabled
|
|
4299
4296
|
}
|
|
4300
4297
|
),
|
|
4301
|
-
/* @__PURE__ */ l("label", { htmlFor: `${a.key}-${
|
|
4302
|
-
/* @__PURE__ */ e("span", { className: "native-radio-label", children:
|
|
4303
|
-
|
|
4298
|
+
/* @__PURE__ */ l("label", { htmlFor: `${a.key}-${h.value}`, children: [
|
|
4299
|
+
/* @__PURE__ */ e("span", { className: "native-radio-label", children: h.label }),
|
|
4300
|
+
h.description && /* @__PURE__ */ e("span", { className: "native-radio-description", children: h.description })
|
|
4304
4301
|
] })
|
|
4305
|
-
] },
|
|
4302
|
+
] }, h.value)),
|
|
4306
4303
|
o[n.key]?.[a.key] && /* @__PURE__ */ e("div", { style: { color: "#ef4444", fontSize: "12px", marginTop: "2px" }, children: o[n.key][a.key] })
|
|
4307
4304
|
] }),
|
|
4308
4305
|
a.fieldtype === "search" && /* @__PURE__ */ l("div", { children: [
|
|
@@ -4310,8 +4307,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4310
4307
|
he,
|
|
4311
4308
|
{
|
|
4312
4309
|
value: i[a.key] || "",
|
|
4313
|
-
onChange: (
|
|
4314
|
-
const g = { ...i, [a.key]:
|
|
4310
|
+
onChange: (h) => {
|
|
4311
|
+
const g = { ...i, [a.key]: h };
|
|
4315
4312
|
c(g), s && s(n.key, g);
|
|
4316
4313
|
},
|
|
4317
4314
|
placeholder: a.placeholder || `Search ${a.label}`,
|
|
@@ -4322,15 +4319,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4322
4319
|
] }),
|
|
4323
4320
|
(a.fieldtype === "datetime" || a.fieldtype === "datetime-local") && /* @__PURE__ */ l("div", { children: [
|
|
4324
4321
|
/* @__PURE__ */ e(
|
|
4325
|
-
|
|
4322
|
+
Y,
|
|
4326
4323
|
{
|
|
4327
4324
|
type: "datetime-local",
|
|
4328
4325
|
name: a.key,
|
|
4329
4326
|
defaultValue: a.default,
|
|
4330
4327
|
placeholder: a.placeholder || "Select date and time",
|
|
4331
4328
|
value: i[a.key] || "",
|
|
4332
|
-
onChange: (
|
|
4333
|
-
const g = { ...i, [a.key]:
|
|
4329
|
+
onChange: (h) => {
|
|
4330
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4334
4331
|
c(g), s && s(n.key, g);
|
|
4335
4332
|
},
|
|
4336
4333
|
required: a.required,
|
|
@@ -4341,15 +4338,15 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4341
4338
|
] }),
|
|
4342
4339
|
a.fieldtype === "time" && /* @__PURE__ */ l("div", { children: [
|
|
4343
4340
|
/* @__PURE__ */ e(
|
|
4344
|
-
|
|
4341
|
+
Y,
|
|
4345
4342
|
{
|
|
4346
4343
|
type: "time",
|
|
4347
4344
|
name: a.key,
|
|
4348
4345
|
defaultValue: a.default,
|
|
4349
4346
|
placeholder: a.placeholder || "Select time",
|
|
4350
4347
|
value: i[a.key] || "",
|
|
4351
|
-
onChange: (
|
|
4352
|
-
const g = { ...i, [a.key]:
|
|
4348
|
+
onChange: (h) => {
|
|
4349
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4353
4350
|
c(g), s && s(n.key, g);
|
|
4354
4351
|
},
|
|
4355
4352
|
required: a.required,
|
|
@@ -4360,14 +4357,14 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4360
4357
|
] }),
|
|
4361
4358
|
a.fieldtype === "color" && /* @__PURE__ */ l("div", { children: [
|
|
4362
4359
|
/* @__PURE__ */ e(
|
|
4363
|
-
|
|
4360
|
+
Y,
|
|
4364
4361
|
{
|
|
4365
4362
|
type: "color",
|
|
4366
4363
|
name: a.key,
|
|
4367
4364
|
defaultValue: a.default || "#000000",
|
|
4368
4365
|
value: i[a.key] || "#000000",
|
|
4369
|
-
onChange: (
|
|
4370
|
-
const g = { ...i, [a.key]:
|
|
4366
|
+
onChange: (h) => {
|
|
4367
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4371
4368
|
c(g), s && s(n.key, g);
|
|
4372
4369
|
},
|
|
4373
4370
|
className: `w-full h-10 ${o[n.key]?.[a.key] ? "border-red-500" : ""}`
|
|
@@ -4377,14 +4374,14 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4377
4374
|
] }),
|
|
4378
4375
|
a.fieldtype === "range" && /* @__PURE__ */ l("div", { children: [
|
|
4379
4376
|
/* @__PURE__ */ e(
|
|
4380
|
-
|
|
4377
|
+
Y,
|
|
4381
4378
|
{
|
|
4382
4379
|
type: "range",
|
|
4383
4380
|
name: a.key,
|
|
4384
4381
|
defaultValue: a.default || a.min || 0,
|
|
4385
4382
|
value: i[a.key] || a.min || 0,
|
|
4386
|
-
onChange: (
|
|
4387
|
-
const g = { ...i, [a.key]:
|
|
4383
|
+
onChange: (h) => {
|
|
4384
|
+
const g = { ...i, [a.key]: h.target.value };
|
|
4388
4385
|
c(g), s && s(n.key, g);
|
|
4389
4386
|
},
|
|
4390
4387
|
min: a.min || 0,
|
|
@@ -4405,12 +4402,12 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4405
4402
|
] }),
|
|
4406
4403
|
a.fieldtype === "file" && /* @__PURE__ */ l("div", { children: [
|
|
4407
4404
|
/* @__PURE__ */ e(
|
|
4408
|
-
|
|
4405
|
+
Y,
|
|
4409
4406
|
{
|
|
4410
4407
|
type: "file",
|
|
4411
4408
|
name: a.key,
|
|
4412
|
-
onChange: (
|
|
4413
|
-
const g =
|
|
4409
|
+
onChange: (h) => {
|
|
4410
|
+
const g = h.target.files[0], $ = { ...i, [a.key]: g ? g.name : "" };
|
|
4414
4411
|
c($), s && s(n.key, $);
|
|
4415
4412
|
},
|
|
4416
4413
|
accept: a.accept,
|
|
@@ -4426,8 +4423,8 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4426
4423
|
endpoints: a.endpoints || {},
|
|
4427
4424
|
initialData: i[a.key] || a.initialData || [],
|
|
4428
4425
|
className: a.className || "",
|
|
4429
|
-
onCollectionChange: (
|
|
4430
|
-
const g = { ...i, [a.key]:
|
|
4426
|
+
onCollectionChange: (h) => {
|
|
4427
|
+
const g = { ...i, [a.key]: h };
|
|
4431
4428
|
c(g), s && s(n.key, g);
|
|
4432
4429
|
},
|
|
4433
4430
|
showSearch: a.showSearch !== !1,
|
|
@@ -4456,401 +4453,401 @@ function In({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4456
4453
|
const zn = ({ children: t }) => /* @__PURE__ */ e("div", { className: "flex -space-x-2", children: t });
|
|
4457
4454
|
function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
4458
4455
|
console.log(`[DynamicConfig/DataTableRenderer] Component loaded for section: ${t.key}`);
|
|
4459
|
-
const [n, u] = B(t), [i, c] = B(null), [y,
|
|
4456
|
+
const [n, u] = B(t), [i, c] = B(null), [y, v] = B(null);
|
|
4460
4457
|
console.log(`[DataTableRenderer] ${n.key} - Received props:`, { item: t, initialData: r });
|
|
4461
|
-
const [
|
|
4462
|
-
const
|
|
4458
|
+
const [x, a] = B(() => {
|
|
4459
|
+
const N = r && r[n.key] || [], p = N.length > 0 ? N : [{ id: 0 }];
|
|
4463
4460
|
return console.log(`[DataTableRenderer] ${n.key} - Initial data:`, p), p;
|
|
4464
4461
|
}), k = ue(r);
|
|
4465
|
-
|
|
4462
|
+
X(() => {
|
|
4466
4463
|
if (console.log(`[DataTableRenderer] ${n.key} - Checking for initialData changes`), console.log(`[DataTableRenderer] ${n.key} - Previous:`, k.current), console.log(`[DataTableRenderer] ${n.key} - Current:`, r), k.current !== r) {
|
|
4467
4464
|
k.current = r;
|
|
4468
|
-
const
|
|
4465
|
+
const N = r && r[n.key] || [], p = N.length > 0 ? N : [{ id: 0 }];
|
|
4469
4466
|
console.log(`[DataTableRenderer] ${n.key} - Setting new data:`, p), a(p);
|
|
4470
4467
|
}
|
|
4471
4468
|
}, [r, n.key]);
|
|
4472
|
-
const
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
s(n.key,
|
|
4469
|
+
const h = ue(x), g = ue(null);
|
|
4470
|
+
X(() => {
|
|
4471
|
+
h.current !== x && s && typeof s == "function" && (h.current = x, g.current && clearTimeout(g.current), g.current = setTimeout(() => {
|
|
4472
|
+
s(n.key, x);
|
|
4476
4473
|
}, 300));
|
|
4477
|
-
}, [n.key,
|
|
4474
|
+
}, [n.key, x, s]), X(() => () => {
|
|
4478
4475
|
g.current && clearTimeout(g.current);
|
|
4479
4476
|
}, []);
|
|
4480
|
-
const $ = (
|
|
4481
|
-
const p = (d,
|
|
4482
|
-
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value:
|
|
4483
|
-
const
|
|
4484
|
-
return
|
|
4477
|
+
const $ = (N) => {
|
|
4478
|
+
const p = (d, m) => {
|
|
4479
|
+
console.log("[DataTableRenderer] updateFieldValue called with:", { rowIndex: d, value: m, type: typeof m }), a((b) => {
|
|
4480
|
+
const D = [...b];
|
|
4481
|
+
return D[d][N.key] = m, D;
|
|
4485
4482
|
});
|
|
4486
|
-
}, f = (d) => o[n.key]?.[d]?.[
|
|
4487
|
-
const
|
|
4488
|
-
return
|
|
4483
|
+
}, f = (d) => o[n.key]?.[d]?.[N.key], w = (d) => {
|
|
4484
|
+
const m = f(d);
|
|
4485
|
+
return m ? /* @__PURE__ */ e("div", { className: "text-red-500 text-xs mt-1", children: m }) : null;
|
|
4489
4486
|
};
|
|
4490
|
-
switch (
|
|
4487
|
+
switch (N.fieldtype) {
|
|
4491
4488
|
case "text":
|
|
4492
|
-
return (d,
|
|
4489
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4493
4490
|
/* @__PURE__ */ e(
|
|
4494
|
-
|
|
4491
|
+
Y,
|
|
4495
4492
|
{
|
|
4496
|
-
value: d[
|
|
4497
|
-
onChange: (
|
|
4498
|
-
placeholder:
|
|
4499
|
-
required:
|
|
4500
|
-
className: `w-full ${f(
|
|
4493
|
+
value: d[N.key] || "",
|
|
4494
|
+
onChange: (b) => p(m, b.target.value),
|
|
4495
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4496
|
+
required: N.required,
|
|
4497
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4501
4498
|
}
|
|
4502
4499
|
),
|
|
4503
|
-
w(
|
|
4500
|
+
w(m)
|
|
4504
4501
|
] });
|
|
4505
4502
|
case "textarea":
|
|
4506
|
-
return (d,
|
|
4503
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4507
4504
|
/* @__PURE__ */ e(
|
|
4508
4505
|
ja,
|
|
4509
4506
|
{
|
|
4510
|
-
value: d[
|
|
4511
|
-
onChange: (
|
|
4512
|
-
placeholder:
|
|
4513
|
-
required:
|
|
4514
|
-
className: `w-full ${f(
|
|
4507
|
+
value: d[N.key] || "",
|
|
4508
|
+
onChange: (b) => p(m, b.target.value),
|
|
4509
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4510
|
+
required: N.required,
|
|
4511
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`,
|
|
4515
4512
|
rows: 3
|
|
4516
4513
|
}
|
|
4517
4514
|
),
|
|
4518
|
-
w(
|
|
4515
|
+
w(m)
|
|
4519
4516
|
] });
|
|
4520
4517
|
case "number":
|
|
4521
|
-
return (d,
|
|
4518
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4522
4519
|
/* @__PURE__ */ e(
|
|
4523
|
-
|
|
4520
|
+
Y,
|
|
4524
4521
|
{
|
|
4525
4522
|
type: "number",
|
|
4526
|
-
value: d[
|
|
4527
|
-
onChange: (
|
|
4528
|
-
placeholder:
|
|
4529
|
-
required:
|
|
4530
|
-
className: `w-full ${f(
|
|
4523
|
+
value: d[N.key] || "",
|
|
4524
|
+
onChange: (b) => p(m, b.target.value),
|
|
4525
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4526
|
+
required: N.required,
|
|
4527
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4531
4528
|
}
|
|
4532
4529
|
),
|
|
4533
|
-
w(
|
|
4530
|
+
w(m)
|
|
4534
4531
|
] });
|
|
4535
4532
|
case "email":
|
|
4536
|
-
return (d,
|
|
4533
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4537
4534
|
/* @__PURE__ */ e(
|
|
4538
|
-
|
|
4535
|
+
Y,
|
|
4539
4536
|
{
|
|
4540
4537
|
type: "email",
|
|
4541
|
-
value: d[
|
|
4542
|
-
onChange: (
|
|
4543
|
-
placeholder:
|
|
4544
|
-
required:
|
|
4545
|
-
className: `w-full ${f(
|
|
4538
|
+
value: d[N.key] || "",
|
|
4539
|
+
onChange: (b) => p(m, b.target.value),
|
|
4540
|
+
placeholder: N.placeholder || "Enter email address",
|
|
4541
|
+
required: N.required,
|
|
4542
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4546
4543
|
}
|
|
4547
4544
|
),
|
|
4548
|
-
w(
|
|
4545
|
+
w(m)
|
|
4549
4546
|
] });
|
|
4550
4547
|
case "url":
|
|
4551
|
-
return (d,
|
|
4548
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4552
4549
|
/* @__PURE__ */ e(
|
|
4553
|
-
|
|
4550
|
+
Y,
|
|
4554
4551
|
{
|
|
4555
4552
|
type: "url",
|
|
4556
|
-
value: d[
|
|
4557
|
-
onChange: (
|
|
4558
|
-
placeholder:
|
|
4559
|
-
required:
|
|
4560
|
-
className: `w-full ${f(
|
|
4553
|
+
value: d[N.key] || "",
|
|
4554
|
+
onChange: (b) => p(m, b.target.value),
|
|
4555
|
+
placeholder: N.placeholder || "Enter URL",
|
|
4556
|
+
required: N.required,
|
|
4557
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4561
4558
|
}
|
|
4562
4559
|
),
|
|
4563
|
-
w(
|
|
4560
|
+
w(m)
|
|
4564
4561
|
] });
|
|
4565
4562
|
case "password":
|
|
4566
|
-
return (d,
|
|
4563
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4567
4564
|
/* @__PURE__ */ e(
|
|
4568
|
-
|
|
4565
|
+
Y,
|
|
4569
4566
|
{
|
|
4570
4567
|
type: "password",
|
|
4571
|
-
value: d[
|
|
4572
|
-
onChange: (
|
|
4573
|
-
placeholder:
|
|
4574
|
-
required:
|
|
4575
|
-
className: `w-full ${f(
|
|
4568
|
+
value: d[N.key] || "",
|
|
4569
|
+
onChange: (b) => p(m, b.target.value),
|
|
4570
|
+
placeholder: N.placeholder || "Enter password",
|
|
4571
|
+
required: N.required,
|
|
4572
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4576
4573
|
}
|
|
4577
4574
|
),
|
|
4578
|
-
w(
|
|
4575
|
+
w(m)
|
|
4579
4576
|
] });
|
|
4580
4577
|
case "select":
|
|
4581
4578
|
case "dropdown":
|
|
4582
|
-
return (d,
|
|
4579
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4583
4580
|
/* @__PURE__ */ e(
|
|
4584
4581
|
ra,
|
|
4585
4582
|
{
|
|
4586
|
-
value: d[
|
|
4587
|
-
onChange: (
|
|
4588
|
-
options:
|
|
4589
|
-
placeholder:
|
|
4590
|
-
required:
|
|
4591
|
-
className: `w-full ${f(
|
|
4583
|
+
value: d[N.key] || "",
|
|
4584
|
+
onChange: (b) => p(m, b),
|
|
4585
|
+
options: N.options || [],
|
|
4586
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4587
|
+
required: N.required,
|
|
4588
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4592
4589
|
}
|
|
4593
4590
|
),
|
|
4594
|
-
w(
|
|
4591
|
+
w(m)
|
|
4595
4592
|
] });
|
|
4596
4593
|
case "selectDynamic":
|
|
4597
|
-
return (d,
|
|
4598
|
-
const
|
|
4599
|
-
if (
|
|
4600
|
-
const { config:
|
|
4601
|
-
if (Array.isArray(
|
|
4602
|
-
return
|
|
4603
|
-
id: A[
|
|
4604
|
-
value: A[
|
|
4605
|
-
label: A[
|
|
4594
|
+
return (d, m) => {
|
|
4595
|
+
const b = () => {
|
|
4596
|
+
if (N.optionsFrom && r) {
|
|
4597
|
+
const { config: D, valueField: R, labelField: j } = N.optionsFrom, S = r[D] || [];
|
|
4598
|
+
if (Array.isArray(S))
|
|
4599
|
+
return S.map((A) => ({
|
|
4600
|
+
id: A[R] || "",
|
|
4601
|
+
value: A[R] || "",
|
|
4602
|
+
label: A[j] || ""
|
|
4606
4603
|
}));
|
|
4607
4604
|
}
|
|
4608
|
-
return
|
|
4605
|
+
return N.options || [];
|
|
4609
4606
|
};
|
|
4610
4607
|
return /* @__PURE__ */ l("div", { children: [
|
|
4611
4608
|
/* @__PURE__ */ e(
|
|
4612
4609
|
ra,
|
|
4613
4610
|
{
|
|
4614
|
-
index:
|
|
4615
|
-
value: d[
|
|
4616
|
-
onChange: (
|
|
4617
|
-
options:
|
|
4618
|
-
placeholder:
|
|
4619
|
-
required:
|
|
4620
|
-
className: `w-full ${f(
|
|
4611
|
+
index: m,
|
|
4612
|
+
value: d[N.key] || "",
|
|
4613
|
+
onChange: (D) => p(m, D),
|
|
4614
|
+
options: b(),
|
|
4615
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4616
|
+
required: N.required,
|
|
4617
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4621
4618
|
},
|
|
4622
4619
|
Math.random()
|
|
4623
4620
|
),
|
|
4624
|
-
w(
|
|
4621
|
+
w(m)
|
|
4625
4622
|
] });
|
|
4626
4623
|
};
|
|
4627
4624
|
case "multiselect":
|
|
4628
|
-
return (d,
|
|
4629
|
-
const
|
|
4625
|
+
return (d, m) => {
|
|
4626
|
+
const b = d[N.key] || [];
|
|
4630
4627
|
return /* @__PURE__ */ e(
|
|
4631
4628
|
Ye,
|
|
4632
4629
|
{
|
|
4633
|
-
selectedItems:
|
|
4634
|
-
onSelectionChange: (
|
|
4635
|
-
options:
|
|
4636
|
-
placeholder:
|
|
4630
|
+
selectedItems: b,
|
|
4631
|
+
onSelectionChange: (D) => p(m, D),
|
|
4632
|
+
options: N.options || [],
|
|
4633
|
+
placeholder: N.placeholder || `Select ${N.label}`,
|
|
4637
4634
|
className: "w-full"
|
|
4638
4635
|
}
|
|
4639
4636
|
);
|
|
4640
4637
|
};
|
|
4641
4638
|
case "checkbox":
|
|
4642
4639
|
case "boolean":
|
|
4643
|
-
return (d,
|
|
4640
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4644
4641
|
Pa,
|
|
4645
4642
|
{
|
|
4646
|
-
checked: !!d[
|
|
4647
|
-
onChange: (
|
|
4648
|
-
label:
|
|
4643
|
+
checked: !!d[N.key],
|
|
4644
|
+
onChange: (b) => p(m, b),
|
|
4645
|
+
label: N.placeholder || N.label,
|
|
4649
4646
|
className: "w-full"
|
|
4650
4647
|
}
|
|
4651
4648
|
);
|
|
4652
4649
|
case "toggle":
|
|
4653
4650
|
case "switch":
|
|
4654
|
-
return (d,
|
|
4651
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4655
4652
|
Ga,
|
|
4656
4653
|
{
|
|
4657
|
-
isOn: !!d[
|
|
4658
|
-
onToggle: (
|
|
4659
|
-
label:
|
|
4654
|
+
isOn: !!d[N.key],
|
|
4655
|
+
onToggle: (b) => p(m, b),
|
|
4656
|
+
label: N.placeholder || N.label,
|
|
4660
4657
|
className: "w-full"
|
|
4661
4658
|
}
|
|
4662
4659
|
);
|
|
4663
4660
|
case "date":
|
|
4664
|
-
return (d,
|
|
4661
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4665
4662
|
Ma,
|
|
4666
4663
|
{
|
|
4667
|
-
selectedDate: d[
|
|
4668
|
-
onDateChange: (
|
|
4669
|
-
placeholder:
|
|
4664
|
+
selectedDate: d[N.key] ? new Date(d[N.key]) : null,
|
|
4665
|
+
onDateChange: (b) => p(m, b ? b.toISOString().split("T")[0] : ""),
|
|
4666
|
+
placeholder: N.placeholder || "Select date",
|
|
4670
4667
|
className: "w-full"
|
|
4671
4668
|
}
|
|
4672
4669
|
);
|
|
4673
4670
|
case "datetime":
|
|
4674
|
-
return (d,
|
|
4675
|
-
|
|
4671
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4672
|
+
Y,
|
|
4676
4673
|
{
|
|
4677
4674
|
type: "datetime-local",
|
|
4678
|
-
value: d[
|
|
4679
|
-
onChange: (
|
|
4680
|
-
placeholder:
|
|
4681
|
-
required:
|
|
4675
|
+
value: d[N.key] || "",
|
|
4676
|
+
onChange: (b) => p(m, b.target.value),
|
|
4677
|
+
placeholder: N.placeholder || "Select date and time",
|
|
4678
|
+
required: N.required,
|
|
4682
4679
|
className: "w-full"
|
|
4683
4680
|
}
|
|
4684
4681
|
);
|
|
4685
4682
|
case "time":
|
|
4686
|
-
return (d,
|
|
4687
|
-
|
|
4683
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4684
|
+
Y,
|
|
4688
4685
|
{
|
|
4689
4686
|
type: "time",
|
|
4690
|
-
value: d[
|
|
4691
|
-
onChange: (
|
|
4692
|
-
placeholder:
|
|
4693
|
-
required:
|
|
4687
|
+
value: d[N.key] || "",
|
|
4688
|
+
onChange: (b) => p(m, b.target.value),
|
|
4689
|
+
placeholder: N.placeholder || "Select time",
|
|
4690
|
+
required: N.required,
|
|
4694
4691
|
className: "w-full"
|
|
4695
4692
|
}
|
|
4696
4693
|
);
|
|
4697
4694
|
case "radio":
|
|
4698
|
-
return (d,
|
|
4695
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4699
4696
|
Ua,
|
|
4700
4697
|
{
|
|
4701
|
-
selectedValue: d[
|
|
4702
|
-
onValueChange: (
|
|
4703
|
-
options:
|
|
4698
|
+
selectedValue: d[N.key] || "",
|
|
4699
|
+
onValueChange: (b) => p(m, b),
|
|
4700
|
+
options: N.options || [],
|
|
4704
4701
|
className: "w-full"
|
|
4705
4702
|
}
|
|
4706
4703
|
);
|
|
4707
4704
|
case "search":
|
|
4708
|
-
return (d,
|
|
4705
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4709
4706
|
he,
|
|
4710
4707
|
{
|
|
4711
|
-
value: d[
|
|
4712
|
-
onChange: (
|
|
4713
|
-
placeholder:
|
|
4708
|
+
value: d[N.key] || "",
|
|
4709
|
+
onChange: (b) => p(m, b),
|
|
4710
|
+
placeholder: N.placeholder || `Search ${N.label}`,
|
|
4714
4711
|
className: "w-full"
|
|
4715
4712
|
}
|
|
4716
4713
|
);
|
|
4717
4714
|
case "audience":
|
|
4718
|
-
return (d,
|
|
4719
|
-
const
|
|
4720
|
-
...
|
|
4721
|
-
...
|
|
4722
|
-
...
|
|
4715
|
+
return (d, m) => {
|
|
4716
|
+
const b = d[N.key] || { users: [], groups: [], roles: [] }, D = [
|
|
4717
|
+
...b.users || [],
|
|
4718
|
+
...b.groups || [],
|
|
4719
|
+
...b.roles || []
|
|
4723
4720
|
];
|
|
4724
4721
|
return /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
4725
|
-
/* @__PURE__ */ e(zn, { children:
|
|
4722
|
+
/* @__PURE__ */ e(zn, { children: D.length > 0 ? D.slice(0, 3).map((R, j) => /* @__PURE__ */ e(
|
|
4726
4723
|
za,
|
|
4727
4724
|
{
|
|
4728
4725
|
size: "small",
|
|
4729
|
-
name:
|
|
4730
|
-
src:
|
|
4726
|
+
name: R.name || R.displayName || R.id,
|
|
4727
|
+
src: R.avatarUrl
|
|
4731
4728
|
},
|
|
4732
|
-
|
|
4729
|
+
j
|
|
4733
4730
|
)) : null }),
|
|
4734
4731
|
/* @__PURE__ */ e(
|
|
4735
4732
|
"button",
|
|
4736
4733
|
{
|
|
4737
4734
|
className: "text-blue-600 font-semibold hover:text-blue-800",
|
|
4738
4735
|
onClick: () => {
|
|
4739
|
-
|
|
4736
|
+
v(N.key), c(m);
|
|
4740
4737
|
},
|
|
4741
|
-
children:
|
|
4738
|
+
children: D.length > 0 ? "Edit" : "Assign"
|
|
4742
4739
|
}
|
|
4743
4740
|
)
|
|
4744
4741
|
] });
|
|
4745
4742
|
};
|
|
4746
4743
|
case "color":
|
|
4747
|
-
return (d,
|
|
4748
|
-
|
|
4744
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4745
|
+
Y,
|
|
4749
4746
|
{
|
|
4750
4747
|
type: "color",
|
|
4751
|
-
value: d[
|
|
4752
|
-
onChange: (
|
|
4748
|
+
value: d[N.key] || "#000000",
|
|
4749
|
+
onChange: (b) => p(m, b.target.value),
|
|
4753
4750
|
className: "w-full h-10"
|
|
4754
4751
|
}
|
|
4755
4752
|
);
|
|
4756
4753
|
case "range":
|
|
4757
|
-
return (d,
|
|
4754
|
+
return (d, m) => /* @__PURE__ */ l("div", { className: "w-full", children: [
|
|
4758
4755
|
/* @__PURE__ */ e(
|
|
4759
|
-
|
|
4756
|
+
Y,
|
|
4760
4757
|
{
|
|
4761
4758
|
type: "range",
|
|
4762
|
-
value: d[
|
|
4763
|
-
onChange: (
|
|
4764
|
-
min:
|
|
4765
|
-
max:
|
|
4766
|
-
step:
|
|
4759
|
+
value: d[N.key] || N.min || 0,
|
|
4760
|
+
onChange: (b) => p(m, b.target.value),
|
|
4761
|
+
min: N.min || 0,
|
|
4762
|
+
max: N.max || 100,
|
|
4763
|
+
step: N.step || 1,
|
|
4767
4764
|
className: "w-full"
|
|
4768
4765
|
}
|
|
4769
4766
|
),
|
|
4770
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: d[
|
|
4767
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-gray-500", children: d[N.key] || N.min || 0 })
|
|
4771
4768
|
] });
|
|
4772
4769
|
case "file":
|
|
4773
|
-
return (d,
|
|
4774
|
-
|
|
4770
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4771
|
+
Y,
|
|
4775
4772
|
{
|
|
4776
4773
|
type: "file",
|
|
4777
|
-
onChange: (
|
|
4778
|
-
const
|
|
4779
|
-
p(
|
|
4774
|
+
onChange: (b) => {
|
|
4775
|
+
const D = b.target.files[0];
|
|
4776
|
+
p(m, D ? D.name : "");
|
|
4780
4777
|
},
|
|
4781
|
-
accept:
|
|
4778
|
+
accept: N.accept,
|
|
4782
4779
|
className: "w-full"
|
|
4783
4780
|
}
|
|
4784
4781
|
);
|
|
4785
4782
|
case "hidden":
|
|
4786
|
-
return (d,
|
|
4787
|
-
|
|
4783
|
+
return (d, m) => /* @__PURE__ */ e(
|
|
4784
|
+
Y,
|
|
4788
4785
|
{
|
|
4789
4786
|
type: "hidden",
|
|
4790
|
-
value: d[
|
|
4791
|
-
onChange: (
|
|
4787
|
+
value: d[N.key] || "",
|
|
4788
|
+
onChange: (b) => p(m, b.target.value)
|
|
4792
4789
|
}
|
|
4793
4790
|
);
|
|
4794
4791
|
// Default fallback for unknown field types
|
|
4795
4792
|
default:
|
|
4796
|
-
return (d,
|
|
4793
|
+
return (d, m) => /* @__PURE__ */ l("div", { children: [
|
|
4797
4794
|
/* @__PURE__ */ e(
|
|
4798
|
-
|
|
4795
|
+
Y,
|
|
4799
4796
|
{
|
|
4800
|
-
value: d[
|
|
4801
|
-
onChange: (
|
|
4802
|
-
placeholder:
|
|
4803
|
-
required:
|
|
4804
|
-
className: `w-full ${f(
|
|
4797
|
+
value: d[N.key] || "",
|
|
4798
|
+
onChange: (b) => p(m, b.target.value),
|
|
4799
|
+
placeholder: N.placeholder || `Enter ${N.label}`,
|
|
4800
|
+
required: N.required,
|
|
4801
|
+
className: `w-full ${f(m) ? "border-red-500" : ""}`
|
|
4805
4802
|
}
|
|
4806
4803
|
),
|
|
4807
|
-
w(
|
|
4804
|
+
w(m)
|
|
4808
4805
|
] });
|
|
4809
4806
|
}
|
|
4810
4807
|
}, L = K(() => {
|
|
4811
|
-
console.log("[DataTableRenderer] Adding blank row"), a((
|
|
4812
|
-
console.log("[DataTableRenderer] Current data before add:",
|
|
4808
|
+
console.log("[DataTableRenderer] Adding blank row"), a((N) => {
|
|
4809
|
+
console.log("[DataTableRenderer] Current data before add:", N);
|
|
4813
4810
|
const p = {
|
|
4814
|
-
id:
|
|
4811
|
+
id: N.length
|
|
4815
4812
|
// Assign next available ID
|
|
4816
4813
|
};
|
|
4817
4814
|
n.fields.forEach((w) => {
|
|
4818
4815
|
w.fieldtype === "audience" ? p[w.key] = { users: [], groups: [], roles: [] } : p[w.key] = w.default || "";
|
|
4819
4816
|
}), console.log("[DataTableRenderer] New blank row:", p);
|
|
4820
|
-
const f = [...
|
|
4817
|
+
const f = [...N, p];
|
|
4821
4818
|
return console.log("[DataTableRenderer] Updated data:", f), f;
|
|
4822
4819
|
});
|
|
4823
|
-
}, [n.fields]),
|
|
4820
|
+
}, [n.fields]), O = K((N) => {
|
|
4824
4821
|
a((p) => {
|
|
4825
4822
|
if (p.length <= 1)
|
|
4826
4823
|
return p;
|
|
4827
4824
|
const f = [...p];
|
|
4828
|
-
return f.splice(
|
|
4825
|
+
return f.splice(N, 1), f;
|
|
4829
4826
|
});
|
|
4830
|
-
}, []), [C, T] = B(null),
|
|
4831
|
-
T(p),
|
|
4832
|
-
}, []),
|
|
4833
|
-
|
|
4834
|
-
}, []),
|
|
4835
|
-
|
|
4827
|
+
}, []), [C, T] = B(null), I = K((N, p) => {
|
|
4828
|
+
T(p), N.dataTransfer.effectAllowed = "move", N.dataTransfer.setData("text/html", "");
|
|
4829
|
+
}, []), E = K((N) => {
|
|
4830
|
+
N.preventDefault(), N.dataTransfer.dropEffect = "move";
|
|
4831
|
+
}, []), V = K((N, p) => {
|
|
4832
|
+
N.preventDefault(), !(C === null || C === p) && (a((f) => {
|
|
4836
4833
|
const w = [...f], d = w[C];
|
|
4837
4834
|
return w.splice(C, 1), w.splice(p, 0, d), w;
|
|
4838
4835
|
}), T(null));
|
|
4839
|
-
}, [C]),
|
|
4836
|
+
}, [C]), q = K(() => {
|
|
4840
4837
|
T(null);
|
|
4841
|
-
}, []),
|
|
4842
|
-
console.log("[DataTableRenderer] handleAddAudience called with:",
|
|
4838
|
+
}, []), G = K((N) => {
|
|
4839
|
+
console.log("[DataTableRenderer] handleAddAudience called with:", N), a((p) => {
|
|
4843
4840
|
const f = [...p];
|
|
4844
4841
|
if (i !== null && y && f[i]) {
|
|
4845
|
-
const w =
|
|
4842
|
+
const w = N.pendingInvites || [], d = w.filter((D) => D.type === "User"), m = w.filter((D) => D.type === "Group"), b = w.filter((D) => D.type === "Role");
|
|
4846
4843
|
f[i][y] = {
|
|
4847
4844
|
users: [...f[i][y]?.users || [], ...d],
|
|
4848
|
-
groups: [...f[i][y]?.groups || [], ...
|
|
4849
|
-
roles: [...f[i][y]?.roles || [], ...
|
|
4845
|
+
groups: [...f[i][y]?.groups || [], ...m],
|
|
4846
|
+
roles: [...f[i][y]?.roles || [], ...b]
|
|
4850
4847
|
}, console.log("[DataTableRenderer] Updated audience data:", f[i][y]);
|
|
4851
4848
|
}
|
|
4852
4849
|
return f;
|
|
4853
|
-
}), c(null),
|
|
4850
|
+
}), c(null), v(null);
|
|
4854
4851
|
}, [i, y]);
|
|
4855
4852
|
return /* @__PURE__ */ l("div", { children: [
|
|
4856
4853
|
/* @__PURE__ */ l("div", { style: { marginBottom: "20px" }, children: [
|
|
@@ -4870,32 +4867,32 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4870
4867
|
/* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ l("table", { className: "min-w-full bg-white border border-gray-300", style: { marginBottom: "20px" }, children: [
|
|
4871
4868
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "bg-gray-50", children: [
|
|
4872
4869
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-10" }),
|
|
4873
|
-
n.fields.map((
|
|
4870
|
+
n.fields.map((N, p) => /* @__PURE__ */ e(
|
|
4874
4871
|
"th",
|
|
4875
4872
|
{
|
|
4876
4873
|
className: "px-4 py-2 text-left text-sm font-medium text-gray-700",
|
|
4877
|
-
children:
|
|
4874
|
+
children: N.label || N.key
|
|
4878
4875
|
},
|
|
4879
4876
|
p
|
|
4880
4877
|
)),
|
|
4881
4878
|
/* @__PURE__ */ e("th", { className: "px-4 py-2 w-16" })
|
|
4882
4879
|
] }) }),
|
|
4883
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4880
|
+
/* @__PURE__ */ e("tbody", { children: x.map((N, p) => /* @__PURE__ */ l(
|
|
4884
4881
|
"tr",
|
|
4885
4882
|
{
|
|
4886
4883
|
className: `hover:bg-gray-50 ${C === p ? "opacity-50" : ""}`,
|
|
4887
4884
|
draggable: !0,
|
|
4888
|
-
onDragStart: (f) =>
|
|
4889
|
-
onDragOver:
|
|
4890
|
-
onDrop: (f) =>
|
|
4891
|
-
onDragEnd:
|
|
4885
|
+
onDragStart: (f) => I(f, p),
|
|
4886
|
+
onDragOver: E,
|
|
4887
|
+
onDrop: (f) => V(f, p),
|
|
4888
|
+
onDragEnd: q,
|
|
4892
4889
|
children: [
|
|
4893
4890
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e("div", { className: "cursor-move text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ e(sa, { size: 16 }) }) }),
|
|
4894
|
-
n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(
|
|
4891
|
+
n.fields.map((f, w) => /* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: $(f)(N, p) }, w)),
|
|
4895
4892
|
/* @__PURE__ */ e("td", { className: "px-4 py-2 ", children: /* @__PURE__ */ e(
|
|
4896
4893
|
"button",
|
|
4897
4894
|
{
|
|
4898
|
-
onClick: () =>
|
|
4895
|
+
onClick: () => O(p),
|
|
4899
4896
|
className: "text-red-500 hover:text-red-700",
|
|
4900
4897
|
title: "Delete row",
|
|
4901
4898
|
children: /* @__PURE__ */ e(Jt, { size: 16 })
|
|
@@ -4907,20 +4904,20 @@ function Pn({ item: t, data: r, updateHandler: s, validationErrors: o = {} }) {
|
|
|
4907
4904
|
)) })
|
|
4908
4905
|
] }) }),
|
|
4909
4906
|
i !== null && (() => {
|
|
4910
|
-
const
|
|
4911
|
-
users:
|
|
4912
|
-
groups:
|
|
4913
|
-
roles:
|
|
4907
|
+
const N = x[i] && x[i][y] ? {
|
|
4908
|
+
users: x[i][y].users || [],
|
|
4909
|
+
groups: x[i][y].groups || [],
|
|
4910
|
+
roles: x[i][y].roles || []
|
|
4914
4911
|
} : { users: [], groups: [], roles: [] };
|
|
4915
|
-
return console.log("[DataTableRenderer] Opening modal with existing data:",
|
|
4912
|
+
return console.log("[DataTableRenderer] Opening modal with existing data:", N), console.log("[DataTableRenderer] Row data:", x[i]), console.log("[DataTableRenderer] Field name:", y), /* @__PURE__ */ e(
|
|
4916
4913
|
kn,
|
|
4917
4914
|
{
|
|
4918
4915
|
isOpen: !0,
|
|
4919
4916
|
onClose: () => {
|
|
4920
|
-
c(null),
|
|
4917
|
+
c(null), v(null);
|
|
4921
4918
|
},
|
|
4922
|
-
onFinalSubmit:
|
|
4923
|
-
existingShares:
|
|
4919
|
+
onFinalSubmit: G,
|
|
4920
|
+
existingShares: N,
|
|
4924
4921
|
allowedPermissions: ["view", "remove"]
|
|
4925
4922
|
}
|
|
4926
4923
|
);
|
|
@@ -4994,114 +4991,114 @@ const fa = () => {
|
|
|
4994
4991
|
initialData: y = null
|
|
4995
4992
|
// Add prop for initial demo data
|
|
4996
4993
|
}) => {
|
|
4997
|
-
const [
|
|
4994
|
+
const [v, x] = B(null), [a, k] = B(""), [h, g] = B(() => Array.isArray(y) ? y : []), [$, L] = B(null), [O, C] = B(null), [T, I] = B(""), E = async () => {
|
|
4998
4995
|
try {
|
|
4999
|
-
const
|
|
5000
|
-
if (
|
|
5001
|
-
const A =
|
|
5002
|
-
...
|
|
5003
|
-
order: typeof
|
|
4996
|
+
const S = await Ee(t.collectionList);
|
|
4997
|
+
if (S) {
|
|
4998
|
+
const A = S.map((M, F) => ({
|
|
4999
|
+
...M,
|
|
5000
|
+
order: typeof M.order == "number" ? M.order : F + 1
|
|
5004
5001
|
}));
|
|
5005
|
-
A.sort((
|
|
5002
|
+
A.sort((M, F) => (M.order ?? 0) - (F.order ?? 0)), g(A), s?.(A);
|
|
5006
5003
|
}
|
|
5007
|
-
} catch (
|
|
5008
|
-
console.log("Error loading collections:",
|
|
5004
|
+
} catch (S) {
|
|
5005
|
+
console.log("Error loading collections:", S), typeof window < "u" && !window.location.pathname.includes("iframe.html") && le.error("Failed to load collections");
|
|
5009
5006
|
}
|
|
5010
5007
|
};
|
|
5011
|
-
|
|
5012
|
-
(!y || y.length === 0) &&
|
|
5013
|
-
}, [y]),
|
|
5008
|
+
X(() => {
|
|
5009
|
+
(!y || y.length === 0) && E();
|
|
5010
|
+
}, [y]), X(() => {
|
|
5014
5011
|
Array.isArray(y) && g(y);
|
|
5015
5012
|
}, [y]);
|
|
5016
|
-
const
|
|
5017
|
-
u && (
|
|
5018
|
-
},
|
|
5019
|
-
if (!n ||
|
|
5020
|
-
const
|
|
5013
|
+
const V = (S) => {
|
|
5014
|
+
u && (x(S.id), k(S.categoryName || ""));
|
|
5015
|
+
}, q = () => {
|
|
5016
|
+
if (!n || v !== null) return;
|
|
5017
|
+
const S = `temp-${Date.now()}`;
|
|
5021
5018
|
g((A) => [
|
|
5022
5019
|
...A,
|
|
5023
5020
|
{
|
|
5024
|
-
id:
|
|
5021
|
+
id: S,
|
|
5025
5022
|
categoryName: "",
|
|
5026
5023
|
links: [],
|
|
5027
5024
|
order: (A.at(-1)?.order ?? 0) + 1,
|
|
5028
5025
|
_temp: !0
|
|
5029
5026
|
}
|
|
5030
|
-
]),
|
|
5031
|
-
},
|
|
5032
|
-
|
|
5033
|
-
const A =
|
|
5034
|
-
return s?.(
|
|
5035
|
-
}),
|
|
5036
|
-
},
|
|
5037
|
-
if (
|
|
5038
|
-
const
|
|
5027
|
+
]), x(S), k("");
|
|
5028
|
+
}, G = () => {
|
|
5029
|
+
v != null && (g((S) => {
|
|
5030
|
+
const A = S.find((F) => F.id === v), M = A && A._temp ? S.filter((F) => F.id !== v) : S;
|
|
5031
|
+
return s?.(M), M;
|
|
5032
|
+
}), x(null), k(""));
|
|
5033
|
+
}, N = async () => {
|
|
5034
|
+
if (v == null || !a.trim()) return;
|
|
5035
|
+
const S = typeof v == "string" && v.startsWith("temp-");
|
|
5039
5036
|
try {
|
|
5040
|
-
if (
|
|
5037
|
+
if (S) {
|
|
5041
5038
|
const A = await Re(t.collectionCreate, {
|
|
5042
5039
|
categoryName: a.trim(),
|
|
5043
|
-
order: (Array.isArray(
|
|
5040
|
+
order: (Array.isArray(h) && h.length > 0 ? h.at(-1)?.order ?? 0 : 0) + 1
|
|
5044
5041
|
});
|
|
5045
|
-
A && (g((
|
|
5046
|
-
const
|
|
5047
|
-
return s?.(
|
|
5042
|
+
A && (g((M) => {
|
|
5043
|
+
const F = M.map((z) => z.id === v ? A : z);
|
|
5044
|
+
return s?.(F), F;
|
|
5048
5045
|
}), ke.success("Collection created successfully"));
|
|
5049
5046
|
} else {
|
|
5050
5047
|
const A = await mn(
|
|
5051
|
-
`${t.collectionUpdate}/${
|
|
5048
|
+
`${t.collectionUpdate}/${v}?newName=${a.trim()}`
|
|
5052
5049
|
);
|
|
5053
|
-
g((
|
|
5054
|
-
const
|
|
5055
|
-
(
|
|
5050
|
+
g((M) => {
|
|
5051
|
+
const F = M.map(
|
|
5052
|
+
(z) => z.id === v ? A && A.id ? { ...z, ...A } : { ...z, categoryName: a.trim() } : z
|
|
5056
5053
|
);
|
|
5057
|
-
return s?.(
|
|
5054
|
+
return s?.(F), F;
|
|
5058
5055
|
}), le.success("Collection updated successfully");
|
|
5059
5056
|
}
|
|
5060
|
-
|
|
5057
|
+
x(null), k("");
|
|
5061
5058
|
} catch (A) {
|
|
5062
5059
|
console.log(A), le.error("Failed to save collection");
|
|
5063
5060
|
}
|
|
5064
|
-
}, p = async (
|
|
5061
|
+
}, p = async (S) => {
|
|
5065
5062
|
if (i)
|
|
5066
5063
|
try {
|
|
5067
|
-
await un(`${t.collectionUpdate}/${
|
|
5064
|
+
await un(`${t.collectionUpdate}/${S.id}`) && (le.success("Deleted successfully", { autoClose: 3e3 }), E());
|
|
5068
5065
|
} catch (A) {
|
|
5069
5066
|
console.log(A), le.error("Failed to delete collection");
|
|
5070
5067
|
}
|
|
5071
|
-
}, f = (
|
|
5072
|
-
if (!c || !A || !
|
|
5073
|
-
const
|
|
5074
|
-
if (
|
|
5075
|
-
const
|
|
5076
|
-
return
|
|
5077
|
-
}, w = async (
|
|
5078
|
-
const A =
|
|
5079
|
-
id:
|
|
5080
|
-
order:
|
|
5081
|
-
categoryName:
|
|
5068
|
+
}, f = (S, A, M) => {
|
|
5069
|
+
if (!c || !A || !M || A === M) return S;
|
|
5070
|
+
const F = S.findIndex((ie) => ie.id === A), z = S.findIndex((ie) => ie.id === M);
|
|
5071
|
+
if (F === -1 || z === -1) return S;
|
|
5072
|
+
const U = [...S], [Ne] = U.splice(F, 1);
|
|
5073
|
+
return U.splice(z, 0, Ne), U.map((ie, xe) => ({ ...ie, order: xe + 1 }));
|
|
5074
|
+
}, w = async (S) => {
|
|
5075
|
+
const A = S.map((M) => ({
|
|
5076
|
+
id: M.id,
|
|
5077
|
+
order: M.order,
|
|
5078
|
+
categoryName: M.categoryName
|
|
5082
5079
|
}));
|
|
5083
5080
|
try {
|
|
5084
5081
|
await Re(t.updateCollection, A);
|
|
5085
|
-
} catch (
|
|
5086
|
-
console.log(
|
|
5082
|
+
} catch (M) {
|
|
5083
|
+
console.log(M), le.error("Failed to save order", { autoClose: 2500 });
|
|
5087
5084
|
}
|
|
5088
|
-
}, d = (
|
|
5089
|
-
c && (
|
|
5090
|
-
},
|
|
5091
|
-
$ &&
|
|
5092
|
-
},
|
|
5093
|
-
|
|
5094
|
-
},
|
|
5095
|
-
|
|
5096
|
-
const
|
|
5097
|
-
|
|
5098
|
-
const
|
|
5099
|
-
return console.log("Reordered",
|
|
5085
|
+
}, d = (S, A) => {
|
|
5086
|
+
c && (S.dataTransfer.effectAllowed = "move", S.dataTransfer.setData("text/plain", String(A)), L(A));
|
|
5087
|
+
}, m = (S) => {
|
|
5088
|
+
$ && S !== O && C(S);
|
|
5089
|
+
}, b = (S) => {
|
|
5090
|
+
S.preventDefault();
|
|
5091
|
+
}, D = async (S, A) => {
|
|
5092
|
+
S.preventDefault();
|
|
5093
|
+
const M = S.dataTransfer.getData("text/plain");
|
|
5094
|
+
M && (g((F) => {
|
|
5095
|
+
const z = f(F, M, A);
|
|
5096
|
+
return console.log("Reordered", z), w(z), s?.(z), z;
|
|
5100
5097
|
}), L(null), C(null));
|
|
5101
|
-
},
|
|
5098
|
+
}, R = () => {
|
|
5102
5099
|
L(null), C(null);
|
|
5103
|
-
},
|
|
5104
|
-
(
|
|
5100
|
+
}, j = Array.isArray(h) ? h.filter(
|
|
5101
|
+
(S) => S.categoryName?.toLowerCase().includes(T.toLowerCase())
|
|
5105
5102
|
) : [];
|
|
5106
5103
|
return /* @__PURE__ */ l("div", { className: `manage-collection-list ${r}`, children: [
|
|
5107
5104
|
/* @__PURE__ */ e("div", { className: "flex justify-end", children: /* @__PURE__ */ l("div", { className: "w-1/2 flex justify-end", children: [
|
|
@@ -5109,7 +5106,7 @@ const fa = () => {
|
|
|
5109
5106
|
he,
|
|
5110
5107
|
{
|
|
5111
5108
|
value: T,
|
|
5112
|
-
onDebouncedChange:
|
|
5109
|
+
onDebouncedChange: I,
|
|
5113
5110
|
placeholder: "Search Collection",
|
|
5114
5111
|
customClass: "mr-4 searchmanagecollection"
|
|
5115
5112
|
}
|
|
@@ -5119,28 +5116,28 @@ const fa = () => {
|
|
|
5119
5116
|
{
|
|
5120
5117
|
className: [
|
|
5121
5118
|
"px-4 py-3 bg-black text-white rounded-2xl ml-4",
|
|
5122
|
-
|
|
5119
|
+
v !== null ? "opacity-60 cursor-not-allowed" : "cursor-pointer"
|
|
5123
5120
|
].join(" "),
|
|
5124
|
-
onClick:
|
|
5125
|
-
disabled:
|
|
5121
|
+
onClick: q,
|
|
5122
|
+
disabled: v !== null,
|
|
5126
5123
|
children: "Add a Collection"
|
|
5127
5124
|
}
|
|
5128
5125
|
)
|
|
5129
5126
|
] }) }),
|
|
5130
|
-
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children:
|
|
5131
|
-
const A =
|
|
5127
|
+
/* @__PURE__ */ e("div", { className: "mt-5 flex flex-col", children: j.map((S) => {
|
|
5128
|
+
const A = v === S.id, M = S?.links?.length ?? 0, F = $ === S.id, z = O === S.id && $ !== S.id;
|
|
5132
5129
|
return /* @__PURE__ */ e(
|
|
5133
5130
|
"div",
|
|
5134
5131
|
{
|
|
5135
|
-
onDragEnter: () =>
|
|
5136
|
-
onDragOver:
|
|
5137
|
-
onDrop: (
|
|
5138
|
-
onDragEnd:
|
|
5132
|
+
onDragEnter: () => m(S.id),
|
|
5133
|
+
onDragOver: b,
|
|
5134
|
+
onDrop: (U) => D(U, S.id),
|
|
5135
|
+
onDragEnd: R,
|
|
5139
5136
|
className: [
|
|
5140
5137
|
"flex items-center justify-between p-3 border rounded-2xl mb-3",
|
|
5141
5138
|
"border-gray-300",
|
|
5142
|
-
|
|
5143
|
-
|
|
5139
|
+
z ? "ring-2 ring-gray-800/20" : "",
|
|
5140
|
+
F ? "opacity-60" : ""
|
|
5144
5141
|
].join(" "),
|
|
5145
5142
|
children: A ? /* @__PURE__ */ l(ee, { children: [
|
|
5146
5143
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 flex-1", children: /* @__PURE__ */ e(
|
|
@@ -5149,10 +5146,10 @@ const fa = () => {
|
|
|
5149
5146
|
type: "text",
|
|
5150
5147
|
className: "flex-1 h-10 px-3 max-w-[200px] border border-gray-300 rounded-2xl outline-none focus:ring-2 focus:ring-gray-800/20",
|
|
5151
5148
|
value: a,
|
|
5152
|
-
placeholder:
|
|
5153
|
-
onChange: (
|
|
5154
|
-
onKeyDown: (
|
|
5155
|
-
|
|
5149
|
+
placeholder: S._temp ? "New collection name" : "Edit collection name",
|
|
5150
|
+
onChange: (U) => k(U.target.value),
|
|
5151
|
+
onKeyDown: (U) => {
|
|
5152
|
+
U.key === "Enter" && N(), U.key === "Escape" && G();
|
|
5156
5153
|
},
|
|
5157
5154
|
autoFocus: !0
|
|
5158
5155
|
}
|
|
@@ -5162,7 +5159,7 @@ const fa = () => {
|
|
|
5162
5159
|
"button",
|
|
5163
5160
|
{
|
|
5164
5161
|
className: "cursor-pointer border border-gray-300 p-2 rounded-2xl",
|
|
5165
|
-
onClick:
|
|
5162
|
+
onClick: G,
|
|
5166
5163
|
"aria-label": "Cancel edit",
|
|
5167
5164
|
children: /* @__PURE__ */ e(ye, { color: "#767676" })
|
|
5168
5165
|
}
|
|
@@ -5174,7 +5171,7 @@ const fa = () => {
|
|
|
5174
5171
|
"border p-2 rounded-2xl",
|
|
5175
5172
|
a.trim() ? "cursor-pointer border-gray-300" : "cursor-not-allowed border-gray-200"
|
|
5176
5173
|
].join(" "),
|
|
5177
|
-
onClick:
|
|
5174
|
+
onClick: N,
|
|
5178
5175
|
"aria-label": "Save",
|
|
5179
5176
|
disabled: !a.trim(),
|
|
5180
5177
|
title: a.trim() ? "Save" : "Name required",
|
|
@@ -5191,36 +5188,36 @@ const fa = () => {
|
|
|
5191
5188
|
"aria-label": "Drag to reorder",
|
|
5192
5189
|
className: "cursor-grab active:cursor-grabbing p-1 -m-1 rounded-md hover:bg-gray-50",
|
|
5193
5190
|
draggable: !0,
|
|
5194
|
-
onDragStart: (
|
|
5191
|
+
onDragStart: (U) => d(U, S.id),
|
|
5195
5192
|
children: /* @__PURE__ */ e(sa, {})
|
|
5196
5193
|
}
|
|
5197
5194
|
),
|
|
5198
|
-
/* @__PURE__ */ e("span", { children:
|
|
5195
|
+
/* @__PURE__ */ e("span", { children: S.categoryName })
|
|
5199
5196
|
] }),
|
|
5200
5197
|
/* @__PURE__ */ l("div", { className: "flex gap-2 items-center", children: [
|
|
5201
|
-
|
|
5198
|
+
S.protected ? /* @__PURE__ */ e("span", { className: "text-sm text-gray-600 cursor-default", children: S.qlAppName }) : /* @__PURE__ */ e("span", { className: "text-sm text-blue-600 cursor-default", children: `${M} ${M === 1 ? "link" : "links"}` }),
|
|
5202
5199
|
u && /* @__PURE__ */ e(
|
|
5203
5200
|
"button",
|
|
5204
5201
|
{
|
|
5205
5202
|
className: "cursor-pointer",
|
|
5206
|
-
onClick: () =>
|
|
5207
|
-
"aria-label": `Edit ${
|
|
5203
|
+
onClick: () => V(S),
|
|
5204
|
+
"aria-label": `Edit ${S.categoryName}`,
|
|
5208
5205
|
children: /* @__PURE__ */ e(Qt, { color: "#767676" })
|
|
5209
5206
|
}
|
|
5210
5207
|
),
|
|
5211
5208
|
i && /* @__PURE__ */ e(
|
|
5212
5209
|
"span",
|
|
5213
5210
|
{
|
|
5214
|
-
className:
|
|
5215
|
-
title:
|
|
5216
|
-
onClick:
|
|
5217
|
-
children: /* @__PURE__ */ e(Ve, { color:
|
|
5211
|
+
className: M === 0 && !S.protected ? "cursor-pointer" : "cursor-not-allowed",
|
|
5212
|
+
title: M === 0 && !S.protected ? "Delete" : "Cannot delete this collection",
|
|
5213
|
+
onClick: M === 0 ? () => p(S) : null,
|
|
5214
|
+
children: /* @__PURE__ */ e(Ve, { color: M === 0 ? "#767676" : "#C2C2C2" })
|
|
5218
5215
|
}
|
|
5219
5216
|
)
|
|
5220
5217
|
] })
|
|
5221
5218
|
] })
|
|
5222
5219
|
},
|
|
5223
|
-
|
|
5220
|
+
S.id
|
|
5224
5221
|
);
|
|
5225
5222
|
}) })
|
|
5226
5223
|
] });
|
|
@@ -5232,11 +5229,11 @@ const fa = () => {
|
|
|
5232
5229
|
initialData: i = null,
|
|
5233
5230
|
showSearch: c = !0,
|
|
5234
5231
|
allowAdd: y = !0,
|
|
5235
|
-
allowEdit:
|
|
5236
|
-
allowDelete:
|
|
5232
|
+
allowEdit: v = !0,
|
|
5233
|
+
allowDelete: x = !0,
|
|
5237
5234
|
allowReorder: a = !0,
|
|
5238
5235
|
className: k = ""
|
|
5239
|
-
} = t,
|
|
5236
|
+
} = t, h = r?.[t.key] || i || [], g = Array.isArray(h) ? h : [];
|
|
5240
5237
|
return /* @__PURE__ */ l("div", { className: "dynamic-config-manage-collection-list", children: [
|
|
5241
5238
|
(o || n) && /* @__PURE__ */ l("div", { className: "mb-4", children: [
|
|
5242
5239
|
o && /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 mb-1", children: o }),
|
|
@@ -5253,8 +5250,8 @@ const fa = () => {
|
|
|
5253
5250
|
},
|
|
5254
5251
|
showSearch: c,
|
|
5255
5252
|
allowAdd: y,
|
|
5256
|
-
allowEdit:
|
|
5257
|
-
allowDelete:
|
|
5253
|
+
allowEdit: v,
|
|
5254
|
+
allowDelete: x,
|
|
5258
5255
|
allowReorder: a
|
|
5259
5256
|
}
|
|
5260
5257
|
)
|
|
@@ -5282,122 +5279,122 @@ function Un({
|
|
|
5282
5279
|
onCancel: o,
|
|
5283
5280
|
onSave: n
|
|
5284
5281
|
}) {
|
|
5285
|
-
const [u, i] = ae.useState(r), [c, y] = ae.useState(null), [
|
|
5282
|
+
const [u, i] = ae.useState(r), [c, y] = ae.useState(null), [v, x] = B(!1), [a, k] = B(!1), [h, g] = B({}), $ = `${ve()}/unifyedxappmodulemanagement/api/v1/appmanager/${t}/configuration`, L = $, [O, C] = B(1), T = (f) => {
|
|
5286
5283
|
if (!r || !r.configuration)
|
|
5287
5284
|
return f;
|
|
5288
5285
|
const w = {}, d = f?.configuration || {};
|
|
5289
|
-
return r.configuration.forEach((
|
|
5290
|
-
if (
|
|
5291
|
-
const
|
|
5292
|
-
const
|
|
5293
|
-
return
|
|
5286
|
+
return r.configuration.forEach((m) => {
|
|
5287
|
+
if (m.key && m.type === "datatable") {
|
|
5288
|
+
const D = (d[m.key] || []).map((R, j) => {
|
|
5289
|
+
const S = { id: R.id || 0 };
|
|
5290
|
+
return m.fields && m.fields.forEach((A) => {
|
|
5294
5291
|
if (A.fieldtype === "audience") {
|
|
5295
|
-
let
|
|
5296
|
-
|
|
5297
|
-
users:
|
|
5298
|
-
groups:
|
|
5299
|
-
roles:
|
|
5300
|
-
})),
|
|
5292
|
+
let M = { users: [], groups: [], roles: [] };
|
|
5293
|
+
R[A.key] && (Array.isArray(R[A.key]) ? M = { users: [], groups: [], roles: [] } : typeof R[A.key] == "object" && (M = {
|
|
5294
|
+
users: R[A.key].users || [],
|
|
5295
|
+
groups: R[A.key].groups || [],
|
|
5296
|
+
roles: R[A.key].roles || []
|
|
5297
|
+
})), S[A.key] = M;
|
|
5301
5298
|
} else
|
|
5302
|
-
|
|
5303
|
-
}),
|
|
5299
|
+
S[A.key] = R[A.key] || A.default || "";
|
|
5300
|
+
}), S;
|
|
5304
5301
|
});
|
|
5305
|
-
if (
|
|
5306
|
-
const
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
}),
|
|
5302
|
+
if (D.length === 0) {
|
|
5303
|
+
const R = { id: 0 };
|
|
5304
|
+
m.fields && m.fields.forEach((j) => {
|
|
5305
|
+
j.fieldtype === "audience" ? R[j.key] = { users: [], groups: [], roles: [] } : R[j.key] = j.default || "";
|
|
5306
|
+
}), D.push(R);
|
|
5310
5307
|
}
|
|
5311
|
-
w[
|
|
5312
|
-
} else
|
|
5308
|
+
w[m.key] = D;
|
|
5309
|
+
} else m.key && (w[m.key] = d[m.key] || {});
|
|
5313
5310
|
}), w;
|
|
5314
|
-
},
|
|
5311
|
+
}, I = () => {
|
|
5315
5312
|
if (r && r.configuration) {
|
|
5316
5313
|
const f = {};
|
|
5317
5314
|
r.configuration.forEach((w) => {
|
|
5318
5315
|
if (w.key)
|
|
5319
5316
|
if (w.type === "datatable") {
|
|
5320
5317
|
const d = { id: 0 };
|
|
5321
|
-
w.fields && w.fields.forEach((
|
|
5322
|
-
|
|
5318
|
+
w.fields && w.fields.forEach((m) => {
|
|
5319
|
+
m.fieldtype === "audience" ? d[m.key] = { users: [], groups: [], roles: [] } : d[m.key] = m.default || "";
|
|
5323
5320
|
}), f[w.key] = [d];
|
|
5324
5321
|
} else if (w.type === "section") {
|
|
5325
5322
|
const d = {};
|
|
5326
|
-
w.fields && Array.isArray(w.fields) && w.fields.forEach((
|
|
5327
|
-
|
|
5323
|
+
w.fields && Array.isArray(w.fields) && w.fields.forEach((m) => {
|
|
5324
|
+
m.key && (d[m.key] = m.default || "");
|
|
5328
5325
|
}), f[w.key] = d;
|
|
5329
5326
|
} else
|
|
5330
5327
|
f[w.key] = {};
|
|
5331
5328
|
}), y(f);
|
|
5332
5329
|
}
|
|
5333
5330
|
};
|
|
5334
|
-
|
|
5331
|
+
X(() => {
|
|
5335
5332
|
if (s) {
|
|
5336
|
-
|
|
5333
|
+
x(!1);
|
|
5337
5334
|
return;
|
|
5338
5335
|
}
|
|
5339
5336
|
const f = async () => {
|
|
5340
5337
|
try {
|
|
5341
|
-
|
|
5338
|
+
x(!0);
|
|
5342
5339
|
let w = await Ee($);
|
|
5343
5340
|
if (w) {
|
|
5344
5341
|
const d = T(w);
|
|
5345
5342
|
y(d);
|
|
5346
5343
|
} else
|
|
5347
|
-
|
|
5344
|
+
I();
|
|
5348
5345
|
} catch (w) {
|
|
5349
5346
|
console.error("Error fetching configuration:", w);
|
|
5350
5347
|
let d = "Failed to load configuration";
|
|
5351
5348
|
if (w.response) {
|
|
5352
|
-
const
|
|
5353
|
-
|
|
5349
|
+
const m = w.response.status, b = w.response.data?.message || w.response.data?.error;
|
|
5350
|
+
m === 400 ? d = b || "Invalid request. Please check the application ID." : m === 401 ? d = "You are not authorized to access this configuration." : m === 403 ? d = "Access denied. You don't have permission to view this configuration." : m === 404 ? d = "Configuration not found. It may not exist yet or the application ID is incorrect." : m >= 500 ? d = b || "Server error. Please try again later." : d = b || `Failed to load configuration (Error ${m})`;
|
|
5354
5351
|
} else w.request ? d = "Network error. Please check your connection and try again." : d = w.message || "An unexpected error occurred while loading configuration.";
|
|
5355
|
-
ke.error(d),
|
|
5352
|
+
ke.error(d), I();
|
|
5356
5353
|
} finally {
|
|
5357
|
-
|
|
5354
|
+
x(!1);
|
|
5358
5355
|
}
|
|
5359
5356
|
};
|
|
5360
|
-
r && (i(r), t ? f() :
|
|
5361
|
-
}, [r,
|
|
5362
|
-
const
|
|
5357
|
+
r && (i(r), t ? f() : I());
|
|
5358
|
+
}, [r, O, t, s]);
|
|
5359
|
+
const E = (f, w) => {
|
|
5363
5360
|
y((d) => ({
|
|
5364
5361
|
...d,
|
|
5365
5362
|
[f]: w
|
|
5366
5363
|
})), g((d) => {
|
|
5367
|
-
const
|
|
5368
|
-
return
|
|
5364
|
+
const m = { ...d };
|
|
5365
|
+
return m[f] && delete m[f], m;
|
|
5369
5366
|
});
|
|
5370
|
-
},
|
|
5367
|
+
}, V = () => {
|
|
5371
5368
|
const f = {};
|
|
5372
5369
|
return !u || !c || u.configuration.forEach((w) => {
|
|
5373
5370
|
if (w.type === "section")
|
|
5374
5371
|
w.fields.forEach((d) => {
|
|
5375
5372
|
if (d.required) {
|
|
5376
|
-
const
|
|
5377
|
-
(!
|
|
5373
|
+
const m = c[w.key]?.[d.key];
|
|
5374
|
+
(!m || typeof m == "string" && m.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][d.key] = `${d.label} is required`);
|
|
5378
5375
|
}
|
|
5379
5376
|
});
|
|
5380
5377
|
else if (w.type === "datatable") {
|
|
5381
5378
|
const d = c[w.key];
|
|
5382
|
-
Array.isArray(d) && d.forEach((
|
|
5383
|
-
w.fields.forEach((
|
|
5384
|
-
if (
|
|
5385
|
-
const
|
|
5386
|
-
(!
|
|
5379
|
+
Array.isArray(d) && d.forEach((m, b) => {
|
|
5380
|
+
w.fields.forEach((D) => {
|
|
5381
|
+
if (D.required) {
|
|
5382
|
+
const R = m[D.key];
|
|
5383
|
+
(!R || typeof R == "string" && R.trim() === "") && (f[w.key] || (f[w.key] = {}), f[w.key][b] || (f[w.key][b] = {}), f[w.key][b][D.key] = `${D.label} is required`);
|
|
5387
5384
|
}
|
|
5388
5385
|
});
|
|
5389
5386
|
});
|
|
5390
5387
|
}
|
|
5391
5388
|
}), f;
|
|
5392
|
-
},
|
|
5393
|
-
const f =
|
|
5394
|
-
if (g(f),
|
|
5389
|
+
}, q = (f) => Object.keys(f).length > 0, G = () => {
|
|
5390
|
+
const f = V();
|
|
5391
|
+
if (g(f), q(f)) {
|
|
5395
5392
|
let d = [];
|
|
5396
|
-
Object.keys(f).forEach((
|
|
5397
|
-
typeof f[
|
|
5398
|
-
typeof f[
|
|
5399
|
-
d.push(`${
|
|
5400
|
-
}) : d.push(`${
|
|
5393
|
+
Object.keys(f).forEach((m) => {
|
|
5394
|
+
typeof f[m] == "object" && Object.keys(f[m]).forEach((b) => {
|
|
5395
|
+
typeof f[m][b] == "object" ? Object.keys(f[m][b]).forEach((D) => {
|
|
5396
|
+
d.push(`${m} row ${parseInt(b) + 1}: ${f[m][b][D]}`);
|
|
5397
|
+
}) : d.push(`${m}: ${f[m][b]}`);
|
|
5401
5398
|
});
|
|
5402
5399
|
});
|
|
5403
5400
|
return;
|
|
@@ -5406,52 +5403,52 @@ function Un({
|
|
|
5406
5403
|
try {
|
|
5407
5404
|
k(!0);
|
|
5408
5405
|
const d = {};
|
|
5409
|
-
c && Object.keys(c).forEach((
|
|
5410
|
-
const
|
|
5411
|
-
(
|
|
5406
|
+
c && Object.keys(c).forEach((b) => {
|
|
5407
|
+
const D = r?.configuration?.find(
|
|
5408
|
+
(R) => R.key === b && R.type === "datatable"
|
|
5412
5409
|
);
|
|
5413
|
-
|
|
5414
|
-
const
|
|
5415
|
-
return
|
|
5416
|
-
if (
|
|
5410
|
+
D && Array.isArray(c[b]) ? d[b] = c[b].map((R) => {
|
|
5411
|
+
const j = { id: R.id || 0 };
|
|
5412
|
+
return D.fields && D.fields.forEach((S) => {
|
|
5413
|
+
if (S.fieldtype === "audience") {
|
|
5417
5414
|
let A = { users: [], groups: [], roles: [] };
|
|
5418
|
-
|
|
5419
|
-
users:
|
|
5420
|
-
groups:
|
|
5421
|
-
roles:
|
|
5422
|
-
}),
|
|
5415
|
+
R[S.key] && typeof R[S.key] == "object" && !Array.isArray(R[S.key]) && (A = {
|
|
5416
|
+
users: R[S.key].users || [],
|
|
5417
|
+
groups: R[S.key].groups || [],
|
|
5418
|
+
roles: R[S.key].roles || []
|
|
5419
|
+
}), j[S.key] = A;
|
|
5423
5420
|
} else
|
|
5424
|
-
|
|
5425
|
-
}),
|
|
5426
|
-
}) : d[
|
|
5421
|
+
j[S.key] = R[S.key] || "";
|
|
5422
|
+
}), j;
|
|
5423
|
+
}) : d[b] = c[b];
|
|
5427
5424
|
});
|
|
5428
|
-
let
|
|
5429
|
-
if (console.log(),
|
|
5425
|
+
let m = await Re(L, d);
|
|
5426
|
+
if (console.log(), m && m.status != "fail") {
|
|
5430
5427
|
g({});
|
|
5431
|
-
const
|
|
5432
|
-
ke.success(
|
|
5428
|
+
const b = m.message || "Configuration has been saved successfully";
|
|
5429
|
+
ke.success(b), n && typeof n == "function" && n(c);
|
|
5433
5430
|
} else
|
|
5434
|
-
throw ke.error(
|
|
5431
|
+
throw ke.error(m?.message || "Failed to save configuration"), new Error("No response received from server");
|
|
5435
5432
|
} catch (d) {
|
|
5436
5433
|
console.error("Error saving configuration:", d), ke.error(d?.message || "Failed to save configuration");
|
|
5437
5434
|
} finally {
|
|
5438
5435
|
k(!1);
|
|
5439
5436
|
}
|
|
5440
5437
|
})();
|
|
5441
|
-
},
|
|
5438
|
+
}, N = () => {
|
|
5442
5439
|
if (o) {
|
|
5443
5440
|
o();
|
|
5444
5441
|
return;
|
|
5445
5442
|
}
|
|
5446
|
-
|
|
5443
|
+
h && Object.keys(h).length > 0 && !window.confirm(
|
|
5447
5444
|
"You have validation errors that will be lost. Are you sure you want to cancel?"
|
|
5448
5445
|
) || (g({}), y(null), C((w) => w + 1), ke.info("Configuration changes cancelled"));
|
|
5449
5446
|
};
|
|
5450
5447
|
if (!u?.configuration && !r?.configuration)
|
|
5451
5448
|
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" }) });
|
|
5452
5449
|
const p = r?.configuration || u?.configuration;
|
|
5453
|
-
return
|
|
5454
|
-
s && r ? (!c || Object.keys(c).length === 0) &&
|
|
5450
|
+
return X(() => {
|
|
5451
|
+
s && r ? (!c || Object.keys(c).length === 0) && I() : s && !r && I();
|
|
5455
5452
|
}, [s, r]), /* @__PURE__ */ l("div", { children: [
|
|
5456
5453
|
/* @__PURE__ */ l(
|
|
5457
5454
|
"div",
|
|
@@ -5459,8 +5456,8 @@ function Un({
|
|
|
5459
5456
|
className: "dynamic-config bg-white w-full h-[calc(100vh-350px)] overflow-y-auto",
|
|
5460
5457
|
style: { padding: "0px 20px 0px 0px" },
|
|
5461
5458
|
children: [
|
|
5462
|
-
|
|
5463
|
-
!
|
|
5459
|
+
v && /* @__PURE__ */ e("div", { className: "flex justify-center items-center h-64", children: /* @__PURE__ */ e(qa, { size: "large" }) }),
|
|
5460
|
+
!v && p?.map((f, w) => {
|
|
5464
5461
|
const d = Mn(f.type);
|
|
5465
5462
|
if (d && d !== "UnknownType")
|
|
5466
5463
|
return /* @__PURE__ */ e(
|
|
@@ -5468,8 +5465,8 @@ function Un({
|
|
|
5468
5465
|
{
|
|
5469
5466
|
item: f,
|
|
5470
5467
|
data: c,
|
|
5471
|
-
updateHandler:
|
|
5472
|
-
validationErrors:
|
|
5468
|
+
updateHandler: E,
|
|
5469
|
+
validationErrors: h
|
|
5473
5470
|
},
|
|
5474
5471
|
w
|
|
5475
5472
|
);
|
|
@@ -5479,19 +5476,19 @@ function Un({
|
|
|
5479
5476
|
),
|
|
5480
5477
|
/* @__PURE__ */ l("div", { className: "w-full gap-5 bg-white flex justify-end py-3 px-7 rounded-t-md rounded-b-2xl border border-gray-300", style: { boxShadow: "0 -2px 10px 0 rgba(0, 0, 0, 0.20)", marginTop: "20px" }, children: [
|
|
5481
5478
|
/* @__PURE__ */ e(
|
|
5482
|
-
|
|
5479
|
+
H,
|
|
5483
5480
|
{
|
|
5484
5481
|
category: "secondary",
|
|
5485
|
-
onClick:
|
|
5482
|
+
onClick: N,
|
|
5486
5483
|
label: "Cancel",
|
|
5487
5484
|
disabled: a
|
|
5488
5485
|
}
|
|
5489
5486
|
),
|
|
5490
5487
|
/* @__PURE__ */ e(
|
|
5491
|
-
|
|
5488
|
+
H,
|
|
5492
5489
|
{
|
|
5493
5490
|
category: "primary",
|
|
5494
|
-
onClick:
|
|
5491
|
+
onClick: G,
|
|
5495
5492
|
disabled: a,
|
|
5496
5493
|
label: a ? "Saving..." : "Apply",
|
|
5497
5494
|
type: "submit"
|
|
@@ -5506,12 +5503,12 @@ const ys = ({
|
|
|
5506
5503
|
disableApi: s = !1
|
|
5507
5504
|
}) => {
|
|
5508
5505
|
const [o, n] = B(0), [u, i] = B(!1), [c, y] = B(r), {
|
|
5509
|
-
pageHeader:
|
|
5510
|
-
appletHeader:
|
|
5506
|
+
pageHeader: v = {},
|
|
5507
|
+
appletHeader: x = {},
|
|
5511
5508
|
breadcrumb: a = [],
|
|
5512
5509
|
overview: k = {},
|
|
5513
|
-
configuration:
|
|
5514
|
-
} = t, g =
|
|
5510
|
+
configuration: h = []
|
|
5511
|
+
} = t, g = h.map((p) => {
|
|
5515
5512
|
if (p.type === "section" && p.fields) {
|
|
5516
5513
|
const f = [...p.fields], w = f.findIndex((d) => d.key === "appkey");
|
|
5517
5514
|
if (w !== -1) {
|
|
@@ -5522,15 +5519,15 @@ const ys = ({
|
|
|
5522
5519
|
value: r,
|
|
5523
5520
|
disabled: !0,
|
|
5524
5521
|
placeholder: r
|
|
5525
|
-
}, f.some((
|
|
5526
|
-
const
|
|
5527
|
-
f[
|
|
5528
|
-
...f[
|
|
5522
|
+
}, f.some((b) => b.key === "displayname")) {
|
|
5523
|
+
const b = f.findIndex((D) => D.key === "displayname");
|
|
5524
|
+
f[b] = {
|
|
5525
|
+
...f[b],
|
|
5529
5526
|
default: r,
|
|
5530
5527
|
value: r
|
|
5531
5528
|
};
|
|
5532
5529
|
} else {
|
|
5533
|
-
const
|
|
5530
|
+
const b = {
|
|
5534
5531
|
key: "displayname",
|
|
5535
5532
|
label: "Display Name",
|
|
5536
5533
|
fieldtype: "text",
|
|
@@ -5539,7 +5536,7 @@ const ys = ({
|
|
|
5539
5536
|
placeholder: "Enter display name",
|
|
5540
5537
|
required: !1
|
|
5541
5538
|
};
|
|
5542
|
-
f.splice(w + 1, 0,
|
|
5539
|
+
f.splice(w + 1, 0, b);
|
|
5543
5540
|
}
|
|
5544
5541
|
}
|
|
5545
5542
|
return {
|
|
@@ -5553,11 +5550,11 @@ const ys = ({
|
|
|
5553
5550
|
subHeading: "View app details and customize configurations to align with institutional requirements.",
|
|
5554
5551
|
isLeftArrow: !0,
|
|
5555
5552
|
onBackClick: () => window.history.back(),
|
|
5556
|
-
...
|
|
5553
|
+
...v
|
|
5557
5554
|
}, L = a.map((p) => ({
|
|
5558
5555
|
label: p.text,
|
|
5559
5556
|
href: p.href || "#"
|
|
5560
|
-
})),
|
|
5557
|
+
})), O = K(() => {
|
|
5561
5558
|
console.log("handleCancelRequest called - showing modal"), i(!0);
|
|
5562
5559
|
}, []), C = K((p) => {
|
|
5563
5560
|
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");
|
|
@@ -5573,18 +5570,18 @@ const ys = ({
|
|
|
5573
5570
|
ae.useEffect(() => {
|
|
5574
5571
|
y(T());
|
|
5575
5572
|
}, [g]);
|
|
5576
|
-
const
|
|
5573
|
+
const I = K((p) => {
|
|
5577
5574
|
console.log("Config saved with data:", p), Object.keys(p).forEach((f) => {
|
|
5578
5575
|
const w = p[f];
|
|
5579
5576
|
console.log(`Checking section ${f}:`, w), w && w.displayname && (console.log("Found displayname:", w.displayname), y(w.displayname));
|
|
5580
5577
|
});
|
|
5581
|
-
}, []),
|
|
5578
|
+
}, []), E = {
|
|
5582
5579
|
subHeading: "Application configuration and details",
|
|
5583
5580
|
tags: [],
|
|
5584
|
-
...
|
|
5581
|
+
...x,
|
|
5585
5582
|
heading: c
|
|
5586
5583
|
// Ensure displayname always overrides config heading
|
|
5587
|
-
},
|
|
5584
|
+
}, V = {
|
|
5588
5585
|
about: "This application provides comprehensive functionality for your organization.",
|
|
5589
5586
|
images: {
|
|
5590
5587
|
desktop: "https://via.placeholder.com/600x400?text=Desktop+View",
|
|
@@ -5602,14 +5599,14 @@ const ys = ({
|
|
|
5602
5599
|
}
|
|
5603
5600
|
],
|
|
5604
5601
|
...k
|
|
5605
|
-
},
|
|
5606
|
-
{ label: "Overview", content:
|
|
5607
|
-
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel:
|
|
5602
|
+
}, q = [
|
|
5603
|
+
{ label: "Overview", content: N(V) },
|
|
5604
|
+
{ label: "Configuration", content: /* @__PURE__ */ e(Un, { appid: r, configdata: { configuration: g }, disableApi: s, onCancel: O, onSave: I }) }
|
|
5608
5605
|
];
|
|
5609
|
-
function
|
|
5606
|
+
function G(p) {
|
|
5610
5607
|
return p ? p.includes("<svg") ? /* @__PURE__ */ e("div", { dangerouslySetInnerHTML: { __html: p } }) : p : "📱";
|
|
5611
5608
|
}
|
|
5612
|
-
function
|
|
5609
|
+
function N(p) {
|
|
5613
5610
|
return /* @__PURE__ */ l("div", { className: "bg-white rounded-2xl p-1", children: [
|
|
5614
5611
|
/* @__PURE__ */ l("section", { className: "mb-8", children: [
|
|
5615
5612
|
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold mb-2", children: "About" }),
|
|
@@ -5663,11 +5660,11 @@ const ys = ({
|
|
|
5663
5660
|
}
|
|
5664
5661
|
),
|
|
5665
5662
|
/* @__PURE__ */ l("div", { className: "bg-[#ffffff] border border-[#eef2f6] rounded-[12px] px-6 py-5 flex gap-4 items-start mb-4 shadow-sm", children: [
|
|
5666
|
-
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children:
|
|
5663
|
+
/* @__PURE__ */ e("div", { className: "icon w-[72px] h-[72px] rounded-full flex items-center justify-center bg-[#F5F5F6] text-[#1C274C] font-bold text-[18px]", children: G(E.icon) }),
|
|
5667
5664
|
/* @__PURE__ */ l("div", { className: "flex flex-col min-w-0", children: [
|
|
5668
|
-
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children:
|
|
5669
|
-
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children:
|
|
5670
|
-
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children:
|
|
5665
|
+
/* @__PURE__ */ e("h2", { className: "text-[24px] font-semibold m-0 leading-tight truncate", children: E.heading }),
|
|
5666
|
+
/* @__PURE__ */ e("p", { className: "text-[13px] text-[#101112] mt-1 mb-0 max-w-[800px] leading-normal", children: E.subHeading }),
|
|
5667
|
+
/* @__PURE__ */ e("div", { className: "mt-2 flex flex-wrap gap-2", children: E.tags && E.tags.map((p, f) => /* @__PURE__ */ e(
|
|
5671
5668
|
"span",
|
|
5672
5669
|
{
|
|
5673
5670
|
className: "pill inline-block px-[10px] py-[6px] rounded-[14px] text-[11px] border border-[#e6e9ee] text-[#767676] font-semibold mt-1",
|
|
@@ -5678,7 +5675,7 @@ const ys = ({
|
|
|
5678
5675
|
] })
|
|
5679
5676
|
] }),
|
|
5680
5677
|
/* @__PURE__ */ l("div", { className: "bg-white border border-gray-300 rounded-2xl w-full mt-5 ", children: [
|
|
5681
|
-
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children:
|
|
5678
|
+
/* @__PURE__ */ e("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ e("nav", { className: "flex space-x-8", "aria-label": "Tabs", children: q.map((p, f) => /* @__PURE__ */ e(
|
|
5682
5679
|
"button",
|
|
5683
5680
|
{
|
|
5684
5681
|
onClick: () => n(f),
|
|
@@ -5687,7 +5684,7 @@ const ys = ({
|
|
|
5687
5684
|
},
|
|
5688
5685
|
f
|
|
5689
5686
|
)) }) }),
|
|
5690
|
-
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children:
|
|
5687
|
+
/* @__PURE__ */ e("div", { className: "p-8 h-full overflow-y-auto", children: q[o].content })
|
|
5691
5688
|
] }),
|
|
5692
5689
|
/* @__PURE__ */ e(
|
|
5693
5690
|
Zr,
|
|
@@ -5742,66 +5739,66 @@ const bs = ({
|
|
|
5742
5739
|
addBtnText: c = "Add",
|
|
5743
5740
|
// Feature toggles
|
|
5744
5741
|
showSearch: y = !0,
|
|
5745
|
-
showColumnChooser:
|
|
5746
|
-
showFilter:
|
|
5742
|
+
showColumnChooser: v = !0,
|
|
5743
|
+
showFilter: x = !1,
|
|
5747
5744
|
showPrint: a = !1,
|
|
5748
5745
|
showExcel: k = !1,
|
|
5749
|
-
showPdf:
|
|
5746
|
+
showPdf: h = !1,
|
|
5750
5747
|
showRefresh: g = !1,
|
|
5751
5748
|
showAdd: $ = !1,
|
|
5752
5749
|
// Additional props
|
|
5753
5750
|
searchPlaceholder: L = "Search...",
|
|
5754
|
-
handleRefreshClick:
|
|
5751
|
+
handleRefreshClick: O = () => {
|
|
5755
5752
|
},
|
|
5756
5753
|
handleSearchChange: C = () => {
|
|
5757
5754
|
},
|
|
5758
5755
|
// Optional: override export file names
|
|
5759
5756
|
excelFileName: T,
|
|
5760
|
-
pdfFileName:
|
|
5757
|
+
pdfFileName: I
|
|
5761
5758
|
}) => {
|
|
5762
|
-
const
|
|
5763
|
-
(
|
|
5764
|
-
const
|
|
5765
|
-
if (console.log("openColumnChooserNear",
|
|
5766
|
-
if (typeof window > "u" || !
|
|
5767
|
-
|
|
5759
|
+
const E = () => n?.current || o?.current, [V, q] = ae.useState(""), G = (t || "export").toString().trim() || "export", N = `${T || G}.xlsx`, p = `${I || G}.pdf`, f = (m, b, D) => Math.max(b, Math.min(m, D)), w = K(
|
|
5760
|
+
(m) => {
|
|
5761
|
+
const b = E();
|
|
5762
|
+
if (console.log("openColumnChooserNear", b), !!b?.openColumnChooser) {
|
|
5763
|
+
if (typeof window > "u" || !m?.currentTarget) {
|
|
5764
|
+
b.openColumnChooser();
|
|
5768
5765
|
return;
|
|
5769
5766
|
}
|
|
5770
5767
|
try {
|
|
5771
|
-
const
|
|
5772
|
-
let
|
|
5773
|
-
const
|
|
5774
|
-
|
|
5775
|
-
} catch (
|
|
5776
|
-
console.log("coloumn choose error",
|
|
5768
|
+
const D = m.currentTarget.getBoundingClientRect(), R = D.left + window.scrollX, j = D.bottom + window.scrollY;
|
|
5769
|
+
let S = R - 120, A = j - 120;
|
|
5770
|
+
const M = window.innerWidth, F = window.innerHeight;
|
|
5771
|
+
S = f(S, window.scrollX + 8, window.scrollX + M - 340), A = f(A, window.scrollY, window.scrollY + F - 120), console.log("openColumnChooserNear", S, A), b.openColumnChooser(S, A);
|
|
5772
|
+
} catch (D) {
|
|
5773
|
+
console.log("coloumn choose error", D);
|
|
5777
5774
|
}
|
|
5778
5775
|
}
|
|
5779
5776
|
},
|
|
5780
5777
|
[]
|
|
5781
5778
|
// no external deps; reads ref at call time
|
|
5782
5779
|
), d = K(
|
|
5783
|
-
(
|
|
5784
|
-
const
|
|
5785
|
-
if (
|
|
5786
|
-
switch (
|
|
5780
|
+
(m, b) => {
|
|
5781
|
+
const D = E();
|
|
5782
|
+
if (D)
|
|
5783
|
+
switch (m) {
|
|
5787
5784
|
case "ColumnChooser":
|
|
5788
|
-
|
|
5785
|
+
v && (console.log("openColumnChooser", b), b ? w(b) : D.openColumnChooser?.()), console.log("openColumnChooser out", b);
|
|
5789
5786
|
break;
|
|
5790
5787
|
case "Print":
|
|
5791
|
-
a &&
|
|
5788
|
+
a && D.print?.();
|
|
5792
5789
|
break;
|
|
5793
5790
|
case "Excel":
|
|
5794
|
-
k &&
|
|
5791
|
+
k && D.excelExport?.({ fileName: N });
|
|
5795
5792
|
break;
|
|
5796
5793
|
case "Pdf":
|
|
5797
|
-
|
|
5794
|
+
h && D.pdfExport?.({ fileName: p });
|
|
5798
5795
|
break;
|
|
5799
5796
|
case "Refresh":
|
|
5800
|
-
g &&
|
|
5797
|
+
g && O();
|
|
5801
5798
|
break;
|
|
5802
5799
|
}
|
|
5803
5800
|
},
|
|
5804
|
-
[
|
|
5801
|
+
[v, a, k, h, g, N, p, O, w]
|
|
5805
5802
|
);
|
|
5806
5803
|
return /* @__PURE__ */ l("div", { className: "flex items-center flex-wrap justify-between w-full px-4 py-2 bg-white border border-gray-200 rounded-t-2xl mb-0", children: [
|
|
5807
5804
|
/* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
@@ -5817,27 +5814,27 @@ const bs = ({
|
|
|
5817
5814
|
he,
|
|
5818
5815
|
{
|
|
5819
5816
|
placeholder: L,
|
|
5820
|
-
value:
|
|
5821
|
-
onDebouncedChange: (
|
|
5822
|
-
|
|
5817
|
+
value: V,
|
|
5818
|
+
onDebouncedChange: (m) => {
|
|
5819
|
+
q(m), C(m);
|
|
5823
5820
|
}
|
|
5824
5821
|
}
|
|
5825
5822
|
) }),
|
|
5826
5823
|
/* @__PURE__ */ l("div", { className: "flex gap-3", children: [
|
|
5827
5824
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
|
|
5828
|
-
|
|
5829
|
-
|
|
5825
|
+
v && /* @__PURE__ */ e(
|
|
5826
|
+
H,
|
|
5830
5827
|
{
|
|
5831
5828
|
icon: Xt,
|
|
5832
|
-
onClick: (
|
|
5829
|
+
onClick: (m) => d("ColumnChooser", m),
|
|
5833
5830
|
size: "small",
|
|
5834
5831
|
ariaLabel: "Column Chooser",
|
|
5835
5832
|
category: "secondary",
|
|
5836
5833
|
title: "Choose Columns"
|
|
5837
5834
|
}
|
|
5838
5835
|
),
|
|
5839
|
-
|
|
5840
|
-
|
|
5836
|
+
x && /* @__PURE__ */ e(
|
|
5837
|
+
H,
|
|
5841
5838
|
{
|
|
5842
5839
|
icon: Zt,
|
|
5843
5840
|
onClick: i,
|
|
@@ -5848,7 +5845,7 @@ const bs = ({
|
|
|
5848
5845
|
}
|
|
5849
5846
|
),
|
|
5850
5847
|
a && /* @__PURE__ */ e(
|
|
5851
|
-
|
|
5848
|
+
H,
|
|
5852
5849
|
{
|
|
5853
5850
|
icon: Ht,
|
|
5854
5851
|
onClick: () => d("Print"),
|
|
@@ -5859,18 +5856,18 @@ const bs = ({
|
|
|
5859
5856
|
}
|
|
5860
5857
|
),
|
|
5861
5858
|
k && /* @__PURE__ */ e(
|
|
5862
|
-
|
|
5859
|
+
H,
|
|
5863
5860
|
{
|
|
5864
5861
|
icon: Kt,
|
|
5865
5862
|
onClick: () => d("Excel"),
|
|
5866
5863
|
ariaLabel: "Excel Download",
|
|
5867
5864
|
size: "small",
|
|
5868
5865
|
category: "secondary",
|
|
5869
|
-
title: `Export Excel (${
|
|
5866
|
+
title: `Export Excel (${N})`
|
|
5870
5867
|
}
|
|
5871
5868
|
),
|
|
5872
|
-
|
|
5873
|
-
|
|
5869
|
+
h && /* @__PURE__ */ e(
|
|
5870
|
+
H,
|
|
5874
5871
|
{
|
|
5875
5872
|
icon: er,
|
|
5876
5873
|
onClick: () => d("Pdf"),
|
|
@@ -5881,7 +5878,7 @@ const bs = ({
|
|
|
5881
5878
|
}
|
|
5882
5879
|
),
|
|
5883
5880
|
g && /* @__PURE__ */ e(
|
|
5884
|
-
|
|
5881
|
+
H,
|
|
5885
5882
|
{
|
|
5886
5883
|
icon: ar,
|
|
5887
5884
|
onClick: () => d("Refresh"),
|
|
@@ -5893,7 +5890,7 @@ const bs = ({
|
|
|
5893
5890
|
)
|
|
5894
5891
|
] }),
|
|
5895
5892
|
$ && u && /* @__PURE__ */ e(
|
|
5896
|
-
|
|
5893
|
+
H,
|
|
5897
5894
|
{
|
|
5898
5895
|
label: c,
|
|
5899
5896
|
icon: tr,
|
|
@@ -5919,71 +5916,71 @@ function vs(t) {
|
|
|
5919
5916
|
allowSorting: i = !0,
|
|
5920
5917
|
allowFiltering: c = !1,
|
|
5921
5918
|
allowGrouping: y = !1,
|
|
5922
|
-
allowReordering:
|
|
5923
|
-
allowResizing:
|
|
5919
|
+
allowReordering: v = !0,
|
|
5920
|
+
allowResizing: x = !0,
|
|
5924
5921
|
allowExcelExport: a = !1,
|
|
5925
5922
|
allowPdfExport: k = !1,
|
|
5926
|
-
showColumnChooser:
|
|
5923
|
+
showColumnChooser: h = !1,
|
|
5927
5924
|
enableSearchApi: g = !1,
|
|
5928
5925
|
height: $ = "600",
|
|
5929
5926
|
selectionSettings: L = { type: "Multiple", mode: "Row" },
|
|
5930
|
-
enableCheckbox:
|
|
5927
|
+
enableCheckbox: O = !1,
|
|
5931
5928
|
columns: C = [],
|
|
5932
5929
|
onGridStateChange: T,
|
|
5933
|
-
onRowSelected:
|
|
5934
|
-
onRowDeselected:
|
|
5935
|
-
onRowDoubleClick:
|
|
5936
|
-
apiRef:
|
|
5937
|
-
gridProps:
|
|
5938
|
-
} = t,
|
|
5930
|
+
onRowSelected: I,
|
|
5931
|
+
onRowDeselected: E,
|
|
5932
|
+
onRowDoubleClick: V,
|
|
5933
|
+
apiRef: q,
|
|
5934
|
+
gridProps: G = {}
|
|
5935
|
+
} = t, N = ue(null), {
|
|
5939
5936
|
pageSettings: p,
|
|
5940
5937
|
sortSettings: f,
|
|
5941
5938
|
...w
|
|
5942
|
-
} =
|
|
5943
|
-
const P = [
|
|
5944
|
-
return i && P.push(
|
|
5945
|
-
}, [i, c, y, g, a, k,
|
|
5946
|
-
const P = () =>
|
|
5947
|
-
!pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${
|
|
5939
|
+
} = G || {}, [d, m] = ae.useState(p?.page || 1), [b, D] = ae.useState(f?.pageSize || 20), [R, j] = ae.useState(f?.sortKey || "updatedDate"), [S, A] = ae.useState(f?.direction || "Descending"), M = ce(() => {
|
|
5940
|
+
const P = [Fr];
|
|
5941
|
+
return i && P.push($r), c && P.push(Tr), y && P.push(Ar), g && P.push(Er), a && P.push(Rr), k && P.push(Ir), h && P.push(zr), x && P.push(Pr), v && P.push(Br), P.push(Lr), P;
|
|
5942
|
+
}, [i, c, y, g, a, k, h, x, v]), F = ce(() => {
|
|
5943
|
+
const P = () => N.current, te = (W, pe) => {
|
|
5944
|
+
!pe && process.env.NODE_ENV !== "production" && console.warn(`[CustomDataGrid] ${W} requested but related service/feature is disabled.`);
|
|
5948
5945
|
};
|
|
5949
5946
|
return {
|
|
5950
5947
|
getInstance: () => P(),
|
|
5951
5948
|
refresh: () => P()?.refresh?.(),
|
|
5952
5949
|
getSelectedRecords: () => P()?.getSelectedRecords?.() ?? [],
|
|
5953
5950
|
clearSelection: () => P()?.clearSelection?.(),
|
|
5954
|
-
selectRow: (
|
|
5955
|
-
selectRows: (
|
|
5956
|
-
search: (
|
|
5957
|
-
te("search()", g), P()?.search?.(
|
|
5951
|
+
selectRow: (W) => P()?.selectRow?.(W),
|
|
5952
|
+
selectRows: (W) => P()?.selectRows?.(W),
|
|
5953
|
+
search: (W) => {
|
|
5954
|
+
te("search()", g), P()?.search?.(W);
|
|
5958
5955
|
},
|
|
5959
5956
|
print: () => P()?.print?.(),
|
|
5960
|
-
excelExport: (
|
|
5961
|
-
te("excelExport()", a), P()?.excelExport?.(
|
|
5957
|
+
excelExport: (W) => {
|
|
5958
|
+
te("excelExport()", a), P()?.excelExport?.(W);
|
|
5962
5959
|
},
|
|
5963
|
-
pdfExport: (
|
|
5964
|
-
te("pdfExport()", k), P()?.pdfExport?.(
|
|
5960
|
+
pdfExport: (W) => {
|
|
5961
|
+
te("pdfExport()", k), P()?.pdfExport?.(W);
|
|
5965
5962
|
},
|
|
5966
|
-
openColumnChooser: (
|
|
5967
|
-
te("openColumnChooser()",
|
|
5963
|
+
openColumnChooser: (W, pe) => {
|
|
5964
|
+
te("openColumnChooser()", h), P()?.columnChooserModule?.openColumnChooser?.(W, pe);
|
|
5968
5965
|
}
|
|
5969
5966
|
};
|
|
5970
5967
|
}, []);
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
}, [
|
|
5974
|
-
|
|
5968
|
+
X(() => {
|
|
5969
|
+
q && (q.current = F);
|
|
5970
|
+
}, [q, F]), X(() => () => {
|
|
5971
|
+
q && (q.current = null);
|
|
5975
5972
|
}, []);
|
|
5976
|
-
const
|
|
5973
|
+
const z = (P) => {
|
|
5977
5974
|
const te = String(P || "");
|
|
5978
5975
|
return te === "Ascending" || te === "Descending" ? te : te.toLowerCase() === "ascending" ? "Ascending" : "Descending";
|
|
5979
|
-
},
|
|
5980
|
-
const te =
|
|
5981
|
-
field:
|
|
5982
|
-
dir:
|
|
5976
|
+
}, U = (P) => {
|
|
5977
|
+
const te = N.current, W = P?.requestType, pe = W === "paging" ? "paging" : W === "sorting" ? "sorting" : W === "searching" ? "searching" : W === "filtering" ? "filtering" : W === "grouping" ? "grouping" : W === "reorder" ? "reorder" : W === "columnstate" ? "columnstate" : "other", Fe = P?.pageSize ?? te?.pageSettings?.pageSize ?? b, Ie = P?.currentPage ?? te?.pageSettings?.currentPage ?? n, Je = P?.columnName && P?.direction ? [{ field: P.columnName, dir: z(P.direction) }] : (te?.sortSettings?.columns || []).map(($e) => ({
|
|
5978
|
+
field: $e.field,
|
|
5979
|
+
dir: z($e.direction ?? $e.dir)
|
|
5983
5980
|
})), Qe = P?.searchString ?? "", Xe = P?.columns ?? te?.filterSettings?.columns ?? [];
|
|
5984
5981
|
return {
|
|
5985
5982
|
reason: pe,
|
|
5986
|
-
page: { index: Ie, size:
|
|
5983
|
+
page: { index: Ie, size: Fe, skip: (Ie - 1) * Fe, take: Fe },
|
|
5987
5984
|
sort: Je,
|
|
5988
5985
|
// [{ field, dir: 'Ascending'|'Descending' }]
|
|
5989
5986
|
search: Qe,
|
|
@@ -5992,21 +5989,21 @@ function vs(t) {
|
|
|
5992
5989
|
};
|
|
5993
5990
|
}, Ne = (P) => {
|
|
5994
5991
|
setTimeout(() => {
|
|
5995
|
-
|
|
5996
|
-
}, 1e3), P.requestType === "paging" && (
|
|
5992
|
+
N?.current?.hideSpinner();
|
|
5993
|
+
}, 1e3), P.requestType === "paging" && (m(P.currentPage), D(P.pageSize)), P.requestType === "sorting" && (j(P.columnName || "updatedDate"), A(P.direction === "Ascending" ? "ASC" : "DESC")), T && T(U(P), P);
|
|
5997
5994
|
}, ie = (P) => {
|
|
5998
|
-
typeof
|
|
5995
|
+
typeof V == "function" && V(P?.rowData, P);
|
|
5999
5996
|
}, xe = () => {
|
|
6000
5997
|
const P = [];
|
|
6001
|
-
return
|
|
5998
|
+
return O && P.push(/* @__PURE__ */ e(ia, { type: "checkbox", width: "50" }, "__checkbox__")), C.forEach((te, W) => {
|
|
6002
5999
|
const {
|
|
6003
6000
|
field: pe,
|
|
6004
|
-
headerText:
|
|
6001
|
+
headerText: Fe,
|
|
6005
6002
|
width: Ie,
|
|
6006
6003
|
textAlign: Je = "Left",
|
|
6007
6004
|
template: Qe,
|
|
6008
6005
|
isPrimaryKey: Xe,
|
|
6009
|
-
showInColumnChooser:
|
|
6006
|
+
showInColumnChooser: $e = !0,
|
|
6010
6007
|
allowFiltering: tt = !0,
|
|
6011
6008
|
allowSorting: rt = !0,
|
|
6012
6009
|
type: nt,
|
|
@@ -6022,12 +6019,12 @@ function vs(t) {
|
|
|
6022
6019
|
ia,
|
|
6023
6020
|
{
|
|
6024
6021
|
field: pe,
|
|
6025
|
-
headerText:
|
|
6022
|
+
headerText: Fe,
|
|
6026
6023
|
width: Ie,
|
|
6027
6024
|
textAlign: Je,
|
|
6028
6025
|
template: Qe,
|
|
6029
6026
|
isPrimaryKey: Xe,
|
|
6030
|
-
showInColumnChooser:
|
|
6027
|
+
showInColumnChooser: $e,
|
|
6031
6028
|
allowFiltering: tt,
|
|
6032
6029
|
allowSorting: rt,
|
|
6033
6030
|
type: nt,
|
|
@@ -6038,7 +6035,7 @@ function vs(t) {
|
|
|
6038
6035
|
customAttributes: ct,
|
|
6039
6036
|
...dt
|
|
6040
6037
|
},
|
|
6041
|
-
pe || `col-${
|
|
6038
|
+
pe || `col-${W}`
|
|
6042
6039
|
)
|
|
6043
6040
|
);
|
|
6044
6041
|
}), P;
|
|
@@ -6047,7 +6044,7 @@ function vs(t) {
|
|
|
6047
6044
|
Or,
|
|
6048
6045
|
{
|
|
6049
6046
|
id: o,
|
|
6050
|
-
ref:
|
|
6047
|
+
ref: N,
|
|
6051
6048
|
dataSource: {
|
|
6052
6049
|
result: r,
|
|
6053
6050
|
count: s
|
|
@@ -6057,23 +6054,23 @@ function vs(t) {
|
|
|
6057
6054
|
allowSorting: i,
|
|
6058
6055
|
allowFiltering: c,
|
|
6059
6056
|
allowGrouping: y,
|
|
6060
|
-
allowReordering:
|
|
6061
|
-
allowResizing:
|
|
6062
|
-
showColumnChooser:
|
|
6057
|
+
allowReordering: v,
|
|
6058
|
+
allowResizing: x,
|
|
6059
|
+
showColumnChooser: h,
|
|
6063
6060
|
selectionSettings: L,
|
|
6064
6061
|
pageSettings: { pageSize: 10, pageSizes: p?.pageSizes ?? [20, 40, 60, 80, 100] },
|
|
6065
6062
|
sortSettings: f ?? {
|
|
6066
|
-
columns: [{ field:
|
|
6063
|
+
columns: [{ field: R, direction: z(S) }],
|
|
6067
6064
|
allowUnsort: !1
|
|
6068
6065
|
},
|
|
6069
6066
|
actionBegin: Ne,
|
|
6070
|
-
rowSelected:
|
|
6071
|
-
rowDeselected:
|
|
6067
|
+
rowSelected: I,
|
|
6068
|
+
rowDeselected: E,
|
|
6072
6069
|
recordDoubleClick: ie,
|
|
6073
6070
|
...w,
|
|
6074
6071
|
children: [
|
|
6075
6072
|
/* @__PURE__ */ e(Mr, { children: xe() }),
|
|
6076
|
-
/* @__PURE__ */ e(Ur, { services:
|
|
6073
|
+
/* @__PURE__ */ e(Ur, { services: M })
|
|
6077
6074
|
]
|
|
6078
6075
|
}
|
|
6079
6076
|
);
|
|
@@ -6097,7 +6094,7 @@ export {
|
|
|
6097
6094
|
ys as FullConfigPage,
|
|
6098
6095
|
ns as FullScreenLoader,
|
|
6099
6096
|
as as GenericFilter,
|
|
6100
|
-
|
|
6097
|
+
Y as Input,
|
|
6101
6098
|
et as ManageCollectionList,
|
|
6102
6099
|
Zr as Modal,
|
|
6103
6100
|
Ye as MultiSelect,
|
|
@@ -6115,7 +6112,7 @@ export {
|
|
|
6115
6112
|
Ga as ToggleSwitch,
|
|
6116
6113
|
ss as Tooltip,
|
|
6117
6114
|
ps as TreeView,
|
|
6118
|
-
|
|
6115
|
+
H as UnifyedCoreButton,
|
|
6119
6116
|
ls as WizardModal,
|
|
6120
6117
|
Qa as adGroupsListSearchApi,
|
|
6121
6118
|
un as axiosDelete,
|