react-admin-crud-manager 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,14 +1,14 @@
1
- import { jsx as e, Fragment as D, jsxs as h } from "react/jsx-runtime";
1
+ import { jsx as e, Fragment as j, jsxs as h } from "react/jsx-runtime";
2
2
  import Me, { useState as C, useRef as X, useEffect as K, useMemo as Fe } from "react";
3
3
  import { Info as Xe, ChevronDown as $e, Search as Ie, Check as ea, X as Le, User as Ae, Plus as aa, Filter as ra, ChevronLeft as ta, ChevronRight as na, EllipsisVertical as la, Music as oa } from "lucide-react";
4
4
  import { createPortal as ia } from "react-dom";
5
5
  import { Icon as ne } from "@iconify/react";
6
6
  import { Editor as sa } from "@tinymce/tinymce-react";
7
- import { enqueueSnackbar as ce, SnackbarProvider as da } from "notistack";
8
- import n from "prop-types";
9
- const Ge = (o, l = "DD MMM YYYY") => {
10
- if (!o) return "N/A";
11
- const t = new Date(o);
7
+ import { enqueueSnackbar as ce, SnackbarProvider as da, useSnackbar as ca } from "notistack";
8
+ import l from "prop-types";
9
+ const Ge = (n, o = "DD MMM YYYY") => {
10
+ if (!n) return "N/A";
11
+ const t = new Date(n);
12
12
  if (isNaN(t)) return "Invalid Date";
13
13
  const s = (d) => String(d).padStart(2, "0"), i = {
14
14
  YYYY: t.getFullYear(),
@@ -27,14 +27,14 @@ const Ge = (o, l = "DD MMM YYYY") => {
27
27
  ss: s(t.getSeconds()),
28
28
  A: t.getHours() >= 12 ? "PM" : "AM"
29
29
  };
30
- return l.replace(
30
+ return o.replace(
31
31
  /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
32
32
  (d) => i[d]
33
33
  );
34
- }, ca = (o, l, t = []) => {
35
- if (!(l != null && l.trim())) return o;
36
- const s = l.toLowerCase(), i = (d) => d == null ? [] : typeof d == "object" ? Object.values(d).flatMap(i) : [String(d)];
37
- return o.filter((d) => {
34
+ }, ua = (n, o, t = []) => {
35
+ if (!(o != null && o.trim())) return n;
36
+ const s = o.toLowerCase(), i = (d) => d == null ? [] : typeof d == "object" ? Object.values(d).flatMap(i) : [String(d)];
37
+ return n.filter((d) => {
38
38
  let r = [];
39
39
  return t.length > 0 ? t.forEach((x) => {
40
40
  d[x] !== void 0 && r.push(...i(d[x]));
@@ -44,8 +44,8 @@ const Ge = (o, l = "DD MMM YYYY") => {
44
44
  });
45
45
  }, Q = Me.forwardRef(
46
46
  ({
47
- className: o = "",
48
- variant: l = "contained",
47
+ className: n = "",
48
+ variant: o = "contained",
49
49
  color: t = "default",
50
50
  size: s = "default",
51
51
  fullWidth: i = !1,
@@ -80,12 +80,12 @@ const Ge = (o, l = "DD MMM YYYY") => {
80
80
  outlined: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500",
81
81
  text: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500"
82
82
  }
83
- }, u = ((g = b[t]) == null ? void 0 : g[l]) || b.default.contained, w = c[s], f = `
83
+ }, u = ((g = b[t]) == null ? void 0 : g[o]) || b.default.contained, k = c[s], f = `
84
84
  ${S}
85
85
  ${u}
86
- ${w}
86
+ ${k}
87
87
  ${i ? "w-full" : ""}
88
- ${o}
88
+ ${n}
89
89
  `.trim();
90
90
  return /* @__PURE__ */ e(
91
91
  "button",
@@ -100,10 +100,10 @@ const Ge = (o, l = "DD MMM YYYY") => {
100
100
  }
101
101
  );
102
102
  Q.displayName = "Button";
103
- function q({ label: o, required: l = !1, infoText: t = "" }) {
104
- return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("label", { className: "flex text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
- o,
106
- l && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" }),
103
+ function q({ label: n, required: o = !1, infoText: t = "" }) {
104
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("label", { className: "flex text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
+ n,
106
+ o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" }),
107
107
  t && /* @__PURE__ */ h("span", { className: "ml-2 relative group inline-flex items-center cursor-pointer", children: [
108
108
  /* @__PURE__ */ e(Xe, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }),
109
109
  /* @__PURE__ */ e(
@@ -120,9 +120,9 @@ function q({ label: o, required: l = !1, infoText: t = "" }) {
120
120
  ] })
121
121
  ] }) });
122
122
  }
123
- const ua = ({
124
- options: o = [],
125
- value: l = "",
123
+ const ha = ({
124
+ options: n = [],
125
+ value: o = "",
126
126
  defaultValue: t = "",
127
127
  onChange: s,
128
128
  placeholder: i = "Select option",
@@ -133,59 +133,59 @@ const ua = ({
133
133
  required: c = !1,
134
134
  name: b = "",
135
135
  parentClass: u = "",
136
- multiple: w = !1,
136
+ multiple: k = !1,
137
137
  // ✅ NEW
138
138
  dropdownMaxHeight: f = "",
139
139
  formData: g = {},
140
140
  dependencyKey: N = ""
141
141
  }) => {
142
142
  var I;
143
- const [y, M] = C(!1), [j, U] = C(""), [L, O] = C(!0), E = X(null), F = X(null), [T, B] = C([]);
144
- let G = l || l === !1 ? l : t;
145
- const _ = (k) => k == null || k === "" ? "" : String(typeof k == "boolean" ? k : k ?? "");
143
+ const [y, M] = C(!1), [D, U] = C(""), [L, O] = C(!0), E = X(null), F = X(null), [T, B] = C([]);
144
+ let G = o || o === !1 ? o : t;
145
+ const _ = (w) => w == null || w === "" ? "" : String(typeof w == "boolean" ? w : w ?? "");
146
146
  K(
147
147
  () => {
148
148
  (async () => {
149
- if (typeof o == "function") {
150
- const P = await o(g);
149
+ if (typeof n == "function") {
150
+ const P = await n(g);
151
151
  B(P);
152
152
  } else
153
- B(o || []);
153
+ B(n || []);
154
154
  })();
155
155
  },
156
- N ? [o, g == null ? void 0 : g[N]] : [o]
156
+ N ? [n, g == null ? void 0 : g[N]] : [n]
157
157
  );
158
- const J = w ? (G || []).map(_) : _(G), Z = T.filter(
159
- (k) => k.label.toLowerCase().includes(j.toLowerCase())
160
- ), A = (k) => {
161
- const P = _(k);
162
- return w ? J.includes(P) : P === J;
158
+ const J = k ? (G || []).map(_) : _(G), Z = T.filter(
159
+ (w) => w.label.toLowerCase().includes(D.toLowerCase())
160
+ ), A = (w) => {
161
+ const P = _(w);
162
+ return k ? J.includes(P) : P === J;
163
163
  };
164
164
  K(() => {
165
- const k = (P) => {
165
+ const w = (P) => {
166
166
  E.current && !E.current.contains(P.target) && (M(!1), U(""));
167
167
  };
168
- return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
168
+ return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
169
169
  }, []), K(() => {
170
170
  if (y && E.current) {
171
- const k = E.current.getBoundingClientRect(), W = window.innerHeight - k.bottom;
171
+ const w = E.current.getBoundingClientRect(), W = window.innerHeight - w.bottom;
172
172
  O(W < 200);
173
173
  }
174
174
  }, [y]), K(() => {
175
175
  y && F.current && F.current.focus();
176
176
  }, [y]);
177
- const z = (k) => {
178
- let P = k;
179
- if (k === "true" ? P = !0 : k === "false" && (P = !1), w) {
180
- const W = J.includes(_(k));
177
+ const z = (w) => {
178
+ let P = w;
179
+ if (w === "true" ? P = !0 : w === "false" && (P = !1), k) {
180
+ const W = J.includes(_(w));
181
181
  let H;
182
- W ? H = l.filter(
183
- (ae) => _(ae) !== _(k)
184
- ) : H = [...l || [], P], s(H);
182
+ W ? H = o.filter(
183
+ (ae) => _(ae) !== _(w)
184
+ ) : H = [...o || [], P], s(H);
185
185
  } else
186
186
  s(P), M(!1);
187
187
  U("");
188
- }, V = w ? T.filter((k) => A(k.value)).map((k) => k.label).join(", ") : (I = T.find((k) => A(k.value))) == null ? void 0 : I.label;
188
+ }, V = k ? T.filter((w) => A(w.value)).map((w) => w.label).join(", ") : (I = T.find((w) => A(w.value))) == null ? void 0 : I.label;
189
189
  return K(() => {
190
190
  (G || G === !1) && setTimeout(() => {
191
191
  s(G);
@@ -199,7 +199,7 @@ const ua = ({
199
199
  name: "hidden_select_for_validation",
200
200
  value: V || "",
201
201
  required: c,
202
- multiple: w,
202
+ multiple: k,
203
203
  className: "absolute opacity-0 right-1/2 top-[80%] -translate-x-1/2 -translate-y-1/2 pointer-events-none h-[10px]",
204
204
  children: /* @__PURE__ */ e("option", { hidden: !0, value: V, children: V })
205
205
  }
@@ -237,8 +237,8 @@ const ua = ({
237
237
  {
238
238
  ref: F,
239
239
  type: "text",
240
- value: j,
241
- onChange: (k) => U(k.target.value),
240
+ value: D,
241
+ onChange: (w) => U(w.target.value),
242
242
  placeholder: "Search...",
243
243
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none"
244
244
  }
@@ -251,19 +251,19 @@ const ua = ({
251
251
  style: {
252
252
  maxHeight: f || ""
253
253
  },
254
- children: Z.length > 0 ? Z.map((k) => /* @__PURE__ */ h(
254
+ children: Z.length > 0 ? Z.map((w) => /* @__PURE__ */ h(
255
255
  "button",
256
256
  {
257
257
  type: "button",
258
- onClick: () => z(String(k.value)),
258
+ onClick: () => z(String(w.value)),
259
259
  className: `w-full px-3 py-2 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-600
260
- ${A(k.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
260
+ ${A(w.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
261
261
  children: [
262
- /* @__PURE__ */ e("span", { children: k.label }),
263
- w && A(k.value) && /* @__PURE__ */ e(ea, { className: "w-4 h-4" })
262
+ /* @__PURE__ */ e("span", { children: w.label }),
263
+ k && A(w.value) && /* @__PURE__ */ e(ea, { className: "w-4 h-4" })
264
264
  ]
265
265
  },
266
- String(k.value)
266
+ String(w.value)
267
267
  )) : /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No options found" })
268
268
  }
269
269
  )
@@ -274,8 +274,8 @@ const ua = ({
274
274
  ] }, b);
275
275
  }, Ke = Me.forwardRef(
276
276
  ({
277
- label: o,
278
- required: l,
277
+ label: n,
278
+ required: o,
279
279
  parentClass: t = "col-span-12",
280
280
  className: s = "",
281
281
  value: i,
@@ -283,7 +283,7 @@ const ua = ({
283
283
  disabled: r = !1,
284
284
  ...x
285
285
  }, S) => /* @__PURE__ */ h("div", { className: `flex justify-between ${t}`, children: [
286
- o && /* @__PURE__ */ e(q, { label: o, required: l }),
286
+ n && /* @__PURE__ */ e(q, { label: n, required: o }),
287
287
  /* @__PURE__ */ h("label", { className: "relative inline-flex items-center cursor-pointer", children: [
288
288
  /* @__PURE__ */ e(
289
289
  "input",
@@ -577,9 +577,9 @@ const Se = [
577
577
  { label: "Zambia", code: "ZM", phone: "260" },
578
578
  { label: "Zimbabwe", code: "ZW", phone: "263" }
579
579
  ];
580
- function ha({
581
- label: o = "",
582
- value: l = "",
580
+ function ba({
581
+ label: n = "",
582
+ value: o = "",
583
583
  name: t = "",
584
584
  parentClass: s = "",
585
585
  onChange: i,
@@ -590,22 +590,22 @@ function ha({
590
590
  countriesList: c = !1,
591
591
  defaultCountry: b = ""
592
592
  }) {
593
- const u = (T) => Se.find((B) => B.code == T), [w, f] = C(
593
+ const u = (T) => Se.find((B) => B.code == T), [k, f] = C(
594
594
  u(b) || Se[0]
595
- ), [g, N] = C(""), [y, M] = C(!1), [j, U] = C(""), L = X();
595
+ ), [g, N] = C(""), [y, M] = C(!1), [D, U] = C(""), L = X();
596
596
  K(() => {
597
- if (typeof l == "string" && l.startsWith("+")) {
598
- const T = Se.filter((B) => l.startsWith("+" + B.phone)).sort((B, G) => G.phone.length - B.phone.length)[0];
597
+ if (typeof o == "string" && o.startsWith("+")) {
598
+ const T = Se.filter((B) => o.startsWith("+" + B.phone)).sort((B, G) => G.phone.length - B.phone.length)[0];
599
599
  if (T) {
600
- f(T), N(l.replace("+" + T.phone, ""));
600
+ f(T), N(o.replace("+" + T.phone, ""));
601
601
  return;
602
602
  }
603
603
  }
604
- N(l);
605
- }, [l]);
604
+ N(o);
605
+ }, [o]);
606
606
  const O = (T) => {
607
607
  const B = T.target.value.replace(/\D/g, "");
608
- N(B), w && i && i("+" + w.phone + B);
608
+ N(B), k && i && i("+" + k.phone + B);
609
609
  }, E = (T) => {
610
610
  f(T), i && i("+" + T.phone + g), M(!1), U("");
611
611
  };
@@ -616,10 +616,10 @@ function ha({
616
616
  return document.addEventListener("mousedown", T), () => document.removeEventListener("mousedown", T);
617
617
  }, []);
618
618
  const F = Se.filter(
619
- (T) => T.label.toLowerCase().includes(j.toLowerCase()) || T.phone.includes(j)
619
+ (T) => T.label.toLowerCase().includes(D.toLowerCase()) || T.phone.includes(D)
620
620
  );
621
- return c ? /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
622
- /* @__PURE__ */ e(q, { label: o, required: r }),
621
+ return c ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
622
+ /* @__PURE__ */ e(q, { label: n, required: r }),
623
623
  /* @__PURE__ */ h("div", { className: "relative ", ref: L, children: [
624
624
  /* @__PURE__ */ h(
625
625
  "div",
@@ -636,11 +636,11 @@ function ha({
636
636
  onClick: () => M(!y),
637
637
  className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
638
638
  children: [
639
- w ? /* @__PURE__ */ e(
639
+ k ? /* @__PURE__ */ e(
640
640
  "img",
641
641
  {
642
- src: `https://flagcdn.com/w20/${w.code.toLowerCase()}.png`,
643
- alt: w.code,
642
+ src: `https://flagcdn.com/w20/${k.code.toLowerCase()}.png`,
643
+ alt: k.code,
644
644
  className: "w-5 h-3 object-cover"
645
645
  }
646
646
  ) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "🌐" }),
@@ -648,9 +648,9 @@ function ha({
648
648
  ]
649
649
  }
650
650
  ),
651
- w && /* @__PURE__ */ h("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
651
+ k && /* @__PURE__ */ h("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
652
652
  "+",
653
- w.phone
653
+ k.phone
654
654
  ] }),
655
655
  /* @__PURE__ */ e(
656
656
  "input",
@@ -659,8 +659,8 @@ function ha({
659
659
  value: g,
660
660
  onChange: O,
661
661
  required: r,
662
- disabled: d || !w,
663
- placeholder: w ? x : "Select a country",
662
+ disabled: d || !k,
663
+ placeholder: k ? x : "Select a country",
664
664
  className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
665
665
  }
666
666
  ),
@@ -671,7 +671,7 @@ function ha({
671
671
  required: r,
672
672
  tabIndex: -1,
673
673
  readOnly: !0,
674
- value: w && g ? "+" + w.phone + g : "",
674
+ value: k && g ? "+" + k.phone + g : "",
675
675
  style: {
676
676
  position: "absolute",
677
677
  opacity: 0,
@@ -690,7 +690,7 @@ function ha({
690
690
  "input",
691
691
  {
692
692
  type: "text",
693
- value: j,
693
+ value: D,
694
694
  onChange: (T) => U(T.target.value),
695
695
  placeholder: "Search country...",
696
696
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none "
@@ -724,13 +724,13 @@ function ha({
724
724
  ))
725
725
  ] })
726
726
  ] })
727
- ] }, t) }) : /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
728
- /* @__PURE__ */ e(q, { label: o, required: r }),
727
+ ] }, t) }) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
728
+ /* @__PURE__ */ e(q, { label: n, required: r }),
729
729
  /* @__PURE__ */ e(
730
730
  "input",
731
731
  {
732
732
  type: "text",
733
- value: l,
733
+ value: o,
734
734
  onChange: (B) => {
735
735
  const G = B.target.value.replace(/[^+\d]/g, ""), _ = G.startsWith("+") ? "+" + G.replace(/[+]/g, "").slice(0) : G;
736
736
  i(_);
@@ -748,13 +748,13 @@ function ha({
748
748
  ] }, t) });
749
749
  }
750
750
  const _e = Me.forwardRef(
751
- ({ className: o = "", label: l, required: t, ...s }, i) => {
751
+ ({ className: n = "", label: o, required: t, ...s }, i) => {
752
752
  const d = `
753
753
  placeholder-gray-400 dark:placeholder-gray-400
754
- ${o}
754
+ ${n}
755
755
  `.trim();
756
- return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: s.parentClass || "col-span-12", children: [
757
- /* @__PURE__ */ e(q, { label: l, required: t }),
756
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: s.parentClass || "col-span-12", children: [
757
+ /* @__PURE__ */ e(q, { label: o, required: t }),
758
758
  /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
759
759
  "textarea",
760
760
  {
@@ -768,9 +768,9 @@ const _e = Me.forwardRef(
768
768
  }
769
769
  );
770
770
  _e.displayName = "TextArea";
771
- const ba = ({
772
- label: o = "",
773
- value: l = null,
771
+ const pa = ({
772
+ label: n = "",
773
+ value: o = null,
774
774
  onChange: t,
775
775
  required: s = !1,
776
776
  accept: i = "image/*",
@@ -779,10 +779,10 @@ const ba = ({
779
779
  name: x = "",
780
780
  parentClass: S = ""
781
781
  }) => {
782
- const [c, b] = C(l), [u, w] = C(!1), f = X(null);
783
- K(() => (l instanceof File ? b({ file: l, preview: URL.createObjectURL(l) }) : (l != null && l.preview, b(l)), () => {
782
+ const [c, b] = C(o), [u, k] = C(!1), f = X(null);
783
+ K(() => (o instanceof File ? b({ file: o, preview: URL.createObjectURL(o) }) : (o != null && o.preview, b(o)), () => {
784
784
  c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview);
785
- }), [l]);
785
+ }), [o]);
786
786
  const g = (L) => {
787
787
  if (!L || L.length === 0)
788
788
  return;
@@ -791,23 +791,23 @@ const ba = ({
791
791
  }, N = (L) => {
792
792
  L && L.stopPropagation(), c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview), b(null), t == null || t(null), f.current && (f.current.value = "");
793
793
  }, y = (L) => {
794
- r && (L.preventDefault(), w(!0));
794
+ r && (L.preventDefault(), k(!0));
795
795
  }, M = (L) => {
796
- r && (L.preventDefault(), w(!1));
797
- }, j = (L) => {
798
- r && (L.preventDefault(), w(!1), g(L.dataTransfer.files));
796
+ r && (L.preventDefault(), k(!1));
797
+ }, D = (L) => {
798
+ r && (L.preventDefault(), k(!1), g(L.dataTransfer.files));
799
799
  }, U = () => {
800
800
  f.current.click();
801
801
  };
802
- return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
803
- /* @__PURE__ */ e(q, { label: o, required: s }),
802
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
803
+ /* @__PURE__ */ e(q, { label: n, required: s }),
804
804
  /* @__PURE__ */ h(
805
805
  "div",
806
806
  {
807
807
  className: `relative rounded-md p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
808
808
  onDragOver: y,
809
809
  onDragLeave: M,
810
- onDrop: j,
810
+ onDrop: D,
811
811
  children: [
812
812
  /* @__PURE__ */ e(
813
813
  "input",
@@ -881,8 +881,8 @@ const ba = ({
881
881
  ] }, x) });
882
882
  }, ze = Me.forwardRef(
883
883
  ({
884
- label: o,
885
- required: l,
884
+ label: n,
885
+ required: o,
886
886
  parentClass: t = "",
887
887
  className: s = "",
888
888
  type: i = "text",
@@ -892,7 +892,7 @@ const ba = ({
892
892
  field: S = {},
893
893
  ...c
894
894
  }, b) => {
895
- const [u, w] = C(!1), f = (N) => {
895
+ const [u, k] = C(!1), f = (N) => {
896
896
  if (i === "number") {
897
897
  if (["e", "E", "+"].includes(N.key)) {
898
898
  N.preventDefault();
@@ -922,12 +922,12 @@ const ba = ({
922
922
  (y = c.onChange) == null || y.call(c, { target: { value: N } });
923
923
  }, 100);
924
924
  }
925
- }, [x]), /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: t || "col-span-12", children: [
925
+ }, [x]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: t || "col-span-12", children: [
926
926
  /* @__PURE__ */ e(
927
927
  q,
928
928
  {
929
- label: o,
930
- required: l,
929
+ label: n,
930
+ required: o,
931
931
  infoText: S.infoText
932
932
  }
933
933
  ),
@@ -937,7 +937,7 @@ const ba = ({
937
937
  {
938
938
  type: i === "password" && u ? "text" : i,
939
939
  ref: b,
940
- required: l,
940
+ required: o,
941
941
  onKeyDown: f,
942
942
  className: g,
943
943
  ...c
@@ -948,7 +948,7 @@ const ba = ({
948
948
  {
949
949
  type: "button",
950
950
  tabIndex: -1,
951
- onClick: () => w((N) => !N),
951
+ onClick: () => k((N) => !N),
952
952
  className: "absolute inset-y-0 right-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-200",
953
953
  children: /* @__PURE__ */ e(
954
954
  ne,
@@ -964,9 +964,9 @@ const ba = ({
964
964
  }
965
965
  );
966
966
  ze.displayName = "Input";
967
- const pa = ({
968
- key: o,
969
- editorKey: l = "",
967
+ const ga = ({
968
+ key: n,
969
+ editorKey: o = "",
970
970
  value: t = "",
971
971
  onChange: s,
972
972
  label: i = "",
@@ -977,7 +977,7 @@ const pa = ({
977
977
  inline: c = !1,
978
978
  disabled: b = !1,
979
979
  plugins: u,
980
- toolbar: w,
980
+ toolbar: k,
981
981
  menubar: f = !1,
982
982
  fontFamily: g = "Inter, sans-serif",
983
983
  initConfig: N = {},
@@ -988,7 +988,7 @@ const pa = ({
988
988
  /* @__PURE__ */ e(
989
989
  sa,
990
990
  {
991
- apiKey: l,
991
+ apiKey: o,
992
992
  value: t,
993
993
  disabled: b,
994
994
  init: {
@@ -1030,7 +1030,7 @@ const pa = ({
1030
1030
  "help",
1031
1031
  "wordcount"
1032
1032
  ],
1033
- toolbar: w ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1033
+ toolbar: k ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1034
1034
  placeholder: r,
1035
1035
  content_style: `
1036
1036
  body {
@@ -1044,9 +1044,9 @@ const pa = ({
1044
1044
  }
1045
1045
  }
1046
1046
  )
1047
- ] }, o), ga = ({
1048
- name: o = "",
1049
- label: l = "",
1047
+ ] }, n), ma = ({
1048
+ name: n = "",
1049
+ label: o = "",
1050
1050
  // label for single checkbox
1051
1051
  options: t = [],
1052
1052
  // array of { label, value } for multiple
@@ -1060,12 +1060,12 @@ const pa = ({
1060
1060
  multiSelect: c = !1
1061
1061
  // ✅ if true, only one option can be selected (like radio)
1062
1062
  }) => {
1063
- const b = Array.isArray(t) && t.length > 0, u = (g) => b ? c ? Array.isArray(s) && s.includes(g) : s === g : !!s, w = (g) => {
1064
- i == null || i(g.target.checked, o);
1063
+ const b = Array.isArray(t) && t.length > 0, u = (g) => b ? c ? Array.isArray(s) && s.includes(g) : s === g : !!s, k = (g) => {
1064
+ i == null || i(g.target.checked, n);
1065
1065
  }, f = (g, N) => {
1066
1066
  if (i)
1067
1067
  if (!c)
1068
- i(N ? g : "", o);
1068
+ i(N ? g : "", n);
1069
1069
  else {
1070
1070
  const y = Array.isArray(s) ? [...s] : [];
1071
1071
  if (N)
@@ -1074,17 +1074,17 @@ const pa = ({
1074
1074
  const M = y.indexOf(g);
1075
1075
  M > -1 && y.splice(M, 1);
1076
1076
  }
1077
- i(y, o);
1077
+ i(y, n);
1078
1078
  }
1079
1079
  };
1080
- return b ? /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: `${x}`, children: [
1081
- /* @__PURE__ */ e(q, { label: l, required: r }),
1080
+ return b ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: `${x}`, children: [
1081
+ /* @__PURE__ */ e(q, { label: o, required: r }),
1082
1082
  /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: t.map((g, N) => /* @__PURE__ */ h("div", { className: "flex items-center", children: [
1083
1083
  /* @__PURE__ */ e(
1084
1084
  "input",
1085
1085
  {
1086
1086
  type: "checkbox",
1087
- name: o,
1087
+ name: n,
1088
1088
  value: g.value,
1089
1089
  checked: u(g.value),
1090
1090
  disabled: d || g.disabled,
@@ -1092,12 +1092,12 @@ const pa = ({
1092
1092
  onChange: (y) => f(g.value, y.target.checked),
1093
1093
  className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1094
1094
  },
1095
- o
1095
+ n
1096
1096
  ),
1097
1097
  g.label && /* @__PURE__ */ e(
1098
1098
  "label",
1099
1099
  {
1100
- htmlFor: o,
1100
+ htmlFor: n,
1101
1101
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1102
1102
  children: g.label
1103
1103
  }
@@ -1108,26 +1108,26 @@ const pa = ({
1108
1108
  "input",
1109
1109
  {
1110
1110
  type: "checkbox",
1111
- name: o,
1111
+ name: n,
1112
1112
  checked: u(),
1113
1113
  disabled: d,
1114
1114
  required: r,
1115
- onChange: w,
1115
+ onChange: k,
1116
1116
  className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1117
1117
  }
1118
1118
  ),
1119
- l && /* @__PURE__ */ e(
1119
+ o && /* @__PURE__ */ e(
1120
1120
  "label",
1121
1121
  {
1122
- htmlFor: o,
1122
+ htmlFor: n,
1123
1123
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1124
- children: l
1124
+ children: o
1125
1125
  }
1126
1126
  )
1127
1127
  ] });
1128
- }, ma = ({
1129
- label: o = "",
1130
- value: l = null,
1128
+ }, fa = ({
1129
+ label: n = "",
1130
+ value: o = null,
1131
1131
  onChange: t,
1132
1132
  required: s = !1,
1133
1133
  accept: i = "audio/*",
@@ -1136,19 +1136,19 @@ const pa = ({
1136
1136
  name: x = "",
1137
1137
  parentClass: S = ""
1138
1138
  }) => {
1139
- const [c, b] = C(null), [u, w] = C(!1), f = X(null);
1139
+ const [c, b] = C(null), [u, k] = C(!1), f = X(null);
1140
1140
  K(() => {
1141
- if (!l) {
1141
+ if (!o) {
1142
1142
  g(), b(null);
1143
1143
  return;
1144
1144
  }
1145
- if (l instanceof File) {
1146
- const O = URL.createObjectURL(l);
1147
- return b({ file: l, preview: O }), () => {
1145
+ if (o instanceof File) {
1146
+ const O = URL.createObjectURL(o);
1147
+ return b({ file: o, preview: O }), () => {
1148
1148
  URL.revokeObjectURL(O);
1149
1149
  };
1150
- } else typeof l == "string" ? b({ preview: l }) : l != null && l.preview && b(l);
1151
- }, [l]);
1150
+ } else typeof o == "string" ? b({ preview: o }) : o != null && o.preview && b(o);
1151
+ }, [o]);
1152
1152
  const g = () => {
1153
1153
  c != null && c.preview && c.preview.startsWith("blob:") && URL.revokeObjectURL(c.preview);
1154
1154
  }, N = (O) => {
@@ -1159,22 +1159,22 @@ const pa = ({
1159
1159
  }, y = (O) => {
1160
1160
  O && O.stopPropagation(), g(), b(null), t == null || t(null), f.current && (f.current.value = "");
1161
1161
  }, M = (O) => {
1162
- r && (O.preventDefault(), w(!0));
1163
- }, j = (O) => {
1164
- r && (O.preventDefault(), w(!1));
1162
+ r && (O.preventDefault(), k(!0));
1163
+ }, D = (O) => {
1164
+ r && (O.preventDefault(), k(!1));
1165
1165
  }, U = (O) => {
1166
- r && (O.preventDefault(), w(!1), N(O.dataTransfer.files));
1166
+ r && (O.preventDefault(), k(!1), N(O.dataTransfer.files));
1167
1167
  }, L = () => {
1168
1168
  f.current.click();
1169
1169
  };
1170
1170
  return /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
1171
- /* @__PURE__ */ e(q, { label: o, required: s }),
1171
+ /* @__PURE__ */ e(q, { label: n, required: s }),
1172
1172
  /* @__PURE__ */ h(
1173
1173
  "div",
1174
1174
  {
1175
1175
  className: `relative rounded-lg p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1176
1176
  onDragOver: M,
1177
- onDragLeave: j,
1177
+ onDragLeave: D,
1178
1178
  onDrop: U,
1179
1179
  children: [
1180
1180
  /* @__PURE__ */ e(
@@ -1242,7 +1242,7 @@ const pa = ({
1242
1242
  }
1243
1243
  )
1244
1244
  ] }, x);
1245
- }, Pe = ({ src: o, alt: l = "preview", isOpen: t, setIsOpen: s }) => {
1245
+ }, Pe = ({ src: n, alt: o = "preview", isOpen: t, setIsOpen: s }) => {
1246
1246
  const i = () => s(!1);
1247
1247
  return K(() => {
1248
1248
  const d = (r) => {
@@ -1251,7 +1251,7 @@ const pa = ({
1251
1251
  return t && (document.body.style.overflow = "hidden", document.addEventListener("keydown", d)), () => {
1252
1252
  document.body.style.overflow = "", document.removeEventListener("keydown", d);
1253
1253
  };
1254
- }, [t]), /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h(
1254
+ }, [t]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h(
1255
1255
  "div",
1256
1256
  {
1257
1257
  className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
@@ -1275,8 +1275,8 @@ const pa = ({
1275
1275
  children: /* @__PURE__ */ e(
1276
1276
  "img",
1277
1277
  {
1278
- src: o,
1279
- alt: l,
1278
+ src: n,
1279
+ alt: o,
1280
1280
  className: "w-full max-h-[90vh] object-contain rounded-xl"
1281
1281
  }
1282
1282
  )
@@ -1285,12 +1285,12 @@ const pa = ({
1285
1285
  ]
1286
1286
  }
1287
1287
  ) });
1288
- }, He = ({ col: o, data: l }) => {
1289
- let t = l[o.titleKey], s = l[o.subtitleKey], i = l[o.imageKey], d = o.fallback_icon;
1288
+ }, He = ({ col: n, data: o }) => {
1289
+ let t = o[n.titleKey], s = o[n.subtitleKey], i = o[n.imageKey], d = n.fallback_icon;
1290
1290
  const [r, x] = C(null), [S, c] = C(!1), b = (u) => {
1291
1291
  u && u.src instanceof File && (u = { ...u, src: URL.createObjectURL(u.src) }), x(u), c(!0);
1292
1292
  };
1293
- return /* @__PURE__ */ h(D, { children: [
1293
+ return /* @__PURE__ */ h(j, { children: [
1294
1294
  S && /* @__PURE__ */ e(
1295
1295
  Pe,
1296
1296
  {
@@ -1305,7 +1305,7 @@ const pa = ({
1305
1305
  {
1306
1306
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
1307
1307
  bg-gray-100 dark:bg-gray-900
1308
- ${o.blockClass}`,
1308
+ ${n.blockClass}`,
1309
1309
  children: [
1310
1310
  i ? /* @__PURE__ */ e(
1311
1311
  "img",
@@ -1315,7 +1315,7 @@ const pa = ({
1315
1315
  onClick: () => b({ src: i, alt: t }),
1316
1316
  className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
1317
1317
  }
1318
- ) : d ? d instanceof Function ? d(l) : d : /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ae, { className: "w-8 h-8 text-gray-400" }) }),
1318
+ ) : d ? d instanceof Function ? d(o) : d : /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ae, { className: "w-8 h-8 text-gray-400" }) }),
1319
1319
  /* @__PURE__ */ h("div", { children: [
1320
1320
  /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: t }),
1321
1321
  /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: s })
@@ -1324,12 +1324,12 @@ const pa = ({
1324
1324
  }
1325
1325
  )
1326
1326
  ] });
1327
- }, Ye = ({ col: o, data: l }) => {
1328
- let t = l[o.titleKey], s = l[o.subtitleKey], i = l[o.imageKey], d = o.label, r = o == null ? void 0 : o.icon, x = o.fallback_icon;
1329
- const [S, c] = C(null), [b, u] = C(!1), w = (f) => {
1327
+ }, Ye = ({ col: n, data: o }) => {
1328
+ let t = o[n.titleKey], s = o[n.subtitleKey], i = o[n.imageKey], d = n.label, r = n == null ? void 0 : n.icon, x = n.fallback_icon;
1329
+ const [S, c] = C(null), [b, u] = C(!1), k = (f) => {
1330
1330
  f && f.src instanceof File && (f = { ...f, src: URL.createObjectURL(f.src) }), c(f), u(!0);
1331
1331
  };
1332
- return /* @__PURE__ */ h(D, { children: [
1332
+ return /* @__PURE__ */ h(j, { children: [
1333
1333
  b && /* @__PURE__ */ e(
1334
1334
  Pe,
1335
1335
  {
@@ -1344,7 +1344,7 @@ const pa = ({
1344
1344
  {
1345
1345
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
1346
1346
  bg-gray-100 dark:bg-gray-900
1347
- ${o.blockClass}`,
1347
+ ${n.blockClass}`,
1348
1348
  children: [
1349
1349
  r && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: r }),
1350
1350
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
@@ -1355,10 +1355,10 @@ const pa = ({
1355
1355
  {
1356
1356
  src: i instanceof File ? URL.createObjectURL(i) : i,
1357
1357
  alt: t,
1358
- onClick: () => w({ src: i, alt: t }),
1358
+ onClick: () => k({ src: i, alt: t }),
1359
1359
  className: "w-8 h-8 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
1360
1360
  }
1361
- ) : x ? x instanceof Function ? x(l) : x : /* @__PURE__ */ e("div", { className: "w-8 h-8 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ae, { className: "w-6 h-6 text-gray-400" }) }),
1361
+ ) : x ? x instanceof Function ? x(o) : x : /* @__PURE__ */ e("div", { className: "w-8 h-8 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Ae, { className: "w-6 h-6 text-gray-400" }) }),
1362
1362
  /* @__PURE__ */ h("div", { className: "ml-2", children: [
1363
1363
  /* @__PURE__ */ e("p", { className: "mb-0 text-sm text-gray-900 dark:text-white break-words", children: t }),
1364
1364
  /* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-gray-400", children: s })
@@ -1403,13 +1403,13 @@ const pa = ({
1403
1403
  outline: "border !bg-transparent",
1404
1404
  soft: "bg opacity-90"
1405
1405
  }, Ve = ({
1406
- label: o,
1407
- variant: l = "contained",
1406
+ label: n,
1407
+ variant: o = "contained",
1408
1408
  // contained | outline | soft
1409
1409
  color: t = "green",
1410
1410
  className: s = ""
1411
1411
  }) => {
1412
- const i = Be[t] || Be.green, d = Ue[l] || Ue.contained, r = l === "outline" ? i.border : i.bg;
1412
+ const i = Be[t] || Be.green, d = Ue[o] || Ue.contained, r = o === "outline" ? i.border : i.bg;
1413
1413
  return /* @__PURE__ */ e(
1414
1414
  "span",
1415
1415
  {
@@ -1417,21 +1417,21 @@ const pa = ({
1417
1417
  ${r}
1418
1418
  ${d}
1419
1419
  ${s}`,
1420
- children: o
1420
+ children: n
1421
1421
  }
1422
1422
  );
1423
- }, We = ({ col: o, data: l }) => {
1423
+ }, We = ({ col: n, data: o }) => {
1424
1424
  var S;
1425
- let t = o == null ? void 0 : o.icon, s = o.label, i = l[o.key], d = o.type, r = o.variant || "outline", x = o.defaultColor;
1426
- if (d === "chip" && ((S = o.chipOptions) == null ? void 0 : S.length) > 0) {
1427
- let c = o == null ? void 0 : o.chipOptions.find((b) => b.value == i);
1425
+ let t = n == null ? void 0 : n.icon, s = n.label, i = o[n.key], d = n.type, r = n.variant || "outline", x = n.defaultColor;
1426
+ if (d === "chip" && ((S = n.chipOptions) == null ? void 0 : S.length) > 0) {
1427
+ let c = n == null ? void 0 : n.chipOptions.find((b) => b.value == i);
1428
1428
  c && (i = c.label, x = c.color);
1429
1429
  }
1430
1430
  return /* @__PURE__ */ h(
1431
1431
  "div",
1432
1432
  {
1433
1433
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
1434
- bg-gray-100 dark:bg-gray-900 ${o.blockClass || ""}`,
1434
+ bg-gray-100 dark:bg-gray-900 ${n.blockClass || ""}`,
1435
1435
  children: [
1436
1436
  t && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: t }),
1437
1437
  /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
@@ -1465,16 +1465,16 @@ const pa = ({
1465
1465
  i instanceof File ? URL.createObjectURL(i) : i
1466
1466
  ) : /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-400", children: "N/A" }) : (
1467
1467
  /* DEFAULT */
1468
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: d == "date" ? /* @__PURE__ */ e("span", { children: Ge(i, o.format || "DD MMM YYYY") }) : i || "N/A" })
1468
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: d == "date" ? /* @__PURE__ */ e("span", { children: Ge(i, n.format || "DD MMM YYYY") }) : i || "N/A" })
1469
1469
  )
1470
1470
  )
1471
1471
  ] })
1472
1472
  ]
1473
1473
  }
1474
1474
  );
1475
- }, fa = ({
1476
- value: o = !0,
1477
- onChange: l,
1475
+ }, ya = ({
1476
+ value: n = !0,
1477
+ onChange: o,
1478
1478
  text: t,
1479
1479
  options: s = [],
1480
1480
  label: i,
@@ -1487,7 +1487,7 @@ const pa = ({
1487
1487
  { label: "Active", value: !0 },
1488
1488
  { label: "Inactive", value: !1 }
1489
1489
  ];
1490
- return /* @__PURE__ */ e(D, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
1490
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
1491
1491
  /* @__PURE__ */ e(q, { label: i, required: d }),
1492
1492
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
1493
1493
  t && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: t }),
@@ -1504,8 +1504,8 @@ const pa = ({
1504
1504
  required: d && u === 0,
1505
1505
  value: b.value,
1506
1506
  disabled: x,
1507
- checked: o === b.value,
1508
- onChange: () => l(b.value),
1507
+ checked: n === b.value,
1508
+ onChange: () => o(b.value),
1509
1509
  className: "w-4 h-4 border-gray-300 cursor-pointer"
1510
1510
  }
1511
1511
  ),
@@ -1516,7 +1516,7 @@ const pa = ({
1516
1516
  )) })
1517
1517
  ] })
1518
1518
  ] }, r) });
1519
- }, qe = ({ field: o, formData: l, handleChange: t }) => {
1519
+ }, qe = ({ field: n, formData: o, handleChange: t }) => {
1520
1520
  const {
1521
1521
  key: s,
1522
1522
  label: i,
@@ -1527,13 +1527,13 @@ const pa = ({
1527
1527
  inputClass: c,
1528
1528
  search: b,
1529
1529
  accept: u,
1530
- text: w,
1530
+ text: k,
1531
1531
  required: f = !1,
1532
1532
  minLength: g,
1533
1533
  dragDrop: N,
1534
1534
  parentClass: y,
1535
1535
  countriesList: M,
1536
- defaultCountry: j,
1536
+ defaultCountry: D,
1537
1537
  multiple: U,
1538
1538
  dropdownMaxHeight: L,
1539
1539
  editorKey: O,
@@ -1545,29 +1545,29 @@ const pa = ({
1545
1545
  optionDependencyKey: _,
1546
1546
  pattern: J,
1547
1547
  renderType: Z
1548
- } = o;
1549
- let A = l == null ? void 0 : l[s];
1548
+ } = n;
1549
+ let A = o == null ? void 0 : o[s];
1550
1550
  A == null && (A = "");
1551
1551
  const z = x || (d === "select" ? `Select ${i}` : `Enter ${i}`), V = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1552
- if (G && typeof G == "function" && !G(l))
1552
+ if (G && typeof G == "function" && !G(o))
1553
1553
  return null;
1554
1554
  if (Z && Z == "details")
1555
1555
  switch (d) {
1556
1556
  case "group":
1557
- return /* @__PURE__ */ e(He, { col: o, data: l });
1557
+ return /* @__PURE__ */ e(He, { col: n, data: o });
1558
1558
  case "cardGroup":
1559
- return /* @__PURE__ */ e(Ye, { col: o, data: l });
1559
+ return /* @__PURE__ */ e(Ye, { col: n, data: o });
1560
1560
  default:
1561
- return /* @__PURE__ */ e(We, { col: o, data: l });
1561
+ return /* @__PURE__ */ e(We, { col: n, data: o });
1562
1562
  }
1563
1563
  switch (d) {
1564
1564
  case "select":
1565
1565
  return /* @__PURE__ */ e(
1566
- ua,
1566
+ ha,
1567
1567
  {
1568
1568
  options: r || [],
1569
1569
  value: A,
1570
- formData: l,
1570
+ formData: o,
1571
1571
  dependencyKey: _,
1572
1572
  onChange: (I) => t(s, I),
1573
1573
  placeholder: z,
@@ -1585,7 +1585,7 @@ const pa = ({
1585
1585
  );
1586
1586
  case "checkbox":
1587
1587
  return /* @__PURE__ */ e(
1588
- ga,
1588
+ ma,
1589
1589
  {
1590
1590
  name: s,
1591
1591
  label: i,
@@ -1601,11 +1601,11 @@ const pa = ({
1601
1601
  );
1602
1602
  case "radio":
1603
1603
  return /* @__PURE__ */ e(
1604
- fa,
1604
+ ya,
1605
1605
  {
1606
1606
  value: A,
1607
1607
  onChange: (I) => t(s, I),
1608
- text: w,
1608
+ text: k,
1609
1609
  options: r || [],
1610
1610
  label: i,
1611
1611
  required: f,
@@ -1620,7 +1620,7 @@ const pa = ({
1620
1620
  {
1621
1621
  value: A,
1622
1622
  onChange: (I) => t(s, I),
1623
- text: w,
1623
+ text: k,
1624
1624
  options: r || [],
1625
1625
  label: i,
1626
1626
  required: f,
@@ -1631,12 +1631,12 @@ const pa = ({
1631
1631
  );
1632
1632
  case "phone":
1633
1633
  return /* @__PURE__ */ e(
1634
- ha,
1634
+ ba,
1635
1635
  {
1636
1636
  value: A,
1637
1637
  onChange: (I) => t(s, I),
1638
1638
  countriesList: M,
1639
- defaultCountry: j,
1639
+ defaultCountry: D,
1640
1640
  required: f,
1641
1641
  placeholder: z,
1642
1642
  search: b,
@@ -1664,7 +1664,7 @@ const pa = ({
1664
1664
  );
1665
1665
  case "image":
1666
1666
  return /* @__PURE__ */ e(
1667
- ba,
1667
+ pa,
1668
1668
  {
1669
1669
  value: A,
1670
1670
  onChange: (I) => t(s, I),
@@ -1679,7 +1679,7 @@ const pa = ({
1679
1679
  );
1680
1680
  case "audio":
1681
1681
  return /* @__PURE__ */ e(
1682
- ma,
1682
+ fa,
1683
1683
  {
1684
1684
  value: A,
1685
1685
  onChange: (I) => t(s, I),
@@ -1694,7 +1694,7 @@ const pa = ({
1694
1694
  );
1695
1695
  case "tinyEditor":
1696
1696
  return /* @__PURE__ */ e(
1697
- pa,
1697
+ ga,
1698
1698
  {
1699
1699
  value: A,
1700
1700
  onChange: (I) => t(s, I),
@@ -1712,7 +1712,7 @@ const pa = ({
1712
1712
  return /* @__PURE__ */ e(
1713
1713
  ze,
1714
1714
  {
1715
- field: o,
1715
+ field: n,
1716
1716
  type: d || "text",
1717
1717
  defaultValue: B,
1718
1718
  value: A,
@@ -1730,21 +1730,21 @@ const pa = ({
1730
1730
  }
1731
1731
  );
1732
1732
  }
1733
- }, ya = ({ isOpen: o, onClose: l, config: t, onApply: s }) => {
1733
+ }, xa = ({ isOpen: n, onClose: o, config: t, onApply: s }) => {
1734
1734
  var c;
1735
1735
  const [i, d] = C({}), r = (b, u) => {
1736
- d((w) => ({ ...w, [b]: u }));
1736
+ d((k) => ({ ...k, [b]: u }));
1737
1737
  }, x = () => {
1738
- s == null || s(i), l();
1738
+ s == null || s(i), o();
1739
1739
  }, S = () => {
1740
- d({}), s == null || s({}), l();
1740
+ d({}), s == null || s({}), o();
1741
1741
  };
1742
- return /* @__PURE__ */ h(D, { children: [
1742
+ return /* @__PURE__ */ h(j, { children: [
1743
1743
  /* @__PURE__ */ e(
1744
1744
  "div",
1745
1745
  {
1746
- className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${o ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1747
- onClick: l
1746
+ className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${n ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1747
+ onClick: o
1748
1748
  }
1749
1749
  ),
1750
1750
  /* @__PURE__ */ h(
@@ -1752,7 +1752,7 @@ const pa = ({
1752
1752
  {
1753
1753
  className: `fixed top-0 right-0 h-full w-[28rem] bg-white dark:bg-gray-900 shadow-2xl z-50 flex flex-col border-l border-gray-200 dark:border-gray-700
1754
1754
  transform transition-transform duration-300 ease-in-out
1755
- ${o ? "translate-x-0" : "translate-x-full"}
1755
+ ${n ? "translate-x-0" : "translate-x-full"}
1756
1756
  `,
1757
1757
  children: [
1758
1758
  /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
@@ -1760,19 +1760,19 @@ const pa = ({
1760
1760
  /* @__PURE__ */ e(
1761
1761
  "button",
1762
1762
  {
1763
- onClick: l,
1763
+ onClick: o,
1764
1764
  className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
1765
1765
  children: /* @__PURE__ */ e(Le, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1766
1766
  }
1767
1767
  )
1768
1768
  ] }),
1769
- o && /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: t != null && t.component ? /* @__PURE__ */ e(
1769
+ n && /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: t != null && t.component ? /* @__PURE__ */ e(
1770
1770
  t.component,
1771
1771
  {
1772
1772
  filters: i,
1773
1773
  onFilterChange: r
1774
1774
  }
1775
- ) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (c = t == null ? void 0 : t.fields) == null ? void 0 : c.map((b) => /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
1775
+ ) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (c = t == null ? void 0 : t.fields) == null ? void 0 : c.map((b) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1776
1776
  qe,
1777
1777
  {
1778
1778
  field: b,
@@ -1806,22 +1806,22 @@ const pa = ({
1806
1806
  }
1807
1807
  )
1808
1808
  ] });
1809
- }, xa = ({ rows: o = 5, columns: l = 5 }) => /* @__PURE__ */ h(D, { children: [
1809
+ }, va = ({ rows: n = 5, columns: o = 5 }) => /* @__PURE__ */ h(j, { children: [
1810
1810
  /* @__PURE__ */ e("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
1811
1811
  /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ h("table", { className: "w-full border-collapse", children: [
1812
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: l }).map((t, s) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, s)) }) }),
1813
- /* @__PURE__ */ e("tbody", { children: Array.from({ length: o }).map((t, s) => /* @__PURE__ */ e(
1812
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((t, s) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, s)) }) }),
1813
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: n }).map((t, s) => /* @__PURE__ */ e(
1814
1814
  "tr",
1815
1815
  {
1816
1816
  className: "border-t border-gray-200 dark:border-gray-800",
1817
- children: Array.from({ length: l }).map((i, d) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, d))
1817
+ children: Array.from({ length: o }).map((i, d) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, d))
1818
1818
  },
1819
1819
  s
1820
1820
  )) })
1821
1821
  ] }) })
1822
- ] }), va = ({
1823
- config: o,
1824
- setShowAdd: l,
1822
+ ] }), ka = ({
1823
+ config: n,
1824
+ setShowAdd: o,
1825
1825
  title: t,
1826
1826
  buttonText: s,
1827
1827
  description: i,
@@ -1845,18 +1845,18 @@ const pa = ({
1845
1845
  rows_per_page: 10,
1846
1846
  useServerSidePagination: !1
1847
1847
  },
1848
- emptyMessage: w = "No data available",
1848
+ emptyMessage: k = "No data available",
1849
1849
  onMenuAction: f,
1850
1850
  setServerSidePaginationData: g = () => {
1851
1851
  },
1852
1852
  onFilterApply: N,
1853
1853
  filterConfig: y = null,
1854
1854
  rowClick: M = null
1855
- } = o, [j, U] = C(""), [L, O] = C(null), [E, F] = C([]), [T, B] = C({}), [G, _] = C(!1), [J, Z] = C({}), [A, z] = C(null), [V, I] = C(!1), k = Fe(() => !c.enabled || !j.trim() || c.useServerSideSearch ? r : ca(r, j, c.searchKeys || []), [r, j, c]), [P, W] = C(1), [H, ae] = C((u == null ? void 0 : u.rows_per_page) || 50), [ee, Re] = C(k.length || 0), le = u != null && u.useServerSidePagination ? u.total_pages : Math.ceil(k.length / H), ue = Fe(() => {
1856
- if (u.useServerSidePagination) return k;
1855
+ } = n, [D, U] = C(""), [L, O] = C(null), [E, F] = C([]), [T, B] = C({}), [G, _] = C(!1), [J, Z] = C({}), [A, z] = C(null), [V, I] = C(!1), w = Fe(() => !c.enabled || !D.trim() || c.useServerSideSearch ? r : ua(r, D, c.searchKeys || []), [r, D, c]), [P, W] = C(1), [H, ae] = C((u == null ? void 0 : u.rows_per_page) || 50), [ee, Re] = C(w.length || 0), le = u != null && u.useServerSidePagination ? u.total_pages : Math.ceil(w.length / H), ue = Fe(() => {
1856
+ if (u.useServerSidePagination) return w;
1857
1857
  const a = (P - 1) * H;
1858
- return k.slice(a, a + H);
1859
- }, [k, P, H]), re = X(null), oe = X({}), te = X(null), he = (a) => {
1858
+ return w.slice(a, a + H);
1859
+ }, [w, P, H]), re = X(null), oe = X({}), te = X(null), he = (a) => {
1860
1860
  U(a), W(1), c.useServerSideSearch && (te.current && clearTimeout(te.current), te.current = setTimeout(async () => {
1861
1861
  try {
1862
1862
  await g((m) => ({
@@ -1881,7 +1881,7 @@ const pa = ({
1881
1881
  }), O(L === a ? null : a);
1882
1882
  }, ge = (a) => (P - 1) * H + a + 1, me = (a) => {
1883
1883
  a && a.src instanceof File && (a = { ...a, src: URL.createObjectURL(a.src) }), z(a), I(!0);
1884
- }, ie = (a, m, p, v = null, R = null) => /* @__PURE__ */ e(D, { children: a ? /* @__PURE__ */ e(
1884
+ }, ie = (a, m, p, v = null, R = null) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1885
1885
  "img",
1886
1886
  {
1887
1887
  src: a instanceof File ? URL.createObjectURL(a) : a,
@@ -1891,13 +1891,13 @@ const pa = ({
1891
1891
  },
1892
1892
  className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${p || ""}`
1893
1893
  }
1894
- ) : /* @__PURE__ */ e(D, { children: v ? typeof v == "function" ? v(R) : v : /* @__PURE__ */ e(
1894
+ ) : /* @__PURE__ */ e(j, { children: v ? typeof v == "function" ? v(R) : v : /* @__PURE__ */ e(
1895
1895
  "div",
1896
1896
  {
1897
1897
  className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${p || ""}`,
1898
1898
  children: /* @__PURE__ */ e(Ae, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1899
1899
  }
1900
- ) }) }), fe = (a, m) => /* @__PURE__ */ e(D, { children: a ? /* @__PURE__ */ e(
1900
+ ) }) }), fe = (a, m) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1901
1901
  "audio",
1902
1902
  {
1903
1903
  controls: !0,
@@ -1908,7 +1908,7 @@ const pa = ({
1908
1908
  className: `w-64 cursor-pointer ${m || ""}`
1909
1909
  },
1910
1910
  a instanceof File ? URL.createObjectURL(a) : a
1911
- ) : /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
1911
+ ) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1912
1912
  "div",
1913
1913
  {
1914
1914
  className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${m || ""}`,
@@ -1954,19 +1954,19 @@ const pa = ({
1954
1954
  className: "p-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-full transition text-gray-700 dark:text-gray-300",
1955
1955
  children: /* @__PURE__ */ e(la, { className: "h-4 w-4" })
1956
1956
  }
1957
- ) }) : a.type === "index" ? /* @__PURE__ */ e("span", { className: a.className || "", children: ge(p) }) : a.type === "group" ? ye(m, a) : a.type === "chip" ? /* @__PURE__ */ e(D, { children: xe(v, a) }) : a.type === "date" ? /* @__PURE__ */ e("span", { className: a.className || "", children: Ge(v, a.format || "DD MMM YYYY") }) : a.type === "avatar" ? /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ie(
1957
+ ) }) : a.type === "index" ? /* @__PURE__ */ e("span", { className: a.className || "", children: ge(p) }) : a.type === "group" ? ye(m, a) : a.type === "chip" ? /* @__PURE__ */ e(j, { children: xe(v, a) }) : a.type === "date" ? /* @__PURE__ */ e("span", { className: a.className || "", children: Ge(v, a.format || "DD MMM YYYY") }) : a.type === "avatar" ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ie(
1958
1958
  v,
1959
1959
  a.alt,
1960
1960
  a.className,
1961
1961
  a.fallback_icon,
1962
1962
  m
1963
- ) }) }) : a.type === "audio" ? /* @__PURE__ */ e(D, { children: fe(v, a.className) }) : /* @__PURE__ */ e("span", { className: a.className || "", children: v || "N/A" });
1964
- }, we = (a) => {
1963
+ ) }) }) : a.type === "audio" ? /* @__PURE__ */ e(j, { children: fe(v, a.className) }) : /* @__PURE__ */ e("span", { className: a.className || "", children: v || "N/A" });
1964
+ }, ke = (a) => {
1965
1965
  if (typeof M == "function")
1966
1966
  return M(a);
1967
1967
  if (M)
1968
1968
  return f == null ? void 0 : f("view", a);
1969
- }, ke = (a, m) => {
1969
+ }, we = (a, m) => {
1970
1970
  if (a.onClickDetails)
1971
1971
  return f == null ? void 0 : f("view", m);
1972
1972
  if (typeof a.handleClick == "function")
@@ -1992,14 +1992,14 @@ const pa = ({
1992
1992
  u.current_page
1993
1993
  ]), K(() => {
1994
1994
  Re(
1995
- u != null && u.useServerSidePagination ? u.total_records : k.length
1996
- ), k.length <= H * (P - 1) && !(u != null && u.useServerSidePagination) && W((a) => a - 1 || 1);
1995
+ u != null && u.useServerSidePagination ? u.total_records : w.length
1996
+ ), w.length <= H * (P - 1) && !(u != null && u.useServerSidePagination) && W((a) => a - 1 || 1);
1997
1997
  }, [
1998
- k.length,
1998
+ w.length,
1999
1999
  u.total_records,
2000
2000
  u == null ? void 0 : u.useServerSidePagination
2001
- ]), /* @__PURE__ */ h(D, { children: [
2002
- S ? /* @__PURE__ */ e(xa, { rows: 6, columns: 6 }) : /* @__PURE__ */ h(D, { children: [
2001
+ ]), /* @__PURE__ */ h(j, { children: [
2002
+ S ? /* @__PURE__ */ e(va, { rows: 6, columns: 6 }) : /* @__PURE__ */ h(j, { children: [
2003
2003
  /* @__PURE__ */ h("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
2004
2004
  /* @__PURE__ */ h("div", { children: [
2005
2005
  /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: t }),
@@ -2009,7 +2009,7 @@ const pa = ({
2009
2009
  d && /* @__PURE__ */ h(
2010
2010
  Q,
2011
2011
  {
2012
- onClick: () => l(!0),
2012
+ onClick: () => o(!0),
2013
2013
  variant: "contained",
2014
2014
  color: "primary",
2015
2015
  children: [
@@ -2026,7 +2026,7 @@ const pa = ({
2026
2026
  {
2027
2027
  type: "text",
2028
2028
  placeholder: c.placeholder || "Search...",
2029
- value: j,
2029
+ value: D,
2030
2030
  onChange: (a) => he(a.target.value),
2031
2031
  className: "w-full h-[36px] pl-9 pr-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-300 dark:ring-blue-200 disabled:opacity-50"
2032
2032
  }
@@ -2065,14 +2065,14 @@ const pa = ({
2065
2065
  {
2066
2066
  colSpan: x.length,
2067
2067
  className: "text-center py-10 text-gray-500 dark:text-gray-400",
2068
- children: w
2068
+ children: k
2069
2069
  }
2070
2070
  ) }) : ue.map((a, m) => /* @__PURE__ */ e(
2071
2071
  "tr",
2072
2072
  {
2073
2073
  className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${se() ? "cursor-pointer" : ""}`,
2074
2074
  onClick: (p) => {
2075
- se() && we(a);
2075
+ se() && ke(a);
2076
2076
  },
2077
2077
  children: x.map((p) => /* @__PURE__ */ e(
2078
2078
  "td",
@@ -2080,7 +2080,7 @@ const pa = ({
2080
2080
  className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${p.type == "audio" ? "" : "max-w-[300px]"} truncate ${de(p) ? "cursor-pointer" : ""}`,
2081
2081
  title: String(a[p.key] ?? ""),
2082
2082
  onClick: (v) => {
2083
- de(p) && (v.stopPropagation(), v.preventDefault(), ke(p, a));
2083
+ de(p) && (v.stopPropagation(), v.preventDefault(), we(p, a));
2084
2084
  },
2085
2085
  children: p.render ? p.render(a, m) : ve(p, a, m)
2086
2086
  },
@@ -2090,7 +2090,7 @@ const pa = ({
2090
2090
  a.id || a._id || m
2091
2091
  )) })
2092
2092
  ] }) }),
2093
- (u == null ? void 0 : u.enabled) && k.length > 0 && /* @__PURE__ */ h("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
2093
+ (u == null ? void 0 : u.enabled) && w.length > 0 && /* @__PURE__ */ h("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
2094
2094
  /* @__PURE__ */ h("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
2095
2095
  "Showing ",
2096
2096
  (P - 1) * H + 1,
@@ -2203,7 +2203,7 @@ const pa = ({
2203
2203
  document.body
2204
2204
  ),
2205
2205
  y && /* @__PURE__ */ e(
2206
- ya,
2206
+ xa,
2207
2207
  {
2208
2208
  isOpen: G,
2209
2209
  onClose: () => _(!1),
@@ -2224,8 +2224,8 @@ const pa = ({
2224
2224
  )
2225
2225
  ] });
2226
2226
  }, Ce = ({
2227
- isOpen: o,
2228
- onClose: l,
2227
+ isOpen: n,
2228
+ onClose: o,
2229
2229
  icon: t,
2230
2230
  title: s,
2231
2231
  children: i,
@@ -2237,13 +2237,13 @@ const pa = ({
2237
2237
  hideFooter: b = !1,
2238
2238
  onFormSubmit: u = () => {
2239
2239
  },
2240
- onCancel: w,
2240
+ onCancel: k,
2241
2241
  loadingBtn: f = !1,
2242
2242
  executeFunction: g = () => {
2243
2243
  },
2244
2244
  selectedItem: N = null
2245
2245
  }) => {
2246
- if (!o) return null;
2246
+ if (!n) return null;
2247
2247
  const y = {
2248
2248
  sm: "max-w-md",
2249
2249
  md: "max-w-lg",
@@ -2256,7 +2256,7 @@ const pa = ({
2256
2256
  "div",
2257
2257
  {
2258
2258
  className: "fixed inset-0 bg-gray-500 opacity-75",
2259
- onClick: () => l()
2259
+ onClick: () => o()
2260
2260
  }
2261
2261
  ),
2262
2262
  /* @__PURE__ */ h(
@@ -2272,7 +2272,7 @@ const pa = ({
2272
2272
  /* @__PURE__ */ e(
2273
2273
  "button",
2274
2274
  {
2275
- onClick: () => l(),
2275
+ onClick: () => o(),
2276
2276
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
2277
2277
  children: /* @__PURE__ */ e(Le, { className: "w-6 h-6" })
2278
2278
  }
@@ -2282,13 +2282,13 @@ const pa = ({
2282
2282
  r.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: r.map((M) => /* @__PURE__ */ e(
2283
2283
  Q,
2284
2284
  {
2285
- onClick: (j) => {
2286
- M.type == "submit" ? u(j) : g(
2285
+ onClick: (D) => {
2286
+ M.type == "submit" ? u(D) : g(
2287
2287
  () => {
2288
2288
  var U;
2289
- return (U = M == null ? void 0 : M.onClick) == null ? void 0 : U.call(M, j, N);
2289
+ return (U = M == null ? void 0 : M.onClick) == null ? void 0 : U.call(M, D, N);
2290
2290
  },
2291
- (U) => l == null ? void 0 : l(U)
2291
+ (U) => o == null ? void 0 : o(U)
2292
2292
  );
2293
2293
  },
2294
2294
  disabled: f || M.disabled,
@@ -2308,13 +2308,13 @@ const pa = ({
2308
2308
  )
2309
2309
  ] });
2310
2310
  }, Ee = ({
2311
- config: o,
2312
- onSubmit: l,
2311
+ config: n,
2312
+ onSubmit: o,
2313
2313
  initialData: t = {},
2314
2314
  fetchRowDetails: s,
2315
2315
  type: i = "add"
2316
2316
  }) => {
2317
- const { formClass: d = "grid grid-cols-12 gap-4", formFields: r = [] } = o || {}, [x, S] = C(t), [c, b] = C(!0), u = async () => {
2317
+ const { formClass: d = "grid grid-cols-12 gap-4", formFields: r = [] } = n || {}, [x, S] = C(t), [c, b] = C(!0), u = async () => {
2318
2318
  s == null || s(t).then((g) => {
2319
2319
  S(g.data);
2320
2320
  }).catch((g) => {
@@ -2326,7 +2326,7 @@ const pa = ({
2326
2326
  K(() => {
2327
2327
  s instanceof Function ? u() : (S(t), b(!1));
2328
2328
  }, []);
2329
- const w = (g, N) => {
2329
+ const k = (g, N) => {
2330
2330
  S((y) => ({ ...y, [g]: N }));
2331
2331
  }, f = (g) => {
2332
2332
  g.preventDefault();
@@ -2335,7 +2335,7 @@ const pa = ({
2335
2335
  N.reportValidity();
2336
2336
  return;
2337
2337
  }
2338
- l(x);
2338
+ o(x);
2339
2339
  };
2340
2340
  return c ? (
2341
2341
  // spinner loader
@@ -2355,21 +2355,21 @@ const pa = ({
2355
2355
  onSubmit: f,
2356
2356
  className: d,
2357
2357
  noValidate: !1,
2358
- children: r.map((g) => /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
2358
+ children: r.map((g) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
2359
2359
  qe,
2360
2360
  {
2361
2361
  field: g,
2362
2362
  formData: x,
2363
- handleChange: w
2363
+ handleChange: k
2364
2364
  },
2365
2365
  g.key
2366
2366
  ) }))
2367
2367
  }
2368
2368
  );
2369
2369
  };
2370
- function wa({ data: o, config: l, fetchRowDetails: t }) {
2371
- const { fields: s, containerClass: i } = l, [d, r] = C(o), [x, S] = C(!0), c = async () => {
2372
- t == null || t(o).then((b) => {
2370
+ function wa({ data: n, config: o, fetchRowDetails: t }) {
2371
+ const { fields: s, containerClass: i } = o, [d, r] = C(n), [x, S] = C(!0), c = async () => {
2372
+ t == null || t(n).then((b) => {
2373
2373
  r(b.data);
2374
2374
  }).catch((b) => {
2375
2375
  ce(b.message, { variant: "error" });
@@ -2378,7 +2378,7 @@ function wa({ data: o, config: l, fetchRowDetails: t }) {
2378
2378
  });
2379
2379
  };
2380
2380
  return K(() => {
2381
- t instanceof Function ? c() : (r(o), S(!1));
2381
+ t instanceof Function ? c() : (r(n), S(!1));
2382
2382
  }, []), x ? (
2383
2383
  // spinner loader
2384
2384
  /* @__PURE__ */ e("div", { className: "flex items-center justify-center h-64", children: /* @__PURE__ */ e(
@@ -2390,12 +2390,12 @@ function wa({ data: o, config: l, fetchRowDetails: t }) {
2390
2390
  }
2391
2391
  }
2392
2392
  ) })
2393
- ) : /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: s.map((b) => b.renderCondition && typeof b.renderCondition == "function" && !b.renderCondition(d) ? null : b.type == "group" ? /* @__PURE__ */ e(He, { col: b, data: d }) : b.type == "cardGroup" ? /* @__PURE__ */ e(Ye, { col: b, data: d }) : /* @__PURE__ */ e(We, { col: b, data: d })) }) });
2393
+ ) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: s.map((b) => b.renderCondition && typeof b.renderCondition == "function" && !b.renderCondition(d) ? null : b.type == "group" ? /* @__PURE__ */ e(He, { col: b, data: d }) : b.type == "cardGroup" ? /* @__PURE__ */ e(Ye, { col: b, data: d }) : /* @__PURE__ */ e(We, { col: b, data: d })) }) });
2394
2394
  }
2395
- const Ze = ({ config: o }) => {
2396
- var re, oe, te, he, be, pe, ge, me, ie, fe, ye, xe, ve, we, ke, se, de, a, m;
2395
+ const Ze = ({ config: n }) => {
2396
+ var re, oe, te, he, be, pe, ge, me, ie, fe, ye, xe, ve, ke, we, se, de, a, m;
2397
2397
  const {
2398
- title: l,
2398
+ title: o,
2399
2399
  fetchData: t = async () => {
2400
2400
  },
2401
2401
  fetchRowDetails: s = null,
@@ -2403,11 +2403,11 @@ const Ze = ({ config: o }) => {
2403
2403
  tableConfig: d = {},
2404
2404
  modalConfig: r = {},
2405
2405
  filterConfig: x
2406
- } = o, [S, c] = C(!0), [b, u] = C(!1), [w, f] = C([]), [g, N] = C(null), [y, M] = C({
2406
+ } = n, [S, c] = C(!0), [b, u] = C(!1), [k, f] = C([]), [g, N] = C(null), [y, M] = C({
2407
2407
  search: "",
2408
2408
  rows_per_page: 50,
2409
2409
  current_page: 1
2410
- }), [j, U] = C({}), [L, O] = C(!1), [E, F] = C(!1), [T, B] = C(!1), [G, _] = C(!1), [J, Z] = C(!1), [A, z] = C(null), V = (p, v) => {
2410
+ }), [D, U] = C({}), [L, O] = C(!1), [E, F] = C(!1), [T, B] = C(!1), [G, _] = C(!1), [J, Z] = C(!1), [A, z] = C(null), V = (p, v) => {
2411
2411
  p === "edit" ? (z(v), B(!0)) : p === "view" ? (z(v), Z(!0)) : p === "delete" && (z(v), _(!0));
2412
2412
  }, I = async (p, v, R = "", Y = "") => {
2413
2413
  u(!0);
@@ -2421,7 +2421,7 @@ const Ze = ({ config: o }) => {
2421
2421
  } finally {
2422
2422
  u(!1);
2423
2423
  }
2424
- }, k = (p) => {
2424
+ }, w = (p) => {
2425
2425
  let v = p.newObject;
2426
2426
  i ? (f((R) => [v, ...R]), N((R) => ({
2427
2427
  ...R,
@@ -2444,7 +2444,7 @@ const Ze = ({ config: o }) => {
2444
2444
  }
2445
2445
  i ? f(
2446
2446
  (v) => v.filter((R) => R.id !== p.targetObject.id)
2447
- ) : w.length == 1 && y.current_page > 1 ? M((v) => ({
2447
+ ) : k.length == 1 && y.current_page > 1 ? M((v) => ({
2448
2448
  ...v,
2449
2449
  current_page: v.current_page - 1
2450
2450
  })) : ee(), _(!1), z(null);
@@ -2453,7 +2453,7 @@ const Ze = ({ config: o }) => {
2453
2453
  var v, R;
2454
2454
  return (R = (v = r == null ? void 0 : r.addModal) == null ? void 0 : v.handleSubmit) == null ? void 0 : R.call(v, p);
2455
2455
  },
2456
- k
2456
+ w
2457
2457
  ), ae = (p) => I(
2458
2458
  () => {
2459
2459
  var v, R;
@@ -2461,7 +2461,7 @@ const Ze = ({ config: o }) => {
2461
2461
  },
2462
2462
  P
2463
2463
  ), ee = async () => {
2464
- c(!0), t == null || t({ ...y, ...j }).then((p) => {
2464
+ c(!0), t == null || t({ ...y, ...D }).then((p) => {
2465
2465
  f(p.data), N(p.pagination);
2466
2466
  }).catch((p) => {
2467
2467
  ce(p.message, { variant: "error" });
@@ -2477,8 +2477,8 @@ const Ze = ({ config: o }) => {
2477
2477
  (R) => Object.entries(v).every(([Y, $]) => R[Y] === $)
2478
2478
  ), ue = Fe(() => {
2479
2479
  var p;
2480
- return (p = d == null ? void 0 : d.filter) != null && p.useServerSideFilters ? w : le(w, j);
2481
- }, [w, j]);
2480
+ return (p = d == null ? void 0 : d.filter) != null && p.useServerSideFilters ? k : le(k, D);
2481
+ }, [k, D]);
2482
2482
  return K(() => {
2483
2483
  ee();
2484
2484
  }, [
@@ -2486,314 +2486,322 @@ const Ze = ({ config: o }) => {
2486
2486
  y.rows_per_page,
2487
2487
  y.current_page,
2488
2488
  L
2489
- ]), /* @__PURE__ */ e(
2490
- da,
2491
- {
2492
- maxSnack: 3,
2493
- anchorOrigin: {
2494
- vertical: "bottom",
2495
- horizontal: "right"
2496
- },
2497
- autoHideDuration: 3e3,
2498
- action: (p) => /* @__PURE__ */ e(
2499
- "button",
2500
- {
2501
- onClick: () => {
2502
- window.dispatchEvent(
2503
- new CustomEvent("closeSnackbar", { detail: p })
2504
- );
2489
+ ]), /* @__PURE__ */ h("div", { children: [
2490
+ /* @__PURE__ */ e(
2491
+ ka,
2492
+ {
2493
+ title: o,
2494
+ setShowAdd: F,
2495
+ description: n.description,
2496
+ buttonText: n.buttonText,
2497
+ showAddButton: !!r.addModal,
2498
+ config: {
2499
+ ...d,
2500
+ pagination: {
2501
+ ...d.pagination,
2502
+ ...g
2505
2503
  },
2506
- className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
2507
- children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
2504
+ data: ue,
2505
+ setServerSidePaginationData: M,
2506
+ onMenuAction: V,
2507
+ filterConfig: x,
2508
+ onFilterApply: Re,
2509
+ loading: S
2508
2510
  }
2509
- ),
2510
- children: /* @__PURE__ */ h("div", { children: [
2511
- /* @__PURE__ */ e(
2512
- va,
2513
- {
2514
- title: l,
2515
- setShowAdd: F,
2516
- description: o.description,
2517
- buttonText: o.buttonText,
2518
- showAddButton: !!r.addModal,
2519
- config: {
2520
- ...d,
2521
- pagination: {
2522
- ...d.pagination,
2523
- ...g
2524
- },
2525
- data: ue,
2526
- setServerSidePaginationData: M,
2527
- onMenuAction: V,
2528
- filterConfig: x,
2529
- onFilterApply: Re,
2530
- loading: S
2531
- }
2532
- }
2533
- ),
2534
- /* @__PURE__ */ e(
2535
- Ce,
2536
- {
2537
- isOpen: E,
2538
- onClose: () => {
2539
- b || F(!1);
2540
- },
2541
- icon: (re = r.addModal) == null ? void 0 : re.icon,
2542
- title: ((oe = r.addModal) == null ? void 0 : oe.title) || "Add New",
2543
- size: ((te = r.addModal) == null ? void 0 : te.size) || "md",
2544
- onFormSubmit: () => {
2545
- var p;
2546
- return (p = document.querySelector("#addForm")) == null ? void 0 : p.requestSubmit();
2547
- },
2548
- loadingBtn: b,
2549
- actionButtons: ((he = r == null ? void 0 : r.addModal) == null ? void 0 : he.actionButtons) || [],
2550
- children: /* @__PURE__ */ e(
2551
- Ee,
2552
- {
2553
- config: (r == null ? void 0 : r.addModal) || {},
2554
- onSubmit: H,
2555
- initialData: {},
2556
- type: "add",
2557
- loading: b
2558
- }
2559
- )
2560
- }
2561
- ),
2562
- /* @__PURE__ */ e(
2563
- Ce,
2511
+ }
2512
+ ),
2513
+ /* @__PURE__ */ e(
2514
+ Ce,
2515
+ {
2516
+ isOpen: E,
2517
+ onClose: () => {
2518
+ b || F(!1);
2519
+ },
2520
+ icon: (re = r.addModal) == null ? void 0 : re.icon,
2521
+ title: ((oe = r.addModal) == null ? void 0 : oe.title) || "Add New",
2522
+ size: ((te = r.addModal) == null ? void 0 : te.size) || "md",
2523
+ onFormSubmit: () => {
2524
+ var p;
2525
+ return (p = document.querySelector("#addForm")) == null ? void 0 : p.requestSubmit();
2526
+ },
2527
+ loadingBtn: b,
2528
+ actionButtons: ((he = r == null ? void 0 : r.addModal) == null ? void 0 : he.actionButtons) || [],
2529
+ children: /* @__PURE__ */ e(
2530
+ Ee,
2564
2531
  {
2565
- isOpen: T,
2566
- onClose: () => {
2567
- b || B(!1);
2568
- },
2569
- icon: (be = r.editModal) == null ? void 0 : be.icon,
2570
- title: ((pe = r.editModal) == null ? void 0 : pe.title) || "Edit",
2571
- size: ((ge = r.editModal) == null ? void 0 : ge.size) || "md",
2572
- onFormSubmit: () => {
2573
- var p;
2574
- return (p = document.querySelector("#editForm")) == null ? void 0 : p.requestSubmit();
2575
- },
2576
- actionButtons: ((me = r == null ? void 0 : r.editModal) == null ? void 0 : me.actionButtons) || [],
2577
- loadingBtn: b,
2578
- children: /* @__PURE__ */ e(
2579
- Ee,
2580
- {
2581
- config: r.editModal || {},
2582
- onSubmit: ae,
2583
- initialData: A,
2584
- type: "edit",
2585
- loading: b,
2586
- fetchRowDetails: s
2587
- }
2588
- )
2532
+ config: (r == null ? void 0 : r.addModal) || {},
2533
+ onSubmit: H,
2534
+ initialData: {},
2535
+ type: "add",
2536
+ loading: b
2589
2537
  }
2590
- ),
2591
- G && /* @__PURE__ */ e(
2592
- Ce,
2538
+ )
2539
+ }
2540
+ ),
2541
+ /* @__PURE__ */ e(
2542
+ Ce,
2543
+ {
2544
+ isOpen: T,
2545
+ onClose: () => {
2546
+ b || B(!1);
2547
+ },
2548
+ icon: (be = r.editModal) == null ? void 0 : be.icon,
2549
+ title: ((pe = r.editModal) == null ? void 0 : pe.title) || "Edit",
2550
+ size: ((ge = r.editModal) == null ? void 0 : ge.size) || "md",
2551
+ onFormSubmit: () => {
2552
+ var p;
2553
+ return (p = document.querySelector("#editForm")) == null ? void 0 : p.requestSubmit();
2554
+ },
2555
+ actionButtons: ((me = r == null ? void 0 : r.editModal) == null ? void 0 : me.actionButtons) || [],
2556
+ loadingBtn: b,
2557
+ children: /* @__PURE__ */ e(
2558
+ Ee,
2593
2559
  {
2594
- isOpen: G,
2595
- onClose: (p) => {
2596
- W(p);
2597
- },
2598
- icon: ((ie = r.deleteModal) == null ? void 0 : ie.icon) || /* @__PURE__ */ e(ne, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2599
- title: ((fe = r.deleteModal) == null ? void 0 : fe.title) || "Confirm Delete",
2600
- size: ((ye = r.deleteModal) == null ? void 0 : ye.size) || "md",
2560
+ config: r.editModal || {},
2561
+ onSubmit: ae,
2562
+ initialData: A,
2563
+ type: "edit",
2601
2564
  loading: b,
2602
- actionButtons: ((xe = r == null ? void 0 : r.deleteModal) == null ? void 0 : xe.actionButtons) || [],
2603
- executeFunction: I,
2604
- selectedItem: A,
2605
- children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ h("div", { children: [
2606
- /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((ve = r.deleteModal) == null ? void 0 : ve.confirmText) || "Are you sure you want to delete this item?" }),
2607
- ((we = r.deleteModal) == null ? void 0 : we.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: A[(ke = r.deleteModal) == null ? void 0 : ke.referenceKey] })
2608
- ] }) })
2565
+ fetchRowDetails: s
2609
2566
  }
2610
- ),
2611
- r.viewModal && /* @__PURE__ */ e(
2612
- Ce,
2567
+ )
2568
+ }
2569
+ ),
2570
+ G && /* @__PURE__ */ e(
2571
+ Ce,
2572
+ {
2573
+ isOpen: G,
2574
+ onClose: (p) => {
2575
+ W(p);
2576
+ },
2577
+ icon: ((ie = r.deleteModal) == null ? void 0 : ie.icon) || /* @__PURE__ */ e(ne, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2578
+ title: ((fe = r.deleteModal) == null ? void 0 : fe.title) || "Confirm Delete",
2579
+ size: ((ye = r.deleteModal) == null ? void 0 : ye.size) || "md",
2580
+ loading: b,
2581
+ actionButtons: ((xe = r == null ? void 0 : r.deleteModal) == null ? void 0 : xe.actionButtons) || [],
2582
+ executeFunction: I,
2583
+ selectedItem: A,
2584
+ children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ h("div", { children: [
2585
+ /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((ve = r.deleteModal) == null ? void 0 : ve.confirmText) || "Are you sure you want to delete this item?" }),
2586
+ ((ke = r.deleteModal) == null ? void 0 : ke.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: A[(we = r.deleteModal) == null ? void 0 : we.referenceKey] })
2587
+ ] }) })
2588
+ }
2589
+ ),
2590
+ r.viewModal && /* @__PURE__ */ e(
2591
+ Ce,
2592
+ {
2593
+ isOpen: J,
2594
+ onClose: () => {
2595
+ Z(!1), z(null);
2596
+ },
2597
+ icon: (se = r.viewModal) == null ? void 0 : se.icon,
2598
+ title: ((de = r.viewModal) == null ? void 0 : de.title) || "View Details",
2599
+ size: ((a = r.viewModal) == null ? void 0 : a.size) || "lg",
2600
+ footerConfig: r == null ? void 0 : r.viewModal.footer,
2601
+ children: (m = r.viewModal) != null && m.component ? /* @__PURE__ */ e(r.viewModal.component, { data: A }) : /* @__PURE__ */ e(
2602
+ wa,
2613
2603
  {
2614
- isOpen: J,
2615
- onClose: () => {
2616
- Z(!1), z(null);
2617
- },
2618
- icon: (se = r.viewModal) == null ? void 0 : se.icon,
2619
- title: ((de = r.viewModal) == null ? void 0 : de.title) || "View Details",
2620
- size: ((a = r.viewModal) == null ? void 0 : a.size) || "lg",
2621
- footerConfig: r == null ? void 0 : r.viewModal.footer,
2622
- children: (m = r.viewModal) != null && m.component ? /* @__PURE__ */ e(r.viewModal.component, { data: A }) : /* @__PURE__ */ e(
2623
- wa,
2624
- {
2625
- data: A,
2626
- fetchRowDetails: s,
2627
- config: r.viewModal || {}
2628
- }
2629
- )
2604
+ data: A,
2605
+ fetchRowDetails: s,
2606
+ config: r.viewModal || {}
2630
2607
  }
2631
2608
  )
2632
- ] })
2633
- }
2634
- );
2635
- }, De = n.shape({
2636
- value: n.oneOfType([
2637
- n.string,
2638
- n.number,
2639
- n.bool
2609
+ }
2610
+ )
2611
+ ] });
2612
+ }, De = l.shape({
2613
+ value: l.oneOfType([
2614
+ l.string,
2615
+ l.number,
2616
+ l.bool
2640
2617
  ]).isRequired,
2641
- label: n.string.isRequired,
2642
- color: n.string
2643
- }), Oe = n.shape({
2644
- type: n.string.isRequired,
2645
- label: n.string.isRequired,
2646
- color: n.string,
2647
- variant: n.string,
2648
- onClick: n.func
2649
- }), ka = n.shape({
2650
- title: n.string.isRequired,
2651
- type: n.string.isRequired,
2652
- variant: n.string,
2653
- icon: n.node
2654
- }), Na = n.shape({
2655
- key: n.string.isRequired,
2656
- title: n.string,
2657
- type: n.string,
2658
- imageKey: n.string,
2659
- titleKey: n.string,
2660
- subtitleKey: n.string,
2661
- onClickDetails: n.bool,
2662
- variant: n.string,
2663
- chipOptions: n.arrayOf(De),
2664
- defaultColor: n.string,
2665
- className: n.string,
2666
- format: n.string,
2667
- menuList: n.arrayOf(ka)
2668
- }), Te = n.shape({
2669
- key: n.string.isRequired,
2670
- label: n.string,
2671
- type: n.string.isRequired,
2672
- required: n.bool,
2673
- minLength: n.number,
2674
- parentClass: n.string,
2675
- search: n.bool,
2676
- multiple: n.bool,
2677
- dropdownMaxHeight: n.string,
2678
- dragDrop: n.bool,
2679
- countriesList: n.bool,
2680
- defaultCountry: n.string,
2681
- placeholder: n.string,
2682
- rows: n.number,
2683
- text: n.string,
2684
- editorKey: n.string,
2685
- options: n.arrayOf(De)
2686
- }), Sa = n.shape({
2687
- key: n.string,
2688
- label: n.string,
2689
- type: n.string,
2690
- imageKey: n.string,
2691
- titleKey: n.string,
2692
- subtitleKey: n.string,
2693
- blockClass: n.string,
2694
- icon: n.node,
2695
- variant: n.string,
2696
- chipOptions: n.arrayOf(De),
2697
- defaultColor: n.string,
2698
- className: n.string,
2699
- format: n.string
2618
+ label: l.string.isRequired,
2619
+ color: l.string
2620
+ }), Oe = l.shape({
2621
+ type: l.string.isRequired,
2622
+ label: l.string.isRequired,
2623
+ color: l.string,
2624
+ variant: l.string,
2625
+ onClick: l.func
2626
+ }), Na = l.shape({
2627
+ title: l.string.isRequired,
2628
+ type: l.string.isRequired,
2629
+ variant: l.string,
2630
+ icon: l.node
2631
+ }), Sa = l.shape({
2632
+ key: l.string.isRequired,
2633
+ title: l.string,
2634
+ type: l.string,
2635
+ imageKey: l.string,
2636
+ titleKey: l.string,
2637
+ subtitleKey: l.string,
2638
+ onClickDetails: l.bool,
2639
+ variant: l.string,
2640
+ chipOptions: l.arrayOf(De),
2641
+ defaultColor: l.string,
2642
+ className: l.string,
2643
+ format: l.string,
2644
+ menuList: l.arrayOf(Na)
2645
+ }), Te = l.shape({
2646
+ key: l.string.isRequired,
2647
+ label: l.string,
2648
+ type: l.string.isRequired,
2649
+ required: l.bool,
2650
+ minLength: l.number,
2651
+ parentClass: l.string,
2652
+ search: l.bool,
2653
+ multiple: l.bool,
2654
+ dropdownMaxHeight: l.string,
2655
+ dragDrop: l.bool,
2656
+ countriesList: l.bool,
2657
+ defaultCountry: l.string,
2658
+ placeholder: l.string,
2659
+ rows: l.number,
2660
+ text: l.string,
2661
+ editorKey: l.string,
2662
+ options: l.arrayOf(De)
2663
+ }), Ca = l.shape({
2664
+ key: l.string,
2665
+ label: l.string,
2666
+ type: l.string,
2667
+ imageKey: l.string,
2668
+ titleKey: l.string,
2669
+ subtitleKey: l.string,
2670
+ blockClass: l.string,
2671
+ icon: l.node,
2672
+ variant: l.string,
2673
+ chipOptions: l.arrayOf(De),
2674
+ defaultColor: l.string,
2675
+ className: l.string,
2676
+ format: l.string
2700
2677
  });
2701
2678
  Ze.propTypes = {
2702
- config: n.shape({
2703
- title: n.string.isRequired,
2704
- description: n.string,
2705
- buttonText: n.string,
2706
- fetchData: n.func.isRequired,
2707
- isStaticData: n.bool,
2679
+ config: l.shape({
2680
+ title: l.string.isRequired,
2681
+ description: l.string,
2682
+ buttonText: l.string,
2683
+ fetchData: l.func.isRequired,
2684
+ isStaticData: l.bool,
2708
2685
  /* ================= TABLE CONFIG ================= */
2709
- tableConfig: n.shape({
2710
- table_head: n.arrayOf(Na).isRequired,
2711
- search: n.shape({
2712
- enabled: n.bool,
2713
- useServerSideSearch: n.bool,
2714
- searchKeys: n.arrayOf(n.string)
2686
+ tableConfig: l.shape({
2687
+ table_head: l.arrayOf(Sa).isRequired,
2688
+ search: l.shape({
2689
+ enabled: l.bool,
2690
+ useServerSideSearch: l.bool,
2691
+ searchKeys: l.arrayOf(l.string)
2715
2692
  }),
2716
- pagination: n.shape({
2717
- enabled: n.bool,
2718
- useServerSidePagination: n.bool
2693
+ pagination: l.shape({
2694
+ enabled: l.bool,
2695
+ useServerSidePagination: l.bool
2719
2696
  }),
2720
- filter: n.shape({
2721
- enabled: n.bool,
2722
- useServerSideFilters: n.bool
2697
+ filter: l.shape({
2698
+ enabled: l.bool,
2699
+ useServerSideFilters: l.bool
2723
2700
  })
2724
2701
  }).isRequired,
2725
2702
  /* ================= MODAL CONFIG ================= */
2726
- modalConfig: n.shape({
2727
- addModal: n.shape({
2728
- title: n.string.isRequired,
2729
- size: n.string,
2730
- formClass: n.string,
2731
- formFields: n.arrayOf(Te),
2732
- handleSubmit: n.func.isRequired,
2733
- actionButtons: n.arrayOf(Oe)
2703
+ modalConfig: l.shape({
2704
+ addModal: l.shape({
2705
+ title: l.string.isRequired,
2706
+ size: l.string,
2707
+ formClass: l.string,
2708
+ formFields: l.arrayOf(Te),
2709
+ handleSubmit: l.func.isRequired,
2710
+ actionButtons: l.arrayOf(Oe)
2734
2711
  }),
2735
- editModal: n.shape({
2736
- title: n.string.isRequired,
2737
- size: n.string,
2738
- formClass: n.string,
2739
- formFields: n.arrayOf(Te),
2740
- handleSubmit: n.func.isRequired,
2741
- actionButtons: n.arrayOf(Oe)
2712
+ editModal: l.shape({
2713
+ title: l.string.isRequired,
2714
+ size: l.string,
2715
+ formClass: l.string,
2716
+ formFields: l.arrayOf(Te),
2717
+ handleSubmit: l.func.isRequired,
2718
+ actionButtons: l.arrayOf(Oe)
2742
2719
  }),
2743
- deleteModal: n.shape({
2744
- title: n.string.isRequired,
2745
- size: n.string,
2746
- confirmText: n.string,
2747
- referenceKey: n.string,
2748
- actionButtons: n.arrayOf(Oe)
2720
+ deleteModal: l.shape({
2721
+ title: l.string.isRequired,
2722
+ size: l.string,
2723
+ confirmText: l.string,
2724
+ referenceKey: l.string,
2725
+ actionButtons: l.arrayOf(Oe)
2749
2726
  }),
2750
- viewModal: n.shape({
2751
- title: n.string.isRequired,
2752
- size: n.string,
2727
+ viewModal: l.shape({
2728
+ title: l.string.isRequired,
2729
+ size: l.string,
2753
2730
  // 👇 This covers your commented code:
2754
- component: n.elementType,
2731
+ component: l.elementType,
2755
2732
  // for custom component like TeamMemberDetail
2756
- fields: n.arrayOf(Sa),
2757
- footer: n.shape({
2758
- cancelButton: n.bool,
2759
- cancelText: n.string
2733
+ fields: l.arrayOf(Ca),
2734
+ footer: l.shape({
2735
+ cancelButton: l.bool,
2736
+ cancelText: l.string
2760
2737
  })
2761
2738
  })
2762
2739
  }),
2763
2740
  /* ================= FILTER CONFIG ================= */
2764
- filterConfig: n.shape({
2765
- fields: n.arrayOf(Te)
2741
+ filterConfig: l.shape({
2742
+ fields: l.arrayOf(Te)
2766
2743
  })
2767
2744
  }).isRequired
2768
2745
  };
2769
- const Ca = () => {
2746
+ function Ma({ children: n }) {
2747
+ return ca(), n;
2748
+ }
2749
+ function La({ children: n }) {
2750
+ try {
2751
+ return /* @__PURE__ */ e(Ma, { children: n });
2752
+ } catch {
2753
+ return /* @__PURE__ */ e(
2754
+ da,
2755
+ {
2756
+ anchorOrigin: {
2757
+ vertical: "bottom",
2758
+ horizontal: "right"
2759
+ },
2760
+ action: (t) => /* @__PURE__ */ e(
2761
+ "button",
2762
+ {
2763
+ onClick: () => {
2764
+ window.dispatchEvent(
2765
+ new CustomEvent("closeSnackbar", { detail: t })
2766
+ );
2767
+ },
2768
+ className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
2769
+ children: /* @__PURE__ */ e(Le, { className: "h-4 w-4" })
2770
+ }
2771
+ ),
2772
+ maxSnack: 3,
2773
+ autoHideDuration: 3e3,
2774
+ children: n
2775
+ }
2776
+ );
2777
+ }
2778
+ }
2779
+ const Ra = () => {
2770
2780
  if (typeof document > "u" || document.getElementById("react-admin-crud-manager-styles")) return;
2771
- const o = document.createElement("style");
2772
- o.id = "react-admin-crud-manager-styles";
2773
- const l = `
2781
+ const n = document.createElement("style");
2782
+ n.id = "react-admin-crud-manager-styles", n.textContent = `
2774
2783
  .no-spinner::-webkit-outer-spin-button,
2775
2784
  .no-spinner::-webkit-inner-spin-button {
2776
2785
  -webkit-appearance: none;
2777
2786
  margin: 0;
2778
2787
  }
2779
-
2788
+
2780
2789
  .no-spinner {
2781
2790
  -moz-appearance: textfield;
2782
2791
  }
2783
-
2792
+
2784
2793
  .tox.tox-tinymce .tox-edit-area::before {
2785
2794
  border: 0 !important;
2786
2795
  box-shadow: none !important;
2787
2796
  }
2788
- `;
2789
- o.textContent = l, document.head.appendChild(o);
2797
+ `, document.head.appendChild(n);
2790
2798
  };
2791
- function ja(o) {
2799
+ function Ea(n) {
2792
2800
  return K(() => {
2793
- Ca();
2794
- }, []), /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(Ze, { config: o.config }) });
2801
+ Ra();
2802
+ }, []), /* @__PURE__ */ e(La, { children: /* @__PURE__ */ e(Ze, { config: n.config }) });
2795
2803
  }
2796
2804
  export {
2797
- ja as default
2805
+ Ea as default
2798
2806
  };
2799
2807
  //# sourceMappingURL=index.es.js.map