@plitzi/plitzi-ui 1.6.18 → 1.6.19

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 (30) hide show
  1. package/dist/components/Accordion/helpers/AccordionManager.js +2 -1
  2. package/dist/components/Cache/CacheProvider.js +7 -4
  3. package/dist/components/Checkbox/Checkbox.js +2 -2
  4. package/dist/components/CodeMirror/CodeMirror.js +21 -21
  5. package/dist/components/ContainerDraggable/ContainerDraggable.js +9 -9
  6. package/dist/components/ContainerFloating/ContainerFloating.js +15 -15
  7. package/dist/components/ContainerResizable/ContainerResizable.js +1 -1
  8. package/dist/components/ContainerShadow/ContainerShadowStyle.js +8 -5
  9. package/dist/components/FileUpload/FileUpload.js +1 -1
  10. package/dist/components/FileUpload/components/DrawTypes/DrawTypes.js +16 -13
  11. package/dist/components/FileUpload/components/FileUploadMessage/FileUploadMessage.js +24 -21
  12. package/dist/components/Input/Input.js +2 -2
  13. package/dist/components/KVInput/KVInput.js +2 -2
  14. package/dist/components/MenuList/MenuList.js +14 -12
  15. package/dist/components/MenuList/MenuListContainer.js +8 -6
  16. package/dist/components/MetricInput/MetricInput.js +1 -4
  17. package/dist/components/Modal/ModalProvider.js +5 -5
  18. package/dist/components/Popup/PopupProvider.js +61 -61
  19. package/dist/components/Provider/providers/ThemeProvider/ThemeProvider.js +12 -12
  20. package/dist/components/QueryBuilder/QueryBuilderProvider.js +30 -30
  21. package/dist/components/QueryBuilder/RuleValue.js +7 -1
  22. package/dist/components/QueryBuilder/helpers/QueryBuilderEvaluator.js +1 -5
  23. package/dist/components/Sidebar/SidebarProvider.js +7 -4
  24. package/dist/components/Switch/Switch.js +2 -2
  25. package/dist/components/TextArea/TextArea.js +2 -2
  26. package/dist/components/Toast/ToastProvider.js +2 -2
  27. package/dist/helpers/formatDate.js +5 -1
  28. package/dist/helpers/lodash/throttle.js +3 -2
  29. package/dist/hooks/useStorage/useStorageHelper.js +1 -1
  30. package/package.json +20 -20
@@ -27,7 +27,8 @@ var e = class {
27
27
  flexBasis: ""
28
28
  }), n.hasManualSize = !1;
29
29
  break;
30
- } else if (n.active) {
30
+ }
31
+ if (n.active) {
31
32
  e = !0;
32
33
  break;
33
34
  }
@@ -2,9 +2,12 @@ import e from "./CacheContext.js";
2
2
  import { useMemo as t } from "react";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/Cache/CacheProvider.tsx
5
- var r = ({ children: r, cacheId: i = "" }) => /* @__PURE__ */ n(e, {
6
- value: t(() => ({ cacheId: i }), [i]),
7
- children: r
8
- });
5
+ var r = ({ children: r, cacheId: i = "" }) => {
6
+ let a = t(() => ({ cacheId: i }), [i]);
7
+ return /* @__PURE__ */ n(e, {
8
+ value: a,
9
+ children: r
10
+ });
11
+ };
9
12
  //#endregion
10
13
  export { r as default };
