@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.51
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/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
- package/dist/DatePicker.css +1 -1
- package/dist/Modal-CjC-CIJ8.js +99 -0
- package/dist/assets/icons/index.js +7 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -0
- package/dist/chevron-up-DEfvgPCw.js +54 -0
- package/dist/chevron-up-DrQr2Fwd.js +5 -0
- package/dist/components/Alert/Alert.js +2 -2
- package/dist/components/AlertDialog/AlertDialog.js +81 -53
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +41 -44
- package/dist/components/Badge/Badge.variants.js +52 -13
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +108 -98
- package/dist/components/Card/Card.variants.js +7 -12
- package/dist/components/Checkbox/Checkbox.js +108 -105
- package/dist/components/Checkbox/Checkbox.variants.js +34 -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/Counter/Counter.js +210 -0
- package/dist/components/Counter/Counter.variants.js +70 -0
- package/dist/components/Datepicker/DatePicker.js +1587 -1353
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.js +1 -1
- package/dist/components/Filter/Filter.variants.js +8 -7
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
- package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
- package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
- package/dist/components/Filter/events/index.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.js +221 -0
- package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
- package/dist/components/Input/Input.js +185 -118
- package/dist/components/Input/Input.variants.js +24 -19
- package/dist/components/Loading/Loading.js +1 -7
- package/dist/components/Modal/Modal.js +2 -2
- 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 +4 -4
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
- package/dist/components/MultiSelectDropdown/components/index.js +8 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
- package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
- package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
- package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
- package/dist/components/PhoneNumberInput/components/index.js +6 -0
- package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
- package/dist/components/PhoneNumberInput/utils/index.js +11 -0
- package/dist/components/PieChart/PieChart.js +463 -482
- package/dist/components/Radio/Radio.js +47 -44
- package/dist/components/Radio/Radio.variants.js +12 -8
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +10 -10
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
- package/dist/components/Select/components/List/List.js +172 -0
- package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
- package/dist/components/Select/components/ListItem/ListItem.js +117 -0
- package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
- package/dist/components/Select/components/Wrapper.js +226 -0
- package/dist/components/Select/constants/index.js +4 -0
- package/dist/components/Select/constants/pagination.js +4 -0
- package/dist/components/Select/contexts/index.js +6 -0
- package/dist/components/Select/contexts/select.context.js +36 -0
- package/dist/components/Select/contexts/select.hook.js +11 -0
- package/dist/components/Select/contexts/select.provider.js +58 -0
- package/dist/components/Select/hooks/useNavigationList.js +50 -0
- package/dist/components/Select/hooks/useSelect.js +103 -0
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +156 -129
- package/dist/components/Switch/Switch.variants.js +19 -10
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -3
- 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/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimePicker/TimePicker.variants.js +26 -14
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
- package/dist/components/Toast/Toast.js +283 -256
- package/dist/components/Toast/Toast.variants.js +37 -24
- package/dist/components/Tooltip/Tooltip.js +15 -14
- package/dist/components/Tooltip/Tooltip.variants.js +5 -4
- package/dist/components/Typography/Typography.js +23 -25
- package/dist/components/Typography/Typography.variants.js +55 -52
- package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
- package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
- package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
- 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 +68 -761
- package/dist/components/index.js +94 -86
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
- package/dist/index-BG8O18ZY.js +93 -0
- package/dist/index-BKjcReYh.js +55 -0
- package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
- package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
- package/dist/index-BmVmDQGH.js +662 -0
- package/dist/index-BvoZGpli.js +60 -0
- package/dist/index-Byr10W8m.js +1873 -0
- package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
- package/dist/index-CeZcoQDw.js +479 -0
- package/dist/index-D6KzX_ef.js +135 -0
- package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
- package/dist/index-DKfEnhKr.js +200 -0
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
- package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
- package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
- package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
- package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
- package/dist/index.d.ts +2142 -99
- package/dist/index.js +116 -106
- package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +43 -33
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +194 -168
- package/dist/ui/theme.css +27 -0
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/x-BXShoIAM.js +8 -0
- package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
- package/package.json +43 -33
- package/dist/Modal-D-NOEWMX.js +0 -98
- package/dist/chevron-down-MZvQoT2F.js +0 -11
- package/dist/chevron-right-VYBOBhRt.js +0 -19
- package/dist/components/Dropdown/Dropdown.js +0 -42
- package/dist/components/Dropdown/components/List/List.js +0 -79
- package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
- package/dist/components/Dropdown/components/Wrapper.js +0 -205
- package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
- package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
- package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
- package/dist/components/Dropdown/contexts/index.js +0 -6
- package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
- package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
- package/dist/components/NumberInput/NumberInput.js +0 -179
- package/dist/components/NumberInput/NumberInput.variants.js +0 -50
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
- package/dist/index-BITvcJAz.js +0 -423
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DBbEcSUG.js +0 -31
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-DzIBBMjs.js +0 -436
- package/dist/index-os7vysFS.js +0 -131
- /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
- /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
|
@@ -1,25 +1,77 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { f as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
}) => {
|
|
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",
|
|
8
16
|
{
|
|
9
|
-
className:
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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",
|
|
44
|
+
{
|
|
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
|
+
);
|
|
22
74
|
};
|
|
23
75
|
export {
|
|
24
|
-
|
|
76
|
+
S as Body
|
|
25
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 l = u(
|
|
7
7
|
({
|
|
8
|
-
index:
|
|
9
|
-
currentPage:
|
|
10
|
-
handlePage:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
8
|
+
index: t,
|
|
9
|
+
currentPage: e,
|
|
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
|
-
|
|
19
|
-
|
|
15
|
+
onClick: () => i(t),
|
|
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 font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
children: t + 1
|
|
20
23
|
}
|
|
21
|
-
) },
|
|
24
|
+
) }, t)
|
|
22
25
|
);
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const
|
|
26
|
+
l.displayName = "KonstructPageButton";
|
|
27
|
+
const a = u(({ keyValue: t }) => /* @__PURE__ */ s("li", { className: "px-2", children: /* @__PURE__ */ s("span", { className: "text-blue-600 select-none dark:text-aurora-500", children: "..." }) }, t));
|
|
28
|
+
a.displayName = "KonstructEllipsis";
|
|
29
|
+
const o = u(
|
|
27
30
|
({
|
|
28
|
-
direction:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}) => /* @__PURE__ */
|
|
32
|
-
|
|
31
|
+
direction: t,
|
|
32
|
+
disabled: e,
|
|
33
|
+
onClick: i
|
|
34
|
+
}) => /* @__PURE__ */ s("li", { className: "flex items-center justify-center", children: /* @__PURE__ */ s("button", { onClick: i, disabled: e, children: /* @__PURE__ */ s(
|
|
35
|
+
t === "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": !e,
|
|
39
|
+
"text-slate-400 cursor-not-allowed": e
|
|
37
40
|
})
|
|
38
41
|
}
|
|
39
42
|
) }) })
|
|
40
43
|
);
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const { totalPages:
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
44
|
+
o.displayName = "KonstructNavigationButton";
|
|
45
|
+
const N = () => {
|
|
46
|
+
const { totalPages: t, page: e, 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: () =>
|
|
50
|
-
disabled:
|
|
52
|
+
onClick: () => i(e - 1),
|
|
53
|
+
disabled: e === 0
|
|
51
54
|
}
|
|
52
55
|
),
|
|
53
56
|
(() => {
|
|
54
|
-
if (
|
|
55
|
-
return Array.from({ length:
|
|
56
|
-
|
|
57
|
+
if (t <= 5)
|
|
58
|
+
return Array.from({ length: t }, (r, c) => /* @__PURE__ */ s(
|
|
59
|
+
l,
|
|
57
60
|
{
|
|
58
61
|
index: c,
|
|
59
|
-
currentPage:
|
|
60
|
-
handlePage:
|
|
62
|
+
currentPage: e,
|
|
63
|
+
handlePage: i
|
|
61
64
|
},
|
|
62
65
|
c
|
|
63
66
|
));
|
|
64
67
|
const n = [];
|
|
65
|
-
if (
|
|
66
|
-
for (let
|
|
68
|
+
if (e < 3) {
|
|
69
|
+
for (let r = 0; r < 3; r++)
|
|
67
70
|
n.push(
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
|
|
71
|
+
/* @__PURE__ */ s(
|
|
72
|
+
l,
|
|
70
73
|
{
|
|
71
|
-
index:
|
|
72
|
-
currentPage:
|
|
73
|
-
handlePage:
|
|
74
|
+
index: r,
|
|
75
|
+
currentPage: e,
|
|
76
|
+
handlePage: i
|
|
74
77
|
},
|
|
75
|
-
|
|
78
|
+
r
|
|
76
79
|
)
|
|
77
80
|
);
|
|
78
|
-
n.push(/* @__PURE__ */
|
|
79
|
-
for (let
|
|
81
|
+
n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis" }, "ellipsis"));
|
|
82
|
+
for (let r = t - 2; r < t; r++)
|
|
80
83
|
n.push(
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
84
|
+
/* @__PURE__ */ s(
|
|
85
|
+
l,
|
|
83
86
|
{
|
|
84
|
-
index:
|
|
85
|
-
currentPage:
|
|
86
|
-
handlePage:
|
|
87
|
+
index: r,
|
|
88
|
+
currentPage: e,
|
|
89
|
+
handlePage: i
|
|
87
90
|
},
|
|
88
|
-
|
|
91
|
+
r
|
|
89
92
|
)
|
|
90
93
|
);
|
|
91
|
-
} else if (
|
|
94
|
+
} else if (e >= t - 5) {
|
|
92
95
|
n.push(
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
96
|
+
/* @__PURE__ */ s(
|
|
97
|
+
l,
|
|
95
98
|
{
|
|
96
99
|
index: 0,
|
|
97
|
-
currentPage:
|
|
98
|
-
handlePage:
|
|
100
|
+
currentPage: e,
|
|
101
|
+
handlePage: i
|
|
99
102
|
},
|
|
100
103
|
0
|
|
101
104
|
)
|
|
102
|
-
),
|
|
103
|
-
for (let
|
|
105
|
+
), t > 6 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis" }, "ellipsis"));
|
|
106
|
+
for (let r = Math.max(1, t - 5); r < t; r++)
|
|
104
107
|
n.push(
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
108
|
+
/* @__PURE__ */ s(
|
|
109
|
+
l,
|
|
107
110
|
{
|
|
108
|
-
index:
|
|
109
|
-
currentPage:
|
|
110
|
-
handlePage:
|
|
111
|
+
index: r,
|
|
112
|
+
currentPage: e,
|
|
113
|
+
handlePage: i
|
|
111
114
|
},
|
|
112
|
-
|
|
115
|
+
r
|
|
113
116
|
)
|
|
114
117
|
);
|
|
115
118
|
} else {
|
|
116
119
|
n.push(
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
120
|
+
/* @__PURE__ */ s(
|
|
121
|
+
l,
|
|
119
122
|
{
|
|
120
123
|
index: 0,
|
|
121
|
-
currentPage:
|
|
122
|
-
handlePage:
|
|
124
|
+
currentPage: e,
|
|
125
|
+
handlePage: i
|
|
123
126
|
},
|
|
124
127
|
0
|
|
125
128
|
)
|
|
126
|
-
),
|
|
127
|
-
for (let
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
|
|
129
|
+
), e > 3 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis1" }, "ellipsis1"));
|
|
130
|
+
for (let r = e - 1; r <= e + 1; r++)
|
|
131
|
+
r > 0 && r < t - 1 && n.push(
|
|
132
|
+
/* @__PURE__ */ s(
|
|
133
|
+
l,
|
|
131
134
|
{
|
|
132
|
-
index:
|
|
133
|
-
currentPage:
|
|
134
|
-
handlePage:
|
|
135
|
+
index: r,
|
|
136
|
+
currentPage: e,
|
|
137
|
+
handlePage: i
|
|
135
138
|
},
|
|
136
|
-
|
|
139
|
+
r
|
|
137
140
|
)
|
|
138
141
|
);
|
|
139
|
-
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
+
e < t - 4 && n.push(/* @__PURE__ */ s(a, { keyValue: "ellipsis2" }, "ellipsis2")), n.push(
|
|
143
|
+
/* @__PURE__ */ s(
|
|
144
|
+
l,
|
|
142
145
|
{
|
|
143
|
-
index:
|
|
144
|
-
currentPage:
|
|
145
|
-
handlePage:
|
|
146
|
+
index: t - 1,
|
|
147
|
+
currentPage: e,
|
|
148
|
+
handlePage: i
|
|
146
149
|
},
|
|
147
|
-
|
|
150
|
+
t - 1
|
|
148
151
|
)
|
|
149
152
|
);
|
|
150
153
|
}
|
|
151
154
|
return n;
|
|
152
155
|
})(),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
156
|
+
/* @__PURE__ */ s(
|
|
157
|
+
o,
|
|
155
158
|
{
|
|
156
159
|
direction: "right",
|
|
157
|
-
onClick: () =>
|
|
158
|
-
disabled:
|
|
160
|
+
onClick: () => i(e + 1),
|
|
161
|
+
disabled: e >= t - 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 {
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as l, useCallback as p } from "react";
|
|
3
|
+
import { Select as c } from "../../../Select/Select.js";
|
|
4
4
|
import { DEFAULT_PAGE_SIZES as g } from "../../constants/pagination.js";
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
const
|
|
7
|
-
pageSizes:
|
|
5
|
+
import { useTableContext as d } from "../../contexts/table.hook.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
pageSizes: m = g
|
|
8
8
|
}) => {
|
|
9
|
-
const { pageSize:
|
|
10
|
-
() =>
|
|
9
|
+
const { pageSize: r, onPageSize: t, handlePage: a } = d(), s = l(
|
|
10
|
+
() => m.map(String).map((e) => ({ label: e, value: e })),
|
|
11
11
|
[]
|
|
12
|
-
),
|
|
12
|
+
), n = 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__ */
|
|
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
21
|
c,
|
|
22
22
|
{
|
|
23
|
-
className: "w-
|
|
24
|
-
listItemClassName: "[&>p]:text-
|
|
25
|
-
options:
|
|
26
|
-
value:
|
|
27
|
-
onChange: ({ target: e }) =>
|
|
23
|
+
className: "w-22 [&>div>p]:text-sm bg-white",
|
|
24
|
+
listItemClassName: "[&>p]:text-sm dark:bg-metal-800",
|
|
25
|
+
options: s,
|
|
26
|
+
value: r.toString(),
|
|
27
|
+
onChange: ({ target: e }) => n(e.value)
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
] });
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
u as DropdownPaginate
|
|
34
34
|
};
|
|
@@ -1,73 +1,90 @@
|
|
|
1
1
|
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { d as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { d as R } from "../../../../debounce-BFejQm9P.js";
|
|
3
|
+
import { useRef as v, useCallback as u, useMemo as p } from "react";
|
|
4
|
+
import { Button as y } from "../../../Button/Button.js";
|
|
5
|
+
import { Filter as l } from "../../../Filter/Filter.js";
|
|
6
|
+
import { Input as B } from "../../../Input/Input.js";
|
|
7
|
+
import { cn as N } from "../../../../utils/index.js";
|
|
8
|
+
import { useTableContext as T } from "../../contexts/table.hook.js";
|
|
9
|
+
const E = ({
|
|
10
|
+
actions: f,
|
|
11
|
+
multiSelectFilter: h,
|
|
12
|
+
placeholder: d,
|
|
13
|
+
showFilterInput: g = !0,
|
|
14
|
+
showResetButton: C = !0,
|
|
15
|
+
resetButtonClassName: S
|
|
11
16
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
termOfSearch:
|
|
17
|
+
const o = v(null), {
|
|
18
|
+
termOfSearch: s,
|
|
14
19
|
multiselectSelected: c,
|
|
15
|
-
onChangeTermOfSearch:
|
|
20
|
+
onChangeTermOfSearch: n,
|
|
16
21
|
onSelectMultiselect: i
|
|
17
|
-
} =
|
|
18
|
-
(e,
|
|
22
|
+
} = T(), x = u(
|
|
23
|
+
(e, t) => i(
|
|
19
24
|
e,
|
|
20
|
-
|
|
25
|
+
t.map((r) => r.id)
|
|
21
26
|
),
|
|
22
27
|
[i]
|
|
23
|
-
),
|
|
24
|
-
|
|
25
|
-
}, [
|
|
26
|
-
() =>
|
|
27
|
-
|
|
28
|
+
), F = u(() => {
|
|
29
|
+
n(""), o.current && (o.current.value = "");
|
|
30
|
+
}, [n]), M = p(
|
|
31
|
+
() => R((e) => {
|
|
32
|
+
n(e.target.value);
|
|
28
33
|
}, 500),
|
|
29
|
-
[
|
|
30
|
-
),
|
|
31
|
-
() => !!
|
|
32
|
-
[
|
|
34
|
+
[n]
|
|
35
|
+
), b = p(
|
|
36
|
+
() => !!s || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
|
|
37
|
+
[s, c]
|
|
33
38
|
);
|
|
34
39
|
return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
g && /* @__PURE__ */ a(
|
|
41
|
+
B,
|
|
37
42
|
{
|
|
38
|
-
ref:
|
|
39
|
-
placeholder:
|
|
43
|
+
ref: o,
|
|
44
|
+
placeholder: d,
|
|
40
45
|
isSearch: !0,
|
|
41
46
|
autoComplete: "false",
|
|
42
47
|
className: "w-72",
|
|
43
48
|
inputMode: "search",
|
|
44
|
-
onChange:
|
|
49
|
+
onChange: M
|
|
45
50
|
}
|
|
46
51
|
),
|
|
47
|
-
/* @__PURE__ */ m(
|
|
48
|
-
|
|
49
|
-
({ key: e, label:
|
|
50
|
-
|
|
52
|
+
/* @__PURE__ */ m(l, { children: [
|
|
53
|
+
h?.map(
|
|
54
|
+
({ key: e, label: t, position: r = "right", options: j }) => /* @__PURE__ */ a(
|
|
55
|
+
l.BadgeMultiSelect,
|
|
51
56
|
{
|
|
52
|
-
label:
|
|
53
|
-
position:
|
|
54
|
-
options:
|
|
55
|
-
onApply: (
|
|
57
|
+
label: t,
|
|
58
|
+
position: r,
|
|
59
|
+
options: j,
|
|
60
|
+
onApply: (O) => {
|
|
61
|
+
x(e, O);
|
|
62
|
+
}
|
|
56
63
|
},
|
|
57
|
-
|
|
64
|
+
t
|
|
58
65
|
)
|
|
59
66
|
),
|
|
60
|
-
/* @__PURE__ */ a(
|
|
61
|
-
|
|
67
|
+
f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ a(
|
|
68
|
+
y,
|
|
62
69
|
{
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
onClick:
|
|
70
|
+
variant: r,
|
|
71
|
+
appearance: "compact",
|
|
72
|
+
onClick: t,
|
|
73
|
+
children: e
|
|
74
|
+
},
|
|
75
|
+
e
|
|
76
|
+
)),
|
|
77
|
+
C && /* @__PURE__ */ a(
|
|
78
|
+
l.ResetButton,
|
|
79
|
+
{
|
|
80
|
+
className: N("select-none", S),
|
|
81
|
+
disabled: !b,
|
|
82
|
+
onClick: F
|
|
66
83
|
}
|
|
67
84
|
)
|
|
68
85
|
] })
|
|
69
86
|
] });
|
|
70
87
|
};
|
|
71
88
|
export {
|
|
72
|
-
|
|
89
|
+
E as Filter
|
|
73
90
|
};
|
|
@@ -1,41 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useCallback as l } from "react";
|
|
3
3
|
import { Input as c } from "../../../Input/Input.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import { Typography as f } from "../../../Typography/Typography.js";
|
|
5
|
+
import { Button as g } from "../../../Button/Button.js";
|
|
6
|
+
import { useTableContext as x } from "../../contexts/table.hook.js";
|
|
7
|
+
const y = () => {
|
|
8
|
+
const o = u(null), { totalPages: t, handlePage: r } = x(), m = l(
|
|
9
|
+
(a) => {
|
|
10
|
+
a.preventDefault();
|
|
11
|
+
const s = new FormData(a.currentTarget), n = Number(s.get("jump-to")), i = (n < t ? n : t) || 1;
|
|
12
|
+
r(i - 1), o.current?.reset();
|
|
11
13
|
},
|
|
12
|
-
[
|
|
14
|
+
[r, t]
|
|
13
15
|
);
|
|
14
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ p(
|
|
15
17
|
"form",
|
|
16
18
|
{
|
|
17
19
|
"aria-label": "footer-pagination",
|
|
18
|
-
ref:
|
|
20
|
+
ref: o,
|
|
19
21
|
onSubmit: m,
|
|
20
22
|
className: "flex items-center gap-2",
|
|
23
|
+
noValidate: !0,
|
|
21
24
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
f,
|
|
27
|
+
{
|
|
28
|
+
component: "span",
|
|
29
|
+
className: "text-sm min-w-fit tracking-normal",
|
|
30
|
+
children: "Jump to"
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
/* @__PURE__ */ e(
|
|
24
34
|
c,
|
|
25
35
|
{
|
|
26
36
|
type: "number",
|
|
27
|
-
className: "w-
|
|
37
|
+
className: "w-18 text-sm no-spinner",
|
|
28
38
|
name: "jump-to",
|
|
29
39
|
min: 1,
|
|
30
|
-
max:
|
|
31
|
-
required: !0
|
|
40
|
+
max: t,
|
|
41
|
+
required: !0,
|
|
42
|
+
autoComplete: "off"
|
|
32
43
|
}
|
|
33
44
|
),
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
g,
|
|
36
47
|
{
|
|
48
|
+
variant: "link",
|
|
37
49
|
type: "submit",
|
|
38
|
-
className: "text-xs
|
|
50
|
+
className: "text-xs p-2 cursor-pointer",
|
|
39
51
|
children: "Go"
|
|
40
52
|
}
|
|
41
53
|
)
|
|
@@ -44,5 +56,5 @@ const h = () => {
|
|
|
44
56
|
);
|
|
45
57
|
};
|
|
46
58
|
export {
|
|
47
|
-
|
|
59
|
+
y as FormPaginate
|
|
48
60
|
};
|