@alphakits/ui 2.0.12 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/badge/component.d.ts +1 -1
- package/dist/box/component.d.ts +2 -2
- package/dist/calendar/typings.d.ts +42 -0
- package/dist/calendar/use-calendar.d.ts +2 -40
- package/dist/calendar/use-calendar.js +1 -1
- package/dist/calendar/use-calendar.js.map +1 -1
- package/dist/calendar-input/component.d.ts +1 -1
- package/dist/checkbox/component.js +12 -15
- package/dist/checkbox/component.js.map +1 -1
- package/dist/checkbox-lists/component.d.ts +2 -2
- package/dist/collapsable-row/addons.d.ts +3 -3
- package/dist/copy-button/component.d.ts +2 -1
- package/dist/date-switcher/component.d.ts +2 -2
- package/dist/flex/component.d.ts +2 -2
- package/dist/footer/component.js +32 -38
- package/dist/footer/component.js.map +1 -1
- package/dist/footer/index.module.css +1 -1
- package/dist/footer/index.module.css.js +16 -14
- package/dist/footer/index.module.css.js.map +1 -1
- package/dist/form/component.d.ts +2 -2
- package/dist/form/templates/base-form/index.d.ts +1 -1
- package/dist/form/templates/rest-form/form.d.ts +2 -1
- package/dist/form/templates/rest-form/index.d.ts +2 -2
- package/dist/form/templates/rest-form/index.js.map +1 -1
- package/dist/grid/component.d.ts +20 -5
- package/dist/grid/component.js +49 -7
- package/dist/grid/component.js.map +1 -1
- package/dist/grid/index.js +4 -2
- package/dist/grid/index.module.css +1 -0
- package/dist/grid/index.module.css.js +11 -0
- package/dist/grid/{row/index.module.css.js.map → index.module.css.js.map} +1 -1
- package/dist/hooks/useClickOutside/index.d.ts +1 -1
- package/dist/hooks/useClickOutside/index.js.map +1 -1
- package/dist/hooks/useFocus/index.d.ts +1 -1
- package/dist/hooks/useFocus/index.js.map +1 -1
- package/dist/hooks/usePrevious/index.js +3 -3
- package/dist/hooks/usePrevious/index.js.map +1 -1
- package/dist/image/use-image-render-component.d.ts +1 -1
- package/dist/image-gallery/component.d.ts +2 -2
- package/dist/index.js +254 -252
- package/dist/input/component.js +56 -60
- package/dist/input/component.js.map +1 -1
- package/dist/input/index.module.css +1 -1
- package/dist/input-autocomplete/autocomplete-field/index.d.ts +2 -1
- package/dist/input-autocomplete/autocomplete-field/index.js.map +1 -1
- package/dist/input-autocomplete/component.d.ts +3 -3
- package/dist/input-ghost/component.d.ts +1 -1
- package/dist/masked-input/component.d.ts +1 -1
- package/dist/menu/component.d.ts +3 -2
- package/dist/menu/component.js.map +1 -1
- package/dist/menu/hooks/use-menu.d.ts +1 -1
- package/dist/menu/hooks/use-menu.js +6 -6
- package/dist/menu/hooks/use-menu.js.map +1 -1
- package/dist/modal/components/modals/modal.d.ts +2 -1
- package/dist/notification/component.js +33 -37
- package/dist/notification/component.js.map +1 -1
- package/dist/notification/utils/index.d.ts +1 -1
- package/dist/notification/utils/index.js.map +1 -1
- package/dist/page-loading/component.d.ts +2 -2
- package/dist/picker-button/component.d.ts +1 -1
- package/dist/picker-button/field/Component.d.ts +2 -1
- package/dist/portal/utils.d.ts +1 -1
- package/dist/portal/utils.js.map +1 -1
- package/dist/radio-groups/component.d.ts +2 -2
- package/dist/select/components/arrow/component.d.ts +2 -1
- package/dist/select/components/base-select/component.js +262 -259
- package/dist/select/components/base-select/component.js.map +1 -1
- package/dist/select/components/checkmark/component.d.ts +2 -1
- package/dist/select/components/field/component.d.ts +2 -1
- package/dist/select/components/field/component.js.map +1 -1
- package/dist/select/components/native-select/component.js.map +1 -1
- package/dist/select/components/optgroup/component.d.ts +2 -1
- package/dist/select/components/select-search/index.d.ts +1 -1
- package/dist/select/components/virtual-options-list/component.d.ts +2 -1
- package/dist/select/presets/use-lazy-loading/index.d.ts +4 -4
- package/dist/select/presets/use-lazy-loading/index.js +20 -20
- package/dist/select/presets/use-lazy-loading/index.js.map +1 -1
- package/dist/select/presets/use-select-with-loading/hook.d.ts +3 -2
- package/dist/select/presets/use-select-with-loading/hook.js +7 -7
- package/dist/select/presets/use-select-with-loading/hook.js.map +1 -1
- package/dist/select/typings.d.ts +1 -1
- package/dist/select/utils.d.ts +2 -2
- package/dist/select/utils.js +17 -15
- package/dist/select/utils.js.map +1 -1
- package/dist/sidepanel/component.d.ts +1 -0
- package/dist/sidepanel/component.js.map +1 -1
- package/dist/space/Item.d.ts +1 -1
- package/dist/status/component.d.ts +2 -1
- package/dist/status/component.js.map +1 -1
- package/dist/switch/component.d.ts +1 -1
- package/dist/table/components/cells/index.d.ts +2 -1
- package/dist/table/components/empty-list/index.d.ts +2 -2
- package/dist/table/components/error/index.d.ts +2 -2
- package/dist/table/components/loading/index.d.ts +1 -1
- package/dist/table/components/table-header/index.d.ts +1 -1
- package/dist/table/components/table-header/index.js.map +1 -1
- package/dist/table/table.d.ts +2 -2
- package/dist/table/table.js.map +1 -1
- package/dist/table/utils/get-tags.d.ts +3 -2
- package/dist/table/utils/get-tags.js.map +1 -1
- package/dist/table/utils/prepare-rows.d.ts +2 -1
- package/dist/table/utils/prepare-rows.js.map +1 -1
- package/dist/textarea/component.js +68 -75
- package/dist/textarea/component.js.map +1 -1
- package/dist/theme-provider/component.d.ts +1 -0
- package/dist/theme-provider/component.js.map +1 -1
- package/dist/toast/component.d.ts +1 -1
- package/dist/toast-notifier/component.js +39 -40
- package/dist/toast-notifier/component.js.map +1 -1
- package/dist/tooltip/component.d.ts +2 -2
- package/dist/tooltip/component.js +4 -4
- package/dist/tooltip/component.js.map +1 -1
- package/dist/tooltip/node-resolver.d.ts +26 -0
- package/dist/tooltip/node-resolver.js +14 -0
- package/dist/tooltip/node-resolver.js.map +1 -0
- package/dist/typography/title/component.d.ts +2 -2
- package/dist/with-suffix/component.d.ts +1 -1
- package/package.json +8 -12
- package/dist/calendar/typings.js +0 -2
- package/dist/calendar/typings.js.map +0 -1
- package/dist/grid/col/component.d.ts +0 -52
- package/dist/grid/col/component.js +0 -39
- package/dist/grid/col/component.js.map +0 -1
- package/dist/grid/col/index.d.ts +0 -1
- package/dist/grid/col/index.js +0 -5
- package/dist/grid/col/index.js.map +0 -1
- package/dist/grid/col/index.module.css +0 -1
- package/dist/grid/col/index.module.css.js +0 -519
- package/dist/grid/col/index.module.css.js.map +0 -1
- package/dist/grid/gutters.module.css +0 -1
- package/dist/grid/gutters.module.css.js +0 -50
- package/dist/grid/gutters.module.css.js.map +0 -1
- package/dist/grid/row/component.d.ts +0 -41
- package/dist/grid/row/component.js +0 -43
- package/dist/grid/row/component.js.map +0 -1
- package/dist/grid/row/index.d.ts +0 -1
- package/dist/grid/row/index.js +0 -5
- package/dist/grid/row/index.js.map +0 -1
- package/dist/grid/row/index.module.css +0 -1
- package/dist/grid/row/index.module.css.js +0 -25
- package/dist/grid/typings.d.ts +0 -15
- package/dist/grid/typings.js +0 -2
- package/dist/grid/typings.js.map +0 -1
- package/dist/grid/utils/index.d.ts +0 -2
- package/dist/grid/utils/index.js +0 -31
- package/dist/grid/utils/index.js.map +0 -1
- package/dist/select/typings.js +0 -2
- package/dist/select/typings.js.map +0 -1
|
@@ -1,174 +1,187 @@
|
|
|
1
|
-
import { jsx as l, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { useMultipleSelection as
|
|
6
|
-
import { ResizeObserver as
|
|
7
|
-
import { getDataTestId as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { processOptions as
|
|
10
|
-
import { NativeSelect as
|
|
1
|
+
import { jsx as l, jsxs as ot } from "react/jsx-runtime";
|
|
2
|
+
import ct, { forwardRef as it, useRef as I, useMemo as N, useCallback as H, useEffect as U } from "react";
|
|
3
|
+
import ae from "react-merge-refs";
|
|
4
|
+
import le from "classnames";
|
|
5
|
+
import { useMultipleSelection as de, useCombobox as V } from "downshift";
|
|
6
|
+
import { ResizeObserver as at } from "resize-observer";
|
|
7
|
+
import { getDataTestId as _ } from "../../../__internal/utils/getDataTestId.js";
|
|
8
|
+
import { Popover as lt } from "../../../popover/component.js";
|
|
9
|
+
import { processOptions as dt } from "../../utils.js";
|
|
10
|
+
import { NativeSelect as ut } from "../native-select/component.js";
|
|
11
11
|
import P from "./index.module.css.js";
|
|
12
|
-
const
|
|
12
|
+
const ue = (c) => {
|
|
13
|
+
var u;
|
|
14
|
+
return c ? (u = c.key) == null ? void 0 : u.toString() : "";
|
|
15
|
+
}, fe = (c) => {
|
|
16
|
+
const u = I(c);
|
|
17
|
+
return u.current = c, u;
|
|
18
|
+
}, xt = it(
|
|
13
19
|
({
|
|
14
|
-
dataTestId:
|
|
15
|
-
className:
|
|
16
|
-
fieldClassName:
|
|
17
|
-
filteredOptions:
|
|
18
|
-
popoverOuterClassname:
|
|
19
|
-
optionsListClassName:
|
|
20
|
-
optionClassName:
|
|
21
|
-
options:
|
|
22
|
-
actionButton:
|
|
23
|
-
autocomplete:
|
|
24
|
-
multiple:
|
|
25
|
-
allowUnselect:
|
|
26
|
-
disabled:
|
|
27
|
-
closeOnSelect:
|
|
28
|
-
circularNavigation:
|
|
29
|
-
nativeSelect:
|
|
30
|
-
defaultOpen:
|
|
31
|
-
open:
|
|
32
|
-
popoverPosition:
|
|
33
|
-
offset:
|
|
34
|
-
withArrow:
|
|
35
|
-
preventFlip:
|
|
36
|
-
optionsListWidth:
|
|
37
|
-
name:
|
|
38
|
-
id:
|
|
39
|
-
required:
|
|
40
|
-
selected:
|
|
41
|
-
size:
|
|
42
|
-
optionsSize:
|
|
43
|
-
error:
|
|
44
|
-
hint:
|
|
45
|
-
block:
|
|
20
|
+
dataTestId: c = "",
|
|
21
|
+
className: u,
|
|
22
|
+
fieldClassName: pe,
|
|
23
|
+
filteredOptions: S,
|
|
24
|
+
popoverOuterClassname: me,
|
|
25
|
+
optionsListClassName: he,
|
|
26
|
+
optionClassName: q,
|
|
27
|
+
options: w,
|
|
28
|
+
actionButton: z,
|
|
29
|
+
autocomplete: b = !1,
|
|
30
|
+
multiple: h = !1,
|
|
31
|
+
allowUnselect: E = !1,
|
|
32
|
+
disabled: f = !1,
|
|
33
|
+
closeOnSelect: G = !h,
|
|
34
|
+
circularNavigation: ge = !1,
|
|
35
|
+
nativeSelect: k = !1,
|
|
36
|
+
defaultOpen: J = !1,
|
|
37
|
+
open: K,
|
|
38
|
+
popoverPosition: ye = "bottom-start",
|
|
39
|
+
offset: Ie,
|
|
40
|
+
withArrow: we,
|
|
41
|
+
preventFlip: be = !0,
|
|
42
|
+
optionsListWidth: Q = "field",
|
|
43
|
+
name: g,
|
|
44
|
+
id: ke,
|
|
45
|
+
required: ve,
|
|
46
|
+
selected: C,
|
|
47
|
+
size: L = "m",
|
|
48
|
+
optionsSize: X = L,
|
|
49
|
+
error: xe,
|
|
50
|
+
hint: Pe,
|
|
51
|
+
block: Ce = !0,
|
|
46
52
|
label: O,
|
|
47
|
-
placeholder:
|
|
48
|
-
fieldProps:
|
|
49
|
-
optionsListProps:
|
|
50
|
-
optionProps:
|
|
51
|
-
valueRenderer:
|
|
52
|
-
onChange:
|
|
53
|
-
onOpen:
|
|
54
|
-
onFocus:
|
|
55
|
-
onBlur:
|
|
56
|
-
onScroll:
|
|
57
|
-
Arrow:
|
|
58
|
-
Field:
|
|
59
|
-
OptionsList:
|
|
60
|
-
Optgroup:
|
|
61
|
-
Option:
|
|
62
|
-
updatePopover:
|
|
63
|
-
zIndexPopover:
|
|
64
|
-
showEmptyOptionsList:
|
|
65
|
-
visibleOptions:
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
placeholder: De,
|
|
54
|
+
fieldProps: Re = {},
|
|
55
|
+
optionsListProps: Te = {},
|
|
56
|
+
optionProps: Y = {},
|
|
57
|
+
valueRenderer: Me,
|
|
58
|
+
onChange: Ne,
|
|
59
|
+
onOpen: Se,
|
|
60
|
+
onFocus: W,
|
|
61
|
+
onBlur: F,
|
|
62
|
+
onScroll: Ee,
|
|
63
|
+
Arrow: Z,
|
|
64
|
+
Field: Ke = () => null,
|
|
65
|
+
OptionsList: Le = () => null,
|
|
66
|
+
Optgroup: Oe = () => null,
|
|
67
|
+
Option: ee = () => null,
|
|
68
|
+
updatePopover: We,
|
|
69
|
+
zIndexPopover: Fe,
|
|
70
|
+
showEmptyOptionsList: je = !1,
|
|
71
|
+
visibleOptions: Ae
|
|
72
|
+
}, Be) => {
|
|
73
|
+
var ce, ie;
|
|
74
|
+
const v = I(null), te = I(null), x = I(null), ne = I(null), y = I(null), D = fe(Ne), R = fe(Se), { flatOptions: i, selectedOptions: re } = N(
|
|
75
|
+
() => dt(w || [], C),
|
|
76
|
+
[w, C]
|
|
77
|
+
), se = N(() => {
|
|
78
|
+
const e = /* @__PURE__ */ new Map();
|
|
79
|
+
return i.forEach((t, r) => {
|
|
80
|
+
e.set(t.key, r);
|
|
81
|
+
}), e;
|
|
82
|
+
}, [i]), $e = N(
|
|
83
|
+
() => ({
|
|
84
|
+
itemToString: ue,
|
|
85
|
+
onSelectedItemsChange: (e) => {
|
|
86
|
+
var r;
|
|
77
87
|
const { selectedItems: t = [] } = e;
|
|
78
|
-
|
|
88
|
+
(r = D.current) == null || r.call(D, {
|
|
79
89
|
selectedMultiple: t,
|
|
80
90
|
selected: t.length ? t[0] : null,
|
|
81
|
-
name:
|
|
91
|
+
name: g
|
|
82
92
|
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
selectedItems:
|
|
93
|
-
addSelectedItem:
|
|
94
|
-
setSelectedItems:
|
|
95
|
-
removeSelectedItem:
|
|
96
|
-
getDropdownProps:
|
|
97
|
-
} =
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
93
|
+
},
|
|
94
|
+
stateReducer: (e, t) => {
|
|
95
|
+
const { type: r, changes: n } = t;
|
|
96
|
+
return !E && r === de.stateChangeTypes.DropdownKeyDownBackspace ? e : n;
|
|
97
|
+
},
|
|
98
|
+
...C !== void 0 ? { selectedItems: re } : {}
|
|
99
|
+
}),
|
|
100
|
+
[E, g, C, re, D]
|
|
101
|
+
), {
|
|
102
|
+
selectedItems: o,
|
|
103
|
+
addSelectedItem: He,
|
|
104
|
+
setSelectedItems: j,
|
|
105
|
+
removeSelectedItem: Ue,
|
|
106
|
+
getDropdownProps: Ve
|
|
107
|
+
} = de($e), A = N(
|
|
108
|
+
() => new Set(o.map((e) => e.key)),
|
|
109
|
+
[o]
|
|
110
|
+
), {
|
|
111
|
+
isOpen: a,
|
|
112
|
+
getMenuProps: _e,
|
|
113
|
+
getInputProps: qe,
|
|
114
|
+
getItemProps: oe,
|
|
115
|
+
getComboboxProps: ze,
|
|
116
|
+
getLabelProps: Ge,
|
|
117
|
+
highlightedIndex: T,
|
|
118
|
+
toggleMenu: B,
|
|
106
119
|
openMenu: p
|
|
107
|
-
} =
|
|
108
|
-
id:
|
|
109
|
-
isOpen:
|
|
110
|
-
circularNavigation:
|
|
111
|
-
items:
|
|
112
|
-
itemToString:
|
|
113
|
-
defaultHighlightedIndex:
|
|
120
|
+
} = V({
|
|
121
|
+
id: ke,
|
|
122
|
+
isOpen: K,
|
|
123
|
+
circularNavigation: ge,
|
|
124
|
+
items: i,
|
|
125
|
+
itemToString: ue,
|
|
126
|
+
defaultHighlightedIndex: o.length === 0 ? -1 : void 0,
|
|
114
127
|
onIsOpenChange: (e) => {
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
R.current && setTimeout(() => {
|
|
129
|
+
var t;
|
|
130
|
+
(t = R.current) == null || t.call(R, { open: e.isOpen, name: g });
|
|
117
131
|
}, 0);
|
|
118
132
|
},
|
|
119
133
|
stateReducer: (e, t) => {
|
|
120
|
-
const { type:
|
|
121
|
-
switch (
|
|
122
|
-
case
|
|
123
|
-
case
|
|
124
|
-
if (
|
|
125
|
-
const
|
|
126
|
-
|
|
134
|
+
const { type: r, changes: n } = t, { selectedItem: d } = n;
|
|
135
|
+
switch (r) {
|
|
136
|
+
case V.stateChangeTypes.InputKeyDownEnter:
|
|
137
|
+
case V.stateChangeTypes.ItemClick:
|
|
138
|
+
if (d && !d.disabled) {
|
|
139
|
+
const M = A.has(d.key), s = E || h && o.length > 1;
|
|
140
|
+
M && s && Ue(d), M || (h ? He(d) : j([d]));
|
|
127
141
|
}
|
|
128
142
|
return {
|
|
129
|
-
...
|
|
130
|
-
isOpen: !
|
|
131
|
-
highlightedIndex: e.isOpen && !
|
|
143
|
+
...n,
|
|
144
|
+
isOpen: !G,
|
|
145
|
+
highlightedIndex: e.isOpen && !G ? e.highlightedIndex : n.highlightedIndex
|
|
132
146
|
};
|
|
133
147
|
default:
|
|
134
|
-
return
|
|
148
|
+
return n;
|
|
135
149
|
}
|
|
136
150
|
}
|
|
137
|
-
}),
|
|
138
|
-
{ ref:
|
|
151
|
+
}), Je = _e(
|
|
152
|
+
{ ref: x },
|
|
139
153
|
{ suppressRefError: !0 }
|
|
140
|
-
), m =
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
var
|
|
154
|
+
), m = qe(Ve({ ref: ae([Be, te]) })), Qe = (e) => {
|
|
155
|
+
W == null || W(e), b && !a && p();
|
|
156
|
+
}, Xe = (e) => {
|
|
157
|
+
var n;
|
|
144
158
|
const t = e.relatedTarget || document.activeElement;
|
|
145
|
-
!!(t && ((
|
|
146
|
-
},
|
|
147
|
-
m.onKeyDown(e),
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
|
|
159
|
+
!!(t && ((n = x.current) != null && n.contains(t))) || (F == null || F(e), m.onBlur(e));
|
|
160
|
+
}, Ye = (e) => {
|
|
161
|
+
m.onKeyDown(e), b && !a && e.key.length === 1 && p(), [" ", "Enter"].includes(e.key) && !b && !k && e.target.tagName !== "INPUT" && (e.preventDefault(), (!a || T === -1) && B());
|
|
162
|
+
}, Ze = (e) => {
|
|
163
|
+
var t;
|
|
164
|
+
(t = x.current) != null && t.contains(e.target) || (!b || e.target.tagName !== "INPUT" ? B() : p());
|
|
165
|
+
}, et = H(
|
|
151
166
|
(e) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
(t,
|
|
167
|
+
j(
|
|
168
|
+
Array.from(e.target.options).reduce(
|
|
169
|
+
(t, r, n) => r.selected ? t.concat(i[n]) : t,
|
|
155
170
|
[]
|
|
156
171
|
)
|
|
157
172
|
);
|
|
158
173
|
},
|
|
159
|
-
[
|
|
160
|
-
),
|
|
161
|
-
({ option: e, index: t, ...
|
|
174
|
+
[i, j]
|
|
175
|
+
), tt = H(
|
|
176
|
+
({ option: e, index: t, ...r }) => {
|
|
162
177
|
if (!e) return null;
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
item:
|
|
167
|
-
index:
|
|
178
|
+
const n = se.get(e.key);
|
|
179
|
+
if (n === void 0) return null;
|
|
180
|
+
const d = i[n], M = oe({
|
|
181
|
+
item: d,
|
|
182
|
+
index: n,
|
|
168
183
|
disabled: e.disabled,
|
|
169
|
-
// десктоп
|
|
170
184
|
onMouseDown: (s) => s.preventDefault(),
|
|
171
|
-
// мобилки: не даём событию «пробить» до поля и повторно открыть меню
|
|
172
185
|
onPointerDown: (s) => {
|
|
173
186
|
s.preventDefault(), s.stopPropagation();
|
|
174
187
|
},
|
|
@@ -179,151 +192,141 @@ const pt = Ze(
|
|
|
179
192
|
s.stopPropagation();
|
|
180
193
|
}
|
|
181
194
|
});
|
|
182
|
-
return /* @__PURE__ */ l(
|
|
183
|
-
...
|
|
184
|
-
...
|
|
185
|
-
className:
|
|
186
|
-
innerProps:
|
|
195
|
+
return /* @__PURE__ */ l(ct.Fragment, { children: ee({
|
|
196
|
+
...Y,
|
|
197
|
+
...r,
|
|
198
|
+
className: q,
|
|
199
|
+
innerProps: M,
|
|
187
200
|
index: t,
|
|
188
201
|
option: e,
|
|
189
|
-
size:
|
|
202
|
+
size: X,
|
|
190
203
|
disabled: e.disabled,
|
|
191
|
-
highlighted:
|
|
192
|
-
selected:
|
|
204
|
+
highlighted: n === T,
|
|
205
|
+
selected: A.has(e.key)
|
|
193
206
|
}) }, e.key);
|
|
194
207
|
},
|
|
195
208
|
[
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
te,
|
|
209
|
+
Y,
|
|
210
|
+
i,
|
|
211
|
+
se,
|
|
200
212
|
q,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
213
|
+
oe,
|
|
214
|
+
X,
|
|
215
|
+
T,
|
|
216
|
+
A,
|
|
217
|
+
ee
|
|
204
218
|
]
|
|
205
219
|
);
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}, [
|
|
209
|
-
|
|
210
|
-
}, [
|
|
211
|
-
const
|
|
212
|
-
if (!
|
|
213
|
-
const e =
|
|
214
|
-
ne.current !== t && (ne.current = t,
|
|
215
|
-
}, [
|
|
216
|
-
|
|
217
|
-
if (!
|
|
218
|
-
const e =
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return b.current && e.observe(b.current), x(), () => {
|
|
224
|
-
e.disconnect(), I.current && window.clearTimeout(I.current), I.current = null;
|
|
220
|
+
U(() => {
|
|
221
|
+
J && p();
|
|
222
|
+
}, [J, p]), U(() => {
|
|
223
|
+
K === !0 && p();
|
|
224
|
+
}, [K, p]);
|
|
225
|
+
const $ = H(() => {
|
|
226
|
+
if (!x.current || !v.current) return;
|
|
227
|
+
const e = Q === "field" ? "width" : "minWidth", t = Math.round(v.current.getBoundingClientRect().width);
|
|
228
|
+
ne.current !== t && (ne.current = t, x.current.style[e] = `${t}px`);
|
|
229
|
+
}, [Q]);
|
|
230
|
+
U(() => {
|
|
231
|
+
if (!a || !v.current) return;
|
|
232
|
+
const e = () => {
|
|
233
|
+
y.current && window.clearTimeout(y.current), y.current = window.setTimeout($, 50);
|
|
234
|
+
}, t = new at(e);
|
|
235
|
+
return t.observe(v.current), $(), () => {
|
|
236
|
+
t.disconnect(), y.current && window.clearTimeout(y.current), y.current = null;
|
|
225
237
|
};
|
|
226
|
-
}, [
|
|
227
|
-
|
|
228
|
-
}, [o, g, n, x]);
|
|
229
|
-
const Ge = R(
|
|
230
|
-
() => n.map((e) => /* @__PURE__ */ l("input", { type: "hidden", name: f, value: e.key }, e.key)),
|
|
231
|
-
[n, f]
|
|
232
|
-
), Je = R(() => {
|
|
238
|
+
}, [a, $, w, o]);
|
|
239
|
+
const nt = h ? o.map((e) => {
|
|
233
240
|
var t;
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}) : (t = (n[0] || {}).key) == null ? void 0 : t.toString();
|
|
238
|
-
return /* @__PURE__ */ l(
|
|
239
|
-
st,
|
|
240
|
-
{
|
|
241
|
-
className: P.nativeSelect,
|
|
242
|
-
disabled: a,
|
|
243
|
-
multiple: u,
|
|
244
|
-
name: f,
|
|
245
|
-
value: e,
|
|
246
|
-
onChange: re,
|
|
247
|
-
options: g
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
}, [u, n, a, f, re, g]), Qe = d.length > 0 || Se || !!B;
|
|
251
|
-
return /* @__PURE__ */ Xe(
|
|
241
|
+
return (t = e.key) == null ? void 0 : t.toString();
|
|
242
|
+
}) : (ie = (ce = o[0]) == null ? void 0 : ce.key) == null ? void 0 : ie.toString(), rt = i.length > 0 || je || !!z, st = O ? /* @__PURE__ */ l("span", { ...Ge(), children: ve ? `${O} *` : O }) : void 0;
|
|
243
|
+
return /* @__PURE__ */ ot(
|
|
252
244
|
"div",
|
|
253
245
|
{
|
|
254
|
-
...
|
|
255
|
-
ref:
|
|
256
|
-
...
|
|
257
|
-
className:
|
|
246
|
+
...ze({
|
|
247
|
+
ref: v,
|
|
248
|
+
...f && { "aria-disabled": !0 },
|
|
249
|
+
className: le(P.component, { [P.block]: Ce }, u)
|
|
258
250
|
}),
|
|
259
|
-
onKeyDown:
|
|
251
|
+
onKeyDown: f ? void 0 : Ye,
|
|
260
252
|
tabIndex: -1,
|
|
261
253
|
id: "slect_wrapper",
|
|
262
|
-
"data-test-id":
|
|
254
|
+
"data-test-id": _("combobox", c),
|
|
263
255
|
children: [
|
|
264
|
-
|
|
256
|
+
k && /* @__PURE__ */ l(
|
|
257
|
+
ut,
|
|
258
|
+
{
|
|
259
|
+
className: P.nativeSelect,
|
|
260
|
+
disabled: f,
|
|
261
|
+
multiple: h,
|
|
262
|
+
name: g,
|
|
263
|
+
value: nt,
|
|
264
|
+
onChange: et,
|
|
265
|
+
options: w
|
|
266
|
+
}
|
|
267
|
+
),
|
|
265
268
|
/* @__PURE__ */ l(
|
|
266
|
-
|
|
269
|
+
Ke,
|
|
267
270
|
{
|
|
268
|
-
selectedMultiple:
|
|
269
|
-
selected:
|
|
270
|
-
multiple:
|
|
271
|
-
open:
|
|
272
|
-
disabled:
|
|
273
|
-
size:
|
|
274
|
-
placeholder:
|
|
275
|
-
label:
|
|
276
|
-
Arrow:
|
|
277
|
-
error:
|
|
278
|
-
hint:
|
|
279
|
-
valueRenderer:
|
|
280
|
-
className:
|
|
271
|
+
selectedMultiple: o,
|
|
272
|
+
selected: o[0],
|
|
273
|
+
multiple: h,
|
|
274
|
+
open: a,
|
|
275
|
+
disabled: f,
|
|
276
|
+
size: L,
|
|
277
|
+
placeholder: De,
|
|
278
|
+
label: st,
|
|
279
|
+
Arrow: Z && /* @__PURE__ */ l(Z, { open: a }),
|
|
280
|
+
error: xe,
|
|
281
|
+
hint: Pe,
|
|
282
|
+
valueRenderer: Me,
|
|
283
|
+
className: pe,
|
|
281
284
|
innerProps: {
|
|
282
|
-
onBlur:
|
|
283
|
-
onFocus:
|
|
284
|
-
onClick:
|
|
285
|
-
tabIndex:
|
|
286
|
-
ref:
|
|
285
|
+
onBlur: Xe,
|
|
286
|
+
onFocus: f ? void 0 : Qe,
|
|
287
|
+
onClick: f ? void 0 : Ze,
|
|
288
|
+
tabIndex: k || f ? -1 : 0,
|
|
289
|
+
ref: ae([m.ref]),
|
|
287
290
|
id: m.id,
|
|
288
291
|
"aria-labelledby": m["aria-labelledby"],
|
|
289
292
|
"aria-controls": m["aria-controls"],
|
|
290
|
-
"aria-autocomplete":
|
|
293
|
+
"aria-autocomplete": b ? m["aria-autocomplete"] : void 0
|
|
291
294
|
},
|
|
292
|
-
dataTestId:
|
|
293
|
-
...
|
|
295
|
+
dataTestId: _("field", c),
|
|
296
|
+
...Re
|
|
294
297
|
}
|
|
295
298
|
),
|
|
296
|
-
|
|
297
|
-
!
|
|
298
|
-
|
|
299
|
+
g && !k && o.map((e) => /* @__PURE__ */ l("input", { type: "hidden", name: g, value: e.key }, e.key)),
|
|
300
|
+
!k && /* @__PURE__ */ l(
|
|
301
|
+
lt,
|
|
299
302
|
{
|
|
300
|
-
open:
|
|
303
|
+
open: a,
|
|
301
304
|
withTransition: !1,
|
|
302
|
-
anchorElement:
|
|
303
|
-
position:
|
|
304
|
-
offset:
|
|
305
|
-
withArrow:
|
|
306
|
-
preventFlip:
|
|
307
|
-
className:
|
|
305
|
+
anchorElement: te.current,
|
|
306
|
+
position: ye,
|
|
307
|
+
offset: Ie,
|
|
308
|
+
withArrow: we,
|
|
309
|
+
preventFlip: be,
|
|
310
|
+
className: me,
|
|
308
311
|
popperClassName: P.popoverInner,
|
|
309
|
-
update:
|
|
310
|
-
zIndex:
|
|
311
|
-
children:
|
|
312
|
-
|
|
312
|
+
update: We,
|
|
313
|
+
zIndex: Fe,
|
|
314
|
+
children: rt && /* @__PURE__ */ l("div", { ...Je, className: le(he, P.optionsList), children: /* @__PURE__ */ l(
|
|
315
|
+
Le,
|
|
313
316
|
{
|
|
314
|
-
...
|
|
315
|
-
flatOptions:
|
|
316
|
-
highlightedIndex:
|
|
317
|
-
open:
|
|
318
|
-
size:
|
|
319
|
-
toggleMenu:
|
|
320
|
-
actionButton:
|
|
321
|
-
options:
|
|
322
|
-
Optgroup:
|
|
323
|
-
Option:
|
|
324
|
-
visibleOptions:
|
|
325
|
-
onScroll:
|
|
326
|
-
dataTestId:
|
|
317
|
+
...Te,
|
|
318
|
+
flatOptions: i,
|
|
319
|
+
highlightedIndex: T,
|
|
320
|
+
open: a,
|
|
321
|
+
size: L,
|
|
322
|
+
toggleMenu: B,
|
|
323
|
+
actionButton: z,
|
|
324
|
+
options: S != null ? S : w,
|
|
325
|
+
Optgroup: Oe,
|
|
326
|
+
Option: tt,
|
|
327
|
+
visibleOptions: Ae,
|
|
328
|
+
onScroll: Ee,
|
|
329
|
+
dataTestId: _("options-list", c)
|
|
327
330
|
}
|
|
328
331
|
) })
|
|
329
332
|
}
|
|
@@ -334,6 +337,6 @@ const pt = Ze(
|
|
|
334
337
|
}
|
|
335
338
|
);
|
|
336
339
|
export {
|
|
337
|
-
|
|
340
|
+
xt as BaseSelect
|
|
338
341
|
};
|
|
339
342
|
//# sourceMappingURL=component.js.map
|