mimir-ui-kit 1.38.5 → 1.38.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-DgSZTriw.js → combobox-CVtJDVoZ.js} +251 -254
- package/dist/components/Accordion/Accordion.js +3 -3
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/Dropdown/Dropdown.js +32 -32
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +18 -18
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +60 -58
- package/dist/components/Slider/Slider.d.ts +21 -8
- package/dist/components/Slider/Slider.js +388 -383
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabTrail.js +4 -4
- package/dist/{field-C1kt7aNM.js → field-FJ34aSs4.js} +2 -2
- package/dist/{focus-management-BtPpk3D1.js → focus-management-DE4t_lW3.js} +1 -1
- package/dist/{hidden-PvGXrYUY.js → hidden-DbgtYPOH.js} +1 -1
- package/dist/{keyboard-mgWkd2Vh.js → keyboard-B0lm_zyn.js} +111 -114
- package/dist/{label-D4GFpe5F.js → label-y3ANLTNC.js} +2 -2
- package/dist/open-closed-CdldUPoq.js +86 -0
- package/dist/portal-WDFNoIMz.js +1908 -0
- package/dist/{use-active-press-CqLGIFz7.js → use-active-press-86hajhdd.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-D2VjDhAN.js +0 -86
- package/dist/portal-DPqg52FR.js +0 -1946
|
@@ -7,10 +7,10 @@ import { useMediaQuery as ye } from "../../hooks/useMediaQuery/useMediaQuery.js"
|
|
|
7
7
|
import { EMediaQuery as Ee } from "../../hooks/useMediaQuery/constants.js";
|
|
8
8
|
import { Icon as Se } from "../../icons/Icon.js";
|
|
9
9
|
import { Link as ke } from "../AnchorLink/Link.js";
|
|
10
|
-
import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-
|
|
11
|
-
import { w as he } from "../../use-active-press-
|
|
10
|
+
import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-B0lm_zyn.js";
|
|
11
|
+
import { w as he } from "../../use-active-press-86hajhdd.js";
|
|
12
12
|
import { e as ve } from "../../use-resolve-button-type-DhFdPxnv.js";
|
|
13
|
-
import { c as $e, i as R, u as ge,
|
|
13
|
+
import { c as $e, i as R, u as ge, R as Pe, H as Te, s as we } from "../../open-closed-CdldUPoq.js";
|
|
14
14
|
import { C as Ne } from "../../close-provider-CEutdhG8.js";
|
|
15
15
|
import { r as Ce } from "../../bugs-diTMAGNw.js";
|
|
16
16
|
import '../../assets/Accordion.css';var ne;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as L, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-
|
|
2
|
+
import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-B0lm_zyn.js";
|
|
3
3
|
import h, { useId as J, useState as Q, useMemo as Y, useCallback as Z, forwardRef as ee } from "react";
|
|
4
|
-
import { w as re } from "../../use-active-press-
|
|
5
|
-
import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-
|
|
4
|
+
import { w as re } from "../../use-active-press-86hajhdd.js";
|
|
5
|
+
import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-y3ANLTNC.js";
|
|
6
6
|
import { r as be } from "../../bugs-diTMAGNw.js";
|
|
7
|
-
import { H as ue } from "../../field-
|
|
7
|
+
import { H as ue } from "../../field-FJ34aSs4.js";
|
|
8
8
|
import { c as me } from "../../index-DIxK0V-G.js";
|
|
9
9
|
import { Icon as fe } from "../../icons/Icon.js";
|
|
10
10
|
import '../../assets/CheckboxMimir.css';let pe = "span";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as le, jsxs as
|
|
1
|
+
import { jsx as le, jsxs as Ae, Fragment as Le } from "react/jsx-runtime";
|
|
2
2
|
import { c as ae } from "../../index-DIxK0V-G.js";
|
|
3
3
|
import S, { createContext as te, useState as ne, useContext as oe, useRef as Q, useReducer as Ge, createRef as Pe, useMemo as R, useEffect as se, useId as ie, memo as Ke } from "react";
|
|
4
|
-
import { o as E, u as we, M as ce, W as z, y as V, T as Ue, s as Te, a as q, H as re, $ as je, b as qe, D as ye, I as Je, n as We, c as U } from "../../keyboard-
|
|
5
|
-
import { w as Xe } from "../../use-active-press-
|
|
6
|
-
import { n as fe, s as Ze, e as Qe, E as Ve, R as Ye,
|
|
4
|
+
import { o as E, u as we, M as ce, W as z, y as V, T as Ue, s as Te, a as q, H as re, $ as je, b as qe, D as ye, I as Je, n as We, c as U } from "../../keyboard-B0lm_zyn.js";
|
|
5
|
+
import { w as Xe } from "../../use-active-press-86hajhdd.js";
|
|
6
|
+
import { n as fe, s as Ze, e as Qe, E as Ve, R as Ye, v as ze, y as et, x as tt, a as nt, b as ot, m as rt, f as lt, d as at, t as ut } from "../../portal-WDFNoIMz.js";
|
|
7
7
|
import { e as st } from "../../use-resolve-button-type-DhFdPxnv.js";
|
|
8
|
-
import { T as pe, s as de } from "../../hidden-
|
|
9
|
-
import { c as it, i as Y, u as _e,
|
|
8
|
+
import { T as pe, s as de } from "../../hidden-DbgtYPOH.js";
|
|
9
|
+
import { c as it, i as Y, u as _e, R as Be, H as Fe, s as ct } from "../../open-closed-CdldUPoq.js";
|
|
10
10
|
import { C as pt } from "../../close-provider-CEutdhG8.js";
|
|
11
11
|
import { r as ke } from "../../bugs-diTMAGNw.js";
|
|
12
|
-
import { b as Se, P as j, F as
|
|
12
|
+
import { b as Se, P as j, F as H, A as dt, h as ft, T as $e } from "../../focus-management-DE4t_lW3.js";
|
|
13
13
|
import '../../assets/Dropdown.css';function vt({ defaultContainers: e = [], portals: n, mainTreeNode: s } = {}) {
|
|
14
14
|
let P = fe(s), i = E(() => {
|
|
15
15
|
var c, d;
|
|
@@ -23,7 +23,7 @@ import '../../assets/Dropdown.css';function vt({ defaultContainers: e = [], port
|
|
|
23
23
|
}
|
|
24
24
|
let Ce = te(null);
|
|
25
25
|
function xe({ children: e, node: n }) {
|
|
26
|
-
let [s, P] = ne(null), i =
|
|
26
|
+
let [s, P] = ne(null), i = Oe(n ?? s);
|
|
27
27
|
return S.createElement(Ce.Provider, { value: i }, e, i === null && S.createElement(pe, { features: de.Hidden, ref: (c) => {
|
|
28
28
|
var d, r;
|
|
29
29
|
if (c) {
|
|
@@ -34,12 +34,12 @@ function xe({ children: e, node: n }) {
|
|
|
34
34
|
}
|
|
35
35
|
} }));
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Oe(e = null) {
|
|
38
38
|
var n;
|
|
39
39
|
return (n = oe(Ce)) != null ? n : e;
|
|
40
40
|
}
|
|
41
41
|
var D = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(D || {});
|
|
42
|
-
function
|
|
42
|
+
function Me() {
|
|
43
43
|
let e = Q(0);
|
|
44
44
|
return Ze(!0, "keydown", (n) => {
|
|
45
45
|
n.key === "Tab" && (e.current = n.shiftKey ? 1 : 0);
|
|
@@ -104,19 +104,19 @@ function ht(e, n) {
|
|
|
104
104
|
return (u = x == null ? void 0 : x.isFocusWithinPopoverGroup()) != null ? u : (T == null ? void 0 : T.activeElement) && ((t == null ? void 0 : t.contains(T.activeElement)) || (h == null ? void 0 : h.contains(T.activeElement)));
|
|
105
105
|
});
|
|
106
106
|
se(() => w == null ? void 0 : w(W), [w, W]);
|
|
107
|
-
let [
|
|
107
|
+
let [A, B] = Qe(), L = Oe(t), O = vt({ mainTreeNode: L, portals: A, defaultContainers: [t, h] });
|
|
108
108
|
Ve(T == null ? void 0 : T.defaultView, "focus", (u) => {
|
|
109
109
|
var l, a, m, v, F, _;
|
|
110
|
-
u.target !== window && u.target instanceof HTMLElement && y === 0 && (X() || t && h && (
|
|
111
|
-
}, !0), Ye(y === 0,
|
|
110
|
+
u.target !== window && u.target instanceof HTMLElement && y === 0 && (X() || t && h && (O.contains(u.target) || (a = (l = f.current) == null ? void 0 : l.contains) != null && a.call(l, u.target) || (v = (m = b.current) == null ? void 0 : m.contains) != null && v.call(m, u.target) || (_ = (F = p.current) == null ? void 0 : F.contains) != null && _.call(F, u.target) || $({ type: 1 })));
|
|
111
|
+
}, !0), Ye(y === 0, O.resolveContainers, (u, l) => {
|
|
112
112
|
$({ type: 1 }), dt(l, ft.Loose) || (u.preventDefault(), t == null || t.focus());
|
|
113
113
|
});
|
|
114
|
-
let
|
|
114
|
+
let M = E((u) => {
|
|
115
115
|
$({ type: 1 });
|
|
116
116
|
let l = u ? u instanceof HTMLElement ? u : "current" in u && u.current instanceof HTMLElement ? u.current : t : t;
|
|
117
117
|
l == null || l.focus();
|
|
118
|
-
}), Z = R(() => ({ close:
|
|
119
|
-
return S.createElement(xe, { node:
|
|
118
|
+
}), Z = R(() => ({ close: M, isPortalled: k }), [M, k]), ee = R(() => ({ open: y === 0, close: M }), [y, M]), G = { ref: d };
|
|
119
|
+
return S.createElement(xe, { node: L }, S.createElement(ze, null, S.createElement(be.Provider, { value: null }, S.createElement(he.Provider, { value: o }, S.createElement(me.Provider, { value: Z }, S.createElement(pt, { value: M }, S.createElement(it, { value: q(y, { 0: Y.Open, 1: Y.Closed }) }, S.createElement(B, null, re({ ourProps: G, theirProps: i, slot: ee, defaultTag: St, name: "Popover" })))))))));
|
|
120
120
|
}
|
|
121
121
|
let Et = "button";
|
|
122
122
|
function gt(e, n) {
|
|
@@ -163,15 +163,15 @@ function gt(e, n) {
|
|
|
163
163
|
ke(l.currentTarget) || i || (f ? (o({ type: 1 }), (a = r.button) == null || a.focus()) : (l.preventDefault(), l.stopPropagation(), r.popoverState === 1 && (I == null || I(r.buttonId)), o({ type: 0 }), (m = r.button) == null || m.focus()));
|
|
164
164
|
}), W = E((l) => {
|
|
165
165
|
l.preventDefault(), l.stopPropagation();
|
|
166
|
-
}), { isFocusVisible: x, focusProps: w } = je({ autoFocus: c }), { isHovered: X, hoverProps:
|
|
166
|
+
}), { isFocusVisible: x, focusProps: w } = je({ autoFocus: c }), { isHovered: X, hoverProps: A } = qe({ isDisabled: i }), { pressed: B, pressProps: L } = Xe({ disabled: i }), O = r.popoverState === 0, M = R(() => ({ open: O, active: B || O, disabled: i, hover: X, focus: x, autofocus: c }), [O, X, x, B, i, c]), Z = st(e, r.button), ee = f ? ye({ ref: $, type: Z, onKeyDown: k, onClick: C, disabled: i || void 0, autoFocus: c }, w, A, L) : ye({ ref: p, id: r.buttonId, type: Z, "aria-expanded": r.popoverState === 0, "aria-controls": r.panel ? r.panelId : void 0, disabled: i || void 0, autoFocus: c, onKeyDown: k, onKeyUp: J, onClick: C, onMouseDown: W }, w, A, L), G = Me(), u = E(() => {
|
|
167
167
|
let l = r.panel;
|
|
168
168
|
if (!l) return;
|
|
169
169
|
function a() {
|
|
170
|
-
q(G.current, { [D.Forwards]: () => j(l,
|
|
170
|
+
q(G.current, { [D.Forwards]: () => j(l, H.First), [D.Backwards]: () => j(l, H.Last) }) === $e.Error && j(Se().filter((m) => m.dataset.headlessuiFocusGuard !== "true"), q(G.current, { [D.Forwards]: H.Next, [D.Backwards]: H.Previous }), { relativeTo: r.button });
|
|
171
171
|
}
|
|
172
172
|
a();
|
|
173
173
|
});
|
|
174
|
-
return S.createElement(S.Fragment, null, re({ ourProps: ee, theirProps: d, slot:
|
|
174
|
+
return S.createElement(S.Fragment, null, re({ ourProps: ee, theirProps: d, slot: M, defaultTag: Et, name: "Popover.Button" }), O && !f && y && S.createElement(pe, { id: g, ref: r.afterButtonSentinel, features: de.Focusable, "data-headlessui-focus-guard": !0, as: "button", type: "button", onFocus: u }));
|
|
175
175
|
}
|
|
176
176
|
let It = "div", Tt = ce.RenderStrategy | ce.Static;
|
|
177
177
|
function Re(e, n) {
|
|
@@ -189,13 +189,13 @@ function Bt(e, n) {
|
|
|
189
189
|
We(() => (g({ type: 5, panelId: P }), () => {
|
|
190
190
|
g({ type: 5, panelId: null });
|
|
191
191
|
}), [P, g]);
|
|
192
|
-
let
|
|
192
|
+
let A = _e(), [B, L] = Be(o, C, A !== null ? (A & Y.Open) === Y.Open : t.popoverState === 0);
|
|
193
193
|
rt(B, t.button, () => {
|
|
194
194
|
g({ type: 1 });
|
|
195
195
|
});
|
|
196
|
-
let
|
|
197
|
-
lt(
|
|
198
|
-
let
|
|
196
|
+
let O = t.__demoMode ? !1 : r && B;
|
|
197
|
+
lt(O, w);
|
|
198
|
+
let M = E((a) => {
|
|
199
199
|
var m;
|
|
200
200
|
switch (a.key) {
|
|
201
201
|
case U.Escape:
|
|
@@ -210,19 +210,19 @@ function Bt(e, n) {
|
|
|
210
210
|
}, [t.popoverState, e.unmount, e.static, g]), se(() => {
|
|
211
211
|
if (t.__demoMode || !i || t.popoverState !== 0 || !p.current) return;
|
|
212
212
|
let a = w == null ? void 0 : w.activeElement;
|
|
213
|
-
p.current.contains(a) || j(p.current,
|
|
213
|
+
p.current.contains(a) || j(p.current, H.First);
|
|
214
214
|
}, [t.__demoMode, i, p.current, t.popoverState]);
|
|
215
|
-
let Z = R(() => ({ open: t.popoverState === 0, close: h }), [t.popoverState, h]), ee = ye($ ? J() : {}, { ref: x, id: P, onKeyDown:
|
|
215
|
+
let Z = R(() => ({ open: t.popoverState === 0, close: h }), [t.popoverState, h]), ee = ye($ ? J() : {}, { ref: x, id: P, onKeyDown: M, onBlur: i && t.popoverState === 0 ? (a) => {
|
|
216
216
|
var m, v, F, _, K;
|
|
217
217
|
let N = a.relatedTarget;
|
|
218
218
|
N && p.current && ((m = p.current) != null && m.contains(N) || (g({ type: 1 }), ((F = (v = t.beforePanelSentinel.current) == null ? void 0 : v.contains) != null && F.call(v, N) || (K = (_ = t.afterPanelSentinel.current) == null ? void 0 : _.contains) != null && K.call(_, N)) && N.focus({ preventScroll: !0 })));
|
|
219
|
-
} : void 0, tabIndex: -1, style: { ...y.style, ...k, "--button-width": at(t.button, !0).width }, ...Fe(
|
|
219
|
+
} : void 0, tabIndex: -1, style: { ...y.style, ...k, "--button-width": at(t.button, !0).width }, ...Fe(L) }), G = Me(), u = E(() => {
|
|
220
220
|
let a = p.current;
|
|
221
221
|
if (!a) return;
|
|
222
222
|
function m() {
|
|
223
223
|
q(G.current, { [D.Forwards]: () => {
|
|
224
224
|
var v;
|
|
225
|
-
j(a,
|
|
225
|
+
j(a, H.First) === $e.Error && ((v = t.afterPanelSentinel.current) == null || v.focus());
|
|
226
226
|
}, [D.Backwards]: () => {
|
|
227
227
|
var v;
|
|
228
228
|
(v = t.button) == null || v.focus({ preventScroll: !0 });
|
|
@@ -240,10 +240,10 @@ function Bt(e, n) {
|
|
|
240
240
|
let Ie = K.indexOf(N);
|
|
241
241
|
Ie !== -1 && K.splice(Ie, 1);
|
|
242
242
|
}
|
|
243
|
-
j(K,
|
|
243
|
+
j(K, H.First, { sorted: !1 });
|
|
244
244
|
}, [D.Backwards]: () => {
|
|
245
245
|
var v;
|
|
246
|
-
j(a,
|
|
246
|
+
j(a, H.Previous) === $e.Error && ((v = t.button) == null || v.focus());
|
|
247
247
|
} });
|
|
248
248
|
}
|
|
249
249
|
m();
|
|
@@ -275,7 +275,7 @@ function kt(e, n) {
|
|
|
275
275
|
}), t = R(() => ({ registerPopover: r, unregisterPopover: d, isFocusWithinPopoverGroup: o, closeOthers: y }), [r, d, o, y]), g = R(() => ({}), []), h = e, I = { ref: P };
|
|
276
276
|
return S.createElement(xe, null, S.createElement(ge.Provider, { value: t }, re({ ourProps: I, theirProps: h, slot: g, defaultTag: Ft, name: "Popover.Group" })));
|
|
277
277
|
}
|
|
278
|
-
let Ct = z(ht), De = z(gt), xt = z(Re),
|
|
278
|
+
let Ct = z(ht), De = z(gt), xt = z(Re), Ot = z(Re), He = z(Bt), Mt = z(kt), Nt = Object.assign(Ct, { Button: De, Backdrop: Ot, Overlay: xt, Panel: He, Group: Mt });
|
|
279
279
|
const Rt = "_menu_1tfih_3", ue = {
|
|
280
280
|
menu: Rt,
|
|
281
281
|
"menu-button": "_menu-button_1tfih_6",
|
|
@@ -297,7 +297,7 @@ const Rt = "_menu_1tfih_3", ue = {
|
|
|
297
297
|
as: "div",
|
|
298
298
|
className: ae(ue.menu, P),
|
|
299
299
|
...s,
|
|
300
|
-
children: ({ close: o }) => /* @__PURE__ */ Le
|
|
300
|
+
children: ({ close: o }) => /* @__PURE__ */ Ae(Le, { children: [
|
|
301
301
|
/* @__PURE__ */ le(
|
|
302
302
|
De,
|
|
303
303
|
{
|
|
@@ -307,7 +307,7 @@ const Rt = "_menu_1tfih_3", ue = {
|
|
|
307
307
|
}
|
|
308
308
|
),
|
|
309
309
|
/* @__PURE__ */ le(
|
|
310
|
-
|
|
310
|
+
He,
|
|
311
311
|
{
|
|
312
312
|
anchor: n,
|
|
313
313
|
className: ae(ue["menu-items"], c),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as b, jsx as o, Fragment as
|
|
1
|
+
import { jsxs as b, jsx as o, Fragment as P } from "react/jsx-runtime";
|
|
2
2
|
import { c as r } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { forwardRef as ce, useRef as
|
|
3
|
+
import { forwardRef as ce, useRef as F, useState as E, useEffect as L, useMemo as ae } from "react";
|
|
4
4
|
import { EMultiSelectSearchSize as O } from "./constants.js";
|
|
5
|
-
import { getInitialInputValue as
|
|
5
|
+
import { getInitialInputValue as j, MULTISELECT_OPEN_EVENT as G, mapSizeToInputSize as U, getDropdownArrowIcon as ue, dispatchMultiselectOpen as I, joinSelectedItems as W } from "./utils.js";
|
|
6
6
|
import { Icon as de } from "../../icons/Icon.js";
|
|
7
7
|
import { Button as pe } from "../Button/Button.js";
|
|
8
8
|
import { CheckboxMimir as me } from "../CheckboxMimir/CheckboxMimir.js";
|
|
9
9
|
import { Chip as _e } from "../Chip/Chip.js";
|
|
10
|
-
import { I as
|
|
10
|
+
import { I as H } from "../../Input-BYrIS5GU.js";
|
|
11
11
|
import { EInputVariant as he } from "../Input/constants.js";
|
|
12
|
-
import { H as fe, U as
|
|
12
|
+
import { H as fe, U as J, G as K, K as ke, W as qe } from "../../combobox-CVtJDVoZ.js";
|
|
13
13
|
import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve = "_container_17kql_9", be = "_full_17kql_27", Ie = "_button_17kql_39", we = "_options_17kql_53", Ne = "_top_17kql_64", Ce = "_bottom_17kql_69", Se = "_m_17kql_2", Me = "_l_17kql_111", Ee = "_focused_17kql_129", Le = "_option_17kql_53", Oe = "_chip_17kql_158", Te = "_clear_17kql_183", t = {
|
|
14
14
|
"multi-select-search": "_multi-select-search_17kql_2",
|
|
15
15
|
disabled: ge,
|
|
@@ -64,13 +64,13 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
64
64
|
disableInput: f = !1,
|
|
65
65
|
autocomplete: z = "on",
|
|
66
66
|
id: m = `multiselect-${Math.random().toString(36).slice(2, 11)}`
|
|
67
|
-
} = $, S =
|
|
68
|
-
() =>
|
|
67
|
+
} = $, S = F(null), _ = F(null), [k, h] = E(!1), [q, g] = E(
|
|
68
|
+
() => j(u, p)
|
|
69
69
|
), [l, v] = E(
|
|
70
70
|
u || []
|
|
71
71
|
);
|
|
72
72
|
L(() => {
|
|
73
|
-
u && (v(u), JSON.stringify(u) !== JSON.stringify(l) && g(
|
|
73
|
+
u && (v(u), JSON.stringify(u) !== JSON.stringify(l) && g(j(u, p)));
|
|
74
74
|
}, [u, p, l]);
|
|
75
75
|
const V = ae(() => {
|
|
76
76
|
var n;
|
|
@@ -81,7 +81,7 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
81
81
|
);
|
|
82
82
|
}, [x, d, q, l]), ne = (e) => {
|
|
83
83
|
v(e), s == null || s(e);
|
|
84
|
-
const n =
|
|
84
|
+
const n = W(e, p);
|
|
85
85
|
g(n), h(!0), I(m), setTimeout(() => {
|
|
86
86
|
if (_.current) {
|
|
87
87
|
_.current.focus(), _.current.scrollLeft = _.current.scrollWidth;
|
|
@@ -101,7 +101,7 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
101
101
|
const n = l.filter(
|
|
102
102
|
(a) => a.id !== e.id
|
|
103
103
|
);
|
|
104
|
-
v(n), s == null || s(n), g(
|
|
104
|
+
v(n), s == null || s(n), g(W(n, p));
|
|
105
105
|
}, B = () => {
|
|
106
106
|
const e = !k;
|
|
107
107
|
h(e), e && I(m);
|
|
@@ -160,15 +160,15 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
160
160
|
children: [
|
|
161
161
|
f && /* @__PURE__ */ b("div", { className: t["input-container"], children: [
|
|
162
162
|
/* @__PURE__ */ o(
|
|
163
|
-
|
|
163
|
+
J,
|
|
164
164
|
{
|
|
165
165
|
disabled: c,
|
|
166
166
|
style: { width: "100%" },
|
|
167
167
|
onClick: B,
|
|
168
168
|
children: /* @__PURE__ */ o(
|
|
169
|
-
|
|
169
|
+
K,
|
|
170
170
|
{
|
|
171
|
-
as:
|
|
171
|
+
as: H,
|
|
172
172
|
label: T,
|
|
173
173
|
size: U(i),
|
|
174
174
|
className: r(t["multi-select-input"], {
|
|
@@ -212,9 +212,9 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
212
212
|
)
|
|
213
213
|
] }),
|
|
214
214
|
!f && /* @__PURE__ */ o(
|
|
215
|
-
|
|
215
|
+
K,
|
|
216
216
|
{
|
|
217
|
-
as:
|
|
217
|
+
as: H,
|
|
218
218
|
label: T,
|
|
219
219
|
size: U(i),
|
|
220
220
|
className: t["multi-select-input"],
|
|
@@ -233,7 +233,7 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
233
233
|
rightAddon: {
|
|
234
234
|
addonType: "react-node",
|
|
235
235
|
addonContent: Y && /* @__PURE__ */ o(
|
|
236
|
-
|
|
236
|
+
J,
|
|
237
237
|
{
|
|
238
238
|
className: r(t.button, {
|
|
239
239
|
[t.disabled]: c
|
|
@@ -257,7 +257,7 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
257
257
|
...D
|
|
258
258
|
}
|
|
259
259
|
),
|
|
260
|
-
k && /* @__PURE__ */ o(
|
|
260
|
+
k && /* @__PURE__ */ o(P, { children: d.length ? V.length ? /* @__PURE__ */ o(
|
|
261
261
|
ke,
|
|
262
262
|
{
|
|
263
263
|
className: r(
|
|
@@ -279,7 +279,7 @@ import '../../assets/MultiSelectSearch.css';const ge = "_disabled_17kql_5", ve =
|
|
|
279
279
|
[t["option-active"]]: n
|
|
280
280
|
}
|
|
281
281
|
),
|
|
282
|
-
children: /* @__PURE__ */ b(
|
|
282
|
+
children: /* @__PURE__ */ b(P, { children: [
|
|
283
283
|
/* @__PURE__ */ b("div", { className: t["option-inner"], children: [
|
|
284
284
|
e.name,
|
|
285
285
|
e.bottom && /* @__PURE__ */ o("div", { children: e.bottom })
|
|
@@ -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-y3ANLTNC.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-B0lm_zyn.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-DE4t_lW3.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) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as m, Fragment as D } from "react/jsx-runtime";
|
|
2
2
|
import { c as l } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { forwardRef as U, useState as
|
|
3
|
+
import { forwardRef as U, useState as q, useMemo as W, useCallback as R, useEffect as $ } from "react";
|
|
4
4
|
import { ESelectSearchSize as g } from "./constants.js";
|
|
5
|
-
import { mapSizeToInputSize as
|
|
6
|
-
import { Icon as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { I as
|
|
5
|
+
import { mapSizeToInputSize as A, getDropdownArrowIcon as J } from "./utils.js";
|
|
6
|
+
import { Icon as O } from "../../icons/Icon.js";
|
|
7
|
+
import { Button as Q } from "../Button/Button.js";
|
|
8
|
+
import { I as B } from "../../Input-BYrIS5GU.js";
|
|
9
9
|
import { EInputVariant as X } from "../Input/constants.js";
|
|
10
|
-
import { H as Y, U as
|
|
11
|
-
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113",
|
|
10
|
+
import { H as Y, U as M, G as j, K as Z, W as ee } from "../../combobox-CVtJDVoZ.js";
|
|
11
|
+
import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_container_1bph7_13", ne = "_full_1bph7_28", se = "_button_1bph7_40", ae = "_options_1bph7_54", ie = "_top_1bph7_65", le = "_bottom_1bph7_71", re = "_m_1bph7_98", ce = "_l_1bph7_113", de = "_option_1bph7_54", pe = "_clear_1bph7_167", e = {
|
|
12
12
|
"select-search": "_select-search_1bph7_2",
|
|
13
13
|
disabled: te,
|
|
14
14
|
container: oe,
|
|
@@ -26,12 +26,12 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
26
26
|
l: ce,
|
|
27
27
|
"select-input": "_select-input_1bph7_128",
|
|
28
28
|
"select-input-disabled": "_select-input-disabled_1bph7_131",
|
|
29
|
-
option:
|
|
29
|
+
option: de,
|
|
30
30
|
"option-active": "_option-active_1bph7_147",
|
|
31
31
|
"option-inner": "_option-inner_1bph7_150",
|
|
32
32
|
"right-slot": "_right-slot_1bph7_157",
|
|
33
33
|
"required-mark": "_required-mark_1bph7_162",
|
|
34
|
-
clear:
|
|
34
|
+
clear: pe,
|
|
35
35
|
"icon-button": "_icon-button_1bph7_176"
|
|
36
36
|
}, Ce = U(
|
|
37
37
|
(E, L) => {
|
|
@@ -42,7 +42,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
42
42
|
onChange: s,
|
|
43
43
|
full: V,
|
|
44
44
|
showArrow: C = !0,
|
|
45
|
-
items:
|
|
45
|
+
items: p = [],
|
|
46
46
|
classNameOption: F,
|
|
47
47
|
displayValue: G = "name",
|
|
48
48
|
filterOnSearch: I = !0,
|
|
@@ -55,23 +55,23 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
55
55
|
disableInput: c = !1,
|
|
56
56
|
autocomplete: k = "on",
|
|
57
57
|
immediate: P = !1
|
|
58
|
-
} = E, N = String((n == null ? void 0 : n[G]) || ""), [
|
|
59
|
-
(
|
|
60
|
-
) :
|
|
61
|
-
|
|
62
|
-
}, z =
|
|
63
|
-
(
|
|
58
|
+
} = E, N = String((n == null ? void 0 : n[G]) || ""), [d, u] = q(N), [v, h] = q(n), x = W(() => !I || n && (n.id || n.name) ? p : d.trim().toLowerCase() ? p.filter(
|
|
59
|
+
(t) => t.name.toLowerCase().includes(d.toLowerCase())
|
|
60
|
+
) : p, [d, p, n, I]), T = (t) => {
|
|
61
|
+
t ? (u(t.name), h(t), s == null || s(t)) : (u(""), h(null), s == null || s({ id: "", name: "" }));
|
|
62
|
+
}, z = R(
|
|
63
|
+
(t) => {
|
|
64
64
|
if (c) return;
|
|
65
|
-
const
|
|
66
|
-
|
|
65
|
+
const o = t.target.value;
|
|
66
|
+
u(o), _ == null || _(o), !o && n && (s == null || s({ id: "", name: "" }));
|
|
67
67
|
},
|
|
68
68
|
[c, s, _, n]
|
|
69
69
|
), H = () => {
|
|
70
|
-
|
|
70
|
+
u(""), h(null), s == null || s({ id: "", name: "" });
|
|
71
71
|
};
|
|
72
|
-
return
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
return $(() => {
|
|
73
|
+
const t = !n || typeof n == "object" && !Object.keys(n).length;
|
|
74
|
+
u(t ? "" : N), h(t ? null : n);
|
|
75
75
|
}, [n, N]), /* @__PURE__ */ a(
|
|
76
76
|
Y,
|
|
77
77
|
{
|
|
@@ -86,44 +86,44 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
86
86
|
disabled: r,
|
|
87
87
|
virtual: { options: x },
|
|
88
88
|
immediate: P,
|
|
89
|
-
children: ({ open:
|
|
90
|
-
/* @__PURE__ */
|
|
89
|
+
children: ({ open: t }) => /* @__PURE__ */ m(D, { children: [
|
|
90
|
+
/* @__PURE__ */ m(
|
|
91
91
|
"div",
|
|
92
92
|
{
|
|
93
93
|
className: l(e.container, e[i], {
|
|
94
|
-
[e["container-open"]]:
|
|
94
|
+
[e["container-open"]]: t
|
|
95
95
|
}),
|
|
96
96
|
children: [
|
|
97
|
-
c && /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */ a(
|
|
99
|
-
|
|
97
|
+
c && /* @__PURE__ */ m("div", { style: { position: "relative", width: "100%" }, children: [
|
|
98
|
+
/* @__PURE__ */ a(M, { disabled: r, style: { width: "100%" }, children: /* @__PURE__ */ a(
|
|
99
|
+
j,
|
|
100
100
|
{
|
|
101
|
-
as:
|
|
101
|
+
as: B,
|
|
102
102
|
label: w,
|
|
103
|
-
size:
|
|
103
|
+
size: A(i),
|
|
104
104
|
className: l(e["select-input"], {
|
|
105
105
|
[e["select-input-disabled"]]: c && f
|
|
106
106
|
}),
|
|
107
107
|
onChange: z,
|
|
108
|
-
value:
|
|
108
|
+
value: d,
|
|
109
109
|
disabled: r,
|
|
110
110
|
variant: S,
|
|
111
111
|
rightSlotClassName: e["right-slot"],
|
|
112
112
|
requiredMarkClassName: e["required-mark"],
|
|
113
113
|
"data-testid": "select-search-input",
|
|
114
|
-
onFocus: (
|
|
115
|
-
c &&
|
|
114
|
+
onFocus: (o) => {
|
|
115
|
+
c && o.target.blur();
|
|
116
116
|
},
|
|
117
117
|
rightAddon: {
|
|
118
118
|
addonType: "icon",
|
|
119
|
-
addonContent:
|
|
119
|
+
addonContent: J(t, i)
|
|
120
120
|
},
|
|
121
121
|
autocomplete: k,
|
|
122
122
|
...y
|
|
123
123
|
}
|
|
124
124
|
) }),
|
|
125
|
-
f &&
|
|
126
|
-
|
|
125
|
+
f && d && /* @__PURE__ */ a(
|
|
126
|
+
Q,
|
|
127
127
|
{
|
|
128
128
|
tabIndex: -1,
|
|
129
129
|
className: l(e.clear, {
|
|
@@ -136,22 +136,22 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
136
136
|
clear: !0,
|
|
137
137
|
disabled: r,
|
|
138
138
|
variant: "secondary-gray",
|
|
139
|
-
onClick: (
|
|
140
|
-
|
|
139
|
+
onClick: (o) => {
|
|
140
|
+
o.stopPropagation(), H();
|
|
141
141
|
},
|
|
142
142
|
"data-testid": "clear-button"
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
] }),
|
|
146
146
|
!c && /* @__PURE__ */ a(
|
|
147
|
-
|
|
147
|
+
j,
|
|
148
148
|
{
|
|
149
|
-
as:
|
|
149
|
+
as: B,
|
|
150
150
|
label: w,
|
|
151
|
-
size:
|
|
151
|
+
size: A(i),
|
|
152
152
|
className: e["select-input"],
|
|
153
153
|
onChange: z,
|
|
154
|
-
value:
|
|
154
|
+
value: d,
|
|
155
155
|
disabled: r,
|
|
156
156
|
variant: S,
|
|
157
157
|
withClearButton: f,
|
|
@@ -161,26 +161,26 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
161
161
|
rightAddon: C ? {
|
|
162
162
|
addonType: "react-node",
|
|
163
163
|
addonContent: C && /* @__PURE__ */ a(
|
|
164
|
-
|
|
164
|
+
M,
|
|
165
165
|
{
|
|
166
166
|
className: l(e.button, {
|
|
167
167
|
[e.disabled]: r
|
|
168
168
|
}),
|
|
169
169
|
disabled: r,
|
|
170
170
|
children: /* @__PURE__ */ a(
|
|
171
|
-
|
|
171
|
+
O,
|
|
172
172
|
{
|
|
173
173
|
iconName: i == g.M ? "DropdownArrowBottom16px" : "DropdownArrowDown24px",
|
|
174
174
|
className: l(e["selector-icon"], {
|
|
175
|
-
[e["selector-icon-open"]]:
|
|
175
|
+
[e["selector-icon-open"]]: t
|
|
176
176
|
})
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
} : void 0,
|
|
182
|
-
onFocus: (
|
|
183
|
-
c &&
|
|
182
|
+
onFocus: (o) => {
|
|
183
|
+
c && o.target.blur();
|
|
184
184
|
},
|
|
185
185
|
autocomplete: k,
|
|
186
186
|
...y
|
|
@@ -189,7 +189,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
189
189
|
]
|
|
190
190
|
}
|
|
191
191
|
),
|
|
192
|
-
|
|
192
|
+
t && /* @__PURE__ */ a(D, { children: p.length ? x.length ? /* @__PURE__ */ a(
|
|
193
193
|
Z,
|
|
194
194
|
{
|
|
195
195
|
"data-testid": "select-search-options",
|
|
@@ -198,10 +198,10 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
198
198
|
e[i],
|
|
199
199
|
e[b]
|
|
200
200
|
),
|
|
201
|
-
children: ({ option:
|
|
201
|
+
children: ({ option: o }) => /* @__PURE__ */ m(
|
|
202
202
|
ee,
|
|
203
203
|
{
|
|
204
|
-
value:
|
|
204
|
+
value: o,
|
|
205
205
|
className: ({ focus: K }) => l(
|
|
206
206
|
e.option,
|
|
207
207
|
F,
|
|
@@ -210,14 +210,14 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
210
210
|
[e["option-active"]]: K
|
|
211
211
|
}
|
|
212
212
|
),
|
|
213
|
-
"data-testid": `select-search-option-${
|
|
213
|
+
"data-testid": `select-search-option-${o.id}`,
|
|
214
214
|
children: [
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
/* @__PURE__ */ m("div", { className: e["option-inner"], children: [
|
|
216
|
+
o.name,
|
|
217
|
+
o.bottom && /* @__PURE__ */ a("div", { children: o.bottom })
|
|
218
218
|
] }),
|
|
219
|
-
v && v.id ===
|
|
220
|
-
|
|
219
|
+
v && v.id === o.id && /* @__PURE__ */ a(
|
|
220
|
+
O,
|
|
221
221
|
{
|
|
222
222
|
iconName: i === g.M ? "Done16px" : "Done24px",
|
|
223
223
|
className: e["selected-icon"]
|
|
@@ -225,7 +225,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
225
225
|
)
|
|
226
226
|
]
|
|
227
227
|
},
|
|
228
|
-
|
|
228
|
+
o.id
|
|
229
229
|
)
|
|
230
230
|
}
|
|
231
231
|
) : /* @__PURE__ */ a(
|
|
@@ -237,6 +237,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
237
237
|
e["no-options"],
|
|
238
238
|
e[b]
|
|
239
239
|
),
|
|
240
|
+
"data-headlessui-state": t ? "open" : "closed",
|
|
240
241
|
children: "Ничего не найдено"
|
|
241
242
|
}
|
|
242
243
|
) : /* @__PURE__ */ a(
|
|
@@ -248,6 +249,7 @@ import '../../assets/SelectSearch.css';const te = "_disabled_1bph7_6", oe = "_co
|
|
|
248
249
|
e["no-options"],
|
|
249
250
|
e[b]
|
|
250
251
|
),
|
|
252
|
+
"data-headlessui-state": t ? "open" : "closed",
|
|
251
253
|
children: "Нет данных"
|
|
252
254
|
}
|
|
253
255
|
) })
|