@ztwoint/z-ui 0.1.146 → 0.1.147
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { Table as r } from "../../table/table-provider.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../alert/alert.const.js";
|
|
7
7
|
import "../../button/button.js";
|
|
@@ -23,7 +23,7 @@ import "@radix-ui/react-dialog";
|
|
|
23
23
|
import "../../dropdown/z2-dropdown.js";
|
|
24
24
|
import "@radix-ui/react-dropdown-menu";
|
|
25
25
|
import "lucide-react";
|
|
26
|
-
import
|
|
26
|
+
import q from "../../assets/icons/octagon-warning-Copy.js";
|
|
27
27
|
import "../../input/input.js";
|
|
28
28
|
import "../../nav-header/nav-header.js";
|
|
29
29
|
import "../../nav-header/nav-item/nav-item.js";
|
|
@@ -33,7 +33,7 @@ import "../../stepper/stepper.js";
|
|
|
33
33
|
import "../../stepper-item/stepper-item.js";
|
|
34
34
|
import "@radix-ui/react-tabs";
|
|
35
35
|
import "../../tooltip/tooltip.js";
|
|
36
|
-
import { Filter as
|
|
36
|
+
import { Filter as g } from "../../table-filter/index.js";
|
|
37
37
|
import "../../badge/badge.js";
|
|
38
38
|
import "../../avatar/avatar.js";
|
|
39
39
|
import "../../text-preset/text-preset.js";
|
|
@@ -58,57 +58,58 @@ import "../../z2map/components/map-zoom-control.js";
|
|
|
58
58
|
import "../../z2map/components/map-style-control.js";
|
|
59
59
|
import "../../kpi-card/kpi-card.js";
|
|
60
60
|
import "../../table/table.context.js";
|
|
61
|
-
const
|
|
62
|
-
dataSource:
|
|
63
|
-
schema:
|
|
64
|
-
loading:
|
|
65
|
-
emptyMessage:
|
|
66
|
-
className:
|
|
67
|
-
rounded:
|
|
68
|
-
bordered:
|
|
69
|
-
showHeader:
|
|
70
|
-
headerClassName:
|
|
61
|
+
const Mt = ({
|
|
62
|
+
dataSource: b,
|
|
63
|
+
schema: k,
|
|
64
|
+
loading: H,
|
|
65
|
+
emptyMessage: f,
|
|
66
|
+
className: j,
|
|
67
|
+
rounded: n = !0,
|
|
68
|
+
bordered: c = !0,
|
|
69
|
+
showHeader: P = !0,
|
|
70
|
+
headerClassName: T,
|
|
71
71
|
search: s,
|
|
72
72
|
filter: e,
|
|
73
73
|
headerLeftContent: p,
|
|
74
|
-
headerActions:
|
|
75
|
-
body:
|
|
74
|
+
headerActions: u,
|
|
75
|
+
body: l = {
|
|
76
76
|
cell: { hasBorder: !0 },
|
|
77
77
|
className: "",
|
|
78
78
|
stickyHeader: !0
|
|
79
79
|
},
|
|
80
|
-
showFooter:
|
|
81
|
-
footerClassName:
|
|
82
|
-
pagination:
|
|
80
|
+
showFooter: C = !0,
|
|
81
|
+
footerClassName: _,
|
|
82
|
+
pagination: m,
|
|
83
83
|
paginationInfo: i,
|
|
84
84
|
paginationQuickJumper: a,
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
footerInfo: d,
|
|
86
|
+
error: x = !1,
|
|
87
|
+
dataSourceError: R = !1
|
|
87
88
|
}) => {
|
|
88
|
-
var
|
|
89
|
-
if (
|
|
90
|
-
return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */ t(
|
|
92
|
-
/* @__PURE__ */
|
|
89
|
+
var w;
|
|
90
|
+
if (x)
|
|
91
|
+
return /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center h-64 bg-background-error-subtle rounded-lg text-text-warning-secondary", children: /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
|
|
92
|
+
/* @__PURE__ */ t(q, { className: "mt-1.5" }),
|
|
93
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
|
|
93
94
|
/* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
|
|
94
95
|
/* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
|
|
95
|
-
typeof
|
|
96
|
+
typeof x == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: x })
|
|
96
97
|
] })
|
|
97
98
|
] }) });
|
|
98
|
-
const N = a && a.totalPage && a.totalPage >= 2,
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
99
|
+
const N = a && a.totalPage && a.totalPage >= 2, v = m && m.totalPage && m.totalPage >= 2 || !!i || N || !!d, F = s || e || p || u, S = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
|
|
100
|
+
return /* @__PURE__ */ o("div", { className: h("flex flex-col overflow-hidden relative", j), children: [
|
|
101
|
+
/* @__PURE__ */ o(r, { dataSource: b, schema: k, emptyMessage: f, children: [
|
|
102
|
+
P && F && /* @__PURE__ */ o(
|
|
102
103
|
r.Header,
|
|
103
104
|
{
|
|
104
|
-
className:
|
|
105
|
+
className: h(
|
|
105
106
|
"flex-shrink-0",
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
c && "border-stroke-solid-medium border-1 border-b-0",
|
|
108
|
+
n && "rounded-t-xl",
|
|
109
|
+
T
|
|
109
110
|
),
|
|
110
111
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ o(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
|
|
112
113
|
p && p,
|
|
113
114
|
s && /* @__PURE__ */ t(
|
|
114
115
|
r.Search,
|
|
@@ -122,8 +123,8 @@ const It = ({
|
|
|
122
123
|
className: s.className
|
|
123
124
|
}
|
|
124
125
|
),
|
|
125
|
-
e && /* @__PURE__ */
|
|
126
|
-
|
|
126
|
+
e && /* @__PURE__ */ o(
|
|
127
|
+
g,
|
|
127
128
|
{
|
|
128
129
|
filterSchema: e.filterSchema,
|
|
129
130
|
filter: {
|
|
@@ -134,54 +135,57 @@ const It = ({
|
|
|
134
135
|
loading: e.loading
|
|
135
136
|
},
|
|
136
137
|
children: [
|
|
137
|
-
|
|
138
|
-
(
|
|
138
|
+
S && /* @__PURE__ */ t(g.FilterButton, {}),
|
|
139
|
+
(w = e == null ? void 0 : e.quickFilters) == null ? void 0 : w.map((B) => /* @__PURE__ */ t(g.FilterColumnButton, { filterName: B }, B))
|
|
139
140
|
]
|
|
140
141
|
}
|
|
141
142
|
)
|
|
142
143
|
] }),
|
|
143
|
-
|
|
144
|
+
u && /* @__PURE__ */ t(r.HeaderContent, { children: u })
|
|
144
145
|
]
|
|
145
146
|
}
|
|
146
147
|
),
|
|
147
148
|
/* @__PURE__ */ t(
|
|
148
149
|
r.Body,
|
|
149
150
|
{
|
|
150
|
-
dataSourceError:
|
|
151
|
-
cell:
|
|
152
|
-
sort:
|
|
153
|
-
className:
|
|
151
|
+
dataSourceError: R,
|
|
152
|
+
cell: l == null ? void 0 : l.cell,
|
|
153
|
+
sort: l == null ? void 0 : l.sort,
|
|
154
|
+
className: h(
|
|
154
155
|
"flex-1 min-h-0",
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
c && "border-stroke-solid-light border-1",
|
|
157
|
+
n && !(P && F) && "rounded-t-xl",
|
|
158
|
+
n && !(C && v) && "rounded-b-xl",
|
|
159
|
+
c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
160
|
+
c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
161
|
+
l == null ? void 0 : l.className
|
|
161
162
|
),
|
|
162
|
-
stickyHeader:
|
|
163
|
+
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
163
164
|
}
|
|
164
165
|
),
|
|
165
|
-
|
|
166
|
+
C && v && /* @__PURE__ */ o(
|
|
166
167
|
r.Footer,
|
|
167
168
|
{
|
|
168
|
-
className:
|
|
169
|
+
className: h(
|
|
169
170
|
"flex-shrink-0 border-stroke-solid-light border-t-[1px] mt-[-2px]",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
c && "border",
|
|
172
|
+
n && "rounded-b-xl",
|
|
173
|
+
_
|
|
173
174
|
),
|
|
174
175
|
children: [
|
|
175
|
-
i ? /* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
176
|
+
i ? /* @__PURE__ */ o(r.FooterContent, { children: [
|
|
177
|
+
/* @__PURE__ */ t(
|
|
178
|
+
r.PaginationInfo,
|
|
179
|
+
{
|
|
180
|
+
showTotal: i.showTotal,
|
|
181
|
+
totalItems: i.totalItems,
|
|
182
|
+
currentPage: i.currentPage,
|
|
183
|
+
itemsPerPage: i.itemsPerPage
|
|
184
|
+
}
|
|
185
|
+
),
|
|
186
|
+
d
|
|
187
|
+
] }) : d ? /* @__PURE__ */ t(r.FooterContent, { children: d }) : a || m ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
|
|
188
|
+
(a || m) && /* @__PURE__ */ o(r.FooterContent, { children: [
|
|
185
189
|
N && /* @__PURE__ */ t(
|
|
186
190
|
r.PaginationQuickJumper,
|
|
187
191
|
{
|
|
@@ -192,14 +196,14 @@ const It = ({
|
|
|
192
196
|
disabled: a.disabled
|
|
193
197
|
}
|
|
194
198
|
),
|
|
195
|
-
|
|
199
|
+
m && /* @__PURE__ */ t(
|
|
196
200
|
r.Pagination,
|
|
197
201
|
{
|
|
198
|
-
currentPage:
|
|
199
|
-
totalPage:
|
|
200
|
-
onChange:
|
|
202
|
+
currentPage: m.currentPage,
|
|
203
|
+
totalPage: m.totalPage,
|
|
204
|
+
onChange: m.onChange || (() => {
|
|
201
205
|
}),
|
|
202
|
-
totalItems:
|
|
206
|
+
totalItems: m.totalItems
|
|
203
207
|
}
|
|
204
208
|
)
|
|
205
209
|
] })
|
|
@@ -207,12 +211,12 @@ const It = ({
|
|
|
207
211
|
}
|
|
208
212
|
)
|
|
209
213
|
] }),
|
|
210
|
-
|
|
214
|
+
H && /* @__PURE__ */ t("div", { className: "absolute top-0 inset-0 w-full h-full bg-white/80 flex items-center justify-center", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
|
|
211
215
|
/* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
|
|
212
216
|
/* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
|
|
213
217
|
] }) })
|
|
214
218
|
] });
|
|
215
219
|
};
|
|
216
220
|
export {
|
|
217
|
-
|
|
221
|
+
Mt as default
|
|
218
222
|
};
|
|
@@ -32,6 +32,7 @@ export interface TableCardProps {
|
|
|
32
32
|
pagination?: PaginationProps;
|
|
33
33
|
paginationInfo?: PaginationInfoProps;
|
|
34
34
|
paginationQuickJumper?: PaginationQuickJumperProps;
|
|
35
|
+
footerInfo?: React.ReactNode;
|
|
35
36
|
loading?: boolean;
|
|
36
37
|
emptyMessage?: string;
|
|
37
38
|
dataSourceError?: boolean | string;
|
|
@@ -33,6 +33,7 @@ export interface TableCardProps {
|
|
|
33
33
|
pagination?: PaginationProps;
|
|
34
34
|
paginationInfo?: PaginationInfoProps;
|
|
35
35
|
paginationQuickJumper?: PaginationQuickJumperProps;
|
|
36
|
+
footerInfo?: React.ReactNode;
|
|
36
37
|
loading?: boolean;
|
|
37
38
|
emptyMessage?: string;
|
|
38
39
|
dataSourceError?: boolean | string;
|