@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
@@ -3,641 +3,165 @@ import { TimePickerForm } from "../shared/TimePickerForm.js";
3
3
  import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
4
4
  import { DateTimeDialog } from "../shared/DateTimeDialog.js";
5
5
  import { DateTimeDialogFooter } from "../shared/DateTimeDialogFooter.js";
6
- import { getStaticTimeSegments } from "../shared/staticDateTimeSegments.js";
7
6
  import { FormField } from "../../FormField/FormField.js";
8
7
  import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
9
- import { InputFrame } from "../../Skeleton/InputFrame.js";
10
- import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
11
- import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
12
8
  import { TimePickerInput } from "../shared/TimePickerInput.js";
13
- import { c } from "react/compiler-runtime";
14
9
  import { jsx, jsxs } from "react/jsx-runtime";
15
10
  import { clsx } from "clsx";
16
11
  import { useEffect, useRef, useState } from "react";
17
12
  import { useLocale, useTimeField } from "react-aria";
18
13
  import { mergeRefs } from "@react-aria/utils";
19
14
  import { Controller } from "react-hook-form";
20
- import { now, toTime } from "@internationalized/date";
15
+ import { getLocalTimeZone, now, toTime } from "@internationalized/date";
21
16
  import { DateTime } from "luxon";
22
17
  import { useTimeFieldState } from "react-stately";
23
18
  //#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
