@plitzi/plitzi-ui 1.6.19 → 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.
@@ -27,25 +27,27 @@ var u = ({ ref: u, children: d, testId: f, className: p = "", iconPlacement: m =
27
27
  e.contentChildren = n;
28
28
  return;
29
29
  }
30
- if (i(n)) if (n.type === t) {
31
- let t = n.props;
32
- e.iconChildren = r(n, {
33
- className: l(T.icon, t.className),
34
- size: v,
35
- testId: f ? `${f}-icon` : void 0,
36
- ...t,
37
- intent: t.intent ?? "custom"
38
- });
39
- } else if (n.type === "i") {
40
- let t = n.props;
41
- e.iconChildren = r(n, {
42
- className: l(T.icon, t.className),
43
- size: v,
44
- "data-testid": f ? `${f}-icon` : void 0,
45
- ...t,
46
- intent: t.intent ?? "custom"
47
- });
48
- } else e.contentChildren = n;
30
+ if (i(n)) {
31
+ if (n.type === t) {
32
+ let t = n.props;
33
+ e.iconChildren = r(n, {
34
+ className: l(T.icon, t.className),
35
+ size: v,
36
+ testId: f ? `${f}-icon` : void 0,
37
+ ...t,
38
+ intent: t.intent ?? "custom"
39
+ });
40
+ } else if (n.type === "i") {
41
+ let t = n.props;
42
+ e.iconChildren = r(n, {
43
+ className: l(T.icon, t.className),
44
+ size: v,
45
+ "data-testid": f ? `${f}-icon` : void 0,
46
+ ...t,
47
+ intent: t.intent ?? "custom"
48
+ });
49
+ } else e.contentChildren = n;
50
+ }
49
51
  }), e;
50
52
  }, [
51
53
  d,
@@ -25,23 +25,25 @@ var l = ({ ref: l, className: u, children: d, closeable: f, testId: p, intent: m
25
25
  e.content.push(t);
26
26
  return;
27
27
  }
28
- if (a(t)) if (t.type === n) {
29
- let n = t.props;
30
- e.icon = i(t, {
31
- testId: p ? `${p}-icon` : void 0,
32
- ...n,
33
- intent: n.intent ?? "custom",
34
- size: h
35
- });
36
- } else if (t.type === "i") {
37
- let n = t.props;
38
- e.icon = i(t, {
39
- "data-testid": p ? `${p}-icon` : void 0,
40
- ...n,
41
- intent: n.intent ?? "custom",
42
- size: h
43
- });
44
- } else e.content.push(t);
28
+ if (a(t)) {
29
+ if (t.type === n) {
30
+ let n = t.props;
31
+ e.icon = i(t, {
32
+ testId: p ? `${p}-icon` : void 0,
33
+ ...n,
34
+ intent: n.intent ?? "custom",
35
+ size: h
36
+ });
37
+ } else if (t.type === "i") {
38
+ let n = t.props;
39
+ e.icon = i(t, {
40
+ "data-testid": p ? `${p}-icon` : void 0,
41
+ ...n,
42
+ intent: n.intent ?? "custom",
43
+ size: h
44
+ });
45
+ } else e.content.push(t);
46
+ }
45
47
  }), e;
