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.
Files changed (85) hide show
  1. package/lib/assets/styles/datepicker2.css +77 -4
  2. package/lib/inputs/number/Currency.js +19 -17
  3. package/lib/inputs/number/Currency.js.map +1 -1
  4. package/lib/inputs/number/Decimal.js +19 -17
  5. package/lib/inputs/number/Decimal.js.map +1 -1
  6. package/lib/inputs/number/index.js +17 -15
  7. package/lib/inputs/number/index.js.map +1 -1
  8. package/lib/inputs2/date/calendarbox.d.ts +23 -0
  9. package/lib/inputs2/date/calendarbox.js +254 -0
  10. package/lib/inputs2/date/calendarbox.js.map +1 -0
  11. package/lib/inputs2/date/datefield/base.js +590 -214
  12. package/lib/inputs2/date/datefield/base.js.map +1 -1
  13. package/lib/inputs2/date/datefield/triggers.js +4 -4
  14. package/lib/inputs2/date/datefield/triggers.js.map +1 -1
  15. package/lib/inputs2/date/datefield/types.d.ts +5 -12
  16. package/lib/inputs2/date/dateperiodfield/base.js +543 -674
  17. package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
  18. package/lib/inputs2/date/dateperiodfield/triggers.js +21 -9
  19. package/lib/inputs2/date/dateperiodfield/triggers.js.map +1 -1
  20. package/lib/inputs2/date/dateperiodfield/types.d.ts +7 -23
  21. package/lib/inputs2/date/helpers.d.ts +21 -4
  22. package/lib/inputs2/date/helpers.js +64 -4
  23. package/lib/inputs2/date/helpers.js.map +1 -1
  24. package/lib/inputs2/date/{base/constants.d.ts → hooks/useCalendarPosition.d.ts} +1 -1
  25. package/lib/inputs2/date/hooks/useCalendarPosition.js +93 -0
  26. package/lib/inputs2/date/hooks/useCalendarPosition.js.map +1 -0
  27. package/lib/inputs2/date/hooks/useDateCalendarState.d.ts +14 -0
  28. package/lib/inputs2/date/hooks/useDateCalendarState.js +250 -0
  29. package/lib/inputs2/date/hooks/useDateCalendarState.js.map +1 -0
  30. package/lib/inputs2/date/hooks/useDateMask.d.ts +20 -0
  31. package/lib/inputs2/date/hooks/useDateMask.js +178 -0
  32. package/lib/inputs2/date/hooks/useDateMask.js.map +1 -0
  33. package/lib/inputs2/date/timeselector.d.ts +15 -0
  34. package/lib/inputs2/date/timeselector.js +228 -0
  35. package/lib/inputs2/date/timeselector.js.map +1 -0
  36. package/lib/inputs2/date/types.d.ts +16 -1
  37. package/lib/inputs2/date/types.js.map +1 -1
  38. package/lib/inputs2/selectfield/base.js +1 -1
  39. package/lib/inputs2/selectfield/base.js.map +1 -1
  40. package/lib/menus/float/SubMenuContainer.d.ts +10 -28
  41. package/lib/menus/float/SubMenuContainer.js +97 -83
  42. package/lib/menus/float/SubMenuContainer.js.map +1 -1
  43. package/lib/node_modules/moment/dist/locale/pt-br.js +54 -0
  44. package/lib/node_modules/moment/dist/locale/pt-br.js.map +1 -0
  45. package/lib/treetable/helpers.d.ts +0 -2
  46. package/lib/treetable/helpers.js.map +1 -1
  47. package/package.json +1 -1
  48. package/lib/_virtual/index.js +0 -8
  49. package/lib/_virtual/index.js.map +0 -1
  50. package/lib/_virtual/index2.js +0 -5
  51. package/lib/_virtual/index2.js.map +0 -1
  52. package/lib/_virtual/index3.js +0 -5
  53. package/lib/_virtual/index3.js.map +0 -1
  54. package/lib/_virtual/react-is.development.js +0 -5
  55. package/lib/_virtual/react-is.development.js.map +0 -1
  56. package/lib/_virtual/react-is.production.min.js +0 -5
  57. package/lib/_virtual/react-is.production.min.js.map +0 -1
  58. package/lib/inputs2/date/base/constants.js +0 -69
  59. package/lib/inputs2/date/base/constants.js.map +0 -1
  60. package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -6
  61. package/lib/inputs2/date/datefield/calendarbox.js +0 -228
  62. package/lib/inputs2/date/datefield/calendarbox.js.map +0 -1
  63. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -6
  64. package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -282
  65. package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +0 -1
  66. package/lib/node_modules/object-assign/index.js +0 -79
  67. package/lib/node_modules/object-assign/index.js.map +0 -1
  68. package/lib/node_modules/prop-types/checkPropTypes.js +0 -69
  69. package/lib/node_modules/prop-types/checkPropTypes.js.map +0 -1
  70. package/lib/node_modules/prop-types/factoryWithThrowingShims.js +0 -59
  71. package/lib/node_modules/prop-types/factoryWithThrowingShims.js.map +0 -1
  72. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js +0 -452
  73. package/lib/node_modules/prop-types/factoryWithTypeCheckers.js.map +0 -1
  74. package/lib/node_modules/prop-types/index.js +0 -21
  75. package/lib/node_modules/prop-types/index.js.map +0 -1
  76. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js +0 -13
  77. package/lib/node_modules/prop-types/lib/ReactPropTypesSecret.js.map +0 -1
  78. package/lib/node_modules/prop-types/lib/has.js +0 -12
  79. package/lib/node_modules/prop-types/lib/has.js.map +0 -1
  80. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +0 -166
  81. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +0 -1
  82. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +0 -107
  83. package/lib/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +0 -1
  84. package/lib/node_modules/prop-types/node_modules/react-is/index.js +0 -18
  85. 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 { TOKEN_ISO_FORMAT, TOKEN_PTBR_FORMAT, TOKEN_MASK, NAVIGATION_KEYS } from "../helpers.js";
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(193);
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
- shouldCloseOnSelect: t15,
40
- showPredefinedPeriodsButton: t16,
41
- showClearDateButton: t17,
42
- placeholder: t18,
43
- returnValueType: t19,
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 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;
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
- t20 = {
88
+ t19 = {
74
89
  inicial: null,
75
90
  final: null
76
91
  };
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;
92
+ $[0] = t19;
87
93
  } else {
88
- t21 = $[1];
94
+ t19 = $[0];
89
95
  }
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;
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 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;
110
- } else {
111
- t23 = $[5];
112
- }
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;
120
- } else {
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;
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
- t25 = $[9];
126
+ t20 = $[3];
134
127
  }
