@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.
- package/dist/components/assets/icons/double-chevron-left.js +1 -2
- package/dist/components/assets/icons/double-chevron-right.js +1 -2
- package/dist/components/dynamic-table/z2-table-pagination.d.ts +2 -0
- package/dist/components/dynamic-table/z2-table-pagination.js +113 -64
- package/dist/components/dynamic-table/z2-table.js +162 -137
- package/dist/components/skeleton/skeleton.js +5 -5
- package/dist/components/table/table.const.d.ts +3 -3
- package/dist/components/table/table.const.js +6 -6
- package/dist/components/table-filter/table-filter-column-button.js +22 -22
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/dynamic-table/z2-table-pagination.d.ts +2 -0
- package/dist/types/components/table/table.const.d.ts +3 -3
- package/package.json +1 -1
|
@@ -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:
|
|
15
|
-
const [T,
|
|
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(
|
|
26
|
+
!o && f ? A(n, v, p.value) ? a(!0) : s(!1) : s(o);
|
|
27
27
|
}, $ = () => {
|
|
28
|
-
c(),
|
|
28
|
+
c(), a(!1), s(!1);
|
|
29
29
|
}, D = () => {
|
|
30
|
-
P(),
|
|
30
|
+
P(), a(!1), s(!1);
|
|
31
31
|
}, R = () => {
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
() => C(
|
|
35
|
-
[
|
|
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 "${
|
|
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
|
-
},
|
|
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:
|
|
48
|
-
})) : void 0, w =
|
|
49
|
-
const o = g(
|
|
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
|
|
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-
|
|
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: "
|
|
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
|
-
|
|
85
|
+
b,
|
|
86
86
|
{
|
|
87
|
-
value:
|
|
88
|
-
onChange: ({ condition: o, value:
|
|
87
|
+
value: l,
|
|
88
|
+
onChange: ({ condition: o, value: i }) => g(n, o, i),
|
|
89
89
|
filterOptions: y
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
(
|
|
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
|
-
|
|
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
|
}
|