linear-react-components-ui 2.1.0-beta.3 → 2.1.0-beta.4

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.
@@ -11,13 +11,13 @@ import { Label, Input, Container, Root } from "../base/index.js";
11
11
  import { useDateMask } from "../hooks/useDateMask.js";
12
12
  import { useDateCalendarState } from "../hooks/useDateCalendarState.js";
13
13
  import { TimeSelector } from "../timeselector.js";
14
- import { parseBoundary, isDayOutOfBounds, TOKEN_ISO_FORMAT, getDateFormats, clampDateToBounds, parseDateValue } from "../helpers.js";
14
+ import { parseBoundary, getTimeSelection, isDayOutOfBounds, TOKEN_ISO_FORMAT, getDateFormats, clampDateToBounds, formatPartialDateTime, completePartialDateTime, parseDateValue, resolveAssumedTime } from "../helpers.js";
15
15
  import { CalendarBox } from "../calendarbox.js";
16
16
  import { Triggers } from "./triggers.js";
17
17
  import { DateFieldContext } from "./context.js";
18
18
  import v1 from "../../../node_modules/uuid/dist/v1.js";
19
19
  const InputBase = React.forwardRef((props, ref) => {
20
- const $ = compilerRuntimeExports.c(186);
20
+ const $ = compilerRuntimeExports.c(209);
21
21
  let disabled;
22
22
  let errors;
23
23
  let label;
@@ -223,35 +223,45 @@ const InputBase = React.forwardRef((props, ref) => {
223
223
  onBeforeInput: props.onBeforeInput
224
224
  });
225
225
  let t18;
226
- if ($[34] !== props.id || $[35] !== props.name) {
227
- t18 = props.id || props.name || v1();
228
- $[34] = props.id;
229
- $[35] = props.name;
226
+ if ($[34] !== unmaskedValue || $[35] !== variant) {
227
+ t18 = getTimeSelection(unmaskedValue, variant);
228
+ $[34] = unmaskedValue;
229
+ $[35] = variant;
230
230
  $[36] = t18;
231
231
  } else {
232
232
  t18 = $[36];
233
233
  }
234
- const inputId = t18;
234
+ const timeSelection = t18;
235
235
  let t19;
236
- if ($[37] !== props.label) {
237
- t19 = _.isEmpty(props?.label);
238
- $[37] = props.label;
239
- $[38] = t19;
236
+ if ($[37] !== props.id || $[38] !== props.name) {
237
+ t19 = props.id || props.name || v1();
238
+ $[37] = props.id;
239
+ $[38] = props.name;
240
+ $[39] = t19;
240
241
  } else {
241
- t19 = $[38];
242
+ t19 = $[39];
242
243
  }
243
- const hasLabel = !t19;
244
+ const inputId = t19;
245
+ let t20;
246
+ if ($[40] !== props.label) {
247
+ t20 = _.isEmpty(props?.label);
248
+ $[40] = props.label;
249
+ $[41] = t20;
250
+ } else {
251
+ t20 = $[41];
252
+ }
253
+ const hasLabel = !t20;
244
254
  const hasHintMessages = Boolean(props.hint?.length);
245
255
  const hasValidationErrors = Boolean(errors?.length);
246
- let t20;
247
- if ($[39] !== props.value) {
248
- t20 = _.isEmpty(props?.value);
249
- $[39] = props.value;
250
- $[40] = t20;
256
+ let t21;
257
+ if ($[42] !== props.value) {
258
+ t21 = _.isEmpty(props?.value);
259
+ $[42] = props.value;
260
+ $[43] = t21;
251
261
  } else {
252
- t20 = $[40];
262
+ t21 = $[43];
253
263
  }
254
- const hasValidDateSelected = !t20;
264
+ const hasValidDateSelected = !t21;
255
265
  const handleUpdateDateState = (date_0) => {
256
266
  const nonIsoDateFormat = date_0.format(isoFormat);
257
267
  const isoDateFormat = date_0.toISOString();
@@ -268,9 +278,31 @@ const InputBase = React.forwardRef((props, ref) => {
268
278
  handleSetCalendarBoxOpen(false);
269
279
  }
270
280
  };
271
- let t21;
272
- if ($[41] !== handleSetCalendarBoxOpen || $[42] !== onChange || $[43] !== props.name || $[44] !== setMaskValue || $[45] !== setSelectedDate) {
273
- t21 = () => {
281
+ let t22;
282
+ if ($[44] !== handleChangeActiveDescendant || $[45] !== handleChangeCalendarDisplayDate || $[46] !== handleSetCalendarBoxOpen || $[47] !== setMaskValue || $[48] !== setSelectedDate || $[49] !== shouldCloseCalendarOnSelect) {
283
+ t22 = (date_1, hour, minute) => {
284
+ setSelectedDate(date_1.clone());
285
+ setMaskValue(formatPartialDateTime(date_1, hour, minute));
286
+ handleChangeActiveDescendant(date_1.format(TOKEN_ISO_FORMAT));
287
+ handleChangeCalendarDisplayDate(date_1.clone());
288
+ if (shouldCloseCalendarOnSelect) {
289
+ handleSetCalendarBoxOpen(false);
290
+ }
291
+ };
292
+ $[44] = handleChangeActiveDescendant;
293
+ $[45] = handleChangeCalendarDisplayDate;
294
+ $[46] = handleSetCalendarBoxOpen;
295
+ $[47] = setMaskValue;
296
+ $[48] = setSelectedDate;
297
+ $[49] = shouldCloseCalendarOnSelect;
298
+ $[50] = t22;
299
+ } else {
300
+ t22 = $[50];
301
+ }
302
+ const handleUpdateDraftState = t22;
303
+ let t23;
304
+ if ($[51] !== handleSetCalendarBoxOpen || $[52] !== onChange || $[53] !== props.name || $[54] !== setMaskValue || $[55] !== setSelectedDate) {
305
+ t23 = () => {
274
306
  onChange?.({
275
307
  target: {
276
308
  name: props.name,
@@ -281,48 +313,62 @@ const InputBase = React.forwardRef((props, ref) => {
281
313
  setMaskValue("");
282
314
  handleSetCalendarBoxOpen(false);
283
315
  };
284
- $[41] = handleSetCalendarBoxOpen;
285
- $[42] = onChange;
286
- $[43] = props.name;
287
- $[44] = setMaskValue;
288
- $[45] = setSelectedDate;
289
- $[46] = t21;
316
+ $[51] = handleSetCalendarBoxOpen;
317
+ $[52] = onChange;
318
+ $[53] = props.name;
319
+ $[54] = setMaskValue;
320
+ $[55] = setSelectedDate;
321
+ $[56] = t23;
290
322
  } else {
291
- t21 = $[46];
323
+ t23 = $[56];
292
324
  }
293
- const handleOnClickClearSelectedDate = t21;
294
- let t22;
295
- if ($[47] !== digits || $[48] !== handleChangeActiveDescendant || $[49] !== handleChangeCalendarDisplayDate || $[50] !== handleSetCalendarBoxOpen || $[51] !== props || $[52] !== ptbrFormat || $[53] !== selectedDate || $[54] !== setMaskValue || $[55] !== unmaskedValue || $[56] !== variant) {
296
- t22 = (event) => {
325
+ const handleOnClickClearSelectedDate = t23;
326
+ let t24;
327
+ if ($[57] !== digits || $[58] !== handleChangeActiveDescendant || $[59] !== handleChangeCalendarDisplayDate || $[60] !== handleSetCalendarBoxOpen || $[61] !== handleUpdateDateState || $[62] !== maxDate || $[63] !== minDate || $[64] !== props || $[65] !== ptbrFormat || $[66] !== selectedDate || $[67] !== setMaskValue || $[68] !== unmaskedValue || $[69] !== variant) {
328
+ t24 = (event) => {
297
329
  props?.onBlur?.(event);
298
330
  handleSetCalendarBoxOpen(false);
299
331
  handleChangeActiveDescendant((selectedDate ?? hooks()).format(TOKEN_ISO_FORMAT));
300
332
  handleChangeCalendarDisplayDate(selectedDate ?? hooks());
333
+ const completedDate = completePartialDateTime({
334
+ unmaskedValue,
335
+ variant,
336
+ min: minDate,
337
+ max: maxDate
338
+ });
339
+ if (completedDate) {
340
+ setMaskValue(completedDate.format(ptbrFormat));
341
+ handleUpdateDateState(completedDate);
342
+ return;
343
+ }
301
344
  if (_.size(unmaskedValue) !== digits) {
302
- const date_1 = parseDateValue(props?.value, variant);
303
- if (date_1.isValid()) {
304
- setMaskValue(date_1.format(ptbrFormat));
345
+ const date_2 = parseDateValue(props?.value, variant);
346
+ if (date_2.isValid()) {
347
+ setMaskValue(date_2.format(ptbrFormat));
305
348
  }
306
349
  }
307
350
  };
308
- $[47] = digits;
309
- $[48] = handleChangeActiveDescendant;
310
- $[49] = handleChangeCalendarDisplayDate;
311
- $[50] = handleSetCalendarBoxOpen;
312
- $[51] = props;
313
- $[52] = ptbrFormat;
314
- $[53] = selectedDate;
315
- $[54] = setMaskValue;
316
- $[55] = unmaskedValue;
317
- $[56] = variant;
318
- $[57] = t22;
351
+ $[57] = digits;
352
+ $[58] = handleChangeActiveDescendant;
353
+ $[59] = handleChangeCalendarDisplayDate;
354
+ $[60] = handleSetCalendarBoxOpen;
355
+ $[61] = handleUpdateDateState;
356
+ $[62] = maxDate;
357
+ $[63] = minDate;
358
+ $[64] = props;
359
+ $[65] = ptbrFormat;
360
+ $[66] = selectedDate;
361
+ $[67] = setMaskValue;
362
+ $[68] = unmaskedValue;
363
+ $[69] = variant;
364
+ $[70] = t24;
319
365
  } else {
320
- t22 = $[57];
366
+ t24 = $[70];
321
367
  }
322
- const handleOnBlur = t22;
323
- let t23;
324
- if ($[58] !== handleChangeActiveDescendant || $[59] !== handleChangeCalendarDisplayDate || $[60] !== handleSetCalendarBoxOpen || $[61] !== openCalendarOnFocus || $[62] !== props || $[63] !== readOnly || $[64] !== selectedDate) {
325
- t23 = (event_0) => {
368
+ const handleOnBlur = t24;
369
+ let t25;
370
+ if ($[71] !== handleChangeActiveDescendant || $[72] !== handleChangeCalendarDisplayDate || $[73] !== handleSetCalendarBoxOpen || $[74] !== openCalendarOnFocus || $[75] !== props || $[76] !== readOnly || $[77] !== selectedDate) {
371
+ t25 = (event_0) => {
326
372
  props?.onFocus?.(event_0);
327
373
  handleChangeActiveDescendant((selectedDate ?? hooks()).format(TOKEN_ISO_FORMAT));
328
374
  handleChangeCalendarDisplayDate(selectedDate ?? hooks());
@@ -330,86 +376,131 @@ const InputBase = React.forwardRef((props, ref) => {
330
376
  handleSetCalendarBoxOpen(true);
331
377
  }
332
378
  };
333
- $[58] = handleChangeActiveDescendant;
334
- $[59] = handleChangeCalendarDisplayDate;
335
- $[60] = handleSetCalendarBoxOpen;
336
- $[61] = openCalendarOnFocus;
337
- $[62] = props;
338
- $[63] = readOnly;
339
- $[64] = selectedDate;
340
- $[65] = t23;
379
+ $[71] = handleChangeActiveDescendant;
380
+ $[72] = handleChangeCalendarDisplayDate;
381
+ $[73] = handleSetCalendarBoxOpen;
382
+ $[74] = openCalendarOnFocus;
383
+ $[75] = props;
384
+ $[76] = readOnly;
385
+ $[77] = selectedDate;
386
+ $[78] = t25;
341
387
  } else {
342
- t23 = $[65];
388
+ t25 = $[78];
343
389
  }
344
- const handleOnFocus = t23;
345
- let t24;
346
- if ($[66] !== handleKeyDownNavigation || $[67] !== props) {
347
- t24 = (event_1) => {
390
+ const handleOnFocus = t25;
391
+ let t26;
392
+ if ($[79] !== handleKeyDownNavigation || $[80] !== props) {
393
+ t26 = (event_1) => {
348
394
  props?.onKeyDown?.(event_1);
349
395
  handleKeyDownNavigation(event_1);
350
396
  };
351
- $[66] = handleKeyDownNavigation;
352
- $[67] = props;
353
- $[68] = t24;
397
+ $[79] = handleKeyDownNavigation;
398
+ $[80] = props;
399
+ $[81] = t26;
354
400
  } else {
355
- t24 = $[68];
401
+ t26 = $[81];
356
402
  }
357
- const handleOnKeyDown = t24;
358
- let t25;
359
- if ($[69] !== handleUpdateDateState || $[70] !== selectedDate) {
360
- t25 = (hour, minute) => {
403
+ const handleOnKeyDown = t26;
404
+ let t27;
405
+ if ($[82] !== handleUpdateDateState || $[83] !== handleUpdateDraftState || $[84] !== selectedDate || $[85] !== timeSelection) {
406
+ t27 = (hour_0) => {
407
+ if (!selectedDate) {
408
+ return;
409
+ }
410
+ const {
411
+ minute: minute_0
412
+ } = timeSelection;
413
+ if (_.isNull(minute_0)) {
414
+ handleUpdateDraftState(selectedDate.clone().hour(hour_0), hour_0, null);
415
+ return;
416
+ }
417
+ handleUpdateDateState(selectedDate.clone().hour(hour_0).minute(minute_0).second(0));
418
+ };
419
+ $[82] = handleUpdateDateState;
420
+ $[83] = handleUpdateDraftState;
421
+ $[84] = selectedDate;
422
+ $[85] = timeSelection;
423
+ $[86] = t27;
424
+ } else {
425
+ t27 = $[86];
426
+ }
427
+ const handleSelectHour = t27;
428
+ let t28;
429
+ if ($[87] !== handleUpdateDateState || $[88] !== maxDate || $[89] !== minDate || $[90] !== selectedDate || $[91] !== timeSelection) {
430
+ t28 = (minute_1) => {
361
431
  if (!selectedDate) {
362
432
  return;
363
433
  }
364
- handleUpdateDateState(selectedDate.clone().hour(hour).minute(minute).second(0));
434
+ const {
435
+ hour: hour_1
436
+ } = timeSelection;
437
+ handleUpdateDateState(_.isNull(hour_1) ? resolveAssumedTime({
438
+ date: selectedDate,
439
+ hour: null,
440
+ minute: minute_1,
441
+ min: minDate,
442
+ max: maxDate
443
+ }) : selectedDate.clone().hour(hour_1).minute(minute_1).second(0));
365
444
  };
366
- $[69] = handleUpdateDateState;
367
- $[70] = selectedDate;
368
- $[71] = t25;
445
+ $[87] = handleUpdateDateState;
446
+ $[88] = maxDate;
447
+ $[89] = minDate;
448
+ $[90] = selectedDate;
449
+ $[91] = timeSelection;
450
+ $[92] = t28;
369
451
  } else {
370
- t25 = $[71];
452
+ t28 = $[92];
371
453
  }
372
- const handleSelectTime = t25;
454
+ const handleSelectMinute = t28;
373
455
  const handleSelectDay = (day) => {
456
+ const {
457
+ hour: hour_2,
458
+ minute: minute_2,
459
+ isComplete
460
+ } = timeSelection;
461
+ if (isDateTime && !isComplete) {
462
+ handleUpdateDraftState(day.clone().hour(hour_2 ?? 0).minute(minute_2 ?? 0), hour_2, minute_2);
463
+ return;
464
+ }
374
465
  const dayWithTime = isDateTime && selectedDate ? day.clone().hour(selectedDate.hour()).minute(selectedDate.minute()) : day;
375
466
  handleUpdateDateState(clampDateToBounds(dayWithTime, minDate, maxDate));
376
467
  };
377
- let t26;
378
- if ($[72] !== props.value || $[73] !== ptbrFormat || $[74] !== setMaskValue || $[75] !== setSelectedDate || $[76] !== variant) {
379
- t26 = () => {
380
- const date_2 = parseDateValue(props?.value ?? null, variant);
381
- setSelectedDate(date_2.isValid() ? date_2 : null);
382
- setMaskValue(date_2.format(ptbrFormat));
468
+ let t29;
469
+ if ($[93] !== props.value || $[94] !== ptbrFormat || $[95] !== setMaskValue || $[96] !== setSelectedDate || $[97] !== variant) {
470
+ t29 = () => {
471
+ const date_3 = parseDateValue(props?.value ?? null, variant);
472
+ setSelectedDate(date_3.isValid() ? date_3 : null);
473
+ setMaskValue(date_3.format(ptbrFormat));
383
474
  };
384
- $[72] = props.value;
385
- $[73] = ptbrFormat;
386
- $[74] = setMaskValue;
387
- $[75] = setSelectedDate;
388
- $[76] = variant;
389
- $[77] = t26;
475
+ $[93] = props.value;
476
+ $[94] = ptbrFormat;
477
+ $[95] = setMaskValue;
478
+ $[96] = setSelectedDate;
479
+ $[97] = variant;
480
+ $[98] = t29;
390
481
  } else {
391
- t26 = $[77];
482
+ t29 = $[98];
392
483
  }
393
- const t27 = props?.value;
394
- let t28;
395
- if ($[78] !== t27) {
396
- t28 = [t27];
397
- $[78] = t27;
398
- $[79] = t28;
484
+ const t30 = props?.value;
485
+ let t31;
486
+ if ($[99] !== t30) {
487
+ t31 = [t30];
488
+ $[99] = t30;
489
+ $[100] = t31;
399
490
  } else {
400
- t28 = $[79];
491
+ t31 = $[100];
401
492
  }
402
- React.useEffect(t26, t28);
403
- const t29 = Boolean(readOnly);
404
- const t30 = Boolean(disabled);
405
- let t31;
406
- if ($[80] !== calendarState || $[81] !== handleOnClickClearSelectedDate || $[82] !== handleUpdateDateState || $[83] !== hasValidDateSelected || $[84] !== inputId || $[85] !== label || $[86] !== maskedValue || $[87] !== selectedDate || $[88] !== showCalendarButton || $[89] !== showClearDateButton || $[90] !== skeletonize || $[91] !== t29 || $[92] !== t30 || $[93] !== unmaskedValue) {
407
- t31 = {
493
+ React.useEffect(t29, t31);
494
+ const t32 = Boolean(readOnly);
495
+ const t33 = Boolean(disabled);
496
+ let t34;
497
+ if ($[101] !== calendarState || $[102] !== handleOnClickClearSelectedDate || $[103] !== handleUpdateDateState || $[104] !== hasValidDateSelected || $[105] !== inputId || $[106] !== label || $[107] !== maskedValue || $[108] !== selectedDate || $[109] !== showCalendarButton || $[110] !== showClearDateButton || $[111] !== skeletonize || $[112] !== t32 || $[113] !== t33 || $[114] !== unmaskedValue) {
498
+ t34 = {
408
499
  ...calendarState,
409
500
  label,
410
501
  inputFieldId: inputId,
411
- isReadOnly: t29,
412
- isDisabled: t30,
502
+ isReadOnly: t32,
503
+ isDisabled: t33,
413
504
  skeletonize,
414
505
  showCalendarButton,
415
506
  hasValidDateSelected,
@@ -421,208 +512,210 @@ const InputBase = React.forwardRef((props, ref) => {
421
512
  handleOnClickClearSelectedDate,
422
513
  handleSelectDate: handleUpdateDateState
423
514
  };
424
- $[80] = calendarState;
425
- $[81] = handleOnClickClearSelectedDate;
426
- $[82] = handleUpdateDateState;
427
- $[83] = hasValidDateSelected;
428
- $[84] = inputId;
429
- $[85] = label;
430
- $[86] = maskedValue;
431
- $[87] = selectedDate;
432
- $[88] = showCalendarButton;
433
- $[89] = showClearDateButton;
434
- $[90] = skeletonize;
435
- $[91] = t29;
436
- $[92] = t30;
437
- $[93] = unmaskedValue;
438
- $[94] = t31;
515
+ $[101] = calendarState;
516
+ $[102] = handleOnClickClearSelectedDate;
517
+ $[103] = handleUpdateDateState;
518
+ $[104] = hasValidDateSelected;
519
+ $[105] = inputId;
520
+ $[106] = label;
521
+ $[107] = maskedValue;
522
+ $[108] = selectedDate;
523
+ $[109] = showCalendarButton;
524
+ $[110] = showClearDateButton;
525
+ $[111] = skeletonize;
526
+ $[112] = t32;
527
+ $[113] = t33;
528
+ $[114] = unmaskedValue;
529
+ $[115] = t34;
439
530
  } else {
440
- t31 = $[94];
531
+ t34 = $[115];
441
532
  }
442
- const contextValues = t31;
443
- let t32;
444
- if ($[95] !== customClassLabel || $[96] !== disabled || $[97] !== hasHintMessages || $[98] !== hasLabel || $[99] !== hintPosition || $[100] !== inputId || $[101] !== label || $[102] !== labelUppercase || $[103] !== popoverAlign || $[104] !== props.hint || $[105] !== props.required || $[106] !== readOnly || $[107] !== skeletonize || $[108] !== themePopover) {
445
- t32 = hasLabel && /* @__PURE__ */ jsx(Label, { "data-testid": "test-date-field-label", label, inputId, hint: props?.hint, isDisabled: disabled, isReadOnly: readOnly, skeletonize, required: props?.required, hintPosition, themePopover, popoverAlign, labelUppercase, hasHintMessages, customClassLabel });
446
- $[95] = customClassLabel;
447
- $[96] = disabled;
448
- $[97] = hasHintMessages;
449
- $[98] = hasLabel;
450
- $[99] = hintPosition;
451
- $[100] = inputId;
452
- $[101] = label;
453
- $[102] = labelUppercase;
454
- $[103] = popoverAlign;
455
- $[104] = props.hint;
456
- $[105] = props.required;
457
- $[106] = readOnly;
458
- $[107] = skeletonize;
459
- $[108] = themePopover;
460
- $[109] = t32;
533
+ const contextValues = t34;
534
+ let t35;
535
+ if ($[116] !== customClassLabel || $[117] !== disabled || $[118] !== hasHintMessages || $[119] !== hasLabel || $[120] !== hintPosition || $[121] !== inputId || $[122] !== label || $[123] !== labelUppercase || $[124] !== popoverAlign || $[125] !== props.hint || $[126] !== props.required || $[127] !== readOnly || $[128] !== skeletonize || $[129] !== themePopover) {
536
+ t35 = hasLabel && /* @__PURE__ */ jsx(Label, { "data-testid": "test-date-field-label", label, inputId, hint: props?.hint, isDisabled: disabled, isReadOnly: readOnly, skeletonize, required: props?.required, hintPosition, themePopover, popoverAlign, labelUppercase, hasHintMessages, customClassLabel });
537
+ $[116] = customClassLabel;
538
+ $[117] = disabled;
539
+ $[118] = hasHintMessages;
540
+ $[119] = hasLabel;
541
+ $[120] = hintPosition;
542
+ $[121] = inputId;
543
+ $[122] = label;
544
+ $[123] = labelUppercase;
545
+ $[124] = popoverAlign;
546
+ $[125] = props.hint;
547
+ $[126] = props.required;
548
+ $[127] = readOnly;
549
+ $[128] = skeletonize;
550
+ $[129] = themePopover;
551
+ $[130] = t35;
461
552
  } else {
462
- t32 = $[109];
553
+ t35 = $[130];
463
554
  }
464
- let t33;
465
- if ($[110] !== ref) {
466
- t33 = mergeRefs(ref, dateInputRef);
467
- $[110] = ref;
468
- $[111] = t33;
555
+ let t36;
556
+ if ($[131] !== ref) {
557
+ t36 = mergeRefs(ref, dateInputRef);
558
+ $[131] = ref;
559
+ $[132] = t36;
469
560
  } else {
470
- t33 = $[111];
561
+ t36 = $[132];
471
562
  }
472
- const t34 = props?.name;
473
- const t35 = !readOnly && !skeletonize ? 0 : -1;
474
- let t36;
475
- if ($[112] !== activeDescendant || $[113] !== calendarBoxOpen || $[114] !== customClass || $[115] !== disabled || $[116] !== handleOnBeforeInput || $[117] !== handleOnBlur || $[118] !== handleOnFocus || $[119] !== handleOnKeyDown || $[120] !== handleOnKeyDownCapture || $[121] !== handleOnPaste || $[122] !== hasValidationErrors || $[123] !== inputId || $[124] !== inputPlaceholder || $[125] !== maskedValue || $[126] !== readOnly || $[127] !== rest || $[128] !== skeletonize || $[129] !== t33 || $[130] !== t34 || $[131] !== t35 || $[132] !== textAlign || $[133] !== undigitable) {
476
- t36 = /* @__PURE__ */ jsx(Input, { ...rest, ref: t33, id: inputId, name: t34, value: maskedValue, readOnly, disabled, customClass, tabIndex: t35, placeholder: inputPlaceholder, "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": inputId, "aria-labelledby": inputId, "data-state-is-period-input": false, "data-testid": "test-date-field-input", "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onBlur: handleOnBlur, onFocus: handleOnFocus, onPaste: handleOnPaste, onKeyDown: handleOnKeyDown, onKeyDownCapture: handleOnKeyDownCapture, onBeforeInput: handleOnBeforeInput });
477
- $[112] = activeDescendant;
478
- $[113] = calendarBoxOpen;
479
- $[114] = customClass;
480
- $[115] = disabled;
481
- $[116] = handleOnBeforeInput;
482
- $[117] = handleOnBlur;
483
- $[118] = handleOnFocus;
484
- $[119] = handleOnKeyDown;
485
- $[120] = handleOnKeyDownCapture;
486
- $[121] = handleOnPaste;
487
- $[122] = hasValidationErrors;
488
- $[123] = inputId;
489
- $[124] = inputPlaceholder;
490
- $[125] = maskedValue;
491
- $[126] = readOnly;
492
- $[127] = rest;
493
- $[128] = skeletonize;
494
- $[129] = t33;
495
- $[130] = t34;
496
- $[131] = t35;
497
- $[132] = textAlign;
498
- $[133] = undigitable;
499
- $[134] = t36;
563
+ const t37 = props?.name;
564
+ const t38 = !readOnly && !skeletonize ? 0 : -1;
565
+ let t39;
566
+ if ($[133] !== activeDescendant || $[134] !== calendarBoxOpen || $[135] !== customClass || $[136] !== disabled || $[137] !== handleOnBeforeInput || $[138] !== handleOnBlur || $[139] !== handleOnFocus || $[140] !== handleOnKeyDown || $[141] !== handleOnKeyDownCapture || $[142] !== handleOnPaste || $[143] !== hasValidationErrors || $[144] !== inputId || $[145] !== inputPlaceholder || $[146] !== maskedValue || $[147] !== readOnly || $[148] !== rest || $[149] !== skeletonize || $[150] !== t36 || $[151] !== t37 || $[152] !== t38 || $[153] !== textAlign || $[154] !== undigitable) {
567
+ t39 = /* @__PURE__ */ jsx(Input, { ...rest, ref: t36, id: inputId, name: t37, value: maskedValue, readOnly, disabled, customClass, tabIndex: t38, placeholder: inputPlaceholder, "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": inputId, "aria-labelledby": inputId, "data-state-is-period-input": false, "data-testid": "test-date-field-input", "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onBlur: handleOnBlur, onFocus: handleOnFocus, onPaste: handleOnPaste, onKeyDown: handleOnKeyDown, onKeyDownCapture: handleOnKeyDownCapture, onBeforeInput: handleOnBeforeInput });
568
+ $[133] = activeDescendant;
569
+ $[134] = calendarBoxOpen;
570
+ $[135] = customClass;
571
+ $[136] = disabled;
572
+ $[137] = handleOnBeforeInput;
573
+ $[138] = handleOnBlur;
574
+ $[139] = handleOnFocus;
575
+ $[140] = handleOnKeyDown;
576
+ $[141] = handleOnKeyDownCapture;
577
+ $[142] = handleOnPaste;
578
+ $[143] = hasValidationErrors;
579
+ $[144] = inputId;
580
+ $[145] = inputPlaceholder;
581
+ $[146] = maskedValue;
582
+ $[147] = readOnly;
583
+ $[148] = rest;
584
+ $[149] = skeletonize;
585
+ $[150] = t36;
586
+ $[151] = t37;
587
+ $[152] = t38;
588
+ $[153] = textAlign;
589
+ $[154] = undigitable;
590
+ $[155] = t39;
500
591
  } else {
501
- t36 = $[134];
592
+ t39 = $[155];
502
593
  }
503
- let t37;
504
- if ($[135] === Symbol.for("react.memo_cache_sentinel")) {
505
- t37 = /* @__PURE__ */ jsx(Triggers, {});
506
- $[135] = t37;
594
+ let t40;
595
+ if ($[156] === Symbol.for("react.memo_cache_sentinel")) {
596
+ t40 = /* @__PURE__ */ jsx(Triggers, {});
597
+ $[156] = t40;
507
598
  } else {
508
- t37 = $[135];
599
+ t40 = $[156];
509
600
  }
510
- let t38;
511
- if ($[136] !== customClassInputContainer || $[137] !== dateContainerRef || $[138] !== skeletonize || $[139] !== t36) {
512
- t38 = /* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, skeletonize, customClassInputContainer, children: [
513
- t36,
514
- t37
601
+ let t41;
602
+ if ($[157] !== customClassInputContainer || $[158] !== dateContainerRef || $[159] !== skeletonize || $[160] !== t39) {
603
+ t41 = /* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, skeletonize, customClassInputContainer, children: [
604
+ t39,
605
+ t40
515
606
  ] });
516
- $[136] = customClassInputContainer;
517
- $[137] = dateContainerRef;
518
- $[138] = skeletonize;
519
- $[139] = t36;
520
- $[140] = t38;
607
+ $[157] = customClassInputContainer;
608
+ $[158] = dateContainerRef;
609
+ $[159] = skeletonize;
610
+ $[160] = t39;
611
+ $[161] = t41;
521
612
  } else {
522
- t38 = $[140];
613
+ t41 = $[161];
523
614
  }
524
- let t39;
525
- if ($[141] !== activeDescendant || $[142] !== calendarBoxOpen || $[143] !== calendarDisplayDate || $[144] !== calendarRef || $[145] !== dateContainerRef || $[146] !== handleNextMonth || $[147] !== handlePreviousMonth || $[148] !== handleSelectDay || $[149] !== handleSelectTime || $[150] !== hasBounds || $[151] !== inputId || $[152] !== isDateTime || $[153] !== maxDate || $[154] !== minDate || $[155] !== selectedDate) {
526
- t39 = calendarBoxOpen && createPortal(/* @__PURE__ */ jsx(CalendarBox, { ref: calendarRef, testIdPrefix: "test-date-field", headerId: inputId, calendarBoxOpen, activeDescendant, calendarDisplayDate, containerRef: dateContainerRef, onNextMonth: handleNextMonth, onPreviousMonth: handlePreviousMonth, getDayState: (day_0) => ({
615
+ let t42;
616
+ if ($[162] !== activeDescendant || $[163] !== calendarBoxOpen || $[164] !== calendarDisplayDate || $[165] !== calendarRef || $[166] !== dateContainerRef || $[167] !== handleNextMonth || $[168] !== handlePreviousMonth || $[169] !== handleSelectDay || $[170] !== handleSelectHour || $[171] !== handleSelectMinute || $[172] !== hasBounds || $[173] !== inputId || $[174] !== isDateTime || $[175] !== maxDate || $[176] !== minDate || $[177] !== selectedDate || $[178] !== timeSelection) {
617
+ t42 = calendarBoxOpen && createPortal(/* @__PURE__ */ jsx(CalendarBox, { ref: calendarRef, testIdPrefix: "test-date-field", headerId: inputId, calendarBoxOpen, activeDescendant, calendarDisplayDate, containerRef: dateContainerRef, onNextMonth: handleNextMonth, onPreviousMonth: handlePreviousMonth, getDayState: (day_0) => ({
527
618
  isSelected: selectedDate ? day_0.isSame(selectedDate, "day") : false,
528
619
  ...hasBounds && {
529
620
  isDisabled: isDayOutOfBounds(day_0, minDate, maxDate)
530
621
  }
531
- }), onSelectDay: handleSelectDay, children: isDateTime && /* @__PURE__ */ jsx(TimeSelector, { value: selectedDate, onSelectTime: handleSelectTime, min: minDate, max: maxDate, testIdPrefix: "test-date-field" }) }), document.body);
532
- $[141] = activeDescendant;
533
- $[142] = calendarBoxOpen;
534
- $[143] = calendarDisplayDate;
535
- $[144] = calendarRef;
536
- $[145] = dateContainerRef;
537
- $[146] = handleNextMonth;
538
- $[147] = handlePreviousMonth;
539
- $[148] = handleSelectDay;
540
- $[149] = handleSelectTime;
541
- $[150] = hasBounds;
542
- $[151] = inputId;
543
- $[152] = isDateTime;
544
- $[153] = maxDate;
545
- $[154] = minDate;
546
- $[155] = selectedDate;
547
- $[156] = t39;
622
+ }), onSelectDay: handleSelectDay, children: isDateTime && /* @__PURE__ */ jsx(TimeSelector, { value: selectedDate, selectedHour: timeSelection.hour, selectedMinute: timeSelection.minute, onSelectHour: handleSelectHour, onSelectMinute: handleSelectMinute, min: minDate, max: maxDate, testIdPrefix: "test-date-field" }) }), document.body);
623
+ $[162] = activeDescendant;
624
+ $[163] = calendarBoxOpen;
625
+ $[164] = calendarDisplayDate;
626
+ $[165] = calendarRef;
627
+ $[166] = dateContainerRef;
628
+ $[167] = handleNextMonth;
629
+ $[168] = handlePreviousMonth;
630
+ $[169] = handleSelectDay;
631
+ $[170] = handleSelectHour;
632
+ $[171] = handleSelectMinute;
633
+ $[172] = hasBounds;
634
+ $[173] = inputId;
635
+ $[174] = isDateTime;
636
+ $[175] = maxDate;
637
+ $[176] = minDate;
638
+ $[177] = selectedDate;
639
+ $[178] = timeSelection;
640
+ $[179] = t42;
548
641
  } else {
549
- t39 = $[156];
642
+ t42 = $[179];
550
643
  }
551
- let t40;
552
- if ($[157] !== disabled || $[158] !== hasHintMessages || $[159] !== hintPosition || $[160] !== props.hint || $[161] !== skeletonize) {
553
- t40 = hintPosition === "below" && /* @__PURE__ */ jsx(Hint, { customClass: "hint", description: props.hint, disabled, skeletonize, visible: hasHintMessages });
554
- $[157] = disabled;
555
- $[158] = hasHintMessages;
556
- $[159] = hintPosition;
557
- $[160] = props.hint;
558
- $[161] = skeletonize;
559
- $[162] = t40;
644
+ let t43;
645
+ if ($[180] !== disabled || $[181] !== hasHintMessages || $[182] !== hintPosition || $[183] !== props.hint || $[184] !== skeletonize) {
646
+ t43 = hintPosition === "below" && /* @__PURE__ */ jsx(Hint, { customClass: "hint", description: props.hint, disabled, skeletonize, visible: hasHintMessages });
647
+ $[180] = disabled;
648
+ $[181] = hasHintMessages;
649
+ $[182] = hintPosition;
650
+ $[183] = props.hint;
651
+ $[184] = skeletonize;
652
+ $[185] = t43;
560
653
  } else {
561
- t40 = $[162];
654
+ t43 = $[185];
562
655
  }
563
- let t41;
564
- if ($[163] !== errors || $[164] !== hasValidationErrors || $[165] !== props.name || $[166] !== skeletonize) {
565
- t41 = hasValidationErrors && /* @__PURE__ */ jsx("span", { "data-testid": "test-date-field-list-errors", className: "error", "data-state-skeletonize": skeletonize, "aria-describedby": String(props.name).concat("-errors"), children: errors?.map(_temp) });
566
- $[163] = errors;
567
- $[164] = hasValidationErrors;
568
- $[165] = props.name;
569
- $[166] = skeletonize;
570
- $[167] = t41;
656
+ let t44;
657
+ if ($[186] !== errors || $[187] !== hasValidationErrors || $[188] !== props.name || $[189] !== skeletonize) {
658
+ t44 = hasValidationErrors && /* @__PURE__ */ jsx("span", { "data-testid": "test-date-field-list-errors", className: "error", "data-state-skeletonize": skeletonize, "aria-describedby": String(props.name).concat("-errors"), children: errors?.map(_temp) });
659
+ $[186] = errors;
660
+ $[187] = hasValidationErrors;
661
+ $[188] = props.name;
662
+ $[189] = skeletonize;
663
+ $[190] = t44;
571
664
  } else {
572
- t41 = $[167];
665
+ t44 = $[190];
573
666
  }
574
- let t42;
575
- if ($[168] !== customClassWrapper || $[169] !== hasValidationErrors || $[170] !== t32 || $[171] !== t38 || $[172] !== t39 || $[173] !== t40 || $[174] !== t41) {
576
- t42 = /* @__PURE__ */ jsxs(Root, { ref: inputRootRef, "data-testid": "test-date-field-root", customClassWrapper, hasValidationErrors, children: [
577
- t32,
578
- t38,
579
- t39,
580
- t40,
581
- t41
667
+ let t45;
668
+ if ($[191] !== customClassWrapper || $[192] !== hasValidationErrors || $[193] !== t35 || $[194] !== t41 || $[195] !== t42 || $[196] !== t43 || $[197] !== t44) {
669
+ t45 = /* @__PURE__ */ jsxs(Root, { ref: inputRootRef, "data-testid": "test-date-field-root", customClassWrapper, hasValidationErrors, children: [
670
+ t35,
671
+ t41,
672
+ t42,
673
+ t43,
674
+ t44
582
675
  ] });
583
- $[168] = customClassWrapper;
584
- $[169] = hasValidationErrors;
585
- $[170] = t32;
586
- $[171] = t38;
587
- $[172] = t39;
588
- $[173] = t40;
589
- $[174] = t41;
590
- $[175] = t42;
676
+ $[191] = customClassWrapper;
677
+ $[192] = hasValidationErrors;
678
+ $[193] = t35;
679
+ $[194] = t41;
680
+ $[195] = t42;
681
+ $[196] = t43;
682
+ $[197] = t44;
683
+ $[198] = t45;
591
684
  } else {
592
- t42 = $[175];
685
+ t45 = $[198];
593
686
  }
594
- let t43;
595
- if ($[176] !== contextValues || $[177] !== t42) {
596
- t43 = /* @__PURE__ */ jsx(DateFieldContext.Provider, { value: contextValues, children: t42 });
597
- $[176] = contextValues;
598
- $[177] = t42;
599
- $[178] = t43;
687
+ let t46;
688
+ if ($[199] !== contextValues || $[200] !== t45) {
689
+ t46 = /* @__PURE__ */ jsx(DateFieldContext.Provider, { value: contextValues, children: t45 });
690
+ $[199] = contextValues;
691
+ $[200] = t45;
692
+ $[201] = t46;
600
693
  } else {
601
- t43 = $[178];
694
+ t46 = $[201];
602
695
  }
603
- let t44;
604
- if ($[179] !== tooltip || $[180] !== tooltipPosition || $[181] !== tooltipWidth) {
605
- t44 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
606
- $[179] = tooltip;
607
- $[180] = tooltipPosition;
608
- $[181] = tooltipWidth;
609
- $[182] = t44;
696
+ let t47;
697
+ if ($[202] !== tooltip || $[203] !== tooltipPosition || $[204] !== tooltipWidth) {
698
+ t47 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
699
+ $[202] = tooltip;
700
+ $[203] = tooltipPosition;
701
+ $[204] = tooltipWidth;
702
+ $[205] = t47;
610
703
  } else {
611
- t44 = $[182];
704
+ t47 = $[205];
612
705
  }
613
- let t45;
614
- if ($[183] !== t43 || $[184] !== t44) {
615
- t45 = /* @__PURE__ */ jsxs(React.Fragment, { children: [
616
- t43,
617
- t44
706
+ let t48;
707
+ if ($[206] !== t46 || $[207] !== t47) {
708
+ t48 = /* @__PURE__ */ jsxs(React.Fragment, { children: [
709
+ t46,
710
+ t47
618
711
  ] });
619
- $[183] = t43;
620
- $[184] = t44;
621
- $[185] = t45;
712
+ $[206] = t46;
713
+ $[207] = t47;
714
+ $[208] = t48;
622
715
  } else {
623
- t45 = $[185];
716
+ t48 = $[208];
624
717
  }
625
- return t45;
718
+ return t48;
626
719
  });
627
720
  InputBase.displayName = "DateFieldInputBase";
628
721
  function _temp(error, index) {