@plitzi/plitzi-ui 1.6.18 → 1.6.20

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.
Files changed (40) hide show
  1. package/dist/components/Accordion/helpers/AccordionManager.js +2 -1
  2. package/dist/components/Button/Button.js +21 -19
  3. package/dist/components/Cache/CacheProvider.js +7 -4
  4. package/dist/components/Card/CardHeader.js +19 -17
  5. package/dist/components/Checkbox/Checkbox.js +2 -2
  6. package/dist/components/CodeMirror/CodeMirror.js +21 -21
  7. package/dist/components/ContainerDraggable/ContainerDraggable.js +9 -9
  8. package/dist/components/ContainerFloating/ContainerFloating.js +15 -15
  9. package/dist/components/ContainerResizable/ContainerResizable.js +9 -7
  10. package/dist/components/ContainerShadow/ContainerShadowStyle.js +8 -5
  11. package/dist/components/FileUpload/FileUpload.js +1 -1
  12. package/dist/components/FileUpload/components/DrawTypes/DrawTypes.js +16 -13
  13. package/dist/components/FileUpload/components/FileUploadMessage/FileUploadMessage.js +24 -21
  14. package/dist/components/Flex/Flex.styles.d.ts +2 -2
  15. package/dist/components/Form/index.js +6 -6
  16. package/dist/components/Input/Input.js +2 -2
  17. package/dist/components/Input/InputContainer.js +11 -9
  18. package/dist/components/KVInput/KVInput.js +2 -2
  19. package/dist/components/MenuList/MenuItem.js +23 -21
  20. package/dist/components/MenuList/MenuList.js +14 -12
  21. package/dist/components/MenuList/MenuListContainer.js +8 -6
  22. package/dist/components/MetricInput/MetricInput.js +1 -4
  23. package/dist/components/Modal/ModalProvider.js +5 -5
  24. package/dist/components/Popup/PopupProvider.js +61 -61
  25. package/dist/components/Provider/providers/ThemeProvider/ThemeProvider.js +12 -12
  26. package/dist/components/QueryBuilder/QueryBuilderProvider.js +47 -47
  27. package/dist/components/QueryBuilder/Rule.js +4 -4
  28. package/dist/components/QueryBuilder/RuleValue.js +7 -1
  29. package/dist/components/QueryBuilder/helpers/QueryBuilderEvaluator.js +1 -5
  30. package/dist/components/Sidebar/Sidebar.js +22 -20
  31. package/dist/components/Sidebar/SidebarProvider.js +7 -4
  32. package/dist/components/Switch/Switch.js +2 -2
  33. package/dist/components/TextArea/TextArea.js +2 -2
  34. package/dist/components/Toast/ToastProvider.js +2 -2
  35. package/dist/components/index.js +249 -249
  36. package/dist/helpers/formatDate.js +5 -1
  37. package/dist/helpers/lodash/throttle.js +3 -2
  38. package/dist/hooks/useStorage/useStorageHelper.js +1 -1
  39. package/dist/index.js +112 -112
  40. package/package.json +1313 -70
@@ -39,18 +39,20 @@ var d = ({ className: d, children: f, open: p = !1, asSubMenu: m = !1 }) => {
39
39
  _,
40
40
  m
41
41
  ]), T = r(() => p && w(), [p, w]);
