@elliemae/ds-form-combobox 3.53.0-alpha.1 → 3.53.0-alpha.2
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/constants/index.js +66 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +15 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/parts/DropdownIndicator.js +10 -1
- package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
- package/dist/cjs/parts/Section.js +82 -34
- package/dist/cjs/parts/Section.js.map +3 -3
- package/dist/cjs/parts/container/Container.js +18 -17
- package/dist/cjs/parts/container/Container.js.map +3 -3
- package/dist/cjs/parts/controls/Controls.js +10 -5
- package/dist/cjs/parts/controls/Controls.js.map +2 -2
- package/dist/cjs/parts/controls-input/ControlsInput.js +12 -6
- package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/cjs/parts/controls-input/styled.js +1 -0
- package/dist/cjs/parts/controls-input/styled.js.map +2 -2
- package/dist/cjs/parts/controls-input/useControlsInput.js +11 -11
- package/dist/cjs/parts/controls-input/useControlsInput.js.map +2 -2
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +8 -2
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js +1 -1
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/cjs/parts/menu-list/LoadingContainer.js +6 -1
- package/dist/cjs/parts/menu-list/LoadingContainer.js.map +2 -2
- package/dist/cjs/parts/menu-list/MenuList.js +36 -21
- package/dist/cjs/parts/menu-list/MenuList.js.map +2 -2
- package/dist/cjs/parts/menu-list/SkeletonContainer.js +12 -2
- package/dist/cjs/parts/menu-list/SkeletonContainer.js.map +2 -2
- package/dist/cjs/parts/menu-list/styled.js +1 -1
- package/dist/cjs/parts/menu-list/styled.js.map +1 -1
- package/dist/cjs/parts/menu-list/useItemRenderer.js +32 -5
- package/dist/cjs/parts/menu-list/useItemRenderer.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/esm/constants/index.js +36 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +15 -4
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/parts/DropdownIndicator.js +10 -1
- package/dist/esm/parts/DropdownIndicator.js.map +2 -2
- package/dist/esm/parts/Section.js +82 -34
- package/dist/esm/parts/Section.js.map +2 -2
- package/dist/esm/parts/container/Container.js +13 -12
- package/dist/esm/parts/container/Container.js.map +3 -3
- package/dist/esm/parts/controls/Controls.js +12 -7
- package/dist/esm/parts/controls/Controls.js.map +2 -2
- package/dist/esm/parts/controls-input/ControlsInput.js +14 -8
- package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/esm/parts/controls-input/styled.js +1 -0
- package/dist/esm/parts/controls-input/styled.js.map +2 -2
- package/dist/esm/parts/controls-input/useControlsInput.js +12 -12
- package/dist/esm/parts/controls-input/useControlsInput.js.map +2 -2
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js +8 -2
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/parts/controls-input/useMaskedOnChange.js +1 -1
- package/dist/esm/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/esm/parts/menu-list/LoadingContainer.js +6 -1
- package/dist/esm/parts/menu-list/LoadingContainer.js.map +2 -2
- package/dist/esm/parts/menu-list/MenuList.js +37 -22
- package/dist/esm/parts/menu-list/MenuList.js.map +2 -2
- package/dist/esm/parts/menu-list/SkeletonContainer.js +12 -2
- package/dist/esm/parts/menu-list/SkeletonContainer.js.map +2 -2
- package/dist/esm/parts/menu-list/styled.js +1 -1
- package/dist/esm/parts/menu-list/styled.js.map +1 -1
- package/dist/esm/parts/menu-list/useItemRenderer.js +32 -5
- package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/types/ComboBoxCTX.d.ts +0 -1
- package/dist/types/constants/index.d.ts +35 -0
- package/dist/types/index.d.ts +4 -3
- package/dist/types/parts/DropdownIndicator.d.ts +0 -1
- package/dist/types/parts/Section.d.ts +4 -0
- package/dist/types/parts/container/Container.d.ts +0 -1
- package/dist/types/parts/container/styled.d.ts +2 -2
- package/dist/types/parts/controls/Controls.d.ts +0 -1
- package/dist/types/parts/controls/styled.d.ts +0 -1
- package/dist/types/parts/controls-input/ControlsInput.d.ts +0 -1
- package/dist/types/parts/controls-input/useControlsInput.d.ts +0 -1
- package/dist/types/parts/controls-input/useKeyboardNavigation.d.ts +0 -1
- package/dist/types/parts/controls-input/useMaskedOnChange.d.ts +0 -1
- package/dist/types/parts/menu-list/LoadingContainer.d.ts +3 -1
- package/dist/types/parts/menu-list/MenuList.d.ts +0 -1
- package/dist/types/parts/menu-list/SkeletonContainer.d.ts +2 -2
- package/dist/types/parts/menu-list/styled.d.ts +0 -1
- package/dist/types/parts/menu-list/useItemRenderer.d.ts +1 -2
- package/dist/types/parts/multi-selected-values-container/MultiSelectedValuesContainer.d.ts +0 -1
- package/dist/types/react-desc-prop-types.d.ts +6 -5
- package/dist/types/tests/DSCombobox.exports.test.d.ts +1 -0
- package/dist/types/tests/DSCombobox.get-owner-props.test.d.ts +1 -0
- package/dist/types/utils/useOnElementResize.d.ts +1 -1
- package/package.json +20 -19
- package/dist/cjs/tests/utils.js +0 -133
- package/dist/cjs/tests/utils.js.map +0 -7
- package/dist/esm/tests/utils.js +0 -103
- package/dist/esm/tests/utils.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/menu-list/MenuList.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useCallback } from 'react';\nimport { DSFastList } from '@elliemae/ds-fast-list';\nimport { type SizingProps, styled } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { StyledListWrapper, StyledNoResultsWrapper } from './styled.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { ItemRenderer } from './useItemRenderer.js';\nimport { LoadingContainer } from './LoadingContainer.js';\nimport { SkeletonContainer } from './SkeletonContainer.js';\nimport { useOnElementResize } from '../../utils/useOnElementResize.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\nconst StyledFastList = styled(DSFastList, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.FAST_LIST,\n})``;\n\nconst StyledItemsWrapper = styled(Grid)<{\n maxHeight: SizingProps['maxHeight'];\n}>`\n max-height: ${({ maxHeight }) => (maxHeight ? `${String(maxHeight)}px` : '300px')};\n`;\n\nconst estimatedSize = () => 32;\n\nexport const MenuList = (): JSX.Element => {\n const {\n props,\n props: { isLoading, menuMinWidth, noOptionsMessage, menuMaxHeight, onCreate, inline, isSkeleton },\n controlsWrapperRef,\n listRef,\n wrapperListRef,\n correctOptions: filteredOptions,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps } = useOwnerProps(props);\n const { width } = useOnElementResize(controlsWrapperRef);\n\n const preventLoseInputFocus: React.MouseEventHandler = useCallback((e) => {\n e.preventDefault();\n }, []);\n\n let content: JSX.Element;\n\n if (isSkeleton) {\n content = <SkeletonContainer instanceUid={instanceUid} getOwnerProps={getOwnerProps} />;\n } else if (isLoading) {\n content = <LoadingContainer getOwnerProps={getOwnerProps} />;\n } else if ((filteredOptions?.length ?? 0) > 0 || onCreate) {\n content = (\n <StyledItemsWrapper maxHeight={menuMaxHeight} id={`combo-listbox-${instanceUid}`}>\n <StyledFastList\n dsFastlistWrapperList={{\n role: 'listbox',\n 'data-testid': ComboboxDataTestid.LIST,\n 'aria-label': 'listbox',\n }}\n dsFastlistItem={{ role: 'none' }}\n actionRef={listRef}\n count={filteredOptions.length}\n ItemRenderer={ItemRenderer}\n extraItemProps={{ itemList: filteredOptions }}\n getId={(index: number) => filteredOptions[index].dsId}\n estimateSize={estimatedSize}\n getOwnerProps={getOwnerProps}\n />\n </StyledItemsWrapper>\n );\n } else {\n content = (\n <StyledNoResultsWrapper\n id={`combo-listbox-${instanceUid}`}\n data-testid={ComboboxDataTestid.NO_MATCHES_FOUND}\n role=\"alert\"\n >\n {noOptionsMessage}\n </StyledNoResultsWrapper>\n );\n }\n\n return (\n <StyledListWrapper\n innerRef={wrapperListRef}\n inline={inline}\n onMouseDown={preventLoseInputFocus}\n width={width}\n minWidth={menuMinWidth}\n >\n {content}\n </StyledListWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgDT;AAhDd,SAAgB,YAAY,mBAAmB;AAC/C,SAAS,kBAAkB;AAC3B,SAA2B,cAAc;AACzC,SAAS,YAAY;AACrB,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB,8BAA8B;AAC1D,SAAS,0BAA0B;AACnC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAClC,SAAS,0BAA0B;AACnC,SAAS,oBAAoB,2BAA2B;AAExD,MAAM,iBAAiB,OAAO,YAAY;AAAA,EACxC,MAAM;AAAA,EACN,MAAM,oBAAoB;AAC5B,CAAC;AAED,MAAM,qBAAqB,OAAO,IAAI;AAAA,gBAGtB,CAAC,EAAE,UAAU,MAAO,YAAY,GAAG,OAAO,SAAS,CAAC,OAAO,OAAQ;AAAA;AAGnF,MAAM,gBAAgB,MAAM;AAErB,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ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ACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,9 +2,19 @@ import * as React from "react";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { SkeletonMenuItem } from "@elliemae/ds-menu-items";
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
|
-
|
|
5
|
+
import { styled } from "@elliemae/ds-system";
|
|
6
|
+
import { FORM_COMBOBOX_SLOTS, DSFormComboboxName } from "../../constants/index.js";
|
|
7
|
+
const StyledSkeletonMenuItem = styled(SkeletonMenuItem, {
|
|
8
|
+
name: DSFormComboboxName,
|
|
9
|
+
slot: FORM_COMBOBOX_SLOTS.SKELETON_MENU_ITEM,
|
|
10
|
+
preserveLegacyDataTestId: true
|
|
11
|
+
})``;
|
|
12
|
+
const SkeletonContainer = ({
|
|
13
|
+
instanceUid,
|
|
14
|
+
getOwnerProps
|
|
15
|
+
}) => {
|
|
6
16
|
const SKELETON_AMOUNT = [0, 1, 2, 3, 4];
|
|
7
|
-
return /* @__PURE__ */ jsx(Grid, { id: `combo-listbox-${instanceUid}`, children: SKELETON_AMOUNT.map((n, index) => /* @__PURE__ */ jsx(
|
|
17
|
+
return /* @__PURE__ */ jsx(Grid, { id: `combo-listbox-${instanceUid}`, children: SKELETON_AMOUNT.map((n, index) => /* @__PURE__ */ jsx(StyledSkeletonMenuItem, { dsId: index.toString(), role: "presentation", getOwnerProps }, n)) });
|
|
8
18
|
};
|
|
9
19
|
export {
|
|
10
20
|
SkeletonContainer
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/menu-list/SkeletonContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { SkeletonMenuItem } from '@elliemae/ds-menu-items';\nimport { Grid } from '@elliemae/ds-grid';\n\nexport const SkeletonContainer = ({
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { SkeletonMenuItem } from '@elliemae/ds-menu-items';\nimport { Grid } from '@elliemae/ds-grid';\nimport { styled } from '@elliemae/ds-system';\n\nimport { FORM_COMBOBOX_SLOTS, DSFormComboboxName } from '../../constants/index.js';\n\nconst StyledSkeletonMenuItem = styled(SkeletonMenuItem, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SKELETON_MENU_ITEM,\n preserveLegacyDataTestId: true,\n})``;\n\nexport const SkeletonContainer = ({\n instanceUid,\n getOwnerProps,\n}: {\n instanceUid: string;\n getOwnerProps: () => object;\n}): JSX.Element => {\n const SKELETON_AMOUNT = [0, 1, 2, 3, 4] as const;\n\n return (\n <Grid id={`combo-listbox-${instanceUid}`}>\n {SKELETON_AMOUNT.map((n, index) => (\n <StyledSkeletonMenuItem key={n} dsId={index.toString()} role=\"presentation\" getOwnerProps={getOwnerProps} />\n ))}\n </Grid>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyBf;AAxBR,SAAS,wBAAwB;AACjC,SAAS,YAAY;AACrB,SAAS,cAAc;AAEvB,SAAS,qBAAqB,0BAA0B;AAExD,MAAM,yBAAyB,OAAO,kBAAkB;AAAA,EACtD,MAAM;AAAA,EACN,MAAM,oBAAoB;AAAA,EAC1B,0BAA0B;AAC5B,CAAC;AAEM,MAAM,oBAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AACF,MAGmB;AACjB,QAAM,kBAAkB,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtC,SACE,oBAAC,QAAK,IAAI,iBAAiB,WAAW,IACnC,0BAAgB,IAAI,CAAC,GAAG,UACvB,oBAAC,0BAA+B,MAAM,MAAM,SAAS,GAAG,MAAK,gBAAe,iBAA/C,CAA6E,CAC3G,GACH;AAEJ;",
|
|
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/menu-list/styled.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\ninterface StyledListWrapperT {\n minWidth: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n width: number | string;\n inline?: boolean;\n}\nexport const StyledListWrapper = styled(Grid)<StyledListWrapperT>`\n min-width: ${({ inline, minWidth }) => (inline ? '100%' : `${String(minWidth)}px`)};\n width: ${({ width }) => `${width}px`};\n background-color: #ffffff;\n z-index: 100;\n`;\n\nexport const StyledCreatableLabel = styled.span`\n font-weight: bold;\n font-style: italic;\n`;\n\nexport const StyledCreatableValue = styled.span`\n word-break: break-all;\n`;\n\nexport const StyledNoResultsWrapper = styled.div`\n padding:
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styled } from '@elliemae/ds-system';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\n\ninterface StyledListWrapperT {\n minWidth: SizingProps['minWidth'];\n maxHeight?: SizingProps['maxHeight'];\n width: number | string;\n inline?: boolean;\n}\nexport const StyledListWrapper = styled(Grid)<StyledListWrapperT>`\n min-width: ${({ inline, minWidth }) => (inline ? '100%' : `${String(minWidth)}px`)};\n width: ${({ width }) => `${width}px`};\n background-color: #ffffff;\n z-index: 100;\n`;\n\nexport const StyledCreatableLabel = styled.span`\n font-weight: bold;\n font-style: italic;\n`;\n\nexport const StyledCreatableValue = styled.span`\n word-break: break-all;\n`;\n\nexport const StyledNoResultsWrapper = styled.div`\n padding: 14px;\n`;\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,cAAc;AAEvB,SAAS,YAAY;AAQd,MAAM,oBAAoB,OAAO,IAAI;AAAA,eAC7B,CAAC,EAAE,QAAQ,SAAS,MAAO,SAAS,SAAS,GAAG,OAAO,QAAQ,CAAC,IAAK;AAAA,WACzE,CAAC,EAAE,MAAM,MAAM,GAAG,KAAK,IAAI;AAAA;AAAA;AAAA;AAK/B,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAAA;AAKpC,MAAM,uBAAuB,OAAO;AAAA;AAAA;AAIpC,MAAM,yBAAyB,OAAO;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,14 +3,28 @@ 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 { SingleMenuItem, MultiMenuItem, Separator } from "@elliemae/ds-menu-items";
|
|
6
|
+
import { styled } from "@elliemae/ds-system";
|
|
7
|
+
import { useOwnerProps } from "@elliemae/ds-props-helpers";
|
|
6
8
|
import { Section } from "../Section.js";
|
|
7
9
|
import { ComboBoxContext } from "../../ComboBoxCTX.js";
|
|
8
10
|
import { StyledCreatableLabel, StyledCreatableValue } from "./styled.js";
|
|
9
11
|
import { isSelected, getSuggestedValueOnChange } from "../../utils/listHelper.js";
|
|
10
12
|
import { ComboboxDataTestid } from "../../ComboboxDataTestids.js";
|
|
11
13
|
import { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from "../../constants.js";
|
|
14
|
+
import { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from "../../constants/index.js";
|
|
15
|
+
const StyledSingleMenuItem = styled(SingleMenuItem, {
|
|
16
|
+
name: DSFormComboboxName,
|
|
17
|
+
slot: FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM,
|
|
18
|
+
preserveLegacyDataTestId: true
|
|
19
|
+
})``;
|
|
20
|
+
const StyledMultiMenuItem = styled(MultiMenuItem, {
|
|
21
|
+
name: DSFormComboboxName,
|
|
22
|
+
slot: FORM_COMBOBOX_SLOTS.MULTI_MENU_ITEM,
|
|
23
|
+
preserveLegacyDataTestId: true
|
|
24
|
+
})``;
|
|
12
25
|
const ItemRenderer = ({ index, extraItemProps }) => {
|
|
13
26
|
const {
|
|
27
|
+
props,
|
|
14
28
|
props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions, readOnly },
|
|
15
29
|
setMenuState,
|
|
16
30
|
inputValue,
|
|
@@ -18,9 +32,16 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
18
32
|
setInputValue,
|
|
19
33
|
optionsPerSection
|
|
20
34
|
} = useContext(ComboBoxContext);
|
|
21
|
-
const
|
|
35
|
+
const { getOwnerProps } = useOwnerProps(props);
|
|
36
|
+
const getOwnerPropsArguments = useCallback(
|
|
37
|
+
() => ({
|
|
38
|
+
index
|
|
39
|
+
}),
|
|
40
|
+
[index]
|
|
41
|
+
);
|
|
42
|
+
const option = extraItemProps?.itemList?.[index];
|
|
22
43
|
const multiple = Array.isArray(selectedValues);
|
|
23
|
-
const CBItem = multiple ?
|
|
44
|
+
const CBItem = multiple ? StyledMultiMenuItem : StyledSingleMenuItem;
|
|
24
45
|
const handleOnCreateClick = useCallback(() => {
|
|
25
46
|
if (inputValue && onCreate) {
|
|
26
47
|
onCreate(inputValue);
|
|
@@ -69,7 +90,9 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
69
90
|
handleClick,
|
|
70
91
|
focusOptionIdx,
|
|
71
92
|
handleOnMouseDown,
|
|
72
|
-
selectedValues
|
|
93
|
+
selectedValues,
|
|
94
|
+
getOwnerProps,
|
|
95
|
+
getOwnerPropsArguments
|
|
73
96
|
}
|
|
74
97
|
);
|
|
75
98
|
}
|
|
@@ -94,16 +117,20 @@ const ItemRenderer = ({ index, extraItemProps }) => {
|
|
|
94
117
|
},
|
|
95
118
|
onMouseDown: handleOnMouseDown,
|
|
96
119
|
isActive: dsId === focusOptionIdx,
|
|
120
|
+
tabIndex: -1,
|
|
97
121
|
isSelected: isSelected(selectedValues, option),
|
|
98
|
-
|
|
122
|
+
getOwnerProps,
|
|
123
|
+
getOwnerPropsArguments
|
|
99
124
|
}
|
|
100
125
|
)
|
|
101
126
|
);
|
|
102
127
|
}
|
|
103
128
|
if (type === INTERNAL_MENU_OPTION_TYPES.CREATABLE) {
|
|
104
129
|
return /* @__PURE__ */ jsx(
|
|
105
|
-
|
|
130
|
+
StyledSingleMenuItem,
|
|
106
131
|
{
|
|
132
|
+
getOwnerProps,
|
|
133
|
+
getOwnerPropsArguments,
|
|
107
134
|
dataTestid: ComboboxDataTestid.OPTION,
|
|
108
135
|
isActive: dsId === focusOptionIdx,
|
|
109
136
|
...generalProps,
|
|
@@ -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 { SingleMenuItem, MultiMenuItem, Separator } from '@elliemae/ds-menu-items';\nimport { Section } from '../Section.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { StyledCreatableLabel, StyledCreatableValue } 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
|
|
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 { SingleMenuItem, MultiMenuItem, Separator } from '@elliemae/ds-menu-items';\nimport { styled } from '@elliemae/ds-system';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { Section } from '../Section.js';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport { StyledCreatableLabel, StyledCreatableValue } 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';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../../constants/index.js';\n\ninterface ItemRendererT {\n extraItemProps?: {\n itemList?: DSComboboxT.OptionTypes[];\n };\n index: number;\n}\n\nconst StyledSingleMenuItem = styled(SingleMenuItem, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.SINGLE_MENU_ITEM,\n preserveLegacyDataTestId: true,\n})``;\n\nconst StyledMultiMenuItem = styled(MultiMenuItem, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.MULTI_MENU_ITEM,\n preserveLegacyDataTestId: true,\n})``;\n\nexport const ItemRenderer = ({ index, extraItemProps }: ItemRendererT): JSX.Element => {\n const {\n props,\n props: { onCreate, onChange, isNonClearable, selectedValues, onFilter, allOptions, readOnly },\n setMenuState,\n inputValue,\n focusOptionIdx,\n setInputValue,\n optionsPerSection,\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 = multiple ? StyledMultiMenuItem : StyledSingleMenuItem;\n\n const handleOnCreateClick = useCallback(() => {\n if (inputValue && onCreate) {\n onCreate(inputValue);\n setInputValue('');\n if (onFilter) onFilter(allOptions, inputValue);\n }\n }, [onFilter, onCreate, inputValue, allOptions, setInputValue]);\n\n const handleClick = useCallback(\n (currentOption: DSComboboxT.ItemOption, e: React.MouseEvent) => {\n if (readOnly) 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(getSuggestedValueOnChange(currentOption, selectedValues, isNonClearable), currentOption, e);\n }\n }\n // prevent for loosing focus on input control\n e.stopPropagation();\n e.preventDefault();\n },\n [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 // @ts-expect-error - this needs to be rewritten, this should not be a custom hook returning JSX, this should be a component.\n return useMemo(() => {\n if (option) {\n const { dsId, type, disabled, applyAriaDisabled, readOnly: itemReadOnly, ...rest } = option;\n const generalProps = {\n // 'aria-setsize': `${allOptions.length}`,\n // 'aria-posinset': `${vItem.index + 1}`,\n key: `${dsId}`,\n dsId: dsId.toString(),\n ...rest,\n };\n if (type === MENU_OPTION_TYPES.SECTION) {\n return (\n <Section\n label={option.label}\n {...generalProps}\n // @ts-expect-error - this needs to be rewritten, broken typescript typings?\n options={option.options}\n handleClick={handleClick}\n focusOptionIdx={focusOptionIdx}\n handleOnMouseDown={handleOnMouseDown}\n selectedValues={selectedValues}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\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 // @ts-expect-error - this needs to be rewritten, this should not be a custom hook returning JSX, this should be a component.\n <CBItem\n {...generalProps}\n value={option.value}\n label={option.label}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || itemReadOnly}\n onClick={(e: React.MouseEvent) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\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 p=\"8px\" cols={['min-content', 'auto']} gutter=\"xxs\" alignItems=\"center\">\n <StyledCreatableLabel>Add:</StyledCreatableLabel>\n <StyledCreatableValue>{`\"${labelCreatable}\"`}</StyledCreatableValue>\n </Grid>\n )}\n label={option.label}\n onClick={handleOnCreateClick}\n />\n );\n }\n return null;\n }\n return null;\n }, [optionsPerSection, focusOptionIdx, selectedValues, allOptions, onCreate, inputValue, readOnly]);\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0Gb,cAiDI,YAjDJ;AAvGV,SAAgB,SAAS,YAAY,mBAAmB;AACxD,SAAS,YAAY;AACrB,SAAS,gBAAgB,eAAe,iBAAiB;AACzD,SAAS,cAAc;AACvB,SAAS,qBAAqB;AAC9B,SAAS,eAAe;AACxB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB,4BAA4B;AAC3D,SAAS,YAAY,iCAAiC;AACtD,SAAS,0BAA0B;AAEnC,SAAS,mBAAmB,kCAAkC;AAC9D,SAAS,oBAAoB,2BAA2B;AASxD,MAAM,uBAAuB,OAAO,gBAAgB;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,WAAW;AACjD,eACE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA,YAAY,mBAAmB;AAAA,YAC/B,UAAU,SAAS;AAAA,YAClB,GAAG;AAAA,YACJ,QAAQ,CAAC,EAAE,OAAO,eAAe,MAC/B,qBAAC,QAAK,GAAE,OAAM,MAAM,CAAC,eAAe,MAAM,GAAG,QAAO,OAAM,YAAW,UACnE;AAAA,kCAAC,wBAAqB,kBAAI;AAAA,cAC1B,oBAAC,wBAAsB,cAAI,cAAc,KAAI;AAAA,eAC/C;AAAA,YAEF,OAAO,OAAO;AAAA,YACd,SAAS;AAAA;AAAA,QACX;AAAA,MAEJ;AACA,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT,GAAG,CAAC,mBAAmB,gBAAgB,gBAAgB,YAAY,UAAU,YAAY,QAAQ,CAAC;AACpG;",
|
|
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/react-desc-prop-types.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable no-unused-vars */\nimport type { DSFastListT } from '@elliemae/ds-fast-list';\nimport type { DSFloatingWrapperT, useFloatingContext } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPopperJST } from '@elliemae/ds-popperjs';\nimport type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';\nimport { globalAttributesPropTypes, PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport function noop<T extends unknown[]>(..._args: T): void {}\n\nexport declare namespace DSComboboxT {\n type ReturnOfUseFloatingContext = ReturnType<typeof useFloatingContext>;\n export interface CommonItemOptions extends GlobalAttributesT {\n dsId: string;\n disabled?: boolean;\n applyAriaDisabled?: boolean;\n render?: React.ComponentType<unknown>;\n }\n export interface ItemSeparatorOptions extends CommonItemOptions {\n type: 'separator';\n }\n\n export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n\n export type OptionTypes = ItemOption | ItemSectionOptions | ItemSeparatorOptions | ItemCreatableOption;\n\n export type SelectedOptionsT = ItemOption[] | ItemOption | null;\n export interface PropsOptional {\n menuMinWidth?: SizingProps['minWidth'];\n menuMaxHeight?: SizingProps['maxHeight'];\n placeholder?: string;\n autoFocus?: boolean;\n filteredOptions?: OptionTypes[];\n isMenuOpen?: boolean;\n onMenuChange?: (\n state: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => void;\n onCreate?: (label: string) => void;\n onFilter?: (newOptions: OptionTypes[], inputValue?: string) => void;\n onCancel?: () => void;\n onSelectAll?: (suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => null;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;\n isLoading?: boolean;\n popperProps?: DSFloatingWrapperT.Props;\n }\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n selectedValues: SelectedOptionsT;\n onChange: (\n suggestedValue: SelectedOptionsT,\n selectedOption: ItemOption,\n event: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n }\n export interface DefaultProps {\n startPlacementPreference: DSPopperJST.PopperPlacementsT;\n placementOrderPreference: DSPopperJST.PopperPlacementsT[];\n hasError: boolean;\n inline: boolean;\n withoutPortal: boolean;\n isNonClearable: boolean;\n disabled: boolean;\n noOptionsMessage: string;\n innerRef: React.MutableRefObject<HTMLInputElement | null> | ((ref: HTMLInputElement | null) => void);\n useMask: DSMaskT.Hook | typeof noop;\n onlySelectable: boolean;\n isSkeleton: boolean;\n applyAriaDisabled: boolean;\n readOnly: boolean;\n isMenuOpenableWithReadOnly: boolean;\n forceFocusFirstOptionOnType: boolean;\n }\n\n export interface Props\n extends Partial<DefaultProps>,\n RequiredProps,\n PropsOptional,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof RequiredProps | keyof PropsOptional>,\n XstyledProps {}\n\n export interface InternalProps\n extends DefaultProps,\n RequiredProps,\n PropsOptional,\n Omit<GlobalAttributesT, keyof DefaultProps | keyof RequiredProps | keyof PropsOptional>,\n XstyledProps {}\n\n type ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n };\n}\n\nexport const ComboboxPropTypes = {\n ...globalAttributesPropTypes,\n placeholder: PropTypes.string.description(\"input's placeholder value\").defaultValue(''),\n allOptions: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n .isRequired.description('List of original options')\n .defaultValue([]),\n filteredOptions: PropTypes.oneOfType([PropTypes.array, PropTypes.object])\n .description('List of filtered options to show in the menu based on the current internal input filter value')\n .defaultValue([]),\n selectedValues: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]).isRequired.description(\n 'Array of option or single option selected',\n ),\n disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue('false'),\n autoFocus: PropTypes.bool.description('Whether the combo box uses auto focus or not').defaultValue('false'),\n hasError: PropTypes.bool.description('Whether the combo box has error or not').defaultValue('false'),\n noOptionsMessage: PropTypes.string\n .description('Custome message to be display when no matches found after filtering')\n .defaultValue('No Matches Found'),\n onChange: PropTypes.func.isRequired\n .description('function triggered when an option is selected it will send the options selected')\n .defaultValue('() => {}'),\n onFilter: PropTypes.func.description('function triggered when user type in the combobox input').defaultValue(''),\n onCreate: PropTypes.func\n .description(\n 'function triggered when user select \"create\" a new item whenever is not a match in the all option list',\n )\n .defaultValue(''),\n onCancel: PropTypes.func.description('function triggered when user press ESC key').defaultValue('() => {}'),\n onMenuChange: PropTypes.func\n .description('function triggered when user open or close the menu list')\n .defaultValue('() => {}'),\n menuMinWidth: PropTypes.any.description('Minimum width for the dropdown menu').defaultValue(undefined),\n menuMaxHeight: PropTypes.any.description('Maximum height for the dropdown menu').defaultValue(undefined),\n withoutPortal: PropTypes.bool\n .description('Whether the combobox menu is rendered in a portal or not')\n .defaultValue(false),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.any })]).description(\n 'reference to the component',\n ),\n onlySelectable: PropTypes.bool.description('filtering is disabled'),\n isSkeleton: PropTypes.bool.description('whether or not the component is in skeleton state').defaultValue(false),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Whether to apply disabled styling and announce as disabled in SR. CAN STILL RECEIVE FOCUS. PREVENTS ONLY MAIN ACTION.',\n )\n .defaultValue(false),\n readOnly: PropTypes.bool\n .description('Makes the component non-editable while remaining accessible.')\n .defaultValue(false),\n isMenuOpenableWithReadOnly: PropTypes.bool\n .description('Whether the menu can be opened when the input is readonly')\n .defaultValue(false),\n onSelectAll: PropTypes.func\n .description('function triggered when user select all the options')\n .defaultValue('() => {}')\n .deprecated({ version: '25.2' }),\n popperProps: PropTypes.object\n .description('props to be passed to the FloatingWrapper component')\n .defaultValue(undefined),\n forceFocusFirstOptionOnType: PropTypes.bool\n .description('Whether to focus the first option when typing in the input.')\n .defaultValue(false),\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOvB,SAAS,2BAA2B,iBAAiB;AAI9C,SAAS,QAA6B,OAAgB;AAAC;AAsGvD,MAAM,oBAAoB;AAAA,EAC/B,GAAG;AAAA,EACH,aAAa,UAAU,OAAO,YAAY,2BAA2B,EAAE,a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C,CAAC,EAAE;AAAA,IAC3F;AAAA,EACF;AAAA,EACA,gBAAgB,UAAU,KAAK,YAAY,uBAAuB;AAAA,EAClE,YAAY,UAAU,KAAK,YAAY,mDAAmD,EAAE,aAAa,KAAK;AAAA,EAC9G,mBAAmB,UAAU,KAC1B;AAAA,IACC;AAAA,EACF,EACC,aAAa,KAAK;AAAA,EACrB,UAAU,UAAU,KACjB,YAAY,8DAA8D,EAC1E,aAAa,KAAK;AAAA,EACrB,4BAA4B,UAAU,KACnC,YAAY,2DAA2D,EACvE,aAAa,KAAK;AAAA,EACrB,aAAa,UAAU,KACpB,YAAY,qDAAqD,EACjE,aAAa,UAAU,EACvB,WAAW,EAAE,SAAS,OAAO,CAAC;AAAA,EACjC,aAAa,UAAU,OACpB,YAAY,qDAAqD,EACjE,aAAa,MAAS;AAAA,EACzB,6BAA6B,UAAU,KACpC,YAAY,6DAA6D,EACzE,aAAa,KAAK;AACvB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const DSFormComboboxName = "DSCombobox";
|
|
2
|
+
export declare const FORM_COMBOBOX_SLOTS: {
|
|
3
|
+
readonly ROOT: "root";
|
|
4
|
+
readonly INPUT_WRAPPER: "input-wrapper";
|
|
5
|
+
readonly INPUT: "input";
|
|
6
|
+
readonly DROPDOWN_BUTTON: "dropdown-button";
|
|
7
|
+
readonly FAST_LIST: "fast-list";
|
|
8
|
+
readonly SECTION_WRAPPER: "section-wrapper";
|
|
9
|
+
readonly SECTION_LABEL: "section-label";
|
|
10
|
+
readonly SINGLE_MENU_ITEM: "single-menu-item";
|
|
11
|
+
readonly MULTI_MENU_ITEM: "multi-menu-item";
|
|
12
|
+
readonly LOADING_INDICATOR: "loading-indicator";
|
|
13
|
+
readonly SKELETON_MENU_ITEM: "skeleton-menu-item";
|
|
14
|
+
};
|
|
15
|
+
export declare const FORM_COMBOBOX_DATA_TESTID: {
|
|
16
|
+
CONTROLS_WRAPPER: string;
|
|
17
|
+
CONTAINER: string;
|
|
18
|
+
INPUT: string;
|
|
19
|
+
LIST: string;
|
|
20
|
+
NO_MATCHES_FOUND: string;
|
|
21
|
+
SELECTED_VALUES: string;
|
|
22
|
+
DROPDOWN: string;
|
|
23
|
+
OPTION: string;
|
|
24
|
+
ALLY_SELECTED_VALUES: string;
|
|
25
|
+
ROOT: "ds-combobox-root";
|
|
26
|
+
INPUT_WRAPPER: "ds-combobox-input-wrapper";
|
|
27
|
+
DROPDOWN_BUTTON: "ds-combobox-dropdown-button";
|
|
28
|
+
FAST_LIST: "ds-combobox-fast-list";
|
|
29
|
+
SECTION_WRAPPER: "ds-combobox-section-wrapper";
|
|
30
|
+
SECTION_LABEL: "ds-combobox-section-label";
|
|
31
|
+
SINGLE_MENU_ITEM: "ds-combobox-single-menu-item";
|
|
32
|
+
MULTI_MENU_ITEM: "ds-combobox-multi-menu-item";
|
|
33
|
+
LOADING_INDICATOR: "ds-combobox-loading-indicator";
|
|
34
|
+
SKELETON_MENU_ITEM: "ds-combobox-skeleton-menu-item";
|
|
35
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export { DSComboBox, DSComboBoxV3, DSComboBoxWithSchema, offScreenStyle } from './ComboBox.js';
|
|
2
|
+
export { DSComboBoxName, DSComboboxSlots } from './theming.js';
|
|
3
|
+
export { DSFormComboboxName, FORM_COMBOBOX_DATA_TESTID, FORM_COMBOBOX_SLOTS } from './constants/index.js';
|
|
4
|
+
export { ComboboxDataTestid } from './ComboboxDataTestids.js';
|
|
4
5
|
export { type DSComboboxT, ComboboxPropTypes } from './react-desc-prop-types.js';
|
|
@@ -9,6 +9,10 @@ interface SectionProps {
|
|
|
9
9
|
handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;
|
|
10
10
|
focusOptionIdx: string;
|
|
11
11
|
selectedValues: DSComboboxT.SelectedOptionsT;
|
|
12
|
+
getOwnerProps: () => object;
|
|
13
|
+
getOwnerPropsArguments?: () => {
|
|
14
|
+
index: number;
|
|
15
|
+
};
|
|
12
16
|
}
|
|
13
17
|
export declare const Section: React.MemoExoticComponent<(props: SectionProps) => import("react/jsx-runtime.js").JSX.Element>;
|
|
14
18
|
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
|
|
3
|
+
disabled?: boolean;
|
|
4
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
|
|
7
|
+
disabled?: boolean;
|
|
8
8
|
applyAriaDisabled: boolean;
|
|
9
9
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
declare const LoadingContainer: (
|
|
1
|
+
declare const LoadingContainer: ({ getOwnerProps }: {
|
|
2
|
+
getOwnerProps: () => object;
|
|
3
|
+
}) => import("react/jsx-runtime.js").JSX.Element;
|
|
2
4
|
export { LoadingContainer };
|
|
3
5
|
export default LoadingContainer;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type {
|
|
3
|
-
import type { DSFloatingWrapperT } from '@elliemae/ds-floating-context';
|
|
1
|
+
import type { DSFastListT } from '@elliemae/ds-fast-list';
|
|
2
|
+
import type { DSFloatingWrapperT, useFloatingContext } from '@elliemae/ds-floating-context';
|
|
4
3
|
import type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';
|
|
5
|
-
import type { SizingProps } from '@elliemae/ds-system';
|
|
6
4
|
import type { DSPopperJST } from '@elliemae/ds-popperjs';
|
|
7
|
-
import type {
|
|
5
|
+
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
6
|
+
import type { SizingProps } from '@elliemae/ds-system';
|
|
7
|
+
import type React from 'react';
|
|
8
8
|
export declare function noop<T extends unknown[]>(..._args: T): void;
|
|
9
9
|
export declare namespace DSComboboxT {
|
|
10
|
+
type ReturnOfUseFloatingContext = ReturnType<typeof useFloatingContext>;
|
|
10
11
|
interface CommonItemOptions extends GlobalAttributesT {
|
|
11
12
|
dsId: string;
|
|
12
13
|
disabled?: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export declare const useOnElementResize: <T extends HTMLElement>(targetRef: React.RefObject<T>) => Record<
|
|
2
|
+
export declare const useOnElementResize: <T extends HTMLElement>(targetRef: React.RefObject<T>) => Record<"width" | "height", number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-combobox",
|
|
3
|
-
"version": "3.53.0-alpha.
|
|
3
|
+
"version": "3.53.0-alpha.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Combobox",
|
|
6
6
|
"files": [
|
|
@@ -37,31 +37,32 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"react-virtual": "~2.10.4",
|
|
40
|
-
"uid": "
|
|
41
|
-
"@elliemae/ds-button-v2": "3.53.0-alpha.
|
|
42
|
-
"@elliemae/ds-circular-progress-indicator": "3.53.0-alpha.
|
|
43
|
-
"@elliemae/ds-fast-list": "3.53.0-alpha.
|
|
44
|
-
"@elliemae/ds-floating-context": "3.53.0-alpha.
|
|
45
|
-
"@elliemae/ds-
|
|
46
|
-
"@elliemae/ds-
|
|
47
|
-
"@elliemae/ds-
|
|
48
|
-
"@elliemae/ds-
|
|
49
|
-
"@elliemae/ds-
|
|
50
|
-
"@elliemae/ds-
|
|
51
|
-
"@elliemae/ds-
|
|
52
|
-
"@elliemae/ds-truncated-tooltip-text": "3.53.0-alpha.
|
|
40
|
+
"uid": "^2.0.2",
|
|
41
|
+
"@elliemae/ds-button-v2": "3.53.0-alpha.2",
|
|
42
|
+
"@elliemae/ds-circular-progress-indicator": "3.53.0-alpha.2",
|
|
43
|
+
"@elliemae/ds-fast-list": "3.53.0-alpha.2",
|
|
44
|
+
"@elliemae/ds-floating-context": "3.53.0-alpha.2",
|
|
45
|
+
"@elliemae/ds-form-checkbox": "3.53.0-alpha.2",
|
|
46
|
+
"@elliemae/ds-menu-items": "3.53.0-alpha.2",
|
|
47
|
+
"@elliemae/ds-icons": "3.53.0-alpha.2",
|
|
48
|
+
"@elliemae/ds-props-helpers": "3.53.0-alpha.2",
|
|
49
|
+
"@elliemae/ds-grid": "3.53.0-alpha.2",
|
|
50
|
+
"@elliemae/ds-pills-v2": "3.53.0-alpha.2",
|
|
51
|
+
"@elliemae/ds-system": "3.53.0-alpha.2",
|
|
52
|
+
"@elliemae/ds-truncated-tooltip-text": "3.53.0-alpha.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
56
|
-
"@elliemae/pui-theme": "~2.
|
|
55
|
+
"@elliemae/pui-cli": "9.0.0-next.65",
|
|
56
|
+
"@elliemae/pui-theme": "~2.13.0",
|
|
57
57
|
"jest": "~29.7.0",
|
|
58
58
|
"styled-components": "~5.3.9",
|
|
59
59
|
"styled-system": "^5.1.5",
|
|
60
|
-
"@elliemae/ds-
|
|
61
|
-
"@elliemae/ds-
|
|
60
|
+
"@elliemae/ds-monorepo-devops": "3.53.0-alpha.2",
|
|
61
|
+
"@elliemae/ds-form-helpers-mask-hooks": "3.53.0-alpha.2",
|
|
62
|
+
"@elliemae/ds-test-utils": "3.53.0-alpha.2"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
|
-
"@elliemae/pui-theme": "~2.
|
|
65
|
+
"@elliemae/pui-theme": "~2.13.0",
|
|
65
66
|
"react": "^18.3.1",
|
|
66
67
|
"react-dom": "^18.3.1",
|
|
67
68
|
"styled-components": "~5.3.9",
|