@ztwoint/z-ui 0.1.44 → 0.1.46
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/avatar/avatar.d.ts +185 -0
- package/dist/components/avatar/avatar.js +55 -0
- package/dist/components/table/components/pagination/index.d.ts +1 -0
- package/dist/components/table/components/pagination/pagination.hook.d.ts +1 -1
- package/dist/components/table/components/pagination/pagination.hook.js +20 -16
- package/dist/components/table/components/table-filter/filters/checkbox.js +35 -51
- package/dist/components/table/components/table-filter/filters/text.js +41 -39
- package/dist/components/table/components/table-filter/index.d.ts +4 -1
- package/dist/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.js +30 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +26 -0
- package/dist/components/table/components/table-filter/table-filter-button.d.ts +2 -0
- package/dist/components/table/components/table-filter/table-filter-button.js +103 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.js +78 -0
- package/dist/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
- package/dist/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
- package/dist/components/table/components/table-filter/table-filter-provider.js +32 -0
- package/dist/components/table/components/table-filter/table-filter.context.d.ts +21 -0
- package/dist/components/table/components/table-filter/table-filter.context.js +13 -0
- package/dist/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
- package/dist/components/table/components/table-filter/table-filter.hook.js +39 -37
- package/dist/components/table/index.d.ts +1 -2
- package/dist/components/table/table-provider.d.ts +1 -1
- package/dist/components/table/table-provider.js +13 -13
- package/dist/components/table/table.type.d.ts +2 -0
- package/dist/components/table/table.utils.d.ts +0 -1
- package/dist/components/table/table.utils.js +5 -3
- package/dist/components/table-card/table-card.js +69 -64
- package/dist/components/table-card/table-card.type.d.ts +7 -7
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/hooks/useClickOutside.d.ts +1 -0
- package/dist/hooks/useClickOutside.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +110 -110
- package/dist/types/components/avatar/avatar.d.ts +185 -0
- package/dist/types/components/table/components/pagination/index.d.ts +1 -0
- package/dist/types/components/table/components/pagination/pagination.hook.d.ts +1 -1
- package/dist/types/components/table/components/table-filter/index.d.ts +4 -1
- package/dist/types/components/table/components/table-filter/selected-filters-display/index.d.ts +2 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.type.d.ts +12 -0
- package/dist/types/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.d.ts +6 -0
- package/dist/types/components/table/components/table-filter/table-filter-button.d.ts +2 -0
- package/dist/types/components/table/components/table-filter/table-filter-column-button.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/table-filter-column-button.type.d.ts +3 -0
- package/dist/types/components/table/components/table-filter/table-filter-provider.d.ts +14 -0
- package/dist/types/components/table/components/table-filter/table-filter.context.d.ts +21 -0
- package/dist/types/components/table/components/table-filter/table-filter.hook.d.ts +1 -2
- package/dist/types/components/table/index.d.ts +1 -2
- package/dist/types/components/table/table-provider.d.ts +1 -1
- package/dist/types/components/table/table.type.d.ts +2 -0
- package/dist/types/components/table/table.utils.d.ts +0 -1
- package/dist/types/components/table-card/table-card.type.d.ts +7 -7
- package/dist/types/hooks/useClickOutside.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -1
- package/dist/components/table/components/table-filter/table-filter.d.ts +0 -9
- package/dist/components/table/components/table-filter/table-filter.js +0 -120
- package/dist/types/components/table/components/table-filter/table-filter.d.ts +0 -9
|
@@ -1,132 +1,137 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { Table as e } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as P } from "../../lib/utils.js";
|
|
5
5
|
import "../table/table.context.js";
|
|
6
6
|
import "../button/button.js";
|
|
7
7
|
import "../input/input.js";
|
|
8
|
-
const
|
|
9
|
-
dataSource:
|
|
8
|
+
const M = ({
|
|
9
|
+
dataSource: w,
|
|
10
10
|
schema: C,
|
|
11
|
-
loading:
|
|
12
|
-
emptyMessage:
|
|
13
|
-
className:
|
|
14
|
-
rounded:
|
|
15
|
-
bordered:
|
|
16
|
-
showHeader:
|
|
11
|
+
loading: T,
|
|
12
|
+
emptyMessage: _,
|
|
13
|
+
className: k,
|
|
14
|
+
rounded: n = !0,
|
|
15
|
+
bordered: d = !0,
|
|
16
|
+
showHeader: x = !0,
|
|
17
17
|
headerClassName: R,
|
|
18
|
-
search:
|
|
19
|
-
filter:
|
|
20
|
-
headerLeftContent:
|
|
21
|
-
headerActions:
|
|
18
|
+
search: a,
|
|
19
|
+
filter: t,
|
|
20
|
+
headerLeftContent: m,
|
|
21
|
+
headerActions: u,
|
|
22
22
|
body: l = {
|
|
23
23
|
cell: { cellHeight: "small", hasBorder: !0 },
|
|
24
24
|
className: "",
|
|
25
25
|
stickyHeader: !0
|
|
26
26
|
},
|
|
27
|
-
showFooter:
|
|
27
|
+
showFooter: F = !0,
|
|
28
28
|
footerClassName: j,
|
|
29
|
-
pagination:
|
|
30
|
-
paginationInfo:
|
|
31
|
-
paginationQuickJumper:
|
|
29
|
+
pagination: s,
|
|
30
|
+
paginationInfo: c,
|
|
31
|
+
paginationQuickJumper: o
|
|
32
32
|
}) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
var N;
|
|
34
|
+
const g = o && o.totalPage && o.totalPage >= 2, B = s && s.totalPage && s.totalPage >= 2 || !!c || g, H = a || t || m || u, q = typeof (t == null ? void 0 : t.showFilterButton) > "u" ? !0 : t == null ? void 0 : t.showFilterButton;
|
|
35
|
+
return /* @__PURE__ */ r("div", { className: P("flex flex-col overflow-hidden", k), children: /* @__PURE__ */ h(e, { dataSource: w, schema: C, loading: T, emptyMessage: _, children: [
|
|
36
|
+
x && H && /* @__PURE__ */ h(
|
|
36
37
|
e.Header,
|
|
37
38
|
{
|
|
38
|
-
className:
|
|
39
|
+
className: P(
|
|
39
40
|
"flex-shrink-0",
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
d && "border-stroke-solid-medium border-1 border-b-0",
|
|
42
|
+
n && "rounded-t-xl",
|
|
42
43
|
R
|
|
43
44
|
),
|
|
44
45
|
children: [
|
|
45
46
|
/* @__PURE__ */ h(e.HeaderContent, { children: [
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
m && m,
|
|
48
|
+
a && /* @__PURE__ */ r(
|
|
48
49
|
e.Search,
|
|
49
50
|
{
|
|
50
51
|
search: {
|
|
51
|
-
value:
|
|
52
|
-
onChange:
|
|
52
|
+
value: a.value || "",
|
|
53
|
+
onChange: a.onChange || (() => {
|
|
53
54
|
}),
|
|
54
|
-
placeholder:
|
|
55
|
+
placeholder: a.placeholder
|
|
55
56
|
},
|
|
56
|
-
className:
|
|
57
|
+
className: a.className
|
|
57
58
|
}
|
|
58
59
|
),
|
|
59
|
-
|
|
60
|
+
t && /* @__PURE__ */ h(
|
|
60
61
|
e.Filter,
|
|
61
62
|
{
|
|
62
63
|
schema: C,
|
|
63
64
|
filter: {
|
|
64
|
-
value:
|
|
65
|
-
onChange:
|
|
65
|
+
value: t.value || [],
|
|
66
|
+
onChange: t.onChange || (() => {
|
|
66
67
|
})
|
|
67
|
-
}
|
|
68
|
+
},
|
|
69
|
+
children: [
|
|
70
|
+
q && /* @__PURE__ */ r(e.Filter.FilterButton, {}),
|
|
71
|
+
(N = t == null ? void 0 : t.quickFilters) == null ? void 0 : N.map((v) => /* @__PURE__ */ r(e.Filter.FilterColumnButton, { filterName: v }, v))
|
|
72
|
+
]
|
|
68
73
|
}
|
|
69
74
|
)
|
|
70
75
|
] }),
|
|
71
|
-
|
|
76
|
+
u && /* @__PURE__ */ r(e.HeaderContent, { children: u })
|
|
72
77
|
]
|
|
73
78
|
}
|
|
74
79
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ r(
|
|
76
81
|
e.Body,
|
|
77
82
|
{
|
|
78
83
|
cell: l == null ? void 0 : l.cell,
|
|
79
84
|
sort: l == null ? void 0 : l.sort,
|
|
80
|
-
className:
|
|
85
|
+
className: P(
|
|
81
86
|
"flex-1 min-h-0",
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
d && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
88
|
+
n && !(x && H) && "rounded-t-xl",
|
|
89
|
+
n && !(F && B) && "rounded-b-xl",
|
|
90
|
+
d && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
91
|
+
d && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
87
92
|
l == null ? void 0 : l.className
|
|
88
93
|
),
|
|
89
94
|
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
90
95
|
}
|
|
91
96
|
),
|
|
92
|
-
|
|
97
|
+
F && B && /* @__PURE__ */ h(
|
|
93
98
|
e.Footer,
|
|
94
99
|
{
|
|
95
|
-
className:
|
|
100
|
+
className: P(
|
|
96
101
|
"flex-shrink-0",
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
d && "border-stroke-solid-light border border-t-[0.5px]",
|
|
103
|
+
n && "rounded-b-xl",
|
|
99
104
|
j
|
|
100
105
|
),
|
|
101
106
|
children: [
|
|
102
|
-
|
|
107
|
+
c ? /* @__PURE__ */ r(e.FooterContent, { children: /* @__PURE__ */ r(
|
|
103
108
|
e.PaginationInfo,
|
|
104
109
|
{
|
|
105
|
-
showTotal:
|
|
106
|
-
totalItems:
|
|
107
|
-
currentPage:
|
|
108
|
-
itemsPerPage:
|
|
110
|
+
showTotal: c.showTotal,
|
|
111
|
+
totalItems: c.totalItems,
|
|
112
|
+
currentPage: c.currentPage,
|
|
113
|
+
itemsPerPage: c.itemsPerPage
|
|
109
114
|
}
|
|
110
|
-
) }) :
|
|
111
|
-
(
|
|
112
|
-
|
|
115
|
+
) }) : o || s ? /* @__PURE__ */ r(e.FooterContent, { children: null }) : null,
|
|
116
|
+
(o || s) && /* @__PURE__ */ h(e.FooterContent, { children: [
|
|
117
|
+
g && /* @__PURE__ */ r(
|
|
113
118
|
e.PaginationQuickJumper,
|
|
114
119
|
{
|
|
115
|
-
currentPage:
|
|
116
|
-
totalPage:
|
|
117
|
-
onChange:
|
|
120
|
+
currentPage: o.currentPage,
|
|
121
|
+
totalPage: o.totalPage,
|
|
122
|
+
onChange: o.onChange || (() => {
|
|
118
123
|
}),
|
|
119
|
-
disabled:
|
|
124
|
+
disabled: o.disabled
|
|
120
125
|
}
|
|
121
126
|
),
|
|
122
|
-
|
|
127
|
+
s && /* @__PURE__ */ r(
|
|
123
128
|
e.Pagination,
|
|
124
129
|
{
|
|
125
|
-
currentPage:
|
|
126
|
-
totalPage:
|
|
127
|
-
onChange:
|
|
130
|
+
currentPage: s.currentPage,
|
|
131
|
+
totalPage: s.totalPage,
|
|
132
|
+
onChange: s.onChange || (() => {
|
|
128
133
|
}),
|
|
129
|
-
totalItems:
|
|
134
|
+
totalItems: s.totalItems
|
|
130
135
|
}
|
|
131
136
|
)
|
|
132
137
|
] })
|
|
@@ -136,5 +141,5 @@ const E = ({
|
|
|
136
141
|
] }) });
|
|
137
142
|
};
|
|
138
143
|
export {
|
|
139
|
-
|
|
144
|
+
M as default
|
|
140
145
|
};
|
|
@@ -12,7 +12,10 @@ export interface TableCardProps {
|
|
|
12
12
|
search?: Partial<TableSearch> & {
|
|
13
13
|
className?: string;
|
|
14
14
|
};
|
|
15
|
-
filter?: Partial<TableFilter
|
|
15
|
+
filter?: Partial<TableFilter> & {
|
|
16
|
+
quickFilters?: string[];
|
|
17
|
+
showFilterButton?: boolean;
|
|
18
|
+
};
|
|
16
19
|
headerLeftContent?: React.ReactNode;
|
|
17
20
|
headerActions?: React.ReactNode;
|
|
18
21
|
body?: {
|
|
@@ -23,12 +26,9 @@ export interface TableCardProps {
|
|
|
23
26
|
};
|
|
24
27
|
showFooter?: boolean;
|
|
25
28
|
footerClassName?: string;
|
|
26
|
-
pagination?:
|
|
27
|
-
paginationInfo?:
|
|
28
|
-
|
|
29
|
-
totalItems: number;
|
|
30
|
-
};
|
|
31
|
-
paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
|
|
29
|
+
pagination?: PaginationProps;
|
|
30
|
+
paginationInfo?: PaginationInfoProps;
|
|
31
|
+
paginationQuickJumper?: PaginationQuickJumperProps;
|
|
32
32
|
loading?: boolean;
|
|
33
33
|
emptyMessage?: string;
|
|
34
34
|
}
|