mimir-ui-kit 1.37.5 → 1.37.7
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/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.d.ts +2 -0
- package/dist/components/Accordion/Accordion.js +150 -149
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +22 -22
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +24 -24
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabButtons/TabButtons.d.ts +2 -0
- package/dist/components/TabTrail/TabButtons/TabButtons.js +20 -16
- package/dist/components/TabTrail/TabTrail.d.ts +5 -0
- package/dist/components/TabTrail/TabTrail.js +156 -153
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
@@ -36,6 +36,8 @@ export type TProps = {
|
|
36
36
|
linkClassName?: string;
|
37
37
|
/** Флаг, указывающий, отключен ли аккордеон. */
|
38
38
|
disabled?: boolean;
|
39
|
+
/** Флаг, указывающий, отображать ли заголовок по умолчанию */
|
40
|
+
showTitleByDefault?: boolean;
|
39
41
|
/** Контент аккордеона. */
|
40
42
|
children?: ReactNode | ((props: TChildrenProps) => ReactNode);
|
41
43
|
};
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { jsxs as
|
1
|
+
import { jsxs as B, Fragment as K, jsx as b } from "react/jsx-runtime";
|
2
2
|
import { c as $ } from "../../index-DIxK0V-G.js";
|
3
|
-
import v, { createContext as M, useRef as
|
4
|
-
import { AccordionItem as
|
5
|
-
import { EAccordionButtonType as T, EAccordionSize as x, EAccordionLinkIconSize as
|
6
|
-
import { useMediaQuery as
|
7
|
-
import { EMediaQuery as
|
8
|
-
import { Icon as
|
9
|
-
import { Link as
|
10
|
-
import { M as
|
11
|
-
import { w as
|
12
|
-
import { e as
|
13
|
-
import { c as
|
14
|
-
import { r as
|
15
|
-
import '../../assets/Accordion.css';let
|
3
|
+
import v, { createContext as M, useRef as ne, Fragment as re, useReducer as pe, useMemo as O, useId as le, useEffect as se, useState as ae, useContext as U, forwardRef as me } from "react";
|
4
|
+
import { AccordionItem as fe } from "./AccordionItem/AccordionItem.js";
|
5
|
+
import { EAccordionButtonType as T, EAccordionSize as x, EAccordionLinkIconSize as J, EAccordionButtonStyle as _e, EAccordionIconType as Y, EAccordionButtonIconSize as Z } from "./constants.js";
|
6
|
+
import { useMediaQuery as Ee } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
7
|
+
import { EMediaQuery as Se } from "../../hooks/useMediaQuery/constants.js";
|
8
|
+
import { Icon as ke } from "../../icons/Icon.js";
|
9
|
+
import { Link as Ie } from "../AnchorLink/Link.js";
|
10
|
+
import { M as ee, W as q, y as j, T as be, o as P, a as W, H as Q, I as ce, $ as ve, b as ye, D as te, u as he, c as w } from "../../keyboard-mgWkd2Vh.js";
|
11
|
+
import { w as De } from "../../use-active-press-CqLGIFz7.js";
|
12
|
+
import { e as $e } from "../../use-resolve-button-type-DhFdPxnv.js";
|
13
|
+
import { c as Pe, i as R, u as ge, x as Te, R as we, s as Ne } from "../../open-closed-D2VjDhAN.js";
|
14
|
+
import { r as Ce } from "../../bugs-diTMAGNw.js";
|
15
|
+
import '../../assets/Accordion.css';let Ae = M(() => {
|
16
16
|
});
|
17
|
-
function
|
18
|
-
return v.createElement(
|
17
|
+
function Be({ value: e, children: t }) {
|
18
|
+
return v.createElement(Ae.Provider, { value: e }, t);
|
19
19
|
}
|
20
|
-
var
|
21
|
-
let
|
20
|
+
var oe;
|
21
|
+
let xe = (oe = v.startTransition) != null ? oe : function(e) {
|
22
22
|
e();
|
23
23
|
};
|
24
|
-
var
|
25
|
-
let
|
24
|
+
var Oe = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Oe || {}), Re = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.SetButtonElement = 4] = "SetButtonElement", e[e.SetPanelElement = 5] = "SetPanelElement", e))(Re || {});
|
25
|
+
let Me = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
|
26
26
|
return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
|
27
27
|
}, 3(e, t) {
|
28
28
|
return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
|
@@ -30,160 +30,161 @@ let Re = { 0: (e) => ({ ...e, disclosureState: j(e.disclosureState, { 0: 1, 1: 0
|
|
30
30
|
return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
|
31
31
|
}, 5(e, t) {
|
32
32
|
return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
|
33
|
-
} },
|
34
|
-
|
35
|
-
function
|
36
|
-
let t =
|
33
|
+
} }, V = M(null);
|
34
|
+
V.displayName = "DisclosureContext";
|
35
|
+
function z(e) {
|
36
|
+
let t = U(V);
|
37
37
|
if (t === null) {
|
38
|
-
let
|
39
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
38
|
+
let u = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
39
|
+
throw Error.captureStackTrace && Error.captureStackTrace(u, z), u;
|
40
40
|
}
|
41
41
|
return t;
|
42
42
|
}
|
43
|
-
let
|
44
|
-
|
45
|
-
function
|
46
|
-
let t =
|
43
|
+
let X = M(null);
|
44
|
+
X.displayName = "DisclosureAPIContext";
|
45
|
+
function ie(e) {
|
46
|
+
let t = U(X);
|
47
47
|
if (t === null) {
|
48
|
-
let
|
49
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
48
|
+
let u = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
49
|
+
throw Error.captureStackTrace && Error.captureStackTrace(u, ie), u;
|
50
50
|
}
|
51
51
|
return t;
|
52
52
|
}
|
53
|
-
let
|
54
|
-
|
55
|
-
function
|
56
|
-
return
|
57
|
-
}
|
58
|
-
function Fe(e, t) {
|
59
|
-
return j(t.type, Re, e, t);
|
53
|
+
let G = M(null);
|
54
|
+
G.displayName = "DisclosurePanelContext";
|
55
|
+
function Fe() {
|
56
|
+
return U(G);
|
60
57
|
}
|
61
|
-
let He = ne;
|
62
58
|
function Le(e, t) {
|
63
|
-
|
59
|
+
return W(t.type, Me, e, t);
|
60
|
+
}
|
61
|
+
let He = re;
|
62
|
+
function Ke(e, t) {
|
63
|
+
let { defaultOpen: u = !1, ...p } = e, s = ne(null), m = j(t, be((c) => {
|
64
64
|
s.current = c;
|
65
|
-
}, e.as === void 0 || e.as ===
|
66
|
-
|
67
|
-
let f =
|
65
|
+
}, e.as === void 0 || e.as === re)), a = pe(Le, { disclosureState: u ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: o, buttonId: r }, E] = a, l = P((c) => {
|
66
|
+
E({ type: 1 });
|
67
|
+
let f = he(s);
|
68
68
|
if (!f || !r) return;
|
69
69
|
let _ = c ? c instanceof HTMLElement ? c : c.current instanceof HTMLElement ? c.current : f.getElementById(r) : f.getElementById(r);
|
70
70
|
_ == null || _.focus();
|
71
|
-
}), y = O(() => ({ close: l }), [l]),
|
72
|
-
return v.createElement(
|
71
|
+
}), y = O(() => ({ close: l }), [l]), S = O(() => ({ open: o === 0, close: l }), [o, l]), k = { ref: m };
|
72
|
+
return v.createElement(V.Provider, { value: a }, v.createElement(X.Provider, { value: y }, v.createElement(Be, { value: l }, v.createElement(Pe, { value: W(o, { 0: R.Open, 1: R.Closed }) }, Q({ ourProps: k, theirProps: p, slot: S, defaultTag: He, name: "Disclosure" })))));
|
73
73
|
}
|
74
|
-
let
|
75
|
-
function
|
76
|
-
let
|
77
|
-
if (!l) return r({ type: 4, element:
|
78
|
-
})),
|
79
|
-
|
80
|
-
if (!l) return r({ type: 2, buttonId:
|
74
|
+
let Ue = "button";
|
75
|
+
function qe(e, t) {
|
76
|
+
let u = le(), { id: p = `headlessui-disclosure-button-${u}`, disabled: s = !1, autoFocus: m = !1, ...a } = e, [o, r] = z("Disclosure.Button"), E = Fe(), l = E === null ? !1 : E === o.panelId, y = ne(null), S = j(y, t, P((i) => {
|
77
|
+
if (!l) return r({ type: 4, element: i });
|
78
|
+
})), k = ce();
|
79
|
+
se(() => {
|
80
|
+
if (!l) return r({ type: 2, buttonId: p }), () => {
|
81
81
|
r({ type: 2, buttonId: null });
|
82
82
|
};
|
83
|
-
}, [
|
84
|
-
let c = P((
|
85
|
-
var
|
83
|
+
}, [p, r, l]);
|
84
|
+
let c = P((i) => {
|
85
|
+
var n;
|
86
86
|
if (l) {
|
87
87
|
if (o.disclosureState === 1) return;
|
88
|
-
switch (
|
88
|
+
switch (i.key) {
|
89
89
|
case w.Space:
|
90
90
|
case w.Enter:
|
91
|
-
|
91
|
+
i.preventDefault(), i.stopPropagation(), r({ type: 0 }), (n = o.buttonElement) == null || n.focus();
|
92
92
|
break;
|
93
93
|
}
|
94
|
-
} else switch (
|
94
|
+
} else switch (i.key) {
|
95
95
|
case w.Space:
|
96
96
|
case w.Enter:
|
97
|
-
|
97
|
+
i.preventDefault(), i.stopPropagation(), r({ type: 0 });
|
98
98
|
break;
|
99
99
|
}
|
100
|
-
}), f = P((
|
101
|
-
switch (
|
100
|
+
}), f = P((i) => {
|
101
|
+
switch (i.key) {
|
102
102
|
case w.Space:
|
103
|
-
|
103
|
+
i.preventDefault();
|
104
104
|
break;
|
105
105
|
}
|
106
|
-
}), _ = P((
|
107
|
-
var
|
108
|
-
|
109
|
-
}), { isFocusVisible: h, focusProps: D } =
|
110
|
-
return
|
106
|
+
}), _ = P((i) => {
|
107
|
+
var n;
|
108
|
+
Ce(i.currentTarget) || s || (l ? (r({ type: 0 }), (n = o.buttonElement) == null || n.focus()) : r({ type: 0 }));
|
109
|
+
}), { isFocusVisible: h, focusProps: D } = ve({ autoFocus: m }), { isHovered: N, hoverProps: C } = ye({ isDisabled: s }), { pressed: I, pressProps: g } = De({ disabled: s }), F = O(() => ({ open: o.disclosureState === 0, hover: N, active: I, disabled: s, focus: h, autofocus: m }), [o, N, I, h, s, m]), A = $e(e, o.buttonElement), L = l ? te({ ref: S, type: A, disabled: s || void 0, autoFocus: m, onKeyDown: c, onClick: _ }, D, C, g) : te({ ref: S, id: p, type: A, "aria-expanded": o.disclosureState === 0, "aria-controls": o.panelElement ? o.panelId : void 0, disabled: s || void 0, autoFocus: m, onKeyDown: c, onKeyUp: f, onClick: _ }, D, C, g);
|
110
|
+
return Q({ mergeRefs: k, ourProps: L, theirProps: a, slot: F, defaultTag: Ue, name: "Disclosure.Button" });
|
111
111
|
}
|
112
|
-
let
|
113
|
-
function
|
114
|
-
let
|
115
|
-
|
112
|
+
let je = "div", We = ee.RenderStrategy | ee.Static;
|
113
|
+
function Qe(e, t) {
|
114
|
+
let u = le(), { id: p = `headlessui-disclosure-panel-${u}`, transition: s = !1, ...m } = e, [a, o] = z("Disclosure.Panel"), { close: r } = ie("Disclosure.Panel"), E = ce(), [l, y] = ae(null), S = j(t, P((D) => {
|
115
|
+
xe(() => o({ type: 5, element: D }));
|
116
116
|
}), y);
|
117
|
-
|
117
|
+
se(() => (o({ type: 3, panelId: p }), () => {
|
118
118
|
o({ type: 3, panelId: null });
|
119
|
-
}), [
|
120
|
-
let
|
121
|
-
return v.createElement(
|
119
|
+
}), [p, o]);
|
120
|
+
let k = ge(), [c, f] = Te(s, l, k !== null ? (k & R.Open) === R.Open : a.disclosureState === 0), _ = O(() => ({ open: a.disclosureState === 0, close: r }), [a.disclosureState, r]), h = { ref: S, id: p, ...we(f) };
|
121
|
+
return v.createElement(Ne, null, v.createElement(G.Provider, { value: a.panelId }, Q({ mergeRefs: E, ourProps: h, theirProps: m, slot: _, defaultTag: je, features: We, visible: c, name: "Disclosure.Panel" })));
|
122
122
|
}
|
123
|
-
let
|
124
|
-
const
|
125
|
-
accordion:
|
123
|
+
let Ve = q(Ke), ue = q(qe), de = q(Qe), ze = Object.assign(Ve, { Button: ue, Panel: de });
|
124
|
+
const Xe = "_accordion_1k9to_2", Ge = "_header_1k9to_13", Je = "_disabled_1k9to_25", Ye = "_title_1k9to_29", Ze = "_icon_1k9to_36", et = "_circle_1k9to_46", tt = "_square_1k9to_53", ot = "_panel_1k9to_73", nt = "_open_1k9to_80", rt = "_m_1k9to_106", lt = "_s_1k9to_53", d = {
|
125
|
+
accordion: Xe,
|
126
126
|
"is-link": "_is-link_1k9to_9",
|
127
|
-
header:
|
128
|
-
disabled:
|
129
|
-
title:
|
127
|
+
header: Ge,
|
128
|
+
disabled: Je,
|
129
|
+
title: Ye,
|
130
130
|
"title-uppercase": "_title-uppercase_1k9to_32",
|
131
|
-
icon:
|
131
|
+
icon: Ze,
|
132
132
|
"icon-container": "_icon-container_1k9to_39",
|
133
|
-
circle:
|
134
|
-
square:
|
135
|
-
panel:
|
136
|
-
open:
|
133
|
+
circle: et,
|
134
|
+
square: tt,
|
135
|
+
panel: ot,
|
136
|
+
open: nt,
|
137
137
|
"link-open": "_link-open_1k9to_102",
|
138
|
-
m:
|
139
|
-
s:
|
138
|
+
m: rt,
|
139
|
+
s: lt,
|
140
140
|
"wrapper-button": "_wrapper-button_1k9to_134"
|
141
|
-
},
|
141
|
+
}, bt = me(
|
142
142
|
({
|
143
143
|
title: e,
|
144
144
|
disabled: t,
|
145
|
-
buttonType:
|
146
|
-
children:
|
147
|
-
|
145
|
+
buttonType: u = T.BUTTON,
|
146
|
+
children: p,
|
147
|
+
showTitleByDefault: s = !0,
|
148
|
+
linkClassName: m,
|
148
149
|
size: a = x.M,
|
149
|
-
titleUppercase:
|
150
|
-
buttonStyle:
|
151
|
-
iconType:
|
152
|
-
classNameTitle:
|
153
|
-
classNameContent:
|
154
|
-
classNameAccordion:
|
150
|
+
titleUppercase: o,
|
151
|
+
buttonStyle: r = _e.CIRCLE,
|
152
|
+
iconType: E = Y.ARROW,
|
153
|
+
classNameTitle: l,
|
154
|
+
classNameContent: y,
|
155
|
+
classNameAccordion: S,
|
155
156
|
classNameIconButton: k,
|
156
|
-
subtitleNode:
|
157
|
-
onlyOpenSubtitleNode:
|
158
|
-
classNameSubtitleContainer:
|
159
|
-
},
|
160
|
-
const [
|
161
|
-
[
|
162
|
-
},
|
163
|
-
t ||
|
164
|
-
},
|
157
|
+
subtitleNode: c,
|
158
|
+
onlyOpenSubtitleNode: f,
|
159
|
+
classNameSubtitleContainer: _
|
160
|
+
}, h) => {
|
161
|
+
const [D, N] = ae(!1), C = Ee(Se.XS1), I = u === T.LINK, g = {
|
162
|
+
[d["is-link"]]: I
|
163
|
+
}, F = () => {
|
164
|
+
t || N((n) => !n);
|
165
|
+
}, A = a === x.S ? J.S : J.M, L = (n) => ({
|
165
166
|
variant: "anchor",
|
166
|
-
size:
|
167
|
+
size: C ? "s" : "l",
|
167
168
|
rightIcon: {
|
168
|
-
iconName:
|
169
|
+
iconName: A,
|
169
170
|
className: $({
|
170
|
-
[
|
171
|
+
[d["link-open"]]: n
|
171
172
|
})
|
172
173
|
}
|
173
|
-
},
|
174
|
-
const
|
175
|
-
switch (
|
174
|
+
}), i = (n) => {
|
175
|
+
const H = () => E === Y.DROPDOWN ? a === x.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === x.S ? Z.S : Z.M;
|
176
|
+
switch (u) {
|
176
177
|
case T.LINK:
|
177
178
|
return e;
|
178
179
|
case T.BUTTON:
|
179
|
-
return /* @__PURE__ */
|
180
|
+
return /* @__PURE__ */ B(K, { children: [
|
180
181
|
/* @__PURE__ */ b(
|
181
182
|
"span",
|
182
183
|
{
|
183
184
|
className: $(
|
184
|
-
|
185
|
-
|
186
|
-
|
185
|
+
d.title,
|
186
|
+
l,
|
187
|
+
o && d["title-uppercase"]
|
187
188
|
),
|
188
189
|
children: e
|
189
190
|
}
|
@@ -192,18 +193,18 @@ const ze = "_accordion_1k9to_2", Xe = "_header_1k9to_13", Ge = "_disabled_1k9to_
|
|
192
193
|
"div",
|
193
194
|
{
|
194
195
|
className: $(
|
195
|
-
|
196
|
-
n &&
|
197
|
-
t &&
|
198
|
-
|
196
|
+
d["icon-container"],
|
197
|
+
n && d.open,
|
198
|
+
t && d.disabled,
|
199
|
+
d[r],
|
199
200
|
k
|
200
201
|
),
|
201
202
|
"data-testid": "accordion-icon-container",
|
202
203
|
children: /* @__PURE__ */ b(
|
203
|
-
|
204
|
+
ke,
|
204
205
|
{
|
205
|
-
iconName:
|
206
|
-
className:
|
206
|
+
iconName: H(),
|
207
|
+
className: d.icon,
|
207
208
|
"data-testid": "accordion-icon"
|
208
209
|
}
|
209
210
|
)
|
@@ -214,57 +215,57 @@ const ze = "_accordion_1k9to_2", Xe = "_header_1k9to_13", Ge = "_disabled_1k9to_
|
|
214
215
|
return null;
|
215
216
|
}
|
216
217
|
};
|
217
|
-
return /* @__PURE__ */
|
218
|
+
return /* @__PURE__ */ B(K, { children: [
|
218
219
|
/* @__PURE__ */ b(
|
219
220
|
"div",
|
220
221
|
{
|
221
222
|
className: $(
|
222
|
-
|
223
|
-
|
223
|
+
d.accordion,
|
224
|
+
d[a],
|
224
225
|
g,
|
225
|
-
|
226
|
+
S
|
226
227
|
),
|
227
|
-
children: /* @__PURE__ */ b(
|
228
|
-
/* @__PURE__ */ b(
|
229
|
-
|
228
|
+
children: /* @__PURE__ */ b(ze, { ref: h, children: ({ open: n, close: H }) => /* @__PURE__ */ B(K, { children: [
|
229
|
+
(!n || s) && /* @__PURE__ */ b(
|
230
|
+
ue,
|
230
231
|
{
|
231
232
|
disabled: t,
|
232
|
-
as: I ?
|
233
|
-
onClick:
|
233
|
+
as: I ? Ie : T.BUTTON,
|
234
|
+
onClick: F,
|
234
235
|
className: $({
|
235
|
-
[
|
236
|
-
[
|
237
|
-
[
|
236
|
+
[d.header]: !I,
|
237
|
+
[d.disabled]: t,
|
238
|
+
[m ?? ""]: I && m
|
238
239
|
}),
|
239
|
-
...I ?
|
240
|
-
children:
|
240
|
+
...I ? L(n) : {},
|
241
|
+
children: (!n || s) && i(n)
|
241
242
|
}
|
242
243
|
),
|
243
244
|
n && /* @__PURE__ */ b(
|
244
|
-
|
245
|
+
de,
|
245
246
|
{
|
246
247
|
"data-testid": "accordion-panel",
|
247
248
|
className: $(
|
248
|
-
|
249
|
-
|
249
|
+
d.panel,
|
250
|
+
y,
|
250
251
|
g
|
251
252
|
),
|
252
|
-
children: /* @__PURE__ */ b(
|
253
|
+
children: /* @__PURE__ */ b(fe, { size: a, children: typeof p == "function" ? p({
|
253
254
|
open: n,
|
254
|
-
close:
|
255
|
-
}) :
|
255
|
+
close: H
|
256
|
+
}) : p })
|
256
257
|
}
|
257
258
|
)
|
258
259
|
] }) })
|
259
260
|
}
|
260
261
|
),
|
261
|
-
(
|
262
|
-
|
263
|
-
|
262
|
+
(c || f) && /* @__PURE__ */ B("div", { className: _, children: [
|
263
|
+
c,
|
264
|
+
D && f
|
264
265
|
] })
|
265
266
|
] });
|
266
267
|
}
|
267
268
|
);
|
268
269
|
export {
|
269
|
-
|
270
|
+
bt as Accordion
|
270
271
|
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsxs as O, jsx as x } from "react/jsx-runtime";
|
2
|
-
import { W as V, p as W, o as m, $ as X, b as q, D as z, H as J, c as y } from "../../keyboard-
|
2
|
+
import { W as V, p as W, o as m, $ as X, b as q, D as z, H as J, c as y } from "../../keyboard-mgWkd2Vh.js";
|
3
3
|
import $, { useId as Q, useState as F, useMemo as Y, useCallback as Z, forwardRef as ee, useEffect as ae } from "react";
|
4
|
-
import { w as re } from "../../use-active-press-
|
5
|
-
import { u as oe, a as te, b as ce, T as se, I as ne, G as ie, j as de, p as le, K as be } from "../../label-
|
4
|
+
import { w as re } from "../../use-active-press-CqLGIFz7.js";
|
5
|
+
import { u as oe, a as te, b as ce, T as se, I as ne, G as ie, j as de, p as le, K as be } from "../../label-D4GFpe5F.js";
|
6
6
|
import { r as ue } from "../../bugs-diTMAGNw.js";
|
7
|
-
import { H as fe } from "../../field-
|
7
|
+
import { H as fe } from "../../field-C1kt7aNM.js";
|
8
8
|
import { c as me } from "../../index-DIxK0V-G.js";
|
9
9
|
import { Icon as pe } from "../../icons/Icon.js";
|
10
10
|
import '../../assets/CheckboxMimir.css';let he = "span";
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { jsxs as g, jsx as n, Fragment as B } from "react/jsx-runtime";
|
2
2
|
import { c as l } from "../../index-DIxK0V-G.js";
|
3
|
-
import { forwardRef as ie, useRef as R, useState as S, useEffect as
|
3
|
+
import { forwardRef as ie, useRef as R, useState as S, useEffect as j, useMemo as le } from "react";
|
4
4
|
import { EMultiSelectSearchSize as M } from "./constants.js";
|
5
|
-
import { getInitialInputValue as
|
5
|
+
import { getInitialInputValue as E, mapSizeToInputSize as F, getDropdownArrowIcon as re, joinSelectedItems as P } from "./utils.js";
|
6
6
|
import { Icon as ce } from "../../icons/Icon.js";
|
7
7
|
import { Button as ae } from "../Button/Button.js";
|
8
8
|
import { CheckboxMimir as ue } from "../CheckboxMimir/CheckboxMimir.js";
|
9
9
|
import { Chip as de } from "../Chip/Chip.js";
|
10
10
|
import { I as G } from "../../Input-BYrIS5GU.js";
|
11
11
|
import { EInputVariant as pe } from "../Input/constants.js";
|
12
|
-
import { H as me, U as
|
12
|
+
import { H as me, U as H, G as J, K as _e, j as he } from "../../combobox-BpYucpxz.js";
|
13
13
|
import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke = "_container_17kql_9", qe = "_full_17kql_27", ge = "_button_17kql_39", be = "_options_17kql_53", ve = "_top_17kql_64", Ne = "_bottom_17kql_69", Ie = "_m_17kql_2", we = "_l_17kql_111", Ce = "_focused_17kql_129", Se = "_option_17kql_53", Me = "_chip_17kql_158", xe = "_clear_17kql_183", e = {
|
14
14
|
"multi-select-search": "_multi-select-search_17kql_2",
|
15
15
|
disabled: fe,
|
@@ -40,14 +40,14 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
40
40
|
"required-mark": "_required-mark_17kql_178",
|
41
41
|
clear: xe,
|
42
42
|
"icon-button": "_icon-button_17kql_192"
|
43
|
-
},
|
44
|
-
(
|
43
|
+
}, Fe = ie(
|
44
|
+
(K, U) => {
|
45
45
|
const {
|
46
46
|
placeholder: x,
|
47
47
|
size: i = M.L,
|
48
48
|
value: a,
|
49
49
|
onChange: s,
|
50
|
-
full:
|
50
|
+
full: W,
|
51
51
|
showArrow: Q = !0,
|
52
52
|
items: m = [],
|
53
53
|
classNameOption: X,
|
@@ -63,13 +63,13 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
63
63
|
chipVariant: Z = "sapphire",
|
64
64
|
disableInput: _ = !1,
|
65
65
|
autocomplete: O = "on"
|
66
|
-
} =
|
67
|
-
() =>
|
66
|
+
} = K, w = R(null), p = R(null), [b, h] = S(!1), [f, k] = S(
|
67
|
+
() => E(a, d)
|
68
68
|
), [u, q] = S(
|
69
69
|
a || []
|
70
70
|
);
|
71
|
-
|
72
|
-
a && (q(a), JSON.stringify(a) !== JSON.stringify(u) && k(
|
71
|
+
j(() => {
|
72
|
+
a && (q(a), JSON.stringify(a) !== JSON.stringify(u) && k(E(a, d)));
|
73
73
|
}, [a, d, u]);
|
74
74
|
const A = le(() => {
|
75
75
|
var o;
|
@@ -80,7 +80,7 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
80
80
|
);
|
81
81
|
}, [y, m, f]), $ = (t) => {
|
82
82
|
q(t), s == null || s(t);
|
83
|
-
const o =
|
83
|
+
const o = P(t, d);
|
84
84
|
k(o), h(!0), setTimeout(() => {
|
85
85
|
if (p.current) {
|
86
86
|
p.current.focus(), p.current.scrollLeft = p.current.scrollWidth;
|
@@ -100,7 +100,7 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
100
100
|
const o = u.filter(
|
101
101
|
(c) => c.id !== t.id
|
102
102
|
);
|
103
|
-
q(o), s == null || s(o), k(
|
103
|
+
q(o), s == null || s(o), k(P(o, d));
|
104
104
|
}, T = () => h((t) => !t), te = (t) => {
|
105
105
|
t.preventDefault(), t.currentTarget.focus();
|
106
106
|
const o = t.currentTarget.value.length;
|
@@ -112,7 +112,7 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
112
112
|
}, se = (t) => {
|
113
113
|
_ && t.target.blur();
|
114
114
|
};
|
115
|
-
return
|
115
|
+
return j(() => {
|
116
116
|
const t = (o) => {
|
117
117
|
w.current && !w.current.contains(o.target) && !o.defaultPrevented && h(!1);
|
118
118
|
};
|
@@ -127,11 +127,11 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
127
127
|
as: "div",
|
128
128
|
value: u,
|
129
129
|
className: l(e["multi-select-search"], {
|
130
|
-
[e.full]:
|
130
|
+
[e.full]: W,
|
131
131
|
[e.disabled]: r
|
132
132
|
}),
|
133
133
|
onChange: $,
|
134
|
-
ref:
|
134
|
+
ref: U,
|
135
135
|
disabled: r,
|
136
136
|
virtual: { options: A },
|
137
137
|
children: /* @__PURE__ */ g(
|
@@ -143,17 +143,17 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
143
143
|
children: [
|
144
144
|
_ && /* @__PURE__ */ g("div", { className: e["input-container"], children: [
|
145
145
|
/* @__PURE__ */ n(
|
146
|
-
|
146
|
+
H,
|
147
147
|
{
|
148
148
|
disabled: r,
|
149
149
|
style: { width: "100%" },
|
150
150
|
onClick: T,
|
151
151
|
children: /* @__PURE__ */ n(
|
152
|
-
|
152
|
+
J,
|
153
153
|
{
|
154
154
|
as: G,
|
155
155
|
label: x,
|
156
|
-
size:
|
156
|
+
size: F(i),
|
157
157
|
className: l(e["multi-select-input"], {
|
158
158
|
[e["multi-select-input-disabled"]]: _ && I
|
159
159
|
}),
|
@@ -195,11 +195,11 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
195
195
|
)
|
196
196
|
] }),
|
197
197
|
!_ && /* @__PURE__ */ n(
|
198
|
-
|
198
|
+
J,
|
199
199
|
{
|
200
200
|
as: G,
|
201
201
|
label: x,
|
202
|
-
size:
|
202
|
+
size: F(i),
|
203
203
|
className: e["multi-select-input"],
|
204
204
|
rightSlotClassName: e["right-slot"],
|
205
205
|
requiredMarkClassName: e["required-mark"],
|
@@ -214,7 +214,7 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
214
214
|
rightAddon: {
|
215
215
|
addonType: "react-node",
|
216
216
|
addonContent: Q && /* @__PURE__ */ n(
|
217
|
-
|
217
|
+
H,
|
218
218
|
{
|
219
219
|
className: l(e.button, {
|
220
220
|
[e.disabled]: r
|
@@ -323,5 +323,5 @@ import '../../assets/MultiSelectSearch.css';const fe = "_disabled_17kql_5", ke =
|
|
323
323
|
}
|
324
324
|
);
|
325
325
|
export {
|
326
|
-
|
326
|
+
Fe as MultiSelectSearch
|
327
327
|
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { jsxs as ee, jsx as L, Fragment as _e } from "react/jsx-runtime";
|
2
|
-
import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-
|
3
|
-
import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-
|
2
|
+
import { K as V, w as ye, a as oe, z as te, U as ie, b as ke, T as Oe, j as we, u as Pe, I as Ee, G as Te, p as De } from "../../label-D4GFpe5F.js";
|
3
|
+
import { W, y as z, o as U, H as K, s as se, n as ne, $ as le, b as de, D as ue, a as Ce, u as Ge, c as N } from "../../keyboard-mgWkd2Vh.js";
|
4
4
|
import E, { createContext as ce, useId as q, useReducer as xe, useRef as B, useMemo as T, useCallback as Fe, useContext as pe, forwardRef as Ne } from "react";
|
5
5
|
import { u as Ae } from "../../use-by-comparator-CVuf9KBq.js";
|
6
6
|
import { r as fe } from "../../bugs-diTMAGNw.js";
|
7
|
-
import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-
|
7
|
+
import { P as re, F as H, T as ae, _ as Ie } from "../../focus-management-DOYCPyGg.js";
|
8
8
|
import { c as M } from "../../index-DIxK0V-G.js";
|
9
9
|
import '../../assets/RadioGroup.css';var Se = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Se || {});
|
10
10
|
let Le = { 0(e, r) {
|