24
19
  var TimePickerBase = (props) => {
25
- const $ = c(143);
26
20
  const ui = UIConfig.useConfig();
27
- let asProp;
28
- let className;
29
- let disableDropdown;
30
- let disableManualEntryProp;
31
- let error;
32
- let errorClassName;
33
- let fireBlurOnChangeProp;
34
- let headerClassName;
35
- let helperText;
36
- let hideLabelProp;
37
- let inputClassName;
38
- let isClearableProp;
39
- let isDirty;
40
- let isDisabled;
41
- let isHeaderHidden;
42
- let isRequired;
43
- let label;
44
- let onBlur;
45
- let onChange;
46
- let placeholder;
47
- let ref;
48
- let rest;
49
- let rightContent;
50
- let sizeProp;
51
- let tooltipText;
52
- let value;
53
- let variantProp;
54
- if ($[0] !== props) {
55
- ({ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, onBlur, value, disableDropdown, placeholder, className, inputClassName, variant: variantProp, as: asProp, size: sizeProp, hideLabel: hideLabelProp, isClearable: isClearableProp, disableManualEntry: disableManualEntryProp, fireBlurOnChange: fireBlurOnChangeProp, ...rest} = props);
56
- $[0] = props;
57
- $[1] = asProp;
58
- $[2] = className;
59
- $[3] = disableDropdown;
60
- $[4] = disableManualEntryProp;
61
- $[5] = error;
62
- $[6] = errorClassName;
63
- $[7] = fireBlurOnChangeProp;
64
- $[8] = headerClassName;
65
- $[9] = helperText;
66
- $[10] = hideLabelProp;
67
- $[11] = inputClassName;
68
- $[12] = isClearableProp;
69
- $[13] = isDirty;
70
- $[14] = isDisabled;
71
- $[15] = isHeaderHidden;
72
- $[16] = isRequired;
73
- $[17] = label;
74
- $[18] = onBlur;
75
- $[19] = onChange;
76
- $[20] = placeholder;
77
- $[21] = ref;
78
- $[22] = rest;
79
- $[23] = rightContent;
80
- $[24] = sizeProp;
81
- $[25] = tooltipText;
82
- $[26] = value;
83
- $[27] = variantProp;
84
- } else {
85
- asProp = $[1];
86
- className = $[2];
87
- disableDropdown = $[3];
88
- disableManualEntryProp = $[4];
89
- error = $[5];
90
- errorClassName = $[6];
91
- fireBlurOnChangeProp = $[7];
92
- headerClassName = $[8];
93
- helperText = $[9];
94
- hideLabelProp = $[10];
95
- inputClassName = $[11];
96
- isClearableProp = $[12];
97
- isDirty = $[13];
98
- isDisabled = $[14];
99
- isHeaderHidden = $[15];
100
- isRequired = $[16];
101
- label = $[17];
102
- onBlur = $[18];
103
- onChange = $[19];
104
- placeholder = $[20];
105
- ref = $[21];
106
- rest = $[22];
107
- rightContent = $[23];
108
- sizeProp = $[24];
109
- tooltipText = $[25];
110
- value = $[26];
111
- variantProp = $[27];
112
- }
113
- const variant = variantProp ?? ui.input.variant;
114
- const as = asProp ?? ui.input.as;
115
- const size = sizeProp ?? ui.input.size;
116
- const hideLabel = hideLabelProp ?? ui.input.hideLabel;
117
- const isClearable = isClearableProp ?? ui.input.isClearable;
118
- const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
119
- const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
120
- const t0 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
121
- let t1;
122
- if ($[28] !== error || $[29] !== errorClassName || $[30] !== headerClassName || $[31] !== helperText || $[32] !== hideLabel || $[33] !== isDisabled || $[34] !== isRequired || $[35] !== label || $[36] !== rightContent || $[37] !== t0 || $[38] !== tooltipText) {
123
- t1 = {
124
- error,
125
- label,
126
- tooltipText,
127
- helperText,
128
- isRequired,
129
- rightContent,
130
- isHeaderHidden: t0,
131
- hideLabel,
132
- isDisabled,
133
- headerClassName,
134
- errorClassName
135
- };
136
- $[28] = error;
137
- $[29] = errorClassName;
138
- $[30] = headerClassName;
139
- $[31] = helperText;
140
- $[32] = hideLabel;
141
- $[33] = isDisabled;
142
- $[34] = isRequired;
143
- $[35] = label;
144
- $[36] = rightContent;
145
- $[37] = t0;
146
- $[38] = tooltipText;
147
- $[39] = t1;
148
- } else t1 = $[39];
149
- const formFieldProps = t1;
21
+ const { ref, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isDirty, headerClassName, errorClassName, isHeaderHidden, error, onChange, value, disableDropdown, placeholder, className, inputClassName, variant = ui.input.variant, as = ui.input.as, size = ui.input.size, hideLabel = ui.input.hideLabel, isClearable = ui.input.isClearable, disableManualEntry = ui.dateInput.disableManualEntry, ...rest } = props;
22
+ const formFieldProps = {
23
+ error,
24
+ label,
25
+ tooltipText,
26
+ helperText,
27
+ isRequired,
28
+ rightContent,
29
+ isHeaderHidden: isHeaderHidden || as === "inline" || as === "filter" || as === "floating",
30
+ hideLabel,
31
+ isDisabled,
32
+ headerClassName,
33
+ errorClassName
34
+ };
150
35
  const [isOpen, setIsOpen] = useState(false);
151
36
  const initialDateEmitRef = useRef(true);
152
37
  const { locale } = useLocale();
153
- const normalizedValue = value ?? null;
154
- const t2 = normalizedValue ?? rest.defaultValue ?? null;
155
- let t3;
156
- if ($[40] !== locale || $[41] !== rest || $[42] !== t2) {
157
- t3 = {
158
- ...rest,
159
- defaultValue: t2,
160
- locale
161
- };
162
- $[40] = locale;
163
- $[41] = rest;
164
- $[42] = t2;
165
- $[43] = t3;
166
- } else t3 = $[43];
167
- const dialogState = useTimeFieldState(t3);
168
- let t4;
169
- if ($[44] !== onBlur) {
170
- t4 = (val) => {
171
- onBlur?.({ target: { value: val } });
172
- };
173
- $[44] = onBlur;
174
- $[45] = t4;
175
- } else t4 = $[45];
176
- const handleBlur = t4;
177
- let t5;
178
- if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
179
- t5 = { delay: 500 };
180
- $[46] = t5;
181
- } else t5 = $[46];
182
- const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
183
- let t6;
184
- if ($[47] !== debouncedBlur || $[48] !== fireBlurOnChange || $[49] !== onChange) {
185
- t6 = (val_0) => {
186
- onChange?.(val_0);
187
- if (fireBlurOnChange) debouncedBlur(val_0);
188
- };
189
- $[47] = debouncedBlur;
190
- $[48] = fireBlurOnChange;
191
- $[49] = onChange;
192
- $[50] = t6;
193
- } else t6 = $[50];
194
- let t7;
195
- if ($[51] !== isDisabled || $[52] !== locale || $[53] !== normalizedValue || $[54] !== rest || $[55] !== t6) {
196
- t7 = {
197
- ...rest,
198
- isDisabled,
199
- value: normalizedValue,
200
- onChange: t6,
201
- locale
202
- };
203
- $[51] = isDisabled;
204
- $[52] = locale;
205
- $[53] = normalizedValue;
206
- $[54] = rest;
207
- $[55] = t6;
208
- $[56] = t7;
209
- } else t7 = $[56];
210
- const state = useTimeFieldState(t7);
211
- let t8;
212
- if ($[57] !== onChange || $[58] !== state.timeValue) {
213
- t8 = () => {
214
- if (initialDateEmitRef.current) {
215
- initialDateEmitRef.current = false;
216
- return;
217
- }
218
- if (state.timeValue) onChange?.(state.timeValue);
219
- };
220
- $[57] = onChange;
221
- $[58] = state.timeValue;
222
- $[59] = t8;
223
- } else t8 = $[59];
224
- let t9;
225
- if ($[60] !== rest.date) {
226
- t9 = [rest.date];
227
- $[60] = rest.date;
228
- $[61] = t9;
229
- } else t9 = $[61];
230
- useEffect(t8, t9);
38
+ const dialogState = useTimeFieldState({
39
+ ...rest,
40
+ defaultValue: value || rest.defaultValue,
41
+ locale
42
+ });
43
+ const state = useTimeFieldState({
44
+ ...rest,
45
+ isDisabled,
46
+ value,
47
+ onChange,
48
+ locale
49
+ });
50
+ useEffect(() => {
51
+ if (initialDateEmitRef.current) {
52
+ initialDateEmitRef.current = false;
53
+ return;
54
+ }
55
+ if (state.timeValue) onChange?.(state.timeValue);
56
+ }, [rest.date]);
231
57
  const timeFieldRef = useRef(null);
