@ztwoint/z-ui 0.1.146 → 0.1.148
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/pdf-preview/components/pdf-error-state.d.ts +9 -0
- package/dist/components/pdf-preview/components/pdf-error-state.js +18 -0
- package/dist/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
- package/dist/components/pdf-preview/components/pdf-loading-state.js +34 -0
- package/dist/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
- package/dist/components/pdf-preview/components/pdf-toolbar.js +47 -0
- package/dist/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
- package/dist/components/pdf-preview/components/pdf-viewer.js +6 -0
- package/dist/components/pdf-preview/index.d.ts +3 -0
- package/dist/components/pdf-preview/pdf-preview.const.d.ts +29 -0
- package/dist/components/pdf-preview/pdf-preview.const.js +29 -0
- package/dist/components/pdf-preview/pdf-preview.d.ts +16 -0
- package/dist/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
- package/dist/components/pdf-preview/pdf-preview.hook.js +69 -0
- package/dist/components/pdf-preview/pdf-preview.js +77 -0
- package/dist/components/pdf-preview/pdf-preview.type.d.ts +81 -0
- package/dist/components/primitives/table-card/table-card.js +81 -76
- package/dist/components/primitives/table-card/table-card.type.d.ts +1 -0
- package/dist/components/table/components/cell/avatar-cell.js +3 -2
- package/dist/components/table/table-provider.js +1 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +56 -54
- package/dist/sample-resume.pdf +0 -0
- package/dist/types/components/pdf-preview/components/pdf-error-state.d.ts +9 -0
- package/dist/types/components/pdf-preview/components/pdf-loading-state.d.ts +3 -0
- package/dist/types/components/pdf-preview/components/pdf-toolbar.d.ts +16 -0
- package/dist/types/components/pdf-preview/components/pdf-viewer.d.ts +22 -0
- package/dist/types/components/pdf-preview/index.d.ts +3 -0
- package/dist/types/components/pdf-preview/pdf-preview.const.d.ts +29 -0
- package/dist/types/components/pdf-preview/pdf-preview.d.ts +16 -0
- package/dist/types/components/pdf-preview/pdf-preview.hook.d.ts +12 -0
- package/dist/types/components/pdf-preview/pdf-preview.type.d.ts +81 -0
- package/dist/types/components/primitives/table-card/table-card.type.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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 p } 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";
|
|
@@ -57,59 +57,61 @@ import "../../z2map/components/map-controls.js";
|
|
|
57
57
|
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
|
+
import "../../pdf-preview/pdf-preview.js";
|
|
60
61
|
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:
|
|
62
|
+
const Ut = ({
|
|
63
|
+
dataSource: b,
|
|
64
|
+
schema: k,
|
|
65
|
+
loading: H,
|
|
66
|
+
emptyMessage: f,
|
|
67
|
+
className: j,
|
|
68
|
+
rounded: n = !0,
|
|
69
|
+
bordered: c = !0,
|
|
70
|
+
showHeader: P = !0,
|
|
71
|
+
headerClassName: T,
|
|
71
72
|
search: s,
|
|
72
73
|
filter: e,
|
|
73
|
-
headerLeftContent:
|
|
74
|
-
headerActions:
|
|
75
|
-
body:
|
|
74
|
+
headerLeftContent: h,
|
|
75
|
+
headerActions: u,
|
|
76
|
+
body: l = {
|
|
76
77
|
cell: { hasBorder: !0 },
|
|
77
78
|
className: "",
|
|
78
79
|
stickyHeader: !0
|
|
79
80
|
},
|
|
80
|
-
showFooter:
|
|
81
|
-
footerClassName:
|
|
82
|
-
pagination:
|
|
81
|
+
showFooter: C = !0,
|
|
82
|
+
footerClassName: _,
|
|
83
|
+
pagination: m,
|
|
83
84
|
paginationInfo: i,
|
|
84
85
|
paginationQuickJumper: a,
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
footerInfo: d,
|
|
87
|
+
error: x = !1,
|
|
88
|
+
dataSourceError: R = !1
|
|
87
89
|
}) => {
|
|
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__ */
|
|
90
|
+
var w;
|
|
91
|
+
if (x)
|
|
92
|
+
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: [
|
|
93
|
+
/* @__PURE__ */ t(q, { className: "mt-1.5" }),
|
|
94
|
+
/* @__PURE__ */ o("div", { className: "flex flex-col gap-2", children: [
|
|
93
95
|
/* @__PURE__ */ t("div", { className: "text-text-error-primary text-lg font-medium", children: "Error loading data" }),
|
|
94
96
|
/* @__PURE__ */ t("div", { className: "text-sm", children: "Please try again later" }),
|
|
95
|
-
typeof
|
|
97
|
+
typeof x == "string" && /* @__PURE__ */ t("div", { className: "text-text-warning-secondary text-sm", children: x })
|
|
96
98
|
] })
|
|
97
99
|
] }) });
|
|
98
|
-
const N = a && a.totalPage && a.totalPage >= 2,
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
100
|
+
const N = a && a.totalPage && a.totalPage >= 2, v = m && m.totalPage && m.totalPage >= 2 || !!i || N || !!d, F = s || e || h || u, S = typeof (e == null ? void 0 : e.showFilterButton) > "u" ? !0 : e == null ? void 0 : e.showFilterButton;
|
|
101
|
+
return /* @__PURE__ */ o("div", { className: p("flex flex-col overflow-hidden relative", j), children: [
|
|
102
|
+
/* @__PURE__ */ o(r, { dataSource: b, schema: k, emptyMessage: f, children: [
|
|
103
|
+
P && F && /* @__PURE__ */ o(
|
|
102
104
|
r.Header,
|
|
103
105
|
{
|
|
104
|
-
className:
|
|
106
|
+
className: p(
|
|
105
107
|
"flex-shrink-0",
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
c && "border-stroke-solid-medium border-1 border-b-0",
|
|
109
|
+
n && "rounded-t-xl",
|
|
110
|
+
T
|
|
109
111
|
),
|
|
110
112
|
children: [
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
|
|
113
|
+
/* @__PURE__ */ o(r.HeaderContent, { className: "overflow-x-auto p-[1px]", children: [
|
|
114
|
+
h && h,
|
|
113
115
|
s && /* @__PURE__ */ t(
|
|
114
116
|
r.Search,
|
|
115
117
|
{
|
|
@@ -122,8 +124,8 @@ const It = ({
|
|
|
122
124
|
className: s.className
|
|
123
125
|
}
|
|
124
126
|
),
|
|
125
|
-
e && /* @__PURE__ */
|
|
126
|
-
|
|
127
|
+
e && /* @__PURE__ */ o(
|
|
128
|
+
g,
|
|
127
129
|
{
|
|
128
130
|
filterSchema: e.filterSchema,
|
|
129
131
|
filter: {
|
|
@@ -134,54 +136,57 @@ const It = ({
|
|
|
134
136
|
loading: e.loading
|
|
135
137
|
},
|
|
136
138
|
children: [
|
|
137
|
-
|
|
138
|
-
(
|
|
139
|
+
S && /* @__PURE__ */ t(g.FilterButton, {}),
|
|
140
|
+
(w = e == null ? void 0 : e.quickFilters) == null ? void 0 : w.map((B) => /* @__PURE__ */ t(g.FilterColumnButton, { filterName: B }, B))
|
|
139
141
|
]
|
|
140
142
|
}
|
|
141
143
|
)
|
|
142
144
|
] }),
|
|
143
|
-
|
|
145
|
+
u && /* @__PURE__ */ t(r.HeaderContent, { children: u })
|
|
144
146
|
]
|
|
145
147
|
}
|
|
146
148
|
),
|
|
147
149
|
/* @__PURE__ */ t(
|
|
148
150
|
r.Body,
|
|
149
151
|
{
|
|
150
|
-
dataSourceError:
|
|
151
|
-
cell:
|
|
152
|
-
sort:
|
|
153
|
-
className:
|
|
152
|
+
dataSourceError: R,
|
|
153
|
+
cell: l == null ? void 0 : l.cell,
|
|
154
|
+
sort: l == null ? void 0 : l.sort,
|
|
155
|
+
className: p(
|
|
154
156
|
"flex-1 min-h-0",
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
c && "border-stroke-solid-light border-1",
|
|
158
|
+
n && !(P && F) && "rounded-t-xl",
|
|
159
|
+
n && !(C && v) && "rounded-b-xl",
|
|
160
|
+
c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
161
|
+
c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
162
|
+
l == null ? void 0 : l.className
|
|
161
163
|
),
|
|
162
|
-
stickyHeader:
|
|
164
|
+
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
163
165
|
}
|
|
164
166
|
),
|
|
165
|
-
|
|
167
|
+
C && v && /* @__PURE__ */ o(
|
|
166
168
|
r.Footer,
|
|
167
169
|
{
|
|
168
|
-
className:
|
|
170
|
+
className: p(
|
|
169
171
|
"flex-shrink-0 border-stroke-solid-light border-t-[1px] mt-[-2px]",
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
c && "border",
|
|
173
|
+
n && "rounded-b-xl",
|
|
174
|
+
_
|
|
173
175
|
),
|
|
174
176
|
children: [
|
|
175
|
-
i ? /* @__PURE__ */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
i ? /* @__PURE__ */ o(r.FooterContent, { children: [
|
|
178
|
+
/* @__PURE__ */ t(
|
|
179
|
+
r.PaginationInfo,
|
|
180
|
+
{
|
|
181
|
+
showTotal: i.showTotal,
|
|
182
|
+
totalItems: i.totalItems,
|
|
183
|
+
currentPage: i.currentPage,
|
|
184
|
+
itemsPerPage: i.itemsPerPage
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
d
|
|
188
|
+
] }) : d ? /* @__PURE__ */ t(r.FooterContent, { children: d }) : a || m ? /* @__PURE__ */ t(r.FooterContent, { children: null }) : null,
|
|
189
|
+
(a || m) && /* @__PURE__ */ o(r.FooterContent, { children: [
|
|
185
190
|
N && /* @__PURE__ */ t(
|
|
186
191
|
r.PaginationQuickJumper,
|
|
187
192
|
{
|
|
@@ -192,14 +197,14 @@ const It = ({
|
|
|
192
197
|
disabled: a.disabled
|
|
193
198
|
}
|
|
194
199
|
),
|
|
195
|
-
|
|
200
|
+
m && /* @__PURE__ */ t(
|
|
196
201
|
r.Pagination,
|
|
197
202
|
{
|
|
198
|
-
currentPage:
|
|
199
|
-
totalPage:
|
|
200
|
-
onChange:
|
|
203
|
+
currentPage: m.currentPage,
|
|
204
|
+
totalPage: m.totalPage,
|
|
205
|
+
onChange: m.onChange || (() => {
|
|
201
206
|
}),
|
|
202
|
-
totalItems:
|
|
207
|
+
totalItems: m.totalItems
|
|
203
208
|
}
|
|
204
209
|
)
|
|
205
210
|
] })
|
|
@@ -207,12 +212,12 @@ const It = ({
|
|
|
207
212
|
}
|
|
208
213
|
)
|
|
209
214
|
] }),
|
|
210
|
-
|
|
215
|
+
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
216
|
/* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-text-brand-secondary" }),
|
|
212
217
|
/* @__PURE__ */ t("p", { className: "text-text-neutral-primary font-medium", children: "Loading..." })
|
|
213
218
|
] }) })
|
|
214
219
|
] });
|
|
215
220
|
};
|
|
216
221
|
export {
|
|
217
|
-
|
|
222
|
+
Ut as default
|
|
218
223
|
};
|
|
@@ -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;
|
|
@@ -57,7 +57,8 @@ import "../../../z2map/components/map-controls.js";
|
|
|
57
57
|
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 "../../../pdf-preview/pdf-preview.js";
|
|
61
|
+
const Nt = ({
|
|
61
62
|
avatar: m,
|
|
62
63
|
value: a,
|
|
63
64
|
rightIcon: o,
|
|
@@ -95,5 +96,5 @@ const ht = ({
|
|
|
95
96
|
}
|
|
96
97
|
);
|
|
97
98
|
export {
|
|
98
|
-
|
|
99
|
+
Nt as AvatarCell
|
|
99
100
|
};
|
|
@@ -62,6 +62,7 @@ import "../z2map/components/map-controls.js";
|
|
|
62
62
|
import "../z2map/components/map-zoom-control.js";
|
|
63
63
|
import "../z2map/components/map-style-control.js";
|
|
64
64
|
import "../kpi-card/kpi-card.js";
|
|
65
|
+
import "../pdf-preview/pdf-preview.js";
|
|
65
66
|
import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
|
|
66
67
|
import { TableHeaderContent as b } from "./components/table-header-content.js";
|
|
67
68
|
import { TableFooter as s } from "./components/table-footer.js";
|