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