@viasat/beam-react 2.30.0 → 2.37.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 +1 -0
- 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/dialog.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.BK0jH2ge.js +1 -0
- package/chunks/FloatingUI.arrow.BXR2atOC.js +28 -0
- package/chunks/dialog.module.Djvqgz-x.js +1 -0
- package/chunks/{dialog.module.TRHzVysh.js → dialog.module.vokt9Lwb.js} +2 -1
- package/chunks/panel.module.BVmRxZHo.js +1 -0
- package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
- 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/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/lib/Dialog/Dialog.Body.cjs.js +1 -1
- package/lib/Dialog/Dialog.Body.es.js +1 -1
- package/lib/Dialog/Dialog.Content.cjs.js +1 -1
- package/lib/Dialog/Dialog.Content.es.js +1 -1
- package/lib/Dialog/Dialog.Footer.cjs.js +1 -1
- package/lib/Dialog/Dialog.Footer.es.js +1 -1
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.cjs.js +1 -1
- package/lib/Dialog/Dialog.es.js +1 -1
- 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 +31 -32
- 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/SideNav/SideNavActionList.es.js +1 -0
- package/lib/SideNav/SideNavActionListItemLabel.d.ts +1 -1
- package/lib/Slider/DualSlider.cjs.js +1 -1
- package/lib/Slider/DualSlider.es.js +28 -27
- package/lib/Slider/SingleSlider.cjs.js +1 -1
- package/lib/Slider/SingleSlider.es.js +1 -1
- package/lib/Slider/Slider.es.js +17 -17
- package/lib/Slider/hooks/useDualSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useDualSliderLogic.es.js +14 -14
- package/lib/Slider/hooks/useSingleSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useSingleSliderLogic.es.js +17 -17
- package/lib/Tabs/Tabs.Group.d.ts +2 -2
- package/lib/Tabs/Tabs.Item.d.ts +2 -2
- package/lib/Tabs/Tabs.Panel.d.ts +2 -2
- package/lib/Text/Text.d.ts +2 -2
- package/lib/Text/Text.es.js +12 -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/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 +3 -1
- package/lib/wip/Panel/Panel.Inline.es.js +44 -40
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +18 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +110 -84
- 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 +125 -94
- 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/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +1 -0
- package/lib/wip/index.es.js +4 -2
- 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/assets/floatingui.css +0 -1
- package/chunks/dialog.module.C_6Qrg4w.js +0 -1
- 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
package/lib/Select/Select.es.js
CHANGED
|
@@ -1,259 +1,272 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { b as
|
|
8
|
-
import { LabelProvider as
|
|
9
|
-
import { HelperTextProvider as
|
|
10
|
-
import { ActionList as
|
|
11
|
-
import { useSelectDropdown as
|
|
12
|
-
import { SelectDropdown as
|
|
13
|
-
import { useSelectChips as
|
|
14
|
-
import { useSelectKeyboardManager as
|
|
15
|
-
import
|
|
16
|
-
import { OptionChips as
|
|
17
|
-
import { SelectField as
|
|
18
|
-
import
|
|
19
|
-
import { useCreateOptionsContext as
|
|
20
|
-
import { Option as
|
|
21
|
-
import {
|
|
22
|
-
import
|
|
23
|
-
|
|
1
|
+
import { jsxs as v, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { g as Ke } from "../../chunks/classNames.BTJmrO_L.js";
|
|
3
|
+
import { t as Te } from "../../chunks/constants.CKKGf1-i.js";
|
|
4
|
+
import { s as i } from "../../chunks/combobox.module.D_HXP875.js";
|
|
5
|
+
import We from "clsx";
|
|
6
|
+
import ze, { useCallback as H, useMemo as y } from "react";
|
|
7
|
+
import { b as Je, H as Qe } from "../../chunks/form.context.D7b4066_.js";
|
|
8
|
+
import { LabelProvider as Ue } from "../Form/contexts/label.context.es.js";
|
|
9
|
+
import { HelperTextProvider as Xe } from "../Form/contexts/helperText.context.es.js";
|
|
10
|
+
import { ActionList as j } from "../ActionList/ActionList.es.js";
|
|
11
|
+
import { useSelectDropdown as Ye } from "./useSelectDropdown.es.js";
|
|
12
|
+
import { SelectDropdown as Ze } from "./SelectDropdown.es.js";
|
|
13
|
+
import { useSelectChips as _e } from "./useSelectChips.es.js";
|
|
14
|
+
import { useSelectKeyboardManager as et } from "./useSelectKeyboardManager.es.js";
|
|
15
|
+
import tt from "./useClearSelection.es.js";
|
|
16
|
+
import { OptionChips as rt } from "../_Options/OptionChips.es.js";
|
|
17
|
+
import { SelectField as it } from "./SelectField.es.js";
|
|
18
|
+
import ot from "./useSelectA11y.es.js";
|
|
19
|
+
import { useCreateOptionsContext as st, OptionsProvider as lt } from "../_Options/Option.context.es.js";
|
|
20
|
+
import { Option as at } from "../_Options/Option.es.js";
|
|
21
|
+
import { OptionGroup as dt } from "../_Options/OptionGroup.es.js";
|
|
22
|
+
import "../_Options/OptionGroup.context.es.js";
|
|
23
|
+
import { getLastVisibleStructureIndex as nt } from "../_Options/getLastVisibleStructureIndex.es.js";
|
|
24
|
+
import { useRenderOption as ct } from "../_Options/useRenderOption.es.js";
|
|
25
|
+
import { useSelectValue as pt } from "../_Options/useSelectValue.es.js";
|
|
26
|
+
import { createSelectionStrategy as mt } from "../_Options/strategies/SelectionStrategy.es.js";
|
|
27
|
+
const { baseClassNamePrefix: ut, subElementClassPrefix: P, classModifierPrefix: a } = Ke("combobox"), ft = ze.forwardRef(
|
|
24
28
|
({
|
|
25
|
-
theme:
|
|
26
|
-
width:
|
|
29
|
+
theme: O,
|
|
30
|
+
width: k,
|
|
27
31
|
error: d,
|
|
28
|
-
children:
|
|
29
|
-
label:
|
|
30
|
-
contentBefore:
|
|
31
|
-
contentAfter:
|
|
32
|
-
fluid:
|
|
33
|
-
helperText:
|
|
34
|
-
validationRules:
|
|
35
|
-
className:
|
|
36
|
-
hideRequiredMarker:
|
|
37
|
-
disabled:
|
|
38
|
-
readOnly:
|
|
39
|
-
required:
|
|
40
|
-
placeholder:
|
|
32
|
+
children: K,
|
|
33
|
+
label: $ = null,
|
|
34
|
+
contentBefore: T,
|
|
35
|
+
contentAfter: W,
|
|
36
|
+
fluid: z = !1,
|
|
37
|
+
helperText: N = null,
|
|
38
|
+
validationRules: J = [],
|
|
39
|
+
className: Q,
|
|
40
|
+
hideRequiredMarker: U = !1,
|
|
41
|
+
disabled: X = !1,
|
|
42
|
+
readOnly: Y = !1,
|
|
43
|
+
required: Z = !1,
|
|
44
|
+
placeholder: _ = "",
|
|
41
45
|
onChange: m,
|
|
42
46
|
...u
|
|
43
|
-
},
|
|
47
|
+
}, ee) => {
|
|
44
48
|
const {
|
|
45
|
-
id:
|
|
46
|
-
name:
|
|
47
|
-
"aria-describedby":
|
|
49
|
+
id: V,
|
|
50
|
+
name: te,
|
|
51
|
+
"aria-describedby": re,
|
|
48
52
|
multiple: e = !1,
|
|
49
|
-
clearable:
|
|
50
|
-
...
|
|
51
|
-
} = u, { showErrors:
|
|
52
|
-
name:
|
|
53
|
-
validationRules:
|
|
54
|
-
disabledProp:
|
|
55
|
-
readOnlyProp:
|
|
56
|
-
requiredProp:
|
|
57
|
-
}), { aria: f, ids:
|
|
58
|
-
helperText:
|
|
59
|
-
externalDescribedBy:
|
|
53
|
+
clearable: ie = e,
|
|
54
|
+
...oe
|
|
55
|
+
} = u, { showErrors: se, isInvalid: le, errorShown: ae, disabled: r, readOnly: s, required: w } = Je({
|
|
56
|
+
name: te,
|
|
57
|
+
validationRules: J,
|
|
58
|
+
disabledProp: X,
|
|
59
|
+
readOnlyProp: Y,
|
|
60
|
+
requiredProp: Z
|
|
61
|
+
}), { aria: f, ids: de } = ot({
|
|
62
|
+
helperText: N,
|
|
63
|
+
externalDescribedBy: re,
|
|
60
64
|
error: d,
|
|
61
|
-
errorShown:
|
|
65
|
+
errorShown: ae,
|
|
62
66
|
invalid: !!d || le
|
|
63
|
-
}), { helperTextId:
|
|
64
|
-
(
|
|
65
|
-
m == null || m(
|
|
67
|
+
}), { helperTextId: ne, errorId: ce, validationErrorsId: pe, labelId: D } = de, me = !!(d != null && d.length), ue = H(
|
|
68
|
+
(t) => {
|
|
69
|
+
m == null || m(t);
|
|
66
70
|
},
|
|
67
71
|
[m]
|
|
68
72
|
), {
|
|
69
73
|
value: n,
|
|
70
|
-
setValue:
|
|
71
|
-
selectProps:
|
|
72
|
-
handleBlur:
|
|
74
|
+
setValue: L,
|
|
75
|
+
selectProps: fe,
|
|
76
|
+
handleBlur: M,
|
|
73
77
|
singleValue: b
|
|
74
|
-
} =
|
|
75
|
-
optionsContext:
|
|
76
|
-
optionIds:
|
|
77
|
-
optionsProps:
|
|
78
|
-
selectedOptionsProps:
|
|
79
|
-
deselectOptionValue:
|
|
80
|
-
|
|
78
|
+
} = pt({ onChange: ue, ...u }, ee), g = !n || Array.isArray(n) && !n.length, {
|
|
79
|
+
optionsContext: be,
|
|
80
|
+
optionIds: h,
|
|
81
|
+
optionsProps: c,
|
|
82
|
+
selectedOptionsProps: R,
|
|
83
|
+
deselectOptionValue: E,
|
|
84
|
+
structureIds: S,
|
|
85
|
+
groupsProps: he,
|
|
86
|
+
optionIdsByGroup: C
|
|
87
|
+
} = st(n, L, e), x = y(() => {
|
|
81
88
|
if (!b) return;
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
}, [
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
return
|
|
88
|
-
}, [h, c
|
|
89
|
-
disabled:
|
|
89
|
+
const t = h.map((l) => c.get(l)).findIndex((l) => (l == null ? void 0 : l.value) === b);
|
|
90
|
+
return t !== -1 ? t : void 0;
|
|
91
|
+
}, [h, c, b]), xe = y(() => {
|
|
92
|
+
if (x === void 0) return;
|
|
93
|
+
const t = c.get(h[x]);
|
|
94
|
+
return t == null ? void 0 : t.label;
|
|
95
|
+
}, [x, h, c]), { getFieldProps: ve, dropdownProps: ye, refs: Oe, open: F, setOpen: I, status: ge } = Ye({
|
|
96
|
+
disabled: r,
|
|
90
97
|
readOnly: s,
|
|
91
|
-
lastSelectedOptionIndex:
|
|
92
|
-
}),
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
f.invalid &&
|
|
97
|
-
|
|
98
|
-
s &&
|
|
99
|
-
|
|
100
|
-
e &&
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
), { canClear:
|
|
98
|
+
lastSelectedOptionIndex: x
|
|
99
|
+
}), Se = We(
|
|
100
|
+
i[ut],
|
|
101
|
+
O && Te(O),
|
|
102
|
+
z && i[`${a}fluid`],
|
|
103
|
+
f.invalid && i[`${a}error`],
|
|
104
|
+
r && i[`${a}disabled`],
|
|
105
|
+
s && i[`${a}read-only`],
|
|
106
|
+
g && i[`${a}empty`],
|
|
107
|
+
e && i[`${a}multiple`],
|
|
108
|
+
i[`${a}dropdown-${ge}`],
|
|
109
|
+
Q
|
|
110
|
+
), { canClear: Ce, handleClear: Ie } = tt({
|
|
104
111
|
multiple: e,
|
|
105
|
-
clearable:
|
|
106
|
-
isEmpty:
|
|
107
|
-
disabled:
|
|
112
|
+
clearable: ie,
|
|
113
|
+
isEmpty: g,
|
|
114
|
+
disabled: r,
|
|
108
115
|
readOnly: s,
|
|
109
|
-
setValue:
|
|
110
|
-
setOpen:
|
|
116
|
+
setValue: L,
|
|
117
|
+
setOpen: I
|
|
111
118
|
}), {
|
|
112
|
-
chipGroupProps:
|
|
113
|
-
handleBlur:
|
|
114
|
-
selectedChip:
|
|
115
|
-
setSelectedChip:
|
|
116
|
-
enabled:
|
|
117
|
-
selectPreviousChip:
|
|
118
|
-
selectNextChip:
|
|
119
|
-
options:
|
|
120
|
-
deselectOptionValue:
|
|
121
|
-
} =
|
|
119
|
+
chipGroupProps: Pe,
|
|
120
|
+
handleBlur: G,
|
|
121
|
+
selectedChip: Be,
|
|
122
|
+
setSelectedChip: $e,
|
|
123
|
+
enabled: Ne,
|
|
124
|
+
selectPreviousChip: Ve,
|
|
125
|
+
selectNextChip: we,
|
|
126
|
+
options: De,
|
|
127
|
+
deselectOptionValue: Le
|
|
128
|
+
} = _e({
|
|
122
129
|
multiple: e,
|
|
123
|
-
disabled:
|
|
130
|
+
disabled: r,
|
|
124
131
|
readOnly: s,
|
|
125
|
-
open:
|
|
126
|
-
setOpen:
|
|
127
|
-
options:
|
|
128
|
-
deselectOptionValue:
|
|
129
|
-
fieldRef:
|
|
130
|
-
}), { getKeyboardProps:
|
|
132
|
+
open: F,
|
|
133
|
+
setOpen: I,
|
|
134
|
+
options: R,
|
|
135
|
+
deselectOptionValue: E,
|
|
136
|
+
fieldRef: Oe.domReference
|
|
137
|
+
}), { getKeyboardProps: Me } = et({
|
|
131
138
|
multiple: e,
|
|
132
|
-
disabled:
|
|
139
|
+
disabled: r,
|
|
133
140
|
readOnly: s,
|
|
134
|
-
open:
|
|
135
|
-
setOpen:
|
|
141
|
+
open: F,
|
|
142
|
+
setOpen: I,
|
|
136
143
|
chips: {
|
|
137
|
-
enabled:
|
|
138
|
-
selectedChip:
|
|
139
|
-
setSelectedChip:
|
|
140
|
-
selectPreviousChip:
|
|
141
|
-
selectNextChip:
|
|
142
|
-
options:
|
|
143
|
-
deselectOptionValue:
|
|
144
|
+
enabled: Ne,
|
|
145
|
+
selectedChip: Be,
|
|
146
|
+
setSelectedChip: $e,
|
|
147
|
+
selectPreviousChip: Ve,
|
|
148
|
+
selectNextChip: we,
|
|
149
|
+
options: De,
|
|
150
|
+
deselectOptionValue: Le
|
|
144
151
|
}
|
|
145
|
-
}),
|
|
146
|
-
() =>
|
|
152
|
+
}), Re = y(
|
|
153
|
+
() => mt(e),
|
|
147
154
|
[e]
|
|
148
|
-
),
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
), Ee = H(() => {
|
|
156
|
+
M(), G();
|
|
157
|
+
}, [M, G]), q = ct({
|
|
158
|
+
optionsProps: c,
|
|
159
|
+
selectionStrategy: Re,
|
|
160
|
+
value: n,
|
|
161
|
+
multiple: e,
|
|
162
|
+
optionClassName: i[`${P}option`]
|
|
163
|
+
}), Fe = y(
|
|
164
|
+
() => nt(S, C),
|
|
165
|
+
[S, C]
|
|
166
|
+
), { ref: Ge, ...qe } = Me(ve());
|
|
167
|
+
return /* @__PURE__ */ v(lt, { value: be, children: [
|
|
168
|
+
/* @__PURE__ */ v("div", { className: Se, style: { maxWidth: k }, children: [
|
|
169
|
+
/* @__PURE__ */ o(
|
|
170
|
+
Ue,
|
|
155
171
|
{
|
|
156
|
-
ctxHtmlFor:
|
|
157
|
-
ctxDisabled:
|
|
158
|
-
ctxRequired:
|
|
159
|
-
ctxId:
|
|
160
|
-
children:
|
|
172
|
+
ctxHtmlFor: V,
|
|
173
|
+
ctxDisabled: r,
|
|
174
|
+
ctxRequired: w && !U,
|
|
175
|
+
ctxId: D,
|
|
176
|
+
children: $
|
|
161
177
|
}
|
|
162
178
|
),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
179
|
+
/* @__PURE__ */ o(
|
|
180
|
+
it,
|
|
165
181
|
{
|
|
166
|
-
id:
|
|
167
|
-
disabled:
|
|
182
|
+
id: V,
|
|
183
|
+
disabled: r,
|
|
168
184
|
readOnly: s,
|
|
169
|
-
required:
|
|
185
|
+
required: w,
|
|
170
186
|
invalid: f.invalid,
|
|
171
187
|
errorMessage: f.errorMessage,
|
|
172
|
-
labelId: !u.ariaLabel &&
|
|
188
|
+
labelId: !u.ariaLabel && $ ? D : void 0,
|
|
173
189
|
ariaLabel: u.ariaLabel,
|
|
174
190
|
describedBy: f.describedBy,
|
|
175
|
-
contentBefore:
|
|
176
|
-
contentAfter:
|
|
177
|
-
chips: /* @__PURE__ */
|
|
178
|
-
|
|
191
|
+
contentBefore: T,
|
|
192
|
+
contentAfter: W,
|
|
193
|
+
chips: /* @__PURE__ */ o(
|
|
194
|
+
rt,
|
|
179
195
|
{
|
|
180
196
|
multiple: e,
|
|
181
|
-
disabled:
|
|
197
|
+
disabled: r,
|
|
182
198
|
readOnly: s,
|
|
183
|
-
selectedOptions:
|
|
184
|
-
deselectOptionValue:
|
|
185
|
-
chipGroupProps:
|
|
186
|
-
input: /* @__PURE__ */
|
|
199
|
+
selectedOptions: R,
|
|
200
|
+
deselectOptionValue: E,
|
|
201
|
+
chipGroupProps: Pe,
|
|
202
|
+
input: /* @__PURE__ */ o(
|
|
187
203
|
"input",
|
|
188
204
|
{
|
|
189
|
-
className:
|
|
190
|
-
placeholder: e && !
|
|
191
|
-
disabled:
|
|
205
|
+
className: i[`${P}field__input`],
|
|
206
|
+
placeholder: e && !g ? "" : _,
|
|
207
|
+
disabled: r,
|
|
192
208
|
readOnly: !0,
|
|
193
209
|
autoComplete: "off",
|
|
194
210
|
tabIndex: -1,
|
|
195
211
|
autoFocus: !1,
|
|
196
|
-
value: e ? "" :
|
|
212
|
+
value: e ? "" : xe ?? b
|
|
197
213
|
}
|
|
198
214
|
)
|
|
199
215
|
}
|
|
200
216
|
),
|
|
201
|
-
hasClearButton:
|
|
202
|
-
onClear:
|
|
203
|
-
onBlur:
|
|
204
|
-
...
|
|
205
|
-
ref:
|
|
217
|
+
hasClearButton: Ce,
|
|
218
|
+
onClear: Ie,
|
|
219
|
+
onBlur: Ee,
|
|
220
|
+
...qe,
|
|
221
|
+
ref: Ge
|
|
206
222
|
}
|
|
207
223
|
),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
210
|
-
|
|
224
|
+
/* @__PURE__ */ v(Xe, { ctxId: ne, ctxDisabled: r, children: [
|
|
225
|
+
N,
|
|
226
|
+
me && /* @__PURE__ */ o(Qe, { id: ce, appearance: "negative", children: d })
|
|
211
227
|
] }),
|
|
212
|
-
|
|
228
|
+
se(pe)
|
|
213
229
|
] }),
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
216
|
-
|
|
230
|
+
/* @__PURE__ */ v("select", { ...oe, ...fe, hidden: !0, multiple: e, children: [
|
|
231
|
+
/* @__PURE__ */ o("option", { value: "", children: "empty" }),
|
|
232
|
+
K
|
|
217
233
|
] }),
|
|
218
|
-
/* @__PURE__ */
|
|
219
|
-
|
|
234
|
+
/* @__PURE__ */ o(
|
|
235
|
+
Ze,
|
|
220
236
|
{
|
|
221
|
-
...
|
|
222
|
-
className:
|
|
223
|
-
disabled:
|
|
237
|
+
...ye,
|
|
238
|
+
className: i[`${P}dropdown`],
|
|
239
|
+
disabled: r,
|
|
224
240
|
readOnly: s,
|
|
225
|
-
theme:
|
|
241
|
+
theme: O,
|
|
226
242
|
multiple: e,
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
L.Item,
|
|
243
|
+
children: /* @__PURE__ */ o(j, { role: "listbox", children: S.map((t, l) => {
|
|
244
|
+
if (t.kind === "option")
|
|
245
|
+
return q(t.id);
|
|
246
|
+
const p = he.get(t.id);
|
|
247
|
+
if (!p) return null;
|
|
248
|
+
const A = C.get(t.id) ?? [], Ae = A.length > 0, He = l === Fe, je = !!p.divider && !He;
|
|
249
|
+
return /* @__PURE__ */ o(
|
|
250
|
+
j.Group,
|
|
236
251
|
{
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
kind: e ? "checkbox" : "singleCheckMark",
|
|
245
|
-
role: "option"
|
|
246
|
-
}
|
|
252
|
+
heading: p.heading,
|
|
253
|
+
divider: je,
|
|
254
|
+
disabled: p.disabled,
|
|
255
|
+
hidden: !Ae,
|
|
256
|
+
children: A.map((ke) => q(ke, p.disabled))
|
|
257
|
+
},
|
|
258
|
+
t.id
|
|
247
259
|
);
|
|
248
260
|
}) })
|
|
249
261
|
}
|
|
250
262
|
)
|
|
251
263
|
] });
|
|
252
264
|
}
|
|
253
|
-
),
|
|
254
|
-
|
|
255
|
-
|
|
265
|
+
), B = ft;
|
|
266
|
+
B.Option = at;
|
|
267
|
+
B.OptionGroup = dt;
|
|
268
|
+
B.displayName = "Select";
|
|
256
269
|
export {
|
|
257
|
-
|
|
258
|
-
|
|
270
|
+
B as Select,
|
|
271
|
+
B as default
|
|
259
272
|
};
|
|
@@ -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");require("../_Options/Option.context.cjs.js");const v=require("../_Options/Option.cjs.js"),y=require("react");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 S=require("../ActionList/ActionList.context.cjs.js"),O=require("../../chunks/FloatingUI.arrow.BK0jH2ge.js"),w=require("../../chunks/popover.module.DGUJIXrP.js"),{baseClassNamePrefix:M}=a.getBEMClassNames("floatingui"),{baseClassNamePrefix:A}=a.getBEMClassNames("popover"),L=[v.Option],T=({setOpen:t,isMounted:n,status:l,nodeId:c,context:u,getFloatingProps:d,floatingStyles:q,labelsRef:x,elementsRef:g,getItemProps:f,setFloating:p,disabled:F,readOnly:_,theme:o,className:b,children:m,multiple:i,activeIndex:N,onItemClick:r})=>{const j=y.useCallback(h=>{r==null||r(h),!i&&t(!1)},[i,r,t]);return n?e.jsx(s.FloatingTree,{children:e.jsx(s.FloatingNode,{id:c,children:e.jsx(s.FloatingPortal,{children:e.jsx(s.FloatingFocusManager,{context:u,modal:!1,initialFocus:0,disabled:F||_,closeOnFocusOut:!0,restoreFocus:!0,returnFocus:!0,guards:!0,order:["content","reference"],children:e.jsx(B.Box,{"data-status":l,className:C(o&&P.themeClassName(o),O.floatinguiStyles[M],w.popoverStyles[A],b),...d(),style:q,ref:p,children:e.jsx(S.ActionListContextProvider,{allowChildrenTypes:L,getItemProps:f,itemsFocusable:!1,onItemClick:j,labelsRef:x,elementsRef:g,activeIndex:N,children:m})})})})})}):null};exports.SelectDropdown=T;
|
|
@@ -7,38 +7,41 @@ import { t as O } from "../../chunks/constants.CKKGf1-i.js";
|
|
|
7
7
|
import "../_Options/Option.context.es.js";
|
|
8
8
|
import { Option as T } from "../_Options/Option.es.js";
|
|
9
9
|
import { useCallback as j } from "react";
|
|
10
|
+
import "../_Options/OptionGroup.context.es.js";
|
|
11
|
+
import "../../utils/hooks/useId.es.js";
|
|
12
|
+
import "../ActionList/ActionList.es.js";
|
|
10
13
|
import "../../chunks/form.context.D7b4066_.js";
|
|
11
14
|
import "../Form/contexts/label.context.es.js";
|
|
12
15
|
import "../Form/contexts/helperText.context.es.js";
|
|
13
16
|
import { ActionListContextProvider as A } from "../ActionList/ActionList.context.es.js";
|
|
14
|
-
import { f as D } from "../../chunks/
|
|
17
|
+
import { f as D } from "../../chunks/FloatingUI.arrow.BXR2atOC.js";
|
|
15
18
|
import { p as E } from "../../chunks/popover.module.3dnl8y6-.js";
|
|
16
|
-
const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } = a("popover"), z = [T],
|
|
19
|
+
const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } = a("popover"), z = [T], er = ({
|
|
17
20
|
setOpen: e,
|
|
18
21
|
isMounted: i,
|
|
19
22
|
status: l,
|
|
20
23
|
nodeId: m,
|
|
21
24
|
context: n,
|
|
22
|
-
getFloatingProps:
|
|
23
|
-
floatingStyles:
|
|
25
|
+
getFloatingProps: p,
|
|
26
|
+
floatingStyles: f,
|
|
24
27
|
labelsRef: c,
|
|
25
28
|
elementsRef: u,
|
|
26
29
|
getItemProps: d,
|
|
27
30
|
setFloating: g,
|
|
28
31
|
disabled: F,
|
|
29
32
|
readOnly: x,
|
|
30
|
-
theme:
|
|
33
|
+
theme: t,
|
|
31
34
|
className: N,
|
|
32
35
|
children: h,
|
|
33
|
-
multiple:
|
|
36
|
+
multiple: s,
|
|
34
37
|
activeIndex: C,
|
|
35
38
|
onItemClick: o
|
|
36
39
|
}) => {
|
|
37
40
|
const P = j(
|
|
38
41
|
(b) => {
|
|
39
|
-
o == null || o(b), !
|
|
42
|
+
o == null || o(b), !s && e(!1);
|
|
40
43
|
},
|
|
41
|
-
[
|
|
44
|
+
[s, o, e]
|
|
42
45
|
);
|
|
43
46
|
return i ? /* @__PURE__ */ r(v, { children: /* @__PURE__ */ r(y, { id: m, children: /* @__PURE__ */ r(B, { children: /* @__PURE__ */ r(
|
|
44
47
|
S,
|
|
@@ -57,13 +60,13 @@ const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } =
|
|
|
57
60
|
{
|
|
58
61
|
"data-status": l,
|
|
59
62
|
className: M(
|
|
60
|
-
|
|
63
|
+
t && O(t),
|
|
61
64
|
D[L],
|
|
62
65
|
E[q],
|
|
63
66
|
N
|
|
64
67
|
),
|
|
65
|
-
...
|
|
66
|
-
style:
|
|
68
|
+
...p(),
|
|
69
|
+
style: f,
|
|
67
70
|
ref: g,
|
|
68
71
|
children: /* @__PURE__ */ r(
|
|
69
72
|
A,
|
|
@@ -84,5 +87,5 @@ const { baseClassNamePrefix: L } = a("floatingui"), { baseClassNamePrefix: q } =
|
|
|
84
87
|
) }) }) }) : null;
|
|
85
88
|
};
|
|
86
89
|
export {
|
|
87
|
-
|
|
90
|
+
er as SelectDropdown
|
|
88
91
|
};
|
|
@@ -5,4 +5,4 @@ export interface SideNavActionListItemLabelProps {
|
|
|
5
5
|
*/
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
}
|
|
8
|
-
export declare const SideNavActionListItemLabel: (props: SideNavActionListItemLabelProps) =>
|
|
8
|
+
export declare const SideNavActionListItemLabel: (props: SideNavActionListItemLabelProps) => React.ReactElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),m=require("react"),W=require("@floating-ui/react"),P=require("../../chunks/slider.module.hYyjcVRE.js"),Y=require("../Label/Label.cjs.js"),Z=require("./Slider.TickMarks.cjs.js"),b=require("./Slider.ValueAxisLabels.cjs.js"),ee=require("./Slider.Error.cjs.js"),A=require("./Slider.TextField.cjs.js"),I=require("./Slider.Thumb.cjs.js"),le=require("./hooks/useDualSliderLogic.cjs.js");require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/form.context.hesWPMlU.js");const re=require("../Form/contexts/label.context.cjs.js"),ie=require("../Form/contexts/helperText.context.cjs.js");require("../../chunks/CSSLookup.DESAWWRT.js");require("../../utils/hooks/useId.cjs.js");const ae=require("./utils/slider.validation.utils.cjs.js"),R=require("./utils/slider.rendering.utils.cjs.js"),S=require("./slider.constants.cjs.js"),$=require("./hooks/useSliderEvents.cjs.js"),C=m.forwardRef(function({base:e,value:N,defaultValue:F,marksSource:w="none",restrictToValueAxis:x=!1,showTextField:L=!1,textFieldWidth:y=S.DEFAULT_TEXT_FIELD_WIDTH,persistentTooltip:T=!1,disabledTooltip:z=!1,helperText:B,contentBefore:q,contentAfter:p,minGap:g,onChange:H,...X},U){const G=W.useMergeRefs([e.containerRef,U]),_=ae.validateDualSliderDefaultValue(F,e.normalizedMin,e.normalizedMax),[t,u]=m.useState(!1),{value:i,setValue:a,markValues:j,step:n,getValidValue:s}=le.useDualSliderLogic({value:N,defaultValue:_,range:e.normalizedRange,min:e.normalizedMin,max:e.normalizedMax,step:e.normalizedStep,valueAxis:e.valueAxis,restrictToValueAxis:x,onChange:H,minGap:g});$.useSliderFormReset(e.internalInputRef,_??[e.normalizedMin??e.normalizedRange[0],e.normalizedMax??e.normalizedRange[1]],a,[_,e.normalizedMin,e.normalizedMax,e.normalizedRange,a]);const J=m.useCallback(l=>{if(e.disabled||e.readOnly)return;const[o,c]=i,f=Math.abs(l-o),h=Math.abs(l-c);f<h?a([l,c]):a([o,l])},[e.disabled,e.readOnly,a,i]),D=m.useCallback((l,o)=>{if(e.disabled||e.readOnly||!e.trackRef.current)return;const c=e.trackRef.current.getBoundingClientRect(),[f,h]=e.normalizedRange,d=R.clientXToValue(l,c,f,h,e.isRTL),[v,M]=i;if(o==="left")a([d,M]);else if(o==="right")a([v,d]);else{const K=Math.abs(d-v),Q=Math.abs(d-M);K<Q?(a([d,M]),u("left")):(a([v,d]),u("right"))}},[e.disabled,e.readOnly,e.normalizedRange,e.isRTL,a,i]);$.useSliderPointerEvents(t,D,()=>u(!1),()=>[t==="left"?"left":t==="right"?"right":void 0]);const[V
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),m=require("react"),W=require("@floating-ui/react"),P=require("../../chunks/slider.module.hYyjcVRE.js"),Y=require("../Label/Label.cjs.js"),Z=require("./Slider.TickMarks.cjs.js"),b=require("./Slider.ValueAxisLabels.cjs.js"),ee=require("./Slider.Error.cjs.js"),A=require("./Slider.TextField.cjs.js"),I=require("./Slider.Thumb.cjs.js"),le=require("./hooks/useDualSliderLogic.cjs.js");require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/form.context.hesWPMlU.js");const re=require("../Form/contexts/label.context.cjs.js"),ie=require("../Form/contexts/helperText.context.cjs.js");require("../../chunks/CSSLookup.DESAWWRT.js");require("../../utils/hooks/useId.cjs.js");const ae=require("./utils/slider.validation.utils.cjs.js"),R=require("./utils/slider.rendering.utils.cjs.js"),S=require("./slider.constants.cjs.js"),$=require("./hooks/useSliderEvents.cjs.js"),C=m.forwardRef(function({base:e,value:N,defaultValue:F,marksSource:w="none",restrictToValueAxis:x=!1,showTextField:L=!1,textFieldWidth:y=S.DEFAULT_TEXT_FIELD_WIDTH,persistentTooltip:T=!1,disabledTooltip:z=!1,helperText:B,contentBefore:q,contentAfter:p,minGap:g,onChange:H,...X},U){const G=W.useMergeRefs([e.containerRef,U]),_=ae.validateDualSliderDefaultValue(F,e.normalizedMin,e.normalizedMax),[t,u]=m.useState(!1),{value:i,setValue:a,markValues:j,step:n,getValidValue:s}=le.useDualSliderLogic({value:N,defaultValue:_,range:e.normalizedRange,min:e.normalizedMin,max:e.normalizedMax,step:e.normalizedStep,valueAxis:e.valueAxis,restrictToValueAxis:x,onChange:H,minGap:g});$.useSliderFormReset(e.internalInputRef,_??[e.normalizedMin??e.normalizedRange[0],e.normalizedMax??e.normalizedRange[1]],a,[_,e.normalizedMin,e.normalizedMax,e.normalizedRange,a]);const J=m.useCallback(l=>{if(e.disabled||e.readOnly)return;const[o,c]=i,f=Math.abs(l-o),h=Math.abs(l-c);f<h?a([l,c]):a([o,l])},[e.disabled,e.readOnly,a,i]),D=m.useCallback((l,o)=>{if(e.disabled||e.readOnly||!e.trackRef.current)return;const c=e.trackRef.current.getBoundingClientRect(),[f,h]=e.normalizedRange,d=R.clientXToValue(l,c,f,h,e.isRTL),[v,M]=i;if(o==="left")a([d,M]);else if(o==="right")a([v,d]);else{const K=Math.abs(d-v),Q=Math.abs(d-M);K<Q?(a([d,M]),u("left")):(a([v,d]),u("right"))}},[e.disabled,e.readOnly,e.normalizedRange,e.isRTL,e.trackRef,a,i]);$.useSliderPointerEvents(t,D,()=>u(!1),()=>[t==="left"?"left":t==="right"?"right":void 0]);const[k,V]=e.normalizedRange,E=R.calculatePercentage(i[0],k,V),O=R.calculatePercentage(i[1],k,V);return r.jsxs("div",{ref:G,className:e.classNames.container,...X,children:[r.jsx(re.LabelProvider,{ctxHtmlFor:e.ids.input,ctxRequired:e.required,ctxDisabled:e.disabled,ctxId:e.aria.labelledBy,children:e.label&&typeof e.label=="string"?r.jsx(Y.Label,{children:e.label}):e.label}),r.jsxs("div",{className:e.classNames.contentContainer,role:"group",children:[q&&r.jsx("div",{className:P.styles[`${e.bem.subElementClassPrefix}content-before`],children:q}),L&&r.jsx(A.SliderTextField,{value:i[0],readOnly:e.readOnly,disabled:e.disabled,error:e.hasError,getValidValue:s,setValue:l=>{e.isRTL?a([i[0],l]):a([l,i[1]])},textFieldWidth:y,min:e.normalizedMin,max:e.normalizedMax,step:n,errorId:e.ids.error,ariaLabelledby:e.aria.labelledBy,ariaLabel:e.isRTL?e.aria.label?`${e.aria.label} (maximum)`:"Maximum value":e.aria.label?`${e.aria.label} (minimum)`:"Minimum value"}),r.jsxs("div",{style:{width:"100%"},children:[r.jsxs("div",{ref:e.trackRef,className:e.classNames.track,onPointerDown:l=>{e.disabled||e.readOnly||D(l.clientX)},children:[r.jsx("div",{className:e.classNames.fill,style:{[e.bem.variable("min-percentage")]:S.toCqw(E),[e.bem.variable("max-percentage")]:S.toCqw(O)}}),r.jsx(Z.SliderTickMarks,{valueAxis:e.valueAxis,markValues:j,range:e.normalizedRange,step:n,marksSource:w}),r.jsx(I.SliderThumb,{isRTL:e.isRTL,error:e.hasError,isDragging:t==="left",setIsDragging:l=>u(l?"left":!1),currentPercentage:E,disabled:e.disabled,readOnly:e.readOnly,value:i[0],range:e.normalizedRange,min:e.normalizedMin,max:e.normalizedMax,step:n,persistentTooltip:T,disabledTooltip:z,getValidValue:s,setValue:l=>a([l,i[1]]),ariaLabelledby:e.aria.labelledBy,ariaLabel:e.aria.label?`${e.aria.label} (minimum)`:"Minimum value",valueAxis:e.valueAxis,restrictToValueAxis:x,thumbSide:"left",otherThumbValue:i[1],minGap:g??n}),r.jsx(I.SliderThumb,{isRTL:e.isRTL,error:e.hasError,isDragging:t==="right",setIsDragging:l=>u(l?"right":!1),currentPercentage:O,disabled:e.disabled,readOnly:e.readOnly,value:i[1],range:e.normalizedRange,min:e.normalizedMin,max:e.normalizedMax,step:n,persistentTooltip:T,disabledTooltip:z,getValidValue:s,setValue:l=>a([i[0],l]),ariaLabelledby:e.aria.labelledBy,ariaLabel:e.aria.label?`${e.aria.label} (maximum)`:"Maximum value",valueAxis:e.valueAxis,restrictToValueAxis:x,thumbSide:"right",otherThumbValue:i[0],minGap:g??n})]}),r.jsx(b.SliderValueAxisLabels,{valueAxis:e.valueAxis,markValues:j,range:e.normalizedRange,showValueAxisLabels:e.showValueAxisLabels,onMarkClick:J,isRTL:e.isRTL})]}),L&&r.jsx(A.SliderTextField,{value:i[1],readOnly:e.readOnly,disabled:e.disabled,error:e.hasError,getValidValue:s,setValue:l=>{e.isRTL?a([l,i[1]]):a([i[0],l])},textFieldWidth:y,min:e.normalizedMin,max:e.normalizedMax,step:n,errorId:e.ids.error,ariaLabelledby:e.aria.labelledBy,ariaLabel:e.isRTL?e.aria.label?`${e.aria.label} (minimum)`:"Minimum value":e.aria.label?`${e.aria.label} (maximum)`:"Maximum value"}),p&&r.jsx("div",{className:P.styles[`${e.bem.subElementClassPrefix}content-after`],children:p})]}),e.name&&r.jsxs(r.Fragment,{children:[r.jsx("input",{type:"hidden",ref:e.internalInputRef,id:`${e.ids.input}-min`,name:`${e.name}-min`,value:i[0],disabled:e.disabled}),r.jsx("input",{type:"hidden",id:`${e.ids.input}-max`,name:`${e.name}-max`,value:i[1],disabled:e.disabled})]}),r.jsxs(ie.HelperTextProvider,{ctxId:e.ids.helperText,ctxDisabled:e.disabled,children:[B,r.jsx(ee.SliderError,{error:e.error,errorId:e.ids.error})]}),e.showErrors(e.ids.validationErrors)]})});exports.DualSlider=C;exports.default=C;
|