@plitzi/plitzi-ui 1.6.17 → 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.
- package/dist/components/Accordion/helpers/AccordionManager.js +2 -1
- package/dist/components/Cache/CacheProvider.js +7 -4
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/CodeMirror/CodeMirror.js +21 -21
- package/dist/components/ContainerDraggable/ContainerDraggable.js +9 -9
- package/dist/components/ContainerFloating/ContainerFloating.js +15 -15
- package/dist/components/ContainerResizable/ContainerResizable.js +1 -1
- package/dist/components/ContainerShadow/ContainerShadowStyle.js +8 -5
- package/dist/components/FileUpload/FileUpload.js +1 -1
- package/dist/components/FileUpload/components/DrawTypes/DrawTypes.js +16 -13
- package/dist/components/FileUpload/components/FileUploadMessage/FileUploadMessage.js +24 -21
- package/dist/components/Input/Input.js +2 -2
- package/dist/components/KVInput/KVInput.js +2 -2
- package/dist/components/MenuList/MenuList.js +14 -12
- package/dist/components/MenuList/MenuListContainer.js +8 -6
- package/dist/components/MetricInput/MetricInput.js +1 -4
- package/dist/components/Modal/ModalProvider.js +5 -5
- package/dist/components/Popup/PopupProvider.js +61 -61
- package/dist/components/Provider/providers/ThemeProvider/ThemeProvider.js +12 -12
- package/dist/components/QueryBuilder/QueryBuilderProvider.js +30 -30
- package/dist/components/QueryBuilder/RuleValue.js +7 -1
- package/dist/components/QueryBuilder/helpers/QueryBuilderEvaluator.js +1 -5
- package/dist/components/Sidebar/SidebarProvider.js +7 -4
- package/dist/components/Switch/Switch.js +2 -2
- package/dist/components/TextArea/TextArea.js +2 -2
- package/dist/components/Toast/ToastProvider.js +2 -2
- package/dist/helpers/formatDate.js +5 -1
- package/dist/helpers/lodash/throttle.js +3 -2
- package/dist/hooks/useStorage/useStorageHelper.js +1 -1
- package/dist/plitzi-ui.css +1 -1
- package/package.json +26 -26
|
@@ -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:
|
|
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(() =>
|
|
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 }) =>
|
|
6
|
-
|
|
7
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
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) =>
|
|
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:
|
|
6
|
-
trailing:
|
|
6
|
+
leading: i,
|
|
7
|
+
trailing: a,
|
|
7
8
|
maxWait: n
|
|
8
9
|
});
|
|
9
10
|
}
|