@elliemae/ds-form-combobox 3.80.0-next.8 → 3.80.0-next.81
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/cjs/DSCommonComboboxPropsT.js +7 -3
- package/dist/cjs/DSCommonComboboxPropsT.js.map +2 -2
- package/dist/cjs/TruncatedText.js +11 -7
- package/dist/cjs/TruncatedText.js.map +2 -2
- package/dist/cjs/config/useComboBox.js +21 -6
- package/dist/cjs/config/useComboBox.js.map +2 -2
- package/dist/cjs/parts/DropdownIndicator.js +4 -3
- package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
- package/dist/cjs/parts/Section.js +18 -8
- package/dist/cjs/parts/Section.js.map +2 -2
- package/dist/cjs/parts/container/Container.js +5 -2
- package/dist/cjs/parts/container/Container.js.map +2 -2
- package/dist/cjs/parts/container/styled.js +4 -4
- package/dist/cjs/parts/container/styled.js.map +2 -2
- package/dist/cjs/parts/controls/Controls.js +10 -19
- package/dist/cjs/parts/controls/Controls.js.map +2 -2
- package/dist/cjs/parts/controls/styled.js +7 -7
- package/dist/cjs/parts/controls/styled.js.map +2 -2
- package/dist/cjs/parts/controls/useOnPillsNavigation.js +5 -13
- package/dist/cjs/parts/controls/useOnPillsNavigation.js.map +2 -2
- package/dist/cjs/parts/controls-input/ControlsInput.js +20 -19
- package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/cjs/parts/controls-input/styled.js +5 -2
- package/dist/cjs/parts/controls-input/styled.js.map +2 -2
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +22 -15
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js +11 -4
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/cjs/parts/menu-list/useItemRenderer.js +22 -11
- package/dist/cjs/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +4 -9
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
- package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js +10 -2
- package/dist/cjs/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
- package/dist/cjs/parts/styled.js.map +2 -2
- package/dist/cjs/utils/listHelper.js +2 -0
- package/dist/cjs/utils/listHelper.js.map +2 -2
- package/dist/esm/DSCommonComboboxPropsT.js +7 -3
- package/dist/esm/DSCommonComboboxPropsT.js.map +2 -2
- package/dist/esm/TruncatedText.js +11 -7
- package/dist/esm/TruncatedText.js.map +2 -2
- package/dist/esm/config/useComboBox.js +22 -7
- package/dist/esm/config/useComboBox.js.map +2 -2
- package/dist/esm/parts/DropdownIndicator.js +5 -4
- package/dist/esm/parts/DropdownIndicator.js.map +2 -2
- package/dist/esm/parts/Section.js +18 -8
- package/dist/esm/parts/Section.js.map +2 -2
- package/dist/esm/parts/container/Container.js +5 -2
- package/dist/esm/parts/container/Container.js.map +2 -2
- package/dist/esm/parts/container/styled.js +5 -5
- package/dist/esm/parts/container/styled.js.map +2 -2
- package/dist/esm/parts/controls/Controls.js +10 -19
- package/dist/esm/parts/controls/Controls.js.map +2 -2
- package/dist/esm/parts/controls/styled.js +7 -7
- package/dist/esm/parts/controls/styled.js.map +2 -2
- package/dist/esm/parts/controls/useOnPillsNavigation.js +5 -13
- package/dist/esm/parts/controls/useOnPillsNavigation.js.map +2 -2
- package/dist/esm/parts/controls-input/ControlsInput.js +27 -20
- package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/esm/parts/controls-input/styled.js +6 -3
- package/dist/esm/parts/controls-input/styled.js.map +2 -2
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js +24 -16
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/parts/controls-input/useMaskedOnChange.js +11 -4
- package/dist/esm/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/esm/parts/menu-list/useItemRenderer.js +24 -13
- package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +5 -10
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
- package/dist/esm/parts/multi-selected-values-container/useGroupPills.js +10 -2
- package/dist/esm/parts/multi-selected-values-container/useGroupPills.js.map +2 -2
- package/dist/esm/parts/styled.js.map +2 -2
- package/dist/esm/utils/listHelper.js +2 -0
- package/dist/esm/utils/listHelper.js.map +2 -2
- package/dist/types/ComboBoxCTX.d.ts +3 -1
- package/dist/types/TruncatedText.d.ts +2 -1
- package/dist/types/config/useComboBox.d.ts +3 -1
- package/dist/types/parts/Section.d.ts +1 -0
- package/dist/types/parts/container/styled.d.ts +4 -4
- package/dist/types/parts/controls/styled.d.ts +7 -7
- package/dist/types/parts/controls-input/styled.d.ts +1 -1
- package/dist/types/parts/controls-input/useMaskedOnChange.d.ts +1 -1
- package/dist/types/parts/styled.d.ts +5 -0
- package/dist/types/utils/listHelper.d.ts +8 -0
- package/package.json +17 -17
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
2
|
+
import { isLocked, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { uid } from "uid";
|
|
5
5
|
import { ComboboxPropTypes, defaultProps } from "../react-desc-prop-types.js";
|
|
@@ -34,9 +34,13 @@ const useComboBox = (props) => {
|
|
|
34
34
|
forceFocusFirstOptionOnType,
|
|
35
35
|
inline,
|
|
36
36
|
readOnly,
|
|
37
|
+
disabled,
|
|
37
38
|
isMenuOpenableWithReadOnly
|
|
38
39
|
} = propsWithDefaults;
|
|
39
40
|
const instanceUid = useMemo(() => id || uid(5), [id]);
|
|
41
|
+
const shouldPreventContextMenuOpening = Boolean(applyAriaDisabled || readOnly) && !isMenuOpenableWithReadOnly;
|
|
42
|
+
const isInteractionLocked = isLocked({ disabled, applyAriaDisabled, readOnly });
|
|
43
|
+
const isMenuOpeningLocked = Boolean(disabled || shouldPreventContextMenuOpening);
|
|
40
44
|
const menuState = useMemo(() => {
|
|
41
45
|
if (isMenuOpen !== void 0) return isMenuOpen;
|
|
42
46
|
return showPopover;
|
|
@@ -73,7 +77,7 @@ const useComboBox = (props) => {
|
|
|
73
77
|
}, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);
|
|
74
78
|
const setMenuState = useCallback(
|
|
75
79
|
(newState, reason, e) => {
|
|
76
|
-
if (
|
|
80
|
+
if (shouldPreventContextMenuOpening) return;
|
|
77
81
|
if (onMenuChange !== void 0) onMenuChange(newState, reason, e);
|
|
78
82
|
setShowPopover(newState);
|
|
79
83
|
if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {
|
|
@@ -84,14 +88,21 @@ const useComboBox = (props) => {
|
|
|
84
88
|
setFocusOptionIdx("");
|
|
85
89
|
}
|
|
86
90
|
},
|
|
87
|
-
[
|
|
91
|
+
[
|
|
92
|
+
shouldPreventContextMenuOpening,
|
|
93
|
+
onMenuChange,
|
|
94
|
+
inputValue,
|
|
95
|
+
focusOptionIdx,
|
|
96
|
+
selectedValues,
|
|
97
|
+
correctOptions,
|
|
98
|
+
scrollOptionIntoView
|
|
99
|
+
]
|
|
88
100
|
);
|
|
89
101
|
useEffect(() => {
|
|
90
|
-
if (inline) {
|
|
102
|
+
if (inline && !disabled && !shouldPreventContextMenuOpening) {
|
|
91
103
|
setMenuState(true, "inline");
|
|
92
104
|
}
|
|
93
105
|
}, []);
|
|
94
|
-
const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;
|
|
95
106
|
const ctx = useMemo(
|
|
96
107
|
() => ({
|
|
97
108
|
props: { ...propsWithDefaults },
|
|
@@ -116,7 +127,9 @@ const useComboBox = (props) => {
|
|
|
116
127
|
correctOptions,
|
|
117
128
|
instanceUid,
|
|
118
129
|
optionsPerSection,
|
|
119
|
-
shouldPreventContextMenuOpening
|
|
130
|
+
shouldPreventContextMenuOpening,
|
|
131
|
+
isInteractionLocked,
|
|
132
|
+
isMenuOpeningLocked
|
|
120
133
|
}),
|
|
121
134
|
[
|
|
122
135
|
scrollOptionIntoView,
|
|
@@ -136,7 +149,9 @@ const useComboBox = (props) => {
|
|
|
136
149
|
internalRef,
|
|
137
150
|
instanceUid,
|
|
138
151
|
optionsPerSection,
|
|
139
|
-
shouldPreventContextMenuOpening
|
|
152
|
+
shouldPreventContextMenuOpening,
|
|
153
|
+
isInteractionLocked,
|
|
154
|
+
isMenuOpeningLocked
|
|
140
155
|
]
|
|
141
156
|
);
|
|
142
157
|
return ctx;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useComboBox.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,8BAA8B,sCAAsC;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { isLocked, useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n disabled,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n // applyAriaDisabled and readOnly are the same soft lock: both keep the menu closed unless isMenuOpenableWithReadOnly\n // (the listbox may expand to read)\n const shouldPreventContextMenuOpening = Boolean(applyAriaDisabled || readOnly) && !isMenuOpenableWithReadOnly;\n // PUI-16695: disabled blocks every action. applyAriaDisabled and readOnly block every change of the value, and block\n // opening the menu unless isMenuOpenableWithReadOnly is set (see above)\n const isInteractionLocked = isLocked({ disabled, applyAriaDisabled, readOnly });\n const isMenuOpeningLocked = Boolean(disabled || shouldPreventContextMenuOpening);\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (shouldPreventContextMenuOpening) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [\n shouldPreventContextMenuOpening,\n onMenuChange,\n inputValue,\n focusOptionIdx,\n selectedValues,\n correctOptions,\n scrollOptionIntoView,\n ],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n // setMenuState ignores the soft locks unless isMenuOpenableWithReadOnly; disabled (hard lock) is not, so it is gated here.\n useEffect(() => {\n if (inline && !disabled && !shouldPreventContextMenuOpening) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n isInteractionLocked,\n isMenuOpeningLocked,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n isInteractionLocked,\n isMenuOpeningLocked,\n ],\n );\n\n return ctx;\n};\n\nexport type UseComboBoxReturnType = ReturnType<typeof useComboBox>;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useContext } from "react";
|
|
4
|
-
import { styled } from "@elliemae/ds-system";
|
|
4
|
+
import { styled, ariaDisabledInteractionCss } from "@elliemae/ds-system";
|
|
5
5
|
import { DSButtonV3 } from "@elliemae/ds-button-v2";
|
|
6
6
|
import { ChevronSmallDown } from "@elliemae/ds-icons";
|
|
7
7
|
import { useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
@@ -23,7 +23,7 @@ const StyledDropDownButton = styled(DSButtonV3, {
|
|
|
23
23
|
fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral["400"] : theme.colors.brand["600"]};
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
${({ applyAriaDisabled }) => applyAriaDisabled &&
|
|
26
|
+
${({ applyAriaDisabled }) => applyAriaDisabled && ariaDisabledInteractionCss}
|
|
27
27
|
`;
|
|
28
28
|
const DropdownIndicator = () => {
|
|
29
29
|
const {
|
|
@@ -36,6 +36,7 @@ const DropdownIndicator = () => {
|
|
|
36
36
|
const handleOnClick = useCallback((e) => {
|
|
37
37
|
e.preventDefault();
|
|
38
38
|
}, []);
|
|
39
|
+
const isDropdownLocked = Boolean(applyAriaDisabled || readOnly) && !isMenuOpenableWithReadOnly;
|
|
39
40
|
return /* @__PURE__ */ jsx(
|
|
40
41
|
StyledDropDownButton,
|
|
41
42
|
{
|
|
@@ -46,14 +47,14 @@ const DropdownIndicator = () => {
|
|
|
46
47
|
"aria-controls": `combo-listbox-${instanceUid}`,
|
|
47
48
|
"aria-labelledby": "combo-label",
|
|
48
49
|
disabled,
|
|
49
|
-
"aria-disabled":
|
|
50
|
+
"aria-disabled": !disabled && isDropdownLocked ? true : void 0,
|
|
50
51
|
"aria-expanded": menuState,
|
|
51
52
|
"aria-haspopup": "listbox",
|
|
52
53
|
"aria-hidden": true,
|
|
53
54
|
buttonType: "icon",
|
|
54
55
|
tabIndex: -1,
|
|
55
56
|
size: "s",
|
|
56
|
-
applyAriaDisabled,
|
|
57
|
+
applyAriaDisabled: isDropdownLocked,
|
|
57
58
|
children: /* @__PURE__ */ jsx(ChevronSmallDown, { size: "s" })
|
|
58
59
|
}
|
|
59
60
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/DropdownIndicator.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV3, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean | undefined }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['600'])};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled &&
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled, ariaDisabledInteractionCss } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV3, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean | undefined }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['600'])};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && ariaDisabledInteractionCss}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props,\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n // applyAriaDisabled and readOnly are the same soft lock; an openable one still opens its menu, so it is not locked here\n const isDropdownLocked = Boolean(applyAriaDisabled || readOnly) && !isMenuOpenableWithReadOnly;\n\n return (\n <StyledDropDownButton\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n // button never use readOnly attribute: the soft lock is aria-disabled (Dimsum never writes aria-readonly)\n aria-disabled={!disabled && isDropdownLocked ? true : undefined}\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={isDropdownLocked}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkEjB;AAhEN,SAAgB,aAAa,kBAAkB;AAC/C,SAAS,QAAQ,kCAAkC;AACnD,SAAS,kBAAkB;AAC3B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,uBAAuB,OAAO,YAAY;AAAA,EAC9C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YASW,CAAC,EAAE,OAAO,SAAS,MAAO,WAAW,MAAM,OAAO,QAAQ,KAAK,IAAI,MAAM,OAAO,MAAM,KAAK,CAAE;AAAA;AAAA;AAAA,IAGrG,CAAC,EAAE,kBAAkB,MAAM,qBAAqB,0BAA0B;AAAA;AAGvE,MAAM,oBAAoB,MAAmB;AAClD,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,UAAU,mBAAmB,UAAU,2BAA2B;AAAA,IAC3E;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBACJ,YAAY,CAAC,MAAM;AACjB,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAGP,QAAM,mBAAmB,QAAQ,qBAAqB,QAAQ,KAAK,CAAC;AAEpE,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,MACT,eAAa,mBAAmB;AAAA,MAChC,iBAAe,iBAAiB,WAAW;AAAA,MAC3C,mBAAgB;AAAA,MAChB;AAAA,MAEA,iBAAe,CAAC,YAAY,mBAAmB,OAAO;AAAA,MACtD,iBAAe;AAAA,MACf,iBAAc;AAAA,MACd,eAAW;AAAA,MACX,YAAW;AAAA,MACX,UAAU;AAAA,MACV,MAAK;AAAA,MACL,mBAAmB;AAAA,MAEnB,8BAAC,oBAAiB,MAAK,KAAI;AAAA;AAAA,EAC7B;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -5,6 +5,7 @@ import React2 from "react";
|
|
|
5
5
|
import { styled } from "@elliemae/ds-system";
|
|
6
6
|
import { DSTypography } from "@elliemae/ds-typography";
|
|
7
7
|
import { Separator } from "@elliemae/ds-menu-items";
|
|
8
|
+
import { omitLockedHandlers } from "@elliemae/ds-props-helpers";
|
|
8
9
|
import { MENU_OPTION_TYPES } from "../constants.js";
|
|
9
10
|
import { ComboboxDataTestid } from "../ComboboxDataTestids.js";
|
|
10
11
|
import { isSelected } from "../utils/listHelper.js";
|
|
@@ -31,7 +32,8 @@ const Section = React2.memo((props) => {
|
|
|
31
32
|
options,
|
|
32
33
|
handleClick,
|
|
33
34
|
getOwnerProps,
|
|
34
|
-
getOwnerPropsArguments
|
|
35
|
+
getOwnerPropsArguments,
|
|
36
|
+
isInteractionLocked
|
|
35
37
|
} = props;
|
|
36
38
|
const id = `${label.replace(/ /g, "")}-section`;
|
|
37
39
|
const CBItem = Array.isArray(selectedValues) ? StyledMultiMenuItem : StyledSingleMenuItem;
|
|
@@ -72,6 +74,11 @@ const Section = React2.memo((props) => {
|
|
|
72
74
|
if (type === MENU_OPTION_TYPES.SEPARATOR) {
|
|
73
75
|
return /* @__PURE__ */ jsx(Separator, {}, dsId);
|
|
74
76
|
}
|
|
77
|
+
const {
|
|
78
|
+
onClick: consumerOnClick,
|
|
79
|
+
onMouseDown: consumerOnMouseDown,
|
|
80
|
+
...restHandlers
|
|
81
|
+
} = omitLockedHandlers(rest, Boolean(isInteractionLocked || disabled || applyAriaDisabled || readOnly));
|
|
75
82
|
return /* @__PURE__ */ createElement(
|
|
76
83
|
CBItem,
|
|
77
84
|
{
|
|
@@ -81,16 +88,19 @@ const Section = React2.memo((props) => {
|
|
|
81
88
|
label: optionLabel,
|
|
82
89
|
dataTestid: ComboboxDataTestid.OPTION,
|
|
83
90
|
disabled,
|
|
84
|
-
applyAriaDisabled: applyAriaDisabled || readOnly,
|
|
85
|
-
onClick: (e) => {
|
|
86
|
-
if (applyAriaDisabled) return;
|
|
87
|
-
handleClick(option, e);
|
|
88
|
-
},
|
|
89
|
-
onMouseDown: handleOnMouseDown,
|
|
91
|
+
applyAriaDisabled: Boolean(applyAriaDisabled || readOnly || isInteractionLocked),
|
|
90
92
|
isActive: dsId === focusOptionIdx,
|
|
91
93
|
isSelected: option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option),
|
|
92
94
|
tabIndex: -1,
|
|
93
|
-
...
|
|
95
|
+
...restHandlers,
|
|
96
|
+
onClick: (e) => {
|
|
97
|
+
consumerOnClick?.(e);
|
|
98
|
+
handleClick(option, e);
|
|
99
|
+
},
|
|
100
|
+
onMouseDown: (e) => {
|
|
101
|
+
consumerOnMouseDown?.(e);
|
|
102
|
+
handleOnMouseDown(e);
|
|
103
|
+
},
|
|
94
104
|
key: option.dsId,
|
|
95
105
|
dsId: option.dsId
|
|
96
106
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/Section.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nimport { StyledSingleMenuItem, StyledMultiMenuItem } from './menu-list/styled.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles?: React.CSSProperties;\n innerRef?: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.OptionTypes[];\n handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n display: grid;\n align-items: center;\n`;\n\n/**\n * The 32px group-label row height comes from this label alone: 8px top + 8px bottom padding +\n * the b3-strong line-height (~16px) = 32px. No min-height needed here.\n *\n * This is one of four independent reimplementations of the section/group-label row \u2014 the menu-items\n * path (ds-menu-items-commons StyledSectionWrapper) and ds-menu-button reach the same 32px via a\n * wrapper min-height instead. Keep all four aligned (PUI-18609); see KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nconst StyledSectionLabel = styled(DSTypography, { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 8px 16px;\n`;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem: React.ComponentType<React.ComponentProps<typeof StyledSingleMenuItem>> = Array.isArray(selectedValues)\n ? StyledMultiMenuItem\n : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n component=\"header\"\n variant=\"b3-strong\"\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { Separator } from '@elliemae/ds-menu-items';\nimport { omitLockedHandlers } from '@elliemae/ds-props-helpers';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nimport { StyledSingleMenuItem, StyledMultiMenuItem } from './menu-list/styled.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles?: React.CSSProperties;\n innerRef?: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.OptionTypes[];\n handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n // the combobox-level lock (disabled / applyAriaDisabled / readOnly), see ItemRenderer.handleClick\n isInteractionLocked?: boolean;\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n display: grid;\n align-items: center;\n`;\n\n/**\n * The 32px group-label row height comes from this label alone: 8px top + 8px bottom padding +\n * the b3-strong line-height (~16px) = 32px. No min-height needed here.\n *\n * This is one of four independent reimplementations of the section/group-label row \u2014 the menu-items\n * path (ds-menu-items-commons StyledSectionWrapper) and ds-menu-button reach the same 32px via a\n * wrapper min-height instead. Keep all four aligned (PUI-18609); see KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nconst StyledSectionLabel = styled(DSTypography, { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 8px 16px;\n`;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n isInteractionLocked,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem: React.ComponentType<React.ComponentProps<typeof StyledSingleMenuItem>> = Array.isArray(selectedValues)\n ? StyledMultiMenuItem\n : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n component=\"header\"\n variant=\"b3-strong\"\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n // the option's own consumer handlers run before the component's, and are withheld while the combobox or this\n // option is locked\n const {\n onClick: consumerOnClick,\n onMouseDown: consumerOnMouseDown,\n ...restHandlers\n } = omitLockedHandlers(rest, Boolean(isInteractionLocked || disabled || applyAriaDisabled || readOnly));\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={Boolean(applyAriaDisabled || readOnly || isInteractionLocked)}\n isActive={dsId === focusOptionIdx}\n isSelected={option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option)}\n tabIndex={-1}\n {...restHandlers}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n consumerOnClick?.(e);\n handleClick(option, e);\n }}\n onMouseDown={(e: React.MouseEvent<HTMLLIElement>) => {\n consumerOnMouseDown?.(e);\n handleOnMouseDown(e);\n }}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqEnB,SAQE,KARF;AA4CM;AAjHV,OAAOA,YAAW;AAClB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,0BAA0B;AAEnC,SAAS,yBAAyB;AAElC,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB,2BAA2B;AACxD,SAAS,sBAAsB,2BAA2B;AAiB1D,MAAM,uBAAuB,OAAO,WAAW,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AActH,MAAM,qBAAqB,OAAO,cAAc,EAAE,MAAM,oBAAoB,MAAM,oBAAoB,cAAc,CAAC;AAAA;AAAA;AAAA;AAAA;AAM9G,MAAM,UAAUA,OAAM,KAAK,CAAC,UAAwB;AACzD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,KAAK,GAAG,MAAM,QAAQ,MAAM,EAAE,CAAC;AACrC,QAAM,SAAiF,MAAM,QAAQ,cAAc,IAC/G,sBACA;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,mBAAiB;AAAA,MACjB,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,SAAQ;AAAA,YACR;AAAA,YACA,MAAK;AAAA,YACL;AAAA,YACA;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACC,SAAS,IAAI,CAAC,WAAW;AACxB,gBAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA,OAAO;AAAA,YACP;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,GAAG;AAAA,UACL,IAAI;AAEJ,cAAI,SAAS,kBAAkB,WAAW;AACxC,mBAAO,oBAAC,eAAe,IAAM;AAAA,UAC/B;AAIA,gBAAM;AAAA,YACJ,SAAS;AAAA,YACT,aAAa;AAAA,YACb,GAAG;AAAA,UACL,IAAI,mBAAmB,MAAM,QAAQ,uBAAuB,YAAY,qBAAqB,QAAQ,CAAC;AAEtG,iBACE;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA,OAAO;AAAA,cACP,YAAY,mBAAmB;AAAA,cAC/B;AAAA,cACA,mBAAmB,QAAQ,qBAAqB,YAAY,mBAAmB;AAAA,cAC/E,UAAU,SAAS;AAAA,cACnB,YAAY,OAAO,SAAS,kBAAkB,UAAU,WAAW,gBAAgB,MAAM;AAAA,cACzF,UAAU;AAAA,cACT,GAAG;AAAA,cACJ,SAAS,CAAC,MAA0C;AAClD,kCAAkB,CAAC;AACnB,4BAAY,QAAQ,CAAC;AAAA,cACvB;AAAA,cACA,aAAa,CAAC,MAAuC;AACnD,sCAAsB,CAAC;AACvB,kCAAkB,CAAC;AAAA,cACrB;AAAA,cACA,KAAK,OAAO;AAAA,cACZ,MAAM,OAAO;AAAA;AAAA,UACf;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -18,7 +18,9 @@ const Container = () => {
|
|
|
18
18
|
placementOrderPreference,
|
|
19
19
|
isLoading,
|
|
20
20
|
isSkeleton,
|
|
21
|
+
disabled,
|
|
21
22
|
applyAriaDisabled,
|
|
23
|
+
readOnly,
|
|
22
24
|
popperProps
|
|
23
25
|
} = props;
|
|
24
26
|
const globalAttributes = useGetGlobalAttributes(props);
|
|
@@ -62,7 +64,8 @@ const Container = () => {
|
|
|
62
64
|
"data-testid": dataTestId ?? ComboboxDataTestid.CONTAINER,
|
|
63
65
|
innerRef: refs.setReference,
|
|
64
66
|
className,
|
|
65
|
-
|
|
67
|
+
$disabled: Boolean(disabled),
|
|
68
|
+
$applyAriaDisabled: Boolean(applyAriaDisabled || readOnly),
|
|
66
69
|
...xStyledProps,
|
|
67
70
|
getOwnerProps,
|
|
68
71
|
getOwnerPropsArguments,
|
|
@@ -85,7 +88,7 @@ const Container = () => {
|
|
|
85
88
|
{
|
|
86
89
|
tabIndex: -1,
|
|
87
90
|
onMouseDown: handleMouseDown,
|
|
88
|
-
applyAriaDisabled: applyAriaDisabled
|
|
91
|
+
$applyAriaDisabled: Boolean(applyAriaDisabled || readOnly),
|
|
89
92
|
getOwnerProps,
|
|
90
93
|
getOwnerPropsArguments,
|
|
91
94
|
children: /* @__PURE__ */ jsx(MenuList, {})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/container/Container.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { Controls } from '../controls/index.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\n\nexport const Container = (): JSX.Element => {\n const { props, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const {\n inline,\n startPlacementPreference,\n placementOrderPreference,\n isLoading,\n isSkeleton,\n applyAriaDisabled,\n popperProps,\n } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n // In inline mode the combobox is rendered inside a consumer-controlled FloatingWrapper.\n // The consumer owns dismissal; if we closed the internal menuState here, the outer wrapper\n // would stay open and the user would see the input without options (\"weird state\").\n const handleClickOutside = useCallback(() => {\n if (inline) return;\n setMenuState(false, 'blur');\n }, [setMenuState, inline]);\n\n const config = useMemo(\n () => ({\n placement: startPlacementPreference,\n withoutAnimation: true,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n externallyControlledIsOpen: menuState,\n // Gate on `!inline` \u2014 in inline mode the consumer's outer wrapper handles dismissal.\n onClickOutside: inline ? undefined : handleClickOutside,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { Controls } from '../controls/index.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\n\nexport const Container = (): JSX.Element => {\n const { props, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const {\n inline,\n startPlacementPreference,\n placementOrderPreference,\n isLoading,\n isSkeleton,\n disabled,\n applyAriaDisabled,\n readOnly,\n popperProps,\n } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n // In inline mode the combobox is rendered inside a consumer-controlled FloatingWrapper.\n // The consumer owns dismissal; if we closed the internal menuState here, the outer wrapper\n // would stay open and the user would see the input without options (\"weird state\").\n const handleClickOutside = useCallback(() => {\n if (inline) return;\n setMenuState(false, 'blur');\n }, [setMenuState, inline]);\n\n const config = useMemo(\n () => ({\n placement: startPlacementPreference,\n withoutAnimation: true,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n externallyControlledIsOpen: menuState,\n // Gate on `!inline` \u2014 in inline mode the consumer's outer wrapper handles dismissal.\n onClickOutside: inline ? undefined : handleClickOutside,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n // readOnly gets the same not-allowed cursor as applyAriaDisabled (PUI-16695: synonyms)\n $disabled={Boolean(disabled)}\n $applyAriaDisabled={Boolean(applyAriaDisabled || readOnly)}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper\n tabIndex={-1}\n onMouseDown={handleMouseDown}\n $applyAriaDisabled={Boolean(applyAriaDisabled || readOnly)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4EnB,SAWE,KAXF;AAgBI;AA1FR,SAAS,iBAAiB,0BAA0B;AACpD,SAAS,wBAAwB,oBAAoB,qBAAqB;AAC1E,SAAgB,aAAa,YAAY,WAAW,eAAe;AACnE,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;AACzB,SAAS,iBAAiB,2BAA2B;AAE9C,MAAM,YAAY,MAAmB;AAC1C,QAAM,EAAE,OAAO,cAAc,UAAU,IAAI,WAAW,eAAe;AAErE,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,mBAAmB,uBAAuB,KAAK;AAGrD,QAAM,EAAE,QAAQ,GAAG,aAAa,IAAI,mBAAmB,KAAK;AAC5D,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBAAgB,SAAS,SAAS,QAAkB,EAAE,IAAI;AAEhE,QAAM,EAAE,WAAW,eAAe,WAAW,IAAI;AACjD,QAAM,kBAAkB,YAAY,CAAC,MAAwB;AAC3D,MAAE,eAAe;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACd,UAAM,wBAAwB,MAAM;AAClC,UAAI,UAAW,cAAa,OAAO,MAAM;AAAA,IAC3C;AAEA,WAAO,iBAAiB,QAAQ,qBAAqB;AAErD,WAAO,MAAM;AACX,aAAO,oBAAoB,QAAQ,qBAAqB;AAAA,IAC1D;AAAA,EACF,GAAG,CAAC,WAAW,YAAY,CAAC;AAK5B,QAAM,qBAAqB,YAAY,MAAM;AAC3C,QAAI,OAAQ;AACZ,iBAAa,OAAO,MAAM;AAAA,EAC5B,GAAG,CAAC,cAAc,MAAM,CAAC;AAEzB,QAAM,SAAS;AAAA,IACb,OAAO;AAAA,MACL,WAAW;AAAA,MACX,kBAAkB;AAAA,MAClB;AAAA,MACA,QAAQ;AAAA,MACR,cAAc,CAAC,GAAG,CAAC;AAAA,MACnB,4BAA4B;AAAA;AAAA,MAE5B,gBAAgB,SAAS,SAAY;AAAA,IACvC;AAAA,IACA,CAAC,0BAA0B,0BAA0B,eAAe,WAAW,QAAQ,kBAAkB;AAAA,EAC3G;AAEA,QAAM,EAAE,MAAM,gBAAgB,QAAQ,IAAI,mBAAmB,MAAM;AAEnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,cAAc,mBAAmB;AAAA,MAC9C,UAAU,KAAK;AAAA,MACf;AAAA,MAEA,WAAW,QAAQ,QAAQ;AAAA,MAC3B,oBAAoB,QAAQ,qBAAqB,QAAQ;AAAA,MACxD,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA,4BAAC,cAAW;AAAA,QACZ,oBAAC,YAAS;AAAA,QAET,aAAa,SAAS,oBAAC,YAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG;AAAA,YACJ,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,aAAa;AAAA,cACb,oBAAoB,QAAQ,qBAAqB,QAAQ;AAAA,cACzD;AAAA,cACA;AAAA,cAEA,8BAAC,YAAS;AAAA;AAAA,UACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { styled, xStyledCommonProps } from "@elliemae/ds-system";
|
|
2
|
+
import { styled, xStyledCommonProps, lockedStateInteractionCss } from "@elliemae/ds-system";
|
|
3
3
|
import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../../constants/index.js";
|
|
4
4
|
const StyledContainer = styled("div", {
|
|
5
5
|
name: DSFormComboboxName,
|
|
6
6
|
slot: FORM_COMBOBOX_SLOTS.ROOT
|
|
7
7
|
})`
|
|
8
8
|
position: relative;
|
|
9
|
-
cursor:
|
|
10
|
-
cursor: ${({ applyAriaDisabled }) => applyAriaDisabled ? "not-allowed" : "default"};
|
|
9
|
+
cursor: default;
|
|
11
10
|
min-width: 64px;
|
|
12
11
|
${xStyledCommonProps}
|
|
12
|
+
${lockedStateInteractionCss}
|
|
13
13
|
`;
|
|
14
14
|
const StyledPopperWrapper = styled("div", {
|
|
15
15
|
name: DSFormComboboxName,
|
|
16
16
|
slot: FORM_COMBOBOX_SLOTS.POPPER_WRAPPER
|
|
17
17
|
})`
|
|
18
18
|
position: relative;
|
|
19
|
-
cursor:
|
|
20
|
-
cursor: ${({ applyAriaDisabled }) => applyAriaDisabled ? "not-allowed" : "default"};
|
|
19
|
+
cursor: default;
|
|
21
20
|
overflow: auto;
|
|
21
|
+
${lockedStateInteractionCss}
|
|
22
22
|
`;
|
|
23
23
|
export {
|
|
24
24
|
StyledContainer,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/container/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\nimport type {} from '@xstyled/system';\n\nexport const StyledContainer = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.ROOT,\n})<XstyledProps & { disabled?: boolean; applyAriaDisabled: boolean }>`\n position: relative;\n cursor:
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled, xStyledCommonProps, lockedStateInteractionCss } from '@elliemae/ds-system';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\nimport type {} from '@xstyled/system';\n\nexport const StyledContainer = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.ROOT,\n})<XstyledProps & { $disabled?: boolean; $applyAriaDisabled: boolean }>`\n position: relative;\n cursor: default;\n min-width: 64px;\n ${xStyledCommonProps}\n ${lockedStateInteractionCss}\n`;\n\nexport const StyledPopperWrapper = styled('div', {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.POPPER_WRAPPER,\n})<{ $disabled?: boolean; $applyAriaDisabled: boolean }>`\n position: relative;\n cursor: default;\n overflow: auto;\n ${lockedStateInteractionCss}\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,oBAAoB,iCAAiC;AAEtE,SAAS,oBAAoB,2BAA2B;AAIjD,MAAM,kBAAkB,OAAO,OAAO;AAAA,EAC3C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,kBAAkB;AAAA,IAClB,yBAAyB;AAAA;AAGtB,MAAM,sBAAsB,OAAO,OAAO;AAAA,EAC/C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;AAAA;AAAA,IAIG,yBAAyB;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -35,7 +35,7 @@ const Controls = () => {
|
|
|
35
35
|
const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);
|
|
36
36
|
const handleOnClick = useCallback(() => {
|
|
37
37
|
if (disabled) return;
|
|
38
|
-
if (
|
|
38
|
+
if (shouldPreventContextMenuOpening) {
|
|
39
39
|
internalRef.current?.focus();
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
@@ -61,7 +61,6 @@ const Controls = () => {
|
|
|
61
61
|
]);
|
|
62
62
|
const handleOnPillsClick = useCallback(
|
|
63
63
|
(e) => {
|
|
64
|
-
if (applyAriaDisabled) return;
|
|
65
64
|
if (menuState || disabled || shouldPreventContextMenuOpening) {
|
|
66
65
|
e.stopPropagation();
|
|
67
66
|
} else {
|
|
@@ -69,7 +68,7 @@ const Controls = () => {
|
|
|
69
68
|
setMenuState(true, "pill-click");
|
|
70
69
|
}
|
|
71
70
|
},
|
|
72
|
-
[
|
|
71
|
+
[menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening]
|
|
73
72
|
);
|
|
74
73
|
const handleOnMouseDown = useCallback(
|
|
75
74
|
(e) => {
|
|
@@ -90,16 +89,16 @@ const Controls = () => {
|
|
|
90
89
|
getOwnerProps,
|
|
91
90
|
getOwnerPropsArguments,
|
|
92
91
|
innerRef: controlsWrapperRef,
|
|
93
|
-
readOnly: readOnly ?? false,
|
|
92
|
+
$readOnly: readOnly ?? false,
|
|
94
93
|
cols,
|
|
95
|
-
disabled: disabled ?? false,
|
|
96
|
-
applyAriaDisabled: applyAriaDisabled ?? false,
|
|
94
|
+
$disabled: disabled ?? false,
|
|
95
|
+
$applyAriaDisabled: applyAriaDisabled ?? false,
|
|
97
96
|
hasError: hasError ?? false,
|
|
98
97
|
inline: inline ?? false,
|
|
99
98
|
onClick: handleOnClick,
|
|
100
99
|
onMouseDown: handleOnMouseDown,
|
|
101
100
|
onKeyDown: onKeyDownPills,
|
|
102
|
-
"aria-disabled": applyAriaDisabled,
|
|
101
|
+
"aria-disabled": applyAriaDisabled || readOnly ? true : void 0,
|
|
103
102
|
"data-testid": ComboboxDataTestid.CONTROLS_WRAPPER,
|
|
104
103
|
children: [
|
|
105
104
|
!inline && /* @__PURE__ */ jsx(
|
|
@@ -113,10 +112,10 @@ const Controls = () => {
|
|
|
113
112
|
children: Array.isArray(selectedValues) ? /* @__PURE__ */ jsx(MultiSelectedValuesContainer, {}) : /* @__PURE__ */ jsx(
|
|
114
113
|
StyledSingleSelectWraper,
|
|
115
114
|
{
|
|
116
|
-
readOnly: readOnly ?? false,
|
|
115
|
+
$readOnly: readOnly ?? false,
|
|
117
116
|
"data-testid": ComboboxDataTestid.SELECTED_VALUES,
|
|
118
|
-
disabled: disabled ?? false,
|
|
119
|
-
applyAriaDisabled: applyAriaDisabled ?? false,
|
|
117
|
+
$disabled: disabled ?? false,
|
|
118
|
+
$applyAriaDisabled: applyAriaDisabled ?? false,
|
|
120
119
|
getOwnerProps,
|
|
121
120
|
children: selectedValues && inputValue === "" ? /* @__PURE__ */ jsx(TruncatedText, { value: selectedValues.label }) : null
|
|
122
121
|
}
|
|
@@ -133,15 +132,7 @@ const Controls = () => {
|
|
|
133
132
|
justifyContent: "flex-end",
|
|
134
133
|
getOwnerProps,
|
|
135
134
|
children: [
|
|
136
|
-
/* @__PURE__ */ jsx(
|
|
137
|
-
StyleHeaderActionsSeparator,
|
|
138
|
-
{
|
|
139
|
-
disabled,
|
|
140
|
-
applyAriaDisabled,
|
|
141
|
-
readOnly,
|
|
142
|
-
getOwnerProps
|
|
143
|
-
}
|
|
144
|
-
),
|
|
135
|
+
/* @__PURE__ */ jsx(StyleHeaderActionsSeparator, { getOwnerProps }),
|
|
145
136
|
/* @__PURE__ */ jsx(DropdownIndicator, {})
|
|
146
137
|
]
|
|
147
138
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/controls/Controls.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { TruncatedText } from '../../TruncatedText.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { TruncatedText } from '../../TruncatedText.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={controlsWrapperRef}\n $readOnly={readOnly ?? false}\n cols={cols}\n $disabled={disabled ?? false}\n $applyAriaDisabled={applyAriaDisabled ?? false}\n hasError={hasError ?? false}\n inline={inline ?? false}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled || readOnly ? true : undefined}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection\n variant=\"b2\"\n component=\"div\"\n innerRef={selectedOptionsRef}\n onClick={handleOnPillsClick}\n getOwnerProps={getOwnerProps}\n >\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n $readOnly={readOnly ?? false}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n $disabled={disabled ?? false}\n $applyAriaDisabled={applyAriaDisabled ?? false}\n getOwnerProps={getOwnerProps}\n >\n {selectedValues && inputValue === '' ? <TruncatedText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n getOwnerProps={getOwnerProps}\n >\n <StyleHeaderActionsSeparator getOwnerProps={getOwnerProps} />\n <DropdownIndicator />\n </StyledHeaderActionsWrapper>\n )}\n </StyledControlsWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0HX,cAoBJ,YApBI;AAxHZ,SAAS,qBAAqB;AAC9B,SAAgB,aAAa,YAAY,eAAe;AACxD,OAAO,qBAAqB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,oCAAoC;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AAE9B,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,QAAQ,UAAU,UAAU,gBAAgB,mBAAmB,UAAU,2BAA2B;AAAA,IAC7G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,EAAE,eAAe,uBAAuB,IAAI,cAAc,KAAK;AAErE,QAAM,gBAAgB,YAAY,MAAM;AACtC,QAAI,SAAU;AACd,QAAI,iCAAiC;AACnC,kBAAY,SAAS,MAAM;AAC3B;AAAA,IACF;AACA,QAAI,YAAY,aAAa,CAAC,QAAQ;AACpC,mBAAa,OAAO,OAAO;AAC3B,wBAAkB,EAAE;AACpB,kBAAY,SAAS,KAAK;AAC1B;AAAA,IACF;AACA,gBAAY,SAAS,MAAM;AAC3B,iBAAa,MAAM,OAAO;AAAA,EAG5B,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAGD,QAAM,qBAA8C;AAAA,IAClD,CAAC,MAAM;AACL,UAAI,aAAa,YAAY,iCAAiC;AAC5D,UAAE,gBAAgB;AAAA,MACpB,OAAO;AACL,oBAAY,SAAS,MAAM;AAC3B,qBAAa,MAAM,YAAY;AAAA,MACjC;AAAA,IACF;AAAA,IACA,CAAC,WAAW,UAAU,aAAa,cAAc,+BAA+B;AAAA,EAClF;AAGA,QAAM,oBAA6C;AAAA,IACjD,CAAC,MAAM;AACL,UAAI,SAAS,kBAAkB,YAAY,WAAW,QAAQ;AAC5D,UAAE,eAAe;AAAA,MACnB;AAAA,IACF;AAAA,IACA,CAAC,aAAa,MAAM;AAAA,EACtB;AAEA,QAAM,EAAE,eAAe,IAAI,qBAAqB;AAEhD,QAAM,OAAO;AAAA,IACX,MAAO,CAAC,SAAS,CAAC,2BAA2B,sBAAsB,OAAO,UAAU,IAAI,CAAC,mBAAmB;AAAA,IAC5G,CAAC,MAAM;AAAA,EACT;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,WAAW,YAAY;AAAA,MACvB;AAAA,MACA,WAAW,YAAY;AAAA,MACvB,oBAAoB,qBAAqB;AAAA,MACzC,UAAU,YAAY;AAAA,MACtB,QAAQ,UAAU;AAAA,MAClB,SAAS;AAAA,MACT,aAAa;AAAA,MACb,WAAW;AAAA,MACX,iBAAe,qBAAqB,WAAW,OAAO;AAAA,MACtD,eAAa,mBAAmB;AAAA,MAE/B;AAAA,SAAC,UACA;AAAA,UAAC;AAAA;AAAA,YACC,SAAQ;AAAA,YACR,WAAU;AAAA,YACV,UAAU;AAAA,YACV,SAAS;AAAA,YACT;AAAA,YAEC,gBAAM,QAAQ,cAAc,IAC3B,oBAAC,gCAA6B,IAE9B;AAAA,cAAC;AAAA;AAAA,gBACC,WAAW,YAAY;AAAA,gBAEvB,eAAa,mBAAmB;AAAA,gBAChC,WAAW,YAAY;AAAA,gBACvB,oBAAoB,qBAAqB;AAAA,gBACzC;AAAA,gBAEC,4BAAkB,eAAe,KAAK,oBAAC,iBAAc,OAAO,eAAe,OAAO,IAAK;AAAA;AAAA,YAC1F;AAAA;AAAA,QAEJ;AAAA,QAGF,oBAAC,iBAAc;AAAA,QAEf,oBAAC,SAAI;AAAA,QACJ,CAAC,UACA;AAAA,UAAC;AAAA;AAAA,YACC,cAAa;AAAA,YACb,MAAM,CAAC,eAAe,0BAA0B;AAAA,YAChD,gBAAe;AAAA,YACf;AAAA,YAEA;AAAA,kCAAC,+BAA4B,eAA8B;AAAA,cAC3D,oBAAC,qBAAkB;AAAA;AAAA;AAAA,QACrB;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -9,14 +9,14 @@ const readOnlyBorder = css`
|
|
|
9
9
|
`;
|
|
10
10
|
const borderStyles = css`
|
|
11
11
|
border: 1px solid ${({ hasError, theme }) => hasError ? theme.colors.danger[900] : theme.colors.neutral[400]};
|
|
12
|
-
${({ readOnly, applyAriaDisabled }) => readOnly || applyAriaDisabled ? readOnlyBorder : ""}
|
|
12
|
+
${({ $readOnly, $applyAriaDisabled }) => $readOnly || $applyAriaDisabled ? readOnlyBorder : ""}
|
|
13
13
|
`;
|
|
14
14
|
const backgroundStyles = css`
|
|
15
|
-
background: ${({ disabled, applyAriaDisabled, readOnly, theme }) => {
|
|
16
|
-
if (readOnly || applyAriaDisabled) {
|
|
15
|
+
background: ${({ $disabled, $applyAriaDisabled, $readOnly, theme }) => {
|
|
16
|
+
if ($readOnly || $applyAriaDisabled) {
|
|
17
17
|
return theme.colors.neutral["050"];
|
|
18
18
|
}
|
|
19
|
-
if (disabled) {
|
|
19
|
+
if ($disabled) {
|
|
20
20
|
return theme.colors.neutral["080"];
|
|
21
21
|
}
|
|
22
22
|
return "#ffffff";
|
|
@@ -47,7 +47,7 @@ const StyledControlsWrapper = styled(Grid, {
|
|
|
47
47
|
margin: ${({ inline }) => inline ? "8px 16px" : ""};
|
|
48
48
|
${borderStyles}
|
|
49
49
|
&:hover {
|
|
50
|
-
${({ disabled }) =>
|
|
50
|
+
${({ $disabled }) => !$disabled ? hoverBorder : ""}
|
|
51
51
|
}
|
|
52
52
|
&:focus-within {
|
|
53
53
|
${focusBorder}
|
|
@@ -60,8 +60,8 @@ const StyledSingleSelectWraper = styled("div", {
|
|
|
60
60
|
display: flex;
|
|
61
61
|
width: 100%;
|
|
62
62
|
align-items: center;
|
|
63
|
-
color: ${({ disabled, readOnly, theme }) => disabled || readOnly ? theme.colors.neutral["600"] : theme.colors.neutral["700"]};
|
|
64
|
-
user-select: ${({ disabled, applyAriaDisabled }) => disabled || applyAriaDisabled ? "none" : ""};
|
|
63
|
+
color: ${({ $disabled, $readOnly, $applyAriaDisabled, theme }) => $disabled || $readOnly || $applyAriaDisabled ? theme.colors.neutral["600"] : theme.colors.neutral["700"]};
|
|
64
|
+
user-select: ${({ $disabled, $applyAriaDisabled }) => $disabled || $applyAriaDisabled ? "none" : ""};
|
|
65
65
|
`;
|
|
66
66
|
const StyledSelection = styled(DSTypography, {
|
|
67
67
|
name: DSFormComboboxName,
|