@ztwoint/z-ui 0.1.116 → 0.1.118

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.
@@ -11,8 +11,8 @@ import E from "../assets/icons/circle-check-filled.js";
11
11
  import { getFilterCount as G } from "./selected-filters-display/selected-filters-display.utils.js";
12
12
  import { FilterConfirmationDialog as H } from "./close-filter-confirm/filter-confirmation-dialog.js";
13
13
  import { hasUnsavedFilterChangesForColumn as A } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
14
- const re = ({ filterName: l }) => {
15
- const [T, i] = k.useState(!1), [f, s] = k.useState(!1), {
14
+ const re = ({ filterName: n }) => {
15
+ const [T, a] = k.useState(!1), [f, s] = k.useState(!1), {
16
16
  getFilterForColumn: C,
17
17
  hasAppliedFilterForColumn: O,
18
18
  updateColumnFilter: g,
@@ -23,35 +23,35 @@ const re = ({ filterName: l }) => {
23
23
  tempFilters: v,
24
24
  filter: p
25
25
  } = L(), N = (o) => {
26
- !o && f ? A(l, v, p.value) ? i(!0) : s(!1) : s(o);
26
+ !o && f ? A(n, v, p.value) ? a(!0) : s(!1) : s(o);
27
27
  }, $ = () => {
28
- c(), i(!1), s(!1);
28
+ c(), a(!1), s(!1);
29
29
  }, D = () => {
30
- P(), i(!1), s(!1);
30
+ P(), a(!1), s(!1);
31
31
  }, R = () => {
32
- i(!1);
33
- }, b = A(l, v, p.value), t = j.find((o) => o.filterKey === l), n = K(
34
- () => C(l),
35
- [l, C]
32
+ a(!1);
33
+ }, x = A(n, v, p.value), t = j.find((o) => o.filterKey === n), l = K(
34
+ () => C(n),
35
+ [n, C]
36
36
  );
37
37
  if (!t)
38
- return console.warn(`Column "${l}" not found in schema`), null;
38
+ return console.warn(`Column "${n}" not found in schema`), null;
39
39
  const S = {
40
40
  boolean: M,
41
41
  string: _,
42
42
  number: U,
43
43
  checkbox: q
44
- }, x = t.type && (m == null ? void 0 : m[t.type]) || S[t.type ?? "string"], h = O(l), F = p.loading || !1, y = t.options ? Object.entries(t.options).map(([o, a]) => ({
44
+ }, b = t.type && (m == null ? void 0 : m[t.type]) || S[t.type ?? "string"], h = O(n), F = p.loading || !1, y = t.options ? Object.entries(t.options).map(([o, i]) => ({
45
45
  label: o,
46
46
  value: o,
47
- total: a
48
- })) : void 0, w = n ? G(n, y) : void 0, z = n != null && n.value ? Array.isArray(n.value) ? n.value.length : 1 : 0, B = () => {
49
- const o = g(l, "", "");
47
+ total: i
48
+ })) : void 0, w = l ? G(l, y) : void 0, z = l != null && l.value ? Array.isArray(l.value) ? l.value.length : 1 : 0, B = () => {
49
+ const o = g(n, "", "");
50
50
  c(o), s(!1);
51
51
  }, I = () => {
52
52
  c(), s(!1);
53
53
  };
54
- return x ? /* @__PURE__ */ r(d.Root, { open: f, onOpenChange: N, children: [
54
+ return b ? /* @__PURE__ */ r(d.Root, { open: f, onOpenChange: N, children: [
55
55
  /* @__PURE__ */ e(d.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
56
56
  u,
57
57
  {
@@ -67,7 +67,7 @@ const re = ({ filterName: l }) => {
67
67
  t.title
68
68
  ] }),
69
69
  h && /* @__PURE__ */ e(E, { className: "w-4 h-4 text-white flex-shrink-0" }),
70
- F && /* @__PURE__ */ e("div", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin flex-shrink-0" })
70
+ F && /* @__PURE__ */ e("div", { className: "w-4 h-4 border-2 border-text-brand-secondary rounded-full animate-spin flex-shrink-0" })
71
71
  ] })
72
72
  }
73
73
  ) }),
@@ -79,19 +79,19 @@ const re = ({ filterName: l }) => {
79
79
  align: "start",
80
80
  children: [
81
81
  F ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "flex flex-col items-center gap-3", children: [
82
- /* @__PURE__ */ e("div", { className: "w-8 h-8 border-2 border-stroke-solid-medium border-t-stroke-solid-strong rounded-full animate-spin" }),
82
+ /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
83
83
  /* @__PURE__ */ e("span", { className: "text-text-neutral-muted text-sm", children: "Loading options..." })
84
84
  ] }) }) : /* @__PURE__ */ e(
85
- x,
85
+ b,
86
86
  {
87
- value: n,
88
- onChange: ({ condition: o, value: a }) => g(l, o, a),
87
+ value: l,
88
+ onChange: ({ condition: o, value: i }) => g(n, o, i),
89
89
  filterOptions: y
90
90
  }
91
91
  ),
92
- (b || !!z) && /* @__PURE__ */ r("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
92
+ (x || !!z) && /* @__PURE__ */ r("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
93
93
  /* @__PURE__ */ e(u, { onClick: B, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
94
- b && /* @__PURE__ */ e(u, { onClick: I, variant: "filled", shade: "neutral", size: "small", children: `Apply${w !== void 0 ? ` ${w}` : ""}` })
94
+ x && /* @__PURE__ */ e(u, { onClick: I, variant: "filled", shade: "neutral", size: "small", children: `Apply${w !== void 0 ? ` ${w}` : ""}` })
95
95
  ] })
96
96
  ]
97
97
  }