@stenajs-webui/select 20.0.3 → 20.2.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/components/ui/ChipMultiSelect/ChipMultiSelect.d.ts +2 -2
- package/dist/components/ui/ChipMultiSelect/ChipRow.d.ts +2 -3
- package/dist/components/ui/MultiSelect.d.ts +4 -3
- package/dist/components/ui/OverflowingMultiSelect.d.ts +2 -2
- package/dist/index.es.js +192 -152
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { useMemo as p, memo as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { cssColor as
|
|
7
|
-
import {
|
|
8
|
-
import { Row as
|
|
9
|
-
import { uniqWith as
|
|
10
|
-
import
|
|
1
|
+
import { jsx as i, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import * as F from "react";
|
|
3
|
+
import { useMemo as p, memo as P, createElement as j } from "react";
|
|
4
|
+
import R, { mergeStyles as w, components as b } from "react-select";
|
|
5
|
+
import H from "react-select/async";
|
|
6
|
+
import { cssColor as u } from "@stenajs-webui/theme";
|
|
7
|
+
import { TextInputButton as N, stenaTimes as U, Chip as O, CloseButton as V, Icon as q, stenaCheck as D, FlatButton as E } from "@stenajs-webui/elements";
|
|
8
|
+
import { Row as k, Space as y, Text as X, Column as Y, Spacing as I } from "@stenajs-webui/core";
|
|
9
|
+
import { uniqWith as J, isEqual as S, intersectionWith as L, differenceWith as K } from "lodash";
|
|
10
|
+
import Q from "react-select/creatable";
|
|
11
11
|
const W = {
|
|
12
12
|
arrowColor: {
|
|
13
|
-
disabled:
|
|
13
|
+
disabled: u("--silver-light"),
|
|
14
14
|
focused: {
|
|
15
|
-
hover:
|
|
16
|
-
standard:
|
|
15
|
+
hover: u("--lhds-color-blue-600"),
|
|
16
|
+
standard: u("--lhds-color-blue-600")
|
|
17
17
|
},
|
|
18
18
|
closed: {
|
|
19
|
-
hover:
|
|
20
|
-
standard:
|
|
19
|
+
hover: u("--lhds-color-blue-600"),
|
|
20
|
+
standard: u("--lhds-color-blue-600")
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
clearButtonColor: {
|
|
24
|
-
hover:
|
|
25
|
-
standard:
|
|
24
|
+
hover: u("--lhds-color-red-600"),
|
|
25
|
+
standard: u("--lhds-color-red-500")
|
|
26
26
|
},
|
|
27
27
|
input: {
|
|
28
28
|
backgroundColor: "var(--swui-field-bg-enabled)",
|
|
@@ -40,7 +40,7 @@ const W = {
|
|
|
40
40
|
boxShadowFocused: "none",
|
|
41
41
|
fontFamily: "var(--swui-font-primary)",
|
|
42
42
|
fontSize: "var(--swui-font-size-inputs)",
|
|
43
|
-
minHeight: "
|
|
43
|
+
minHeight: "24px",
|
|
44
44
|
placeholderColor: "var(--swui-field-text-color)",
|
|
45
45
|
textColor: "var(--swui-field-text-color)",
|
|
46
46
|
borderRadius: "var(--swui-field-border-radius)"
|
|
@@ -49,29 +49,29 @@ const W = {
|
|
|
49
49
|
textColor: "var(--swui-field-text-color)"
|
|
50
50
|
},
|
|
51
51
|
groupHeading: {
|
|
52
|
-
fontSize: "var(--swui-font-size-
|
|
52
|
+
fontSize: "var(--swui-font-size-small)",
|
|
53
53
|
lineHeight: "var(--swui-line-height-smaller)",
|
|
54
54
|
fontWeight: "var(--swui-font-weight-text-bold)",
|
|
55
|
-
color:
|
|
55
|
+
color: u("--lhds-color-ui-600"),
|
|
56
56
|
letterSpacing: "0.1rem"
|
|
57
57
|
},
|
|
58
58
|
menu: {
|
|
59
|
-
activeBackgroundColor:
|
|
59
|
+
activeBackgroundColor: u("--lhds-color-blue-100"),
|
|
60
60
|
activeTextColor: "var(--swui-field-text-color)",
|
|
61
|
-
selectedItemActiveBackgroundColor:
|
|
62
|
-
selectedItemActiveTextColor:
|
|
61
|
+
selectedItemActiveBackgroundColor: u("--lhds-color-blue-500"),
|
|
62
|
+
selectedItemActiveTextColor: u("--lhds-color-blue-50"),
|
|
63
63
|
disabledTextColor: "var(--swui-field-text-color-disabled)",
|
|
64
64
|
disabledBackgroundColor: "var(--swui-field-bg-disabled)",
|
|
65
65
|
textColor: "var(--swui-field-text-color)",
|
|
66
66
|
backgroundColor: "var(--swui-field-bg-enabled)",
|
|
67
67
|
hoverTextColor: "var(--swui-field-text-color)",
|
|
68
|
-
hoverBackgroundColor:
|
|
69
|
-
selectedItemTextColor:
|
|
70
|
-
selectedItemIconColor:
|
|
68
|
+
hoverBackgroundColor: u("--lhds-color-blue-200"),
|
|
69
|
+
selectedItemTextColor: u("--lhds-color-blue-500"),
|
|
70
|
+
selectedItemIconColor: u("--lhds-color-blue-500"),
|
|
71
71
|
selectedItemHoverTextColor: "var(--swui-field-text-color)",
|
|
72
72
|
selectedItemHoverIconColor: "var(--swui-field-text-color)",
|
|
73
|
-
selectedItemBackgroundColor:
|
|
74
|
-
selectedItemHoverBackgroundColor:
|
|
73
|
+
selectedItemBackgroundColor: u("--lhds-color-blue-50"),
|
|
74
|
+
selectedItemHoverBackgroundColor: u("--lhds-color-blue-50"),
|
|
75
75
|
zIndex: 1,
|
|
76
76
|
width: "auto",
|
|
77
77
|
minWidth: "100%",
|
|
@@ -82,13 +82,13 @@ const W = {
|
|
|
82
82
|
},
|
|
83
83
|
multiSelect: {
|
|
84
84
|
backgroundColor: "var(--swui-primary-action-color)",
|
|
85
|
-
textColor:
|
|
85
|
+
textColor: u("--lhds-color-blue-50"),
|
|
86
86
|
removeButtonBackgroundColor: "transparent",
|
|
87
87
|
removeButtonTextColor: "var(--swui-white)",
|
|
88
88
|
removeButtonHoverBackgroundColor: "var(--swui-primary-action-color-hover)",
|
|
89
89
|
removeButtonHoverTextColor: "var(--swui-white)"
|
|
90
90
|
}
|
|
91
|
-
},
|
|
91
|
+
}, Z = (e, r, o, t) => r ? e.disabledBackgroundColor : o && t ? e.selectedItemHoverBackgroundColor : o ? e.selectedItemBackgroundColor : t ? e.hoverBackgroundColor : void 0, $ = (e, r, o, t) => r ? e.disabledTextColor : o && t ? e.selectedItemHoverTextColor : o ? e.selectedItemTextColor : t ? e.hoverTextColor : void 0, ee = (e, r, o, t) => r ? e.disabledBackgroundColor : o ? e.backgroundColor : t === "warning" ? e.warningBackgroundColor : t === "success" ? e.successBackgroundColor : t === "error" ? e.errorBackgroundColor : e.backgroundColor, M = (e, r, o, t, n) => r ? e.disabledBorderColor : o ? e.borderColorFocused : n === "warning" ? e.warningBorderColor : n === "success" ? e.successBorderColor : n === "error" ? e.errorBorderColor : t ? e.borderColorFocused : e.borderColor, oe = ({
|
|
92
92
|
menu: e,
|
|
93
93
|
menuPortal: r,
|
|
94
94
|
input: o,
|
|
@@ -96,58 +96,58 @@ const W = {
|
|
|
96
96
|
clearButtonColor: n,
|
|
97
97
|
arrowColor: a,
|
|
98
98
|
groupHeading: c,
|
|
99
|
-
loadingIndicator:
|
|
100
|
-
},
|
|
101
|
-
option: (l, { isDisabled:
|
|
99
|
+
loadingIndicator: m
|
|
100
|
+
}, f) => ({
|
|
101
|
+
option: (l, { isDisabled: s, isFocused: d, isSelected: h }) => ({
|
|
102
102
|
...l,
|
|
103
103
|
fontFamily: o.fontFamily,
|
|
104
104
|
fontSize: o.fontSize,
|
|
105
|
-
backgroundColor:
|
|
105
|
+
backgroundColor: Z(
|
|
106
106
|
e,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
s,
|
|
108
|
+
h,
|
|
109
|
+
d
|
|
110
110
|
),
|
|
111
|
-
color:
|
|
112
|
-
cursor:
|
|
111
|
+
color: $(e, s, h, d),
|
|
112
|
+
cursor: s ? "not-allowed" : "default",
|
|
113
113
|
whiteSpace: e.whiteSpace || l.whiteSpace,
|
|
114
114
|
":active": {
|
|
115
|
-
backgroundColor:
|
|
116
|
-
color:
|
|
115
|
+
backgroundColor: s ? void 0 : h ? e.selectedItemActiveBackgroundColor : e.activeBackgroundColor,
|
|
116
|
+
color: s ? void 0 : h ? e.selectedItemActiveTextColor : e.activeTextColor
|
|
117
117
|
}
|
|
118
118
|
}),
|
|
119
|
-
control: (l, { isFocused:
|
|
119
|
+
control: (l, { isFocused: s, isDisabled: d, menuIsOpen: h }) => ({
|
|
120
120
|
...l,
|
|
121
121
|
// none of react-selects styles are passed to <View />
|
|
122
122
|
fontFamily: o.fontFamily,
|
|
123
123
|
fontSize: o.fontSize,
|
|
124
|
-
minHeight:
|
|
125
|
-
backgroundColor:
|
|
124
|
+
minHeight: "var(--swui-field-height)",
|
|
125
|
+
backgroundColor: ee(
|
|
126
126
|
o,
|
|
127
|
-
u,
|
|
128
127
|
d,
|
|
129
|
-
|
|
128
|
+
s,
|
|
129
|
+
f
|
|
130
130
|
),
|
|
131
131
|
borderRadius: o.borderRadius,
|
|
132
132
|
border: o.border,
|
|
133
133
|
"--swui-select-border-color": M(
|
|
134
134
|
o,
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
d,
|
|
136
|
+
s || h,
|
|
137
137
|
!1,
|
|
138
|
-
|
|
138
|
+
f
|
|
139
139
|
),
|
|
140
|
-
outline:
|
|
141
|
-
outlineOffset:
|
|
140
|
+
outline: s ? "var(--swui-focus-outline)" : void 0,
|
|
141
|
+
outlineOffset: s ? "-1px" : void 0,
|
|
142
142
|
transition: "none",
|
|
143
|
-
boxShadow:
|
|
143
|
+
boxShadow: s ? o.boxShadowFocused : void 0,
|
|
144
144
|
"&:hover": {
|
|
145
145
|
"--swui-select-border-color": M(
|
|
146
146
|
o,
|
|
147
147
|
!1,
|
|
148
|
-
|
|
148
|
+
s || h,
|
|
149
149
|
!0,
|
|
150
|
-
|
|
150
|
+
f
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
153
|
}),
|
|
@@ -164,6 +164,8 @@ const W = {
|
|
|
164
164
|
}),
|
|
165
165
|
input: (l) => ({
|
|
166
166
|
...l,
|
|
167
|
+
padding: 0,
|
|
168
|
+
margin: 0,
|
|
167
169
|
minHeight: o.minHeight,
|
|
168
170
|
fontFamily: o.fontFamily,
|
|
169
171
|
fontSize: o.fontSize,
|
|
@@ -209,14 +211,15 @@ const W = {
|
|
|
209
211
|
}),
|
|
210
212
|
valueContainer: (l) => ({
|
|
211
213
|
...l,
|
|
212
|
-
padding: "
|
|
214
|
+
padding: "var(--swui-metrics-space-half)",
|
|
215
|
+
gap: "var(--swui-metrics-space-half)"
|
|
213
216
|
}),
|
|
214
|
-
dropdownIndicator: (l, { isFocused:
|
|
217
|
+
dropdownIndicator: (l, { isFocused: s, isDisabled: d }) => ({
|
|
215
218
|
...l,
|
|
216
219
|
padding: "5px",
|
|
217
|
-
color:
|
|
220
|
+
color: d ? a.disabled : s ? a.focused.standard : a.closed.standard,
|
|
218
221
|
"&:hover": {
|
|
219
|
-
color:
|
|
222
|
+
color: d ? a.disabled : s ? a.focused.hover : a.closed.hover
|
|
220
223
|
},
|
|
221
224
|
svg: {
|
|
222
225
|
width: 14,
|
|
@@ -264,16 +267,17 @@ const W = {
|
|
|
264
267
|
fontSize: c.fontSize,
|
|
265
268
|
alignItems: "center",
|
|
266
269
|
margin: 0,
|
|
267
|
-
|
|
270
|
+
borderRadius: "var(--swui-border-radius-small)",
|
|
271
|
+
overflow: "hidden"
|
|
268
272
|
}),
|
|
269
273
|
loadingMessage: (l) => ({
|
|
270
274
|
...l,
|
|
271
|
-
color:
|
|
275
|
+
color: m.textColor,
|
|
272
276
|
fontFamily: o.fontFamily,
|
|
273
277
|
fontSize: o.fontSize
|
|
274
278
|
})
|
|
275
|
-
}), x = (e) =>
|
|
276
|
-
function
|
|
279
|
+
}), x = (e) => oe(W, e);
|
|
280
|
+
function ye({
|
|
277
281
|
variant: e = "standard",
|
|
278
282
|
styles: r,
|
|
279
283
|
isMulti: o,
|
|
@@ -283,9 +287,9 @@ function Se({
|
|
|
283
287
|
const a = x(e);
|
|
284
288
|
return r ? w(a, r) : a;
|
|
285
289
|
}, [e, r]);
|
|
286
|
-
return /* @__PURE__ */ i(
|
|
290
|
+
return /* @__PURE__ */ i(H, { styles: n, ...t, isMulti: !0 });
|
|
287
291
|
}
|
|
288
|
-
function
|
|
292
|
+
function Be({
|
|
289
293
|
variant: e = "standard",
|
|
290
294
|
styles: r,
|
|
291
295
|
isMulti: o,
|
|
@@ -295,8 +299,44 @@ function ke({
|
|
|
295
299
|
const a = x(e);
|
|
296
300
|
return r ? w(a, r) : a;
|
|
297
301
|
}, [e, r]);
|
|
298
|
-
return /* @__PURE__ */ i(
|
|
302
|
+
return /* @__PURE__ */ i(H, { styles: n, ...t, isMulti: !1 });
|
|
299
303
|
}
|
|
304
|
+
const re = function({
|
|
305
|
+
clearValue: e
|
|
306
|
+
}) {
|
|
307
|
+
return (
|
|
308
|
+
// stopPropagation is needed to prevent react-select from opening its menu when clicking on the button.
|
|
309
|
+
/* @__PURE__ */ i("div", { onMouseDown: (r) => r.stopPropagation(), children: /* @__PURE__ */ i(
|
|
310
|
+
N,
|
|
311
|
+
{
|
|
312
|
+
"aria-label": "Clear",
|
|
313
|
+
onClick: e,
|
|
314
|
+
icon: U,
|
|
315
|
+
variant: "error"
|
|
316
|
+
}
|
|
317
|
+
) })
|
|
318
|
+
);
|
|
319
|
+
}, te = function({
|
|
320
|
+
removeProps: e,
|
|
321
|
+
data: r
|
|
322
|
+
}) {
|
|
323
|
+
return (
|
|
324
|
+
// stopPropagation is needed to prevent react-select from opening its menu when clicking on the button.
|
|
325
|
+
/* @__PURE__ */ i("div", { onMouseDown: (o) => o.stopPropagation(), children: /* @__PURE__ */ i(
|
|
326
|
+
O,
|
|
327
|
+
{
|
|
328
|
+
onClickRemove: (o) => {
|
|
329
|
+
var t;
|
|
330
|
+
return (t = e.onClick) == null ? void 0 : t.call(
|
|
331
|
+
e,
|
|
332
|
+
o
|
|
333
|
+
);
|
|
334
|
+
},
|
|
335
|
+
label: r.label
|
|
336
|
+
}
|
|
337
|
+
) })
|
|
338
|
+
);
|
|
339
|
+
};
|
|
300
340
|
function B({
|
|
301
341
|
variant: e = "standard",
|
|
302
342
|
styles: r,
|
|
@@ -305,20 +345,20 @@ function B({
|
|
|
305
345
|
...n
|
|
306
346
|
}) {
|
|
307
347
|
const a = p(() => {
|
|
308
|
-
const
|
|
309
|
-
return r ? w(
|
|
348
|
+
const c = x(e);
|
|
349
|
+
return r ? w(c, r) : c;
|
|
310
350
|
}, [e, r]);
|
|
311
351
|
return /* @__PURE__ */ i(
|
|
312
|
-
|
|
352
|
+
R,
|
|
313
353
|
{
|
|
314
354
|
styles: a,
|
|
315
|
-
components: { ...t, ClearIndicator:
|
|
355
|
+
components: { ...t, ClearIndicator: re, MultiValue: te },
|
|
316
356
|
...n,
|
|
317
357
|
isMulti: !0
|
|
318
358
|
}
|
|
319
359
|
);
|
|
320
360
|
}
|
|
321
|
-
function
|
|
361
|
+
function ze(e) {
|
|
322
362
|
return /* @__PURE__ */ i(
|
|
323
363
|
B,
|
|
324
364
|
{
|
|
@@ -326,20 +366,20 @@ function Ie(e) {
|
|
|
326
366
|
...e,
|
|
327
367
|
components: {
|
|
328
368
|
...e.components,
|
|
329
|
-
ValueContainer:
|
|
369
|
+
ValueContainer: le
|
|
330
370
|
}
|
|
331
371
|
}
|
|
332
372
|
);
|
|
333
373
|
}
|
|
334
|
-
const
|
|
374
|
+
const le = P(
|
|
335
375
|
(e) => {
|
|
336
|
-
const [r, ...o] = e.children, t =
|
|
337
|
-
return /* @__PURE__ */
|
|
376
|
+
const [r, ...o] = e.children, t = ne(r, e);
|
|
377
|
+
return /* @__PURE__ */ C(b.ValueContainer, { ...e, children: [
|
|
338
378
|
t,
|
|
339
379
|
o
|
|
340
380
|
] });
|
|
341
381
|
}
|
|
342
|
-
),
|
|
382
|
+
), ne = (e, {
|
|
343
383
|
children: r,
|
|
344
384
|
innerProps: o,
|
|
345
385
|
className: t,
|
|
@@ -365,7 +405,7 @@ const ee = _(
|
|
|
365
405
|
"+" + (e.length - 1)
|
|
366
406
|
)
|
|
367
407
|
] : e : null;
|
|
368
|
-
function
|
|
408
|
+
function Me({
|
|
369
409
|
variant: e = "standard",
|
|
370
410
|
styles: r,
|
|
371
411
|
isMulti: o,
|
|
@@ -373,29 +413,29 @@ function Oe({
|
|
|
373
413
|
...n
|
|
374
414
|
}) {
|
|
375
415
|
const a = p(() => {
|
|
376
|
-
const
|
|
377
|
-
return r ? w(
|
|
416
|
+
const m = x(e);
|
|
417
|
+
return r ? w(m, r) : m;
|
|
378
418
|
}, [e, r]);
|
|
379
419
|
return /* @__PURE__ */ i(
|
|
380
|
-
|
|
420
|
+
R,
|
|
381
421
|
{
|
|
382
422
|
styles: a,
|
|
383
|
-
components: { ...t, ClearIndicator: (
|
|
423
|
+
components: { ...t, ClearIndicator: (m) => /* @__PURE__ */ i(V, { "aria-label": "Clear", onClick: m.clearValue }) },
|
|
384
424
|
...n,
|
|
385
425
|
isMulti: !1
|
|
386
426
|
}
|
|
387
427
|
);
|
|
388
428
|
}
|
|
389
|
-
const
|
|
429
|
+
const T = (e, r) => K(
|
|
390
430
|
r,
|
|
391
431
|
[...e.internalOptions, e],
|
|
392
|
-
|
|
393
|
-
).map(g),
|
|
432
|
+
S
|
|
433
|
+
).map(g), ie = (e) => !("internalOptions" in e), v = (e) => e.filter(ie).map(g), ae = (e) => (r, o) => {
|
|
394
434
|
const t = r ?? [];
|
|
395
435
|
switch (o.action) {
|
|
396
436
|
case "select-option":
|
|
397
437
|
if (o.option && "internalOptions" in o.option) {
|
|
398
|
-
const n =
|
|
438
|
+
const n = J(
|
|
399
439
|
t.reduce(
|
|
400
440
|
(a, c) => "internalOptions" in c ? [...a, ...c.internalOptions] : [
|
|
401
441
|
...a,
|
|
@@ -403,7 +443,7 @@ const F = (e, r) => J(
|
|
|
403
443
|
],
|
|
404
444
|
[]
|
|
405
445
|
),
|
|
406
|
-
|
|
446
|
+
S
|
|
407
447
|
);
|
|
408
448
|
e(n, o);
|
|
409
449
|
} else
|
|
@@ -411,7 +451,7 @@ const F = (e, r) => J(
|
|
|
411
451
|
break;
|
|
412
452
|
case "deselect-option":
|
|
413
453
|
o.option && "internalOptions" in o.option ? e(
|
|
414
|
-
|
|
454
|
+
T(
|
|
415
455
|
o.option,
|
|
416
456
|
v(t)
|
|
417
457
|
),
|
|
@@ -421,7 +461,7 @@ const F = (e, r) => J(
|
|
|
421
461
|
case "remove-value":
|
|
422
462
|
case "pop-value":
|
|
423
463
|
o.removedValue && "internalOptions" in o.removedValue ? e(
|
|
424
|
-
|
|
464
|
+
T(
|
|
425
465
|
o.removedValue,
|
|
426
466
|
v(t)
|
|
427
467
|
),
|
|
@@ -441,27 +481,27 @@ const F = (e, r) => J(
|
|
|
441
481
|
);
|
|
442
482
|
break;
|
|
443
483
|
}
|
|
444
|
-
},
|
|
484
|
+
}, ce = (e) => e.reduce(
|
|
445
485
|
(r, o) => [
|
|
446
486
|
...r,
|
|
447
487
|
A(o),
|
|
448
488
|
...o.options.map(G)
|
|
449
489
|
],
|
|
450
490
|
[]
|
|
451
|
-
),
|
|
491
|
+
), se = (e, r) => {
|
|
452
492
|
if (!r)
|
|
453
493
|
return [];
|
|
454
494
|
const o = [];
|
|
455
495
|
return e.forEach((t) => {
|
|
456
|
-
|
|
496
|
+
de(t.options, r) && o.push(
|
|
457
497
|
A(t)
|
|
458
498
|
), o.push(
|
|
459
|
-
...L(t.options, r,
|
|
499
|
+
...L(t.options, r, S).map(
|
|
460
500
|
(n) => G(n)
|
|
461
501
|
)
|
|
462
502
|
);
|
|
463
503
|
}), o;
|
|
464
|
-
},
|
|
504
|
+
}, de = (e, r) => r ? L(e, r, S).length === e.length : !1, G = (e) => ({
|
|
465
505
|
data: e.data,
|
|
466
506
|
label: e.label,
|
|
467
507
|
value: e.value
|
|
@@ -474,8 +514,8 @@ const F = (e, r) => J(
|
|
|
474
514
|
data: e.data,
|
|
475
515
|
label: e.label,
|
|
476
516
|
value: e.value
|
|
477
|
-
}),
|
|
478
|
-
function
|
|
517
|
+
}), ue = (e, r) => r ? e.menu.selectedItemHoverIconColor : e.menu.selectedItemIconColor;
|
|
518
|
+
function fe(e) {
|
|
479
519
|
const { formatGroupLabel: r, formatOptionLabel: o } = e.selectProps;
|
|
480
520
|
return "internalOptions" in e.data ? r ? r({
|
|
481
521
|
label: e.data.label,
|
|
@@ -486,7 +526,7 @@ function ce(e) {
|
|
|
486
526
|
selectValue: e.getValue()
|
|
487
527
|
}) : e.label;
|
|
488
528
|
}
|
|
489
|
-
function
|
|
529
|
+
function me({
|
|
490
530
|
onChange: e,
|
|
491
531
|
options: r,
|
|
492
532
|
value: o,
|
|
@@ -495,58 +535,58 @@ function se({
|
|
|
495
535
|
formatOptionLabel: a,
|
|
496
536
|
...c
|
|
497
537
|
}) {
|
|
498
|
-
const
|
|
499
|
-
const
|
|
500
|
-
return /* @__PURE__ */ i(b.Option, { ...
|
|
501
|
-
!z && /* @__PURE__ */ i(
|
|
538
|
+
const m = (d) => {
|
|
539
|
+
const h = fe(d), z = "internalOptions" in d.data;
|
|
540
|
+
return /* @__PURE__ */ i(b.Option, { ...d, children: /* @__PURE__ */ C(k, { children: [
|
|
541
|
+
!z && /* @__PURE__ */ i(y, {}),
|
|
502
542
|
/* @__PURE__ */ i(
|
|
503
|
-
|
|
543
|
+
he,
|
|
504
544
|
{
|
|
505
545
|
theme: W,
|
|
506
546
|
size: z ? void 0 : "small",
|
|
507
|
-
label:
|
|
508
|
-
selected:
|
|
509
|
-
focused:
|
|
547
|
+
label: h,
|
|
548
|
+
selected: d.isSelected,
|
|
549
|
+
focused: d.isFocused
|
|
510
550
|
}
|
|
511
551
|
)
|
|
512
552
|
] }) });
|
|
513
|
-
},
|
|
553
|
+
}, f = (d) => "internalOptions" in d.data ? null : /* @__PURE__ */ i(b.MultiValue, { ...d }), l = r ? se(r, o) : void 0, s = r ? ce(r) : void 0;
|
|
514
554
|
return /* @__PURE__ */ i(
|
|
515
555
|
B,
|
|
516
556
|
{
|
|
517
557
|
...c,
|
|
518
|
-
onChange: e ?
|
|
558
|
+
onChange: e ? ae(e) : void 0,
|
|
519
559
|
hideSelectedOptions: !1,
|
|
520
560
|
components: {
|
|
521
561
|
...c.components,
|
|
522
|
-
MultiValue:
|
|
523
|
-
Option:
|
|
562
|
+
MultiValue: f,
|
|
563
|
+
Option: m
|
|
524
564
|
},
|
|
525
565
|
isMulti: !0,
|
|
526
|
-
options:
|
|
566
|
+
options: s,
|
|
527
567
|
value: l,
|
|
528
568
|
variant: t
|
|
529
569
|
}
|
|
530
570
|
);
|
|
531
571
|
}
|
|
532
|
-
const
|
|
572
|
+
const he = ({
|
|
533
573
|
focused: e,
|
|
534
574
|
label: r,
|
|
535
575
|
selected: o,
|
|
536
576
|
size: t,
|
|
537
577
|
theme: n
|
|
538
|
-
}) => /* @__PURE__ */
|
|
539
|
-
/* @__PURE__ */ i(
|
|
578
|
+
}) => /* @__PURE__ */ C(k, { alignItems: "center", justifyContent: "space-between", flexGrow: 1, children: [
|
|
579
|
+
/* @__PURE__ */ i(X, { tabIndex: -1, size: t, color: "currentColor", children: r }),
|
|
540
580
|
o && /* @__PURE__ */ i(
|
|
541
|
-
|
|
581
|
+
q,
|
|
542
582
|
{
|
|
543
|
-
color:
|
|
544
|
-
icon:
|
|
583
|
+
color: ue(n, e),
|
|
584
|
+
icon: D,
|
|
545
585
|
size: 12
|
|
546
586
|
}
|
|
547
587
|
)
|
|
548
588
|
] });
|
|
549
|
-
function
|
|
589
|
+
function Te({
|
|
550
590
|
variant: e = "standard",
|
|
551
591
|
styles: r,
|
|
552
592
|
isMulti: o,
|
|
@@ -555,30 +595,30 @@ function ye({
|
|
|
555
595
|
...a
|
|
556
596
|
}) {
|
|
557
597
|
const c = p(() => {
|
|
558
|
-
const
|
|
559
|
-
return r ? w(
|
|
598
|
+
const f = x(e);
|
|
599
|
+
return r ? w(f, r) : f;
|
|
560
600
|
}, [e, r]);
|
|
561
601
|
return /* @__PURE__ */ i(
|
|
562
|
-
|
|
602
|
+
Q,
|
|
563
603
|
{
|
|
564
604
|
styles: c,
|
|
565
|
-
components: { ...t, ClearIndicator: (
|
|
605
|
+
components: { ...t, ClearIndicator: (f) => /* @__PURE__ */ i(V, { "aria-label": n, onClick: f.clearValue }) },
|
|
566
606
|
...a,
|
|
567
607
|
isMulti: !1
|
|
568
608
|
}
|
|
569
609
|
);
|
|
570
610
|
}
|
|
571
|
-
function
|
|
611
|
+
function _({
|
|
572
612
|
value: e,
|
|
573
613
|
onValueChange: r,
|
|
574
614
|
noneSelectedLabel: o = "None",
|
|
575
615
|
children: t
|
|
576
616
|
}) {
|
|
577
|
-
return /* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
e == null ? void 0 : e.map((n) => /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ C(Y, { flex: 1, children: [
|
|
618
|
+
/* @__PURE__ */ C(k, { flexWrap: "wrap", children: [
|
|
619
|
+
e == null ? void 0 : e.map((n) => /* @__PURE__ */ C(k, { children: [
|
|
580
620
|
/* @__PURE__ */ i(I, { num: 0.5, children: /* @__PURE__ */ i(
|
|
581
|
-
|
|
621
|
+
O,
|
|
582
622
|
{
|
|
583
623
|
label: n.label,
|
|
584
624
|
onClickRemove: () => r == null ? void 0 : r(
|
|
@@ -586,22 +626,22 @@ function P({
|
|
|
586
626
|
)
|
|
587
627
|
}
|
|
588
628
|
) }),
|
|
589
|
-
/* @__PURE__ */ i(
|
|
629
|
+
/* @__PURE__ */ i(y, {})
|
|
590
630
|
] }, n.value)),
|
|
591
631
|
e != null && e.length ? /* @__PURE__ */ i(I, { num: 0.5, children: /* @__PURE__ */ i(
|
|
592
|
-
|
|
632
|
+
E,
|
|
593
633
|
{
|
|
594
634
|
size: "small",
|
|
595
635
|
label: "Clear",
|
|
596
636
|
onClick: () => r == null ? void 0 : r([])
|
|
597
637
|
}
|
|
598
|
-
) }) : /* @__PURE__ */ i(I, { num: 0.5, children: /* @__PURE__ */ i(
|
|
638
|
+
) }) : /* @__PURE__ */ i(I, { num: 0.5, children: /* @__PURE__ */ i(O, { variant: "secondary", label: o }) })
|
|
599
639
|
] }),
|
|
600
|
-
/* @__PURE__ */ i(
|
|
640
|
+
/* @__PURE__ */ i(y, { num: 0.5 }),
|
|
601
641
|
t
|
|
602
642
|
] });
|
|
603
643
|
}
|
|
604
|
-
function
|
|
644
|
+
function Ce({
|
|
605
645
|
value: e,
|
|
606
646
|
onValueChange: r,
|
|
607
647
|
placeholder: o = "Type to search",
|
|
@@ -609,10 +649,10 @@ function ue({
|
|
|
609
649
|
inputValue: n,
|
|
610
650
|
onInputChange: a,
|
|
611
651
|
noneSelectedLabel: c = "None",
|
|
612
|
-
...
|
|
652
|
+
...m
|
|
613
653
|
}) {
|
|
614
654
|
return /* @__PURE__ */ i(
|
|
615
|
-
|
|
655
|
+
_,
|
|
616
656
|
{
|
|
617
657
|
noneSelectedLabel: c,
|
|
618
658
|
onValueChange: r,
|
|
@@ -620,10 +660,10 @@ function ue({
|
|
|
620
660
|
children: /* @__PURE__ */ i(
|
|
621
661
|
B,
|
|
622
662
|
{
|
|
623
|
-
...
|
|
663
|
+
...m,
|
|
624
664
|
isClearable: !1,
|
|
625
665
|
value: e,
|
|
626
|
-
onChange: r ? (
|
|
666
|
+
onChange: r ? (f) => r([...f]) : void 0,
|
|
627
667
|
backspaceRemovesValue: !1,
|
|
628
668
|
hideSelectedOptions: !0,
|
|
629
669
|
controlShouldRenderValue: !1,
|
|
@@ -636,10 +676,10 @@ function ue({
|
|
|
636
676
|
}
|
|
637
677
|
);
|
|
638
678
|
}
|
|
639
|
-
const
|
|
640
|
-
|
|
679
|
+
const Fe = F.memo(
|
|
680
|
+
Ce
|
|
641
681
|
);
|
|
642
|
-
function
|
|
682
|
+
function be({
|
|
643
683
|
value: e,
|
|
644
684
|
onValueChange: r,
|
|
645
685
|
placeholder: o = "Type to search",
|
|
@@ -647,21 +687,21 @@ function fe({
|
|
|
647
687
|
inputValue: n,
|
|
648
688
|
onInputChange: a,
|
|
649
689
|
noneSelectedLabel: c = "None",
|
|
650
|
-
...
|
|
690
|
+
...m
|
|
651
691
|
}) {
|
|
652
692
|
return /* @__PURE__ */ i(
|
|
653
|
-
|
|
693
|
+
_,
|
|
654
694
|
{
|
|
655
695
|
noneSelectedLabel: c,
|
|
656
696
|
onValueChange: r,
|
|
657
697
|
value: e,
|
|
658
698
|
children: /* @__PURE__ */ i(
|
|
659
|
-
|
|
699
|
+
me,
|
|
660
700
|
{
|
|
661
|
-
...
|
|
701
|
+
...m,
|
|
662
702
|
isClearable: !1,
|
|
663
703
|
value: e,
|
|
664
|
-
onChange: r ? (
|
|
704
|
+
onChange: r ? (f) => r([...f]) : void 0,
|
|
665
705
|
backspaceRemovesValue: !1,
|
|
666
706
|
hideSelectedOptions: !0,
|
|
667
707
|
controlShouldRenderValue: !1,
|
|
@@ -674,20 +714,20 @@ function fe({
|
|
|
674
714
|
}
|
|
675
715
|
);
|
|
676
716
|
}
|
|
677
|
-
const
|
|
678
|
-
|
|
717
|
+
const Re = F.memo(
|
|
718
|
+
be
|
|
679
719
|
);
|
|
680
720
|
export {
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
721
|
+
ye as AsyncMultiSelect,
|
|
722
|
+
Be as AsyncSelect,
|
|
723
|
+
Fe as ChipMultiSelect,
|
|
724
|
+
Te as CreatableSelect,
|
|
725
|
+
Re as GroupedChipMultiSelect,
|
|
726
|
+
me as GroupedMultiSelect,
|
|
687
727
|
B as MultiSelect,
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
728
|
+
ze as OverflowingMultiSelect,
|
|
729
|
+
Me as Select,
|
|
730
|
+
oe as createStylesFromTheme,
|
|
691
731
|
x as createStylesFromVariant,
|
|
692
732
|
W as defaultSelectTheme
|
|
693
733
|
};
|