@ztwoint/z-ui 0.1.30 → 0.1.33
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/button/button.js +10 -11
- package/dist/components/input/input.d.ts +2 -1
- package/dist/components/input/input.js +37 -8
- package/dist/components/input/input.type.d.ts +6 -0
- package/dist/components/table/components/index.d.ts +4 -3
- package/dist/components/table/components/pagination/pagination.const.d.ts +2 -2
- package/dist/components/table/components/pagination/pagination.const.js +4 -4
- package/dist/components/table/components/pagination/pagination.js +67 -63
- package/dist/components/table/components/table-filter/table-filter.js +1 -1
- package/dist/components/table/components/table-footer-content.js +11 -4
- package/dist/components/table/components/table-footer.js +10 -4
- package/dist/components/table/components/table-header/table-header.d.ts +1 -0
- package/dist/components/table/components/table-header/table-header.js +34 -23
- package/dist/components/table/components/table-header-content.js +2 -2
- package/dist/components/table/components/table-header-wrapper.js +10 -4
- package/dist/components/table/components/table-search/index.d.ts +1 -0
- package/dist/components/table/components/table-search/table-search.d.ts +7 -0
- package/dist/components/table/components/table-search/table-search.js +21 -0
- package/dist/components/table/table-provider.d.ts +2 -0
- package/dist/components/table/table-provider.js +29 -27
- package/dist/components/table/table.d.ts +4 -1
- package/dist/components/table/table.js +26 -24
- package/dist/components/table/table.type.d.ts +5 -0
- package/dist/components/table-card/index.d.ts +2 -0
- package/dist/components/table-card/table-card.d.ts +4 -0
- package/dist/components/table-card/table-card.type.d.ts +36 -0
- package/dist/css/config/colors/defaults.css +15 -6
- package/dist/css/config/components/index.css +1 -0
- package/dist/css/config/components/input.css +56 -0
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/index.js +36 -36
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/table-card.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +2 -1
- package/dist/types/components/input/input.type.d.ts +6 -0
- package/dist/types/components/table/components/index.d.ts +4 -3
- package/dist/types/components/table/components/pagination/pagination.const.d.ts +2 -2
- package/dist/types/components/table/components/table-header/table-header.d.ts +1 -0
- package/dist/types/components/table/components/table-search/index.d.ts +1 -0
- package/dist/types/components/table/components/table-search/table-search.d.ts +7 -0
- package/dist/types/components/table/table-provider.d.ts +2 -0
- package/dist/types/components/table/table.d.ts +4 -1
- package/dist/types/components/table/table.type.d.ts +5 -0
- package/dist/types/components/table-card/index.d.ts +2 -0
- package/dist/types/components/table-card/table-card.d.ts +4 -0
- package/dist/types/components/table-card/table-card.type.d.ts +36 -0
- package/dist/types/routes/index.d.ts +1 -0
- package/dist/types/routes/table-card.d.ts +2 -0
- package/package.json +1 -1
|
@@ -8,17 +8,15 @@ const k = z(
|
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
filled: [
|
|
12
|
-
|
|
13
|
-
],
|
|
14
|
-
stroke: ["disabled:shadow-[var(--shadow-button-disabled)]"],
|
|
11
|
+
filled: ["border-[.5px] disabled:border-none disabled:shadow-button-disabled"],
|
|
12
|
+
stroke: ["disabled:shadow-button-disabled"],
|
|
15
13
|
ghost: [""]
|
|
16
14
|
},
|
|
17
15
|
shade: {
|
|
18
16
|
brand: "bg-button-primary-brand-surface-default border-button-primary-brand-surface-default text-text-inverted-primary hover:bg-button-primary-brand-surface-hover active:bg-button-primary-brand-surface-pressed disabled:bg-button-primary-brand-surface-disabled disabled:text-text-neutral-muted disabled:border-button-primary-brand-surface-disabled",
|
|
19
17
|
neutral: "bg-button-primary-neutral-surface-default border-button-primary-neutral-surface-default disabled:border-none text-text-inverted-primary hover:bg-button-primary-neutral-surface-hover active:bg-button-primary-neutral-surface-pressed disabled:bg-button-primary-neutral-surface-disabled disabled:text-text-neutral-muted",
|
|
20
18
|
danger: "bg-button-primary-danger-surface-default border-button-primary-danger-stroke-default text-text-inverted-primary hover:bg-button-primary-danger-surface-hover active:bg-button-primary-danger-surface-pressed disabled:bg-button-primary-danger-surface-disabled disabled:text-text-neutral-muted",
|
|
21
|
-
neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted
|
|
19
|
+
neutralGhost: "border-none text-text-neutral-primary hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
|
|
22
20
|
},
|
|
23
21
|
size: {
|
|
24
22
|
large: "gap-1",
|
|
@@ -96,14 +94,15 @@ const k = z(
|
|
|
96
94
|
asChild: o = !1,
|
|
97
95
|
leftIcon: t,
|
|
98
96
|
rightIcon: a,
|
|
99
|
-
label:
|
|
97
|
+
label: m,
|
|
100
98
|
children: u,
|
|
101
|
-
...
|
|
99
|
+
...p
|
|
102
100
|
}, y) => {
|
|
103
|
-
const f = o ? O : "button", r =
|
|
104
|
-
k({ shade: b, size: c, variant: x, iconOnly: n
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
const f = o ? O : "button", r = m || u, n = !r && !!(t || a), l = n ? t || a : null, g = d(
|
|
102
|
+
k({ shade: b, size: c, variant: x, iconOnly: n }),
|
|
103
|
+
i
|
|
104
|
+
), s = "w-3.5 h-3.5 min-w-max";
|
|
105
|
+
return /* @__PURE__ */ e(f, { className: g, ref: y, ...p, children: o ? u : n ? l ? /* @__PURE__ */ e("span", { className: s, children: l }) : null : /* @__PURE__ */ v(h, { children: [
|
|
107
106
|
t && /* @__PURE__ */ e("span", { className: d(s), children: t }),
|
|
108
107
|
r && /* @__PURE__ */ e("span", { children: r }),
|
|
109
108
|
a && /* @__PURE__ */ e("span", { className: d(s), children: a })
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { cva as _ } from "class-variance-authority";
|
|
3
|
+
import "react";
|
|
4
|
+
import { cn as e } from "../../lib/utils.js";
|
|
5
|
+
const d = _("", {
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
small: "p-1.5 gap-1 h-[26px]",
|
|
9
|
+
large: "p-2 gap-1.5 h-[30px]"
|
|
10
|
+
}
|
|
7
11
|
}
|
|
8
|
-
)
|
|
12
|
+
}), m = ({ size: s, leftIcon: a, rightIcon: n, className: o, ...i }) => {
|
|
13
|
+
const r = " w-3.5 h-3.5 text-text-neutral-secondary has-[:disabled]:text-input-surface-disabled", { ...p } = i;
|
|
14
|
+
return /* @__PURE__ */ l(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: e(
|
|
18
|
+
"rounded-lg bg-input-surface-default flex items-center shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.default)] hover:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.hover)] focus-within:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] focus-within:hover:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] has-[:disabled]:shadow-[inset_0_0_0_0.5px_theme(colors.input.stroke.disabled)]",
|
|
19
|
+
d({ size: s }),
|
|
20
|
+
o
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
a && /* @__PURE__ */ t("span", { className: e(r, s === "large" && "w-4 h-4"), children: a }),
|
|
24
|
+
/* @__PURE__ */ t(
|
|
25
|
+
"input",
|
|
26
|
+
{
|
|
27
|
+
className: e(
|
|
28
|
+
"bg-transparent text-text-neutral-primary placeholder:text-text-neutral-muted disabled:text-text-neutral-muted leading-none-medium-sm border-none outline-none flex-1"
|
|
29
|
+
),
|
|
30
|
+
...p
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
n && /* @__PURE__ */ t("span", { className: e(r), children: n })
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
9
38
|
export {
|
|
10
|
-
|
|
39
|
+
m as Input
|
|
11
40
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
export { TableCell } from './table-cell';
|
|
2
|
-
export {
|
|
2
|
+
export { TextCell, NumberCell, BooleanCell } from './cell';
|
|
3
|
+
export { TableHeader } from './table-header';
|
|
3
4
|
export { TableRow } from './table-row';
|
|
4
5
|
export { TableEmptyState } from './table-empty-state';
|
|
5
6
|
export { TableLoadingState } from './table-loading-state';
|
|
6
|
-
export { Pagination as TablePagination } from './pagination';
|
|
7
|
+
export { Pagination as TablePagination } from './pagination/pagination';
|
|
7
8
|
export { TableHeaderWrapper } from './table-header-wrapper';
|
|
8
9
|
export { TableHeaderContent } from './table-header-content';
|
|
9
10
|
export { TableFooter } from './table-footer';
|
|
10
11
|
export { TableFooterContent } from './table-footer-content';
|
|
11
|
-
export
|
|
12
|
+
export { TableSearch } from './table-search';
|
|
@@ -9,9 +9,9 @@ export declare const PAGINATION_CSS_CLASSES: {
|
|
|
9
9
|
readonly buttonActive: "bg-blue-600 text-white border-blue-600 hover:bg-blue-700";
|
|
10
10
|
readonly buttonIcon: "flex items-center justify-center w-8 h-8 text-sm rounded border border-gray-300 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed transition-colors";
|
|
11
11
|
readonly ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400";
|
|
12
|
-
readonly info: "
|
|
12
|
+
readonly info: "leading-none-sm text-text-neutral-secondary";
|
|
13
13
|
readonly jumper: "flex items-center gap-2 text-sm text-text-neutral-primary";
|
|
14
|
-
readonly input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
|
|
14
|
+
readonly input: "w-16 px-2 py-1 text-sm h-6 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent";
|
|
15
15
|
};
|
|
16
16
|
export declare const PAGINATION_LABELS: {
|
|
17
17
|
readonly previous: "Previous page";
|
|
@@ -2,10 +2,10 @@ const e = {
|
|
|
2
2
|
MAX_VISIBLE_PAGES: 6
|
|
3
3
|
}, t = {
|
|
4
4
|
ellipsis: "flex items-center justify-center w-8 h-8 text-gray-400",
|
|
5
|
-
info: "
|
|
5
|
+
info: "leading-none-sm text-text-neutral-secondary",
|
|
6
6
|
jumper: "flex items-center gap-2 text-sm text-text-neutral-primary",
|
|
7
|
-
input: "w-16 px-2 py-1 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
8
|
-
},
|
|
7
|
+
input: "w-16 px-2 py-1 text-sm h-6 border border-gray-300 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
8
|
+
}, o = {
|
|
9
9
|
previous: "Previous page",
|
|
10
10
|
next: "Next page",
|
|
11
11
|
first: "First page",
|
|
@@ -18,5 +18,5 @@ const e = {
|
|
|
18
18
|
export {
|
|
19
19
|
t as PAGINATION_CSS_CLASSES,
|
|
20
20
|
e as PAGINATION_DEFAULTS,
|
|
21
|
-
|
|
21
|
+
o as PAGINATION_LABELS
|
|
22
22
|
};
|
|
@@ -1,112 +1,116 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { usePagination as
|
|
3
|
-
import { PAGINATION_LABELS as o, PAGINATION_DEFAULTS as
|
|
4
|
-
import { Button as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import { jsxs as v, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { usePagination as A } from "./pagination.hook.js";
|
|
3
|
+
import { PAGINATION_LABELS as o, PAGINATION_DEFAULTS as C, PAGINATION_CSS_CLASSES as S } from "./pagination.const.js";
|
|
4
|
+
import { Button as m } from "../../../button/button.js";
|
|
5
|
+
import E from "../../../assets/icons/chevron-left.js";
|
|
6
|
+
import k from "../../../assets/icons/chevron-right.js";
|
|
7
|
+
import y from "../../../assets/icons/double-chevron-left.js";
|
|
8
|
+
import L from "../../../assets/icons/double-chevron-right.js";
|
|
9
9
|
import "react";
|
|
10
|
-
import { cn as
|
|
11
|
-
const p = () => /* @__PURE__ */
|
|
12
|
-
currentPage:
|
|
13
|
-
totalPage:
|
|
14
|
-
onChange:
|
|
15
|
-
disabled:
|
|
10
|
+
import { cn as _ } from "../../../../lib/utils.js";
|
|
11
|
+
const p = () => /* @__PURE__ */ e("span", { className: S.ellipsis, children: "..." }), $ = ({
|
|
12
|
+
currentPage: t,
|
|
13
|
+
totalPage: l,
|
|
14
|
+
onChange: x,
|
|
15
|
+
disabled: r = !1
|
|
16
16
|
}) => {
|
|
17
|
-
const { visiblePages:
|
|
18
|
-
currentPage:
|
|
19
|
-
totalPage:
|
|
20
|
-
maxVisiblePages:
|
|
17
|
+
const { visiblePages: d, hasEllipsisStart: b, hasEllipsisEnd: N } = A({
|
|
18
|
+
currentPage: t,
|
|
19
|
+
totalPage: l,
|
|
20
|
+
maxVisiblePages: C.MAX_VISIBLE_PAGES
|
|
21
21
|
});
|
|
22
|
-
if (
|
|
22
|
+
if (l <= 1)
|
|
23
23
|
return null;
|
|
24
|
-
const
|
|
25
|
-
!
|
|
26
|
-
},
|
|
27
|
-
const
|
|
28
|
-
let
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
const n =
|
|
32
|
-
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
|
|
24
|
+
const c = t === 1, f = t === l, i = (s) => {
|
|
25
|
+
!r && s !== t && s >= 1 && s <= l && x(s);
|
|
26
|
+
}, I = () => {
|
|
27
|
+
const s = [];
|
|
28
|
+
let u = !1, h = !1;
|
|
29
|
+
return d.forEach((a, z) => {
|
|
30
|
+
b && a === d[1] && !u && (s.push(/* @__PURE__ */ e(p, {}, "ellipsis-start")), u = !0);
|
|
31
|
+
const n = a === t;
|
|
32
|
+
s.push(
|
|
33
|
+
/* @__PURE__ */ e(
|
|
34
|
+
m,
|
|
35
35
|
{
|
|
36
|
-
onClick: () => a
|
|
36
|
+
onClick: () => i(a),
|
|
37
37
|
variant: "stroke",
|
|
38
38
|
shade: n ? "brand" : "neutral",
|
|
39
39
|
size: "small",
|
|
40
|
-
"aria-label": `${o.page} ${
|
|
40
|
+
"aria-label": `${o.page} ${a}`,
|
|
41
41
|
"aria-current": n ? "page" : void 0,
|
|
42
|
-
className:
|
|
43
|
-
"
|
|
44
|
-
n && "border border-button-primary-brand-surface-default"
|
|
42
|
+
className: _(
|
|
43
|
+
"text-text-neutral-secondary",
|
|
44
|
+
n && "border border-button-primary-brand-surface-default text-text-neutral-primary"
|
|
45
45
|
),
|
|
46
46
|
style: {
|
|
47
47
|
borderStyle: n ? "solid" : "none",
|
|
48
48
|
boxShadow: n ? "none" : ""
|
|
49
49
|
},
|
|
50
|
-
children:
|
|
50
|
+
leftIcon: /* @__PURE__ */ e("span", { className: "leading-none-medium-sm", children: a })
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
a
|
|
53
53
|
)
|
|
54
|
-
),
|
|
55
|
-
}),
|
|
54
|
+
), N && a === d[d.length - 2] && !h && (s.push(/* @__PURE__ */ e(p, {}, "ellipsis-end")), h = !0);
|
|
55
|
+
}), s;
|
|
56
56
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
57
|
+
return /* @__PURE__ */ v("div", { className: "flex gap-1.5 items-center", children: [
|
|
58
|
+
/* @__PURE__ */ e(
|
|
59
|
+
m,
|
|
60
60
|
{
|
|
61
61
|
"aria-label": o.first,
|
|
62
|
-
onClick: () =>
|
|
63
|
-
disabled:
|
|
62
|
+
onClick: () => i(1),
|
|
63
|
+
disabled: r || c,
|
|
64
64
|
variant: "stroke",
|
|
65
65
|
shade: "neutral",
|
|
66
66
|
size: "small",
|
|
67
|
-
|
|
67
|
+
className: "text-text-neutral-secondary",
|
|
68
|
+
leftIcon: /* @__PURE__ */ e(y, {})
|
|
68
69
|
}
|
|
69
70
|
),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
71
|
+
/* @__PURE__ */ e(
|
|
72
|
+
m,
|
|
72
73
|
{
|
|
73
74
|
"aria-label": o.previous,
|
|
74
|
-
onClick: () =>
|
|
75
|
-
disabled:
|
|
75
|
+
onClick: () => i(t - 1),
|
|
76
|
+
disabled: r || c,
|
|
76
77
|
variant: "stroke",
|
|
77
78
|
shade: "neutral",
|
|
78
79
|
size: "small",
|
|
79
|
-
|
|
80
|
+
className: "text-text-neutral-secondary",
|
|
81
|
+
leftIcon: /* @__PURE__ */ e(E, {})
|
|
80
82
|
}
|
|
81
83
|
),
|
|
82
|
-
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
|
|
84
|
+
I(),
|
|
85
|
+
/* @__PURE__ */ e(
|
|
86
|
+
m,
|
|
85
87
|
{
|
|
86
88
|
"aria-label": o.next,
|
|
87
|
-
onClick: () =>
|
|
88
|
-
disabled:
|
|
89
|
+
onClick: () => i(t + 1),
|
|
90
|
+
disabled: r || f,
|
|
89
91
|
variant: "stroke",
|
|
90
92
|
shade: "neutral",
|
|
91
93
|
size: "small",
|
|
92
|
-
|
|
94
|
+
className: "text-text-neutral-secondary",
|
|
95
|
+
leftIcon: /* @__PURE__ */ e(k, {})
|
|
93
96
|
}
|
|
94
97
|
),
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
98
|
+
/* @__PURE__ */ e(
|
|
99
|
+
m,
|
|
97
100
|
{
|
|
98
101
|
"aria-label": o.last,
|
|
99
|
-
onClick: () =>
|
|
100
|
-
disabled:
|
|
102
|
+
onClick: () => i(l),
|
|
103
|
+
disabled: r || f,
|
|
101
104
|
variant: "stroke",
|
|
102
105
|
shade: "neutral",
|
|
103
106
|
size: "small",
|
|
104
|
-
|
|
107
|
+
className: "text-text-neutral-secondary",
|
|
108
|
+
leftIcon: /* @__PURE__ */ e(L, {})
|
|
105
109
|
}
|
|
106
110
|
)
|
|
107
111
|
] });
|
|
108
112
|
};
|
|
109
113
|
export {
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
$ as Pagination,
|
|
115
|
+
$ as default
|
|
112
116
|
};
|
|
@@ -21,7 +21,7 @@ const C = ({
|
|
|
21
21
|
updateFilterRule: u
|
|
22
22
|
} = N({ schema: c, filter: n || { value: [], onChange: () => {
|
|
23
23
|
} } });
|
|
24
|
-
return n ? /* @__PURE__ */ r("div", { className: "relative
|
|
24
|
+
return n ? /* @__PURE__ */ r("div", { className: "relative", children: [
|
|
25
25
|
/* @__PURE__ */ r(
|
|
26
26
|
s,
|
|
27
27
|
{
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
2
|
+
const a = ({
|
|
3
3
|
children: e,
|
|
4
4
|
className: t = ""
|
|
5
|
-
}) => /* @__PURE__ */ o(
|
|
5
|
+
}) => /* @__PURE__ */ o(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: `flex items-center
|
|
9
|
+
gap-3 ${t}`,
|
|
10
|
+
children: e
|
|
11
|
+
}
|
|
12
|
+
);
|
|
6
13
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
a as TableFooterContent,
|
|
15
|
+
a as default
|
|
9
16
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
const
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
const l = ({ children: e, className: r = "" }) => /* @__PURE__ */ t(
|
|
3
|
+
"div",
|
|
4
|
+
{
|
|
5
|
+
className: `flex justify-between items-center bg-neutral-default border-stroke-solid-light border border-t-[0.5px] gap-3 p-2 pl-4 rounded-b-xl ${r} `,
|
|
6
|
+
children: e
|
|
7
|
+
}
|
|
8
|
+
);
|
|
3
9
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
10
|
+
l as TableFooter,
|
|
11
|
+
l as default
|
|
6
12
|
};
|
|
@@ -1,27 +1,38 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { TABLE_CSS_CLASSES as t } from "../../table.const.js";
|
|
3
|
-
import { TableSortIcon as
|
|
4
|
-
import { getCurrentSortDirection as
|
|
3
|
+
import { TableSortIcon as n } from "./table-sort-icon.js";
|
|
4
|
+
import { getCurrentSortDirection as h, isSortActive as p, handleSortClick as C } from "./table-header.utils.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { cn as
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
6
|
+
import { cn as S } from "../../../../lib/utils.js";
|
|
7
|
+
const x = ({
|
|
8
|
+
schema: a,
|
|
9
|
+
sort: i,
|
|
10
|
+
cell: o,
|
|
11
|
+
stickyHeader: s = !1
|
|
12
|
+
}) => /* @__PURE__ */ r(
|
|
13
|
+
"thead",
|
|
14
|
+
{
|
|
15
|
+
className: `${t.header} ${s ? "sticky top-[-1.5px] z-10" : ""}`,
|
|
16
|
+
children: /* @__PURE__ */ r("tr", { children: a.map((e) => {
|
|
17
|
+
const l = h(e.key, i), d = p(e.key, i);
|
|
18
|
+
return /* @__PURE__ */ r(
|
|
19
|
+
"th",
|
|
20
|
+
{
|
|
21
|
+
className: S(
|
|
22
|
+
e.sortable ? t.sortableHeaderCell : t.headerCell,
|
|
23
|
+
t.cell.hasBorder[o.hasBorder ? "true" : "false"]
|
|
24
|
+
),
|
|
25
|
+
onClick: e.sortable ? () => C(e.key, i) : void 0,
|
|
26
|
+
children: /* @__PURE__ */ c("div", { className: t.headerCellContent, children: [
|
|
27
|
+
/* @__PURE__ */ r("span", { children: e.title }),
|
|
28
|
+
e.sortable && /* @__PURE__ */ r(n, { direction: l, isActive: d })
|
|
29
|
+
] })
|
|
30
|
+
},
|
|
31
|
+
e.key
|
|
32
|
+
);
|
|
33
|
+
}) })
|
|
34
|
+
}
|
|
35
|
+
);
|
|
25
36
|
export {
|
|
26
|
-
|
|
37
|
+
x as TableHeader
|
|
27
38
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
const s = ({
|
|
3
3
|
children: e,
|
|
4
4
|
className: t = ""
|
|
5
|
-
}) => /* @__PURE__ */
|
|
5
|
+
}) => /* @__PURE__ */ a("div", { className: `flex items-center justify-between gap-3 ${t}`, children: e });
|
|
6
6
|
export {
|
|
7
7
|
s as TableHeaderContent,
|
|
8
8
|
s as default
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
const
|
|
2
|
+
const o = ({
|
|
3
3
|
children: e,
|
|
4
4
|
className: r = ""
|
|
5
|
-
}) => /* @__PURE__ */ t(
|
|
5
|
+
}) => /* @__PURE__ */ t(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: `p-3 gap-3 flex justify-between items-center border-stroke-solid-medium border-1 border-b-0 rounded-t-xl ${r}`,
|
|
9
|
+
children: e
|
|
10
|
+
}
|
|
11
|
+
);
|
|
6
12
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
13
|
+
o as TableHeaderWrapper,
|
|
14
|
+
o as default
|
|
9
15
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TableSearch } from './table-search';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Input as c } from "../../../input/input.js";
|
|
3
|
+
import { MagnifierIcon as l } from "../../../assets/icons/magnifier-icon.js";
|
|
4
|
+
const h = ({ search: r, className: o = "" }) => {
|
|
5
|
+
const { value: t, onChange: a, placeholder: n = "Search by Item Number or Description" } = r;
|
|
6
|
+
return /* @__PURE__ */ e(
|
|
7
|
+
c,
|
|
8
|
+
{
|
|
9
|
+
size: "small",
|
|
10
|
+
leftIcon: /* @__PURE__ */ e(l, { className: "w-4 h-4" }),
|
|
11
|
+
placeholder: n,
|
|
12
|
+
value: t,
|
|
13
|
+
onChange: (m) => a(m.target.value),
|
|
14
|
+
type: "text",
|
|
15
|
+
className: o
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
h as TableSearch
|
|
21
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TableProps } from './table.type';
|
|
2
2
|
import { TableBody } from './table';
|
|
3
3
|
import { TableFilter } from './components/table-filter';
|
|
4
|
+
import { TableSearch } from './components/table-search';
|
|
4
5
|
import { Pagination } from './components/pagination';
|
|
5
6
|
import { TableHeaderWrapper, TableHeaderContent, TableFooter, TableFooterContent } from './components';
|
|
6
7
|
import { PaginationInfo, PaginationQuickJumper } from './components/pagination/components';
|
|
@@ -12,6 +13,7 @@ declare const TableProvider: React.FC<TableProviderProps>;
|
|
|
12
13
|
interface TableCompoundComponent extends React.FC<TableProviderProps> {
|
|
13
14
|
Body: typeof TableBody;
|
|
14
15
|
Filter: typeof TableFilter;
|
|
16
|
+
Search: typeof TableSearch;
|
|
15
17
|
Pagination: typeof Pagination;
|
|
16
18
|
PaginationInfo: typeof PaginationInfo;
|
|
17
19
|
PaginationQuickJumper: typeof PaginationQuickJumper;
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
3
|
import { TableContext as m } from "./table.context.js";
|
|
4
4
|
import { TableBody as p } from "./table.js";
|
|
5
5
|
import { TableFilter as f } from "./components/table-filter/table-filter.js";
|
|
6
|
-
import {
|
|
6
|
+
import { TableSearch as l } from "./components/table-search/table-search.js";
|
|
7
|
+
import { Pagination as s } from "./components/pagination/pagination.js";
|
|
7
8
|
import "clsx";
|
|
8
9
|
import "tailwind-merge";
|
|
9
|
-
import { TableHeaderWrapper as
|
|
10
|
-
import { TableHeaderContent as
|
|
11
|
-
import { TableFooter as
|
|
12
|
-
import { TableFooterContent as
|
|
10
|
+
import { TableHeaderWrapper as T } from "./components/table-header-wrapper.js";
|
|
11
|
+
import { TableHeaderContent as b } from "./components/table-header-content.js";
|
|
12
|
+
import { TableFooter as c } from "./components/table-footer.js";
|
|
13
|
+
import { TableFooterContent as d } from "./components/table-footer-content.js";
|
|
13
14
|
import { PaginationInfo as u } from "./components/pagination/components/pagination-info.js";
|
|
14
|
-
import { PaginationQuickJumper as
|
|
15
|
-
const
|
|
15
|
+
import { PaginationQuickJumper as g } from "./components/pagination/components/pagination-quick-jumper.js";
|
|
16
|
+
const t = ({
|
|
16
17
|
children: e,
|
|
17
|
-
pagination:
|
|
18
|
-
sort:
|
|
19
|
-
filter:
|
|
20
|
-
filterComponents:
|
|
21
|
-
...
|
|
18
|
+
pagination: C,
|
|
19
|
+
sort: F,
|
|
20
|
+
filter: v,
|
|
21
|
+
filterComponents: x,
|
|
22
|
+
...r
|
|
22
23
|
}) => {
|
|
23
|
-
const i =
|
|
24
|
+
const i = n.useMemo(
|
|
24
25
|
() => ({
|
|
25
|
-
...
|
|
26
|
+
...r
|
|
26
27
|
}),
|
|
27
|
-
[
|
|
28
|
+
[r]
|
|
28
29
|
);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
},
|
|
30
|
+
return /* @__PURE__ */ a(m.Provider, { value: i, children: e });
|
|
31
|
+
}, P = t, o = P;
|
|
31
32
|
o.Body = p;
|
|
32
33
|
o.Filter = f;
|
|
33
|
-
o.
|
|
34
|
+
o.Search = l;
|
|
35
|
+
o.Pagination = s;
|
|
34
36
|
o.PaginationInfo = u;
|
|
35
|
-
o.PaginationQuickJumper =
|
|
36
|
-
o.Provider =
|
|
37
|
-
o.Header =
|
|
38
|
-
o.HeaderContent =
|
|
39
|
-
o.Footer =
|
|
40
|
-
o.FooterContent =
|
|
37
|
+
o.PaginationQuickJumper = g;
|
|
38
|
+
o.Provider = t;
|
|
39
|
+
o.Header = T;
|
|
40
|
+
o.HeaderContent = b;
|
|
41
|
+
o.Footer = c;
|
|
42
|
+
o.FooterContent = d;
|
|
41
43
|
export {
|
|
42
44
|
o as Table,
|
|
43
|
-
|
|
45
|
+
t as TableProvider,
|
|
44
46
|
o as default
|
|
45
47
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { TableProps } from './table.type';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export declare const TableBody: React.FC<Partial<TableProps
|
|
3
|
+
export declare const TableBody: React.FC<Partial<TableProps> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
stickyHeader?: boolean;
|
|
6
|
+
}>;
|
|
4
7
|
export default TableBody;
|