@povio/ui 3.4.0-rc.1 → 3.4.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +2 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +100 -93
- package/dist/components/inputs/Checkbox/CheckboxGroup.d.ts +2 -1
- package/dist/components/inputs/Checkbox/CheckboxGroup.js +113 -109
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +21 -14
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +22 -14
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +21 -14
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +2 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +294 -275
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +10 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +46 -43
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +17 -17
- package/dist/components/inputs/File/InputUpload.d.ts +1 -1
- package/dist/components/inputs/File/InputUpload.js +17 -17
- package/dist/components/inputs/File/fileUpload.types.d.ts +1 -1
- package/dist/components/inputs/File/inputUpload.types.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +19 -19
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +1 -1
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +18 -18
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.d.ts +1 -1
- package/dist/components/inputs/Input/TextArea/TextArea.js +18 -18
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +38 -36
- package/dist/components/inputs/Inputs/Form.d.ts +4 -4
- package/dist/components/inputs/Inputs/InputItem.d.ts +22 -22
- package/dist/components/inputs/Inputs/InputItem.js +36 -35
- package/dist/components/inputs/Inputs/Inputs.d.ts +2 -2
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +111 -107
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +13 -13
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +1 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +19 -19
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/QuerySelect.js +19 -19
- package/dist/components/inputs/Selection/Select/Select.d.ts +1 -1
- package/dist/components/inputs/Selection/Select/Select.js +19 -19
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +37 -34
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +8 -4
- package/dist/components/inputs/Selection/shared/select.types.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.d.ts +1 -1
- package/dist/components/inputs/Slider/Slider.js +18 -18
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +18 -18
- package/dist/components/inputs/Toggle/Toggle.d.ts +2 -1
- package/dist/components/inputs/Toggle/Toggle.js +63 -59
- package/dist/components/inputs/shared/form.types.d.ts +8 -9
- package/dist/components/segment/Segment.d.ts +1 -1
- package/dist/components/segment/Segment.js +17 -17
- package/dist/components/segment/segment.types.d.ts +1 -1
- package/dist/config/uiConfig.context.d.ts +5 -5
- package/dist/config/uiConfig.context.js +12 -3
- package/dist/helpers/dynamicColumns.d.ts +1 -1
- package/dist/helpers/dynamicInputs.d.ts +7 -7
- package/dist/hooks/useAutosave.d.ts +4 -4
- package/dist/hooks/useAutosave.js +49 -64
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useForm.d.ts +15 -39
- package/dist/hooks/useForm.js +43 -96
- package/dist/hooks/useFormAutosave.d.ts +9 -8
- package/dist/hooks/useFormAutosave.js +9 -23
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/package.json +3 -2
- package/dist/components/inputs/shared/form.binding.d.ts +0 -27
- package/dist/components/inputs/shared/form.binding.js +0 -57
- package/dist/components/inputs/shared/form.types.js +0 -8
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
|
-
import { FieldController } from "../../shared/form.binding.js";
|
|
3
2
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
3
|
import { TimePickerForm } from "../shared/TimePickerForm.js";
|
|
5
4
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
@@ -9,6 +8,7 @@ import { getStaticDateTimeFocusTarget, getStaticTimeSegments } from "../shared/s
|
|
|
9
8
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
10
9
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
11
10
|
import { useStaticInputHandoff } from "../../shared/useStaticInputHandoff.js";
|
|
11
|
+
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
12
12
|
import { TimePickerInput } from "../shared/TimePickerInput.js";
|
|
13
13
|
import { c } from "react/compiler-runtime";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -16,12 +16,13 @@ import { clsx } from "clsx";
|
|
|
16
16
|
import { useEffect, useRef, useState } from "react";
|
|
17
17
|
import { useLocale, useTimeField } from "react-aria";
|
|
18
18
|
import { mergeRefs } from "@react-aria/utils";
|
|
19
|
+
import { Controller } from "react-hook-form";
|
|
19
20
|
import { getLocalTimeZone, now, toTime } from "@internationalized/date";
|
|
20
21
|
import { DateTime } from "luxon";
|
|
21
22
|
import { useTimeFieldState } from "react-stately";
|
|
22
23
|
//#region src/components/inputs/DateTime/TimePicker/TimePicker.tsx
|
|
23
24
|
var TimePickerBase = (props) => {
|
|
24
|
-
const $ = c(
|
|
25
|
+
const $ = c(147);
|
|
25
26
|
const ui = UIConfig.useConfig();
|
|
26
27
|
let asProp;
|
|
27
28
|
let className;
|
|
@@ -29,6 +30,7 @@ var TimePickerBase = (props) => {
|
|
|
29
30
|
let disableManualEntryProp;
|
|
30
31
|
let error;
|
|
31
32
|
let errorClassName;
|
|
33
|
+
let fireBlurOnChangeProp;
|
|
32
34
|
let headerClassName;
|
|
33
35
|
let helperText;
|
|
34
36
|
let hideLabelProp;
|
|
@@ -51,7 +53,7 @@ var TimePickerBase = (props) => {
|
|
|
51
53
|
let value;
|
|
52
54
|
let variantProp;
|
|
53
55
|
if ($[0] !== props) {
|
|
54
|
-
({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, shouldForceLeadingZeros: shouldForceLeadingZerosProp, ...rest} = props);
|
|
56
|
+
({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, shouldForceLeadingZeros: shouldForceLeadingZerosProp, ...rest} = props);
|
|
55
57
|
$[0] = props;
|
|
56
58
|
$[1] = asProp;
|
|
57
59
|
$[2] = className;
|
|
@@ -59,27 +61,28 @@ var TimePickerBase = (props) => {
|
|
|
59
61
|
$[4] = disableManualEntryProp;
|
|
60
62
|
$[5] = error;
|
|
61
63
|
$[6] = errorClassName;
|
|
62
|
-
$[7] =
|
|
63
|
-
$[8] =
|
|
64
|
-
$[9] =
|
|
65
|
-
$[10] =
|
|
66
|
-
$[11] =
|
|
67
|
-
$[12] =
|
|
68
|
-
$[13] =
|
|
69
|
-
$[14] =
|
|
70
|
-
$[15] =
|
|
71
|
-
$[16] =
|
|
72
|
-
$[17] =
|
|
73
|
-
$[18] =
|
|
74
|
-
$[19] =
|
|
75
|
-
$[20] =
|
|
76
|
-
$[21] =
|
|
77
|
-
$[22] =
|
|
78
|
-
$[23] =
|
|
79
|
-
$[24] =
|
|
80
|
-
$[25] =
|
|
81
|
-
$[26] =
|
|
82
|
-
$[27] =
|
|
64
|
+
$[7] = fireBlurOnChangeProp;
|
|
65
|
+
$[8] = headerClassName;
|
|
66
|
+
$[9] = helperText;
|
|
67
|
+
$[10] = hideLabelProp;
|
|
68
|
+
$[11] = inputClassName;
|
|
69
|
+
$[12] = isClearableProp;
|
|
70
|
+
$[13] = isDirty;
|
|
71
|
+
$[14] = isDisabled;
|
|
72
|
+
$[15] = isHeaderHidden;
|
|
73
|
+
$[16] = isRequired;
|
|
74
|
+
$[17] = label;
|
|
75
|
+
$[18] = onBlur;
|
|
76
|
+
$[19] = onChange;
|
|
77
|
+
$[20] = placeholder;
|
|
78
|
+
$[21] = ref;
|
|
79
|
+
$[22] = rest;
|
|
80
|
+
$[23] = rightContent;
|
|
81
|
+
$[24] = shouldForceLeadingZerosProp;
|
|
82
|
+
$[25] = sizeProp;
|
|
83
|
+
$[26] = tooltipText;
|
|
84
|
+
$[27] = value;
|
|
85
|
+
$[28] = variantProp;
|
|
83
86
|
} else {
|
|
84
87
|
asProp = $[1];
|
|
85
88
|
className = $[2];
|
|
@@ -87,27 +90,28 @@ var TimePickerBase = (props) => {
|
|
|
87
90
|
disableManualEntryProp = $[4];
|
|
88
91
|
error = $[5];
|
|
89
92
|
errorClassName = $[6];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
93
|
+
fireBlurOnChangeProp = $[7];
|
|
94
|
+
headerClassName = $[8];
|
|
95
|
+
helperText = $[9];
|
|
96
|
+
hideLabelProp = $[10];
|
|
97
|
+
inputClassName = $[11];
|
|
98
|
+
isClearableProp = $[12];
|
|
99
|
+
isDirty = $[13];
|
|
100
|
+
isDisabled = $[14];
|
|
101
|
+
isHeaderHidden = $[15];
|
|
102
|
+
isRequired = $[16];
|
|
103
|
+
label = $[17];
|
|
104
|
+
onBlur = $[18];
|
|
105
|
+
onChange = $[19];
|
|
106
|
+
placeholder = $[20];
|
|
107
|
+
ref = $[21];
|
|
108
|
+
rest = $[22];
|
|
109
|
+
rightContent = $[23];
|
|
110
|
+
shouldForceLeadingZerosProp = $[24];
|
|
111
|
+
sizeProp = $[25];
|
|
112
|
+
tooltipText = $[26];
|
|
113
|
+
value = $[27];
|
|
114
|
+
variantProp = $[28];
|
|
111
115
|
}
|
|
112
116
|
const variant = variantProp ?? ui.input.variant;
|
|
113
117
|
const as = asProp ?? ui.input.as;
|
|
@@ -115,10 +119,11 @@ var TimePickerBase = (props) => {
|
|
|
115
119
|
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
116
120
|
const isClearable = isClearableProp ?? ui.input.isClearable;
|
|
117
121
|
const disableManualEntry = disableManualEntryProp ?? ui.dateInput.disableManualEntry;
|
|
122
|
+
const fireBlurOnChange = fireBlurOnChangeProp ?? ui.dateInput.fireBlurOnChange;
|
|
118
123
|
const shouldForceLeadingZeros = shouldForceLeadingZerosProp ?? ui.dateInput.shouldForceLeadingZeros;
|
|
119
124
|
const t0 = isHeaderHidden || as === "inline" || as === "filter" || as === "floating";
|
|
120
125
|
let t1;
|
|
121
|
-
if ($[
|
|
126
|
+
if ($[29] !== error || $[30] !== errorClassName || $[31] !== headerClassName || $[32] !== helperText || $[33] !== hideLabel || $[34] !== isDisabled || $[35] !== isRequired || $[36] !== label || $[37] !== rightContent || $[38] !== t0 || $[39] !== tooltipText) {
|
|
122
127
|
t1 = {
|
|
123
128
|
error,
|
|
124
129
|
label,
|
|
@@ -132,19 +137,19 @@ var TimePickerBase = (props) => {
|
|
|
132
137
|
headerClassName,
|
|
133
138
|
errorClassName
|
|
134
139
|
};
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
} else t1 = $[
|
|
140
|
+
$[29] = error;
|
|
141
|
+
$[30] = errorClassName;
|
|
142
|
+
$[31] = headerClassName;
|
|
143
|
+
$[32] = helperText;
|
|
144
|
+
$[33] = hideLabel;
|
|
145
|
+
$[34] = isDisabled;
|
|
146
|
+
$[35] = isRequired;
|
|
147
|
+
$[36] = label;
|
|
148
|
+
$[37] = rightContent;
|
|
149
|
+
$[38] = t0;
|
|
150
|
+
$[39] = tooltipText;
|
|
151
|
+
$[40] = t1;
|
|
152
|
+
} else t1 = $[40];
|
|
148
153
|
const formFieldProps = t1;
|
|
149
154
|
const [isOpen, setIsOpen] = useState(false);
|
|
150
155
|
const initialDateEmitRef = useRef(true);
|
|
@@ -152,210 +157,222 @@ var TimePickerBase = (props) => {
|
|
|
152
157
|
const normalizedValue = value ?? null;
|
|
153
158
|
const t2 = normalizedValue ?? rest.defaultValue ?? null;
|
|
154
159
|
let t3;
|
|
155
|
-
if ($[
|
|
160
|
+
if ($[41] !== locale || $[42] !== rest || $[43] !== shouldForceLeadingZeros || $[44] !== t2) {
|
|
156
161
|
t3 = {
|
|
157
162
|
...rest,
|
|
158
163
|
defaultValue: t2,
|
|
159
164
|
locale,
|
|
160
165
|
shouldForceLeadingZeros
|
|
161
166
|
};
|
|
162
|
-
$[
|
|
163
|
-
$[
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
} else t3 = $[
|
|
167
|
+
$[41] = locale;
|
|
168
|
+
$[42] = rest;
|
|
169
|
+
$[43] = shouldForceLeadingZeros;
|
|
170
|
+
$[44] = t2;
|
|
171
|
+
$[45] = t3;
|
|
172
|
+
} else t3 = $[45];
|
|
168
173
|
const dialogState = useTimeFieldState(t3);
|
|
169
174
|
let t4;
|
|
170
|
-
if ($[
|
|
175
|
+
if ($[46] !== onBlur) {
|
|
171
176
|
t4 = (val) => {
|
|
172
177
|
onBlur?.({ target: { value: val } });
|
|
173
178
|
};
|
|
174
|
-
$[
|
|
175
|
-
$[
|
|
176
|
-
} else t4 = $[
|
|
179
|
+
$[46] = onBlur;
|
|
180
|
+
$[47] = t4;
|
|
181
|
+
} else t4 = $[47];
|
|
177
182
|
const handleBlur = t4;
|
|
178
183
|
let t5;
|
|
179
|
-
if ($[
|
|
180
|
-
t5 =
|
|
181
|
-
onChange?.(val_0);
|
|
182
|
-
};
|
|
183
|
-
$[47] = onChange;
|
|
184
|
+
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
185
|
+
t5 = { delay: 500 };
|
|
184
186
|
$[48] = t5;
|
|
185
187
|
} else t5 = $[48];
|
|
188
|
+
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
|
|
186
189
|
let t6;
|
|
187
|
-
if ($[49] !==
|
|
188
|
-
t6 = {
|
|
190
|
+
if ($[49] !== debouncedBlur || $[50] !== fireBlurOnChange || $[51] !== onChange) {
|
|
191
|
+
t6 = (val_0) => {
|
|
192
|
+
onChange?.(val_0);
|
|
193
|
+
if (fireBlurOnChange) debouncedBlur(val_0);
|
|
194
|
+
};
|
|
195
|
+
$[49] = debouncedBlur;
|
|
196
|
+
$[50] = fireBlurOnChange;
|
|
197
|
+
$[51] = onChange;
|
|
198
|
+
$[52] = t6;
|
|
199
|
+
} else t6 = $[52];
|
|
200
|
+
let t7;
|
|
201
|
+
if ($[53] !== isDisabled || $[54] !== locale || $[55] !== normalizedValue || $[56] !== rest || $[57] !== shouldForceLeadingZeros || $[58] !== t6) {
|
|
202
|
+
t7 = {
|
|
189
203
|
...rest,
|
|
190
204
|
isDisabled,
|
|
191
205
|
value: normalizedValue,
|
|
192
|
-
onChange:
|
|
206
|
+
onChange: t6,
|
|
193
207
|
locale,
|
|
194
208
|
shouldForceLeadingZeros
|
|
195
209
|
};
|
|
196
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
$[
|
|
199
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
} else
|
|
204
|
-
const state = useTimeFieldState(
|
|
205
|
-
let
|
|
206
|
-
if ($[
|
|
207
|
-
|
|
210
|
+
$[53] = isDisabled;
|
|
211
|
+
$[54] = locale;
|
|
212
|
+
$[55] = normalizedValue;
|
|
213
|
+
$[56] = rest;
|
|
214
|
+
$[57] = shouldForceLeadingZeros;
|
|
215
|
+
$[58] = t6;
|
|
216
|
+
$[59] = t7;
|
|
217
|
+
} else t7 = $[59];
|
|
218
|
+
const state = useTimeFieldState(t7);
|
|
219
|
+
let t8;
|
|
220
|
+
if ($[60] !== onChange || $[61] !== state.timeValue) {
|
|
221
|
+
t8 = () => {
|
|
208
222
|
if (initialDateEmitRef.current) {
|
|
209
223
|
initialDateEmitRef.current = false;
|
|
210
224
|
return;
|
|
211
225
|
}
|
|
212
226
|
if (state.timeValue) onChange?.(state.timeValue);
|
|
213
227
|
};
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
} else
|
|
218
|
-
let t8;
|
|
219
|
-
if ($[59] !== rest.date) {
|
|
220
|
-
t8 = [rest.date];
|
|
221
|
-
$[59] = rest.date;
|
|
222
|
-
$[60] = t8;
|
|
223
|
-
} else t8 = $[60];
|
|
224
|
-
useEffect(t7, t8);
|
|
225
|
-
const timeFieldRef = useRef(null);
|
|
228
|
+
$[60] = onChange;
|
|
229
|
+
$[61] = state.timeValue;
|
|
230
|
+
$[62] = t8;
|
|
231
|
+
} else t8 = $[62];
|
|
226
232
|
let t9;
|
|
227
|
-
if ($[
|
|
228
|
-
t9 =
|
|
233
|
+
if ($[63] !== rest.date) {
|
|
234
|
+
t9 = [rest.date];
|
|
235
|
+
$[63] = rest.date;
|
|
236
|
+
$[64] = t9;
|
|
237
|
+
} else t9 = $[64];
|
|
238
|
+
useEffect(t8, t9);
|
|
239
|
+
const timeFieldRef = useRef(null);
|
|
240
|
+
let t10;
|
|
241
|
+
if ($[65] !== disableManualEntry || $[66] !== label || $[67] !== rest || $[68] !== shouldForceLeadingZeros) {
|
|
242
|
+
t10 = {
|
|
229
243
|
...rest,
|
|
230
244
|
label,
|
|
231
245
|
isReadOnly: disableManualEntry,
|
|
232
246
|
shouldForceLeadingZeros
|
|
233
247
|
};
|
|
234
|
-
$[
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
} else
|
|
240
|
-
const { labelProps, fieldProps } = useTimeField(
|
|
241
|
-
const
|
|
242
|
-
let
|
|
243
|
-
if ($[
|
|
244
|
-
|
|
248
|
+
$[65] = disableManualEntry;
|
|
249
|
+
$[66] = label;
|
|
250
|
+
$[67] = rest;
|
|
251
|
+
$[68] = shouldForceLeadingZeros;
|
|
252
|
+
$[69] = t10;
|
|
253
|
+
} else t10 = $[69];
|
|
254
|
+
const { labelProps, fieldProps } = useTimeField(t10, state, timeFieldRef);
|
|
255
|
+
const t11 = hideLabel || isHeaderHidden;
|
|
256
|
+
let t12;
|
|
257
|
+
if ($[70] !== headerClassName || $[71] !== helperText || $[72] !== isDisabled || $[73] !== isRequired || $[74] !== label || $[75] !== labelProps || $[76] !== rightContent || $[77] !== t11 || $[78] !== tooltipText) {
|
|
258
|
+
t12 = {
|
|
245
259
|
label,
|
|
246
260
|
tooltipText,
|
|
247
261
|
helperText,
|
|
248
262
|
isRequired,
|
|
249
263
|
rightContent,
|
|
250
|
-
isHeaderHidden:
|
|
264
|
+
isHeaderHidden: t11,
|
|
251
265
|
isDisabled,
|
|
252
266
|
className: headerClassName,
|
|
253
267
|
labelProps
|
|
254
268
|
};
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[
|
|
265
|
-
} else
|
|
266
|
-
const headerProps =
|
|
267
|
-
let
|
|
268
|
-
if ($[
|
|
269
|
-
|
|
269
|
+
$[70] = headerClassName;
|
|
270
|
+
$[71] = helperText;
|
|
271
|
+
$[72] = isDisabled;
|
|
272
|
+
$[73] = isRequired;
|
|
273
|
+
$[74] = label;
|
|
274
|
+
$[75] = labelProps;
|
|
275
|
+
$[76] = rightContent;
|
|
276
|
+
$[77] = t11;
|
|
277
|
+
$[78] = tooltipText;
|
|
278
|
+
$[79] = t12;
|
|
279
|
+
} else t12 = $[79];
|
|
280
|
+
const headerProps = t12;
|
|
281
|
+
let t13;
|
|
282
|
+
if ($[80] !== dialogState.value || $[81] !== fireBlurOnChange || $[82] !== handleBlur || $[83] !== state) {
|
|
283
|
+
t13 = () => {
|
|
270
284
|
const newValue = dialogState.value;
|
|
271
285
|
state.setValue(newValue);
|
|
272
286
|
setIsOpen(false);
|
|
287
|
+
if (fireBlurOnChange) handleBlur(newValue);
|
|
273
288
|
};
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
289
|
+
$[80] = dialogState.value;
|
|
290
|
+
$[81] = fireBlurOnChange;
|
|
291
|
+
$[82] = handleBlur;
|
|
292
|
+
$[83] = state;
|
|
293
|
+
$[84] = t13;
|
|
294
|
+
} else t13 = $[84];
|
|
295
|
+
const onApply = t13;
|
|
296
|
+
let t14;
|
|
297
|
+
if ($[85] !== dialogState || $[86] !== isOpen || $[87] !== state.value) {
|
|
298
|
+
t14 = (open) => {
|
|
282
299
|
setIsOpen(open);
|
|
283
300
|
if (!isOpen) dialogState.setValue(state.value);
|
|
284
301
|
};
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
} else
|
|
290
|
-
const onOpenChange =
|
|
291
|
-
let
|
|
292
|
-
if ($[
|
|
293
|
-
|
|
302
|
+
$[85] = dialogState;
|
|
303
|
+
$[86] = isOpen;
|
|
304
|
+
$[87] = state.value;
|
|
305
|
+
$[88] = t14;
|
|
306
|
+
} else t14 = $[88];
|
|
307
|
+
const onOpenChange = t14;
|
|
308
|
+
let t15;
|
|
309
|
+
if ($[89] !== dialogState || $[90] !== state.value) {
|
|
310
|
+
t15 = () => {
|
|
294
311
|
dialogState.setValue(state.value);
|
|
295
312
|
setIsOpen(true);
|
|
296
313
|
};
|
|
297
|
-
$[
|
|
298
|
-
$[
|
|
299
|
-
$[
|
|
300
|
-
} else
|
|
301
|
-
const onOpen =
|
|
302
|
-
let
|
|
303
|
-
if ($[
|
|
304
|
-
|
|
314
|
+
$[89] = dialogState;
|
|
315
|
+
$[90] = state.value;
|
|
316
|
+
$[91] = t15;
|
|
317
|
+
} else t15 = $[91];
|
|
318
|
+
const onOpen = t15;
|
|
319
|
+
let t16;
|
|
320
|
+
if ($[92] !== onChange) {
|
|
321
|
+
t16 = () => {
|
|
305
322
|
onChange?.(null);
|
|
306
323
|
};
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
} else
|
|
310
|
-
const onInputClear =
|
|
311
|
-
const
|
|
312
|
-
let
|
|
313
|
-
if ($[
|
|
314
|
-
|
|
315
|
-
$[
|
|
316
|
-
$[
|
|
317
|
-
} else
|
|
318
|
-
const
|
|
319
|
-
let t19;
|
|
320
|
-
if ($[90] !== ref) {
|
|
321
|
-
t19 = mergeRefs(ref, timeFieldRef);
|
|
322
|
-
$[90] = ref;
|
|
323
|
-
$[91] = t19;
|
|
324
|
-
} else t19 = $[91];
|
|
324
|
+
$[92] = onChange;
|
|
325
|
+
$[93] = t16;
|
|
326
|
+
} else t16 = $[93];
|
|
327
|
+
const onInputClear = t16;
|
|
328
|
+
const t17 = as === "inline" ? -1 : void 0;
|
|
329
|
+
let t18;
|
|
330
|
+
if ($[94] !== className) {
|
|
331
|
+
t18 = clsx("group relative inline-flex w-full flex-col text-left", className);
|
|
332
|
+
$[94] = className;
|
|
333
|
+
$[95] = t18;
|
|
334
|
+
} else t18 = $[95];
|
|
335
|
+
const t19 = as === "inline" ? -1 : void 0;
|
|
325
336
|
let t20;
|
|
326
|
-
if ($[
|
|
327
|
-
t20 = (
|
|
337
|
+
if ($[96] !== ref) {
|
|
338
|
+
t20 = mergeRefs(ref, timeFieldRef);
|
|
339
|
+
$[96] = ref;
|
|
340
|
+
$[97] = t20;
|
|
341
|
+
} else t20 = $[97];
|
|
342
|
+
let t21;
|
|
343
|
+
if ($[98] !== fieldProps || $[99] !== handleBlur || $[100] !== state.value) {
|
|
344
|
+
t21 = (event) => {
|
|
328
345
|
fieldProps.onBlur?.(event);
|
|
329
346
|
handleBlur(state.value);
|
|
330
347
|
};
|
|
331
|
-
$[
|
|
332
|
-
$[
|
|
333
|
-
$[
|
|
334
|
-
$[
|
|
335
|
-
} else
|
|
336
|
-
let
|
|
337
|
-
if ($[
|
|
338
|
-
|
|
348
|
+
$[98] = fieldProps;
|
|
349
|
+
$[99] = handleBlur;
|
|
350
|
+
$[100] = state.value;
|
|
351
|
+
$[101] = t21;
|
|
352
|
+
} else t21 = $[101];
|
|
353
|
+
let t22;
|
|
354
|
+
if ($[102] !== fieldProps || $[103] !== t21) {
|
|
355
|
+
t22 = {
|
|
339
356
|
...fieldProps,
|
|
340
|
-
onBlur:
|
|
357
|
+
onBlur: t21
|
|
341
358
|
};
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
} else
|
|
346
|
-
const
|
|
347
|
-
let
|
|
348
|
-
if ($[
|
|
349
|
-
|
|
350
|
-
ref:
|
|
359
|
+
$[102] = fieldProps;
|
|
360
|
+
$[103] = t21;
|
|
361
|
+
$[104] = t22;
|
|
362
|
+
} else t22 = $[104];
|
|
363
|
+
const t23 = !!error;
|
|
364
|
+
let t24;
|
|
365
|
+
if ($[105] !== as || $[106] !== disableDropdown || $[107] !== disableManualEntry || $[108] !== fireBlurOnChange || $[109] !== headerProps || $[110] !== inputClassName || $[111] !== isClearable || $[112] !== isDirty || $[113] !== isDisabled || $[114] !== isRequired || $[115] !== onInputClear || $[116] !== onOpen || $[117] !== placeholder || $[118] !== size || $[119] !== state || $[120] !== t20 || $[121] !== t22 || $[122] !== t23 || $[123] !== variant) {
|
|
366
|
+
t24 = /* @__PURE__ */ jsx(TimePickerInput, {
|
|
367
|
+
ref: t20,
|
|
351
368
|
as,
|
|
352
|
-
fieldProps:
|
|
369
|
+
fieldProps: t22,
|
|
353
370
|
state,
|
|
354
371
|
onPress: onOpen,
|
|
355
372
|
isDisabled,
|
|
356
373
|
isDirty,
|
|
357
374
|
isRequired,
|
|
358
|
-
isInvalid:
|
|
375
|
+
isInvalid: t23,
|
|
359
376
|
disableDropdown,
|
|
360
377
|
variant,
|
|
361
378
|
size,
|
|
@@ -364,31 +381,33 @@ var TimePickerBase = (props) => {
|
|
|
364
381
|
disableManualEntry,
|
|
365
382
|
placeholder,
|
|
366
383
|
className: inputClassName,
|
|
367
|
-
onClear: onInputClear
|
|
384
|
+
onClear: onInputClear,
|
|
385
|
+
fireBlurOnChange
|
|
368
386
|
});
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
$[
|
|
385
|
-
$[
|
|
386
|
-
$[
|
|
387
|
-
$[
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
387
|
+
$[105] = as;
|
|
388
|
+
$[106] = disableDropdown;
|
|
389
|
+
$[107] = disableManualEntry;
|
|
390
|
+
$[108] = fireBlurOnChange;
|
|
391
|
+
$[109] = headerProps;
|
|
392
|
+
$[110] = inputClassName;
|
|
393
|
+
$[111] = isClearable;
|
|
394
|
+
$[112] = isDirty;
|
|
395
|
+
$[113] = isDisabled;
|
|
396
|
+
$[114] = isRequired;
|
|
397
|
+
$[115] = onInputClear;
|
|
398
|
+
$[116] = onOpen;
|
|
399
|
+
$[117] = placeholder;
|
|
400
|
+
$[118] = size;
|
|
401
|
+
$[119] = state;
|
|
402
|
+
$[120] = t20;
|
|
403
|
+
$[121] = t22;
|
|
404
|
+
$[122] = t23;
|
|
405
|
+
$[123] = variant;
|
|
406
|
+
$[124] = t24;
|
|
407
|
+
} else t24 = $[124];
|
|
408
|
+
let t25;
|
|
409
|
+
if ($[125] !== dialogState || $[126] !== disableDropdown || $[127] !== disableManualEntry || $[128] !== isDisabled || $[129] !== isOpen || $[130] !== label || $[131] !== onApply || $[132] !== onOpenChange) {
|
|
410
|
+
t25 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
392
411
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
393
412
|
isDisabled,
|
|
394
413
|
onApply,
|
|
@@ -400,50 +419,50 @@ var TimePickerBase = (props) => {
|
|
|
400
419
|
onOpenChange,
|
|
401
420
|
children: /* @__PURE__ */ jsx(TimePickerForm, { state: dialogState })
|
|
402
421
|
});
|
|
403
|
-
$[
|
|
404
|
-
$[
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
$[
|
|
410
|
-
$[
|
|
411
|
-
$[
|
|
412
|
-
} else
|
|
413
|
-
let
|
|
414
|
-
if ($[
|
|
415
|
-
|
|
422
|
+
$[125] = dialogState;
|
|
423
|
+
$[126] = disableDropdown;
|
|
424
|
+
$[127] = disableManualEntry;
|
|
425
|
+
$[128] = isDisabled;
|
|
426
|
+
$[129] = isOpen;
|
|
427
|
+
$[130] = label;
|
|
428
|
+
$[131] = onApply;
|
|
429
|
+
$[132] = onOpenChange;
|
|
430
|
+
$[133] = t25;
|
|
431
|
+
} else t25 = $[133];
|
|
432
|
+
let t26;
|
|
433
|
+
if ($[134] !== as || $[135] !== formFieldProps || $[136] !== labelProps || $[137] !== t18 || $[138] !== t19 || $[139] !== t24 || $[140] !== t25) {
|
|
434
|
+
t26 = /* @__PURE__ */ jsxs(FormField, {
|
|
416
435
|
...formFieldProps,
|
|
417
436
|
as,
|
|
418
437
|
labelProps,
|
|
419
|
-
className:
|
|
420
|
-
tabIndex:
|
|
421
|
-
children: [
|
|
438
|
+
className: t18,
|
|
439
|
+
tabIndex: t19,
|
|
440
|
+
children: [t24, t25]
|
|
422
441
|
});
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
} else
|
|
432
|
-
let
|
|
433
|
-
if ($[
|
|
434
|
-
|
|
442
|
+
$[134] = as;
|
|
443
|
+
$[135] = formFieldProps;
|
|
444
|
+
$[136] = labelProps;
|
|
445
|
+
$[137] = t18;
|
|
446
|
+
$[138] = t19;
|
|
447
|
+
$[139] = t24;
|
|
448
|
+
$[140] = t25;
|
|
449
|
+
$[141] = t26;
|
|
450
|
+
} else t26 = $[141];
|
|
451
|
+
let t27;
|
|
452
|
+
if ($[142] !== as || $[143] !== error || $[144] !== t17 || $[145] !== t26) {
|
|
453
|
+
t27 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
435
454
|
as,
|
|
436
455
|
error,
|
|
437
|
-
triggerTabIndex:
|
|
438
|
-
children:
|
|
456
|
+
triggerTabIndex: t17,
|
|
457
|
+
children: t26
|
|
439
458
|
});
|
|
440
|
-
$[
|
|
441
|
-
$[
|
|
442
|
-
$[
|
|
443
|
-
$[
|
|
444
|
-
$[
|
|
445
|
-
} else
|
|
446
|
-
return
|
|
459
|
+
$[142] = as;
|
|
460
|
+
$[143] = error;
|
|
461
|
+
$[144] = t17;
|
|
462
|
+
$[145] = t26;
|
|
463
|
+
$[146] = t27;
|
|
464
|
+
} else t27 = $[146];
|
|
465
|
+
return t27;
|
|
447
466
|
};
|
|
448
467
|
var TimePickerInner = (t0) => {
|
|
449
468
|
const $ = c(9);
|
|
@@ -564,35 +583,35 @@ var TimePicker = (t0) => {
|
|
|
564
583
|
props = $[1];
|
|
565
584
|
renderStaticInput = $[2];
|
|
566
585
|
}
|
|
567
|
-
if ("
|
|
568
|
-
let
|
|
586
|
+
if ("formControl" in props && props.formControl) {
|
|
587
|
+
let formControl;
|
|
569
588
|
let innerProps;
|
|
570
589
|
let ref;
|
|
571
590
|
if ($[3] !== props) {
|
|
572
|
-
({
|
|
591
|
+
({formControl, ref, ...innerProps} = props);
|
|
573
592
|
$[3] = props;
|
|
574
|
-
$[4] =
|
|
593
|
+
$[4] = formControl;
|
|
575
594
|
$[5] = innerProps;
|
|
576
595
|
$[6] = ref;
|
|
577
596
|
} else {
|
|
578
|
-
|
|
597
|
+
formControl = $[4];
|
|
579
598
|
innerProps = $[5];
|
|
580
599
|
ref = $[6];
|
|
581
600
|
}
|
|
582
|
-
const controlWithOptions =
|
|
601
|
+
const controlWithOptions = formControl.control;
|
|
583
602
|
let t1;
|
|
584
603
|
if ($[7] !== controlWithOptions._options?.disabled || $[8] !== innerProps || $[9] !== props.error || $[10] !== props.isDisabled || $[11] !== ref || $[12] !== renderStaticInput) {
|
|
585
604
|
t1 = (t2) => {
|
|
586
|
-
const { field
|
|
605
|
+
const { field, fieldState: t3 } = t2;
|
|
587
606
|
const { error, isDirty } = t3;
|
|
588
607
|
return /* @__PURE__ */ jsx(TimePickerInner, {
|
|
589
608
|
...innerProps,
|
|
590
|
-
ref: mergeRefs(ref,
|
|
591
|
-
value:
|
|
592
|
-
onChange:
|
|
593
|
-
onBlur:
|
|
609
|
+
ref: mergeRefs(ref, field.ref),
|
|
610
|
+
value: field.value ?? null,
|
|
611
|
+
onChange: field.onChange,
|
|
612
|
+
onBlur: field.onBlur,
|
|
594
613
|
isDirty,
|
|
595
|
-
isDisabled:
|
|
614
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
596
615
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
597
616
|
error: props.error ?? error?.message,
|
|
598
617
|
renderStaticInput
|
|
@@ -607,14 +626,14 @@ var TimePicker = (t0) => {
|
|
|
607
626
|
$[13] = t1;
|
|
608
627
|
} else t1 = $[13];
|
|
609
628
|
let t2;
|
|
610
|
-
if ($[14] !==
|
|
611
|
-
t2 = /* @__PURE__ */ jsx(
|
|
612
|
-
control:
|
|
613
|
-
name:
|
|
629
|
+
if ($[14] !== formControl.control || $[15] !== formControl.name || $[16] !== t1) {
|
|
630
|
+
t2 = /* @__PURE__ */ jsx(Controller, {
|
|
631
|
+
control: formControl.control,
|
|
632
|
+
name: formControl.name,
|
|
614
633
|
render: t1
|
|
615
634
|
});
|
|
616
|
-
$[14] =
|
|
617
|
-
$[15] =
|
|
635
|
+
$[14] = formControl.control;
|
|
636
|
+
$[15] = formControl.name;
|
|
618
637
|
$[16] = t1;
|
|
619
638
|
$[17] = t2;
|
|
620
639
|
} else t2 = $[17];
|