@ztwoint/z-ui 0.1.58 → 0.1.60
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/drag-handle.d.ts +2 -0
- package/dist/components/assets/icons/minus.d.ts +8 -0
- package/dist/components/assets/icons/octagon-warning-Copy.js +30 -0
- package/dist/components/column-reorder/column-item.d.ts +0 -0
- package/dist/components/column-reorder/column-reorder.d.ts +3 -0
- package/dist/components/column-reorder/column-reorder.hook.d.ts +4 -0
- package/dist/components/column-reorder/column-reorder.type.d.ts +12 -0
- package/dist/components/column-reorder/components/column-item/column-item.d.ts +4 -0
- package/dist/components/column-reorder/components/column-item/column-item.hook.d.ts +7 -0
- package/dist/components/column-reorder/components/column-item/column-item.type.d.ts +18 -0
- package/dist/components/column-reorder/components/column-item/column-item.util.d.ts +10 -0
- package/dist/components/column-reorder/components/column-item/index.d.ts +3 -0
- package/dist/components/column-reorder/components/index.d.ts +1 -0
- package/dist/components/column-reorder/index.d.ts +2 -0
- package/dist/components/table/components/cell/link-cell.d.ts +1 -0
- package/dist/components/table/components/cell/link-cell.js +5 -4
- 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/routes/column-reorder.d.ts +3 -0
- package/dist/routes/index.d.ts +1 -0
- package/dist/types/components/assets/icons/drag-handle.d.ts +2 -0
- package/dist/types/components/assets/icons/minus.d.ts +8 -0
- package/dist/types/components/column-reorder/column-item.d.ts +0 -0
- package/dist/types/components/column-reorder/column-reorder.d.ts +3 -0
- package/dist/types/components/column-reorder/column-reorder.hook.d.ts +4 -0
- package/dist/types/components/column-reorder/column-reorder.type.d.ts +12 -0
- package/dist/types/components/column-reorder/components/column-item/column-item.d.ts +4 -0
- package/dist/types/components/column-reorder/components/column-item/column-item.hook.d.ts +7 -0
- package/dist/types/components/column-reorder/components/column-item/column-item.type.d.ts +18 -0
- package/dist/types/components/column-reorder/components/column-item/column-item.util.d.ts +10 -0
- package/dist/types/components/column-reorder/components/column-item/index.d.ts +3 -0
- package/dist/types/components/column-reorder/components/index.d.ts +1 -0
- package/dist/types/components/column-reorder/index.d.ts +2 -0
- package/dist/types/components/table/components/cell/link-cell.d.ts +1 -0
- package/dist/types/components/table-card/table-card.type.d.ts +1 -0
- package/dist/types/routes/column-reorder.d.ts +3 -0
- package/dist/types/routes/index.d.ts +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
type IconProps = SVGProps<SVGSVGElement> & {
|
|
3
|
+
secondaryfill?: string;
|
|
4
|
+
strokewidth?: number;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function Minus({ title, ...props }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default Minus;
|
|
@@ -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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type ColumnType = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: [string, string];
|
|
5
|
+
icon: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export interface ColumnReOrderProps {
|
|
8
|
+
columns: ColumnType[];
|
|
9
|
+
onReorder?: (reorderedColumns: ColumnType[]) => void;
|
|
10
|
+
onRemove?: (columnId: string) => void;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ColumnType } from '../../column-reorder.type';
|
|
2
|
+
import { ColumnItemState } from './column-item.type';
|
|
3
|
+
export declare const idle: ColumnItemState;
|
|
4
|
+
export declare const useColumnItemDragAndDrop: (column: ColumnType, index: number) => {
|
|
5
|
+
ref: import('react').RefObject<HTMLDivElement | null>;
|
|
6
|
+
state: ColumnItemState;
|
|
7
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
|
|
2
|
+
import { ColumnType } from '../../column-reorder.type';
|
|
3
|
+
export type ColumnItemState = {
|
|
4
|
+
type: 'idle';
|
|
5
|
+
} | {
|
|
6
|
+
type: 'preview';
|
|
7
|
+
container: HTMLElement;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'is-dragging';
|
|
10
|
+
} | {
|
|
11
|
+
type: 'is-dragging-over';
|
|
12
|
+
closestEdge: Edge | null;
|
|
13
|
+
};
|
|
14
|
+
export interface ColumnItemProps {
|
|
15
|
+
column: ColumnType;
|
|
16
|
+
index: number;
|
|
17
|
+
onRemove?: (columnId: string) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColumnType } from '../../column-reorder.type';
|
|
2
|
+
export declare const getColumnData: (column: ColumnType, index: number) => {
|
|
3
|
+
columnId: string;
|
|
4
|
+
index: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const isColumnData: (data: Record<string | symbol, unknown>) => boolean;
|
|
7
|
+
export declare const parseColumnLabel: (column: ColumnType) => {
|
|
8
|
+
groupLabel: string;
|
|
9
|
+
fieldLabel: string;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './column-item';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as e } from "../../../../lib/utils.js";
|
|
4
|
-
const
|
|
4
|
+
const x = ({
|
|
5
5
|
value: i,
|
|
6
6
|
href: m,
|
|
7
7
|
target: t = "_self",
|
|
8
8
|
leftIcon: n,
|
|
9
9
|
rightIcon: r,
|
|
10
|
-
className: o
|
|
10
|
+
className: o,
|
|
11
|
+
LinkComponent: c = "a"
|
|
11
12
|
}) => {
|
|
12
13
|
const l = "min-h-max min-w-max";
|
|
13
14
|
return /* @__PURE__ */ s(
|
|
14
|
-
|
|
15
|
+
c,
|
|
15
16
|
{
|
|
16
17
|
href: m,
|
|
17
18
|
target: t,
|
|
@@ -31,5 +32,5 @@ const p = ({
|
|
|
31
32
|
);
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
x as LinkCell
|
|
35
36
|
};
|
|
@@ -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
|
};
|