@@ -21,9 +21,9 @@ var s = r(({ ref: r, children: s, id: c, loading: l = !1, disabled: u = !1, clas
21
21
  disabled: u,
22
22
  error: !!p
23
23
  }
24
- });
24
+ }), y = i(() => e(v, ["input"]), [v]);
25
25
  return /* @__PURE__ */ o(n, {
26
- className: i(() => e(v, ["input"]), [v]),
26
+ className: y,
27
27
  id: c,
28
28
  label: f,
29
29
  error: p,
@@ -102,22 +102,22 @@ var _ = [], v = ({ ref: v, className: y, id: b, label: x = "", loading: S = !1,
102
102
  e = !1;
103
103
  };
104
104
  }, [D, J]);
105
- let { editorRef: Z } = r({
106
- extensions: o(() => {
107
- let e = [
108
- K(),
109
- g.of([{
110
- key: "Tab",
111
- run: u
112
- }]),
113
- g.of([f])
114
- ];
115
- return Y && e.push(...Y), M && e.push(h.lineWrapping), e;
116
- }, [
117
- K,
118
- M,
119
- Y
120
- ]),
105
+ let Z = o(() => {
106
+ let e = [
107
+ K(),
108
+ g.of([{
109
+ key: "Tab",
110
+ run: u
111
+ }]),
112
+ g.of([f])
113
+ ];
114
+ return Y && e.push(...Y), M && e.push(h.lineWrapping), e;
115
+ }, [
116
+ K,
117
+ M,
118
+ Y
119
+ ]), { editorRef: Q } = r({
120
+ extensions: Z,
121
121
  theme: O,
122
122
  style: W,
123
123
  basicSetup: U,
@@ -127,9 +127,9 @@ var _ = [], v = ({ ref: v, className: y, id: b, label: x = "", loading: S = !1,
127
127
  value: T,
128
128
  onChange: A,
129
129
  ref: v
130
- }), Q = i((e) => {
130
+ }), $ = i((e) => {
131
131
  e.stopPropagation();
132
- }, []);
132
+ }, []), ee = i(() => A?.(""), [A]);
133
133
  return /* @__PURE__ */ l(n, {
134
134
  className: H,
135
135
  id: b,
@@ -141,11 +141,11 @@ var _ = [], v = ({ ref: v, className: y, id: b, label: x = "", loading: S = !1,
141
141
  loading: S,
142
142
  clearable: w,
143
143
  value: T,
144
- onClear: i(() => A?.(""), [A]),
144
+ onClear: ee,
145
145
  children: /* @__PURE__ */ l("div", {
146
146
  className: V.input,
147
- ref: Z,
148
- onKeyDown: Q,
147
+ ref: Q,
148
+ onKeyDown: $,
149
149
  onBlur: j
150
150
  })
151
151
  });
@@ -20,14 +20,14 @@ var ne = ["se"], re = [], d = ({ icon: d, title: ie = "Title", className: ae = "
20
20
  }), se = c(void 0), M = c(void 0), N = c(!1), P = c(m), F = c(h), [I, L] = l(!1), [R, z] = l(m), [B, V] = l(h), [H, U] = l(0), [W, G] = l(0), [ce, K] = l(!1), [le] = l(g), [ue] = l(_ - v), [q, de] = l({
21
21
  width: 0,
22
22
  height: 0
23
- }), J = o(() => !C?.current && typeof document < "u" ? document.body : C?.current, [C]), fe = c(e(o(() => {
23
+ }), J = o(() => !C?.current && typeof document < "u" ? document.body : C?.current, [C]), fe = o(() => {
24
24
  if (!N.current) {
25
25
  let e = M.current.getBoundingClientRect(), t = P.current, n = F.current;
26
26
  e.x + e.width > window.innerWidth ? t = window.innerWidth - e.width : e.x < 0 && (t = 0), e.y + e.height > window.innerHeight ? n = window.innerHeight - e.height : e.y < 0 && (n = 0), (P.current !== t || F.current !== n) && (P.current = t, F.current = n, z(t), V(n));
27
27
  }
28
- }, []), 250));
28
+ }, []), pe = c(e(fe, 250));
29
29
  s(() => {
30
- let e = fe.current;
30
+ let e = pe.current;
31
31
  return window.addEventListener("resize", e), () => {
32
32
  N.current = !0, window.removeEventListener("resize", e);
33
33
  };
@@ -52,7 +52,7 @@ var ne = ["se"], re = [], d = ({ icon: d, title: ie = "Title", className: ae = "
52
52
  s(() => (I && (window.addEventListener("mousemove", Y, !1), window.addEventListener("mouseup", X, !1), window.addEventListener("touchmove", Z, !1), window.addEventListener("touchend", Q, !1)), () => {
53
53
  I && (window.removeEventListener("mousemove", Y, !1), window.removeEventListener("mouseup", X, !1), window.removeEventListener("touchmove", Z, !1), window.removeEventListener("touchend", Q, !1));
54
54
  }), [I, q]);
55
- let pe = (e) => {
55
+ let me = (e) => {
56
56
  let t;
57
57
  p === "parent" ? (M.current.parentNode || (t = {
58
58
  height: window.innerHeight,
@@ -61,7 +61,7 @@ var ne = ["se"], re = [], d = ({ icon: d, title: ie = "Title", className: ae = "
61
61
  height: window.innerHeight,
62
62
  width: window.innerWidth
63
63
  }, e.button === 0 ? (J()?.classList.add("moving"), L(!0), de(t), U(e.clientX), G(e.clientY), D?.(e)) : (L(!1), z(P.current), V(F.current));
64
- }, me = () => K((e) => !e), Z = o((e) => {
64
+ }, he = () => K((e) => !e), Z = o((e) => {
65
65
  if (e.stopPropagation(), e.changedTouches.length > 1 && e.preventDefault(), I) {
66
66
  let t = M.current.getBoundingClientRect(), { clientX: n, clientY: r } = e.touches[0], i = R + n - H, a = B + r - W;
67
67
  i + t.width > window.innerWidth ? i = window.innerWidth - t.width : i < 0 && (i = 0), a + t.height > window.innerHeight ? a = window.innerHeight - t.height : a < 0 && (a = 0), P.current = i, F.current = a, M.current.style.left = `${i}px`, M.current.style.top = `${a}px`;
@@ -74,11 +74,11 @@ var ne = ["se"], re = [], d = ({ icon: d, title: ie = "Title", className: ae = "
74
74
  B
75
75
  ]), Q = o(() => {
76
76
  L(!1), z(P.current), V(F.current);
77
- }, []), he = o((e) => {
77
+ }, []), ge = o((e) => {
78
78
  e.stopPropagation(), L(!0), U(e.touches[0].clientX), G(e.touches[0].clientY), D?.(e);
79
79
  }, [D]);
80
80
  if (ce) return /* @__PURE__ */ u(r, {
81
- onClose: me,
81
+ onClose: he,
82
82
  width: g,
83
83
  height: _ - v,
84
84
  top: F.current,
@@ -119,8 +119,8 @@ var ne = ["se"], re = [], d = ({ icon: d, title: ie = "Title", className: ae = "
119
119
  setExternalWindow: K,
120
120
  onClose: E,
121
121
  onCollapse: O,
122
- onMouseDown: pe,
123
- onTouchStart: he
122
+ onMouseDown: me,
123
+ onTouchStart: ge
124
124
  }), /* @__PURE__ */ u(i, {
125
125
  ref: se,
126
126
  parentRef: C,
@@ -49,23 +49,23 @@ var m = ({ ref: m, children: h, containerTopOffset: g = 0, containerLeftOffset:
49
49
  C,
50
50
  A,
51
51
  j
52
+ ]), P = l(() => ({
53
+ placement: C,
54
+ triggerRef: A,
55
+ container: w,
56
+ containerTopOffset: g,
57
+ containerLeftOffset: _,
58
+ setOpen: O
59
+ }), [
60
+ C,
61
+ A,
62
+ w,
63
+ g,
64
+ _,
65
+ O
52
66
  ]);
53
67
  return /* @__PURE__ */ p(d, { children: [M, /* @__PURE__ */ f(e, {
54
- value: l(() => ({
55
- placement: C,
56
- triggerRef: A,
57
- container: w,
58
- containerTopOffset: g,
59
- containerLeftOffset: _,
60
- setOpen: O
61
- }), [
62
- C,
63
- A,
64
- w,
65
- g,
66
- _,
67
- O
68
- ]),
68
+ value: P,
69
69
  children: /* @__PURE__ */ f(t, {
70
70
  ref: E,
71
71
  open: D,
@@ -37,7 +37,7 @@ var f = ["se"], p = ({ ref: p, className: m, parentRef: h, hoverMode: g = !1, au
37
37
  let t = e.clientX, n = e.clientY, i = (t - L) / S, a = (n - U) / S, o = (C === "both" || C === "x") && ["n", "s"].indexOf(z ?? "") === -1, s = (C === "both" || C === "y") && ["e", "w"].indexOf(z ?? "") === -1, c = z?.includes("w") || z?.includes("n");
38
38
  if (Array.isArray(b) && ([i, a] = r(i, a, b), !i && !a)) return;
39
39
  let l = V + (o ? i : 0), u = H + (s ? a : 0);
40
- c && (l = V - (o ? i : 0), u = H - (s ? a : 0)), !(l === V && u === H) && ([l, u] = J(l, u, c), K?.(l, u), V !== Infinity && G.current && (G.current.style.width = `${l}px`), H !== Infinity && G.current && (G.current.style.height = `${u}px`));
40
+ c && (l = V - (o ? i : 0), u = H - (s ? a : 0)), (l !== V || u !== H) && ([l, u] = J(l, u, c), K?.(l, u), V !== Infinity && G.current && (G.current.style.width = `${l}px`), H !== Infinity && G.current && (G.current.style.height = `${u}px`));
41
41
  }, [
42
42
  C,
43
43
  L,
@@ -1,10 +1,13 @@
1
1
  import { useRef as e } from "react";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  //#region src/components/ContainerShadow/ContainerShadowStyle.tsx
4
- var n = ({ children: n, ...r }) => /* @__PURE__ */ t("style", {
5
- ref: e(null),
6
- ...r,
7
- children: n
8
- });
4
+ var n = ({ children: n, ...r }) => {
5
+ let i = e(null);
6
+ return /* @__PURE__ */ t("style", {
7
+ ref: i,
8
+ ...r,
9
+ children: n
10
+ });
11
+ };
9
12
  //#endregion
10
13
  export { n as default };
@@ -49,7 +49,7 @@ var y = [
49
49
  let r = e[n];
50
50
  t = !K(r) || t;
51
51
  }
52
- return t ? !1 : (d.multiple, d.onChange?.(e), R?.(void 0), !0);
52
+ return !t && (d.multiple, d.onChange?.(e), R?.(void 0), !0);
53
53
  }
54
54
  return !1;
55
55
  }, [
@@ -6,24 +6,27 @@ var r = [
6
6
  "jpeg",
7
7
  "jpg",
8
8
  "png"
9
- ], i = ({ className: i = "", minSize: a = 0, maxSize: o = Infinity, types: s = r }) => /* @__PURE__ */ n("div", {
10
- title: t(() => {
9
+ ], i = ({ className: i = "", minSize: a = 0, maxSize: o = Infinity, types: s = r }) => {
10
+ let c = t(() => {
11
11
  let t = [];
12
12
  return o && t.push(`Max size: ${e(o)}`), a && t.push(`Min size: ${e(a)}`), t.push(`types: ${s.join(", ")}`), t.join(" | ");
13
13
  }, [
14
14
  o,
15
15
  a,
16
16
  s
17
- ]),
18
- className: i,
19
- children: [s.join(", "), o && o !== Infinity && /* @__PURE__ */ n("span", {
20
- className: "inline-block uppercase mx-1 text-inherit",
21
- children: [
22
- "(",
23
- e(o),
24
- ")"
25
- ]
26
- })]
27
- });
17
+ ]);
18
+ return /* @__PURE__ */ n("div", {
19
+ title: c,
20
+ className: i,
21
+ children: [s.join(", "), o && o !== Infinity && /* @__PURE__ */ n("span", {
22
+ className: "inline-block uppercase mx-1 text-inherit",
23
+ children: [
24
+ "(",
25
+ e(o),
26
+ ")"
27
+ ]
28
+ })]
29
+ });
30
+ };
28
31
  //#endregion
29
32
  export { i as default };
@@ -1,8 +1,8 @@
1
1
  import e from "../../../../hooks/useTheme/index.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
3
  //#region src/components/FileUpload/components/FileUploadMessage/FileUploadMessage.tsx
4
- var r = ({ className: r = "", label: i = "", hasFiles: a = !1, disabled: o = !1, error: s, intent: c, size: l, canDragAndDrop: u }) => /* @__PURE__ */ n("div", {
5
- className: e("FileUpload", {
4
+ var r = ({ className: r = "", label: i = "", hasFiles: a = !1, disabled: o = !1, error: s, intent: c, size: l, canDragAndDrop: u }) => {
5
+ let d = e("FileUpload", {
6
6
  className: r,
7
7
  componentKey: ["label"],
8
8
  variants: {
@@ -12,25 +12,28 @@ var r = ({ className: r = "", label: i = "", hasFiles: a = !1, disabled: o = !1,
12
12
  disabled: o,
13
13
  canDragAndDrop: u
14
14
  }
15
- }).label,
16
- children: [
17
- i && /* @__PURE__ */ t("span", {
18
- className: "text-inherit",
19
- children: i
20
- }),
21
- /* @__PURE__ */ n("span", {
22
- className: "text-inherit",
23
- children: [/* @__PURE__ */ t("span", {
24
- className: "font-bold underline text-inherit",
25
- children: "Click to Upload"
26
- }), /* @__PURE__ */ t("span", {
15
+ });
16
+ return /* @__PURE__ */ n("div", {
17
+ className: d.label,
18
+ children: [
19
+ i && /* @__PURE__ */ t("span", {
27
20
  className: "text-inherit",
28
- children: " or drop a file here"
29
- })]
30
- }),
31
- a && /* @__PURE__ */ t("span", { children: "Added Successfully!. Add another?" }),
32
- s && /* @__PURE__ */ t("span", { children: typeof s == "boolean" ? "This field is invalid" : s })
33
- ]
34
- });
21
+ children: i
22
+ }),
23
+ /* @__PURE__ */ n("span", {
24
+ className: "text-inherit",
25
+ children: [/* @__PURE__ */ t("span", {
26
+ className: "font-bold underline text-inherit",
27
+ children: "Click to Upload"
28
+ }), /* @__PURE__ */ t("span", {
29
+ className: "text-inherit",
30
+ children: " or drop a file here"
31
+ })]
32
+ }),
33
+ a && /* @__PURE__ */ t("span", { children: "Added Successfully!. Add another?" }),
34
+ s && /* @__PURE__ */ t("span", { children: typeof s == "boolean" ? "This field is invalid" : s })
35
+ ]
36
+ });
37
+ };
35
38
  //#endregion
36
39
  export { r as default };
@@ -14,7 +14,7 @@ var s = Object.assign(r(({ ref: t, children: r, className: s = "", id: c, label:
14
14
  error: !!b,
15
15
  inline: m
16
16
  }
17
- }), T = i((e) => S?.(e.target.value), [S]);
17
+ }), T = i((e) => S?.(e.target.value), [S]), E = i(() => S?.(""), [S]);
18
18
  return /* @__PURE__ */ o(n, {
19
19
  className: s,
20
20
  id: c,
@@ -27,7 +27,7 @@ var s = Object.assign(r(({ ref: t, children: r, className: s = "", id: c, label:
27
27
  error: b,
28
28
  intent: v,
29
29
  size: _,
30
- onClear: i(() => S?.(""), [S]),
30
+ onClear: E,
31
31
  ...x,
32
32
  children: [r, /* @__PURE__ */ a("input", {
33
33
  ref: t,
@@ -27,8 +27,8 @@ var u = ({ className: u, id: d, size: f, value: p, disabled: m = !1, label: h, e
27
27
  w
28
28
  ]), O = o((e) => {
29
29
  if (!b) return;
30
- let t = E.filter((t, n) => n !== e), r = n(t.map(([e, t]) => [...e.split("."), t]));
31
- w?.(t, r);
30
+ let t = E.filter((t, n) => n !== e), r = t.map(([e, t]) => [...e.split("."), t]), i = n(r);
31
+ w?.(t, i);
32
32
  }, [
33
33
  E,
34
34
  b,
@@ -42,21 +42,23 @@ var v = ({ ref: e, className: r, children: v, open: y, disabled: b = !1, testId:
42
42
  A,
43
43
  x
44
44
  ]);
45
- return u(() => {
45
+ u(() => {
46
46
  if (T) return document.addEventListener("mousedown", k), () => {
47
47
  document.removeEventListener("mousedown", k);
48
48
  };
49
- }, [k, T]), /* @__PURE__ */ _(h, { children: [j, /* @__PURE__ */ g(t, {
50
- value: f(() => ({
51
- open: T,
52
- placement: S,
53
- triggerRef: D,
54
- container: C
55
- }), [
56
- T,
57
- S,
58
- C
59
- ]),
49
+ }, [k, T]);
50
+ let N = f(() => ({
51
+ open: T,
52
+ placement: S,
53
+ triggerRef: D,
54
+ container: C
55
+ }), [
56
+ T,
57
+ S,
58
+ C
59
+ ]);
60
+ return /* @__PURE__ */ _(h, { children: [j, /* @__PURE__ */ g(t, {
61
+ value: N,
60
62
  children: /* @__PURE__ */ g(n, {
61
63
  open: T,
62
64
  className: r,
@@ -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
  };
@@ -71,37 +71,37 @@ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSub
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]);
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
+ ]);
75
103
  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
- ]),
104
+ value: j,
105
105
  children: d
106
106
  });
107
107
  };
@@ -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":
@@ -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,
@@ -3,6 +3,10 @@ import { getTime as e, isValid as t, parse as n, parseISO as r } from "date-fns"
3
3
  var i = (t) => {
4
4
  let n;
5
5
  return n = typeof t == "number" ? t < 0xe8d4a51000 ? /* @__PURE__ */ new Date(t * 1e3) : new Date(t) : typeof t == "string" ? r(t) : t, Math.floor(e(n) / 1e3).toString();
6
- }, a = (e) => typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e) ? !1 : t(n(e, "yyyy-MM-dd", /* @__PURE__ */ new Date()));
6
+ }, a = (e) => {
7
+ if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return !1;
8
+ let r = n(e, "yyyy-MM-dd", /* @__PURE__ */ new Date());
9
+ return t(r);
10
+ };
7
11
  //#endregion
8
12
  export { a as isDate, i as toUnixSeconds };
@@ -1,9 +1,10 @@
1
1
  import { debounce as e } from "./debounce.js";
2
2
  //#region src/helpers/lodash/throttle.ts
3
3
  function t(t, n = 0, r = {}) {
4
+ let i = r.leading ?? !0, a = r.trailing ?? !0;
4
5
  return e(t, n, {
5
- leading: r.leading ?? !0,
6
- trailing: r.trailing ?? !0,
6
+ leading: i,
7
+ trailing: a,
7
8
  maxWait: n
8
9
  });
9
10
  }
@@ -11,7 +11,7 @@ var e = (e, t, n) => {
11
11
  oldValue: t,
12
12
  newValue: n
13
13
  } }));
14
- }, t = 3600 * 24 * 365, n = () => {
14
+ }, t = 31536e3, n = () => {
15
15
  let e = {};
16
16
  if (typeof document > "u" || !document.cookie) return e;
17
17
  for (let t of document.cookie.split(";")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plitzi/plitzi-ui",
3
- "version": "1.6.18",
3
+ "version": "1.6.19",
4
4
  "homepage": "./",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
@@ -98,8 +98,8 @@
98
98
  "@codemirror/search": "^6.7.1",
99
99
  "@codemirror/state": "^6.7.1",
100
100
  "@codemirror/theme-one-dark": "^6.1.3",
101
- "@codemirror/view": "^6.43.6",
102
- "@hookform/resolvers": "^5.4.0",
101
+ "@codemirror/view": "^6.43.7",
102
+ "@hookform/resolvers": "^5.6.0",
103
103
  "@uiw/color-convert": "^2.10.3",
104
104
  "@uiw/react-color-sketch": "^2.10.3",
105
105
  "class-variance-authority": "^0.7.1",
@@ -108,7 +108,7 @@
108
108
  "immer": "^11.1.15",
109
109
  "react": "^19.2.8",
110
110
  "react-dom": "^19.2.8",
111
- "react-hook-form": "^7.82.0",
111
+ "react-hook-form": "^7.84.0",
112
112
  "react-markdown": "^10.1.0",
113
113
  "react-syntax-highlighter": "^16.1.1",
114
114
  "react-toastify": "^11.1.0",
@@ -125,25 +125,25 @@
125
125
  "@eslint/js": "^10.0.1",
126
126
  "@storybook/addon-actions": "^9.0.8",
127
127
  "@storybook/addon-controls": "^9.0.8",
128
- "@storybook/addon-links": "^10.5.3",
128
+ "@storybook/addon-links": "^10.5.5",
129
129
  "@storybook/addon-styling-webpack": "^3.0.2",
130
- "@storybook/react": "^10.5.3",
131
- "@storybook/react-vite": "^10.5.3",
130
+ "@storybook/react": "^10.5.5",
131
+ "@storybook/react-vite": "^10.5.5",
132
132
  "@tailwindcss/forms": "^0.5.11",
133
133
  "@tailwindcss/postcss": "^4.3.3",
134
134
  "@tailwindcss/vite": "^4.3.3",
135
135
  "@testing-library/dom": "^10.4.1",
136
136
  "@testing-library/jest-dom": "^7.0.0",
137
137
  "@testing-library/react": "^16.3.2",
138
- "@types/lodash": "^4.17.24",
138
+ "@types/lodash": "^4.17.25",
139
139
  "@types/lodash-es": "^4.17.12",
140
- "@types/node": "^26.1.1",
141
- "@types/react": "^19.2.17",
140
+ "@types/node": "^26.1.2",
141
+ "@types/react": "^19.2.18",
142
142
  "@types/react-color": "^3.0.13",
143
- "@types/react-dom": "^19.2.3",
143
+ "@types/react-dom": "^19.2.4",
144
144
  "@types/react-syntax-highlighter": "^15.5.13",
145
145
  "@types/tinycolor2": "^1.4.6",
146
- "@vitejs/plugin-react": "^6.0.4",
146
+ "@vitejs/plugin-react": "^6.0.5",
147
147
  "cssnano": "^8.0.2",
148
148
  "eslint": "^9.39.5",
149
149
  "eslint-plugin-import": "^2.32.0",
@@ -151,24 +151,24 @@
151
151
  "eslint-plugin-react": "^7.37.5",
152
152
  "eslint-plugin-react-hooks": "^7.1.1",
153
153
  "eslint-plugin-react-refresh": "^0.5.3",
154
- "eslint-plugin-storybook": "^10.5.3",
155
- "flow-bin": "^0.323.0",
156
- "globals": "^17.7.0",
157
- "jsdom": "^29.1.1",
154
+ "eslint-plugin-storybook": "^10.5.5",
155
+ "flow-bin": "^0.325.0",
156
+ "globals": "^17.8.0",
157
+ "jsdom": "^30.0.1",
158
158
  "lodash": "^4.18.1",
159
159
  "lodash-es": "^4.18.1",
160
- "postcss": "^8.5.22",
160
+ "postcss": "^8.5.25",
161
161
  "postcss-scss": "^4.0.9",
162
162
  "prettier": "^3.9.6",
163
- "sass": "^1.101.7",
164
- "storybook": "^10.5.3",
163
+ "sass": "^1.102.0",
164
+ "storybook": "^10.5.5",
165
165
  "stylelint": "^17.14.1",
166
166
  "stylelint-order": "^8.1.1",
167
167
  "stylelint-scss": "^7.2.0",
168
168
  "tailwindcss": "4.3.3",
169
169
  "typescript": "^6.0.3",
170
170
  "typescript-eslint": "^8.65.0",
171
- "vite": "^8.1.5",
171
+ "vite": "^8.2.0",
172
172
  "vite-plugin-dts": "^5.0.3",
173
173
  "vite-plugin-static-copy": "^4.1.1",
174
174
  "vitest": "^4.1.10",