42
- return i(() => {
42
+ i(() => {
43
43
  if (p) return document.addEventListener("scroll", T, !0), window.addEventListener("resize", T), () => {
44
44
  document.removeEventListener("scroll", T, !0), window.removeEventListener("resize", T);
45
45
  };
46
46
  }, [p, T]), i(() => {
47
47
  p && w();
48
- }, [p, w]), u(/* @__PURE__ */ c("div", {
48
+ }, [p, w]);
49
+ let E = a(() => ({
50
+ top: S.top,
51
+ left: S.left
52
+ }), [S]);
53
+ return u(/* @__PURE__ */ c("div", {
49
54
  ref: y,
50
- style: a(() => ({
51
- top: S.top,
52
- left: S.left
53
- }), [S]),
55
+ style: E,
54
56
  className: l("menu", d, {
55
57
  "opacity-0 pointer-events-none": S.top === void 0 || S.left === void 0 || !p,
56
58
  "-translate-x-full": m && (b === "top-right" || b === "bottom-right")
@@ -101,10 +101,7 @@ var _ = ({ ref: _, children: v, className: y = "", placeholder: b = "", loading:
101
101
  case "ArrowUp":
102
102
  (t + M <= P || P === Infinity) && (t = Number((t + M).toFixed(r(M))));
103
103
  break;
104
- case "ArrowDown":
105
- (t - M >= N || N === Infinity) && (t = Number((t - M).toFixed(r(M))));
106
- break;
107
- default:
104
+ case "ArrowDown": (t - M >= N || N === Infinity) && (t = Number((t - M).toFixed(r(M))));
108
105
  }
109
106
  Number.isNaN(t) && (t = N), H !== `${t}` && F?.(U ? `${t}${U}` : `${t}${R[0].value}`);
110
107
  }, [
@@ -57,12 +57,12 @@ var l = ({ children: l }) => {
57
57
  size: a?.size,
58
58
  children: "Cancel"
59
59
  })]
60
- }), p(e, r, i, a)), [p]);
60
+ }), p(e, r, i, a)), [p]), h = a(() => ({
61
+ showModal: p,
62
+ showDialog: m
63
+ }), [p, m]);
61
64
  return /* @__PURE__ */ c(r, {
62
- value: a(() => ({
63
- showModal: p,
64
- showDialog: m
65
- }), [p, m]),
65
+ value: h,
66
66
  children: [l, Object.values(u).map((e, t) => /* @__PURE__ */ s(n, { ...e }, e?.id ?? t))]
67
67
  });
68
68
  };
@@ -27,70 +27,70 @@ var h = ({ children: h, floatingClassName: g = "h-screen w-screen", floatingFixe
27
27
  });