135
- let t26;
136
- if ($[10] !== selectedDate.inicial) {
137
- t26 = selectedDate.inicial?.format(TOKEN_PTBR_FORMAT);
138
- $[10] = selectedDate.inicial;
139
- $[11] = t26;
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
- t26 = $[11];
136
+ t21 = $[6];
142
137
  }
138
+ const finalInputName = t21;
143
139
  const {
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
- }
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
- value: finalMaskedValue,
182
- setValue: setFinalMaskValue,
159
+ maskedValue: finalMaskedValue,
160
+ setMaskValue: setFinalMaskValue,
183
161
  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
- }
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 t29;
199
- if ($[15] !== props.label) {
200
- t29 = _.isEmpty(props?.label);
201
- $[15] = props.label;
202
- $[16] = t29;
175
+ let t22;
176
+ if ($[7] !== props.label) {
177
+ t22 = _.isEmpty(props?.label);
178
+ $[7] = props.label;
179
+ $[8] = t22;
203
180
  } else {
204
- t29 = $[16];
181
+ t22 = $[8];
205
182
  }
206
- const hasLabel = !t29;
183
+ const hasLabel = !t22;
207
184
  const hasHintMessages = Boolean(props.hint?.length);
208
185
  const hasValidationErrors = Boolean(errors?.length);
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");
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
- $[27] = finalName;
302
- $[28] = initialName;
303
- $[29] = props.value;
304
- $[30] = t38;
194
+ $[9] = finalName;
195
+ $[10] = initialName;
196
+ $[11] = props.value;
197
+ $[12] = t23;
305
198
  } else {
306
- t38 = $[30];
199
+ t23 = $[12];
307
200
  }
