@elliemae/ds-form-combobox 3.80.0-next.71 → 3.80.0-next.75
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 +15 -15
|
@@ -3,23 +3,24 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useMemo, useContext, useCallback } from "react";
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
5
|
import { Separator } from "@elliemae/ds-menu-items";
|
|
6
|
-
import { useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
6
|
+
import { omitLockedHandlers, useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
7
7
|
import { Section } from "../Section.js";
|
|
8
8
|
import { ComboBoxContext } from "../../ComboBoxCTX.js";
|
|
9
9
|
import { StyledCreatableLabel, StyledCreatableValue, StyledSingleMenuItem, StyledMultiMenuItem } from "./styled.js";
|
|
10
|
-
import { isSelected, getSuggestedValueOnChange } from "../../utils/listHelper.js";
|
|
10
|
+
import { isSelected, getSuggestedValueOnChange, isOptionLocked } from "../../utils/listHelper.js";
|
|
11
11
|
import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
|
|
12
12
|
import { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from "../../constants.js";
|
|
13
13
|
const ItemRenderer = ({ index, extraItemProps }) => {
|
|
14
14
|
const {
|
|
15
15
|
props,
|
|
16
|
-
props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions
|
|
16
|
+
props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions },
|
|
17
17
|
setMenuState,
|
|
18
18
|
inputValue,
|
|
19
19
|
focusOptionIdx,
|
|
20
20
|
setInputValue,
|
|
21
21
|
setFocusOptionIdx,
|
|
22
|
-
optionsPerSection
|
|
22
|
+
optionsPerSection,
|
|
23
|
+
isInteractionLocked
|
|
23
24
|
} = useContext(ComboBoxContext);
|
|
24
25
|
const { getOwnerProps } = useOwnerProps(props);
|
|
25
26
|
const getOwnerPropsArguments = useCallback(
|
|
@@ -32,16 +33,17 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
32
33
|
const multiple = Array.isArray(selectedValues);
|
|
33
34
|
const CBItem = multiple ? StyledMultiMenuItem : StyledSingleMenuItem;
|
|
34
35
|
const handleOnCreateClick = useCallback(() => {
|
|
36
|
+
if (isInteractionLocked) return;
|
|
35
37
|
if (inputValue && onCreate) {
|
|
36
38
|
onCreate(inputValue);
|
|
37
39
|
setFocusOptionIdx("");
|
|
38
40
|
setInputValue("");
|
|
39
41
|
if (onFilter) onFilter(allOptions, "");
|
|
40
42
|
}
|
|
41
|
-
}, [onFilter, onCreate, inputValue, allOptions, setInputValue, setFocusOptionIdx]);
|
|
43
|
+
}, [isInteractionLocked, onFilter, onCreate, inputValue, allOptions, setInputValue, setFocusOptionIdx]);
|
|
42
44
|
const handleClick = useCallback(
|
|
43
45
|
(currentOption, e) => {
|
|
44
|
-
if (
|
|
46
|
+
if (isInteractionLocked || isOptionLocked(currentOption)) return;
|
|
45
47
|
if (currentOption.type === MENU_OPTION_TYPES.OPTION) {
|
|
46
48
|
if (!currentOption.disabled) {
|
|
47
49
|
if (onFilter) onFilter(allOptions, inputValue);
|
|
@@ -59,7 +61,7 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
59
61
|
e.stopPropagation();
|
|
60
62
|
e.preventDefault();
|
|
61
63
|
},
|
|
62
|
-
[onFilter, selectedValues, allOptions, onChange, setMenuState, multiple]
|
|
64
|
+
[isInteractionLocked, onFilter, selectedValues, allOptions, onChange, setMenuState, multiple]
|
|
63
65
|
);
|
|
64
66
|
const handleOnMouseDown = useCallback((e) => {
|
|
65
67
|
e.preventDefault();
|
|
@@ -67,12 +69,17 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
67
69
|
return useMemo(() => {
|
|
68
70
|
if (option) {
|
|
69
71
|
const { dsId, type, disabled, applyAriaDisabled, readOnly: itemReadOnly, ...rest } = option;
|
|
72
|
+
const {
|
|
73
|
+
onClick: consumerOnClick,
|
|
74
|
+
onMouseDown: consumerOnMouseDown,
|
|
75
|
+
...restHandlers
|
|
76
|
+
} = omitLockedHandlers(rest, Boolean(isInteractionLocked || disabled || applyAriaDisabled || itemReadOnly));
|
|
70
77
|
const generalProps = {
|
|
71
78
|
// 'aria-setsize': `${allOptions.length}`,
|
|
72
79
|
// 'aria-posinset': `${vItem.index + 1}`,
|
|
73
80
|
key: `${dsId}`,
|
|
74
81
|
dsId: dsId.toString(),
|
|
75
|
-
...
|
|
82
|
+
...restHandlers
|
|
76
83
|
};
|
|
77
84
|
if (option.type === MENU_OPTION_TYPES.SECTION) {
|
|
78
85
|
return /* @__PURE__ */ jsx(
|
|
@@ -86,7 +93,8 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
86
93
|
handleOnMouseDown,
|
|
87
94
|
selectedValues,
|
|
88
95
|
getOwnerProps,
|
|
89
|
-
getOwnerPropsArguments
|
|
96
|
+
getOwnerPropsArguments,
|
|
97
|
+
isInteractionLocked
|
|
90
98
|
}
|
|
91
99
|
);
|
|
92
100
|
}
|
|
@@ -102,12 +110,15 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
102
110
|
label: option.label,
|
|
103
111
|
dataTestid: ComboboxDataTestid.OPTION,
|
|
104
112
|
disabled,
|
|
105
|
-
applyAriaDisabled: applyAriaDisabled || itemReadOnly,
|
|
113
|
+
applyAriaDisabled: Boolean(applyAriaDisabled || itemReadOnly || isInteractionLocked),
|
|
106
114
|
onClick: (e) => {
|
|
107
|
-
|
|
115
|
+
consumerOnClick?.(e);
|
|
108
116
|
handleClick(option, e);
|
|
109
117
|
},
|
|
110
|
-
onMouseDown:
|
|
118
|
+
onMouseDown: (e) => {
|
|
119
|
+
consumerOnMouseDown?.(e);
|
|
120
|
+
handleOnMouseDown(e);
|
|
121
|
+
},
|
|
111
122
|
isActive: dsId === focusOptionIdx,
|
|
112
123
|
tabIndex: -1,
|
|
113
124
|
isSelected: isSelected(selectedValues, option),
|
|
@@ -138,7 +149,7 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
138
149
|
return null;
|
|
139
150
|
}
|
|
140
151
|
return null;
|
|
141
|
-
}, [optionsPerSection, focusOptionIdx, selectedValues, allOptions, onCreate, inputValue,
|
|
152
|
+
}, [optionsPerSection, focusOptionIdx, selectedValues, allOptions, onCreate, inputValue, isInteractionLocked]);
|
|
142
153
|
};
|
|
143
154
|
export {
|
|
144
155
|
ItemRenderer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/menu-list/useItemRenderer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Separator } from '@elliemae/ds-menu-items';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { Section } from '../Section.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { StyledCreatableLabel, StyledCreatableValue, StyledSingleMenuItem, StyledMultiMenuItem } from './styled.js';\nimport { isSelected, getSuggestedValueOnChange } from '../../utils/listHelper.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants.js';\n\ninterface ItemRendererT {\n extraItemProps?: {\n itemList?: DSComboboxT.OptionTypes[];\n };\n index: number;\n}\n\nexport const ItemRenderer = ({ index, extraItemProps }: ItemRendererT): React.ReactElement | null => {\n const {\n props,\n props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\n/* eslint-disable react-hooks/exhaustive-deps */\nimport React, { useMemo, useContext, useCallback } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { Separator } from '@elliemae/ds-menu-items';\nimport { omitLockedHandlers, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { Section } from '../Section.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { StyledCreatableLabel, StyledCreatableValue, StyledSingleMenuItem, StyledMultiMenuItem } from './styled.js';\nimport { isSelected, getSuggestedValueOnChange, isOptionLocked } from '../../utils/listHelper.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants.js';\n\ninterface ItemRendererT {\n extraItemProps?: {\n itemList?: DSComboboxT.OptionTypes[];\n };\n index: number;\n}\n\nexport const ItemRenderer = ({ index, extraItemProps }: ItemRendererT): React.ReactElement | null => {\n const {\n props,\n props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions },\n setMenuState,\n inputValue,\n focusOptionIdx,\n setInputValue,\n setFocusOptionIdx,\n optionsPerSection,\n isInteractionLocked,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps } = useOwnerProps(props);\n const getOwnerPropsArguments = useCallback(\n () => ({\n index,\n }),\n [index],\n );\n\n const option = extraItemProps?.itemList?.[index];\n\n const multiple = Array.isArray(selectedValues);\n const CBItem: React.ComponentType<React.ComponentProps<typeof StyledSingleMenuItem>> = multiple\n ? StyledMultiMenuItem\n : StyledSingleMenuItem;\n\n const handleOnCreateClick = useCallback(() => {\n if (isInteractionLocked) return;\n if (inputValue && onCreate) {\n onCreate(inputValue);\n // blank active item to force search last one\n setFocusOptionIdx('');\n setInputValue('');\n if (onFilter) onFilter(allOptions, '');\n }\n }, [isInteractionLocked, onFilter, onCreate, inputValue, allOptions, setInputValue, setFocusOptionIdx]);\n\n // PUI-16695: the container lock (disabled/applyAriaDisabled/readOnly) and the option-level lock both block selection\n const handleClick = useCallback(\n (currentOption: DSComboboxT.OptionTypes, e: React.MouseEvent) => {\n if (isInteractionLocked || isOptionLocked(currentOption)) return;\n if (currentOption.type === MENU_OPTION_TYPES.OPTION) {\n if (!currentOption.disabled) {\n if (onFilter) onFilter(allOptions, inputValue);\n setInputValue('');\n if (!multiple) {\n setMenuState(false, 'selectOption', e);\n }\n (onChange as (v: DSComboboxT.SelectedOptionsT, ...args: unknown[]) => void)(\n getSuggestedValueOnChange(currentOption, selectedValues, isNonClearable),\n currentOption,\n e,\n );\n }\n }\n // prevent for loosing focus on input control\n e.stopPropagation();\n e.preventDefault();\n },\n [isInteractionLocked, onFilter, selectedValues, allOptions, onChange, setMenuState, multiple],\n );\n\n // prevent blur from controls input\n const handleOnMouseDown = useCallback((e: React.MouseEvent<HTMLLIElement>) => {\n e.preventDefault();\n }, []);\n\n return useMemo(() => {\n if (option) {\n const { dsId, type, disabled, applyAriaDisabled, readOnly: itemReadOnly, ...rest } = option;\n // the option's own consumer handlers are withheld while the combobox or this option is locked\n const {\n onClick: consumerOnClick,\n onMouseDown: consumerOnMouseDown,\n ...restHandlers\n } = omitLockedHandlers(rest, Boolean(isInteractionLocked || disabled || applyAriaDisabled || itemReadOnly));\n const generalProps = {\n // 'aria-setsize': `${allOptions.length}`,\n // 'aria-posinset': `${vItem.index + 1}`,\n key: `${dsId}`,\n dsId: dsId.toString(),\n ...restHandlers,\n };\n if (option.type === MENU_OPTION_TYPES.SECTION) {\n return (\n <Section\n label={option.label}\n {...generalProps}\n options={option.options}\n handleClick={handleClick}\n focusOptionIdx={focusOptionIdx}\n handleOnMouseDown={handleOnMouseDown}\n selectedValues={selectedValues}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n isInteractionLocked={isInteractionLocked}\n />\n );\n }\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator {...generalProps} render={undefined} />;\n }\n if (option.type === MENU_OPTION_TYPES.OPTION) {\n return (\n <CBItem\n {...generalProps}\n value={option.value}\n label={option.label}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={Boolean(applyAriaDisabled || itemReadOnly || isInteractionLocked)}\n onClick={(e: React.MouseEvent) => {\n consumerOnClick?.(e);\n handleClick(option, e);\n }}\n onMouseDown={(e: React.MouseEvent<HTMLLIElement>) => {\n consumerOnMouseDown?.(e);\n handleOnMouseDown(e);\n }}\n isActive={dsId === focusOptionIdx}\n tabIndex={-1}\n isSelected={isSelected(selectedValues, option)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n }\n if (type === INTERNAL_MENU_OPTION_TYPES.CREATABLE) {\n return (\n <StyledSingleMenuItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n dataTestid={ComboboxDataTestid.OPTION}\n isActive={dsId === focusOptionIdx}\n {...generalProps}\n render={({ label: labelCreatable }: { label?: string }) => (\n <Grid py=\"8px\" cols={['min-content', 'auto']} gutter=\"xxs\" alignItems=\"center\">\n <StyledCreatableLabel variant=\"b2\" component=\"span\" getOwnerProps={getOwnerProps}>\n Add:\n </StyledCreatableLabel>\n <StyledCreatableValue variant=\"b2\" component=\"span\" getOwnerProps={getOwnerProps}>\n {`\"${labelCreatable}\"`}\n </StyledCreatableValue>\n </Grid>\n )}\n label={option.label}\n onClick={handleOnCreateClick}\n tabIndex={-1}\n />\n );\n }\n return null;\n }\n return null;\n }, [optionsPerSection, focusOptionIdx, selectedValues, allOptions, onCreate, inputValue, isInteractionLocked]);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React2, { useContext } from "react";
|
|
4
4
|
import ComboBoxContext from "../../ComboBoxCTX.js";
|
|
5
|
-
import { getSuggestedValueOnChange } from "../../utils/listHelper.js";
|
|
5
|
+
import { getSuggestedValueOnChange, isOptionLocked } from "../../utils/listHelper.js";
|
|
6
6
|
import { StyledDSPillV2 } from "../styled.js";
|
|
7
7
|
const RemovableSelectedValuePill = (props) => {
|
|
8
8
|
const { pill, trailingComma, ownerProps } = props;
|
|
@@ -15,18 +15,14 @@ const RemovableSelectedValuePill = (props) => {
|
|
|
15
15
|
applyAriaDisabled: applyAriaDisabledToContainer,
|
|
16
16
|
readOnly
|
|
17
17
|
},
|
|
18
|
-
internalRef
|
|
18
|
+
internalRef,
|
|
19
|
+
isInteractionLocked
|
|
19
20
|
} = useContext(ComboBoxContext);
|
|
20
21
|
const type = React2.useMemo(() => {
|
|
21
22
|
if (disabled || isNonClearable) return "value";
|
|
22
23
|
if (applyAriaDisabledToContainer || readOnly) return "labelOnly";
|
|
23
24
|
return "removable";
|
|
24
25
|
}, [disabled, isNonClearable, applyAriaDisabledToContainer, readOnly]);
|
|
25
|
-
const className = React2.useMemo(() => {
|
|
26
|
-
if (type === "removable") return "ds-pill-wrapper ds-pill-wrapper-removable";
|
|
27
|
-
if (type === "labelOnly") return "ds-pill-wrapper ds-pill-wrapper-label";
|
|
28
|
-
return "ds-pill-wrapper ds-pill-wrapper-value";
|
|
29
|
-
}, [type]);
|
|
30
26
|
return /* @__PURE__ */ jsx(
|
|
31
27
|
StyledDSPillV2,
|
|
32
28
|
{
|
|
@@ -34,15 +30,14 @@ const RemovableSelectedValuePill = (props) => {
|
|
|
34
30
|
label: pill.label,
|
|
35
31
|
disabled: disabled || pill.disabled,
|
|
36
32
|
type,
|
|
37
|
-
className,
|
|
38
33
|
applyAriaDisabled: applyAriaDisabledToContainer || pill.applyAriaDisabled,
|
|
39
|
-
readOnly,
|
|
34
|
+
readOnly: readOnly || pill.readOnly,
|
|
40
35
|
trailingComma,
|
|
41
36
|
tabIndex: -1,
|
|
42
37
|
labelTruncated: true,
|
|
43
38
|
disableTruncationTooltip: true,
|
|
44
39
|
onRemove: (e) => {
|
|
45
|
-
if (
|
|
40
|
+
if (isInteractionLocked || isOptionLocked(pill)) return;
|
|
46
41
|
e.stopPropagation();
|
|
47
42
|
onChange(
|
|
48
43
|
getSuggestedValueOnChange(pill, selectedValues),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/multi-selected-values-container/RemovableSelectedValuePill.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\nimport { getSuggestedValueOnChange } from '../../utils/listHelper.js';\nimport { StyledDSPillV2 } from '../styled.js';\n\nexport const RemovableSelectedValuePill: React.ComponentType<{\n pill: DSComboboxT.ItemOption;\n applyAriaDisabled?: boolean;\n trailingComma?: boolean;\n ownerProps?: {\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n };\n}> = (props) => {\n const { pill, trailingComma, ownerProps } = props;\n const {\n props: {\n onChange,\n isNonClearable,\n disabled,\n selectedValues,\n applyAriaDisabled: applyAriaDisabledToContainer,\n readOnly,\n },\n internalRef,\n } = useContext(ComboBoxContext);\n\n const type = React.useMemo(() => {\n if (disabled || isNonClearable) return 'value';\n if (applyAriaDisabledToContainer || readOnly) return 'labelOnly';\n return 'removable';\n }, [disabled, isNonClearable, applyAriaDisabledToContainer, readOnly]);\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\nimport { getSuggestedValueOnChange, isOptionLocked } from '../../utils/listHelper.js';\nimport { StyledDSPillV2 } from '../styled.js';\n\nexport const RemovableSelectedValuePill: React.ComponentType<{\n pill: DSComboboxT.ItemOption;\n applyAriaDisabled?: boolean;\n trailingComma?: boolean;\n ownerProps?: {\n getOwnerProps: () => object;\n getOwnerPropsArguments: () => object;\n };\n}> = (props) => {\n const { pill, trailingComma, ownerProps } = props;\n const {\n props: {\n onChange,\n isNonClearable,\n disabled,\n selectedValues,\n applyAriaDisabled: applyAriaDisabledToContainer,\n readOnly,\n },\n internalRef,\n isInteractionLocked,\n } = useContext(ComboBoxContext);\n\n const type = React.useMemo(() => {\n if (disabled || isNonClearable) return 'value';\n if (applyAriaDisabledToContainer || readOnly) return 'labelOnly';\n return 'removable';\n }, [disabled, isNonClearable, applyAriaDisabledToContainer, readOnly]);\n\n // PUI-18744: no className here. DSPillV2 sets its own variant classNames (ds-pill-wrapper-removable / -label /\n // -value) and merges them with the className StyledDSPillV2 passes down; it used to overwrite them, which is why\n // this component rebuilt them by hand.\n return (\n <StyledDSPillV2\n size=\"s\"\n key={pill.value}\n label={pill.label}\n disabled={disabled || pill.disabled}\n type={type}\n applyAriaDisabled={applyAriaDisabledToContainer || pill.applyAriaDisabled}\n // an item-level readOnly is the same soft lock as the container's: the remove button must show it\n readOnly={readOnly || pill.readOnly}\n trailingComma={trailingComma}\n tabIndex={-1}\n labelTruncated\n /**\n * PUI-18660: intentionally unconditional for every pill type (removable/labelOnly/value),\n * not a bug. The pill never shows its own hover tooltip on truncation here \u2014 consumers who\n * need the full value in readOnly/aria-disabled states (where the menu can't be opened)\n * are expected to wrap the combobox itself in DSTooltipV3. See the Heads Up entry in the\n * v27.1 Incoming Changes release notes and the \"WithTooltip\" example in ds-form-multi-combobox.\n */\n disableTruncationTooltip\n onRemove={(e: React.KeyboardEvent | React.MouseEvent) => {\n // PUI-16695: removing a value is an action, so every lock (container or pill level) blocks it\n if (isInteractionLocked || isOptionLocked(pill)) return;\n // preventing the menu to be opened\n e.stopPropagation();\n (onChange as (v: DSComboboxT.SelectedOptionsT, ...args: unknown[]) => void)(\n getSuggestedValueOnChange(pill, selectedValues),\n pill,\n e,\n );\n internalRef.current?.focus();\n }}\n {...ownerProps}\n />\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACuCnB;AAvCJ,OAAOA,UAAS,kBAAkB;AAClC,OAAO,qBAAqB;AAE5B,SAAS,2BAA2B,sBAAsB;AAC1D,SAAS,sBAAsB;AAExB,MAAM,6BAQR,CAAC,UAAU;AACd,QAAM,EAAE,MAAM,eAAe,WAAW,IAAI;AAC5C,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,mBAAmB;AAAA,MACnB;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,OAAOA,OAAM,QAAQ,MAAM;AAC/B,QAAI,YAAY,eAAgB,QAAO;AACvC,QAAI,gCAAgC,SAAU,QAAO;AACrD,WAAO;AAAA,EACT,GAAG,CAAC,UAAU,gBAAgB,8BAA8B,QAAQ,CAAC;AAKrE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MAEL,OAAO,KAAK;AAAA,MACZ,UAAU,YAAY,KAAK;AAAA,MAC3B;AAAA,MACA,mBAAmB,gCAAgC,KAAK;AAAA,MAExD,UAAU,YAAY,KAAK;AAAA,MAC3B;AAAA,MACA,UAAU;AAAA,MACV,gBAAc;AAAA,MAQd,0BAAwB;AAAA,MACxB,UAAU,CAAC,MAA8C;AAEvD,YAAI,uBAAuB,eAAe,IAAI,EAAG;AAEjD,UAAE,gBAAgB;AAClB,QAAC;AAAA,UACC,0BAA0B,MAAM,cAAc;AAAA,UAC9C;AAAA,UACA;AAAA,QACF;AACA,oBAAY,SAAS,MAAM;AAAA,MAC7B;AAAA,MACC,GAAG;AAAA;AAAA,IA9BC,KAAK;AAAA,EA+BZ;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -9,7 +9,14 @@ const getGroupedPillWidth = (remainingPills) => {
|
|
|
9
9
|
};
|
|
10
10
|
const useGroupPills = () => {
|
|
11
11
|
const {
|
|
12
|
-
props: {
|
|
12
|
+
props: {
|
|
13
|
+
selectedValues,
|
|
14
|
+
isNonClearable,
|
|
15
|
+
disabled,
|
|
16
|
+
innerRef,
|
|
17
|
+
applyAriaDisabled: applyAriaDisabledToContainer,
|
|
18
|
+
readOnly
|
|
19
|
+
},
|
|
13
20
|
selectedOptionsRef,
|
|
14
21
|
controlsWrapperRef,
|
|
15
22
|
pillGroupRef
|
|
@@ -32,7 +39,7 @@ const useGroupPills = () => {
|
|
|
32
39
|
const referenceWidth = selectedOptionsRef.current.offsetWidth;
|
|
33
40
|
const pills = [
|
|
34
41
|
...pillGroupRef.current.querySelectorAll(
|
|
35
|
-
disabled ||
|
|
42
|
+
disabled || isNonClearable ? ".ds-pill-wrapper-value" : ".ds-pill-wrapper-removable, .ds-pill-wrapper-label"
|
|
36
43
|
)
|
|
37
44
|
];
|
|
38
45
|
const pillsWidth = pills.map((pill) => pill?.offsetWidth);
|
|
@@ -60,6 +67,7 @@ const useGroupPills = () => {
|
|
|
60
67
|
widthInput,
|
|
61
68
|
disabled,
|
|
62
69
|
applyAriaDisabledToContainer,
|
|
70
|
+
readOnly,
|
|
63
71
|
selectedValuesLength,
|
|
64
72
|
isNonClearable
|
|
65
73
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/multi-selected-values-container/useGroupPills.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useContext, useEffect, useState, useLayoutEffect } from 'react';\nimport { useOnElementResize } from '../../utils/useOnElementResize.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\n\nconst getGroupedPillWidth = (remainingPills: number): number => {\n if (remainingPills === 0) return 0;\n const digits = remainingPills.toString().length;\n return 8 * (digits - 1) + 31;\n};\nconst useGroupPills = (): number => {\n const {\n props: {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,YAAY,WAAW,UAAU,uBAAuB;AACjE,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAGhC,MAAM,sBAAsB,CAAC,mBAAmC;AAC9D,MAAI,mBAAmB,EAAG,QAAO;AACjC,QAAM,SAAS,eAAe,SAAS,EAAE;AACzC,SAAO,KAAK,SAAS,KAAK;AAC5B;AACA,MAAM,gBAAgB,MAAc;AAClC,QAAM;AAAA,IACJ,OAAO,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport { useContext, useEffect, useState, useLayoutEffect } from 'react';\nimport { useOnElementResize } from '../../utils/useOnElementResize.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\n\nconst getGroupedPillWidth = (remainingPills: number): number => {\n if (remainingPills === 0) return 0;\n const digits = remainingPills.toString().length;\n return 8 * (digits - 1) + 31;\n};\nconst useGroupPills = (): number => {\n const {\n props: {\n selectedValues,\n isNonClearable,\n disabled,\n innerRef,\n applyAriaDisabled: applyAriaDisabledToContainer,\n readOnly,\n },\n selectedOptionsRef,\n controlsWrapperRef,\n pillGroupRef,\n } = useContext(ComboBoxContext);\n\n const multiSelectedValues = selectedValues as DSComboboxT.ItemOption[];\n\n // 30 represent 30 pills maximum to calculate the grouped pill. this fix the load time issue\n // when combobox is receiving a huge amount of options.\n const selectedValuesLength = Math.min(30, multiSelectedValues.length);\n\n const [pillsToShow, setPillsToShow] = useState(selectedValuesLength);\n const { width } = useOnElementResize(controlsWrapperRef);\n const { width: widthInput } = useOnElementResize(innerRef as React.RefObject<HTMLInputElement>);\n useEffect(() => {\n if (selectedValuesLength !== pillsToShow) {\n setPillsToShow(selectedValuesLength);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedValuesLength, width, widthInput]);\n\n useLayoutEffect(() => {\n if (selectedOptionsRef.current && pillGroupRef.current) {\n if (pillGroupRef.current) pillGroupRef.current.style.width = 'max-content';\n let lastPillFit = -1;\n let currentWidth = 0;\n const referenceWidth = selectedOptionsRef.current.offsetWidth;\n const pills: HTMLDivElement[] = [\n ...pillGroupRef.current.querySelectorAll(\n disabled || isNonClearable ? '.ds-pill-wrapper-value' : '.ds-pill-wrapper-removable, .ds-pill-wrapper-label',\n ),\n ] as HTMLDivElement[];\n const pillsWidth = pills.map((pill) => pill?.offsetWidth);\n pillsWidth.forEach((pillWidth, idx) => {\n currentWidth += pillWidth;\n if (currentWidth + getGroupedPillWidth(selectedValuesLength - idx - 1) <= referenceWidth) {\n lastPillFit = idx;\n }\n });\n\n if (!(selectedValuesLength > 0 && pillsToShow !== selectedValuesLength)) {\n const nextPillsToShow = lastPillFit + 1;\n\n if (nextPillsToShow !== pillsToShow) {\n setPillsToShow(nextPillsToShow);\n }\n }\n\n if (pillGroupRef.current) pillGroupRef.current.style.width = 'fit-content';\n }\n }, [\n selectedOptionsRef,\n innerRef,\n multiSelectedValues,\n pillsToShow,\n pillGroupRef,\n width,\n widthInput,\n disabled,\n applyAriaDisabledToContainer,\n readOnly,\n selectedValuesLength,\n isNonClearable,\n ]);\n\n return pillsToShow || 1;\n};\n\nexport { useGroupPills };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,YAAY,WAAW,UAAU,uBAAuB;AACjE,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAGhC,MAAM,sBAAsB,CAAC,mBAAmC;AAC9D,MAAI,mBAAmB,EAAG,QAAO;AACjC,QAAM,SAAS,eAAe,SAAS,EAAE;AACzC,SAAO,KAAK,SAAS,KAAK;AAC5B;AACA,MAAM,gBAAgB,MAAc;AAClC,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,mBAAmB;AAAA,MACnB;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,eAAe;AAE9B,QAAM,sBAAsB;AAI5B,QAAM,uBAAuB,KAAK,IAAI,IAAI,oBAAoB,MAAM;AAEpE,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,oBAAoB;AACnE,QAAM,EAAE,MAAM,IAAI,mBAAmB,kBAAkB;AACvD,QAAM,EAAE,OAAO,WAAW,IAAI,mBAAmB,QAA6C;AAC9F,YAAU,MAAM;AACd,QAAI,yBAAyB,aAAa;AACxC,qBAAe,oBAAoB;AAAA,IACrC;AAAA,EAEF,GAAG,CAAC,sBAAsB,OAAO,UAAU,CAAC;AAE5C,kBAAgB,MAAM;AACpB,QAAI,mBAAmB,WAAW,aAAa,SAAS;AACtD,UAAI,aAAa,QAAS,cAAa,QAAQ,MAAM,QAAQ;AAC7D,UAAI,cAAc;AAClB,UAAI,eAAe;AACnB,YAAM,iBAAiB,mBAAmB,QAAQ;AAClD,YAAM,QAA0B;AAAA,QAC9B,GAAG,aAAa,QAAQ;AAAA,UACtB,YAAY,iBAAiB,2BAA2B;AAAA,QAC1D;AAAA,MACF;AACA,YAAM,aAAa,MAAM,IAAI,CAAC,SAAS,MAAM,WAAW;AACxD,iBAAW,QAAQ,CAAC,WAAW,QAAQ;AACrC,wBAAgB;AAChB,YAAI,eAAe,oBAAoB,uBAAuB,MAAM,CAAC,KAAK,gBAAgB;AACxF,wBAAc;AAAA,QAChB;AAAA,MACF,CAAC;AAED,UAAI,EAAE,uBAAuB,KAAK,gBAAgB,uBAAuB;AACvE,cAAM,kBAAkB,cAAc;AAEtC,YAAI,oBAAoB,aAAa;AACnC,yBAAe,eAAe;AAAA,QAChC;AAAA,MACF;AAEA,UAAI,aAAa,QAAS,cAAa,QAAQ,MAAM,QAAQ;AAAA,IAC/D;AAAA,EACF,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,SAAO,eAAe;AACxB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSPillV2, DSPillGroupV2 } from '@elliemae/ds-pills-v2';\nimport { styled } from '@elliemae/ds-system';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nexport const StyledA11yNotVisible = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n`;\n\n/**\n * Combobox-specific pill styling with stateful behavior\n *\n * DSPillV2 is stateless by design, but Combobox requires pills to visually\n * reflect container state (disabled/aria-disabled/readOnly). This wrapper\n * applies context-aware colors based on Combobox's interaction state.\n *\n * These styles were previously part of the Pills component but have been\n * moved here as Pills were refactored to be stateless. Combobox maintains\n * this stateful behavior as a specific use case requirement.\n */\nexport const StyledDSPillV2 = styled(DSPillV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.PILL,\n preserveLegacyDataTestId: true,\n})`\n background-color: ${({ theme, disabled, applyAriaDisabled, readOnly }) => {\n if (disabled) return theme.colors.neutral['080'];\n if (applyAriaDisabled || readOnly) return theme.colors.neutral['050'];\n return theme.colors.brand[250];\n }};\n\n color: ${({ theme, disabled, applyAriaDisabled, readOnly }) => {\n if (disabled) return theme.colors.neutral['600'];\n if (applyAriaDisabled || readOnly) return theme.colors.neutral['700'];\n return theme.colors.brand['800'];\n }};\n`;\n\n/*\n * PUI-17945: https://jira.elliemae.io/browse/PUI-17945\n * By new Pills designs, pills should wrap to new lines when there is not enough horizontal space,\n * but for Combobox we want to keep them in one line and show a \"+X\" pill when there are more selected values than the max pills to show,\n * so we are changing its display property to grid instead of flex.\n */\n\nexport const StyledDSPillGroupV2 = styled(DSPillGroupV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.PILL_GROUP,\n})`\n display: grid;\n`;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,qBAAqB;AACxC,SAAS,cAAc;AACvB,SAAS,oBAAoB,2BAA2B;AACjD,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSPillV2, DSPillGroupV2 } from '@elliemae/ds-pills-v2';\nimport { styled } from '@elliemae/ds-system';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nexport const StyledA11yNotVisible = styled.span`\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n border: 0;\n padding: 0;\n overflow: hidden;\n clip: rect(0 0 0 0);\n clip-path: inset(100%);\n white-space: nowrap;\n`;\n\n/**\n * Combobox-specific pill styling with stateful behavior\n *\n * DSPillV2 is stateless by design, but Combobox requires pills to visually\n * reflect container state (disabled/aria-disabled/readOnly). This wrapper\n * applies context-aware colors based on Combobox's interaction state.\n *\n * These styles were previously part of the Pills component but have been\n * moved here as Pills were refactored to be stateless. Combobox maintains\n * this stateful behavior as a specific use case requirement.\n *\n * PUI-18744: kept here on purpose, not moved into DSPillV2. Moving them would change every standalone pill\n * with disabled / applyAriaDisabled / readOnly (the Pills docs state readOnly does not change how a pill looks),\n * and whether the combobox pills keep or align these colors is UX's call in PUI-18754.\n * See KNOWN_INTENTIONAL_DEVIATIONS.md #7.\n */\nexport const StyledDSPillV2 = styled(DSPillV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.PILL,\n preserveLegacyDataTestId: true,\n})`\n background-color: ${({ theme, disabled, applyAriaDisabled, readOnly }) => {\n if (disabled) return theme.colors.neutral['080'];\n if (applyAriaDisabled || readOnly) return theme.colors.neutral['050'];\n return theme.colors.brand[250];\n }};\n\n color: ${({ theme, disabled, applyAriaDisabled, readOnly }) => {\n if (disabled) return theme.colors.neutral['600'];\n if (applyAriaDisabled || readOnly) return theme.colors.neutral['700'];\n return theme.colors.brand['800'];\n }};\n`;\n\n/*\n * PUI-17945: https://jira.elliemae.io/browse/PUI-17945\n * By new Pills designs, pills should wrap to new lines when there is not enough horizontal space,\n * but for Combobox we want to keep them in one line and show a \"+X\" pill when there are more selected values than the max pills to show,\n * so we are changing its display property to grid instead of flex.\n */\n\nexport const StyledDSPillGroupV2 = styled(DSPillGroupV2, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.PILL_GROUP,\n})`\n display: grid;\n`;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU,qBAAqB;AACxC,SAAS,cAAc;AACvB,SAAS,oBAAoB,2BAA2B;AACjD,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BpC,MAAM,iBAAiB,OAAO,UAAU;AAAA,EAC7C,MAAM;AAAA,EACN,MAAM,oBAAoB;AAAA,EAC1B,0BAA0B;AAC5B,CAAC;AAAA,sBACqB,CAAC,EAAE,OAAO,UAAU,mBAAmB,SAAS,MAAM;AACxE,MAAI,SAAU,QAAO,MAAM,OAAO,QAAQ,KAAK;AAC/C,MAAI,qBAAqB,SAAU,QAAO,MAAM,OAAO,QAAQ,KAAK;AACpE,SAAO,MAAM,OAAO,MAAM,GAAG;AAC/B,CAAC;AAAA;AAAA,WAEQ,CAAC,EAAE,OAAO,UAAU,mBAAmB,SAAS,MAAM;AAC7D,MAAI,SAAU,QAAO,MAAM,OAAO,QAAQ,KAAK;AAC/C,MAAI,qBAAqB,SAAU,QAAO,MAAM,OAAO,QAAQ,KAAK;AACpE,SAAO,MAAM,OAAO,MAAM,KAAK;AACjC,CAAC;AAAA;AAUI,MAAM,sBAAsB,OAAO,eAAe;AAAA,EACvD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -27,6 +27,7 @@ const findInCircularList = (list, from, criteria, step = 1) => {
|
|
|
27
27
|
}
|
|
28
28
|
return from;
|
|
29
29
|
};
|
|
30
|
+
const isOptionLocked = (option) => Boolean(option?.applyAriaDisabled || option?.readOnly);
|
|
30
31
|
const getLastValueSelected = (selectedValues) => {
|
|
31
32
|
if (Array.isArray(selectedValues)) {
|
|
32
33
|
return selectedValues[selectedValues.length - 1];
|
|
@@ -83,6 +84,7 @@ export {
|
|
|
83
84
|
getSuggestedValueOnChange,
|
|
84
85
|
isArrayOfItems,
|
|
85
86
|
isItem,
|
|
87
|
+
isOptionLocked,
|
|
86
88
|
isSelected,
|
|
87
89
|
isSelectedValueEmpty,
|
|
88
90
|
isSelectedValueMultiple,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/listHelper.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nexport const getSelectableOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && !option.disabled);\n\nexport const getOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION);\n\nexport const isSelectedValueEmpty = (value: DSComboboxT.SelectedOptionsT): boolean =>\n Array.isArray(value) ? value.length === 0 : !value;\n\nexport const isSelectedValueMultiple = (value: DSComboboxT.SelectedOptionsT): boolean => Array.isArray(value);\n\nexport const isSelected = (value: DSComboboxT.SelectedOptionsT, activeOption: DSComboboxT.ItemOption): boolean => {\n if (isSelectedValueMultiple(value)) {\n const multiValue = value as DSComboboxT.ItemOption[];\n return multiValue.some((item) => item?.value === activeOption?.value);\n }\n const singleValue = value as DSComboboxT.ItemOption;\n return singleValue?.value === activeOption.value;\n};\n\nexport function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[] {\n return Array.isArray(value) && value.length > 0;\n}\n\nexport const isItem = (value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption =>\n !Array.isArray(value) && value !== null && typeof value === 'object';\n\nexport const findInCircularList = (\n list: DSComboboxT.OptionTypes[],\n from: number,\n criteria: (item: DSComboboxT.OptionTypes) => boolean,\n step = 1,\n): number => {\n if (list.length === 0) return from;\n\n let i = (from + step + list.length) % list.length;\n let iterations = 0;\n\n while (iterations < list.length) {\n if (criteria(list[i])) return i;\n\n i = (i + step + list.length) % list.length;\n iterations += 1;\n }\n\n return from; // Return the original index if no match is found\n};\nexport const getLastValueSelected = (selectedValues: DSComboboxT.SelectedOptionsT) => {\n if (Array.isArray(selectedValues)) {\n return selectedValues[selectedValues.length - 1];\n }\n return selectedValues;\n};\n\nexport const getFirstOption = (\n options: DSComboboxT.OptionTypes[],\n selectedValues?: DSComboboxT.SelectedOptionsT,\n): string => {\n if (selectedValues) {\n const lastValue = getLastValueSelected(selectedValues);\n /**\n * A selected value can be created dynamically (e.g. a creatable filter) and later filtered\n * out of the rendered options, so its id must still exist in `options` before we focus it \u2014\n * otherwise aria-activedescendant would point at a non-existent id.\n */\n if (lastValue && options.some((option) => option.dsId === lastValue.dsId)) return lastValue.dsId;\n }\n for (let i = 0; i < options.length; i += 1)\n if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {\n return options[i].dsId;\n }\n // list of disabled item results return ''\n return '';\n};\n\nexport const getSuggestedValueOnChange = (\n selectedOption: DSComboboxT.SelectionableOptions,\n selectedValues: DSComboboxT.SelectedOptionsT,\n isNonClearable?: boolean,\n): DSComboboxT.SelectedOptionsT => {\n if (Array.isArray(selectedValues)) {\n if (selectedOption === null) return selectedValues;\n const isFound = selectedValues.find((item) => item.type === 'option' && item.value === selectedOption.value);\n if (isFound) {\n if (isNonClearable) return selectedValues;\n return selectedValues.filter((item) => item.type === 'option' && item.value !== selectedOption.value);\n }\n return [...selectedValues, selectedOption];\n }\n if (selectedValues && selectedValues.dsId === selectedOption.dsId) {\n if (isNonClearable) return selectedOption;\n return null;\n }\n return selectedOption;\n};\n\nexport const filterOptions = (inputValue: string, options: DSComboboxT.OptionTypes[]) => {\n if (!inputValue) return options;\n return options.filter(\n (option) =>\n option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase()),\n );\n};\n\nexport const getFilteredOptionsSelected = (\n filteredOption: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.ItemOption[],\n) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));\n\nexport const scrollIfNeeded = (\n elem: HTMLElement,\n options = { behavior: 'smooth', block: 'end', inline: 'nearest' } as ScrollIntoViewOptions | undefined,\n) => {\n const bounding = elem.getBoundingClientRect();\n if (!(\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n ))\n elem.scrollIntoView(options);\n};\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,yBAAyB;AAC3B,MAAM,uBAAuB,CAAC,YACnC,QAAQ,OAAO,CAAC,WAAW,OAAO,SAAS,kBAAkB,UAAU,CAAC,OAAO,QAAQ;AAElF,MAAM,aAAa,CAAC,YACzB,QAAQ,OAAO,CAAC,WAAW,OAAO,SAAS,kBAAkB,MAAM;AAE9D,MAAM,uBAAuB,CAAC,UACnC,MAAM,QAAQ,KAAK,IAAI,MAAM,WAAW,IAAI,CAAC;AAExC,MAAM,0BAA0B,CAAC,UAAiD,MAAM,QAAQ,KAAK;AAErG,MAAM,aAAa,CAAC,OAAqC,iBAAkD;AAChH,MAAI,wBAAwB,KAAK,GAAG;AAClC,UAAM,aAAa;AACnB,WAAO,WAAW,KAAK,CAAC,SAAS,MAAM,UAAU,cAAc,KAAK;AAAA,EACtE;AACA,QAAM,cAAc;AACpB,SAAO,aAAa,UAAU,aAAa;AAC7C;AAEO,SAAS,eAAe,OAAwE;AACrG,SAAO,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS;AAChD;AAEO,MAAM,SAAS,CAAC,UACrB,CAAC,MAAM,QAAQ,KAAK,KAAK,UAAU,QAAQ,OAAO,UAAU;AAEvD,MAAM,qBAAqB,CAChC,MACA,MACA,UACA,OAAO,MACI;AACX,MAAI,KAAK,WAAW,EAAG,QAAO;AAE9B,MAAI,KAAK,OAAO,OAAO,KAAK,UAAU,KAAK;AAC3C,MAAI,aAAa;AAEjB,SAAO,aAAa,KAAK,QAAQ;AAC/B,QAAI,SAAS,KAAK,CAAC,CAAC,EAAG,QAAO;AAE9B,SAAK,IAAI,OAAO,KAAK,UAAU,KAAK;AACpC,kBAAc;AAAA,EAChB;AAEA,SAAO;AACT;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nexport const getSelectableOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && !option.disabled);\n\nexport const getOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION);\n\nexport const isSelectedValueEmpty = (value: DSComboboxT.SelectedOptionsT): boolean =>\n Array.isArray(value) ? value.length === 0 : !value;\n\nexport const isSelectedValueMultiple = (value: DSComboboxT.SelectedOptionsT): boolean => Array.isArray(value);\n\nexport const isSelected = (value: DSComboboxT.SelectedOptionsT, activeOption: DSComboboxT.ItemOption): boolean => {\n if (isSelectedValueMultiple(value)) {\n const multiValue = value as DSComboboxT.ItemOption[];\n return multiValue.some((item) => item?.value === activeOption?.value);\n }\n const singleValue = value as DSComboboxT.ItemOption;\n return singleValue?.value === activeOption.value;\n};\n\nexport function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[] {\n return Array.isArray(value) && value.length > 0;\n}\n\nexport const isItem = (value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption =>\n !Array.isArray(value) && value !== null && typeof value === 'object';\n\nexport const findInCircularList = (\n list: DSComboboxT.OptionTypes[],\n from: number,\n criteria: (item: DSComboboxT.OptionTypes) => boolean,\n step = 1,\n): number => {\n if (list.length === 0) return from;\n\n let i = (from + step + list.length) % list.length;\n let iterations = 0;\n\n while (iterations < list.length) {\n if (criteria(list[i])) return i;\n\n i = (i + step + list.length) % list.length;\n iterations += 1;\n }\n\n return from; // Return the original index if no match is found\n};\n/**\n * An option is locked when it carries applyAriaDisabled or readOnly (the same soft lock; the option type extends the\n * global attributes, so both can be set on a single option). PUI-16695.\n */\nexport const isOptionLocked = (option?: { applyAriaDisabled?: boolean; readOnly?: boolean } | null): boolean =>\n Boolean(option?.applyAriaDisabled || option?.readOnly);\n\nexport const getLastValueSelected = (selectedValues: DSComboboxT.SelectedOptionsT) => {\n if (Array.isArray(selectedValues)) {\n return selectedValues[selectedValues.length - 1];\n }\n return selectedValues;\n};\n\nexport const getFirstOption = (\n options: DSComboboxT.OptionTypes[],\n selectedValues?: DSComboboxT.SelectedOptionsT,\n): string => {\n if (selectedValues) {\n const lastValue = getLastValueSelected(selectedValues);\n /**\n * A selected value can be created dynamically (e.g. a creatable filter) and later filtered\n * out of the rendered options, so its id must still exist in `options` before we focus it \u2014\n * otherwise aria-activedescendant would point at a non-existent id.\n */\n if (lastValue && options.some((option) => option.dsId === lastValue.dsId)) return lastValue.dsId;\n }\n for (let i = 0; i < options.length; i += 1)\n if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {\n return options[i].dsId;\n }\n // list of disabled item results return ''\n return '';\n};\n\nexport const getSuggestedValueOnChange = (\n selectedOption: DSComboboxT.SelectionableOptions,\n selectedValues: DSComboboxT.SelectedOptionsT,\n isNonClearable?: boolean,\n): DSComboboxT.SelectedOptionsT => {\n if (Array.isArray(selectedValues)) {\n if (selectedOption === null) return selectedValues;\n const isFound = selectedValues.find((item) => item.type === 'option' && item.value === selectedOption.value);\n if (isFound) {\n if (isNonClearable) return selectedValues;\n return selectedValues.filter((item) => item.type === 'option' && item.value !== selectedOption.value);\n }\n return [...selectedValues, selectedOption];\n }\n if (selectedValues && selectedValues.dsId === selectedOption.dsId) {\n if (isNonClearable) return selectedOption;\n return null;\n }\n return selectedOption;\n};\n\nexport const filterOptions = (inputValue: string, options: DSComboboxT.OptionTypes[]) => {\n if (!inputValue) return options;\n return options.filter(\n (option) =>\n option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase()),\n );\n};\n\nexport const getFilteredOptionsSelected = (\n filteredOption: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.ItemOption[],\n) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));\n\nexport const scrollIfNeeded = (\n elem: HTMLElement,\n options = { behavior: 'smooth', block: 'end', inline: 'nearest' } as ScrollIntoViewOptions | undefined,\n) => {\n const bounding = elem.getBoundingClientRect();\n if (!(\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n ))\n elem.scrollIntoView(options);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,6 +26,8 @@ export declare const ComboBoxContext: import("react").Context<{
|
|
|
26
26
|
correctOptions: import("./DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.OptionTypes[];
|
|
27
27
|
instanceUid: string;
|
|
28
28
|
optionsPerSection: import("./DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.OptionTypes[];
|
|
29
|
-
shouldPreventContextMenuOpening: boolean
|
|
29
|
+
shouldPreventContextMenuOpening: boolean;
|
|
30
|
+
isInteractionLocked: boolean;
|
|
31
|
+
isMenuOpeningLocked: boolean;
|
|
30
32
|
}>;
|
|
31
33
|
export default ComboBoxContext;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
interface TruncatedTextProps {
|
|
2
3
|
value?: string;
|
|
3
4
|
}
|
|
@@ -8,6 +9,6 @@ interface TruncatedTextProps {
|
|
|
8
9
|
* menu can't be opened) wrap the combobox in DSTooltipV3 themselves; see the
|
|
9
10
|
* "WithTooltip" examples in ds-form-single-combobox / ds-form-multi-combobox.
|
|
10
11
|
*/
|
|
11
|
-
declare const TruncatedText: ({ value }: TruncatedTextProps) =>
|
|
12
|
+
declare const TruncatedText: ({ value }: TruncatedTextProps) => React.JSX.Element;
|
|
12
13
|
export { TruncatedText };
|
|
13
14
|
export default TruncatedText;
|
|
@@ -27,7 +27,9 @@ export declare const useComboBox: <T extends DSCommonComboboxPropsT.ItemOption |
|
|
|
27
27
|
correctOptions: DSCommonComboboxPropsT.OptionTypes[];
|
|
28
28
|
instanceUid: string;
|
|
29
29
|
optionsPerSection: DSCommonComboboxPropsT.OptionTypes[];
|
|
30
|
-
shouldPreventContextMenuOpening: boolean
|
|
30
|
+
shouldPreventContextMenuOpening: boolean;
|
|
31
|
+
isInteractionLocked: boolean;
|
|
32
|
+
isMenuOpeningLocked: boolean;
|
|
31
33
|
};
|
|
32
34
|
export type UseComboBoxReturnType = ReturnType<typeof useComboBox>;
|
|
33
35
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { XstyledProps } from '@elliemae/ds-props-helpers';
|
|
2
2
|
export declare const StyledContainer: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, XstyledProps & {
|
|
3
|
-
disabled?: boolean;
|
|
4
|
-
applyAriaDisabled: boolean;
|
|
3
|
+
$disabled?: boolean;
|
|
4
|
+
$applyAriaDisabled: boolean;
|
|
5
5
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
6
6
|
export declare const StyledPopperWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
applyAriaDisabled: boolean;
|
|
7
|
+
$disabled?: boolean;
|
|
8
|
+
$applyAriaDisabled: boolean;
|
|
9
9
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
@@ -2,18 +2,18 @@ interface StyledControlsWrapperT {
|
|
|
2
2
|
hasError: boolean;
|
|
3
3
|
inline: boolean;
|
|
4
4
|
minWidth?: number;
|
|
5
|
-
disabled: boolean;
|
|
6
|
-
applyAriaDisabled: boolean;
|
|
7
|
-
readOnly: boolean;
|
|
5
|
+
$disabled: boolean;
|
|
6
|
+
$applyAriaDisabled: boolean;
|
|
7
|
+
$readOnly: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const StyledControlsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, StyledControlsWrapperT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
|
|
10
10
|
export declare const StyledSingleSelectWraper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
|
|
11
|
-
disabled: boolean;
|
|
12
|
-
applyAriaDisabled: boolean;
|
|
13
|
-
readOnly: boolean;
|
|
11
|
+
$disabled: boolean;
|
|
12
|
+
$applyAriaDisabled: boolean;
|
|
13
|
+
$readOnly: boolean;
|
|
14
14
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
15
15
|
export declare const StyledSelection: import("styled-components").StyledComponent<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").FC<import("@elliemae/ds-typography").DSTypographyT.Props>>, never>;
|
|
16
16
|
export declare const StyledHeaderActionsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
|
|
17
17
|
export declare const StyleDropdownIndicator: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
18
|
-
export declare const StyleHeaderActionsSeparator: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme,
|
|
18
|
+
export declare const StyleHeaderActionsSeparator: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
19
19
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const StyleHiddenInput: import("styled-components").StyledComponent<"input", import("@elliemae/ds-system").Theme, {
|
|
2
|
-
|
|
2
|
+
$applyAriaDisabled: boolean;
|
|
3
3
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"input">, never>;
|
|
4
4
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", import("@elliemae/ds-system").Theme, {
|
|
5
5
|
withoutCaret: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const useMaskedOnChange: () =>
|
|
1
|
+
declare const useMaskedOnChange: () => (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
2
2
|
export { useMaskedOnChange };
|
|
@@ -9,6 +9,11 @@ export declare const StyledA11yNotVisible: import("styled-components").StyledCom
|
|
|
9
9
|
* These styles were previously part of the Pills component but have been
|
|
10
10
|
* moved here as Pills were refactored to be stateless. Combobox maintains
|
|
11
11
|
* this stateful behavior as a specific use case requirement.
|
|
12
|
+
*
|
|
13
|
+
* PUI-18744: kept here on purpose, not moved into DSPillV2. Moving them would change every standalone pill
|
|
14
|
+
* with disabled / applyAriaDisabled / readOnly (the Pills docs state readOnly does not change how a pill looks),
|
|
15
|
+
* and whether the combobox pills keep or align these colors is UX's call in PUI-18754.
|
|
16
|
+
* See KNOWN_INTENTIONAL_DEVIATIONS.md #7.
|
|
12
17
|
*/
|
|
13
18
|
export declare const StyledDSPillV2: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-pills-v2").DSPillT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-pills-v2").DSPillT.Props>>, never>;
|
|
14
19
|
export declare const StyledDSPillGroupV2: import("styled-components").StyledComponent<import("react").ComponentType<import("@elliemae/ds-pills-v2/dist/types/parts/DSPillGroup/react-desc-prop-types.js").DSPillGroupT.Props>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ComponentType<import("@elliemae/ds-pills-v2/dist/types/parts/DSPillGroup/react-desc-prop-types.js").DSPillGroupT.Props>>, never>;
|
|
@@ -7,6 +7,14 @@ export declare const isSelected: (value: DSComboboxT.SelectedOptionsT, activeOpt
|
|
|
7
7
|
export declare function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[];
|
|
8
8
|
export declare const isItem: (value: DSComboboxT.SelectedOptionsT) => value is DSComboboxT.ItemOption;
|
|
9
9
|
export declare const findInCircularList: (list: DSComboboxT.OptionTypes[], from: number, criteria: (item: DSComboboxT.OptionTypes) => boolean, step?: number) => number;
|
|
10
|
+
/**
|
|
11
|
+
* An option is locked when it carries applyAriaDisabled or readOnly (the same soft lock; the option type extends the
|
|
12
|
+
* global attributes, so both can be set on a single option). PUI-16695.
|
|
13
|
+
*/
|
|
14
|
+
export declare const isOptionLocked: (option?: {
|
|
15
|
+
applyAriaDisabled?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
} | null) => boolean;
|
|
10
18
|
export declare const getLastValueSelected: (selectedValues: DSComboboxT.SelectedOptionsT) => import("../DSCommonComboboxPropsT.js").DSCommonComboboxPropsT.SelectionableOptions | null;
|
|
11
19
|
export declare const getFirstOption: (options: DSComboboxT.OptionTypes[], selectedValues?: DSComboboxT.SelectedOptionsT) => string;
|
|
12
20
|
export declare const getSuggestedValueOnChange: (selectedOption: DSComboboxT.SelectionableOptions, selectedValues: DSComboboxT.SelectedOptionsT, isNonClearable?: boolean) => DSComboboxT.SelectedOptionsT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-combobox",
|
|
3
|
-
"version": "3.80.0-next.
|
|
3
|
+
"version": "3.80.0-next.75",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Combobox",
|
|
6
6
|
"files": [
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
"indent": 4
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@elliemae/ds-button-v2": "3.80.0-next.
|
|
40
|
-
"@elliemae/ds-circular-progress-indicator": "3.80.0-next.
|
|
41
|
-
"@elliemae/ds-fast-list": "3.80.0-next.
|
|
42
|
-
"@elliemae/ds-floating-context": "3.80.0-next.
|
|
43
|
-
"@elliemae/ds-grid": "3.80.0-next.
|
|
44
|
-
"@elliemae/ds-icons": "3.80.0-next.
|
|
45
|
-
"@elliemae/ds-menu-items": "3.80.0-next.
|
|
46
|
-
"@elliemae/ds-pills-v2": "3.80.0-next.
|
|
47
|
-
"@elliemae/ds-props-helpers": "3.80.0-next.
|
|
48
|
-
"@elliemae/ds-system": "3.80.0-next.
|
|
49
|
-
"@elliemae/ds-typography": "3.80.0-next.
|
|
39
|
+
"@elliemae/ds-button-v2": "3.80.0-next.75",
|
|
40
|
+
"@elliemae/ds-circular-progress-indicator": "3.80.0-next.75",
|
|
41
|
+
"@elliemae/ds-fast-list": "3.80.0-next.75",
|
|
42
|
+
"@elliemae/ds-floating-context": "3.80.0-next.75",
|
|
43
|
+
"@elliemae/ds-grid": "3.80.0-next.75",
|
|
44
|
+
"@elliemae/ds-icons": "3.80.0-next.75",
|
|
45
|
+
"@elliemae/ds-menu-items": "3.80.0-next.75",
|
|
46
|
+
"@elliemae/ds-pills-v2": "3.80.0-next.75",
|
|
47
|
+
"@elliemae/ds-props-helpers": "3.80.0-next.75",
|
|
48
|
+
"@elliemae/ds-system": "3.80.0-next.75",
|
|
49
|
+
"@elliemae/ds-typography": "3.80.0-next.75",
|
|
50
50
|
"uid": "^2.0.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@elliemae/ds-form-helpers-mask-hooks": "3.80.0-next.
|
|
54
|
-
"@elliemae/ds-monorepo-devops": "3.80.0-next.
|
|
55
|
-
"@elliemae/ds-test-utils": "3.80.0-next.
|
|
53
|
+
"@elliemae/ds-form-helpers-mask-hooks": "3.80.0-next.75",
|
|
54
|
+
"@elliemae/ds-monorepo-devops": "3.80.0-next.75",
|
|
55
|
+
"@elliemae/ds-test-utils": "3.80.0-next.75",
|
|
56
56
|
"@elliemae/pui-theme": "~2.13.0",
|
|
57
57
|
"jest": "^30.0.0",
|
|
58
58
|
"styled-components": "~5.3.11",
|