@elliemae/ds-form-combobox 3.70.0-next.7 → 3.70.0-next.70
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/ComboBox.js.map +2 -2
- package/dist/cjs/DSComboboxMultiT.js +1 -1
- package/dist/cjs/DSComboboxMultiT.js.map +2 -2
- package/dist/cjs/DSComboboxSingleT.js.map +2 -2
- package/dist/cjs/DSCommonComboboxPropsT.js.map +1 -1
- package/dist/cjs/{config/useClickOutside.js → TruncatedText.js} +17 -22
- package/dist/cjs/TruncatedText.js.map +7 -0
- package/dist/cjs/config/useComboBox.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/parts/DropdownIndicator.js +2 -2
- package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
- package/dist/cjs/parts/Section.js +5 -6
- package/dist/cjs/parts/Section.js.map +2 -2
- package/dist/cjs/parts/container/Container.js +9 -13
- package/dist/cjs/parts/container/Container.js.map +2 -2
- package/dist/cjs/parts/controls/Controls.js +19 -9
- package/dist/cjs/parts/controls/Controls.js.map +2 -2
- package/dist/cjs/parts/controls/styled.js +18 -8
- package/dist/cjs/parts/controls/styled.js.map +2 -2
- package/dist/cjs/parts/controls-input/ControlsInput.js +17 -4
- package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/cjs/parts/controls-input/styled.js +24 -9
- package/dist/cjs/parts/controls-input/styled.js.map +2 -2
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +3 -1
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/parts/menu-list/LoadingContainer.js +1 -1
- package/dist/cjs/parts/menu-list/LoadingContainer.js.map +2 -2
- package/dist/cjs/parts/menu-list/styled.js +7 -3
- package/dist/cjs/parts/menu-list/styled.js.map +2 -2
- package/dist/cjs/parts/menu-list/useItemRenderer.js +7 -5
- package/dist/cjs/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -0
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
- package/dist/cjs/parts/styled.js +5 -1
- package/dist/cjs/parts/styled.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/utils/listHelper.js +2 -1
- package/dist/cjs/utils/listHelper.js.map +2 -2
- package/dist/cjs/utils/typeGuards.js +36 -0
- package/dist/cjs/utils/typeGuards.js.map +7 -0
- package/dist/esm/ComboBox.js.map +2 -2
- package/dist/esm/DSComboboxMultiT.js +1 -1
- package/dist/esm/DSComboboxMultiT.js.map +2 -2
- package/dist/esm/DSComboboxSingleT.js.map +2 -2
- package/dist/esm/DSCommonComboboxPropsT.js.map +1 -1
- package/dist/esm/TruncatedText.js +17 -0
- package/dist/esm/TruncatedText.js.map +7 -0
- package/dist/esm/config/useComboBox.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/parts/DropdownIndicator.js +3 -3
- package/dist/esm/parts/DropdownIndicator.js.map +2 -2
- package/dist/esm/parts/Section.js +5 -6
- package/dist/esm/parts/Section.js.map +2 -2
- package/dist/esm/parts/container/Container.js +9 -13
- package/dist/esm/parts/container/Container.js.map +2 -2
- package/dist/esm/parts/controls/Controls.js +19 -9
- package/dist/esm/parts/controls/Controls.js.map +2 -2
- package/dist/esm/parts/controls/styled.js +19 -9
- package/dist/esm/parts/controls/styled.js.map +2 -2
- package/dist/esm/parts/controls-input/ControlsInput.js +17 -4
- package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/esm/parts/controls-input/styled.js +25 -10
- package/dist/esm/parts/controls-input/styled.js.map +2 -2
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js +3 -1
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/parts/menu-list/LoadingContainer.js +1 -1
- package/dist/esm/parts/menu-list/LoadingContainer.js.map +2 -2
- package/dist/esm/parts/menu-list/styled.js +7 -3
- package/dist/esm/parts/menu-list/styled.js.map +2 -2
- package/dist/esm/parts/menu-list/useItemRenderer.js +7 -5
- package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -0
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +2 -2
- package/dist/esm/parts/styled.js +5 -1
- package/dist/esm/parts/styled.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/utils/listHelper.js +2 -1
- package/dist/esm/utils/listHelper.js.map +2 -2
- package/dist/esm/utils/typeGuards.js +6 -0
- package/dist/esm/utils/typeGuards.js.map +7 -0
- package/dist/types/ComboBox.d.ts +1 -1
- package/dist/types/DSComboboxMultiT.d.ts +2 -2
- package/dist/types/DSComboboxSingleT.d.ts +2 -2
- package/dist/types/DSCommonComboboxPropsT.d.ts +1 -1
- package/dist/types/TruncatedText.d.ts +13 -0
- package/dist/types/parts/LiveRegion.d.ts +2 -2
- package/dist/types/parts/Section.d.ts +1 -1
- package/dist/types/parts/controls/styled.d.ts +1 -1
- package/dist/types/parts/controls-input/styled.d.ts +4 -2
- package/dist/types/parts/menu-list/LoadingContainer.d.ts +2 -1
- package/dist/types/parts/menu-list/styled.d.ts +20 -3
- package/dist/types/react-desc-prop-types.d.ts +1 -1
- package/dist/types/utils/listHelper.d.ts +2 -2
- package/dist/types/utils/typeGuards.d.ts +2 -0
- package/package.json +19 -18
- package/dist/cjs/TruncatedTooltipText.js +0 -96
- package/dist/cjs/TruncatedTooltipText.js.map +0 -7
- package/dist/cjs/config/useClickOutside.js.map +0 -7
- package/dist/esm/TruncatedTooltipText.js +0 -70
- package/dist/esm/TruncatedTooltipText.js.map +0 -7
- package/dist/esm/config/useClickOutside.js +0 -22
- package/dist/esm/config/useClickOutside.js.map +0 -7
- package/dist/types/TruncatedTooltipText.d.ts +0 -8
- package/dist/types/config/useClickOutside.d.ts +0 -1
- package/dist/types/tests/DSCombobox.a11y.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.api.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.creatable.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.data-testid.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.disabled.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.events.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.exports.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.force-focus-first-option-on-type.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.get-owner-props.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.keyboard.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.multi-select.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.onlyselectable.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.pui-18034.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.read-only.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.single-select.test.d.ts +0 -1
- package/dist/types/tests/DSCombobox.usemask.test.d.ts +0 -1
- package/dist/types/tests/utils.d.ts +0 -30
- package/dist/types/typescript-testing/slot-props.d.ts +0 -1
- package/dist/types/typescript-testing/typescript-combobox-multi-valid.d.ts +0 -1
- package/dist/types/typescript-testing/typescript-combobox-single-valid.d.ts +0 -1
package/dist/cjs/ComboBox.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/ComboBox.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { describe } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { ComboBoxContext } from './ComboBoxCTX.js';\nimport { useComboBox } from './config/useComboBox.js';\nimport type { DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { Container } from './parts/container/index.js';\nimport { ResultCountStatus } from './parts/LiveRegion.js';\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport { ComboboxPropTypesSchema } from './react-desc-prop-types.js';\n\nexport const offScreenStyle: React.CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n width: '1px',\n position: 'absolute',\n};\n\nconst DSComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import { describe } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { ComboBoxContext } from './ComboBoxCTX.js';\nimport { useComboBox } from './config/useComboBox.js';\nimport type { DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { Container } from './parts/container/index.js';\nimport { ResultCountStatus } from './parts/LiveRegion.js';\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport { ComboboxPropTypesSchema } from './react-desc-prop-types.js';\n\nexport const offScreenStyle: React.CSSProperties = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n width: '1px',\n position: 'absolute',\n};\n\nconst DSComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const ctx = useComboBox<T>(props);\n return (\n <ComboBoxContext.Provider value={ctx}>\n <Container />\n <ResultCountStatus\n menuOpen={ctx.menuState}\n isLoading={!!props.isLoading}\n isSkeleton={!!props.isSkeleton}\n resultCount={ctx.correctOptions?.length ?? 0}\n />\n </ComboBoxContext.Provider>\n );\n};\n\nDSComboBox.displayName = 'DSComboBox';\nconst DSComboBoxWithSchema = describe(DSComboBox);\n\nDSComboBoxWithSchema.propTypes = ComboboxPropTypesSchema;\n\nexport { DSComboBox, DSComboBox as DSComboBoxV3, DSComboBoxWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6BnB;AA7BJ,8BAAyB;AAEzB,yBAAgC;AAChC,yBAA4B;AAE5B,uBAA0B;AAC1B,wBAAkC;AAElC,mCAAwC;AAEjC,MAAM,iBAAsC;AAAA,EACjD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,SAAS;AAAA,EACT,OAAO;AAAA,EACP,UAAU;AACZ;AAEA,MAAM,aAAa,CAIjB,UACG;AACH,QAAM,UAAM,gCAAe,KAAK;AAChC,SACE,6CAAC,mCAAgB,UAAhB,EAAyB,OAAO,KAC/B;AAAA,gDAAC,8BAAU;AAAA,IACX;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,IAAI;AAAA,QACd,WAAW,CAAC,CAAC,MAAM;AAAA,QACnB,YAAY,CAAC,CAAC,MAAM;AAAA,QACpB,aAAa,IAAI,gBAAgB,UAAU;AAAA;AAAA,IAC7C;AAAA,KACF;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAEhD,qBAAqB,YAAY;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -44,7 +44,7 @@ const multiComboboxPropTypes = {
|
|
|
44
44
|
onChange: import_ds_props_helpers.PropTypes.func.isRequired.description(
|
|
45
45
|
"Multi-select change callback. Receives the full next selection array; use an empty array when no option remains selected."
|
|
46
46
|
).signature(
|
|
47
|
-
"(suggestedValue:
|
|
47
|
+
"(suggestedValue: SelectionableOptions[], selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void"
|
|
48
48
|
),
|
|
49
49
|
selectedValues: import_ds_props_helpers.PropTypes.arrayOf(import_ds_props_helpers.PropTypes.object).isRequired.description(
|
|
50
50
|
"Multi-select values as an array of selectable option objects. Use an empty array for no selection."
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSComboboxMultiT.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_MULTI_SLOTS } from './constants/index.js';\n\nexport declare namespace DSComboboxMultiT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValues: DSCommonComboboxPropsT.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,oCAAqE;AACrE,uBAA8D;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_MULTI_SLOTS } from './constants/index.js';\n\nexport declare namespace DSComboboxMultiT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValues: DSCommonComboboxPropsT.SelectionableOptions[];\n onChange: (\n suggestedValue: DSCommonComboboxPropsT.SelectionableOptions[],\n selectedOption: DSCommonComboboxPropsT.SelectionableOptions,\n event: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n }\n export interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {}\n export interface OptionalProps\n extends\n DSCommonComboboxPropsT.OptionalProps,\n TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSFormComboboxName, typeof FORM_COMBOBOX_MULTI_SLOTS> {}\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\n/**\n * Multi-select schema variant.\n *\n * - `selectedValues` is always an array of selectable option objects.\n * - empty array indicates no current selection.\n */\nexport const multiComboboxPropTypes: DSPropTypesSchema<DSComboboxMultiT.Props> = {\n ...getPropsPerSlotPropTypes(DSFormComboboxName, FORM_COMBOBOX_MULTI_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n ...commonComboboxPropTypes,\n onChange: PropTypes.func.isRequired\n .description(\n 'Multi-select change callback. Receives the full next selection array; use an empty array when no option remains selected.',\n )\n .signature(\n '(suggestedValue: SelectionableOptions[], selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void',\n ),\n selectedValues: PropTypes.arrayOf(PropTypes.object).isRequired.description(\n 'Multi-select values as an array of selectable option objects. Use an empty array for no selection.',\n ),\n};\n\nexport const multiComboboxPropTypesSchema = multiComboboxPropTypes as unknown as ValidationMap<DSComboboxMultiT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,oCAAqE;AACrE,uBAA8D;AAuDvD,MAAM,yBAAoE;AAAA,EAC/E,OAAG,kDAAyB,qCAAoB,0CAAyB;AAAA,EACzE,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,WACtB;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AAAA,EACF,gBAAgB,kCAAU,QAAQ,kCAAU,MAAM,EAAE,WAAW;AAAA,IAC7D;AAAA,EACF;AACF;AAEO,MAAM,+BAA+B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSComboboxSingleT.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SINGLE_SLOTS } from './constants/index.js';\n\nexport declare namespace DSComboboxSingleT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValue: DSCommonComboboxPropsT.
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,oCAAqE;AACrE,uBAA+D;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n PropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { commonComboboxPropTypes, type DSCommonComboboxPropsT } from './DSCommonComboboxPropsT.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SINGLE_SLOTS } from './constants/index.js';\n\nexport declare namespace DSComboboxSingleT {\n export type CommonItemOptions = DSCommonComboboxPropsT.CommonItemOptions;\n export type ItemSeparatorOptions = DSCommonComboboxPropsT.ItemSeparatorOptions;\n export type ItemSectionOptions = DSCommonComboboxPropsT.ItemSectionOptions;\n export type ItemOption = DSCommonComboboxPropsT.ItemOption;\n export type ItemCreatableOption = DSCommonComboboxPropsT.ItemCreatableOption;\n\n export type SelectionableOptions = DSCommonComboboxPropsT.SelectionableOptions;\n export type LayoutOptions = DSCommonComboboxPropsT.LayoutOptions;\n export type OptionTypes = DSCommonComboboxPropsT.OptionTypes;\n\n export interface RequiredProps extends DSCommonComboboxPropsT.RequiredProps {\n selectedValue: DSCommonComboboxPropsT.SelectionableOptions | null;\n onChange: (\n suggestedValue: DSCommonComboboxPropsT.SelectionableOptions | null,\n selectedOption: DSCommonComboboxPropsT.SelectionableOptions,\n event: React.MouseEvent | React.KeyboardEvent,\n ) => void;\n }\n export interface DefaultProps extends DSCommonComboboxPropsT.DefaultProps {}\n export interface OptionalProps\n extends\n DSCommonComboboxPropsT.OptionalProps,\n TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSFormComboboxName, typeof FORM_COMBOBOX_SINGLE_SLOTS> {}\n export interface Props\n extends\n Partial<DefaultProps>,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n\n export interface InternalProps\n extends\n DefaultProps,\n OptionalProps,\n Omit<\n GlobalAttributesT<HTMLElement>,\n keyof RequiredProps | keyof DefaultProps | keyof OptionalProps | keyof XstyledProps\n >,\n XstyledProps,\n RequiredProps {}\n}\n\ntype SingleComboboxWithSelectedValues = Omit<DSComboboxSingleT.Props, 'selectedValue'> & {\n selectedValues: DSComboboxSingleT.RequiredProps['selectedValue'];\n};\n\n/**\n * Single-select schema variant.\n *\n * - `selectedValues` is a single selectable option object.\n * - `null` indicates no current selection.\n */\nexport const singleComboboxPropTypes: DSPropTypesSchema<SingleComboboxWithSelectedValues> = {\n ...getPropsPerSlotPropTypes(DSFormComboboxName, FORM_COMBOBOX_SINGLE_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n ...commonComboboxPropTypes,\n onChange: PropTypes.func.isRequired\n .description(\n 'Single-select change callback. Receives the next single selected option or null when selection is cleared.',\n )\n .signature(\n '(suggestedValue: ItemOption | null, selectedOption: SelectionableOptions, event: React.MouseEvent | React.KeyboardEvent) => void',\n ),\n selectedValues: PropTypes.oneOfType([PropTypes.object, PropTypes.oneOf([null])]).isRequired.description(\n 'Single-select value. Use a selectable option object for a selected state, or null for no selection.',\n ),\n};\n\nexport const singleComboboxPropTypesSchema =\n singleComboboxPropTypes as unknown as ValidationMap<SingleComboboxWithSelectedValues>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,oCAAqE;AACrE,uBAA+D;AA2DxD,MAAM,0BAA+E;AAAA,EAC1F,OAAG,kDAAyB,qCAAoB,2CAA0B;AAAA,EAC1E,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,UAAU,kCAAU,KAAK,WACtB;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,EACF;AAAA,EACF,gBAAgB,kCAAU,UAAU,CAAC,kCAAU,QAAQ,kCAAU,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW;AAAA,IAC1F;AAAA,EACF;AACF;AAEO,MAAM,gCACX;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/DSCommonComboboxPropsT.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSFloatingWrapperT, DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPropTypesSchema, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport declare function noop<T extends unknown[]>(..._args: T): void;\n\nexport declare namespace DSCommonComboboxPropsT {\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 export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n export type SelectionableOptions = ItemOption | ItemCreatableOption;\n export type LayoutOptions = ItemSeparatorOptions | ItemSectionOptions;\n export type OptionTypes = SelectionableOptions | LayoutOptions;\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n }\n export interface DefaultProps {\n startPlacementPreference: DSHookFloatingContextT.PopperPlacementsT;\n placementOrderPreference: DSHookFloatingContextT.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 menuMaxHeight: SizingProps['maxHeight'];\n }\n export interface OptionalProps {\n menuMinWidth?: SizingProps['minWidth'];\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:
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport type { DSFloatingWrapperT, DSHookFloatingContextT } from '@elliemae/ds-floating-context';\nimport type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';\nimport type { DSPropTypesSchema, GlobalAttributesT } from '@elliemae/ds-props-helpers';\nimport { PropTypes } from '@elliemae/ds-props-helpers';\nimport type { SizingProps } from '@elliemae/ds-system';\nimport type React from 'react';\n\nexport declare function noop<T extends unknown[]>(..._args: T): void;\n\nexport declare namespace DSCommonComboboxPropsT {\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 export interface ItemSectionOptions extends CommonItemOptions {\n type: 'section';\n label: string;\n options: OptionTypes[];\n }\n export interface ItemOption extends CommonItemOptions {\n value: string;\n label: string;\n type: 'option';\n }\n export interface ItemCreatableOption extends CommonItemOptions {\n label: string;\n type: 'creatable';\n }\n export type SelectionableOptions = ItemOption | ItemCreatableOption;\n export type LayoutOptions = ItemSeparatorOptions | ItemSectionOptions;\n export type OptionTypes = SelectionableOptions | LayoutOptions;\n\n export interface RequiredProps {\n allOptions: OptionTypes[];\n }\n export interface DefaultProps {\n startPlacementPreference: DSHookFloatingContextT.PopperPlacementsT;\n placementOrderPreference: DSHookFloatingContextT.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 menuMaxHeight: SizingProps['maxHeight'];\n }\n export interface OptionalProps {\n menuMinWidth?: SizingProps['minWidth'];\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: SelectionableOptions[] | [], event: React.MouseEvent | React.KeyboardEvent) => void;\n onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;\n isLoading?: boolean;\n popperProps?: DSFloatingWrapperT.Props;\n }\n}\n\ntype CommonComboboxProps = DSCommonComboboxPropsT.RequiredProps &\n DSCommonComboboxPropsT.DefaultProps &\n DSCommonComboboxPropsT.OptionalProps;\n\nexport const commonComboboxPropTypes: DSPropTypesSchema<CommonComboboxProps> = {\n placeholder: PropTypes.string.description(\n 'Input placeholder text. Note: announcement behavior may be handled by component logic for accessibility, while visible placeholder text remains as provided.',\n ),\n allOptions: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.object, PropTypes.string])).isRequired.description(\n 'Full list of options and layout rows used by the combobox before filtering.',\n ),\n filteredOptions: PropTypes.arrayOf(PropTypes.object).description(\n 'Filtered list rendered in the menu for the current input value. THIS DOES NOT SUPPORT STRING OPTIONS, ALL OPTIONS MUST BE OBJECTS.',\n ),\n disabled: PropTypes.bool\n .description('Disables user interaction with the combobox input and menu trigger.')\n .defaultValue('false'),\n autoFocus: PropTypes.bool.description('Automatically focuses the input on mount when true.'),\n hasError: PropTypes.bool.description('Applies error styling/state to the combobox.').defaultValue('false'),\n noOptionsMessage: PropTypes.string\n .description('Message displayed when no options match the current filter.')\n .defaultValue('No Matches Found'),\n onFilter: PropTypes.func\n .description('Called when input text changes and options are filtered.')\n .signature('(newOptions: OptionTypes[], inputValue?: string) => void'),\n onCreate: PropTypes.func\n .description('Called when the user creates a new option from free-text input.')\n .signature('(label: string) => void'),\n onCancel: PropTypes.func\n .description('Called when Escape dismisses/closes the menu (effectively menu dismiss semantics).')\n .signature('() => void'),\n onMenuChange: PropTypes.func\n .description('Called when the menu open state changes.')\n .signature(\n '(state: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void',\n ),\n menuMinWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).description(\n 'Minimum menu width. Numeric values are interpreted as px.',\n ),\n menuMaxHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string])\n .description('Maximum menu height. Will always append \"px\" to the provided values.')\n .defaultValue('300'),\n withoutPortal: PropTypes.bool\n .description(\n 'When true the contextual menu DOM will render as part of the same parent element of the input instead of the body tag.',\n )\n .defaultValue('false'),\n innerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({ current: PropTypes.object })])\n .description('Mutable ref object or callback ref assigned to the underlying input.')\n .defaultValue('createRef()'),\n onlySelectable: PropTypes.bool\n .description('Disables free-text filtering and allows only selectable option values.')\n .defaultValue('false'),\n isSkeleton: PropTypes.bool.description('Displays the component in skeleton loading mode.').defaultValue('false'),\n applyAriaDisabled: PropTypes.bool\n .description(\n 'Applies disabled semantics for accessibility while preserving focusability. Primary action remains blocked.',\n )\n .defaultValue('false'),\n readOnly: PropTypes.bool\n .description('Makes input content non-editable while keeping the field accessible.')\n .defaultValue('false'),\n isMenuOpenableWithReadOnly: PropTypes.bool\n .description('Controls whether the menu may still open while `readOnly` is true.')\n .defaultValue('false'),\n onSelectAll: PropTypes.func\n .description('Deprecated callback fired when selecting all options.')\n .signature('(suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => void')\n .deprecated({ version: '25.2' }),\n popperProps: PropTypes.object.description(\n 'Pass-through props forwarded to the floating wrapper implementation. Behavior is primarily defined by the floating wrapper contract.',\n ),\n forceFocusFirstOptionOnType: PropTypes.bool\n .description('When typing, moves pseudo focus to the first available option.')\n .defaultValue('false'),\n placementOrderPreference: PropTypes.arrayOf(PropTypes.string)\n .description(\n 'When the floating menu cannot be placed in the preferred start placement, it will attempt placements in the order defined by this array.',\n )\n .defaultValue('[\"bottom-start\", \"top-start\"]'),\n startPlacementPreference: PropTypes.string\n .description('If possible, the contextual menu will position first and foremost according to this placement.')\n .defaultValue('bottom-start'),\n inline: PropTypes.bool.description('Renders menu using inline positioning strategy when true.').defaultValue('false'),\n isNonClearable: PropTypes.bool\n .description('Prevents clearing the current selection when true, in a select-like fashion.')\n .defaultValue('false'),\n useMask: PropTypes.func\n .description(\n 'Mask hook/function returning input mask handlers. Designed for the design system masks (e.g. usePhoneMask) but accepts any compatible implementation.',\n )\n .defaultValue('() => {}'),\n isMenuOpen: PropTypes.bool.description('Controlled open state for the menu.'),\n isLoading: PropTypes.bool.description('Shows loading state while options are being fetched.'),\n onKeyDown: PropTypes.func\n .description(\n 'Callback for key down events on the input text element only (not a root-level/global keyboard handler). This is intentionally narrower than generic global onKeyDown behavior.',\n )\n .signature('(e: React.KeyboardEvent<HTMLInputElement>, value: Item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AACtF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -26,27 +26,22 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
|
|
29
|
+
var TruncatedText_exports = {};
|
|
30
|
+
__export(TruncatedText_exports, {
|
|
31
|
+
TruncatedText: () => TruncatedText,
|
|
32
|
+
default: () => TruncatedText_default
|
|
32
33
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(TruncatedText_exports);
|
|
34
35
|
var React = __toESM(require("react"));
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
document.removeEventListener("mousedown", listener);
|
|
48
|
-
document.removeEventListener("touchstart", listener);
|
|
49
|
-
};
|
|
50
|
-
}, [ref, cb, excludeNode]);
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=useClickOutside.js.map
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
38
|
+
const TruncatedSpan = import_ds_system.styled.span`
|
|
39
|
+
text-overflow: ellipsis;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
max-width: 100%;
|
|
44
|
+
`;
|
|
45
|
+
const TruncatedText = ({ value = "" }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TruncatedSpan, { children: value });
|
|
46
|
+
var TruncatedText_default = TruncatedText;
|
|
47
|
+
//# sourceMappingURL=TruncatedText.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/TruncatedText.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { styled } from '@elliemae/ds-system';\n\nconst TruncatedSpan = styled.span`\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n display: inline-block;\n max-width: 100%;\n`;\n\ninterface TruncatedTextProps {\n value?: string;\n}\n\n/**\n * PUI-18660: this used to render its own hand-rolled hover tooltip on truncation.\n * That internal tooltip was removed \u2014 truncation is visual-only here. Consumers who\n * need the full value on hover/focus (e.g. readOnly/aria-disabled states where the\n * menu can't be opened) wrap the combobox in DSTooltipV3 themselves; see the\n * \"WithTooltip\" examples in ds-form-single-combobox / ds-form-multi-combobox.\n */\nconst TruncatedText = ({ value = '' }: TruncatedTextProps) => <TruncatedSpan>{value}</TruncatedSpan>;\n\nexport { TruncatedText };\nexport default TruncatedText;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqBuC;AArB9D,uBAAuB;AAEvB,MAAM,gBAAgB,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmB7B,MAAM,gBAAgB,CAAC,EAAE,QAAQ,GAAG,MAA0B,4CAAC,iBAAe,iBAAM;AAGpF,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useComboBox.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,8BAA6E;AAC7E,mBAAkE;AAClE,iBAAoB;AAGpB,mCAAgD;AAChD,qBAA+B;AAC/B,wBAAqD;AACrD,+BAAkC;AAClC,kCAAqC;AAM9B,MAAM,cAAc,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { type DSFastListT } from '@elliemae/ds-fast-list';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { uid } from 'uid';\nimport type { DSCommonComboboxPropsT } from '../DSCommonComboboxPropsT.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { ComboboxPropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { DSComboBoxName } from '../theming.js';\nimport { getFirstOption, isSelectedValueEmpty } from '../utils/listHelper.js';\nimport { useCorrectOptions } from './useCorrectOptions.js';\nimport { useOptionsPerSection } from './useOptionsPerSection.js';\n\ntype ActionRefVirtualized = {\n scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;\n};\n\nexport const useComboBox = <\n T extends DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[] | null =\n DSCommonComboboxPropsT.ItemOption | DSCommonComboboxPropsT.ItemOption[],\n>(\n props: DSComboboxT.Props<T>,\n) => {\n const propsWithDefaults = useMemoMergePropsWithDefault<DSComboboxT.Props<T>>(\n props,\n // we have a weird inference going on in this component\n // weird because we are even renaming selectedValues to selectedValue for the single combobox,\n // type safety here is flanky, we need to cast this, as a one ad-hoc exception\n defaultProps as DSComboboxT.Props<T>,\n );\n useValidateTypescriptPropTypes(propsWithDefaults, ComboboxPropTypes, DSComboBoxName);\n const [showPopover, setShowPopover] = useState<boolean>(false);\n const [referenceElement, setReferenceElement] = useState<HTMLElement | null>(null);\n\n const [inputValue, setInputValue] = useState<string>('');\n const [hasFocus, setHasFocus] = useState<boolean>(false);\n\n const internalRef = useRef<HTMLInputElement>(null);\n const wrapperListRef = useRef<HTMLDivElement>(null);\n\n const selectedOptionsRef = useRef<HTMLDivElement>(null);\n const controlsWrapperRef = useRef<HTMLDivElement>(null);\n const pillGroupRef = useRef<HTMLDivElement>(null);\n\n const {\n id,\n selectedValues,\n isMenuOpen,\n onMenuChange,\n applyAriaDisabled,\n forceFocusFirstOptionOnType,\n inline,\n readOnly,\n isMenuOpenableWithReadOnly,\n } = propsWithDefaults;\n\n const instanceUid = useMemo(() => id || uid(5), [id]);\n\n const menuState = useMemo(() => {\n if (isMenuOpen !== undefined) return isMenuOpen;\n return showPopover;\n }, [showPopover, isMenuOpen]);\n\n // ---------------------------------------------------------------------------\n // Options with creatable option + filtered by selected\n // ---------------------------------------------------------------------------\n\n const correctOptions = useCorrectOptions(propsWithDefaults, inputValue);\n\n const optionsPerSection = useOptionsPerSection(correctOptions);\n\n const actionRef: ActionRefVirtualized = {\n scrollTo: () => {},\n };\n\n const listRef = useRef<ActionRefVirtualized>(actionRef);\n\n // ===========================================================================\n // Scroll into view function\n // ===========================================================================\n const scrollOptionIntoView = useCallback(\n (dsId: string, opts: DSFastListT.ScrollToOptions = { align: 'center' } as DSFastListT.ScrollToOptions) => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n requestAnimationFrame(() => {\n listRef.current.scrollTo(\n correctOptions.findIndex((opt) => opt.dsId === dsId),\n opts,\n );\n });\n },\n [correctOptions],\n );\n\n // ===========================================================================\n // Init focused option when opening the menu list\n // ===========================================================================\n\n const [focusOptionIdx, setFocusOptionIdx] = useState<string>('');\n\n useEffect(() => {\n if (inputValue && forceFocusFirstOptionOnType) {\n const focusedValue = getFirstOption(correctOptions);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n }\n }, [correctOptions, inputValue, forceFocusFirstOptionOnType, scrollOptionIntoView, selectedValues]);\n\n const setMenuState = useCallback(\n (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => {\n if (applyAriaDisabled) return;\n if (onMenuChange !== undefined) onMenuChange(newState, reason, e);\n setShowPopover(newState);\n if (!inputValue && newState && !focusOptionIdx && !isSelectedValueEmpty(selectedValues)) {\n const focusedValue = getFirstOption(correctOptions, selectedValues);\n setFocusOptionIdx(focusedValue);\n scrollOptionIntoView(focusedValue, { align: 'center' });\n } else {\n setFocusOptionIdx('');\n }\n },\n [applyAriaDisabled, onMenuChange, inputValue, focusOptionIdx, selectedValues, correctOptions, scrollOptionIntoView],\n );\n\n // We need to force the auto focus for the inline since we dont control the floating wrapper.\n useEffect(() => {\n if (inline) {\n setMenuState(true, 'inline');\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const shouldPreventContextMenuOpening = readOnly && !isMenuOpenableWithReadOnly;\n\n const ctx = useMemo(\n () => ({\n props: { ...propsWithDefaults },\n menuState,\n referenceElement,\n listRef,\n focusOptionIdx,\n selectedOptionsRef,\n controlsWrapperRef,\n inputValue,\n setInputValue,\n setMenuState,\n hasFocus,\n pillGroupRef,\n wrapperListRef,\n setHasFocus,\n setFocusOptionIdx,\n scrollOptionIntoView,\n setReferenceElement,\n setShowPopover,\n internalRef,\n correctOptions,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n }),\n [\n scrollOptionIntoView,\n setMenuState,\n correctOptions,\n hasFocus,\n propsWithDefaults,\n inputValue,\n focusOptionIdx,\n wrapperListRef,\n menuState,\n pillGroupRef,\n referenceElement,\n selectedOptionsRef,\n controlsWrapperRef,\n listRef,\n internalRef,\n instanceUid,\n optionsPerSection,\n shouldPreventContextMenuOpening,\n ],\n );\n\n return ctx;\n};\n\nexport type UseComboBoxReturnType = ReturnType<typeof useComboBox>;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,8BAA6E;AAC7E,mBAAkE;AAClE,iBAAoB;AAGpB,mCAAgD;AAChD,qBAA+B;AAC/B,wBAAqD;AACrD,+BAAkC;AAClC,kCAAqC;AAM9B,MAAM,cAAc,CAIzB,UACG;AACH,QAAM,wBAAoB;AAAA,IACxB;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,EACF;AACA,8DAA+B,mBAAmB,gDAAmB,6BAAc;AACnF,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAkB,KAAK;AAC7D,QAAM,CAAC,kBAAkB,mBAAmB,QAAI,uBAA6B,IAAI;AAEjF,QAAM,CAAC,YAAY,aAAa,QAAI,uBAAiB,EAAE;AACvD,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAkB,KAAK;AAEvD,QAAM,kBAAc,qBAAyB,IAAI;AACjD,QAAM,qBAAiB,qBAAuB,IAAI;AAElD,QAAM,yBAAqB,qBAAuB,IAAI;A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var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
41
41
|
var import_ComboBoxCTX = __toESM(require("../ComboBoxCTX.js"));
|
|
42
42
|
var import_ComboboxDataTestids = require("../ComboboxDataTestids.js");
|
|
43
43
|
var import_constants = require("../constants/index.js");
|
|
44
|
-
const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.
|
|
44
|
+
const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV3, {
|
|
45
45
|
name: import_constants.DSFormComboboxName,
|
|
46
46
|
slot: import_constants.FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON
|
|
47
47
|
})`
|
|
@@ -53,7 +53,7 @@ const StyledDropDownButton = (0, import_ds_system.styled)(import_ds_button_v2.DS
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
& svg {
|
|
56
|
-
fill: ${({ theme, disabled
|
|
56
|
+
fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral["400"] : theme.colors.brand["600"]};
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/DropdownIndicator.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/prop-types */\n/* eslint-disable import/no-cycle */\nimport React, { useCallback, useContext } from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSButtonV3 } from '@elliemae/ds-button-v2';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport ComboBoxContext from '../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\n\nconst StyledDropDownButton = styled(DSButtonV3, {\n name: DSFormComboboxName,\n slot: FORM_COMBOBOX_SLOTS.DROPDOWN_BUTTON,\n})<{ applyAriaDisabled: boolean | undefined }>`\n &:focus::after {\n border: none;\n }\n &:hover:not(:disabled) {\n background-color: transparent;\n }\n\n & svg {\n fill: ${({ theme, disabled }) => (disabled ? theme.colors.neutral['400'] : theme.colors.brand['600'])};\n }\n\n ${({ applyAriaDisabled }) => applyAriaDisabled && `cursor: not-allowed`}\n`;\n\nexport const DropdownIndicator = (): JSX.Element => {\n const {\n props,\n props: { disabled, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n menuState,\n instanceUid,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick: (e: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void =\n useCallback((e) => {\n e.preventDefault();\n }, []);\n\n return (\n <StyledDropDownButton\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n onClick={handleOnClick}\n data-testid={ComboboxDataTestid.DROPDOWN}\n aria-controls={`combo-listbox-${instanceUid}`}\n aria-labelledby=\"combo-label\"\n disabled={disabled}\n aria-disabled={readOnly && !isMenuOpenableWithReadOnly} // button never use readOnly attribute\n aria-expanded={menuState}\n aria-haspopup=\"listbox\"\n aria-hidden\n buttonType=\"icon\"\n tabIndex={-1}\n size=\"s\"\n applyAriaDisabled={applyAriaDisabled}\n >\n <ChevronSmallDown size=\"s\" />\n </StyledDropDownButton>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;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
}
|
|
@@ -36,6 +36,7 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
36
36
|
var import_react = require("react");
|
|
37
37
|
var import_react2 = __toESM(require("react"));
|
|
38
38
|
var import_ds_system = require("@elliemae/ds-system");
|
|
39
|
+
var import_ds_typography = require("@elliemae/ds-typography");
|
|
39
40
|
var import_ds_menu_items = require("@elliemae/ds-menu-items");
|
|
40
41
|
var import_constants = require("../constants.js");
|
|
41
42
|
var import_ComboboxDataTestids = require("../ComboboxDataTestids.js");
|
|
@@ -44,17 +45,13 @@ var import_constants2 = require("../constants/index.js");
|
|
|
44
45
|
var import_styled = require("./menu-list/styled.js");
|
|
45
46
|
const StyledSectionWrapper = (0, import_ds_system.styled)("section", { name: import_constants2.DSFormComboboxName, slot: import_constants2.FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`
|
|
46
47
|
list-style: none;
|
|
47
|
-
min-height: 24px;
|
|
48
48
|
display: grid;
|
|
49
49
|
align-items: center;
|
|
50
50
|
`;
|
|
51
|
-
const StyledSectionLabel = (0, import_ds_system.styled)(
|
|
51
|
+
const StyledSectionLabel = (0, import_ds_system.styled)(import_ds_typography.DSTypography, { name: import_constants2.DSFormComboboxName, slot: import_constants2.FORM_COMBOBOX_SLOTS.SECTION_LABEL })`
|
|
52
52
|
display: flex;
|
|
53
53
|
align-items: center;
|
|
54
|
-
padding:
|
|
55
|
-
min-height: 24px;
|
|
56
|
-
font-size: 1rem;
|
|
57
|
-
color: neutral-500;
|
|
54
|
+
padding: 8px 16px;
|
|
58
55
|
`;
|
|
59
56
|
const Section = import_react2.default.memo((props) => {
|
|
60
57
|
const {
|
|
@@ -84,6 +81,8 @@ const Section = import_react2.default.memo((props) => {
|
|
|
84
81
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
85
82
|
StyledSectionLabel,
|
|
86
83
|
{
|
|
84
|
+
component: "header",
|
|
85
|
+
variant: "b3-strong",
|
|
87
86
|
id,
|
|
88
87
|
role: "presentation",
|
|
89
88
|
getOwnerProps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/parts/Section.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nimport { StyledSingleMenuItem, StyledMultiMenuItem } from './menu-list/styled.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles?: React.CSSProperties;\n innerRef?: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.OptionTypes[];\n handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { styled } from '@elliemae/ds-system';\nimport { DSTypography } from '@elliemae/ds-typography';\nimport { Separator } from '@elliemae/ds-menu-items';\n\nimport { MENU_OPTION_TYPES } from '../constants.js';\n\nimport { ComboboxDataTestid } from '../ComboboxDataTestids.js';\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { isSelected } from '../utils/listHelper.js';\nimport { DSFormComboboxName, FORM_COMBOBOX_SLOTS } from '../constants/index.js';\nimport { StyledSingleMenuItem, StyledMultiMenuItem } from './menu-list/styled.js';\n\ninterface SectionProps {\n label: string;\n wrapperStyles?: React.CSSProperties;\n innerRef?: (instance: HTMLDivElement | null) => void;\n options: DSComboboxT.OptionTypes[];\n handleClick: (option: DSComboboxT.OptionTypes, e: React.MouseEvent<HTMLInputElement>) => void;\n handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;\n focusOptionIdx: string;\n selectedValues: DSComboboxT.SelectedOptionsT;\n getOwnerProps: () => object;\n getOwnerPropsArguments?: () => { index: number };\n}\n\nconst StyledSectionWrapper = styled('section', { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_WRAPPER })`\n list-style: none;\n display: grid;\n align-items: center;\n`;\n\n/**\n * The 32px group-label row height comes from this label alone: 8px top + 8px bottom padding +\n * the b3-strong line-height (~16px) = 32px. No min-height needed here.\n *\n * This is one of four independent reimplementations of the section/group-label row \u2014 the menu-items\n * path (ds-menu-items-commons StyledSectionWrapper) and ds-menu-button reach the same 32px via a\n * wrapper min-height instead. Keep all four aligned (PUI-18609); see KNOWN_INTENTIONAL_DEVIATIONS.md.\n */\nconst StyledSectionLabel = styled(DSTypography, { name: DSFormComboboxName, slot: FORM_COMBOBOX_SLOTS.SECTION_LABEL })`\n display: flex;\n align-items: center;\n padding: 8px 16px;\n`;\n\nexport const Section = React.memo((props: SectionProps) => {\n const {\n label,\n wrapperStyles,\n focusOptionIdx,\n selectedValues,\n innerRef,\n handleOnMouseDown,\n options,\n handleClick,\n getOwnerProps,\n getOwnerPropsArguments,\n } = props;\n const id = `${label.replace(/ /g, '')}-section`;\n const CBItem: React.ComponentType<React.ComponentProps<typeof StyledSingleMenuItem>> = Array.isArray(selectedValues)\n ? StyledMultiMenuItem\n : StyledSingleMenuItem;\n\n return (\n <StyledSectionWrapper\n role=\"group\"\n aria-labelledby={id}\n style={wrapperStyles}\n innerRef={innerRef}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <StyledSectionLabel\n component=\"header\"\n variant=\"b3-strong\"\n id={id}\n role=\"presentation\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {label}\n </StyledSectionLabel>\n {options?.map((option) => {\n const {\n dsId,\n type,\n value,\n label: optionLabel,\n readOnly,\n disabled,\n applyAriaDisabled,\n render,\n ...rest\n } = option;\n\n if (type === MENU_OPTION_TYPES.SEPARATOR) {\n return <Separator key={dsId} />;\n }\n\n return (\n <CBItem\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n value={value}\n label={optionLabel}\n dataTestid={ComboboxDataTestid.OPTION}\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled || readOnly}\n onClick={(e: React.MouseEvent<HTMLInputElement>) => {\n if (applyAriaDisabled) return;\n handleClick(option, e);\n }}\n onMouseDown={handleOnMouseDown}\n isActive={dsId === focusOptionIdx}\n isSelected={option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option)}\n tabIndex={-1}\n {...rest}\n key={option.dsId}\n dsId={option.dsId}\n />\n );\n })}\n </StyledSectionWrapper>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiEnB;AAoCM;AArGV,IAAAA,gBAAkB;AAClB,uBAAuB;AACvB,2BAA6B;AAC7B,2BAA0B;AAE1B,uBAAkC;AAElC,iCAAmC;AAEnC,wBAA2B;AAC3B,IAAAC,oBAAwD;AACxD,oBAA0D;AAe1D,MAAM,2BAAuB,yBAAO,WAAW,EAAE,MAAM,sCAAoB,MAAM,sCAAoB,gBAAgB,CAAC;AAAA;AAAA;AAAA;AAAA;AActH,MAAM,yBAAqB,yBAAO,mCAAc,EAAE,MAAM,sCAAoB,M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AA,cACT,GAAG;AAAA,cACJ,KAAK,OAAO;AAAA,cACZ,MAAM,OAAO;AAAA;AAAA,UACf;AAAA,QAEJ,CAAC;AAAA;AAAA;AAAA,EACH;AAEJ,CAAC;",
|
|
6
6
|
"names": ["import_react", "import_constants", "React"]
|
|
7
7
|
}
|
|
@@ -39,13 +39,12 @@ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
39
39
|
var import_react2 = require("react");
|
|
40
40
|
var import_ComboBoxCTX = __toESM(require("../../ComboBoxCTX.js"));
|
|
41
41
|
var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
|
|
42
|
-
var import_useClickOutside = require("../../config/useClickOutside.js");
|
|
43
42
|
var import_controls = require("../controls/index.js");
|
|
44
43
|
var import_LiveRegion = require("../LiveRegion.js");
|
|
45
44
|
var import_menu_list = require("../menu-list/index.js");
|
|
46
45
|
var import_styled = require("./styled.js");
|
|
47
46
|
const Container = () => {
|
|
48
|
-
const { props,
|
|
47
|
+
const { props, setMenuState, menuState } = (0, import_react2.useContext)(import_ComboBoxCTX.default);
|
|
49
48
|
const {
|
|
50
49
|
inline,
|
|
51
50
|
startPlacementPreference,
|
|
@@ -63,10 +62,6 @@ const Container = () => {
|
|
|
63
62
|
const handleMouseDown = (0, import_react2.useCallback)((e) => {
|
|
64
63
|
e.preventDefault();
|
|
65
64
|
}, []);
|
|
66
|
-
const handleCloseMenu = (0, import_react2.useCallback)(() => {
|
|
67
|
-
setMenuState(false, "blur");
|
|
68
|
-
if (internalRef?.current) internalRef.current.blur();
|
|
69
|
-
}, [internalRef, setMenuState]);
|
|
70
65
|
(0, import_react2.useEffect)(() => {
|
|
71
66
|
const closeMenuOnWindowBlur = () => {
|
|
72
67
|
if (menuState) setMenuState(false, "blur");
|
|
@@ -76,6 +71,10 @@ const Container = () => {
|
|
|
76
71
|
window.removeEventListener("blur", closeMenuOnWindowBlur);
|
|
77
72
|
};
|
|
78
73
|
}, [menuState, setMenuState]);
|
|
74
|
+
const handleClickOutside = (0, import_react2.useCallback)(() => {
|
|
75
|
+
if (inline) return;
|
|
76
|
+
setMenuState(false, "blur");
|
|
77
|
+
}, [setMenuState, inline]);
|
|
79
78
|
const config = (0, import_react2.useMemo)(
|
|
80
79
|
() => ({
|
|
81
80
|
placement: startPlacementPreference,
|
|
@@ -83,16 +82,13 @@ const Container = () => {
|
|
|
83
82
|
placementOrderPreference,
|
|
84
83
|
zIndex: correctZIndex,
|
|
85
84
|
customOffset: [0, 5],
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
externallyControlledIsOpen: menuState,
|
|
86
|
+
// Gate on `!inline` — in inline mode the consumer's outer wrapper handles dismissal.
|
|
87
|
+
onClickOutside: inline ? void 0 : handleClickOutside
|
|
88
88
|
}),
|
|
89
|
-
[startPlacementPreference, placementOrderPreference, correctZIndex,
|
|
89
|
+
[startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside]
|
|
90
90
|
);
|
|
91
91
|
const { refs, floatingStyles, context } = (0, import_ds_floating_context.useFloatingContext)(config);
|
|
92
|
-
const hideTooltip = (0, import_react2.useCallback)(() => {
|
|
93
|
-
setMenuState(false, "blur");
|
|
94
|
-
}, [setMenuState]);
|
|
95
|
-
(0, import_useClickOutside.useOnClickOutside)(refs.reference, hideTooltip, refs.floating);
|
|
96
92
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
97
93
|
import_styled.StyledContainer,
|
|
98
94
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/container/Container.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable consistent-return */\n/* eslint-disable complexity */\nimport { FloatingWrapper, useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useGetGlobalAttributes, useGetXstyledProps, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useEffect, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { Controls } from '../controls/index.js';\nimport { LiveRegion } from '../LiveRegion.js';\nimport { MenuList } from '../menu-list/index.js';\nimport { StyledContainer, StyledPopperWrapper } from './styled.js';\n\nexport const Container = (): JSX.Element => {\n const { props, setMenuState, menuState } = useContext(ComboBoxContext);\n\n const {\n inline,\n startPlacementPreference,\n placementOrderPreference,\n isLoading,\n isSkeleton,\n applyAriaDisabled,\n popperProps,\n } = props;\n const globalAttributes = useGetGlobalAttributes(props) as ReturnType<typeof useGetGlobalAttributes> & {\n 'data-testid'?: string;\n };\n const { zIndex, ...xStyledProps } = useGetXstyledProps(props);\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const correctZIndex = zIndex ? parseInt(zIndex as string, 10) : undefined;\n // Removing possible collisionable props\n const { className, 'data-testid': dataTestId } = globalAttributes;\n const handleMouseDown = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n }, []);\n\n useEffect(() => {\n const closeMenuOnWindowBlur = () => {\n if (menuState) setMenuState(false, 'blur');\n };\n\n window.addEventListener('blur', closeMenuOnWindowBlur);\n\n return () => {\n window.removeEventListener('blur', closeMenuOnWindowBlur);\n };\n }, [menuState, setMenuState]);\n\n // In inline mode the combobox is rendered inside a consumer-controlled FloatingWrapper.\n // The consumer owns dismissal; if we closed the internal menuState here, the outer wrapper\n // would stay open and the user would see the input without options (\"weird state\").\n const handleClickOutside = useCallback(() => {\n if (inline) return;\n setMenuState(false, 'blur');\n }, [setMenuState, inline]);\n\n const config = useMemo(\n () => ({\n placement: startPlacementPreference,\n withoutAnimation: true,\n placementOrderPreference,\n zIndex: correctZIndex,\n customOffset: [0, 5] as [number, number],\n externallyControlledIsOpen: menuState,\n // Gate on `!inline` \u2014 in inline mode the consumer's outer wrapper handles dismissal.\n onClickOutside: inline ? undefined : handleClickOutside,\n }),\n [startPlacementPreference, placementOrderPreference, correctZIndex, menuState, inline, handleClickOutside],\n );\n\n const { refs, floatingStyles, context } = useFloatingContext(config);\n\n return (\n <StyledContainer\n data-testid={dataTestId ?? ComboboxDataTestid.CONTAINER}\n innerRef={refs.setReference}\n className={className}\n applyAriaDisabled={applyAriaDisabled ?? false}\n {...xStyledProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <LiveRegion />\n <Controls />\n\n {menuState && inline ? <MenuList /> : null}\n {menuState && !inline && refs.reference ? (\n <FloatingWrapper\n innerRef={refs.setFloating}\n floatingStyles={floatingStyles}\n isOpen={menuState}\n context={context}\n {...popperProps}\n key={`${isLoading}${isSkeleton}`} // to force remount when loading/skeleton changes\n >\n <StyledPopperWrapper\n tabIndex={-1}\n onMouseDown={handleMouseDown}\n applyAriaDisabled={applyAriaDisabled ?? false}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <MenuList />\n </StyledPopperWrapper>\n </FloatingWrapper>\n ) : null}\n </StyledContainer>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD0EnB;AAcI;AAtFR,iCAAoD;AACpD,8BAA0E;AAC1E,IAAAA,gBAAm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AAW,QAAQ,kBAAkB;AAAA,EAC3G;AAEA,QAAM,EAAE,MAAM,gBAAgB,QAAQ,QAAI,+CAAmB,MAAM;AAEnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,cAAc,8CAAmB;AAAA,MAC9C,UAAU,KAAK;AAAA,MACf;AAAA,MACA,mBAAmB,qBAAqB;AAAA,MACvC,GAAG;AAAA,MACJ;AAAA,MACA;AAAA,MAEA;AAAA,oDAAC,gCAAW;AAAA,QACZ,4CAAC,4BAAS;AAAA,QAET,aAAa,SAAS,4CAAC,6BAAS,IAAK;AAAA,QACrC,aAAa,CAAC,UAAU,KAAK,YAC5B;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf;AAAA,YACA,QAAQ;AAAA,YACR;AAAA,YACC,GAAG;AAAA,YACJ,KAAK,GAAG,SAAS,GAAG,UAAU;AAAA;AAAA,UAE9B;AAAA,YAAC;AAAA;AAAA,cACC,UAAU;AAAA,cACV,aAAa;AAAA,cACb,mBAAmB,qBAAqB;AAAA,cACxC;AAAA,cACA;AAAA,cAEA,sDAAC,6BAAS;AAAA;AAAA,UACZ;AAAA,QACF,IACE;AAAA;AAAA;AAAA,EACN;AAEJ;",
|
|
6
6
|
"names": ["import_react", "ComboBoxContext"]
|
|
7
7
|
}
|
|
@@ -37,7 +37,7 @@ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
|
37
37
|
var import_react = require("react");
|
|
38
38
|
var import_ComboBoxCTX = __toESM(require("../../ComboBoxCTX.js"));
|
|
39
39
|
var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
|
|
40
|
-
var
|
|
40
|
+
var import_TruncatedText = require("../../TruncatedText.js");
|
|
41
41
|
var import_ControlsInput = require("../controls-input/ControlsInput.js");
|
|
42
42
|
var import_DropdownIndicator = require("../DropdownIndicator.js");
|
|
43
43
|
var import_multi_selected_values_container = require("../multi-selected-values-container/index.js");
|
|
@@ -129,17 +129,27 @@ const Controls = () => {
|
|
|
129
129
|
"aria-disabled": applyAriaDisabled,
|
|
130
130
|
"data-testid": import_ComboboxDataTestids.ComboboxDataTestid.CONTROLS_WRAPPER,
|
|
131
131
|
children: [
|
|
132
|
-
!inline && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
-
import_styled.
|
|
132
|
+
!inline && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
133
|
+
import_styled.StyledSelection,
|
|
134
134
|
{
|
|
135
|
-
|
|
136
|
-
"
|
|
137
|
-
|
|
138
|
-
|
|
135
|
+
variant: "b2",
|
|
136
|
+
component: "div",
|
|
137
|
+
innerRef: selectedOptionsRef,
|
|
138
|
+
onClick: handleOnPillsClick,
|
|
139
139
|
getOwnerProps,
|
|
140
|
-
children: selectedValues
|
|
140
|
+
children: Array.isArray(selectedValues) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_multi_selected_values_container.MultiSelectedValuesContainer, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
141
|
+
import_styled.StyledSingleSelectWraper,
|
|
142
|
+
{
|
|
143
|
+
readOnly: readOnly ?? false,
|
|
144
|
+
"data-testid": import_ComboboxDataTestids.ComboboxDataTestid.SELECTED_VALUES,
|
|
145
|
+
disabled: disabled ?? false,
|
|
146
|
+
applyAriaDisabled: applyAriaDisabled ?? false,
|
|
147
|
+
getOwnerProps,
|
|
148
|
+
children: selectedValues && inputValue === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TruncatedText.TruncatedText, { value: selectedValues.label }) : null
|
|
149
|
+
}
|
|
150
|
+
)
|
|
141
151
|
}
|
|
142
|
-
)
|
|
152
|
+
),
|
|
143
153
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ControlsInput.ControlsInput, {}),
|
|
144
154
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {}),
|
|
145
155
|
!inline && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/controls/Controls.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useOwnerProps } from '@elliemae/ds-props-helpers';\nimport React, { useCallback, useContext, useMemo } from 'react';\nimport ComboBoxContext from '../../ComboBoxCTX.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { TruncatedText } from '../../TruncatedText.js';\nimport { ControlsInput } from '../controls-input/ControlsInput.js';\nimport { DropdownIndicator } from '../DropdownIndicator.js';\nimport { MultiSelectedValuesContainer } from '../multi-selected-values-container/index.js';\nimport {\n StyledControlsWrapper,\n StyledHeaderActionsWrapper,\n StyledSelection,\n StyledSingleSelectWraper,\n StyleHeaderActionsSeparator,\n} from './styled.js';\nimport { useOnPillsNavigation } from './useOnPillsNavigation.js';\n\nexport const Controls = (): JSX.Element => {\n const {\n props,\n props: { inline, disabled, hasError, selectedValues, applyAriaDisabled, readOnly, isMenuOpenableWithReadOnly },\n selectedOptionsRef,\n setMenuState,\n setFocusOptionIdx,\n hasFocus,\n inputValue,\n listRef,\n focusOptionIdx,\n menuState,\n controlsWrapperRef,\n internalRef,\n shouldPreventContextMenuOpening,\n } = useContext(ComboBoxContext);\n\n const { getOwnerProps, getOwnerPropsArguments } = useOwnerProps(props);\n\n const handleOnClick = useCallback(() => {\n if (disabled) return;\n if (applyAriaDisabled || shouldPreventContextMenuOpening) {\n internalRef.current?.focus();\n return;\n }\n if (hasFocus && menuState && !inline) {\n setMenuState(false, 'click');\n setFocusOptionIdx('');\n internalRef.current?.blur();\n return;\n }\n internalRef.current?.focus();\n setMenuState(true, 'click');\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n disabled,\n listRef,\n hasFocus,\n menuState,\n inline,\n setMenuState,\n focusOptionIdx,\n readOnly,\n applyAriaDisabled,\n isMenuOpenableWithReadOnly,\n ]);\n\n // this callback prevent to toggle the menu when clicking or removing pills\n const handleOnPillsClick: React.MouseEventHandler = useCallback(\n (e) => {\n if (applyAriaDisabled) return;\n if (menuState || disabled || shouldPreventContextMenuOpening) {\n e.stopPropagation();\n } else {\n internalRef.current?.focus();\n setMenuState(true, 'pill-click');\n }\n },\n [applyAriaDisabled, menuState, disabled, internalRef, setMenuState, shouldPreventContextMenuOpening],\n );\n\n // callback to prevent onBlur on the input when clicking in all the wrapper\n const handleOnMouseDown: React.MouseEventHandler = useCallback(\n (e) => {\n if (document.activeElement === internalRef.current || inline) {\n e.preventDefault();\n }\n },\n [internalRef, inline],\n );\n\n const { onKeyDownPills } = useOnPillsNavigation();\n\n const cols = useMemo(\n () => (!inline ? ['minmax(0px,max-content)', 'minmax(20px, auto)', '8px', '2.231rem'] : ['minmax(0px, auto)']),\n [inline],\n );\n return (\n <StyledControlsWrapper\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n innerRef={controlsWrapperRef}\n readOnly={readOnly ?? false}\n cols={cols}\n disabled={disabled ?? false}\n applyAriaDisabled={applyAriaDisabled ?? false}\n hasError={hasError ?? false}\n inline={inline ?? false}\n onClick={handleOnClick}\n onMouseDown={handleOnMouseDown}\n onKeyDown={onKeyDownPills}\n aria-disabled={applyAriaDisabled}\n data-testid={ComboboxDataTestid.CONTROLS_WRAPPER}\n >\n {!inline && (\n <StyledSelection\n variant=\"b2\"\n component=\"div\"\n innerRef={selectedOptionsRef}\n onClick={handleOnPillsClick}\n getOwnerProps={getOwnerProps}\n >\n {Array.isArray(selectedValues) ? (\n <MultiSelectedValuesContainer />\n ) : (\n <StyledSingleSelectWraper\n readOnly={readOnly ?? false}\n // legacy data-testid \u2014 preserved for QA/consumer compatibility, breaking change if removed\n data-testid={ComboboxDataTestid.SELECTED_VALUES}\n disabled={disabled ?? false}\n applyAriaDisabled={applyAriaDisabled ?? false}\n getOwnerProps={getOwnerProps}\n >\n {selectedValues && inputValue === '' ? <TruncatedText value={selectedValues.label} /> : null}\n </StyledSingleSelectWraper>\n )}\n </StyledSelection>\n )}\n\n <ControlsInput />\n {/** This empty div is a gap between the input and the drop down indicator */}\n <div />\n {!inline && (\n <StyledHeaderActionsWrapper\n justifyItems=\"center\"\n cols={['min-content', 'minmax(28px,max-content)']}\n justifyContent=\"flex-end\"\n getOwnerProps={getOwnerProps}\n >\n <StyleHeaderActionsSeparator\n disabled={disabled}\n applyAriaDisabled={applyAriaDisabled}\n readOnly={readOnly}\n getOwnerProps={getOwnerProps}\n />\n <DropdownIndicator />\n </StyledHeaderActionsWrapper>\n )}\n </StyledControlsWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2HX;AAzHZ,8BAA8B;AAC9B,mBAAwD;AACxD,yBAA4B;AAC5B,iCAAmC;AACnC,2BAA8B;AAC9B,2BAA8B;AAC9B,+BAAkC;AAClC,6CAA6C;AAC7C,oBAMO;AACP,kCAAqC;AAE9B,MAAM,WAAW,MAAmB;AACzC,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,QAAQ,UAAU,UAAU,gBAAgB,mBAAmB,UAAU,2BAA2B;AAAA,IAC7G;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;A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