@konstructio/ui 0.1.2-alpha.70 → 0.1.2-alpha.72
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/{Modal-BGcucTHv.js → Modal-CXRo8f-h.js} +1 -1
- package/dist/assets/icons/components/CheckCircleFilled.d.ts +3 -0
- package/dist/assets/icons/components/CheckCircleFilled.js +31 -0
- package/dist/assets/icons/components/CheckCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/{CheckCircle.js → CheckCircleOutline.js} +8 -8
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.d.ts +3 -0
- package/dist/assets/icons/components/CheckboxMarkedCircleOutline.js +26 -0
- package/dist/assets/icons/components/InfoCircle.d.ts +3 -0
- package/dist/assets/icons/components/InfoCircle.js +31 -0
- package/dist/assets/icons/components/WarningTriangle.d.ts +3 -0
- package/dist/assets/icons/components/WarningTriangle.js +28 -0
- package/dist/assets/icons/components/index.d.ts +5 -1
- package/dist/assets/icons/components/index.js +124 -116
- package/dist/assets/icons/index.js +124 -116
- package/dist/components/Alert/Alert.d.ts +5 -16
- package/dist/components/Alert/Alert.js +46 -32
- package/dist/components/Alert/Alert.types.d.ts +8 -8
- package/dist/components/Alert/Alert.variants.d.ts +11 -2
- package/dist/components/Alert/Alert.variants.js +77 -32
- package/dist/components/Badge/Badge.variants.d.ts +2 -2
- package/dist/components/Button/Button.variants.d.ts +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.js +1 -1
- package/dist/components/ButtonGroup/components/ButtonGroupItem/ButtonGroupItem.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/hooks/useDateTimeInputs.d.ts +1 -1
- package/dist/components/Filter/Filter.d.ts +2 -2
- package/dist/components/Filter/Filter.js +20 -14
- package/dist/components/Filter/Filter.types.d.ts +3 -1
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.d.ts +3 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +122 -0
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.types.d.ts +7 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.d.ts +3 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +14 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +74 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +155 -0
- package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.types.d.ts +13 -0
- package/dist/components/Filter/components/index.d.ts +4 -0
- package/dist/components/Filter/components/index.js +8 -4
- package/dist/components/LineChart/LineChart.d.ts +17 -0
- package/dist/components/LineChart/LineChart.js +154 -0
- package/dist/components/LineChart/LineChart.types.d.ts +54 -0
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/PieChart/PieChart.js +51 -5095
- package/dist/components/ProgressBar/ProgressBar.variants.d.ts +1 -1
- package/dist/components/RadioCardGroup/RadioCardGroup.variants.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.variants.d.ts +1 -1
- package/dist/components/Tabs/Tabs.variants.d.ts +1 -1
- package/dist/components/Toast/Toast.variants.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +4 -9
- package/dist/components/Tooltip/Tooltip.js +35 -33
- package/dist/components/Tooltip/Tooltip.types.d.ts +22 -11
- package/dist/components/Typography/Typography.variants.d.ts +1 -1
- package/dist/components/VirtualizedTable/VirtualizedTable.js +61 -59
- package/dist/components/VirtualizedTable/VirtualizedTable.types.d.ts +93 -8
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +153 -71
- package/dist/components/VirtualizedTable/components/Filter/Filter.types.d.ts +7 -8
- package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
- package/dist/components/VirtualizedTable/contexts/table.context.d.ts +12 -0
- package/dist/components/VirtualizedTable/contexts/table.context.js +9 -0
- package/dist/components/VirtualizedTable/contexts/table.provider.js +198 -162
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +124 -118
- package/dist/icons.d.ts +1 -1
- package/dist/icons.js +124 -116
- package/dist/{index-DPcwqB8q.js → index-B7-5g1Sm.js} +169 -168
- package/dist/index-qDQP8rW4.js +7281 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +142 -135
- package/dist/package.json +8 -8
- package/dist/{proxy-CngVm5qA.js → proxy-0sbyKj-k.js} +732 -728
- package/dist/styles.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +16 -15
- package/package.json +8 -8
- package/dist/assets/icons/components/CheckCircle.d.ts +0 -3
- package/dist/components/Tooltip/Tooltip.variants.d.ts +0 -6
- package/dist/components/Tooltip/Tooltip.variants.js +0 -86
- package/dist/components/Tooltip/hooks/useTooltip.d.ts +0 -4
- package/dist/components/Tooltip/hooks/useTooltip.js +0 -24
|
@@ -1,90 +1,172 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { d as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Filter as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { useTableContext as
|
|
9
|
-
const
|
|
10
|
-
actions:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsxs as S, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { d as q } from "../../../../debounce-DJveWHr_.js";
|
|
3
|
+
import { useRef as z, useMemo as m, useCallback as w } from "react";
|
|
4
|
+
import { Button as E } from "../../../Button/Button.js";
|
|
5
|
+
import { Filter as n } from "../../../Filter/Filter.js";
|
|
6
|
+
import { Input as G } from "../../../Input/Input.js";
|
|
7
|
+
import { cn as H } from "../../../../utils/index.js";
|
|
8
|
+
import { useTableContext as J } from "../../contexts/table.hook.js";
|
|
9
|
+
const C = ({
|
|
10
|
+
actions: p,
|
|
11
|
+
filters: u,
|
|
12
|
+
multiSelectFilter: d,
|
|
13
|
+
placeholder: T,
|
|
14
|
+
showFilterInput: v = !0,
|
|
15
|
+
showResetButton: x = !0,
|
|
16
|
+
resetButtonClassName: M
|
|
16
17
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
termOfSearch:
|
|
19
|
-
multiselectSelected:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
const l = z(null), {
|
|
19
|
+
termOfSearch: i,
|
|
20
|
+
multiselectSelected: h,
|
|
21
|
+
dateFilters: y,
|
|
22
|
+
dateRangeFilters: F,
|
|
23
|
+
timeFilters: b,
|
|
24
|
+
onChangeTermOfSearch: c,
|
|
25
|
+
onSelectMultiselect: D,
|
|
26
|
+
onSelectDateFilter: j,
|
|
27
|
+
onSelectDateRangeFilter: O,
|
|
28
|
+
onSelectTimeFilter: A
|
|
29
|
+
} = J(), B = m(() => {
|
|
30
|
+
const e = u ?? d?.map((o) => ({
|
|
31
|
+
...o,
|
|
32
|
+
type: "badgeMultiSelect"
|
|
33
|
+
})) ?? [], t = p ?? [];
|
|
34
|
+
return [...e, ...t];
|
|
35
|
+
}, [u, d, p]), R = w(
|
|
36
|
+
(e, t) => D(
|
|
24
37
|
e,
|
|
25
|
-
t.map((
|
|
38
|
+
t.map((o) => o.id)
|
|
26
39
|
),
|
|
27
|
-
[
|
|
28
|
-
),
|
|
29
|
-
|
|
30
|
-
}, [
|
|
31
|
-
() =>
|
|
32
|
-
|
|
40
|
+
[D]
|
|
41
|
+
), k = w(() => {
|
|
42
|
+
c(""), l.current && (l.current.value = "");
|
|
43
|
+
}, [c]), P = m(
|
|
44
|
+
() => q((e) => {
|
|
45
|
+
c(e.target.value);
|
|
33
46
|
}, 500),
|
|
34
|
-
[
|
|
35
|
-
),
|
|
36
|
-
() => !!
|
|
37
|
-
[
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
[c]
|
|
48
|
+
), N = m(
|
|
49
|
+
() => !!i || Object.values(h ?? {}).flat().length > 0 || Object.values(y ?? {}).some(Boolean) || Object.values(F ?? {}).some(Boolean) || Object.values(b ?? {}).some(Boolean),
|
|
50
|
+
[
|
|
51
|
+
i,
|
|
52
|
+
h,
|
|
53
|
+
y,
|
|
54
|
+
F,
|
|
55
|
+
b
|
|
56
|
+
]
|
|
57
|
+
), I = (e) => {
|
|
58
|
+
if (e.type === "action") {
|
|
59
|
+
const {
|
|
60
|
+
label: a,
|
|
61
|
+
appearance: _ = "compact",
|
|
62
|
+
variant: $ = "secondary",
|
|
63
|
+
type: K,
|
|
64
|
+
...g
|
|
65
|
+
} = e;
|
|
66
|
+
return /* @__PURE__ */ s(
|
|
67
|
+
E,
|
|
68
|
+
{
|
|
69
|
+
appearance: _,
|
|
70
|
+
variant: $,
|
|
71
|
+
...g,
|
|
72
|
+
children: a
|
|
73
|
+
},
|
|
74
|
+
a
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
const { key: t, label: o, position: r = "right" } = e;
|
|
78
|
+
return e.type === "textMultiSelect" ? /* @__PURE__ */ s(
|
|
79
|
+
n.TextMultiSelect,
|
|
80
|
+
{
|
|
81
|
+
label: o,
|
|
82
|
+
position: r,
|
|
83
|
+
options: e.options,
|
|
84
|
+
onApply: (a) => {
|
|
85
|
+
R(t, a);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
t
|
|
89
|
+
) : e.type === "date" ? /* @__PURE__ */ s(
|
|
90
|
+
n.DateFilterDropdown,
|
|
91
|
+
{
|
|
92
|
+
label: o,
|
|
93
|
+
position: r,
|
|
94
|
+
countryCode: e.countryCode,
|
|
95
|
+
onApply: (a) => {
|
|
96
|
+
j(t, a);
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
t
|
|
100
|
+
) : e.type === "dateRange" ? /* @__PURE__ */ s(
|
|
101
|
+
n.DateRangeFilterDropdown,
|
|
102
|
+
{
|
|
103
|
+
label: o,
|
|
104
|
+
position: r,
|
|
105
|
+
showTime: e.showTime,
|
|
106
|
+
timeFormat: e.timeFormat,
|
|
107
|
+
showPresets: e.showPresets,
|
|
108
|
+
defaultRange: e.defaultRange,
|
|
109
|
+
minDate: e.minDate,
|
|
110
|
+
maxDate: e.maxDate,
|
|
111
|
+
countryCode: e.countryCode,
|
|
112
|
+
onApply: (a) => {
|
|
113
|
+
O(t, a);
|
|
114
|
+
},
|
|
115
|
+
onRangeChange: e.onRangeChange
|
|
116
|
+
},
|
|
117
|
+
t
|
|
118
|
+
) : e.type === "time" ? /* @__PURE__ */ s(
|
|
119
|
+
n.TimeFilterDropdown,
|
|
120
|
+
{
|
|
121
|
+
label: o,
|
|
122
|
+
position: r,
|
|
123
|
+
format: e.format,
|
|
124
|
+
presets: e.presets,
|
|
125
|
+
showTimePicker: e.showTimePicker,
|
|
126
|
+
onApply: (a) => {
|
|
127
|
+
A(t, a);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
t
|
|
131
|
+
) : /* @__PURE__ */ s(
|
|
132
|
+
n.BadgeMultiSelect,
|
|
42
133
|
{
|
|
43
|
-
|
|
44
|
-
|
|
134
|
+
label: o,
|
|
135
|
+
position: r,
|
|
136
|
+
options: e.options,
|
|
137
|
+
onApply: (a) => {
|
|
138
|
+
R(t, a);
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
t
|
|
142
|
+
);
|
|
143
|
+
};
|
|
144
|
+
return /* @__PURE__ */ S("div", { className: "w-full flex items-center justify-end pb-6", children: [
|
|
145
|
+
v && /* @__PURE__ */ s(
|
|
146
|
+
G,
|
|
147
|
+
{
|
|
148
|
+
ref: l,
|
|
149
|
+
placeholder: T,
|
|
45
150
|
isSearch: !0,
|
|
46
151
|
autoComplete: "false",
|
|
47
152
|
className: "w-72",
|
|
48
153
|
inputMode: "search",
|
|
49
|
-
onChange:
|
|
154
|
+
onChange: P
|
|
50
155
|
}
|
|
51
156
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
label: t,
|
|
58
|
-
position: r,
|
|
59
|
-
options: j,
|
|
60
|
-
onApply: (O) => {
|
|
61
|
-
x(e, O);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
t
|
|
65
|
-
)
|
|
66
|
-
),
|
|
67
|
-
f?.map(({ label: e, onClick: t, variant: r = "secondary" }) => /* @__PURE__ */ a(
|
|
68
|
-
y,
|
|
69
|
-
{
|
|
70
|
-
variant: r,
|
|
71
|
-
appearance: "compact",
|
|
72
|
-
onClick: t,
|
|
73
|
-
children: e
|
|
74
|
-
},
|
|
75
|
-
e
|
|
76
|
-
)),
|
|
77
|
-
C && /* @__PURE__ */ a(
|
|
78
|
-
l.ResetButton,
|
|
157
|
+
/* @__PURE__ */ S(n, { children: [
|
|
158
|
+
B.map(I),
|
|
159
|
+
x && /* @__PURE__ */ s(
|
|
160
|
+
n.ResetButton,
|
|
79
161
|
{
|
|
80
|
-
className:
|
|
81
|
-
disabled: !
|
|
82
|
-
onClick:
|
|
162
|
+
className: H("select-none", M),
|
|
163
|
+
disabled: !N,
|
|
164
|
+
onClick: k
|
|
83
165
|
}
|
|
84
166
|
)
|
|
85
167
|
] })
|
|
86
168
|
] });
|
|
87
169
|
};
|
|
88
170
|
export {
|
|
89
|
-
|
|
171
|
+
C as Filter
|
|
90
172
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { MultiSelectFilter } from '../../VirtualizedTable.types';
|
|
1
|
+
import { ActionFilterConfig, FilterConfig, MultiSelectFilter } from '../../VirtualizedTable.types';
|
|
3
2
|
export type { Option } from '../../../Filter/Filter.types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
onClick: () => void;
|
|
7
|
-
variant?: ButtonProps['variant'];
|
|
8
|
-
};
|
|
3
|
+
/** @deprecated Use `ActionFilterConfig` with `type: 'action'` in the `filters` array instead */
|
|
4
|
+
export type FilterAction = ActionFilterConfig;
|
|
9
5
|
export type Props = {
|
|
10
|
-
|
|
6
|
+
filters?: FilterConfig[];
|
|
7
|
+
/** @deprecated Use `filters` instead */
|
|
11
8
|
multiSelectFilter?: MultiSelectFilter[];
|
|
9
|
+
/** @deprecated Use `ActionFilterConfig` items in `filters` instead */
|
|
10
|
+
actions?: FilterAction[];
|
|
12
11
|
placeholder: string;
|
|
13
12
|
showFilterInput?: boolean;
|
|
14
13
|
showResetButton?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { P as u, R as b, T as m, C as p } from "../../../../index-B7-5g1Sm.js";
|
|
3
3
|
import { d as h } from "../../../../debounce-DJveWHr_.js";
|
|
4
4
|
import { useRef as x, useState as w, useCallback as g, useEffect as s } from "react";
|
|
5
5
|
const v = ({ getValue: l, value: i }) => {
|
|
@@ -11,6 +11,12 @@ export type ContextType<TData extends RowData = RowData> = {
|
|
|
11
11
|
termOfSearch?: string;
|
|
12
12
|
page: number;
|
|
13
13
|
multiselectSelected?: Record<string, string[]>;
|
|
14
|
+
dateFilters?: Record<string, string | undefined>;
|
|
15
|
+
dateRangeFilters?: Record<string, {
|
|
16
|
+
from?: string;
|
|
17
|
+
to?: string;
|
|
18
|
+
} | undefined>;
|
|
19
|
+
timeFilters?: Record<string, string | undefined>;
|
|
14
20
|
totalPages: number;
|
|
15
21
|
isFirstLoad: boolean;
|
|
16
22
|
enableExpandedRow?: boolean;
|
|
@@ -28,5 +34,11 @@ export type ContextType<TData extends RowData = RowData> = {
|
|
|
28
34
|
onSorting: Dispatch<SetStateAction<SortingState>>;
|
|
29
35
|
onChangeTermOfSearch: (term: string) => void;
|
|
30
36
|
onSelectMultiselect: (key: string, selectedValues: string[]) => void;
|
|
37
|
+
onSelectDateFilter: (key: string, date?: Date) => void;
|
|
38
|
+
onSelectDateRangeFilter: (key: string, range?: {
|
|
39
|
+
from?: Date;
|
|
40
|
+
to?: Date;
|
|
41
|
+
}) => void;
|
|
42
|
+
onSelectTimeFilter: (key: string, time?: Date) => void;
|
|
31
43
|
};
|
|
32
44
|
export declare const TableContext: import('react').Context<ContextType<unknown>>;
|
|
@@ -20,6 +20,15 @@ const r = e({
|
|
|
20
20
|
onSelectMultiselect() {
|
|
21
21
|
throw new Error("onSelectMultiselect function is not implemented");
|
|
22
22
|
},
|
|
23
|
+
onSelectDateFilter() {
|
|
24
|
+
throw new Error("onSelectDateFilter function is not implemented");
|
|
25
|
+
},
|
|
26
|
+
onSelectDateRangeFilter() {
|
|
27
|
+
throw new Error("onSelectDateRangeFilter function is not implemented");
|
|
28
|
+
},
|
|
29
|
+
onSelectTimeFilter() {
|
|
30
|
+
throw new Error("onSelectTimeFilter function is not implemented");
|
|
31
|
+
},
|
|
23
32
|
handlePage() {
|
|
24
33
|
throw new Error("handlePage function is not implemented");
|
|
25
34
|
},
|