@povio/ui 2.3.0-rc.27 → 2.3.0-rc.29
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/DateTime/DatePicker/DatePicker.js +17 -16
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +8 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +9 -8
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +110 -109
- package/dist/components/inputs/DateTime/shared/DateField.js +4 -5
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +3 -3
- package/package.json +1 -1
|
@@ -77,28 +77,29 @@ var DatePickerBase = (props) => {
|
|
|
77
77
|
onBlur?.({ target: { value: val } });
|
|
78
78
|
};
|
|
79
79
|
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
80
|
+
const normalizedValue = value ?? null;
|
|
80
81
|
const dialogState = useDatePickerState({
|
|
81
82
|
...rest,
|
|
82
|
-
defaultValue:
|
|
83
|
+
defaultValue: normalizedValue ?? rest.defaultValue ?? null,
|
|
83
84
|
shouldCloseOnSelect: false,
|
|
84
85
|
shouldForceLeadingZeros
|
|
85
86
|
});
|
|
86
87
|
const state = useDatePickerState({
|
|
87
88
|
...rest,
|
|
88
89
|
shouldForceLeadingZeros,
|
|
89
|
-
value,
|
|
90
|
+
value: normalizedValue,
|
|
90
91
|
onChange: (val_0) => {
|
|
91
|
-
let
|
|
92
|
-
if (val_0)
|
|
93
|
-
if (
|
|
92
|
+
let normalizedValue_0 = val_0;
|
|
93
|
+
if (val_0) normalizedValue_0 = normalizeByGranularity(val_0);
|
|
94
|
+
if (normalizedValue_0 && (rest.minValue && normalizedValue_0 < rest?.minValue || rest?.maxValue && normalizedValue_0 > rest?.maxValue)) {
|
|
94
95
|
state.setValue(state.value);
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
onChange?.(
|
|
98
|
-
dialogState.setValue(
|
|
99
|
-
if (fireBlurOnChange) debouncedBlur(
|
|
100
|
-
if (
|
|
101
|
-
calendarState.setFocusedDate(
|
|
98
|
+
onChange?.(normalizedValue_0);
|
|
99
|
+
dialogState.setValue(normalizedValue_0);
|
|
100
|
+
if (fireBlurOnChange) debouncedBlur(normalizedValue_0);
|
|
101
|
+
if (normalizedValue_0) {
|
|
102
|
+
calendarState.setFocusedDate(normalizedValue_0);
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
calendarState.setFocusedDate(today(DATE_PICKER_TIME_ZONE));
|
|
@@ -262,7 +263,7 @@ var DatePickerInner = (t0) => {
|
|
|
262
263
|
setRenderInput,
|
|
263
264
|
getFocusTarget: _temp
|
|
264
265
|
});
|
|
265
|
-
const
|
|
266
|
+
const normalizedValue = props.value ?? null;
|
|
266
267
|
let t3;
|
|
267
268
|
if ($[0] !== granularity) {
|
|
268
269
|
t3 = (date) => {
|
|
@@ -330,7 +331,7 @@ var DatePickerInner = (t0) => {
|
|
|
330
331
|
} else t8 = $[16];
|
|
331
332
|
const dateLimits = t8;
|
|
332
333
|
if (!renderInput) {
|
|
333
|
-
const dateValue =
|
|
334
|
+
const dateValue = normalizedValue ? parseCalendarDate(normalizedValue) : null;
|
|
334
335
|
const as = props.as ?? ui.input.as;
|
|
335
336
|
const size = props.size ?? ui.input.size;
|
|
336
337
|
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
@@ -356,14 +357,14 @@ var DatePickerInner = (t0) => {
|
|
|
356
357
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
357
358
|
labelPlacement: "content-row",
|
|
358
359
|
dataAttributes: {
|
|
359
|
-
dataIsEmpty: dateValue
|
|
360
|
-
dataIsFilled: dateValue
|
|
360
|
+
dataIsEmpty: dateValue == null,
|
|
361
|
+
dataIsFilled: dateValue != null,
|
|
361
362
|
dataIsDirty: props.isDirty,
|
|
362
363
|
dataIsRequired: props.isRequired,
|
|
363
364
|
dataIsDisabled: isDisabled,
|
|
364
365
|
dataDisabled: isDisabled,
|
|
365
366
|
dataInvalid: !!props.error,
|
|
366
|
-
dataHasSelection: dateValue
|
|
367
|
+
dataHasSelection: dateValue != null
|
|
367
368
|
},
|
|
368
369
|
renderStatic: true,
|
|
369
370
|
onStaticInteract: renderRealInput,
|
|
@@ -378,7 +379,7 @@ var DatePickerInner = (t0) => {
|
|
|
378
379
|
}
|
|
379
380
|
const T0 = DatePickerBase;
|
|
380
381
|
const t9 = mergeRefs(props.ref, inputRef);
|
|
381
|
-
const t10 = parseCalendarDate(
|
|
382
|
+
const t10 = parseCalendarDate(normalizedValue);
|
|
382
383
|
let t11;
|
|
383
384
|
if ($[17] !== formatCalendarDate || $[18] !== props) {
|
|
384
385
|
t11 = (value) => props.onChange?.(formatCalendarDate(value));
|
|
@@ -50,16 +50,17 @@ var DateRangePickerBase = (props) => {
|
|
|
50
50
|
const dateRangePickerRef = useMemo(() => ({ get current() {
|
|
51
51
|
return datePickerInputRef.current?.getContainer?.() || null;
|
|
52
52
|
} }), []);
|
|
53
|
+
const normalizedValue = value ?? null;
|
|
53
54
|
const dialogState = useDateRangePickerState({
|
|
54
55
|
...rest,
|
|
55
|
-
value,
|
|
56
|
+
value: normalizedValue,
|
|
56
57
|
shouldCloseOnSelect: false,
|
|
57
58
|
shouldForceLeadingZeros
|
|
58
59
|
});
|
|
59
60
|
const state = useDateRangePickerState({
|
|
60
61
|
...rest,
|
|
61
62
|
shouldForceLeadingZeros,
|
|
62
|
-
value,
|
|
63
|
+
value: normalizedValue,
|
|
63
64
|
onChange: (newValue) => {
|
|
64
65
|
if (isValidRange(newValue)) return;
|
|
65
66
|
onChange?.(newValue);
|
|
@@ -589,7 +590,7 @@ var DateRangePickerInner = (t0) => {
|
|
|
589
590
|
setRenderInput,
|
|
590
591
|
getFocusTarget: _temp
|
|
591
592
|
});
|
|
592
|
-
const
|
|
593
|
+
const normalizedValue = props.value ?? null;
|
|
593
594
|
let t2;
|
|
594
595
|
if ($[0] !== fullIso) {
|
|
595
596
|
t2 = (range) => {
|
|
@@ -668,9 +669,9 @@ var DateRangePickerInner = (t0) => {
|
|
|
668
669
|
} else t7 = $[14];
|
|
669
670
|
const dateLimits = t7;
|
|
670
671
|
if (!renderInput) {
|
|
671
|
-
const startDateValue = parseCalendarDate(
|
|
672
|
-
const endDateValue = parseCalendarDate(
|
|
673
|
-
const hasProvidedRangeValue = !!(
|
|
672
|
+
const startDateValue = parseCalendarDate(normalizedValue?.start ?? null);
|
|
673
|
+
const endDateValue = parseCalendarDate(normalizedValue?.end ?? null);
|
|
674
|
+
const hasProvidedRangeValue = !!(normalizedValue?.start || normalizedValue?.end);
|
|
674
675
|
const as = props.as ?? ui.input.as;
|
|
675
676
|
const size = props.size ?? ui.input.size;
|
|
676
677
|
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
@@ -719,7 +720,7 @@ var DateRangePickerInner = (t0) => {
|
|
|
719
720
|
}
|
|
720
721
|
const T0 = DateRangePickerBase;
|
|
721
722
|
const t8 = mergeRefs(props.ref, inputRef);
|
|
722
|
-
const t9 = parseDateRange(
|
|
723
|
+
const t9 = parseDateRange(normalizedValue);
|
|
723
724
|
let t10;
|
|
724
725
|
if ($[15] !== formatDateRange || $[16] !== props) {
|
|
725
726
|
t10 = (value) => props.onChange?.(formatDateRange(value));
|
|
@@ -68,9 +68,10 @@ var DateTimePickerBase = (props) => {
|
|
|
68
68
|
onBlur?.({ target: { value: val } });
|
|
69
69
|
};
|
|
70
70
|
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, { delay: 500 });
|
|
71
|
+
const normalizedValue = value ?? null;
|
|
71
72
|
const dialogState = useDatePickerState({
|
|
72
73
|
...rest,
|
|
73
|
-
defaultValue:
|
|
74
|
+
defaultValue: normalizedValue ?? rest.defaultValue ?? null,
|
|
74
75
|
shouldCloseOnSelect: false,
|
|
75
76
|
granularity: "minute",
|
|
76
77
|
hideTimeZone: true,
|
|
@@ -82,7 +83,7 @@ var DateTimePickerBase = (props) => {
|
|
|
82
83
|
const state = useDatePickerState({
|
|
83
84
|
...rest,
|
|
84
85
|
shouldForceLeadingZeros,
|
|
85
|
-
value,
|
|
86
|
+
value: normalizedValue,
|
|
86
87
|
onChange: (val_0) => {
|
|
87
88
|
onChange?.(val_0);
|
|
88
89
|
dialogState.setValue(val_0);
|
|
@@ -260,11 +261,11 @@ var DateTimePickerInner = (t0) => {
|
|
|
260
261
|
setRenderInput,
|
|
261
262
|
getFocusTarget: _temp
|
|
262
263
|
});
|
|
263
|
-
const
|
|
264
|
+
const normalizedValue = props.value ?? null;
|
|
264
265
|
const formatDateValue = _temp2;
|
|
265
266
|
const parseDateValue = _temp3;
|
|
266
267
|
if (!renderInput) {
|
|
267
|
-
const dateTimeValue =
|
|
268
|
+
const dateTimeValue = normalizedValue ? parseDateValue(normalizedValue) : null;
|
|
268
269
|
const as = props.as ?? ui.input.as;
|
|
269
270
|
const size = props.size ?? ui.input.size;
|
|
270
271
|
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
@@ -290,14 +291,14 @@ var DateTimePickerInner = (t0) => {
|
|
|
290
291
|
contentWrapperClassName: datePickerInputContentRowCva({ size }),
|
|
291
292
|
labelPlacement: "content-row",
|
|
292
293
|
dataAttributes: {
|
|
293
|
-
dataIsEmpty: dateTimeValue
|
|
294
|
-
dataIsFilled: dateTimeValue
|
|
294
|
+
dataIsEmpty: dateTimeValue == null,
|
|
295
|
+
dataIsFilled: dateTimeValue != null,
|
|
295
296
|
dataIsDirty: props.isDirty,
|
|
296
297
|
dataIsRequired: props.isRequired,
|
|
297
298
|
dataIsDisabled: isDisabled,
|
|
298
299
|
dataDisabled: isDisabled,
|
|
299
300
|
dataInvalid: !!props.error,
|
|
300
|
-
dataHasSelection: dateTimeValue
|
|
301
|
+
dataHasSelection: dateTimeValue != null
|
|
301
302
|
},
|
|
302
303
|
renderStatic: true,
|
|
303
304
|
onStaticInteract: renderRealInput,
|
|
@@ -312,7 +313,7 @@ var DateTimePickerInner = (t0) => {
|
|
|
312
313
|
}
|
|
313
314
|
const T0 = DateTimePickerBase;
|
|
314
315
|
const t2 = mergeRefs(props.ref, inputRef);
|
|
315
|
-
const t3 = parseDateValue(
|
|
316
|
+
const t3 = parseDateValue(normalizedValue);
|
|
316
317
|
let t4;
|
|
317
318
|
if ($[0] !== formatDateValue || $[1] !== props) {
|
|
318
319
|
t4 = (value) => props.onChange?.(formatDateValue(value));
|
|
@@ -150,7 +150,7 @@ var TimePickerBase = (props) => {
|
|
|
150
150
|
const [isOpen, setIsOpen] = useState(false);
|
|
151
151
|
const initialDateEmitRef = useRef(true);
|
|
152
152
|
const { locale } = useLocale();
|
|
153
|
-
const t2 = value
|
|
153
|
+
const t2 = value ?? rest.defaultValue ?? null;
|
|
154
154
|
let t3;
|
|
155
155
|
if ($[40] !== locale || $[41] !== rest || $[42] !== t2) {
|
|
156
156
|
t3 = {
|
|
@@ -179,37 +179,38 @@ var TimePickerBase = (props) => {
|
|
|
179
179
|
$[46] = t5;
|
|
180
180
|
} else t5 = $[46];
|
|
181
181
|
const { callback: debouncedBlur } = useDebounceCallback(handleBlur, t5);
|
|
182
|
-
|
|
182
|
+
const t6 = value ?? null;
|
|
183
|
+
let t7;
|
|
183
184
|
if ($[47] !== debouncedBlur || $[48] !== fireBlurOnChange || $[49] !== onChange) {
|
|
184
|
-
|
|
185
|
+
t7 = (val_0) => {
|
|
185
186
|
onChange?.(val_0);
|
|
186
187
|
if (fireBlurOnChange) debouncedBlur(val_0);
|
|
187
188
|
};
|
|
188
189
|
$[47] = debouncedBlur;
|
|
189
190
|
$[48] = fireBlurOnChange;
|
|
190
191
|
$[49] = onChange;
|
|
191
|
-
$[50] =
|
|
192
|
-
} else
|
|
193
|
-
let
|
|
194
|
-
if ($[51] !== isDisabled || $[52] !== locale || $[53] !== rest || $[54] !== t6 || $[55] !==
|
|
195
|
-
|
|
192
|
+
$[50] = t7;
|
|
193
|
+
} else t7 = $[50];
|
|
194
|
+
let t8;
|
|
195
|
+
if ($[51] !== isDisabled || $[52] !== locale || $[53] !== rest || $[54] !== t6 || $[55] !== t7) {
|
|
196
|
+
t8 = {
|
|
196
197
|
...rest,
|
|
197
198
|
isDisabled,
|
|
198
|
-
value,
|
|
199
|
-
onChange:
|
|
199
|
+
value: t6,
|
|
200
|
+
onChange: t7,
|
|
200
201
|
locale
|
|
201
202
|
};
|
|
202
203
|
$[51] = isDisabled;
|
|
203
204
|
$[52] = locale;
|
|
204
205
|
$[53] = rest;
|
|
205
206
|
$[54] = t6;
|
|
206
|
-
$[55] =
|
|
207
|
-
$[56] =
|
|
208
|
-
} else
|
|
209
|
-
const state = useTimeFieldState(
|
|
210
|
-
let
|
|
207
|
+
$[55] = t7;
|
|
208
|
+
$[56] = t8;
|
|
209
|
+
} else t8 = $[56];
|
|
210
|
+
const state = useTimeFieldState(t8);
|
|
211
|
+
let t9;
|
|
211
212
|
if ($[57] !== onChange || $[58] !== state.timeValue) {
|
|
212
|
-
|
|
213
|
+
t9 = () => {
|
|
213
214
|
if (initialDateEmitRef.current) {
|
|
214
215
|
initialDateEmitRef.current = false;
|
|
215
216
|
return;
|
|
@@ -218,19 +219,19 @@ var TimePickerBase = (props) => {
|
|
|
218
219
|
};
|
|
219
220
|
$[57] = onChange;
|
|
220
221
|
$[58] = state.timeValue;
|
|
221
|
-
$[59] =
|
|
222
|
-
} else
|
|
223
|
-
let
|
|
222
|
+
$[59] = t9;
|
|
223
|
+
} else t9 = $[59];
|
|
224
|
+
let t10;
|
|
224
225
|
if ($[60] !== rest.date) {
|
|
225
|
-
|
|
226
|
+
t10 = [rest.date];
|
|
226
227
|
$[60] = rest.date;
|
|
227
|
-
$[61] =
|
|
228
|
-
} else
|
|
229
|
-
useEffect(
|
|
228
|
+
$[61] = t10;
|
|
229
|
+
} else t10 = $[61];
|
|
230
|
+
useEffect(t9, t10);
|
|
230
231
|
const timeFieldRef = useRef(null);
|
|
231
|
-
let
|
|
232
|
+
let t11;
|
|
232
233
|
if ($[62] !== disableManualEntry || $[63] !== label || $[64] !== rest) {
|
|
233
|
-
|
|
234
|
+
t11 = {
|
|
234
235
|
...rest,
|
|
235
236
|
label,
|
|
236
237
|
isReadOnly: disableManualEntry
|
|
@@ -238,19 +239,19 @@ var TimePickerBase = (props) => {
|
|
|
238
239
|
$[62] = disableManualEntry;
|
|
239
240
|
$[63] = label;
|
|
240
241
|
$[64] = rest;
|
|
241
|
-
$[65] =
|
|
242
|
-
} else
|
|
243
|
-
const { labelProps, fieldProps } = useTimeField(
|
|
244
|
-
const
|
|
245
|
-
let
|
|
246
|
-
if ($[66] !== headerClassName || $[67] !== helperText || $[68] !== isDisabled || $[69] !== isRequired || $[70] !== label || $[71] !== labelProps || $[72] !== rightContent || $[73] !==
|
|
247
|
-
|
|
242
|
+
$[65] = t11;
|
|
243
|
+
} else t11 = $[65];
|
|
244
|
+
const { labelProps, fieldProps } = useTimeField(t11, state, timeFieldRef);
|
|
245
|
+
const t12 = hideLabel || isHeaderHidden;
|
|
246
|
+
let t13;
|
|
247
|
+
if ($[66] !== headerClassName || $[67] !== helperText || $[68] !== isDisabled || $[69] !== isRequired || $[70] !== label || $[71] !== labelProps || $[72] !== rightContent || $[73] !== t12 || $[74] !== tooltipText) {
|
|
248
|
+
t13 = {
|
|
248
249
|
label,
|
|
249
250
|
tooltipText,
|
|
250
251
|
helperText,
|
|
251
252
|
isRequired,
|
|
252
253
|
rightContent,
|
|
253
|
-
isHeaderHidden:
|
|
254
|
+
isHeaderHidden: t12,
|
|
254
255
|
isDisabled,
|
|
255
256
|
className: headerClassName,
|
|
256
257
|
labelProps
|
|
@@ -262,14 +263,14 @@ var TimePickerBase = (props) => {
|
|
|
262
263
|
$[70] = label;
|
|
263
264
|
$[71] = labelProps;
|
|
264
265
|
$[72] = rightContent;
|
|
265
|
-
$[73] =
|
|
266
|
+
$[73] = t12;
|
|
266
267
|
$[74] = tooltipText;
|
|
267
|
-
$[75] =
|
|
268
|
-
} else
|
|
269
|
-
const headerProps =
|
|
270
|
-
let
|
|
268
|
+
$[75] = t13;
|
|
269
|
+
} else t13 = $[75];
|
|
270
|
+
const headerProps = t13;
|
|
271
|
+
let t14;
|
|
271
272
|
if ($[76] !== dialogState.value || $[77] !== fireBlurOnChange || $[78] !== handleBlur || $[79] !== state) {
|
|
272
|
-
|
|
273
|
+
t14 = () => {
|
|
273
274
|
const newValue = dialogState.value;
|
|
274
275
|
state.setValue(newValue);
|
|
275
276
|
setIsOpen(false);
|
|
@@ -279,62 +280,62 @@ var TimePickerBase = (props) => {
|
|
|
279
280
|
$[77] = fireBlurOnChange;
|
|
280
281
|
$[78] = handleBlur;
|
|
281
282
|
$[79] = state;
|
|
282
|
-
$[80] =
|
|
283
|
-
} else
|
|
284
|
-
const onApply =
|
|
285
|
-
let
|
|
283
|
+
$[80] = t14;
|
|
284
|
+
} else t14 = $[80];
|
|
285
|
+
const onApply = t14;
|
|
286
|
+
let t15;
|
|
286
287
|
if ($[81] !== dialogState || $[82] !== isOpen || $[83] !== state.value) {
|
|
287
|
-
|
|
288
|
+
t15 = (open) => {
|
|
288
289
|
setIsOpen(open);
|
|
289
290
|
if (!isOpen) dialogState.setValue(state.value);
|
|
290
291
|
};
|
|
291
292
|
$[81] = dialogState;
|
|
292
293
|
$[82] = isOpen;
|
|
293
294
|
$[83] = state.value;
|
|
294
|
-
$[84] =
|
|
295
|
-
} else
|
|
296
|
-
const onOpenChange =
|
|
297
|
-
let
|
|
295
|
+
$[84] = t15;
|
|
296
|
+
} else t15 = $[84];
|
|
297
|
+
const onOpenChange = t15;
|
|
298
|
+
let t16;
|
|
298
299
|
if ($[85] !== dialogState || $[86] !== state.value) {
|
|
299
|
-
|
|
300
|
+
t16 = () => {
|
|
300
301
|
dialogState.setValue(state.value);
|
|
301
302
|
setIsOpen(true);
|
|
302
303
|
};
|
|
303
304
|
$[85] = dialogState;
|
|
304
305
|
$[86] = state.value;
|
|
305
|
-
$[87] =
|
|
306
|
-
} else
|
|
307
|
-
const onOpen =
|
|
308
|
-
let
|
|
306
|
+
$[87] = t16;
|
|
307
|
+
} else t16 = $[87];
|
|
308
|
+
const onOpen = t16;
|
|
309
|
+
let t17;
|
|
309
310
|
if ($[88] !== dialogState || $[89] !== onChange) {
|
|
310
|
-
|
|
311
|
+
t17 = () => {
|
|
311
312
|
onChange?.(null);
|
|
312
313
|
dialogState.setValue(null);
|
|
313
314
|
};
|
|
314
315
|
$[88] = dialogState;
|
|
315
316
|
$[89] = onChange;
|
|
316
|
-
$[90] =
|
|
317
|
-
} else
|
|
318
|
-
const onInputClear =
|
|
319
|
-
const
|
|
320
|
-
let
|
|
317
|
+
$[90] = t17;
|
|
318
|
+
} else t17 = $[90];
|
|
319
|
+
const onInputClear = t17;
|
|
320
|
+
const t18 = as === "inline" ? -1 : void 0;
|
|
321
|
+
let t19;
|
|
321
322
|
if ($[91] !== className) {
|
|
322
|
-
|
|
323
|
+
t19 = clsx("relative inline-flex w-full flex-col text-left", className);
|
|
323
324
|
$[91] = className;
|
|
324
|
-
$[92] =
|
|
325
|
-
} else
|
|
326
|
-
const
|
|
327
|
-
let
|
|
325
|
+
$[92] = t19;
|
|
326
|
+
} else t19 = $[92];
|
|
327
|
+
const t20 = as === "inline" ? -1 : void 0;
|
|
328
|
+
let t21;
|
|
328
329
|
if ($[93] !== ref) {
|
|
329
|
-
|
|
330
|
+
t21 = mergeRefs(ref, timeFieldRef);
|
|
330
331
|
$[93] = ref;
|
|
331
|
-
$[94] =
|
|
332
|
-
} else
|
|
333
|
-
const
|
|
334
|
-
let
|
|
335
|
-
if ($[95] !== as || $[96] !== disableDropdown || $[97] !== disableManualEntry || $[98] !== fieldProps || $[99] !== fireBlurOnChange || $[100] !== headerProps || $[101] !== inputClassName || $[102] !== isClearable || $[103] !== isDirty || $[104] !== isDisabled || $[105] !== isRequired || $[106] !== onInputClear || $[107] !== onOpen || $[108] !== placeholder || $[109] !== size || $[110] !== state || $[111] !==
|
|
336
|
-
|
|
337
|
-
ref:
|
|
332
|
+
$[94] = t21;
|
|
333
|
+
} else t21 = $[94];
|
|
334
|
+
const t22 = !!error;
|
|
335
|
+
let t23;
|
|
336
|
+
if ($[95] !== as || $[96] !== disableDropdown || $[97] !== disableManualEntry || $[98] !== fieldProps || $[99] !== fireBlurOnChange || $[100] !== headerProps || $[101] !== inputClassName || $[102] !== isClearable || $[103] !== isDirty || $[104] !== isDisabled || $[105] !== isRequired || $[106] !== onInputClear || $[107] !== onOpen || $[108] !== placeholder || $[109] !== size || $[110] !== state || $[111] !== t21 || $[112] !== t22 || $[113] !== variant) {
|
|
337
|
+
t23 = /* @__PURE__ */ jsx(TimePickerInput, {
|
|
338
|
+
ref: t21,
|
|
338
339
|
as,
|
|
339
340
|
fieldProps,
|
|
340
341
|
state,
|
|
@@ -342,7 +343,7 @@ var TimePickerBase = (props) => {
|
|
|
342
343
|
isDisabled,
|
|
343
344
|
isDirty,
|
|
344
345
|
isRequired,
|
|
345
|
-
isInvalid:
|
|
346
|
+
isInvalid: t22,
|
|
346
347
|
disableDropdown,
|
|
347
348
|
variant,
|
|
348
349
|
size,
|
|
@@ -370,14 +371,14 @@ var TimePickerBase = (props) => {
|
|
|
370
371
|
$[108] = placeholder;
|
|
371
372
|
$[109] = size;
|
|
372
373
|
$[110] = state;
|
|
373
|
-
$[111] =
|
|
374
|
-
$[112] =
|
|
374
|
+
$[111] = t21;
|
|
375
|
+
$[112] = t22;
|
|
375
376
|
$[113] = variant;
|
|
376
|
-
$[114] =
|
|
377
|
-
} else
|
|
378
|
-
let
|
|
377
|
+
$[114] = t23;
|
|
378
|
+
} else t23 = $[114];
|
|
379
|
+
let t24;
|
|
379
380
|
if ($[115] !== dialogState || $[116] !== disableDropdown || $[117] !== disableManualEntry || $[118] !== isDisabled || $[119] !== isOpen || $[120] !== label || $[121] !== onApply || $[122] !== onOpenChange) {
|
|
380
|
-
|
|
381
|
+
t24 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(DateTimeDialog, {
|
|
381
382
|
footer: /* @__PURE__ */ jsx(DateTimeDialogFooter, {
|
|
382
383
|
isDisabled,
|
|
383
384
|
onApply,
|
|
@@ -397,42 +398,42 @@ var TimePickerBase = (props) => {
|
|
|
397
398
|
$[120] = label;
|
|
398
399
|
$[121] = onApply;
|
|
399
400
|
$[122] = onOpenChange;
|
|
400
|
-
$[123] =
|
|
401
|
-
} else
|
|
402
|
-
let
|
|
403
|
-
if ($[124] !== as || $[125] !== formFieldProps || $[126] !== labelProps || $[127] !==
|
|
404
|
-
|
|
401
|
+
$[123] = t24;
|
|
402
|
+
} else t24 = $[123];
|
|
403
|
+
let t25;
|
|
404
|
+
if ($[124] !== as || $[125] !== formFieldProps || $[126] !== labelProps || $[127] !== t19 || $[128] !== t20 || $[129] !== t23 || $[130] !== t24) {
|
|
405
|
+
t25 = /* @__PURE__ */ jsxs(FormField, {
|
|
405
406
|
...formFieldProps,
|
|
406
407
|
as,
|
|
407
408
|
labelProps,
|
|
408
|
-
className:
|
|
409
|
-
tabIndex:
|
|
410
|
-
children: [
|
|
409
|
+
className: t19,
|
|
410
|
+
tabIndex: t20,
|
|
411
|
+
children: [t23, t24]
|
|
411
412
|
});
|
|
412
413
|
$[124] = as;
|
|
413
414
|
$[125] = formFieldProps;
|
|
414
415
|
$[126] = labelProps;
|
|
415
|
-
$[127] =
|
|
416
|
-
$[128] =
|
|
417
|
-
$[129] =
|
|
418
|
-
$[130] =
|
|
419
|
-
$[131] =
|
|
420
|
-
} else
|
|
421
|
-
let
|
|
422
|
-
if ($[132] !== as || $[133] !== error || $[134] !==
|
|
423
|
-
|
|
416
|
+
$[127] = t19;
|
|
417
|
+
$[128] = t20;
|
|
418
|
+
$[129] = t23;
|
|
419
|
+
$[130] = t24;
|
|
420
|
+
$[131] = t25;
|
|
421
|
+
} else t25 = $[131];
|
|
422
|
+
let t26;
|
|
423
|
+
if ($[132] !== as || $[133] !== error || $[134] !== t18 || $[135] !== t25) {
|
|
424
|
+
t26 = /* @__PURE__ */ jsx(TooltipWrapper, {
|
|
424
425
|
as,
|
|
425
426
|
error,
|
|
426
|
-
triggerTabIndex:
|
|
427
|
-
children:
|
|
427
|
+
triggerTabIndex: t18,
|
|
428
|
+
children: t25
|
|
428
429
|
});
|
|
429
430
|
$[132] = as;
|
|
430
431
|
$[133] = error;
|
|
431
|
-
$[134] =
|
|
432
|
-
$[135] =
|
|
433
|
-
$[136] =
|
|
434
|
-
} else
|
|
435
|
-
return
|
|
432
|
+
$[134] = t18;
|
|
433
|
+
$[135] = t25;
|
|
434
|
+
$[136] = t26;
|
|
435
|
+
} else t26 = $[136];
|
|
436
|
+
return t26;
|
|
436
437
|
};
|
|
437
438
|
var TimePickerInner = (t0) => {
|
|
438
439
|
const $ = c(9);
|
|
@@ -447,7 +448,7 @@ var TimePickerInner = (t0) => {
|
|
|
447
448
|
setRenderInput,
|
|
448
449
|
getFocusTarget: _temp
|
|
449
450
|
});
|
|
450
|
-
const
|
|
451
|
+
const normalizedValue = props.value ?? null;
|
|
451
452
|
const formatTimeValue = (timeValue) => {
|
|
452
453
|
if (timeValue === null) return null;
|
|
453
454
|
let parsedDate;
|
|
@@ -459,7 +460,7 @@ var TimePickerInner = (t0) => {
|
|
|
459
460
|
};
|
|
460
461
|
const parseTimeValue = _temp2;
|
|
461
462
|
if (!renderInput) {
|
|
462
|
-
const timeValue_0 =
|
|
463
|
+
const timeValue_0 = normalizedValue ? parseTimeValue(normalizedValue) : null;
|
|
463
464
|
const as = props.as ?? ui.input.as;
|
|
464
465
|
const isDisabled = isFormControlDisabled || !!props.isDisabled;
|
|
465
466
|
const disableManualEntry = props.disableManualEntry ?? ui.dateInput.disableManualEntry;
|
|
@@ -478,14 +479,14 @@ var TimePickerInner = (t0) => {
|
|
|
478
479
|
contentClassName: "pr-0!",
|
|
479
480
|
labelPlacement: "content-row",
|
|
480
481
|
dataAttributes: {
|
|
481
|
-
dataIsEmpty: timeValue_0
|
|
482
|
-
dataIsFilled: timeValue_0
|
|
482
|
+
dataIsEmpty: timeValue_0 == null,
|
|
483
|
+
dataIsFilled: timeValue_0 != null,
|
|
483
484
|
dataIsDirty: props.isDirty,
|
|
484
485
|
dataIsRequired: props.isRequired,
|
|
485
486
|
dataIsDisabled: isDisabled,
|
|
486
487
|
dataDisabled: isDisabled,
|
|
487
488
|
dataInvalid: !!props.error,
|
|
488
|
-
dataHasSelection: timeValue_0
|
|
489
|
+
dataHasSelection: timeValue_0 != null
|
|
489
490
|
},
|
|
490
491
|
renderStatic: true,
|
|
491
492
|
onStaticInteract: renderRealInput,
|
|
@@ -497,7 +498,7 @@ var TimePickerInner = (t0) => {
|
|
|
497
498
|
}
|
|
498
499
|
const T0 = TimePickerBase;
|
|
499
500
|
const t1 = mergeRefs(props.ref, inputRef);
|
|
500
|
-
const t2 = parseTimeValue(
|
|
501
|
+
const t2 = parseTimeValue(normalizedValue);
|
|
501
502
|
let t3;
|
|
502
503
|
if ($[0] !== formatTimeValue || $[1] !== props) {
|
|
503
504
|
t3 = (value) => props.onChange?.(formatTimeValue(value));
|
|
@@ -181,7 +181,6 @@ var DateField = (t0) => {
|
|
|
181
181
|
t10 = () => ({
|
|
182
182
|
clearField: () => {
|
|
183
183
|
state.setValue(null);
|
|
184
|
-
for (const segment_5 of state.segments) if (segment_5.type !== "literal") state.clearSegment(segment_5.type);
|
|
185
184
|
},
|
|
186
185
|
autoFixYear
|
|
187
186
|
});
|
|
@@ -227,8 +226,8 @@ var DateField = (t0) => {
|
|
|
227
226
|
const formattedDisplayValue = t13;
|
|
228
227
|
let t14;
|
|
229
228
|
if ($[46] !== hidePlaceholder || $[47] !== isDisabled || $[48] !== segmentsToRender || $[49] !== state) {
|
|
230
|
-
t14 = /* @__PURE__ */ jsx(Fragment, { children: segmentsToRender.map((
|
|
231
|
-
segment:
|
|
229
|
+
t14 = /* @__PURE__ */ jsx(Fragment, { children: segmentsToRender.map((segment_6, i) => /* @__PURE__ */ jsx(DateSegmentItem, {
|
|
230
|
+
segment: segment_6,
|
|
232
231
|
state,
|
|
233
232
|
isDisabled,
|
|
234
233
|
hidePlaceholder
|
|
@@ -308,8 +307,8 @@ function _temp4(segment_3) {
|
|
|
308
307
|
function _temp5(segment_4) {
|
|
309
308
|
return segment_4.type === "minute";
|
|
310
309
|
}
|
|
311
|
-
function _temp6(
|
|
312
|
-
return
|
|
310
|
+
function _temp6(segment_5) {
|
|
311
|
+
return segment_5.type !== "literal" && segment_5.isPlaceholder === false;
|
|
313
312
|
}
|
|
314
313
|
//#endregion
|
|
315
314
|
export { DateField };
|
|
@@ -159,13 +159,13 @@ var DatePickerInput = (t0) => {
|
|
|
159
159
|
const t17 = isDisabled || void 0;
|
|
160
160
|
const t18 = isDisabled || void 0;
|
|
161
161
|
const t19 = isInvalid || void 0;
|
|
162
|
-
const t20 = fieldProps.value
|
|
162
|
+
const t20 = fieldProps.value == null || void 0;
|
|
163
163
|
const t21 = isFocused || void 0;
|
|
164
164
|
const t22 = isFocused && isFocusVisible || void 0;
|
|
165
|
-
const t23 = fieldProps.value
|
|
165
|
+
const t23 = fieldProps.value != null || void 0;
|
|
166
166
|
const t24 = isDirty || void 0;
|
|
167
167
|
const t25 = isRequired || void 0;
|
|
168
|
-
const t26 = fieldProps.value
|
|
168
|
+
const t26 = fieldProps.value != null || void 0;
|
|
169
169
|
let t27;
|
|
170
170
|
if ($[25] !== as || $[26] !== inputSizeCva || $[27] !== size) {
|
|
171
171
|
t27 = clsx("flex w-full items-center gap-input-gap-input-text-to-elements pr-0!", inputSizeCva({
|