@viasat/beam-react 2.29.1 → 2.36.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/assets/ActionList.css +1 -1
- package/assets/Avatar.css +1 -1
- package/assets/Badge.css +1 -1
- package/assets/Button.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/Chip.css +1 -1
- package/assets/ChipGroup.css +1 -1
- package/assets/CloseButton.css +1 -1
- package/assets/DateField.css +1 -0
- package/assets/EmptyState.css +1 -1
- package/assets/{floatingui.css → FloatingUI.css} +1 -1
- package/assets/InputChoiceGroup.css +1 -1
- package/assets/Link.css +1 -1
- package/assets/NativeSelect.css +1 -1
- package/assets/Pagination.css +1 -1
- package/assets/ProgressBar.css +1 -1
- package/assets/RadioButton.css +1 -1
- package/assets/Search.css +1 -1
- package/assets/SpinnerWrap.css +1 -1
- package/assets/Switch.css +1 -1
- package/assets/TextArea.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/card.css +1 -1
- package/assets/combobox.css +1 -1
- package/assets/fileUpload.css +1 -1
- package/assets/header.css +1 -1
- package/assets/index.css +1 -1
- package/assets/panel.css +1 -1
- package/assets/segmentedControl.css +1 -1
- package/assets/slider.css +1 -1
- package/assets/stepper.css +1 -1
- package/chunks/DateField.Segment.7oCeBSNo.js +1 -0
- package/chunks/DateField.Segment.DbjGMAPP.js +99 -0
- package/chunks/FloatingUI.arrow.DFhYQv_F.js +1 -0
- package/chunks/FloatingUI.arrow.tN5_IctZ.js +27 -0
- package/chunks/panel.module.BVmRxZHo.js +1 -0
- package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
- package/index.cjs.js +1 -1
- package/index.es.js +35 -33
- package/lib/ActionList/ActionList.Group.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +5 -5
- package/lib/Autocomplete/Autocomplete.es.js +296 -268
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +15 -12
- package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.es.js +6 -17
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +17 -18
- package/lib/Search/SearchDropdown.cjs.js +1 -1
- package/lib/Search/SearchDropdown.es.js +1 -1
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.d.ts +3 -2
- package/lib/Select/Select.es.js +208 -195
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +15 -12
- package/lib/_Options/Option.cjs.js +1 -1
- package/lib/_Options/Option.context.cjs.js +1 -1
- package/lib/_Options/Option.context.d.ts +31 -13
- package/lib/_Options/Option.context.es.js +133 -88
- package/lib/_Options/Option.es.js +23 -21
- package/lib/_Options/Option.types.d.ts +23 -0
- package/lib/_Options/OptionGroup.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.d.ts +6 -0
- package/lib/_Options/OptionGroup.context.es.js +6 -0
- package/lib/_Options/OptionGroup.d.ts +3 -0
- package/lib/_Options/OptionGroup.es.js +22 -0
- package/lib/_Options/getLastVisibleStructureIndex.cjs.js +1 -0
- package/lib/_Options/getLastVisibleStructureIndex.d.ts +15 -0
- package/lib/_Options/getLastVisibleStructureIndex.es.js +14 -0
- package/lib/_Options/index.cjs.js +1 -1
- package/lib/_Options/index.d.ts +4 -0
- package/lib/_Options/index.es.js +13 -4
- package/lib/_Options/useRenderOption.cjs.js +1 -0
- package/lib/_Options/useRenderOption.d.ts +30 -0
- package/lib/_Options/useRenderOption.es.js +43 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +27 -25
- package/lib/wip/DateField/DateField.Segment.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segment.d.ts +2 -0
- package/lib/wip/DateField/DateField.Segment.es.js +8 -0
- package/lib/wip/DateField/DateField.Segments.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segments.d.ts +17 -0
- package/lib/wip/DateField/DateField.Segments.es.js +61 -0
- package/lib/wip/DateField/DateField.cjs.js +1 -0
- package/lib/wip/DateField/DateField.d.ts +3 -0
- package/lib/wip/DateField/DateField.es.js +191 -0
- package/lib/wip/DateField/DateField.types.cjs.js +1 -0
- package/lib/wip/DateField/DateField.types.d.ts +118 -0
- package/lib/wip/DateField/DateField.types.es.js +1 -0
- package/lib/wip/DateField/DateField.utils.cjs.js +1 -0
- package/lib/wip/DateField/DateField.utils.d.ts +26 -0
- package/lib/wip/DateField/DateField.utils.es.js +45 -0
- package/lib/wip/DateField/DateField.validation.cjs.js +1 -0
- package/lib/wip/DateField/DateField.validation.d.ts +26 -0
- package/lib/wip/DateField/DateField.validation.es.js +24 -0
- package/lib/wip/DateField/index.cjs.js +1 -0
- package/lib/wip/DateField/index.d.ts +2 -0
- package/lib/wip/DateField/index.es.js +4 -0
- package/lib/wip/DateField/useDateFieldFocus.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldFocus.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldFocus.es.js +65 -0
- package/lib/wip/DateField/useDateFieldForm.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldForm.d.ts +32 -0
- package/lib/wip/DateField/useDateFieldForm.es.js +51 -0
- package/lib/wip/DateField/useDateFieldSegments.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldSegments.d.ts +7 -0
- package/lib/wip/DateField/useDateFieldSegments.es.js +13 -0
- package/lib/wip/DateField/useDateFieldValidity.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValidity.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldValidity.es.js +19 -0
- package/lib/wip/DateField/useDateFieldValue.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValue.d.ts +19 -0
- package/lib/wip/DateField/useDateFieldValue.es.js +62 -0
- package/lib/wip/DateField/useInvalidState.cjs.js +1 -0
- package/lib/wip/DateField/useInvalidState.d.ts +13 -0
- package/lib/wip/DateField/useInvalidState.es.js +8 -0
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.es.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.es.js +1 -1
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.es.js +1 -1
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +5 -1
- package/lib/wip/Panel/Panel.Inline.es.js +54 -47
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +20 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +117 -80
- package/lib/wip/Panel/Panel.ResizeHandle.cjs.js +1 -1
- package/lib/wip/Panel/Panel.ResizeHandle.es.js +1 -1
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +1 -1
- package/lib/wip/Panel/Panel.es.js +139 -100
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +2 -1
- package/lib/wip/Panel/Panel.helpers.es.js +37 -35
- package/lib/wip/Panel/Panel.types.d.ts +64 -10
- package/lib/wip/Panel/Panel.useResize.cjs.js +1 -1
- package/lib/wip/Panel/Panel.useResize.d.ts +3 -1
- package/lib/wip/Panel/Panel.useResize.es.js +34 -30
- package/package.json +6 -6
- package/utils/hooks/index.cjs.js +1 -1
- package/utils/hooks/index.d.ts +1 -0
- package/utils/hooks/index.es.js +12 -10
- package/utils/hooks/useElementResize.cjs.js +1 -1
- package/utils/hooks/useElementResize.d.ts +1 -1
- package/utils/hooks/useElementResize.es.js +33 -33
- package/utils/hooks/usePrevious.cjs.js +1 -0
- package/utils/hooks/usePrevious.d.ts +5 -0
- package/utils/hooks/usePrevious.es.js +10 -0
- package/chunks/floatingui.module.BcBFebz0.js +0 -10
- package/chunks/floatingui.module.D3Aw_aYe.js +0 -1
- package/chunks/panel.module.CVyUzyCZ.js +0 -1
|
@@ -1,298 +1,325 @@
|
|
|
1
|
-
import { jsxs as C, jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { t as tt } from "../../chunks/constants.CKKGf1-i.js";
|
|
1
|
+
import { jsxs as C, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { g as st } from "../../chunks/classNames.BTJmrO_L.js";
|
|
3
|
+
import { t as it } from "../../chunks/constants.CKKGf1-i.js";
|
|
5
4
|
import { s as r } from "../../chunks/combobox.module.D_HXP875.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
|
|
5
|
+
import lt from "clsx";
|
|
6
|
+
import nt, { useCallback as at, useState as dt, useMemo as h, useRef as pt } from "react";
|
|
7
|
+
import { b as ct, H as ut } from "../../chunks/form.context.D7b4066_.js";
|
|
8
|
+
import { LabelProvider as mt } from "../Form/contexts/label.context.es.js";
|
|
9
|
+
import { HelperTextProvider as ft } from "../Form/contexts/helperText.context.es.js";
|
|
10
|
+
import { ActionList as Q } from "../ActionList/ActionList.es.js";
|
|
11
|
+
import { useCreateOptionsContext as bt, OptionsProvider as ht } from "../_Options/Option.context.es.js";
|
|
12
|
+
import { Option as xt } from "../_Options/Option.es.js";
|
|
13
|
+
import { OptionGroup as gt } from "../_Options/OptionGroup.es.js";
|
|
14
|
+
import "../_Options/OptionGroup.context.es.js";
|
|
15
|
+
import { getLastVisibleStructureIndex as yt } from "../_Options/getLastVisibleStructureIndex.es.js";
|
|
16
|
+
import { useRenderOption as vt } from "../_Options/useRenderOption.es.js";
|
|
17
|
+
import { useSelectValue as Ot } from "../_Options/useSelectValue.es.js";
|
|
18
|
+
import { useAutocompleteDropdown as Ct } from "./useAutocompleteDropdown.es.js";
|
|
19
|
+
import { AutocompleteDropdown as It } from "./AutocompleteDropdown.es.js";
|
|
20
|
+
import { useAutocompleteChips as Pt } from "./useAutocompleteChips.es.js";
|
|
21
|
+
import { useAutocompleteKeyboardManager as At } from "./useAutocompleteKeyboardManager.es.js";
|
|
22
|
+
import St from "./utils/filterOptions.es.js";
|
|
23
|
+
import Bt from "./useClearSelection.es.js";
|
|
24
|
+
import { AutocompleteField as Vt } from "./AutocompleteField.es.js";
|
|
25
|
+
import $t from "./useAutocompleteA11y.es.js";
|
|
26
|
+
import { useAutocompleteInteractions as Nt } from "./useAutocompleteInteractions.es.js";
|
|
27
|
+
import { createSelectionStrategy as wt } from "../_Options/strategies/SelectionStrategy.es.js";
|
|
28
|
+
import { OptionChips as Rt } from "../_Options/OptionChips.es.js";
|
|
29
|
+
const { baseClassNamePrefix: Dt, subElementClassPrefix: L, classModifierPrefix: a } = st("combobox"), Ft = nt.forwardRef(
|
|
26
30
|
({
|
|
27
|
-
theme:
|
|
28
|
-
width:
|
|
29
|
-
error:
|
|
30
|
-
children:
|
|
31
|
-
label:
|
|
32
|
-
contentBefore:
|
|
33
|
-
contentAfter:
|
|
34
|
-
fluid:
|
|
35
|
-
helperText:
|
|
36
|
-
validationRules:
|
|
37
|
-
className:
|
|
38
|
-
hideRequiredMarker:
|
|
39
|
-
disabled:
|
|
40
|
-
readOnly:
|
|
41
|
-
required:
|
|
42
|
-
placeholder:
|
|
43
|
-
onChange:
|
|
44
|
-
noResultsText:
|
|
45
|
-
optionFilter:
|
|
46
|
-
hideChevron:
|
|
47
|
-
...
|
|
48
|
-
},
|
|
31
|
+
theme: I,
|
|
32
|
+
width: U,
|
|
33
|
+
error: p,
|
|
34
|
+
children: X,
|
|
35
|
+
label: Y = null,
|
|
36
|
+
contentBefore: Z,
|
|
37
|
+
contentAfter: ee,
|
|
38
|
+
fluid: te = !1,
|
|
39
|
+
helperText: q = null,
|
|
40
|
+
validationRules: oe = [],
|
|
41
|
+
className: re,
|
|
42
|
+
hideRequiredMarker: se = !1,
|
|
43
|
+
disabled: ie = !1,
|
|
44
|
+
readOnly: le = !1,
|
|
45
|
+
required: ne = !1,
|
|
46
|
+
placeholder: ae = "",
|
|
47
|
+
onChange: x,
|
|
48
|
+
noResultsText: de = "No results found",
|
|
49
|
+
optionFilter: P,
|
|
50
|
+
hideChevron: pe = !1,
|
|
51
|
+
...g
|
|
52
|
+
}, ce) => {
|
|
49
53
|
const {
|
|
50
|
-
id:
|
|
51
|
-
name:
|
|
52
|
-
"aria-describedby":
|
|
53
|
-
multiple:
|
|
54
|
-
clearable:
|
|
55
|
-
...
|
|
56
|
-
} =
|
|
57
|
-
name:
|
|
58
|
-
validationRules:
|
|
59
|
-
disabledProp:
|
|
60
|
-
readOnlyProp:
|
|
61
|
-
requiredProp:
|
|
62
|
-
}), { aria:
|
|
63
|
-
helperText:
|
|
64
|
-
externalDescribedBy:
|
|
65
|
-
error:
|
|
66
|
-
errorShown:
|
|
67
|
-
invalid: !!
|
|
68
|
-
}), { helperTextId:
|
|
69
|
-
(
|
|
70
|
-
|
|
54
|
+
id: H,
|
|
55
|
+
name: ue,
|
|
56
|
+
"aria-describedby": me,
|
|
57
|
+
multiple: t = !1,
|
|
58
|
+
clearable: fe = t,
|
|
59
|
+
...be
|
|
60
|
+
} = g, { showErrors: he, isInvalid: xe, errorShown: ge, disabled: o, readOnly: i, required: A } = ct({
|
|
61
|
+
name: ue,
|
|
62
|
+
validationRules: oe,
|
|
63
|
+
disabledProp: ie,
|
|
64
|
+
readOnlyProp: le,
|
|
65
|
+
requiredProp: ne
|
|
66
|
+
}), { aria: y, ids: ye } = $t({
|
|
67
|
+
helperText: q,
|
|
68
|
+
externalDescribedBy: me,
|
|
69
|
+
error: p,
|
|
70
|
+
errorShown: ge,
|
|
71
|
+
invalid: !!p || xe
|
|
72
|
+
}), { helperTextId: ve, errorId: Oe, validationErrorsId: Ce, labelId: S } = ye, Ie = !!(p != null && p.length), Pe = at(
|
|
73
|
+
(e) => {
|
|
74
|
+
x == null || x(e);
|
|
71
75
|
},
|
|
72
|
-
[
|
|
76
|
+
[x]
|
|
73
77
|
), {
|
|
74
|
-
value:
|
|
75
|
-
setValue:
|
|
76
|
-
selectProps:
|
|
77
|
-
handleBlur:
|
|
78
|
-
singleValue:
|
|
79
|
-
} =
|
|
80
|
-
optionsContext:
|
|
81
|
-
optionIds:
|
|
82
|
-
optionsProps:
|
|
83
|
-
selectedOptionsProps:
|
|
84
|
-
deselectOptionValue:
|
|
85
|
-
getOptionByIndex:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
78
|
+
value: u,
|
|
79
|
+
setValue: k,
|
|
80
|
+
selectProps: Ae,
|
|
81
|
+
handleBlur: Se,
|
|
82
|
+
singleValue: B
|
|
83
|
+
} = Ot({ onChange: Pe, ...g }, ce), [m, V] = dt(null), $ = !m && (!u || Array.isArray(u) && !u.length), {
|
|
84
|
+
optionsContext: Be,
|
|
85
|
+
optionIds: d,
|
|
86
|
+
optionsProps: f,
|
|
87
|
+
selectedOptionsProps: N,
|
|
88
|
+
deselectOptionValue: T,
|
|
89
|
+
getOptionByIndex: Ve,
|
|
90
|
+
structureIds: w,
|
|
91
|
+
groupsProps: R,
|
|
92
|
+
optionGroupOf: j,
|
|
93
|
+
optionIdsByGroup: D
|
|
94
|
+
} = bt(u, k, t), $e = h(() => {
|
|
95
|
+
if (!B) return;
|
|
96
|
+
const e = d.map((s) => f.get(s)).findIndex((s) => (s == null ? void 0 : s.value) === B);
|
|
97
|
+
return e !== -1 ? e : void 0;
|
|
98
|
+
}, [d, f, B]), F = pt(null), {
|
|
99
|
+
getFieldProps: Ne,
|
|
100
|
+
getInputProps: we,
|
|
101
|
+
dropdownProps: Re,
|
|
102
|
+
refs: De,
|
|
103
|
+
open: K,
|
|
104
|
+
setOpen: v,
|
|
105
|
+
status: Fe,
|
|
106
|
+
setDisplayActiveIndex: Ge
|
|
107
|
+
} = Ct({
|
|
108
|
+
disabled: o,
|
|
109
|
+
readOnly: i,
|
|
110
|
+
lastSelectedOptionIndex: $e,
|
|
111
|
+
fieldRef: F
|
|
112
|
+
}), O = De.domReference, Ee = lt(
|
|
113
|
+
r[Dt],
|
|
114
|
+
I && it(I),
|
|
115
|
+
te && r[`${a}fluid`],
|
|
116
|
+
y.invalid && r[`${a}error`],
|
|
117
|
+
o && r[`${a}disabled`],
|
|
118
|
+
i && r[`${a}read-only`],
|
|
119
|
+
$ && r[`${a}empty`],
|
|
120
|
+
t && r[`${a}multiple`],
|
|
113
121
|
r[`${a}autocomplete`],
|
|
114
|
-
r[`${a}dropdown-${
|
|
115
|
-
|
|
116
|
-
), { canClear:
|
|
117
|
-
multiple:
|
|
118
|
-
clearable:
|
|
119
|
-
isEmpty:
|
|
120
|
-
disabled:
|
|
121
|
-
readOnly:
|
|
122
|
-
setValue:
|
|
123
|
-
setSearchText:
|
|
124
|
-
inputRef:
|
|
125
|
-
setOpen:
|
|
122
|
+
r[`${a}dropdown-${Fe}`],
|
|
123
|
+
re
|
|
124
|
+
), { canClear: Le, handleClear: Me } = Bt({
|
|
125
|
+
multiple: t,
|
|
126
|
+
clearable: fe,
|
|
127
|
+
isEmpty: $,
|
|
128
|
+
disabled: o,
|
|
129
|
+
readOnly: i,
|
|
130
|
+
setValue: k,
|
|
131
|
+
setSearchText: V,
|
|
132
|
+
inputRef: O,
|
|
133
|
+
setOpen: v
|
|
126
134
|
}), {
|
|
127
|
-
chipGroupProps:
|
|
128
|
-
handleBlur:
|
|
129
|
-
selectedChip:
|
|
130
|
-
setSelectedChip:
|
|
131
|
-
enabled:
|
|
132
|
-
selectPreviousChip:
|
|
133
|
-
selectNextChip:
|
|
134
|
-
options:
|
|
135
|
-
deselectOptionValue:
|
|
136
|
-
} =
|
|
137
|
-
multiple:
|
|
138
|
-
disabled:
|
|
139
|
-
readOnly:
|
|
140
|
-
open:
|
|
141
|
-
setOpen:
|
|
142
|
-
options:
|
|
143
|
-
deselectOptionValue:
|
|
144
|
-
fieldRef:
|
|
145
|
-
inputRef:
|
|
146
|
-
}), { getKeyboardProps:
|
|
147
|
-
multiple:
|
|
148
|
-
disabled:
|
|
149
|
-
readOnly:
|
|
150
|
-
open:
|
|
151
|
-
setOpen:
|
|
152
|
-
inputRef:
|
|
153
|
-
fieldRef:
|
|
135
|
+
chipGroupProps: qe,
|
|
136
|
+
handleBlur: He,
|
|
137
|
+
selectedChip: ke,
|
|
138
|
+
setSelectedChip: Te,
|
|
139
|
+
enabled: je,
|
|
140
|
+
selectPreviousChip: Ke,
|
|
141
|
+
selectNextChip: We,
|
|
142
|
+
options: _e,
|
|
143
|
+
deselectOptionValue: ze
|
|
144
|
+
} = Pt({
|
|
145
|
+
multiple: t,
|
|
146
|
+
disabled: o,
|
|
147
|
+
readOnly: i,
|
|
148
|
+
open: K,
|
|
149
|
+
setOpen: v,
|
|
150
|
+
options: N,
|
|
151
|
+
deselectOptionValue: T,
|
|
152
|
+
fieldRef: F,
|
|
153
|
+
inputRef: O
|
|
154
|
+
}), { getKeyboardProps: W } = At({
|
|
155
|
+
multiple: t,
|
|
156
|
+
disabled: o,
|
|
157
|
+
readOnly: i,
|
|
158
|
+
open: K,
|
|
159
|
+
setOpen: v,
|
|
160
|
+
inputRef: O,
|
|
161
|
+
fieldRef: F,
|
|
154
162
|
chips: {
|
|
155
|
-
enabled:
|
|
156
|
-
selectedChip:
|
|
157
|
-
setSelectedChip:
|
|
158
|
-
selectPreviousChip:
|
|
159
|
-
selectNextChip:
|
|
160
|
-
options:
|
|
161
|
-
deselectOptionValue:
|
|
163
|
+
enabled: je,
|
|
164
|
+
selectedChip: ke,
|
|
165
|
+
setSelectedChip: Te,
|
|
166
|
+
selectPreviousChip: Ke,
|
|
167
|
+
selectNextChip: We,
|
|
168
|
+
options: _e,
|
|
169
|
+
deselectOptionValue: ze
|
|
162
170
|
}
|
|
163
|
-
}),
|
|
164
|
-
() =>
|
|
165
|
-
[
|
|
166
|
-
), { handleBlur:
|
|
167
|
-
selectionStrategy:
|
|
168
|
-
selectedOptions:
|
|
169
|
-
inputRef:
|
|
170
|
-
blurSelect:
|
|
171
|
-
blurChips:
|
|
172
|
-
setSearchText:
|
|
173
|
-
setOpen:
|
|
174
|
-
searchText:
|
|
175
|
-
getOptionByIndex:
|
|
176
|
-
setDisplayActiveIndex:
|
|
177
|
-
}),
|
|
178
|
-
() =>
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
182
|
-
return
|
|
171
|
+
}), _ = h(
|
|
172
|
+
() => wt(t),
|
|
173
|
+
[t]
|
|
174
|
+
), { handleBlur: Je, handleFocus: Qe, handleItemClick: Ue } = Nt({
|
|
175
|
+
selectionStrategy: _,
|
|
176
|
+
selectedOptions: N,
|
|
177
|
+
inputRef: O,
|
|
178
|
+
blurSelect: Se,
|
|
179
|
+
blurChips: He,
|
|
180
|
+
setSearchText: V,
|
|
181
|
+
setOpen: v,
|
|
182
|
+
searchText: m,
|
|
183
|
+
getOptionByIndex: Ve,
|
|
184
|
+
setDisplayActiveIndex: Ge
|
|
185
|
+
}), c = h(
|
|
186
|
+
() => d.reduce((e, s) => {
|
|
187
|
+
const l = f.get(s);
|
|
188
|
+
if (!l) return e;
|
|
189
|
+
const b = j.get(s), J = b ? R.get(b) : void 0, G = P ? P(l, m, J) : St(l, m);
|
|
190
|
+
return e[s] = G, e;
|
|
183
191
|
}, {}),
|
|
184
|
-
[
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
[
|
|
193
|
+
d,
|
|
194
|
+
f,
|
|
195
|
+
m,
|
|
196
|
+
P,
|
|
197
|
+
j,
|
|
198
|
+
R
|
|
199
|
+
]
|
|
200
|
+
), Xe = h(() => d.length === 0 ? !1 : d.every((e) => c[e]), [d, c]), Ye = h(
|
|
201
|
+
() => yt(
|
|
202
|
+
w,
|
|
203
|
+
D,
|
|
204
|
+
c
|
|
205
|
+
),
|
|
206
|
+
[w, D, c]
|
|
207
|
+
), z = vt({
|
|
208
|
+
optionsProps: f,
|
|
209
|
+
selectionStrategy: _,
|
|
210
|
+
value: u,
|
|
211
|
+
multiple: t,
|
|
212
|
+
optionClassName: r[`${L}option`],
|
|
213
|
+
filteredOptionsById: c
|
|
214
|
+
}), { ref: Ze, ...et } = W(Ne()), tt = W(we());
|
|
215
|
+
return /* @__PURE__ */ C(ht, { value: Be, children: [
|
|
216
|
+
/* @__PURE__ */ C("div", { className: Ee, style: { maxWidth: U }, children: [
|
|
217
|
+
/* @__PURE__ */ n(
|
|
218
|
+
mt,
|
|
190
219
|
{
|
|
191
|
-
ctxHtmlFor:
|
|
192
|
-
ctxDisabled:
|
|
193
|
-
ctxRequired:
|
|
194
|
-
ctxId:
|
|
195
|
-
children:
|
|
220
|
+
ctxHtmlFor: H,
|
|
221
|
+
ctxDisabled: o,
|
|
222
|
+
ctxRequired: A && !se,
|
|
223
|
+
ctxId: S,
|
|
224
|
+
children: Y
|
|
196
225
|
}
|
|
197
226
|
),
|
|
198
|
-
/* @__PURE__ */
|
|
199
|
-
|
|
227
|
+
/* @__PURE__ */ n(
|
|
228
|
+
Vt,
|
|
200
229
|
{
|
|
201
|
-
id:
|
|
202
|
-
disabled:
|
|
203
|
-
readOnly:
|
|
204
|
-
required:
|
|
205
|
-
contentBefore:
|
|
206
|
-
contentAfter:
|
|
207
|
-
chips: /* @__PURE__ */
|
|
208
|
-
|
|
230
|
+
id: H,
|
|
231
|
+
disabled: o,
|
|
232
|
+
readOnly: i,
|
|
233
|
+
required: A,
|
|
234
|
+
contentBefore: Z,
|
|
235
|
+
contentAfter: ee,
|
|
236
|
+
chips: /* @__PURE__ */ n(
|
|
237
|
+
Rt,
|
|
209
238
|
{
|
|
210
|
-
multiple:
|
|
211
|
-
disabled:
|
|
212
|
-
readOnly:
|
|
213
|
-
selectedOptions:
|
|
214
|
-
deselectOptionValue:
|
|
215
|
-
chipGroupProps:
|
|
216
|
-
input: /* @__PURE__ */
|
|
239
|
+
multiple: t,
|
|
240
|
+
disabled: o,
|
|
241
|
+
readOnly: i,
|
|
242
|
+
selectedOptions: N,
|
|
243
|
+
deselectOptionValue: T,
|
|
244
|
+
chipGroupProps: qe,
|
|
245
|
+
input: /* @__PURE__ */ n(
|
|
217
246
|
"input",
|
|
218
247
|
{
|
|
219
|
-
className: r[`${
|
|
220
|
-
"aria-readonly":
|
|
221
|
-
"aria-disabled":
|
|
222
|
-
"aria-required":
|
|
223
|
-
"aria-invalid":
|
|
224
|
-
"aria-errormessage":
|
|
225
|
-
"aria-labelledby": !
|
|
226
|
-
"aria-label":
|
|
227
|
-
"aria-describedby":
|
|
228
|
-
placeholder:
|
|
229
|
-
onChange: (
|
|
230
|
-
disabled:
|
|
231
|
-
readOnly:
|
|
248
|
+
className: r[`${L}field__input`],
|
|
249
|
+
"aria-readonly": i,
|
|
250
|
+
"aria-disabled": o,
|
|
251
|
+
"aria-required": A,
|
|
252
|
+
"aria-invalid": y.invalid,
|
|
253
|
+
"aria-errormessage": y.errorMessage || void 0,
|
|
254
|
+
"aria-labelledby": !g.ariaLabel && S ? S : void 0,
|
|
255
|
+
"aria-label": g.ariaLabel,
|
|
256
|
+
"aria-describedby": y.describedBy,
|
|
257
|
+
placeholder: t && !$ ? "" : ae,
|
|
258
|
+
onChange: (e) => V(e.target.value),
|
|
259
|
+
disabled: o,
|
|
260
|
+
readOnly: i,
|
|
232
261
|
autoComplete: "off",
|
|
233
|
-
tabIndex:
|
|
262
|
+
tabIndex: o ? -1 : 0,
|
|
234
263
|
autoFocus: !1,
|
|
235
|
-
...
|
|
264
|
+
...tt
|
|
236
265
|
}
|
|
237
266
|
)
|
|
238
267
|
}
|
|
239
268
|
),
|
|
240
|
-
hasClearButton:
|
|
241
|
-
hideChevron:
|
|
242
|
-
onClear:
|
|
243
|
-
onBlur:
|
|
244
|
-
onFocusCapture:
|
|
245
|
-
...
|
|
246
|
-
ref:
|
|
269
|
+
hasClearButton: Le,
|
|
270
|
+
hideChevron: pe,
|
|
271
|
+
onClear: Me,
|
|
272
|
+
onBlur: Je,
|
|
273
|
+
onFocusCapture: Qe,
|
|
274
|
+
...et,
|
|
275
|
+
ref: Ze
|
|
247
276
|
}
|
|
248
277
|
),
|
|
249
|
-
/* @__PURE__ */ C(
|
|
250
|
-
|
|
251
|
-
|
|
278
|
+
/* @__PURE__ */ C(ft, { ctxId: ve, ctxDisabled: o, children: [
|
|
279
|
+
q,
|
|
280
|
+
Ie && /* @__PURE__ */ n(ut, { id: Oe, appearance: "negative", children: p })
|
|
252
281
|
] }),
|
|
253
|
-
|
|
282
|
+
he(Ce)
|
|
254
283
|
] }),
|
|
255
|
-
/* @__PURE__ */ C("select", { ...
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
|
|
284
|
+
/* @__PURE__ */ C("select", { ...be, ...Ae, hidden: !0, multiple: t, children: [
|
|
285
|
+
/* @__PURE__ */ n("option", { value: "", children: "empty" }),
|
|
286
|
+
X
|
|
258
287
|
] }),
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
|
|
288
|
+
/* @__PURE__ */ n(
|
|
289
|
+
It,
|
|
261
290
|
{
|
|
262
|
-
...
|
|
263
|
-
className: r[`${
|
|
264
|
-
disabled:
|
|
265
|
-
readOnly:
|
|
266
|
-
theme:
|
|
267
|
-
multiple:
|
|
268
|
-
onItemClick:
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
-
|
|
291
|
+
...Re,
|
|
292
|
+
className: r[`${L}dropdown`],
|
|
293
|
+
disabled: o,
|
|
294
|
+
readOnly: i,
|
|
295
|
+
theme: I,
|
|
296
|
+
multiple: t,
|
|
297
|
+
onItemClick: Ue,
|
|
298
|
+
children: /* @__PURE__ */ n(
|
|
299
|
+
Q,
|
|
271
300
|
{
|
|
272
301
|
role: "listbox",
|
|
273
|
-
noResults:
|
|
274
|
-
children:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
302
|
+
noResults: Xe ? de : void 0,
|
|
303
|
+
children: w.map((e, s) => {
|
|
304
|
+
if (e.kind === "option")
|
|
305
|
+
return z(e.id);
|
|
306
|
+
const l = R.get(e.id);
|
|
307
|
+
if (!l) return null;
|
|
308
|
+
const b = D.get(e.id) ?? [], G = !b.some(
|
|
309
|
+
(E) => !c[E]
|
|
310
|
+
), ot = s === Ye, rt = !!l.divider && !ot;
|
|
311
|
+
return /* @__PURE__ */ n(
|
|
312
|
+
Q.Group,
|
|
283
313
|
{
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
kind: o ? "checkbox" : "singleCheckMark",
|
|
294
|
-
role: "option"
|
|
295
|
-
}
|
|
314
|
+
heading: l.heading,
|
|
315
|
+
divider: rt,
|
|
316
|
+
disabled: l.disabled,
|
|
317
|
+
hidden: G,
|
|
318
|
+
children: b.map(
|
|
319
|
+
(E) => z(E, l.disabled)
|
|
320
|
+
)
|
|
321
|
+
},
|
|
322
|
+
e.id
|
|
296
323
|
);
|
|
297
324
|
})
|
|
298
325
|
}
|
|
@@ -301,10 +328,11 @@ const { baseClassNamePrefix: Ot, subElementClassPrefix: R, classModifierPrefix:
|
|
|
301
328
|
)
|
|
302
329
|
] });
|
|
303
330
|
}
|
|
304
|
-
),
|
|
305
|
-
|
|
306
|
-
|
|
331
|
+
), M = Ft;
|
|
332
|
+
M.Option = xt;
|
|
333
|
+
M.OptionGroup = gt;
|
|
334
|
+
M.displayName = "Autocomplete";
|
|
307
335
|
export {
|
|
308
|
-
|
|
309
|
-
|
|
336
|
+
M as Autocomplete,
|
|
337
|
+
M as default
|
|
310
338
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@floating-ui/react"),B=require("../Box/Box.cjs.js"),C=require("clsx"),a=require("../../chunks/classNames.DAeKwerT.js"),P=require("../../chunks/constants.hwjHOsvT.js"),v=require("../ActionList/ActionList.context.cjs.js"),y=require("react"),A=require("../../chunks/FloatingUI.arrow.DFhYQv_F.js"),O=require("../../chunks/popover.module.DGUJIXrP.js");require("../_Options/Option.context.cjs.js");const w=require("../_Options/Option.cjs.js");require("../_Options/OptionGroup.context.cjs.js");require("../../utils/hooks/useId.cjs.js");require("../ActionList/ActionList.cjs.js");require("../../chunks/form.context.hesWPMlU.js");require("../Form/contexts/label.context.cjs.js");require("../Form/contexts/helperText.context.cjs.js");const{baseClassNamePrefix:M}=a.getBEMClassNames("floatingui"),{baseClassNamePrefix:S}=a.getBEMClassNames("popover"),L=[w.Option],T=({setOpen:o,isMounted:n,status:l,nodeId:u,context:c,getFloatingProps:d,floatingStyles:q,labelsRef:x,elementsRef:g,getItemProps:p,setFloating:f,disabled:m,readOnly:F,theme:t,className:_,children:b,multiple:i,activeIndex:N,onItemClick:r})=>{const j=y.useCallback(h=>{r==null||r(h),!i&&o(!1)},[i,r,o]);return n?e.jsx(s.FloatingTree,{children:e.jsx(s.FloatingNode,{id:u,children:e.jsx(s.FloatingPortal,{children:e.jsx(s.FloatingFocusManager,{context:c,modal:!1,initialFocus:0,disabled:m||F,closeOnFocusOut:!0,restoreFocus:!0,returnFocus:!0,guards:!0,order:["content","reference"],children:e.jsx(B.Box,{"data-status":l,className:C(t&&P.themeClassName(t),A.floatinguiStyles[M],O.popoverStyles[S],_),...d(),style:q,ref:f,children:e.jsx(v.ActionListContextProvider,{allowChildrenTypes:L,getItemProps:p,itemsFocusable:!1,onItemClick:j,labelsRef:x,elementsRef:g,activeIndex:N,children:b})})})})})}):null};exports.AutocompleteDropdown=T;
|