@konstructio/ui 0.1.3 → 0.1.5
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/{Breadcrumb-DzavonoC.js → Breadcrumb-BiiOnn0p.js} +1 -1
- package/dist/{CollapsedSteps-CkMuzOHx.js → CollapsedSteps-Dy2I7XDd.js} +35 -35
- package/dist/{Input-C1Js3pbF.js → Input-CE6J6HIW.js} +6 -6
- package/dist/components/Alert/Alert.js +19 -18
- package/dist/components/Alert/Alert.variants.js +11 -4
- package/dist/components/Autocomplete/Autocomplete.variants.js +6 -5
- package/dist/components/Badge/Badge.js +15 -15
- package/dist/components/Badge/Badge.variants.js +5 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/BackButton/BackButton.variants.js +1 -1
- package/dist/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.js +1 -1
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +2 -2
- package/dist/components/Breadcrumb/components/index.js +1 -1
- package/dist/components/Button/Button.variants.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup.js +67 -63
- package/dist/components/ButtonGroup/ButtonGroup.variants.js +18 -5
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +51 -32
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.js +56 -8
- package/dist/components/Checkbox/Checkbox.variants.js +9 -6
- package/dist/components/Command/components/DialogContent.js +5 -5
- package/dist/components/ConfirmDialog/ConfirmDialog.js +1 -1
- package/dist/components/CopyButton/CopyButton.variants.js +4 -3
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
- package/dist/components/Datepicker/components/DatePickerContent/DatePickerContent.js +7 -7
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +15 -14
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +22 -22
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +6 -2
- package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +5 -5
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +1 -1
- package/dist/components/Range/Range.variants.js +9 -4
- package/dist/components/Select/Select.js +21 -20
- package/dist/components/Select/components/ListItem/ListItem.js +47 -37
- package/dist/components/Select/contexts/select.context.js +1 -0
- package/dist/components/Select/contexts/select.provider.js +28 -27
- package/dist/components/Sidebar/components/CollapseTrigger/CollapseTrigger.variants.js +3 -1
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.variants.js +6 -3
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -0
- package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +4 -2
- package/dist/components/Slider/Slider.variants.js +9 -4
- package/dist/components/Switch/Switch.variants.js +8 -4
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Toast/Toast.variants.js +7 -3
- package/dist/components/VirtualizedTable/assets/chevron-down.js +6 -6
- package/dist/components/VirtualizedTable/assets/chevron-up.js +4 -4
- package/dist/components/VirtualizedTable/components/Body/Body.js +59 -56
- package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +42 -40
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +85 -68
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +51 -49
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +34 -33
- package/dist/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.js +11 -11
- package/dist/components/VirtualizedTable/constants/index.js +10 -5
- package/dist/components/VirtualizedTable/constants/responsive.js +70 -1
- package/dist/components/VirtualizedTable/hooks/index.js +6 -2
- package/dist/components/VirtualizedTable/hooks/useDisplayedColumnCount/index.js +4 -0
- package/dist/components/VirtualizedTable/hooks/useDisplayedColumnCount/useDisplayedColumnCount.js +20 -0
- package/dist/components/VirtualizedTable/hooks/useIsFlexWrapped/index.js +4 -0
- package/dist/components/VirtualizedTable/hooks/useIsFlexWrapped/useIsFlexWrapped.js +18 -0
- package/dist/components/VirtualizedTable/utils/index.js +10 -8
- package/dist/components/VirtualizedTable/utils/responsive-edges/responsive-edges.js +8 -0
- package/dist/components/index.js +77 -73
- package/dist/{constants-q2QnJrOb.js → constants-YCGllWdf.js} +1 -1
- package/dist/index.js +77 -73
- package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +2 -0
- package/dist/lib/components/ButtonGroup/ButtonGroup.variants.d.ts +1 -0
- package/dist/lib/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.types.d.ts +2 -1
- package/dist/lib/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.variants.d.ts +9 -0
- package/dist/lib/components/Select/Select.types.d.ts +2 -0
- package/dist/lib/components/Select/contexts/select.context.d.ts +1 -0
- package/dist/lib/components/Select/contexts/select.provider.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +5 -0
- package/dist/lib/components/VirtualizedTable/assets/chevron-down.d.ts +1 -2
- package/dist/lib/components/VirtualizedTable/assets/chevron-up.d.ts +1 -2
- package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +10 -0
- package/dist/lib/components/VirtualizedTable/hooks/index.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/hooks/useDisplayedColumnCount/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/hooks/useDisplayedColumnCount/useDisplayedColumnCount.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/hooks/useIsFlexWrapped/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/hooks/useIsFlexWrapped/useIsFlexWrapped.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/responsive-edges/responsive-edges.d.ts +6 -0
- package/dist/package.json +8 -8
- package/dist/styles.css +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as r } from "../../dist-B9GE4SXf.js";
|
|
2
|
-
var
|
|
2
|
+
var t = r([
|
|
3
3
|
"overflow-hidden",
|
|
4
4
|
"rounded-lg",
|
|
5
5
|
"inset-ring",
|
|
@@ -77,7 +77,11 @@ var e = r([
|
|
|
77
77
|
"cursor-pointer",
|
|
78
78
|
"text-white",
|
|
79
79
|
"tap-target",
|
|
80
|
-
"touch-hit-area"
|
|
80
|
+
"touch-hit-area",
|
|
81
|
+
"rounded",
|
|
82
|
+
"outline-none",
|
|
83
|
+
"focus-visible:ring-1",
|
|
84
|
+
"focus-visible:ring-aurora-500"
|
|
81
85
|
], {
|
|
82
86
|
variants: { type: {
|
|
83
87
|
success: ["dark:text-green-300"],
|
|
@@ -90,7 +94,7 @@ var e = r([
|
|
|
90
94
|
export {
|
|
91
95
|
s as toastCloseButtonVariants,
|
|
92
96
|
i as toastDescriptionVariants,
|
|
93
|
-
|
|
97
|
+
t as toastFrameVariants,
|
|
94
98
|
o as toastIconVariants,
|
|
95
99
|
n as toastTitleVariants,
|
|
96
100
|
a as toastVariants
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
var
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
var o = ({ className: r }) => /* @__PURE__ */ e("svg", {
|
|
3
3
|
width: "7",
|
|
4
4
|
height: "5",
|
|
5
5
|
viewBox: "0 0 7 5",
|
|
6
6
|
fill: "none",
|
|
7
|
-
className:
|
|
8
|
-
|
|
9
|
-
children: /* @__PURE__ */
|
|
7
|
+
className: r,
|
|
8
|
+
"aria-hidden": !0,
|
|
9
|
+
children: /* @__PURE__ */ e("path", {
|
|
10
10
|
d: "M0.8225 0L3.5 2.67167L6.1775 0L7 0.8225L3.5 4.3225L0 0.8225L0.8225 0Z",
|
|
11
11
|
fill: "currentColor"
|
|
12
12
|
})
|
|
13
13
|
});
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
o as default
|
|
16
16
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
var
|
|
2
|
+
var t = ({ className: e }) => /* @__PURE__ */ r("svg", {
|
|
3
3
|
width: "7",
|
|
4
4
|
height: "5",
|
|
5
5
|
viewBox: "0 0 7 5",
|
|
6
6
|
fill: "currentColor",
|
|
7
|
-
className:
|
|
8
|
-
|
|
7
|
+
className: e,
|
|
8
|
+
"aria-hidden": !0,
|
|
9
9
|
children: /* @__PURE__ */ r("path", {
|
|
10
10
|
d: "M0.8225 4.99999L3.5 2.32832L6.1775 4.99999L7 4.17749L3.5 0.67749L0 4.17749L0.8225 4.99999Z",
|
|
11
11
|
fill: "currentColor"
|
|
12
12
|
})
|
|
13
13
|
});
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
t as default
|
|
16
16
|
};
|
|
@@ -1,77 +1,80 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import { Skeleton as
|
|
3
|
-
import { t as
|
|
4
|
-
import { HIDE_BELOW_CLASS as
|
|
5
|
-
import { useTableContext as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { n as X } from "../../../../table.provider-Dhs7WtwK.js";
|
|
2
|
+
import { Skeleton as Y } from "../Skeleton/Skeleton.js";
|
|
3
|
+
import { t as a } from "../../../../utils-DnIJruo0.js";
|
|
4
|
+
import { BORDER_EDGE_CLASSES as Z, HIDE_BELOW_CLASS as $, ROUNDED_BOTTOM_EDGE_CLASSES as I } from "../../constants/responsive.js";
|
|
5
|
+
import { useTableContext as ee } from "../../contexts/table.hook.js";
|
|
6
|
+
import { useDisplayedColumnCount as te } from "../../hooks/useDisplayedColumnCount/useDisplayedColumnCount.js";
|
|
7
|
+
import { getPinnedCellProps as re } from "../../utils/pinned-columns/pinned-columns.js";
|
|
8
|
+
import { getResponsiveEdgeClasses as N } from "../../utils/responsive-edges/responsive-edges.js";
|
|
9
|
+
import { isPaginationBarVisible as ae } from "../../utils/pagination.js";
|
|
10
|
+
import { ExpandableRow as oe } from "../ExpandableRow/ExpandableRow.js";
|
|
11
|
+
import { Fragment as ne } from "react";
|
|
12
|
+
import { jsx as e, jsxs as se } from "react/jsx-runtime";
|
|
13
|
+
var Ee = ({ isLoading: D, showPagination: _, emptyState: B, errorState: l }) => {
|
|
14
|
+
const { table: i, pageSize: S, totalItems: L = -1 / 0, tableLoading: O, tableError: g, enableExpandedRow: A, classNameExpandedRow: j, classNameExpandedCell: z, classNameExpandedContent: P, enableHoverRow: E, classNameHoverRow: V, classNameActiveExpandedRow: H, renderExpandedRow: k, isBorderOnAdjacentCell: M, isExpandColumnVisible: T, pinnedWidths: F } = ee(), [G, W] = te();
|
|
15
|
+
if (D || O) return /* @__PURE__ */ e(Y, {
|
|
16
|
+
numberOfRows: S,
|
|
17
|
+
table: i
|
|
16
18
|
});
|
|
17
|
-
const
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
19
|
+
const t = i.getRowModel().rows ?? [], d = _ && ae(L), w = t.length === 0 && !!g && !!l, C = t.length > 0 ? null : g && l ? typeof l == "function" ? l(g) : l : B ?? null;
|
|
20
|
+
if (C) {
|
|
21
|
+
const m = W ?? i.getVisibleLeafColumns().length;
|
|
20
22
|
return /* @__PURE__ */ e("tbody", {
|
|
21
|
-
|
|
23
|
+
ref: G,
|
|
24
|
+
className: a("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
|
|
22
25
|
children: /* @__PURE__ */ e("tr", {
|
|
23
|
-
className:
|
|
26
|
+
className: a(w ? "kvt-error-row" : "kvt-empty-row", "border-b", "border-b-gray-200", "dark:border-b-metal-700", "bg-transparent"),
|
|
24
27
|
"data-empty-row": !0,
|
|
25
|
-
"data-error-row":
|
|
28
|
+
"data-error-row": w ? !0 : void 0,
|
|
26
29
|
children: /* @__PURE__ */ e("td", {
|
|
27
|
-
colSpan:
|
|
28
|
-
className:
|
|
30
|
+
colSpan: m,
|
|
31
|
+
className: a("p-0", "bg-white", "dark:bg-metal-900", "dark:border", "dark:border-metal-700", "rounded-b-lg"),
|
|
29
32
|
children: /* @__PURE__ */ e("div", {
|
|
30
33
|
className: "flex items-center justify-center",
|
|
31
|
-
children:
|
|
34
|
+
children: C
|
|
32
35
|
})
|
|
33
36
|
})
|
|
34
37
|
})
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
return /* @__PURE__ */ e("tbody", {
|
|
38
|
-
className:
|
|
39
|
-
children:
|
|
40
|
-
const { id:
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
"data-row-id":
|
|
44
|
-
...
|
|
45
|
-
children:
|
|
46
|
-
const
|
|
41
|
+
className: a("kvt-body", "text-slate-800", "text-sm", "font-normal", "relative", "dark:border-x"),
|
|
42
|
+
children: t.map((m, c) => {
|
|
43
|
+
const { id: f, original: u, getVisibleCells: U } = m, { meta: p = {} } = u, o = U(), n = A && m.getIsExpanded(), q = !!p.expandedRow || !!k, h = o.map(({ column: x }) => x.columnDef.meta?.hideBelow), s = h.some(Boolean) && o[0]?.column.id !== "__expand", J = c === t.length - 1 && !d && !n, R = o[0]?.column.id !== "__expand" || T ? 0 : M ? 1 : null;
|
|
44
|
+
return /* @__PURE__ */ se(ne, { children: [/* @__PURE__ */ e("tr", {
|
|
45
|
+
className: a("kvt-row", { "group/row": E }, "border-b", "border-b-gray-200", "dark:text-metal-50", "dark:border-b-metal-700", "bg-transparent", p.className),
|
|
46
|
+
"data-row-id": f,
|
|
47
|
+
...p.attributes ?? {},
|
|
48
|
+
children: o.map(({ id: x, column: r, getContext: K }, b) => {
|
|
49
|
+
const Q = typeof r.columnDef.meta?.className == "function" ? r.columnDef.meta?.className(u) : r.columnDef.meta?.className, { hideBelow: v } = r.columnDef.meta ?? {}, y = re(i, r, F);
|
|
47
50
|
return /* @__PURE__ */ e("td", {
|
|
48
|
-
style:
|
|
49
|
-
className:
|
|
50
|
-
"group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800":
|
|
51
|
-
[
|
|
52
|
-
},
|
|
53
|
-
"rounded-bl-lg":
|
|
54
|
-
"rounded-br-lg":
|
|
55
|
-
"dark:[tr:last-child_&]:border-b": !
|
|
51
|
+
style: y.style,
|
|
52
|
+
className: a("kvt-cell", "px-4", "py-1", "text-sm", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", !s && "dark:first:border-l", !s && "dark:last:border-r", s && N(h, b, Z), s && J && N(h, b, I), "[tr[data-actions-open]_&]:bg-zinc-100", "dark:[tr[data-actions-open]_&]:bg-metal-800", {
|
|
53
|
+
"group-hover/row:bg-zinc-100 dark:group-hover/row:bg-metal-800": E,
|
|
54
|
+
[a("bg-zinc-100 dark:bg-metal-800", H)]: !!n
|
|
55
|
+
}, V, y.className, v && $[v], Q, {
|
|
56
|
+
"rounded-bl-lg": !s && c === t.length - 1 && R !== null && b === R && !d && !n,
|
|
57
|
+
"rounded-br-lg": !s && c === t.length - 1 && b === o.length - 1 && !d && !n,
|
|
58
|
+
"dark:[tr:last-child_&]:border-b": !d
|
|
56
59
|
}),
|
|
57
|
-
"data-expanded":
|
|
58
|
-
...
|
|
59
|
-
children:
|
|
60
|
-
},
|
|
60
|
+
"data-expanded": n ? !0 : void 0,
|
|
61
|
+
...r.columnDef.meta?.attributes ?? {},
|
|
62
|
+
children: X(r.columnDef.cell, K())
|
|
63
|
+
}, x);
|
|
61
64
|
})
|
|
62
|
-
}),
|
|
63
|
-
classNameExpandedCell:
|
|
64
|
-
classNameExpandedContent:
|
|
65
|
-
classNameExpandedRow:
|
|
66
|
-
colSpan:
|
|
67
|
-
id:
|
|
68
|
-
isExpanded: !!
|
|
69
|
-
isLastRow:
|
|
70
|
-
children:
|
|
71
|
-
})] },
|
|
65
|
+
}), q && /* @__PURE__ */ e(oe, {
|
|
66
|
+
classNameExpandedCell: z,
|
|
67
|
+
classNameExpandedContent: P,
|
|
68
|
+
classNameExpandedRow: j,
|
|
69
|
+
colSpan: o.length,
|
|
70
|
+
id: f,
|
|
71
|
+
isExpanded: !!n,
|
|
72
|
+
isLastRow: c === t.length - 1 && !d,
|
|
73
|
+
children: p.expandedRow ?? k?.(u)
|
|
74
|
+
})] }, f);
|
|
72
75
|
})
|
|
73
76
|
});
|
|
74
77
|
};
|
|
75
78
|
export {
|
|
76
|
-
|
|
79
|
+
Ee as Body
|
|
77
80
|
};
|
|
@@ -1,103 +1,105 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { t as
|
|
1
|
+
import { t as m } from "../../../../chevron-left-B1zWfqll.js";
|
|
2
|
+
import { t as f } from "../../../../chevron-right-D4OkgIIT.js";
|
|
3
3
|
import { t as p } from "../../../../utils-DnIJruo0.js";
|
|
4
|
-
import { useTableContext as
|
|
4
|
+
import { useTableContext as g } from "../../contexts/table.hook.js";
|
|
5
5
|
import { memo as u } from "react";
|
|
6
|
-
import { jsx as i, jsxs as
|
|
7
|
-
var
|
|
6
|
+
import { jsx as i, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
var a = u(({ index: t, currentPage: e, handlePage: n }) => /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
|
|
8
8
|
type: "button",
|
|
9
|
-
onClick: () =>
|
|
10
|
-
className: p("px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500", { "bg-blue-600 text-white font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e }),
|
|
9
|
+
onClick: () => n(t),
|
|
10
|
+
className: p("inline-flex items-center justify-center px-2.5 py-1 rounded-lg text-blue-600 cursor-pointer dark:text-aurora-500 outline-none focus-visible:ring-1 focus-visible:ring-aurora-500", "tap-target pointer-coarse:min-h-11 pointer-coarse:min-w-11 active:bg-blue-50 dark:active:bg-metal-700", { "bg-blue-600 text-white font-semibold dark:bg-aurora-500 dark:text-metal-800": t === e }),
|
|
11
11
|
children: t + 1
|
|
12
12
|
}) }, t));
|
|
13
|
-
|
|
14
|
-
var
|
|
13
|
+
a.displayName = "KonstructPageButton";
|
|
14
|
+
var l = u(({ keyValue: t }) => /* @__PURE__ */ i("li", {
|
|
15
15
|
className: "px-2",
|
|
16
16
|
children: /* @__PURE__ */ i("span", {
|
|
17
17
|
className: "text-blue-600 select-none dark:text-aurora-500",
|
|
18
18
|
children: "..."
|
|
19
19
|
})
|
|
20
20
|
}, t));
|
|
21
|
-
|
|
22
|
-
var o = u(({ direction: t, disabled: e, onClick:
|
|
21
|
+
l.displayName = "KonstructEllipsis";
|
|
22
|
+
var o = u(({ direction: t, disabled: e, onClick: n }) => /* @__PURE__ */ i("li", {
|
|
23
23
|
className: "flex items-center justify-center",
|
|
24
24
|
children: /* @__PURE__ */ i("button", {
|
|
25
|
-
|
|
25
|
+
type: "button",
|
|
26
|
+
className: "flex items-center justify-center rounded outline-none focus-visible:ring-1 focus-visible:ring-aurora-500 tap-target pointer-coarse:min-h-11 pointer-coarse:min-w-11",
|
|
27
|
+
onClick: n,
|
|
26
28
|
disabled: e,
|
|
27
|
-
children: /* @__PURE__ */ i(t === "left" ?
|
|
29
|
+
children: /* @__PURE__ */ i(t === "left" ? m : f, { className: p("h-6 w-6 cursor-pointer", {
|
|
28
30
|
"text-blue-600 dark:text-aurora-500": !e,
|
|
29
31
|
"text-slate-400 cursor-not-allowed": e
|
|
30
32
|
}) })
|
|
31
33
|
})
|
|
32
34
|
}));
|
|
33
35
|
o.displayName = "KonstructNavigationButton";
|
|
34
|
-
var
|
|
35
|
-
const { totalPages: t, page: e, handlePage:
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
var N = () => {
|
|
37
|
+
const { totalPages: t, page: e, handlePage: n } = g();
|
|
38
|
+
return /* @__PURE__ */ d("ul", {
|
|
37
39
|
className: "flex items-center gap-2",
|
|
38
40
|
children: [
|
|
39
41
|
/* @__PURE__ */ i(o, {
|
|
40
42
|
direction: "left",
|
|
41
|
-
onClick: () =>
|
|
43
|
+
onClick: () => n(e - 1),
|
|
42
44
|
disabled: e === 0
|
|
43
45
|
}),
|
|
44
46
|
(() => {
|
|
45
|
-
if (t <= 5) return Array.from({ length: t }, (r, c) => /* @__PURE__ */ i(
|
|
47
|
+
if (t <= 5) return Array.from({ length: t }, (r, c) => /* @__PURE__ */ i(a, {
|
|
46
48
|
index: c,
|
|
47
49
|
currentPage: e,
|
|
48
|
-
handlePage:
|
|
50
|
+
handlePage: n
|
|
49
51
|
}, c));
|
|
50
|
-
const
|
|
52
|
+
const s = [];
|
|
51
53
|
if (e < 3) {
|
|
52
|
-
for (let r = 0; r < 3; r++)
|
|
54
|
+
for (let r = 0; r < 3; r++) s.push(/* @__PURE__ */ i(a, {
|
|
53
55
|
index: r,
|
|
54
56
|
currentPage: e,
|
|
55
|
-
handlePage:
|
|
57
|
+
handlePage: n
|
|
56
58
|
}, r));
|
|
57
|
-
|
|
58
|
-
for (let r = t - 2; r < t; r++)
|
|
59
|
+
s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis" }, "ellipsis"));
|
|
60
|
+
for (let r = t - 2; r < t; r++) s.push(/* @__PURE__ */ i(a, {
|
|
59
61
|
index: r,
|
|
60
62
|
currentPage: e,
|
|
61
|
-
handlePage:
|
|
63
|
+
handlePage: n
|
|
62
64
|
}, r));
|
|
63
65
|
} else if (e >= t - 5) {
|
|
64
|
-
|
|
66
|
+
s.push(/* @__PURE__ */ i(a, {
|
|
65
67
|
index: 0,
|
|
66
68
|
currentPage: e,
|
|
67
|
-
handlePage:
|
|
68
|
-
}, 0)), t > 6 &&
|
|
69
|
-
for (let r = Math.max(1, t - 5); r < t; r++)
|
|
69
|
+
handlePage: n
|
|
70
|
+
}, 0)), t > 6 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis" }, "ellipsis"));
|
|
71
|
+
for (let r = Math.max(1, t - 5); r < t; r++) s.push(/* @__PURE__ */ i(a, {
|
|
70
72
|
index: r,
|
|
71
73
|
currentPage: e,
|
|
72
|
-
handlePage:
|
|
74
|
+
handlePage: n
|
|
73
75
|
}, r));
|
|
74
76
|
} else {
|
|
75
|
-
|
|
77
|
+
s.push(/* @__PURE__ */ i(a, {
|
|
76
78
|
index: 0,
|
|
77
79
|
currentPage: e,
|
|
78
|
-
handlePage:
|
|
79
|
-
}, 0)), e > 3 &&
|
|
80
|
-
for (let r = e - 1; r <= e + 1; r++) r > 0 && r < t - 1 &&
|
|
80
|
+
handlePage: n
|
|
81
|
+
}, 0)), e > 3 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis1" }, "ellipsis1"));
|
|
82
|
+
for (let r = e - 1; r <= e + 1; r++) r > 0 && r < t - 1 && s.push(/* @__PURE__ */ i(a, {
|
|
81
83
|
index: r,
|
|
82
84
|
currentPage: e,
|
|
83
|
-
handlePage:
|
|
85
|
+
handlePage: n
|
|
84
86
|
}, r));
|
|
85
|
-
e < t - 4 &&
|
|
87
|
+
e < t - 4 && s.push(/* @__PURE__ */ i(l, { keyValue: "ellipsis2" }, "ellipsis2")), s.push(/* @__PURE__ */ i(a, {
|
|
86
88
|
index: t - 1,
|
|
87
89
|
currentPage: e,
|
|
88
|
-
handlePage:
|
|
90
|
+
handlePage: n
|
|
89
91
|
}, t - 1));
|
|
90
92
|
}
|
|
91
|
-
return
|
|
93
|
+
return s;
|
|
92
94
|
})(),
|
|
93
95
|
/* @__PURE__ */ i(o, {
|
|
94
96
|
direction: "right",
|
|
95
|
-
onClick: () =>
|
|
97
|
+
onClick: () => n(e + 1),
|
|
96
98
|
disabled: e >= t - 1
|
|
97
99
|
})
|
|
98
100
|
]
|
|
99
101
|
});
|
|
100
102
|
};
|
|
101
103
|
export {
|
|
102
|
-
|
|
104
|
+
N as DotPaginate
|
|
103
105
|
};
|
|
@@ -1,65 +1,68 @@
|
|
|
1
|
-
import { o as
|
|
2
|
-
import { t as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Filter as
|
|
5
|
-
import { resetEvent as
|
|
6
|
-
import { t as
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { o as U } from "../../../../rolldown-runtime-B28h4lGi.js";
|
|
2
|
+
import { t as X } from "../../../../debounce-DhCY9mXz.js";
|
|
3
|
+
import { Button as x } from "../../../Button/Button.js";
|
|
4
|
+
import { Filter as n } from "../../../Filter/Filter.js";
|
|
5
|
+
import { resetEvent as Y } from "../../../Filter/events/index.js";
|
|
6
|
+
import { t as Z } from "../../../../Input-CE6J6HIW.js";
|
|
7
|
+
import { t as d } from "../../../../utils-DnIJruo0.js";
|
|
8
|
+
import { HIDE_BELOW_CLASS as C, SHOW_BELOW_CLASS as ee } from "../../constants/responsive.js";
|
|
9
|
+
import { useTableContext as te } from "../../contexts/table.hook.js";
|
|
10
|
+
import { useIsFlexWrapped as ae } from "../../hooks/useIsFlexWrapped/useIsFlexWrapped.js";
|
|
11
|
+
import { t as re } from "../../../../events.types-BG1Uh8i6.js";
|
|
12
|
+
import { getTableId as oe } from "../../utils/get-table-id.js";
|
|
13
|
+
import { useEffect as se, useMemo as ne, useRef as D } from "react";
|
|
14
|
+
import { jsx as o, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
var le = /* @__PURE__ */ U(X(), 1), De = ({ id: T, actions: _, filters: O, multiSelectFilter: k, placeholder: A, showFilterInput: b = !0, showResetButton: E = !0, resetButtonClassName: B, closeOnApply: I = !0 }) => {
|
|
16
|
+
const l = D(null), v = D(null), M = ae(v), m = oe(T), { termOfSearch: j, multiselectSelected: N, dateFilters: f, dateRangeFilters: g, timeFilters: L, onChangeTermOfSearch: c, onSelectMultiselect: P, onSelectDateFilter: W, onSelectDateRangeFilter: S, onSelectTimeFilter: z } = te(), w = [...O ?? k?.map((e) => ({
|
|
15
17
|
...e,
|
|
16
18
|
type: "badgeMultiSelect"
|
|
17
|
-
})) ?? [], ...
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
|
|
19
|
+
})) ?? [], ..._ ?? []], H = w.filter((e) => e.type === "action" && !!e.iconOnlyBelow), F = (e, t) => {
|
|
20
|
+
P(e, t.map((r) => r.id));
|
|
21
|
+
}, q = () => {
|
|
22
|
+
c(""), l.current && (l.current.value = "");
|
|
21
23
|
};
|
|
22
|
-
|
|
24
|
+
se(() => {
|
|
23
25
|
const e = new AbortController();
|
|
24
|
-
return document.addEventListener(
|
|
26
|
+
return document.addEventListener(re.RESET_FILTERS, (t) => {
|
|
25
27
|
const { detail: r } = t;
|
|
26
|
-
r.tableId ===
|
|
28
|
+
r.tableId === m && (c(""), l.current && (l.current.value = ""), Y(m));
|
|
27
29
|
}, { signal: e.signal }), () => e.abort();
|
|
28
|
-
}, [
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
}, 500), [
|
|
30
|
+
}, [m, c]);
|
|
31
|
+
const V = ne(() => (0, le.default)((e) => {
|
|
32
|
+
c(e.target.value);
|
|
33
|
+
}, 500), [c]), $ = !!j || Object.values(N ?? {}).flat().length > 0 || Object.values(f ?? {}).some(Boolean) || Object.values(g ?? {}).some(Boolean) || Object.values(L ?? {}).some(Boolean), G = (e) => {
|
|
32
34
|
if (e.type === "action") {
|
|
33
|
-
const { label: a, appearance:
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
appearance:
|
|
36
|
-
variant:
|
|
37
|
-
|
|
35
|
+
const { label: a, appearance: p = "compact", variant: i = "secondary", leftIcon: u, rightIcon: h, iconOnlyBelow: R, className: K, type: ce, ...Q } = e;
|
|
36
|
+
return /* @__PURE__ */ y(x, {
|
|
37
|
+
appearance: p,
|
|
38
|
+
variant: i,
|
|
39
|
+
className: d(R && C[R], K),
|
|
40
|
+
...Q,
|
|
38
41
|
children: [
|
|
39
42
|
u,
|
|
40
43
|
a,
|
|
41
|
-
|
|
44
|
+
h
|
|
42
45
|
]
|
|
43
46
|
}, a);
|
|
44
47
|
}
|
|
45
|
-
const { key: t, label: r, position: s = "right" } = e;
|
|
46
|
-
if (e.type === "textMultiSelect") return /* @__PURE__ */ n
|
|
48
|
+
const { key: t, label: r, position: s = M ? "left" : "right" } = e;
|
|
49
|
+
if (e.type === "textMultiSelect") return /* @__PURE__ */ o(n.TextMultiSelect, {
|
|
47
50
|
label: r,
|
|
48
51
|
position: s,
|
|
49
52
|
options: e.options,
|
|
50
53
|
onApply: (a) => {
|
|
51
|
-
|
|
54
|
+
F(t, a);
|
|
52
55
|
}
|
|
53
56
|
}, t);
|
|
54
|
-
if (e.type === "date") return /* @__PURE__ */ n
|
|
57
|
+
if (e.type === "date") return /* @__PURE__ */ o(n.DateFilterDropdown, {
|
|
55
58
|
label: r,
|
|
56
59
|
position: s,
|
|
57
60
|
countryCode: e.countryCode,
|
|
58
61
|
onApply: (a) => {
|
|
59
|
-
|
|
62
|
+
W(t, a);
|
|
60
63
|
}
|
|
61
64
|
}, t);
|
|
62
|
-
if (e.type === "dateRange") return /* @__PURE__ */ n
|
|
65
|
+
if (e.type === "dateRange") return /* @__PURE__ */ o(n.DateRangeFilterDropdown, {
|
|
63
66
|
label: r,
|
|
64
67
|
position: s,
|
|
65
68
|
showTime: e.showTime,
|
|
@@ -70,60 +73,74 @@ var Z = /* @__PURE__ */ z(V(), 1), de = ({ id: F, actions: b, filters: v, multiS
|
|
|
70
73
|
maxDate: e.maxDate,
|
|
71
74
|
countryCode: e.countryCode,
|
|
72
75
|
onApply: (a) => {
|
|
73
|
-
|
|
76
|
+
S(t, a);
|
|
74
77
|
},
|
|
75
78
|
onRangeChange: e.onRangeChange
|
|
76
79
|
}, t);
|
|
77
80
|
if (e.type === "customDateRange") {
|
|
78
|
-
const { key: a, type:
|
|
79
|
-
return /* @__PURE__ */ n
|
|
80
|
-
...
|
|
81
|
+
const { key: a, type: p, ...i } = e;
|
|
82
|
+
return /* @__PURE__ */ o(n.CustomDateRangeFilterDropdown, {
|
|
83
|
+
...i,
|
|
81
84
|
position: s,
|
|
82
85
|
onApply: (u) => {
|
|
83
|
-
|
|
86
|
+
S(t, u);
|
|
84
87
|
}
|
|
85
88
|
}, t);
|
|
86
89
|
}
|
|
87
|
-
return e.type === "time" ? /* @__PURE__ */ n
|
|
90
|
+
return e.type === "time" ? /* @__PURE__ */ o(n.TimeFilterDropdown, {
|
|
88
91
|
label: r,
|
|
89
92
|
position: s,
|
|
90
93
|
format: e.format,
|
|
91
94
|
presets: e.presets,
|
|
92
95
|
showTimePicker: e.showTimePicker,
|
|
93
96
|
onApply: (a) => {
|
|
94
|
-
|
|
97
|
+
z(t, a);
|
|
95
98
|
}
|
|
96
|
-
}, t) : /* @__PURE__ */ n
|
|
99
|
+
}, t) : /* @__PURE__ */ o(n.BadgeMultiSelect, {
|
|
97
100
|
label: r,
|
|
98
101
|
position: s,
|
|
99
102
|
options: e.options,
|
|
100
103
|
onApply: (a) => {
|
|
101
|
-
|
|
104
|
+
F(t, a);
|
|
102
105
|
}
|
|
103
106
|
}, t);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
107
|
+
}, J = ({ label: e, variant: t = "secondary", leftIcon: r, rightIcon: s, iconOnlyBelow: a, className: p, appearance: i, type: u, ...h }) => /* @__PURE__ */ o(x, {
|
|
108
|
+
variant: t,
|
|
109
|
+
"aria-label": e,
|
|
110
|
+
className: d("relative size-10 shrink-0 p-0 pointer-coarse:min-h-10 touch-hit-area [&>svg]:size-5", a && ee[a], p),
|
|
111
|
+
...h,
|
|
112
|
+
children: r ?? s
|
|
113
|
+
}, e);
|
|
114
|
+
return /* @__PURE__ */ y("div", {
|
|
115
|
+
ref: v,
|
|
116
|
+
className: d("kvt-filter w-full flex flex-wrap items-center gap-4 pb-6", b ? "justify-between" : "justify-end"),
|
|
117
|
+
children: [
|
|
118
|
+
b && /* @__PURE__ */ o("div", {
|
|
119
|
+
className: "kvt-search-wrapper w-60 min-w-0 max-sm:grow max-sm:basis-0",
|
|
120
|
+
children: /* @__PURE__ */ o(Z, {
|
|
121
|
+
ref: l,
|
|
122
|
+
placeholder: A,
|
|
123
|
+
isSearch: !0,
|
|
124
|
+
autoComplete: "false",
|
|
125
|
+
className: "kvt-search w-full",
|
|
126
|
+
inputMode: "search",
|
|
127
|
+
onChange: V
|
|
128
|
+
})
|
|
129
|
+
}),
|
|
130
|
+
H.map(J),
|
|
131
|
+
/* @__PURE__ */ y(n, {
|
|
132
|
+
className: "kvt-filter-actions flex-wrap gap-4 max-sm:basis-full",
|
|
133
|
+
closeOnApply: I,
|
|
134
|
+
resetScope: m,
|
|
135
|
+
children: [w.map(G), E && /* @__PURE__ */ o(n.ResetButton, {
|
|
136
|
+
className: d("select-none max-md:ml-auto", B),
|
|
137
|
+
disabled: !$,
|
|
138
|
+
onClick: q
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
]
|
|
125
142
|
});
|
|
126
143
|
};
|
|
127
144
|
export {
|
|
128
|
-
|
|
145
|
+
De as Filter
|
|
129
146
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as s } from "../../../../Input-
|
|
1
|
+
import { t as s } from "../../../../Input-CE6J6HIW.js";
|
|
2
2
|
import { Typography as i } from "../../../Typography/Typography.js";
|
|
3
3
|
import { Button as p } from "../../../Button/Button.js";
|
|
4
4
|
import { useTableContext as u } from "../../contexts/table.hook.js";
|