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.
- package/lib/assets/styles/datepicker2.css +8 -11
- package/lib/inputs2/date/calendarbox.js.map +1 -1
- package/lib/inputs2/date/datefield/base.js +370 -277
- package/lib/inputs2/date/datefield/base.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/base.js +483 -492
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/types.d.ts +6 -0
- package/lib/inputs2/date/helpers.d.ts +22 -3
- package/lib/inputs2/date/helpers.js +123 -2
- package/lib/inputs2/date/helpers.js.map +1 -1
- package/lib/inputs2/date/hooks/useCalendarPosition.js.map +1 -1
- package/lib/inputs2/date/hooks/useDateCalendarState.js.map +1 -1
- package/lib/inputs2/date/hooks/useDateMask.d.ts +1 -1
- package/lib/inputs2/date/hooks/useDateMask.js +77 -149
- package/lib/inputs2/date/hooks/useDateMask.js.map +1 -1
- package/lib/inputs2/date/timeselector.d.ts +4 -2
- package/lib/inputs2/date/timeselector.js +115 -117
- package/lib/inputs2/date/timeselector.js.map +1 -1
- package/lib/inputs2/date/types.d.ts +6 -0
- package/lib/inputs2/date/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -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 {
|
|
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(
|
|
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] !==
|
|
182
|
-
t22 =
|
|
183
|
-
$[7] =
|
|
184
|
-
$[8] =
|
|
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 = $[
|
|
188
|
+
t22 = $[10];
|
|
187
189
|
}
|
|
188
|
-
const
|
|
189
|
-
const
|
|
190
|
-
const hasValidationErrors = Boolean(errors?.length);
|
|
190
|
+
const timeSelectionOf = t22;
|
|
191
|
+
const activeTimeSelection = timeSelectionOf(activeInputType);
|
|
191
192
|
let t23;
|
|
192
|
-
if ($[
|
|
193
|
-
t23 = ()
|
|
194
|
-
|
|
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
|
|
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
|
|
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] =
|
|
243
|
-
$[21] = t24;
|
|
242
|
+
$[20] = t24;
|
|
244
243
|
} else {
|
|
245
|
-
t24 = $[
|
|
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
|
-
|
|
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
|
|
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
|
|
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 ($[
|
|
322
|
-
t25 = (
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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
|
-
$[
|
|
353
|
-
$[
|
|
354
|
-
$[
|
|
355
|
-
$[
|
|
356
|
-
$[
|
|
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 = $[
|
|
346
|
+
t25 = $[25];
|
|
366
347
|
}
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
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 ($[
|
|
442
|
-
t26 = (event_0,
|
|
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(
|
|
448
|
-
if (
|
|
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 (
|
|
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
|
-
$[
|
|
458
|
-
$[
|
|
459
|
-
$[
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
462
|
-
$[
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
$[
|
|
466
|
-
$[
|
|
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 = $[
|
|
479
|
+
t26 = $[35];
|
|
470
480
|
}
|
|
471
481
|
const handleOnFocusMaskInput = t26;
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
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
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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
|
-
|
|
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 ($[
|
|
559
|
-
t27 = (
|
|
560
|
-
|
|
561
|
-
|
|
503
|
+
if ($[36] !== finalInputName || $[37] !== initialInputName) {
|
|
504
|
+
t27 = () => {
|
|
505
|
+
const focusedInputId = document.activeElement?.id;
|
|
506
|
+
if (focusedInputId === initialInputName) {
|
|
507
|
+
return "initial";
|
|
562
508
|
}
|
|
563
|
-
|
|
564
|
-
|
|
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
|
-
$[
|
|
593
|
-
$[
|
|
594
|
-
$[
|
|
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
|
-
|
|
517
|
+
t27 = $[38];
|
|
612
518
|
}
|
|
613
|
-
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
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:
|
|
622
|
-
isDisabled:
|
|
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:
|
|
627
|
+
hasValidPeriodSelected: t31
|
|
641
628
|
};
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
651
|
-
$[
|
|
652
|
-
$[
|
|
653
|
-
$[
|
|
654
|
-
$[
|
|
655
|
-
$[
|
|
656
|
-
$[
|
|
657
|
-
$[
|
|
658
|
-
$[
|
|
659
|
-
$[
|
|
660
|
-
$[
|
|
661
|
-
$[
|
|
662
|
-
$[
|
|
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
|
-
|
|
685
|
+
t36 = $[78];
|
|
665
686
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
$[
|
|
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
|
-
|
|
693
|
+
t37 = $[80];
|
|
687
694
|
}
|
|
688
|
-
const t36 = _.omit(rest, ["initialRef", "finalRef"]);
|
|
689
|
-
const t37 = props?.initialRef;
|
|
690
695
|
let t38;
|
|
691
|
-
if ($[
|
|
692
|
-
t38 =
|
|
693
|
-
$[
|
|
694
|
-
$[
|
|
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 = $[
|
|
701
|
+
t38 = $[82];
|
|
698
702
|
}
|
|
699
703
|
let t39;
|
|
700
|
-
if ($[
|
|
701
|
-
t39 = (
|
|
702
|
-
$[
|
|
703
|
-
$[
|
|
704
|
+
if ($[83] !== handleOnKeyDownMaskInput) {
|
|
705
|
+
t39 = (event_4) => handleOnKeyDownMaskInput(event_4, "initial");
|
|
706
|
+
$[83] = handleOnKeyDownMaskInput;
|
|
707
|
+
$[84] = t39;
|
|
704
708
|
} else {
|
|
705
|
-
t39 = $[
|
|
709
|
+
t39 = $[84];
|
|
706
710
|
}
|
|
707
711
|
let t40;
|
|
708
|
-
if ($[
|
|
709
|
-
t40 =
|
|
710
|
-
$[
|
|
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 = $[
|
|
716
|
+
t40 = $[85];
|
|
714
717
|
}
|
|
715
718
|
let t41;
|
|
716
|
-
if ($[
|
|
717
|
-
t41 =
|
|
718
|
-
$[
|
|
719
|
-
$[
|
|
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 = $[
|
|
725
|
+
t41 = $[88];
|
|
722
726
|
}
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
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
|
-
|
|
737
|
+
t45 = $[91];
|
|
729
738
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
$[
|
|
735
|
-
$[
|
|
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
|
-
|
|
746
|
+
t47 = $[93];
|
|
738
747
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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
|
-
|
|
754
|
+
t48 = $[95];
|
|
749
755
|
}
|
|
750
|
-
const t48 = !readOnly && !skeletonize ? 0 : -1;
|
|
751
756
|
let t49;
|
|
752
|
-
if ($[
|
|
753
|
-
t49 = (
|
|
754
|
-
$[
|
|
755
|
-
$[
|
|
757
|
+
if ($[96] !== handleOnKeyDownMaskInput) {
|
|
758
|
+
t49 = (event_8) => handleOnKeyDownMaskInput(event_8, "final");
|
|
759
|
+
$[96] = handleOnKeyDownMaskInput;
|
|
760
|
+
$[97] = t49;
|
|
756
761
|
} else {
|
|
757
|
-
t49 = $[
|
|
762
|
+
t49 = $[97];
|
|
758
763
|
}
|
|
759
764
|
let t50;
|
|
760
|
-
if ($[
|
|
761
|
-
t50 =
|
|
762
|
-
$[
|
|
763
|
-
$[
|
|
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 = $[
|
|
791
|
+
t50 = $[120];
|
|
766
792
|
}
|
|
767
793
|
let t51;
|
|
768
|
-
if ($[
|
|
769
|
-
t51 =
|
|
770
|
-
$[
|
|
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 = $[
|
|
798
|
+
t51 = $[121];
|
|
774
799
|
}
|
|
775
800
|
let t52;
|
|
776
|
-
if ($[
|
|
777
|
-
t52 = /* @__PURE__ */ jsx(
|
|
778
|
-
$[
|
|
779
|
-
$[
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
$[
|
|
783
|
-
$[
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
$[
|
|
787
|
-
$[
|
|
788
|
-
$[
|
|
789
|
-
$[
|
|
790
|
-
$[
|
|
791
|
-
$[
|
|
792
|
-
$[
|
|
793
|
-
$[
|
|
794
|
-
$[
|
|
795
|
-
$[
|
|
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 = $[
|
|
822
|
+
t52 = $[139];
|
|
803
823
|
}
|
|
804
824
|
let t53;
|
|
805
|
-
if ($[
|
|
806
|
-
t53 = /* @__PURE__ */ jsx(
|
|
807
|
-
$[
|
|
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 = $[
|
|
834
|
+
t53 = $[145];
|
|
810
835
|
}
|
|
811
836
|
let t54;
|
|
812
|
-
if ($[
|
|
813
|
-
t54 =
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
816
|
-
$[
|
|
817
|
-
$[
|
|
818
|
-
$[
|
|
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 = $[
|
|
845
|
+
t54 = $[150];
|
|
832
846
|
}
|
|
833
847
|
let t55;
|
|
834
|
-
if ($[
|
|
835
|
-
t55 =
|
|
836
|
-
$[
|
|
837
|
-
$[
|
|
838
|
-
$[
|
|
839
|
-
$[
|
|
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
|
-
|
|
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
|
-
|
|
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, { ...
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
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
|
-
|
|
876
|
-
|
|
877
|
-
|
|
866
|
+
t52,
|
|
867
|
+
t53,
|
|
868
|
+
t54
|
|
878
869
|
] }) }),
|
|
879
|
-
|
|
870
|
+
t55
|
|
880
871
|
] });
|
|
881
872
|
});
|
|
882
873
|
InputBase.displayName = "DatePeriodFieldInputBase";
|