308
- const verifyPeriodSelectedIsValid = t38;
309
- let t39;
310
- if ($[31] !== finalName || $[32] !== handleChangeCalendarBoxState || $[33] !== initialName || $[34] !== props || $[35] !== setFinalMaskValue || $[36] !== setInitialMaskValue) {
311
- t39 = () => {
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(_temp3);
214
+ setSelectedDate(_temp);
322
215
  setInitialMaskValue("");
323
216
  setFinalMaskValue("");
324
- handleChangeCalendarBoxState(false);
217
+ handleSetCalendarBoxOpen(false);
325
218
  };
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;
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 = _temp4;
345
- bb185: switch (inputType) {
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(TOKEN_ISO_FORMAT) : inicial_3?.toISOString(),
367
- [finalName]: returnValueType === "default" ? final_3?.format(TOKEN_ISO_FORMAT) : final_3?.toISOString()
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 bb185;
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(TOKEN_ISO_FORMAT) : inicial_1?.toISOString(),
399
- [finalName]: returnValueType === "default" ? final_1?.format(TOKEN_ISO_FORMAT) : final_1?.toISOString()
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 (shouldCloseOnSelect) {
404
- handleChangeCalendarBoxState(false);
297
+ if (shouldCloseCalendarOnSelect) {
298
+ handleSetCalendarBoxOpen(false);
405
299
  }
406
- break bb185;
300
+ break bb165;
407
301
  }
408
302
  }
409
- setCalendarDisplayDate(rawDate.clone());
303
+ handleChangeActiveDescendant(rawDate.format(TOKEN_ISO_FORMAT));
304
+ handleChangeCalendarDisplayDate(rawDate.clone());
410
305
  };
411
- let t40;
412
- if ($[38] !== finalName || $[39] !== handleChangeCalendarBoxState || $[40] !== initialName || $[41] !== props || $[42] !== returnValueType || $[43] !== shouldCloseOnSelect) {
413
- t40 = (period) => {
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(TOKEN_ISO_FORMAT) : initialDate_0.toISOString(),
417
- [finalName]: returnValueType === "default" ? finalDate_0.format(TOKEN_ISO_FORMAT) : finalDate_0.toISOString()
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
- bb304: switch (period) {
434
- case "today": {
435
- const date_2 = hooks();
436
- localOnChange(date_2, date_2);
437
- break bb304;
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 (shouldCloseOnSelect) {
472
- handleChangeCalendarBoxState(false);
334
+ if (shouldCloseCalendarOnSelect) {
335
+ handleSetCalendarBoxOpen(false);
473
336
  }
474
337
  };
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) => {
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
- handleChangeCalendarBoxState(false);
359
+ handleSetCalendarBoxOpen(false);
493
360
  }
494
361
  if (calendarBoxOpen) {
495
362
  handleChangeActiveDescendant((selectedDate.inicial ?? hooks()).format(TOKEN_ISO_FORMAT));
496
- setCalendarDisplayDate(selectedDate.inicial ?? hooks());
363
+ handleChangeCalendarDisplayDate(selectedDate.inicial ?? hooks());
497
364
  }
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));
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
- handleChangeCalendarBoxState(false);
374
+ handleSetCalendarBoxOpen(false);
508
375
  }
509
376
  if (calendarBoxOpen) {
510
377
  handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
511
- setCalendarDisplayDate(selectedDate.final ?? hooks());
378
+ handleChangeCalendarDisplayDate(selectedDate.final ?? hooks());
512
379
  }
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));
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
- $[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;
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
- t41 = $[57];
405
+ t26 = $[47];
536
406
  }
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) => {
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
- setCalendarBoxOpen(true);
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
- setCalendarDisplayDate(selectedDate.inicial ?? hooks());
418
+ handleChangeCalendarDisplayDate(selectedDate.inicial ?? hooks());
548
419
  }
