linear-react-components-ui 1.1.26-beta.23 → 1.1.26-beta.25
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/radiofield.css +1 -1
- package/lib/assets/styles/selectfield.css +1 -1
- package/lib/assets/styles/textfield.css +1 -1
- package/lib/buttons/DefaultButton.js +1 -1
- package/lib/calendar/base/index.js +2 -2
- package/lib/dialog/base/Content.d.ts +1 -1
- package/lib/dialog/base/Content.js +8 -7
- package/lib/dialog/base/Content.js.map +1 -1
- package/lib/dialog/form/index.js +23 -23
- package/lib/dialog/form/index.js.map +1 -1
- package/lib/dialog/types.d.ts +2 -1
- package/lib/dialog/wizard/index.js +4 -4
- package/lib/form/Field.js.map +1 -1
- package/lib/form/FieldArray.js +18 -18
- package/lib/form/FieldArray.js.map +1 -1
- package/lib/form/FieldNumber.js +42 -39
- package/lib/form/FieldNumber.js.map +1 -1
- package/lib/form/FieldPeriod.js +27 -27
- package/lib/form/FieldPeriod.js.map +1 -1
- package/lib/form/helpers.d.ts +5 -1
- package/lib/form/helpers.js.map +1 -1
- package/lib/form/withFormSecurity.js +3 -3
- package/lib/form2/useForm/index.js +95 -87
- package/lib/form2/useForm/index.js.map +1 -1
- package/lib/icons/index.js +1 -1
- package/lib/inputs/base/InputTextBase.js +1 -1
- package/lib/inputs/base/types.d.ts +2 -2
- package/lib/inputs/date/index.js +1 -1
- package/lib/inputs/mask/types.d.ts +2 -1
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Currency.js +79 -18
- package/lib/inputs/number/Currency.js.map +1 -1
- package/lib/inputs/number/Decimal.d.ts +2 -2
- package/lib/inputs/number/Decimal.js +78 -8
- package/lib/inputs/number/Decimal.js.map +1 -1
- package/lib/inputs/number/format_number.js +11 -5
- package/lib/inputs/number/format_number.js.map +1 -1
- package/lib/inputs/number/index.d.ts +1 -1
- package/lib/inputs/number/index.js +75 -31
- package/lib/inputs/number/index.js.map +1 -1
- package/lib/inputs/number/types.d.ts +9 -0
- package/lib/inputs/period/PeriodList.js +3 -3
- package/lib/inputs/period/helper.d.ts +1 -0
- package/lib/inputs/period/helper.js +27 -19
- package/lib/inputs/period/helper.js.map +1 -1
- package/lib/inputs/period/index.js +156 -152
- package/lib/inputs/period/index.js.map +1 -1
- package/lib/inputs2/checkboxfield/base.js +1 -1
- package/lib/inputs2/date/datefield/base.js +1 -1
- package/lib/inputs2/date/datefield/types.d.ts +2 -2
- package/lib/inputs2/date/dateperiodfield/base.js +1 -1
- package/lib/inputs2/date/dateperiodfield/types.d.ts +2 -2
- package/lib/inputs2/filefield/index.js.map +1 -1
- package/lib/inputs2/index.d.ts +1 -1
- package/lib/inputs2/index.js +8 -8
- package/lib/inputs2/mask/Cnpj.d.ts +6 -3
- package/lib/inputs2/mask/Cnpj.js +107 -43
- package/lib/inputs2/mask/Cnpj.js.map +1 -1
- package/lib/inputs2/mask/Cpf.d.ts +6 -3
- package/lib/inputs2/mask/Cpf.js +87 -37
- package/lib/inputs2/mask/Cpf.js.map +1 -1
- package/lib/inputs2/mask/Phone.d.ts +5 -3
- package/lib/inputs2/mask/Phone.js +19 -18
- package/lib/inputs2/mask/Phone.js.map +1 -1
- package/lib/inputs2/mask/ZipCode.d.ts +6 -2
- package/lib/inputs2/mask/ZipCode.js +18 -16
- package/lib/inputs2/mask/ZipCode.js.map +1 -1
- package/lib/inputs2/mask/index.d.ts +6 -0
- package/lib/inputs2/mask/index.js +113 -0
- package/lib/inputs2/mask/index.js.map +1 -0
- package/lib/inputs2/mask/types.d.ts +16 -0
- package/lib/inputs2/numberfield/currency.d.ts +2 -1
- package/lib/inputs2/numberfield/currency.js +93 -75
- package/lib/inputs2/numberfield/currency.js.map +1 -1
- package/lib/inputs2/numberfield/decimal.d.ts +2 -1
- package/lib/inputs2/numberfield/decimal.js +86 -68
- package/lib/inputs2/numberfield/decimal.js.map +1 -1
- package/lib/inputs2/numberfield/helpers.js +10 -10
- package/lib/inputs2/numberfield/helpers.js.map +1 -1
- package/lib/inputs2/numberfield/index.d.ts +3 -2
- package/lib/inputs2/numberfield/index.js +26 -25
- package/lib/inputs2/numberfield/index.js.map +1 -1
- package/lib/inputs2/radiofield/base.js +76 -80
- package/lib/inputs2/radiofield/base.js.map +1 -1
- package/lib/inputs2/radiofield/index.js.map +1 -1
- package/lib/inputs2/selectfield/base.d.ts +1 -2
- package/lib/inputs2/selectfield/base.js +258 -381
- package/lib/inputs2/selectfield/base.js.map +1 -1
- package/lib/inputs2/selectfield/context.d.ts +1 -1
- package/lib/inputs2/selectfield/context.js.map +1 -1
- package/lib/inputs2/selectfield/helpers.d.ts +5 -0
- package/lib/inputs2/selectfield/helpers.js +22 -13
- package/lib/inputs2/selectfield/helpers.js.map +1 -1
- package/lib/inputs2/selectfield/index.d.ts +2 -1
- package/lib/inputs2/selectfield/index.js +20 -18
- package/lib/inputs2/selectfield/index.js.map +1 -1
- package/lib/inputs2/selectfield/listbox.d.ts +1 -0
- package/lib/inputs2/selectfield/listbox.js +34 -34
- package/lib/inputs2/selectfield/listbox.js.map +1 -1
- package/lib/inputs2/selectfield/selections.d.ts +1 -1
- package/lib/inputs2/selectfield/selections.js +11 -11
- package/lib/inputs2/selectfield/selections.js.map +1 -1
- package/lib/inputs2/selectfield/simple.d.ts +9 -0
- package/lib/inputs2/selectfield/simple.js +24 -0
- package/lib/inputs2/selectfield/simple.js.map +1 -0
- package/lib/inputs2/selectfield/triggers.js +15 -15
- package/lib/inputs2/selectfield/triggers.js.map +1 -1
- package/lib/inputs2/selectfield/types.d.ts +1 -0
- package/lib/inputs2/selectfield/types.js.map +1 -1
- package/lib/inputs2/textareafield/base.js +1 -1
- package/lib/inputs2/textfield/base.js +1 -1
- package/lib/labels/DefaultLabel.js +1 -1
- package/lib/list/Item.js +1 -1
- package/lib/menus/sidenav/MenuLink.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +1 -1
- package/lib/permissionValidations.js +1 -2
- package/lib/textContent/index.js +1 -1
- package/package.json +1 -1
- package/lib/inputs/number/BaseNumber.d.ts +0 -3
- package/lib/inputs/number/BaseNumber.js +0 -60
- package/lib/inputs/number/BaseNumber.js.map +0 -1
- package/lib/inputs2/mask/BaseMask.d.ts +0 -13
- package/lib/inputs2/mask/BaseMask.js +0 -79
- package/lib/inputs2/mask/BaseMask.js.map +0 -1
|
@@ -1,411 +1,288 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as cl } from "../../_virtual/compiler-runtime.js";
|
|
1
|
+
import { jsxs as B, jsx as c } from "react/jsx-runtime";
|
|
3
2
|
import '../../assets/styles/selectfield.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { createPortal as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { mergeRefs as
|
|
11
|
-
import { LeftSlot as
|
|
12
|
-
import { ListBox as
|
|
13
|
-
import { Triggers as
|
|
14
|
-
import { Selections as
|
|
15
|
-
import { SelectFieldContext as
|
|
16
|
-
import { Options as
|
|
17
|
-
import { Item as
|
|
18
|
-
import { MultipleVariantEnum as
|
|
19
|
-
import { isTypingKey as
|
|
20
|
-
import
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
}, e[43] = i, e[44] = a, e[45] = M, e[46] = Re) : Re = e[46];
|
|
83
|
-
let Ne;
|
|
84
|
-
e[47] !== a ? (Ne = [a], e[47] = a, e[48] = Ne) : Ne = e[48], o.useEffect(Re, Ne);
|
|
85
|
-
let Ae;
|
|
86
|
-
e[49] !== i || e[50] !== y || e[51] !== B || e[52] !== ht || e[53] !== t.value || e[54] !== E.value ? (Ae = () => {
|
|
87
|
-
if (!i && !t?.value && x(""), !t?.value || document.activeElement === w.current)
|
|
88
|
-
return;
|
|
89
|
-
const l = y.get(E.value);
|
|
90
|
-
if (i || x(l ?? ""), i) {
|
|
91
|
-
const r = y.get(t?.value[0]);
|
|
92
|
-
switch (h.size(t?.value)) {
|
|
3
|
+
import { forwardRef as Ye, useId as Je, useState as N, useRef as E, useMemo as q, Children as M, isValidElement as R, useEffect as H, cloneElement as j, Fragment as ne } from "react";
|
|
4
|
+
import o from "../../_virtual/lodash.js";
|
|
5
|
+
import { createPortal as Qe } from "react-dom";
|
|
6
|
+
import Xe from "../../hint/index.js";
|
|
7
|
+
import Ze from "../../popover/index.js";
|
|
8
|
+
import { Tooltip as _e } from "../../tooltip/index.js";
|
|
9
|
+
import { mergeRefs as et } from "../../form2/helpers.js";
|
|
10
|
+
import { LeftSlot as tt, RightSlot as lt } from "../slot/index.js";
|
|
11
|
+
import { ListBox as nt } from "./listbox.js";
|
|
12
|
+
import { Triggers as at } from "./triggers.js";
|
|
13
|
+
import { Selections as ot } from "./selections.js";
|
|
14
|
+
import { SelectFieldContext as st } from "./context.js";
|
|
15
|
+
import { Options as it } from "./options.js";
|
|
16
|
+
import { Item as rt } from "./item.js";
|
|
17
|
+
import { MultipleVariantEnum as ae, Keys as b } from "./types.js";
|
|
18
|
+
import { scrollListBoxToElement as oe, isTypingKey as ct, NAVIGATION_KEYS as se } from "./helpers.js";
|
|
19
|
+
import ut from "../../popover/PopoverText.js";
|
|
20
|
+
const dt = Ye((t, ie) => {
|
|
21
|
+
const {
|
|
22
|
+
name: S,
|
|
23
|
+
label: U,
|
|
24
|
+
errors: G,
|
|
25
|
+
children: v,
|
|
26
|
+
onChange: T,
|
|
27
|
+
tooltip: re,
|
|
28
|
+
tooltipPosition: Y,
|
|
29
|
+
tooltipWidth: ce,
|
|
30
|
+
hintPosition: A = "below",
|
|
31
|
+
themePopover: ue = "light",
|
|
32
|
+
popoverAlign: de = "left",
|
|
33
|
+
skeletonize: f = !1,
|
|
34
|
+
striped: fe = !1,
|
|
35
|
+
undigitable: I = !1,
|
|
36
|
+
externalSearch: me = !1,
|
|
37
|
+
openDropdownOnFocus: J = !0,
|
|
38
|
+
showClearButton: he = !0,
|
|
39
|
+
textAlign: pe = "left",
|
|
40
|
+
searchOnDropdown: ye = !1,
|
|
41
|
+
onSearch: ge = void 0,
|
|
42
|
+
customClass: be = "",
|
|
43
|
+
customClassLabel: ve = "",
|
|
44
|
+
customClassWrapper: xe = "",
|
|
45
|
+
customClassInputContainer: Se = "",
|
|
46
|
+
notFoundFilterLabel: Be = "Nenhuma opção encontrada.",
|
|
47
|
+
multipleInputLabelEmpty: P = "Nenhum registro selecionado",
|
|
48
|
+
multipleInputLabelManySelection: Ee = "Múltiplos registros selecionados",
|
|
49
|
+
searchInputPlaceholder: Ie = "Pesquisar registros",
|
|
50
|
+
dropdownAlignButton: ke = "left",
|
|
51
|
+
dropdownMaxWidth: Le = void 0,
|
|
52
|
+
disabled: i,
|
|
53
|
+
readOnly: k,
|
|
54
|
+
...$
|
|
55
|
+
} = t, Q = Je(), [we, m] = N(""), [Ce, x] = N(""), [u, h] = N(!1), [F, V] = N(void 0), z = o.isEqual(t?.multiple, ae.default), d = o.isEqual(t?.multiple, ae.checkboxes), y = z || d, X = E(null), Oe = E(null), g = E(null), L = E(null), Z = E(null), w = E(null), C = q(() => {
|
|
56
|
+
const e = /* @__PURE__ */ new Map();
|
|
57
|
+
return M.forEach(v, (l) => {
|
|
58
|
+
R(l) && e.set(l.props.value, l.props.label);
|
|
59
|
+
}), e;
|
|
60
|
+
}, [v]);
|
|
61
|
+
H(() => {
|
|
62
|
+
d && m(P);
|
|
63
|
+
}, []), H(() => {
|
|
64
|
+
if (J && u && d && setTimeout(() => {
|
|
65
|
+
w.current?.focus?.();
|
|
66
|
+
}, 10), u) {
|
|
67
|
+
let e = 0;
|
|
68
|
+
const l = 20, n = () => {
|
|
69
|
+
const a = L.current?.querySelector('ul[role="listbox"]'), s = y ? o.orderBy([...t.value], (r) => o.toNumber(r), ["asc"])[0] : t?.value, p = a?.querySelector(`li[id="${o.toString(s)}"]`);
|
|
70
|
+
p && a && (a.clientHeight > 0 ? oe(a, p, "center") : e < l && (e++, requestAnimationFrame(n)));
|
|
71
|
+
};
|
|
72
|
+
requestAnimationFrame(n);
|
|
73
|
+
}
|
|
74
|
+
}, [u]), H(() => {
|
|
75
|
+
if (!d && !t?.value && m(""), !t?.value || document.activeElement === g.current) return;
|
|
76
|
+
const e = C.get($.value);
|
|
77
|
+
if (d || m(e ?? ""), d) {
|
|
78
|
+
const l = C.get(t?.value[0]);
|
|
79
|
+
switch (o.size(t?.value)) {
|
|
93
80
|
case 0:
|
|
94
|
-
return
|
|
81
|
+
return m(P);
|
|
95
82
|
case 1:
|
|
96
|
-
return
|
|
83
|
+
return m(l ?? "");
|
|
97
84
|
default:
|
|
98
|
-
return
|
|
85
|
+
return m(Ee);
|
|
99
86
|
}
|
|
100
87
|
}
|
|
101
|
-
},
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const l = [];
|
|
111
|
-
o.Children.map(m, (r, f) => {
|
|
112
|
-
if (o.isValidElement(r)) {
|
|
113
|
-
const g = o.cloneElement(r, {
|
|
114
|
-
key: r.key ?? `child-item-${f + 1}`
|
|
88
|
+
}, [t?.value, C]);
|
|
89
|
+
const Fe = !o.isEmpty(t?.label), _ = !!t.hint?.length, K = !!G?.length, {
|
|
90
|
+
childrenItems: Ve
|
|
91
|
+
} = q(() => {
|
|
92
|
+
const e = [];
|
|
93
|
+
return M.map(v, (l, n) => {
|
|
94
|
+
if (R(l)) {
|
|
95
|
+
const a = j(l, {
|
|
96
|
+
key: l.key ?? `child-item-${n + 1}`
|
|
115
97
|
});
|
|
116
|
-
|
|
98
|
+
l.type === rt && e.push(a);
|
|
117
99
|
}
|
|
118
|
-
}),
|
|
119
|
-
childrenItems:
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
key: f.key ?? `slot-${g}`,
|
|
133
|
-
disabled: n,
|
|
134
|
-
"aria-disabled": n
|
|
100
|
+
}), {
|
|
101
|
+
childrenItems: e
|
|
102
|
+
};
|
|
103
|
+
}, [v, i]), {
|
|
104
|
+
leftSlotElements: ee,
|
|
105
|
+
rightSlotElements: te
|
|
106
|
+
} = q(() => {
|
|
107
|
+
const e = [], l = [];
|
|
108
|
+
return M.map(v, (n, a) => {
|
|
109
|
+
if (R(n)) {
|
|
110
|
+
const s = j(n, {
|
|
111
|
+
key: n.key ?? `slot-${a}`,
|
|
112
|
+
disabled: i,
|
|
113
|
+
"aria-disabled": i
|
|
135
114
|
});
|
|
136
|
-
|
|
115
|
+
n.type === tt && e.push(s), n.type === lt && l.push(s);
|
|
137
116
|
}
|
|
138
|
-
}),
|
|
139
|
-
leftSlotElements:
|
|
140
|
-
rightSlotElements:
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
o.Children.map(m, (r, f) => {
|
|
152
|
-
if (o.isValidElement(r)) {
|
|
153
|
-
const g = o.cloneElement(r, {
|
|
154
|
-
key: r.key ?? `option-list-${f}`,
|
|
155
|
-
disabled: n
|
|
117
|
+
}), {
|
|
118
|
+
leftSlotElements: e,
|
|
119
|
+
rightSlotElements: l
|
|
120
|
+
};
|
|
121
|
+
}, [v, i]), {
|
|
122
|
+
optionItens: De
|
|
123
|
+
} = q(() => {
|
|
124
|
+
const e = [];
|
|
125
|
+
return M.map(v, (l, n) => {
|
|
126
|
+
if (R(l)) {
|
|
127
|
+
const a = j(l, {
|
|
128
|
+
key: l.key ?? `option-list-${n}`,
|
|
129
|
+
disabled: i
|
|
156
130
|
});
|
|
157
|
-
|
|
131
|
+
l.type === it && e.push(a);
|
|
158
132
|
}
|
|
159
|
-
}),
|
|
160
|
-
optionItens:
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
}, e[70] = u, e[71] = t.value, e[72] = ze) : ze = e[72];
|
|
177
|
-
const $ = ze;
|
|
178
|
-
let Ke;
|
|
179
|
-
e[73] === Symbol.for("react.memo_cache_sentinel") ? (Ke = () => {
|
|
180
|
-
C((l) => (l && F(""), w.current !== document.activeElement && w?.current?.focus?.(), !l));
|
|
181
|
-
}, e[73] = Ke) : Ke = e[73];
|
|
182
|
-
const il = Ke;
|
|
183
|
-
let We;
|
|
184
|
-
e[74] === Symbol.for("react.memo_cache_sentinel") ? (We = (l) => {
|
|
185
|
-
Kt.current = l;
|
|
186
|
-
}, e[74] = We) : We = e[74];
|
|
187
|
-
const ol = We;
|
|
188
|
-
let je;
|
|
189
|
-
e[75] !== u || e[76] !== c || e[77] !== b || e[78] !== t.value ? (je = (l, r, f) => {
|
|
190
|
-
let g = t?.value;
|
|
191
|
-
f || (g = h.union(t.value, [l])), f && (g = h.without(t.value, l));
|
|
192
|
-
const S = u ? h.orderBy(g, Ll, ["asc"]) : l;
|
|
193
|
-
b?.({
|
|
133
|
+
}), {
|
|
134
|
+
optionItens: e
|
|
135
|
+
};
|
|
136
|
+
}, [v, i]), Ne = !!ee?.length, qe = !!te?.length, Me = () => {
|
|
137
|
+
h(!1), x("");
|
|
138
|
+
}, W = () => {
|
|
139
|
+
const e = y ? o.orderBy([...t.value], (l) => o.toNumber(l), ["asc"])[0] : t?.value;
|
|
140
|
+
V(o.toString(e) ?? void 0);
|
|
141
|
+
}, Re = () => {
|
|
142
|
+
h((e) => (e && x(""), g.current !== document.activeElement && g?.current?.focus?.(), W(), !e));
|
|
143
|
+
}, Te = (e) => {
|
|
144
|
+
X.current = e;
|
|
145
|
+
}, Ae = (e, l, n) => {
|
|
146
|
+
let a = t?.value;
|
|
147
|
+
n || (a = o.union(t.value, [e])), n && (a = o.without(t.value, e));
|
|
148
|
+
const s = y ? o.orderBy(a, (r) => o.toNumber(r), ["asc"]) : e;
|
|
149
|
+
T?.({
|
|
194
150
|
target: {
|
|
195
|
-
name:
|
|
196
|
-
value:
|
|
151
|
+
name: S,
|
|
152
|
+
value: s
|
|
197
153
|
}
|
|
198
|
-
}),
|
|
199
|
-
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
e[80] !== y || e[81] !== c || e[82] !== b ? (He = (l) => {
|
|
203
|
-
const r = !!l, f = [];
|
|
204
|
-
y.forEach((A, te) => f.push(te)), b?.({
|
|
154
|
+
}), y || (h(!1), x(""), m(l ?? ""), document.activeElement === w.current && (g?.current?.focus?.(), h(!1)));
|
|
155
|
+
}, Pe = (e) => {
|
|
156
|
+
const l = !!e, n = [];
|
|
157
|
+
C.forEach((p, r) => n.push(r)), T?.({
|
|
205
158
|
target: {
|
|
206
|
-
name:
|
|
207
|
-
value:
|
|
159
|
+
name: S,
|
|
160
|
+
value: l ? n : []
|
|
208
161
|
}
|
|
209
162
|
});
|
|
210
|
-
}, e
|
|
211
|
-
|
|
212
|
-
let Ue;
|
|
213
|
-
e[84] !== u || e[85] !== i || e[86] !== B || e[87] !== c || e[88] !== b ? (Ue = () => {
|
|
214
|
-
b?.({
|
|
163
|
+
}, $e = () => {
|
|
164
|
+
T?.({
|
|
215
165
|
target: {
|
|
216
|
-
name:
|
|
217
|
-
value:
|
|
166
|
+
name: S,
|
|
167
|
+
value: y ? [] : ""
|
|
218
168
|
}
|
|
219
|
-
}),
|
|
220
|
-
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
let Qe;
|
|
238
|
-
e[97] !== i || e[98] !== t || e[99] !== v ? (Qe = (l) => {
|
|
239
|
-
v || i ? l.preventDefault() : t.onPaste?.(l);
|
|
240
|
-
}, e[97] = i, e[98] = t, e[99] = v, e[100] = Qe) : Qe = e[100];
|
|
241
|
-
const Ot = Qe;
|
|
242
|
-
let Xe;
|
|
243
|
-
e[101] !== i || e[102] !== t || e[103] !== v ? (Xe = (l) => {
|
|
244
|
-
v || i ? l.preventDefault() : t.onBeforeInput?.(l);
|
|
245
|
-
}, e[101] = i, e[102] = t, e[103] = v, e[104] = Xe) : Xe = e[104];
|
|
246
|
-
const Ft = Xe;
|
|
247
|
-
let Ze;
|
|
248
|
-
e[105] !== st || e[106] !== dt ? (Ze = (l) => {
|
|
249
|
-
st ? dt?.(l) : F(l.target.value);
|
|
250
|
-
}, e[105] = st, e[106] = dt, e[107] = Ze) : Ze = e[107];
|
|
251
|
-
const Dt = Ze;
|
|
252
|
-
let et;
|
|
253
|
-
e[108] !== I || e[109] !== $ || e[110] !== u || e[111] !== a || e[112] !== t || e[113] !== v ? (et = (l) => {
|
|
254
|
-
t?.onKeyDown?.(l);
|
|
255
|
-
const r = [O.backspace, O.delete];
|
|
256
|
-
if (v && r.includes(l.key)) {
|
|
257
|
-
l.preventDefault();
|
|
169
|
+
}), h(!1), y || (x(""), m("")), d && m(P);
|
|
170
|
+
}, ze = (e) => {
|
|
171
|
+
t?.onBlur?.(e), (!e.relatedTarget || e.relatedTarget !== w.current) && h(!1), x("");
|
|
172
|
+
}, Ke = (e) => {
|
|
173
|
+
t?.onFocus?.(e), J && (h(!0), W());
|
|
174
|
+
}, We = (e) => {
|
|
175
|
+
x(e.target.value), m(e.target.value);
|
|
176
|
+
}, He = (e) => {
|
|
177
|
+
I || d ? e.preventDefault() : t.onPaste?.(e);
|
|
178
|
+
}, je = (e) => {
|
|
179
|
+
I || d ? e.preventDefault() : t.onBeforeInput?.(e);
|
|
180
|
+
}, Ue = (e) => {
|
|
181
|
+
me ? ge?.(e) : x(e.target.value);
|
|
182
|
+
}, le = (e) => {
|
|
183
|
+
t?.onKeyDown?.(e);
|
|
184
|
+
const l = [b.backspace, b.delete];
|
|
185
|
+
if (I && l.includes(e.key)) {
|
|
186
|
+
e.preventDefault();
|
|
258
187
|
return;
|
|
259
188
|
}
|
|
260
|
-
(
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
263
|
-
const
|
|
264
|
-
|
|
189
|
+
(ct(e) || e.key === b.arrowDown) && g.current === document.activeElement && (e.key === b.arrowDown && e.preventDefault(), requestAnimationFrame(() => {
|
|
190
|
+
const s = L.current?.querySelector('ul[role="listbox"]')?.querySelectorAll('li[data-state-filtered="true"]') ?? [];
|
|
191
|
+
if (!u && e.key === b.arrowDown) {
|
|
192
|
+
const p = y ? o.orderBy([...t.value], (r) => o.toNumber(r), ["asc"])[0] : t?.value;
|
|
193
|
+
V(o.toString(p) ?? void 0);
|
|
265
194
|
} else
|
|
266
|
-
|
|
267
|
-
}),
|
|
268
|
-
const
|
|
269
|
-
let
|
|
270
|
-
if (
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
-
case
|
|
274
|
-
|
|
275
|
-
break
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (I) {
|
|
287
|
-
const Ut = S[te];
|
|
288
|
-
Ut && Ut.click();
|
|
195
|
+
V(s[0]?.id ?? void 0);
|
|
196
|
+
}), u || (h(!0), W())), u && se.includes(e.key) && e.preventDefault(), requestAnimationFrame(() => {
|
|
197
|
+
const s = L.current?.querySelector('ul[role="listbox"]')?.querySelectorAll('li[data-state-filtered="true"]') ?? [], p = Array.from(s).findIndex((O) => O.id === F);
|
|
198
|
+
let r = p;
|
|
199
|
+
if (u) {
|
|
200
|
+
if (se.includes(e.key)) {
|
|
201
|
+
switch (e.key) {
|
|
202
|
+
case b.escape:
|
|
203
|
+
h(!1), x(""), g.current?.focus(), e.target === w.current && h(!1);
|
|
204
|
+
break;
|
|
205
|
+
case b.arrowDown:
|
|
206
|
+
r = Math.min(p + 1, s.length - 1);
|
|
207
|
+
break;
|
|
208
|
+
case b.arrowUp:
|
|
209
|
+
r = Math.max(p - 1, 0);
|
|
210
|
+
break;
|
|
211
|
+
case b.enter:
|
|
212
|
+
if (F) {
|
|
213
|
+
const D = s[r];
|
|
214
|
+
D && D.click();
|
|
289
215
|
}
|
|
290
|
-
break
|
|
291
|
-
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
const O = s[r];
|
|
219
|
+
if (O) {
|
|
220
|
+
V(O?.id ?? "");
|
|
221
|
+
const D = L.current?.querySelector('ul[role="listbox"]');
|
|
222
|
+
oe(D, O, "nearest");
|
|
292
223
|
}
|
|
293
|
-
const we = S[te];
|
|
294
|
-
we && (Le(we?.id ?? ""), we.scrollIntoView({
|
|
295
|
-
block: "nearest"
|
|
296
|
-
}));
|
|
297
224
|
}
|
|
298
|
-
} else
|
|
299
|
-
return null;
|
|
225
|
+
} else return null;
|
|
300
226
|
});
|
|
301
|
-
},
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
e[185] === Symbol.for("react.memo_cache_sentinel") ? (lt = /* @__PURE__ */ p(gl, {}), e[185] = lt) : lt = e[185];
|
|
358
|
-
let U;
|
|
359
|
-
e[186] !== n || e[187] !== d || e[188] !== s ? (U = /* @__PURE__ */ p("div", { className: "triggers", "data-state-disabled": n, "data-state-read-only": d, "data-state-skeletonize": s, children: lt }), e[186] = n, e[187] = d, e[188] = s, e[189] = U) : U = e[189];
|
|
360
|
-
let G;
|
|
361
|
-
e[190] !== xt || e[191] !== a ? (G = a && ul(/* @__PURE__ */ p(bl, { ref: St, children: xt }), document.body), e[190] = xt, e[191] = a, e[192] = G) : G = e[192];
|
|
362
|
-
let Y;
|
|
363
|
-
e[193] !== a || e[194] !== s || e[195] !== Pt || e[196] !== qt || e[197] !== H || e[198] !== _t || e[199] !== U || e[200] !== G ? (Y = /* @__PURE__ */ le("div", { ref: Wt, className: Pt, "aria-expanded": a, "data-state-skeletonize": s, children: [
|
|
364
|
-
qt,
|
|
365
|
-
H,
|
|
366
|
-
_t,
|
|
367
|
-
U,
|
|
368
|
-
G
|
|
369
|
-
] }), e[193] = a, e[194] = s, e[195] = Pt, e[196] = qt, e[197] = H, e[198] = _t, e[199] = U, e[200] = G, e[201] = Y) : Y = e[201];
|
|
370
|
-
let J;
|
|
371
|
-
e[202] !== n || e[203] !== T || e[204] !== k || e[205] !== t.hint || e[206] !== s ? (J = k === "below" && /* @__PURE__ */ p(dl, { customClass: "hint", skeletonize: s, description: t.hint, disabled: n, visible: T }), e[202] = n, e[203] = T, e[204] = k, e[205] = t.hint, e[206] = s, e[207] = J) : J = e[207];
|
|
372
|
-
let Q;
|
|
373
|
-
e[208] !== D || e[209] !== L || e[210] !== c || e[211] !== s ? (Q = L && /* @__PURE__ */ p("span", { "data-testid": "test-select-field-list-errors", className: "error", "data-state-skeletonize": s, "aria-describedby": String(c).concat("-errors"), children: D?.map(Fl) }), e[208] = D, e[209] = L, e[210] = c, e[211] = s, e[212] = Q) : Q = e[212];
|
|
374
|
-
let X;
|
|
375
|
-
e[213] !== L || e[214] !== k || e[215] !== At || e[216] !== z || e[217] !== Y || e[218] !== J || e[219] !== Q ? (X = /* @__PURE__ */ le("div", { ref: el, "data-testid": "test-select-field-root", className: At, "data-state-error": L, "data-state-hint-position": k, children: [
|
|
376
|
-
z,
|
|
377
|
-
Y,
|
|
378
|
-
J,
|
|
379
|
-
Q
|
|
380
|
-
] }), e[213] = L, e[214] = k, e[215] = At, e[216] = z, e[217] = Y, e[218] = J, e[219] = Q, e[220] = X) : X = e[220];
|
|
381
|
-
let Z;
|
|
382
|
-
e[221] !== Nt || e[222] !== X ? (Z = /* @__PURE__ */ p(pl.Provider, { value: Nt, children: X }), e[221] = Nt, e[222] = X, e[223] = Z) : Z = e[223];
|
|
383
|
-
const zt = R === "right" ? 64 : void 0;
|
|
384
|
-
let ee;
|
|
385
|
-
e[224] !== zt || e[225] !== P || e[226] !== R || e[227] !== q ? (ee = /* @__PURE__ */ p(ml, { targetRef: w, text: P, position: R, width: q, space: zt }), e[224] = zt, e[225] = P, e[226] = R, e[227] = q, e[228] = ee) : ee = e[228];
|
|
386
|
-
let nt;
|
|
387
|
-
return e[229] !== Z || e[230] !== ee ? (nt = /* @__PURE__ */ le(rl, { children: [
|
|
388
|
-
Z,
|
|
389
|
-
ee
|
|
390
|
-
] }), e[229] = Z, e[230] = ee, e[231] = nt) : nt = e[231], nt;
|
|
227
|
+
}, Ge = {
|
|
228
|
+
selectFieldId: Q,
|
|
229
|
+
label: t.label,
|
|
230
|
+
striped: fe,
|
|
231
|
+
listBoxOpen: u,
|
|
232
|
+
filterValue: Ce,
|
|
233
|
+
disabled: i,
|
|
234
|
+
liSelectedRef: X,
|
|
235
|
+
selectInputRef: g,
|
|
236
|
+
selectSearchInputRef: w,
|
|
237
|
+
handleOnSearch: Ue,
|
|
238
|
+
searchOnDropdown: ye,
|
|
239
|
+
nameSelect: String(t.name),
|
|
240
|
+
valueSelect: t?.value,
|
|
241
|
+
activeDescendant: F,
|
|
242
|
+
handleOnChange: Ae,
|
|
243
|
+
handleOnKeyDown: le,
|
|
244
|
+
selectContainerRef: Z,
|
|
245
|
+
handleCloseListBox: Me,
|
|
246
|
+
notFoundFilterLabel: Be,
|
|
247
|
+
handleChangeLiSelected: Te,
|
|
248
|
+
isMultipleSelect: y,
|
|
249
|
+
isMultipleDefault: z,
|
|
250
|
+
isMultipleWithCheckboxes: d,
|
|
251
|
+
searchInputPlaceholder: Ie,
|
|
252
|
+
showClearButton: he,
|
|
253
|
+
dropdownAlignButton: ke,
|
|
254
|
+
handleClearValue: $e,
|
|
255
|
+
handleCheckMultiple: Pe,
|
|
256
|
+
handleChangeListBoxState: Re,
|
|
257
|
+
optionItens: De
|
|
258
|
+
};
|
|
259
|
+
return /* @__PURE__ */ B(ne, { children: [
|
|
260
|
+
/* @__PURE__ */ c(st.Provider, { value: Ge, children: /* @__PURE__ */ B("div", { ref: Oe, "data-testid": "test-select-field-root", className: `select-field-root ${xe}`, "data-state-error": K, "data-state-hint-position": A, children: [
|
|
261
|
+
Fe && /* @__PURE__ */ B("span", { className: `root-label ${ve}`, "data-state-skeletonize": f, children: [
|
|
262
|
+
/* @__PURE__ */ c("label", { "data-testid": "test-select-field-label", className: "label", title: U, htmlFor: S, "aria-disabled": i, "aria-readonly": k, "data-state-input-required": t.required, children: U }),
|
|
263
|
+
_ && A === "onLabelRight" && !f && /* @__PURE__ */ c(Ze, { customClass: "label-popover", theme: ue, align: de, iconColor: "#03bde2", children: /* @__PURE__ */ c(ut, { text: t?.hint ?? "" }) })
|
|
264
|
+
] }),
|
|
265
|
+
/* @__PURE__ */ B("div", { ref: Z, className: `container ${Se}`, "aria-expanded": u, "data-state-skeletonize": f, children: [
|
|
266
|
+
Ne && !f && ee,
|
|
267
|
+
/* @__PURE__ */ B("div", { className: "input-root", children: [
|
|
268
|
+
/* @__PURE__ */ c("input", { ...$, ref: et(ie, g), readOnly: t.readOnly || I, className: `input ${be}`, placeholder: $.placeholder, "data-state-error": K, "data-state-multiple": y, "data-state-read-only": k, "data-state-text-align": pe, "data-state-undigitable": I, "data-state-skeletonize": f, "data-state-multiple-with-checkboxes": d, id: S, type: "text", role: "combobox", multiple: !1, disabled: i, "data-testid": "test-select-field-input", "aria-autocomplete": "list", "aria-expanded": u, "aria-controls": Q, "aria-activedescendant": F, tabIndex: !k && !f ? 0 : -1, value: we, onBlur: ze, onFocus: Ke, onKeyDown: le, onChange: We, onPaste: He, onBeforeInput: je }),
|
|
269
|
+
z && /* @__PURE__ */ c(ot, { disabled: !!i, isReadOnly: !!k, listOfOptionsToSelect: C })
|
|
270
|
+
] }),
|
|
271
|
+
qe && !f && te,
|
|
272
|
+
/* @__PURE__ */ c("div", { className: "triggers", "data-state-disabled": i, "data-state-read-only": k, "data-state-skeletonize": f, children: /* @__PURE__ */ c(at, {}) }),
|
|
273
|
+
u && Qe(/* @__PURE__ */ c(nt, { ref: L, dropdownMaxWidth: Le, children: Ve }), document.body)
|
|
274
|
+
] }),
|
|
275
|
+
A === "below" && /* @__PURE__ */ c(Xe, { customClass: "hint", skeletonize: f, description: t.hint, disabled: i, visible: _ }),
|
|
276
|
+
K && /* @__PURE__ */ c("span", { "data-testid": "test-select-field-list-errors", className: "error", "data-state-skeletonize": f, "aria-describedby": String(S).concat("-errors"), children: G?.map((e, l) => /* @__PURE__ */ B(ne, { children: [
|
|
277
|
+
e,
|
|
278
|
+
" "
|
|
279
|
+
] }, `${l + 1}-${e}`)) })
|
|
280
|
+
] }) }),
|
|
281
|
+
/* @__PURE__ */ c(_e, { targetRef: g, text: re, position: Y, width: ce, space: Y === "right" ? 64 : void 0 })
|
|
282
|
+
] });
|
|
391
283
|
});
|
|
392
|
-
|
|
393
|
-
function wl(t) {
|
|
394
|
-
return h.toNumber(t);
|
|
395
|
-
}
|
|
396
|
-
function Ll(t) {
|
|
397
|
-
return h.toNumber(t);
|
|
398
|
-
}
|
|
399
|
-
function Ol(t) {
|
|
400
|
-
return h.toNumber(t);
|
|
401
|
-
}
|
|
402
|
-
function Fl(t, ne) {
|
|
403
|
-
return /* @__PURE__ */ le(o.Fragment, { children: [
|
|
404
|
-
t,
|
|
405
|
-
" "
|
|
406
|
-
] }, `${ne + 1}-${t}`);
|
|
407
|
-
}
|
|
284
|
+
dt.displayName = "SelectFieldInputBase";
|
|
408
285
|
export {
|
|
409
|
-
|
|
286
|
+
dt as InputBase
|
|
410
287
|
};
|
|
411
288
|
//# sourceMappingURL=base.js.map
|