linear-react-components-ui 1.1.26-beta.20 → 1.1.26-beta.22
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 +1 -1
- package/lib/assets/styles/dialog.css +1 -1
- package/lib/assets/styles/drawers.css +1 -1
- package/lib/assets/styles/gridlayout.css +1 -1
- package/lib/assets/styles/selectfield.css +1 -1
- package/lib/assets/styles/textfield.css +1 -1
- package/lib/assets/styles/tooltip.css +1 -1
- package/lib/dialog/base/index.js +53 -55
- package/lib/dialog/base/index.js.map +1 -1
- package/lib/dialog/form/index.js +56 -55
- package/lib/dialog/form/index.js.map +1 -1
- package/lib/drawer/Drawer.js +7 -7
- package/lib/drawer/Drawer.js.map +1 -1
- package/lib/drawer/index.js +1 -1
- package/lib/drawer/index.js.map +1 -1
- package/lib/form2/types.d.ts +9 -4
- package/lib/form2/useForm/index.js +96 -89
- package/lib/form2/useForm/index.js.map +1 -1
- package/lib/icons/helper.d.ts +12 -0
- package/lib/icons/helper.js +12 -0
- package/lib/icons/helper.js.map +1 -1
- package/lib/inputs/date/index.js +59 -61
- package/lib/inputs/date/index.js.map +1 -1
- package/lib/inputs2/checkboxfield/base.d.ts +27 -0
- package/lib/inputs2/checkboxfield/base.js +100 -0
- package/lib/inputs2/checkboxfield/base.js.map +1 -0
- package/lib/inputs2/checkboxfield/index.d.ts +4 -25
- package/lib/inputs2/checkboxfield/index.js +41 -108
- package/lib/inputs2/checkboxfield/index.js.map +1 -1
- package/lib/inputs2/date/base/index.js +1 -1
- package/lib/inputs2/date/base/index.js.map +1 -1
- package/lib/inputs2/date/datefield/base.d.ts +3 -0
- package/lib/inputs2/date/datefield/base.js +193 -0
- package/lib/inputs2/date/datefield/base.js.map +1 -0
- package/lib/inputs2/date/datefield/calendarbox.js +26 -26
- package/lib/inputs2/date/datefield/calendarbox.js.map +1 -1
- package/lib/inputs2/date/datefield/index.d.ts +2 -1
- package/lib/inputs2/date/datefield/index.js +42 -312
- package/lib/inputs2/date/datefield/index.js.map +1 -1
- package/lib/inputs2/date/datefield/types.d.ts +6 -4
- package/lib/inputs2/date/dateperiodfield/base.d.ts +3 -0
- package/lib/inputs2/date/dateperiodfield/base.js +511 -0
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -0
- package/lib/inputs2/date/dateperiodfield/calendarbox.js +55 -55
- package/lib/inputs2/date/dateperiodfield/calendarbox.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/index.d.ts +2 -1
- package/lib/inputs2/date/dateperiodfield/index.js +42 -517
- package/lib/inputs2/date/dateperiodfield/index.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/types.d.ts +6 -4
- package/lib/inputs2/numberfield/index.js +85 -68
- package/lib/inputs2/numberfield/index.js.map +1 -1
- package/lib/inputs2/radiofield/base.d.ts +3 -0
- package/lib/inputs2/radiofield/base.js +115 -0
- package/lib/inputs2/radiofield/base.js.map +1 -0
- package/lib/inputs2/radiofield/index.d.ts +2 -1
- package/lib/inputs2/radiofield/index.js +41 -108
- package/lib/inputs2/radiofield/index.js.map +1 -1
- package/lib/inputs2/radiofield/types.d.ts +5 -2
- package/lib/inputs2/selectfield/base.d.ts +3 -0
- package/lib/inputs2/selectfield/base.js +411 -0
- package/lib/inputs2/selectfield/base.js.map +1 -0
- package/lib/inputs2/selectfield/index.d.ts +2 -1
- package/lib/inputs2/selectfield/index.js +49 -402
- package/lib/inputs2/selectfield/index.js.map +1 -1
- package/lib/inputs2/selectfield/listbox.js +25 -31
- package/lib/inputs2/selectfield/listbox.js.map +1 -1
- package/lib/inputs2/selectfield/types.d.ts +8 -6
- package/lib/inputs2/selectfield/types.js.map +1 -1
- package/lib/inputs2/textareafield/base.d.ts +23 -0
- package/lib/inputs2/textareafield/base.js +137 -0
- package/lib/inputs2/textareafield/base.js.map +1 -0
- package/lib/inputs2/textareafield/index.d.ts +4 -22
- package/lib/inputs2/textareafield/index.js +45 -130
- package/lib/inputs2/textareafield/index.js.map +1 -1
- package/lib/inputs2/textfield/base.d.ts +23 -0
- package/lib/inputs2/textfield/base.js +107 -0
- package/lib/inputs2/textfield/base.js.map +1 -0
- package/lib/inputs2/textfield/index.d.ts +4 -22
- package/lib/inputs2/textfield/index.js +45 -103
- package/lib/inputs2/textfield/index.js.map +1 -1
- package/lib/tooltip/types.d.ts +4 -1
- package/lib/tooltip/useTooltip.js +68 -86
- package/lib/tooltip/useTooltip.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Moment } from 'moment';
|
|
2
|
-
import {
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
3
|
import { TextAlign } from '../../../@types/Align';
|
|
4
4
|
import { ColorTheme } from '../../../@types/ColorStyles';
|
|
5
5
|
import { ITooltipCommonProps } from '../../../tooltip/types';
|
|
6
6
|
import { Position, HintPosition } from '../../../@types/Position';
|
|
7
7
|
import { OnDenied, PermissionAttr } from '../../../@types/PermissionAttr';
|
|
8
8
|
import { DateValueReturnType } from '../types';
|
|
9
|
-
type InputHTMLProps = Omit<ComponentPropsWithoutRef<'input'>, 'type' | 'multiple'>;
|
|
10
|
-
export interface
|
|
9
|
+
type InputHTMLProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'type' | 'multiple'>;
|
|
10
|
+
export interface DateFieldInputBaseProps extends InputHTMLProps, ITooltipCommonProps {
|
|
11
11
|
hint?: string;
|
|
12
12
|
label?: string;
|
|
13
13
|
errors?: string[];
|
|
14
|
-
gridLayout?: string;
|
|
15
14
|
customClass?: string;
|
|
16
15
|
customClassLabel?: string;
|
|
17
16
|
customClassWrapper?: string;
|
|
@@ -29,6 +28,9 @@ export interface DateFieldInputProps extends InputHTMLProps, ITooltipCommonProps
|
|
|
29
28
|
hintPosition?: HintPosition;
|
|
30
29
|
themePopover?: ColorTheme;
|
|
31
30
|
popoverAlign?: Extract<Position, 'left' | 'right'>;
|
|
31
|
+
}
|
|
32
|
+
export interface DateFieldInputProps extends DateFieldInputBaseProps {
|
|
33
|
+
gridLayout?: string;
|
|
32
34
|
permissionAttr?: PermissionAttr;
|
|
33
35
|
onDeniedActions?: OnDenied;
|
|
34
36
|
}
|
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { jsx as C, jsxs as Je } from "react/jsx-runtime";
|
|
2
|
+
import { c as ua } from "../../../_virtual/compiler-runtime.js";
|
|
3
|
+
import S from "react";
|
|
4
|
+
import w from "../../../_virtual/lodash.js";
|
|
5
|
+
import "../../../node_modules/imask/esm/index.js";
|
|
6
|
+
import "../../../node_modules/imask/esm/controls/input.js";
|
|
7
|
+
import "../../../node_modules/imask/esm/masked/factory.js";
|
|
8
|
+
import "../../../node_modules/imask/esm/controls/mask-element.js";
|
|
9
|
+
import "../../../node_modules/imask/esm/controls/html-input-mask-element.js";
|
|
10
|
+
import "../../../node_modules/imask/esm/controls/html-mask-element.js";
|
|
11
|
+
import "../../../node_modules/imask/esm/controls/html-contenteditable-mask-element.js";
|
|
12
|
+
import "../../../node_modules/imask/esm/controls/input-history.js";
|
|
13
|
+
import "../../../node_modules/react-imask/esm/input.js";
|
|
14
|
+
import Zt from "../../../node_modules/react-imask/esm/hook.js";
|
|
15
|
+
import "../../../node_modules/react-imask/esm/mixin.js";
|
|
16
|
+
import { createPortal as ma } from "react-dom";
|
|
17
|
+
import o from "../../../node_modules/moment/dist/moment.js";
|
|
18
|
+
import ha from "../../../hint/index.js";
|
|
19
|
+
import ba from "../../../icons/index.js";
|
|
20
|
+
import ya from "../../../tooltip/index.js";
|
|
21
|
+
import { mergeRefs as ea } from "../../../form2/helpers.js";
|
|
22
|
+
import { Keys as V } from "../types.js";
|
|
23
|
+
import * as ga from "../base/index.js";
|
|
24
|
+
import { Label as ka, Root as Sa, Container as Oa, Input as _a } from "../base/index.js";
|
|
25
|
+
import { TOKEN_ISO_FORMAT as d, TOKEN_PTBR_FORMAT as D, TOKEN_MASK as ta, NAVIGATION_KEYS as Ca } from "../helpers.js";
|
|
26
|
+
import { Triggers as va } from "./triggers.js";
|
|
27
|
+
import { CalendarBox as Ia } from "./calendarbox.js";
|
|
28
|
+
import { DatePeriodFieldContext as wa } from "./context.js";
|
|
29
|
+
const Va = S.forwardRef((t, M) => {
|
|
30
|
+
const e = ua.c(193), {
|
|
31
|
+
label: B,
|
|
32
|
+
errors: Z,
|
|
33
|
+
initialName: Dt,
|
|
34
|
+
finalName: Bt,
|
|
35
|
+
customClass: Pt,
|
|
36
|
+
customClassLabel: xt,
|
|
37
|
+
customClassWrapper: Mt,
|
|
38
|
+
customClassInputContainer: Ft,
|
|
39
|
+
labelUppercase: Nt,
|
|
40
|
+
undigitable: Kt,
|
|
41
|
+
skeletonize: Tt,
|
|
42
|
+
hintPosition: At,
|
|
43
|
+
themePopover: Wt,
|
|
44
|
+
popoverAlign: zt,
|
|
45
|
+
showCalendarButton: Et,
|
|
46
|
+
textAlign: Lt,
|
|
47
|
+
openCalendarOnFocus: Ut,
|
|
48
|
+
shouldCloseOnSelect: qt,
|
|
49
|
+
showPredefinedPeriodsButton: jt,
|
|
50
|
+
showClearDateButton: $t,
|
|
51
|
+
placeholder: Ht,
|
|
52
|
+
returnValueType: Gt,
|
|
53
|
+
tooltip: Qe,
|
|
54
|
+
tooltipPosition: Xe,
|
|
55
|
+
tooltipWidth: Ze,
|
|
56
|
+
disabled: y,
|
|
57
|
+
readOnly: c,
|
|
58
|
+
...Yt
|
|
59
|
+
} = t, f = Dt === void 0 ? "inicial" : Dt, u = Bt === void 0 ? "final" : Bt, ee = Pt === void 0 ? "" : Pt, et = xt === void 0 ? "" : xt, aa = Mt === void 0 ? "" : Mt, na = Ft === void 0 ? "" : Ft, tt = Nt === void 0 ? !1 : Nt, g = Kt === void 0 ? !1 : Kt, r = Tt === void 0 ? !1 : Tt, N = At === void 0 ? "below" : At, at = Wt === void 0 ? "light" : Wt, nt = zt === void 0 ? "left" : zt, it = Et === void 0 ? !0 : Et, te = Lt === void 0 ? "left" : Lt, K = Ut === void 0 ? !0 : Ut, ae = qt === void 0 ? !0 : qt, lt = jt === void 0 ? !0 : jt, ot = $t === void 0 ? !0 : $t, ne = Ht === void 0 ? D : Ht, P = Gt === void 0 ? "default" : Gt;
|
|
60
|
+
let ie;
|
|
61
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (ie = {
|
|
62
|
+
inicial: null,
|
|
63
|
+
final: null
|
|
64
|
+
}, e[0] = ie) : ie = e[0];
|
|
65
|
+
const [l, T] = S.useState(ie), [s, Jt] = S.useState(!1);
|
|
66
|
+
let le;
|
|
67
|
+
e[1] === Symbol.for("react.memo_cache_sentinel") ? (le = o().format(d), e[1] = le) : le = e[1];
|
|
68
|
+
const [v, ia] = S.useState(le);
|
|
69
|
+
let oe;
|
|
70
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (oe = o(), e[2] = oe) : oe = e[2];
|
|
71
|
+
const [st, I] = S.useState(oe), la = S.useRef(null), Qt = S.useRef(null), Y = S.useRef(null), ct = S.useRef(null), Xt = S.useRef(null);
|
|
72
|
+
let se;
|
|
73
|
+
e[3] !== f || e[4] !== t.name ? (se = String(t.name).concat(".").concat(f), e[3] = f, e[4] = t.name, e[5] = se) : se = e[5];
|
|
74
|
+
const k = se;
|
|
75
|
+
let ce;
|
|
76
|
+
e[6] !== u || e[7] !== t.name ? (ce = String(t.name).concat(".").concat(u), e[6] = u, e[7] = t.name, e[8] = ce) : ce = e[8];
|
|
77
|
+
const O = ce;
|
|
78
|
+
let re;
|
|
79
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (re = {
|
|
80
|
+
mask: ta,
|
|
81
|
+
lazy: !1,
|
|
82
|
+
placeholderChar: "_"
|
|
83
|
+
}, e[9] = re) : re = e[9];
|
|
84
|
+
let de;
|
|
85
|
+
e[10] !== l.inicial ? (de = l.inicial?.format(D), e[10] = l.inicial, e[11] = de) : de = e[11];
|
|
86
|
+
const {
|
|
87
|
+
value: oa,
|
|
88
|
+
setValue: p,
|
|
89
|
+
unmaskedValue: rt
|
|
90
|
+
} = Zt(re, {
|
|
91
|
+
ref: ct,
|
|
92
|
+
defaultValue: de,
|
|
93
|
+
onComplete: (a) => {
|
|
94
|
+
const i = o(a, D);
|
|
95
|
+
i.isValid() && x({
|
|
96
|
+
date: i,
|
|
97
|
+
inputType: "initial",
|
|
98
|
+
typing: !0
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
let fe;
|
|
103
|
+
e[12] === Symbol.for("react.memo_cache_sentinel") ? (fe = {
|
|
104
|
+
mask: ta,
|
|
105
|
+
lazy: !1,
|
|
106
|
+
placeholderChar: "_"
|
|
107
|
+
}, e[12] = fe) : fe = e[12];
|
|
108
|
+
let ue;
|
|
109
|
+
e[13] !== l.final ? (ue = l.final?.format(D), e[13] = l.final, e[14] = ue) : ue = e[14];
|
|
110
|
+
const {
|
|
111
|
+
value: dt,
|
|
112
|
+
setValue: R,
|
|
113
|
+
unmaskedValue: ft
|
|
114
|
+
} = Zt(fe, {
|
|
115
|
+
ref: Y,
|
|
116
|
+
defaultValue: ue,
|
|
117
|
+
onComplete: (a) => {
|
|
118
|
+
const i = o(a, D);
|
|
119
|
+
i.isValid() && x({
|
|
120
|
+
date: i,
|
|
121
|
+
inputType: "final",
|
|
122
|
+
typing: !0
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
let me;
|
|
127
|
+
e[15] !== t.label ? (me = w.isEmpty(t?.label), e[15] = t.label, e[16] = me) : me = e[16];
|
|
128
|
+
const ut = !me, A = !!t.hint?.length, _ = !!Z?.length;
|
|
129
|
+
let he;
|
|
130
|
+
e[17] === Symbol.for("react.memo_cache_sentinel") ? (he = (a) => T(a), e[17] = he) : he = e[17];
|
|
131
|
+
const mt = he;
|
|
132
|
+
let be;
|
|
133
|
+
e[18] === Symbol.for("react.memo_cache_sentinel") ? (be = (a) => Jt(a), e[18] = be) : be = e[18];
|
|
134
|
+
const m = be;
|
|
135
|
+
let ye;
|
|
136
|
+
e[19] === Symbol.for("react.memo_cache_sentinel") ? (ye = (a) => ia(a), e[19] = ye) : ye = e[19];
|
|
137
|
+
const h = ye;
|
|
138
|
+
let ge;
|
|
139
|
+
e[20] === Symbol.for("react.memo_cache_sentinel") ? (ge = (a) => I(a), e[20] = ge) : ge = e[20];
|
|
140
|
+
const ht = ge;
|
|
141
|
+
let ke;
|
|
142
|
+
e[21] === Symbol.for("react.memo_cache_sentinel") ? (ke = () => I(pa), e[21] = ke) : ke = e[21];
|
|
143
|
+
const W = ke;
|
|
144
|
+
let Se;
|
|
145
|
+
e[22] === Symbol.for("react.memo_cache_sentinel") ? (Se = () => I(Ra), e[22] = Se) : Se = e[22];
|
|
146
|
+
const z = Se;
|
|
147
|
+
let Oe;
|
|
148
|
+
e[23] !== h ? (Oe = (a) => {
|
|
149
|
+
I((i) => {
|
|
150
|
+
const n = i.clone().add(a, "day");
|
|
151
|
+
return h(n.format(d)), n;
|
|
152
|
+
});
|
|
153
|
+
}, e[23] = h, e[24] = Oe) : Oe = e[24];
|
|
154
|
+
const E = Oe;
|
|
155
|
+
let _e;
|
|
156
|
+
e[25] !== h ? (_e = (a) => {
|
|
157
|
+
I((i) => {
|
|
158
|
+
let n = i;
|
|
159
|
+
return a === "end" && (n = i.clone().endOf("week")), a === "start" && (n = i.clone().startOf("week")), h(n.format(d)), n;
|
|
160
|
+
});
|
|
161
|
+
}, e[25] = h, e[26] = _e) : _e = e[26];
|
|
162
|
+
const Ce = _e;
|
|
163
|
+
let ve;
|
|
164
|
+
e[27] !== u || e[28] !== f || e[29] !== t.value ? (ve = () => {
|
|
165
|
+
const a = t?.value, i = !w.isEmpty(a[f]), n = !w.isEmpty(a[u]);
|
|
166
|
+
return i && n;
|
|
167
|
+
}, e[27] = u, e[28] = f, e[29] = t.value, e[30] = ve) : ve = e[30];
|
|
168
|
+
const sa = ve;
|
|
169
|
+
let Ie;
|
|
170
|
+
e[31] !== u || e[32] !== m || e[33] !== f || e[34] !== t || e[35] !== R || e[36] !== p ? (Ie = () => {
|
|
171
|
+
t.onChange?.({
|
|
172
|
+
target: {
|
|
173
|
+
name: t.name,
|
|
174
|
+
value: {
|
|
175
|
+
[f]: "",
|
|
176
|
+
[u]: ""
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}), T(Da), p(""), R(""), m(!1);
|
|
180
|
+
}, e[31] = u, e[32] = m, e[33] = f, e[34] = t, e[35] = R, e[36] = p, e[37] = Ie) : Ie = e[37];
|
|
181
|
+
const bt = Ie, x = (a) => {
|
|
182
|
+
const {
|
|
183
|
+
date: i,
|
|
184
|
+
inputType: n,
|
|
185
|
+
typing: b
|
|
186
|
+
} = a, F = i.clone(), J = Ba;
|
|
187
|
+
e: switch (n) {
|
|
188
|
+
case "initial": {
|
|
189
|
+
T((Vt) => {
|
|
190
|
+
const {
|
|
191
|
+
inicial: pt,
|
|
192
|
+
final: Rt
|
|
193
|
+
} = J(F, Vt.final);
|
|
194
|
+
return {
|
|
195
|
+
inicial: pt,
|
|
196
|
+
final: Rt
|
|
197
|
+
};
|
|
198
|
+
});
|
|
199
|
+
const {
|
|
200
|
+
inicial: Q,
|
|
201
|
+
final: X
|
|
202
|
+
} = J(F, l.final);
|
|
203
|
+
t.onChange?.({
|
|
204
|
+
target: {
|
|
205
|
+
name: t.name,
|
|
206
|
+
value: {
|
|
207
|
+
[f]: P === "default" ? Q?.format(d) : Q?.toISOString(),
|
|
208
|
+
[u]: P === "default" ? X?.format(d) : X?.toISOString()
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}), requestAnimationFrame(() => {
|
|
212
|
+
b || Y.current?.focus?.();
|
|
213
|
+
});
|
|
214
|
+
break e;
|
|
215
|
+
}
|
|
216
|
+
case "final": {
|
|
217
|
+
T((Vt) => {
|
|
218
|
+
const {
|
|
219
|
+
inicial: pt,
|
|
220
|
+
final: Rt
|
|
221
|
+
} = J(Vt.inicial, F);
|
|
222
|
+
return {
|
|
223
|
+
inicial: pt,
|
|
224
|
+
final: Rt
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
const {
|
|
228
|
+
inicial: Q,
|
|
229
|
+
final: X
|
|
230
|
+
} = J(l.inicial, F);
|
|
231
|
+
t.onChange?.({
|
|
232
|
+
target: {
|
|
233
|
+
name: t.name,
|
|
234
|
+
value: {
|
|
235
|
+
[f]: P === "default" ? Q?.format(d) : Q?.toISOString(),
|
|
236
|
+
[u]: P === "default" ? X?.format(d) : X?.toISOString()
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}), ae && m(!1);
|
|
240
|
+
break e;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
I(F.clone());
|
|
244
|
+
};
|
|
245
|
+
let we;
|
|
246
|
+
e[38] !== u || e[39] !== m || e[40] !== f || e[41] !== t || e[42] !== P || e[43] !== ae ? (we = (a) => {
|
|
247
|
+
const i = (n, b) => {
|
|
248
|
+
const F = {
|
|
249
|
+
[f]: P === "default" ? n.format(d) : n.toISOString(),
|
|
250
|
+
[u]: P === "default" ? b.format(d) : b.toISOString()
|
|
251
|
+
};
|
|
252
|
+
T(() => ({
|
|
253
|
+
inicial: n.clone(),
|
|
254
|
+
final: b.clone()
|
|
255
|
+
})), t.onChange?.({
|
|
256
|
+
target: {
|
|
257
|
+
name: t.name,
|
|
258
|
+
value: F
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
e: switch (a) {
|
|
263
|
+
case "today": {
|
|
264
|
+
const n = o();
|
|
265
|
+
i(n, n);
|
|
266
|
+
break e;
|
|
267
|
+
}
|
|
268
|
+
case "week": {
|
|
269
|
+
const n = o().startOf("week"), b = o().endOf("week");
|
|
270
|
+
i(n, b);
|
|
271
|
+
break e;
|
|
272
|
+
}
|
|
273
|
+
case "lastweek": {
|
|
274
|
+
const n = o().add(-1, "week").startOf("week"), b = o().add(-1, "week").endOf("week");
|
|
275
|
+
i(n, b);
|
|
276
|
+
break e;
|
|
277
|
+
}
|
|
278
|
+
case "last15": {
|
|
279
|
+
const n = o().add(-14, "d"), b = o();
|
|
280
|
+
i(n, b);
|
|
281
|
+
break e;
|
|
282
|
+
}
|
|
283
|
+
case "month": {
|
|
284
|
+
const n = o().startOf("month"), b = o().endOf("month");
|
|
285
|
+
i(n, b);
|
|
286
|
+
break e;
|
|
287
|
+
}
|
|
288
|
+
case "lastmonth": {
|
|
289
|
+
const n = o().add(-1, "month").startOf("month"), b = o().add(-1, "month").endOf("month");
|
|
290
|
+
i(n, b);
|
|
291
|
+
break e;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
Y?.current?.focus?.(), ae && m(!1);
|
|
295
|
+
}, e[38] = u, e[39] = m, e[40] = f, e[41] = t, e[42] = P, e[43] = ae, e[44] = we) : we = e[44];
|
|
296
|
+
const yt = we;
|
|
297
|
+
let Ve;
|
|
298
|
+
e[45] !== s || e[46] !== O || e[47] !== ft || e[48] !== h || e[49] !== m || e[50] !== k || e[51] !== rt || e[52] !== t || e[53] !== l.final || e[54] !== l.inicial || e[55] !== R || e[56] !== p ? (Ve = (a, i) => {
|
|
299
|
+
if (t?.onBlur?.(a), i === "initial" && (a.relatedTarget?.id !== O && m(!1), s && (h((l.inicial ?? o()).format(d)), I(l.inicial ?? o())), w.size(rt) !== 8)) {
|
|
300
|
+
const n = o(l.inicial, d);
|
|
301
|
+
n.isValid() && p(n.format(D));
|
|
302
|
+
}
|
|
303
|
+
if (i === "final" && (a.relatedTarget?.id !== k && m(!1), s && (h((l.final ?? o()).format(d)), I(l.final ?? o())), w.size(ft) !== 8)) {
|
|
304
|
+
const n = o(l.final, d);
|
|
305
|
+
n.isValid() && R(n.format(D));
|
|
306
|
+
}
|
|
307
|
+
}, e[45] = s, e[46] = O, e[47] = ft, e[48] = h, e[49] = m, e[50] = k, e[51] = rt, e[52] = t, e[53] = l.final, e[54] = l.inicial, e[55] = R, e[56] = p, e[57] = Ve) : Ve = e[57];
|
|
308
|
+
const L = Ve;
|
|
309
|
+
let pe;
|
|
310
|
+
e[58] !== s || e[59] !== h || e[60] !== K || e[61] !== t || e[62] !== c || e[63] !== l.final || e[64] !== l.inicial ? (pe = (a, i) => {
|
|
311
|
+
t?.onFocus?.(a), !c && !s && K && Jt(!0), i === "initial" && (h((l.inicial ?? o()).format(d)), I(l.inicial ?? o())), i === "final" && (h((l.final ?? o()).format(d)), I(l.final ?? o()));
|
|
312
|
+
}, e[58] = s, e[59] = h, e[60] = K, e[61] = t, e[62] = c, e[63] = l.final, e[64] = l.inicial, e[65] = pe) : pe = e[65];
|
|
313
|
+
const U = pe;
|
|
314
|
+
let Re;
|
|
315
|
+
e[66] !== v || e[67] !== s || e[68] !== x || e[69] !== t ? (Re = (a, i) => {
|
|
316
|
+
if (t?.onKeyDown?.(a), s && a.key && !a.shiftKey && !a.altKey && a.key === V.enter) {
|
|
317
|
+
a.preventDefault();
|
|
318
|
+
const n = o(w.toString(v), d);
|
|
319
|
+
x({
|
|
320
|
+
date: n,
|
|
321
|
+
inputType: i
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
}, e[66] = v, e[67] = s, e[68] = x, e[69] = t, e[70] = Re) : Re = e[70];
|
|
325
|
+
const q = Re;
|
|
326
|
+
let De;
|
|
327
|
+
e[71] !== t || e[72] !== g ? (De = (a) => {
|
|
328
|
+
g ? a.preventDefault() : t.onPaste?.(a);
|
|
329
|
+
}, e[71] = t, e[72] = g, e[73] = De) : De = e[73];
|
|
330
|
+
const Be = De;
|
|
331
|
+
let Pe;
|
|
332
|
+
e[74] !== t || e[75] !== g ? (Pe = (a) => {
|
|
333
|
+
g ? a.preventDefault() : t.onBeforeInput?.(a);
|
|
334
|
+
}, e[74] = t, e[75] = g, e[76] = Pe) : Pe = e[76];
|
|
335
|
+
const xe = Pe;
|
|
336
|
+
let Me;
|
|
337
|
+
e[77] !== s || e[78] !== m || e[79] !== z || e[80] !== W || e[81] !== E || e[82] !== Ce ? (Me = (a) => {
|
|
338
|
+
if (s && a.key && !a.shiftKey && !a.altKey && Ca.includes(a.key)) {
|
|
339
|
+
a.preventDefault();
|
|
340
|
+
e: switch (a.key) {
|
|
341
|
+
case V.arrowLeft: {
|
|
342
|
+
E(-1);
|
|
343
|
+
break e;
|
|
344
|
+
}
|
|
345
|
+
case V.arrowRight: {
|
|
346
|
+
E(1);
|
|
347
|
+
break e;
|
|
348
|
+
}
|
|
349
|
+
case V.arrowUp: {
|
|
350
|
+
E(-7);
|
|
351
|
+
break e;
|
|
352
|
+
}
|
|
353
|
+
case V.arrowDown: {
|
|
354
|
+
E(7);
|
|
355
|
+
break e;
|
|
356
|
+
}
|
|
357
|
+
case V.pageUp: {
|
|
358
|
+
z();
|
|
359
|
+
break e;
|
|
360
|
+
}
|
|
361
|
+
case V.pageDown: {
|
|
362
|
+
W();
|
|
363
|
+
break e;
|
|
364
|
+
}
|
|
365
|
+
case V.home: {
|
|
366
|
+
Ce("start");
|
|
367
|
+
break e;
|
|
368
|
+
}
|
|
369
|
+
case V.end: {
|
|
370
|
+
Ce("end");
|
|
371
|
+
break e;
|
|
372
|
+
}
|
|
373
|
+
case V.escape: {
|
|
374
|
+
m(!1);
|
|
375
|
+
break e;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}, e[77] = s, e[78] = m, e[79] = z, e[80] = W, e[81] = E, e[82] = Ce, e[83] = Me) : Me = e[83];
|
|
380
|
+
const ca = Me;
|
|
381
|
+
let Fe;
|
|
382
|
+
e[84] !== u || e[85] !== f || e[86] !== t.value || e[87] !== R || e[88] !== p ? (Fe = () => {
|
|
383
|
+
if (t?.value) {
|
|
384
|
+
const a = t.value, i = o(w.toString(a[f]), d), n = o(w.toString(a[u]), d);
|
|
385
|
+
T(() => ({
|
|
386
|
+
inicial: i.isValid() ? i : null,
|
|
387
|
+
final: n.isValid() ? n : null
|
|
388
|
+
})), p(i.format(D)), R(n.format(D));
|
|
389
|
+
}
|
|
390
|
+
}, e[84] = u, e[85] = f, e[86] = t.value, e[87] = R, e[88] = p, e[89] = Fe) : Fe = e[89];
|
|
391
|
+
const gt = t?.value;
|
|
392
|
+
let Ne;
|
|
393
|
+
e[90] !== gt ? (Ne = [gt], e[90] = gt, e[91] = Ne) : Ne = e[91], S.useEffect(Fe, Ne);
|
|
394
|
+
const kt = !!c, St = !!c, Ot = sa();
|
|
395
|
+
let Ke;
|
|
396
|
+
e[92] !== v || e[93] !== s || e[94] !== st || e[95] !== O || e[96] !== h || e[97] !== m || e[98] !== ht || e[99] !== z || e[100] !== W || e[101] !== mt || e[102] !== x || e[103] !== yt || e[104] !== bt || e[105] !== _ || e[106] !== k || e[107] !== K || e[108] !== l || e[109] !== it || e[110] !== ot || e[111] !== lt || e[112] !== r || e[113] !== kt || e[114] !== St || e[115] !== Ot || e[116] !== g ? (Ke = {
|
|
397
|
+
isReadOnly: kt,
|
|
398
|
+
isDisabled: St,
|
|
399
|
+
undigitable: g,
|
|
400
|
+
skeletonize: r,
|
|
401
|
+
dateContainerRef: Xt,
|
|
402
|
+
calendarBoxOpen: s,
|
|
403
|
+
activeDescendant: v,
|
|
404
|
+
selectedDate: l,
|
|
405
|
+
initialInputId: k,
|
|
406
|
+
finalInputId: O,
|
|
407
|
+
initialInputRef: ct,
|
|
408
|
+
finalInputRef: Y,
|
|
409
|
+
showCalendarButton: it,
|
|
410
|
+
calendarDisplayDate: st,
|
|
411
|
+
hasValidationErrors: _,
|
|
412
|
+
openCalendarOnFocus: K,
|
|
413
|
+
showPredefinedPeriodsButton: lt,
|
|
414
|
+
showClearDateButton: ot,
|
|
415
|
+
handleChangeSelectedDate: mt,
|
|
416
|
+
handleChangePreviousMonth: W,
|
|
417
|
+
handleChangeNextMonth: z,
|
|
418
|
+
handleChangeCalendarBoxState: m,
|
|
419
|
+
handleChangeActiveDescendant: h,
|
|
420
|
+
handleChangeCalendarDisplayDate: ht,
|
|
421
|
+
handleChangeUpdateDateState: x,
|
|
422
|
+
handleOnClickClearSelectedPeriod: bt,
|
|
423
|
+
handleChangeUpdateDateStateWithPredefinedPeriod: yt,
|
|
424
|
+
hasValidPeriodSelected: Ot
|
|
425
|
+
}, e[92] = v, e[93] = s, e[94] = st, e[95] = O, e[96] = h, e[97] = m, e[98] = ht, e[99] = z, e[100] = W, e[101] = mt, e[102] = x, e[103] = yt, e[104] = bt, e[105] = _, e[106] = k, e[107] = K, e[108] = l, e[109] = it, e[110] = ot, e[111] = lt, e[112] = r, e[113] = kt, e[114] = St, e[115] = Ot, e[116] = g, e[117] = Ke) : Ke = e[117];
|
|
426
|
+
const ra = Ke;
|
|
427
|
+
let Te;
|
|
428
|
+
e[118] !== et || e[119] !== y || e[120] !== A || e[121] !== ut || e[122] !== N || e[123] !== k || e[124] !== B || e[125] !== tt || e[126] !== nt || e[127] !== t.hint || e[128] !== t.required || e[129] !== c || e[130] !== r || e[131] !== at ? (Te = ut && /* @__PURE__ */ C(ka, { "data-testid": "test-date-period-field-label", label: B, inputId: k, hint: t?.hint, isDisabled: y, isReadOnly: c, skeletonize: r, required: t?.required, hintPosition: N, themePopover: at, popoverAlign: nt, labelUppercase: tt, hasHintMessages: A, customClassLabel: et }), e[118] = et, e[119] = y, e[120] = A, e[121] = ut, e[122] = N, e[123] = k, e[124] = B, e[125] = tt, e[126] = nt, e[127] = t.hint, e[128] = t.required, e[129] = c, e[130] = r, e[131] = at, e[132] = Te) : Te = e[132];
|
|
429
|
+
const da = w.omit(Yt, ["initialRef", "finalRef"]), _t = t?.initialRef;
|
|
430
|
+
let Ae;
|
|
431
|
+
e[133] !== _t ? (Ae = ea(ct, _t), e[133] = _t, e[134] = Ae) : Ae = e[134];
|
|
432
|
+
let We;
|
|
433
|
+
e[135] !== L ? (We = (a) => L(a, "initial"), e[135] = L, e[136] = We) : We = e[136];
|
|
434
|
+
let ze;
|
|
435
|
+
e[137] !== U ? (ze = (a) => U(a, "initial"), e[137] = U, e[138] = ze) : ze = e[138];
|
|
436
|
+
let Ee;
|
|
437
|
+
e[139] !== q ? (Ee = (a) => q(a, "initial"), e[139] = q, e[140] = Ee) : Ee = e[140];
|
|
438
|
+
let Le;
|
|
439
|
+
e[141] === Symbol.for("react.memo_cache_sentinel") ? (Le = /* @__PURE__ */ C(ba, { name: "arrow_right", size: 10 }), e[141] = Le) : Le = e[141];
|
|
440
|
+
let Ue;
|
|
441
|
+
e[142] !== y || e[143] !== c ? (Ue = /* @__PURE__ */ C("span", { className: "separator", "data-state-disabled": y, "data-state-read-only": c, onMouseDown: Pa, children: Le }), e[142] = y, e[143] = c, e[144] = Ue) : Ue = e[144];
|
|
442
|
+
const Ct = ga, vt = w.omit(Yt, ["initialRef", "finalRef"]), It = t?.finalRef;
|
|
443
|
+
let j;
|
|
444
|
+
e[145] !== It ? (j = ea(Y, It), e[145] = It, e[146] = j) : j = e[146];
|
|
445
|
+
const wt = !c && !r ? 0 : -1;
|
|
446
|
+
let $;
|
|
447
|
+
e[147] !== L ? ($ = (a) => L(a, "final"), e[147] = L, e[148] = $) : $ = e[148];
|
|
448
|
+
let H;
|
|
449
|
+
e[149] !== U ? (H = (a) => U(a, "final"), e[149] = U, e[150] = H) : H = e[150];
|
|
450
|
+
let G;
|
|
451
|
+
e[151] !== q ? (G = (a) => q(a, "final"), e[151] = q, e[152] = G) : G = e[152];
|
|
452
|
+
let qe;
|
|
453
|
+
e[153] !== v || e[154] !== s || e[155] !== ee || e[156] !== y || e[157] !== O || e[158] !== dt || e[159] !== xe || e[160] !== Be || e[161] !== _ || e[162] !== ne || e[163] !== c || e[164] !== r || e[165] !== Ct.Input || e[166] !== vt || e[167] !== j || e[168] !== wt || e[169] !== $ || e[170] !== H || e[171] !== G || e[172] !== te || e[173] !== g ? (qe = /* @__PURE__ */ C(Ct.Input, { ...vt, ref: j, id: O, name: O, value: dt, readOnly: c, disabled: y, customClass: ee, tabIndex: wt, placeholder: ne, "aria-autocomplete": "list", "aria-activedescendant": v, "aria-expanded": s, "aria-controls": O, "aria-labelledby": O, "data-testid": "test-date-period-field-final-input", "data-state-is-period-input": !0, "data-state-error": _, "data-state-read-only": c, "data-state-text-align": te, "data-state-undigitable": g, "data-state-skeletonize": r, onPaste: Be, onBeforeInput: xe, onBlur: $, onFocus: H, onKeyDown: G }), e[153] = v, e[154] = s, e[155] = ee, e[156] = y, e[157] = O, e[158] = dt, e[159] = xe, e[160] = Be, e[161] = _, e[162] = ne, e[163] = c, e[164] = r, e[165] = Ct.Input, e[166] = vt, e[167] = j, e[168] = wt, e[169] = $, e[170] = H, e[171] = G, e[172] = te, e[173] = g, e[174] = qe) : qe = e[174];
|
|
454
|
+
let je;
|
|
455
|
+
e[175] === Symbol.for("react.memo_cache_sentinel") ? (je = /* @__PURE__ */ C(va, {}), e[175] = je) : je = e[175];
|
|
456
|
+
let $e;
|
|
457
|
+
e[176] !== s ? ($e = s && ma(/* @__PURE__ */ C(Ia, { ref: la }), document.body), e[176] = s, e[177] = $e) : $e = e[177];
|
|
458
|
+
let He;
|
|
459
|
+
e[178] !== y || e[179] !== A || e[180] !== N || e[181] !== t.hint || e[182] !== r ? (He = N === "below" && /* @__PURE__ */ C(ha, { customClass: "hint", description: t.hint, disabled: y, skeletonize: r, visible: A }), e[178] = y, e[179] = A, e[180] = N, e[181] = t.hint, e[182] = r, e[183] = He) : He = e[183];
|
|
460
|
+
let Ge;
|
|
461
|
+
e[184] !== Z || e[185] !== _ || e[186] !== B || e[187] !== r ? (Ge = _ && /* @__PURE__ */ C("span", { "data-testid": "test-date-period-field-list-errors", className: "error", "data-state-skeletonize": r, "aria-describedby": String(B).concat("-errors"), children: Z?.map(xa) }), e[184] = Z, e[185] = _, e[186] = B, e[187] = r, e[188] = Ge) : Ge = e[188];
|
|
462
|
+
let Ye;
|
|
463
|
+
return e[189] !== Qe || e[190] !== Xe || e[191] !== Ze ? (Ye = /* @__PURE__ */ C(ya, { targetRef: Qt, text: Qe, width: Ze, position: Xe }), e[189] = Qe, e[190] = Xe, e[191] = Ze, e[192] = Ye) : Ye = e[192], /* @__PURE__ */ Je(S.Fragment, { children: [
|
|
464
|
+
/* @__PURE__ */ C(wa.Provider, { value: ra, children: /* @__PURE__ */ Je(Sa, { ref: Qt, "data-testid": "test-date-period-field-root", "data-state-error": _, customClassWrapper: aa, children: [
|
|
465
|
+
Te,
|
|
466
|
+
/* @__PURE__ */ Je(Oa, { ref: Xt, "data-testid": "test-date-period-field-container", onKeyDown: ca, skeletonize: r, customClassInputContainer: na, children: [
|
|
467
|
+
/* @__PURE__ */ C(_a, { ...da, ref: Ae, id: k, name: k, value: oa, disabled: y, readOnly: c, customClass: ee, tabIndex: !c && !r ? 0 : -1, placeholder: ne, "aria-autocomplete": "list", "aria-activedescendant": v, "aria-expanded": s, "aria-controls": k, "aria-labelledby": k, "data-testid": "test-date-period-field-initial-input", "data-state-is-period-input": !0, "data-state-error": _, "data-state-read-only": c, "data-state-text-align": te, "data-state-undigitable": g, "data-state-skeletonize": r, onPaste: Be, onBeforeInput: xe, onBlur: We, onFocus: ze, onKeyDown: Ee }),
|
|
468
|
+
Ue,
|
|
469
|
+
qe,
|
|
470
|
+
je
|
|
471
|
+
] }),
|
|
472
|
+
$e,
|
|
473
|
+
He,
|
|
474
|
+
Ge
|
|
475
|
+
] }) }),
|
|
476
|
+
Ye
|
|
477
|
+
] });
|
|
478
|
+
});
|
|
479
|
+
Va.displayName = "DatePeriodFieldInputBase";
|
|
480
|
+
function pa(t) {
|
|
481
|
+
return t.clone().subtract(1, "month");
|
|
482
|
+
}
|
|
483
|
+
function Ra(t) {
|
|
484
|
+
return t.clone().add(1, "month");
|
|
485
|
+
}
|
|
486
|
+
function Da() {
|
|
487
|
+
return {
|
|
488
|
+
inicial: null,
|
|
489
|
+
final: null
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
function Ba(t, M) {
|
|
493
|
+
const e = t?.isAfter(M) ? M : t, B = t?.isAfter(M) ? t : M;
|
|
494
|
+
return {
|
|
495
|
+
inicial: e,
|
|
496
|
+
final: B
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
function Pa(t) {
|
|
500
|
+
t.preventDefault();
|
|
501
|
+
}
|
|
502
|
+
function xa(t, M) {
|
|
503
|
+
return /* @__PURE__ */ Je(S.Fragment, { children: [
|
|
504
|
+
t,
|
|
505
|
+
" "
|
|
506
|
+
] }, `${M + 1}-${t}`);
|
|
507
|
+
}
|
|
508
|
+
export {
|
|
509
|
+
Va as InputBase
|
|
510
|
+
};
|
|
511
|
+
//# sourceMappingURL=base.js.map
|