549
420
  if (inputType_1 === "final") {
550
421
  handleChangeActiveDescendant((selectedDate.final ?? hooks()).format(TOKEN_ISO_FORMAT));
551
- setCalendarDisplayDate(selectedDate.final ?? hooks());
422
+ handleChangeCalendarDisplayDate(selectedDate.final ?? hooks());
552
423
  }
553
424
  };
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) => {
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
- const rawDate_0 = hooks(_.toString(activeDescendant), TOKEN_ISO_FORMAT);
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
- $[74] = props;
614
- $[75] = undigitable;
615
- $[76] = t45;
616
- } else {
617
- t45 = $[76];
618
- }
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;
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
- $[77] = calendarBoxOpen;
666
- $[78] = handleChangeCalendarBoxState;
667
- $[79] = handleChangeNextMonth;
668
- $[80] = handleChangePreviousMonth;
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
- t46 = $[83];
542
+ t28 = $[84];
674
543
  }
675
- const handleOnKeyDown = t46;
676
- let t47;
677
- if ($[84] !== finalName || $[85] !== initialName || $[86] !== props.value || $[87] !== setFinalMaskValue || $[88] !== setInitialMaskValue) {
678
- t47 = () => {
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 initialDate_1 = hooks(_.toString(objectValue_0[initialName]), TOKEN_ISO_FORMAT);
682
- const finalDate_1 = hooks(_.toString(objectValue_0[finalName]), TOKEN_ISO_FORMAT);
550
+ const initialDate_2 = parseDateValue(objectValue_0[initialName], variant);
551
+ const finalDate_2 = parseDateValue(objectValue_0[finalName], variant);
683
552
  setSelectedDate(() => ({
684
- inicial: initialDate_1.isValid() ? initialDate_1 : null,
685
- final: finalDate_1.isValid() ? finalDate_1 : null
553
+ inicial: initialDate_2.isValid() ? initialDate_2 : null,
554
+ final: finalDate_2.isValid() ? finalDate_2 : null
686
555
  }));
687
- setInitialMaskValue(initialDate_1.format(TOKEN_PTBR_FORMAT));
688
- setFinalMaskValue(finalDate_1.format(TOKEN_PTBR_FORMAT));
556
+ setInitialMaskValue(initialDate_2.format(ptbrFormat));
557
+ setFinalMaskValue(finalDate_2.format(ptbrFormat));
689
558
  }
690
559
  };
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;
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
- t49 = $[91];
579
+ t31 = $[95];
708
580
  }
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,
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: t52
608
+ hasValidPeriodSelected: t34
744
609
  };
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;
771
- } else {
772
- t53 = $[117];
773
- }
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;
793
- } else {
794
- t54 = $[132];
795
- }
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;
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
- t57 = $[134];
665
+ t39 = $[134];
805
666
  }
806
- let t58;
667
+ let t40;
807
668
  if ($[135] !== handleOnBlurMaskInput) {
808
- t58 = (event_5) => handleOnBlurMaskInput(event_5, "initial");
669
+ t40 = (event_2) => handleOnBlurMaskInput(event_2, "initial");
809
670
  $[135] = handleOnBlurMaskInput;
810
- $[136] = t58;
671
+ $[136] = t40;
811
672
  } else {
812
- t58 = $[136];
673
+ t40 = $[136];
813
674
  }
814
- let t59;
675
+ let t41;
815
676
  if ($[137] !== handleOnFocusMaskInput) {
816
- t59 = (event_6) => handleOnFocusMaskInput(event_6, "initial");
677
+ t41 = (event_3) => handleOnFocusMaskInput(event_3, "initial");
817
678
  $[137] = handleOnFocusMaskInput;
818
- $[138] = t59;
679
+ $[138] = t41;
819
680
  } else {
820
- t59 = $[138];
681
+ t41 = $[138];
821
682
  }
822
- let t60;
683
+ let t42;
823
684
  if ($[139] !== handleOnKeyDownMaskInput) {
824
- t60 = (event_7) => handleOnKeyDownMaskInput(event_7, "initial");
685
+ t42 = (event_4) => handleOnKeyDownMaskInput(event_4, "initial");
825
686
  $[139] = handleOnKeyDownMaskInput;
826
- $[140] = t60;
687
+ $[140] = t42;
827
688
  } else {
828
- t60 = $[140];
689
+ t42 = $[140];
829
690
  }
