@povio/ui 2.3.2-rc.3 → 2.3.3

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 (284) hide show
  1. package/dist/assets/icons/AlignCenter.js +11 -26
  2. package/dist/assets/icons/AlignLeft.js +11 -26
  3. package/dist/assets/icons/AlignLeftRight.js +11 -26
  4. package/dist/assets/icons/AlignRight.js +11 -26
  5. package/dist/assets/icons/ArrowDropDown.js +11 -26
  6. package/dist/assets/icons/ArrowDropUp.js +11 -26
  7. package/dist/assets/icons/ArrowLeft.js +11 -26
  8. package/dist/assets/icons/ArrowRight.js +11 -26
  9. package/dist/assets/icons/Bold.js +11 -26
  10. package/dist/assets/icons/BulletedList.js +11 -26
  11. package/dist/assets/icons/Calendar.js +13 -28
  12. package/dist/assets/icons/Check.js +13 -28
  13. package/dist/assets/icons/CheckCircle.js +11 -26
  14. package/dist/assets/icons/CheckboxCheckmark.js +14 -29
  15. package/dist/assets/icons/CheckboxIndeterminate.js +14 -29
  16. package/dist/assets/icons/ChevronDown.js +13 -28
  17. package/dist/assets/icons/ChevronLeft.js +13 -28
  18. package/dist/assets/icons/ChevronRight.js +13 -28
  19. package/dist/assets/icons/ChevronUp.js +13 -28
  20. package/dist/assets/icons/ChevronsLeft.js +13 -28
  21. package/dist/assets/icons/ChevronsRight.js +13 -28
  22. package/dist/assets/icons/Clock.js +11 -26
  23. package/dist/assets/icons/Close.js +11 -26
  24. package/dist/assets/icons/DateTime.js +14 -35
  25. package/dist/assets/icons/DragIndicator.js +11 -26
  26. package/dist/assets/icons/File.js +13 -28
  27. package/dist/assets/icons/Highlight.js +11 -26
  28. package/dist/assets/icons/HighlightOn.js +15 -49
  29. package/dist/assets/icons/Home.js +11 -26
  30. package/dist/assets/icons/Info.js +16 -37
  31. package/dist/assets/icons/Italic.js +11 -26
  32. package/dist/assets/icons/Link.js +11 -26
  33. package/dist/assets/icons/Menu.js +11 -26
  34. package/dist/assets/icons/NumberedList.js +11 -26
  35. package/dist/assets/icons/PointerHorizontal.js +11 -26
  36. package/dist/assets/icons/PointerVertical.js +11 -26
  37. package/dist/assets/icons/Search.js +11 -26
  38. package/dist/assets/icons/Send.js +13 -28
  39. package/dist/assets/icons/Strikethrough.js +11 -26
  40. package/dist/assets/icons/TextColor.js +14 -48
  41. package/dist/assets/icons/Today.js +11 -26
  42. package/dist/assets/icons/Underlined.js +13 -28
  43. package/dist/assets/icons/Upload.js +14 -35
  44. package/dist/assets/icons/Visibility.js +11 -26
  45. package/dist/assets/icons/VisibilityOff.js +11 -26
  46. package/dist/assets/icons/WarningFilled.js +13 -28
  47. package/dist/assets/locales/sl/translation.json.js +2 -2
  48. package/dist/components/Breadcrumbs/Breadcrumbs.js +56 -207
  49. package/dist/components/Menu/Menu.js +2 -18
  50. package/dist/components/Menu/MenuDesktop.js +7 -41
  51. package/dist/components/Menu/MenuItem.js +9 -32
  52. package/dist/components/Menu/MenuMobile.js +38 -97
  53. package/dist/components/Menu/MenuPopover.js +29 -105
  54. package/dist/components/buttons/IconButton/IconButton.js +8 -40
  55. package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +1 -2
  56. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +9 -34
  57. package/dist/components/buttons/PillButton/PillButton.js +17 -55
  58. package/dist/components/buttons/SplitButton/SplitButton.js +18 -103
  59. package/dist/components/buttons/TextButton/TextButton.js +8 -30
  60. package/dist/components/buttons/ToggleButton/ToggleButton.js +8 -28
  61. package/dist/components/buttons/shared/ButtonContent.js +22 -80
  62. package/dist/components/inputs/Checkbox/Checkbox.d.ts +0 -1
  63. package/dist/components/inputs/Checkbox/Checkbox.js +35 -201
  64. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +10 -24
  65. package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +0 -3
  66. package/dist/components/inputs/Checkbox/checkbox.cva.js +1 -2
  67. package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +5 -12
  68. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +75 -368
  69. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +5 -12
  70. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +298 -506
  71. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +5 -13
  72. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +56 -273
  73. package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +3 -6
  74. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +130 -606
  75. package/dist/components/inputs/DateTime/shared/Calendar.d.ts +2 -5
  76. package/dist/components/inputs/DateTime/shared/Calendar.js +119 -332
  77. package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -3
  78. package/dist/components/inputs/DateTime/shared/CalendarCell.js +102 -301
  79. package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -3
  80. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +33 -146
  81. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +93 -249
  82. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +137 -318
  83. package/dist/components/inputs/DateTime/shared/DateField.js +112 -311
  84. package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +3 -13
  85. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +139 -383
  86. package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +0 -15
  87. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +11 -96
  88. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +27 -81
  89. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +10 -59
  90. package/dist/components/inputs/DateTime/shared/MonthPicker.js +58 -103
  91. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +82 -193
  92. package/dist/components/inputs/DateTime/shared/TimeField.js +8 -27
  93. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +110 -279
  94. package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +1 -4
  95. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +65 -210
  96. package/dist/components/inputs/DateTime/shared/YearPicker.js +68 -119
  97. package/dist/components/inputs/File/FileUpload.js +44 -87
  98. package/dist/components/inputs/File/FileUploadContainer.js +7 -15
  99. package/dist/components/inputs/File/InputUpload.js +79 -317
  100. package/dist/components/inputs/File/shared/FileCard.js +41 -104
  101. package/dist/components/inputs/File/shared/FileCardList.js +12 -47
  102. package/dist/components/inputs/File/shared/FileUploadContent.js +44 -175
  103. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +46 -149
  104. package/dist/components/inputs/File/shared/FileUploadContentError.js +93 -234
  105. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +97 -230
  106. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +55 -199
  107. package/dist/components/inputs/File/shared/InputUploadContent.js +34 -148
  108. package/dist/components/inputs/File/shared/InputUploadFilled.js +8 -49
  109. package/dist/components/inputs/File/shared/ProgressBar.js +9 -48
  110. package/dist/components/inputs/FormField/FormField.d.ts +3 -3
  111. package/dist/components/inputs/FormField/FormField.js +37 -119
  112. package/dist/components/inputs/FormField/FormFieldError.js +5 -25
  113. package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
  114. package/dist/components/inputs/FormField/FormFieldHeader.js +22 -81
  115. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +7 -31
  116. package/dist/components/inputs/FormField/FormFieldHelper.js +6 -26
  117. package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
  118. package/dist/components/inputs/FormField/FormFieldLabel.js +9 -40
  119. package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +2 -5
  120. package/dist/components/inputs/Input/NumberInput/NumberInput.js +97 -447
  121. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +9 -48
  122. package/dist/components/inputs/Input/TextArea/TextArea.js +90 -305
  123. package/dist/components/inputs/Input/TextInput/TextInput.d.ts +1 -3
  124. package/dist/components/inputs/Input/TextInput/TextInput.js +90 -419
  125. package/dist/components/inputs/Input/shared/InputContent.js +59 -192
  126. package/dist/components/inputs/Inputs/Form.js +11 -40
  127. package/dist/components/inputs/Inputs/InputItem.d.ts +21 -15
  128. package/dist/components/inputs/Inputs/InputItem.js +14 -69
  129. package/dist/components/inputs/Inputs/Inputs.js +11 -37
  130. package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +1 -3
  131. package/dist/components/inputs/RadioGroup/RadioGroup.js +61 -353
  132. package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -17
  133. package/dist/components/inputs/RadioGroup/radio.cva.js +1 -42
  134. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +2 -6
  135. package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +22 -214
  136. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +18 -3
  137. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +8 -104
  138. package/dist/components/inputs/Selection/Select/Select.d.ts +3 -7
  139. package/dist/components/inputs/Selection/Select/Select.js +18 -225
  140. package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -8
  141. package/dist/components/inputs/Selection/shared/SelectBase.js +18 -69
  142. package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
  143. package/dist/components/inputs/Selection/shared/SelectDesktop.js +138 -393
  144. package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
  145. package/dist/components/inputs/Selection/shared/SelectInput.js +116 -330
  146. package/dist/components/inputs/Selection/shared/SelectInputTags.js +25 -99
  147. package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
  148. package/dist/components/inputs/Selection/shared/SelectListBox.js +52 -164
  149. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +35 -85
  150. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +16 -69
  151. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +21 -70
  152. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +9 -58
  153. package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
  154. package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -9
  155. package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -3
  156. package/dist/components/inputs/Selection/shared/select.context.js +36 -67
  157. package/dist/components/inputs/Selection/shared/select.types.d.ts +2 -3
  158. package/dist/components/inputs/Selection/shared/useSelectItems.js +49 -109
  159. package/dist/components/inputs/Slider/Slider.d.ts +1 -2
  160. package/dist/components/inputs/Slider/Slider.js +76 -265
  161. package/dist/components/inputs/TextEditor/TextEditor.d.ts +0 -1
  162. package/dist/components/inputs/TextEditor/TextEditor.js +98 -447
  163. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +11 -37
  164. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +30 -102
  165. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +45 -194
  166. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +28 -88
  167. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +14 -48
  168. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +19 -66
  169. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +15 -49
  170. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +32 -92
  171. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +54 -126
  172. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +38 -141
  173. package/dist/components/inputs/Toggle/Toggle.d.ts +0 -1
  174. package/dist/components/inputs/Toggle/Toggle.js +37 -214
  175. package/dist/components/inputs/Toggle/toggle.cva.d.ts +0 -3
  176. package/dist/components/inputs/Toggle/toggle.cva.js +1 -2
  177. package/dist/components/inputs/shared/CheckContent.d.ts +1 -2
  178. package/dist/components/inputs/shared/CheckContent.js +11 -21
  179. package/dist/components/inputs/shared/InputClear.d.ts +1 -2
  180. package/dist/components/inputs/shared/InputClear.js +12 -88
  181. package/dist/components/inputs/shared/TooltipWrapper.js +11 -50
  182. package/dist/components/inputs/shared/input.cva.d.ts +0 -10
  183. package/dist/components/inputs/shared/input.cva.js +4 -32
  184. package/dist/components/navigation/Accordion/Accordion.js +22 -69
  185. package/dist/components/navigation/Accordion/AccordionItem.js +41 -86
  186. package/dist/components/navigation/Stepper/Stepper.js +22 -67
  187. package/dist/components/navigation/Stepper/StepperItem.js +31 -104
  188. package/dist/components/navigation/Stepper/StepperSeparator.js +5 -23
  189. package/dist/components/overlays/ActionModal/ActionModal.js +35 -169
  190. package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -96
  191. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +8 -48
  192. package/dist/components/overlays/Drawer/Drawer.js +20 -62
  193. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +27 -83
  194. package/dist/components/overlays/Tooltip/Tooltip.js +28 -137
  195. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +12 -37
  196. package/dist/components/segment/Segment.js +57 -218
  197. package/dist/components/segment/SegmentItem.js +10 -67
  198. package/dist/components/shared/pagination/Pagination.js +22 -108
  199. package/dist/components/shared/pagination/PaginationList.js +64 -167
  200. package/dist/components/status/Alert/Alert.js +30 -97
  201. package/dist/components/status/Loader/Loader.js +22 -77
  202. package/dist/components/status/Toast/Toast.js +13 -21
  203. package/dist/components/status/Toast/useToast.js +57 -62
  204. package/dist/components/table/ColumnConfig.js +54 -158
  205. package/dist/components/table/InfiniteTable.js +16 -67
  206. package/dist/components/table/PaginatedTable.js +18 -84
  207. package/dist/components/table/Table.js +27 -28
  208. package/dist/components/text/Link/Link.js +7 -19
  209. package/dist/components/text/Typography/Typography.js +8 -23
  210. package/dist/config/confirmation.context.js +1 -1
  211. package/dist/config/link.context.js +9 -23
  212. package/dist/config/router.context.js +16 -42
  213. package/dist/config/theme.context.js +45 -98
  214. package/dist/config/uiConfig.context.d.ts +6 -19
  215. package/dist/config/uiConfig.context.js +14 -67
  216. package/dist/config/uiStyle.context.d.ts +4 -27
  217. package/dist/config/uiStyle.context.js +5 -15
  218. package/dist/helpers/dynamicInputs.d.ts +5 -5
  219. package/dist/helpers/dynamicInputs.js +0 -3
  220. package/dist/hooks/useBreakpoint.js +3 -16
  221. package/dist/hooks/useDebounceCallback.js +17 -51
  222. package/dist/hooks/useFilters.js +64 -125
  223. package/dist/hooks/useForm.js +8 -42
  224. package/dist/hooks/useFormAutosave.js +30 -101
  225. package/dist/hooks/useIntersectionObserver.d.ts +1 -1
  226. package/dist/hooks/useIntersectionObserver.js +24 -91
  227. package/dist/hooks/useLocalStorage.js +10 -43
  228. package/dist/hooks/useLongPressRepeat.js +20 -55
  229. package/dist/hooks/usePagination.js +19 -49
  230. package/dist/hooks/useScrollableListBox.js +16 -37
  231. package/dist/hooks/useSorting.js +28 -69
  232. package/dist/hooks/useStateAndRef.js +7 -21
  233. package/dist/hooks/useTableColumnConfig.js +31 -124
  234. package/dist/hooks/useTranslationMemo.js +5 -25
  235. package/dist/index.d.ts +0 -7
  236. package/dist/index.js +2 -4
  237. package/dist/tw-ui-plugin.js +0 -6
  238. package/dist/utils/date-time.utils.d.ts +10 -38
  239. package/dist/utils/date-time.utils.js +22 -134
  240. package/package.json +1 -1
  241. package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +0 -5
  242. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -7
  243. package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +0 -13
  244. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +0 -15
  245. package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +0 -32
  246. package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +0 -2
  247. package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +0 -1
  248. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +0 -39
  249. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +0 -85
  250. package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +0 -1
  251. package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -6
  252. package/dist/components/inputs/FormField/formFieldHeader.cva.js +0 -11
  253. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +0 -45
  254. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +0 -571
  255. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +0 -35
  256. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +0 -575
  257. package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
  258. package/dist/components/inputs/Input/TextArea/TextArea.cva.js +0 -5
  259. package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +0 -1
  260. package/dist/components/inputs/Input/shared/numberStatic.utils.js +0 -7
  261. package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +0 -36
  262. package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +0 -14
  263. package/dist/components/inputs/Selection/Select/QuerySelect.js +0 -173
  264. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +0 -9
  265. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +0 -47
  266. package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +0 -12
  267. package/dist/components/inputs/Selection/shared/querySelect.utils.js +0 -36
  268. package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -3
  269. package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +0 -5
  270. package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +0 -5
  271. package/dist/components/inputs/Selection/shared/selectInput.cva.js +0 -5
  272. package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +0 -23
  273. package/dist/components/inputs/Selection/shared/staticSelect.utils.js +0 -37
  274. package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +0 -1
  275. package/dist/components/inputs/Skeleton/InputFrame.d.ts +0 -82
  276. package/dist/components/inputs/Skeleton/InputFrame.js +0 -548
  277. package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
  278. package/dist/components/inputs/shared/tooltipWrapper.cva.js +0 -5
  279. package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +0 -14
  280. package/dist/components/inputs/shared/useStaticInputHandoff.js +0 -100
  281. package/dist/hooks/useQueryAutocomplete.d.ts +0 -14
  282. package/dist/hooks/useQueryAutocomplete.js +0 -57
  283. package/dist/utils/query.utils.d.ts +0 -4
  284. package/dist/utils/query.utils.js +0 -8
