@ztwoint/z-ui 0.1.128 → 0.1.130
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.d.ts +1 -1
- package/dist/components/button/button.js +30 -12
- package/dist/components/column-reorder/column-reorder.js +14 -14
- package/dist/components/dropdown/z2-dropdown.js +3 -3
- package/dist/components/dynamic-table/z2-table.js +116 -116
- package/dist/components/input/input.js +1 -1
- package/dist/components/number-badge/index.d.ts +2 -0
- package/dist/components/number-badge/number-badge.d.ts +10 -0
- package/dist/components/number-badge/number-badge.js +27 -0
- package/dist/components/primitives/table-card/table-card.js +1 -1
- package/dist/components/tab/tab.js +57 -27
- package/dist/components/table/components/cell/avatar-cell.js +1 -1
- package/dist/components/table/components/cell/description-cell.js +3 -3
- package/dist/components/table/components/cell/label-cell.js +9 -9
- package/dist/components/table/components/cell/link-cell.js +17 -17
- package/dist/components/table/components/cell/number-cell.js +17 -17
- package/dist/components/table/table.const.d.ts +1 -1
- package/dist/components/table/table.const.js +1 -1
- package/dist/components/table-filter/table-filter-button.js +46 -45
- package/dist/components/table-filter/table-filter-column-button.js +49 -49
- package/dist/css/config/colors/semantic/base.css +6 -6
- package/dist/css/config/config.css +2 -1
- package/dist/css/config/other-variables.css +1 -1
- package/dist/css/styles/tailwind.css +1 -1
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/number-badge/index.d.ts +2 -0
- package/dist/types/components/number-badge/number-badge.d.ts +10 -0
- package/dist/types/components/table/table.const.d.ts +1 -1
- package/package.json +1 -1
- package/dist/css/config/colors/backgrounds.css +0 -32
- package/dist/css/config/colors/components/avatar.css +0 -53
- package/dist/css/config/colors/components/badge.css +0 -137
- package/dist/css/config/colors/components/checkbox.css +0 -7
- package/dist/css/config/colors/components/featured-icon.css +0 -80
- package/dist/css/config/colors/components/progress-bar.css +0 -7
- package/dist/css/config/colors/components/radio-button.css +0 -7
- package/dist/css/config/colors/components/scroll-overlay.css +0 -17
- package/dist/css/config/colors/components/tab.css +0 -59
- package/dist/css/config/colors/components/toggle-switch.css +0 -3
- package/dist/css/config/colors/components/toggle.css +0 -25
- package/dist/css/config/colors/icons.css +0 -81
- package/dist/css/config/colors/overlay.css +0 -3
- package/dist/css/config/colors/shape.css +0 -163
- package/dist/css/config/colors/stroke.css +0 -79
- package/dist/css/config/colors/surfaces.css +0 -199
- package/dist/css/config/colors/text.css +0 -160
- package/dist/css/config/config-deprecated.css +0 -39
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "stroke" | "filled" | "ghost" | null | undefined;
|
|
4
|
+
variant?: "stroke" | "filled" | "colored-stroke" | "ghost" | null | undefined;
|
|
5
5
|
shade?: "danger" | "neutral" | "brand" | null | undefined;
|
|
6
6
|
size?: "small" | "large" | "medium" | null | undefined;
|
|
7
7
|
iconOnly?: boolean | null | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
1
|
+
import { jsx as e, jsxs as f, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import k from "react";
|
|
3
3
|
import { Slot as w } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as N } from "class-variance-authority";
|
|
@@ -10,9 +10,12 @@ const C = N(
|
|
|
10
10
|
variant: {
|
|
11
11
|
filled: [""],
|
|
12
12
|
stroke: [
|
|
13
|
-
"ring-[
|
|
13
|
+
"ring-[1px] ring-btn-secondary-stroke-default hover:ring-btn-secondary-stroke-hover active:ring-btn-secondary-stroke-pressed disabled:ring-btn-secondary-stroke-disabled",
|
|
14
14
|
"bg-btn-secondary-surface-default hover:bg-btn-secondary-surface-hover active:bg-btn-secondary-surface-pressed disabled:bg-btn-secondary-surface-disabled"
|
|
15
15
|
],
|
|
16
|
+
"colored-stroke": [
|
|
17
|
+
"ring-[1px] bg-btn-secondary-surface-default hover:bg-btn-secondary-surface-hover active:bg-btn-secondary-surface-pressed disabled:bg-btn-secondary-surface-disabled"
|
|
18
|
+
],
|
|
16
19
|
ghost: [
|
|
17
20
|
"hover:text-text-neutral-secondary active:text-text-neutral-muted disabled:text-text-neutral-muted"
|
|
18
21
|
]
|
|
@@ -35,17 +38,17 @@ const C = N(
|
|
|
35
38
|
{
|
|
36
39
|
variant: "filled",
|
|
37
40
|
shade: "brand",
|
|
38
|
-
class: "bg-btn-primary-brand-surface-default hover:bg-btn-primary-brand-surface-hover active:bg-btn-primary-brand-surface-pressed disabled:bg-btn-primary-brand-surface-disabled ring-[
|
|
41
|
+
class: "bg-btn-primary-brand-surface-default hover:bg-btn-primary-brand-surface-hover active:bg-btn-primary-brand-surface-pressed disabled:bg-btn-primary-brand-surface-disabled ring-[1px] ring-btn-primary-brand-stroke-default hover:ring-btn-primary-brand-stroke-hover active:ring-btn-primary-brand-stroke-pressed disabled:ring-btn-primary-brand-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
39
42
|
},
|
|
40
43
|
{
|
|
41
44
|
variant: "filled",
|
|
42
45
|
shade: "neutral",
|
|
43
|
-
class: "bg-btn-primary-neutral-surface-default hover:bg-btn-primary-neutral-surface-hover active:bg-btn-primary-neutral-surface-pressed disabled:bg-btn-primary-neutral-surface-disabled ring-[
|
|
46
|
+
class: "bg-btn-primary-neutral-surface-default hover:bg-btn-primary-neutral-surface-hover active:bg-btn-primary-neutral-surface-pressed disabled:bg-btn-primary-neutral-surface-disabled ring-[1px] ring-btn-primary-neutral-stroke-default hover:ring-btn-primary-neutral-stroke-hover active:ring-btn-primary-neutral-stroke-pressed disabled:ring-btn-primary-neutral-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
44
47
|
},
|
|
45
48
|
{
|
|
46
49
|
variant: "filled",
|
|
47
50
|
shade: "danger",
|
|
48
|
-
class: "bg-btn-primary-danger-surface-default hover:bg-btn-primary-danger-surface-hover active:bg-btn-primary-danger-surface-pressed disabled:bg-btn-primary-danger-surface-disabled ring-[
|
|
51
|
+
class: "bg-btn-primary-danger-surface-default hover:bg-btn-primary-danger-surface-hover active:bg-btn-primary-danger-surface-pressed disabled:bg-btn-primary-danger-surface-disabled ring-[1px] ring-btn-primary-danger-stroke-default hover:ring-btn-primary-danger-stroke-hover active:ring-btn-primary-danger-stroke-pressed disabled:ring-btn-primary-danger-stroke-disabled text-text-inverted-primary disabled:text-text-neutral-muted"
|
|
49
52
|
},
|
|
50
53
|
{
|
|
51
54
|
variant: "stroke",
|
|
@@ -62,6 +65,21 @@ const C = N(
|
|
|
62
65
|
shade: "danger",
|
|
63
66
|
class: "text-text-danger-secondary disabled:text-text-neutral-muted"
|
|
64
67
|
},
|
|
68
|
+
{
|
|
69
|
+
variant: "colored-stroke",
|
|
70
|
+
shade: "neutral",
|
|
71
|
+
class: "text-text-neutral-primary ring-text-neutral-primary hover:ring-text-neutral-primary active:ring-text-neutral-primary disabled:text-text-neutral-muted disabled:ring-text-neutral-muted"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
variant: "colored-stroke",
|
|
75
|
+
shade: "brand",
|
|
76
|
+
class: "text-text-neutral-primary ring-text-brand-secondary hover:ring-text-brand-secondary active:ring-text-brand-secondary disabled:text-text-neutral-muted disabled:ring-text-neutral-muted"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
variant: "colored-stroke",
|
|
80
|
+
shade: "danger",
|
|
81
|
+
class: "text-text-neutral-primary ring-text-danger-secondary hover:ring-text-danger-secondary active:ring-text-danger-secondary disabled:text-text-neutral-muted disabled:ring-text-neutral-muted"
|
|
82
|
+
},
|
|
65
83
|
{
|
|
66
84
|
variant: "ghost",
|
|
67
85
|
shade: "neutral",
|
|
@@ -90,19 +108,19 @@ const C = N(
|
|
|
90
108
|
className: b,
|
|
91
109
|
shade: u = "neutral",
|
|
92
110
|
size: c,
|
|
93
|
-
variant:
|
|
111
|
+
variant: g = "filled",
|
|
94
112
|
asChild: i = !1,
|
|
95
113
|
leftIcon: r,
|
|
96
114
|
rightIcon: t,
|
|
97
|
-
label:
|
|
115
|
+
label: m,
|
|
98
116
|
children: l,
|
|
99
|
-
...
|
|
100
|
-
},
|
|
101
|
-
const
|
|
102
|
-
C({ shade: u, size: c, variant:
|
|
117
|
+
...p
|
|
118
|
+
}, x) => {
|
|
119
|
+
const y = i ? w : "button", a = m || l, n = !a && !!(r || t), o = n ? r || t : null, v = d(
|
|
120
|
+
C({ shade: u, size: c, variant: g, iconOnly: n }),
|
|
103
121
|
b
|
|
104
122
|
), s = "w-3.5 h-3.5 min-w-max";
|
|
105
|
-
return /* @__PURE__ */ e(
|
|
123
|
+
return /* @__PURE__ */ e(y, { className: v, ref: x, ...p, children: i ? l : n ? o ? /* @__PURE__ */ e("span", { className: s, children: o }) : null : /* @__PURE__ */ f(h, { children: [
|
|
106
124
|
r && /* @__PURE__ */ e("span", { className: d(s), children: r }),
|
|
107
125
|
a && /* @__PURE__ */ e("span", { children: a }),
|
|
108
126
|
t && /* @__PURE__ */ e("span", { className: d(s), children: t })
|
|
@@ -4,35 +4,35 @@ import { cn as f } from "../../lib/utils.js";
|
|
|
4
4
|
import { ColumnItem as p } from "./components/column-item/column-item.js";
|
|
5
5
|
import { useColumnReorder as c } from "./column-reorder.hook.js";
|
|
6
6
|
const C = ({
|
|
7
|
-
columns:
|
|
7
|
+
columns: e,
|
|
8
8
|
onReorder: d,
|
|
9
9
|
onRemove: i,
|
|
10
10
|
onEdit: l,
|
|
11
|
-
renderAction:
|
|
12
|
-
className:
|
|
13
|
-
disabled:
|
|
14
|
-
editable:
|
|
11
|
+
renderAction: m,
|
|
12
|
+
className: t,
|
|
13
|
+
disabled: s = !1,
|
|
14
|
+
editable: n = !1
|
|
15
15
|
}) => {
|
|
16
|
-
const { internalColumns: a } = c({ columns:
|
|
16
|
+
const { internalColumns: a } = c({ columns: e, onReorder: d });
|
|
17
17
|
return /* @__PURE__ */ r(
|
|
18
18
|
"div",
|
|
19
19
|
{
|
|
20
20
|
className: f(
|
|
21
|
-
"rounded-2xl border-[
|
|
22
|
-
|
|
21
|
+
"rounded-2xl border-[1px] border-stroke-solid-light bg-background-neutral-default overflow-hidden box-shadow-medium-10",
|
|
22
|
+
t
|
|
23
23
|
),
|
|
24
|
-
children: /* @__PURE__ */ r("div", { className: "divide-y divide-stroke-solid-light", children: a.map((
|
|
24
|
+
children: /* @__PURE__ */ r("div", { className: "divide-y divide-stroke-solid-light", children: a.map((o, u) => /* @__PURE__ */ r(
|
|
25
25
|
p,
|
|
26
26
|
{
|
|
27
|
-
column:
|
|
27
|
+
column: o,
|
|
28
28
|
index: u,
|
|
29
29
|
onRemove: i,
|
|
30
30
|
onEdit: l,
|
|
31
|
-
renderAction:
|
|
32
|
-
disabled:
|
|
33
|
-
editable:
|
|
31
|
+
renderAction: m,
|
|
32
|
+
disabled: s,
|
|
33
|
+
editable: n
|
|
34
34
|
},
|
|
35
|
-
|
|
35
|
+
o.id
|
|
36
36
|
)) })
|
|
37
37
|
}
|
|
38
38
|
);
|
|
@@ -71,7 +71,7 @@ function B({
|
|
|
71
71
|
"div",
|
|
72
72
|
{
|
|
73
73
|
className: d(
|
|
74
|
-
"flex items-center justify-center gap-1.5 p-2 self-stretch relative cursor-pointer rounded-lg bg-white border-[
|
|
74
|
+
"flex items-center justify-center gap-1.5 p-2 self-stretch relative cursor-pointer rounded-lg bg-white border-[1px] border-[#E0E0E0] shadow-[0px_1px_2px_0px_rgba(0,0,0,0.05)] hover:border-neutral-300 ",
|
|
75
75
|
o
|
|
76
76
|
),
|
|
77
77
|
children: [
|
|
@@ -133,7 +133,7 @@ function F({
|
|
|
133
133
|
align: a,
|
|
134
134
|
sideOffset: 8,
|
|
135
135
|
className: d(
|
|
136
|
-
"bg-white max-w-fit w-[var(--radix-popover-trigger-width)] p-1 flex flex-col items-start rounded-2xl border-[
|
|
136
|
+
"bg-white max-w-fit w-[var(--radix-popover-trigger-width)] p-1 flex flex-col items-start rounded-2xl border-[1px] border-[#E0E0E0] shadow-lg min-w-fit",
|
|
137
137
|
e
|
|
138
138
|
),
|
|
139
139
|
...o
|
|
@@ -222,7 +222,7 @@ function L({
|
|
|
222
222
|
side: l,
|
|
223
223
|
className: d(
|
|
224
224
|
"min-w-md min-h-fit h-[var(--radix-popover-content-height)]",
|
|
225
|
-
"bg-white w-full p-1 flex flex-col items-start rounded-2xl border-[
|
|
225
|
+
"bg-white w-full p-1 flex flex-col items-start rounded-2xl border-[1px] border-[#E0E0E0] shadow-lg",
|
|
226
226
|
e
|
|
227
227
|
),
|
|
228
228
|
...r
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as R, jsx as o, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment as P } from "react";
|
|
3
3
|
import { Z2Checkbox as k } from "../checkbox/checkbox.js";
|
|
4
|
-
import { useZ2Table as
|
|
4
|
+
import { useZ2Table as b } from "./z2-table-context.js";
|
|
5
5
|
import { flexRender as w } from "@tanstack/react-table";
|
|
6
6
|
import { cva as v } from "class-variance-authority";
|
|
7
7
|
import { cn as p } from "../../lib/utils.js";
|
|
8
8
|
import { Z2Skeleton as Z } from "../skeleton/skeleton.js";
|
|
9
|
-
const
|
|
9
|
+
const _ = v("", {
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
12
12
|
dense: "p-2 h-8",
|
|
@@ -37,33 +37,33 @@ function N(l) {
|
|
|
37
37
|
zIndex: e ? 1 : 0
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
var
|
|
42
|
-
const { props: e } =
|
|
40
|
+
function B({ children: l }) {
|
|
41
|
+
var a, r, t;
|
|
42
|
+
const { props: e } = b();
|
|
43
43
|
return /* @__PURE__ */ o(
|
|
44
44
|
"table",
|
|
45
45
|
{
|
|
46
46
|
"data-slot": "data-grid-table",
|
|
47
47
|
className: p(
|
|
48
48
|
"w-full align-middle text-left rtl:text-right text-neutral-secondary",
|
|
49
|
-
!((
|
|
49
|
+
!((a = e.tableLayout) != null && a.columnsDraggable) && "border-separate border-spacing-0",
|
|
50
50
|
((r = e.tableLayout) == null ? void 0 : r.width) === "fixed" ? "table-fixed" : "table-auto",
|
|
51
|
-
(
|
|
51
|
+
(t = e.tableClassNames) == null ? void 0 : t.base
|
|
52
52
|
),
|
|
53
53
|
children: l
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
function I({ children: l }) {
|
|
58
|
-
var
|
|
59
|
-
const { props: e } =
|
|
58
|
+
var a, r, t;
|
|
59
|
+
const { props: e } = b();
|
|
60
60
|
return /* @__PURE__ */ o(
|
|
61
61
|
"thead",
|
|
62
62
|
{
|
|
63
63
|
className: p(
|
|
64
64
|
"",
|
|
65
|
-
(
|
|
66
|
-
((r = e.tableLayout) == null ? void 0 : r.headerSticky) && ((
|
|
65
|
+
(a = e.tableClassNames) == null ? void 0 : a.header,
|
|
66
|
+
((r = e.tableLayout) == null ? void 0 : r.headerSticky) && ((t = e.tableClassNames) == null ? void 0 : t.headerSticky)
|
|
67
67
|
),
|
|
68
68
|
children: l
|
|
69
69
|
}
|
|
@@ -73,18 +73,18 @@ function T({
|
|
|
73
73
|
children: l,
|
|
74
74
|
headerGroup: e
|
|
75
75
|
}) {
|
|
76
|
-
var r,
|
|
77
|
-
const { props:
|
|
76
|
+
var r, t, n, d, i;
|
|
77
|
+
const { props: a } = b();
|
|
78
78
|
return /* @__PURE__ */ o(
|
|
79
79
|
"tr",
|
|
80
80
|
{
|
|
81
81
|
className: p(
|
|
82
82
|
"bg-transparent tracking-wider rounded-xl",
|
|
83
|
-
((r =
|
|
84
|
-
((
|
|
85
|
-
((n =
|
|
86
|
-
((d =
|
|
87
|
-
(
|
|
83
|
+
((r = a.tableLayout) == null ? void 0 : r.headerBorder) && "[&>th]:border-b border-stroke-solid-light",
|
|
84
|
+
((t = a.tableLayout) == null ? void 0 : t.cellBorder) && "[&_>:last-child]:border-e-0",
|
|
85
|
+
((n = a.tableLayout) == null ? void 0 : n.stripped) && "bg-transparent",
|
|
86
|
+
((d = a.tableLayout) == null ? void 0 : d.headerBackground) !== !1 && "bg-background-neutral-medium",
|
|
87
|
+
(i = a.tableClassNames) == null ? void 0 : i.headerRow
|
|
88
88
|
),
|
|
89
89
|
children: l
|
|
90
90
|
},
|
|
@@ -94,42 +94,42 @@ function T({
|
|
|
94
94
|
function D({
|
|
95
95
|
children: l,
|
|
96
96
|
header: e,
|
|
97
|
-
dndRef:
|
|
97
|
+
dndRef: a,
|
|
98
98
|
dndStyle: r
|
|
99
99
|
}) {
|
|
100
|
-
var
|
|
101
|
-
const { props:
|
|
102
|
-
size: (
|
|
100
|
+
var u, g, m, h, f, C, y, x;
|
|
101
|
+
const { props: t } = b(), { column: n } = e, d = n.getIsPinned(), i = d === "left" && n.getIsLastColumn("left"), s = d === "right" && n.getIsFirstColumn("right"), c = _({
|
|
102
|
+
size: (u = t.tableLayout) != null && u.dense ? "dense" : "default"
|
|
103
103
|
});
|
|
104
104
|
return /* @__PURE__ */ o(
|
|
105
105
|
"th",
|
|
106
106
|
{
|
|
107
|
-
ref:
|
|
107
|
+
ref: a,
|
|
108
108
|
colSpan: e.colSpan,
|
|
109
109
|
style: {
|
|
110
|
-
...((
|
|
110
|
+
...((g = t.tableLayout) == null ? void 0 : g.width) === "fixed" && {
|
|
111
111
|
width: `${e.getSize()}px`
|
|
112
112
|
},
|
|
113
|
-
...((m =
|
|
113
|
+
...((m = t.tableLayout) == null ? void 0 : m.columnsPinnable) && n.getCanPin() && N(n),
|
|
114
114
|
...r || null
|
|
115
115
|
},
|
|
116
116
|
"data-pinned": d || void 0,
|
|
117
|
-
"data-last-col":
|
|
117
|
+
"data-last-col": i ? "left" : s ? "right" : void 0,
|
|
118
118
|
className: p(
|
|
119
119
|
"relative h-10 text-left rtl:text-right align-middle [&:has([role=checkbox])]:pe-0 border-stroke-solid-light leading-none-medium-sm dark:text-inverted-secondary",
|
|
120
|
-
|
|
121
|
-
((h =
|
|
122
|
-
((f =
|
|
123
|
-
((C =
|
|
120
|
+
c,
|
|
121
|
+
((h = t.tableLayout) == null ? void 0 : h.cellBorder) && "border-e",
|
|
122
|
+
((f = t.tableLayout) == null ? void 0 : f.columnsResizable) && n.getCanResize() && "truncate",
|
|
123
|
+
((C = t.tableLayout) == null ? void 0 : C.columnsPinnable) && n.getCanPin() && "[&:not([data-pinned]):has(+[data-pinned])_div.cursor-col-resize:last-child]:opacity-0 [&[data-last-col=left]_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=left][data-last-col=left]]:border-e! [&[data-pinned=right]:last-child_div.cursor-col-resize:last-child]:opacity-0 [&[data-pinned=right][data-last-col=right]]:border-s! [&[data-pinned][data-last-col]]:border-border data-pinned:bg-muted/90 data-pinned:backdrop-blur-xs",
|
|
124
124
|
(y = e.column.columnDef.meta) == null ? void 0 : y.headerClassName,
|
|
125
|
-
n.getIndex() === 0 || n.getIndex() === e.headerGroup.headers.length - 1 ? (x =
|
|
125
|
+
n.getIndex() === 0 || n.getIndex() === e.headerGroup.headers.length - 1 ? (x = t.tableClassNames) == null ? void 0 : x.edgeCell : ""
|
|
126
126
|
),
|
|
127
127
|
children: l
|
|
128
128
|
},
|
|
129
129
|
e.id
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function M({ header: l }) {
|
|
133
133
|
const { column: e } = l;
|
|
134
134
|
return /* @__PURE__ */ o(
|
|
135
135
|
"div",
|
|
@@ -141,18 +141,18 @@ function A({ header: l }) {
|
|
|
141
141
|
}
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function A() {
|
|
145
145
|
return /* @__PURE__ */ o("tbody", { "aria-hidden": "true", className: "h-2" });
|
|
146
146
|
}
|
|
147
147
|
function V({ children: l }) {
|
|
148
|
-
var
|
|
149
|
-
const { props: e } =
|
|
148
|
+
var a, r;
|
|
149
|
+
const { props: e } = b();
|
|
150
150
|
return /* @__PURE__ */ o(
|
|
151
151
|
"tbody",
|
|
152
152
|
{
|
|
153
153
|
className: p(
|
|
154
154
|
"[&_tr:last-child]:border-0",
|
|
155
|
-
((
|
|
155
|
+
((a = e.tableLayout) == null ? void 0 : a.rowRounded) && "[&_td:first-child]:rounded-s-lg [&_td:last-child]:rounded-e-lg",
|
|
156
156
|
(r = e.tableClassNames) == null ? void 0 : r.body
|
|
157
157
|
),
|
|
158
158
|
children: l
|
|
@@ -160,19 +160,19 @@ function V({ children: l }) {
|
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
function F({ children: l }) {
|
|
163
|
-
var r,
|
|
164
|
-
const { table: e, props:
|
|
163
|
+
var r, t, n, d, i;
|
|
164
|
+
const { table: e, props: a } = b();
|
|
165
165
|
return /* @__PURE__ */ o(
|
|
166
166
|
"tr",
|
|
167
167
|
{
|
|
168
168
|
className: p(
|
|
169
169
|
"hover:bg-background-neutral-medium data-[state=selected]:bg-muted/50 border-stroke-solid-light",
|
|
170
|
-
|
|
171
|
-
!((r =
|
|
172
|
-
((n =
|
|
173
|
-
((d =
|
|
170
|
+
a.onRowClick && "cursor-pointer",
|
|
171
|
+
!((r = a.tableLayout) != null && r.stripped) && ((t = a.tableLayout) == null ? void 0 : t.rowBorder) && "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-stroke-solid-light",
|
|
172
|
+
((n = a.tableLayout) == null ? void 0 : n.cellBorder) && "[&_>:last-child]:border-e-0",
|
|
173
|
+
((d = a.tableLayout) == null ? void 0 : d.stripped) && "odd:bg-background-neutral-medium hover:bg-transparent odd:hover:bg-background-neutral-medium",
|
|
174
174
|
e.options.enableRowSelection && "[&_>:first-child]:relative",
|
|
175
|
-
(
|
|
175
|
+
(i = a.tableClassNames) == null ? void 0 : i.bodyRow
|
|
176
176
|
),
|
|
177
177
|
children: l
|
|
178
178
|
}
|
|
@@ -182,26 +182,26 @@ function H({
|
|
|
182
182
|
children: l,
|
|
183
183
|
column: e
|
|
184
184
|
}) {
|
|
185
|
-
var n, d, s,
|
|
186
|
-
const { props:
|
|
187
|
-
size: (n =
|
|
185
|
+
var n, d, i, s, c, u, g;
|
|
186
|
+
const { props: a, table: r } = b(), t = S({
|
|
187
|
+
size: (n = a.tableLayout) != null && n.dense ? "dense" : "default"
|
|
188
188
|
});
|
|
189
189
|
return /* @__PURE__ */ o(
|
|
190
190
|
"td",
|
|
191
191
|
{
|
|
192
192
|
style: {
|
|
193
|
-
...((d =
|
|
193
|
+
...((d = a.tableLayout) == null ? void 0 : d.width) === "fixed" && {
|
|
194
194
|
width: `${e.getSize()}px`
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
197
|
className: p(
|
|
198
198
|
"align-middle",
|
|
199
|
-
|
|
200
|
-
((
|
|
201
|
-
((
|
|
202
|
-
(
|
|
203
|
-
((
|
|
204
|
-
e.getIndex() === 0 || e.getIndex() === r.getVisibleFlatColumns().length - 1 ? (
|
|
199
|
+
t,
|
|
200
|
+
((i = a.tableLayout) == null ? void 0 : i.cellBorder) && "border-e border-stroke-solid-light",
|
|
201
|
+
((s = a.tableLayout) == null ? void 0 : s.columnsResizable) && e.getCanResize() && "truncate",
|
|
202
|
+
(c = e.columnDef.meta) == null ? void 0 : c.cellClassName,
|
|
203
|
+
((u = a.tableLayout) == null ? void 0 : u.columnsPinnable) && e.getCanPin() && '[&[data-pinned=left][data-last-col=left]]:border-e! [&[data-pinned=right][data-last-col=right]]:border-s! [&[data-pinned][data-last-col]]:border-stroke-solid-light data-pinned:bg-background/90 data-pinned:backdrop-blur-xs"',
|
|
204
|
+
e.getIndex() === 0 || e.getIndex() === r.getVisibleFlatColumns().length - 1 ? (g = a.tableClassNames) == null ? void 0 : g.edgeCell : ""
|
|
205
205
|
),
|
|
206
206
|
children: l
|
|
207
207
|
}
|
|
@@ -210,79 +210,79 @@ function H({
|
|
|
210
210
|
function E({
|
|
211
211
|
children: l,
|
|
212
212
|
row: e,
|
|
213
|
-
dndRef:
|
|
213
|
+
dndRef: a,
|
|
214
214
|
dndStyle: r
|
|
215
215
|
}) {
|
|
216
|
-
var d, s,
|
|
217
|
-
const { props:
|
|
216
|
+
var d, i, s, c, u;
|
|
217
|
+
const { props: t, table: n } = b();
|
|
218
218
|
return /* @__PURE__ */ o(
|
|
219
219
|
"tr",
|
|
220
220
|
{
|
|
221
|
-
ref:
|
|
221
|
+
ref: a,
|
|
222
222
|
style: { ...r || null },
|
|
223
223
|
"data-state": n.options.enableRowSelection && e.getIsSelected() ? "selected" : void 0,
|
|
224
|
-
onClick: () =>
|
|
224
|
+
onClick: () => t.onRowClick && t.onRowClick(e.original),
|
|
225
225
|
className: p(
|
|
226
226
|
"hover:bg-background-neutral-medium data-[state=selected]:bg-muted/50 leading-none-medium-sm text-neutral-primary dark:text-inverted-primary",
|
|
227
|
-
|
|
228
|
-
!((d =
|
|
229
|
-
((
|
|
230
|
-
((
|
|
227
|
+
t.onRowClick && "cursor-pointer",
|
|
228
|
+
!((d = t.tableLayout) != null && d.stripped) && ((i = t.tableLayout) == null ? void 0 : i.rowBorder) && "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-stroke-solid-light",
|
|
229
|
+
((s = t.tableLayout) == null ? void 0 : s.cellBorder) && "[&_>:last-child]:border-e-0",
|
|
230
|
+
((c = t.tableLayout) == null ? void 0 : c.stripped) && "odd:bg-background-neutral-medium hover:bg-transparent odd:hover:bg-background-neutral-medium",
|
|
231
231
|
n.options.enableRowSelection && "[&_>:first-child]:relative",
|
|
232
|
-
(
|
|
232
|
+
(u = t.tableClassNames) == null ? void 0 : u.bodyRow
|
|
233
233
|
),
|
|
234
234
|
children: l
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function j({ row: l }) {
|
|
239
|
-
var
|
|
240
|
-
const { props: e, table:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
239
|
+
var d, i;
|
|
240
|
+
const { props: e, table: a } = b(), r = a.getAllColumns().find((s) => {
|
|
241
|
+
var c;
|
|
242
|
+
return (c = s.columnDef.meta) == null ? void 0 : c.expandedContent;
|
|
243
|
+
}), t = (d = r == null ? void 0 : r.columnDef.meta) == null ? void 0 : d.expandedContent;
|
|
244
|
+
if (!t)
|
|
245
|
+
return null;
|
|
246
|
+
let n;
|
|
247
|
+
return typeof t == "function" ? n = t(l.original) : n = t, n == null ? null : /* @__PURE__ */ o(
|
|
245
248
|
"tr",
|
|
246
249
|
{
|
|
247
250
|
className: p(
|
|
248
|
-
((
|
|
251
|
+
((i = e.tableLayout) == null ? void 0 : i.rowBorder) && "[&:not(:last-child)>td]:border-b [&:not(:last-child)>td]:border-stroke-solid-light"
|
|
249
252
|
),
|
|
250
|
-
children: /* @__PURE__ */ o("td", { colSpan: l.getVisibleCells().length, children:
|
|
251
|
-
var b;
|
|
252
|
-
return (b = c.columnDef.meta) == null ? void 0 : b.expandedContent;
|
|
253
|
-
})) == null ? void 0 : s.columnDef.meta) == null ? void 0 : i.expandedContent) == null ? void 0 : u.call(i, l.original) })
|
|
253
|
+
children: /* @__PURE__ */ o("td", { colSpan: l.getVisibleCells().length, children: n })
|
|
254
254
|
}
|
|
255
|
-
)
|
|
255
|
+
);
|
|
256
256
|
}
|
|
257
257
|
function $({
|
|
258
258
|
children: l,
|
|
259
259
|
cell: e,
|
|
260
|
-
dndRef:
|
|
260
|
+
dndRef: a,
|
|
261
261
|
dndStyle: r
|
|
262
262
|
}) {
|
|
263
|
-
var
|
|
264
|
-
const { props:
|
|
265
|
-
size: (
|
|
263
|
+
var g, m, h, f, C, y, x, L;
|
|
264
|
+
const { props: t } = b(), { column: n, row: d } = e, i = n.getIsPinned(), s = i === "left" && n.getIsLastColumn("left"), c = i === "right" && n.getIsFirstColumn("right"), u = S({
|
|
265
|
+
size: (g = t.tableLayout) != null && g.dense ? "dense" : "default"
|
|
266
266
|
});
|
|
267
267
|
return /* @__PURE__ */ o(
|
|
268
268
|
"td",
|
|
269
269
|
{
|
|
270
|
-
ref:
|
|
271
|
-
...(m =
|
|
270
|
+
ref: a,
|
|
271
|
+
...(m = t.tableLayout) != null && m.columnsDraggable && !i ? { cell: e } : {},
|
|
272
272
|
style: {
|
|
273
|
-
...((h =
|
|
273
|
+
...((h = t.tableLayout) == null ? void 0 : h.columnsPinnable) && n.getCanPin() && N(n),
|
|
274
274
|
...r || null
|
|
275
275
|
},
|
|
276
|
-
"data-pinned":
|
|
277
|
-
"data-last-col":
|
|
276
|
+
"data-pinned": i || void 0,
|
|
277
|
+
"data-last-col": s ? "left" : c ? "right" : void 0,
|
|
278
278
|
className: p(
|
|
279
279
|
"align-middle",
|
|
280
|
-
|
|
281
|
-
((f =
|
|
282
|
-
((C =
|
|
280
|
+
u,
|
|
281
|
+
((f = t.tableLayout) == null ? void 0 : f.cellBorder) && "border-e border-stroke-solid-light",
|
|
282
|
+
((C = t.tableLayout) == null ? void 0 : C.columnsResizable) && n.getCanResize() && "truncate",
|
|
283
283
|
(y = e.column.columnDef.meta) == null ? void 0 : y.cellClassName,
|
|
284
|
-
((x =
|
|
285
|
-
n.getIndex() === 0 || n.getIndex() === d.getVisibleCells().length - 1 ? (L =
|
|
284
|
+
((x = t.tableLayout) == null ? void 0 : x.columnsPinnable) && n.getCanPin() && '[&[data-pinned=left][data-last-col=left]]:border-e! [&[data-pinned=right][data-last-col=right]]:border-s! [&[data-pinned][data-last-col]]:border-border data-pinned:bg-background/90 data-pinned:backdrop-blur-xs"',
|
|
285
|
+
n.getIndex() === 0 || n.getIndex() === d.getVisibleCells().length - 1 ? (L = t.tableClassNames) == null ? void 0 : L.edgeCell : ""
|
|
286
286
|
),
|
|
287
287
|
children: l
|
|
288
288
|
},
|
|
@@ -290,12 +290,12 @@ function $({
|
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
function G() {
|
|
293
|
-
const { table: l, props: e } =
|
|
294
|
-
return /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan:
|
|
293
|
+
const { table: l, props: e } = b(), a = l.getAllColumns().length;
|
|
294
|
+
return /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: a, className: "text-center text-muted-foreground py-6", children: e.emptyMessage || "No data available" }) });
|
|
295
295
|
}
|
|
296
296
|
function O() {
|
|
297
|
-
const { table: l, props: e } =
|
|
298
|
-
return /* @__PURE__ */ o("tr", { style: { height: l.getState().pagination.pageSize * 43 }, children: /* @__PURE__ */ o("td", { colSpan:
|
|
297
|
+
const { table: l, props: e } = b(), a = l.getAllColumns().length;
|
|
298
|
+
return /* @__PURE__ */ o("tr", { style: { height: l.getState().pagination.pageSize * 43 }, children: /* @__PURE__ */ o("td", { colSpan: a, className: "text-center text-muted-foreground py-6", children: /* @__PURE__ */ R("div", { className: "text-neutral-muted flex items-center gap-2 px-4 py-2 leading-none-medium-sm justify-center", children: [
|
|
299
299
|
/* @__PURE__ */ R(
|
|
300
300
|
"svg",
|
|
301
301
|
{
|
|
@@ -368,43 +368,43 @@ function ee({
|
|
|
368
368
|
) });
|
|
369
369
|
}
|
|
370
370
|
function te(l) {
|
|
371
|
-
const { table: e, recordCount:
|
|
371
|
+
const { table: e, recordCount: a, isLoading: r } = b();
|
|
372
372
|
return /* @__PURE__ */ o(
|
|
373
373
|
k,
|
|
374
374
|
{
|
|
375
375
|
checked: e.getIsAllPageRowsSelected() || e.getIsSomePageRowsSelected() && "indeterminate",
|
|
376
|
-
disabled: r ||
|
|
377
|
-
onCheckedChange: (
|
|
376
|
+
disabled: r || a === 0,
|
|
377
|
+
onCheckedChange: (t) => e.toggleAllPageRowsSelected(!!t),
|
|
378
378
|
"aria-label": "Select all",
|
|
379
379
|
className: "align-[inherit]"
|
|
380
380
|
}
|
|
381
381
|
);
|
|
382
382
|
}
|
|
383
383
|
function ae() {
|
|
384
|
-
var
|
|
385
|
-
const { table: l, isLoading: e, props:
|
|
386
|
-
return /* @__PURE__ */ R(
|
|
387
|
-
(((
|
|
388
|
-
/* @__PURE__ */ o(V, { children: e && (r != null && r.pageSize) ?
|
|
389
|
-
var
|
|
390
|
-
return /* @__PURE__ */ o(H, { column:
|
|
391
|
-
}) },
|
|
392
|
-
/* @__PURE__ */ o(E, { row: d, children: d.getVisibleCells().map((
|
|
384
|
+
var t, n;
|
|
385
|
+
const { table: l, isLoading: e, props: a } = b(), r = l.getState().pagination;
|
|
386
|
+
return /* @__PURE__ */ R(B, { children: [
|
|
387
|
+
(((t = a.tableLayout) == null ? void 0 : t.stripped) || !((n = a.tableLayout) != null && n.rowBorder)) && /* @__PURE__ */ o(A, {}),
|
|
388
|
+
/* @__PURE__ */ o(V, { children: e && (r != null && r.pageSize) ? a.loadingMode === "skeleton" ? Array.from({ length: r.pageSize }).map((d, i) => /* @__PURE__ */ o(F, { children: l.getVisibleFlatColumns().map((s, c) => {
|
|
389
|
+
var u;
|
|
390
|
+
return /* @__PURE__ */ o(H, { column: s, children: ((u = s.columnDef.meta) == null ? void 0 : u.skeleton) || /* @__PURE__ */ o(Z, { className: "h-4 w-full" }) }, c);
|
|
391
|
+
}) }, i)) : /* @__PURE__ */ o(O, {}) : l.getRowModel().rows.length ? l.getRowModel().rows.map((d, i) => /* @__PURE__ */ R(P, { children: [
|
|
392
|
+
/* @__PURE__ */ o(E, { row: d, children: d.getVisibleCells().map((s, c) => /* @__PURE__ */ o($, { cell: s, children: w(s.column.columnDef.cell, s.getContext()) }, c)) }, i),
|
|
393
393
|
d.getIsExpanded() && /* @__PURE__ */ o(j, { row: d })
|
|
394
394
|
] }, d.id)) : /* @__PURE__ */ o(G, {}) }),
|
|
395
|
-
/* @__PURE__ */ o(I, { children: l.getHeaderGroups().map((d,
|
|
396
|
-
var
|
|
397
|
-
const { column:
|
|
398
|
-
return /* @__PURE__ */ R(D, { header:
|
|
399
|
-
|
|
400
|
-
((
|
|
401
|
-
] },
|
|
402
|
-
}) },
|
|
395
|
+
/* @__PURE__ */ o(I, { children: l.getHeaderGroups().map((d, i) => /* @__PURE__ */ o(T, { headerGroup: d, children: d.headers.map((s, c) => {
|
|
396
|
+
var g;
|
|
397
|
+
const { column: u } = s;
|
|
398
|
+
return /* @__PURE__ */ R(D, { header: s, children: [
|
|
399
|
+
s.isPlaceholder ? null : w(s.column.columnDef.header, s.getContext()),
|
|
400
|
+
((g = a.tableLayout) == null ? void 0 : g.columnsResizable) && u.getCanResize() && /* @__PURE__ */ o(M, { header: s })
|
|
401
|
+
] }, c);
|
|
402
|
+
}) }, i)) })
|
|
403
403
|
] });
|
|
404
404
|
}
|
|
405
405
|
export {
|
|
406
406
|
ae as Z2Table,
|
|
407
|
-
|
|
407
|
+
B as Z2TableBase,
|
|
408
408
|
V as Z2TableBody,
|
|
409
409
|
E as Z2TableBodyRow,
|
|
410
410
|
$ as Z2TableBodyRowCell,
|
|
@@ -415,9 +415,9 @@ export {
|
|
|
415
415
|
I as Z2TableHead,
|
|
416
416
|
T as Z2TableHeadRow,
|
|
417
417
|
D as Z2TableHeadRowCell,
|
|
418
|
-
|
|
418
|
+
M as Z2TableHeadRowCellResize,
|
|
419
419
|
O as Z2TableLoader,
|
|
420
420
|
ee as Z2TableRowSelect,
|
|
421
421
|
te as Z2TableRowSelectAll,
|
|
422
|
-
|
|
422
|
+
A as Z2TableRowSpacer
|
|
423
423
|
};
|
|
@@ -15,7 +15,7 @@ const d = _("", {
|
|
|
15
15
|
"div",
|
|
16
16
|
{
|
|
17
17
|
className: e(
|
|
18
|
-
"rounded-lg bg-input-surface-default flex items-center shadow-[
|
|
18
|
+
"rounded-lg bg-input-surface-default flex items-center shadow-[inset_0_0_0_1px_theme(colors.input.stroke.default)] hover:shadow-[inset_0_0_0_1px_theme(colors.input.stroke.hover)] focus-within:shadow-[inset_0_0_0_1px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] focus-within:hover:shadow-[inset_0_0_0_1px_theme(colors.input.stroke.active),0_1px_2px_0_rgba(0,0,0,0.05)] has-[:disabled]:shadow-[inset_0_0_0_1px_theme(colors.input.stroke.disabled)]",
|
|
19
19
|
d({ size: s }),
|
|
20
20
|
o
|
|
21
21
|
),
|