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