232
- let t10;
233
- if ($[62] !== disableManualEntry || $[63] !== label || $[64] !== rest) {
234
- t10 = {
235
- ...rest,
236
- label,
237
- isReadOnly: disableManualEntry
238
- };
239
- $[62] = disableManualEntry;
240
- $[63] = label;
241
- $[64] = rest;
242
- $[65] = t10;
243
- } else t10 = $[65];
244
- const { labelProps, fieldProps } = useTimeField(t10, state, timeFieldRef);
245
- const t11 = hideLabel || isHeaderHidden;
246
- let t12;
247
- if ($[66] !== headerClassName || $[67] !== helperText || $[68] !== isDisabled || $[69] !== isRequired || $[70] !== label || $[71] !== labelProps || $[72] !== rightContent || $[73] !== t11 || $[74] !== tooltipText) {
248
- t12 = {
249
- label,
250
- tooltipText,
251
- helperText,
252
- isRequired,
253
- rightContent,
254
- isHeaderHidden: t11,
255
- isDisabled,
256
- className: headerClassName,
257
- labelProps
258
- };
259
- $[66] = headerClassName;
260
- $[67] = helperText;
261
- $[68] = isDisabled;
262
- $[69] = isRequired;
263
- $[70] = label;
264
- $[71] = labelProps;
265
- $[72] = rightContent;
266
- $[73] = t11;
267
- $[74] = tooltipText;
268
- $[75] = t12;
269
- } else t12 = $[75];
270
- const headerProps = t12;
271
- let t13;
272
- if ($[76] !== dialogState.value || $[77] !== fireBlurOnChange || $[78] !== handleBlur || $[79] !== state) {
273
- t13 = () => {
274
- const newValue = dialogState.value;
275
- state.setValue(newValue);
276
- setIsOpen(false);
277
- if (fireBlurOnChange) handleBlur(newValue);
278
- };
279
- $[76] = dialogState.value;
280
- $[77] = fireBlurOnChange;
281
- $[78] = handleBlur;
282
- $[79] = state;
283
- $[80] = t13;
284
- } else t13 = $[80];
285
- const onApply = t13;
286
- let t14;
287
- if ($[81] !== dialogState || $[82] !== isOpen || $[83] !== state.value) {
288
- t14 = (open) => {
289
- setIsOpen(open);
290
- if (!isOpen) dialogState.setValue(state.value);
291
- };
292
- $[81] = dialogState;
293
- $[82] = isOpen;
294
- $[83] = state.value;
295
- $[84] = t14;
296
- } else t14 = $[84];
297
- const onOpenChange = t14;
298
- let t15;
299
- if ($[85] !== dialogState || $[86] !== state.value) {
300
- t15 = () => {
301
- dialogState.setValue(state.value);
302
- setIsOpen(true);
303
- };
304
- $[85] = dialogState;
305
- $[86] = state.value;
306
- $[87] = t15;
307
- } else t15 = $[87];
308
- const onOpen = t15;
309
- let t16;
310
- if ($[88] !== onChange) {
311
- t16 = () => {
312
- onChange?.(null);
313
- };
314
- $[88] = onChange;
315
- $[89] = t16;
316
- } else t16 = $[89];
317
- const onInputClear = t16;
318
- const t17 = as === "inline" ? -1 : void 0;
319
- let t18;
320
- if ($[90] !== className) {
321
- t18 = clsx("group relative inline-flex w-full flex-col text-left", className);
322
- $[90] = className;
323
- $[91] = t18;
324
- } else t18 = $[91];
325
- const t19 = as === "inline" ? -1 : void 0;
326
- let t20;
327
- if ($[92] !== ref) {
328
- t20 = mergeRefs(ref, timeFieldRef);
329
- $[92] = ref;
330
- $[93] = t20;
331
- } else t20 = $[93];
332
- let t21;
333
- if ($[94] !== fieldProps || $[95] !== handleBlur || $[96] !== state.value) {
334
- t21 = (event) => {
335
- fieldProps.onBlur?.(event);
336
- handleBlur(state.value);
337
- };
338
- $[94] = fieldProps;
339
- $[95] = handleBlur;
340
- $[96] = state.value;
341
- $[97] = t21;
342
- } else t21 = $[97];
343
- let t22;
344
- if ($[98] !== fieldProps || $[99] !== t21) {
345
- t22 = {
346
- ...fieldProps,
347
- onBlur: t21
348
- };
349
- $[98] = fieldProps;
350
- $[99] = t21;
351
- $[100] = t22;
352
- } else t22 = $[100];
353
- const t23 = !!error;
354
- let t24;
355
- if ($[101] !== as || $[102] !== disableDropdown || $[103] !== disableManualEntry || $[104] !== fireBlurOnChange || $[105] !== headerProps || $[106] !== inputClassName || $[107] !== isClearable || $[108] !== isDirty || $[109] !== isDisabled || $[110] !== isRequired || $[111] !== onInputClear || $[112] !== onOpen || $[113] !== placeholder || $[114] !== size || $[115] !== state || $[116] !== t20 || $[117] !== t22 || $[118] !== t23 || $[119] !== variant) {
356
- t24 = /* @__PURE__ */ jsx(TimePickerInput, {
357
- ref: t20,
358
- as,
359
- fieldProps: t22,
360
- state,
361
- onPress: onOpen,
362
- isDisabled,
363
- isDirty,
364
- isRequired,
365
- isInvalid: t23,
366
- disableDropdown,
367
- variant,
368
- size,
369
- isClearable,
370
- headerProps,
371
- disableManualEntry,
372
- placeholder,
373
- className: inputClassName,
374
- onClear: onInputClear,
375
- fireBlurOnChange
376
- });
377
- $[101] = as;
378
- $[102] = disableDropdown;
379
- $[103] = disableManualEntry;
380
- $[104] = fireBlurOnChange;
381
- $[105] = headerProps;
382
- $[106] = inputClassName;
383
- $[107] = isClearable;
384
- $[108] = isDirty;
385
- $[109] = isDisabled;
386
- $[110] = isRequired;
387
- $[111] = onInputClear;
388
- $[112] = onOpen;
389
- $[113] = placeholder;
390
- $[114] = size;
391
- $[115] = state;
392
- $[116] = t20;
393
- $[117] = t22;
394
- $[118] = t23;
395
- $[119] = variant;
396
- $[120] = t24;
397
- } else t24 = $[120];
398
- let t25;
399
- if ($[121] !== dialogState || $[122] !== disableDropdown || $[123] !== disableManualEntry || $[124] !== isDisabled || $[125] !== isOpen || $[126] !== label || $[127] !== onApply || $[128] !== onOpenChange) {
400
- t25 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
401
- footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
402
- isDisabled,
403
- onApply,
404
- isValid: !dialogState.isInvalid && !!dialogState.value
405
- }),
406
- label,
407
- triggerRef: timeFieldRef,
408
- isOpen,
409
- onOpenChange,
410
- children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
411
- });
412
- $[121] = dialogState;
413
- $[122] = disableDropdown;
414
- $[123] = disableManualEntry;
415
- $[124] = isDisabled;
416
- $[125] = isOpen;
417
- $[126] = label;
418
- $[127] = onApply;
419
- $[128] = onOpenChange;
420
- $[129] = t25;
421
- } else t25 = $[129];
422
- let t26;
423
- if ($[130] !== as || $[131] !== formFieldProps || $[132] !== labelProps || $[133] !== t18 || $[134] !== t19 || $[135] !== t24 || $[136] !== t25) {
424
- t26 = /* @__PURE__ */ jsxs(FormField, {
58
+ const { labelProps, fieldProps } = useTimeField({
59
+ ...rest,
60
+ label,
61
+ isReadOnly: disableManualEntry
62
+ }, state, timeFieldRef);
63
+ const headerProps = {
64
+ label,
65
+ tooltipText,
66
+ helperText,
67
+ isRequired,
68
+ rightContent,
69
+ isHeaderHidden: hideLabel || isHeaderHidden,
70
+ isDisabled,
71
+ className: headerClassName,
72
+ labelProps
73
+ };
74
+ const onApply = () => {
75
+ state.setValue(dialogState.value);
76
+ setIsOpen(false);
77
+ };
78
+ const onOpenChange = (open) => {
79
+ setIsOpen(open);
80
+ if (!isOpen) dialogState.setValue(state.value);
81
+ };
82
+ const onOpen = () => {
83
+ dialogState.setValue(state.value);
84
+ setIsOpen(true);
85
+ };
86
+ return /* @__PURE__ */ jsx(TooltipWrapper, {
87
+ as,
88
+ error,
89
+ triggerTabIndex: as === "inline" ? -1 : void 0,
90
+ children: /* @__PURE__ */ jsxs(FormField, {
425
91
  ...formFieldProps,
426
92
  as,
427
93
  labelProps,
428
- className: t18,
429
- tabIndex: t19,
430
- children: [t24, t25]
431
- });
432
- $[130] = as;
433
- $[131] = formFieldProps;
434
- $[132] = labelProps;
435
- $[133] = t18;
436
- $[134] = t19;
437
- $[135] = t24;
438
- $[136] = t25;
439
- $[137] = t26;
440
- } else t26 = $[137];
441
- let t27;
442
- if ($[138] !== as || $[139] !== error || $[140] !== t17 || $[141] !== t26) {
443
- t27 = /* @__PURE__ */ jsx(TooltipWrapper, {
444
- as,
445
- error,
446
- triggerTabIndex: t17,
447
- children: t26
448
- });
449
- $[138] = as;
450
- $[139] = error;
451
- $[140] = t17;
452
- $[141] = t26;
453
- $[142] = t27;
454
- } else t27 = $[142];
455
- return t27;
456
- };
457
- var TimePickerInner = (t0) => {
458
- const $ = c(9);
459
- const { renderStaticInput, isFormControlDisabled, ...props } = t0;
460
- const ui = UIConfig.useConfig();
461
- const { locale } = useLocale();
462
- const [renderInput, setRenderInput] = useState(!(renderStaticInput ?? ui.renderStaticInput));
463
- const inputRef = useRef(null);
464
- const { renderRealInput } = useStaticInputHandoff({
465
- inputRef,
466
- renderInput,
467
- setRenderInput,
468
- getFocusTarget: _temp
94
+ className: clsx("group relative inline-flex w-full flex-col text-left", className),
95
+ tabIndex: as === "inline" ? -1 : void 0,
96
+ children: [/* @__PURE__ */ jsx(TimePickerInput, {
97
+ ref: mergeRefs(ref, timeFieldRef),
98
+ as,
99
+ fieldProps,
100
+ state,
101
+ onPress: onOpen,
102
+ isDisabled,
103
+ isDirty,
104
+ isInvalid: !!error,
105
+ disableDropdown,
106
+ variant,
107
+ size,
108
+ isClearable,
109
+ headerProps,
110
+ disableManualEntry,
111
+ placeholder,
112
+ className: inputClassName
113
+ }), (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
114
+ footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
115
+ isDisabled,
116
+ onApply,
117
+ isValid: !dialogState.isInvalid && !!dialogState.value
118
+ }),
119
+ label,
120
+ triggerRef: timeFieldRef,
121
+ isOpen,
122
+ onOpenChange,
123
+ children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
124
+ })]
125
+ })
469
126
  });
