@konstructio/ui 0.1.2-alpha.21 → 0.1.2-alpha.22
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/{Modal-B8jrP02v.js → Modal-Dpk-1N9W.js} +2 -2
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +1 -1
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +2 -8
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +1 -1
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +6 -7
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +2 -2
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +2 -2
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +1 -1
- package/dist/components/Dropdown/components/List/List.js +1 -1
- package/dist/components/Dropdown/components/Wrapper.js +1 -13
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PieChart/PieChart.js +0 -18
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +10 -11
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/components/Content.js +1 -1
- package/dist/components/Tabs/components/List.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +1 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Toast/Toast.js +233 -210
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +64 -67
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +2 -2
- package/dist/components/VirtualizedTable/components/Body/Body.js +36 -22
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +40 -38
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +23 -16
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +52 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +263 -236
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +8 -6
- package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +43 -42
- package/dist/components/index.js +1 -1
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DGhJ8Z4k.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/{ellipsis-vertical-DpnVYRxI.js → ellipsis-vertical-BVPtjl5f.js} +1 -7
- package/dist/{index-N2OStZoU.js → index--V_ZsiQe.js} +0 -21
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/index-DDByhzds.js +137 -0
- package/dist/{index-DQJhMz8c.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-CffpTFMi.js → index-Dbt2vBmS.js} +5 -6
- package/dist/{index-l3NwplN0.js → index-DpW9ExsS.js} +10 -11
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/{index-0XtjXVpJ.js → index-X4k_cU8k.js} +4 -4
- package/dist/index-kyuBfLcN.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/{index-BAEWsOG1.js → index-ohdbKsws.js} +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/package.json +17 -17
- package/dist/styles.css +1 -1
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/{x-4F_5p77m.js → x-DPU9OdYH.js} +1 -1
- package/package.json +17 -17
- package/dist/chevron-down-J5nS1Tu0.js +0 -11
- package/dist/chevron-right-DeMVrnIg.js +0 -19
- package/dist/components/Skeleton/Skeleton.js +0 -42
- package/dist/index-BVRIAMfe.js +0 -36
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Bn4c-gww.js +0 -131
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DdXGVVBv.js +0 -15
- package/dist/index-amYX3uxF.js +0 -436
- package/dist/index-sp5ZfG6g.js +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
-
import { S as i } from "../../index-
|
|
2
|
+
import { S as i } from "../../index-BtQfgaSF.js";
|
|
3
3
|
import { forwardRef as v, useRef as N, useImperativeHandle as w, useMemo as h, isValidElement as x } from "react";
|
|
4
4
|
import { cn as o } from "../../utils/index.js";
|
|
5
5
|
import { arrowVariants as R, tooltipVariants as V } from "./Tooltip.variants.js";
|
|
@@ -1,98 +1,95 @@
|
|
|
1
1
|
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { TableProvider as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import {
|
|
2
|
+
import { useMemo as I } from "react";
|
|
3
|
+
import { cn as c } from "../../utils/index.js";
|
|
4
|
+
import { TableProvider as K } from "./contexts/table.provider.js";
|
|
5
|
+
import { Filter as M } from "./components/Filter/Filter.js";
|
|
6
|
+
import { WrapperBody as W } from "./components/WrapperBody/WrapperBody.js";
|
|
7
|
+
import { Header as g } from "./components/Header/Header.js";
|
|
7
8
|
import { Body as k } from "./components/Body/Body.js";
|
|
8
9
|
import { Pagination as q } from "./components/Pagination/Pagination.js";
|
|
9
10
|
import { TruncateText as C } from "./components/TruncateText/TruncateText.js";
|
|
10
11
|
import { Actions as F } from "./components/Actions/Actions.js";
|
|
11
12
|
const G = ({
|
|
12
13
|
id: n,
|
|
13
|
-
ariaLabel:
|
|
14
|
-
columns:
|
|
15
|
-
data:
|
|
16
|
-
totalItems:
|
|
17
|
-
className:
|
|
18
|
-
classNameHeaderActiveArrows:
|
|
19
|
-
classNameHeaderArrows:
|
|
14
|
+
ariaLabel: f,
|
|
15
|
+
columns: p,
|
|
16
|
+
data: d,
|
|
17
|
+
totalItems: u = -1 / 0,
|
|
18
|
+
className: b,
|
|
19
|
+
classNameHeaderActiveArrows: T,
|
|
20
|
+
classNameHeaderArrows: x,
|
|
20
21
|
classNameHeaderTable: N,
|
|
21
|
-
classNameTable:
|
|
22
|
-
classNameWrapperTable:
|
|
23
|
-
isLoading:
|
|
24
|
-
fetchData:
|
|
25
|
-
queryOptions:
|
|
22
|
+
classNameTable: A,
|
|
23
|
+
classNameWrapperTable: y,
|
|
24
|
+
isLoading: o,
|
|
25
|
+
fetchData: h,
|
|
26
|
+
queryOptions: z,
|
|
26
27
|
// Pagination
|
|
27
|
-
showPagination:
|
|
28
|
-
showTotalItems:
|
|
29
|
-
showDropdownPagination:
|
|
28
|
+
showPagination: B,
|
|
29
|
+
showTotalItems: a,
|
|
30
|
+
showDropdownPagination: t,
|
|
30
31
|
showDotPagination: l,
|
|
31
|
-
showFormPagination:
|
|
32
|
-
pageSizes:
|
|
32
|
+
showFormPagination: m,
|
|
33
|
+
pageSizes: V,
|
|
33
34
|
// Filter
|
|
34
|
-
showFilter:
|
|
35
|
-
showFilterInput:
|
|
35
|
+
showFilter: j = !1,
|
|
36
|
+
showFilterInput: v,
|
|
36
37
|
filterSearchPlaceholder: w = "",
|
|
37
|
-
multiSelectFilter:
|
|
38
|
-
filterActions:
|
|
39
|
-
showResetButton:
|
|
38
|
+
multiSelectFilter: P,
|
|
39
|
+
filterActions: E,
|
|
40
|
+
showResetButton: H = !0
|
|
40
41
|
}) => {
|
|
41
|
-
const e =
|
|
42
|
-
() =>
|
|
43
|
-
i,
|
|
42
|
+
const e = I(
|
|
43
|
+
() => B || [
|
|
44
44
|
a,
|
|
45
|
+
t,
|
|
45
46
|
l,
|
|
46
|
-
|
|
47
|
+
m
|
|
47
48
|
].some(Boolean),
|
|
48
49
|
[]
|
|
49
50
|
);
|
|
50
51
|
return /* @__PURE__ */ r(
|
|
51
|
-
|
|
52
|
+
K,
|
|
52
53
|
{
|
|
53
54
|
id: n,
|
|
54
|
-
columns:
|
|
55
|
-
data:
|
|
56
|
-
fetchData:
|
|
57
|
-
totalItems:
|
|
58
|
-
queryOptions:
|
|
55
|
+
columns: p,
|
|
56
|
+
data: d,
|
|
57
|
+
fetchData: h,
|
|
58
|
+
totalItems: u,
|
|
59
|
+
queryOptions: z,
|
|
59
60
|
isPaginationEnabled: e,
|
|
60
|
-
children: /* @__PURE__ */ s("section", { className:
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
children: /* @__PURE__ */ s("section", { className: c("w-full min-w-fit", b), children: [
|
|
62
|
+
j && /* @__PURE__ */ r(
|
|
63
|
+
M,
|
|
63
64
|
{
|
|
64
|
-
actions:
|
|
65
|
-
multiSelectFilter:
|
|
65
|
+
actions: E,
|
|
66
|
+
multiSelectFilter: P,
|
|
66
67
|
placeholder: w,
|
|
67
|
-
showFilterInput:
|
|
68
|
-
showResetButton:
|
|
68
|
+
showFilterInput: v,
|
|
69
|
+
showResetButton: H
|
|
69
70
|
}
|
|
70
71
|
),
|
|
71
72
|
/* @__PURE__ */ r(
|
|
72
|
-
|
|
73
|
+
W,
|
|
73
74
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"overflow-hidden rounded-lg": !e
|
|
78
|
-
},
|
|
79
|
-
x
|
|
80
|
-
),
|
|
75
|
+
showPagination: e,
|
|
76
|
+
classNameWrapperTable: y,
|
|
77
|
+
isLoading: o,
|
|
81
78
|
children: /* @__PURE__ */ s(
|
|
82
79
|
"table",
|
|
83
80
|
{
|
|
84
|
-
className:
|
|
85
|
-
"aria-label":
|
|
81
|
+
className: c("w-full border-collapse table-fixed", A),
|
|
82
|
+
"aria-label": f,
|
|
86
83
|
children: [
|
|
87
84
|
/* @__PURE__ */ r(
|
|
88
|
-
|
|
85
|
+
g,
|
|
89
86
|
{
|
|
90
87
|
className: N,
|
|
91
|
-
classNameArrows:
|
|
92
|
-
classNameActiveArrows:
|
|
88
|
+
classNameArrows: x,
|
|
89
|
+
classNameActiveArrows: T
|
|
93
90
|
}
|
|
94
91
|
),
|
|
95
|
-
/* @__PURE__ */ r(k, { isLoading:
|
|
92
|
+
/* @__PURE__ */ r(k, { isLoading: o })
|
|
96
93
|
]
|
|
97
94
|
}
|
|
98
95
|
)
|
|
@@ -101,21 +98,21 @@ const G = ({
|
|
|
101
98
|
e && /* @__PURE__ */ r(
|
|
102
99
|
q,
|
|
103
100
|
{
|
|
104
|
-
showTotalItems:
|
|
105
|
-
showDropdownPagination:
|
|
101
|
+
showTotalItems: a,
|
|
102
|
+
showDropdownPagination: t,
|
|
106
103
|
showDotPagination: l,
|
|
107
|
-
showFormPagination:
|
|
108
|
-
pageSizes:
|
|
104
|
+
showFormPagination: m,
|
|
105
|
+
pageSizes: V
|
|
109
106
|
}
|
|
110
107
|
)
|
|
111
108
|
] })
|
|
112
109
|
}
|
|
113
110
|
);
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
111
|
+
}, i = G;
|
|
112
|
+
i.displayName = "KonstructVirtualizedTable";
|
|
113
|
+
i.TruncateText = C;
|
|
114
|
+
i.Actions = F;
|
|
118
115
|
export {
|
|
119
116
|
C as TruncateText,
|
|
120
|
-
|
|
117
|
+
i as VirtualizedTable
|
|
121
118
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Button as r } from "../../../Button/Button.js";
|
|
3
3
|
import { cn as n } from "../../../../utils/index.js";
|
|
4
|
-
import { E as c } from "../../../../ellipsis-vertical-
|
|
4
|
+
import { E as c } from "../../../../ellipsis-vertical-BVPtjl5f.js";
|
|
5
5
|
const u = ({
|
|
6
6
|
actions: t,
|
|
7
7
|
...i
|
|
8
|
-
}) => t ? /* @__PURE__ */ o("div", { className: "relative group
|
|
8
|
+
}) => t ? /* @__PURE__ */ o("div", { className: "relative group", children: [
|
|
9
9
|
/* @__PURE__ */ o(
|
|
10
10
|
r,
|
|
11
11
|
{
|
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { f
|
|
3
|
-
import { Skeleton as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
import { f } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Skeleton as p } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { cn as m } from "../../../../utils/index.js";
|
|
5
|
+
import { useTableContext as u } from "../../contexts/table.hook.js";
|
|
6
|
+
const y = ({
|
|
7
|
+
isLoading: s
|
|
8
|
+
}) => {
|
|
9
|
+
const { table: r, pageSize: l, tableFetching: n } = u();
|
|
10
|
+
return s || n ? /* @__PURE__ */ e(p, { numberOfRows: l, table: r }) : /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: r.getRowModel().rows.map(({ id: a, original: i, getVisibleCells: c }) => {
|
|
11
|
+
const { meta: o = {} } = i;
|
|
12
|
+
return /* @__PURE__ */ e(
|
|
13
|
+
"tr",
|
|
14
|
+
{
|
|
15
|
+
className: m(
|
|
16
|
+
"border-b border-b-gray-200 bg-white last:border-b-transparent",
|
|
17
|
+
o.className
|
|
18
|
+
),
|
|
19
|
+
"data-row-id": a,
|
|
20
|
+
...o.attributes ?? {},
|
|
21
|
+
children: c().map(({ id: b, column: t, getContext: d }) => /* @__PURE__ */ e(
|
|
22
|
+
"td",
|
|
23
|
+
{
|
|
24
|
+
className: m(
|
|
25
|
+
"px-4 py-1 text-sm",
|
|
26
|
+
t.columnDef.meta?.className
|
|
27
|
+
),
|
|
28
|
+
...t.columnDef.meta?.attributes ?? {},
|
|
29
|
+
children: f(t.columnDef.cell, d())
|
|
30
|
+
},
|
|
31
|
+
b
|
|
32
|
+
))
|
|
33
|
+
},
|
|
34
|
+
a
|
|
35
|
+
);
|
|
36
|
+
}) });
|
|
23
37
|
};
|
|
24
38
|
export {
|
|
25
|
-
|
|
39
|
+
y as Body
|
|
26
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { memo as u } from "react";
|
|
3
3
|
import { cn as p } from "../../../../utils/index.js";
|
|
4
|
-
import { C as g, a as d } from "../../../../chevron-right-
|
|
4
|
+
import { C as g, a as d } from "../../../../chevron-right-DYvXLeql.js";
|
|
5
5
|
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
6
6
|
const r = u(
|
|
7
7
|
({
|
|
@@ -1,68 +1,70 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { cn as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { f as g } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { useCallback as p } from "react";
|
|
4
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
5
|
+
import u from "../../assets/chevron-up.js";
|
|
6
|
+
import C from "../../assets/chevron-down.js";
|
|
7
7
|
import { useTableContext as S } from "../../contexts/table.hook.js";
|
|
8
|
-
const
|
|
9
|
-
className:
|
|
10
|
-
classNameArrows:
|
|
11
|
-
classNameActiveArrows:
|
|
8
|
+
const D = ({
|
|
9
|
+
className: n,
|
|
10
|
+
classNameArrows: i,
|
|
11
|
+
classNameActiveArrows: a
|
|
12
12
|
}) => {
|
|
13
|
-
const { table: c, onSorting:
|
|
14
|
-
(t) =>
|
|
15
|
-
[
|
|
16
|
-
), x =
|
|
17
|
-
(t) =>
|
|
18
|
-
[
|
|
13
|
+
const { table: c, onSorting: o } = S(), d = p(
|
|
14
|
+
(t) => o([{ id: t.id, desc: !1 }]),
|
|
15
|
+
[o]
|
|
16
|
+
), x = p(
|
|
17
|
+
(t) => o([{ id: t.id, desc: !0 }]),
|
|
18
|
+
[o]
|
|
19
19
|
);
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
21
|
"thead",
|
|
22
22
|
{
|
|
23
|
-
className:
|
|
24
|
-
"font-semibold uppercase text-slate-500 text-xs not-italic bg-slate-100
|
|
25
|
-
|
|
23
|
+
className: s(
|
|
24
|
+
"font-semibold uppercase text-slate-500 text-xs not-italic bg-slate-100 overflow-hidden [clip-path:inset(-1px_-1px_0px_-1px_round_8px_8px_0px_0px)]",
|
|
25
|
+
n
|
|
26
26
|
),
|
|
27
|
-
children: c.getHeaderGroups().map(({ id: t, headers:
|
|
27
|
+
children: c.getHeaderGroups().map(({ id: t, headers: m }) => /* @__PURE__ */ r("tr", { children: m.map(({ id: f, column: e, getContext: h }) => /* @__PURE__ */ r(
|
|
28
28
|
"th",
|
|
29
29
|
{
|
|
30
30
|
scope: "col",
|
|
31
|
-
className:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
className: s(
|
|
32
|
+
"px-4 py-3 text-left text-xs",
|
|
33
|
+
e.columnDef.meta?.headerClassName
|
|
34
|
+
),
|
|
35
|
+
children: /* @__PURE__ */ l("span", { className: "flex items-center gap-2 w-full", children: [
|
|
36
|
+
g(e.columnDef.header, h()),
|
|
37
|
+
e.getCanSort() && /* @__PURE__ */ l(
|
|
36
38
|
"div",
|
|
37
39
|
{
|
|
38
|
-
className:
|
|
40
|
+
className: s(
|
|
39
41
|
"flex flex-col text-slate-400 justify-center items-center gap-1",
|
|
40
|
-
|
|
42
|
+
i
|
|
41
43
|
),
|
|
42
44
|
role: "presentation",
|
|
43
45
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
u,
|
|
46
48
|
{
|
|
47
|
-
className:
|
|
49
|
+
className: s(
|
|
48
50
|
"w-2 h-2 cursor-pointer",
|
|
49
51
|
{
|
|
50
52
|
"text-blue-600": e.getIsSorted() === "asc"
|
|
51
53
|
},
|
|
52
|
-
|
|
54
|
+
a
|
|
53
55
|
),
|
|
54
56
|
onClick: () => d(e)
|
|
55
57
|
}
|
|
56
58
|
),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
C,
|
|
59
61
|
{
|
|
60
|
-
className:
|
|
62
|
+
className: s(
|
|
61
63
|
"w-2 h-2 cursor-pointer",
|
|
62
64
|
{
|
|
63
65
|
"text-blue-600": e.getIsSorted() === "desc"
|
|
64
66
|
},
|
|
65
|
-
|
|
67
|
+
a
|
|
66
68
|
),
|
|
67
69
|
onClick: () => x(e)
|
|
68
70
|
}
|
|
@@ -72,11 +74,11 @@ const y = ({
|
|
|
72
74
|
)
|
|
73
75
|
] })
|
|
74
76
|
},
|
|
75
|
-
|
|
77
|
+
f
|
|
76
78
|
)) }, t))
|
|
77
79
|
}
|
|
78
80
|
);
|
|
79
81
|
};
|
|
80
82
|
export {
|
|
81
|
-
|
|
83
|
+
D as Header
|
|
82
84
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as t, Fragment as
|
|
2
|
-
import { DotPaginate as
|
|
3
|
-
import { DropdownPaginate as
|
|
4
|
-
import { FormPaginate as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { useTableContext as
|
|
7
|
-
import { DEFAULT_PAGE_SIZE as
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as t, Fragment as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { DotPaginate as p } from "../DotPaginate/DotPaginate.js";
|
|
3
|
+
import { DropdownPaginate as f } from "../DropdownPaginate/DropdownPaginate.js";
|
|
4
|
+
import { FormPaginate as x } from "../FormPaginate/FormPaginate.js";
|
|
5
|
+
import { cn as u } from "../../../../utils/index.js";
|
|
6
|
+
import { useTableContext as g } from "../../contexts/table.hook.js";
|
|
7
|
+
import { DEFAULT_PAGE_SIZE as h } from "../../constants/pagination.js";
|
|
8
|
+
const j = ({
|
|
9
9
|
showTotalItems: a = !0,
|
|
10
10
|
showDropdownPagination: i = !0,
|
|
11
11
|
showDotPagination: n = !0,
|
|
@@ -13,14 +13,21 @@ const F = ({
|
|
|
13
13
|
pageSizes: l,
|
|
14
14
|
classNamePagination: o
|
|
15
15
|
}) => {
|
|
16
|
-
const {
|
|
17
|
-
|
|
16
|
+
const {
|
|
17
|
+
totalItems: r = -1 / 0,
|
|
18
|
+
tableFetching: m,
|
|
19
|
+
isFirstLoad: c
|
|
20
|
+
} = g();
|
|
21
|
+
return r <= h || m ? null : /* @__PURE__ */ t(d, { children: [
|
|
18
22
|
/* @__PURE__ */ e(
|
|
19
23
|
"div",
|
|
20
24
|
{
|
|
21
|
-
className:
|
|
25
|
+
className: u(
|
|
22
26
|
"bg-slate-50 border border-y-transparent border-x-slate-100 text-slate-500 text-xs not-italic py-2 px-6 rounded-b-lg shadow",
|
|
23
|
-
o
|
|
27
|
+
o,
|
|
28
|
+
{
|
|
29
|
+
"animate-in fade-in-10": !c
|
|
30
|
+
}
|
|
24
31
|
),
|
|
25
32
|
children: /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
|
26
33
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-6", children: [
|
|
@@ -28,11 +35,11 @@ const F = ({
|
|
|
28
35
|
r,
|
|
29
36
|
" Results"
|
|
30
37
|
] }) : null,
|
|
31
|
-
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(
|
|
38
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(f, { pageSizes: l }) })
|
|
32
39
|
] }),
|
|
33
40
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-8", children: [
|
|
34
|
-
n && /* @__PURE__ */ e(
|
|
35
|
-
s && /* @__PURE__ */ e(
|
|
41
|
+
n && /* @__PURE__ */ e(p, {}),
|
|
42
|
+
s && /* @__PURE__ */ e(x, {})
|
|
36
43
|
] })
|
|
37
44
|
] })
|
|
38
45
|
}
|
|
@@ -41,5 +48,5 @@ const F = ({
|
|
|
41
48
|
] });
|
|
42
49
|
};
|
|
43
50
|
export {
|
|
44
|
-
|
|
51
|
+
j as Pagination
|
|
45
52
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Button as o } from "../../../Button/Button.js";
|
|
3
|
+
import { cn as t } from "../../../../utils/index.js";
|
|
4
|
+
import { useTableContext as m } from "../../contexts/table.hook.js";
|
|
5
|
+
import { E as d } from "../../../../ellipsis-vertical-BVPtjl5f.js";
|
|
6
|
+
const x = ({ numberOfRows: r, table: s }) => {
|
|
7
|
+
const { tableFetching: l, tableLoading: i } = m();
|
|
8
|
+
return /* @__PURE__ */ e("tbody", { className: "text-slate-800 text-sm font-normal relative", children: Array.from({ length: r }).map((c, n) => /* @__PURE__ */ e(
|
|
9
|
+
"tr",
|
|
10
|
+
{
|
|
11
|
+
className: "border-b border-b-gray-200 bg-white last:border-b-transparent",
|
|
12
|
+
children: s.getAllColumns().map(
|
|
13
|
+
(a) => a.id !== "actions" ? /* @__PURE__ */ e(
|
|
14
|
+
"td",
|
|
15
|
+
{
|
|
16
|
+
className: t("px-4 py-1", a.columnDef.meta?.className),
|
|
17
|
+
children: /* @__PURE__ */ e("div", { className: "animate-in fade-in-0", children: /* @__PURE__ */ e("div", { className: "bg-gray-200 animate-pulse rounded h-5 w-full" }) })
|
|
18
|
+
},
|
|
19
|
+
`skeleton-${a.id}`
|
|
20
|
+
) : /* @__PURE__ */ e(
|
|
21
|
+
"td",
|
|
22
|
+
{
|
|
23
|
+
className: t("px-4 py-1", a.columnDef.meta?.className),
|
|
24
|
+
children: /* @__PURE__ */ e(
|
|
25
|
+
o,
|
|
26
|
+
{
|
|
27
|
+
variant: "text",
|
|
28
|
+
shape: "circle",
|
|
29
|
+
size: "large",
|
|
30
|
+
disabled: !0,
|
|
31
|
+
"aria-hidden": "true",
|
|
32
|
+
children: /* @__PURE__ */ e(
|
|
33
|
+
d,
|
|
34
|
+
{
|
|
35
|
+
className: t("w-5 h-5 text-slate-400", {
|
|
36
|
+
"text-gray-300 animate-pulse": l || i
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
},
|
|
43
|
+
`skeleton-${a.id}`
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
},
|
|
47
|
+
`skeleton-row-${n}`
|
|
48
|
+
)) });
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
x as Skeleton
|
|
52
|
+
};
|