linear-react-components-ui 2.1.0-beta.5 → 2.2.0-beta.0
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 +11 -81
- package/lib/form2/useForm/index.js +1 -0
- package/lib/form2/useForm/index.js.map +1 -1
- package/lib/inputs2/date/{hooks/useCalendarPosition.d.ts → base/constants.d.ts} +1 -1
- package/lib/inputs2/date/base/constants.js +69 -0
- package/lib/inputs2/date/base/constants.js.map +1 -0
- package/lib/inputs2/date/datefield/base.js +214 -691
- package/lib/inputs2/date/datefield/base.js.map +1 -1
- package/lib/inputs2/date/datefield/calendarbox.d.ts +6 -0
- package/lib/inputs2/date/datefield/calendarbox.js +228 -0
- package/lib/inputs2/date/datefield/calendarbox.js.map +1 -0
- package/lib/inputs2/date/datefield/triggers.js +4 -4
- package/lib/inputs2/date/datefield/triggers.js.map +1 -1
- package/lib/inputs2/date/datefield/types.d.ts +12 -5
- package/lib/inputs2/date/dateperiodfield/base.js +809 -694
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +6 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +282 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +1 -0
- package/lib/inputs2/date/dateperiodfield/triggers.js +9 -21
- package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/types.d.ts +23 -13
- package/lib/inputs2/date/helpers.d.ts +4 -44
- package/lib/inputs2/date/helpers.js +4 -200
- package/lib/inputs2/date/helpers.js.map +1 -1
- package/lib/inputs2/date/types.d.ts +1 -22
- package/lib/inputs2/date/types.js.map +1 -1
- package/lib/node_modules/lodash/lodash.js +2 -2
- package/lib/node_modules/lodash/lodash.js.map +1 -1
- package/package.json +1 -1
- package/lib/inputs2/date/calendarbox.d.ts +0 -23
- package/lib/inputs2/date/calendarbox.js +0 -254
- package/lib/inputs2/date/calendarbox.js.map +0 -1
- package/lib/inputs2/date/hooks/useCalendarPosition.js +0 -93
- package/lib/inputs2/date/hooks/useCalendarPosition.js.map +0 -1
- package/lib/inputs2/date/hooks/useDateCalendarState.d.ts +0 -14
- package/lib/inputs2/date/hooks/useDateCalendarState.js +0 -250
- package/lib/inputs2/date/hooks/useDateCalendarState.js.map +0 -1
- package/lib/inputs2/date/hooks/useDateMask.d.ts +0 -22
- package/lib/inputs2/date/hooks/useDateMask.js +0 -143
- package/lib/inputs2/date/hooks/useDateMask.js.map +0 -1
- package/lib/inputs2/date/timeselector.d.ts +0 -17
- package/lib/inputs2/date/timeselector.js +0 -226
- package/lib/inputs2/date/timeselector.js.map +0 -1
- package/lib/node_modules/moment/dist/locale/pt-br.js +0 -54
- package/lib/node_modules/moment/dist/locale/pt-br.js.map +0 -1
|
@@ -2,6 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as compilerRuntimeExports } from "../../../_virtual/compiler-runtime.js";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import _ from "../../../_virtual/lodash.js";
|
|
5
|
+
import { useIMask } from "react-imask";
|
|
5
6
|
import { createPortal } from "react-dom";
|
|
6
7
|
import hooks from "../../../node_modules/moment/dist/moment.js";
|
|
7
8
|
import Hint from "../../../hint/index.js";
|
|
@@ -11,15 +12,12 @@ import { mergeRefs } from "../../../form2/helpers.js";
|
|
|
11
12
|
import { Keys } from "../types.js";
|
|
12
13
|
import * as inputs2_date_base_index from "../base/index.js";
|
|
13
14
|
import { Label, Root, Container, Input } from "../base/index.js";
|
|
14
|
-
import {
|
|
15
|
-
import { useDateCalendarState } from "../hooks/useDateCalendarState.js";
|
|
16
|
-
import { TimeSelector } from "../timeselector.js";
|
|
17
|
-
import { parseBoundary, TOKEN_ISO_FORMAT, parseDateValue, getDateFormats, getPredefinedPeriodRange, clampDateToBounds, isDayOutOfBounds, resolveAssumedTime, completePartialDateTime, getTimeSelection, formatPartialDateTime } from "../helpers.js";
|
|
18
|
-
import { CalendarBox } from "../calendarbox.js";
|
|
15
|
+
import { TOKEN_ISO_FORMAT, TOKEN_PTBR_FORMAT, TOKEN_MASK, NAVIGATION_KEYS } from "../helpers.js";
|
|
19
16
|
import { Triggers } from "./triggers.js";
|
|
17
|
+
import { CalendarBox } from "./calendarbox.js";
|
|
20
18
|
import { DatePeriodFieldContext } from "./context.js";
|
|
21
19
|
const InputBase = React.forwardRef((props, __) => {
|
|
22
|
-
const $ = compilerRuntimeExports.c(
|
|
20
|
+
const $ = compilerRuntimeExports.c(193);
|
|
23
21
|
const {
|
|
24
22
|
label,
|
|
25
23
|
errors,
|
|
@@ -38,15 +36,11 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
38
36
|
showCalendarButton: t12,
|
|
39
37
|
textAlign: t13,
|
|
40
38
|
openCalendarOnFocus: t14,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
shouldCloseOnSelect,
|
|
47
|
-
min,
|
|
48
|
-
max,
|
|
49
|
-
onChange,
|
|
39
|
+
shouldCloseOnSelect: t15,
|
|
40
|
+
showPredefinedPeriodsButton: t16,
|
|
41
|
+
showClearDateButton: t17,
|
|
42
|
+
placeholder: t18,
|
|
43
|
+
returnValueType: t19,
|
|
50
44
|
tooltip,
|
|
51
45
|
tooltipPosition,
|
|
52
46
|
tooltipWidth,
|
|
@@ -69,156 +63,253 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
69
63
|
const showCalendarButton = t12 === void 0 ? true : t12;
|
|
70
64
|
const textAlign = t13 === void 0 ? "left" : t13;
|
|
71
65
|
const openCalendarOnFocus = t14 === void 0 ? true : t14;
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
isoFormat,
|
|
79
|
-
ptbrFormat,
|
|
80
|
-
digits
|
|
81
|
-
} = getDateFormats(variant);
|
|
82
|
-
const shouldCloseCalendarOnSelect = shouldCloseOnSelect ?? !isDateTime;
|
|
83
|
-
const inputPlaceholder = placeholder ?? ptbrFormat;
|
|
84
|
-
const minDate = parseBoundary(min);
|
|
85
|
-
const maxDate = parseBoundary(max);
|
|
86
|
-
const hasBounds = Boolean(minDate || maxDate);
|
|
87
|
-
let t19;
|
|
66
|
+
const shouldCloseOnSelect = t15 === void 0 ? true : t15;
|
|
67
|
+
const showPredefinedPeriodsButton = t16 === void 0 ? true : t16;
|
|
68
|
+
const showClearDateButton = t17 === void 0 ? true : t17;
|
|
69
|
+
const placeholder = t18 === void 0 ? TOKEN_PTBR_FORMAT : t18;
|
|
70
|
+
const returnValueType = t19 === void 0 ? "default" : t19;
|
|
71
|
+
let t20;
|
|
88
72
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
89
|
-
|
|
73
|
+
t20 = {
|
|
90
74
|
inicial: null,
|
|
91
75
|
final: null
|
|
92
76
|
};
|
|
93
|
-
$[0] =
|
|
77
|
+
$[0] = t20;
|
|
78
|
+
} else {
|
|
79
|
+
t20 = $[0];
|
|
80
|
+
}
|
|
81
|
+
const [selectedDate, setSelectedDate] = React.useState(t20);
|
|
82
|
+
const [calendarBoxOpen, setCalendarBoxOpen] = React.useState(false);
|
|
83
|
+
let t21;
|
|
84
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
85
|
+
t21 = hooks().format(TOKEN_ISO_FORMAT);
|
|
86
|
+
$[1] = t21;
|
|
87
|
+
} else {
|
|
88
|
+
t21 = $[1];
|
|
89
|
+
}
|
|
90
|
+
const [activeDescendant, setActiveDescendant] = React.useState(t21);
|
|
91
|
+
let t22;
|
|
92
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
93
|
+
t22 = hooks();
|
|
94
|
+
$[2] = t22;
|
|
94
95
|
} else {
|
|
95
|
-
|
|
96
|
+
t22 = $[2];
|
|
96
97
|
}
|
|
97
|
-
const [
|
|
98
|
-
const
|
|
98
|
+
const [calendarDisplayDate, setCalendarDisplayDate] = React.useState(t22);
|
|
99
|
+
const calendarRef = React.useRef(null);
|
|
99
100
|
const inputRootRef = React.useRef(null);
|
|
100
101
|
const finalInputRef = React.useRef(null);
|
|
101
102
|
const initialInputRef = React.useRef(null);
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
activeDescendant,
|
|
110
|
-
calendarDisplayDate,
|
|
111
|
-
calendarRef,
|
|
112
|
-
dateContainerRef,
|
|
113
|
-
handleNextMonth,
|
|
114
|
-
handlePreviousMonth,
|
|
115
|
-
handleSetCalendarBoxOpen,
|
|
116
|
-
handleChangeActiveDescendant,
|
|
117
|
-
handleChangeCalendarDisplayDate,
|
|
118
|
-
handleKeyDownNavigation
|
|
119
|
-
} = calendarState;
|
|
120
|
-
let t20;
|
|
121
|
-
if ($[1] !== initialName || $[2] !== props.name) {
|
|
122
|
-
t20 = String(props.name).concat(".").concat(initialName);
|
|
123
|
-
$[1] = initialName;
|
|
124
|
-
$[2] = props.name;
|
|
125
|
-
$[3] = t20;
|
|
103
|
+
const dateContainerRef = React.useRef(null);
|
|
104
|
+
let t23;
|
|
105
|
+
if ($[3] !== initialName || $[4] !== props.name) {
|
|
106
|
+
t23 = String(props.name).concat(".").concat(initialName);
|
|
107
|
+
$[3] = initialName;
|
|
108
|
+
$[4] = props.name;
|
|
109
|
+
$[5] = t23;
|
|
126
110
|
} else {
|
|
127
|
-
|
|
111
|
+
t23 = $[5];
|
|
128
112
|
}
|
|
129
|
-
const initialInputName =
|
|
130
|
-
let
|
|
131
|
-
if ($[
|
|
132
|
-
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
113
|
+
const initialInputName = t23;
|
|
114
|
+
let t24;
|
|
115
|
+
if ($[6] !== finalName || $[7] !== props.name) {
|
|
116
|
+
t24 = String(props.name).concat(".").concat(finalName);
|
|
117
|
+
$[6] = finalName;
|
|
118
|
+
$[7] = props.name;
|
|
119
|
+
$[8] = t24;
|
|
136
120
|
} else {
|
|
137
|
-
|
|
121
|
+
t24 = $[8];
|
|
122
|
+
}
|
|
123
|
+
const finalInputName = t24;
|
|
124
|
+
let t25;
|
|
125
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t25 = {
|
|
127
|
+
mask: TOKEN_MASK,
|
|
128
|
+
lazy: false,
|
|
129
|
+
placeholderChar: "_"
|
|
130
|
+
};
|
|
131
|
+
$[9] = t25;
|
|
132
|
+
} else {
|
|
133
|
+
t25 = $[9];
|
|
134
|
+
}
|
|
135
|
+
let t26;
|
|
136
|
+
if ($[10] !== selectedDate.inicial) {
|
|
137
|
+
t26 = selectedDate.inicial?.format(TOKEN_PTBR_FORMAT);
|
|
138
|
+
$[10] = selectedDate.inicial;
|
|
139
|
+
$[11] = t26;
|
|
140
|
+
} else {
|
|
141
|
+
t26 = $[11];
|
|
138
142
|
}
|
|
139
|
-
const finalInputName = t21;
|
|
140
|
-
const {
|
|
141
|
-
maskedValue: initialMaskedValue,
|
|
142
|
-
setMaskValue: setInitialMaskValue,
|
|
143
|
-
unmaskedValue: initialUnmaskedValue,
|
|
144
|
-
handleOnPaste,
|
|
145
|
-
handleOnBeforeInput,
|
|
146
|
-
handleOnKeyDownCapture: handleInitialKeyDownCapture
|
|
147
|
-
} = useDateMask({
|
|
148
|
-
inputRef: initialInputRef,
|
|
149
|
-
variant,
|
|
150
|
-
defaultValue: selectedDate.inicial?.format(ptbrFormat),
|
|
151
|
-
undigitable,
|
|
152
|
-
readOnly,
|
|
153
|
-
onCommit: (date) => handleChangeUpdateDateState({
|
|
154
|
-
date,
|
|
155
|
-
inputType: "initial",
|
|
156
|
-
typing: true
|
|
157
|
-
}),
|
|
158
|
-
onPaste: props.onPaste,
|
|
159
|
-
onBeforeInput: props.onBeforeInput
|
|
160
|
-
});
|
|
161
143
|
const {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
unmaskedValue:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
onBeforeInput: props.onBeforeInput
|
|
144
|
+
value: initialMaskedValue,
|
|
145
|
+
setValue: setInitialMaskValue,
|
|
146
|
+
unmaskedValue: initialUnmaskedValue
|
|
147
|
+
} = useIMask(t25, {
|
|
148
|
+
ref: initialInputRef,
|
|
149
|
+
defaultValue: t26,
|
|
150
|
+
onComplete: (value) => {
|
|
151
|
+
const date = hooks(value, TOKEN_PTBR_FORMAT);
|
|
152
|
+
if (date.isValid()) {
|
|
153
|
+
handleChangeUpdateDateState({
|
|
154
|
+
date,
|
|
155
|
+
inputType: "initial",
|
|
156
|
+
typing: true
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
179
160
|
});
|
|
180
|
-
let
|
|
181
|
-
if ($[
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
161
|
+
let t27;
|
|
162
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
163
|
+
t27 = {
|
|
164
|
+
mask: TOKEN_MASK,
|
|
165
|
+
lazy: false,
|
|
166
|
+
placeholderChar: "_"
|
|
167
|
+
};
|
|
168
|
+
$[12] = t27;
|
|
187
169
|
} else {
|
|
188
|
-
|
|
170
|
+
t27 = $[12];
|
|
189
171
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
$[
|
|
172
|
+
let t28;
|
|
173
|
+
if ($[13] !== selectedDate.final) {
|
|
174
|
+
t28 = selectedDate.final?.format(TOKEN_PTBR_FORMAT);
|
|
175
|
+
$[13] = selectedDate.final;
|
|
176
|
+
$[14] = t28;
|
|
177
|
+
} else {
|
|
178
|
+
t28 = $[14];
|
|
179
|
+
}
|
|
180
|
+
const {
|
|
181
|
+
value: finalMaskedValue,
|
|
182
|
+
setValue: setFinalMaskValue,
|
|
183
|
+
unmaskedValue: finalUnmaskedValue
|
|
184
|
+
} = useIMask(t27, {
|
|
185
|
+
ref: finalInputRef,
|
|
186
|
+
defaultValue: t28,
|
|
187
|
+
onComplete: (value_0) => {
|
|
188
|
+
const date_0 = hooks(value_0, TOKEN_PTBR_FORMAT);
|
|
189
|
+
if (date_0.isValid()) {
|
|
190
|
+
handleChangeUpdateDateState({
|
|
191
|
+
date: date_0,
|
|
192
|
+
inputType: "final",
|
|
193
|
+
typing: true
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
let t29;
|
|
199
|
+
if ($[15] !== props.label) {
|
|
200
|
+
t29 = _.isEmpty(props?.label);
|
|
201
|
+
$[15] = props.label;
|
|
202
|
+
$[16] = t29;
|
|
197
203
|
} else {
|
|
198
|
-
|
|
204
|
+
t29 = $[16];
|
|
199
205
|
}
|
|
200
|
-
const hasLabel = !
|
|
206
|
+
const hasLabel = !t29;
|
|
201
207
|
const hasHintMessages = Boolean(props.hint?.length);
|
|
202
208
|
const hasValidationErrors = Boolean(errors?.length);
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
let t30;
|
|
210
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
211
|
+
t30 = (object) => setSelectedDate(object);
|
|
212
|
+
$[17] = t30;
|
|
213
|
+
} else {
|
|
214
|
+
t30 = $[17];
|
|
215
|
+
}
|
|
216
|
+
const handleChangeSelectedDate = t30;
|
|
217
|
+
let t31;
|
|
218
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
219
|
+
t31 = (value_1) => setCalendarBoxOpen(value_1);
|
|
220
|
+
$[18] = t31;
|
|
221
|
+
} else {
|
|
222
|
+
t31 = $[18];
|
|
223
|
+
}
|
|
224
|
+
const handleChangeCalendarBoxState = t31;
|
|
225
|
+
let t32;
|
|
226
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
227
|
+
t32 = (value_2) => setActiveDescendant(value_2);
|
|
228
|
+
$[19] = t32;
|
|
229
|
+
} else {
|
|
230
|
+
t32 = $[19];
|
|
231
|
+
}
|
|
232
|
+
const handleChangeActiveDescendant = t32;
|
|
233
|
+
let t33;
|
|
234
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
235
|
+
t33 = (value_3) => setCalendarDisplayDate(value_3);
|
|
236
|
+
$[20] = t33;
|
|
237
|
+
} else {
|
|
238
|
+
t33 = $[20];
|
|
239
|
+
}
|
|
240
|
+
const handleChangeCalendarDisplayDate = t33;
|
|
241
|
+
let t34;
|
|
242
|
+
if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
|
|
243
|
+
t34 = () => setCalendarDisplayDate(_temp);
|
|
244
|
+
$[21] = t34;
|
|
245
|
+
} else {
|
|
246
|
+
t34 = $[21];
|
|
247
|
+
}
|
|
248
|
+
const handleChangePreviousMonth = t34;
|
|
249
|
+
let t35;
|
|
250
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
251
|
+
t35 = () => setCalendarDisplayDate(_temp2);
|
|
252
|
+
$[22] = t35;
|
|
253
|
+
} else {
|
|
254
|
+
t35 = $[22];
|
|
255
|
+
}
|
|
256
|
+
const handleChangeNextMonth = t35;
|
|
257
|
+
let t36;
|
|
258
|
+
if ($[23] !== handleChangeActiveDescendant) {
|
|
259
|
+
t36 = (offset) => {
|
|
260
|
+
setCalendarDisplayDate((prevDisplayDate_1) => {
|
|
261
|
+
const daySelected = prevDisplayDate_1.clone().add(offset, "day");
|
|
262
|
+
handleChangeActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));
|
|
263
|
+
return daySelected;
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
$[23] = handleChangeActiveDescendant;
|
|
267
|
+
$[24] = t36;
|
|
268
|
+
} else {
|
|
269
|
+
t36 = $[24];
|
|
270
|
+
}
|
|
271
|
+
const handleNavigateWithDays = t36;
|
|
272
|
+
let t37;
|
|
273
|
+
if ($[25] !== handleChangeActiveDescendant) {
|
|
274
|
+
t37 = (when) => {
|
|
275
|
+
setCalendarDisplayDate((prevDisplayDate_2) => {
|
|
276
|
+
let daySelected_0 = prevDisplayDate_2;
|
|
277
|
+
if (when === "end") {
|
|
278
|
+
daySelected_0 = prevDisplayDate_2.clone().endOf("week");
|
|
214
279
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
280
|
+
if (when === "start") {
|
|
281
|
+
daySelected_0 = prevDisplayDate_2.clone().startOf("week");
|
|
282
|
+
}
|
|
283
|
+
handleChangeActiveDescendant(daySelected_0.format(TOKEN_ISO_FORMAT));
|
|
284
|
+
return daySelected_0;
|
|
285
|
+
});
|
|
286
|
+
};
|
|
287
|
+
$[25] = handleChangeActiveDescendant;
|
|
288
|
+
$[26] = t37;
|
|
289
|
+
} else {
|
|
290
|
+
t37 = $[26];
|
|
291
|
+
}
|
|
292
|
+
const handleNavigateWithWeeks = t37;
|
|
293
|
+
let t38;
|
|
294
|
+
if ($[27] !== finalName || $[28] !== initialName || $[29] !== props.value) {
|
|
295
|
+
t38 = () => {
|
|
296
|
+
const objectValue = props?.value;
|
|
297
|
+
const isValidInitialValue = !_.isEmpty(objectValue[initialName]);
|
|
298
|
+
const isValidFinalValue = !_.isEmpty(objectValue[finalName]);
|
|
299
|
+
return isValidInitialValue && isValidFinalValue;
|
|
300
|
+
};
|
|
301
|
+
$[27] = finalName;
|
|
302
|
+
$[28] = initialName;
|
|
303
|
+
$[29] = props.value;
|
|
304
|
+
$[30] = t38;
|
|
305
|
+
} else {
|
|
306
|
+
t38 = $[30];
|
|
307
|
+
}
|
|
308
|
+
const verifyPeriodSelectedIsValid = t38;
|
|
309
|
+
let t39;
|
|
310
|
+
if ($[31] !== finalName || $[32] !== handleChangeCalendarBoxState || $[33] !== initialName || $[34] !== props || $[35] !== setFinalMaskValue || $[36] !== setInitialMaskValue) {
|
|
311
|
+
t39 = () => {
|
|
312
|
+
props.onChange?.({
|
|
222
313
|
target: {
|
|
223
314
|
name: props.name,
|
|
224
315
|
value: {
|
|
@@ -227,660 +318,684 @@ const InputBase = React.forwardRef((props, __) => {
|
|
|
227
318
|
}
|
|
228
319
|
}
|
|
229
320
|
});
|
|
230
|
-
setSelectedDate(
|
|
321
|
+
setSelectedDate(_temp3);
|
|
231
322
|
setInitialMaskValue("");
|
|
232
323
|
setFinalMaskValue("");
|
|
233
|
-
|
|
324
|
+
handleChangeCalendarBoxState(false);
|
|
234
325
|
};
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const handleOnClickClearSelectedPeriod = t24;
|
|
326
|
+
$[31] = finalName;
|
|
327
|
+
$[32] = handleChangeCalendarBoxState;
|
|
328
|
+
$[33] = initialName;
|
|
329
|
+
$[34] = props;
|
|
330
|
+
$[35] = setFinalMaskValue;
|
|
331
|
+
$[36] = setInitialMaskValue;
|
|
332
|
+
$[37] = t39;
|
|
333
|
+
} else {
|
|
334
|
+
t39 = $[37];
|
|
335
|
+
}
|
|
336
|
+
const handleOnClickClearSelectedPeriod = t39;
|
|
247
337
|
const handleChangeUpdateDateState = (params) => {
|
|
248
338
|
const {
|
|
249
339
|
date: date_1,
|
|
250
|
-
inputType
|
|
340
|
+
inputType,
|
|
251
341
|
typing
|
|
252
342
|
} = params;
|
|
253
343
|
const rawDate = date_1.clone();
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
return {
|
|
257
|
-
inicial: initialDate,
|
|
258
|
-
final: finalDate
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
const inicial_0 = initialDate?.isAfter(finalDate) ? finalDate : initialDate;
|
|
262
|
-
const final_0 = initialDate?.isAfter(finalDate) ? initialDate : finalDate;
|
|
263
|
-
return {
|
|
264
|
-
inicial: inicial_0,
|
|
265
|
-
final: final_0
|
|
266
|
-
};
|
|
267
|
-
};
|
|
268
|
-
bb223: switch (inputType_0) {
|
|
344
|
+
const verifyDateRangeOrder = _temp4;
|
|
345
|
+
bb185: switch (inputType) {
|
|
269
346
|
case "initial": {
|
|
270
347
|
setSelectedDate((prevSelectedDate_0) => {
|
|
271
348
|
const {
|
|
272
|
-
inicial:
|
|
273
|
-
final:
|
|
274
|
-
} =
|
|
349
|
+
inicial: inicial_2,
|
|
350
|
+
final: final_2
|
|
351
|
+
} = verifyDateRangeOrder(rawDate, prevSelectedDate_0.final);
|
|
275
352
|
const updatedState_0 = {
|
|
276
|
-
inicial:
|
|
277
|
-
final:
|
|
353
|
+
inicial: inicial_2,
|
|
354
|
+
final: final_2
|
|
278
355
|
};
|
|
279
356
|
return updatedState_0;
|
|
280
357
|
});
|
|
281
358
|
const {
|
|
282
|
-
inicial:
|
|
283
|
-
final:
|
|
284
|
-
} =
|
|
285
|
-
|
|
359
|
+
inicial: inicial_3,
|
|
360
|
+
final: final_3
|
|
361
|
+
} = verifyDateRangeOrder(rawDate, selectedDate.final);
|
|
362
|
+
props.onChange?.({
|
|
363
|
+
target: {
|
|
364
|
+
name: props.name,
|
|
365
|
+
value: {
|
|
366
|
+
[initialName]: returnValueType === "default" ? inicial_3?.format(TOKEN_ISO_FORMAT) : inicial_3?.toISOString(),
|
|
367
|
+
[finalName]: returnValueType === "default" ? final_3?.format(TOKEN_ISO_FORMAT) : final_3?.toISOString()
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
});
|
|
286
371
|
requestAnimationFrame(() => {
|
|
287
|
-
if (!typing
|
|
372
|
+
if (!typing) {
|
|
288
373
|
finalInputRef.current?.focus?.();
|
|
289
374
|
}
|
|
290
375
|
});
|
|
291
|
-
break
|
|
376
|
+
break bb185;
|
|
292
377
|
}
|
|
293
378
|
case "final": {
|
|
294
379
|
setSelectedDate((prevSelectedDate) => {
|
|
295
380
|
const {
|
|
296
|
-
inicial:
|
|
297
|
-
final:
|
|
298
|
-
} =
|
|
381
|
+
inicial: inicial_0,
|
|
382
|
+
final: final_0
|
|
383
|
+
} = verifyDateRangeOrder(prevSelectedDate.inicial, rawDate);
|
|
299
384
|
const updatedState = {
|
|
300
|
-
inicial:
|
|
301
|
-
final:
|
|
385
|
+
inicial: inicial_0,
|
|
386
|
+
final: final_0
|
|
302
387
|
};
|
|
303
388
|
return updatedState;
|
|
304
389
|
});
|
|
305
390
|
const {
|
|
306
|
-
inicial:
|
|
307
|
-
final:
|
|
308
|
-
} =
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
391
|
+
inicial: inicial_1,
|
|
392
|
+
final: final_1
|
|
393
|
+
} = verifyDateRangeOrder(selectedDate.inicial, rawDate);
|
|
394
|
+
props.onChange?.({
|
|
395
|
+
target: {
|
|
396
|
+
name: props.name,
|
|
397
|
+
value: {
|
|
398
|
+
[initialName]: returnValueType === "default" ? inicial_1?.format(TOKEN_ISO_FORMAT) : inicial_1?.toISOString(),
|
|
399
|
+
[finalName]: returnValueType === "default" ? final_1?.format(TOKEN_ISO_FORMAT) : final_1?.toISOString()
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
if (shouldCloseOnSelect) {
|
|
404
|
+
handleChangeCalendarBoxState(false);
|
|
312
405
|
}
|
|
313
|
-
break
|
|
406
|
+
break bb185;
|
|
314
407
|
}
|
|
315
408
|
}
|
|
316
|
-
|
|
317
|
-
handleChangeCalendarDisplayDate(rawDate.clone());
|
|
409
|
+
setCalendarDisplayDate(rawDate.clone());
|
|
318
410
|
};
|
|
319
|
-
let
|
|
320
|
-
if ($[
|
|
321
|
-
|
|
322
|
-
const {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
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());
|
|
339
|
-
};
|
|
340
|
-
$[21] = handleChangeActiveDescendant;
|
|
341
|
-
$[22] = handleChangeCalendarDisplayDate;
|
|
342
|
-
$[23] = setFinalMaskValue;
|
|
343
|
-
$[24] = setInitialMaskValue;
|
|
344
|
-
$[25] = t25;
|
|
345
|
-
} else {
|
|
346
|
-
t25 = $[25];
|
|
347
|
-
}
|
|
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()
|
|
411
|
+
let t40;
|
|
412
|
+
if ($[38] !== finalName || $[39] !== handleChangeCalendarBoxState || $[40] !== initialName || $[41] !== props || $[42] !== returnValueType || $[43] !== shouldCloseOnSelect) {
|
|
413
|
+
t40 = (period) => {
|
|
414
|
+
const localOnChange = (initialDate_0, finalDate_0) => {
|
|
415
|
+
const valueToUpdate = {
|
|
416
|
+
[initialName]: returnValueType === "default" ? initialDate_0.format(TOKEN_ISO_FORMAT) : initialDate_0.toISOString(),
|
|
417
|
+
[finalName]: returnValueType === "default" ? finalDate_0.format(TOKEN_ISO_FORMAT) : finalDate_0.toISOString()
|
|
359
418
|
};
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
419
|
+
setSelectedDate(() => {
|
|
420
|
+
const updatedState_1 = {
|
|
421
|
+
inicial: initialDate_0.clone(),
|
|
422
|
+
final: finalDate_0.clone()
|
|
423
|
+
};
|
|
424
|
+
return updatedState_1;
|
|
425
|
+
});
|
|
426
|
+
props.onChange?.({
|
|
427
|
+
target: {
|
|
428
|
+
name: props.name,
|
|
429
|
+
value: valueToUpdate
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
bb304: switch (period) {
|
|
434
|
+
case "today": {
|
|
435
|
+
const date_2 = hooks();
|
|
436
|
+
localOnChange(date_2, date_2);
|
|
437
|
+
break bb304;
|
|
366
438
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
439
|
+
case "week": {
|
|
440
|
+
const startOfWeek = hooks().startOf("week");
|
|
441
|
+
const endOfWeek = hooks().endOf("week");
|
|
442
|
+
localOnChange(startOfWeek, endOfWeek);
|
|
443
|
+
break bb304;
|
|
444
|
+
}
|
|
445
|
+
case "lastweek": {
|
|
446
|
+
const startOfLastWeek = hooks().add(-1, "week").startOf("week");
|
|
447
|
+
const endOfLastWeek = hooks().add(-1, "week").endOf("week");
|
|
448
|
+
localOnChange(startOfLastWeek, endOfLastWeek);
|
|
449
|
+
break bb304;
|
|
450
|
+
}
|
|
451
|
+
case "last15": {
|
|
452
|
+
const startOfLastFifteenDays = hooks().add(-14, "d");
|
|
453
|
+
const endOfLastFifteenDays = hooks();
|
|
454
|
+
localOnChange(startOfLastFifteenDays, endOfLastFifteenDays);
|
|
455
|
+
break bb304;
|
|
456
|
+
}
|
|
457
|
+
case "month": {
|
|
458
|
+
const startOfMonth_0 = hooks().startOf("month");
|
|
459
|
+
const endOfMonth_0 = hooks().endOf("month");
|
|
460
|
+
localOnChange(startOfMonth_0, endOfMonth_0);
|
|
461
|
+
break bb304;
|
|
462
|
+
}
|
|
463
|
+
case "lastmonth": {
|
|
464
|
+
const startOfMonth = hooks().add(-1, "month").startOf("month");
|
|
465
|
+
const endOfMonth = hooks().add(-1, "month").endOf("month");
|
|
466
|
+
localOnChange(startOfMonth, endOfMonth);
|
|
467
|
+
break bb304;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
finalInputRef?.current?.focus?.();
|
|
471
|
+
if (shouldCloseOnSelect) {
|
|
472
|
+
handleChangeCalendarBoxState(false);
|
|
473
|
+
}
|
|
399
474
|
};
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (date_3.isValid()) {
|
|
430
|
-
setMaskValue_0(date_3.format(ptbrFormat));
|
|
475
|
+
$[38] = finalName;
|
|
476
|
+
$[39] = handleChangeCalendarBoxState;
|
|
477
|
+
$[40] = initialName;
|
|
478
|
+
$[41] = props;
|
|
479
|
+
$[42] = returnValueType;
|
|
480
|
+
$[43] = shouldCloseOnSelect;
|
|
481
|
+
$[44] = t40;
|
|
482
|
+
} else {
|
|
483
|
+
t40 = $[44];
|
|
484
|
+
}
|
|
485
|
+
const handleChangeUpdateDateStateWithPredefinedPeriod = t40;
|
|
486
|
+
let t41;
|
|
487
|
+
if ($[45] !== calendarBoxOpen || $[46] !== finalInputName || $[47] !== finalUnmaskedValue || $[48] !== handleChangeActiveDescendant || $[49] !== handleChangeCalendarBoxState || $[50] !== initialInputName || $[51] !== initialUnmaskedValue || $[52] !== props || $[53] !== selectedDate.final || $[54] !== selectedDate.inicial || $[55] !== setFinalMaskValue || $[56] !== setInitialMaskValue) {
|
|
488
|
+
t41 = (event, inputType_0) => {
|
|
489
|
+
props?.onBlur?.(event);
|
|
490
|
+
if (inputType_0 === "initial") {
|
|
491
|
+
if (event.relatedTarget?.id !== finalInputName) {
|
|
492
|
+
handleChangeCalendarBoxState(false);
|
|
493
|
+
}
|
|
494
|
+
if (calendarBoxOpen) {
|
|
495
|
+
handleChangeActiveDescendant((selectedDate.inicial ?? hooks()).format(TOKEN_ISO_FORMAT));
|
|
496
|
+
setCalendarDisplayDate(selectedDate.inicial ?? hooks());
|
|
497
|
+
}
|
|
498
|
+
if (_.size(initialUnmaskedValue) !== 8) {
|
|
499
|
+
const date_3 = hooks(selectedDate.inicial, TOKEN_ISO_FORMAT);
|
|
500
|
+
if (date_3.isValid()) {
|
|
501
|
+
setInitialMaskValue(date_3.format(TOKEN_PTBR_FORMAT));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
431
504
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
505
|
+
if (inputType_0 === "final") {
|
|
506
|
+
if (event.relatedTarget?.id !== initialInputName) {
|
|
507
|
+
handleChangeCalendarBoxState(false);
|
|
508
|
+
}
|
|
509
|
+
if (calendarBoxOpen) {
|
|
510
|
+
handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
|
|
511
|
+
setCalendarDisplayDate(selectedDate.final ?? hooks());
|
|
512
|
+
}
|
|
513
|
+
if (_.size(finalUnmaskedValue) !== 8) {
|
|
514
|
+
const date_4 = hooks(selectedDate.final, TOKEN_ISO_FORMAT);
|
|
515
|
+
if (date_4.isValid()) {
|
|
516
|
+
setFinalMaskValue(date_4.format(TOKEN_PTBR_FORMAT));
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
$[45] = calendarBoxOpen;
|
|
522
|
+
$[46] = finalInputName;
|
|
523
|
+
$[47] = finalUnmaskedValue;
|
|
524
|
+
$[48] = handleChangeActiveDescendant;
|
|
525
|
+
$[49] = handleChangeCalendarBoxState;
|
|
526
|
+
$[50] = initialInputName;
|
|
527
|
+
$[51] = initialUnmaskedValue;
|
|
528
|
+
$[52] = props;
|
|
529
|
+
$[53] = selectedDate.final;
|
|
530
|
+
$[54] = selectedDate.inicial;
|
|
531
|
+
$[55] = setFinalMaskValue;
|
|
532
|
+
$[56] = setInitialMaskValue;
|
|
533
|
+
$[57] = t41;
|
|
534
|
+
} else {
|
|
535
|
+
t41 = $[57];
|
|
536
|
+
}
|
|
537
|
+
const handleOnBlurMaskInput = t41;
|
|
538
|
+
let t42;
|
|
539
|
+
if ($[58] !== calendarBoxOpen || $[59] !== handleChangeActiveDescendant || $[60] !== openCalendarOnFocus || $[61] !== props || $[62] !== readOnly || $[63] !== selectedDate.final || $[64] !== selectedDate.inicial) {
|
|
540
|
+
t42 = (event_0, inputType_1) => {
|
|
454
541
|
props?.onFocus?.(event_0);
|
|
455
542
|
if (!readOnly && !calendarBoxOpen && openCalendarOnFocus) {
|
|
456
|
-
|
|
543
|
+
setCalendarBoxOpen(true);
|
|
457
544
|
}
|
|
458
|
-
|
|
459
|
-
if (inputType_4 === "initial") {
|
|
545
|
+
if (inputType_1 === "initial") {
|
|
460
546
|
handleChangeActiveDescendant((selectedDate.inicial ?? hooks()).format(TOKEN_ISO_FORMAT));
|
|
461
|
-
|
|
547
|
+
setCalendarDisplayDate(selectedDate.inicial ?? hooks());
|
|
462
548
|
}
|
|
463
|
-
if (
|
|
549
|
+
if (inputType_1 === "final") {
|
|
464
550
|
handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
|
|
465
|
-
|
|
551
|
+
setCalendarDisplayDate(selectedDate.final ?? hooks());
|
|
466
552
|
}
|
|
467
553
|
};
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
472
|
-
$[
|
|
473
|
-
$[
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
|
|
477
|
-
$[
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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)
|
|
554
|
+
$[58] = calendarBoxOpen;
|
|
555
|
+
$[59] = handleChangeActiveDescendant;
|
|
556
|
+
$[60] = openCalendarOnFocus;
|
|
557
|
+
$[61] = props;
|
|
558
|
+
$[62] = readOnly;
|
|
559
|
+
$[63] = selectedDate.final;
|
|
560
|
+
$[64] = selectedDate.inicial;
|
|
561
|
+
$[65] = t42;
|
|
562
|
+
} else {
|
|
563
|
+
t42 = $[65];
|
|
564
|
+
}
|
|
565
|
+
const handleOnFocusMaskInput = t42;
|
|
566
|
+
let t43;
|
|
567
|
+
if ($[66] !== activeDescendant || $[67] !== calendarBoxOpen || $[68] !== handleChangeUpdateDateState || $[69] !== props) {
|
|
568
|
+
t43 = (event_1, inputType_2) => {
|
|
569
|
+
props?.onKeyDown?.(event_1);
|
|
570
|
+
if (calendarBoxOpen && event_1.key && !event_1.shiftKey && !event_1.altKey && event_1.key === Keys.enter) {
|
|
571
|
+
event_1.preventDefault();
|
|
572
|
+
const rawDate_0 = hooks(_.toString(activeDescendant), TOKEN_ISO_FORMAT);
|
|
573
|
+
handleChangeUpdateDateState({
|
|
574
|
+
date: rawDate_0,
|
|
575
|
+
inputType: inputType_2
|
|
576
|
+
});
|
|
499
577
|
}
|
|
500
578
|
};
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
579
|
+
$[66] = activeDescendant;
|
|
580
|
+
$[67] = calendarBoxOpen;
|
|
581
|
+
$[68] = handleChangeUpdateDateState;
|
|
582
|
+
$[69] = props;
|
|
583
|
+
$[70] = t43;
|
|
584
|
+
} else {
|
|
585
|
+
t43 = $[70];
|
|
586
|
+
}
|
|
587
|
+
const handleOnKeyDownMaskInput = t43;
|
|
588
|
+
let t44;
|
|
589
|
+
if ($[71] !== props || $[72] !== undigitable) {
|
|
590
|
+
t44 = (event_2) => {
|
|
591
|
+
if (undigitable) {
|
|
592
|
+
event_2.preventDefault();
|
|
593
|
+
} else {
|
|
594
|
+
props.onPaste?.(event_2);
|
|
508
595
|
}
|
|
509
|
-
|
|
510
|
-
|
|
596
|
+
};
|
|
597
|
+
$[71] = props;
|
|
598
|
+
$[72] = undigitable;
|
|
599
|
+
$[73] = t44;
|
|
600
|
+
} else {
|
|
601
|
+
t44 = $[73];
|
|
602
|
+
}
|
|
603
|
+
const handleOnPaste = t44;
|
|
604
|
+
let t45;
|
|
605
|
+
if ($[74] !== props || $[75] !== undigitable) {
|
|
606
|
+
t45 = (event_3) => {
|
|
607
|
+
if (undigitable) {
|
|
608
|
+
event_3.preventDefault();
|
|
609
|
+
} else {
|
|
610
|
+
props.onBeforeInput?.(event_3);
|
|
511
611
|
}
|
|
512
612
|
};
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
613
|
+
$[74] = props;
|
|
614
|
+
$[75] = undigitable;
|
|
615
|
+
$[76] = t45;
|
|
516
616
|
} else {
|
|
517
|
-
|
|
617
|
+
t45 = $[76];
|
|
518
618
|
}
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}
|
|
600
|
-
const
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
619
|
+
const handleOnBeforeInput = t45;
|
|
620
|
+
let t46;
|
|
621
|
+
if ($[77] !== calendarBoxOpen || $[78] !== handleChangeCalendarBoxState || $[79] !== handleChangeNextMonth || $[80] !== handleChangePreviousMonth || $[81] !== handleNavigateWithDays || $[82] !== handleNavigateWithWeeks) {
|
|
622
|
+
t46 = (event_4) => {
|
|
623
|
+
if (calendarBoxOpen && event_4.key && !event_4.shiftKey && !event_4.altKey && NAVIGATION_KEYS.includes(event_4.key)) {
|
|
624
|
+
event_4.preventDefault();
|
|
625
|
+
bb466: switch (event_4.key) {
|
|
626
|
+
case Keys.arrowLeft: {
|
|
627
|
+
handleNavigateWithDays(-1);
|
|
628
|
+
break bb466;
|
|
629
|
+
}
|
|
630
|
+
case Keys.arrowRight: {
|
|
631
|
+
handleNavigateWithDays(1);
|
|
632
|
+
break bb466;
|
|
633
|
+
}
|
|
634
|
+
case Keys.arrowUp: {
|
|
635
|
+
handleNavigateWithDays(-7);
|
|
636
|
+
break bb466;
|
|
637
|
+
}
|
|
638
|
+
case Keys.arrowDown: {
|
|
639
|
+
handleNavigateWithDays(7);
|
|
640
|
+
break bb466;
|
|
641
|
+
}
|
|
642
|
+
case Keys.pageUp: {
|
|
643
|
+
handleChangeNextMonth();
|
|
644
|
+
break bb466;
|
|
645
|
+
}
|
|
646
|
+
case Keys.pageDown: {
|
|
647
|
+
handleChangePreviousMonth();
|
|
648
|
+
break bb466;
|
|
649
|
+
}
|
|
650
|
+
case Keys.home: {
|
|
651
|
+
handleNavigateWithWeeks("start");
|
|
652
|
+
break bb466;
|
|
653
|
+
}
|
|
654
|
+
case Keys.end: {
|
|
655
|
+
handleNavigateWithWeeks("end");
|
|
656
|
+
break bb466;
|
|
657
|
+
}
|
|
658
|
+
case Keys.escape: {
|
|
659
|
+
handleChangeCalendarBoxState(false);
|
|
660
|
+
break bb466;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
$[77] = calendarBoxOpen;
|
|
666
|
+
$[78] = handleChangeCalendarBoxState;
|
|
667
|
+
$[79] = handleChangeNextMonth;
|
|
668
|
+
$[80] = handleChangePreviousMonth;
|
|
669
|
+
$[81] = handleNavigateWithDays;
|
|
670
|
+
$[82] = handleNavigateWithWeeks;
|
|
671
|
+
$[83] = t46;
|
|
672
|
+
} else {
|
|
673
|
+
t46 = $[83];
|
|
674
|
+
}
|
|
675
|
+
const handleOnKeyDown = t46;
|
|
676
|
+
let t47;
|
|
677
|
+
if ($[84] !== finalName || $[85] !== initialName || $[86] !== props.value || $[87] !== setFinalMaskValue || $[88] !== setInitialMaskValue) {
|
|
678
|
+
t47 = () => {
|
|
679
|
+
if (props?.value) {
|
|
680
|
+
const objectValue_0 = props.value;
|
|
681
|
+
const initialDate_1 = hooks(_.toString(objectValue_0[initialName]), TOKEN_ISO_FORMAT);
|
|
682
|
+
const finalDate_1 = hooks(_.toString(objectValue_0[finalName]), TOKEN_ISO_FORMAT);
|
|
683
|
+
setSelectedDate(() => ({
|
|
684
|
+
inicial: initialDate_1.isValid() ? initialDate_1 : null,
|
|
685
|
+
final: finalDate_1.isValid() ? finalDate_1 : null
|
|
686
|
+
}));
|
|
687
|
+
setInitialMaskValue(initialDate_1.format(TOKEN_PTBR_FORMAT));
|
|
688
|
+
setFinalMaskValue(finalDate_1.format(TOKEN_PTBR_FORMAT));
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
$[84] = finalName;
|
|
692
|
+
$[85] = initialName;
|
|
693
|
+
$[86] = props.value;
|
|
694
|
+
$[87] = setFinalMaskValue;
|
|
695
|
+
$[88] = setInitialMaskValue;
|
|
696
|
+
$[89] = t47;
|
|
697
|
+
} else {
|
|
698
|
+
t47 = $[89];
|
|
699
|
+
}
|
|
700
|
+
const t48 = props?.value;
|
|
701
|
+
let t49;
|
|
702
|
+
if ($[90] !== t48) {
|
|
703
|
+
t49 = [t48];
|
|
704
|
+
$[90] = t48;
|
|
705
|
+
$[91] = t49;
|
|
706
|
+
} else {
|
|
707
|
+
t49 = $[91];
|
|
708
|
+
}
|
|
709
|
+
React.useEffect(t47, t49);
|
|
710
|
+
const t50 = Boolean(readOnly);
|
|
711
|
+
const t51 = Boolean(readOnly);
|
|
712
|
+
const t52 = verifyPeriodSelectedIsValid();
|
|
713
|
+
let t53;
|
|
714
|
+
if ($[92] !== activeDescendant || $[93] !== calendarBoxOpen || $[94] !== calendarDisplayDate || $[95] !== finalInputName || $[96] !== handleChangeActiveDescendant || $[97] !== handleChangeCalendarBoxState || $[98] !== handleChangeCalendarDisplayDate || $[99] !== handleChangeNextMonth || $[100] !== handleChangePreviousMonth || $[101] !== handleChangeSelectedDate || $[102] !== handleChangeUpdateDateState || $[103] !== handleChangeUpdateDateStateWithPredefinedPeriod || $[104] !== handleOnClickClearSelectedPeriod || $[105] !== hasValidationErrors || $[106] !== initialInputName || $[107] !== openCalendarOnFocus || $[108] !== selectedDate || $[109] !== showCalendarButton || $[110] !== showClearDateButton || $[111] !== showPredefinedPeriodsButton || $[112] !== skeletonize || $[113] !== t50 || $[114] !== t51 || $[115] !== t52 || $[116] !== undigitable) {
|
|
715
|
+
t53 = {
|
|
716
|
+
isReadOnly: t50,
|
|
717
|
+
isDisabled: t51,
|
|
610
718
|
undigitable,
|
|
611
719
|
skeletonize,
|
|
720
|
+
dateContainerRef,
|
|
721
|
+
calendarBoxOpen,
|
|
722
|
+
activeDescendant,
|
|
612
723
|
selectedDate,
|
|
613
|
-
minDate,
|
|
614
|
-
maxDate,
|
|
615
724
|
initialInputId: initialInputName,
|
|
616
725
|
finalInputId: finalInputName,
|
|
617
726
|
initialInputRef,
|
|
618
727
|
finalInputRef,
|
|
619
728
|
showCalendarButton,
|
|
729
|
+
calendarDisplayDate,
|
|
620
730
|
hasValidationErrors,
|
|
621
731
|
openCalendarOnFocus,
|
|
622
732
|
showPredefinedPeriodsButton,
|
|
623
733
|
showClearDateButton,
|
|
624
|
-
|
|
734
|
+
handleChangeSelectedDate,
|
|
735
|
+
handleChangePreviousMonth,
|
|
736
|
+
handleChangeNextMonth,
|
|
737
|
+
handleChangeCalendarBoxState,
|
|
738
|
+
handleChangeActiveDescendant,
|
|
739
|
+
handleChangeCalendarDisplayDate,
|
|
740
|
+
handleChangeUpdateDateState,
|
|
625
741
|
handleOnClickClearSelectedPeriod,
|
|
626
742
|
handleChangeUpdateDateStateWithPredefinedPeriod,
|
|
627
|
-
hasValidPeriodSelected:
|
|
743
|
+
hasValidPeriodSelected: t52
|
|
628
744
|
};
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
$[
|
|
633
|
-
$[
|
|
634
|
-
$[
|
|
635
|
-
$[
|
|
636
|
-
$[
|
|
637
|
-
$[
|
|
638
|
-
$[
|
|
639
|
-
$[
|
|
640
|
-
$[
|
|
641
|
-
$[
|
|
642
|
-
$[
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
$[
|
|
649
|
-
$[
|
|
650
|
-
$[
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
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;
|
|
745
|
+
$[92] = activeDescendant;
|
|
746
|
+
$[93] = calendarBoxOpen;
|
|
747
|
+
$[94] = calendarDisplayDate;
|
|
748
|
+
$[95] = finalInputName;
|
|
749
|
+
$[96] = handleChangeActiveDescendant;
|
|
750
|
+
$[97] = handleChangeCalendarBoxState;
|
|
751
|
+
$[98] = handleChangeCalendarDisplayDate;
|
|
752
|
+
$[99] = handleChangeNextMonth;
|
|
753
|
+
$[100] = handleChangePreviousMonth;
|
|
754
|
+
$[101] = handleChangeSelectedDate;
|
|
755
|
+
$[102] = handleChangeUpdateDateState;
|
|
756
|
+
$[103] = handleChangeUpdateDateStateWithPredefinedPeriod;
|
|
757
|
+
$[104] = handleOnClickClearSelectedPeriod;
|
|
758
|
+
$[105] = hasValidationErrors;
|
|
759
|
+
$[106] = initialInputName;
|
|
760
|
+
$[107] = openCalendarOnFocus;
|
|
761
|
+
$[108] = selectedDate;
|
|
762
|
+
$[109] = showCalendarButton;
|
|
763
|
+
$[110] = showClearDateButton;
|
|
764
|
+
$[111] = showPredefinedPeriodsButton;
|
|
765
|
+
$[112] = skeletonize;
|
|
766
|
+
$[113] = t50;
|
|
767
|
+
$[114] = t51;
|
|
768
|
+
$[115] = t52;
|
|
769
|
+
$[116] = undigitable;
|
|
770
|
+
$[117] = t53;
|
|
684
771
|
} else {
|
|
685
|
-
|
|
772
|
+
t53 = $[117];
|
|
686
773
|
}
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
$[
|
|
774
|
+
const contextValues = t53;
|
|
775
|
+
let t54;
|
|
776
|
+
if ($[118] !== customClassLabel || $[119] !== disabled || $[120] !== hasHintMessages || $[121] !== hasLabel || $[122] !== hintPosition || $[123] !== initialInputName || $[124] !== label || $[125] !== labelUppercase || $[126] !== popoverAlign || $[127] !== props.hint || $[128] !== props.required || $[129] !== readOnly || $[130] !== skeletonize || $[131] !== themePopover) {
|
|
777
|
+
t54 = 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 });
|
|
778
|
+
$[118] = customClassLabel;
|
|
779
|
+
$[119] = disabled;
|
|
780
|
+
$[120] = hasHintMessages;
|
|
781
|
+
$[121] = hasLabel;
|
|
782
|
+
$[122] = hintPosition;
|
|
783
|
+
$[123] = initialInputName;
|
|
784
|
+
$[124] = label;
|
|
785
|
+
$[125] = labelUppercase;
|
|
786
|
+
$[126] = popoverAlign;
|
|
787
|
+
$[127] = props.hint;
|
|
788
|
+
$[128] = props.required;
|
|
789
|
+
$[129] = readOnly;
|
|
790
|
+
$[130] = skeletonize;
|
|
791
|
+
$[131] = themePopover;
|
|
792
|
+
$[132] = t54;
|
|
692
793
|
} else {
|
|
693
|
-
|
|
794
|
+
t54 = $[132];
|
|
694
795
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
796
|
+
const t55 = _.omit(rest, ["initialRef", "finalRef"]);
|
|
797
|
+
const t56 = props?.initialRef;
|
|
798
|
+
let t57;
|
|
799
|
+
if ($[133] !== t56) {
|
|
800
|
+
t57 = mergeRefs(initialInputRef, t56);
|
|
801
|
+
$[133] = t56;
|
|
802
|
+
$[134] = t57;
|
|
700
803
|
} else {
|
|
701
|
-
|
|
804
|
+
t57 = $[134];
|
|
702
805
|
}
|
|
703
|
-
let
|
|
704
|
-
if ($[
|
|
705
|
-
|
|
706
|
-
$[
|
|
707
|
-
$[
|
|
806
|
+
let t58;
|
|
807
|
+
if ($[135] !== handleOnBlurMaskInput) {
|
|
808
|
+
t58 = (event_5) => handleOnBlurMaskInput(event_5, "initial");
|
|
809
|
+
$[135] = handleOnBlurMaskInput;
|
|
810
|
+
$[136] = t58;
|
|
708
811
|
} else {
|
|
709
|
-
|
|
812
|
+
t58 = $[136];
|
|
710
813
|
}
|
|
711
|
-
let
|
|
712
|
-
if ($[
|
|
713
|
-
|
|
714
|
-
$[
|
|
814
|
+
let t59;
|
|
815
|
+
if ($[137] !== handleOnFocusMaskInput) {
|
|
816
|
+
t59 = (event_6) => handleOnFocusMaskInput(event_6, "initial");
|
|
817
|
+
$[137] = handleOnFocusMaskInput;
|
|
818
|
+
$[138] = t59;
|
|
715
819
|
} else {
|
|
716
|
-
|
|
820
|
+
t59 = $[138];
|
|
717
821
|
}
|
|
718
|
-
let
|
|
719
|
-
if ($[
|
|
720
|
-
|
|
721
|
-
$[
|
|
722
|
-
$[
|
|
723
|
-
$[88] = t41;
|
|
822
|
+
let t60;
|
|
823
|
+
if ($[139] !== handleOnKeyDownMaskInput) {
|
|
824
|
+
t60 = (event_7) => handleOnKeyDownMaskInput(event_7, "initial");
|
|
825
|
+
$[139] = handleOnKeyDownMaskInput;
|
|
826
|
+
$[140] = t60;
|
|
724
827
|
} else {
|
|
725
|
-
|
|
828
|
+
t60 = $[140];
|
|
726
829
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
if ($[89] !== finalInputRef || $[90] !== t44) {
|
|
732
|
-
t45 = mergeRefs(finalInputRef, t44);
|
|
733
|
-
$[89] = finalInputRef;
|
|
734
|
-
$[90] = t44;
|
|
735
|
-
$[91] = t45;
|
|
830
|
+
let t61;
|
|
831
|
+
if ($[141] === Symbol.for("react.memo_cache_sentinel")) {
|
|
832
|
+
t61 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
|
|
833
|
+
$[141] = t61;
|
|
736
834
|
} else {
|
|
737
|
-
|
|
835
|
+
t61 = $[141];
|
|
738
836
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
$[
|
|
744
|
-
$[
|
|
837
|
+
let t62;
|
|
838
|
+
if ($[142] !== disabled || $[143] !== readOnly) {
|
|
839
|
+
t62 = /* @__PURE__ */ jsx("span", { className: "separator", "data-state-disabled": disabled, "data-state-read-only": readOnly, onMouseDown: _temp5, children: t61 });
|
|
840
|
+
$[142] = disabled;
|
|
841
|
+
$[143] = readOnly;
|
|
842
|
+
$[144] = t62;
|
|
745
843
|
} else {
|
|
746
|
-
|
|
844
|
+
t62 = $[144];
|
|
747
845
|
}
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
846
|
+
const t63 = inputs2_date_base_index;
|
|
847
|
+
const t64 = _.omit(rest, ["initialRef", "finalRef"]);
|
|
848
|
+
const t65 = props?.finalRef;
|
|
849
|
+
let t66;
|
|
850
|
+
if ($[145] !== t65) {
|
|
851
|
+
t66 = mergeRefs(finalInputRef, t65);
|
|
852
|
+
$[145] = t65;
|
|
853
|
+
$[146] = t66;
|
|
753
854
|
} else {
|
|
754
|
-
|
|
855
|
+
t66 = $[146];
|
|
755
856
|
}
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
$[
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
let t50;
|
|
765
|
-
if ($[98] !== activeDescendant || $[99] !== calendarBoxOpen || $[100] !== customClass || $[101] !== disabled || $[102] !== finalInputName || $[103] !== finalMaskedValue || $[104] !== handleFinalKeyDownCapture || $[105] !== handleOnBeforeInput || $[106] !== handleOnPaste || $[107] !== hasValidationErrors || $[108] !== inputPlaceholder || $[109] !== readOnly || $[110] !== skeletonize || $[111] !== t42.Input || $[112] !== t43 || $[113] !== t45 || $[114] !== t46 || $[115] !== t47 || $[116] !== t48 || $[117] !== t49 || $[118] !== textAlign || $[119] !== undigitable) {
|
|
766
|
-
t50 = /* @__PURE__ */ jsx(t42.Input, { ...t43, ref: t45, id: finalInputName, name: finalInputName, value: finalMaskedValue, readOnly, disabled, customClass, tabIndex: t46, placeholder: inputPlaceholder, "aria-autocomplete": "list", "aria-activedescendant": activeDescendant, "aria-expanded": calendarBoxOpen, "aria-controls": finalInputName, "aria-labelledby": finalInputName, "data-testid": "test-date-period-field-final-input", "data-state-is-period-input": true, "data-state-error": hasValidationErrors, "data-state-read-only": readOnly, "data-state-text-align": textAlign, "data-state-undigitable": undigitable, "data-state-skeletonize": skeletonize, onPaste: handleOnPaste, onBeforeInput: handleOnBeforeInput, onBlur: t47, onFocus: t48, onKeyDown: t49, onKeyDownCapture: handleFinalKeyDownCapture });
|
|
767
|
-
$[98] = activeDescendant;
|
|
768
|
-
$[99] = calendarBoxOpen;
|
|
769
|
-
$[100] = customClass;
|
|
770
|
-
$[101] = disabled;
|
|
771
|
-
$[102] = finalInputName;
|
|
772
|
-
$[103] = finalMaskedValue;
|
|
773
|
-
$[104] = handleFinalKeyDownCapture;
|
|
774
|
-
$[105] = handleOnBeforeInput;
|
|
775
|
-
$[106] = handleOnPaste;
|
|
776
|
-
$[107] = hasValidationErrors;
|
|
777
|
-
$[108] = inputPlaceholder;
|
|
778
|
-
$[109] = readOnly;
|
|
779
|
-
$[110] = skeletonize;
|
|
780
|
-
$[111] = t42.Input;
|
|
781
|
-
$[112] = t43;
|
|
782
|
-
$[113] = t45;
|
|
783
|
-
$[114] = t46;
|
|
784
|
-
$[115] = t47;
|
|
785
|
-
$[116] = t48;
|
|
786
|
-
$[117] = t49;
|
|
787
|
-
$[118] = textAlign;
|
|
788
|
-
$[119] = undigitable;
|
|
789
|
-
$[120] = t50;
|
|
790
|
-
} else {
|
|
791
|
-
t50 = $[120];
|
|
792
|
-
}
|
|
793
|
-
let t51;
|
|
794
|
-
if ($[121] === Symbol.for("react.memo_cache_sentinel")) {
|
|
795
|
-
t51 = /* @__PURE__ */ jsx(Triggers, {});
|
|
796
|
-
$[121] = t51;
|
|
797
|
-
} else {
|
|
798
|
-
t51 = $[121];
|
|
799
|
-
}
|
|
800
|
-
let 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;
|
|
821
|
-
} else {
|
|
822
|
-
t52 = $[139];
|
|
857
|
+
const t67 = !readOnly && !skeletonize ? 0 : -1;
|
|
858
|
+
let t68;
|
|
859
|
+
if ($[147] !== handleOnBlurMaskInput) {
|
|
860
|
+
t68 = (event_9) => handleOnBlurMaskInput(event_9, "final");
|
|
861
|
+
$[147] = handleOnBlurMaskInput;
|
|
862
|
+
$[148] = t68;
|
|
863
|
+
} else {
|
|
864
|
+
t68 = $[148];
|
|
823
865
|
}
|
|
824
|
-
let
|
|
825
|
-
if ($[
|
|
826
|
-
|
|
827
|
-
$[
|
|
828
|
-
$[
|
|
829
|
-
$[142] = hintPosition;
|
|
830
|
-
$[143] = props.hint;
|
|
831
|
-
$[144] = skeletonize;
|
|
832
|
-
$[145] = t53;
|
|
866
|
+
let t69;
|
|
867
|
+
if ($[149] !== handleOnFocusMaskInput) {
|
|
868
|
+
t69 = (event_10) => handleOnFocusMaskInput(event_10, "final");
|
|
869
|
+
$[149] = handleOnFocusMaskInput;
|
|
870
|
+
$[150] = t69;
|
|
833
871
|
} else {
|
|
834
|
-
|
|
872
|
+
t69 = $[150];
|
|
835
873
|
}
|
|
836
|
-
let
|
|
837
|
-
if ($[
|
|
838
|
-
|
|
839
|
-
$[
|
|
840
|
-
$[
|
|
841
|
-
|
|
842
|
-
$[
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
$[
|
|
851
|
-
$[
|
|
852
|
-
$[
|
|
853
|
-
$[
|
|
854
|
-
|
|
855
|
-
|
|
874
|
+
let t70;
|
|
875
|
+
if ($[151] !== handleOnKeyDownMaskInput) {
|
|
876
|
+
t70 = (event_11) => handleOnKeyDownMaskInput(event_11, "final");
|
|
877
|
+
$[151] = handleOnKeyDownMaskInput;
|
|
878
|
+
$[152] = t70;
|
|
879
|
+
} else {
|
|
880
|
+
t70 = $[152];
|
|
881
|
+
}
|
|
882
|
+
let t71;
|
|
883
|
+
if ($[153] !== activeDescendant || $[154] !== calendarBoxOpen || $[155] !== customClass || $[156] !== disabled || $[157] !== finalInputName || $[158] !== finalMaskedValue || $[159] !== handleOnBeforeInput || $[160] !== handleOnPaste || $[161] !== hasValidationErrors || $[162] !== placeholder || $[163] !== readOnly || $[164] !== skeletonize || $[165] !== t63.Input || $[166] !== t64 || $[167] !== t66 || $[168] !== t67 || $[169] !== t68 || $[170] !== t69 || $[171] !== t70 || $[172] !== textAlign || $[173] !== undigitable) {
|
|
884
|
+
t71 = /* @__PURE__ */ jsx(t63.Input, { ...t64, ref: t66, id: finalInputName, name: finalInputName, value: finalMaskedValue, readOnly, disabled, customClass, tabIndex: t67, placeholder, "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: t68, onFocus: t69, onKeyDown: t70 });
|
|
885
|
+
$[153] = activeDescendant;
|
|
886
|
+
$[154] = calendarBoxOpen;
|
|
887
|
+
$[155] = customClass;
|
|
888
|
+
$[156] = disabled;
|
|
889
|
+
$[157] = finalInputName;
|
|
890
|
+
$[158] = finalMaskedValue;
|
|
891
|
+
$[159] = handleOnBeforeInput;
|
|
892
|
+
$[160] = handleOnPaste;
|
|
893
|
+
$[161] = hasValidationErrors;
|
|
894
|
+
$[162] = placeholder;
|
|
895
|
+
$[163] = readOnly;
|
|
896
|
+
$[164] = skeletonize;
|
|
897
|
+
$[165] = t63.Input;
|
|
898
|
+
$[166] = t64;
|
|
899
|
+
$[167] = t66;
|
|
900
|
+
$[168] = t67;
|
|
901
|
+
$[169] = t68;
|
|
902
|
+
$[170] = t69;
|
|
903
|
+
$[171] = t70;
|
|
904
|
+
$[172] = textAlign;
|
|
905
|
+
$[173] = undigitable;
|
|
906
|
+
$[174] = t71;
|
|
907
|
+
} else {
|
|
908
|
+
t71 = $[174];
|
|
909
|
+
}
|
|
910
|
+
let t72;
|
|
911
|
+
if ($[175] === Symbol.for("react.memo_cache_sentinel")) {
|
|
912
|
+
t72 = /* @__PURE__ */ jsx(Triggers, {});
|
|
913
|
+
$[175] = t72;
|
|
914
|
+
} else {
|
|
915
|
+
t72 = $[175];
|
|
916
|
+
}
|
|
917
|
+
let t73;
|
|
918
|
+
if ($[176] !== calendarBoxOpen) {
|
|
919
|
+
t73 = calendarBoxOpen && createPortal(/* @__PURE__ */ jsx(CalendarBox, { ref: calendarRef }), document.body);
|
|
920
|
+
$[176] = calendarBoxOpen;
|
|
921
|
+
$[177] = t73;
|
|
922
|
+
} else {
|
|
923
|
+
t73 = $[177];
|
|
924
|
+
}
|
|
925
|
+
let t74;
|
|
926
|
+
if ($[178] !== disabled || $[179] !== hasHintMessages || $[180] !== hintPosition || $[181] !== props.hint || $[182] !== skeletonize) {
|
|
927
|
+
t74 = hintPosition === "below" && /* @__PURE__ */ jsx(Hint, { customClass: "hint", description: props.hint, disabled, skeletonize, visible: hasHintMessages });
|
|
928
|
+
$[178] = disabled;
|
|
929
|
+
$[179] = hasHintMessages;
|
|
930
|
+
$[180] = hintPosition;
|
|
931
|
+
$[181] = props.hint;
|
|
932
|
+
$[182] = skeletonize;
|
|
933
|
+
$[183] = t74;
|
|
934
|
+
} else {
|
|
935
|
+
t74 = $[183];
|
|
936
|
+
}
|
|
937
|
+
let t75;
|
|
938
|
+
if ($[184] !== errors || $[185] !== hasValidationErrors || $[186] !== label || $[187] !== skeletonize) {
|
|
939
|
+
t75 = 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(_temp6) });
|
|
940
|
+
$[184] = errors;
|
|
941
|
+
$[185] = hasValidationErrors;
|
|
942
|
+
$[186] = label;
|
|
943
|
+
$[187] = skeletonize;
|
|
944
|
+
$[188] = t75;
|
|
945
|
+
} else {
|
|
946
|
+
t75 = $[188];
|
|
947
|
+
}
|
|
948
|
+
let t76;
|
|
949
|
+
if ($[189] !== tooltip || $[190] !== tooltipPosition || $[191] !== tooltipWidth) {
|
|
950
|
+
t76 = /* @__PURE__ */ jsx(Tooltip, { targetRef: inputRootRef, text: tooltip, width: tooltipWidth, position: tooltipPosition });
|
|
951
|
+
$[189] = tooltip;
|
|
952
|
+
$[190] = tooltipPosition;
|
|
953
|
+
$[191] = tooltipWidth;
|
|
954
|
+
$[192] = t76;
|
|
955
|
+
} else {
|
|
956
|
+
t76 = $[192];
|
|
856
957
|
}
|
|
857
958
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
858
959
|
/* @__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: [
|
|
859
|
-
|
|
860
|
-
/* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, "data-testid": "test-date-period-field-container", onKeyDown:
|
|
861
|
-
/* @__PURE__ */ jsx(Input, { ...
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
960
|
+
t54,
|
|
961
|
+
/* @__PURE__ */ jsxs(Container, { ref: dateContainerRef, "data-testid": "test-date-period-field-container", onKeyDown: handleOnKeyDown, skeletonize, customClassInputContainer, children: [
|
|
962
|
+
/* @__PURE__ */ jsx(Input, { ...t55, ref: t57, id: initialInputName, name: initialInputName, value: initialMaskedValue, disabled, readOnly, customClass, tabIndex: !readOnly && !skeletonize ? 0 : -1, placeholder, "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: t58, onFocus: t59, onKeyDown: t60 }),
|
|
963
|
+
t62,
|
|
964
|
+
t71,
|
|
965
|
+
t72
|
|
865
966
|
] }),
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
967
|
+
t73,
|
|
968
|
+
t74,
|
|
969
|
+
t75
|
|
869
970
|
] }) }),
|
|
870
|
-
|
|
971
|
+
t76
|
|
871
972
|
] });
|
|
872
973
|
});
|
|
873
974
|
InputBase.displayName = "DatePeriodFieldInputBase";
|
|
874
|
-
function _temp() {
|
|
975
|
+
function _temp(prevDisplayDate) {
|
|
976
|
+
return prevDisplayDate.clone().subtract(1, "month");
|
|
977
|
+
}
|
|
978
|
+
function _temp2(prevDisplayDate_0) {
|
|
979
|
+
return prevDisplayDate_0.clone().add(1, "month");
|
|
980
|
+
}
|
|
981
|
+
function _temp3() {
|
|
875
982
|
return {
|
|
876
983
|
inicial: null,
|
|
877
984
|
final: null
|
|
878
985
|
};
|
|
879
986
|
}
|
|
880
|
-
function
|
|
881
|
-
|
|
987
|
+
function _temp4(initialDate, finalDate) {
|
|
988
|
+
const inicial = initialDate?.isAfter(finalDate) ? finalDate : initialDate;
|
|
989
|
+
const final = initialDate?.isAfter(finalDate) ? initialDate : finalDate;
|
|
990
|
+
return {
|
|
991
|
+
inicial,
|
|
992
|
+
final
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function _temp5(event_8) {
|
|
996
|
+
event_8.preventDefault();
|
|
882
997
|
}
|
|
883
|
-
function
|
|
998
|
+
function _temp6(error, index) {
|
|
884
999
|
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
885
1000
|
error,
|
|
886
1001
|
" "
|