28
28
  }, [F]), R = s((e) => {
29
29
  F.getPlacement(e) && F.remove(e);
30
- }, [F]), z = s((e) => F.exists(e), [F]);
30
+ }, [F]), z = s((e) => F.exists(e), [F]), B = l(() => ({
31
+ popupManager: F,
32
+ multi: x,
33
+ multiExpanded: S,
34
+ popups: F.get("floating"),
35
+ popupIds: F.get("floating").map((e) => e.id),
36
+ popupActiveIds: F.get("floating").filter((e) => e.active).map((e) => e.id),
37
+ limitMode: T,
38
+ addPopup: L,
39
+ existsPopup: z,
40
+ removePopup: R
41
+ }), [
42
+ L,
43
+ z,
44
+ R,
45
+ T,
46
+ x,
47
+ S,
48
+ F.lastUpdate.floating
49
+ ]), V = l(() => ({
50
+ popupManager: F,
51
+ multi: x,
52
+ multiExpanded: S,
53
+ popups: F.get("left"),
54
+ popupIds: F.get("left").map((e) => e.id),
55
+ popupActiveIds: F.get("left").filter((e) => e.active).map((e) => e.id),
56
+ limitMode: T,
57
+ addPopup: L,
58
+ existsPopup: z,
59
+ removePopup: R
60
+ }), [
61
+ L,
62
+ z,
63
+ R,
64
+ T,
65
+ x,
66
+ S,
67
+ F.lastUpdate.left
68
+ ]), H = l(() => ({
69
+ popupManager: F,
70
+ multi: x,
71
+ multiExpanded: S,
72
+ popups: F.get("right"),
73
+ popupIds: F.get("right").map((e) => e.id),
74
+ popupActiveIds: F.get("right").filter((e) => e.active).map((e) => e.id),
75
+ limitMode: T,
76
+ addPopup: L,
77
+ existsPopup: z,
78
+ removePopup: R
79
+ }), [
80
+ L,
81
+ z,
82
+ R,
83
+ T,
84
+ x,
85
+ S,
86
+ F.lastUpdate.right
87
+ ]);
31
88
  return /* @__PURE__ */ f(t, {
32
- value: l(() => ({
33
- popupManager: F,
34
- multi: x,
35
- multiExpanded: S,
36
- popups: F.get("floating"),
37
- popupIds: F.get("floating").map((e) => e.id),
38
- popupActiveIds: F.get("floating").filter((e) => e.active).map((e) => e.id),
39
- limitMode: T,
40
- addPopup: L,
41
- existsPopup: z,
42
- removePopup: R
43
- }), [
44
- L,
45
- z,
46
- R,
47
- T,
48
- x,
49
- S,
50
- F.lastUpdate.floating
51
- ]),
89
+ value: B,
52
90
  children: /* @__PURE__ */ f(n, {
53
- value: l(() => ({
54
- popupManager: F,
55
- multi: x,
56
- multiExpanded: S,
57
- popups: F.get("left"),
58
- popupIds: F.get("left").map((e) => e.id),
59
- popupActiveIds: F.get("left").filter((e) => e.active).map((e) => e.id),
60
- limitMode: T,
61
- addPopup: L,
62
- existsPopup: z,
63
- removePopup: R
64
- }), [
65
- L,
66
- z,
67
- R,
68
- T,
69
- x,
70
- S,
71
- F.lastUpdate.left
72
- ]),
91
+ value: V,
73
92
  children: /* @__PURE__ */ p(r, {
74
- value: l(() => ({
75
- popupManager: F,
76
- multi: x,
77
- multiExpanded: S,
78
- popups: F.get("right"),
79
- popupIds: F.get("right").map((e) => e.id),
80
- popupActiveIds: F.get("right").filter((e) => e.active).map((e) => e.id),
81
- limitMode: T,
82
- addPopup: L,
83
- existsPopup: z,
84
- removePopup: R
85
- }), [
86
- L,
87
- z,
88
- R,
89
- T,
90
- x,
91
- S,
92
- F.lastUpdate.right
93
- ]),
93
+ value: H,
94
94
  children: [
95
95
  v && !!F.getCount("left") && /* @__PURE__ */ f(i, {
96
96
  placement: "left",
@@ -37,19 +37,19 @@ var c = ({ children: t, components: c, defaultColorMode: l = "light", colorModeS
37
37
  if (!p && (h(e), u)) try {
38
38
  localStorage.setItem(u, e);
39
39
  } catch {}
40
- }, [p, u]);
40
+ }, [p, u]), v = i(() => ({
41
+ theme: { components: c && Object.keys(c).length > 0 ? c : {} },
42
+ colorMode: m,
43
+ toggleColorMode: g,
44
+ setColorMode: _
45
+ }), [
46
+ c,
47
+ m,
48
+ g,
49
+ _
50
+ ]);
41
51
  return /* @__PURE__ */ o(s, {
42
- value: i(() => ({
43
- theme: { components: c && Object.keys(c).length > 0 ? c : {} },
44
- colorMode: m,
45
- toggleColorMode: g,
46
- setColorMode: _
47
- }), [
48
- c,
49
- m,
50
- g,
51
- _
52
- ]),
52
+ value: v,
53
53
  children: t
54
54
  });
55
55
  };
@@ -1,14 +1,14 @@
1
1
  import { get as e } from "../../helpers/lodash/get.js";
2
2
  import { set as t } from "../../helpers/lodash/set.js";
3
3
  import { getQueryMap as n } from "./helpers/QueryBuilderHelper.js";
4
- import r from "./QueryBuilderContext.js";
5
- import { defaultCombinators as i } from "./helpers/QueryBuilderContants.js";
4
+ import { defaultCombinators as r } from "./helpers/QueryBuilderContants.js";
5
+ import i from "./QueryBuilderContext.js";
6
6
  import { useCallback as a, useMemo as o, useRef as s } from "react";
7
7
  import { jsx as c } from "react/jsx-runtime";
8
- import { v4 as l } from "uuid";
9
- import { produce as u } from "immer";
8
+ import { produce as l } from "immer";
9
+ import { v4 as u } from "uuid";
10
10
  //#region src/components/QueryBuilder/QueryBuilderProvider.tsx
11
- var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSubGroups: h = !0, combinators: g = i, error: _ = !1, onChange: v }) => {
11
+ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSubGroups: h = !0, combinators: g = r, error: _ = !1, onChange: v }) => {
12
12
  let y = s(f);
13
13
  y.current = f;
14
14
  let b = o(() => n(f), [f]), x = s(b);
@@ -16,22 +16,22 @@ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSub
16
16
  let S = a((t, n) => {
17
17
  let { parentId: r, path: i } = e(x.current, n, {});
18
18
  if (!(r && !i)) return i === "" ? t : e(t, i);
19
- }, []), C = a((e) => v?.(u(y.current, (t) => {
19
+ }, []), C = a((e) => v?.(l(y.current, (t) => {
20
20
  let n = S(t, e);
21
21
  n && n.rules.push({
22
- id: l(),
22
+ id: u(),
23
23
  field: "",
24
24
  operator: "",
25
25
  value: "",
26
26
  enabled: !0
27
27
  });
28
- })), [v, S]), w = a((t) => v?.(u(y.current, (n) => {
28
+ })), [v, S]), w = a((t) => v?.(l(y.current, (n) => {
29
29
  let r = S(n, t);
30
30
  !r || !h || !("rules" in r) || r.rules.push({
31
- id: l(),
31
+ id: u(),
32
32
  combinator: e(g, "0.value", "and"),
33
33
  rules: [{
34
- id: l(),
34
+ id: u(),
35
35
  field: "",
36
36
  operator: "",
37
37
  value: "",
@@ -44,7 +44,7 @@ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSub
44
44
  g,
45
45
  v,
46
46
  S
47
- ]), T = a((n, r) => v?.(u(y.current, (i) => {
47
+ ]), T = a((n, r) => v?.(l(y.current, (i) => {
48
48
  let a = S(i, n);
49
49
  if (!a) return;
50
50
  let { parentId: o } = e(x.current, n, {}), s = S(i, o);
@@ -52,56 +52,56 @@ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSub
52
52
  ...a,
53
53
  ...r
54
54
  });
55
- })), [v, S]), E = a((e, n) => v?.(u(y.current, (r) => {
55
+ })), [v, S]), E = a((e, n) => v?.(l(y.current, (r) => {
56
56
  let i = S(r, e);
57
57
  i && t(i, "combinator", n);
58
- })), [v, S]), D = a((e, n) => v?.(u(y.current, (r) => {
58
+ })), [v, S]), D = a((e, n) => v?.(l(y.current, (r) => {
59
59
  let i = S(r, e);
60
60
  i && t(i, "enabled", n);
61
- })), [v, S]), O = a((e, n) => v?.(u(y.current, (r) => {
61
+ })), [v, S]), O = a((e, n) => v?.(l(y.current, (r) => {
62
62
  let i = S(r, e);
63
63
  i && t(i, "operator", n);
64
- })), [v, S]), k = a((e, n) => v?.(u(y.current, (r) => {
64
+ })), [v, S]), k = a((e, n) => v?.(l(y.current, (r) => {
65
65
  let i = S(r, e);
66
66
  i && t(i, "value", n);
67
- })), [v, S]), A = a((t) => v?.(u(y.current, (n) => {
67
+ })), [v, S]), A = a((t) => v?.(l(y.current, (n) => {
68
68
  let r = S(n, t), i;
69
69
  for (; r;) {
70
70
  let { id: t, parentId: a } = e(x.current, r.id ?? "", "");
71
71
  if (i = S(n, a), !i || (i.rules.splice(i.rules.findIndex((e) => e.id === t), 1), i.rules.length < 2 && i.combinator !== "and" && (i.combinator = "and"), i.rules.length > 0 || !a)) break;
72
72
  r = i;
73
73
  }
74
- })), [v, S]);
75
- return /* @__PURE__ */ c(r, {
76
- value: o(() => ({
77
- addGroup: w,
78
- addRule: C,
79
- update: T,
80
- updateCombinator: E,
81
- updateEnabled: D,
82
- updateRuleOperator: O,
83
- updateRuleValue: k,
84
- remove: A,
85
- fields: p,
86
- allowDisableRules: m,
87
- allowSubGroups: h,
88
- combinators: g,
89
- error: _
90
- }), [
91
- w,
92
- C,
93
- T,
94
- E,
95
- D,
96
- O,
97
- k,
98
- A,
99
- p,
100
- m,
101
- h,
102
- g,
103
- _
104
- ]),
74
+ })), [v, S]), j = o(() => ({
75
+ addGroup: w,
76
+ addRule: C,
77
+ update: T,
78
+ updateCombinator: E,
79
+ updateEnabled: D,
80
+ updateRuleOperator: O,
81
+ updateRuleValue: k,
82
+ remove: A,
83
+ fields: p,
84
+ allowDisableRules: m,
85
+ allowSubGroups: h,
86
+ combinators: g,
87
+ error: _
88
+ }), [
89
+ w,
90
+ C,
91
+ T,
92
+ E,
93
+ D,
94
+ O,
95
+ k,
96
+ A,
97
+ p,
98
+ m,
99
+ h,
100
+ g,
101
+ _
102
+ ]);
103
+ return /* @__PURE__ */ c(i, {
104
+ value: j,
105
105
  children: d
106
106
  });
107
107
  };
@@ -4,15 +4,15 @@ import n from "../Flex/index.js";
4
4
  import r from "../Button/index.js";
5
5
  import i from "../Select2/index.js";
6
6
  import a from "../Switch/index.js";
7
- import o from "./QueryBuilderContext.js";
8
- import { defaultOperators as s } from "./helpers/QueryBuilderContants.js";
7
+ import { defaultOperators as o } from "./helpers/QueryBuilderContants.js";
8
+ import s from "./QueryBuilderContext.js";
9
9
  import c from "./RuleOperator.js";
10
10
  import l from "./RuleValue.js";
11
11
  import { use as u, useCallback as d, useMemo as f } from "react";
12
12
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
13
  //#region src/components/QueryBuilder/Rule.tsx
14
14
  var g = ({ className: g = "", id: _ = "", field: v = "", operator: y = "", value: b = "", isBinding: x = !1, enabled: S = !0, size: C, showBranches: w, direction: T, intent: E }) => {
15
- let { fields: D, update: O, updateRuleOperator: k, updateRuleValue: A, updateEnabled: j, remove: M, allowDisableRules: N, error: P } = u(o), F = t("QueryBuilder", {
15
+ let { fields: D, update: O, updateRuleOperator: k, updateRuleValue: A, updateEnabled: j, remove: M, allowDisableRules: N, error: P } = u(s), F = t("QueryBuilder", {
16
16
  className: g,
17
17
  componentKey: [
18
18
  "rule",
@@ -63,7 +63,7 @@ var g = ({ className: g = "", id: _ = "", field: v = "", operator: y = "", value
63
63
  });
64
64
  return;
65
65
  }
66
- let { value: n, defaultValue: r, operators: i } = t, a = e(i, "0.value", e(s, "0.value", "="));
66
+ let { value: n, defaultValue: r, operators: i } = t, a = e(i, "0.value", e(o, "0.value", "="));
67
67
  O(_, {
68
68
  field: n,
69
69
  operator: a,
@@ -6,7 +6,13 @@ import { useCallback as i, useMemo as a, useState as o } from "react";
6
6
  import { jsx as s } from "react/jsx-runtime";
7
7
  //#region src/components/QueryBuilder/RuleValue.tsx
8
8
  var c = [], l = ({ className: l = "", valuePosition: u, value: d = "", options: f = c, placeholder: p = "Enter a value", type: m = "text", error: h = !1, size: g, disabled: _, validator: v, onChange: y }) => {
9
- let [b, x] = o(h), S = i((e) => y?.(e.target.checked), [y]), C = a(() => Number.isInteger(u) && typeof d == "string" ? e(d.split(","), `${u}`, d) : d, [d, u]), w = i((e) => {
9
+ let [b, x] = o(h), S = i((e) => y?.(e.target.checked), [y]), C = a(() => {
10
+ if (Number.isInteger(u) && typeof d == "string") {
11
+ let t = d.split(",");
12
+ return e(t, `${u}`, d);
13
+ }
14
+ return d;
15
+ }, [d, u]), w = i((e) => {
10
16
  if (e.includes(",") && Number.isInteger(u)) return;
11
17
  if (u && Number.isInteger(u) && typeof d == "string") {
12
18
  let t = d.split(",");
@@ -21,11 +21,7 @@ var o = (e) => {
21
21
  combinator: t,
22
22
  enabled: n
23
23
  };
24
- }, s = (e, t = "json") => {
25
- switch (t) {
26
- default: return o(e);
27
- }
28
- }, c = (e, t) => typeof e == "boolean" && typeof t == "string" ? (t = t.toLowerCase(), t = t === "true" || t === "1", e === t) : typeof e == "string" && typeof t == "boolean" ? (e = e.toLowerCase(), e = e === "true" || e === "1", e === t) : (typeof e == "number" && (e = `${e}`), typeof t == "number" && (t = `${t}`), e === t), l = (e, t) => e == null || t == null ? !1 : n(e) && n(t) ? (e = r(e), t = r(t), parseFloat(t) > parseFloat(e)) : i(e) ? (e = parseFloat(e), t = parseFloat(t), i(t) && t > e) : t > e, u = (e, t) => l(e, t) || c(e, t), d = (e, t) => e == null || t == null ? !1 : n(e) && n(t) ? (e = r(e), t = r(t), parseFloat(t) < parseFloat(e)) : i(e) ? (e = parseFloat(e), t = parseFloat(t), i(t) && t < e) : t < e, f = (e, t) => d(e, t) || c(e, t), p = (e, t) => typeof e == "string" && typeof t == "string" && t.toLowerCase().includes(e.toLowerCase()), m = (e, t) => typeof t == "string" && typeof e == "string" && t.toLowerCase().startsWith(e.toLowerCase()), h = (e, t) => typeof t == "string" && typeof e == "string" && t.toLowerCase().endsWith(e.toLowerCase()), g = (e) => {
24
+ }, s = (e, t = "json") => o(e), c = (e, t) => typeof e == "boolean" && typeof t == "string" ? (t = t.toLowerCase(), t = t === "true" || t === "1", e === t) : typeof e == "string" && typeof t == "boolean" ? (e = e.toLowerCase(), e = e === "true" || e === "1", e === t) : (typeof e == "number" && (e = `${e}`), typeof t == "number" && (t = `${t}`), e === t), l = (e, t) => e == null || t == null ? !1 : n(e) && n(t) ? (e = r(e), t = r(t), parseFloat(t) > parseFloat(e)) : i(e) ? (e = parseFloat(e), t = parseFloat(t), i(t) && t > e) : t > e, u = (e, t) => l(e, t) || c(e, t), d = (e, t) => e == null || t == null ? !1 : n(e) && n(t) ? (e = r(e), t = r(t), parseFloat(t) < parseFloat(e)) : i(e) ? (e = parseFloat(e), t = parseFloat(t), i(t) && t < e) : t < e, f = (e, t) => d(e, t) || c(e, t), p = (e, t) => typeof e == "string" && typeof t == "string" && t.toLowerCase().includes(e.toLowerCase()), m = (e, t) => typeof t == "string" && typeof e == "string" && t.toLowerCase().startsWith(e.toLowerCase()), h = (e, t) => typeof t == "string" && typeof e == "string" && t.toLowerCase().endsWith(e.toLowerCase()), g = (e) => {
29
25
  switch (typeof e) {
30
26
  case "boolean":
31
27
  case "number":
@@ -28,26 +28,28 @@ var u = ({ className: u, children: d, value: f = [], multi: p = !1, canEmpty: m
28
28
  ]), { items: S } = c(() => {
29
29
  let e = { items: [] };
30
30
  return i.forEach(d, (n, i) => {
31
- if (o(n)) if (n.type === t) {
32
- let t = n.props, r = t.id ?? i.toString(), o = {
33
- size: v,
34
- ...t,
35
- key: i,
36
- id: r
37
- };
38
- t.detatched || (o.active = b.includes(r)), e.items.push(a(n, o));
39
- } else if (n.type === r) {
40
- let t = n.props;
41
- e.items.push(a(n, {
42
- ...t,
43
- key: i
44
- }));
45
- } else {
46
- let t = n.props;
47
- e.items.push(a(n, {
48
- ...t,
49
- key: i
50
- }));
31
+ if (o(n)) {
32
+ if (n.type === t) {
33
+ let t = n.props, r = t.id ?? i.toString(), o = {
34
+ size: v,
35
+ ...t,
36
+ key: i,
37
+ id: r
38
+ };
39
+ t.detatched || (o.active = b.includes(r)), e.items.push(a(n, o));
40
+ } else if (n.type === r) {
41
+ let t = n.props;
42
+ e.items.push(a(n, {
43
+ ...t,
44
+ key: i
45
+ }));
46
+ } else {
47
+ let t = n.props;
48
+ e.items.push(a(n, {
49
+ ...t,
50
+ key: i
51
+ }));
52
+ }
51
53
  }
52
54
  }), e;
53
55
  }, [
@@ -2,9 +2,12 @@ import e from "./SidebarContext.js";
2
2
  import { useMemo as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/Sidebar/SidebarProvider.tsx
5
- var r = ({ children: r, onChange: i }) => /* @__PURE__ */ n(e, {
6
- value: t(() => ({ onChange: i }), [i]),
7
- children: r
8
- });
5
+ var r = ({ children: r, onChange: i }) => {
6
+ let a = t(() => ({ onChange: i }), [i]);
7
+ return /* @__PURE__ */ n(e, {
8
+ value: a,
9
+ children: r
10
+ });
11
+ };
9
12
  //#endregion
10
13
  export { r as default };
@@ -24,9 +24,9 @@ var c = r(({ ref: r, children: c, id: l, className: u = "", value: d, label: f =
24
24
  disabled: p,
25
25
  error: !!_
26
26
  }
27
- });
27
+ }), x = i(() => e(b, ["switch", "slide"]), [b]);
28
28
  return /* @__PURE__ */ o(n, {
29
- className: i(() => e(b, ["switch", "slide"]), [b]),
29
+ className: x,
30
30
  id: l,
31
31
  label: f,
32
32
  error: _,
@@ -24,7 +24,7 @@ var l = Object.assign(i(({ ref: n, className: i = "", id: l, children: u, label:
24
24
  }
25
25
  }), C = o(() => e(S, ["input"]), [S]), w = a((e) => {
26
26
  b?.(e.target.value);
27
- }, [b]);
27
+ }, [b]), T = a(() => b?.(""), [b]);
28
28
  return /* @__PURE__ */ c(r, {
29
29
  className: C,
30
30
  id: l,
@@ -36,7 +36,7 @@ var l = Object.assign(i(({ ref: n, className: i = "", id: l, children: u, label:
36
36
  loading: p,
37
37
  clearable: h,
38
38
  value: v,
39
- onClear: a(() => b?.(""), [b]),
39
+ onClear: T,
40
40
  children: [u, /* @__PURE__ */ s("textarea", {
41
41
  ref: n,
42
42
  id: l,
@@ -20,9 +20,9 @@ var c = ({ children: c, classNameToast: l = "", classNameContainer: u = "", isFi
20
20
  icon: c,
21
21
  containerId: p
22
22
  });
23
- }, [l, p]);
23
+ }, [l, p]), h = n(() => ({ addToast: m }), [m]);
24
24
  return /* @__PURE__ */ i(e, {
25
- value: n(() => ({ addToast: m }), [m]),
25
+ value: h,
26
26
  children: [/* @__PURE__ */ r(o, {
27
27
  containerId: p,
28
28
  pauseOnFocusLoss: !1,