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