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