@ztwoint/z-ui 0.1.58 → 0.1.59
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/octagon-warning-Copy.js +30 -0
- package/dist/components/table-card/table-card.js +72 -61
- package/dist/components/table-card/table-card.type.d.ts +1 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/table-card/table-card.type.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
function m({
|
|
3
|
+
fill: t = "currentColor",
|
|
4
|
+
strokewidth: o = 1,
|
|
5
|
+
width: e = "1em",
|
|
6
|
+
height: n = "1em",
|
|
7
|
+
...h
|
|
8
|
+
}) {
|
|
9
|
+
return /* @__PURE__ */ r(
|
|
10
|
+
"svg",
|
|
11
|
+
{
|
|
12
|
+
height: n,
|
|
13
|
+
width: e,
|
|
14
|
+
...h,
|
|
15
|
+
viewBox: "0 0 14 14",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
children: /* @__PURE__ */ r("g", { fill: t, children: /* @__PURE__ */ r(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M9.6 0.58h-5.28l-3.74 3.74v5.28l3.74 3.74h5.28l3.74-3.74v-5.28l-3.74-3.74z m-3.22 2.9h1.16v4.64h-1.16v-4.64z m0.58 6.96c-0.4 0-0.72-0.33-0.72-0.73s0.33-0.72 0.72-0.72 0.72 0.33 0.72 0.72-0.33 0.72-0.72 0.73z",
|
|
21
|
+
fill: t,
|
|
22
|
+
strokeWidth: o
|
|
23
|
+
}
|
|
24
|
+
) })
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
m as default
|
|
30
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { Table as t } from "../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as i } from "../../lib/utils.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../alert/alert.const.js";
|
|
7
7
|
import "../button/button.js";
|
|
@@ -30,51 +30,62 @@ import "../stepper/stepper.js";
|
|
|
30
30
|
import "../stepper-item/stepper-item.js";
|
|
31
31
|
import "@radix-ui/react-tabs";
|
|
32
32
|
import "../tooltip/tooltip.js";
|
|
33
|
+
import f from "../assets/icons/octagon-warning-Copy.js";
|
|
33
34
|
import "../badge/badge.js";
|
|
34
35
|
import "../avatar/avatar.js";
|
|
35
36
|
import "../text-preset/text-preset.js";
|
|
36
37
|
import "../table/table.context.js";
|
|
37
|
-
const
|
|
38
|
-
dataSource:
|
|
39
|
-
schema:
|
|
38
|
+
const Pe = ({
|
|
39
|
+
dataSource: w,
|
|
40
|
+
schema: P,
|
|
40
41
|
loading: H,
|
|
41
|
-
emptyMessage:
|
|
42
|
+
emptyMessage: k,
|
|
42
43
|
className: T,
|
|
43
44
|
rounded: d = !0,
|
|
44
|
-
bordered:
|
|
45
|
-
showHeader:
|
|
45
|
+
bordered: n = !0,
|
|
46
|
+
showHeader: g = !0,
|
|
46
47
|
headerClassName: _,
|
|
47
48
|
search: m,
|
|
48
|
-
filter:
|
|
49
|
-
headerLeftContent:
|
|
50
|
-
headerActions:
|
|
51
|
-
body:
|
|
49
|
+
filter: r,
|
|
50
|
+
headerLeftContent: h,
|
|
51
|
+
headerActions: u,
|
|
52
|
+
body: l = {
|
|
52
53
|
cell: { hasBorder: !0 },
|
|
53
54
|
className: "",
|
|
54
55
|
stickyHeader: !0
|
|
55
56
|
},
|
|
56
57
|
showFooter: p = !0,
|
|
57
|
-
footerClassName:
|
|
58
|
-
pagination:
|
|
59
|
-
paginationInfo:
|
|
60
|
-
paginationQuickJumper: s
|
|
58
|
+
footerClassName: j,
|
|
59
|
+
pagination: o,
|
|
60
|
+
paginationInfo: c,
|
|
61
|
+
paginationQuickJumper: s,
|
|
62
|
+
error: x = !1
|
|
61
63
|
}) => {
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
var v;
|
|
65
|
+
if (x)
|
|
66
|
+
return /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
|
|
67
|
+
/* @__PURE__ */ e(f, { className: "mt-1.5" }),
|
|
68
|
+
/* @__PURE__ */ a("div", { className: "flex flex-col gap-2", children: [
|
|
69
|
+
/* @__PURE__ */ e("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
|
|
70
|
+
/* @__PURE__ */ e("div", { className: "text-sm", children: "Please try again later" }),
|
|
71
|
+
typeof x == "string" && /* @__PURE__ */ e("div", { className: "text-text-warning-secondary text-sm", children: x })
|
|
72
|
+
] })
|
|
73
|
+
] }) });
|
|
74
|
+
const C = s && s.totalPage && s.totalPage >= 2, N = o && o.totalPage && o.totalPage >= 2 || !!c || C, F = m || r || h || u, R = typeof (r == null ? void 0 : r.showFilterButton) > "u" ? !0 : r == null ? void 0 : r.showFilterButton;
|
|
75
|
+
return /* @__PURE__ */ e("div", { className: i("flex flex-col overflow-hidden", T), children: /* @__PURE__ */ a(t, { dataSource: w, schema: P, loading: H, emptyMessage: k, children: [
|
|
76
|
+
g && F && /* @__PURE__ */ a(
|
|
66
77
|
t.Header,
|
|
67
78
|
{
|
|
68
|
-
className:
|
|
79
|
+
className: i(
|
|
69
80
|
"flex-shrink-0",
|
|
70
|
-
|
|
81
|
+
n && "border-stroke-solid-medium border-1 border-b-0",
|
|
71
82
|
d && "rounded-t-xl",
|
|
72
83
|
_
|
|
73
84
|
),
|
|
74
85
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
|
|
77
|
-
m && /* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ a(t.HeaderContent, { children: [
|
|
87
|
+
h && h,
|
|
88
|
+
m && /* @__PURE__ */ e(
|
|
78
89
|
t.Search,
|
|
79
90
|
{
|
|
80
91
|
search: {
|
|
@@ -86,64 +97,64 @@ const Pt = ({
|
|
|
86
97
|
className: m.className
|
|
87
98
|
}
|
|
88
99
|
),
|
|
89
|
-
|
|
100
|
+
r && /* @__PURE__ */ a(
|
|
90
101
|
t.Filter,
|
|
91
102
|
{
|
|
92
|
-
schema:
|
|
103
|
+
schema: P,
|
|
93
104
|
filter: {
|
|
94
|
-
value:
|
|
95
|
-
onChange:
|
|
105
|
+
value: r.value || [],
|
|
106
|
+
onChange: r.onChange || (() => {
|
|
96
107
|
})
|
|
97
108
|
},
|
|
98
109
|
children: [
|
|
99
|
-
R && /* @__PURE__ */
|
|
100
|
-
(
|
|
110
|
+
R && /* @__PURE__ */ e(t.Filter.FilterButton, {}),
|
|
111
|
+
(v = r == null ? void 0 : r.quickFilters) == null ? void 0 : v.map((B) => /* @__PURE__ */ e(t.Filter.FilterColumnButton, { filterName: B }, B))
|
|
101
112
|
]
|
|
102
113
|
}
|
|
103
114
|
)
|
|
104
115
|
] }),
|
|
105
|
-
|
|
116
|
+
u && /* @__PURE__ */ e(t.HeaderContent, { children: u })
|
|
106
117
|
]
|
|
107
118
|
}
|
|
108
119
|
),
|
|
109
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ e(
|
|
110
121
|
t.Body,
|
|
111
122
|
{
|
|
112
|
-
cell:
|
|
113
|
-
sort:
|
|
114
|
-
className:
|
|
123
|
+
cell: l == null ? void 0 : l.cell,
|
|
124
|
+
sort: l == null ? void 0 : l.sort,
|
|
125
|
+
className: i(
|
|
115
126
|
"flex-1 min-h-0",
|
|
116
|
-
|
|
117
|
-
d && !(
|
|
118
|
-
d && !(p &&
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
127
|
+
n && "border-stroke-solid-light border-1",
|
|
128
|
+
d && !(g && F) && "rounded-t-xl",
|
|
129
|
+
d && !(p && N) && "rounded-b-xl",
|
|
130
|
+
n && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
131
|
+
n && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
132
|
+
l == null ? void 0 : l.className
|
|
122
133
|
),
|
|
123
|
-
stickyHeader:
|
|
134
|
+
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
124
135
|
}
|
|
125
136
|
),
|
|
126
|
-
p &&
|
|
137
|
+
p && N && /* @__PURE__ */ a(
|
|
127
138
|
t.Footer,
|
|
128
139
|
{
|
|
129
|
-
className:
|
|
140
|
+
className: i(
|
|
130
141
|
"flex-shrink-0 border-stroke-solid-light border-t-[0.5px] mt-[-2px]",
|
|
131
|
-
|
|
142
|
+
n && "border",
|
|
132
143
|
d && "rounded-b-xl",
|
|
133
|
-
|
|
144
|
+
j
|
|
134
145
|
),
|
|
135
146
|
children: [
|
|
136
|
-
|
|
147
|
+
c ? /* @__PURE__ */ e(t.FooterContent, { children: /* @__PURE__ */ e(
|
|
137
148
|
t.PaginationInfo,
|
|
138
149
|
{
|
|
139
|
-
showTotal:
|
|
140
|
-
totalItems:
|
|
141
|
-
currentPage:
|
|
142
|
-
itemsPerPage:
|
|
150
|
+
showTotal: c.showTotal,
|
|
151
|
+
totalItems: c.totalItems,
|
|
152
|
+
currentPage: c.currentPage,
|
|
153
|
+
itemsPerPage: c.itemsPerPage
|
|
143
154
|
}
|
|
144
|
-
) }) : s ||
|
|
145
|
-
(s ||
|
|
146
|
-
|
|
155
|
+
) }) : s || o ? /* @__PURE__ */ e(t.FooterContent, { children: null }) : null,
|
|
156
|
+
(s || o) && /* @__PURE__ */ a(t.FooterContent, { children: [
|
|
157
|
+
C && /* @__PURE__ */ e(
|
|
147
158
|
t.PaginationQuickJumper,
|
|
148
159
|
{
|
|
149
160
|
currentPage: s.currentPage,
|
|
@@ -153,14 +164,14 @@ const Pt = ({
|
|
|
153
164
|
disabled: s.disabled
|
|
154
165
|
}
|
|
155
166
|
),
|
|
156
|
-
|
|
167
|
+
o && /* @__PURE__ */ e(
|
|
157
168
|
t.Pagination,
|
|
158
169
|
{
|
|
159
|
-
currentPage:
|
|
160
|
-
totalPage:
|
|
161
|
-
onChange:
|
|
170
|
+
currentPage: o.currentPage,
|
|
171
|
+
totalPage: o.totalPage,
|
|
172
|
+
onChange: o.onChange || (() => {
|
|
162
173
|
}),
|
|
163
|
-
totalItems:
|
|
174
|
+
totalItems: o.totalItems
|
|
164
175
|
}
|
|
165
176
|
)
|
|
166
177
|
] })
|
|
@@ -170,5 +181,5 @@ const Pt = ({
|
|
|
170
181
|
] }) });
|
|
171
182
|
};
|
|
172
183
|
export {
|
|
173
|
-
|
|
184
|
+
Pe as default
|
|
174
185
|
};
|