470
- const normalizedValue = props.value ?? null;
127
+ };
128
+ var TimePicker = (props) => {
129
+ let effectiveTimeZone = getLocalTimeZone();
130
+ if (props.timeZone) effectiveTimeZone = props.timeZone;
471
131
  const formatTimeValue = (timeValue) => {
472
132
  if (timeValue === null) return null;
473
133
  let parsedDate;
474
- if (props.date) parsedDate = DateTime.fromISO(props.date, { zone: "UTC" }).toJSDate();
475
- let dateValue = now("UTC");
476
- if (parsedDate) dateValue = DateTimeUtils.fromLocalToZonedDateTime(parsedDate, "UTC");
134
+ if (props.date) parsedDate = DateTime.fromISO(props.date, { zone: effectiveTimeZone }).toJSDate();
135
+ let dateValue = now(effectiveTimeZone);
136
+ if (parsedDate) dateValue = DateTimeUtils.fromLocalToZonedDateTime(parsedDate, effectiveTimeZone);
477
137
  const dateTimeValue = dateValue.set(timeValue);
478
- return DateTimeUtils.fromDateValueToISO(dateTimeValue, "UTC");
138
+ return DateTimeUtils.fromDateValueToISO(dateTimeValue, effectiveTimeZone);
139
+ };
140
+ const parseTimeValue = (isoString) => {
141
+ if (isoString == null) return isoString;
142
+ return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, effectiveTimeZone));
479
143
  };
