@ztwoint/z-ui 0.1.40 → 0.1.42
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/chevron-right.d.ts +1 -2
- package/dist/components/assets/icons/chevron-right.js +13 -27
- package/dist/components/button/button.js +9 -9
- package/dist/components/file-upload-area/file-upload-area.js +2 -2
- package/dist/components/stepper-item/stepper-item.js +4 -4
- package/dist/components/table/components/pagination/components/pagination-info.js +12 -12
- package/dist/components/table/components/pagination/pagination.const.d.ts +1 -1
- package/dist/components/table/components/pagination/pagination.const.js +1 -1
- package/dist/components/table/components/pagination/pagination.js +43 -43
- package/dist/components/table/components/pagination/pagination.utils.js +17 -15
- package/dist/components/table/components/table-footer.js +8 -3
- package/dist/components/table/components/table-header/stories/basic-header.d.ts +3 -0
- package/dist/components/table/components/table-header/stories/custom-header-content.d.ts +3 -0
- package/dist/components/table/components/table-header/stories/header-for-sorting.d.ts +3 -0
- package/dist/components/table/components/table-header/table-header.storiesOld.d.ts +6 -0
- package/dist/components/table/components/table-header-wrapper.js +6 -10
- package/dist/components/table/components/table-search/table-search.js +4 -4
- package/dist/components/table-card/table-card.js +118 -92
- package/dist/components/table-card/table-card.type.d.ts +7 -1
- package/dist/css/config/components/button.css +8 -0
- package/dist/css/config/components/file-upload-area.css +11 -0
- package/dist/css/config/components/index.css +1 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/assets/icons/chevron-right.d.ts +1 -2
- package/dist/types/components/table/components/pagination/pagination.const.d.ts +1 -1
- package/dist/types/components/table/components/table-header/stories/basic-header.d.ts +3 -0
- package/dist/types/components/table/components/table-header/stories/custom-header-content.d.ts +3 -0
- package/dist/types/components/table/components/table-header/stories/header-for-sorting.d.ts +3 -0
- package/dist/types/components/table/components/table-header/table-header.storiesOld.d.ts +6 -0
- package/dist/types/components/table-card/table-card.type.d.ts +7 -1
- package/package.json +1 -1
|
@@ -1,114 +1,140 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as t, 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 m } 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:
|
|
10
|
-
schema:
|
|
11
|
-
loading:
|
|
12
|
-
emptyMessage:
|
|
13
|
-
className:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
const E = ({
|
|
9
|
+
dataSource: v,
|
|
10
|
+
schema: C,
|
|
11
|
+
loading: F,
|
|
12
|
+
emptyMessage: T,
|
|
13
|
+
className: _,
|
|
14
|
+
rounded: d = !1,
|
|
15
|
+
bordered: c = !1,
|
|
16
|
+
showHeader: u = !0,
|
|
17
|
+
headerClassName: R,
|
|
18
|
+
search: o,
|
|
19
|
+
filter: P,
|
|
20
|
+
headerLeftContent: n,
|
|
21
|
+
headerActions: x,
|
|
22
|
+
body: l = {
|
|
20
23
|
cell: { cellHeight: "small", hasBorder: !0 },
|
|
21
24
|
className: "",
|
|
22
25
|
stickyHeader: !0
|
|
23
26
|
},
|
|
24
|
-
showFooter:
|
|
25
|
-
footerClassName:
|
|
26
|
-
pagination:
|
|
27
|
-
paginationInfo:
|
|
28
|
-
paginationQuickJumper:
|
|
27
|
+
showFooter: g = !0,
|
|
28
|
+
footerClassName: j,
|
|
29
|
+
pagination: r,
|
|
30
|
+
paginationInfo: a,
|
|
31
|
+
paginationQuickJumper: s
|
|
29
32
|
}) => {
|
|
30
|
-
const
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
placeholder: s.placeholder
|
|
42
|
-
},
|
|
43
|
-
className: s.className
|
|
44
|
-
}
|
|
33
|
+
const N = s && s.totalPage && s.totalPage >= 2, H = r && r.totalPage && r.totalPage >= 2 || !!a || N, f = o || P || n || x;
|
|
34
|
+
return /* @__PURE__ */ t("div", { className: m("flex flex-col overflow-hidden", _), children: /* @__PURE__ */ h(e, { dataSource: v, schema: C, loading: F, emptyMessage: T, children: [
|
|
35
|
+
u && f && /* @__PURE__ */ h(
|
|
36
|
+
e.Header,
|
|
37
|
+
{
|
|
38
|
+
className: m(
|
|
39
|
+
"flex-shrink-0",
|
|
40
|
+
c && "border-stroke-solid-medium border-1 border-b-0",
|
|
41
|
+
d && "rounded-t-xl",
|
|
42
|
+
R
|
|
45
43
|
),
|
|
46
|
-
|
|
47
|
-
e.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ h(e.HeaderContent, { children: [
|
|
46
|
+
n && n,
|
|
47
|
+
o && /* @__PURE__ */ t(
|
|
48
|
+
e.Search,
|
|
49
|
+
{
|
|
50
|
+
search: {
|
|
51
|
+
value: o.value || "",
|
|
52
|
+
onChange: o.onChange || (() => {
|
|
53
|
+
}),
|
|
54
|
+
placeholder: o.placeholder
|
|
55
|
+
},
|
|
56
|
+
className: o.className
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
P && /* @__PURE__ */ t(
|
|
60
|
+
e.Filter,
|
|
61
|
+
{
|
|
62
|
+
schema: C,
|
|
63
|
+
filter: {
|
|
64
|
+
value: P.value || [],
|
|
65
|
+
onChange: P.onChange || (() => {
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
] }),
|
|
71
|
+
x && /* @__PURE__ */ t(e.HeaderContent, { children: x })
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ t(
|
|
61
76
|
e.Body,
|
|
62
77
|
{
|
|
63
|
-
cell:
|
|
64
|
-
sort:
|
|
65
|
-
className:
|
|
78
|
+
cell: l == null ? void 0 : l.cell,
|
|
79
|
+
sort: l == null ? void 0 : l.sort,
|
|
80
|
+
className: m(
|
|
66
81
|
"flex-1 min-h-0",
|
|
67
|
-
"border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
68
|
-
!(
|
|
69
|
-
!(
|
|
70
|
-
"[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
71
|
-
"[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
72
|
-
|
|
73
|
-
r == null ? void 0 : r.className
|
|
82
|
+
c && "border-stroke-solid-light border-b-1 border-x-1 border-t-0",
|
|
83
|
+
d && !(u && f) && "rounded-t-xl",
|
|
84
|
+
d && !(g && H) && "rounded-b-xl",
|
|
85
|
+
c && "[&_td:first-child]:border-l-0 [&_td:last-child]:border-r-0",
|
|
86
|
+
c && "[&_th:first-child]:border-l-0 [&_th:last-child]:border-r-0",
|
|
87
|
+
l == null ? void 0 : l.className
|
|
74
88
|
),
|
|
75
|
-
stickyHeader:
|
|
89
|
+
stickyHeader: l == null ? void 0 : l.stickyHeader
|
|
76
90
|
}
|
|
77
91
|
),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
) }),
|
|
88
|
-
(t || a) && /* @__PURE__ */ d(e.FooterContent, { children: [
|
|
89
|
-
t && /* @__PURE__ */ l(
|
|
90
|
-
e.PaginationQuickJumper,
|
|
91
|
-
{
|
|
92
|
-
currentPage: t.currentPage || 1,
|
|
93
|
-
totalPage: t.totalPage || 1,
|
|
94
|
-
onChange: t.onChange || (() => {
|
|
95
|
-
}),
|
|
96
|
-
disabled: t.disabled || !1
|
|
97
|
-
}
|
|
92
|
+
g && H && /* @__PURE__ */ h(
|
|
93
|
+
e.Footer,
|
|
94
|
+
{
|
|
95
|
+
className: m(
|
|
96
|
+
"flex-shrink-0",
|
|
97
|
+
c && "border-stroke-solid-light border border-t-[0.5px]",
|
|
98
|
+
d && "rounded-b-xl",
|
|
99
|
+
j
|
|
98
100
|
),
|
|
99
|
-
|
|
100
|
-
e.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
children: [
|
|
102
|
+
a ? /* @__PURE__ */ t(e.FooterContent, { children: /* @__PURE__ */ t(
|
|
103
|
+
e.PaginationInfo,
|
|
104
|
+
{
|
|
105
|
+
showTotal: a.showTotal || !0,
|
|
106
|
+
totalItems: a.totalItems,
|
|
107
|
+
currentPage: a.currentPage || 1,
|
|
108
|
+
itemsPerPage: a.itemsPerPage || a.totalItems
|
|
109
|
+
}
|
|
110
|
+
) }) : s || r ? /* @__PURE__ */ t(e.FooterContent, { children: null }) : null,
|
|
111
|
+
(s || r) && /* @__PURE__ */ h(e.FooterContent, { children: [
|
|
112
|
+
N && /* @__PURE__ */ t(
|
|
113
|
+
e.PaginationQuickJumper,
|
|
114
|
+
{
|
|
115
|
+
currentPage: s.currentPage || 1,
|
|
116
|
+
totalPage: s.totalPage || 1,
|
|
117
|
+
onChange: s.onChange || (() => {
|
|
118
|
+
}),
|
|
119
|
+
disabled: s.disabled || !1
|
|
120
|
+
}
|
|
121
|
+
),
|
|
122
|
+
r && /* @__PURE__ */ t(
|
|
123
|
+
e.Pagination,
|
|
124
|
+
{
|
|
125
|
+
currentPage: r.currentPage || 1,
|
|
126
|
+
totalPage: r.totalPage || 1,
|
|
127
|
+
onChange: r.onChange || (() => {
|
|
128
|
+
}),
|
|
129
|
+
totalItems: r.totalItems
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
)
|
|
110
136
|
] }) });
|
|
111
137
|
};
|
|
112
138
|
export {
|
|
113
|
-
|
|
139
|
+
E as default
|
|
114
140
|
};
|
|
@@ -5,12 +5,15 @@ export interface TableCardProps {
|
|
|
5
5
|
dataSource: Record<string, unknown>[];
|
|
6
6
|
schema: TableSchema;
|
|
7
7
|
className?: string;
|
|
8
|
+
rounded?: boolean;
|
|
9
|
+
bordered?: boolean;
|
|
8
10
|
showHeader?: boolean;
|
|
9
11
|
headerClassName?: string;
|
|
10
12
|
search?: Partial<TableSearch> & {
|
|
11
13
|
className?: string;
|
|
12
14
|
};
|
|
13
15
|
filter?: Partial<TableFilter>;
|
|
16
|
+
headerLeftContent?: React.ReactNode;
|
|
14
17
|
headerActions?: React.ReactNode;
|
|
15
18
|
body?: {
|
|
16
19
|
cell?: TableProps['cell'];
|
|
@@ -21,7 +24,10 @@ export interface TableCardProps {
|
|
|
21
24
|
showFooter?: boolean;
|
|
22
25
|
footerClassName?: string;
|
|
23
26
|
pagination?: Partial<PaginationProps>;
|
|
24
|
-
paginationInfo?: Partial<PaginationInfoProps
|
|
27
|
+
paginationInfo?: Partial<Omit<PaginationInfoProps, 'itemsPerPage' | 'totalItems'>> & {
|
|
28
|
+
itemsPerPage: number;
|
|
29
|
+
totalItems: number;
|
|
30
|
+
};
|
|
25
31
|
paginationQuickJumper?: Partial<PaginationQuickJumperProps>;
|
|
26
32
|
loading?: boolean;
|
|
27
33
|
emptyMessage?: string;
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
--button-secondary-stroke-hover: var(--neutral-200);
|
|
49
49
|
--button-secondary-stroke-pressed: transparent;
|
|
50
50
|
--button-secondary-stroke-disabled: var(--neutral-100);
|
|
51
|
+
/* Button Shadows */
|
|
52
|
+
--button-shadow-default:
|
|
53
|
+
0px 1px 2px 0px var(--alpha-one-50), 0px 0px 0px 0.5px var(--neutral-150);
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
.dark {
|
|
@@ -98,6 +101,9 @@
|
|
|
98
101
|
--button-secondary-stroke-hover: var(--neutral-200);
|
|
99
102
|
--button-secondary-stroke-pressed: transparent;
|
|
100
103
|
--button-secondary-stroke-disabled: var(--neutral-50);
|
|
104
|
+
/* Button Shadows - Dark Mode */
|
|
105
|
+
--button-shadow-default:
|
|
106
|
+
0px 1px 2px 0px var(--alpha-one-50), 0px 0px 0px 0.5px var(--neutral-150);
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
/* Tailwind v4 Theme Integration */
|
|
@@ -149,4 +155,6 @@
|
|
|
149
155
|
--color-button-secondary-stroke-hover: var(--button-secondary-stroke-hover);
|
|
150
156
|
--color-button-secondary-stroke-pressed: var(--button-secondary-stroke-pressed);
|
|
151
157
|
--color-button-secondary-stroke-disabled: var(--button-secondary-stroke-disabled);
|
|
158
|
+
/* Button Shadows */
|
|
159
|
+
--shadow-button-default: var(--button-shadow-default);
|
|
152
160
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* File Upload Area Component - Custom SVG dashed border */
|
|
2
|
+
|
|
3
|
+
@layer utilities {
|
|
4
|
+
.file-upload-12-dash-border {
|
|
5
|
+
/* Remove default border */
|
|
6
|
+
border: none;
|
|
7
|
+
|
|
8
|
+
/* SVG dashed border with rounded corners */
|
|
9
|
+
background-image: url("data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='24' ry='24' stroke='%2334303026' stroke-width='2' stroke-dasharray='12%2c12' stroke-dashoffset='0' stroke-linecap='butt'/%3e%3c/svg%3e");
|
|
10
|
+
}
|
|
11
|
+
}
|