@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.30
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/DatePicker.css +1 -1
- package/dist/Modal-5xSxFoaD.js +99 -0
- package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist/chevron-down-DgT-uSF9.js +5 -0
- package/dist/chevron-right-DYvXLeql.js +7 -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 +30 -33
- 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 +1209 -1147
- package/dist/components/Divider/Divider.variants.js +1 -1
- package/dist/components/Dropdown/Dropdown.js +46 -28
- package/dist/components/Dropdown/Dropdown.variants.js +32 -9
- package/dist/components/Dropdown/components/List/List.js +133 -54
- package/dist/components/Dropdown/components/List/List.variants.js +9 -7
- package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
- package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
- package/dist/components/Dropdown/components/Wrapper.js +144 -109
- 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 +26 -8
- package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
- package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
- package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
- 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 +1 -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 +3 -3
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +2 -2
- package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -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 +6137 -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 +45 -24
- 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 +9 -8
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
- 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 +206 -181
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.variants.js +18 -23
- package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -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 +88 -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 +79 -73
- 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-CIAmiWcw.js +200 -0
- package/dist/index-CSFe9uC5.js +14 -0
- package/dist/index-CSWGJT-v.js +1722 -0
- package/dist/index-CigKKiZS.js +91 -0
- package/dist/index-DDByhzds.js +137 -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-D3xzCzcO.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-ohdbKsws.js +27 -0
- package/dist/index.d.ts +184 -18
- package/dist/index.js +106 -98
- package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
- package/dist/package.json +46 -32
- 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 +46 -32
- package/dist/Modal-V67Uz78z.js +0 -98
- package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
- package/dist/chevron-down-BLZPftpV.js +0 -11
- package/dist/chevron-up-RLP4nX7V.js +0 -54
- 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,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
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext as e } from "react";
|
|
2
|
+
import { TableContext as o } from "./table.context.js";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const t = e(o);
|
|
5
|
+
if (!t)
|
|
6
|
+
throw new Error("useTableContext must be used within a TableProvider");
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
s as useTableContext
|
|
11
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsx as k } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as A } from "@tanstack/react-query";
|
|
3
|
+
import { u as D, g as Q, a as $ } from "../../../index-CSWGJT-v.js";
|
|
4
|
+
import { useState as t, useMemo as G, useCallback as c } from "react";
|
|
5
|
+
import { TableContext as U } from "./table.context.js";
|
|
6
|
+
import { DEFAULT_PAGE_SIZE as W } from "../constants/pagination.js";
|
|
7
|
+
const X = ({
|
|
8
|
+
children: p,
|
|
9
|
+
id: r,
|
|
10
|
+
data: g = [],
|
|
11
|
+
columns: S = [],
|
|
12
|
+
totalItems: y,
|
|
13
|
+
isPaginationEnabled: b,
|
|
14
|
+
queryOptions: M = {},
|
|
15
|
+
fetchData: m
|
|
16
|
+
}) => {
|
|
17
|
+
const [f, d] = t([]), [C, P] = t(!0), [i, h] = t(0), [a, w] = t(), [s, F] = t(W), [l, O] = t(y), T = G(
|
|
18
|
+
() => Math.ceil(l / s),
|
|
19
|
+
[l, s]
|
|
20
|
+
), [n, L] = t({}), I = () => {
|
|
21
|
+
const e = typeof r == "string" || typeof r == "number" ? [r] : r;
|
|
22
|
+
return b && e.push(i, s), a && e.push(a), Object.entries(n).forEach(([o, u]) => {
|
|
23
|
+
e.push(`${o}:${u.join(",")}`);
|
|
24
|
+
}), e;
|
|
25
|
+
}, { data: R, isLoading: j, isFetching: x } = A({
|
|
26
|
+
queryKey: I(),
|
|
27
|
+
refetchOnMount: !1,
|
|
28
|
+
refetchOnWindowFocus: !1,
|
|
29
|
+
initialData: g,
|
|
30
|
+
queryFn: async () => m ? m({
|
|
31
|
+
page: Math.max(i + 1, 1),
|
|
32
|
+
pageSize: s,
|
|
33
|
+
termOfSearch: a,
|
|
34
|
+
...Object.keys(n).length > 0 ? n : {}
|
|
35
|
+
}).then(({ data: e, totalItemsCount: o }) => (P(!1), o && O(o), e)) : g ?? [],
|
|
36
|
+
...M
|
|
37
|
+
}), E = c((e) => {
|
|
38
|
+
w(e), h(0);
|
|
39
|
+
}, []), K = c((e, o) => {
|
|
40
|
+
const u = e.toLowerCase().replace(/\s+/g, "_");
|
|
41
|
+
L((_) => ({
|
|
42
|
+
..._,
|
|
43
|
+
[u]: o
|
|
44
|
+
}));
|
|
45
|
+
}, []), q = c((e) => h(e), []), v = c(
|
|
46
|
+
(e) => F(e),
|
|
47
|
+
[]
|
|
48
|
+
), z = D({
|
|
49
|
+
data: R,
|
|
50
|
+
columns: S,
|
|
51
|
+
state: {
|
|
52
|
+
sorting: f
|
|
53
|
+
},
|
|
54
|
+
onSortingChange: d,
|
|
55
|
+
getCoreRowModel: $(),
|
|
56
|
+
getSortedRowModel: Q()
|
|
57
|
+
});
|
|
58
|
+
return /* @__PURE__ */ k(
|
|
59
|
+
U.Provider,
|
|
60
|
+
{
|
|
61
|
+
value: {
|
|
62
|
+
sortedData: f,
|
|
63
|
+
table: z,
|
|
64
|
+
tableFetching: x,
|
|
65
|
+
tableLoading: j,
|
|
66
|
+
totalItems: l,
|
|
67
|
+
termOfSearch: a,
|
|
68
|
+
page: i,
|
|
69
|
+
multiselectSelected: n,
|
|
70
|
+
pageSize: s,
|
|
71
|
+
totalPages: T,
|
|
72
|
+
isFirstLoad: C,
|
|
73
|
+
handlePage: q,
|
|
74
|
+
onPageSize: v,
|
|
75
|
+
onChangeTermOfSearch: E,
|
|
76
|
+
onSorting: d,
|
|
77
|
+
onSelectMultiselect: K
|
|
78
|
+
},
|
|
79
|
+
children: p
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
X as TableProvider
|
|
85
|
+
};
|
package/dist/components/index.js
CHANGED
|
@@ -3,94 +3,100 @@ import { AlertDialog as p } from "./AlertDialog/AlertDialog.js";
|
|
|
3
3
|
import { Autocomplete as x } from "./Autocomplete/Autocomplete.js";
|
|
4
4
|
import { Badge as a } from "./Badge/Badge.js";
|
|
5
5
|
import { Breadcrumb as d } from "./Breadcrumb/Breadcrumb.js";
|
|
6
|
-
import { Button as
|
|
6
|
+
import { Button as g } from "./Button/Button.js";
|
|
7
7
|
import { Card as u } from "./Card/Card.js";
|
|
8
8
|
import { Checkbox as c } from "./Checkbox/Checkbox.js";
|
|
9
|
-
import { DatePicker as
|
|
9
|
+
import { DatePicker as D } from "./Datepicker/DatePicker.js";
|
|
10
10
|
import { Divider as B } from "./Divider/Divider.js";
|
|
11
|
-
import { Dropdown as
|
|
12
|
-
import { DropdownButton as
|
|
13
|
-
import { Filter as
|
|
14
|
-
import { Input as
|
|
11
|
+
import { Dropdown as N } from "./Dropdown/Dropdown.js";
|
|
12
|
+
import { DropdownButton as h } from "./DropdownButton/DropdownButton.js";
|
|
13
|
+
import { Filter as P } from "./Filter/Filter.js";
|
|
14
|
+
import { Input as w } from "./Input/Input.js";
|
|
15
15
|
import { Loading as k } from "./Loading/Loading.js";
|
|
16
|
-
import { M as G } from "../Modal-
|
|
17
|
-
import { NumberInput as
|
|
18
|
-
import {
|
|
16
|
+
import { M as G } from "../Modal-5xSxFoaD.js";
|
|
17
|
+
import { NumberInput as L } from "./NumberInput/NumberInput.js";
|
|
18
|
+
import { PhoneNumberInput as y } from "./PhoneNumberInput/PhoneNumberInput.js";
|
|
19
|
+
import { PieChart as O } from "./PieChart/PieChart.js";
|
|
19
20
|
import { ProgressBar as j } from "./ProgressBar/ProgressBar.js";
|
|
20
|
-
import { Radio as
|
|
21
|
-
import { RadioCard as
|
|
22
|
-
import { RadioCardGroup as
|
|
23
|
-
import { RadioGroup as
|
|
24
|
-
import { Range as
|
|
25
|
-
import { Sidebar as
|
|
26
|
-
import { Slider as
|
|
27
|
-
import { Switch as
|
|
28
|
-
import { Table as
|
|
29
|
-
import { Tabs as
|
|
30
|
-
import { Tag as
|
|
31
|
-
import { TagSelect as
|
|
32
|
-
import { TextArea as
|
|
33
|
-
import { TimePicker as
|
|
34
|
-
import { Toast as
|
|
35
|
-
import { Tooltip as
|
|
36
|
-
import { Typography as
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
21
|
+
import { Radio as E } from "./Radio/Radio.js";
|
|
22
|
+
import { RadioCard as J } from "./RadioCard/RadioCard.js";
|
|
23
|
+
import { RadioCardGroup as Q } from "./RadioCardGroup/RadioCardGroup.js";
|
|
24
|
+
import { RadioGroup as W } from "./RadioGroup/RadioGroup.js";
|
|
25
|
+
import { Range as Y } from "./Range/Range.js";
|
|
26
|
+
import { Sidebar as _ } from "./Sidebar/Sidebar.js";
|
|
27
|
+
import { Slider as oo } from "./Slider/Slider.js";
|
|
28
|
+
import { Switch as eo } from "./Switch/Switch.js";
|
|
29
|
+
import { Table as po } from "./Table/Table.js";
|
|
30
|
+
import { Tabs as xo } from "./Tabs/Tabs.js";
|
|
31
|
+
import { Tag as ao } from "./Tag/Tag.js";
|
|
32
|
+
import { TagSelect as no } from "./TagSelect/TagSelect.js";
|
|
33
|
+
import { TextArea as lo } from "./TextArea/TextArea.js";
|
|
34
|
+
import { TimePicker as To } from "./TimePicker/TimePicker.js";
|
|
35
|
+
import { Toast as bo } from "./Toast/Toast.js";
|
|
36
|
+
import { Tooltip as so } from "./Tooltip/Tooltip.js";
|
|
37
|
+
import { Typography as Co } from "./Typography/Typography.js";
|
|
38
|
+
import { VirtualizedTable as So } from "./VirtualizedTable/VirtualizedTable.js";
|
|
39
|
+
import { BadgeMultiSelect as vo } from "./Filter/components/BadgeDropdown/BadgeMultiSelect.js";
|
|
40
|
+
import { DateFilterDropdown as Ro } from "./Filter/components/DateFilterDropdown/DateFilterDropdown.js";
|
|
41
|
+
import { Footer as Ao } from "./Sidebar/components/Footer/Footer.js";
|
|
42
|
+
import { Logo as Fo } from "./Sidebar/components/Logo/Logo.js";
|
|
43
|
+
import { Navigation as Io } from "./Sidebar/components/Navigation/Navigation.js";
|
|
44
|
+
import { NavigationGroup as Mo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
|
|
45
|
+
import { NavigationOption as zo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
|
|
46
|
+
import { NavigationSeparator as Vo } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
|
|
47
|
+
import { Content as qo } from "./Tabs/components/Content.js";
|
|
48
|
+
import { List as Ho } from "./Tabs/components/List.js";
|
|
49
|
+
import { Trigger as Ko } from "./Tabs/components/Trigger.js";
|
|
50
|
+
import { TruncateText as Uo } from "./VirtualizedTable/components/TruncateText/TruncateText.js";
|
|
48
51
|
export {
|
|
49
52
|
e as Alert,
|
|
50
53
|
p as AlertDialog,
|
|
51
54
|
x as Autocomplete,
|
|
52
55
|
a as Badge,
|
|
53
|
-
|
|
56
|
+
vo as BadgeMultiSelect,
|
|
54
57
|
d as Breadcrumb,
|
|
55
|
-
|
|
58
|
+
g as Button,
|
|
56
59
|
u as Card,
|
|
57
60
|
c as Checkbox,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
qo as Content,
|
|
62
|
+
Ro as DateFilterDropdown,
|
|
63
|
+
D as DatePicker,
|
|
61
64
|
B as Divider,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
N as Dropdown,
|
|
66
|
+
h as DropdownButton,
|
|
67
|
+
P as Filter,
|
|
68
|
+
Ao as Footer,
|
|
69
|
+
w as Input,
|
|
70
|
+
Ho as List,
|
|
68
71
|
k as Loading,
|
|
69
|
-
|
|
72
|
+
Fo as Logo,
|
|
70
73
|
G as Modal,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
Io as Navigation,
|
|
75
|
+
Mo as NavigationGroup,
|
|
76
|
+
zo as NavigationOption,
|
|
77
|
+
Vo as NavigationSeparator,
|
|
78
|
+
L as NumberInput,
|
|
79
|
+
y as PhoneNumberInput,
|
|
80
|
+
O as PieChart,
|
|
77
81
|
j as ProgressBar,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
E as Radio,
|
|
83
|
+
J as RadioCard,
|
|
84
|
+
Q as RadioCardGroup,
|
|
85
|
+
W as RadioGroup,
|
|
86
|
+
Y as Range,
|
|
87
|
+
_ as Sidebar,
|
|
88
|
+
oo as Slider,
|
|
89
|
+
eo as Switch,
|
|
90
|
+
po as Table,
|
|
91
|
+
xo as Tabs,
|
|
92
|
+
ao as Tag,
|
|
93
|
+
no as TagSelect,
|
|
94
|
+
lo as TextArea,
|
|
95
|
+
To as TimePicker,
|
|
96
|
+
bo as Toast,
|
|
97
|
+
so as Tooltip,
|
|
98
|
+
Ko as Trigger,
|
|
99
|
+
Uo as TruncateText,
|
|
100
|
+
Co as Typography,
|
|
101
|
+
So as VirtualizedTable
|
|
96
102
|
};
|