@ztwoint/z-ui 0.1.46 → 0.1.47
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/check.d.ts +8 -0
- package/dist/components/assets/icons/check.js +17 -0
- package/dist/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/components/assets/icons/x-mark.js +17 -0
- package/dist/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/components/table/components/cell/avatar-cell.js +74 -0
- package/dist/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/components/table/components/cell/boolean-cell.js +5 -5
- package/dist/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/components/table/components/cell/description-cell.js +16 -0
- package/dist/components/table/components/cell/index.d.ts +10 -1
- package/dist/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/components/table/components/cell/label-cell.js +47 -0
- package/dist/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/components/table/components/cell/link-cell.js +35 -0
- package/dist/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/components/table/components/cell/number-cell.js +40 -3
- package/dist/components/table/components/index.d.ts +1 -1
- package/dist/components/table/components/table-cell.d.ts +1 -1
- package/dist/components/table/components/table-cell.js +41 -32
- package/dist/components/table/components/table-filter/filters/boolean.js +52 -44
- package/dist/components/table/components/table-filter/selected-filters-display/selected-filters-display.utils.js +16 -16
- package/dist/components/table/components/table-filter/table-filter-button.js +59 -49
- package/dist/components/table/components/table-filter/table-filter-column-button.js +42 -41
- package/dist/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/components/table/components/table-header/table-header.js +10 -10
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/table-provider.js +37 -8
- package/dist/components/table/table.const.d.ts +10 -8
- package/dist/components/table/table.const.js +10 -8
- package/dist/components/table/table.js +1 -7
- package/dist/components/table/table.type.d.ts +36 -5
- package/dist/components/table/table.utils.d.ts +1 -1
- package/dist/components/table/table.utils.js +5 -3
- package/dist/components/table-card/table-card.js +116 -89
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.js +62 -64
- package/dist/types/components/assets/icons/check.d.ts +8 -0
- package/dist/types/components/assets/icons/x-mark.d.ts +8 -0
- package/dist/types/components/table/components/cell/avatar-cell.d.ts +15 -0
- package/dist/types/components/table/components/cell/boolean-cell.d.ts +1 -2
- package/dist/types/components/table/components/cell/description-cell.d.ts +7 -0
- package/dist/types/components/table/components/cell/index.d.ts +10 -1
- package/dist/types/components/table/components/cell/label-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/link-cell.d.ts +10 -0
- package/dist/types/components/table/components/cell/number-cell.d.ts +5 -3
- package/dist/types/components/table/components/index.d.ts +1 -1
- package/dist/types/components/table/components/table-cell.d.ts +1 -1
- package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +1 -1
- package/dist/types/components/table/index.d.ts +1 -1
- package/dist/types/components/table/table.const.d.ts +10 -8
- package/dist/types/components/table/table.type.d.ts +36 -5
- package/dist/types/components/table/table.utils.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/table/components/cell/text-cell.d.ts +0 -7
- package/dist/components/table/components/cell/text-cell.js +0 -5
- package/dist/node_modules/@heroicons/react/24/solid/esm/CheckCircleIcon.js +0 -26
- package/dist/node_modules/@heroicons/react/24/solid/esm/XCircleIcon.js +0 -26
- package/dist/types/components/table/components/cell/text-cell.d.ts +0 -7
|
@@ -1,137 +1,164 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Table as
|
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { Table as t } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
5
|
-
|
|
4
|
+
import { cn as n } from "../../lib/utils.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import "../alert/alert.const.js";
|
|
6
7
|
import "../button/button.js";
|
|
8
|
+
import "../collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
9
|
+
import "../collapsible-side-nav-bar/side-nav-bar.js";
|
|
10
|
+
import "../collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
11
|
+
import "../collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
12
|
+
import "../collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
13
|
+
import "../collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
14
|
+
import "../collapsible-side-nav-bar/side-nav-bar-item.js";
|
|
15
|
+
import "../collapsible-side-nav-bar/side-nav-bar-separator.js";
|
|
16
|
+
import "../collapsible-side-nav-bar/context.js";
|
|
17
|
+
import "../collapsible-side-nav-bar/popover/popover.js";
|
|
18
|
+
import "react-country-flag";
|
|
19
|
+
import "classnames";
|
|
20
|
+
import "@radix-ui/react-dialog";
|
|
21
|
+
import "../dropdown/z2-dropdown.js";
|
|
22
|
+
import "@radix-ui/react-dropdown-menu";
|
|
23
|
+
import "lucide-react";
|
|
7
24
|
import "../input/input.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
import "../nav-header/nav-header.js";
|
|
26
|
+
import "../nav-header/nav-item/nav-item.js";
|
|
27
|
+
import "@radix-ui/react-select";
|
|
28
|
+
import "../stepper/stepper.js";
|
|
29
|
+
import "../stepper-item/stepper-item.js";
|
|
30
|
+
import "@radix-ui/react-tabs";
|
|
31
|
+
import "../tooltip/tooltip.js";
|
|
32
|
+
import "../badge/badge.js";
|
|
33
|
+
import "../avatar/avatar.js";
|
|
34
|
+
import "../table/table.context.js";
|
|
35
|
+
const dt = ({
|
|
36
|
+
dataSource: v,
|
|
37
|
+
schema: i,
|
|
38
|
+
loading: H,
|
|
39
|
+
emptyMessage: w,
|
|
40
|
+
className: T,
|
|
41
|
+
rounded: d = !0,
|
|
42
|
+
bordered: h = !0,
|
|
43
|
+
showHeader: C = !0,
|
|
44
|
+
headerClassName: _,
|
|
45
|
+
search: m,
|
|
46
|
+
filter: e,
|
|
47
|
+
headerLeftContent: P,
|
|
21
48
|
headerActions: u,
|
|
22
|
-
body:
|
|
23
|
-
cell: {
|
|
49
|
+
body: r = {
|
|
50
|
+
cell: { hasBorder: !0 },
|
|
24
51
|
className: "",
|
|
25
52
|
stickyHeader: !0
|
|
26
53
|
},
|
|
27
|
-
showFooter:
|
|
28
|
-
footerClassName:
|
|
29
|
-
pagination:
|
|
30
|
-
paginationInfo:
|
|
31
|
-
paginationQuickJumper:
|
|
54
|
+
showFooter: x = !0,
|
|
55
|
+
footerClassName: k,
|
|
56
|
+
pagination: l,
|
|
57
|
+
paginationInfo: a,
|
|
58
|
+
paginationQuickJumper: s
|
|
32
59
|
}) => {
|
|
33
|
-
var
|
|
34
|
-
const
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
var B;
|
|
61
|
+
const F = s && s.totalPage && s.totalPage >= 2, p = l && l.totalPage && l.totalPage >= 2 || !!a || F, g = m || e || P || u, R = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
|
|
62
|
+
return /* @__PURE__ */ o("div", { className: n("flex flex-col overflow-hidden", T), children: /* @__PURE__ */ c(t, { dataSource: v, schema: i, loading: H, emptyMessage: w, children: [
|
|
63
|
+
C && g && /* @__PURE__ */ c(
|
|
64
|
+
t.Header,
|
|
38
65
|
{
|
|
39
|
-
className:
|
|
66
|
+
className: n(
|
|
40
67
|
"flex-shrink-0",
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
68
|
+
h && "border-stroke-solid-medium border-1 border-b-0",
|
|
69
|
+
d && "rounded-t-xl",
|
|
70
|
+
_
|
|
44
71
|
),
|
|
45
72
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
73
|
+
/* @__PURE__ */ c(t.HeaderContent, { children: [
|
|
74
|
+
P && P,
|
|
75
|
+
m && /* @__PURE__ */ o(
|
|
76
|
+
t.Search,
|
|
50
77
|
{
|
|
51
78
|
search: {
|
|
52
|
-
value:
|
|
53
|
-
onChange:
|
|
79
|
+
value: m.value || "",
|
|
80
|
+
onChange: m.onChange || (() => {
|
|
54
81
|
}),
|
|
55
|
-
placeholder:
|
|
82
|
+
placeholder: m.placeholder
|
|
56
83
|
},
|
|
57
|
-
className:
|
|
84
|
+
className: m.className
|
|
58
85
|
}
|
|
59
86
|
),
|
|
60
|
-
|
|
61
|
-
|
|
87
|
+
e && /* @__PURE__ */ c(
|
|
88
|
+
t.Filter,
|
|
62
89
|
{
|
|
63
|
-
schema:
|
|
90
|
+
schema: i,
|
|
64
91
|
filter: {
|
|
65
|
-
value:
|
|
66
|
-
onChange:
|
|
92
|
+
value: e.value || [],
|
|
93
|
+
onChange: e.onChange || (() => {
|
|
67
94
|
})
|
|
68
95
|
},
|
|
69
96
|
children: [
|
|
70
|
-
|
|
71
|
-
(
|
|
97
|
+
R && /* @__PURE__ */ o(t.Filter.FilterButton, {}),
|
|
98
|
+
(B = e == null ? void 0 : e.quickFilters) == null ? void 0 : B.map((N) => /* @__PURE__ */ o(t.Filter.FilterColumnButton, { filterName: N }, N))
|
|
72
99
|
]
|
|
73
100
|
}
|
|
74
101
|
)
|
|
75
102
|
] }),
|
|
76
|
-
u && /* @__PURE__ */
|
|
103
|
+
u && /* @__PURE__ */ o(t.HeaderContent, { children: u })
|
|
77
104
|
]
|
|
78
105
|
}
|
|
79
106
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
107
|
+
/* @__PURE__ */ o(
|
|
108
|
+
t.Body,
|
|
82
109
|
{
|
|
83
|
-
cell:
|
|
84
|
-
sort:
|
|
85
|
-
className:
|
|
110
|
+
cell: r == null ? void 0 : r.cell,
|
|
111
|
+
sort: r == null ? void 0 : r.sort,
|
|
112
|
+
className: n(
|
|
86
113
|
"flex-1 min-h-0",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
114
|
+
h && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
115
|
+
d && !(C && g) && "rounded-t-xl",
|
|
116
|
+
d && !(x && p) && "rounded-b-xl",
|
|
117
|
+
h && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
118
|
+
h && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
119
|
+
r == null ? void 0 : r.className
|
|
93
120
|
),
|
|
94
|
-
stickyHeader:
|
|
121
|
+
stickyHeader: r == null ? void 0 : r.stickyHeader
|
|
95
122
|
}
|
|
96
123
|
),
|
|
97
|
-
|
|
98
|
-
|
|
124
|
+
x && p && /* @__PURE__ */ c(
|
|
125
|
+
t.Footer,
|
|
99
126
|
{
|
|
100
|
-
className:
|
|
101
|
-
"flex-shrink-0",
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
127
|
+
className: n(
|
|
128
|
+
"flex-shrink-0 border-stroke-solid-light border-t-[0.5px]",
|
|
129
|
+
h && "border",
|
|
130
|
+
d && "rounded-b-xl",
|
|
131
|
+
k
|
|
105
132
|
),
|
|
106
133
|
children: [
|
|
107
|
-
|
|
108
|
-
|
|
134
|
+
a ? /* @__PURE__ */ o(t.FooterContent, { children: /* @__PURE__ */ o(
|
|
135
|
+
t.PaginationInfo,
|
|
109
136
|
{
|
|
110
|
-
showTotal:
|
|
111
|
-
totalItems:
|
|
112
|
-
currentPage:
|
|
113
|
-
itemsPerPage:
|
|
137
|
+
showTotal: a.showTotal,
|
|
138
|
+
totalItems: a.totalItems,
|
|
139
|
+
currentPage: a.currentPage,
|
|
140
|
+
itemsPerPage: a.itemsPerPage
|
|
114
141
|
}
|
|
115
|
-
) }) :
|
|
116
|
-
(
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
) }) : s || l ? /* @__PURE__ */ o(t.FooterContent, { children: null }) : null,
|
|
143
|
+
(s || l) && /* @__PURE__ */ c(t.FooterContent, { children: [
|
|
144
|
+
F && /* @__PURE__ */ o(
|
|
145
|
+
t.PaginationQuickJumper,
|
|
119
146
|
{
|
|
120
|
-
currentPage:
|
|
121
|
-
totalPage:
|
|
122
|
-
onChange:
|
|
147
|
+
currentPage: s.currentPage,
|
|
148
|
+
totalPage: s.totalPage,
|
|
149
|
+
onChange: s.onChange || (() => {
|
|
123
150
|
}),
|
|
124
|
-
disabled:
|
|
151
|
+
disabled: s.disabled
|
|
125
152
|
}
|
|
126
153
|
),
|
|
127
|
-
|
|
128
|
-
|
|
154
|
+
l && /* @__PURE__ */ o(
|
|
155
|
+
t.Pagination,
|
|
129
156
|
{
|
|
130
|
-
currentPage:
|
|
131
|
-
totalPage:
|
|
132
|
-
onChange:
|
|
157
|
+
currentPage: l.currentPage,
|
|
158
|
+
totalPage: l.totalPage,
|
|
159
|
+
onChange: l.onChange || (() => {
|
|
133
160
|
}),
|
|
134
|
-
totalItems:
|
|
161
|
+
totalItems: l.totalItems
|
|
135
162
|
}
|
|
136
163
|
)
|
|
137
164
|
] })
|
|
@@ -141,5 +168,5 @@ const M = ({
|
|
|
141
168
|
] }) });
|
|
142
169
|
};
|
|
143
170
|
export {
|
|
144
|
-
|
|
171
|
+
dt as default
|
|
145
172
|
};
|