linear-react-components-ui 2.1.0-beta.2 → 2.1.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/inputs2/date/datefield/base.js +263 -255
- package/lib/inputs2/date/datefield/base.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/base.js +398 -373
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
- package/lib/inputs2/date/helpers.d.ts +4 -0
- package/lib/inputs2/date/helpers.js +15 -0
- package/lib/inputs2/date/helpers.js.map +1 -1
- package/lib/inputs2/date/hooks/useDateMask.d.ts +2 -0
- package/lib/inputs2/date/hooks/useDateMask.js +93 -56
- package/lib/inputs2/date/hooks/useDateMask.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,7 +19,7 @@ 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(
|
|
22
|
+
const $ = compilerRuntimeExports.c(211);
|
|
23
23
|
const {
|
|
24
24
|
label,
|
|
25
25
|
errors,
|
|
@@ -46,6 +46,7 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
46
46
|
shouldCloseOnSelect,
|
|
47
47
|
min,
|
|
48
48
|
max,
|
|
49
|
+
onChange,
|
|
49
50
|
tooltip,
|
|
50
51
|
tooltipPosition,
|
|
51
52
|
tooltipWidth,
|
|
@@ -141,12 +142,14 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
141
142
|
setMaskValue: setInitialMaskValue,
|
|
142
143
|
unmaskedValue: initialUnmaskedValue,
|
|
143
144
|
handleOnPaste,
|
|
144
|
-
handleOnBeforeInput
|
|
145
|
+
handleOnBeforeInput,
|
|
146
|
+
handleOnKeyDownCapture: handleInitialKeyDownCapture
|
|
145
147
|
} = useDateMask({
|
|
146
148
|
inputRef: initialInputRef,
|
|
147
149
|
variant,
|
|
148
150
|
defaultValue: selectedDate.inicial?.format(ptbrFormat),
|
|
149
151
|
undigitable,
|
|
152
|
+
readOnly,
|
|
150
153
|
onCommit: (date) => handleChangeUpdateDateState({
|
|
151
154
|
date,
|
|
152
155
|
inputType: "initial",
|
|
@@ -158,12 +161,14 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
158
161
|
const {
|
|
159
162
|
maskedValue: finalMaskedValue,
|
|
160
163
|
setMaskValue: setFinalMaskValue,
|
|
161
|
-
unmaskedValue: finalUnmaskedValue
|
|
164
|
+
unmaskedValue: finalUnmaskedValue,
|
|
165
|
+
handleOnKeyDownCapture: handleFinalKeyDownCapture
|
|
162
166
|
} = useDateMask({
|
|
163
167
|
inputRef: finalInputRef,
|
|
164
168
|
variant,
|
|
165
169
|
defaultValue: selectedDate.final?.format(ptbrFormat),
|
|
166
170
|
undigitable,
|
|
171
|
+
readOnly,
|
|
167
172
|
onCommit: (date_0) => handleChangeUpdateDateState({
|
|
168
173
|
date: date_0,
|
|
169
174
|
inputType: "final",
|
|
@@ -199,10 +204,21 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
199
204
|
t23 = $[12];
|
|
200
205
|
}
|
|
201
206
|
const verifyPeriodSelectedIsValid = t23;
|
|
207
|
+
const emitPeriodChange = (inicial, final) => {
|
|
208
|
+
onChange?.({
|
|
209
|
+
target: {
|
|
210
|
+
name: props.name,
|
|
211
|
+
value: {
|
|
212
|
+
[initialName]: returnValueType === "default" ? inicial?.format(isoFormat) : inicial?.toISOString(),
|
|
213
|
+
[finalName]: returnValueType === "default" ? final?.format(isoFormat) : final?.toISOString()
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
};
|
|
202
218
|
let t24;
|
|
203
|
-
if ($[13] !== finalName || $[14] !== handleSetCalendarBoxOpen || $[15] !== initialName || $[16] !==
|
|
219
|
+
if ($[13] !== finalName || $[14] !== handleSetCalendarBoxOpen || $[15] !== initialName || $[16] !== onChange || $[17] !== props.name || $[18] !== setFinalMaskValue || $[19] !== setInitialMaskValue || $[20] !== setSelectedDate) {
|
|
204
220
|
t24 = () => {
|
|
205
|
-
|
|
221
|
+
onChange?.({
|
|
206
222
|
target: {
|
|
207
223
|
name: props.name,
|
|
208
224
|
value: {
|
|
@@ -219,13 +235,14 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
219
235
|
$[13] = finalName;
|
|
220
236
|
$[14] = handleSetCalendarBoxOpen;
|
|
221
237
|
$[15] = initialName;
|
|
222
|
-
$[16] =
|
|
223
|
-
$[17] =
|
|
224
|
-
$[18] =
|
|
225
|
-
$[19] =
|
|
226
|
-
$[20] =
|
|
238
|
+
$[16] = onChange;
|
|
239
|
+
$[17] = props.name;
|
|
240
|
+
$[18] = setFinalMaskValue;
|
|
241
|
+
$[19] = setInitialMaskValue;
|
|
242
|
+
$[20] = setSelectedDate;
|
|
243
|
+
$[21] = t24;
|
|
227
244
|
} else {
|
|
228
|
-
t24 = $[
|
|
245
|
+
t24 = $[21];
|
|
229
246
|
}
|
|
230
247
|
const handleOnClickClearSelectedPeriod = t24;
|
|
231
248
|
const handleChangeUpdateDateState = (params) => {
|
|
@@ -235,76 +252,73 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
235
252
|
typing
|
|
236
253
|
} = params;
|
|
237
254
|
const rawDate = date_1.clone();
|
|
238
|
-
const
|
|
239
|
-
|
|
255
|
+
const resolveDateRange = (initialDate, finalDate) => {
|
|
256
|
+
if (typing) {
|
|
257
|
+
return {
|
|
258
|
+
inicial: initialDate,
|
|
259
|
+
final: finalDate
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
const inicial_0 = initialDate?.isAfter(finalDate) ? finalDate : initialDate;
|
|
263
|
+
const final_0 = initialDate?.isAfter(finalDate) ? initialDate : finalDate;
|
|
264
|
+
return {
|
|
265
|
+
inicial: inicial_0,
|
|
266
|
+
final: final_0
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
bb209: switch (inputType) {
|
|
240
270
|
case "initial": {
|
|
241
271
|
setSelectedDate((prevSelectedDate_0) => {
|
|
242
272
|
const {
|
|
243
|
-
inicial:
|
|
244
|
-
final:
|
|
245
|
-
} =
|
|
273
|
+
inicial: inicial_3,
|
|
274
|
+
final: final_3
|
|
275
|
+
} = resolveDateRange(rawDate, prevSelectedDate_0.final);
|
|
246
276
|
const updatedState_0 = {
|
|
247
|
-
inicial:
|
|
248
|
-
final:
|
|
277
|
+
inicial: inicial_3,
|
|
278
|
+
final: final_3
|
|
249
279
|
};
|
|
250
280
|
return updatedState_0;
|
|
251
281
|
});
|
|
252
282
|
const {
|
|
253
|
-
inicial:
|
|
254
|
-
final:
|
|
255
|
-
} =
|
|
256
|
-
|
|
257
|
-
target: {
|
|
258
|
-
name: props.name,
|
|
259
|
-
value: {
|
|
260
|
-
[initialName]: returnValueType === "default" ? inicial_3?.format(isoFormat) : inicial_3?.toISOString(),
|
|
261
|
-
[finalName]: returnValueType === "default" ? final_3?.format(isoFormat) : final_3?.toISOString()
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
});
|
|
283
|
+
inicial: inicial_4,
|
|
284
|
+
final: final_4
|
|
285
|
+
} = resolveDateRange(rawDate, selectedDate.final);
|
|
286
|
+
emitPeriodChange(inicial_4, final_4);
|
|
265
287
|
requestAnimationFrame(() => {
|
|
266
288
|
if (!typing) {
|
|
267
289
|
finalInputRef.current?.focus?.();
|
|
268
290
|
}
|
|
269
291
|
});
|
|
270
|
-
break
|
|
292
|
+
break bb209;
|
|
271
293
|
}
|
|
272
294
|
case "final": {
|
|
273
295
|
setSelectedDate((prevSelectedDate) => {
|
|
274
296
|
const {
|
|
275
|
-
inicial:
|
|
276
|
-
final:
|
|
277
|
-
} =
|
|
297
|
+
inicial: inicial_1,
|
|
298
|
+
final: final_1
|
|
299
|
+
} = resolveDateRange(prevSelectedDate.inicial, rawDate);
|
|
278
300
|
const updatedState = {
|
|
279
|
-
inicial:
|
|
280
|
-
final:
|
|
301
|
+
inicial: inicial_1,
|
|
302
|
+
final: final_1
|
|
281
303
|
};
|
|
282
304
|
return updatedState;
|
|
283
305
|
});
|
|
284
306
|
const {
|
|
285
|
-
inicial:
|
|
286
|
-
final:
|
|
287
|
-
} =
|
|
288
|
-
|
|
289
|
-
target: {
|
|
290
|
-
name: props.name,
|
|
291
|
-
value: {
|
|
292
|
-
[initialName]: returnValueType === "default" ? inicial_1?.format(isoFormat) : inicial_1?.toISOString(),
|
|
293
|
-
[finalName]: returnValueType === "default" ? final_1?.format(isoFormat) : final_1?.toISOString()
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
307
|
+
inicial: inicial_2,
|
|
308
|
+
final: final_2
|
|
309
|
+
} = resolveDateRange(selectedDate.inicial, rawDate);
|
|
310
|
+
emitPeriodChange(inicial_2, final_2);
|
|
297
311
|
if (shouldCloseCalendarOnSelect) {
|
|
298
312
|
handleSetCalendarBoxOpen(false);
|
|
299
313
|
}
|
|
300
|
-
break
|
|
314
|
+
break bb209;
|
|
301
315
|
}
|
|
302
316
|
}
|
|
303
317
|
handleChangeActiveDescendant(rawDate.format(TOKEN_ISO_FORMAT));
|
|
304
318
|
handleChangeCalendarDisplayDate(rawDate.clone());
|
|
305
319
|
};
|
|
306
320
|
let t25;
|
|
307
|
-
if ($[
|
|
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) {
|
|
308
322
|
t25 = (period) => {
|
|
309
323
|
const localOnChange = (initialDate_0, finalDate_0) => {
|
|
310
324
|
const valueToUpdate = {
|
|
@@ -318,7 +332,7 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
318
332
|
};
|
|
319
333
|
return updatedState_1;
|
|
320
334
|
});
|
|
321
|
-
|
|
335
|
+
onChange?.({
|
|
322
336
|
target: {
|
|
323
337
|
name: props.name,
|
|
324
338
|
value: valueToUpdate
|
|
@@ -335,24 +349,25 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
335
349
|
handleSetCalendarBoxOpen(false);
|
|
336
350
|
}
|
|
337
351
|
};
|
|
338
|
-
$[
|
|
339
|
-
$[
|
|
340
|
-
$[
|
|
341
|
-
$[
|
|
342
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
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;
|
|
349
364
|
} else {
|
|
350
|
-
t25 = $[
|
|
365
|
+
t25 = $[33];
|
|
351
366
|
}
|
|
352
367
|
const handleChangeUpdateDateStateWithPredefinedPeriod = t25;
|
|
353
|
-
let
|
|
354
|
-
if ($[
|
|
355
|
-
|
|
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) => {
|
|
356
371
|
props?.onBlur?.(event);
|
|
357
372
|
if (inputType_0 === "initial") {
|
|
358
373
|
if (event.relatedTarget?.id !== finalInputName) {
|
|
@@ -384,30 +399,47 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
384
399
|
}
|
|
385
400
|
}
|
|
386
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
|
+
});
|
|
416
|
+
setInitialMaskValue(final_5.format(ptbrFormat));
|
|
417
|
+
setFinalMaskValue(inicial_5.format(ptbrFormat));
|
|
418
|
+
emitPeriodChange(final_5, inicial_5);
|
|
387
419
|
};
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
391
|
-
$[
|
|
392
|
-
$[
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
$[
|
|
396
|
-
$[
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
400
|
-
$[
|
|
401
|
-
$[
|
|
402
|
-
$[
|
|
403
|
-
$[
|
|
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;
|
|
404
437
|
} else {
|
|
405
|
-
|
|
438
|
+
handleOnBlurMaskInput = $[50];
|
|
406
439
|
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
t27 = (event_0, inputType_1) => {
|
|
440
|
+
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) => {
|
|
411
443
|
props?.onFocus?.(event_0);
|
|
412
444
|
if (!readOnly && !calendarBoxOpen && openCalendarOnFocus) {
|
|
413
445
|
handleSetCalendarBoxOpen(true);
|
|
@@ -422,25 +454,25 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
422
454
|
handleChangeCalendarDisplayDate(selectedDate.final ?? hooks());
|
|
423
455
|
}
|
|
424
456
|
};
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
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;
|
|
436
468
|
} else {
|
|
437
|
-
|
|
469
|
+
t26 = $[61];
|
|
438
470
|
}
|
|
439
|
-
const handleOnFocusMaskInput =
|
|
471
|
+
const handleOnFocusMaskInput = t26;
|
|
440
472
|
let getDayState;
|
|
441
473
|
let handleOnKeyDownMaskInput;
|
|
442
474
|
let handleSelectDay;
|
|
443
|
-
if ($[
|
|
475
|
+
if ($[62] !== activeDescendant || $[63] !== calendarBoxOpen || $[64] !== finalInputName || $[65] !== handleChangeUpdateDateState || $[66] !== hasBounds || $[67] !== initialInputName || $[68] !== isDateTime || $[69] !== maxDate || $[70] !== minDate || $[71] !== props || $[72] !== selectedDate) {
|
|
444
476
|
handleOnKeyDownMaskInput = (event_1, inputType_2) => {
|
|
445
477
|
props?.onKeyDown?.(event_1);
|
|
446
478
|
if (calendarBoxOpen && event_1.key && !event_1.shiftKey && !event_1.altKey && event_1.key === Keys.enter) {
|
|
@@ -448,33 +480,33 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
448
480
|
handleSelectDay(hooks(_.toString(activeDescendant), TOKEN_ISO_FORMAT), inputType_2);
|
|
449
481
|
}
|
|
450
482
|
};
|
|
451
|
-
let
|
|
452
|
-
if ($[
|
|
453
|
-
|
|
483
|
+
let t272;
|
|
484
|
+
if ($[76] !== hasBounds || $[77] !== maxDate || $[78] !== minDate || $[79] !== selectedDate) {
|
|
485
|
+
t272 = (day) => {
|
|
454
486
|
const {
|
|
455
|
-
inicial:
|
|
456
|
-
final:
|
|
487
|
+
inicial: inicial_6,
|
|
488
|
+
final: final_6
|
|
457
489
|
} = selectedDate;
|
|
458
490
|
return {
|
|
459
|
-
isSelected: Boolean(
|
|
460
|
-
isInRange: Boolean(
|
|
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")),
|
|
461
493
|
...hasBounds && {
|
|
462
494
|
isDisabled: isDayOutOfBounds(day, minDate, maxDate)
|
|
463
495
|
}
|
|
464
496
|
};
|
|
465
497
|
};
|
|
466
|
-
$[
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
498
|
+
$[76] = hasBounds;
|
|
499
|
+
$[77] = maxDate;
|
|
500
|
+
$[78] = minDate;
|
|
501
|
+
$[79] = selectedDate;
|
|
502
|
+
$[80] = t272;
|
|
471
503
|
} else {
|
|
472
|
-
|
|
504
|
+
t272 = $[80];
|
|
473
505
|
}
|
|
474
|
-
getDayState =
|
|
475
|
-
let
|
|
476
|
-
if ($[
|
|
477
|
-
|
|
506
|
+
getDayState = t272;
|
|
507
|
+
let t282;
|
|
508
|
+
if ($[81] !== finalInputName || $[82] !== initialInputName) {
|
|
509
|
+
t282 = () => {
|
|
478
510
|
const focusedInputId = document.activeElement?.id;
|
|
479
511
|
if (focusedInputId === initialInputName) {
|
|
480
512
|
return "initial";
|
|
@@ -483,13 +515,13 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
483
515
|
return "final";
|
|
484
516
|
}
|
|
485
517
|
};
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
518
|
+
$[81] = finalInputName;
|
|
519
|
+
$[82] = initialInputName;
|
|
520
|
+
$[83] = t282;
|
|
489
521
|
} else {
|
|
490
|
-
|
|
522
|
+
t282 = $[83];
|
|
491
523
|
}
|
|
492
|
-
const resolveInputTypeFromFocus =
|
|
524
|
+
const resolveInputTypeFromFocus = t282;
|
|
493
525
|
handleSelectDay = (daySelected, targetInputType) => {
|
|
494
526
|
const inputType_3 = targetInputType ?? resolveInputTypeFromFocus();
|
|
495
527
|
if (_.isUndefined(inputType_3)) {
|
|
@@ -502,29 +534,29 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
502
534
|
inputType: inputType_3
|
|
503
535
|
});
|
|
504
536
|
};
|
|
505
|
-
$[
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
516
|
-
$[
|
|
517
|
-
$[
|
|
518
|
-
$[
|
|
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;
|
|
519
551
|
} else {
|
|
520
|
-
getDayState = $[
|
|
521
|
-
handleOnKeyDownMaskInput = $[
|
|
522
|
-
handleSelectDay = $[
|
|
552
|
+
getDayState = $[73];
|
|
553
|
+
handleOnKeyDownMaskInput = $[74];
|
|
554
|
+
handleSelectDay = $[75];
|
|
523
555
|
}
|
|
524
556
|
const activeSelectedDate = activeInputType === "initial" ? selectedDate.inicial : selectedDate.final;
|
|
525
|
-
let
|
|
526
|
-
if ($[
|
|
527
|
-
|
|
557
|
+
let t27;
|
|
558
|
+
if ($[84] !== activeInputType || $[85] !== activeSelectedDate || $[86] !== handleChangeUpdateDateState) {
|
|
559
|
+
t27 = (hour, minute) => {
|
|
528
560
|
if (!activeSelectedDate) {
|
|
529
561
|
return;
|
|
530
562
|
}
|
|
@@ -534,17 +566,17 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
534
566
|
typing: true
|
|
535
567
|
});
|
|
536
568
|
};
|
|
537
|
-
$[
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
569
|
+
$[84] = activeInputType;
|
|
570
|
+
$[85] = activeSelectedDate;
|
|
571
|
+
$[86] = handleChangeUpdateDateState;
|
|
572
|
+
$[87] = t27;
|
|
541
573
|
} else {
|
|
542
|
-
|
|
574
|
+
t27 = $[87];
|
|
543
575
|
}
|
|
544
|
-
const handleSelectTime =
|
|
545
|
-
let
|
|
546
|
-
if ($[
|
|
547
|
-
|
|
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 = () => {
|
|
548
580
|
if (props?.value) {
|
|
549
581
|
const objectValue_0 = props.value;
|
|
550
582
|
const initialDate_2 = parseDateValue(objectValue_0[initialName], variant);
|
|
@@ -557,37 +589,37 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
557
589
|
setFinalMaskValue(finalDate_2.format(ptbrFormat));
|
|
558
590
|
}
|
|
559
591
|
};
|
|
560
|
-
$[
|
|
561
|
-
$[
|
|
562
|
-
$[
|
|
563
|
-
$[
|
|
564
|
-
$[
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
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;
|
|
569
601
|
} else {
|
|
570
|
-
|
|
602
|
+
t28 = $[96];
|
|
571
603
|
}
|
|
572
|
-
const
|
|
573
|
-
let
|
|
574
|
-
if ($[
|
|
575
|
-
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
604
|
+
const t29 = props?.value;
|
|
605
|
+
let t30;
|
|
606
|
+
if ($[97] !== t29) {
|
|
607
|
+
t30 = [t29];
|
|
608
|
+
$[97] = t29;
|
|
609
|
+
$[98] = t30;
|
|
578
610
|
} else {
|
|
579
|
-
|
|
611
|
+
t30 = $[98];
|
|
580
612
|
}
|
|
581
|
-
React.useEffect(
|
|
582
|
-
const
|
|
583
|
-
const
|
|
584
|
-
const
|
|
585
|
-
let
|
|
586
|
-
if ($[
|
|
587
|
-
|
|
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 = {
|
|
588
620
|
...calendarState,
|
|
589
|
-
isReadOnly:
|
|
590
|
-
isDisabled:
|
|
621
|
+
isReadOnly: t31,
|
|
622
|
+
isDisabled: t32,
|
|
591
623
|
undigitable,
|
|
592
624
|
skeletonize,
|
|
593
625
|
selectedDate,
|
|
@@ -605,245 +637,246 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
605
637
|
handleChangeUpdateDateState,
|
|
606
638
|
handleOnClickClearSelectedPeriod,
|
|
607
639
|
handleChangeUpdateDateStateWithPredefinedPeriod,
|
|
608
|
-
hasValidPeriodSelected:
|
|
640
|
+
hasValidPeriodSelected: t33
|
|
609
641
|
};
|
|
610
|
-
$[
|
|
611
|
-
$[
|
|
612
|
-
$[
|
|
613
|
-
$[
|
|
614
|
-
$[
|
|
615
|
-
$[
|
|
616
|
-
$[
|
|
617
|
-
$[
|
|
618
|
-
$[
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
$[
|
|
623
|
-
$[
|
|
624
|
-
$[
|
|
625
|
-
$[
|
|
626
|
-
$[
|
|
627
|
-
$[
|
|
628
|
-
$[
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
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;
|
|
663
|
+
} else {
|
|
664
|
+
t34 = $[119];
|
|
665
|
+
}
|
|
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;
|
|
631
685
|
} else {
|
|
632
|
-
t35 = $[
|
|
686
|
+
t35 = $[134];
|
|
633
687
|
}
|
|
634
|
-
const
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[121] = hintPosition;
|
|
643
|
-
$[122] = initialInputName;
|
|
644
|
-
$[123] = label;
|
|
645
|
-
$[124] = labelUppercase;
|
|
646
|
-
$[125] = popoverAlign;
|
|
647
|
-
$[126] = props.hint;
|
|
648
|
-
$[127] = props.required;
|
|
649
|
-
$[128] = readOnly;
|
|
650
|
-
$[129] = skeletonize;
|
|
651
|
-
$[130] = themePopover;
|
|
652
|
-
$[131] = t36;
|
|
688
|
+
const t36 = _.omit(rest, ["initialRef", "finalRef"]);
|
|
689
|
+
const t37 = props?.initialRef;
|
|
690
|
+
let t38;
|
|
691
|
+
if ($[135] !== initialInputRef || $[136] !== t37) {
|
|
692
|
+
t38 = mergeRefs(initialInputRef, t37);
|
|
693
|
+
$[135] = initialInputRef;
|
|
694
|
+
$[136] = t37;
|
|
695
|
+
$[137] = t38;
|
|
653
696
|
} else {
|
|
654
|
-
|
|
697
|
+
t38 = $[137];
|
|
655
698
|
}
|
|
656
|
-
const t37 = _.omit(rest, ["initialRef", "finalRef"]);
|
|
657
|
-
const t38 = props?.initialRef;
|
|
658
699
|
let t39;
|
|
659
|
-
if ($[
|
|
660
|
-
t39 =
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
663
|
-
$[134] = t39;
|
|
700
|
+
if ($[138] !== handleOnBlurMaskInput) {
|
|
701
|
+
t39 = (event_2) => handleOnBlurMaskInput(event_2, "initial");
|
|
702
|
+
$[138] = handleOnBlurMaskInput;
|
|
703
|
+
$[139] = t39;
|
|
664
704
|
} else {
|
|
665
|
-
t39 = $[
|
|
705
|
+
t39 = $[139];
|
|
666
706
|
}
|
|
667
707
|
let t40;
|
|
668
|
-
if ($[
|
|
669
|
-
t40 = (
|
|
670
|
-
$[
|
|
671
|
-
$[
|
|
708
|
+
if ($[140] !== handleOnFocusMaskInput) {
|
|
709
|
+
t40 = (event_3) => handleOnFocusMaskInput(event_3, "initial");
|
|
710
|
+
$[140] = handleOnFocusMaskInput;
|
|
711
|
+
$[141] = t40;
|
|
672
712
|
} else {
|
|
673
|
-
t40 = $[
|
|
713
|
+
t40 = $[141];
|
|
674
714
|
}
|
|
675
715
|
let t41;
|
|
676
|
-
if ($[
|
|
677
|
-
t41 = (
|
|
678
|
-
$[
|
|
679
|
-
$[
|
|
716
|
+
if ($[142] !== handleOnKeyDownMaskInput) {
|
|
717
|
+
t41 = (event_4) => handleOnKeyDownMaskInput(event_4, "initial");
|
|
718
|
+
$[142] = handleOnKeyDownMaskInput;
|
|
719
|
+
$[143] = t41;
|
|
680
720
|
} else {
|
|
681
|
-
t41 = $[
|
|
721
|
+
t41 = $[143];
|
|
682
722
|
}
|
|
683
723
|
let t42;
|
|
684
|
-
if ($[
|
|
685
|
-
t42 =
|
|
686
|
-
$[
|
|
687
|
-
$[140] = t42;
|
|
724
|
+
if ($[144] === Symbol.for("react.memo_cache_sentinel")) {
|
|
725
|
+
t42 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
|
|
726
|
+
$[144] = t42;
|
|
688
727
|
} else {
|
|
689
|
-
t42 = $[
|
|
728
|
+
t42 = $[144];
|
|
690
729
|
}
|
|
691
730
|
let t43;
|
|
692
|
-
if ($[
|
|
693
|
-
t43 = /* @__PURE__ */ jsx(
|
|
694
|
-
$[
|
|
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;
|
|
695
736
|
} else {
|
|
696
|
-
t43 = $[
|
|
737
|
+
t43 = $[147];
|
|
697
738
|
}
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
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;
|
|
704
747
|
} else {
|
|
705
|
-
|
|
748
|
+
t47 = $[149];
|
|
706
749
|
}
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
$[145] = t47;
|
|
714
|
-
$[146] = t48;
|
|
750
|
+
const t48 = !readOnly && !skeletonize ? 0 : -1;
|
|
751
|
+
let t49;
|
|
752
|
+
if ($[150] !== handleOnBlurMaskInput) {
|
|
753
|
+
t49 = (event_6) => handleOnBlurMaskInput(event_6, "final");
|
|
754
|
+
$[150] = handleOnBlurMaskInput;
|
|
755
|
+
$[151] = t49;
|
|
715
756
|
} else {
|
|
716
|
-
|
|
757
|
+
t49 = $[151];
|
|
717
758
|
}
|
|
718
|
-
const t49 = !readOnly && !skeletonize ? 0 : -1;
|
|
719
759
|
let t50;
|
|
720
|
-
if ($[
|
|
721
|
-
t50 = (
|
|
722
|
-
$[
|
|
723
|
-
$[
|
|
760
|
+
if ($[152] !== handleOnFocusMaskInput) {
|
|
761
|
+
t50 = (event_7) => handleOnFocusMaskInput(event_7, "final");
|
|
762
|
+
$[152] = handleOnFocusMaskInput;
|
|
763
|
+
$[153] = t50;
|
|
724
764
|
} else {
|
|
725
|
-
t50 = $[
|
|
765
|
+
t50 = $[153];
|
|
726
766
|
}
|
|
727
767
|
let t51;
|
|
728
|
-
if ($[
|
|
729
|
-
t51 = (
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
768
|
+
if ($[154] !== handleOnKeyDownMaskInput) {
|
|
769
|
+
t51 = (event_8) => handleOnKeyDownMaskInput(event_8, "final");
|
|
770
|
+
$[154] = handleOnKeyDownMaskInput;
|
|
771
|
+
$[155] = t51;
|
|
732
772
|
} else {
|
|
733
|
-
t51 = $[
|
|
773
|
+
t51 = $[155];
|
|
734
774
|
}
|
|
735
775
|
let t52;
|
|
736
|
-
if ($[
|
|
737
|
-
t52 =
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
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;
|
|
740
801
|
} else {
|
|
741
|
-
t52 = $[
|
|
802
|
+
t52 = $[178];
|
|
742
803
|
}
|
|
743
804
|
let t53;
|
|
744
|
-
if ($[
|
|
745
|
-
t53 = /* @__PURE__ */ jsx(
|
|
746
|
-
$[
|
|
747
|
-
$[154] = calendarBoxOpen;
|
|
748
|
-
$[155] = customClass;
|
|
749
|
-
$[156] = disabled;
|
|
750
|
-
$[157] = finalInputName;
|
|
751
|
-
$[158] = finalMaskedValue;
|
|
752
|
-
$[159] = handleOnBeforeInput;
|
|
753
|
-
$[160] = handleOnPaste;
|
|
754
|
-
$[161] = hasValidationErrors;
|
|
755
|
-
$[162] = inputPlaceholder;
|
|
756
|
-
$[163] = readOnly;
|
|
757
|
-
$[164] = skeletonize;
|
|
758
|
-
$[165] = t45.Input;
|
|
759
|
-
$[166] = t46;
|
|
760
|
-
$[167] = t48;
|
|
761
|
-
$[168] = t49;
|
|
762
|
-
$[169] = t50;
|
|
763
|
-
$[170] = t51;
|
|
764
|
-
$[171] = t52;
|
|
765
|
-
$[172] = textAlign;
|
|
766
|
-
$[173] = undigitable;
|
|
767
|
-
$[174] = t53;
|
|
805
|
+
if ($[179] === Symbol.for("react.memo_cache_sentinel")) {
|
|
806
|
+
t53 = /* @__PURE__ */ jsx(Triggers, {});
|
|
807
|
+
$[179] = t53;
|
|
768
808
|
} else {
|
|
769
|
-
t53 = $[
|
|
809
|
+
t53 = $[179];
|
|
770
810
|
}
|
|
771
811
|
let t54;
|
|
772
|
-
if ($[
|
|
773
|
-
t54 = /* @__PURE__ */ jsx(
|
|
774
|
-
$[
|
|
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;
|
|
775
830
|
} else {
|
|
776
|
-
t54 = $[
|
|
831
|
+
t54 = $[195];
|
|
777
832
|
}
|
|
778
833
|
let t55;
|
|
779
|
-
if ($[
|
|
780
|
-
t55 =
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
$[
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
$[182] = getDayState;
|
|
788
|
-
$[183] = handleNextMonth;
|
|
789
|
-
$[184] = handlePreviousMonth;
|
|
790
|
-
$[185] = handleSelectDay;
|
|
791
|
-
$[186] = handleSelectTime;
|
|
792
|
-
$[187] = initialInputName;
|
|
793
|
-
$[188] = isDateTime;
|
|
794
|
-
$[189] = maxDate;
|
|
795
|
-
$[190] = minDate;
|
|
796
|
-
$[191] = 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;
|
|
797
842
|
} else {
|
|
798
|
-
t55 = $[
|
|
843
|
+
t55 = $[201];
|
|
799
844
|
}
|
|
800
845
|
let t56;
|
|
801
|
-
if ($[
|
|
802
|
-
t56 =
|
|
803
|
-
$[
|
|
804
|
-
$[
|
|
805
|
-
$[
|
|
806
|
-
$[
|
|
807
|
-
$[
|
|
808
|
-
$[197] = 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;
|
|
809
853
|
} else {
|
|
810
|
-
t56 = $[
|
|
854
|
+
t56 = $[206];
|
|
811
855
|
}
|
|
812
856
|
let t57;
|
|
813
|
-
if ($[
|
|
814
|
-
t57 =
|
|
815
|
-
$[
|
|
816
|
-
$[
|
|
817
|
-
$[
|
|
818
|
-
$[
|
|
819
|
-
$[202] = 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;
|
|
820
863
|
} else {
|
|
821
|
-
t57 = $[
|
|
822
|
-
}
|
|
823
|
-
let t58;
|
|
824
|
-
if ($[203] !== tooltip || $[204] !== tooltipPosition || $[205] !== tooltipWidth) {
|
|
825
|
-
t58 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
|
|
826
|
-
$[203] = tooltip;
|
|
827
|
-
$[204] = tooltipPosition;
|
|
828
|
-
$[205] = tooltipWidth;
|
|
829
|
-
$[206] = t58;
|
|
830
|
-
} else {
|
|
831
|
-
t58 = $[206];
|
|
864
|
+
t57 = $[210];
|
|
832
865
|
}
|
|
833
866
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
834
867
|
/* @__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: [
|
|
835
|
-
|
|
868
|
+
t35,
|
|
836
869
|
/* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, "data-testid": "test-date-period-field-container", onKeyDown: handleKeyDownNavigation, skeletonize, customClassInputContainer, children: [
|
|
837
|
-
/* @__PURE__ */ jsx(Input, { ...
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
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
|
|
841
874
|
] }),
|
|
875
|
+
t54,
|
|
842
876
|
t55,
|
|
843
|
-
t56
|
|
844
|
-
t57
|
|
877
|
+
t56
|
|
845
878
|
] }) }),
|
|
846
|
-
|
|
879
|
+
t57
|
|
847
880
|
] });
|
|
848
881
|
});
|
|
849
882
|
InputBase.displayName = "DatePeriodFieldInputBase";
|
|
@@ -853,18 +886,10 @@ function _temp() {
|
|
|
853
886
|
final: null
|
|
854
887
|
};
|
|
855
888
|
}
|
|
856
|
-
function _temp2(
|
|
857
|
-
const inicial = initialDate?.isAfter(finalDate) ? finalDate : initialDate;
|
|
858
|
-
const final = initialDate?.isAfter(finalDate) ? initialDate : finalDate;
|
|
859
|
-
return {
|
|
860
|
-
inicial,
|
|
861
|
-
final
|
|
862
|
-
};
|
|
863
|
-
}
|
|
864
|
-
function _temp3(event_5) {
|
|
889
|
+
function _temp2(event_5) {
|
|
865
890
|
event_5.preventDefault();
|
|
866
891
|
}
|
|
867
|
-
function
|
|
892
|
+
function _temp3(error, index) {
|
|
868
893
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
869
894
|
error,
|
|
870
895
|
" "
|