@konstructio/ui 0.1.2-alpha.4 → 0.1.2-alpha.40
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-CtAG97Ts.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-left-C4LEg1fH.js +7 -0
- package/dist/chevron-up-CRyLc5Ml.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 +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 +42 -44
- package/dist/components/Badge/Badge.variants.js +8 -6
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
- package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -1
- package/dist/components/Card/Card.variants.js +5 -9
- package/dist/components/Checkbox/Checkbox.js +6 -6
- 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 +1243 -1191
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +37 -31
- package/dist/components/Dropdown/Dropdown.variants.js +9 -4
- package/dist/components/Dropdown/components/List/List.js +128 -59
- package/dist/components/Dropdown/components/ListItem/ListItem.js +90 -39
- package/dist/components/Dropdown/components/Wrapper.js +141 -134
- package/dist/components/Dropdown/constants/index.js +4 -0
- package/dist/components/Dropdown/constants/pagination.js +4 -0
- package/dist/components/Dropdown/contexts/dropdown.context.js +17 -0
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -20
- package/dist/components/Dropdown/hooks/useDropdown.js +74 -29
- package/dist/components/Dropdown/hooks/useNavigationList.js +27 -39
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/Filter/Filter.variants.js +2 -2
- 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/Input/Input.variants.js +2 -1
- 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 +34 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.js +38 -0
- package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
- package/dist/components/MultiSelectDropdown/components/List/List.js +37 -0
- package/dist/components/MultiSelectDropdown/components/List/List.variants.js +23 -0
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +105 -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/NumberInput/NumberInput.js +2 -2
- 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 +27 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
- package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -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 +647 -664
- package/dist/components/RadioCard/RadioCard.variants.js +1 -6
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Sidebar/Sidebar.variants.js +2 -2
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +8 -8
- package/dist/components/Switch/Switch.variants.js +4 -4
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.variants.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/Tag/Tag.variants.js +1 -0
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
- package/dist/components/TimePicker/TimePicker.variants.js +2 -2
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Toast/Toast.js +283 -255
- 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.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +121 -0
- package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
- package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
- package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
- package/dist/components/VirtualizedTable/assets/index.js +6 -0
- package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
- package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
- package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +93 -0
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
- package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
- package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
- package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
- package/dist/components/VirtualizedTable/components/index.js +16 -0
- package/dist/components/VirtualizedTable/constants/index.js +5 -0
- package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
- package/dist/components/VirtualizedTable/contexts/index.js +8 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
- package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
- package/dist/components/index.js +88 -80
- package/dist/contexts/theme.provider.js +0 -1
- package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
- package/dist/debounce-BFejQm9P.js +200 -0
- package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
- package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
- package/dist/index-2hB40Iuc.js +1873 -0
- package/dist/index-BZPx6jYI.js +8 -0
- package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
- package/dist/index-BtQfgaSF.js +60 -0
- package/dist/index-C3tHPg8y.js +662 -0
- package/dist/index-C65LtGuU.js +137 -0
- package/dist/index-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/{index-D3xzCzcO.js → index-CdwPV0FE.js} +4 -4
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
- package/dist/index-DLcqcWxM.js +29 -0
- package/dist/index-Dbt2vBmS.js +136 -0
- package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
- package/dist/index-DrWQH0QF.js +55 -0
- package/dist/index-Ds6U2x4Z.js +479 -0
- package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
- package/dist/index-ohdbKsws.js +27 -0
- package/dist/index.d.ts +232 -23
- package/dist/index.js +112 -102
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/loader-juvMSJ9L.js +5 -0
- package/dist/package.json +48 -34
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +191 -167
- package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
- package/dist/utils/index.js +534 -501
- package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
- package/package.json +48 -34
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/index-BXuxPoz7.js +0 -435
- package/dist/index-BfXxHr_2.js +0 -125
- package/dist/index-C9T9HQaa.js +0 -423
- package/dist/index-CZnD2QxM.js +0 -32
- package/dist/index-CrBonFvu.js +0 -144
- package/dist/index-Cvx4lqTq.js +0 -47
- package/dist/index-DQH6odE9.js +0 -82
- package/dist/index-Oq5GlCHP.js +0 -131
- package/dist/index-iXyXtdgP.js +0 -31
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsx as i, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { memo as u } from "react";
|
|
3
|
+
import { cn as p } from "../../../../utils/index.js";
|
|
4
|
+
import { C as g, a as d } from "../../../../chevron-left-C4LEg1fH.js";
|
|
5
|
+
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
6
|
+
const r = u(
|
|
7
|
+
({
|
|
8
|
+
index: e,
|
|
9
|
+
currentPage: t,
|
|
10
|
+
handlePage: l
|
|
11
|
+
}) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i(
|
|
12
|
+
"button",
|
|
13
|
+
{
|
|
14
|
+
type: "button",
|
|
15
|
+
onClick: () => l(e),
|
|
16
|
+
className: p("px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer", {
|
|
17
|
+
"bg-blue-600 text-white": e === t
|
|
18
|
+
}),
|
|
19
|
+
children: e + 1
|
|
20
|
+
}
|
|
21
|
+
) }, e)
|
|
22
|
+
);
|
|
23
|
+
r.displayName = "PageButton";
|
|
24
|
+
const o = u(({ keyValue: e }) => /* @__PURE__ */ i("li", { className: "px-2", children: /* @__PURE__ */ i("span", { className: "text-blue-600 select-none", children: "..." }) }, e));
|
|
25
|
+
o.displayName = "Ellipsis";
|
|
26
|
+
const a = u(
|
|
27
|
+
({
|
|
28
|
+
direction: e,
|
|
29
|
+
onClick: t,
|
|
30
|
+
disabled: l
|
|
31
|
+
}) => /* @__PURE__ */ i("li", { className: "flex items-center justify-center", children: /* @__PURE__ */ i("button", { onClick: t, disabled: l, children: /* @__PURE__ */ i(
|
|
32
|
+
e === "left" ? g : d,
|
|
33
|
+
{
|
|
34
|
+
className: p("h-6 w-6 cursor-pointer", {
|
|
35
|
+
"text-blue-600": !l,
|
|
36
|
+
"text-slate-400 cursor-not-allowed": l
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
) }) })
|
|
40
|
+
);
|
|
41
|
+
a.displayName = "NavigationButton";
|
|
42
|
+
const k = () => {
|
|
43
|
+
const { totalPages: e, page: t, handlePage: l } = f();
|
|
44
|
+
return /* @__PURE__ */ m("ul", { className: "flex items-center gap-2", children: [
|
|
45
|
+
/* @__PURE__ */ i(
|
|
46
|
+
a,
|
|
47
|
+
{
|
|
48
|
+
direction: "left",
|
|
49
|
+
onClick: () => l(t - 1),
|
|
50
|
+
disabled: t === 0
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
(() => {
|
|
54
|
+
if (e <= 5)
|
|
55
|
+
return Array.from({ length: e }, (s, c) => /* @__PURE__ */ i(
|
|
56
|
+
r,
|
|
57
|
+
{
|
|
58
|
+
index: c,
|
|
59
|
+
currentPage: t,
|
|
60
|
+
handlePage: l
|
|
61
|
+
},
|
|
62
|
+
c
|
|
63
|
+
));
|
|
64
|
+
const n = [];
|
|
65
|
+
if (t < 3) {
|
|
66
|
+
for (let s = 0; s < 3; s++)
|
|
67
|
+
n.push(
|
|
68
|
+
/* @__PURE__ */ i(
|
|
69
|
+
r,
|
|
70
|
+
{
|
|
71
|
+
index: s,
|
|
72
|
+
currentPage: t,
|
|
73
|
+
handlePage: l
|
|
74
|
+
},
|
|
75
|
+
s
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
|
|
79
|
+
for (let s = e - 2; s < e; s++)
|
|
80
|
+
n.push(
|
|
81
|
+
/* @__PURE__ */ i(
|
|
82
|
+
r,
|
|
83
|
+
{
|
|
84
|
+
index: s,
|
|
85
|
+
currentPage: t,
|
|
86
|
+
handlePage: l
|
|
87
|
+
},
|
|
88
|
+
s
|
|
89
|
+
)
|
|
90
|
+
);
|
|
91
|
+
} else if (t >= e - 5) {
|
|
92
|
+
n.push(
|
|
93
|
+
/* @__PURE__ */ i(
|
|
94
|
+
r,
|
|
95
|
+
{
|
|
96
|
+
index: 0,
|
|
97
|
+
currentPage: t,
|
|
98
|
+
handlePage: l
|
|
99
|
+
},
|
|
100
|
+
0
|
|
101
|
+
)
|
|
102
|
+
), e > 6 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis" }, "ellipsis"));
|
|
103
|
+
for (let s = Math.max(1, e - 5); s < e; s++)
|
|
104
|
+
n.push(
|
|
105
|
+
/* @__PURE__ */ i(
|
|
106
|
+
r,
|
|
107
|
+
{
|
|
108
|
+
index: s,
|
|
109
|
+
currentPage: t,
|
|
110
|
+
handlePage: l
|
|
111
|
+
},
|
|
112
|
+
s
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
} else {
|
|
116
|
+
n.push(
|
|
117
|
+
/* @__PURE__ */ i(
|
|
118
|
+
r,
|
|
119
|
+
{
|
|
120
|
+
index: 0,
|
|
121
|
+
currentPage: t,
|
|
122
|
+
handlePage: l
|
|
123
|
+
},
|
|
124
|
+
0
|
|
125
|
+
)
|
|
126
|
+
), t > 3 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis1" }, "ellipsis1"));
|
|
127
|
+
for (let s = t - 1; s <= t + 1; s++)
|
|
128
|
+
s > 0 && s < e - 1 && n.push(
|
|
129
|
+
/* @__PURE__ */ i(
|
|
130
|
+
r,
|
|
131
|
+
{
|
|
132
|
+
index: s,
|
|
133
|
+
currentPage: t,
|
|
134
|
+
handlePage: l
|
|
135
|
+
},
|
|
136
|
+
s
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
t < e - 4 && n.push(/* @__PURE__ */ i(o, { keyValue: "ellipsis2" }, "ellipsis2")), n.push(
|
|
140
|
+
/* @__PURE__ */ i(
|
|
141
|
+
r,
|
|
142
|
+
{
|
|
143
|
+
index: e - 1,
|
|
144
|
+
currentPage: t,
|
|
145
|
+
handlePage: l
|
|
146
|
+
},
|
|
147
|
+
e - 1
|
|
148
|
+
)
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
return n;
|
|
152
|
+
})(),
|
|
153
|
+
/* @__PURE__ */ i(
|
|
154
|
+
a,
|
|
155
|
+
{
|
|
156
|
+
direction: "right",
|
|
157
|
+
onClick: () => l(t + 1),
|
|
158
|
+
disabled: t >= e - 1
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
] });
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
k as DotPaginate
|
|
165
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as p, useCallback as l } from "react";
|
|
3
|
+
import { Dropdown as c } from "../../../Dropdown/Dropdown.js";
|
|
4
|
+
import { DEFAULT_PAGE_SIZES as g } from "../../constants/pagination.js";
|
|
5
|
+
import { useTableContext as x } from "../../contexts/table.hook.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
pageSizes: n = g
|
|
8
|
+
}) => {
|
|
9
|
+
const { pageSize: s, onPageSize: o, handlePage: t } = x(), r = p(
|
|
10
|
+
() => n.map(String).map((e) => ({ label: e, value: e })),
|
|
11
|
+
[]
|
|
12
|
+
), m = l(
|
|
13
|
+
(e) => {
|
|
14
|
+
o(Number(e)), t(0);
|
|
15
|
+
},
|
|
16
|
+
[t, o]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
19
|
+
/* @__PURE__ */ a("span", { children: "Show" }),
|
|
20
|
+
/* @__PURE__ */ a(
|
|
21
|
+
c,
|
|
22
|
+
{
|
|
23
|
+
className: "w-22 [&>div>p]:text-xs bg-white",
|
|
24
|
+
listItemClassName: "[&>p]:text-xs",
|
|
25
|
+
options: r,
|
|
26
|
+
value: s.toString(),
|
|
27
|
+
onChange: ({ target: e }) => m(e.value)
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
b as DropdownPaginate
|
|
34
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as m, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { d as O } from "../../../../debounce-BFejQm9P.js";
|
|
3
|
+
import { useRef as R, useCallback as u, useMemo as p } from "react";
|
|
4
|
+
import { Button as y } from "../../../Button/Button.js";
|
|
5
|
+
import { Filter as s } 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: d,
|
|
12
|
+
placeholder: h,
|
|
13
|
+
showFilterInput: g = !0,
|
|
14
|
+
showResetButton: x = !0,
|
|
15
|
+
resetButtonClassName: C
|
|
16
|
+
}) => {
|
|
17
|
+
const n = R(null), {
|
|
18
|
+
termOfSearch: o,
|
|
19
|
+
multiselectSelected: c,
|
|
20
|
+
onChangeTermOfSearch: a,
|
|
21
|
+
onSelectMultiselect: i
|
|
22
|
+
} = T(), S = u(
|
|
23
|
+
(e, t) => i(
|
|
24
|
+
e,
|
|
25
|
+
t.map((r) => r.id)
|
|
26
|
+
),
|
|
27
|
+
[i]
|
|
28
|
+
), b = u(() => {
|
|
29
|
+
a(""), n.current && (n.current.value = "");
|
|
30
|
+
}, [a]), F = p(
|
|
31
|
+
() => O((e) => {
|
|
32
|
+
a(e.target.value);
|
|
33
|
+
}, 500),
|
|
34
|
+
[a]
|
|
35
|
+
), M = p(
|
|
36
|
+
() => !!o || Object.entries(c ?? {}).map(([, e]) => e).flat().length > 0,
|
|
37
|
+
[o, c]
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ m("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
40
|
+
g && /* @__PURE__ */ l(
|
|
41
|
+
B,
|
|
42
|
+
{
|
|
43
|
+
ref: n,
|
|
44
|
+
placeholder: h,
|
|
45
|
+
isSearch: !0,
|
|
46
|
+
autoComplete: "false",
|
|
47
|
+
className: "w-72",
|
|
48
|
+
inputMode: "search",
|
|
49
|
+
onChange: F
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ m(s, { children: [
|
|
53
|
+
d?.map(
|
|
54
|
+
({ key: e, label: t, position: r = "right", options: j }) => /* @__PURE__ */ l(
|
|
55
|
+
s.BadgeMultiSelect,
|
|
56
|
+
{
|
|
57
|
+
label: t,
|
|
58
|
+
position: r,
|
|
59
|
+
options: j,
|
|
60
|
+
onApply: (v) => {
|
|
61
|
+
S(e, v);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
t
|
|
65
|
+
)
|
|
66
|
+
),
|
|
67
|
+
f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ l(
|
|
68
|
+
y,
|
|
69
|
+
{
|
|
70
|
+
variant: r,
|
|
71
|
+
appearance: "compact",
|
|
72
|
+
onClick: t,
|
|
73
|
+
children: e
|
|
74
|
+
},
|
|
75
|
+
e
|
|
76
|
+
)),
|
|
77
|
+
x && /* @__PURE__ */ l(
|
|
78
|
+
s.ResetButton,
|
|
79
|
+
{
|
|
80
|
+
className: N(
|
|
81
|
+
"text-slate-700 hover:text-slate-700 disabled:text-slate-700/45 select-none",
|
|
82
|
+
C
|
|
83
|
+
),
|
|
84
|
+
disabled: !M,
|
|
85
|
+
onClick: b
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
] })
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
E as Filter
|
|
93
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as l, useCallback as c } from "react";
|
|
3
|
+
import { Input as p } from "../../../Input/Input.js";
|
|
4
|
+
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
5
|
+
const h = () => {
|
|
6
|
+
const r = l(null), { totalPages: e, handlePage: o } = f(), m = c(
|
|
7
|
+
(n) => {
|
|
8
|
+
n.preventDefault();
|
|
9
|
+
const s = new FormData(n.currentTarget), a = Number(s.get("jump-to")), u = (a < e ? a : e) || 1;
|
|
10
|
+
o(u - 1), r.current?.reset();
|
|
11
|
+
},
|
|
12
|
+
[o, e]
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ i(
|
|
15
|
+
"form",
|
|
16
|
+
{
|
|
17
|
+
"aria-label": "footer-pagination",
|
|
18
|
+
ref: r,
|
|
19
|
+
onSubmit: m,
|
|
20
|
+
className: "flex items-center gap-2",
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ t("span", { className: "min-w-fit", children: "Jump to" }),
|
|
23
|
+
/* @__PURE__ */ t(
|
|
24
|
+
p,
|
|
25
|
+
{
|
|
26
|
+
type: "number",
|
|
27
|
+
className: "w-18 text-xs no-spinner",
|
|
28
|
+
name: "jump-to",
|
|
29
|
+
min: 1,
|
|
30
|
+
max: e,
|
|
31
|
+
required: !0
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ t(
|
|
35
|
+
"button",
|
|
36
|
+
{
|
|
37
|
+
type: "submit",
|
|
38
|
+
className: "text-xs text-blue-600 p-2 cursor-pointer",
|
|
39
|
+
children: "Go"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
h as FormPaginate
|
|
48
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import { useTableContext as S } from "../../contexts/table.hook.js";
|
|
8
|
+
const D = ({
|
|
9
|
+
className: n,
|
|
10
|
+
classNameArrows: i,
|
|
11
|
+
classNameActiveArrows: a
|
|
12
|
+
}) => {
|
|
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
|
+
);
|
|
20
|
+
return /* @__PURE__ */ r(
|
|
21
|
+
"thead",
|
|
22
|
+
{
|
|
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
|
+
),
|
|
27
|
+
children: c.getHeaderGroups().map(({ id: t, headers: m }) => /* @__PURE__ */ r("tr", { children: m.map(({ id: f, column: e, getContext: h }) => /* @__PURE__ */ r(
|
|
28
|
+
"th",
|
|
29
|
+
{
|
|
30
|
+
scope: "col",
|
|
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(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: s(
|
|
41
|
+
"flex flex-col text-slate-400 justify-center items-center gap-1",
|
|
42
|
+
i
|
|
43
|
+
),
|
|
44
|
+
role: "presentation",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ r(
|
|
47
|
+
u,
|
|
48
|
+
{
|
|
49
|
+
className: s(
|
|
50
|
+
"w-2 h-2 cursor-pointer",
|
|
51
|
+
{
|
|
52
|
+
"text-blue-600": e.getIsSorted() === "asc"
|
|
53
|
+
},
|
|
54
|
+
a
|
|
55
|
+
),
|
|
56
|
+
onClick: () => d(e)
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
C,
|
|
61
|
+
{
|
|
62
|
+
className: s(
|
|
63
|
+
"w-2 h-2 cursor-pointer",
|
|
64
|
+
{
|
|
65
|
+
"text-blue-600": e.getIsSorted() === "desc"
|
|
66
|
+
},
|
|
67
|
+
a
|
|
68
|
+
),
|
|
69
|
+
onClick: () => x(e)
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] })
|
|
76
|
+
},
|
|
77
|
+
f
|
|
78
|
+
)) }, t))
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
export {
|
|
83
|
+
D as Header
|
|
84
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as t, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { DotPaginate as f } from "../DotPaginate/DotPaginate.js";
|
|
3
|
+
import { DropdownPaginate as x } from "../DropdownPaginate/DropdownPaginate.js";
|
|
4
|
+
import { FormPaginate as u } from "../FormPaginate/FormPaginate.js";
|
|
5
|
+
import { cn as g } from "../../../../utils/index.js";
|
|
6
|
+
import { useTableContext as h } from "../../contexts/table.hook.js";
|
|
7
|
+
import { DEFAULT_PAGE_SIZE as b } from "../../constants/pagination.js";
|
|
8
|
+
const D = ({
|
|
9
|
+
showTotalItems: a = !0,
|
|
10
|
+
showDropdownPagination: i = !0,
|
|
11
|
+
showDotPagination: n = !0,
|
|
12
|
+
showFormPagination: s = !0,
|
|
13
|
+
pageSizes: l,
|
|
14
|
+
classNamePagination: o,
|
|
15
|
+
isLoading: m
|
|
16
|
+
}) => {
|
|
17
|
+
const {
|
|
18
|
+
totalItems: r = -1 / 0,
|
|
19
|
+
tableFetching: c,
|
|
20
|
+
isFirstLoad: d
|
|
21
|
+
} = h();
|
|
22
|
+
return r <= b || c || m ? null : /* @__PURE__ */ t(p, { children: [
|
|
23
|
+
/* @__PURE__ */ e(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: g(
|
|
27
|
+
"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",
|
|
28
|
+
o,
|
|
29
|
+
{
|
|
30
|
+
"animate-in fade-in-10": !d
|
|
31
|
+
}
|
|
32
|
+
),
|
|
33
|
+
children: /* @__PURE__ */ t("div", { className: "flex items-center justify-between", children: [
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-6", children: [
|
|
35
|
+
r && a ? /* @__PURE__ */ t("span", { className: "text-slate-800", children: [
|
|
36
|
+
r,
|
|
37
|
+
" Results"
|
|
38
|
+
] }) : null,
|
|
39
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(x, { pageSizes: l }) })
|
|
40
|
+
] }),
|
|
41
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-8", children: [
|
|
42
|
+
n && /* @__PURE__ */ e(f, {}),
|
|
43
|
+
s && /* @__PURE__ */ e(u, {})
|
|
44
|
+
] })
|
|
45
|
+
] })
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ e("div", { className: "w-full min-h-[150px]" })
|
|
49
|
+
] });
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
D as Pagination
|
|
53
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Button as c } from "../../../Button/Button.js";
|
|
3
|
+
import { cn as i } from "../../../../utils/index.js";
|
|
4
|
+
import { useTableContext as h } from "../../contexts/table.hook.js";
|
|
5
|
+
import { E as g } from "../../../../ellipsis-vertical-BVPtjl5f.js";
|
|
6
|
+
const _ = ({ numberOfRows: n, table: o }) => {
|
|
7
|
+
const { tableFetching: d, tableLoading: m } = h(), e = Array.from({ length: n });
|
|
8
|
+
return /* @__PURE__ */ t("tbody", { className: "text-slate-800 text-sm font-normal relative", children: e.map((p, a) => {
|
|
9
|
+
const s = o.getAllColumns();
|
|
10
|
+
return /* @__PURE__ */ t(
|
|
11
|
+
"tr",
|
|
12
|
+
{
|
|
13
|
+
className: "border-b border-b-gray-200 bg-transparent last:border-b-transparent",
|
|
14
|
+
children: s.map((r, l) => r.id !== "actions" ? /* @__PURE__ */ t(
|
|
15
|
+
"td",
|
|
16
|
+
{
|
|
17
|
+
className: i(
|
|
18
|
+
"px-4 py-1 bg-white",
|
|
19
|
+
r.columnDef.meta?.className,
|
|
20
|
+
{
|
|
21
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
|
|
22
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
children: /* @__PURE__ */ t("div", { className: "animate-in fade-in-0", children: /* @__PURE__ */ t("div", { className: "bg-gray-200 animate-pulse rounded h-5 w-full" }) })
|
|
26
|
+
},
|
|
27
|
+
`skeleton-${r.id}`
|
|
28
|
+
) : /* @__PURE__ */ t(
|
|
29
|
+
"td",
|
|
30
|
+
{
|
|
31
|
+
className: i(
|
|
32
|
+
"px-4 py-1 bg-white",
|
|
33
|
+
r.columnDef.meta?.className,
|
|
34
|
+
{
|
|
35
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === e.length - 1 && l === 0,
|
|
36
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === e.length - 1 && l === s.length - 1
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
children: /* @__PURE__ */ t(
|
|
40
|
+
c,
|
|
41
|
+
{
|
|
42
|
+
variant: "text",
|
|
43
|
+
shape: "circle",
|
|
44
|
+
size: "large",
|
|
45
|
+
disabled: !0,
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
children: /* @__PURE__ */ t(
|
|
48
|
+
g,
|
|
49
|
+
{
|
|
50
|
+
className: i("w-5 h-5 text-slate-400", {
|
|
51
|
+
"text-gray-300 animate-pulse": d || m
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
},
|
|
58
|
+
`skeleton-${r.id}`
|
|
59
|
+
))
|
|
60
|
+
},
|
|
61
|
+
`skeleton-row-${a}`
|
|
62
|
+
);
|
|
63
|
+
}) });
|
|
64
|
+
};
|
|
65
|
+
export {
|
|
66
|
+
_ as Skeleton
|
|
67
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { P as u, R as b, T as m, C as p } from "../../../../index-2hB40Iuc.js";
|
|
3
|
+
import { d as h } from "../../../../debounce-BFejQm9P.js";
|
|
4
|
+
import { useRef as x, useState as w, useCallback as g, useEffect as s } from "react";
|
|
5
|
+
const v = ({ getValue: l, value: i }) => {
|
|
6
|
+
const a = x(null), [c, f] = w(!1), n = i ?? l().toLocaleLowerCase(), t = g(() => {
|
|
7
|
+
const e = a.current;
|
|
8
|
+
e && f(e.scrollWidth > e.clientWidth);
|
|
9
|
+
}, []);
|
|
10
|
+
return s(() => {
|
|
11
|
+
const e = new AbortController(), o = h(t, 300);
|
|
12
|
+
return window.addEventListener("resize", o, {
|
|
13
|
+
signal: e.signal
|
|
14
|
+
}), () => {
|
|
15
|
+
e.abort(), o.cancel();
|
|
16
|
+
};
|
|
17
|
+
}, [t]), s(() => {
|
|
18
|
+
t();
|
|
19
|
+
}, [t]), c ? /* @__PURE__ */ r(u, { delayDuration: 0, children: /* @__PURE__ */ d(b, { children: [
|
|
20
|
+
/* @__PURE__ */ r(m, { asChild: !0, children: /* @__PURE__ */ r("p", { ref: a, className: "w-full truncate cursor-pointer", children: n }) }),
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
p,
|
|
23
|
+
{
|
|
24
|
+
side: "bottom",
|
|
25
|
+
align: "center",
|
|
26
|
+
className: "animate-in fade-in-0 relative mt-1.5 overflow-visible bg-kubefirst-dark-blue-900 text-white px-3 py-2 after:content-[''] after:absolute after:left-1/2 after:-translate-x-1/2 after:top-0 after:-translate-y-full after:border-l-8 after:border-l-transparent after:border-r-8 after:border-r-transparent after:border-b-8 after:border-kubefirst-dark-blue-900",
|
|
27
|
+
children: n
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] }) }) : /* @__PURE__ */ r("p", { ref: a, className: "w-full truncate", children: n });
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
v as TruncateText
|
|
34
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../../../../utils/index.js";
|
|
3
|
+
import { useTableContext as s } from "../../contexts/table.hook.js";
|
|
4
|
+
const p = ({
|
|
5
|
+
children: o,
|
|
6
|
+
classNameWrapperTable: r,
|
|
7
|
+
isLoading: e,
|
|
8
|
+
showPagination: t
|
|
9
|
+
}) => {
|
|
10
|
+
const { tableFetching: d } = s();
|
|
11
|
+
return /* @__PURE__ */ n(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: m(
|
|
15
|
+
"shadow rounded-t-lg",
|
|
16
|
+
{
|
|
17
|
+
"overflow-hidden rounded-lg": !t || d || e
|
|
18
|
+
},
|
|
19
|
+
r
|
|
20
|
+
),
|
|
21
|
+
children: o
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
p as WrapperBody
|
|
27
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Actions as e } from "./Actions/Actions.js";
|
|
2
|
+
import { Body as p } from "./Body/Body.js";
|
|
3
|
+
import { Filter as f } from "./Filter/Filter.js";
|
|
4
|
+
import { Header as a } from "./Header/Header.js";
|
|
5
|
+
import { Pagination as n } from "./Pagination/Pagination.js";
|
|
6
|
+
import { TruncateText as c } from "./TruncateText/TruncateText.js";
|
|
7
|
+
import { WrapperBody as B } from "./WrapperBody/WrapperBody.js";
|
|
8
|
+
export {
|
|
9
|
+
e as Actions,
|
|
10
|
+
p as Body,
|
|
11
|
+
f as Filter,
|
|
12
|
+
a as Header,
|
|
13
|
+
n as Pagination,
|
|
14
|
+
c as TruncateText,
|
|
15
|
+
B as WrapperBody
|
|
16
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createContext as e } from "react";
|
|
2
|
+
import { DEFAULT_PAGE_SIZE as t } from "../constants/pagination.js";
|
|
3
|
+
const r = e({
|
|
4
|
+
sortedData: [],
|
|
5
|
+
table: {},
|
|
6
|
+
tableFetching: !1,
|
|
7
|
+
tableLoading: !1,
|
|
8
|
+
totalItems: -1 / 0,
|
|
9
|
+
termOfSearch: "",
|
|
10
|
+
page: 0,
|
|
11
|
+
pageSize: t,
|
|
12
|
+
totalPages: 1 / 0,
|
|
13
|
+
isFirstLoad: !0,
|
|
14
|
+
onSorting() {
|
|
15
|
+
throw new Error("onSorting function is not implemented");
|
|
16
|
+
},
|
|
17
|
+
onChangeTermOfSearch() {
|
|
18
|
+
throw new Error("onChangeTermOfSearch function is not implemented");
|
|
19
|
+
},
|
|
20
|
+
onSelectMultiselect() {
|
|
21
|
+
throw new Error("onSelectMultiselect function is not implemented");
|
|
22
|
+
},
|
|
23
|
+
handlePage() {
|
|
24
|
+
throw new Error("handlePage function is not implemented");
|
|
25
|
+
},
|
|
26
|
+
onPageSize() {
|
|
27
|
+
throw new Error("onPageSize function is not implemented");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
r as TableContext
|
|
32
|
+
};
|