mainstack-design-system 1.14.0 → 1.14.1
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/assets/styles.css +1 -1
- package/dist/mainstack-design-system467.cjs +1 -1
- package/dist/mainstack-design-system467.js +53 -51
- package/dist/mainstack-design-system468.cjs +1 -1
- package/dist/mainstack-design-system468.js +13 -13
- package/dist/mainstack-design-system471.cjs +1 -1
- package/dist/mainstack-design-system471.js +24 -24
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),y=require("./index-C8aODXfJ.cjs"),D=require("./index-4R9KShCu.cjs"),o=require("react"),I=require("./mainstack-design-system597.cjs"),m=require("./mainstack-design-system598.cjs"),b=o.forwardRef(({isDisabled:x,isError:C,isMultiSelect:r=!1,isSuccess:d,children:h,value:e,defaultValue:s,inputReadOnly:j,isCreatableSelect:q,options:u=[],isOptionOpen:A,onOptionOpenChange:P,onValueChange:a,onOptionSelect:R},n)=>{const f=o.useRef(null),[i,_]=o.useState(m.parseSelectOptions(u)),[p,v]=y.useControllableState({prop:e,defaultProp:m.mapDefaultValuesToSelectedOption({isMultiSelect:r,defaultValue:s,options:u}),onChange:a}),[E,c]=o.useState(()=>typeof e=="string"?i.map.get(e)?.label||"":typeof s=="string"&&i.map.get(s)?.label||""),[O,S]=y.useControllableState({prop:A,defaultProp:!1,onChange:P}),[T,g]=o.useState("idle");return o.useEffect(()=>{r||Array.isArray(e)||c(e||"")},[r,e]),l.jsx(I.SelectContext.Provider,{value:{defaultValue:s,options:i,selectedOption:p,isOptionOpen:O,isDisabled:x,isError:C,isMultiSelect:r,isSuccess:d,inputValue:E,inputReadOnly:j,previousAction:T,isCreatableSelect:q,rootElementRef:f,setOptions:_,setPreviousAction:g,setInputValue:c,setSelectedOption:v,onOptionOpenChange:S,onValueChange:a,onOptionSelect:R},children:l.jsx(D.Popover,{open:O,onOpenChange:t=>{S(t),p&&!Array.isArray(p)&&!t&&(c(i.map.get(p)?.label||""),g("selection"))},children:l.jsx("div",{ref:t=>{f.current=t,typeof n=="function"?n(t):typeof n=="object"&&n?.current&&(n.current=t)},"data-slot":"select-root",children:h})})})});b.displayName="SelectRoot";exports.SelectRoot=b;
|
|
@@ -1,79 +1,81 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
3
3
|
import { u as y } from "./index-437EL2iq.js";
|
|
4
4
|
import { P as I } from "./index-RoCFhqzC.js";
|
|
5
|
-
import { forwardRef as N, useRef as T, useState as
|
|
6
|
-
import { SelectContext as
|
|
7
|
-
import { parseSelectOptions as
|
|
8
|
-
const
|
|
5
|
+
import { forwardRef as N, useRef as T, useState as f, useEffect as k } from "react";
|
|
6
|
+
import { SelectContext as q } from "./mainstack-design-system597.js";
|
|
7
|
+
import { parseSelectOptions as z, mapDefaultValuesToSelectedOption as B } from "./mainstack-design-system598.js";
|
|
8
|
+
const F = N(
|
|
9
9
|
({
|
|
10
|
-
isDisabled:
|
|
11
|
-
isError:
|
|
12
|
-
isMultiSelect:
|
|
10
|
+
isDisabled: h,
|
|
11
|
+
isError: A,
|
|
12
|
+
isMultiSelect: n = !1,
|
|
13
13
|
isSuccess: C,
|
|
14
14
|
children: P,
|
|
15
|
-
value:
|
|
16
|
-
defaultValue:
|
|
15
|
+
value: o,
|
|
16
|
+
defaultValue: r,
|
|
17
17
|
inputReadOnly: b,
|
|
18
|
-
isCreatableSelect:
|
|
19
|
-
options:
|
|
20
|
-
isOptionOpen:
|
|
21
|
-
onOptionOpenChange:
|
|
18
|
+
isCreatableSelect: S,
|
|
19
|
+
options: l = [],
|
|
20
|
+
isOptionOpen: x,
|
|
21
|
+
onOptionOpenChange: d,
|
|
22
22
|
onValueChange: a,
|
|
23
|
-
onOptionSelect:
|
|
24
|
-
},
|
|
25
|
-
const m = T(null), [
|
|
26
|
-
|
|
27
|
-
), [
|
|
28
|
-
prop:
|
|
29
|
-
defaultProp:
|
|
30
|
-
isMultiSelect:
|
|
31
|
-
defaultValue:
|
|
32
|
-
options:
|
|
23
|
+
onOptionSelect: j
|
|
24
|
+
}, e) => {
|
|
25
|
+
const m = T(null), [p, E] = f(
|
|
26
|
+
z(l)
|
|
27
|
+
), [i, R] = y({
|
|
28
|
+
prop: o,
|
|
29
|
+
defaultProp: B({
|
|
30
|
+
isMultiSelect: n,
|
|
31
|
+
defaultValue: r,
|
|
32
|
+
options: l
|
|
33
33
|
}),
|
|
34
34
|
onChange: a
|
|
35
|
-
}), [
|
|
36
|
-
prop:
|
|
35
|
+
}), [v, s] = f(() => typeof o == "string" ? p.map.get(o)?.label || "" : typeof r == "string" && p.map.get(r)?.label || ""), [O, u] = y({
|
|
36
|
+
prop: x,
|
|
37
37
|
defaultProp: !1,
|
|
38
|
-
onChange:
|
|
39
|
-
}), [
|
|
40
|
-
return
|
|
41
|
-
|
|
38
|
+
onChange: d
|
|
39
|
+
}), [D, g] = f("idle");
|
|
40
|
+
return k(() => {
|
|
41
|
+
n || Array.isArray(o) || s(o || "");
|
|
42
|
+
}, [n, o]), /* @__PURE__ */ c(
|
|
43
|
+
q.Provider,
|
|
42
44
|
{
|
|
43
45
|
value: {
|
|
44
|
-
defaultValue:
|
|
45
|
-
options:
|
|
46
|
-
selectedOption:
|
|
47
|
-
isOptionOpen:
|
|
48
|
-
isDisabled:
|
|
49
|
-
isError:
|
|
50
|
-
isMultiSelect:
|
|
46
|
+
defaultValue: r,
|
|
47
|
+
options: p,
|
|
48
|
+
selectedOption: i,
|
|
49
|
+
isOptionOpen: O,
|
|
50
|
+
isDisabled: h,
|
|
51
|
+
isError: A,
|
|
52
|
+
isMultiSelect: n,
|
|
51
53
|
isSuccess: C,
|
|
52
|
-
inputValue:
|
|
54
|
+
inputValue: v,
|
|
53
55
|
inputReadOnly: b,
|
|
54
|
-
previousAction:
|
|
55
|
-
isCreatableSelect:
|
|
56
|
+
previousAction: D,
|
|
57
|
+
isCreatableSelect: S,
|
|
56
58
|
rootElementRef: m,
|
|
57
|
-
setOptions:
|
|
59
|
+
setOptions: E,
|
|
58
60
|
setPreviousAction: g,
|
|
59
|
-
setInputValue:
|
|
61
|
+
setInputValue: s,
|
|
60
62
|
setSelectedOption: R,
|
|
61
|
-
onOptionOpenChange:
|
|
63
|
+
onOptionOpenChange: u,
|
|
62
64
|
onValueChange: a,
|
|
63
|
-
onOptionSelect:
|
|
65
|
+
onOptionSelect: j
|
|
64
66
|
},
|
|
65
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ c(
|
|
66
68
|
I,
|
|
67
69
|
{
|
|
68
|
-
open:
|
|
70
|
+
open: O,
|
|
69
71
|
onOpenChange: (t) => {
|
|
70
|
-
|
|
72
|
+
u(t), i && !Array.isArray(i) && !t && (s(p.map.get(i)?.label || ""), g("selection"));
|
|
71
73
|
},
|
|
72
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ c(
|
|
73
75
|
"div",
|
|
74
76
|
{
|
|
75
77
|
ref: (t) => {
|
|
76
|
-
m.current = t, typeof
|
|
78
|
+
m.current = t, typeof e == "function" ? e(t) : typeof e == "object" && e?.current && (e.current = t);
|
|
77
79
|
},
|
|
78
80
|
"data-slot": "select-root",
|
|
79
81
|
children: P
|
|
@@ -85,7 +87,7 @@ const B = N(
|
|
|
85
87
|
);
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
|
-
|
|
90
|
+
F.displayName = "SelectRoot";
|
|
89
91
|
export {
|
|
90
|
-
|
|
92
|
+
F as SelectRoot
|
|
91
93
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),j=require("./mainstack-design-system440.cjs"),O=require("./mainstack-design-system441.cjs");require("./mainstack-design-system439.cjs");require("./mainstack-design-system357.cjs");const v=require("./mainstack-design-system93.cjs"),N=require("./mainstack-design-
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),j=require("./mainstack-design-system440.cjs"),O=require("./mainstack-design-system441.cjs");require("./mainstack-design-system439.cjs");require("./mainstack-design-system357.cjs");const v=require("./mainstack-design-system93.cjs"),N=require("./mainstack-design-system196.cjs");require("./player-BBiZ5mNK.cjs");const o=require("./utils-Bdd5vx6a.cjs"),R=require("./mainstack-design-system597.cjs"),w=require("./index-4R9KShCu.cjs"),d=g.forwardRef(({onClick:r,children:u,className:p,onChange:i,...a},m)=>{const{isOptionOpen:s,inputValue:x,inputReadOnly:c,isDisabled:f,isError:I,isSuccess:h,selectedOption:l,isMultiSelect:n,setSelectedOption:q,setPreviousAction:_,setInputValue:b,onOptionOpenChange:y}=R.useSelectContext();return e.jsx(w.PopoverAnchor,{role:"combobox","aria-haspopup":"listbox","aria-expanded":s,"aria-controls":"select-portal","aria-owns":"select-portal",children:e.jsxs(j.InputRoot,{className:o.cn(n&&"mds:h-auto mds:py-10 ",p),children:[e.jsxs("div",{className:o.cn("mds:flex mds:flex-1 mds:h-auto mds:min-h-auto mds:items-center mds:flex-wrap mds:gap-6"),children:[u,e.jsx(O.InputField,{...a,readOnly:c,"data-slot":"select-input-field","data-select-options-opened":s,tabIndex:3,value:x,isError:I,isSuccess:h,disabled:f,className:o.cn(n&&"mds:h-auto mds:min-h-auto"),onChange:t=>{i&&i(t),_("typing"),b(t.currentTarget.value)},onClick:t=>{r&&r(t);const S=t.currentTarget;y(!0),c||S.focus()},ref:m,...a})]}),e.jsxs("div",{className:"mds:flex mds:items-center mds:gap-6",children:[n&&Array.isArray(l)&&l.length>0&&e.jsx(v,{role:"button",variant:"filled",className:"mds:size-20 mds:cursor-pointer mds:text-secondary",onClick:()=>{q([])}}),e.jsx(N,{"data-select-options-opened":s,className:"mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"})]})]})})});d.displayName="SelectInputField";exports.SelectInputField=d;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { jsx as t, jsxs as r } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as N } from "react";
|
|
4
4
|
import { InputRoot as S } from "./mainstack-design-system440.js";
|
|
5
|
-
import { InputField as
|
|
5
|
+
import { InputField as w } from "./mainstack-design-system441.js";
|
|
6
6
|
import "./mainstack-design-system439.js";
|
|
7
7
|
import "./mainstack-design-system357.js";
|
|
8
|
-
import
|
|
9
|
-
import C from "./mainstack-design-
|
|
8
|
+
import A from "./mainstack-design-system93.js";
|
|
9
|
+
import C from "./mainstack-design-system196.js";
|
|
10
10
|
import "./player-Cs7wtvrg.js";
|
|
11
11
|
import { c as i } from "./utils-D85wpvmd.js";
|
|
12
12
|
import { useSelectContext as F } from "./mainstack-design-system597.js";
|
|
@@ -14,14 +14,14 @@ import { d as R } from "./index-RoCFhqzC.js";
|
|
|
14
14
|
const j = N(
|
|
15
15
|
({ onClick: a, children: p, className: c, onChange: n, ...d }, u) => {
|
|
16
16
|
const {
|
|
17
|
-
isOptionOpen:
|
|
17
|
+
isOptionOpen: o,
|
|
18
18
|
inputValue: f,
|
|
19
19
|
inputReadOnly: m,
|
|
20
20
|
isDisabled: h,
|
|
21
21
|
isError: x,
|
|
22
22
|
isSuccess: y,
|
|
23
23
|
selectedOption: l,
|
|
24
|
-
isMultiSelect:
|
|
24
|
+
isMultiSelect: s,
|
|
25
25
|
setSelectedOption: b,
|
|
26
26
|
setPreviousAction: I,
|
|
27
27
|
setInputValue: O,
|
|
@@ -32,13 +32,13 @@ const j = N(
|
|
|
32
32
|
{
|
|
33
33
|
role: "combobox",
|
|
34
34
|
"aria-haspopup": "listbox",
|
|
35
|
-
"aria-expanded":
|
|
35
|
+
"aria-expanded": o,
|
|
36
36
|
"aria-controls": "select-portal",
|
|
37
37
|
"aria-owns": "select-portal",
|
|
38
38
|
children: /* @__PURE__ */ r(
|
|
39
39
|
S,
|
|
40
40
|
{
|
|
41
|
-
className: i(
|
|
41
|
+
className: i(s && "mds:h-auto mds:py-10 ", c),
|
|
42
42
|
children: [
|
|
43
43
|
/* @__PURE__ */ r(
|
|
44
44
|
"div",
|
|
@@ -49,18 +49,18 @@ const j = N(
|
|
|
49
49
|
children: [
|
|
50
50
|
p,
|
|
51
51
|
/* @__PURE__ */ t(
|
|
52
|
-
|
|
52
|
+
w,
|
|
53
53
|
{
|
|
54
54
|
...d,
|
|
55
55
|
readOnly: m,
|
|
56
56
|
"data-slot": "select-input-field",
|
|
57
|
-
"data-select-options-opened":
|
|
57
|
+
"data-select-options-opened": o,
|
|
58
58
|
tabIndex: 3,
|
|
59
59
|
value: f,
|
|
60
60
|
isError: x,
|
|
61
61
|
isSuccess: y,
|
|
62
62
|
disabled: h,
|
|
63
|
-
className: i(
|
|
63
|
+
className: i(s && "mds:h-auto mds:min-h-auto"),
|
|
64
64
|
onChange: (e) => {
|
|
65
65
|
n && n(e), I("typing"), O(e.currentTarget.value);
|
|
66
66
|
},
|
|
@@ -77,8 +77,8 @@ const j = N(
|
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
79
|
/* @__PURE__ */ r("div", { className: "mds:flex mds:items-center mds:gap-6", children: [
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
s && Array.isArray(l) && l.length > 0 && /* @__PURE__ */ t(
|
|
81
|
+
A,
|
|
82
82
|
{
|
|
83
83
|
role: "button",
|
|
84
84
|
variant: "filled",
|
|
@@ -91,7 +91,7 @@ const j = N(
|
|
|
91
91
|
/* @__PURE__ */ t(
|
|
92
92
|
C,
|
|
93
93
|
{
|
|
94
|
-
"data-select-options-opened":
|
|
94
|
+
"data-select-options-opened": o,
|
|
95
95
|
className: "mds:size-16 mds:transition-transform mds:transition-1000 mds:data-[select-options-opened=true]:rotate-180"
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),S=require("react"),N=require("./utils-Bdd5vx6a.cjs"),P=require("./mainstack-design-system597.cjs"),x=S.forwardRef(({value:e="",className:A,isGroupLabel:g,isDisabled:d,isCreatableOption:h,onClick:l,..._},I)=>{const{isOptionOpen:q,isMultiSelect:r,selectedOption:s,rootElementRef:p,isCreatableSelect:w,options:m,setOptions:C,setPreviousAction:j,setInputValue:f,onValueChange:n,onOptionSelect:o,onOptionOpenChange:R,setSelectedOption:u}=P.useSelectContext(),y=S.useMemo(()=>r&&Array.isArray(s)?s?.some(c=>e===c):!r&&!Array.isArray(s)?s===e:!1,[r,s,e]);return O.jsx("div",{"aria-disabled":d,className:" mds:aria-disabled:cursor-not-allowed",children:O.jsx("div",{role:"button","data-slot":"select-option-item",tabIndex:0,className:N.cn("mds:body-extrasmall-medium","mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",A),"aria-selected":y,"data-select-options-opened":q,ref:I,"aria-disabled":d||g,onClick:c=>{if(l&&l(c),!e)return;j("selection");let i=m;if(h&&w&&!i.map.has(e)){i={...m};const t={value:e,label:e};i.array.push(t),i.map.set(t.value,t),C(i)}if(r){let t=s;if(Array.isArray(s))if(t=[...s],y){const a=t.findIndex(M=>M===e);a>-1&&t.splice(a,1)}else t.push(e);else t=[e];if(u(t),f(""),Array.isArray(t)&&n&&n(t),Array.isArray(t)&&o&&o(t.map(a=>i.map.get(a))),!p.current)return null;const b=p.current.querySelector('[data-slot="select-input-field"]');b&&b.focus()}else n&&e&&n(e),o&&e&&o(i.map.get(e)),f(i.map.get(e)?.label||""),u(e),R(!1)},..._})})});x.displayName="SelectOptionItem";exports.SelectOptionItem=x;
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),S=require("react"),N=require("./utils-Bdd5vx6a.cjs"),P=require("./mainstack-design-system597.cjs"),x=S.forwardRef(({value:e="",className:A,isGroupLabel:g,isDisabled:d,isCreatableOption:h,onClick:l,..._},I)=>{const{isOptionOpen:q,isMultiSelect:r,selectedOption:s,rootElementRef:p,isCreatableSelect:w,options:m,setOptions:C,setPreviousAction:j,setInputValue:f,onValueChange:n,onOptionSelect:o,onOptionOpenChange:R,setSelectedOption:u}=P.useSelectContext(),y=S.useMemo(()=>r&&Array.isArray(s)?s?.some(c=>e===c):!r&&!Array.isArray(s)?s===e:!1,[r,s,e]);return O.jsx("div",{"aria-disabled":d,className:" mds:aria-disabled:cursor-not-allowed",children:O.jsx("div",{role:"button","data-slot":"select-option-item",tabIndex:0,className:N.cn("mds:body-extrasmall-medium","mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-selected:bg-interactive-secondary-hover mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",A),"aria-selected":y,"data-select-options-opened":q,ref:I,"aria-disabled":d||g,onClick:c=>{if(l&&l(c),!e)return;j("selection");let i=m;if(h&&w&&!i.map.has(e)){i={...m};const t={value:e,label:e};i.array.push(t),i.map.set(t.value,t),C(i)}if(r){let t=s;if(Array.isArray(s))if(t=[...s],y){const a=t.findIndex(M=>M===e);a>-1&&t.splice(a,1)}else t.push(e);else t=[e];if(u(t),f(""),Array.isArray(t)&&n&&n(t),Array.isArray(t)&&o&&o(t.map(a=>i.map.get(a))),!p.current)return null;const b=p.current.querySelector('[data-slot="select-input-field"]');b&&b.focus()}else n&&e&&n(e),o&&e&&o(i.map.get(e)),f(i.map.get(e)?.label||""),u(e),R(!1)},..._})})});x.displayName="SelectOptionItem";exports.SelectOptionItem=x;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { jsx as
|
|
2
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef as R, useMemo as V } from "react";
|
|
4
4
|
import { c as j } from "./utils-D85wpvmd.js";
|
|
5
5
|
import { useSelectContext as q } from "./mainstack-design-system597.js";
|
|
@@ -7,17 +7,17 @@ const E = R(
|
|
|
7
7
|
({
|
|
8
8
|
value: e = "",
|
|
9
9
|
className: A,
|
|
10
|
-
isGroupLabel:
|
|
10
|
+
isGroupLabel: h,
|
|
11
11
|
isDisabled: p,
|
|
12
|
-
isCreatableOption:
|
|
13
|
-
onClick:
|
|
12
|
+
isCreatableOption: x,
|
|
13
|
+
onClick: c,
|
|
14
14
|
...S
|
|
15
15
|
}, g) => {
|
|
16
16
|
const {
|
|
17
17
|
isOptionOpen: w,
|
|
18
18
|
isMultiSelect: s,
|
|
19
|
-
selectedOption:
|
|
20
|
-
rootElementRef:
|
|
19
|
+
selectedOption: r,
|
|
20
|
+
rootElementRef: l,
|
|
21
21
|
isCreatableSelect: I,
|
|
22
22
|
options: m,
|
|
23
23
|
setOptions: C,
|
|
@@ -27,13 +27,13 @@ const E = R(
|
|
|
27
27
|
onOptionSelect: n,
|
|
28
28
|
onOptionOpenChange: N,
|
|
29
29
|
setSelectedOption: y
|
|
30
|
-
} = q(), u = V(() => s && Array.isArray(
|
|
31
|
-
return /* @__PURE__ */
|
|
30
|
+
} = q(), u = V(() => s && Array.isArray(r) ? r?.some((d) => e === d) : !s && !Array.isArray(r) ? r === e : !1, [s, r, e]);
|
|
31
|
+
return /* @__PURE__ */ O(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
34
|
"aria-disabled": p,
|
|
35
35
|
className: " mds:aria-disabled:cursor-not-allowed",
|
|
36
|
-
children: /* @__PURE__ */
|
|
36
|
+
children: /* @__PURE__ */ O(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
39
39
|
role: "button",
|
|
@@ -41,30 +41,30 @@ const E = R(
|
|
|
41
41
|
tabIndex: 0,
|
|
42
42
|
className: j(
|
|
43
43
|
"mds:body-extrasmall-medium",
|
|
44
|
-
"mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",
|
|
44
|
+
"mds:py-8 mds:px-10 mds:cursor-pointer mds:text-left mds:rounded-12 mds:aria-selected:bg-interactive-secondary-hover mds:aria-disabled:pointer-events-none mds:aria-disabled:opacity-40 mds:hover:bg-interactive-secondary-hover",
|
|
45
45
|
A
|
|
46
46
|
),
|
|
47
47
|
"aria-selected": u,
|
|
48
48
|
"data-select-options-opened": w,
|
|
49
49
|
ref: g,
|
|
50
|
-
"aria-disabled": p ||
|
|
50
|
+
"aria-disabled": p || h,
|
|
51
51
|
onClick: (d) => {
|
|
52
|
-
if (
|
|
52
|
+
if (c && c(d), !e)
|
|
53
53
|
return;
|
|
54
54
|
_("selection");
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
|
|
55
|
+
let i = m;
|
|
56
|
+
if (x && I && !i.map.has(e)) {
|
|
57
|
+
i = { ...m };
|
|
58
58
|
const t = {
|
|
59
59
|
value: e,
|
|
60
60
|
label: e
|
|
61
61
|
};
|
|
62
|
-
|
|
62
|
+
i.array.push(t), i.map.set(t.value, t), C(i);
|
|
63
63
|
}
|
|
64
64
|
if (s) {
|
|
65
|
-
let t =
|
|
66
|
-
if (Array.isArray(
|
|
67
|
-
if (t = [...
|
|
65
|
+
let t = r;
|
|
66
|
+
if (Array.isArray(r))
|
|
67
|
+
if (t = [...r], u) {
|
|
68
68
|
const a = t.findIndex((M) => M === e);
|
|
69
69
|
a > -1 && t.splice(a, 1);
|
|
70
70
|
} else
|
|
@@ -72,14 +72,14 @@ const E = R(
|
|
|
72
72
|
else
|
|
73
73
|
t = [e];
|
|
74
74
|
if (y(t), f(""), Array.isArray(t) && o && o(t), Array.isArray(t) && n && n(
|
|
75
|
-
t.map((a) =>
|
|
76
|
-
), !
|
|
77
|
-
const
|
|
75
|
+
t.map((a) => i.map.get(a))
|
|
76
|
+
), !l.current) return null;
|
|
77
|
+
const b = l.current.querySelector(
|
|
78
78
|
'[data-slot="select-input-field"]'
|
|
79
79
|
);
|
|
80
|
-
|
|
80
|
+
b && b.focus();
|
|
81
81
|
} else
|
|
82
|
-
o && e && o(e), n && e && n(
|
|
82
|
+
o && e && o(e), n && e && n(i.map.get(e)), f(i.map.get(e)?.label || ""), y(e), N(!1);
|
|
83
83
|
},
|
|
84
84
|
...S
|
|
85
85
|
}
|