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

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.
@@ -14,12 +14,12 @@ import { Label, Root, Container, Input } from "../base/index.js";
14
14
  import { useDateMask } from "../hooks/useDateMask.js";
15
15
  import { useDateCalendarState } from "../hooks/useDateCalendarState.js";
16
16
  import { TimeSelector } from "../timeselector.js";
17
- import { getDateFormats, parseBoundary, TOKEN_ISO_FORMAT, getPredefinedPeriodRange, clampDateToBounds, isDayOutOfBounds, parseDateValue } from "../helpers.js";
17
+ import { parseBoundary, TOKEN_ISO_FORMAT, parseDateValue, getDateFormats, getPredefinedPeriodRange, clampDateToBounds, isDayOutOfBounds, resolveAssumedTime, completePartialDateTime, getTimeSelection, formatPartialDateTime } from "../helpers.js";
18
18
  import { CalendarBox } from "../calendarbox.js";
19
19
  import { Triggers } from "./triggers.js";
20
20
  import { DatePeriodFieldContext } from "./context.js";
21
21
  const InputBase = React.forwardRef((props, __) => {
22
- const $ = compilerRuntimeExports.c(211);
22
+ const $ = compilerRuntimeExports.c(155);
23
23
  const {
24
24
  label,
25
25
  errors,
@@ -178,32 +178,32 @@ const InputBase = React.forwardRef((props, __) => {
178
178
  onBeforeInput: props.onBeforeInput
179
179
  });
180
180
  let t22;
181
- if ($[7] !== props.label) {
182
- t22 = _.isEmpty(props?.label);
183
- $[7] = props.label;
184
- $[8] = t22;
181
+ if ($[7] !== finalUnmaskedValue || $[8] !== initialUnmaskedValue || $[9] !== variant) {
182
+ t22 = (inputType) => getTimeSelection(inputType === "initial" ? initialUnmaskedValue : finalUnmaskedValue, variant);
183
+ $[7] = finalUnmaskedValue;
184
+ $[8] = initialUnmaskedValue;
185
+ $[9] = variant;
186
+ $[10] = t22;
185
187
  } else {
186
- t22 = $[8];
188
+ t22 = $[10];
187
189
  }
188
- const hasLabel = !t22;
189
- const hasHintMessages = Boolean(props.hint?.length);
190
- const hasValidationErrors = Boolean(errors?.length);
190
+ const timeSelectionOf = t22;
191
+ const activeTimeSelection = timeSelectionOf(activeInputType);
191
192
  let t23;
192
- if ($[9] !== finalName || $[10] !== initialName || $[11] !== props.value) {
193
- t23 = () => {
194
- const objectValue = props?.value;
195
- const isValidInitialValue = !_.isEmpty(objectValue[initialName]);
196
- const isValidFinalValue = !_.isEmpty(objectValue[finalName]);
197
- return isValidInitialValue && isValidFinalValue;
198
- };
199
- $[9] = finalName;
200
- $[10] = initialName;
201
- $[11] = props.value;
193
+ if ($[11] !== props.label) {
194
+ t23 = _.isEmpty(props?.label);
195
+ $[11] = props.label;
202
196
  $[12] = t23;
203
197
  } else {
204
198
  t23 = $[12];
205
199
  }
206
- const verifyPeriodSelectedIsValid = t23;
200
+ const hasLabel = !t23;
201
+ const hasHintMessages = Boolean(props.hint?.length);
202
+ const hasValidationErrors = Boolean(errors?.length);
203
+ const objectValue = props?.value;
204
+ const receivedInitialValue = _.toString(objectValue?.[initialName]);
205
+ const receivedFinalValue = _.toString(objectValue?.[finalName]);
206
+ const verifyPeriodSelectedIsValid = () => !_.isEmpty(receivedInitialValue) && !_.isEmpty(receivedFinalValue);
207
207
  const emitPeriodChange = (inicial, final) => {
208
208
  onChange?.({
209
209
  target: {
@@ -216,7 +216,7 @@ const InputBase = React.forwardRef((props, __) => {
216
216
  });
217
217
  };
218
218
  let t24;
219
- if ($[13] !== finalName || $[14] !== handleSetCalendarBoxOpen || $[15] !== initialName || $[16] !== onChange || $[17] !== props.name || $[18] !== setFinalMaskValue || $[19] !== setInitialMaskValue || $[20] !== setSelectedDate) {
219
+ if ($[13] !== finalName || $[14] !== handleSetCalendarBoxOpen || $[15] !== initialName || $[16] !== onChange || $[17] !== props.name || $[18] !== setFinalMaskValue || $[19] !== setInitialMaskValue) {
220
220
  t24 = () => {
221
221
  onChange?.({
222
222
  target: {
@@ -239,16 +239,15 @@ const InputBase = React.forwardRef((props, __) => {
239
239
  $[17] = props.name;
240
240
  $[18] = setFinalMaskValue;
241
241
  $[19] = setInitialMaskValue;
242
- $[20] = setSelectedDate;
243
- $[21] = t24;
242
+ $[20] = t24;
244
243
  } else {
245
- t24 = $[21];
244
+ t24 = $[20];
246
245
  }
247
246
  const handleOnClickClearSelectedPeriod = t24;
248
247
  const handleChangeUpdateDateState = (params) => {
249
248
  const {
250
249
  date: date_1,
251
- inputType,
250
+ inputType: inputType_0,
252
251
  typing
253
252
  } = params;
254
253
  const rawDate = date_1.clone();
@@ -266,7 +265,7 @@ const InputBase = React.forwardRef((props, __) => {
266
265
  final: final_0
267
266
  };
268
267
  };
269
- bb209: switch (inputType) {
268
+ bb223: switch (inputType_0) {
270
269
  case "initial": {
271
270
  setSelectedDate((prevSelectedDate_0) => {
272
271
  const {
@@ -285,11 +284,11 @@ const InputBase = React.forwardRef((props, __) => {
285
284
  } = resolveDateRange(rawDate, selectedDate.final);
286
285
  emitPeriodChange(inicial_4, final_4);
287
286
  requestAnimationFrame(() => {
288
- if (!typing) {
287
+ if (!typing && !isDateTime) {
289
288
  finalInputRef.current?.focus?.();
290
289
  }
291
290
  });
292
- break bb209;
291
+ break bb223;
293
292
  }
294
293
  case "final": {
295
294
  setSelectedDate((prevSelectedDate) => {
@@ -311,315 +310,303 @@ const InputBase = React.forwardRef((props, __) => {
311
310
  if (shouldCloseCalendarOnSelect) {
312
311
  handleSetCalendarBoxOpen(false);
313
312
  }
314
- break bb209;
313
+ break bb223;
315
314
  }
316
315
  }
317
316
  handleChangeActiveDescendant(rawDate.format(TOKEN_ISO_FORMAT));
318
317
  handleChangeCalendarDisplayDate(rawDate.clone());
319
318
  };
320
319
  let t25;
321
- if ($[22] !== finalName || $[23] !== handleSetCalendarBoxOpen || $[24] !== initialName || $[25] !== isoFormat || $[26] !== maxDate || $[27] !== minDate || $[28] !== onChange || $[29] !== props.name || $[30] !== returnValueType || $[31] !== setSelectedDate || $[32] !== shouldCloseCalendarOnSelect) {
322
- t25 = (period) => {
323
- const localOnChange = (initialDate_0, finalDate_0) => {
324
- const valueToUpdate = {
325
- [initialName]: returnValueType === "default" ? initialDate_0.format(isoFormat) : initialDate_0.toISOString(),
326
- [finalName]: returnValueType === "default" ? finalDate_0.format(isoFormat) : finalDate_0.toISOString()
327
- };
328
- setSelectedDate(() => {
329
- const updatedState_1 = {
330
- inicial: initialDate_0.clone(),
331
- final: finalDate_0.clone()
332
- };
333
- return updatedState_1;
334
- });
335
- onChange?.({
336
- target: {
337
- name: props.name,
338
- value: valueToUpdate
339
- }
340
- });
341
- };
320
+ if ($[21] !== handleChangeActiveDescendant || $[22] !== handleChangeCalendarDisplayDate || $[23] !== setFinalMaskValue || $[24] !== setInitialMaskValue) {
321
+ t25 = (params_0) => {
342
322
  const {
343
- initialDate: initialDate_1,
344
- finalDate: finalDate_1
345
- } = getPredefinedPeriodRange(period);
346
- localOnChange(clampDateToBounds(initialDate_1, minDate, maxDate), clampDateToBounds(finalDate_1, minDate, maxDate));
347
- finalInputRef?.current?.focus?.();
348
- if (shouldCloseCalendarOnSelect) {
349
- handleSetCalendarBoxOpen(false);
350
- }
323
+ date: date_2,
324
+ inputType: inputType_1,
325
+ hour,
326
+ minute
327
+ } = params_0;
328
+ setSelectedDate((prevSelectedDate_1) => inputType_1 === "initial" ? {
329
+ ...prevSelectedDate_1,
330
+ inicial: date_2.clone()
331
+ } : {
332
+ ...prevSelectedDate_1,
333
+ final: date_2.clone()
334
+ });
335
+ const setMaskValue = inputType_1 === "initial" ? setInitialMaskValue : setFinalMaskValue;
336
+ setMaskValue(formatPartialDateTime(date_2, hour, minute));
337
+ handleChangeActiveDescendant(date_2.format(TOKEN_ISO_FORMAT));
338
+ handleChangeCalendarDisplayDate(date_2.clone());
351
339
  };
352
- $[22] = finalName;
353
- $[23] = handleSetCalendarBoxOpen;
354
- $[24] = initialName;
355
- $[25] = isoFormat;
356
- $[26] = maxDate;
357
- $[27] = minDate;
358
- $[28] = onChange;
359
- $[29] = props.name;
360
- $[30] = returnValueType;
361
- $[31] = setSelectedDate;
362
- $[32] = shouldCloseCalendarOnSelect;
363
- $[33] = t25;
340
+ $[21] = handleChangeActiveDescendant;
341
+ $[22] = handleChangeCalendarDisplayDate;
342
+ $[23] = setFinalMaskValue;
343
+ $[24] = setInitialMaskValue;
344
+ $[25] = t25;
364
345
  } else {
365
- t25 = $[33];
346
+ t25 = $[25];
366
347
  }
367
- const handleChangeUpdateDateStateWithPredefinedPeriod = t25;
368
- let handleOnBlurMaskInput;
369
- if ($[34] !== calendarBoxOpen || $[35] !== digits || $[36] !== emitPeriodChange || $[37] !== finalInputName || $[38] !== finalUnmaskedValue || $[39] !== handleChangeActiveDescendant || $[40] !== handleChangeCalendarDisplayDate || $[41] !== handleSetCalendarBoxOpen || $[42] !== initialInputName || $[43] !== initialUnmaskedValue || $[44] !== props || $[45] !== ptbrFormat || $[46] !== selectedDate || $[47] !== setFinalMaskValue || $[48] !== setInitialMaskValue || $[49] !== setSelectedDate) {
370
- handleOnBlurMaskInput = (event, inputType_0) => {
371
- props?.onBlur?.(event);
372
- if (inputType_0 === "initial") {
373
- if (event.relatedTarget?.id !== finalInputName) {
374
- handleSetCalendarBoxOpen(false);
375
- }
376
- if (calendarBoxOpen) {
377
- handleChangeActiveDescendant((selectedDate.inicial ?? hooks()).format(TOKEN_ISO_FORMAT));
378
- handleChangeCalendarDisplayDate(selectedDate.inicial ?? hooks());
379
- }
380
- if (_.size(initialUnmaskedValue) !== digits) {
381
- const date_2 = hooks(selectedDate.inicial, TOKEN_ISO_FORMAT);
382
- if (date_2.isValid()) {
383
- setInitialMaskValue(date_2.format(ptbrFormat));
384
- }
385
- }
386
- }
387
- if (inputType_0 === "final") {
388
- if (event.relatedTarget?.id !== initialInputName) {
389
- handleSetCalendarBoxOpen(false);
390
- }
391
- if (calendarBoxOpen) {
392
- handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
393
- handleChangeCalendarDisplayDate(selectedDate.final ?? hooks());
394
- }
395
- if (_.size(finalUnmaskedValue) !== digits) {
396
- const date_3 = hooks(selectedDate.final, TOKEN_ISO_FORMAT);
397
- if (date_3.isValid()) {
398
- setFinalMaskValue(date_3.format(ptbrFormat));
399
- }
348
+ const handleUpdateDraftState = t25;
349
+ const handleChangeUpdateDateStateWithPredefinedPeriod = (period) => {
350
+ const localOnChange = (initialDate_0, finalDate_0) => {
351
+ const valueToUpdate = {
352
+ [initialName]: returnValueType === "default" ? initialDate_0.format(isoFormat) : initialDate_0.toISOString(),
353
+ [finalName]: returnValueType === "default" ? finalDate_0.format(isoFormat) : finalDate_0.toISOString()
354
+ };
355
+ setSelectedDate(() => {
356
+ const updatedState_1 = {
357
+ inicial: initialDate_0.clone(),
358
+ final: finalDate_0.clone()
359
+ };
360
+ return updatedState_1;
361
+ });
362
+ onChange?.({
363
+ target: {
364
+ name: props.name,
365
+ value: valueToUpdate
400
366
  }
401
- }
402
- handleReorderPeriodOnBlur();
403
- };
404
- const handleReorderPeriodOnBlur = () => {
405
- const {
406
- inicial: inicial_5,
407
- final: final_5
408
- } = selectedDate;
409
- if (!inicial_5 || !final_5 || !inicial_5.isAfter(final_5)) {
410
- return;
411
- }
412
- setSelectedDate({
413
- inicial: final_5,
414
- final: inicial_5
415
367
  });
416
- setInitialMaskValue(final_5.format(ptbrFormat));
417
- setFinalMaskValue(inicial_5.format(ptbrFormat));
418
- emitPeriodChange(final_5, inicial_5);
419
368
  };
420
- $[34] = calendarBoxOpen;
421
- $[35] = digits;
422
- $[36] = emitPeriodChange;
423
- $[37] = finalInputName;
424
- $[38] = finalUnmaskedValue;
425
- $[39] = handleChangeActiveDescendant;
426
- $[40] = handleChangeCalendarDisplayDate;
427
- $[41] = handleSetCalendarBoxOpen;
428
- $[42] = initialInputName;
429
- $[43] = initialUnmaskedValue;
430
- $[44] = props;
431
- $[45] = ptbrFormat;
432
- $[46] = selectedDate;
433
- $[47] = setFinalMaskValue;
434
- $[48] = setInitialMaskValue;
435
- $[49] = setSelectedDate;
436
- $[50] = handleOnBlurMaskInput;
437
- } else {
438
- handleOnBlurMaskInput = $[50];
439
- }
369
+ const {
370
+ initialDate: initialDate_1,
371
+ finalDate: finalDate_1
372
+ } = getPredefinedPeriodRange(period);
373
+ localOnChange(clampDateToBounds(initialDate_1, minDate, maxDate), clampDateToBounds(finalDate_1, minDate, maxDate));
374
+ finalInputRef?.current?.focus?.();
375
+ if (shouldCloseCalendarOnSelect) {
376
+ handleSetCalendarBoxOpen(false);
377
+ }
378
+ };
379
+ const handleCompleteDraftOnBlur = (inputType_2) => {
380
+ const unmaskedValue = inputType_2 === "initial" ? initialUnmaskedValue : finalUnmaskedValue;
381
+ const completedDate = completePartialDateTime({
382
+ unmaskedValue,
383
+ variant,
384
+ min: minDate,
385
+ max: maxDate
386
+ });
387
+ if (!completedDate) {
388
+ return false;
389
+ }
390
+ const inicial_5 = inputType_2 === "initial" ? completedDate : selectedDate.inicial;
391
+ const final_5 = inputType_2 === "final" ? completedDate : selectedDate.final;
392
+ const isInverted = Boolean(inicial_5 && final_5 && inicial_5.isAfter(final_5));
393
+ const ordered = isInverted ? {
394
+ inicial: final_5,
395
+ final: inicial_5
396
+ } : {
397
+ inicial: inicial_5,
398
+ final: final_5
399
+ };
400
+ setSelectedDate(ordered);
401
+ if (ordered.inicial) {
402
+ setInitialMaskValue(ordered.inicial.format(ptbrFormat));
403
+ }
404
+ if (ordered.final) {
405
+ setFinalMaskValue(ordered.final.format(ptbrFormat));
406
+ }
407
+ emitPeriodChange(ordered.inicial, ordered.final);
408
+ return true;
409
+ };
410
+ const handleOnBlurMaskInput = (event, inputType_3) => {
411
+ props?.onBlur?.(event);
412
+ const isInitialInput = inputType_3 === "initial";
413
+ const siblingInputName = isInitialInput ? finalInputName : initialInputName;
414
+ const currentSelectedDate = isInitialInput ? selectedDate.inicial : selectedDate.final;
415
+ if (event.relatedTarget?.id !== siblingInputName) {
416
+ handleSetCalendarBoxOpen(false);
417
+ }
418
+ if (calendarBoxOpen) {
419
+ handleChangeActiveDescendant((currentSelectedDate ?? hooks()).format(TOKEN_ISO_FORMAT));
420
+ handleChangeCalendarDisplayDate(currentSelectedDate ?? hooks());
421
+ }
422
+ if (handleCompleteDraftOnBlur(inputType_3)) {
423
+ return;
424
+ }
425
+ const unmaskedValue_0 = isInitialInput ? initialUnmaskedValue : finalUnmaskedValue;
426
+ const setMaskValue_0 = isInitialInput ? setInitialMaskValue : setFinalMaskValue;
427
+ if (_.size(unmaskedValue_0) !== digits) {
428
+ const date_3 = hooks(currentSelectedDate, TOKEN_ISO_FORMAT);
429
+ if (date_3.isValid()) {
430
+ setMaskValue_0(date_3.format(ptbrFormat));
431
+ }
432
+ }
433
+ handleReorderPeriodOnBlur();
434
+ };
435
+ const handleReorderPeriodOnBlur = () => {
436
+ const {
437
+ inicial: inicial_6,
438
+ final: final_6
439
+ } = selectedDate;
440
+ if (!inicial_6 || !final_6 || !inicial_6.isAfter(final_6)) {
441
+ return;
442
+ }
443
+ setSelectedDate({
444
+ inicial: final_6,
445
+ final: inicial_6
446
+ });
447
+ setInitialMaskValue(final_6.format(ptbrFormat));
448
+ setFinalMaskValue(inicial_6.format(ptbrFormat));
449
+ emitPeriodChange(final_6, inicial_6);
450
+ };
440
451
  let t26;
441
- if ($[51] !== calendarBoxOpen || $[52] !== handleChangeActiveDescendant || $[53] !== handleChangeCalendarDisplayDate || $[54] !== handleSetCalendarBoxOpen || $[55] !== openCalendarOnFocus || $[56] !== props || $[57] !== readOnly || $[58] !== selectedDate.final || $[59] !== selectedDate.inicial || $[60] !== setActiveInputType) {
442
- t26 = (event_0, inputType_1) => {
452
+ if ($[26] !== calendarBoxOpen || $[27] !== handleChangeActiveDescendant || $[28] !== handleChangeCalendarDisplayDate || $[29] !== handleSetCalendarBoxOpen || $[30] !== openCalendarOnFocus || $[31] !== props || $[32] !== readOnly || $[33] !== selectedDate.final || $[34] !== selectedDate.inicial) {
453
+ t26 = (event_0, inputType_4) => {
443
454
  props?.onFocus?.(event_0);
444
455
  if (!readOnly && !calendarBoxOpen && openCalendarOnFocus) {
445
456
  handleSetCalendarBoxOpen(true);
446
457
  }
447
- setActiveInputType(inputType_1);
448
- if (inputType_1 === "initial") {
458
+ setActiveInputType(inputType_4);
459
+ if (inputType_4 === "initial") {
449
460
  handleChangeActiveDescendant((selectedDate.inicial ?? hooks()).format(TOKEN_ISO_FORMAT));
450
461
  handleChangeCalendarDisplayDate(selectedDate.inicial ?? hooks());
451
462
  }
452
- if (inputType_1 === "final") {
463
+ if (inputType_4 === "final") {
453
464
  handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
454
465
  handleChangeCalendarDisplayDate(selectedDate.final ?? hooks());
455
466
  }
456
467
  };
457
- $[51] = calendarBoxOpen;
458
- $[52] = handleChangeActiveDescendant;
459
- $[53] = handleChangeCalendarDisplayDate;
460
- $[54] = handleSetCalendarBoxOpen;
461
- $[55] = openCalendarOnFocus;
462
- $[56] = props;
463
- $[57] = readOnly;
464
- $[58] = selectedDate.final;
465
- $[59] = selectedDate.inicial;
466
- $[60] = setActiveInputType;
467
- $[61] = t26;
468
+ $[26] = calendarBoxOpen;
469
+ $[27] = handleChangeActiveDescendant;
470
+ $[28] = handleChangeCalendarDisplayDate;
471
+ $[29] = handleSetCalendarBoxOpen;
472
+ $[30] = openCalendarOnFocus;
473
+ $[31] = props;
474
+ $[32] = readOnly;
475
+ $[33] = selectedDate.final;
476
+ $[34] = selectedDate.inicial;
477
+ $[35] = t26;
468
478
  } else {
469
- t26 = $[61];
479
+ t26 = $[35];
470
480
  }
471
481
  const handleOnFocusMaskInput = t26;
472
- let getDayState;
473
- let handleOnKeyDownMaskInput;
474
- let handleSelectDay;
475
- if ($[62] !== activeDescendant || $[63] !== calendarBoxOpen || $[64] !== finalInputName || $[65] !== handleChangeUpdateDateState || $[66] !== hasBounds || $[67] !== initialInputName || $[68] !== isDateTime || $[69] !== maxDate || $[70] !== minDate || $[71] !== props || $[72] !== selectedDate) {
476
- handleOnKeyDownMaskInput = (event_1, inputType_2) => {
477
- props?.onKeyDown?.(event_1);
478
- if (calendarBoxOpen && event_1.key && !event_1.shiftKey && !event_1.altKey && event_1.key === Keys.enter) {
479
- event_1.preventDefault();
480
- handleSelectDay(hooks(_.toString(activeDescendant), TOKEN_ISO_FORMAT), inputType_2);
481
- }
482
- };
483
- let t272;
484
- if ($[76] !== hasBounds || $[77] !== maxDate || $[78] !== minDate || $[79] !== selectedDate) {
485
- t272 = (day) => {
486
- const {
487
- inicial: inicial_6,
488
- final: final_6
489
- } = selectedDate;
490
- return {
491
- isSelected: Boolean(inicial_6 && day.isSame(inicial_6, "day") || final_6 && day.isSame(final_6, "day")),
492
- isInRange: Boolean(inicial_6 && final_6 && day.isAfter(inicial_6, "day") && day.isBefore(final_6, "day")),
493
- ...hasBounds && {
494
- isDisabled: isDayOutOfBounds(day, minDate, maxDate)
495
- }
496
- };
497
- };
498
- $[76] = hasBounds;
499
- $[77] = maxDate;
500
- $[78] = minDate;
501
- $[79] = selectedDate;
502
- $[80] = t272;
503
- } else {
504
- t272 = $[80];
482
+ const handleOnKeyDownMaskInput = (event_1, inputType_5) => {
483
+ props?.onKeyDown?.(event_1);
484
+ if (calendarBoxOpen && event_1.key && !event_1.shiftKey && !event_1.altKey && event_1.key === Keys.enter) {
485
+ event_1.preventDefault();
486
+ handleSelectDay(hooks(_.toString(activeDescendant), TOKEN_ISO_FORMAT), inputType_5);
505
487
  }
506
- getDayState = t272;
507
- let t282;
508
- if ($[81] !== finalInputName || $[82] !== initialInputName) {
509
- t282 = () => {
510
- const focusedInputId = document.activeElement?.id;
511
- if (focusedInputId === initialInputName) {
512
- return "initial";
513
- }
514
- if (focusedInputId === finalInputName) {
515
- return "final";
516
- }
517
- };
518
- $[81] = finalInputName;
519
- $[82] = initialInputName;
520
- $[83] = t282;
521
- } else {
522
- t282 = $[83];
523
- }
524
- const resolveInputTypeFromFocus = t282;
525
- handleSelectDay = (daySelected, targetInputType) => {
526
- const inputType_3 = targetInputType ?? resolveInputTypeFromFocus();
527
- if (_.isUndefined(inputType_3)) {
528
- return;
488
+ };
489
+ const getDayState = (day) => {
490
+ const {
491
+ inicial: inicial_7,
492
+ final: final_7
493
+ } = selectedDate;
494
+ return {
495
+ isSelected: Boolean(inicial_7 && day.isSame(inicial_7, "day") || final_7 && day.isSame(final_7, "day")),
496
+ isInRange: Boolean(inicial_7 && final_7 && day.isAfter(inicial_7, "day") && day.isBefore(final_7, "day")),
497
+ ...hasBounds && {
498
+ isDisabled: isDayOutOfBounds(day, minDate, maxDate)
529
499
  }
530
- const current = inputType_3 === "initial" ? selectedDate.inicial : selectedDate.final;
531
- const dayWithTime = isDateTime && current ? daySelected.clone().hour(current.hour()).minute(current.minute()) : daySelected;
532
- handleChangeUpdateDateState({
533
- date: clampDateToBounds(dayWithTime, minDate, maxDate),
534
- inputType: inputType_3
535
- });
536
500
  };
537
- $[62] = activeDescendant;
538
- $[63] = calendarBoxOpen;
539
- $[64] = finalInputName;
540
- $[65] = handleChangeUpdateDateState;
541
- $[66] = hasBounds;
542
- $[67] = initialInputName;
543
- $[68] = isDateTime;
544
- $[69] = maxDate;
545
- $[70] = minDate;
546
- $[71] = props;
547
- $[72] = selectedDate;
548
- $[73] = getDayState;
549
- $[74] = handleOnKeyDownMaskInput;
550
- $[75] = handleSelectDay;
551
- } else {
552
- getDayState = $[73];
553
- handleOnKeyDownMaskInput = $[74];
554
- handleSelectDay = $[75];
555
- }
556
- const activeSelectedDate = activeInputType === "initial" ? selectedDate.inicial : selectedDate.final;
501
+ };
557
502
  let t27;
558
- if ($[84] !== activeInputType || $[85] !== activeSelectedDate || $[86] !== handleChangeUpdateDateState) {
559
- t27 = (hour, minute) => {
560
- if (!activeSelectedDate) {
561
- return;
503
+ if ($[36] !== finalInputName || $[37] !== initialInputName) {
504
+ t27 = () => {
505
+ const focusedInputId = document.activeElement?.id;
506
+ if (focusedInputId === initialInputName) {
507
+ return "initial";
562
508
  }
563
- handleChangeUpdateDateState({
564
- date: activeSelectedDate.clone().hour(hour).minute(minute).second(0),
565
- inputType: activeInputType,
566
- typing: true
567
- });
568
- };
569
- $[84] = activeInputType;
570
- $[85] = activeSelectedDate;
571
- $[86] = handleChangeUpdateDateState;
572
- $[87] = t27;
573
- } else {
574
- t27 = $[87];
575
- }
576
- const handleSelectTime = t27;
577
- let t28;
578
- if ($[88] !== finalName || $[89] !== initialName || $[90] !== props.value || $[91] !== ptbrFormat || $[92] !== setFinalMaskValue || $[93] !== setInitialMaskValue || $[94] !== setSelectedDate || $[95] !== variant) {
579
- t28 = () => {
580
- if (props?.value) {
581
- const objectValue_0 = props.value;
582
- const initialDate_2 = parseDateValue(objectValue_0[initialName], variant);
583
- const finalDate_2 = parseDateValue(objectValue_0[finalName], variant);
584
- setSelectedDate(() => ({
585
- inicial: initialDate_2.isValid() ? initialDate_2 : null,
586
- final: finalDate_2.isValid() ? finalDate_2 : null
587
- }));
588
- setInitialMaskValue(initialDate_2.format(ptbrFormat));
589
- setFinalMaskValue(finalDate_2.format(ptbrFormat));
509
+ if (focusedInputId === finalInputName) {
510
+ return "final";
590
511
  }
591
512
  };
592
- $[88] = finalName;
593
- $[89] = initialName;
594
- $[90] = props.value;
595
- $[91] = ptbrFormat;
596
- $[92] = setFinalMaskValue;
597
- $[93] = setInitialMaskValue;
598
- $[94] = setSelectedDate;
599
- $[95] = variant;
600
- $[96] = t28;
601
- } else {
602
- t28 = $[96];
603
- }
604
- const t29 = props?.value;
605
- let t30;
606
- if ($[97] !== t29) {
607
- t30 = [t29];
608
- $[97] = t29;
609
- $[98] = t30;
513
+ $[36] = finalInputName;
514
+ $[37] = initialInputName;
515
+ $[38] = t27;
610
516
  } else {
611
- t30 = $[98];
517
+ t27 = $[38];
612
518
  }
613
- React.useEffect(t28, t30);
614
- const t31 = Boolean(readOnly);
615
- const t32 = Boolean(disabled);
616
- const t33 = verifyPeriodSelectedIsValid();
617
- let t34;
618
- if ($[99] !== calendarState || $[100] !== finalInputName || $[101] !== handleChangeUpdateDateState || $[102] !== handleChangeUpdateDateStateWithPredefinedPeriod || $[103] !== handleOnClickClearSelectedPeriod || $[104] !== hasValidationErrors || $[105] !== initialInputName || $[106] !== initialInputRef || $[107] !== maxDate || $[108] !== minDate || $[109] !== openCalendarOnFocus || $[110] !== selectedDate || $[111] !== showCalendarButton || $[112] !== showClearDateButton || $[113] !== showPredefinedPeriodsButton || $[114] !== skeletonize || $[115] !== t31 || $[116] !== t32 || $[117] !== t33 || $[118] !== undigitable) {
619
- t34 = {
519
+ const resolveInputTypeFromFocus = t27;
520
+ const handleSelectDay = (daySelected, targetInputType) => {
521
+ const inputType_6 = targetInputType ?? resolveInputTypeFromFocus();
522
+ if (_.isUndefined(inputType_6)) {
523
+ return;
524
+ }
525
+ const {
526
+ hour: hour_0,
527
+ minute: minute_0,
528
+ isComplete
529
+ } = timeSelectionOf(inputType_6);
530
+ if (isDateTime && !isComplete) {
531
+ handleUpdateDraftState({
532
+ date: daySelected.clone().hour(hour_0 ?? 0).minute(minute_0 ?? 0),
533
+ inputType: inputType_6,
534
+ hour: hour_0,
535
+ minute: minute_0
536
+ });
537
+ return;
538
+ }
539
+ const current = inputType_6 === "initial" ? selectedDate.inicial : selectedDate.final;
540
+ const dayWithTime = isDateTime && current ? daySelected.clone().hour(current.hour()).minute(current.minute()) : daySelected;
541
+ handleChangeUpdateDateState({
542
+ date: clampDateToBounds(dayWithTime, minDate, maxDate),
543
+ inputType: inputType_6
544
+ });
545
+ };
546
+ const activeSelectedDate = activeInputType === "initial" ? selectedDate.inicial : selectedDate.final;
547
+ const handleSelectHour = (hour_1) => {
548
+ if (!activeSelectedDate) {
549
+ return;
550
+ }
551
+ const {
552
+ minute: minute_1
553
+ } = activeTimeSelection;
554
+ if (_.isNull(minute_1)) {
555
+ handleUpdateDraftState({
556
+ date: activeSelectedDate.clone().hour(hour_1),
557
+ inputType: activeInputType,
558
+ hour: hour_1,
559
+ minute: null
560
+ });
561
+ return;
562
+ }
563
+ handleChangeUpdateDateState({
564
+ date: activeSelectedDate.clone().hour(hour_1).minute(minute_1).second(0),
565
+ inputType: activeInputType,
566
+ typing: true
567
+ });
568
+ };
569
+ const handleSelectMinute = (minute_2) => {
570
+ if (!activeSelectedDate) {
571
+ return;
572
+ }
573
+ const {
574
+ hour: hour_2
575
+ } = activeTimeSelection;
576
+ handleChangeUpdateDateState({
577
+ date: _.isNull(hour_2) ? resolveAssumedTime({
578
+ date: activeSelectedDate,
579
+ hour: null,
580
+ minute: minute_2,
581
+ min: minDate,
582
+ max: maxDate
583
+ }) : activeSelectedDate.clone().hour(hour_2).minute(minute_2).second(0),
584
+ inputType: activeInputType,
585
+ typing: true
586
+ });
587
+ };
588
+ React.useEffect(() => {
589
+ if (props?.value) {
590
+ const initialDate_2 = parseDateValue(receivedInitialValue, variant);
591
+ const finalDate_2 = parseDateValue(receivedFinalValue, variant);
592
+ setSelectedDate(() => ({
593
+ inicial: initialDate_2.isValid() ? initialDate_2 : null,
594
+ final: finalDate_2.isValid() ? finalDate_2 : null
595
+ }));
596
+ setInitialMaskValue(initialDate_2.format(ptbrFormat));
597
+ setFinalMaskValue(finalDate_2.format(ptbrFormat));
598
+ }
599
+ }, [receivedInitialValue, receivedFinalValue]);
600
+ const t28 = Boolean(readOnly);
601
+ const t29 = Boolean(disabled);
602
+ const t30 = handleChangeUpdateDateState;
603
+ const t31 = verifyPeriodSelectedIsValid();
604
+ let t32;
605
+ if ($[39] !== calendarState || $[40] !== finalInputName || $[41] !== finalInputRef || $[42] !== handleChangeUpdateDateStateWithPredefinedPeriod || $[43] !== handleOnClickClearSelectedPeriod || $[44] !== hasValidationErrors || $[45] !== initialInputName || $[46] !== initialInputRef || $[47] !== maxDate || $[48] !== minDate || $[49] !== openCalendarOnFocus || $[50] !== selectedDate || $[51] !== showCalendarButton || $[52] !== showClearDateButton || $[53] !== showPredefinedPeriodsButton || $[54] !== skeletonize || $[55] !== t28 || $[56] !== t29 || $[57] !== t30 || $[58] !== t31 || $[59] !== undigitable) {
606
+ t32 = {
620
607
  ...calendarState,
621
- isReadOnly: t31,
622
- isDisabled: t32,
608
+ isReadOnly: t28,
609
+ isDisabled: t29,
623
610
  undigitable,
624
611
  skeletonize,
625
612
  selectedDate,
@@ -634,249 +621,253 @@ const InputBase = React.forwardRef((props, __) => {
634
621
  openCalendarOnFocus,
635
622
  showPredefinedPeriodsButton,
636
623
  showClearDateButton,
637
- handleChangeUpdateDateState,
624
+ handleChangeUpdateDateState: t30,
638
625
  handleOnClickClearSelectedPeriod,
639
626
  handleChangeUpdateDateStateWithPredefinedPeriod,
640
- hasValidPeriodSelected: t33
627
+ hasValidPeriodSelected: t31
641
628
  };
642
- $[99] = calendarState;
643
- $[100] = finalInputName;
644
- $[101] = handleChangeUpdateDateState;
645
- $[102] = handleChangeUpdateDateStateWithPredefinedPeriod;
646
- $[103] = handleOnClickClearSelectedPeriod;
647
- $[104] = hasValidationErrors;
648
- $[105] = initialInputName;
649
- $[106] = initialInputRef;
650
- $[107] = maxDate;
651
- $[108] = minDate;
652
- $[109] = openCalendarOnFocus;
653
- $[110] = selectedDate;
654
- $[111] = showCalendarButton;
655
- $[112] = showClearDateButton;
656
- $[113] = showPredefinedPeriodsButton;
657
- $[114] = skeletonize;
658
- $[115] = t31;
659
- $[116] = t32;
660
- $[117] = t33;
661
- $[118] = undigitable;
662
- $[119] = t34;
629
+ $[39] = calendarState;
630
+ $[40] = finalInputName;
631
+ $[41] = finalInputRef;
632
+ $[42] = handleChangeUpdateDateStateWithPredefinedPeriod;
633
+ $[43] = handleOnClickClearSelectedPeriod;
634
+ $[44] = hasValidationErrors;
635
+ $[45] = initialInputName;
636
+ $[46] = initialInputRef;
637
+ $[47] = maxDate;
638
+ $[48] = minDate;
639
+ $[49] = openCalendarOnFocus;
640
+ $[50] = selectedDate;
641
+ $[51] = showCalendarButton;
642
+ $[52] = showClearDateButton;
643
+ $[53] = showPredefinedPeriodsButton;
644
+ $[54] = skeletonize;
645
+ $[55] = t28;
646
+ $[56] = t29;
647
+ $[57] = t30;
648
+ $[58] = t31;
649
+ $[59] = undigitable;
650
+ $[60] = t32;
651
+ } else {
652
+ t32 = $[60];
653
+ }
654
+ const contextValues = t32;
655
+ let t33;
656
+ if ($[61] !== customClassLabel || $[62] !== disabled || $[63] !== hasHintMessages || $[64] !== hasLabel || $[65] !== hintPosition || $[66] !== initialInputName || $[67] !== label || $[68] !== labelUppercase || $[69] !== popoverAlign || $[70] !== props.hint || $[71] !== props.required || $[72] !== readOnly || $[73] !== skeletonize || $[74] !== themePopover) {
657
+ t33 = hasLabel && /* @__PURE__ */ jsx(Label, { "data-testid": "test-date-period-field-label", label, inputId: initialInputName, hint: props?.hint, isDisabled: disabled, isReadOnly: readOnly, skeletonize, required: props?.required, hintPosition, themePopover, popoverAlign, labelUppercase, hasHintMessages, customClassLabel });
658
+ $[61] = customClassLabel;
659
+ $[62] = disabled;
660
+ $[63] = hasHintMessages;
661
+ $[64] = hasLabel;
662
+ $[65] = hintPosition;
663
+ $[66] = initialInputName;
664
+ $[67] = label;
665
+ $[68] = labelUppercase;
666
+ $[69] = popoverAlign;
667
+ $[70] = props.hint;
668
+ $[71] = props.required;
669
+ $[72] = readOnly;
670
+ $[73] = skeletonize;
671
+ $[74] = themePopover;
672
+ $[75] = t33;
673
+ } else {
674
+ t33 = $[75];
675
+ }
676
+ const t34 = _.omit(rest, ["initialRef", "finalRef"]);
677
+ const t35 = props?.initialRef;
678
+ let t36;
679
+ if ($[76] !== initialInputRef || $[77] !== t35) {
680
+ t36 = mergeRefs(initialInputRef, t35);
681
+ $[76] = initialInputRef;
682
+ $[77] = t35;
683
+ $[78] = t36;
663
684
  } else {
664
- t34 = $[119];
685
+ t36 = $[78];
665
686
  }
666
- const contextValues = t34;
667
- let t35;
668
- if ($[120] !== customClassLabel || $[121] !== disabled || $[122] !== hasHintMessages || $[123] !== hasLabel || $[124] !== hintPosition || $[125] !== initialInputName || $[126] !== label || $[127] !== labelUppercase || $[128] !== popoverAlign || $[129] !== props.hint || $[130] !== props.required || $[131] !== readOnly || $[132] !== skeletonize || $[133] !== themePopover) {
669
- t35 = hasLabel && /* @__PURE__ */ jsx(Label, { "data-testid": "test-date-period-field-label", label, inputId: initialInputName, hint: props?.hint, isDisabled: disabled, isReadOnly: readOnly, skeletonize, required: props?.required, hintPosition, themePopover, popoverAlign, labelUppercase, hasHintMessages, customClassLabel });
670
- $[120] = customClassLabel;
671
- $[121] = disabled;
672
- $[122] = hasHintMessages;
673
- $[123] = hasLabel;
674
- $[124] = hintPosition;
675
- $[125] = initialInputName;
676
- $[126] = label;
677
- $[127] = labelUppercase;
678
- $[128] = popoverAlign;
679
- $[129] = props.hint;
680
- $[130] = props.required;
681
- $[131] = readOnly;
682
- $[132] = skeletonize;
683
- $[133] = themePopover;
684
- $[134] = t35;
687
+ let t37;
688
+ if ($[79] !== handleOnBlurMaskInput) {
689
+ t37 = (event_2) => handleOnBlurMaskInput(event_2, "initial");
690
+ $[79] = handleOnBlurMaskInput;
691
+ $[80] = t37;
685
692
  } else {
686
- t35 = $[134];
693
+ t37 = $[80];
687
694
  }
688
- const t36 = _.omit(rest, ["initialRef", "finalRef"]);
689
- const t37 = props?.initialRef;
690
695
  let t38;
691
- if ($[135] !== initialInputRef || $[136] !== t37) {
692
- t38 = mergeRefs(initialInputRef, t37);
693
- $[135] = initialInputRef;
694
- $[136] = t37;
695
- $[137] = t38;
696
+ if ($[81] !== handleOnFocusMaskInput) {
697
+ t38 = (event_3) => handleOnFocusMaskInput(event_3, "initial");
698
+ $[81] = handleOnFocusMaskInput;
699
+ $[82] = t38;
696
700
  } else {
697
- t38 = $[137];
701
+ t38 = $[82];
698
702
  }
699
703
  let t39;
700
- if ($[138] !== handleOnBlurMaskInput) {
701
- t39 = (event_2) => handleOnBlurMaskInput(event_2, "initial");
702
- $[138] = handleOnBlurMaskInput;
703
- $[139] = t39;
704
+ if ($[83] !== handleOnKeyDownMaskInput) {
705
+ t39 = (event_4) => handleOnKeyDownMaskInput(event_4, "initial");
706
+ $[83] = handleOnKeyDownMaskInput;
707
+ $[84] = t39;
704
708
  } else {
705
- t39 = $[139];
709
+ t39 = $[84];
706
710
  }
707
711
  let t40;
708
- if ($[140] !== handleOnFocusMaskInput) {
709
- t40 = (event_3) => handleOnFocusMaskInput(event_3, "initial");
710
- $[140] = handleOnFocusMaskInput;
711
- $[141] = t40;
712
+ if ($[85] === Symbol.for("react.memo_cache_sentinel")) {
713
+ t40 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
714
+ $[85] = t40;
712
715
  } else {
713
- t40 = $[141];
716
+ t40 = $[85];
714
717
  }
715
718
  let t41;
716
- if ($[142] !== handleOnKeyDownMaskInput) {
717
- t41 = (event_4) => handleOnKeyDownMaskInput(event_4, "initial");
718
- $[142] = handleOnKeyDownMaskInput;
719
- $[143] = t41;
719
+ if ($[86] !== disabled || $[87] !== readOnly) {
720
+ t41 = /* @__PURE__ */ jsx("span", { className: "separator", "data-state-disabled": disabled, "data-state-read-only": readOnly, onMouseDown: _temp2, children: t40 });
721
+ $[86] = disabled;
722
+ $[87] = readOnly;
723
+ $[88] = t41;
720
724
  } else {
721
- t41 = $[143];
725
+ t41 = $[88];
722
726
  }
723
- let t42;
724
- if ($[144] === Symbol.for("react.memo_cache_sentinel")) {
725
- t42 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
726
- $[144] = t42;
727
+ const t42 = inputs2_date_base_index;
728
+ const t43 = _.omit(rest, ["initialRef", "finalRef"]);
729
+ const t44 = props?.finalRef;
730
+ let t45;
731
+ if ($[89] !== finalInputRef || $[90] !== t44) {
732
+ t45 = mergeRefs(finalInputRef, t44);
733
+ $[89] = finalInputRef;
734
+ $[90] = t44;
735
+ $[91] = t45;
727
736
  } else {
728
- t42 = $[144];
737
+ t45 = $[91];
729
738
  }
730
- let t43;
731
- if ($[145] !== disabled || $[146] !== readOnly) {
732
- t43 = /* @__PURE__ */ jsx("span", { className: "separator", "data-state-disabled": disabled, "data-state-read-only": readOnly, onMouseDown: _temp2, children: t42 });
733
- $[145] = disabled;
734
- $[146] = readOnly;
735
- $[147] = t43;
739
+ const t46 = !readOnly && !skeletonize ? 0 : -1;
740
+ let t47;
741
+ if ($[92] !== handleOnBlurMaskInput) {
742
+ t47 = (event_6) => handleOnBlurMaskInput(event_6, "final");
743
+ $[92] = handleOnBlurMaskInput;
744
+ $[93] = t47;
736
745
  } else {
737
- t43 = $[147];
746
+ t47 = $[93];
738
747
  }
739
- const t44 = inputs2_date_base_index;
740
- const t45 = _.omit(rest, ["initialRef", "finalRef"]);
741
- const t46 = props?.finalRef;
742
- let t47;
743
- if ($[148] !== t46) {
744
- t47 = mergeRefs(finalInputRef, t46);
745
- $[148] = t46;
746
- $[149] = t47;
748
+ let t48;
749
+ if ($[94] !== handleOnFocusMaskInput) {
750
+ t48 = (event_7) => handleOnFocusMaskInput(event_7, "final");
751
+ $[94] = handleOnFocusMaskInput;
752
+ $[95] = t48;
747
753
  } else {
748
- t47 = $[149];
754
+ t48 = $[95];
749
755
  }
750
- const t48 = !readOnly && !skeletonize ? 0 : -1;
751
756
  let t49;
752
- if ($[150] !== handleOnBlurMaskInput) {
753
- t49 = (event_6) => handleOnBlurMaskInput(event_6, "final");
754
- $[150] = handleOnBlurMaskInput;
755
- $[151] = t49;
757
+ if ($[96] !== handleOnKeyDownMaskInput) {
758
+ t49 = (event_8) => handleOnKeyDownMaskInput(event_8, "final");
759
+ $[96] = handleOnKeyDownMaskInput;
760
+ $[97] = t49;
756
761
  } else {
757
- t49 = $[151];
762
+ t49 = $[97];
758
763
  }
759
764
  let t50;
760
- if ($[152] !== handleOnFocusMaskInput) {
761
- t50 = (event_7) => handleOnFocusMaskInput(event_7, "final");
762
- $[152] = handleOnFocusMaskInput;
763
- $[153] = t50;
765
+ if ($[98] !== activeDescendant || $[99] !== calendarBoxOpen || $[100] !== customClass || $[101] !== disabled || $[102] !== finalInputName || $[103] !== finalMaskedValue || $[104] !== handleFinalKeyDownCapture || $[105] !== handleOnBeforeInput || $[106] !== handleOnPaste || $[107] !== hasValidationErrors || $[108] !== inputPlaceholder || $[109] !== readOnly || $[110] !== skeletonize || $[111] !== t42.Input || $[112] !== t43 || $[113] !== t45 || $[114] !== t46 || $[115] !== t47 || $[116] !== t48 || $[117] !== t49 || $[118] !== textAlign || $[119] !== undigitable) {
766
+ t50 = /* @__PURE__ */ jsx(t42.Input, { ...t43, ref: t45, id: finalInputName, name: finalInputName, value: finalMaskedValue, readOnly, disabled, customClass, tabIndex: t46, placeholder: inputPlaceholder, "aria-autocomplete": "list", "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": finalInputName, "aria-labelledby": finalInputName, "data-testid": "test-date-period-field-final-input", "data-state-is-period-input": true, "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onPaste: handleOnPaste, onBeforeInput: handleOnBeforeInput, onBlur: t47, onFocus: t48, onKeyDown: t49, onKeyDownCapture: handleFinalKeyDownCapture });
767
+ $[98] = activeDescendant;
768
+ $[99] = calendarBoxOpen;
769
+ $[100] = customClass;
770
+ $[101] = disabled;
771
+ $[102] = finalInputName;
772
+ $[103] = finalMaskedValue;
773
+ $[104] = handleFinalKeyDownCapture;
774
+ $[105] = handleOnBeforeInput;
775
+ $[106] = handleOnPaste;
776
+ $[107] = hasValidationErrors;
777
+ $[108] = inputPlaceholder;
778
+ $[109] = readOnly;
779
+ $[110] = skeletonize;
780
+ $[111] = t42.Input;
781
+ $[112] = t43;
782
+ $[113] = t45;
783
+ $[114] = t46;
784
+ $[115] = t47;
785
+ $[116] = t48;
786
+ $[117] = t49;
787
+ $[118] = textAlign;
788
+ $[119] = undigitable;
789
+ $[120] = t50;
764
790
  } else {
765
- t50 = $[153];
791
+ t50 = $[120];
766
792
  }
767
793
  let t51;
768
- if ($[154] !== handleOnKeyDownMaskInput) {
769
- t51 = (event_8) => handleOnKeyDownMaskInput(event_8, "final");
770
- $[154] = handleOnKeyDownMaskInput;
771
- $[155] = t51;
794
+ if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
795
+ t51 = /* @__PURE__ */ jsx(Triggers, {});
796
+ $[121] = t51;
772
797
  } else {
773
- t51 = $[155];
798
+ t51 = $[121];
774
799
  }
775
800
  let t52;
776
- if ($[156] !== activeDescendant || $[157] !== calendarBoxOpen || $[158] !== customClass || $[159] !== disabled || $[160] !== finalInputName || $[161] !== finalMaskedValue || $[162] !== handleFinalKeyDownCapture || $[163] !== handleOnBeforeInput || $[164] !== handleOnPaste || $[165] !== hasValidationErrors || $[166] !== inputPlaceholder || $[167] !== readOnly || $[168] !== skeletonize || $[169] !== t44.Input || $[170] !== t45 || $[171] !== t47 || $[172] !== t48 || $[173] !== t49 || $[174] !== t50 || $[175] !== t51 || $[176] !== textAlign || $[177] !== undigitable) {
777
- t52 = /* @__PURE__ */ jsx(t44.Input, { ...t45, ref: t47, id: finalInputName, name: finalInputName, value: finalMaskedValue, readOnly, disabled, customClass, tabIndex: t48, placeholder: inputPlaceholder, "aria-autocomplete": "list", "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": finalInputName, "aria-labelledby": finalInputName, "data-testid": "test-date-period-field-final-input", "data-state-is-period-input": true, "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onPaste: handleOnPaste, onBeforeInput: handleOnBeforeInput, onBlur: t49, onFocus: t50, onKeyDown: t51, onKeyDownCapture: handleFinalKeyDownCapture });
778
- $[156] = activeDescendant;
779
- $[157] = calendarBoxOpen;
780
- $[158] = customClass;
781
- $[159] = disabled;
782
- $[160] = finalInputName;
783
- $[161] = finalMaskedValue;
784
- $[162] = handleFinalKeyDownCapture;
785
- $[163] = handleOnBeforeInput;
786
- $[164] = handleOnPaste;
787
- $[165] = hasValidationErrors;
788
- $[166] = inputPlaceholder;
789
- $[167] = readOnly;
790
- $[168] = skeletonize;
791
- $[169] = t44.Input;
792
- $[170] = t45;
793
- $[171] = t47;
794
- $[172] = t48;
795
- $[173] = t49;
796
- $[174] = t50;
797
- $[175] = t51;
798
- $[176] = textAlign;
799
- $[177] = undigitable;
800
- $[178] = t52;
801
+ if ($[122] !== activeDescendant || $[123] !== activeSelectedDate || $[124] !== activeTimeSelection || $[125] !== calendarBoxOpen || $[126] !== calendarDisplayDate || $[127] !== calendarRef || $[128] !== dateContainerRef || $[129] !== getDayState || $[130] !== handleNextMonth || $[131] !== handlePreviousMonth || $[132] !== handleSelectDay || $[133] !== handleSelectHour || $[134] !== handleSelectMinute || $[135] !== initialInputName || $[136] !== isDateTime || $[137] !== maxDate || $[138] !== minDate) {
802
+ t52 = calendarBoxOpen && createPortal(/* @__PURE__ */ jsx(CalendarBox, { ref: calendarRef, testIdPrefix: "test-date-period-field", headerId: initialInputName, calendarBoxOpen, activeDescendant, calendarDisplayDate, containerRef: dateContainerRef, onNextMonth: handleNextMonth, onPreviousMonth: handlePreviousMonth, getDayState, onSelectDay: handleSelectDay, children: isDateTime && /* @__PURE__ */ jsx(TimeSelector, { value: activeSelectedDate, selectedHour: activeTimeSelection.hour, selectedMinute: activeTimeSelection.minute, onSelectHour: handleSelectHour, onSelectMinute: handleSelectMinute, min: minDate, max: maxDate, testIdPrefix: "test-date-period-field" }) }), document.body);
803
+ $[122] = activeDescendant;
804
+ $[123] = activeSelectedDate;
805
+ $[124] = activeTimeSelection;
806
+ $[125] = calendarBoxOpen;
807
+ $[126] = calendarDisplayDate;
808
+ $[127] = calendarRef;
809
+ $[128] = dateContainerRef;
810
+ $[129] = getDayState;
811
+ $[130] = handleNextMonth;
812
+ $[131] = handlePreviousMonth;
813
+ $[132] = handleSelectDay;
814
+ $[133] = handleSelectHour;
815
+ $[134] = handleSelectMinute;
816
+ $[135] = initialInputName;
817
+ $[136] = isDateTime;
818
+ $[137] = maxDate;
819
+ $[138] = minDate;
820
+ $[139] = t52;
801
821
  } else {
802
- t52 = $[178];
822
+ t52 = $[139];
803
823
  }
804
824
  let t53;
805
- if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
806
- t53 = /* @__PURE__ */ jsx(Triggers, {});
807
- $[179] = t53;
825
+ if ($[140] !== disabled || $[141] !== hasHintMessages || $[142] !== hintPosition || $[143] !== props.hint || $[144] !== skeletonize) {
826
+ t53 = hintPosition === "below" && /* @__PURE__ */ jsx(Hint, { customClass: "hint", description: props.hint, disabled, skeletonize, visible: hasHintMessages });
827
+ $[140] = disabled;
828
+ $[141] = hasHintMessages;
829
+ $[142] = hintPosition;
830
+ $[143] = props.hint;
831
+ $[144] = skeletonize;
832
+ $[145] = t53;
808
833
  } else {
809
- t53 = $[179];
834
+ t53 = $[145];
810
835
  }
811
836
  let t54;
812
- if ($[180] !== activeDescendant || $[181] !== activeSelectedDate || $[182] !== calendarBoxOpen || $[183] !== calendarDisplayDate || $[184] !== calendarRef || $[185] !== dateContainerRef || $[186] !== getDayState || $[187] !== handleNextMonth || $[188] !== handlePreviousMonth || $[189] !== handleSelectDay || $[190] !== handleSelectTime || $[191] !== initialInputName || $[192] !== isDateTime || $[193] !== maxDate || $[194] !== minDate) {
813
- t54 = calendarBoxOpen && createPortal(/* @__PURE__ */ jsx(CalendarBox, { ref: calendarRef, testIdPrefix: "test-date-period-field", headerId: initialInputName, calendarBoxOpen, activeDescendant, calendarDisplayDate, containerRef: dateContainerRef, onNextMonth: handleNextMonth, onPreviousMonth: handlePreviousMonth, getDayState, onSelectDay: handleSelectDay, children: isDateTime && /* @__PURE__ */ jsx(TimeSelector, { value: activeSelectedDate, onSelectTime: handleSelectTime, min: minDate, max: maxDate, testIdPrefix: "test-date-period-field" }) }), document.body);
814
- $[180] = activeDescendant;
815
- $[181] = activeSelectedDate;
816
- $[182] = calendarBoxOpen;
817
- $[183] = calendarDisplayDate;
818
- $[184] = calendarRef;
819
- $[185] = dateContainerRef;
820
- $[186] = getDayState;
821
- $[187] = handleNextMonth;
822
- $[188] = handlePreviousMonth;
823
- $[189] = handleSelectDay;
824
- $[190] = handleSelectTime;
825
- $[191] = initialInputName;
826
- $[192] = isDateTime;
827
- $[193] = maxDate;
828
- $[194] = minDate;
829
- $[195] = t54;
837
+ if ($[146] !== errors || $[147] !== hasValidationErrors || $[148] !== label || $[149] !== skeletonize) {
838
+ t54 = hasValidationErrors && /* @__PURE__ */ jsx("span", { "data-testid": "test-date-period-field-list-errors", className: "error", "data-state-skeletonize": skeletonize, "aria-describedby": String(label).concat("-errors"), children: errors?.map(_temp3) });
839
+ $[146] = errors;
840
+ $[147] = hasValidationErrors;
841
+ $[148] = label;
842
+ $[149] = skeletonize;
843
+ $[150] = t54;
830
844
  } else {
831
- t54 = $[195];
845
+ t54 = $[150];
832
846
  }
833
847
  let t55;
834
- if ($[196] !== disabled || $[197] !== hasHintMessages || $[198] !== hintPosition || $[199] !== props.hint || $[200] !== skeletonize) {
835
- t55 = hintPosition === "below" && /* @__PURE__ */ jsx(Hint, { customClass: "hint", description: props.hint, disabled, skeletonize, visible: hasHintMessages });
836
- $[196] = disabled;
837
- $[197] = hasHintMessages;
838
- $[198] = hintPosition;
839
- $[199] = props.hint;
840
- $[200] = skeletonize;
841
- $[201] = t55;
842
- } else {
843
- t55 = $[201];
844
- }
845
- let t56;
846
- if ($[202] !== errors || $[203] !== hasValidationErrors || $[204] !== label || $[205] !== skeletonize) {
847
- t56 = hasValidationErrors && /* @__PURE__ */ jsx("span", { "data-testid": "test-date-period-field-list-errors", className: "error", "data-state-skeletonize": skeletonize, "aria-describedby": String(label).concat("-errors"), children: errors?.map(_temp3) });
848
- $[202] = errors;
849
- $[203] = hasValidationErrors;
850
- $[204] = label;
851
- $[205] = skeletonize;
852
- $[206] = t56;
853
- } else {
854
- t56 = $[206];
855
- }
856
- let t57;
857
- if ($[207] !== tooltip || $[208] !== tooltipPosition || $[209] !== tooltipWidth) {
858
- t57 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
859
- $[207] = tooltip;
860
- $[208] = tooltipPosition;
861
- $[209] = tooltipWidth;
862
- $[210] = t57;
848
+ if ($[151] !== tooltip || $[152] !== tooltipPosition || $[153] !== tooltipWidth) {
849
+ t55 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
850
+ $[151] = tooltip;
851
+ $[152] = tooltipPosition;
852
+ $[153] = tooltipWidth;
853
+ $[154] = t55;
863
854
  } else {
864
- t57 = $[210];
855
+ t55 = $[154];
865
856
  }
866
857
  return /* @__PURE__ */ jsxs(React.Fragment, { children: [
867
858
  /* @__PURE__ */ jsx(DatePeriodFieldContext.Provider, { value: contextValues, children: /* @__PURE__ */ jsxs(Root, { ref: inputRootRef, "data-testid": "test-date-period-field-root", "data-state-error": hasValidationErrors, customClassWrapper, children: [
868
- t35,
859
+ t33,
869
860
  /* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, "data-testid": "test-date-period-field-container", onKeyDown: handleKeyDownNavigation, skeletonize, customClassInputContainer, children: [
870
- /* @__PURE__ */ jsx(Input, { ...t36, ref: t38, id: initialInputName, name: initialInputName, value: initialMaskedValue, disabled, readOnly, customClass, tabIndex: !readOnly && !skeletonize ? 0 : -1, placeholder: inputPlaceholder, "aria-autocomplete": "list", "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": initialInputName, "aria-labelledby": initialInputName, "data-testid": "test-date-period-field-initial-input", "data-state-is-period-input": true, "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onPaste: handleOnPaste, onBeforeInput: handleOnBeforeInput, onBlur: t39, onFocus: t40, onKeyDown: t41, onKeyDownCapture: handleInitialKeyDownCapture }),
871
- t43,
872
- t52,
873
- t53
861
+ /* @__PURE__ */ jsx(Input, { ...t34, ref: t36, id: initialInputName, name: initialInputName, value: initialMaskedValue, disabled, readOnly, customClass, tabIndex: !readOnly && !skeletonize ? 0 : -1, placeholder: inputPlaceholder, "aria-autocomplete": "list", "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": initialInputName, "aria-labelledby": initialInputName, "data-testid": "test-date-period-field-initial-input", "data-state-is-period-input": true, "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onPaste: handleOnPaste, onBeforeInput: handleOnBeforeInput, onBlur: t37, onFocus: t38, onKeyDown: t39, onKeyDownCapture: handleInitialKeyDownCapture }),
862
+ t41,
863
+ t50,
864
+ t51
874
865
  ] }),
875
- t54,
876
- t55,
877
- t56
866
+ t52,
867
+ t53,
868
+ t54
878
869
  ] }) }),
879
- t57
870
+ t55
880
871
  ] });
881
872
  });
882
873
  InputBase.displayName = "DatePeriodFieldInputBase";