@ztwoint/z-ui 0.1.47 → 0.1.49
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/alert/alert.const.d.ts +0 -3
- package/dist/components/alert/alert.const.js +16 -31
- package/dist/components/alert/alert.js +32 -44
- package/dist/components/button/button.d.ts +3 -3
- package/dist/components/button/button.js +58 -58
- package/dist/components/collapsible-side-nav-bar/side-nav-bar-header.js +17 -17
- package/dist/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/components/nav-header/nav-item/nav-item.js +29 -28
- package/dist/components/select/z2-select.js +131 -78
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.js +33 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.js +20 -0
- package/dist/components/table/components/table-filter/table-filter-button.js +81 -60
- package/dist/components/table/components/table-filter/table-filter-column-button.js +85 -56
- package/dist/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/components/table/components/table-filter/table-filter.hook.js +17 -14
- package/dist/components/table/components/table-footer.js +6 -6
- package/dist/components/table/components/table-header/table-header.js +27 -33
- package/dist/components/table/table.const.d.ts +10 -6
- package/dist/components/table/table.const.js +10 -6
- package/dist/components/table/table.js +39 -28
- package/dist/components/table-card/table-card.js +2 -2
- package/dist/components/tooltip/tooltip.js +24 -22
- package/dist/css/config/colors/backgrounds.css +8 -8
- package/dist/css/config/colors/components/avatar.css +12 -12
- package/dist/css/config/colors/components/badge.css +42 -42
- package/dist/css/config/colors/components/checkbox.css +2 -2
- package/dist/css/config/colors/components/featured-icon.css +18 -18
- package/dist/css/config/colors/components/progress-bar.css +2 -2
- package/dist/css/config/colors/components/radio-button.css +2 -2
- package/dist/css/config/colors/components/scroll-overlay.css +4 -4
- package/dist/css/config/colors/components/tab.css +7 -7
- package/dist/css/config/colors/components/toggle-switch.css +1 -1
- package/dist/css/config/colors/components/toggle.css +6 -6
- package/dist/css/config/colors/icons.css +20 -20
- package/dist/css/config/colors/overlay.css +1 -1
- package/dist/css/config/colors/semantic/alert.css +44 -0
- package/dist/css/config/colors/semantic/background.css +51 -0
- package/dist/css/config/colors/semantic/base.css +395 -0
- package/dist/css/config/colors/semantic/button.css +131 -0
- package/dist/css/config/colors/semantic/drop-shadow.css +30 -0
- package/dist/css/config/colors/semantic/dropdown.css +12 -0
- package/dist/css/config/colors/semantic/index.css +16 -0
- package/dist/css/config/colors/semantic/input.css +56 -0
- package/dist/css/config/colors/semantic/overlay.css +13 -0
- package/dist/css/config/colors/semantic/stroke.css +90 -0
- package/dist/css/config/colors/semantic/surface.css +135 -0
- package/dist/css/config/colors/semantic/text.css +113 -0
- package/dist/css/config/colors/semantic/tooltip.css +12 -0
- package/dist/css/config/colors/shape.css +40 -40
- package/dist/css/config/colors/stroke.css +19 -19
- package/dist/css/config/colors/surfaces.css +47 -47
- package/dist/css/config/colors/text.css +37 -37
- package/dist/css/config/components/index.css +0 -2
- package/dist/css/config/config-deprecated.css +3 -5
- package/dist/css/config/config.css +5 -3
- package/dist/css/config/other-variables.css +9 -0
- package/dist/css/config/shadows.css +15 -0
- package/dist/css/config/typography/2xl.css +7 -14
- package/dist/css/config/typography/3xl.css +7 -14
- package/dist/css/config/typography/4xl.css +7 -14
- package/dist/css/config/typography/base.css +7 -14
- package/dist/css/config/typography/lg.css +7 -14
- package/dist/css/config/typography/sm.css +7 -14
- package/dist/css/config/typography/xl.css +7 -14
- package/dist/css/config/typography/xs.css +7 -14
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/alert/alert.const.d.ts +0 -3
- package/dist/types/components/button/button.d.ts +3 -3
- package/dist/types/components/nav-header/nav-item/nav-item.d.ts +4 -2
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.d.ts +10 -0
- package/dist/types/components/table/components/table-filter/close-filter-confirm/filter-confirmation-dialog.utils.d.ts +13 -0
- package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +1 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -0
- package/dist/types/components/table/table.const.d.ts +10 -6
- package/package.json +1 -1
- package/dist/css/config/colors/components/alert.css +0 -84
- package/dist/css/config/colors/components/button.css +0 -93
- package/dist/css/config/colors/components/select.css +0 -128
- package/dist/css/config/colors/components/text-button.css +0 -67
- package/dist/css/config/colors/defaults.css +0 -393
- package/dist/css/config/colors/semantic-colors.css +0 -353
- package/dist/css/config/components/button.css +0 -160
- package/dist/css/config/components/input.css +0 -56
- /package/dist/css/config/typography/{typography.css → index.css} +0 -0
|
@@ -1,79 +1,108 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { useTableFilterContext as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { useClickOutside as
|
|
11
|
-
import { getFilterCount as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const {
|
|
16
|
-
getFilterForColumn:
|
|
17
|
-
hasAppliedFilterForColumn:
|
|
18
|
-
updateColumnFilter:
|
|
19
|
-
applyFilters:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import { Button as u } from "../../../button/button.js";
|
|
4
|
+
import { useTableFilterContext as K } from "./table-filter.context.js";
|
|
5
|
+
import U from "./filters/text.js";
|
|
6
|
+
import I from "./filters/boolean.js";
|
|
7
|
+
import P from "./filters/number/number.js";
|
|
8
|
+
import V from "./filters/checkbox.js";
|
|
9
|
+
import q from "../../../assets/icons/circle-check-filled.js";
|
|
10
|
+
import { useClickOutside as E } from "../../../../hooks/useClickOutside.js";
|
|
11
|
+
import { getFilterCount as G } from "./selected-filters-display/selected-filters-display.utils.js";
|
|
12
|
+
import { FilterConfirmationDialog as H } from "./close-filter-confirm/filter-confirmation-dialog.js";
|
|
13
|
+
import { hasUnsavedFilterChangesForColumn as b } from "./close-filter-confirm/filter-confirmation-dialog.utils.js";
|
|
14
|
+
const oe = ({ filterName: l }) => {
|
|
15
|
+
const [a, t] = m.useState(!1), [x, s] = m.useState(!1), h = m.useRef(null), {
|
|
16
|
+
getFilterForColumn: k,
|
|
17
|
+
hasAppliedFilterForColumn: y,
|
|
18
|
+
updateColumnFilter: C,
|
|
19
|
+
applyFilters: c,
|
|
20
|
+
resetToAppliedFilters: w,
|
|
21
|
+
schema: T,
|
|
22
|
+
filterComponents: d = {},
|
|
23
|
+
tempFilters: F,
|
|
24
|
+
filter: g
|
|
25
|
+
} = K();
|
|
26
|
+
E(h, () => {
|
|
27
|
+
b(l, F, g.value) && a ? s(!0) : t(!1);
|
|
28
|
+
});
|
|
29
|
+
const A = () => {
|
|
30
|
+
c(), t(!1);
|
|
31
|
+
}, O = () => {
|
|
32
|
+
s(!1), t(!1);
|
|
33
|
+
}, $ = () => {
|
|
34
|
+
w(), s(!1), t(!1);
|
|
35
|
+
}, R = () => {
|
|
36
|
+
s(!1);
|
|
37
|
+
}, e = T.find((r) => r.key === l);
|
|
23
38
|
if (!e)
|
|
24
|
-
return console.warn(`Column "${
|
|
39
|
+
return console.warn(`Column "${l}" not found in schema`), null;
|
|
25
40
|
if (e.filterable === !1)
|
|
26
|
-
return console.warn(`Column "${
|
|
27
|
-
const
|
|
28
|
-
boolean:
|
|
29
|
-
text:
|
|
30
|
-
number:
|
|
31
|
-
checkbox:
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
41
|
+
return console.warn(`Column "${l}" is not filterable`), null;
|
|
42
|
+
const z = {
|
|
43
|
+
boolean: I,
|
|
44
|
+
text: U,
|
|
45
|
+
number: P,
|
|
46
|
+
checkbox: V
|
|
47
|
+
}, v = e.cellType && (d == null ? void 0 : d[e.cellType]) || z[e.cellType ?? "text"];
|
|
48
|
+
if (!v)
|
|
34
49
|
return console.warn(
|
|
35
50
|
`No filter component found for column "${e.key}" with cellType "${e.cellType}". Provide a custom filter component or use supported types: "text", "number", "boolean", "checkbox".`
|
|
36
51
|
), null;
|
|
37
|
-
const
|
|
38
|
-
condition: (
|
|
39
|
-
value: (
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
52
|
+
const o = k(l), f = y(l), p = o ? G(o, e.filterOptions) : void 0, D = {
|
|
53
|
+
condition: (o == null ? void 0 : o.condition) || "",
|
|
54
|
+
value: (o == null ? void 0 : o.value) || ""
|
|
55
|
+
}, j = () => {
|
|
56
|
+
C(l, "", ""), c(), t(!1);
|
|
57
|
+
}, B = () => {
|
|
58
|
+
c(), t(!1);
|
|
44
59
|
};
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
60
|
+
return /* @__PURE__ */ i("div", { className: "relative", ref: h, children: [
|
|
61
|
+
/* @__PURE__ */ n(
|
|
62
|
+
u,
|
|
48
63
|
{
|
|
49
64
|
onClick: () => {
|
|
50
|
-
|
|
65
|
+
t(!a);
|
|
51
66
|
},
|
|
52
|
-
variant:
|
|
53
|
-
shade:
|
|
67
|
+
variant: f ? "filled" : "stroke",
|
|
68
|
+
shade: f ? "brand" : "neutral",
|
|
54
69
|
size: "small",
|
|
55
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
56
71
|
e.title,
|
|
57
|
-
|
|
72
|
+
f && /* @__PURE__ */ n(q, { className: "w-4 h-4 text-white flex-shrink-0" })
|
|
58
73
|
] })
|
|
59
74
|
}
|
|
60
75
|
),
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
|
|
76
|
+
a && /* @__PURE__ */ i("div", { className: "absolute top-full left-0 mt-2 w-80 bg-surface-neutral-default border border-stroke-solid-light rounded-2xl z-10 overflow-hidden shadow-lg", children: [
|
|
77
|
+
/* @__PURE__ */ n(
|
|
78
|
+
v,
|
|
64
79
|
{
|
|
65
|
-
value:
|
|
66
|
-
onChange: ({ condition:
|
|
80
|
+
value: D,
|
|
81
|
+
onChange: ({ condition: r, value: S }) => C(l, r, S),
|
|
67
82
|
filterOptions: e.filterOptions
|
|
68
83
|
}
|
|
69
84
|
),
|
|
70
|
-
!!
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
/* @__PURE__ */
|
|
85
|
+
!!p && /* @__PURE__ */ i("div", { className: "flex justify-between gap-2 p-3 border-t border-stroke-solid-medium", children: [
|
|
86
|
+
/* @__PURE__ */ n(u, { onClick: j, variant: "stroke", shade: "neutral", size: "small", children: "Clear All" }),
|
|
87
|
+
/* @__PURE__ */ n(u, { onClick: B, variant: "filled", shade: "neutral", size: "small", children: `Apply${p !== void 0 ? ` ${p}` : ""}` })
|
|
73
88
|
] })
|
|
74
|
-
] })
|
|
89
|
+
] }),
|
|
90
|
+
x && /* @__PURE__ */ n(
|
|
91
|
+
H,
|
|
92
|
+
{
|
|
93
|
+
onClose: R,
|
|
94
|
+
onKeepChanges: O,
|
|
95
|
+
onRevertChanges: $,
|
|
96
|
+
onApplyChanges: A,
|
|
97
|
+
hasUnsavedChanges: b(
|
|
98
|
+
l,
|
|
99
|
+
F,
|
|
100
|
+
g.value
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
75
104
|
] });
|
|
76
105
|
};
|
|
77
106
|
export {
|
|
78
|
-
|
|
107
|
+
oe as TableFilterColumnButton
|
|
79
108
|
};
|
|
@@ -9,6 +9,7 @@ export interface TableFilterContextValue {
|
|
|
9
9
|
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
|
+
resetToAppliedFilters: () => void;
|
|
12
13
|
applyFilters: () => void;
|
|
13
14
|
hasActiveFilters: boolean;
|
|
14
15
|
filterableFields: TableSchema;
|
|
@@ -9,6 +9,7 @@ declare const useTableFilter: ({ filter, schema }: TableFilterProps) => {
|
|
|
9
9
|
hasAppliedFilterForColumn: (columnKey: string) => boolean;
|
|
10
10
|
updateColumnFilter: (columnKey: string, condition?: string, value?: string | string[]) => void;
|
|
11
11
|
clearAllFilters: () => void;
|
|
12
|
+
resetToAppliedFilters: () => void;
|
|
12
13
|
applyFilters: () => void;
|
|
13
14
|
hasActiveFilters: boolean;
|
|
14
15
|
tempFilters: FilterRule[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import u from "react";
|
|
2
|
-
const
|
|
3
|
-
const [i, f] = u.useState(null), [r,
|
|
2
|
+
const T = ({ filter: l, schema: v }) => {
|
|
3
|
+
const [i, f] = u.useState(null), [r, s] = u.useState(l.value), a = v.filter((t) => t.filterable !== !1);
|
|
4
4
|
u.useEffect(() => {
|
|
5
5
|
!i && a.length > 0 && f(a[0].key);
|
|
6
6
|
}, [i, a]);
|
|
@@ -11,32 +11,34 @@ const S = ({ filter: l, schema: v }) => {
|
|
|
11
11
|
const e = m(t);
|
|
12
12
|
return e ? Array.isArray(e.value) ? e.value.length > 0 : e.value !== "" : !1;
|
|
13
13
|
}, g = (t, e, o) => {
|
|
14
|
-
const d = r.findIndex((
|
|
14
|
+
const d = r.findIndex((n) => n.field === t);
|
|
15
15
|
if (d >= 0) {
|
|
16
|
-
const
|
|
17
|
-
(F,
|
|
16
|
+
const n = r.map(
|
|
17
|
+
(F, b) => b === d ? {
|
|
18
18
|
...F,
|
|
19
19
|
...e !== void 0 ? { condition: e } : {},
|
|
20
20
|
...o !== void 0 ? { value: o } : {}
|
|
21
21
|
} : F
|
|
22
22
|
);
|
|
23
|
-
n
|
|
23
|
+
s(n);
|
|
24
24
|
} else {
|
|
25
|
-
const
|
|
25
|
+
const n = {
|
|
26
26
|
field: t,
|
|
27
27
|
...e ? { condition: e } : {},
|
|
28
28
|
value: o || ""
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
s([...r, n]);
|
|
31
31
|
}
|
|
32
32
|
}, h = () => {
|
|
33
|
-
|
|
33
|
+
s([]);
|
|
34
34
|
}, C = () => {
|
|
35
|
+
s(l.value);
|
|
36
|
+
}, y = () => {
|
|
35
37
|
const t = r.filter((e) => Array.isArray(e.value) ? e.value.length > 0 : e.value !== "");
|
|
36
38
|
l.onChange(t);
|
|
37
|
-
},
|
|
39
|
+
}, x = l.value.length > 0;
|
|
38
40
|
return u.useEffect(() => {
|
|
39
|
-
|
|
41
|
+
s(l.value);
|
|
40
42
|
}, [l.value]), {
|
|
41
43
|
selectedColumn: i,
|
|
42
44
|
setSelectedColumn: f,
|
|
@@ -45,12 +47,13 @@ const S = ({ filter: l, schema: v }) => {
|
|
|
45
47
|
hasAppliedFilterForColumn: A,
|
|
46
48
|
updateColumnFilter: g,
|
|
47
49
|
clearAllFilters: h,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
resetToAppliedFilters: C,
|
|
51
|
+
applyFilters: y,
|
|
52
|
+
hasActiveFilters: x,
|
|
50
53
|
tempFilters: r,
|
|
51
54
|
filterableFields: a
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
T as default
|
|
56
59
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
3
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
4
|
+
const n = ({ children: e, className: t = "" }) => /* @__PURE__ */ r(
|
|
5
5
|
"div",
|
|
6
6
|
{
|
|
7
|
-
className:
|
|
8
|
-
"flex justify-between items-center bg-neutral-
|
|
7
|
+
className: o(
|
|
8
|
+
"flex justify-between items-center bg-background-neutral-default gap-3 p-2 pl-4",
|
|
9
9
|
t
|
|
10
10
|
),
|
|
11
11
|
children: e
|
|
12
12
|
}
|
|
13
13
|
);
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
n as TableFooter,
|
|
16
|
+
n as default
|
|
17
17
|
};
|
|
@@ -1,38 +1,32 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { TABLE_CSS_CLASSES as t } from "../../table.const.js";
|
|
3
|
-
import { TableSortIcon as
|
|
4
|
-
import { getCurrentSortDirection as
|
|
3
|
+
import { TableSortIcon as n } from "./table-sort-icon.js";
|
|
4
|
+
import { getCurrentSortDirection as p, isSortActive as C, handleSortClick as S } from "./table-header.utils.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { cn as
|
|
7
|
-
const
|
|
8
|
-
schema:
|
|
6
|
+
import { cn as i } from "../../../../lib/utils.js";
|
|
7
|
+
const A = ({
|
|
8
|
+
schema: o,
|
|
9
9
|
sort: a,
|
|
10
|
-
cell:
|
|
11
|
-
stickyHeader:
|
|
12
|
-
}) => /* @__PURE__ */ r(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
e.key
|
|
32
|
-
);
|
|
33
|
-
}) })
|
|
34
|
-
}
|
|
35
|
-
);
|
|
10
|
+
cell: s,
|
|
11
|
+
stickyHeader: l = !1
|
|
12
|
+
}) => /* @__PURE__ */ r("thead", { className: i(t.header, l && "sticky top-0 z-1"), children: /* @__PURE__ */ r("tr", { children: o.map((e) => {
|
|
13
|
+
const d = p(e.key, a), c = C(e.key, a);
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
"th",
|
|
16
|
+
{
|
|
17
|
+
className: i(
|
|
18
|
+
e.sortable ? t.sortableHeaderCell : t.headerCell.default,
|
|
19
|
+
t.headerCell.hasBorder[s.hasBorder ? "true" : "false"]
|
|
20
|
+
),
|
|
21
|
+
onClick: e.sortable ? () => S(e.key, a) : void 0,
|
|
22
|
+
children: /* @__PURE__ */ h("div", { className: t.headerCellContent, children: [
|
|
23
|
+
/* @__PURE__ */ r("span", { children: e.title }),
|
|
24
|
+
e.sortable && /* @__PURE__ */ r(n, { direction: d, isActive: c })
|
|
25
|
+
] })
|
|
26
|
+
},
|
|
27
|
+
e.key
|
|
28
|
+
);
|
|
29
|
+
}) }) });
|
|
36
30
|
export {
|
|
37
|
-
|
|
31
|
+
A as TableHeader
|
|
38
32
|
};
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
export declare const DEFAULT_EMPTY_MESSAGE = "No data available";
|
|
2
2
|
export declare const TABLE_CSS_CLASSES: {
|
|
3
3
|
readonly table: "w-full";
|
|
4
|
-
readonly
|
|
4
|
+
readonly bordered: {
|
|
5
|
+
readonly true: "[&_td:first-child]:border-l-1 [&_th:first-child]:border-l-1 ";
|
|
6
|
+
readonly false: "";
|
|
7
|
+
};
|
|
8
|
+
readonly header: "bg-background-neutral-medium text-text-neutral-secondary table-fixed";
|
|
5
9
|
readonly cell: {
|
|
6
|
-
readonly default: "p-0 align-middle relative h-4";
|
|
10
|
+
readonly default: "p-0 align-middle relative h-4 ";
|
|
7
11
|
readonly hasBorder: {
|
|
8
|
-
readonly true: "border-r border-b border-stroke-solid-light";
|
|
12
|
+
readonly true: "border-r border-b border-stroke-solid-light ";
|
|
9
13
|
readonly false: "border-b border-stroke-solid-light";
|
|
10
14
|
};
|
|
11
15
|
};
|
|
12
16
|
readonly headerCell: {
|
|
13
|
-
readonly default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider";
|
|
17
|
+
readonly default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider border-stroke-solid-light";
|
|
14
18
|
readonly hasBorder: {
|
|
15
|
-
readonly true: "
|
|
16
|
-
readonly false: "border-
|
|
19
|
+
readonly true: " [box-shadow:inset_-1px_0_0_0_var(--color-stroke-solid-light),_inset_0_-1px_0_0_var(--color-stroke-solid-light)] border-stroke-solid-light dark:shadow-none dark:border-0";
|
|
20
|
+
readonly false: "border-stroke-solid-light ";
|
|
17
21
|
};
|
|
18
22
|
};
|
|
19
23
|
readonly sortableHeaderCell: "p-3 text-left text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors duration-200";
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
const e = "No data available", t = {
|
|
2
2
|
table: "w-full",
|
|
3
|
-
|
|
3
|
+
bordered: {
|
|
4
|
+
true: "[&_td:first-child]:border-l-1 [&_th:first-child]:border-l-1 ",
|
|
5
|
+
false: ""
|
|
6
|
+
},
|
|
7
|
+
header: "bg-background-neutral-medium text-text-neutral-secondary table-fixed",
|
|
4
8
|
cell: {
|
|
5
|
-
default: "p-0 align-middle relative h-4",
|
|
9
|
+
default: "p-0 align-middle relative h-4 ",
|
|
6
10
|
hasBorder: {
|
|
7
|
-
true: "border-r border-b border-stroke-solid-light",
|
|
11
|
+
true: "border-r border-b border-stroke-solid-light ",
|
|
8
12
|
false: "border-b border-stroke-solid-light"
|
|
9
13
|
}
|
|
10
14
|
},
|
|
11
15
|
headerCell: {
|
|
12
|
-
default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider",
|
|
16
|
+
default: "px-4 py-3 text-left text-xs font-medium uppercase tracking-wider border-stroke-solid-light",
|
|
13
17
|
hasBorder: {
|
|
14
|
-
true: "
|
|
15
|
-
false: "border-
|
|
18
|
+
true: " [box-shadow:inset_-1px_0_0_0_var(--color-stroke-solid-light),_inset_0_-1px_0_0_var(--color-stroke-solid-light)] border-stroke-solid-light dark:shadow-none dark:border-0",
|
|
19
|
+
false: "border-stroke-solid-light "
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
sortableHeaderCell: "p-3 text-left text-xs font-medium uppercase tracking-wider cursor-pointer transition-colors duration-200",
|
|
@@ -1,35 +1,46 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { DEFAULT_EMPTY_MESSAGE as
|
|
4
|
-
import { TableHeader as
|
|
5
|
-
import { TableRow as
|
|
6
|
-
import { TableEmptyState as
|
|
7
|
-
import { TableLoadingState as
|
|
1
|
+
import { jsx as e, jsxs as h } from "react/jsx-runtime";
|
|
2
|
+
import * as T from "react";
|
|
3
|
+
import { DEFAULT_EMPTY_MESSAGE as g, TABLE_CSS_CLASSES as m } from "./table.const.js";
|
|
4
|
+
import { TableHeader as E } from "./components/table-header/table-header.js";
|
|
5
|
+
import { TableRow as y } from "./components/table-row.js";
|
|
6
|
+
import { TableEmptyState as x } from "./components/table-empty-state.js";
|
|
7
|
+
import { TableLoadingState as B } from "./components/table-loading-state.js";
|
|
8
8
|
import { TableContext as C } from "./table.context.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
import { cn as s } from "../../lib/utils.js";
|
|
10
|
+
const R = ({ cell: o = { hasBorder: !0 }, sort: n, className: f, stickyHeader: d = !1, ...i }) => {
|
|
11
|
+
const c = T.useContext(C), {
|
|
12
|
+
dataSource: t = [],
|
|
13
|
+
schema: r = [],
|
|
14
|
+
loading: a = !1,
|
|
15
|
+
emptyMessage: p = g,
|
|
16
|
+
customCells: u
|
|
17
|
+
} = c || i, S = () => a ? /* @__PURE__ */ e(B, { colSpan: r.length }) : !t || t.length === 0 ? /* @__PURE__ */ e(x, { colSpan: r.length, message: p }) : /* @__PURE__ */ e("tbody", { children: t.map((b, l) => /* @__PURE__ */ e(
|
|
18
|
+
y,
|
|
18
19
|
{
|
|
19
|
-
record:
|
|
20
|
-
index:
|
|
21
|
-
schema:
|
|
22
|
-
customCells:
|
|
23
|
-
cell:
|
|
20
|
+
record: b,
|
|
21
|
+
index: l,
|
|
22
|
+
schema: r,
|
|
23
|
+
customCells: u,
|
|
24
|
+
cell: o
|
|
24
25
|
},
|
|
25
|
-
|
|
26
|
+
l
|
|
26
27
|
)) });
|
|
27
|
-
return /* @__PURE__ */ e(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
return /* @__PURE__ */ e(
|
|
29
|
+
"div",
|
|
30
|
+
{
|
|
31
|
+
className: s(
|
|
32
|
+
"overflow-y-auto",
|
|
33
|
+
m.bordered[o.hasBorder && !a && t.length > 0 ? "true" : "false"],
|
|
34
|
+
f
|
|
35
|
+
),
|
|
36
|
+
children: /* @__PURE__ */ h("table", { className: s(m.table, "w-full"), children: [
|
|
37
|
+
/* @__PURE__ */ e(E, { schema: r, sort: n, cell: o, stickyHeader: d }),
|
|
38
|
+
S()
|
|
39
|
+
] })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
31
42
|
};
|
|
32
43
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
R as TableBody,
|
|
45
|
+
R as default
|
|
35
46
|
};
|
|
@@ -111,7 +111,7 @@ const dt = ({
|
|
|
111
111
|
sort: r == null ? void 0 : r.sort,
|
|
112
112
|
className: n(
|
|
113
113
|
"flex-1 min-h-0",
|
|
114
|
-
h && "border-stroke-solid-light border-
|
|
114
|
+
h && "border-stroke-solid-light border-1",
|
|
115
115
|
d && !(C && g) && "rounded-t-xl",
|
|
116
116
|
d && !(x && p) && "rounded-b-xl",
|
|
117
117
|
h && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
@@ -125,7 +125,7 @@ const dt = ({
|
|
|
125
125
|
t.Footer,
|
|
126
126
|
{
|
|
127
127
|
className: n(
|
|
128
|
-
"flex-shrink-0 border-stroke-solid-light border-t-[0.5px]",
|
|
128
|
+
"flex-shrink-0 border-stroke-solid-light border-t-[0.5px] mt-[-2px]",
|
|
129
129
|
h && "border",
|
|
130
130
|
d && "rounded-b-xl",
|
|
131
131
|
k
|
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
5
|
-
message:
|
|
1
|
+
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "@radix-ui/react-tooltip";
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
message: d,
|
|
6
6
|
children: i,
|
|
7
|
-
delayDuration:
|
|
8
|
-
side:
|
|
9
|
-
className:
|
|
10
|
-
...
|
|
11
|
-
}) => /* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
|
|
7
|
+
delayDuration: o = 300,
|
|
8
|
+
side: l = void 0,
|
|
9
|
+
className: r,
|
|
10
|
+
...s
|
|
11
|
+
}) => /* @__PURE__ */ a(e.Provider, { delayDuration: o, children: /* @__PURE__ */ t(e.Root, { children: [
|
|
12
|
+
/* @__PURE__ */ a(e.Trigger, { asChild: !0, children: i }),
|
|
13
|
+
/* @__PURE__ */ a(e.Portal, { children: /* @__PURE__ */ t(
|
|
14
|
+
e.Content,
|
|
15
15
|
{
|
|
16
|
-
side:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
side: l,
|
|
17
|
+
sideOffset: 4,
|
|
18
|
+
className: n(
|
|
19
|
+
"bg-tooltip-surface text-white leading-none-regular-sm rounded-md px-2 py-2",
|
|
20
|
+
"will-change-[transform,opacity] data-[state=delayed-open]:data-[side=bottom]:animate-slideUpAndFade data-[state=delayed-open]:data-[side=left]:animate-slideRightAndFade data-[state=delayed-open]:data-[side=right]:animate-slideLeftAndFade data-[state=delayed-open]:data-[side=top]:animate-slideDownAndFade",
|
|
21
|
+
r
|
|
20
22
|
),
|
|
21
|
-
...
|
|
23
|
+
...s,
|
|
22
24
|
children: [
|
|
23
|
-
|
|
24
|
-
/* @__PURE__ */
|
|
25
|
+
d,
|
|
26
|
+
/* @__PURE__ */ a(e.Arrow, { className: "fill-tooltip-surface" })
|
|
25
27
|
]
|
|
26
28
|
}
|
|
27
29
|
) })
|
|
28
30
|
] }) });
|
|
29
|
-
|
|
31
|
+
p.displayName = "Z2Tooltip";
|
|
30
32
|
export {
|
|
31
|
-
|
|
33
|
+
p as Z2Tooltip
|
|
32
34
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
/* neutral */
|
|
2
2
|
@utility bg-neutral-default {
|
|
3
|
-
background-color: var(--color-neutral-
|
|
3
|
+
background-color: var(--color-background-neutral-default);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
@utility bg-neutral-on-top {
|
|
7
|
-
background-color: var(--color-neutral-
|
|
7
|
+
background-color: var(--color-background-neutral-on-top);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
@utility bg-neutral-light {
|
|
11
|
-
background-color: var(--color-neutral-
|
|
11
|
+
background-color: var(--color-background-neutral-light);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
@utility bg-neutral-high {
|
|
15
|
-
background-color: var(--color-neutral-
|
|
15
|
+
background-color: var(--color-background-neutral-high);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
@utility bg-neutral-medium {
|
|
19
|
-
background-color: var(--color-neutral-
|
|
19
|
+
background-color: var(--color-background-neutral-medium);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
@utility bg-neutral-inverted-elevated {
|
|
23
|
-
background-color: var(--color-
|
|
23
|
+
background-color: var(--color-surface-inverted-default);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
@utility bg-neutral-inverted-attention {
|
|
27
|
-
background-color: var(--color-
|
|
27
|
+
background-color: var(--color-surface-inverted-hover);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
@utility bg-neutral-inverted-brand {
|
|
31
|
-
background-color:
|
|
31
|
+
background-color: var(--color-surface-accent-default);
|
|
32
32
|
}
|