830
- let t61;
691
+ let t43;
831
692
  if ($[141] === Symbol.for("react.memo_cache_sentinel")) {
832
- t61 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
833
- $[141] = t61;
693
+ t43 = /* @__PURE__ */ jsx(Icon, { name: "arrow_right", size: 10 });
694
+ $[141] = t43;
834
695
  } else {
835
- t61 = $[141];
696
+ t43 = $[141];
836
697
  }
837
- let t62;
698
+ let t44;
838
699
  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 });
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] = t62;
703
+ $[144] = t44;
843
704
  } else {
844
- t62 = $[144];
705
+ t44 = $[144];
845
706
  }
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;
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
- t66 = $[146];
716
+ t48 = $[146];
856
717
  }
857
- const t67 = !readOnly && !skeletonize ? 0 : -1;
858
- let t68;
718
+ const t49 = !readOnly && !skeletonize ? 0 : -1;
719
+ let t50;
859
720
  if ($[147] !== handleOnBlurMaskInput) {
860
- t68 = (event_9) => handleOnBlurMaskInput(event_9, "final");
721
+ t50 = (event_6) => handleOnBlurMaskInput(event_6, "final");
861
722
  $[147] = handleOnBlurMaskInput;
862
- $[148] = t68;
723
+ $[148] = t50;
863
724
  } else {
864
- t68 = $[148];
725
+ t50 = $[148];
865
726
  }
866
- let t69;
727
+ let t51;
867
728
  if ($[149] !== handleOnFocusMaskInput) {
868
- t69 = (event_10) => handleOnFocusMaskInput(event_10, "final");
729
+ t51 = (event_7) => handleOnFocusMaskInput(event_7, "final");
869
730
  $[149] = handleOnFocusMaskInput;
870
- $[150] = t69;
731
+ $[150] = t51;
871
732
  } else {
872
- t69 = $[150];
733
+ t51 = $[150];
873
734
  }
874
- let t70;
735
+ let t52;
875
736
  if ($[151] !== handleOnKeyDownMaskInput) {
876
- t70 = (event_11) => handleOnKeyDownMaskInput(event_11, "final");
737
+ t52 = (event_8) => handleOnKeyDownMaskInput(event_8, "final");
877
738
  $[151] = handleOnKeyDownMaskInput;
878
- $[152] = t70;
739
+ $[152] = t52;
879
740
  } else {
880
- t70 = $[152];
741
+ t52 = $[152];
881
742
  }
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 });
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] = placeholder;
755
+ $[162] = inputPlaceholder;
895
756
  $[163] = readOnly;
896
757
  $[164] = skeletonize;
897
- $[165] = t63.Input;
898
- $[166] = t64;
899
- $[167] = t66;
900
- $[168] = t67;
901
- $[169] = t68;
902
- $[170] = t69;
903
- $[171] = t70;
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] = t71;
767
+ $[174] = t53;
907
768
  } else {
908
- t71 = $[174];
769
+ t53 = $[174];
909
770
  }
910
- let t72;
771
+ let t54;
911
772
  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];
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 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;
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
- t75 = $[188];
821
+ t57 = $[202];
947
822
  }
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;
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
- t76 = $[192];
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
- 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
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
- t73,
968
- t74,
969
- t75
842
+ t55,
843
+ t56,
844
+ t57
970
845
  ] }) }),
971
- t76
846
+ t58
972
847
  ] });
973
848
  });
974
849
  InputBase.displayName = "DatePeriodFieldInputBase";
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() {
850
+ function _temp() {
982
851
  return {
983
852
  inicial: null,
984
853
  final: null
985
854
  };
986
855
  }
987
- function _temp4(initialDate, finalDate) {
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 _temp5(event_8) {
996
- event_8.preventDefault();
864
+ function _temp3(event_5) {
865
+ event_5.preventDefault();
997
866
  }
998
- function _temp6(error, index) {
867
+ function _temp4(error, index) {
999
868
  return /* @__PURE__ */ jsxs(React.Fragment, { children: [
1000
869
  error,
1001
870
  " "