46
48
  }, [
47
49
  d,
@@ -14,12 +14,14 @@ var f = ["se"], p = ({ ref: p, className: m, parentRef: h, hoverMode: g = !1, au
14
14
  o(p, () => W.current, [W]);
15
15
  let G = c(null), K = s(() => A ? e(A, 150) : void 0, [A]), q = i(() => !h?.current && typeof document < "u" ? document.body : h?.current, [h]), J = i((e, t, n = !1) => {
16
16
  let [r, i] = [[T, E], [D, O]];
17
- if (w) if (t === F) {
18
- let n = N / F;
19
- t = e / n, e = t * n;
20
- } else {
21
- let n = F / N;
22
- e = t / n, t = e * n;
17
+ if (w) {
18
+ if (t === F) {
19
+ let n = N / F;
20
+ t = e / n, e = t * n;
21
+ } else {
22
+ let n = F / N;
23
+ e = t / n, t = e * n;
24
+ }
23
25
  }
24
26
  r[0] && r[1] && (e = Math.max(r[0], e), t = Math.max(r[1], t)), i[0] && i[1] && (e = Math.min(i[0], e), t = Math.min(i[1], t));
25
27
  let a = W.current?.getBoundingClientRect();
@@ -14,11 +14,11 @@ declare const _default: {
14
14
  root: (props?: ({
15
15
  direction?: "column" | "row" | "row-reverse" | "col-reverse" | null | undefined;
16
16
  grow?: boolean | null | undefined;
17
- basis?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | "auto" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full" | null | undefined;
17
+ basis?: 0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | "auto" | "px" | "0.5" | "1.5" | "2.5" | "3.5" | "1/2" | "1/3" | "2/3" | "1/4" | "2/4" | "3/4" | "1/5" | "2/5" | "3/5" | "4/5" | "1/6" | "2/6" | "3/6" | "4/6" | "5/6" | "1/12" | "2/12" | "3/12" | "4/12" | "5/12" | "6/12" | "7/12" | "8/12" | "9/12" | "10/12" | "11/12" | "full" | null | undefined;
18
18
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | null | undefined;
19
19
  items?: "start" | "end" | "center" | "baseline" | "stretch" | null | undefined;
20
20
  justify?: "start" | "end" | "center" | "stretch" | "normal" | "between" | "around" | "evenly" | null | undefined;
21
- gap?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 1.5 | null | undefined;
21
+ gap?: 0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 14 | 16 | 1.5 | null | undefined;
22
22
  shrink?: 0 | 1 | null | undefined;
23
23
  alignItems?: "start" | "end" | "center" | "baseline" | "stretch" | null | undefined;
24
24
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
@@ -9,12 +9,12 @@ import s from "./fields/FormSelect2.js";
9
9
  import c from "./fields/FormSwitch.js";
10
10
  import l from "./fields/FormTextArea.js";
11
11
  import { fields_exports as u } from "./fields/index.js";
12
- import d from "./Form.js";
13
- import f from "./Form.styles.js";
14
- import p from "./hooks/useForm.js";
15
- import m from "./hooks/useFormWatch.js";
12
+ import d from "./hooks/useForm.js";
13
+ import f from "./hooks/useFormWatch.js";
14
+ import p from "./Form.js";
15
+ import m from "./Form.styles.js";
16
16
  import { useFieldArray as h, useFormContext as g } from "react-hook-form";
17
17
  //#region src/components/Form/index.ts
18
- var _ = d;
18
+ var _ = p;
19
19
  //#endregion
20
- export { e as Checkbox, t as Color, n as Conditional, r as Custom, i as FileUpload, a as Input, o as Select, s as Select2, c as Switch, l as TextArea, _ as default, u as fields, f as formTheme, h as useFieldArray, p as useForm, g as useFormContext, m as useFormWatch };
20
+ export { e as Checkbox, t as Color, n as Conditional, r as Custom, i as FileUpload, a as Input, o as Select, s as Select2, c as Switch, l as TextArea, _ as default, u as fields, m as formTheme, h as useFieldArray, d as useForm, g as useFormContext, f as useFormWatch };
@@ -31,15 +31,17 @@ var f = ({ ref: f, className: p, id: m, label: h, error: g, disabled: _, intent:
31
31
  inputChildren: []
32
32
  };
33
33
  return i.forEach(x, (n) => {
34
- if (o(n)) if (n.type === t) {
35
- let t = n.props;
36
- e.iconChildren = a(n, {
37
- className: d(O.icon, t.className),
38
- size: y,
39
- ...t,
40
- intent: t.intent ?? "custom"
41
- });
42
- } else e.inputChildren.push(n);
34
+ if (o(n)) {
35
+ if (n.type === t) {
36
+ let t = n.props;
37
+ e.iconChildren = a(n, {
38
+ className: d(O.icon, t.className),
39
+ size: y,
40
+ ...t,
41
+ intent: t.intent ?? "custom"
42
+ });
43
+ } else e.inputChildren.push(n);
44
+ }
43
45
  }), e;
44
46
  }, [
45
47
  x,
@@ -35,27 +35,29 @@ var v = ({ className: v, children: y, value: b, disabled: x, testId: S, onSelect
35
35
  e.content.push(n);
36
36
  return;
37
37
  }
38
- if (c(n)) if (n.type === t) {
39
- let t = n.props;
40
- e.icon = s(n, {
41
- testId: S ? `${S}-icon` : void 0,
42
- ...t,
43
- intent: "custom"
44
- });
45
- } else if (n.type === a) {
46
- let t = n.props;
47
- e.subMenu = s(n, {
48
- testId: S ? `${S}-menu` : void 0,
49
- ...t,
50
- onSelect: C
51
- });
52
- } else {
53
- let t = n.props;
54
- e.content.push(s(n, {
55
- key: r,
56
- testId: S ? `${S}-${r}` : void 0,
57
- ...t
58
- }));
38
+ if (c(n)) {
39
+ if (n.type === t) {
40
+ let t = n.props;
41
+ e.icon = s(n, {
42
+ testId: S ? `${S}-icon` : void 0,
43
+ ...t,
44
+ intent: "custom"
45
+ });
46
+ } else if (n.type === a) {
47
+ let t = n.props;
48
+ e.subMenu = s(n, {
49
+ testId: S ? `${S}-menu` : void 0,
50
+ ...t,
51
+ onSelect: C
52
+ });
53
+ } else {
54
+ let t = n.props;
55
+ e.content.push(s(n, {
56
+ key: r,
57
+ testId: S ? `${S}-${r}` : void 0,
58
+ ...t
59
+ }));
60
+ }
59
61
  }
60
62
  }), e;
61
63
  }, [
@@ -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,19 +52,19 @@ 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 ?? "", "");
@@ -100,7 +100,7 @@ var d = ({ children: d, query: f, fields: p, allowDisableRules: m = !0, allowSub
100
100
  g,
101
101
  _
102
102
  ]);
103
- return /* @__PURE__ */ c(r, {
103
+ return /* @__PURE__ */ c(i, {
104
104
  value: j,
105
105
  children: d
106
106
  });
@@ -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,
@@ -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
  }, [