@konstructio/ui 0.1.2-alpha.119 → 0.1.2-alpha.120
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-DDRmDlWK.js +93 -0
- package/dist/{Checkbox-DRdyrKjk.js → Checkbox-DrounE52.js} +2 -2
- package/dist/{CollapsedSteps-CR7oCTRC.js → CollapsedSteps-DvBeYShi.js} +3 -3
- package/dist/{CommandInput-Du2o616y.js → CommandInput-_vujzQ6B.js} +2 -2
- package/dist/{Counter-DMkXIsOO.js → Counter-LQ5_uh06.js} +2 -2
- package/dist/{DayPicker-BtpJg2q3.js → DayPicker-D7KFB2bI.js} +383 -383
- package/dist/DropdownButton-BWfWN4fg.js +121 -0
- package/dist/{HamburgerTrigger-BgeS_nBA.js → HamburgerTrigger-CfrAnhmG.js} +10 -10
- package/dist/{Input-2M2I_H60.js → Input-O2bqyJKW.js} +2 -2
- package/dist/Modal-B-l4ii6w.js +84 -0
- package/dist/{Wrapper-JmStmade.js → Wrapper-B5PmrW4J.js} +3 -3
- package/dist/{Wrapper-ThpRi_Gg.js → Wrapper-CZCSSCLm.js} +2 -2
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
- package/dist/components/Breadcrumb/components/CollapsedSteps/CollapsedSteps.js +1 -1
- package/dist/components/Breadcrumb/components/index.js +1 -1
- package/dist/components/Button/Button.variants.js +1 -0
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/CheckboxCard/CheckboxCard.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/index.js +1 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.js +7 -5
- package/dist/components/CopyButton/CopyButton.variants.js +3 -1
- package/dist/components/Counter/Counter.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.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 +1 -1
- package/dist/components/Drawer/Drawer.js +78 -58
- package/dist/components/Drawer/Drawer.variants.js +40 -22
- package/dist/components/Drawer/components/Footer/Footer.js +5 -5
- package/dist/components/Drawer/constants/index.js +5 -4
- package/dist/components/DropdownButton/DropdownButton.js +1 -1
- package/dist/components/DropdownButton/components/ActionSheet/ActionSheet.js +34 -0
- package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +1 -1
- package/dist/components/Filter/utils/index.js +2 -2
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/Input.variants.js +1 -0
- package/dist/components/LineChart/components/LineChartContent/LineChartContent.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +12 -6
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
- package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
- package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/MultiSelectDropdown/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/PhoneNumberInputContent.js +2 -2
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
- package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
- package/dist/components/PhoneNumberInput/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
- package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
- package/dist/components/PhoneNumberInput/utils/index.js +1 -1
- package/dist/components/PieChart/components/PieChartContent/PieChartContent.js +1 -1
- package/dist/components/Select/Select.variants.js +2 -0
- package/dist/components/Select/components/List/List.js +2 -2
- package/dist/components/Sheet/Sheet.js +130 -0
- package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
- package/dist/components/Sidebar/components/Wrapper/Wrapper.js +103 -86
- package/dist/components/Sidebar/components/index.js +1 -1
- package/dist/components/Table/components/Filter.js +1 -1
- package/dist/components/Tabs/components/Trigger.js +13 -13
- package/dist/components/TagSelect/TagSelect.js +1 -1
- package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
- package/dist/components/TagSelect/components/index.js +1 -1
- package/dist/components/TextArea/TextArea.variants.js +1 -0
- package/dist/components/VirtualizedTable/components/Actions/components/ActionsTrigger/ActionsTrigger.js +7 -7
- package/dist/components/VirtualizedTable/components/Body/Body.js +47 -44
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +68 -68
- package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +1 -1
- package/dist/components/VirtualizedTable/components/Header/Header.js +38 -31
- package/dist/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.js +75 -0
- package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +42 -35
- package/dist/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.js +72 -72
- package/dist/components/VirtualizedTable/components/index.js +14 -12
- package/dist/components/VirtualizedTable/constants/index.js +5 -3
- package/dist/components/VirtualizedTable/constants/responsive.js +10 -0
- package/dist/components/VirtualizedTable/contexts/index.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.js +4 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
- package/dist/components/VirtualizedTable/utils/index.js +8 -4
- package/dist/components/VirtualizedTable/utils/pinned-columns/index.js +6 -0
- package/dist/components/VirtualizedTable/utils/pinned-columns/pinned-columns.js +32 -0
- package/dist/components/index.js +147 -145
- package/dist/{components-B_SWqhCL.js → components-Bq71eyUH.js} +1 -1
- package/dist/{country-locale-map-DbrJ3bEE.js → country-locale-map-BQYYErun.js} +1407 -1407
- package/dist/{debounce-dMRJxNsT.js → debounce-DhCY9mXz.js} +2 -2
- package/dist/{dist-Dg3vyTx9.js → dist-BCqfbYE9.js} +1356 -1317
- package/dist/dist-CMqY_9n-.js +445 -0
- package/dist/{es2015-B_07N-UL.js → es2015-BvX7Yq5Q.js} +2 -2
- package/dist/index.js +158 -156
- package/dist/{isSymbol-BG9higgO.js → isSymbol-CcfkyZfq.js} +1 -1
- package/dist/lib/components/Drawer/Drawer.types.d.ts +10 -0
- package/dist/lib/components/Drawer/Drawer.variants.d.ts +1 -0
- package/dist/lib/components/Drawer/constants/index.d.ts +1 -0
- package/dist/lib/components/DropdownButton/DropdownButton.d.ts +2 -1
- package/dist/lib/components/DropdownButton/DropdownButton.types.d.ts +25 -0
- package/dist/lib/components/DropdownButton/components/ActionSheet/ActionSheet.d.ts +7 -0
- package/dist/lib/components/DropdownButton/components/ActionSheet/ActionSheet.types.d.ts +12 -0
- package/dist/lib/components/Modal/Modal.types.d.ts +2 -0
- package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -0
- package/dist/lib/components/Sheet/Sheet.d.ts +21 -0
- package/dist/lib/components/Sheet/Sheet.types.d.ts +39 -0
- package/dist/lib/components/Sidebar/Sidebar.types.d.ts +9 -0
- package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +11 -2
- package/dist/lib/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.d.ts +10 -0
- package/dist/lib/components/VirtualizedTable/components/ScrollContainer/ScrollContainer.types.d.ts +6 -0
- package/dist/lib/components/VirtualizedTable/components/VirtualizedTableContent/VirtualizedTableContent.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/components/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/constants/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +2 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +4 -0
- package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
- package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +2 -1
- package/dist/lib/components/VirtualizedTable/utils/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/pinned-columns/index.d.ts +1 -0
- package/dist/lib/components/VirtualizedTable/utils/pinned-columns/pinned-columns.d.ts +23 -0
- package/dist/lib/components/index.d.ts +3 -1
- package/dist/{libphonenumber-DtibHRPP.js → libphonenumber-BIeQOhzl.js} +196 -164
- package/dist/package.json +18 -18
- package/dist/{phone-number.provider-DnuL-yYF.js → phone-number.provider-CJeivoDY.js} +2 -2
- package/dist/{prop-types-BCUW56rg.js → prop-types-qsAjMBb1.js} +1 -1
- package/dist/{rolldown-runtime-Dw9YIBcH.js → rolldown-runtime-B28h4lGi.js} +6 -6
- package/dist/styles.css +1 -1
- package/dist/{table.provider-CzfMGbe4.js → table.provider-QUo2buYX.js} +561 -523
- package/dist/{x-Vur_9PXW.js → x-BmNOD9Gr.js} +2 -2
- package/package.json +18 -18
- package/dist/Breadcrumb-CpXRb08J.js +0 -93
- package/dist/DropdownButton-JilCRLJY.js +0 -92
- package/dist/Modal-0Wp5szX4.js +0 -84
- package/dist/dist-BCoDIdCt.js +0 -429
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { o as
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { resetEvent as
|
|
6
|
-
import { Filter as
|
|
7
|
-
import { t as
|
|
8
|
-
import { useTableContext as
|
|
9
|
-
import { t as
|
|
10
|
-
import { getTableId as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { jsx as n, jsxs as
|
|
13
|
-
var
|
|
14
|
-
const l =
|
|
1
|
+
import { o as z } from "../../../../rolldown-runtime-B28h4lGi.js";
|
|
2
|
+
import { t as V } from "../../../../Input-O2bqyJKW.js";
|
|
3
|
+
import { t as $ } from "../../../../utils-DnIJruo0.js";
|
|
4
|
+
import { Button as G } from "../../../Button/Button.js";
|
|
5
|
+
import { resetEvent as H } from "../../../Filter/events/index.js";
|
|
6
|
+
import { Filter as o } from "../../../Filter/Filter.js";
|
|
7
|
+
import { t as J } from "../../../../debounce-DhCY9mXz.js";
|
|
8
|
+
import { useTableContext as K } from "../../contexts/table.hook.js";
|
|
9
|
+
import { t as Q } from "../../../../events.types-BG1Uh8i6.js";
|
|
10
|
+
import { getTableId as U } from "../../utils/get-table-id.js";
|
|
11
|
+
import { useEffect as W, useMemo as X, useRef as Y } from "react";
|
|
12
|
+
import { jsx as n, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
var Z = /* @__PURE__ */ z(J(), 1), de = ({ id: F, actions: b, filters: v, multiSelectFilter: w, placeholder: S, showFilterInput: x = !0, showResetButton: R = !0, resetButtonClassName: D, closeOnApply: T = !0 }) => {
|
|
14
|
+
const l = Y(null), c = U(F), { termOfSearch: k, multiselectSelected: M, dateFilters: E, dateRangeFilters: _, timeFilters: j, onChangeTermOfSearch: m, onSelectMultiselect: A, onSelectDateFilter: I, onSelectDateRangeFilter: i, onSelectTimeFilter: O } = K(), B = [...v ?? w?.map((e) => ({
|
|
15
15
|
...e,
|
|
16
16
|
type: "badgeMultiSelect"
|
|
17
17
|
})) ?? [], ...b ?? []], h = (e, t) => {
|
|
18
|
-
A(e, t.map((
|
|
18
|
+
A(e, t.map((r) => r.id));
|
|
19
19
|
}, P = () => {
|
|
20
|
-
|
|
20
|
+
m(""), l.current && (l.current.value = "");
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
W(() => {
|
|
23
23
|
const e = new AbortController();
|
|
24
|
-
return document.addEventListener(
|
|
25
|
-
const { detail:
|
|
26
|
-
|
|
24
|
+
return document.addEventListener(Q.RESET_FILTERS, (t) => {
|
|
25
|
+
const { detail: r } = t;
|
|
26
|
+
r.tableId === c && (m(""), l.current && (l.current.value = ""), H(c));
|
|
27
27
|
}, { signal: e.signal }), () => e.abort();
|
|
28
|
-
}, [
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
}, 500), [
|
|
28
|
+
}, [c, m]);
|
|
29
|
+
const g = X(() => (0, Z.default)((e) => {
|
|
30
|
+
m(e.target.value);
|
|
31
|
+
}, 500), [m]), N = !!k || Object.values(M ?? {}).flat().length > 0 || Object.values(E ?? {}).some(Boolean) || Object.values(_ ?? {}).some(Boolean) || Object.values(j ?? {}).some(Boolean), f = (e) => {
|
|
32
32
|
if (e.type === "action") {
|
|
33
|
-
const { label:
|
|
34
|
-
return /* @__PURE__ */
|
|
33
|
+
const { label: a, appearance: y = "compact", variant: p = "secondary", leftIcon: u, rightIcon: L, type: C, ...q } = e;
|
|
34
|
+
return /* @__PURE__ */ d(G, {
|
|
35
35
|
appearance: y,
|
|
36
36
|
variant: p,
|
|
37
|
-
...
|
|
37
|
+
...q,
|
|
38
38
|
children: [
|
|
39
39
|
u,
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
a,
|
|
41
|
+
L
|
|
42
42
|
]
|
|
43
|
-
},
|
|
43
|
+
}, a);
|
|
44
44
|
}
|
|
45
|
-
const { key: t, label:
|
|
46
|
-
if (e.type === "textMultiSelect") return /* @__PURE__ */ n(
|
|
47
|
-
label:
|
|
45
|
+
const { key: t, label: r, position: s = "right" } = e;
|
|
46
|
+
if (e.type === "textMultiSelect") return /* @__PURE__ */ n(o.TextMultiSelect, {
|
|
47
|
+
label: r,
|
|
48
48
|
position: s,
|
|
49
49
|
options: e.options,
|
|
50
|
-
onApply: (
|
|
51
|
-
h(t,
|
|
50
|
+
onApply: (a) => {
|
|
51
|
+
h(t, a);
|
|
52
52
|
}
|
|
53
53
|
}, t);
|
|
54
|
-
if (e.type === "date") return /* @__PURE__ */ n(
|
|
55
|
-
label:
|
|
54
|
+
if (e.type === "date") return /* @__PURE__ */ n(o.DateFilterDropdown, {
|
|
55
|
+
label: r,
|
|
56
56
|
position: s,
|
|
57
57
|
countryCode: e.countryCode,
|
|
58
|
-
onApply: (
|
|
59
|
-
I(t,
|
|
58
|
+
onApply: (a) => {
|
|
59
|
+
I(t, a);
|
|
60
60
|
}
|
|
61
61
|
}, t);
|
|
62
|
-
if (e.type === "dateRange") return /* @__PURE__ */ n(
|
|
63
|
-
label:
|
|
62
|
+
if (e.type === "dateRange") return /* @__PURE__ */ n(o.DateRangeFilterDropdown, {
|
|
63
|
+
label: r,
|
|
64
64
|
position: s,
|
|
65
65
|
showTime: e.showTime,
|
|
66
66
|
timeFormat: e.timeFormat,
|
|
@@ -69,61 +69,61 @@ var f = /* @__PURE__ */ V(K(), 1), ie = ({ id: F, actions: b, filters: v, multiS
|
|
|
69
69
|
minDate: e.minDate,
|
|
70
70
|
maxDate: e.maxDate,
|
|
71
71
|
countryCode: e.countryCode,
|
|
72
|
-
onApply: (
|
|
73
|
-
|
|
72
|
+
onApply: (a) => {
|
|
73
|
+
i(t, a);
|
|
74
74
|
},
|
|
75
75
|
onRangeChange: e.onRangeChange
|
|
76
76
|
}, t);
|
|
77
77
|
if (e.type === "customDateRange") {
|
|
78
|
-
const { key:
|
|
79
|
-
return /* @__PURE__ */ n(
|
|
78
|
+
const { key: a, type: y, ...p } = e;
|
|
79
|
+
return /* @__PURE__ */ n(o.CustomDateRangeFilterDropdown, {
|
|
80
80
|
...p,
|
|
81
81
|
position: s,
|
|
82
82
|
onApply: (u) => {
|
|
83
|
-
|
|
83
|
+
i(t, u);
|
|
84
84
|
}
|
|
85
85
|
}, t);
|
|
86
86
|
}
|
|
87
|
-
return e.type === "time" ? /* @__PURE__ */ n(
|
|
88
|
-
label:
|
|
87
|
+
return e.type === "time" ? /* @__PURE__ */ n(o.TimeFilterDropdown, {
|
|
88
|
+
label: r,
|
|
89
89
|
position: s,
|
|
90
90
|
format: e.format,
|
|
91
91
|
presets: e.presets,
|
|
92
92
|
showTimePicker: e.showTimePicker,
|
|
93
|
-
onApply: (
|
|
94
|
-
O(t,
|
|
93
|
+
onApply: (a) => {
|
|
94
|
+
O(t, a);
|
|
95
95
|
}
|
|
96
|
-
}, t) : /* @__PURE__ */ n(
|
|
97
|
-
label:
|
|
96
|
+
}, t) : /* @__PURE__ */ n(o.BadgeMultiSelect, {
|
|
97
|
+
label: r,
|
|
98
98
|
position: s,
|
|
99
99
|
options: e.options,
|
|
100
|
-
onApply: (
|
|
101
|
-
h(t,
|
|
100
|
+
onApply: (a) => {
|
|
101
|
+
h(t, a);
|
|
102
102
|
}
|
|
103
103
|
}, t);
|
|
104
104
|
};
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
className: "kvt-filter w-full flex items-center justify-end pb-6",
|
|
107
|
-
children: [
|
|
105
|
+
return /* @__PURE__ */ d("div", {
|
|
106
|
+
className: "kvt-filter w-full flex items-center justify-end gap-y-4 pb-6 max-md:flex-wrap",
|
|
107
|
+
children: [x && /* @__PURE__ */ n(V, {
|
|
108
108
|
ref: l,
|
|
109
|
-
placeholder:
|
|
109
|
+
placeholder: S,
|
|
110
110
|
isSearch: !0,
|
|
111
111
|
autoComplete: "false",
|
|
112
|
-
className: "kvt-search w-72",
|
|
112
|
+
className: "kvt-search w-72 max-md:w-full",
|
|
113
113
|
inputMode: "search",
|
|
114
|
-
onChange:
|
|
115
|
-
}), /* @__PURE__ */
|
|
116
|
-
className: "kvt-filter-actions",
|
|
117
|
-
closeOnApply:
|
|
118
|
-
resetScope:
|
|
119
|
-
children: [B.map(
|
|
120
|
-
className:
|
|
121
|
-
disabled: !
|
|
114
|
+
onChange: g
|
|
115
|
+
}), /* @__PURE__ */ d(o, {
|
|
116
|
+
className: "kvt-filter-actions max-md:w-full max-md:flex-wrap",
|
|
117
|
+
closeOnApply: T,
|
|
118
|
+
resetScope: c,
|
|
119
|
+
children: [B.map(f), R && /* @__PURE__ */ n(o.ResetButton, {
|
|
120
|
+
className: $("select-none max-md:ml-auto", D),
|
|
121
|
+
disabled: !N,
|
|
122
122
|
onClick: P
|
|
123
123
|
})]
|
|
124
124
|
})]
|
|
125
125
|
});
|
|
126
126
|
};
|
|
127
127
|
export {
|
|
128
|
-
|
|
128
|
+
de as Filter
|
|
129
129
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as s } from "../../../../Input-
|
|
1
|
+
import { t as s } from "../../../../Input-O2bqyJKW.js";
|
|
2
2
|
import { Button as i } from "../../../Button/Button.js";
|
|
3
3
|
import { Typography as p } from "../../../Typography/Typography.js";
|
|
4
4
|
import { useTableContext as u } from "../../contexts/table.hook.js";
|
|
@@ -1,53 +1,60 @@
|
|
|
1
1
|
import { t } from "../../../../utils-DnIJruo0.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { HIDE_BELOW_CLASS as N } from "../../constants/responsive.js";
|
|
3
|
+
import { useTableContext as w } from "../../contexts/table.hook.js";
|
|
4
|
+
import { getPinnedCellProps as y } from "../../utils/pinned-columns/pinned-columns.js";
|
|
5
|
+
import { n as P } from "../../../../table.provider-QUo2buYX.js";
|
|
6
|
+
import D from "../../assets/chevron-up.js";
|
|
7
|
+
import H from "../../assets/chevron-down.js";
|
|
8
|
+
import { jsx as r, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
var G = ({ className: p, classNameArrows: f, classNameActiveArrows: l, classNameHeaderContent: h }) => {
|
|
10
|
+
const { table: o, headerContent: d, onSorting: n, pinnedWidths: x, getPinnedHeaderRef: b } = w(), g = (a) => {
|
|
9
11
|
n([{
|
|
10
12
|
id: a.id,
|
|
11
13
|
desc: !1
|
|
12
14
|
}]);
|
|
13
|
-
},
|
|
15
|
+
}, k = (a) => {
|
|
14
16
|
n([{
|
|
15
17
|
id: a.id,
|
|
16
18
|
desc: !0
|
|
17
19
|
}]);
|
|
18
20
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className: t("kvt-header", "font-semibold", "uppercase", "text-slate-500", "text-xs", "not-italic", "bg-slate-100", "overflow-hidden", "dark:text-slate-300", "dark:bg-metal-800",
|
|
21
|
+
return /* @__PURE__ */ s("thead", {
|
|
22
|
+
className: t("kvt-header", "font-semibold", "uppercase", "text-slate-500", "text-xs", "not-italic", "bg-slate-100", "overflow-hidden", "dark:text-slate-300", "dark:bg-metal-800", p),
|
|
21
23
|
children: [d && /* @__PURE__ */ r("tr", {
|
|
22
24
|
"data-header-content": !0,
|
|
23
25
|
children: /* @__PURE__ */ r("th", {
|
|
24
|
-
colSpan:
|
|
25
|
-
className: t("kvt-header-content", "px-6", "py-4", "text-left", "text-sm", "font-normal", "normal-case", "text-slate-800", "bg-white", "rounded-tl-lg", "rounded-tr-lg", "border-b", "border-b-gray-200", "dark:border-b-0", "dark:text-metal-50", "dark:bg-metal-900", "dark:border-t", "dark:border-x", "dark:border-metal-700",
|
|
26
|
+
colSpan: o.getVisibleLeafColumns().length,
|
|
27
|
+
className: t("kvt-header-content", "px-6", "py-4", "text-left", "text-sm", "font-normal", "normal-case", "text-slate-800", "bg-white", "rounded-tl-lg", "rounded-tr-lg", "border-b", "border-b-gray-200", "dark:border-b-0", "dark:text-metal-50", "dark:bg-metal-900", "dark:border-t", "dark:border-x", "dark:border-metal-700", h),
|
|
26
28
|
children: d
|
|
27
29
|
})
|
|
28
|
-
}),
|
|
30
|
+
}), o.getHeaderGroups().map(({ id: a, headers: u }) => /* @__PURE__ */ r("tr", {
|
|
29
31
|
className: "kvt-header-row",
|
|
30
|
-
children:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
children: u.map(({ id: C, column: e, getContext: S }) => {
|
|
33
|
+
const { hideBelow: i, headerClassName: v } = e.columnDef.meta ?? {}, c = !!e.getIsPinned(), m = y(o, e, x);
|
|
34
|
+
return /* @__PURE__ */ r("th", {
|
|
35
|
+
scope: "col",
|
|
36
|
+
ref: c ? b(e.id) : void 0,
|
|
37
|
+
className: t("kvt-header-cell", "px-4", "py-3", "text-left", "text-xs", !d && "first:rounded-tl-lg", !d && "last:rounded-tr-lg", "border-transparent", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", c && "bg-slate-100 dark:bg-metal-800", m.className, i && N[i], v),
|
|
38
|
+
style: m.style,
|
|
39
|
+
children: /* @__PURE__ */ s("span", {
|
|
40
|
+
className: "flex items-center gap-2 w-full",
|
|
41
|
+
children: [P(e.columnDef.header, S()), e.getCanSort() && /* @__PURE__ */ s("div", {
|
|
42
|
+
className: t("flex flex-col text-slate-400 justify-center items-center gap-1", f),
|
|
43
|
+
role: "presentation",
|
|
44
|
+
children: [/* @__PURE__ */ r(D, {
|
|
45
|
+
className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "asc" }, l),
|
|
46
|
+
onClick: () => g(e)
|
|
47
|
+
}), /* @__PURE__ */ r(H, {
|
|
48
|
+
className: t("w-2 h-2 cursor-pointer", { "text-blue-600 dark:text-aurora-500": e.getIsSorted() === "desc" }, l),
|
|
49
|
+
onClick: () => k(e)
|
|
50
|
+
})]
|
|
44
51
|
})]
|
|
45
|
-
})
|
|
46
|
-
})
|
|
47
|
-
}
|
|
52
|
+
})
|
|
53
|
+
}, C);
|
|
54
|
+
})
|
|
48
55
|
}, a))]
|
|
49
56
|
});
|
|
50
57
|
};
|
|
51
58
|
export {
|
|
52
|
-
|
|
59
|
+
G as Header
|
|
53
60
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { t as c } from "../../../../utils-DnIJruo0.js";
|
|
2
|
+
import { useTableContext as N } from "../../contexts/table.hook.js";
|
|
3
|
+
import { useLayoutEffect as M, useRef as u, useState as S } from "react";
|
|
4
|
+
import { Fragment as C, jsx as n, jsxs as k } from "react/jsx-runtime";
|
|
5
|
+
var y = (r, e) => {
|
|
6
|
+
e && e.scrollLeft !== r.scrollLeft && (e.scrollLeft = r.scrollLeft);
|
|
7
|
+
}, O = ({ scrollWidth: r, clientWidth: e, scrollLeft: a }) => ({
|
|
8
|
+
scrollWidth: r,
|
|
9
|
+
clientWidth: e,
|
|
10
|
+
scrollLeft: a
|
|
11
|
+
}), j = (r, e) => r.scrollWidth === e.scrollWidth && r.clientWidth === e.clientWidth && r.scrollLeft === e.scrollLeft, T = ({ className: r, hasPinnedColumns: e = !1, children: a }) => {
|
|
12
|
+
const { table: m, pinnedWidths: W } = N(), i = u(null), b = u(null), v = u(null), [o, g] = S({
|
|
13
|
+
scrollWidth: 0,
|
|
14
|
+
clientWidth: 0,
|
|
15
|
+
scrollLeft: 0
|
|
16
|
+
}), d = () => {
|
|
17
|
+
const t = i.current;
|
|
18
|
+
t && g((s) => {
|
|
19
|
+
const l = O(t);
|
|
20
|
+
return j(s, l) ? s : l;
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
M(() => {
|
|
24
|
+
const t = i.current, s = b.current;
|
|
25
|
+
if (!t || !s || (d(), typeof ResizeObserver > "u")) return;
|
|
26
|
+
const l = new ResizeObserver(d);
|
|
27
|
+
return l.observe(t), l.observe(s), () => l.disconnect();
|
|
28
|
+
}, []);
|
|
29
|
+
const p = o.scrollWidth > o.clientWidth, w = (t) => t.reduce((s, l) => s + (W[l] ?? 0), 0), f = w(m.getLeftLeafColumns().map(({ id: t }) => t)), h = w(m.getRightLeafColumns().map(({ id: t }) => t)), L = e && p, x = o.scrollLeft > 0, R = o.scrollLeft < o.scrollWidth - o.clientWidth - 1;
|
|
30
|
+
return /* @__PURE__ */ k("div", {
|
|
31
|
+
className: "kvt-scroll-area relative w-full",
|
|
32
|
+
children: [/* @__PURE__ */ n("div", {
|
|
33
|
+
ref: i,
|
|
34
|
+
"data-kvt-overflow": p ? "" : void 0,
|
|
35
|
+
className: c("kvt-scroll", "w-full", e && "[&::-webkit-scrollbar]:hidden", r),
|
|
36
|
+
style: e ? { scrollbarWidth: "none" } : void 0,
|
|
37
|
+
onScroll: ({ currentTarget: t }) => {
|
|
38
|
+
y(t, v.current), d();
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ n("div", {
|
|
41
|
+
ref: b,
|
|
42
|
+
className: "kvt-scroll-content w-full min-w-fit",
|
|
43
|
+
children: a
|
|
44
|
+
})
|
|
45
|
+
}), L && /* @__PURE__ */ k(C, { children: [
|
|
46
|
+
/* @__PURE__ */ n("div", {
|
|
47
|
+
"aria-hidden": "true",
|
|
48
|
+
className: c("kvt-scroll-fade pointer-events-none absolute inset-y-0 w-8", "bg-gradient-to-r from-white to-transparent dark:from-metal-900", "transition-opacity duration-200", x ? "opacity-100" : "opacity-0"),
|
|
49
|
+
style: { left: f }
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ n("div", {
|
|
52
|
+
"aria-hidden": "true",
|
|
53
|
+
className: c("kvt-scroll-fade pointer-events-none absolute inset-y-0 w-8", "bg-gradient-to-l from-white to-transparent dark:from-metal-900", "transition-opacity duration-200", R ? "opacity-100" : "opacity-0"),
|
|
54
|
+
style: { right: h }
|
|
55
|
+
}),
|
|
56
|
+
/* @__PURE__ */ n("div", {
|
|
57
|
+
ref: v,
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
className: c("kvt-scrollbar absolute bottom-0 overflow-x-auto overflow-y-hidden", "[scrollbar-width:thin] [scrollbar-color:var(--color-slate-300)_transparent]", "dark:[scrollbar-color:var(--color-metal-600)_transparent]", "[&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-slate-300", "dark:[&::-webkit-scrollbar-thumb]:bg-metal-600"),
|
|
60
|
+
style: {
|
|
61
|
+
left: f,
|
|
62
|
+
right: h
|
|
63
|
+
},
|
|
64
|
+
onScroll: ({ currentTarget: t }) => y(t, i.current),
|
|
65
|
+
children: /* @__PURE__ */ n("div", {
|
|
66
|
+
className: "h-px",
|
|
67
|
+
style: { width: o.scrollWidth - f - h }
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
] })]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export {
|
|
74
|
+
T as ScrollContainer
|
|
75
|
+
};
|
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
import { t as l } from "../../../../utils-DnIJruo0.js";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { Button as p } from "../../../Button/Button.js";
|
|
3
|
+
import { t as g } from "../../../../ellipsis-vertical-C_yX7aQe.js";
|
|
4
|
+
import { HIDE_BELOW_CLASS as m } from "../../constants/responsive.js";
|
|
5
|
+
import { useTableContext as f } from "../../contexts/table.hook.js";
|
|
6
|
+
import { getPinnedCellProps as k } from "../../utils/pinned-columns/pinned-columns.js";
|
|
7
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
8
|
+
var w = ({ numberOfRows: b, table: n }) => {
|
|
9
|
+
const { tableLoading: c, pinnedWidths: h } = f(), r = Array.from({ length: b });
|
|
10
|
+
return /* @__PURE__ */ e("tbody", {
|
|
9
11
|
className: "kvt-skeleton text-slate-800 text-sm font-normal relative",
|
|
10
|
-
children:
|
|
11
|
-
const
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
children: r.map((y, a) => {
|
|
13
|
+
const o = n.getVisibleLeafColumns();
|
|
14
|
+
return /* @__PURE__ */ e("tr", {
|
|
13
15
|
className: l("border-b", "border-b-gray-200", "bg-transparent", "last:border-b-transparent"),
|
|
14
|
-
children:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
children: o.map((t, s) => {
|
|
17
|
+
const { hideBelow: d } = t.columnDef.meta ?? {}, i = k(n, t, h);
|
|
18
|
+
return t.id !== "actions" ? /* @__PURE__ */ e("td", {
|
|
19
|
+
style: i.style,
|
|
20
|
+
className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", i.className, d && m[d], t.columnDef.meta?.className, {
|
|
21
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === r.length - 1 && s === 0,
|
|
22
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === r.length - 1 && s === o.length - 1
|
|
23
|
+
}),
|
|
24
|
+
children: /* @__PURE__ */ e("div", {
|
|
25
|
+
className: "animate-in fade-in-0",
|
|
26
|
+
children: /* @__PURE__ */ e("div", { className: l("bg-gray-200", "dark:bg-metal-700", "animate-pulse", "rounded", "h-5", "w-full") })
|
|
27
|
+
})
|
|
28
|
+
}, `skeleton-${t.id}`) : /* @__PURE__ */ e("td", {
|
|
29
|
+
style: i.style,
|
|
30
|
+
className: l("px-4", "py-1", "bg-white", "dark:bg-metal-900", "dark:border-t", "dark:border-metal-700", "dark:first:border-l", "dark:last:border-r", "dark:[tr:last-child_&]:border-b", i.className, d && m[d], t.columnDef.meta?.className, {
|
|
31
|
+
"[tr:last-child_&:first-of-type]:rounded-bl-lg": a === r.length - 1 && s === 0,
|
|
32
|
+
"[tr:last-child_&:last-of-type]:rounded-br-lg": a === r.length - 1 && s === o.length - 1
|
|
33
|
+
}),
|
|
34
|
+
children: /* @__PURE__ */ e(p, {
|
|
35
|
+
variant: "link",
|
|
36
|
+
shape: "circle",
|
|
37
|
+
size: "large",
|
|
38
|
+
disabled: !0,
|
|
39
|
+
"aria-hidden": "true",
|
|
40
|
+
children: /* @__PURE__ */ e(g, { className: l("w-5", "h-5", "text-slate-400", "dark:text-metal-700", { "text-gray-300 animate-pulse": c }) })
|
|
41
|
+
})
|
|
42
|
+
}, `skeleton-${t.id}`);
|
|
43
|
+
})
|
|
44
|
+
}, `skeleton-row-${a}`);
|
|
38
45
|
})
|
|
39
46
|
});
|
|
40
47
|
};
|
|
41
48
|
export {
|
|
42
|
-
|
|
49
|
+
w as Skeleton
|
|
43
50
|
};
|