480
- const parseTimeValue = _temp2;
481
- if (!renderInput) {
482
- const timeValue_0 = normalizedValue ? parseTimeValue(normalizedValue) : null;
483
- const as = props.as ?? ui.input.as;
484
- const isDisabled = isFormControlDisabled || !!props.isDisabled;
485
- const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
486
- const showDropdown = !props.disableDropdown || disableManualEntry;
487
- const staticSegments = getStaticTimeSegments({
488
- value: timeValue_0,
489
- locale,
490
- isDisabled,
491
- hidePlaceholder: as === "floating" && !timeValue_0,
492
- disableManualEntry,
493
- placeholder: props.placeholder
494
- });
495
- return /* @__PURE__ */ jsx(InputFrame, {
496
- ...props,
497
- isDisabled,
498
- className: clsx("group relative inline-flex w-full flex-col text-left", props.className),
499
- inputClassName: clsx("min-w-input-width-min-width", props.inputClassName),
500
- contentClassName: "pr-0!",
501
- contentGroup: "date-picker",
502
- labelPlacement: "content-row",
503
- dataAttributes: {
504
- dataIsEmpty: timeValue_0 == null,
505
- dataIsFilled: timeValue_0 != null,
506
- dataIsDirty: props.isDirty,
507
- dataIsRequired: props.isRequired,
508
- dataIsDisabled: isDisabled,
509
- dataDisabled: isDisabled,
510
- dataInvalid: !!props.error,
511
- dataHasSelection: timeValue_0 != null
512
- },
513
- renderStatic: true,
514
- onStaticInteract: renderRealInput,
515
- showClear: timeValue_0 != null,
516
- wrapContentAndTrailing: true,
517
- trailingClassName: "py-0! pl-0!",
518
- action: showDropdown ? {
519
- icon: ui.dateInput.timeIcon,
520
- onClick: _temp3,
521
- altText: ""
522
- } : void 0,
523
- children: staticSegments
524
- });
525
- }
526
- const T0 = TimePickerBase;
527
- const t1 = mergeRefs(props.ref, inputRef);
528
- const t2 = parseTimeValue(normalizedValue);
529
- let t3;
530
- if ($[0] !== formatTimeValue || $[1] !== props) {
531
- t3 = (value) => props.onChange?.(formatTimeValue(value));
532
- $[0] = formatTimeValue;
533
- $[1] = props;
534
- $[2] = t3;
535
- } else t3 = $[2];
536
- let t4;
537
- if ($[3] !== T0 || $[4] !== props || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
538
- t4 = /* @__PURE__ */ jsx(T0, {
539
- ...props,
540
- ref: t1,
541
- value: t2,
542
- onChange: t3
543
- });
544
- $[3] = T0;
545
- $[4] = props;
546
- $[5] = t1;
547
- $[6] = t2;
548
- $[7] = t3;
549
- $[8] = t4;
550
- } else t4 = $[8];
551
- return t4;
552
- };
553
- var TimePicker = (t0) => {
554
- const $ = c(21);
555
- let props;
556
- let renderStaticInput;
557
- if ($[0] !== t0) {
558
- ({renderStaticInput, ...props} = t0);
559
- $[0] = t0;
560
- $[1] = props;
561
- $[2] = renderStaticInput;
562
- } else {
563
- props = $[1];
564
- renderStaticInput = $[2];
565
- }
566
144
  if ("formControl" in props && props.formControl) {
567
- let formControl;
568
- let innerProps;
569
- let ref;
570
- if ($[3] !== props) {
571
- ({formControl, ref, ...innerProps} = props);
572
- $[3] = props;
573
- $[4] = formControl;
574
- $[5] = innerProps;
575
- $[6] = ref;
576
- } else {
577
- formControl = $[4];
578
- innerProps = $[5];
579
- ref = $[6];
580
- }
581
- const controlWithOptions = formControl.control;
582
- let t1;
583
- if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
584
- t1 = (t2) => {
585
- const { field, fieldState: t3 } = t2;
586
- const { error, isDirty } = t3;
587
- return /* @__PURE__ */ jsx(TimePickerInner, {
588
- ...innerProps,
589
- ref: mergeRefs(ref, field.ref),
590
- value: field.value ?? null,
591
- onChange: field.onChange,
592
- onBlur: field.onBlur,
593
- isDirty,
594
- isDisabled: field.disabled || props.isDisabled,
595
- isFormControlDisabled: !!controlWithOptions._options?.disabled,
596
- error: props.error ?? error?.message,
597
- renderStaticInput
598
- });
599
- };
600
- $[7] = controlWithOptions._options?.disabled;
601
- $[8] = innerProps;
602
- $[9] = props.error;
603
- $[10] = props.isDisabled;
604
- $[11] = ref;
605
- $[12] = renderStaticInput;
606
- $[13] = t1;
607
- } else t1 = $[13];
608
- let t2;
609
- if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
610
- t2 = /* @__PURE__ */ jsx(Controller, {
611
- control: formControl.control,
612
- name: formControl.name,
613
- render: t1
614
- });
615
- $[14] = formControl.control;
616
- $[15] = formControl.name;
617
- $[16] = t1;
618
- $[17] = t2;
619
- } else t2 = $[17];
620
- return t2;
621
- }
622
- let t1;
623
- if ($[18] !== props || $[19] !== renderStaticInput) {
624
- t1 = /* @__PURE__ */ jsx(TimePickerInner, {
625
- ...props,
626
- renderStaticInput
145
+ const { formControl, ref, ...innerProps } = props;
146
+ return /* @__PURE__ */ jsx(Controller, {
147
+ control: formControl.control,
148
+ name: formControl.name,
149
+ render: ({ field, fieldState: { error } }) => /* @__PURE__ */ jsx(TimePickerBase, {
150
+ ...innerProps,
151
+ ref: mergeRefs(ref, field.ref),
152
+ value: parseTimeValue(field.value),
153
+ onChange: (value) => field.onChange(formatTimeValue(value)),
154
+ onBlur: field.onBlur,
155
+ isDisabled: field.disabled || props.isDisabled,
156
+ error: props.error ?? error?.message
157
+ })
627
158
  });
628
- $[18] = props;
629
- $[19] = renderStaticInput;
630
- $[20] = t1;
631
- } else t1 = $[20];
632
- return t1;
159
+ }
160
+ return /* @__PURE__ */ jsx(TimePickerBase, {
161
+ ...props,
162
+ value: parseTimeValue(props.value),
163
+ onChange: (value) => props.onChange?.(formatTimeValue(value))
164
+ });
633
165
  };
634
- function _temp(input) {
635
- return input.querySelector("input, button, [tabindex]:not([tabindex='-1'])");
636
- }
637
- function _temp2(isoString) {
638
- if (isoString == null) return null;
639
- return toTime(DateTimeUtils.fromISOtoZonedDateTime(isoString, "UTC"));
640
- }
641
- function _temp3() {}
642
166
  //#endregion
643
167
  export { TimePicker };