@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.
Files changed (102) hide show
  1. package/dist/{Autocomplete-XP-Qdlrm.js → Autocomplete-BKJ5sYdA.js} +4 -4
  2. package/dist/{Autocomplete.bound-DFL87TOZ.js → Autocomplete.bound-B6RmJlR6.js} +1 -1
  3. package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-B7i7tj1S.js} +1 -1
  4. package/dist/{Calendar.lazy-Bl5amf0W.js → Calendar.lazy-9hn-y6c8.js} +1 -1
  5. package/dist/{CheckboxGroup-CK_tTvvI.js → CheckboxGroup-CneFMbCF.js} +1 -1
  6. package/dist/{CheckboxGroup.bound-wGcpw5tY.js → CheckboxGroup.bound-BddvGfb_.js} +1 -1
  7. package/dist/{DatePicker-CqkS8dCf.js → DatePicker-DUCe_SVM.js} +3 -3
  8. package/dist/{DatePicker.bound-Bg524WMN.js → DatePicker.bound-r5FQhOff.js} +1 -1
  9. package/dist/{DatePickerInput-jrCYehXn.js → DatePickerInput-C9wcjFvV.js} +1 -1
  10. package/dist/{DateRangePicker-DfLnonW1.js → DateRangePicker-CkiT1lEf.js} +3 -3
  11. package/dist/{DateRangePicker.bound-Cahr-3cK.js → DateRangePicker.bound-Chl_cUUj.js} +1 -1
  12. package/dist/{DateTimePicker-BL8koIhS.js → DateTimePicker-B7qiGRqC.js} +3 -3
  13. package/dist/{DateTimePicker.bound-BheJ0Rny.js → DateTimePicker.bound-LMdGgruS.js} +1 -1
  14. package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-Dt8nr5qS.js} +2 -2
  15. package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-BjGcbdmX.js} +1 -1
  16. package/dist/{FileInput-3wNdotBt.js → FileInput-CDzclNi2.js} +1 -1
  17. package/dist/{FileInput.bound-CJdou4D6.js → FileInput.bound-Vz2EeuOP.js} +1 -1
  18. package/dist/{FileUpload-C3IMKBRp.js → FileUpload-u81ZwwEt.js} +1 -1
  19. package/dist/{FileUpload.bound-Bf4LzJUU.js → FileUpload.bound-LBo4ERNC.js} +1 -1
  20. package/dist/{FormField-dduTMkNH.js → FormField-ClLu7Hix.js} +2 -2
  21. package/dist/{Input-DRR8_MgG.js → Input-g9gG6FBB.js} +2 -2
  22. package/dist/{Input.bound-3CTdQnA8.js → Input.bound-lFOANQBr.js} +1 -1
  23. package/dist/{InputContent-BkNnqXt3.js → InputContent-qLj8x_zH.js} +1 -1
  24. package/dist/{NumberField-OjtbK2Uh.js → NumberField-DodaCw5J.js} +2 -2
  25. package/dist/{NumberField.bound-D-uZoLYH.js → NumberField.bound-DxgcOvm1.js} +1 -1
  26. package/dist/{NumberRangeInput-EKzbxaN0.js → NumberRangeInput-BIBCaGE4.js} +1 -1
  27. package/dist/{NumberRangeInput.bound-CmXDNvF1.js → NumberRangeInput.bound-BIWKaOMj.js} +1 -1
  28. package/dist/{PasswordInput.bound-lnJeVf4k.js → PasswordInput.bound-BqTCYsLj.js} +1 -1
  29. package/dist/{RadioGroup-Dvq0TiEB.js → RadioGroup-HMm5cKXh.js} +1 -1
  30. package/dist/{RadioGroup.bound-Dya9IgZr.js → RadioGroup.bound-Bj5CLIlT.js} +1 -1
  31. package/dist/{RangeCalendar-BuRiCB7z.js → RangeCalendar-DQ6Ls8z7.js} +1 -1
  32. package/dist/{RichTextEditor-Cg-S5lhK.js → RichTextEditor-CHmqhNmA.js} +3 -3
  33. package/dist/{Select-DfgTo2X3.js → Select-s_1onwY9.js} +5 -5
  34. package/dist/{Select.bound-XC8lgM6E.js → Select.bound-CaNRXZDU.js} +1 -1
  35. package/dist/{SelectListBox-B_bqWSLU.js → SelectListBox-BuKr994Y.js} +1 -1
  36. package/dist/{Slider-DCsCCPFx.js → Slider-8J-Ny6BX.js} +1 -1
  37. package/dist/{Slider.bound-DO1l_qJQ.js → Slider.bound-DgNK0NK1.js} +1 -1
  38. package/dist/{TextArea-nySHbed0.js → TextArea-CsTjCZIE.js} +1 -1
  39. package/dist/{TextArea.bound-DbSMg_Kz.js → TextArea.bound-JYXWI2Vn.js} +1 -1
  40. package/dist/{TimePicker-Fnj3QZ3G.js → TimePicker-BSM4Ioa_.js} +1 -1
  41. package/dist/{TimePicker.bound-DLflOXZm.js → TimePicker.bound-DGNPAcDB.js} +1 -1
  42. package/dist/{ToastContainer-DtpZaefx.js → ToastContainer-Cdp4jsgT.js} +24 -1
  43. package/dist/{ToggleGroup-Co1-A0Ti.js → ToggleGroup-BDKfPYek.js} +1 -1
  44. package/dist/{ToggleGroup.bound-DNxhSz1h.js → ToggleGroup.bound-CF5hXyw8.js} +1 -1
  45. package/dist/components/autocomplete.js +1 -1
  46. package/dist/components/breadcrumbs.js +1 -1
  47. package/dist/components/checkbox-group.js +1 -1
  48. package/dist/components/date-picker.js +1 -1
  49. package/dist/components/date-range-picker.js +1 -1
  50. package/dist/components/date-time-picker.js +1 -1
  51. package/dist/components/dropdown-menu.js +2 -2
  52. package/dist/components/file-input.js +1 -1
  53. package/dist/components/file-upload-container.js +1 -1
  54. package/dist/components/file-upload.js +1 -1
  55. package/dist/components/form-field.js +1 -1
  56. package/dist/components/input-frame.js +1 -1
  57. package/dist/components/input.js +1 -1
  58. package/dist/components/number-field.js +1 -1
  59. package/dist/components/number-range-input.js +1 -1
  60. package/dist/components/page-header.js +1 -1
  61. package/dist/components/password-input.js +1 -1
  62. package/dist/components/radio-group.js +1 -1
  63. package/dist/components/select.js +1 -1
  64. package/dist/components/slider.js +1 -1
  65. package/dist/components/split-button.js +1 -1
  66. package/dist/components/style-definitions.js +2 -2
  67. package/dist/components/text-area.js +1 -1
  68. package/dist/components/time-picker.js +1 -1
  69. package/dist/components/toast.js +2 -2
  70. package/dist/components/toggle-group.js +1 -1
  71. package/dist/components/use-toast.js +2 -2
  72. package/dist/{dist-fFtzh872.js → dist-C8Tl4DGt.js} +1 -1
  73. package/dist/{dropdownMenu.cva-DwSOcbmR.js → dropdownMenu.cva-CcFuz2Yo.js} +1 -1
  74. package/dist/hooks/use-filters.js +1 -1
  75. package/dist/index.js +30 -30
  76. package/dist/rich-text-editor.js +1 -1
  77. package/dist/{routing.utils-DfxEt0_Y.js → routing.utils-C5FAT_Qg.js} +2 -2
  78. package/dist/{selectDesktop.cva-DStkOdwm.js → selectDesktop.cva-30JAvtgB.js} +1 -1
  79. package/dist/tanstack/autocomplete.js +1 -1
  80. package/dist/tanstack/checkbox-group.js +1 -1
  81. package/dist/tanstack/date-picker.js +1 -1
  82. package/dist/tanstack/date-range-picker.js +1 -1
  83. package/dist/tanstack/date-time-picker.js +1 -1
  84. package/dist/tanstack/file-input.js +1 -1
  85. package/dist/tanstack/file-upload.js +1 -1
  86. package/dist/tanstack/input.js +1 -1
  87. package/dist/tanstack/number-field.js +1 -1
  88. package/dist/tanstack/number-range-input.js +1 -1
  89. package/dist/tanstack/password-input.js +1 -1
  90. package/dist/tanstack/radio-group.js +1 -1
  91. package/dist/tanstack/rich-text-editor.js +1 -1
  92. package/dist/tanstack/select.js +1 -1
  93. package/dist/tanstack/slider.js +1 -1
  94. package/dist/tanstack/table.js +1 -1
  95. package/dist/tanstack/text-area.js +1 -1
  96. package/dist/tanstack/time-picker.js +1 -1
  97. package/dist/tanstack/toggle-group.js +1 -1
  98. package/dist/tanstack.js +30 -30
  99. package/dist/{toast.runtime-BWQLlbZW.js → toast.runtime-CvmhLbUP.js} +1 -1
  100. package/dist/{useFilters-DMi94RZK.js → useFilters-Bp9x3-09.js} +71 -78
  101. package/dist/{useTableColumnConfig-xvu1zw0E.js → useTableColumnConfig-yf7pvTbe.js} +1 -1
  102. 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-DfxEt0_Y.js";
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
- function normalizeBooleanQueryValue(value) {
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
- for (const [key, value] of searchParams.entries()) {
35
- const normalizedValue = normalizeBooleanQueryValue(value);
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 isArray = normalizedValue.startsWith("[") && normalizedValue.endsWith("]");
40
- const isObject = normalizedValue.startsWith("{") && normalizedValue.endsWith("}");
41
- const isNumber = !Number.isNaN(Number(normalizedValue)) && normalizedValue !== "";
42
- const isBoolean = ["true", "false"].includes(normalizedValue);
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(33);
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] !== schema || $[1] !== searchParams) {
60
- t1 = () => parseFilterFromQuery(searchParams, schema);
61
- $[0] = schema;
62
- $[1] = searchParams;
63
- $[2] = t1;
64
- } else t1 = $[2];
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 ($[3] !== defaultFilterValues || $[4] !== prefix || $[5] !== replace || $[6] !== schema || $[7] !== searchParams) {
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
- $[3] = defaultFilterValues;
82
- $[4] = prefix;
83
- $[5] = replace;
84
- $[6] = schema;
85
- $[7] = searchParams;
86
- $[8] = t2;
87
- } else t2 = $[8];
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 ($[9] !== defaultFilterValues || $[10] !== prefix || $[11] !== schema) {
77
+ if ($[10] !== defaultFilterValues || $[11] !== prefix || $[12] !== schema) {
90
78
  t3 = [
91
79
  defaultFilterValues,
92
80
  prefix,
93
81
  schema
94
82
  ];
95
- $[9] = defaultFilterValues;
96
- $[10] = prefix;
97
- $[11] = schema;
98
- $[12] = t3;
99
- } else t3 = $[12];
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 ($[13] !== schema || $[14] !== searchParams) {
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 = [searchParams, schema];
109
- $[13] = schema;
110
- $[14] = searchParams;
111
- $[15] = t4;
112
- $[16] = t5;
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 = $[15];
115
- t5 = $[16];
107
+ t4 = $[17];
108
+ t5 = $[18];
116
109
  }
117
110
  useEffect(t4, t5);
118
111
  let t6;
119
- if ($[17] !== defaultFilterValues || $[18] !== filterData || $[19] !== prefix || $[20] !== replace || $[21] !== searchParams) {
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
- $[17] = defaultFilterValues;
143
- $[18] = filterData;
144
- $[19] = prefix;
145
- $[20] = replace;
146
- $[21] = searchParams;
147
- $[22] = t6;
148
- } else t6 = $[22];
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 ($[23] !== filterData) {
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
- $[23] = filterData;
160
- $[24] = t7;
161
- } else t7 = $[24];
152
+ $[25] = filterData;
153
+ $[26] = t7;
154
+ } else t7 = $[26];
162
155
  const getFilterValue = t7;
163
156
  let t8;
164
- if ($[25] !== defaultFilterValues || $[26] !== setFilterValue) {
157
+ if ($[27] !== defaultFilterValues || $[28] !== setFilterValue) {
165
158
  t8 = () => {
166
159
  setFilterValue(defaultFilterValues ?? {});
167
160
  };
168
- $[25] = defaultFilterValues;
169
- $[26] = setFilterValue;
170
- $[27] = t8;
171
- } else t8 = $[27];
161
+ $[27] = defaultFilterValues;
162
+ $[28] = setFilterValue;
163
+ $[29] = t8;
164
+ } else t8 = $[29];
172
165
  const clearAllFilters = t8;
173
166
  let t9;
174
- if ($[28] !== clearAllFilters || $[29] !== filterData || $[30] !== getFilterValue || $[31] !== setFilterValue) {
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
- $[28] = clearAllFilters;
182
- $[29] = filterData;
183
- $[30] = getFilterValue;
184
- $[31] = setFilterValue;
185
- $[32] = t9;
186
- } else t9 = $[32];
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-DfxEt0_Y.js";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "5.0.1-rc.1",
3
+ "version": "5.0.1-rc.2",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",