@iress-oss/ids-components 6.0.0-alpha.49 → 6.0.0-alpha.50
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/.ai/guides/migration-guides-v6.md +2 -1
- package/dist/{Autocomplete-C1SPFcaX.js → Autocomplete-B8Ac_bPk.js} +71 -67
- package/dist/{TableBody-DnTSsbYF.js → TableBody-r9poBt3c.js} +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +1 -1
- package/dist/components/Autocomplete/index.js +1 -1
- package/dist/components/Hide/helpers/normaliseHideValues.js +1 -1
- package/dist/components/Icon/Icon.constants.d.ts +1 -1
- package/dist/components/Icon/Icon.constants.js +2 -2
- package/dist/components/Icon/IconProvider.js +1 -1
- package/dist/components/Icon/index.js +4 -4
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.js +1 -1
- package/dist/components/Select/components/SelectActivator.js +50 -45
- package/dist/components/Select/components/SelectOptions.js +134 -129
- package/dist/components/Select/helpers/toPrimitiveValue.d.ts +4 -0
- package/dist/components/Select/helpers/toPrimitiveValue.js +7 -0
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/TableBody/TableBody.js +1 -1
- package/dist/components/Table/components/TableFilterButton.js +2 -2
- package/dist/components/Table/components/TableHeader.js +1 -1
- package/dist/components/Table/components/TableHeaderCell.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/constants.d.ts +93 -2
- package/dist/constants.js +139 -13
- package/dist/hooks/useBreakpoint.d.ts +1 -1
- package/dist/hooks/useBreakpoint.js +6 -6
- package/dist/hooks/useResponsiveProps.js +4 -4
- package/dist/main.js +266 -267
- package/dist/patterns/DropdownMenu/DropdownMenu.js +1 -1
- package/package.json +1 -1
- package/dist/Icon.constants-CITIz_Fu.js +0 -139
|
@@ -422,7 +422,8 @@ New component for rendering a standalone radio mark indicator (similar to `Iress
|
|
|
422
422
|
| `defaultValue`/`onChange`/`value` | Type-aware based on `multiSelect` — arrays when `true`, single value when `false` |
|
|
423
423
|
| `value`/`defaultValue` accepts strings | Now also accepts a plain string or `FormControlValue` that resolves to the matching option automatically |
|
|
424
424
|
| New `multiSelectLimit` prop | Limits visible selected tags before collapsing to "+N more" summary (default `5`). Display only — does not limit selections |
|
|
425
|
-
| New `native` prop | Renders a browser-native select (replaces the old `IressSelect`)
|
|
425
|
+
| New `native` prop | Renders a browser-native select (replaces the old `IressSelect`) |
|
|
426
|
+
| `onChange` signature | `onChange(event, value, labelValue)` — `value` is the primitive (`FormControlValue`), `labelValue` is the full `LabelValueMeta` |
|
|
426
427
|
| Grouped items | Now supported |
|
|
427
428
|
| New hover and focus states | — |
|
|
428
429
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c, jsxs as O, Fragment as ge } from "react/jsx-runtime";
|
|
2
2
|
import { c as x } from "./cx-DN21T1EH.js";
|
|
3
3
|
import { autoComplete as Ee } from "./components/Autocomplete/Autocomplete.styles.js";
|
|
4
4
|
import { IressPopover as Me } from "./components/Popover/Popover.js";
|
|
5
5
|
import "./components/Popover/Popover.styles.js";
|
|
6
6
|
import { IressInputPopover as je } from "./components/Popover/InputPopover/InputPopover.js";
|
|
7
|
-
import { forwardRef as Se, useState as $, useMemo as fe, useEffect as z, useRef as
|
|
7
|
+
import { forwardRef as Se, useState as $, useMemo as fe, useEffect as z, useRef as le, useImperativeHandle as Pe, useCallback as ke } from "react";
|
|
8
8
|
import "./components/Popover/hooks/useFloatingPopover.js";
|
|
9
9
|
import { IressInput as Ke } from "./components/Input/Input.js";
|
|
10
10
|
import "./components/Input/Input.styles.js";
|
|
@@ -30,7 +30,7 @@ import { IressReadonly as Ie } from "./components/Readonly/Readonly.js";
|
|
|
30
30
|
import "./components/Readonly/Readonly.styles.js";
|
|
31
31
|
import { IressAlert as Je } from "./components/Alert/Alert.js";
|
|
32
32
|
import "./components/Alert/Alert.styles.js";
|
|
33
|
-
import { GlobalCSSClass as
|
|
33
|
+
import { GlobalCSSClass as ce } from "./enums.js";
|
|
34
34
|
import { SelectActivator as Ue } from "./components/Select/components/SelectActivator.js";
|
|
35
35
|
import { SelectOptions as We } from "./components/Select/components/SelectOptions.js";
|
|
36
36
|
import { SelectHiddenInput as Xe } from "./components/Select/components/SelectHiddenInput.js";
|
|
@@ -69,17 +69,17 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
69
69
|
disabled: p,
|
|
70
70
|
footer: J,
|
|
71
71
|
header: R,
|
|
72
|
-
id:
|
|
72
|
+
id: k,
|
|
73
73
|
matchActivatorWidth: U = !0,
|
|
74
74
|
multiSelect: y,
|
|
75
|
-
multiSelectLimit:
|
|
76
|
-
name:
|
|
75
|
+
multiSelectLimit: K,
|
|
76
|
+
name: Q,
|
|
77
77
|
onChange: L,
|
|
78
78
|
onBlur: I,
|
|
79
79
|
options: n,
|
|
80
80
|
native: d,
|
|
81
81
|
placeholder: T,
|
|
82
|
-
readOnly:
|
|
82
|
+
readOnly: q,
|
|
83
83
|
renderHiddenInput: W,
|
|
84
84
|
renderLabel: X,
|
|
85
85
|
renderOptions: Y,
|
|
@@ -112,7 +112,7 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
112
112
|
defaultValue: te,
|
|
113
113
|
multiple: y,
|
|
114
114
|
value: E
|
|
115
|
-
}), g =
|
|
115
|
+
}), g = le(null), S = le(null), u = le(null), { value: N } = Ze(
|
|
116
116
|
typeof d == "string" ? { xs: !0, [d]: !1 } : { xs: d },
|
|
117
117
|
{
|
|
118
118
|
disabled: !d
|
|
@@ -120,11 +120,11 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
120
120
|
), {
|
|
121
121
|
append: oe,
|
|
122
122
|
debounceThreshold: ne,
|
|
123
|
-
initialOptions:
|
|
124
|
-
minSearchLength:
|
|
125
|
-
onActivated:
|
|
123
|
+
initialOptions: B,
|
|
124
|
+
minSearchLength: H,
|
|
125
|
+
onActivated: G,
|
|
126
126
|
onDeactivated: D,
|
|
127
|
-
prepend:
|
|
127
|
+
prepend: l,
|
|
128
128
|
selectedOptionsText: m,
|
|
129
129
|
...j
|
|
130
130
|
} = ee, {
|
|
@@ -138,8 +138,8 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
138
138
|
} = ye({
|
|
139
139
|
debounceThreshold: ne,
|
|
140
140
|
disabled: !t || !!N,
|
|
141
|
-
initialOptions:
|
|
142
|
-
minSearchLength:
|
|
141
|
+
initialOptions: B,
|
|
142
|
+
minSearchLength: H,
|
|
143
143
|
options: n,
|
|
144
144
|
query: v
|
|
145
145
|
});
|
|
@@ -159,23 +159,23 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
159
159
|
focus: () => u.current?.focus(),
|
|
160
160
|
blur: () => u.current?.blur()
|
|
161
161
|
}, [N]), z(() => {
|
|
162
|
-
t ?
|
|
163
|
-
}, [
|
|
162
|
+
t ? G?.() : D?.();
|
|
163
|
+
}, [G, D, t]);
|
|
164
164
|
const xe = ke(
|
|
165
165
|
(V) => {
|
|
166
166
|
if (!I) return;
|
|
167
|
-
const
|
|
168
|
-
!t && (!me || !
|
|
167
|
+
const P = V.currentTarget, me = V.relatedTarget;
|
|
168
|
+
!t && (!me || !P.contains(me)) && I(V), V.stopPropagation();
|
|
169
169
|
},
|
|
170
170
|
[I, t]
|
|
171
171
|
);
|
|
172
|
-
if (
|
|
173
|
-
return /* @__PURE__ */
|
|
172
|
+
if (q)
|
|
173
|
+
return /* @__PURE__ */ c(
|
|
174
174
|
Ie,
|
|
175
175
|
{
|
|
176
176
|
value: f(),
|
|
177
177
|
ref: u,
|
|
178
|
-
variant:
|
|
178
|
+
variant: q,
|
|
179
179
|
children: re(", ")
|
|
180
180
|
}
|
|
181
181
|
);
|
|
@@ -188,17 +188,21 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
188
188
|
throw new Error(
|
|
189
189
|
"[IressSelect] The native select does not support multiple selection. Please remove the multiSelect prop or use the non-native select."
|
|
190
190
|
);
|
|
191
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ c(
|
|
192
192
|
_e,
|
|
193
193
|
{
|
|
194
|
-
className: x(r,
|
|
194
|
+
className: x(r, ce.Select),
|
|
195
195
|
"data-testid": j["data-testid"],
|
|
196
196
|
disabled: p,
|
|
197
|
-
id:
|
|
198
|
-
name:
|
|
199
|
-
onChange: (V,
|
|
200
|
-
L?.(
|
|
201
|
-
|
|
197
|
+
id: k,
|
|
198
|
+
name: Q,
|
|
199
|
+
onChange: (V, P) => {
|
|
200
|
+
L?.(
|
|
201
|
+
V,
|
|
202
|
+
P?.value ?? null,
|
|
203
|
+
P
|
|
204
|
+
), M(
|
|
205
|
+
P
|
|
202
206
|
);
|
|
203
207
|
},
|
|
204
208
|
options: n,
|
|
@@ -216,12 +220,12 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
216
220
|
a(!1), Ne();
|
|
217
221
|
};
|
|
218
222
|
return /* @__PURE__ */ O(ge, { children: [
|
|
219
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ c(
|
|
220
224
|
Xe,
|
|
221
225
|
{
|
|
222
226
|
"data-testid": j["data-testid"],
|
|
223
227
|
getValuesString: f,
|
|
224
|
-
name:
|
|
228
|
+
name: Q,
|
|
225
229
|
renderHiddenInput: W,
|
|
226
230
|
required: Z,
|
|
227
231
|
value: i,
|
|
@@ -229,24 +233,24 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
229
233
|
ref: u
|
|
230
234
|
}
|
|
231
235
|
),
|
|
232
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ c(
|
|
233
237
|
Me,
|
|
234
238
|
{
|
|
235
239
|
...j,
|
|
236
|
-
activator: /* @__PURE__ */
|
|
240
|
+
activator: /* @__PURE__ */ c(
|
|
237
241
|
Ue,
|
|
238
242
|
{
|
|
239
243
|
append: oe,
|
|
240
244
|
async: se,
|
|
241
245
|
disabled: p,
|
|
242
246
|
error: ue,
|
|
243
|
-
id:
|
|
247
|
+
id: k,
|
|
244
248
|
loading: pe,
|
|
245
249
|
multiSelect: y,
|
|
246
|
-
multiSelectLimit:
|
|
250
|
+
multiSelectLimit: K,
|
|
247
251
|
onChange: L,
|
|
248
252
|
placeholder: T,
|
|
249
|
-
prepend:
|
|
253
|
+
prepend: l,
|
|
250
254
|
renderLabel: X,
|
|
251
255
|
selectedOptionsText: m,
|
|
252
256
|
setValue: M,
|
|
@@ -256,7 +260,7 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
256
260
|
}
|
|
257
261
|
),
|
|
258
262
|
align: e,
|
|
259
|
-
className: x(r, ae.root,
|
|
263
|
+
className: x(r, ae.root, ce.Select),
|
|
260
264
|
contentClassName: x(ae.popoverContent),
|
|
261
265
|
contentStyle: {
|
|
262
266
|
...j.contentStyle,
|
|
@@ -272,15 +276,15 @@ const we = (e) => typeof e == "object" && e !== null && "label" in e, ie = (e, o
|
|
|
272
276
|
onBlur: xe,
|
|
273
277
|
children: /* @__PURE__ */ O("div", { className: ae.wrapper, children: [
|
|
274
278
|
R,
|
|
275
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ c(
|
|
276
280
|
We,
|
|
277
281
|
{
|
|
278
282
|
autoHighlight: o,
|
|
279
283
|
debouncedQuery: Ae,
|
|
280
284
|
error: ue,
|
|
281
|
-
initialOptions:
|
|
285
|
+
initialOptions: B,
|
|
282
286
|
loading: pe,
|
|
283
|
-
minSearchLength:
|
|
287
|
+
minSearchLength: H,
|
|
284
288
|
multiSelect: y,
|
|
285
289
|
onChange: L,
|
|
286
290
|
options: n,
|
|
@@ -306,23 +310,23 @@ rt.displayName = "IressSelect";
|
|
|
306
310
|
const ot = Se(
|
|
307
311
|
({
|
|
308
312
|
alwaysShowOnFocus: e,
|
|
309
|
-
append: o = /* @__PURE__ */
|
|
313
|
+
append: o = /* @__PURE__ */ c(Ge, { name: "search" }),
|
|
310
314
|
autoComplete: r = "off",
|
|
311
315
|
autoSelect: s = !0,
|
|
312
316
|
className: p,
|
|
313
317
|
clearable: J = !0,
|
|
314
318
|
"data-testid": R,
|
|
315
|
-
debounceThreshold:
|
|
319
|
+
debounceThreshold: k,
|
|
316
320
|
defaultValue: U,
|
|
317
|
-
errorText: y = /* @__PURE__ */
|
|
318
|
-
initialOptions:
|
|
319
|
-
limitDesktop:
|
|
321
|
+
errorText: y = /* @__PURE__ */ c(Je, { status: "danger", mb: "none", borderRadius: "radius.system.form", children: "An unknown error occurred. Please contact support if the error persists." }),
|
|
322
|
+
initialOptions: K,
|
|
323
|
+
limitDesktop: Q = 12,
|
|
320
324
|
limitMobile: L = 6,
|
|
321
325
|
minSearchLength: I,
|
|
322
326
|
noResultsText: n,
|
|
323
327
|
onChange: d,
|
|
324
328
|
onClear: T,
|
|
325
|
-
onFocus:
|
|
329
|
+
onFocus: q,
|
|
326
330
|
options: W,
|
|
327
331
|
popoverProps: {
|
|
328
332
|
autoHighlight: X = !1,
|
|
@@ -349,8 +353,8 @@ const ot = Se(
|
|
|
349
353
|
shouldShowInstructions: S,
|
|
350
354
|
shouldShowNoResults: u
|
|
351
355
|
} = ye({
|
|
352
|
-
debounceThreshold:
|
|
353
|
-
initialOptions:
|
|
356
|
+
debounceThreshold: k,
|
|
357
|
+
initialOptions: K,
|
|
354
358
|
minSearchLength: I,
|
|
355
359
|
options: W,
|
|
356
360
|
query: He(a)
|
|
@@ -360,24 +364,24 @@ const ot = Se(
|
|
|
360
364
|
}, [f.length, w, v, a]), z(() => {
|
|
361
365
|
i && t(!0);
|
|
362
366
|
}, [i]), h)
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
-
const N = (
|
|
365
|
-
d?.(
|
|
366
|
-
}, oe = (
|
|
367
|
-
T?.(
|
|
368
|
-
}, ne = (
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
const m = qe(
|
|
367
|
+
return /* @__PURE__ */ c(Ie, { value: a, variant: h });
|
|
368
|
+
const N = (l, m) => {
|
|
369
|
+
d?.(l, m), A(m), C(!!m);
|
|
370
|
+
}, oe = (l) => {
|
|
371
|
+
T?.(l), A("");
|
|
372
|
+
}, ne = (l) => {
|
|
373
|
+
q?.(l), K?.length && t(!0);
|
|
374
|
+
}, B = (l) => {
|
|
375
|
+
const m = qe(l)?.[0];
|
|
372
376
|
d?.(
|
|
373
377
|
Be(m?.label),
|
|
374
378
|
m?.label,
|
|
375
379
|
m
|
|
376
380
|
), A(m?.label), t(!1), C(!1);
|
|
377
|
-
},
|
|
381
|
+
}, H = () => {
|
|
378
382
|
(!e || !a) && g(), E(), t(!1), a && C(!1);
|
|
379
|
-
},
|
|
380
|
-
F.onKeyDown?.(
|
|
383
|
+
}, G = (l) => {
|
|
384
|
+
F.onKeyDown?.(l), l.key === "ArrowDown" && (!w || !v) && (f.length || re(!0), C(!0), t(!0));
|
|
381
385
|
}, D = Ee({
|
|
382
386
|
isEmpty: f.length === 0 && !i && !S && !u
|
|
383
387
|
});
|
|
@@ -385,7 +389,7 @@ const ot = Se(
|
|
|
385
389
|
je,
|
|
386
390
|
{
|
|
387
391
|
...b,
|
|
388
|
-
activator: /* @__PURE__ */
|
|
392
|
+
activator: /* @__PURE__ */ c(
|
|
389
393
|
Ke,
|
|
390
394
|
{
|
|
391
395
|
...F,
|
|
@@ -397,7 +401,7 @@ const ot = Se(
|
|
|
397
401
|
onChange: N,
|
|
398
402
|
onClear: oe,
|
|
399
403
|
onFocus: ne,
|
|
400
|
-
onKeyDown:
|
|
404
|
+
onKeyDown: G,
|
|
401
405
|
value: a,
|
|
402
406
|
ref: ee
|
|
403
407
|
}
|
|
@@ -407,7 +411,7 @@ const ot = Se(
|
|
|
407
411
|
p,
|
|
408
412
|
b.className,
|
|
409
413
|
D.root,
|
|
410
|
-
|
|
414
|
+
ce.Autocomplete
|
|
411
415
|
),
|
|
412
416
|
contentClassName: x(
|
|
413
417
|
b.contentClassName,
|
|
@@ -417,30 +421,30 @@ const ot = Se(
|
|
|
417
421
|
"data-testid": R,
|
|
418
422
|
minLength: 0,
|
|
419
423
|
onActivated: () => (v || e) && t(!0),
|
|
420
|
-
onDeactivated:
|
|
424
|
+
onDeactivated: H,
|
|
421
425
|
show: w,
|
|
422
426
|
type: "listbox",
|
|
423
427
|
focusStartIndex: 0,
|
|
424
428
|
children: [
|
|
425
429
|
f.length > 0 && /* @__PURE__ */ O(ge, { children: [
|
|
426
430
|
Z,
|
|
427
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ c(
|
|
428
432
|
ze,
|
|
429
433
|
{
|
|
430
434
|
changeOnBlur: s,
|
|
431
435
|
className: x(D.optionList),
|
|
432
436
|
"data-testid": de(R, "menu"),
|
|
433
437
|
items: f,
|
|
434
|
-
limitDesktop:
|
|
438
|
+
limitDesktop: Q,
|
|
435
439
|
limitMobile: L,
|
|
436
|
-
onChange:
|
|
440
|
+
onChange: B,
|
|
437
441
|
selected: { label: te }
|
|
438
442
|
}
|
|
439
443
|
),
|
|
440
444
|
Y
|
|
441
445
|
] }),
|
|
442
446
|
i && y,
|
|
443
|
-
S && !i && /* @__PURE__ */
|
|
447
|
+
S && !i && /* @__PURE__ */ c(Oe, { minSearchLength: I ?? 1 }),
|
|
444
448
|
u && !i && n
|
|
445
449
|
]
|
|
446
450
|
}
|
|
@@ -28,7 +28,7 @@ import "./components/Icon/Icon.styles.js";
|
|
|
28
28
|
import "./components/Icon/IconProvider.js";
|
|
29
29
|
import "./components/Alert/Alert.js";
|
|
30
30
|
import "./components/Alert/Alert.styles.js";
|
|
31
|
-
import "./Autocomplete-
|
|
31
|
+
import "./Autocomplete-B8Ac_bPk.js";
|
|
32
32
|
import "./components/Autocomplete/Autocomplete.styles.js";
|
|
33
33
|
import "./highlightQueryInLabel-Cx7nIoII.js";
|
|
34
34
|
import "./components/ButtonGroup/ButtonGroup.js";
|
|
@@ -16,7 +16,7 @@ import "../../helpers/form/getFormControlValueAsStringIfDefined.js";
|
|
|
16
16
|
import "./hooks/useAutocompleteSearch.js";
|
|
17
17
|
import "../Icon/Icon.js";
|
|
18
18
|
import "./components/AutocompleteInstructions.js";
|
|
19
|
-
import { I as J } from "../../Autocomplete-
|
|
19
|
+
import { I as J } from "../../Autocomplete-B8Ac_bPk.js";
|
|
20
20
|
import "../Select/SelectBody/SelectBody.js";
|
|
21
21
|
import "../Select/SelectCreate/SelectCreate.js";
|
|
22
22
|
import "../Select/SelectHeading/SelectHeading.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { MATERIAL_SYMBOLS } from '
|
|
1
|
+
export { MATERIAL_SYMBOLS } from '../../constants';
|
|
@@ -2,7 +2,7 @@ import { jsxs as I, jsx as p } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as h, useState as w, useCallback as x } from "react";
|
|
3
3
|
import { FontLoader as y } from "./components/FontLoader.js";
|
|
4
4
|
import { useDynamicFontSubsetting as L } from "./hooks/useDynamicFontSubsetting.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MATERIAL_SYMBOLS as s } from "../../constants.js";
|
|
6
6
|
const F = h(null), $ = ({
|
|
7
7
|
children: n,
|
|
8
8
|
container: i,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { IressIcon as e } from "./Icon.js";
|
|
2
|
-
import {
|
|
3
|
-
import { icon as
|
|
2
|
+
import { MATERIAL_SYMBOLS as f } from "../../constants.js";
|
|
3
|
+
import { icon as p } from "./Icon.styles.js";
|
|
4
4
|
import { IressIconProvider as t } from "./IconProvider.js";
|
|
5
5
|
export {
|
|
6
6
|
e as IressIcon,
|
|
7
7
|
t as IressIconProvider,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
f as MATERIAL_SYMBOLS,
|
|
9
|
+
p as icon
|
|
10
10
|
};
|
|
@@ -13,12 +13,12 @@ import { NativeSelectProps } from './components/NativeSelect';
|
|
|
13
13
|
type SelectValue<TMultiple extends boolean = false, TNative extends boolean | Breakpoints = false> = TNative extends false ? ControlledValue<LabelValueMeta, TMultiple> | ControlledValue<FormControlValue, TMultiple> : LabelValueMeta | FormControlValue;
|
|
14
14
|
type SelectChangeEvent<TMultiple extends boolean = false, TNative extends boolean | Breakpoints = false> = TNative extends false ? (e: ChangeEvent<HTMLElement> & {
|
|
15
15
|
currentTarget: {
|
|
16
|
-
value?:
|
|
16
|
+
value?: ControlledValue<FormControlValue, TMultiple>;
|
|
17
17
|
};
|
|
18
18
|
target: {
|
|
19
|
-
value?:
|
|
19
|
+
value?: ControlledValue<FormControlValue, TMultiple>;
|
|
20
20
|
};
|
|
21
|
-
}, value?:
|
|
21
|
+
}, value?: ControlledValue<FormControlValue, TMultiple>, labelValue?: ControlledValue<LabelValueMeta, TMultiple>) => void : (e: ChangeEvent<HTMLSelectElement>, value?: ControlledValue<FormControlValue, TMultiple>, labelValue?: ControlledValue<LabelValueMeta, TMultiple>) => void;
|
|
22
22
|
export type SelectRef<TNative extends boolean | Breakpoints = false> = TNative extends false ? Partial<PopoverRef> & ReactHookFormCompatibleRef : ReactHookFormCompatibleRef<HTMLSelectElement>;
|
|
23
23
|
type SelectProps<TNative extends boolean | Breakpoints = false> = TNative extends false ? Omit<IressPopoverProps, 'activator' | 'children' | 'contentClassName' | 'defaultShow' | 'defaultValue' | 'onChange' | 'matchActivatorWidth' | 'show' | 'width'> & Omit<AutocompleteSearchHookProps, 'disabled' | 'query'> & Pick<IressSelectActivatorProps, 'append' | 'prepend' | 'selectedOptionsText'> : Omit<NativeSelectProps, 'value' | 'onChange' | 'options'>;
|
|
24
24
|
export type IressSelectProps<TMultiple extends boolean = false, TNative extends boolean | Breakpoints = false> = SelectProps<TNative> & {
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../cx-DN21T1EH.js";
|
|
4
4
|
import "./Select.styles.js";
|
|
5
|
-
import { a as u } from "../../Autocomplete-
|
|
5
|
+
import { a as u } from "../../Autocomplete-B8Ac_bPk.js";
|
|
6
6
|
import "../Autocomplete/Autocomplete.styles.js";
|
|
7
7
|
import "../Autocomplete/hooks/useAutocompleteSearch.js";
|
|
8
8
|
import "./components/SelectActivator.js";
|
|
@@ -1,71 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { toArray as
|
|
3
|
-
import { IressSelectLabel as
|
|
4
|
-
import { IressSelectTags as
|
|
5
|
-
import { getValueAsEvent as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { toArray as j } from "../../../helpers/formatting/toArray.js";
|
|
3
|
+
import { IressSelectLabel as w } from "../SelectLabel/SelectLabel.js";
|
|
4
|
+
import { IressSelectTags as E } from "../SelectTags/SelectTags.js";
|
|
5
|
+
import { getValueAsEvent as b } from "../../../helpers/form/getValueAsEvent.js";
|
|
6
|
+
import { toPrimitiveValue as g } from "../helpers/toPrimitiveValue.js";
|
|
7
|
+
const N = ({
|
|
8
|
+
append: i,
|
|
9
|
+
async: u,
|
|
10
|
+
id: l,
|
|
11
|
+
disabled: m,
|
|
12
|
+
error: S,
|
|
12
13
|
loading: x,
|
|
13
14
|
multiSelect: y,
|
|
14
15
|
multiSelectLimit: D,
|
|
15
|
-
onChange:
|
|
16
|
-
placeholder:
|
|
17
|
-
prepend:
|
|
16
|
+
onChange: c,
|
|
17
|
+
placeholder: s,
|
|
18
|
+
prepend: f,
|
|
18
19
|
renderLabel: n,
|
|
19
20
|
selectedOptionsText: A,
|
|
20
21
|
setShow: a,
|
|
21
|
-
setValue:
|
|
22
|
+
setValue: e,
|
|
22
23
|
show: I,
|
|
23
|
-
value:
|
|
24
|
+
value: r
|
|
24
25
|
}) => n ? n({
|
|
25
26
|
close: () => a(!1),
|
|
26
|
-
disabled:
|
|
27
|
-
error:
|
|
27
|
+
disabled: m,
|
|
28
|
+
error: S,
|
|
28
29
|
loading: x,
|
|
29
|
-
setValue:
|
|
30
|
+
setValue: e,
|
|
30
31
|
show: I,
|
|
31
|
-
value:
|
|
32
|
-
}) : y ? /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
value: r
|
|
33
|
+
}) : y ? /* @__PURE__ */ v(
|
|
34
|
+
E,
|
|
34
35
|
{
|
|
35
|
-
append:
|
|
36
|
-
id:
|
|
36
|
+
append: i,
|
|
37
|
+
id: l,
|
|
37
38
|
limit: D,
|
|
38
|
-
onDelete: (
|
|
39
|
-
if (!
|
|
40
|
-
const
|
|
41
|
-
(
|
|
39
|
+
onDelete: (t) => {
|
|
40
|
+
if (!t) return;
|
|
41
|
+
const o = j(r).filter(
|
|
42
|
+
(V) => V.label !== t.label
|
|
42
43
|
);
|
|
43
|
-
|
|
44
|
+
e(o);
|
|
45
|
+
const p = g(o);
|
|
46
|
+
c?.(b(p), p, o);
|
|
44
47
|
},
|
|
45
48
|
onDeleteAll: () => {
|
|
46
|
-
const
|
|
47
|
-
|
|
49
|
+
const t = [];
|
|
50
|
+
e(t);
|
|
51
|
+
const o = g(t);
|
|
52
|
+
c?.(b(o), o, t);
|
|
48
53
|
},
|
|
49
54
|
onToggleActions: () => a(!1),
|
|
50
|
-
placeholder:
|
|
51
|
-
prepend:
|
|
52
|
-
selected:
|
|
55
|
+
placeholder: s,
|
|
56
|
+
prepend: f,
|
|
57
|
+
selected: r,
|
|
53
58
|
selectedOptionsText: A
|
|
54
59
|
}
|
|
55
|
-
) : /* @__PURE__ */
|
|
56
|
-
|
|
60
|
+
) : /* @__PURE__ */ v(
|
|
61
|
+
w,
|
|
57
62
|
{
|
|
58
|
-
append:
|
|
59
|
-
id:
|
|
60
|
-
disabled:
|
|
61
|
-
placeholder:
|
|
62
|
-
prepend:
|
|
63
|
-
role:
|
|
64
|
-
selected:
|
|
63
|
+
append: i,
|
|
64
|
+
id: l,
|
|
65
|
+
disabled: m,
|
|
66
|
+
placeholder: s,
|
|
67
|
+
prepend: f,
|
|
68
|
+
role: u ? void 0 : "combobox",
|
|
69
|
+
selected: r,
|
|
65
70
|
selectedOptionsText: A
|
|
66
71
|
}
|
|
67
72
|
);
|
|
68
|
-
|
|
73
|
+
N.displayName = "SelectActivator";
|
|
69
74
|
export {
|
|
70
|
-
|
|
75
|
+
N as SelectActivator
|
|
71
76
|
};
|