@@ -1,7 +1,6 @@
1
1
  import { ObjectUtils } from "../utils/object.utils.js";
2
2
  import { useAutosave } from "./useAutosave.js";
3
3
  import { useForm } from "./useForm.js";
4
- import { c } from "react/compiler-runtime";
5
4
  import { useEffect, useRef } from "react";
6
5
  //#region src/hooks/useFormAutosave.ts
7
6
  var getResetTimeoutErrorMessage = (resetTimeout) => `Form Reset Timeout (${resetTimeout}ms) - Action Required
@@ -16,109 +15,39 @@ Solutions:
16
15
  1. Ensure reset dependencies include all relevant state variables
17
16
  2. Confirm your submission handler updates state properly (check query invalidation)
18
17
  3. For slower operations, consider increasing the timeout threshold`;
19
- function useFormAutosave(t0) {
20
- const $ = c(26);
21
- let autosaveDelay;
22
- let enableAutosave;
23
- let getResetValues;
24
- let onAutosave;
25
- let props;
26
- let resetDeps;
27
- let t1;
28
- if ($[0] !== t0) {
29
- ({autosaveDelay, enableAutosave, onAutosave, getResetValues, resetDeps, resetTimeout: t1, ...props} = t0);
30
- $[0] = t0;
31
- $[1] = autosaveDelay;
32
- $[2] = enableAutosave;
33
- $[3] = getResetValues;
34
- $[4] = onAutosave;
35
- $[5] = props;
36
- $[6] = resetDeps;
37
- $[7] = t1;
38
- } else {
39
- autosaveDelay = $[1];
40
- enableAutosave = $[2];
41
- getResetValues = $[3];
42
- onAutosave = $[4];
43
- props = $[5];
44
- resetDeps = $[6];
45
- t1 = $[7];
46
- }
47
- const resetTimeout = t1 === void 0 ? 5e3 : t1;
48
- let t2;
49
- if ($[8] !== getResetValues) {
50
- t2 = getResetValues();
51
- $[8] = getResetValues;
52
- $[9] = t2;
53
- } else t2 = $[9];
54
- let t3;
55
- if ($[10] !== props || $[11] !== t2) {
56
- t3 = {
57
- ...props,
58
- defaultValues: t2
59
- };
60
- $[10] = props;
61
- $[11] = t2;
62
- $[12] = t3;
63
- } else t3 = $[12];
64
- const form = useForm(t3);
18
+ function useFormAutosave({ autosaveDelay, enableAutosave, onAutosave, getResetValues, resetDeps, resetTimeout = 5e3, ...props }) {
19
+ const form = useForm({
20
+ ...props,
21
+ defaultValues: getResetValues()
22
+ });
65
23
  const shouldResetFormValuesRef = useRef(false);
66
24
  const resetFormValuesTimeoutRef = useRef(void 0);
67
- let t4;
68
- if ($[13] !== form || $[14] !== getResetValues) {
69
- t4 = () => {
70
- const resetValues = getResetValues();
71
- if (resetValues === void 0) return;
72
- const resetFormValues = async () => {
73
- const keepStateOptions = shouldResetFormValuesRef.current ? { keepDirtyValues: true } : void 0;
74
- shouldResetFormValuesRef.current = false;
75
- let values = resetValues;
76
- if (ObjectUtils.isFunction(resetValues)) values = await resetValues();
77
- form.reset(values, keepStateOptions);
78
- };
79
- resetFormValues();
80
- };
81
- $[13] = form;
82
- $[14] = getResetValues;
83
- $[15] = t4;
84
- } else t4 = $[15];
85
- let t5;
86
- if ($[16] !== resetDeps) {
87
- t5 = [...resetDeps];
88
- $[16] = resetDeps;
89
- $[17] = t5;
90
- } else t5 = $[17];
91
- useEffect(t4, t5);
92
- let t6;
93
- if ($[18] !== resetTimeout) {
94
- t6 = () => {
95
- shouldResetFormValuesRef.current = true;
96
- if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
97
- resetFormValuesTimeoutRef.current = setTimeout(() => {
98
- if (shouldResetFormValuesRef.current) throw new Error(getResetTimeoutErrorMessage(resetTimeout));
99
- }, resetTimeout);
100
- };
101
- $[18] = resetTimeout;
102
- $[19] = t6;
103
- } else t6 = $[19];
104
- const onSaveSuccess = t6;
105
- let t7;
106
- if ($[20] !== autosaveDelay || $[21] !== enableAutosave || $[22] !== form || $[23] !== onAutosave || $[24] !== onSaveSuccess) {
107
- t7 = {
108
- form,
109
- delay: autosaveDelay,
110
- enabled: enableAutosave,
111
- onSave: onAutosave,
112
- onSaveSuccess
25
+ useEffect(() => {
26
+ const resetValues = getResetValues();
27
+ if (resetValues === void 0) return;
28
+ const resetFormValues = async () => {
29
+ const keepStateOptions = shouldResetFormValuesRef.current ? { keepDirtyValues: true } : void 0;
30
+ shouldResetFormValuesRef.current = false;
31
+ let values = resetValues;
32
+ if (ObjectUtils.isFunction(resetValues)) values = await resetValues();
33
+ form.reset(values, keepStateOptions);
113
34
  };
114
- $[20] = autosaveDelay;
115
- $[21] = enableAutosave;
116
- $[22] = form;
117
- $[23] = onAutosave;
118
- $[24] = onSaveSuccess;
119
- $[25] = t7;
120
- } else t7 = $[25];
121
- useAutosave(t7);
35
+ resetFormValues();
36
+ }, [...resetDeps]);
37
+ const onSaveSuccess = () => {
38
+ shouldResetFormValuesRef.current = true;
39
+ if (resetFormValuesTimeoutRef.current) clearTimeout(resetFormValuesTimeoutRef.current);
40
+ resetFormValuesTimeoutRef.current = setTimeout(() => {
41
+ if (shouldResetFormValuesRef.current) throw new Error(getResetTimeoutErrorMessage(resetTimeout));
42
+ }, resetTimeout);
43
+ };
44
+ useAutosave({
45
+ form,
46
+ delay: autosaveDelay,
47
+ enabled: enableAutosave,
48
+ onSave: onAutosave,
49
+ onSaveSuccess
50
+ });
122
51
  return form;
123
52
  }
124
53
  //#endregion
@@ -3,6 +3,6 @@ type UseIntersectionObserverProps = {
3
3
  onIntersectionChange?: (entry: IntersectionObserverEntry) => void;
4
4
  } & IntersectionObserverInit;
5
5
  export declare const useIntersectionObserver: <T extends HTMLElement>({ onIntersection, onIntersectionChange, root, rootMargin, threshold, }: UseIntersectionObserverProps) => {
6
- ref: (element: T | null) => void;
6
+ ref: (node: T | null) => void;
7
7
  };
8
8
  export {};
@@ -1,98 +1,31 @@
1
- import { c } from "react/compiler-runtime";
2
- import { useEffect, useRef } from "react";
1
+ import { useCallback, useEffect, useState } from "react";
3
2
  //#region src/hooks/useIntersectionObserver.ts
4
- var useIntersectionObserver = (t0) => {
5
- const $ = c(13);
6
- const { onIntersection, onIntersectionChange, root, rootMargin, threshold } = t0;
7
- const elementRef = useRef(null);
8
- const observerRef = useRef(null);
9
- const onIntersectionRef = useRef(onIntersection);
10
- const onIntersectionChangeRef = useRef(onIntersectionChange);
11
- let t1;
12
- let t2;
13
- if ($[0] !== onIntersection) {
14
- t1 = () => {
15
- onIntersectionRef.current = onIntersection;
16
- };
17
- t2 = [onIntersection];
18
- $[0] = onIntersection;
19
- $[1] = t1;
20
- $[2] = t2;
21
- } else {
22
- t1 = $[1];
23
- t2 = $[2];
24
- }
25
- useEffect(t1, t2);
26
- let t3;
27
- let t4;
28
- if ($[3] !== onIntersectionChange) {
29
- t3 = () => {
30
- onIntersectionChangeRef.current = onIntersectionChange;
31
- };
32
- t4 = [onIntersectionChange];
33
- $[3] = onIntersectionChange;
34
- $[4] = t3;
35
- $[5] = t4;
36
- } else {
37
- t3 = $[4];
38
- t4 = $[5];
39
- }
40
- useEffect(t3, t4);
41
- let t5;
42
- let t6;
43
- if ($[6] !== root || $[7] !== rootMargin || $[8] !== threshold) {
44
- t5 = () => {
45
- const observer = new IntersectionObserver((entries) => {
46
- if (entries.some(_temp)) onIntersectionRef.current?.();
47
- onIntersectionChangeRef.current?.(entries[0]);
48
- }, {
49
- root,
50
- rootMargin,
51
- threshold
52
- });
53
- observerRef.current = observer;
54
- if (elementRef.current) observer.observe(elementRef.current);
55
- return () => {
56
- if (elementRef.current) observer.unobserve(elementRef.current);
57
- observer.disconnect();
58
- observerRef.current = null;
59
- };
60
- };
61
- t6 = [
3
+ var useIntersectionObserver = ({ onIntersection, onIntersectionChange, root, rootMargin, threshold }) => {
4
+ const [element, setElement] = useState(null);
5
+ const ref = useCallback((node) => {
6
+ setElement(node);
7
+ }, []);
8
+ useEffect(() => {
9
+ if (!element) return;
10
+ const observer = new IntersectionObserver((entries) => {
11
+ if (entries.some((entry) => entry.isIntersecting)) onIntersection?.();
12
+ onIntersectionChange?.(entries[0]);
13
+ }, {
62
14
  root,
63
15
  rootMargin,
64
16
  threshold
65
- ];
66
- $[6] = root;
67
- $[7] = rootMargin;
68
- $[8] = threshold;
69
- $[9] = t5;
70
- $[10] = t6;
71
- } else {
72
- t5 = $[9];
73
- t6 = $[10];
74
- }
75
- useEffect(t5, t6);
76
- let t7;
77
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
78
- t7 = (element) => {
79
- if (elementRef.current === element) return;
80
- if (observerRef.current && elementRef.current) observerRef.current.unobserve(elementRef.current);
81
- elementRef.current = element;
82
- if (observerRef.current && elementRef.current) observerRef.current.observe(elementRef.current);
83
- };
84
- $[11] = t7;
85
- } else t7 = $[11];
86
- const ref = t7;
87
- let t8;
88
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
89
- t8 = { ref };
90
- $[12] = t8;
91
- } else t8 = $[12];
92
- return t8;
17
+ });
18
+ observer.observe(element);
19
+ return () => observer.disconnect();
20
+ }, [
21
+ element,
22
+ root,
23
+ onIntersection,
24
+ onIntersectionChange,
25
+ rootMargin,
26
+ threshold
27
+ ]);
28
+ return { ref };
93
29
  };
94
- function _temp(entry) {
95
- return entry.isIntersecting;
96
- }
97
30
  //#endregion
98
31
  export { useIntersectionObserver };
@@ -1,5 +1,4 @@
1
- import { c } from "react/compiler-runtime";
2
- import { useState } from "react";
1
+ import { useCallback, useState } from "react";
3
2
  //#region src/hooks/useLocalStorage.ts
4
3
  var getValue = (key, schema) => {
5
4
  if (!localStorage) return null;
@@ -15,56 +14,24 @@ var getValue = (key, schema) => {
15
14
  if (parsedValue.success) return parsedValue.data;
16
15
  else return null;
17
16
  };
18
- var useLocalStorage = (t0) => {
19
- const $ = c(12);
20
- const { key, schema } = t0;
21
- let t1;
22
- if ($[0] !== key || $[1] !== schema) {
23
- t1 = () => getValue(key, schema);
24
- $[0] = key;
25
- $[1] = schema;
26
- $[2] = t1;
27
- } else t1 = $[2];
28
- const [value, setValue] = useState(t1);
29
- let t2;
30
- if ($[3] !== key || $[4] !== schema) {
31
- t2 = (newValue) => {
17
+ var useLocalStorage = ({ key, schema }) => {
18
+ const [value, setValue] = useState(() => getValue(key, schema));
19
+ return {
20
+ value,
21
+ set: useCallback((newValue) => {
32
22
  if (!localStorage) return;
33
23
  const parsedValue = schema.safeParse(newValue);
34
24
  if (!parsedValue.success) return;
35
25
  if (typeof parsedValue.data === "string") localStorage.setItem(key, parsedValue.data);
36
26
  else localStorage.setItem(key, JSON.stringify(parsedValue.data));
37
27
  setValue(parsedValue.data);
38
- };
39
- $[3] = key;
40
- $[4] = schema;
41
- $[5] = t2;
42
- } else t2 = $[5];
43
- const set = t2;
44
- let t3;
45
- if ($[6] !== key) {
46
- t3 = () => {
28
+ }, [key, schema]),
29
+ remove: useCallback(() => {
47
30
  if (!localStorage) return;
48
31
  localStorage.removeItem(key);
49
32
  setValue(null);
50
- };
51
- $[6] = key;
52
- $[7] = t3;
53
- } else t3 = $[7];
54
- const remove = t3;
55
- let t4;
56
- if ($[8] !== remove || $[9] !== set || $[10] !== value) {
57
- t4 = {
58
- value,
59
- set,
60
- remove
61
- };
62
- $[8] = remove;
63
- $[9] = set;
64
- $[10] = value;
65
- $[11] = t4;
66
- } else t4 = $[11];
67
- return t4;
33
+ }, [key])
34
+ };
68
35
  };
69
36
  //#endregion
70
37
  export { useLocalStorage };
@@ -1,64 +1,29 @@
1
- import { c } from "react/compiler-runtime";
2
1
  import { useEffect, useRef } from "react";
3
2
  //#region src/hooks/useLongPressRepeat.ts
4
- var useLongPressRepeat = (t0) => {
5
- const $ = c(10);
6
- const { onPress, enabled: t1, interval: t2, timeout: t3 } = t0;
7
- const enabled = t1 === void 0 ? true : t1;
8
- const interval = t2 === void 0 ? 85 : t2;
9
- const timeout = t3 === void 0 ? 500 : t3;
3
+ var useLongPressRepeat = ({ onPress, enabled = true, interval = 85, timeout = 500 }) => {
10
4
  const intervalRef = useRef(void 0);
11
- let t4;
12
- let t5;
13
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
14
- t4 = () => () => {
5
+ useEffect(() => {
6
+ return () => {
15
7
  clearInterval(intervalRef.current);
16
8
  };
17
- t5 = [];
18
- $[0] = t4;
19
- $[1] = t5;
20
- } else {
21
- t4 = $[0];
22
- t5 = $[1];
23
- }
24
- useEffect(t4, t5);
25
- let t6;
26
- if ($[2] !== enabled || $[3] !== interval || $[4] !== onPress || $[5] !== timeout) {
27
- t6 = () => {
28
- onPress(false);
29
- if (!enabled) return;
30
- intervalRef.current = setTimeout(() => {
9
+ }, []);
10
+ const onPressStart = () => {
11
+ onPress(false);
12
+ if (!enabled) return;
13
+ intervalRef.current = setTimeout(() => {
14
+ onPress(true);
15
+ intervalRef.current = setInterval(() => {
31
16
  onPress(true);
32
- intervalRef.current = setInterval(() => {
33
- onPress(true);
34
- }, interval);
35
- }, timeout);
36
- };
37
- $[2] = enabled;
38
- $[3] = interval;
39
- $[4] = onPress;
40
- $[5] = timeout;
41
- $[6] = t6;
42
- } else t6 = $[6];
43
- const onPressStart = t6;
44
- let t7;
45
- if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
46
- t7 = () => {
47
- clearInterval(intervalRef.current);
48
- };
49
- $[7] = t7;
50
- } else t7 = $[7];
51
- const onPressEnd = t7;
52
- let t8;
53
- if ($[8] !== onPressStart) {
54
- t8 = {
55
- onPressStart,
56
- onPressEnd
57
- };
58
- $[8] = onPressStart;
59
- $[9] = t8;
60
- } else t8 = $[9];
61
- return t8;
17
+ }, interval);
18
+ }, timeout);
19
+ };
20
+ const onPressEnd = () => {
21
+ clearInterval(intervalRef.current);
22
+ };
23
+ return {
24
+ onPressStart,
25
+ onPressEnd
26
+ };
62
27
  };
63
28
  //#endregion
64
29
  export { useLongPressRepeat };
@@ -1,6 +1,5 @@
1
1
  import { UIRouter } from "../config/router.context.js";
2
2
  import { RoutingUtils } from "../utils/routing.utils.js";
3
- import { c } from "react/compiler-runtime";
4
3
  import { useEffect, useState } from "react";
5
4
  //#region src/hooks/usePagination.ts
6
5
  var DEFAULT_STATE = {
@@ -8,55 +7,26 @@ var DEFAULT_STATE = {
8
7
  pageSize: 20
9
8
  };
10
9
  function usePagination(defaultPagination) {
11
- const $ = c(12);
12
10
  const { replace, searchParams } = UIRouter.useUIRouter();
13
- let t0;
14
- if ($[0] !== defaultPagination || $[1] !== searchParams) {
15
- t0 = defaultPagination ?? {
16
- pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
17
- pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
18
- };
19
- $[0] = defaultPagination;
20
- $[1] = searchParams;
21
- $[2] = t0;
22
- } else t0 = $[2];
23
- const [pagination, setPagination] = useState(t0);
24
- let t1;
25
- if ($[3] !== pagination.pageIndex || $[4] !== pagination.pageSize || $[5] !== replace || $[6] !== searchParams) {
26
- t1 = () => {
27
- const params = new URLSearchParams(searchParams);
28
- params.delete("size");
29
- params.delete("page");
30
- if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
31
- if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", pagination.pageIndex.toString());
32
- if (params.toString() === searchParams.toString()) return;
33
- replace(".", RoutingUtils.toRouterSearch(params));
34
- };
35
- $[3] = pagination.pageIndex;
36
- $[4] = pagination.pageSize;
37
- $[5] = replace;
38
- $[6] = searchParams;
39
- $[7] = t1;
40
- } else t1 = $[7];
41
- let t2;
42
- if ($[8] !== pagination) {
43
- t2 = [pagination];
44
- $[8] = pagination;
45
- $[9] = t2;
46
- } else t2 = $[9];
47
- useEffect(t1, t2);
48
- let t3;
49
- if ($[10] !== pagination) {
50
- t3 = {
51
- pagination,
52
- setPagination,
53
- pageIndex: pagination.pageIndex,
54
- pageSize: pagination.pageSize
55
- };
56
- $[10] = pagination;
57
- $[11] = t3;
58
- } else t3 = $[11];
59
- return t3;
11
+ const [pagination, setPagination] = useState(defaultPagination ?? {
12
+ pageIndex: searchParams.has("page") ? Number.parseInt(searchParams.get("page") ?? "", 10) : DEFAULT_STATE.pageIndex,
13
+ pageSize: searchParams.has("size") ? Number.parseInt(searchParams.get("size") ?? "", 10) : DEFAULT_STATE.pageSize
14
+ });
15
+ useEffect(() => {
16
+ const params = new URLSearchParams(searchParams);
17
+ params.delete("size");
18
+ params.delete("page");
19
+ if (pagination.pageSize !== DEFAULT_STATE.pageSize) params.set("size", pagination.pageSize.toString());
20
+ if (pagination.pageIndex !== DEFAULT_STATE.pageIndex) params.set("page", pagination.pageIndex.toString());
21
+ if (params.toString() === searchParams.toString()) return;
22
+ replace(".", RoutingUtils.toRouterSearch(params));
23
+ }, [pagination]);
24
+ return {
25
+ pagination,
26
+ setPagination,
27
+ pageIndex: pagination.pageIndex,
28
+ pageSize: pagination.pageSize
29
+ };
60
30
  }
61
31
  //#endregion
62
32
  export { usePagination };
@@ -1,47 +1,26 @@
1
1
  import { useBreakpoint } from "./useBreakpoint.js";
2
- import { c } from "react/compiler-runtime";
3
2
  import { useEffect, useRef } from "react";
4
3
  //#region src/hooks/useScrollableListBox.ts
5
4
  function useScrollableListBox() {
6
- const $ = c(4);
7
5
  const ref = useRef(null);
8
6
  const isDesktop = useBreakpoint("md");
9
- let t0;
10
- let t1;
11
- if ($[0] !== isDesktop) {
12
- t0 = () => {
13
- const node = ref.current;
14
- if (!node || isDesktop) return;
15
- const onPointerDownCapture = _temp;
16
- const onClickCapture = _temp2;
17
- node.addEventListener("pointerdown", onPointerDownCapture);
18
- node.addEventListener("click", onClickCapture);
19
- return () => {
20
- node.removeEventListener("pointerdown", onPointerDownCapture);
21
- node.removeEventListener("click", onClickCapture);
22
- };
7
+ useEffect(() => {
8
+ const node = ref.current;
9
+ if (!node || isDesktop) return;
10
+ const onPointerDownCapture = (e) => {
11
+ e.stopPropagation();
23
12
  };
24
- t1 = [ref, isDesktop];
25
- $[0] = isDesktop;
26
- $[1] = t0;
27
- $[2] = t1;
28
- } else {
29
- t0 = $[1];
30
- t1 = $[2];
31
- }
32
- useEffect(t0, t1);
33
- let t2;
34
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
35
- t2 = { ref };
36
- $[3] = t2;
37
- } else t2 = $[3];
38
- return t2;
39
- }
40
- function _temp2(e_0) {
41
- if (e_0.currentTarget?.contains(e_0.target) && e_0.target !== e_0.currentTarget) e_0.target.click();
42
- }
43
- function _temp(e) {
44
- e.stopPropagation();
13
+ const onClickCapture = (e) => {
14
+ if (e.currentTarget?.contains(e.target) && e.target !== e.currentTarget) e.target.click();
15
+ };
16
+ node.addEventListener("pointerdown", onPointerDownCapture);
17
+ node.addEventListener("click", onClickCapture);
18
+ return () => {
19
+ node.removeEventListener("pointerdown", onPointerDownCapture);
20
+ node.removeEventListener("click", onClickCapture);
21
+ };
22
+ }, [ref, isDesktop]);
23
+ return { ref };
45
24
  }
46
25
  //#endregion
47
26
  export { useScrollableListBox };