@povio/ui 5.0.1-rc.1 → 5.0.1-rc.2
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/{Autocomplete-XP-Qdlrm.js → Autocomplete-BKJ5sYdA.js} +4 -4
- package/dist/{Autocomplete.bound-DFL87TOZ.js → Autocomplete.bound-B6RmJlR6.js} +1 -1
- package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-B7i7tj1S.js} +1 -1
- package/dist/{Calendar.lazy-Bl5amf0W.js → Calendar.lazy-9hn-y6c8.js} +1 -1
- package/dist/{CheckboxGroup-CK_tTvvI.js → CheckboxGroup-CneFMbCF.js} +1 -1
- package/dist/{CheckboxGroup.bound-wGcpw5tY.js → CheckboxGroup.bound-BddvGfb_.js} +1 -1
- package/dist/{DatePicker-CqkS8dCf.js → DatePicker-DUCe_SVM.js} +3 -3
- package/dist/{DatePicker.bound-Bg524WMN.js → DatePicker.bound-r5FQhOff.js} +1 -1
- package/dist/{DatePickerInput-jrCYehXn.js → DatePickerInput-C9wcjFvV.js} +1 -1
- package/dist/{DateRangePicker-DfLnonW1.js → DateRangePicker-CkiT1lEf.js} +3 -3
- package/dist/{DateRangePicker.bound-Cahr-3cK.js → DateRangePicker.bound-Chl_cUUj.js} +1 -1
- package/dist/{DateTimePicker-BL8koIhS.js → DateTimePicker-B7qiGRqC.js} +3 -3
- package/dist/{DateTimePicker.bound-BheJ0Rny.js → DateTimePicker.bound-LMdGgruS.js} +1 -1
- package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-Dt8nr5qS.js} +2 -2
- package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-BjGcbdmX.js} +1 -1
- package/dist/{FileInput-3wNdotBt.js → FileInput-CDzclNi2.js} +1 -1
- package/dist/{FileInput.bound-CJdou4D6.js → FileInput.bound-Vz2EeuOP.js} +1 -1
- package/dist/{FileUpload-C3IMKBRp.js → FileUpload-u81ZwwEt.js} +1 -1
- package/dist/{FileUpload.bound-Bf4LzJUU.js → FileUpload.bound-LBo4ERNC.js} +1 -1
- package/dist/{FormField-dduTMkNH.js → FormField-ClLu7Hix.js} +2 -2
- package/dist/{Input-DRR8_MgG.js → Input-g9gG6FBB.js} +2 -2
- package/dist/{Input.bound-3CTdQnA8.js → Input.bound-lFOANQBr.js} +1 -1
- package/dist/{InputContent-BkNnqXt3.js → InputContent-qLj8x_zH.js} +1 -1
- package/dist/{NumberField-OjtbK2Uh.js → NumberField-DodaCw5J.js} +2 -2
- package/dist/{NumberField.bound-D-uZoLYH.js → NumberField.bound-DxgcOvm1.js} +1 -1
- package/dist/{NumberRangeInput-EKzbxaN0.js → NumberRangeInput-BIBCaGE4.js} +1 -1
- package/dist/{NumberRangeInput.bound-CmXDNvF1.js → NumberRangeInput.bound-BIWKaOMj.js} +1 -1
- package/dist/{PasswordInput.bound-lnJeVf4k.js → PasswordInput.bound-BqTCYsLj.js} +1 -1
- package/dist/{RadioGroup-Dvq0TiEB.js → RadioGroup-HMm5cKXh.js} +1 -1
- package/dist/{RadioGroup.bound-Dya9IgZr.js → RadioGroup.bound-Bj5CLIlT.js} +1 -1
- package/dist/{RangeCalendar-BuRiCB7z.js → RangeCalendar-DQ6Ls8z7.js} +1 -1
- package/dist/{RichTextEditor-Cg-S5lhK.js → RichTextEditor-CHmqhNmA.js} +3 -3
- package/dist/{Select-DfgTo2X3.js → Select-s_1onwY9.js} +5 -5
- package/dist/{Select.bound-XC8lgM6E.js → Select.bound-CaNRXZDU.js} +1 -1
- package/dist/{SelectListBox-B_bqWSLU.js → SelectListBox-BuKr994Y.js} +1 -1
- package/dist/{Slider-DCsCCPFx.js → Slider-8J-Ny6BX.js} +1 -1
- package/dist/{Slider.bound-DO1l_qJQ.js → Slider.bound-DgNK0NK1.js} +1 -1
- package/dist/{TextArea-nySHbed0.js → TextArea-CsTjCZIE.js} +1 -1
- package/dist/{TextArea.bound-DbSMg_Kz.js → TextArea.bound-JYXWI2Vn.js} +1 -1
- package/dist/{TimePicker-Fnj3QZ3G.js → TimePicker-BSM4Ioa_.js} +1 -1
- package/dist/{TimePicker.bound-DLflOXZm.js → TimePicker.bound-DGNPAcDB.js} +1 -1
- package/dist/{ToastContainer-DtpZaefx.js → ToastContainer-Cdp4jsgT.js} +24 -1
- package/dist/{ToggleGroup-Co1-A0Ti.js → ToggleGroup-BDKfPYek.js} +1 -1
- package/dist/{ToggleGroup.bound-DNxhSz1h.js → ToggleGroup.bound-CF5hXyw8.js} +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.js +1 -1
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload-container.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.js +1 -1
- package/dist/components/input-frame.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/number-field.js +1 -1
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/page-header.js +1 -1
- package/dist/components/password-input.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/split-button.js +1 -1
- package/dist/components/style-definitions.js +2 -2
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.js +2 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/use-toast.js +2 -2
- package/dist/{dist-fFtzh872.js → dist-C8Tl4DGt.js} +1 -1
- package/dist/{dropdownMenu.cva-DwSOcbmR.js → dropdownMenu.cva-CcFuz2Yo.js} +1 -1
- package/dist/hooks/use-filters.js +1 -1
- package/dist/index.js +30 -30
- package/dist/rich-text-editor.js +1 -1
- package/dist/{routing.utils-DfxEt0_Y.js → routing.utils-C5FAT_Qg.js} +2 -2
- package/dist/{selectDesktop.cva-DStkOdwm.js → selectDesktop.cva-30JAvtgB.js} +1 -1
- package/dist/tanstack/autocomplete.js +1 -1
- package/dist/tanstack/checkbox-group.js +1 -1
- package/dist/tanstack/date-picker.js +1 -1
- package/dist/tanstack/date-range-picker.js +1 -1
- package/dist/tanstack/date-time-picker.js +1 -1
- package/dist/tanstack/file-input.js +1 -1
- package/dist/tanstack/file-upload.js +1 -1
- package/dist/tanstack/input.js +1 -1
- package/dist/tanstack/number-field.js +1 -1
- package/dist/tanstack/number-range-input.js +1 -1
- package/dist/tanstack/password-input.js +1 -1
- package/dist/tanstack/radio-group.js +1 -1
- package/dist/tanstack/rich-text-editor.js +1 -1
- package/dist/tanstack/select.js +1 -1
- package/dist/tanstack/slider.js +1 -1
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack/text-area.js +1 -1
- package/dist/tanstack/time-picker.js +1 -1
- package/dist/tanstack/toggle-group.js +1 -1
- package/dist/tanstack.js +30 -30
- package/dist/{toast.runtime-BWQLlbZW.js → toast.runtime-CvmhLbUP.js} +1 -1
- package/dist/{useFilters-DMi94RZK.js → useFilters-Bp9x3-09.js} +71 -78
- package/dist/{useTableColumnConfig-xvu1zw0E.js → useTableColumnConfig-yf7pvTbe.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as UIRouter } from "./router.context-MckTbHw9.js";
|
|
2
|
-
import { t as RoutingUtils } from "./routing.utils-
|
|
2
|
+
import { t as RoutingUtils } from "./routing.utils-C5FAT_Qg.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -24,47 +24,35 @@ const serializeFiltersToQuery = (filterData, prefix) => {
|
|
|
24
24
|
}
|
|
25
25
|
return query;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
if (value === "\"true\"") return "true";
|
|
29
|
-
if (value === "\"false\"") return "false";
|
|
30
|
-
return value;
|
|
31
|
-
}
|
|
32
|
-
const parseFilterFromQuery = (searchParams, schema) => {
|
|
27
|
+
const parseFilterFromQuery = (searchParams, prefix, schema) => {
|
|
33
28
|
const filter = {};
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const prefixPart = prefix ? `${prefix}-` : "";
|
|
30
|
+
for (const [key, value] of Object.entries(RoutingUtils.toRouterSearch(searchParams))) {
|
|
36
31
|
const match = /^filter\[(.+?)\]$/.exec(key);
|
|
37
|
-
if (!match) continue;
|
|
38
|
-
const filterKey = match[1];
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (isArray || isObject || isNumber) filter[filterKey] = JSON.parse(normalizedValue);
|
|
44
|
-
else if (isBoolean) filter[filterKey] = normalizedValue === "true";
|
|
45
|
-
else {
|
|
46
|
-
const expectedType = getFieldType(schema, filterKey);
|
|
47
|
-
if (expectedType === "number" && !Number.isNaN(Number(normalizedValue)) && normalizedValue !== "" && normalizedValue !== null) filter[filterKey] = Number(normalizedValue);
|
|
48
|
-
else if (expectedType === "boolean" && ["true", "false"].includes(normalizedValue)) filter[filterKey] = normalizedValue === "true";
|
|
49
|
-
else filter[filterKey] = normalizedValue;
|
|
50
|
-
}
|
|
32
|
+
if (!match || !match[1].startsWith(prefixPart)) continue;
|
|
33
|
+
const filterKey = match[1].slice(prefixPart.length);
|
|
34
|
+
const expectedType = getFieldType(schema, filterKey);
|
|
35
|
+
if (typeof value === "string" && expectedType === "number" && value.trim() !== "" && Number.isFinite(Number(value))) filter[filterKey] = Number(value);
|
|
36
|
+
else if (expectedType === "boolean" && (value === "true" || value === "false")) filter[filterKey] = value === "true";
|
|
37
|
+
else filter[filterKey] = value;
|
|
51
38
|
}
|
|
52
39
|
return filter;
|
|
53
40
|
};
|
|
54
41
|
const useFilters = (defaultFilterValues, t0, schema) => {
|
|
55
|
-
const $ = c(
|
|
42
|
+
const $ = c(35);
|
|
56
43
|
const prefix = t0 === void 0 ? "" : t0;
|
|
57
44
|
const { searchParams, replace } = UIRouter.useUIRouter();
|
|
58
45
|
let t1;
|
|
59
|
-
if ($[0] !==
|
|
60
|
-
t1 = () => parseFilterFromQuery(searchParams, schema);
|
|
61
|
-
$[0] =
|
|
62
|
-
$[1] =
|
|
63
|
-
$[2] =
|
|
64
|
-
|
|
46
|
+
if ($[0] !== prefix || $[1] !== schema || $[2] !== searchParams) {
|
|
47
|
+
t1 = () => parseFilterFromQuery(searchParams, prefix, schema);
|
|
48
|
+
$[0] = prefix;
|
|
49
|
+
$[1] = schema;
|
|
50
|
+
$[2] = searchParams;
|
|
51
|
+
$[3] = t1;
|
|
52
|
+
} else t1 = $[3];
|
|
65
53
|
const [filterData, setFilterData] = useState(t1);
|
|
66
54
|
let t2;
|
|
67
|
-
if ($[
|
|
55
|
+
if ($[4] !== defaultFilterValues || $[5] !== prefix || $[6] !== replace || $[7] !== schema || $[8] !== searchParams) {
|
|
68
56
|
t2 = () => {
|
|
69
57
|
const setUrlToDefaultFilters = () => {
|
|
70
58
|
const flatFilterQuery = serializeFiltersToQuery(defaultFilterValues, prefix);
|
|
@@ -74,49 +62,54 @@ const useFilters = (defaultFilterValues, t0, schema) => {
|
|
|
74
62
|
...flatFilterQuery
|
|
75
63
|
});
|
|
76
64
|
};
|
|
77
|
-
const currentFilters = parseFilterFromQuery(searchParams, schema);
|
|
65
|
+
const currentFilters = parseFilterFromQuery(searchParams, prefix, schema);
|
|
78
66
|
const hasFiltersSet = Object.keys(currentFilters).length > 0;
|
|
79
67
|
if (defaultFilterValues && !hasFiltersSet) setUrlToDefaultFilters();
|
|
80
68
|
};
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
$[
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
} else t2 = $[
|
|
69
|
+
$[4] = defaultFilterValues;
|
|
70
|
+
$[5] = prefix;
|
|
71
|
+
$[6] = replace;
|
|
72
|
+
$[7] = schema;
|
|
73
|
+
$[8] = searchParams;
|
|
74
|
+
$[9] = t2;
|
|
75
|
+
} else t2 = $[9];
|
|
88
76
|
let t3;
|
|
89
|
-
if ($[
|
|
77
|
+
if ($[10] !== defaultFilterValues || $[11] !== prefix || $[12] !== schema) {
|
|
90
78
|
t3 = [
|
|
91
79
|
defaultFilterValues,
|
|
92
80
|
prefix,
|
|
93
81
|
schema
|
|
94
82
|
];
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
97
|
-
$[
|
|
98
|
-
$[
|
|
99
|
-
} else t3 = $[
|
|
83
|
+
$[10] = defaultFilterValues;
|
|
84
|
+
$[11] = prefix;
|
|
85
|
+
$[12] = schema;
|
|
86
|
+
$[13] = t3;
|
|
87
|
+
} else t3 = $[13];
|
|
100
88
|
useEffect(t2, t3);
|
|
101
89
|
let t4;
|
|
102
90
|
let t5;
|
|
103
|
-
if ($[
|
|
91
|
+
if ($[14] !== prefix || $[15] !== schema || $[16] !== searchParams) {
|
|
104
92
|
t4 = () => {
|
|
105
|
-
const newQueryFilters = parseFilterFromQuery(searchParams, schema);
|
|
93
|
+
const newQueryFilters = parseFilterFromQuery(searchParams, prefix, schema);
|
|
106
94
|
setFilterData(newQueryFilters);
|
|
107
95
|
};
|
|
108
|
-
t5 = [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
t5 = [
|
|
97
|
+
searchParams,
|
|
98
|
+
prefix,
|
|
99
|
+
schema
|
|
100
|
+
];
|
|
101
|
+
$[14] = prefix;
|
|
102
|
+
$[15] = schema;
|
|
103
|
+
$[16] = searchParams;
|
|
104
|
+
$[17] = t4;
|
|
105
|
+
$[18] = t5;
|
|
113
106
|
} else {
|
|
114
|
-
t4 = $[
|
|
115
|
-
t5 = $[
|
|
107
|
+
t4 = $[17];
|
|
108
|
+
t5 = $[18];
|
|
116
109
|
}
|
|
117
110
|
useEffect(t4, t5);
|
|
118
111
|
let t6;
|
|
119
|
-
if ($[
|
|
112
|
+
if ($[19] !== defaultFilterValues || $[20] !== filterData || $[21] !== prefix || $[22] !== replace || $[23] !== searchParams) {
|
|
120
113
|
t6 = (data) => {
|
|
121
114
|
let newFilters = { ...filterData };
|
|
122
115
|
const isReset = Object.keys(data).length === 0;
|
|
@@ -139,16 +132,16 @@ const useFilters = (defaultFilterValues, t0, schema) => {
|
|
|
139
132
|
});
|
|
140
133
|
setFilterData(newFilters);
|
|
141
134
|
};
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
} else t6 = $[
|
|
135
|
+
$[19] = defaultFilterValues;
|
|
136
|
+
$[20] = filterData;
|
|
137
|
+
$[21] = prefix;
|
|
138
|
+
$[22] = replace;
|
|
139
|
+
$[23] = searchParams;
|
|
140
|
+
$[24] = t6;
|
|
141
|
+
} else t6 = $[24];
|
|
149
142
|
const setFilterValue = t6;
|
|
150
143
|
let t7;
|
|
151
|
-
if ($[
|
|
144
|
+
if ($[25] !== filterData) {
|
|
152
145
|
t7 = (keys) => {
|
|
153
146
|
const result = {};
|
|
154
147
|
keys.forEach((key_1) => {
|
|
@@ -156,34 +149,34 @@ const useFilters = (defaultFilterValues, t0, schema) => {
|
|
|
156
149
|
});
|
|
157
150
|
return result;
|
|
158
151
|
};
|
|
159
|
-
$[
|
|
160
|
-
$[
|
|
161
|
-
} else t7 = $[
|
|
152
|
+
$[25] = filterData;
|
|
153
|
+
$[26] = t7;
|
|
154
|
+
} else t7 = $[26];
|
|
162
155
|
const getFilterValue = t7;
|
|
163
156
|
let t8;
|
|
164
|
-
if ($[
|
|
157
|
+
if ($[27] !== defaultFilterValues || $[28] !== setFilterValue) {
|
|
165
158
|
t8 = () => {
|
|
166
159
|
setFilterValue(defaultFilterValues ?? {});
|
|
167
160
|
};
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
} else t8 = $[
|
|
161
|
+
$[27] = defaultFilterValues;
|
|
162
|
+
$[28] = setFilterValue;
|
|
163
|
+
$[29] = t8;
|
|
164
|
+
} else t8 = $[29];
|
|
172
165
|
const clearAllFilters = t8;
|
|
173
166
|
let t9;
|
|
174
|
-
if ($[
|
|
167
|
+
if ($[30] !== clearAllFilters || $[31] !== filterData || $[32] !== getFilterValue || $[33] !== setFilterValue) {
|
|
175
168
|
t9 = {
|
|
176
169
|
filterData,
|
|
177
170
|
setFilterValue,
|
|
178
171
|
getFilterValue,
|
|
179
172
|
clearAllFilters
|
|
180
173
|
};
|
|
181
|
-
$[
|
|
182
|
-
$[
|
|
183
|
-
$[
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
} else t9 = $[
|
|
174
|
+
$[30] = clearAllFilters;
|
|
175
|
+
$[31] = filterData;
|
|
176
|
+
$[32] = getFilterValue;
|
|
177
|
+
$[33] = setFilterValue;
|
|
178
|
+
$[34] = t9;
|
|
179
|
+
} else t9 = $[34];
|
|
187
180
|
return t9;
|
|
188
181
|
};
|
|
189
182
|
//#endregion
|
|
@@ -17,7 +17,7 @@ import { Drawer } from "./components/drawer.js";
|
|
|
17
17
|
import { a as tableDetailsPanelDefinition, c as tableHeaderTextDefinition, d as tableSidePanelDefinition, f as tableSidePanelHeaderDefinition, i as tableDetailsCellDefinition, l as tableRowDefinition, n as tableContainerDefinition, o as tableHeadDataDefinition, p as theadDefinition, r as tableDataDefinition, s as tableHeadRowDefinition, t as tableCellTextDefinition, u as tableSidePanelBodyDefinition } from "./table.cva-DkcsOmZG.js";
|
|
18
18
|
import { t as useIntersectionObserver } from "./useIntersectionObserver-DFAhTsV0.js";
|
|
19
19
|
import { t as UIRouter } from "./router.context-MckTbHw9.js";
|
|
20
|
-
import { t as RoutingUtils } from "./routing.utils-
|
|
20
|
+
import { t as RoutingUtils } from "./routing.utils-C5FAT_Qg.js";
|
|
21
21
|
import { ArrowDown, ArrowUp, ArrowUpDown, ChevronRight, GripVertical, Pin, X } from "lucide-react";
|
|
22
22
|
import { c } from "react/compiler-runtime";
|
|
23
23
|
import { Fragment, Suspense, createContext, lazy, useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|