@konstructio/ui 0.1.2-alpha.41 → 0.1.2-alpha.44
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-CtAG97Ts.js → Modal-CjC-CIJ8.js} +2 -2
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/{chevron-up-CRyLc5Ml.js → chevron-up-DEfvgPCw.js} +1 -1
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +75 -49
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +31 -30
- package/dist/components/Badge/Badge.variants.js +53 -16
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Card/Card.variants.js +4 -5
- package/dist/components/Checkbox/Checkbox.js +4 -4
- package/dist/components/Checkbox/Checkbox.variants.js +5 -1
- 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 +1231 -1047
- package/dist/components/Dropdown/Dropdown.js +13 -13
- package/dist/components/Dropdown/Dropdown.variants.js +7 -6
- package/dist/components/Dropdown/components/List/List.js +42 -20
- package/dist/components/Dropdown/components/List/List.variants.js +5 -5
- package/dist/components/Dropdown/components/ListItem/ListItem.js +20 -20
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +2 -2
- package/dist/components/Dropdown/components/Wrapper.js +60 -46
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +6 -5
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +73 -46
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/ResetButton/ResetButton.js +28 -14
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +2 -2
- 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/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +358 -315
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PhoneNumberInput/components/Wrapper.js +58 -58
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +2 -2
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/PieChart.js +4 -4
- 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 +2 -2
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +3 -2
- 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/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +20 -13
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +23 -16
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +8 -8
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +11 -9
- package/dist/components/VirtualizedTable/VirtualizedTable.js +58 -54
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +58 -26
- package/dist/components/VirtualizedTable/components/Body/Body.js +72 -46
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +80 -77
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +37 -40
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +19 -18
- package/dist/components/VirtualizedTable/components/Header/Header.js +49 -31
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +36 -23
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +74 -35
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-mPY_8Y5v.js → index-AV6ZtGhy.js} +1 -1
- package/dist/{index-CigKKiZS.js → index-BG8O18ZY.js} +5 -3
- package/dist/{index-DrWQH0QF.js → index-BKjcReYh.js} +2 -2
- package/dist/{index--V_ZsiQe.js → index-BOE_3f_Z.js} +4 -4
- package/dist/{index-Dbt2vBmS.js → index-BlSRBdPy.js} +1 -1
- package/dist/{index-C3tHPg8y.js → index-BmVmDQGH.js} +2 -2
- package/dist/{index-BtQfgaSF.js → index-BvoZGpli.js} +2 -2
- package/dist/{index-2hB40Iuc.js → index-Byr10W8m.js} +6 -6
- package/dist/index-CPU02rhe.js +134 -0
- package/dist/{index-Ds6U2x4Z.js → index-CeZcoQDw.js} +11 -11
- package/dist/{index-CdwPV0FE.js → index-D9SSJ6om.js} +3 -3
- package/dist/{index-CIAmiWcw.js → index-DKfEnhKr.js} +2 -2
- package/dist/{index-CSFe9uC5.js → index-DMb4KD0b.js} +1 -1
- package/dist/{index-ohdbKsws.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-BbQkJE5L.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-DpW9ExsS.js → index-gSPwC-1I.js} +3 -3
- package/dist/{index-DH2Fnov1.js → index-vcSp8YRZ.js} +4 -4
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/{libphonenumber-_7ZyKWA7.js → libphonenumber-FTwQ9nyV.js} +11 -11
- package/dist/package.json +21 -21
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +11 -10
- package/dist/{x-DPU9OdYH.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +21 -21
- package/dist/chevron-left-C4LEg1fH.js +0 -7
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-C65LtGuU.js +0 -137
|
@@ -1,51 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import { Skeleton as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
7
|
-
isLoading:
|
|
8
|
-
showPagination:
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { f as N } from "../../../../index-CSWGJT-v.js";
|
|
3
|
+
import { Skeleton as h } from "../Skeleton/Skeleton.js";
|
|
4
|
+
import { cn as s } from "../../../../utils/index.js";
|
|
5
|
+
import { useTableContext as y } from "../../contexts/table.hook.js";
|
|
6
|
+
const S = ({
|
|
7
|
+
isLoading: f,
|
|
8
|
+
showPagination: t
|
|
9
9
|
}) => {
|
|
10
|
-
const { table:
|
|
11
|
-
if (
|
|
12
|
-
return /* @__PURE__ */
|
|
13
|
-
const
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
const { table: o, pageSize: i, tableFetching: p } = y();
|
|
11
|
+
if (f || p)
|
|
12
|
+
return /* @__PURE__ */ r(h, { numberOfRows: i, table: o });
|
|
13
|
+
const a = o.getRowModel().rows ?? [];
|
|
14
|
+
return /* @__PURE__ */ r(
|
|
15
|
+
"tbody",
|
|
16
|
+
{
|
|
17
|
+
className: s(
|
|
18
|
+
"text-slate-800",
|
|
19
|
+
"text-sm",
|
|
20
|
+
"font-normal",
|
|
21
|
+
"relative",
|
|
22
|
+
"dark:border-x"
|
|
23
|
+
),
|
|
24
|
+
children: a.map(({ id: l, original: m, getVisibleCells: u }, d) => {
|
|
25
|
+
const { meta: b = {} } = m, n = u();
|
|
26
|
+
return /* @__PURE__ */ r(
|
|
27
|
+
"tr",
|
|
28
|
+
{
|
|
29
|
+
className: s(
|
|
30
|
+
"border-b",
|
|
31
|
+
"border-b-gray-200",
|
|
32
|
+
"dark:text-metal-50",
|
|
33
|
+
"dark:border-b-metal-700",
|
|
34
|
+
"last:border-b-transparent",
|
|
35
|
+
"bg-transparent",
|
|
36
|
+
b.className
|
|
37
|
+
),
|
|
38
|
+
"data-row-id": l,
|
|
39
|
+
...b.attributes ?? {},
|
|
40
|
+
children: n.map(({ id: k, column: e, getContext: g }, c) => {
|
|
41
|
+
const x = typeof e.columnDef.meta?.className == "function" ? e.columnDef.meta?.className(m) : e.columnDef.meta?.className;
|
|
42
|
+
return /* @__PURE__ */ r(
|
|
43
|
+
"td",
|
|
33
44
|
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
className: s(
|
|
46
|
+
"px-4",
|
|
47
|
+
"py-1",
|
|
48
|
+
"text-sm",
|
|
49
|
+
"bg-white",
|
|
50
|
+
"dark:bg-metal-900",
|
|
51
|
+
"dark:border-t",
|
|
52
|
+
"dark:border-metal-700",
|
|
53
|
+
"dark:first:border-l",
|
|
54
|
+
"dark:last:border-r",
|
|
55
|
+
x,
|
|
56
|
+
{
|
|
57
|
+
"first:rounded-bl-lg": d === a.length - 1 && c === 0 && !t,
|
|
58
|
+
"last:rounded-br-lg": d === a.length - 1 && c === n.length - 1 && !t,
|
|
59
|
+
"dark:[tr:last-child_&]:border-b": !t
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
...e.columnDef.meta?.attributes ?? {},
|
|
63
|
+
children: N(e.columnDef.cell, g())
|
|
64
|
+
},
|
|
65
|
+
k
|
|
66
|
+
);
|
|
67
|
+
})
|
|
68
|
+
},
|
|
69
|
+
l
|
|
70
|
+
);
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
);
|
|
48
74
|
};
|
|
49
75
|
export {
|
|
50
|
-
|
|
76
|
+
S as Body
|
|
51
77
|
};
|
|
@@ -1,165 +1,168 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as s, jsxs as h } 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
|
|
4
|
+
import { C as m, a as g } from "../../../../chevron-right-DYvXLeql.js";
|
|
5
5
|
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
6
|
-
const
|
|
6
|
+
const a = u(
|
|
7
7
|
({
|
|
8
8
|
index: e,
|
|
9
9
|
currentPage: t,
|
|
10
|
-
handlePage:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
10
|
+
handlePage: i
|
|
11
|
+
}) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ s(
|
|
12
12
|
"button",
|
|
13
13
|
{
|
|
14
14
|
type: "button",
|
|
15
|
-
onClick: () =>
|
|
16
|
-
className: p(
|
|
17
|
-
"
|
|
18
|
-
|
|
15
|
+
onClick: () => i(e),
|
|
16
|
+
className: p(
|
|
17
|
+
"px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500",
|
|
18
|
+
{
|
|
19
|
+
"bg-blue-600 text-white dark:bg-aurora-500 dark:text-metal-800": e === t
|
|
20
|
+
}
|
|
21
|
+
),
|
|
19
22
|
children: e + 1
|
|
20
23
|
}
|
|
21
24
|
) }, e)
|
|
22
25
|
);
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
26
|
+
a.displayName = "PageButton";
|
|
27
|
+
const n = u(({ keyValue: e }) => /* @__PURE__ */ s("li", { className: "px-2", children: /* @__PURE__ */ s("span", { className: "text-blue-600 select-none dark:text-aurora-500", children: "..." }) }, e));
|
|
28
|
+
n.displayName = "Ellipsis";
|
|
29
|
+
const o = u(
|
|
27
30
|
({
|
|
28
31
|
direction: e,
|
|
29
32
|
onClick: t,
|
|
30
|
-
disabled:
|
|
31
|
-
}) => /* @__PURE__ */
|
|
32
|
-
e === "left" ?
|
|
33
|
+
disabled: i
|
|
34
|
+
}) => /* @__PURE__ */ s("li", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("button", { onClick: t, disabled: i, children: /* @__PURE__ */ s(
|
|
35
|
+
e === "left" ? m : g,
|
|
33
36
|
{
|
|
34
37
|
className: p("h-6 w-6 cursor-pointer", {
|
|
35
|
-
"text-blue-600": !
|
|
36
|
-
"text-slate-400 cursor-not-allowed":
|
|
38
|
+
"text-blue-600 dark:text-aurora-500": !i,
|
|
39
|
+
"text-slate-400 cursor-not-allowed": i
|
|
37
40
|
})
|
|
38
41
|
}
|
|
39
42
|
) }) })
|
|
40
43
|
);
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const { totalPages: e, page: t, handlePage:
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
44
|
+
o.displayName = "NavigationButton";
|
|
45
|
+
const N = () => {
|
|
46
|
+
const { totalPages: e, page: t, handlePage: i } = f();
|
|
47
|
+
return /* @__PURE__ */ h("ul", { className: "flex items-center gap-2", children: [
|
|
48
|
+
/* @__PURE__ */ s(
|
|
49
|
+
o,
|
|
47
50
|
{
|
|
48
51
|
direction: "left",
|
|
49
|
-
onClick: () =>
|
|
52
|
+
onClick: () => i(t - 1),
|
|
50
53
|
disabled: t === 0
|
|
51
54
|
}
|
|
52
55
|
),
|
|
53
56
|
(() => {
|
|
54
57
|
if (e <= 5)
|
|
55
|
-
return Array.from({ length: e }, (
|
|
56
|
-
|
|
58
|
+
return Array.from({ length: e }, (r, c) => /* @__PURE__ */ s(
|
|
59
|
+
a,
|
|
57
60
|
{
|
|
58
61
|
index: c,
|
|
59
62
|
currentPage: t,
|
|
60
|
-
handlePage:
|
|
63
|
+
handlePage: i
|
|
61
64
|
},
|
|
62
65
|
c
|
|
63
66
|
));
|
|
64
|
-
const
|
|
67
|
+
const l = [];
|
|
65
68
|
if (t < 3) {
|
|
66
|
-
for (let
|
|
67
|
-
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
69
|
+
for (let r = 0; r < 3; r++)
|
|
70
|
+
l.push(
|
|
71
|
+
/* @__PURE__ */ s(
|
|
72
|
+
a,
|
|
70
73
|
{
|
|
71
|
-
index:
|
|
74
|
+
index: r,
|
|
72
75
|
currentPage: t,
|
|
73
|
-
handlePage:
|
|
76
|
+
handlePage: i
|
|
74
77
|
},
|
|
75
|
-
|
|
78
|
+
r
|
|
76
79
|
)
|
|
77
80
|
);
|
|
78
|
-
|
|
79
|
-
for (let
|
|
80
|
-
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
81
|
+
l.push(/* @__PURE__ */ s(n, { keyValue: "ellipsis" }, "ellipsis"));
|
|
82
|
+
for (let r = e - 2; r < e; r++)
|
|
83
|
+
l.push(
|
|
84
|
+
/* @__PURE__ */ s(
|
|
85
|
+
a,
|
|
83
86
|
{
|
|
84
|
-
index:
|
|
87
|
+
index: r,
|
|
85
88
|
currentPage: t,
|
|
86
|
-
handlePage:
|
|
89
|
+
handlePage: i
|
|
87
90
|
},
|
|
88
|
-
|
|
91
|
+
r
|
|
89
92
|
)
|
|
90
93
|
);
|
|
91
94
|
} else if (t >= e - 5) {
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
+
l.push(
|
|
96
|
+
/* @__PURE__ */ s(
|
|
97
|
+
a,
|
|
95
98
|
{
|
|
96
99
|
index: 0,
|
|
97
100
|
currentPage: t,
|
|
98
|
-
handlePage:
|
|
101
|
+
handlePage: i
|
|
99
102
|
},
|
|
100
103
|
0
|
|
101
104
|
)
|
|
102
|
-
), e > 6 &&
|
|
103
|
-
for (let
|
|
104
|
-
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
105
|
+
), e > 6 && l.push(/* @__PURE__ */ s(n, { keyValue: "ellipsis" }, "ellipsis"));
|
|
106
|
+
for (let r = Math.max(1, e - 5); r < e; r++)
|
|
107
|
+
l.push(
|
|
108
|
+
/* @__PURE__ */ s(
|
|
109
|
+
a,
|
|
107
110
|
{
|
|
108
|
-
index:
|
|
111
|
+
index: r,
|
|
109
112
|
currentPage: t,
|
|
110
|
-
handlePage:
|
|
113
|
+
handlePage: i
|
|
111
114
|
},
|
|
112
|
-
|
|
115
|
+
r
|
|
113
116
|
)
|
|
114
117
|
);
|
|
115
118
|
} else {
|
|
116
|
-
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
+
l.push(
|
|
120
|
+
/* @__PURE__ */ s(
|
|
121
|
+
a,
|
|
119
122
|
{
|
|
120
123
|
index: 0,
|
|
121
124
|
currentPage: t,
|
|
122
|
-
handlePage:
|
|
125
|
+
handlePage: i
|
|
123
126
|
},
|
|
124
127
|
0
|
|
125
128
|
)
|
|
126
|
-
), t > 3 &&
|
|
127
|
-
for (let
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
129
|
+
), t > 3 && l.push(/* @__PURE__ */ s(n, { keyValue: "ellipsis1" }, "ellipsis1"));
|
|
130
|
+
for (let r = t - 1; r <= t + 1; r++)
|
|
131
|
+
r > 0 && r < e - 1 && l.push(
|
|
132
|
+
/* @__PURE__ */ s(
|
|
133
|
+
a,
|
|
131
134
|
{
|
|
132
|
-
index:
|
|
135
|
+
index: r,
|
|
133
136
|
currentPage: t,
|
|
134
|
-
handlePage:
|
|
137
|
+
handlePage: i
|
|
135
138
|
},
|
|
136
|
-
|
|
139
|
+
r
|
|
137
140
|
)
|
|
138
141
|
);
|
|
139
|
-
t < e - 4 &&
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
+
t < e - 4 && l.push(/* @__PURE__ */ s(n, { keyValue: "ellipsis2" }, "ellipsis2")), l.push(
|
|
143
|
+
/* @__PURE__ */ s(
|
|
144
|
+
a,
|
|
142
145
|
{
|
|
143
146
|
index: e - 1,
|
|
144
147
|
currentPage: t,
|
|
145
|
-
handlePage:
|
|
148
|
+
handlePage: i
|
|
146
149
|
},
|
|
147
150
|
e - 1
|
|
148
151
|
)
|
|
149
152
|
);
|
|
150
153
|
}
|
|
151
|
-
return
|
|
154
|
+
return l;
|
|
152
155
|
})(),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
156
|
+
/* @__PURE__ */ s(
|
|
157
|
+
o,
|
|
155
158
|
{
|
|
156
159
|
direction: "right",
|
|
157
|
-
onClick: () =>
|
|
160
|
+
onClick: () => i(t + 1),
|
|
158
161
|
disabled: t >= e - 1
|
|
159
162
|
}
|
|
160
163
|
)
|
|
161
164
|
] });
|
|
162
165
|
};
|
|
163
166
|
export {
|
|
164
|
-
|
|
167
|
+
N as DotPaginate
|
|
165
168
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { Dropdown as
|
|
4
|
-
import { DEFAULT_PAGE_SIZES as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
7
|
-
pageSizes:
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l, useCallback as p } from "react";
|
|
3
|
+
import { Dropdown as g } from "../../../Dropdown/Dropdown.js";
|
|
4
|
+
import { DEFAULT_PAGE_SIZES as c } from "../../constants/pagination.js";
|
|
5
|
+
import { useTableContext as d } from "../../contexts/table.hook.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
pageSizes: r = c
|
|
8
8
|
}) => {
|
|
9
|
-
const { pageSize:
|
|
10
|
-
() =>
|
|
9
|
+
const { pageSize: n, onPageSize: t, handlePage: a } = d(), s = l(
|
|
10
|
+
() => r.map(String).map((e) => ({ label: e, value: e })),
|
|
11
11
|
[]
|
|
12
|
-
), m =
|
|
12
|
+
), m = p(
|
|
13
13
|
(e) => {
|
|
14
|
-
|
|
14
|
+
t(Number(e)), a(0);
|
|
15
15
|
},
|
|
16
|
-
[
|
|
16
|
+
[a, t]
|
|
17
17
|
);
|
|
18
|
-
return /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: "flex items-center gap-2 dark:text-metal-300", children: [
|
|
19
|
+
/* @__PURE__ */ o("span", { children: "Show" }),
|
|
20
|
+
/* @__PURE__ */ o(
|
|
21
|
+
g,
|
|
22
22
|
{
|
|
23
23
|
className: "w-22 [&>div>p]:text-xs bg-white",
|
|
24
|
-
listItemClassName: "[&>p]:text-xs",
|
|
25
|
-
options:
|
|
26
|
-
value:
|
|
24
|
+
listItemClassName: "[&>p]:text-xs dark:bg-metal-800",
|
|
25
|
+
options: s,
|
|
26
|
+
value: n.toString(),
|
|
27
27
|
onChange: ({ target: e }) => m(e.value)
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
] });
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
u as DropdownPaginate
|
|
34
34
|
};
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
import { jsxs as m, jsx as
|
|
2
|
-
import { d as
|
|
3
|
-
import { useRef as
|
|
1
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { d as R } from "../../../../debounce-BFejQm9P.js";
|
|
3
|
+
import { useRef as v, useCallback as u, useMemo as p } from "react";
|
|
4
4
|
import { Button as y } from "../../../Button/Button.js";
|
|
5
|
-
import { Filter as
|
|
5
|
+
import { Filter as l } from "../../../Filter/Filter.js";
|
|
6
6
|
import { Input as B } from "../../../Input/Input.js";
|
|
7
7
|
import { cn as N } from "../../../../utils/index.js";
|
|
8
8
|
import { useTableContext as T } from "../../contexts/table.hook.js";
|
|
9
9
|
const E = ({
|
|
10
10
|
actions: f,
|
|
11
|
-
multiSelectFilter:
|
|
12
|
-
placeholder:
|
|
11
|
+
multiSelectFilter: h,
|
|
12
|
+
placeholder: d,
|
|
13
13
|
showFilterInput: g = !0,
|
|
14
|
-
showResetButton:
|
|
15
|
-
resetButtonClassName:
|
|
14
|
+
showResetButton: C = !0,
|
|
15
|
+
resetButtonClassName: S
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
termOfSearch:
|
|
17
|
+
const o = v(null), {
|
|
18
|
+
termOfSearch: s,
|
|
19
19
|
multiselectSelected: c,
|
|
20
|
-
onChangeTermOfSearch:
|
|
20
|
+
onChangeTermOfSearch: n,
|
|
21
21
|
onSelectMultiselect: i
|
|
22
|
-
} = T(),
|
|
22
|
+
} = T(), x = u(
|
|
23
23
|
(e, t) => i(
|
|
24
24
|
e,
|
|
25
25
|
t.map((r) => r.id)
|
|
26
26
|
),
|
|
27
27
|
[i]
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
() =>
|
|
32
|
-
|
|
28
|
+
), F = u(() => {
|
|
29
|
+
n(""), o.current && (o.current.value = "");
|
|
30
|
+
}, [n]), M = p(
|
|
31
|
+
() => R((e) => {
|
|
32
|
+
n(e.target.value);
|
|
33
33
|
}, 500),
|
|
34
|
-
[
|
|
35
|
-
),
|
|
36
|
-
() => !!
|
|
37
|
-
[
|
|
34
|
+
[n]
|
|
35
|
+
), b = p(
|
|
36
|
+
() => !!s || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
|
|
37
|
+
[s, c]
|
|
38
38
|
);
|
|
39
39
|
return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
40
|
-
g && /* @__PURE__ */
|
|
40
|
+
g && /* @__PURE__ */ a(
|
|
41
41
|
B,
|
|
42
42
|
{
|
|
43
|
-
ref:
|
|
44
|
-
placeholder:
|
|
43
|
+
ref: o,
|
|
44
|
+
placeholder: d,
|
|
45
45
|
isSearch: !0,
|
|
46
46
|
autoComplete: "false",
|
|
47
47
|
className: "w-72",
|
|
48
48
|
inputMode: "search",
|
|
49
|
-
onChange:
|
|
49
|
+
onChange: M
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */ m(
|
|
53
|
-
|
|
54
|
-
({ key: e, label: t, position: r = "right", options: j }) => /* @__PURE__ */
|
|
55
|
-
|
|
52
|
+
/* @__PURE__ */ m(l, { children: [
|
|
53
|
+
h?.map(
|
|
54
|
+
({ key: e, label: t, position: r = "right", options: j }) => /* @__PURE__ */ a(
|
|
55
|
+
l.BadgeMultiSelect,
|
|
56
56
|
{
|
|
57
57
|
label: t,
|
|
58
58
|
position: r,
|
|
59
59
|
options: j,
|
|
60
|
-
onApply: (
|
|
61
|
-
|
|
60
|
+
onApply: (O) => {
|
|
61
|
+
x(e, O);
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
t
|
|
65
65
|
)
|
|
66
66
|
),
|
|
67
|
-
f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */
|
|
67
|
+
f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ a(
|
|
68
68
|
y,
|
|
69
69
|
{
|
|
70
70
|
variant: r,
|
|
@@ -74,15 +74,12 @@ const E = ({
|
|
|
74
74
|
},
|
|
75
75
|
e
|
|
76
76
|
)),
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
C && /* @__PURE__ */ a(
|
|
78
|
+
l.ResetButton,
|
|
79
79
|
{
|
|
80
|
-
className: N(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
),
|
|
84
|
-
disabled: !M,
|
|
85
|
-
onClick: b
|
|
80
|
+
className: N("select-none", S),
|
|
81
|
+
disabled: !b,
|
|
82
|
+
onClick: F
|
|
86
83
|
}
|
|
87
84
|
)
|
|
88
85
|
] })
|
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Input as
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as i, useCallback as p } from "react";
|
|
3
|
+
import { Input as c } from "../../../Input/Input.js";
|
|
4
4
|
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
5
|
-
const
|
|
6
|
-
const r =
|
|
7
|
-
(
|
|
8
|
-
|
|
9
|
-
const s = new FormData(
|
|
10
|
-
|
|
5
|
+
const k = () => {
|
|
6
|
+
const r = i(null), { totalPages: e, handlePage: a } = f(), n = p(
|
|
7
|
+
(o) => {
|
|
8
|
+
o.preventDefault();
|
|
9
|
+
const s = new FormData(o.currentTarget), m = Number(s.get("jump-to")), l = (m < e ? m : e) || 1;
|
|
10
|
+
a(l - 1), r.current?.reset();
|
|
11
11
|
},
|
|
12
|
-
[
|
|
12
|
+
[a, e]
|
|
13
13
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ u(
|
|
15
15
|
"form",
|
|
16
16
|
{
|
|
17
17
|
"aria-label": "footer-pagination",
|
|
18
18
|
ref: r,
|
|
19
|
-
onSubmit:
|
|
19
|
+
onSubmit: n,
|
|
20
20
|
className: "flex items-center gap-2",
|
|
21
21
|
children: [
|
|
22
|
-
/* @__PURE__ */ t("span", { className: "min-w-fit", children: "Jump to" }),
|
|
22
|
+
/* @__PURE__ */ t("span", { className: "min-w-fit dark:text-metal-300", children: "Jump to" }),
|
|
23
23
|
/* @__PURE__ */ t(
|
|
24
|
-
|
|
24
|
+
c,
|
|
25
25
|
{
|
|
26
26
|
type: "number",
|
|
27
|
-
className: "w-18 text-xs no-spinner",
|
|
27
|
+
className: "w-18 text-xs no-spinner dark:bg-metal-800 dark:border-metal-700 dark:text-metal-300",
|
|
28
28
|
name: "jump-to",
|
|
29
29
|
min: 1,
|
|
30
30
|
max: e,
|
|
31
|
-
required: !0
|
|
31
|
+
required: !0,
|
|
32
|
+
autoComplete: "off"
|
|
32
33
|
}
|
|
33
34
|
),
|
|
34
35
|
/* @__PURE__ */ t(
|
|
35
36
|
"button",
|
|
36
37
|
{
|
|
37
38
|
type: "submit",
|
|
38
|
-
className: "text-xs text-blue-600 p-2 cursor-pointer",
|
|
39
|
+
className: "text-xs text-blue-600 p-2 cursor-pointer dark:text-aurora-500",
|
|
39
40
|
children: "Go"
|
|
40
41
|
}
|
|
41
42
|
)
|
|
@@ -44,5 +45,5 @@ const h = () => {
|
|
|
44
45
|
);
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
k as FormPaginate
|
|
48
49
|
};
|