@elliemae/ds-form-combobox 3.51.0-next.1 → 3.51.0-next.12
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/ComboBoxCTX.js +4 -7
- package/dist/cjs/ComboBoxCTX.js.map +2 -2
- package/dist/cjs/ComboboxDataTestids.js +0 -4
- package/dist/cjs/ComboboxDataTestids.js.map +2 -2
- package/dist/cjs/{parts/header-list/index.js → config/useClickOutside.js} +22 -6
- package/dist/cjs/config/useClickOutside.js.map +7 -0
- package/dist/cjs/config/useComboBox.js +40 -52
- package/dist/cjs/config/useComboBox.js.map +2 -2
- package/dist/cjs/config/useCorrectOptions.js +3 -6
- package/dist/cjs/config/useCorrectOptions.js.map +2 -2
- package/dist/cjs/config/useOptionsPerSection.js +56 -0
- package/dist/cjs/config/useOptionsPerSection.js.map +7 -0
- package/dist/cjs/parts/DropdownIndicator.js +3 -2
- package/dist/cjs/parts/DropdownIndicator.js.map +2 -2
- package/dist/cjs/parts/Section.js +92 -0
- package/dist/cjs/parts/Section.js.map +7 -0
- package/dist/cjs/parts/container/Container.js +52 -41
- package/dist/cjs/parts/container/Container.js.map +3 -3
- package/dist/cjs/parts/controls/Controls.js +6 -4
- package/dist/cjs/parts/controls/Controls.js.map +2 -2
- package/dist/cjs/parts/controls/styled.js +22 -6
- package/dist/cjs/parts/controls/styled.js.map +2 -2
- package/dist/cjs/parts/controls/useOnPillsNavigation.js +3 -3
- package/dist/cjs/parts/controls/useOnPillsNavigation.js.map +2 -2
- package/dist/cjs/parts/controls-input/ControlsInput.js +21 -6
- package/dist/cjs/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/cjs/parts/controls-input/styled.js +3 -1
- package/dist/cjs/parts/controls-input/styled.js.map +2 -2
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js +15 -18
- package/dist/cjs/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js +4 -5
- package/dist/cjs/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/cjs/parts/menu-list/MenuList.js +31 -54
- package/dist/cjs/parts/menu-list/MenuList.js.map +2 -2
- package/dist/cjs/parts/menu-list/styled.js +3 -15
- package/dist/cjs/parts/menu-list/styled.js.map +2 -2
- package/dist/cjs/parts/menu-list/useItemRenderer.js +52 -47
- package/dist/cjs/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +12 -4
- package/dist/cjs/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js +19 -4
- package/dist/cjs/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +3 -3
- package/dist/cjs/react-desc-prop-types.js +4 -1
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +2 -2
- package/dist/cjs/utils/listHelper.js +7 -23
- package/dist/cjs/utils/listHelper.js.map +2 -2
- package/dist/esm/ComboBoxCTX.js +4 -7
- package/dist/esm/ComboBoxCTX.js.map +2 -2
- package/dist/esm/ComboboxDataTestids.js +0 -4
- package/dist/esm/ComboboxDataTestids.js.map +2 -2
- package/dist/esm/config/useClickOutside.js +22 -0
- package/dist/esm/config/useClickOutside.js.map +7 -0
- package/dist/esm/config/useComboBox.js +40 -52
- package/dist/esm/config/useComboBox.js.map +2 -2
- package/dist/esm/config/useCorrectOptions.js +4 -7
- package/dist/esm/config/useCorrectOptions.js.map +2 -2
- package/dist/esm/config/useOptionsPerSection.js +26 -0
- package/dist/esm/config/useOptionsPerSection.js.map +7 -0
- package/dist/esm/parts/DropdownIndicator.js +3 -2
- package/dist/esm/parts/DropdownIndicator.js.map +2 -2
- package/dist/esm/parts/Section.js +62 -0
- package/dist/esm/parts/Section.js.map +7 -0
- package/dist/esm/parts/container/Container.js +53 -42
- package/dist/esm/parts/container/Container.js.map +3 -3
- package/dist/esm/parts/controls/Controls.js +6 -4
- package/dist/esm/parts/controls/Controls.js.map +2 -2
- package/dist/esm/parts/controls/styled.js +22 -6
- package/dist/esm/parts/controls/styled.js.map +2 -2
- package/dist/esm/parts/controls/useOnPillsNavigation.js +3 -3
- package/dist/esm/parts/controls/useOnPillsNavigation.js.map +2 -2
- package/dist/esm/parts/controls-input/ControlsInput.js +21 -6
- package/dist/esm/parts/controls-input/ControlsInput.js.map +2 -2
- package/dist/esm/parts/controls-input/styled.js +3 -1
- package/dist/esm/parts/controls-input/styled.js.map +2 -2
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js +15 -18
- package/dist/esm/parts/controls-input/useKeyboardNavigation.js.map +2 -2
- package/dist/esm/parts/controls-input/useMaskedOnChange.js +4 -5
- package/dist/esm/parts/controls-input/useMaskedOnChange.js.map +2 -2
- package/dist/esm/parts/menu-list/MenuList.js +35 -58
- package/dist/esm/parts/menu-list/MenuList.js.map +2 -2
- package/dist/esm/parts/menu-list/styled.js +3 -15
- package/dist/esm/parts/menu-list/styled.js.map +2 -2
- package/dist/esm/parts/menu-list/useItemRenderer.js +54 -49
- package/dist/esm/parts/menu-list/useItemRenderer.js.map +2 -2
- package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +12 -4
- package/dist/esm/parts/multi-selected-values-container/MultiSelectedValuesContainer.js.map +2 -2
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js +19 -4
- package/dist/esm/parts/multi-selected-values-container/RemovableSelectedValuePill.js.map +3 -3
- package/dist/esm/react-desc-prop-types.js +4 -1
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/sharedTypes.js.map +2 -2
- package/dist/esm/utils/listHelper.js +7 -23
- package/dist/esm/utils/listHelper.js.map +2 -2
- package/dist/types/ComboboxDataTestids.d.ts +0 -4
- package/dist/types/config/useClickOutside.d.ts +1 -0
- package/dist/types/config/useCorrectOptions.d.ts +1 -1
- package/dist/types/config/useOptionsPerSection.d.ts +2 -0
- package/dist/types/parts/Section.d.ts +14 -0
- package/dist/types/parts/controls/styled.d.ts +2 -0
- package/dist/types/parts/controls-input/styled.d.ts +3 -1
- package/dist/types/parts/menu-list/styled.d.ts +2 -7
- package/dist/types/parts/menu-list/useItemRenderer.d.ts +9 -1
- package/dist/types/parts/multi-selected-values-container/RemovableSelectedValuePill.d.ts +1 -0
- package/dist/types/react-desc-prop-types.d.ts +11 -1
- package/dist/types/sharedTypes.d.ts +4 -10
- package/dist/types/tests/read-only.test.d.ts +1 -0
- package/dist/types/utils/listHelper.d.ts +0 -1
- package/package.json +17 -17
- package/dist/cjs/parts/header-list/HeaderList.js +0 -104
- package/dist/cjs/parts/header-list/HeaderList.js.map +0 -7
- package/dist/cjs/parts/header-list/index.js.map +0 -7
- package/dist/cjs/parts/header-list/styled.js +0 -85
- package/dist/cjs/parts/header-list/styled.js.map +0 -7
- package/dist/cjs/parts/header-list/useHeaderListHandlers.js +0 -140
- package/dist/cjs/parts/header-list/useHeaderListHandlers.js.map +0 -7
- package/dist/esm/parts/header-list/HeaderList.js +0 -80
- package/dist/esm/parts/header-list/HeaderList.js.map +0 -7
- package/dist/esm/parts/header-list/index.js +0 -6
- package/dist/esm/parts/header-list/index.js.map +0 -7
- package/dist/esm/parts/header-list/styled.js +0 -55
- package/dist/esm/parts/header-list/styled.js.map +0 -7
- package/dist/esm/parts/header-list/useHeaderListHandlers.js +0 -110
- package/dist/esm/parts/header-list/useHeaderListHandlers.js.map +0 -7
- package/dist/types/parts/header-list/HeaderList.d.ts +0 -2
- package/dist/types/parts/header-list/index.d.ts +0 -1
- package/dist/types/parts/header-list/styled.d.ts +0 -6
- package/dist/types/parts/header-list/useHeaderListHandlers.d.ts +0 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/sharedTypes.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type React from 'react';\nimport type { DSFastListT } from '@elliemae/ds-fast-list';\n\nimport type { DSComboboxT } from './react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from './constants.js';\n\nexport declare namespace DSComboboxInternalsT {\n export interface ComboBoxContextT {\n props: DSComboboxT.InternalProps;\n internalRef: React.RefObject<HTMLInputElement>;\n menuState: boolean;\n setShowPopover: React.Dispatch<React.SetStateAction<boolean>>;\n pillGroupRef: React.RefObject<HTMLDivElement>;\n scrollOptionIntoView: (dsId: string, opts: DSFastListT.ScrollToOptions) => void;\n setHasFocus: React.Dispatch<React.SetStateAction<boolean>>;\n hasFocus: boolean;\n listRef: React.MutableRefObject<DSComboboxT.ActionRefVirtualized>;\n wrapperListRef: React.RefObject<HTMLDivElement>;\n inputValue: string;\n setInputValue: React.Dispatch<React.SetStateAction<string>>;\n selectedOptionsRef: React.RefObject<HTMLDivElement>;\n controlsWrapperRef: React.RefObject<HTMLDivElement>;\n focusOptionIdx: string;\n setFocusOptionIdx: React.Dispatch<React.SetStateAction<string>>;\n setMenuState: (\n newState: boolean,\n reason: string,\n e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>,\n ) => void;\n correctOptions: DSComboboxT.OptionTypes[];\n instanceUid: string;\n optionsPerSection: DSComboboxT.OptionTypes[];\n }\n}\n\nexport const isSeparator = (el: DSComboboxT.OptionTypes | undefined): el is DSComboboxT.ItemSeparatorOptions =>\n el?.type === MENU_OPTION_TYPES.SEPARATOR;\n\nexport const isOption = (el: DSComboboxT.OptionTypes | undefined): el is DSComboboxT.ItemOption =>\n el?.type === MENU_OPTION_TYPES.OPTION;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIvB,SAAS,yBAAyB;AA+B3B,MAAM,cAAc,CAAC,OAC1B,IAAI,SAAS,kBAAkB;AAE1B,MAAM,WAAW,CAAC,OACvB,IAAI,SAAS,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,8 +17,13 @@ function isArrayOfItems(value) {
|
|
|
17
17
|
}
|
|
18
18
|
const isItem = (value) => !Array.isArray(value) && value !== null && typeof value === "object";
|
|
19
19
|
const findInCircularList = (list, from, criteria, step = 1) => {
|
|
20
|
-
|
|
20
|
+
if (list.length === 0) return from;
|
|
21
|
+
let i = (from + step + list.length) % list.length;
|
|
22
|
+
let iterations = 0;
|
|
23
|
+
while (iterations < list.length) {
|
|
21
24
|
if (criteria(list[i])) return i;
|
|
25
|
+
i = (i + step + list.length) % list.length;
|
|
26
|
+
iterations += 1;
|
|
22
27
|
}
|
|
23
28
|
return from;
|
|
24
29
|
};
|
|
@@ -58,26 +63,6 @@ const filterOptions = (inputValue, options) => {
|
|
|
58
63
|
(option) => option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase())
|
|
59
64
|
);
|
|
60
65
|
};
|
|
61
|
-
const selectedValuesWithSections = (optionsToParse, multiSelectedValue) => {
|
|
62
|
-
const items = [];
|
|
63
|
-
if (optionsToParse)
|
|
64
|
-
optionsToParse.forEach((option) => {
|
|
65
|
-
if (option.type === MENU_OPTION_TYPES.OPTION && isSelected(multiSelectedValue, option)) {
|
|
66
|
-
items.push(option);
|
|
67
|
-
}
|
|
68
|
-
if (option.type === MENU_OPTION_TYPES.SECTION) {
|
|
69
|
-
if (items[items.length - 1]?.type === MENU_OPTION_TYPES.SECTION) {
|
|
70
|
-
items[items.length - 1] = option;
|
|
71
|
-
} else {
|
|
72
|
-
items.push(option);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
if (items[items.length - 1]?.type === MENU_OPTION_TYPES.SECTION) {
|
|
77
|
-
items.pop();
|
|
78
|
-
}
|
|
79
|
-
return items;
|
|
80
|
-
};
|
|
81
66
|
const getFilteredOptionsSelected = (filteredOption, selectedValues) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));
|
|
82
67
|
const scrollIfNeeded = (elem, options = { behavior: "smooth", block: "end", inline: "nearest" }) => {
|
|
83
68
|
const bounding = elem.getBoundingClientRect();
|
|
@@ -98,7 +83,6 @@ export {
|
|
|
98
83
|
isSelected,
|
|
99
84
|
isSelectedValueEmpty,
|
|
100
85
|
isSelectedValueMultiple,
|
|
101
|
-
scrollIfNeeded
|
|
102
|
-
selectedValuesWithSections
|
|
86
|
+
scrollIfNeeded
|
|
103
87
|
};
|
|
104
88
|
//# sourceMappingURL=listHelper.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/listHelper.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { DSComboboxT } from '../react-desc-prop-types.js';\nimport { MENU_OPTION_TYPES } from '../constants.js';\nexport const getSelectableOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && !option.disabled);\n\nexport const getOptions = (options: Array<DSComboboxT.OptionTypes>): Array<DSComboboxT.OptionTypes> =>\n options.filter((option) => option.type === MENU_OPTION_TYPES.OPTION);\n\nexport const isSelectedValueEmpty = (value: DSComboboxT.SelectedOptionsT): boolean =>\n Array.isArray(value) ? value.length === 0 : !value;\n\nexport const isSelectedValueMultiple = (value: DSComboboxT.SelectedOptionsT): boolean => Array.isArray(value);\n\nexport const isSelected = (value: DSComboboxT.SelectedOptionsT, activeOption: DSComboboxT.ItemOption): boolean => {\n if (isSelectedValueMultiple(value)) {\n const multiValue = value as DSComboboxT.ItemOption[];\n return multiValue.some((item) => item?.value === activeOption?.value);\n }\n const singleValue = value as DSComboboxT.ItemOption;\n return singleValue?.value === activeOption.value;\n};\n\nexport function isArrayOfItems(value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption[] {\n return Array.isArray(value) && value.length > 0;\n}\n\nexport const isItem = (value: DSComboboxT.SelectedOptionsT): value is DSComboboxT.ItemOption =>\n !Array.isArray(value) && value !== null && typeof value === 'object';\n\nexport const findInCircularList = (\n list: DSComboboxT.OptionTypes[],\n from: number,\n criteria: (item: DSComboboxT.OptionTypes) => boolean,\n step = 1,\n): number => {\n if (list.length === 0) return from;\n\n let i = (from + step + list.length) % list.length;\n let iterations = 0;\n\n while (iterations < list.length) {\n if (criteria(list[i])) return i;\n\n i = (i + step + list.length) % list.length;\n iterations += 1;\n }\n\n return from; // Return the original index if no match is found\n};\nexport const getLastValueSelected = (selectedValues: DSComboboxT.SelectedOptionsT) => {\n if (Array.isArray(selectedValues)) {\n return selectedValues[selectedValues.length - 1];\n }\n return selectedValues;\n};\n\nexport const getFirstOption = (\n options: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.SelectedOptionsT,\n): string => {\n const lastValue = getLastValueSelected(selectedValues);\n if (lastValue) return lastValue.dsId;\n\n for (let i = 0; i < options.length; i += 1)\n if (!['section', 'separator'].includes(options[i].type) && !options[i].disabled) {\n return options[i].dsId;\n }\n // list of disabled item results return ''\n return '';\n};\n\nexport const getSuggestedValueOnChange = (\n selectedOption: DSComboboxT.ItemOption,\n selectedValues: DSComboboxT.SelectedOptionsT,\n isNonClearable?: boolean,\n) => {\n if (Array.isArray(selectedValues)) {\n const isFound = selectedValues.find((item) => item.type === 'option' && item.value === selectedOption.value);\n if (isFound) {\n if (isNonClearable) return selectedValues;\n return selectedValues.filter((item) => item.type === 'option' && item.value !== selectedOption.value);\n }\n return [...selectedValues, selectedOption];\n }\n if (selectedValues && selectedValues.dsId === selectedOption.dsId) {\n if (isNonClearable) return selectedOption;\n return null;\n }\n return selectedOption;\n};\n\nexport const filterOptions = (inputValue: string, options: DSComboboxT.OptionTypes[]) => {\n if (!inputValue) return options;\n return options.filter(\n (option) =>\n option.type === MENU_OPTION_TYPES.OPTION && option.label.toLowerCase().includes(inputValue.toLowerCase()),\n );\n};\n\nexport const getFilteredOptionsSelected = (\n filteredOption: DSComboboxT.OptionTypes[],\n selectedValues: DSComboboxT.ItemOption[],\n) => filteredOption.filter((option) => option.type === MENU_OPTION_TYPES.OPTION && isSelected(selectedValues, option));\n\nexport const scrollIfNeeded = (\n elem: HTMLElement,\n options = { behavior: 'smooth', block: 'end', inline: 'nearest' } as ScrollIntoViewOptions | undefined,\n) => {\n const bounding = elem.getBoundingClientRect();\n if (\n !(\n bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth)\n )\n )\n elem.scrollIntoView(options);\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useOnClickOutside<T extends Node, CbT extends (event: Event) => void, Z extends Node>(ref: T | null, cb: CbT, excludeNode: Z | null): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DSComboboxT } from '../react-desc-prop-types.js';
|
|
2
|
-
declare const useCorrectOptions: (propsWithDefaults: DSComboboxT.Props, inputValue: string
|
|
2
|
+
declare const useCorrectOptions: (propsWithDefaults: DSComboboxT.Props, inputValue: string) => DSComboboxT.OptionTypes[];
|
|
3
3
|
export { useCorrectOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DSComboboxT } from '../react-desc-prop-types.js';
|
|
3
|
+
interface SectionProps {
|
|
4
|
+
label: string;
|
|
5
|
+
wrapperStyles: React.CSSProperties;
|
|
6
|
+
innerRef: (instance: HTMLDivElement | null) => void;
|
|
7
|
+
options: DSComboboxT.ItemOption[] | DSComboboxT.ItemSeparatorOptions[];
|
|
8
|
+
handleClick: (option: DSComboboxT.ItemOption, e: React.MouseEvent<HTMLInputElement>) => void;
|
|
9
|
+
handleOnMouseDown: (e: React.MouseEvent<HTMLLIElement>) => void;
|
|
10
|
+
focusOptionIdx: string;
|
|
11
|
+
selectedValues: DSComboboxT.SelectedOptionsT;
|
|
12
|
+
}
|
|
13
|
+
export declare const Section: React.MemoExoticComponent<(props: SectionProps) => import("react/jsx-runtime.js").JSX.Element>;
|
|
14
|
+
export {};
|
|
@@ -5,11 +5,13 @@ interface StyledControlsWrapperT {
|
|
|
5
5
|
minWidth?: number;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
applyAriaDisabled: boolean;
|
|
8
|
+
readOnly: boolean;
|
|
8
9
|
}
|
|
9
10
|
export declare const StyledControlsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, StyledControlsWrapperT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
|
|
10
11
|
export declare const StyledSingleSelectWraper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
|
|
11
12
|
disabled: boolean;
|
|
12
13
|
applyAriaDisabled: boolean;
|
|
14
|
+
readOnly: boolean;
|
|
13
15
|
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
14
16
|
export declare const StyledSelection: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
15
17
|
export declare const StyledHeaderActionsWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare const StyleHiddenInput: import("styled-components").StyledComponent<"input", import("@elliemae/ds-system").Theme,
|
|
1
|
+
export declare const StyleHiddenInput: import("styled-components").StyledComponent<"input", import("@elliemae/ds-system").Theme, {
|
|
2
|
+
isDisabled: boolean;
|
|
3
|
+
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"input">, never>;
|
|
2
4
|
export declare const StyledInput: import("styled-components").StyledComponent<"input", import("@elliemae/ds-system").Theme, {
|
|
3
5
|
withoutCaret: boolean;
|
|
4
6
|
applyAriaDisabled: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { SizingProps } from '@elliemae/ds-system';
|
|
2
3
|
interface StyledListWrapperT {
|
|
3
4
|
minWidth: SizingProps['minWidth'];
|
|
@@ -5,13 +6,7 @@ interface StyledListWrapperT {
|
|
|
5
6
|
width: number | string;
|
|
6
7
|
inline?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const StyledListWrapper: import("styled-components").StyledComponent<"
|
|
9
|
-
export declare const StyledList: import("styled-components").StyledComponent<"ul", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"ul">, never>;
|
|
10
|
-
export declare const StyledVirtualListWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, {
|
|
11
|
-
inline: boolean | undefined;
|
|
12
|
-
maxHeight: SizingProps['maxHeight'];
|
|
13
|
-
withHeader?: boolean | undefined;
|
|
14
|
-
} & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
9
|
+
export declare const StyledListWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>, import("@elliemae/ds-system").Theme, StyledListWrapperT & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid").DSGridT.Props & import("react").RefAttributes<HTMLDivElement>>>, never>;
|
|
15
10
|
export declare const StyledCreatableLabel: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
16
11
|
export declare const StyledCreatableValue: import("styled-components").StyledComponent<"span", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"span">, never>;
|
|
17
12
|
export declare const StyledNoResultsWrapper: import("styled-components").StyledComponent<"div", import("@elliemae/ds-system").Theme, object & import("@elliemae/ds-system").OwnerInterface & import("@elliemae/ds-system").InnerRefInterface<"div">, never>;
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { DSComboboxT } from '../../react-desc-prop-types.js';
|
|
3
|
+
interface ItemRendererT {
|
|
4
|
+
extraItemProps?: {
|
|
5
|
+
itemList: DSComboboxT.OptionTypes[];
|
|
6
|
+
};
|
|
7
|
+
index: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const ItemRenderer: ({ index, extraItemProps }: ItemRendererT) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
2
|
import type { GlobalAttributesT, XstyledProps } from '@elliemae/ds-props-helpers';
|
|
3
|
+
import type { DSFloatingWrapperT } from '@elliemae/ds-floating-context';
|
|
3
4
|
import type { DSMaskT } from '@elliemae/ds-form-helpers-mask-hooks';
|
|
4
5
|
import type { SizingProps } from '@elliemae/ds-system';
|
|
5
6
|
import type { DSPopperJST } from '@elliemae/ds-popperjs';
|
|
7
|
+
import type { DSFastListT } from '@elliemae/ds-fast-list';
|
|
6
8
|
export declare function noop<T extends unknown[]>(..._args: T): void;
|
|
7
9
|
export declare namespace DSComboboxT {
|
|
8
10
|
interface CommonItemOptions extends GlobalAttributesT {
|
|
@@ -17,6 +19,7 @@ export declare namespace DSComboboxT {
|
|
|
17
19
|
interface ItemSectionOptions extends CommonItemOptions {
|
|
18
20
|
type: 'section';
|
|
19
21
|
label: string;
|
|
22
|
+
options: OptionTypes[];
|
|
20
23
|
}
|
|
21
24
|
interface ItemOption extends CommonItemOptions {
|
|
22
25
|
value: string;
|
|
@@ -44,6 +47,7 @@ export declare namespace DSComboboxT {
|
|
|
44
47
|
onSelectAll?: (suggestedValue: OptionTypes[] | [], event: React.MouseEvent | React.KeyboardEvent) => null;
|
|
45
48
|
onKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>, value: ItemOption) => void;
|
|
46
49
|
isLoading?: boolean;
|
|
50
|
+
popperProps?: DSFloatingWrapperT.Props;
|
|
47
51
|
}
|
|
48
52
|
interface RequiredProps {
|
|
49
53
|
allOptions: OptionTypes[];
|
|
@@ -64,11 +68,15 @@ export declare namespace DSComboboxT {
|
|
|
64
68
|
onlySelectable: boolean;
|
|
65
69
|
isSkeleton: boolean;
|
|
66
70
|
applyAriaDisabled: boolean;
|
|
71
|
+
readOnly: boolean;
|
|
67
72
|
}
|
|
68
73
|
interface Props extends Partial<DefaultProps>, RequiredProps, PropsOptional, Omit<GlobalAttributesT, keyof DefaultProps | keyof RequiredProps | keyof PropsOptional>, XstyledProps {
|
|
69
74
|
}
|
|
70
75
|
interface InternalProps extends DefaultProps, RequiredProps, PropsOptional, Omit<GlobalAttributesT, keyof DefaultProps | keyof RequiredProps | keyof PropsOptional>, XstyledProps {
|
|
71
76
|
}
|
|
77
|
+
type ActionRefVirtualized = {
|
|
78
|
+
scrollTo: (index: number, opts?: DSFastListT.ScrollToOptions) => void;
|
|
79
|
+
};
|
|
72
80
|
}
|
|
73
81
|
export declare const ComboboxPropTypes: {
|
|
74
82
|
placeholder: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
@@ -92,6 +100,9 @@ export declare const ComboboxPropTypes: {
|
|
|
92
100
|
onlySelectable: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
93
101
|
isSkeleton: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
94
102
|
applyAriaDisabled: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
103
|
+
readOnly: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
104
|
+
onSelectAll: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
105
|
+
popperProps: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
95
106
|
'aria-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
96
107
|
'on-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
97
108
|
'data-*': import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
@@ -408,7 +419,6 @@ export declare const ComboboxPropTypes: {
|
|
|
408
419
|
preload: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
409
420
|
property: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
410
421
|
radioGroup: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
411
|
-
readOnly: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
412
422
|
rel: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
413
423
|
rev: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
414
424
|
required: import("@elliemae/ds-props-helpers/dist/types/propTypes/types").ReactDescT;
|
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DSFastListT } from '@elliemae/ds-fast-list';
|
|
3
3
|
import type { DSComboboxT } from './react-desc-prop-types.js';
|
|
4
4
|
export declare namespace DSComboboxInternalsT {
|
|
5
5
|
interface ComboBoxContextT {
|
|
6
6
|
props: DSComboboxT.InternalProps;
|
|
7
7
|
internalRef: React.RefObject<HTMLInputElement>;
|
|
8
|
-
virtualListHelpers?: ReturnType<typeof useVirtual>;
|
|
9
8
|
menuState: boolean;
|
|
10
9
|
setShowPopover: React.Dispatch<React.SetStateAction<boolean>>;
|
|
11
|
-
referenceElement: HTMLElement | null;
|
|
12
|
-
setReferenceElement: React.Dispatch<React.SetStateAction<HTMLElement | null>>;
|
|
13
10
|
pillGroupRef: React.RefObject<HTMLDivElement>;
|
|
14
|
-
scrollOptionIntoView: (dsId: string) => void;
|
|
11
|
+
scrollOptionIntoView: (dsId: string, opts: DSFastListT.ScrollToOptions) => void;
|
|
15
12
|
setHasFocus: React.Dispatch<React.SetStateAction<boolean>>;
|
|
16
13
|
hasFocus: boolean;
|
|
17
|
-
listRef: React.
|
|
14
|
+
listRef: React.MutableRefObject<DSComboboxT.ActionRefVirtualized>;
|
|
18
15
|
wrapperListRef: React.RefObject<HTMLDivElement>;
|
|
19
16
|
inputValue: string;
|
|
20
17
|
setInputValue: React.Dispatch<React.SetStateAction<string>>;
|
|
21
18
|
selectedOptionsRef: React.RefObject<HTMLDivElement>;
|
|
22
19
|
controlsWrapperRef: React.RefObject<HTMLDivElement>;
|
|
23
|
-
selectAllCheckboxRef: React.RefObject<HTMLInputElement>;
|
|
24
|
-
toggleSelectionButtonRef: React.RefObject<HTMLButtonElement>;
|
|
25
20
|
focusOptionIdx: string;
|
|
26
21
|
setFocusOptionIdx: React.Dispatch<React.SetStateAction<string>>;
|
|
27
|
-
showSelectedOptions: boolean;
|
|
28
|
-
setShowSelectedOptions: React.Dispatch<React.SetStateAction<boolean>>;
|
|
29
22
|
setMenuState: (newState: boolean, reason: string, e?: React.KeyboardEvent | React.MouseEvent | React.ChangeEvent<HTMLInputElement>) => void;
|
|
30
23
|
correctOptions: DSComboboxT.OptionTypes[];
|
|
31
24
|
instanceUid: string;
|
|
25
|
+
optionsPerSection: DSComboboxT.OptionTypes[];
|
|
32
26
|
}
|
|
33
27
|
}
|
|
34
28
|
export declare const isSeparator: (el: DSComboboxT.OptionTypes | undefined) => el is DSComboboxT.ItemSeparatorOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,5 @@ export declare const getLastValueSelected: (selectedValues: DSComboboxT.Selected
|
|
|
11
11
|
export declare const getFirstOption: (options: DSComboboxT.OptionTypes[], selectedValues: DSComboboxT.SelectedOptionsT) => string;
|
|
12
12
|
export declare const getSuggestedValueOnChange: (selectedOption: DSComboboxT.ItemOption, selectedValues: DSComboboxT.SelectedOptionsT, isNonClearable?: boolean) => DSComboboxT.ItemOption | DSComboboxT.ItemOption[] | null;
|
|
13
13
|
export declare const filterOptions: (inputValue: string, options: DSComboboxT.OptionTypes[]) => DSComboboxT.OptionTypes[];
|
|
14
|
-
export declare const selectedValuesWithSections: (optionsToParse: DSComboboxT.OptionTypes[], multiSelectedValue: DSComboboxT.ItemOption[]) => DSComboboxT.OptionTypes[];
|
|
15
14
|
export declare const getFilteredOptionsSelected: (filteredOption: DSComboboxT.OptionTypes[], selectedValues: DSComboboxT.ItemOption[]) => DSComboboxT.OptionTypes[];
|
|
16
15
|
export declare const scrollIfNeeded: (elem: HTMLElement, options?: ScrollIntoViewOptions | undefined) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-combobox",
|
|
3
|
-
"version": "3.51.0-next.
|
|
3
|
+
"version": "3.51.0-next.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Combobox",
|
|
6
6
|
"files": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://git.elliemae.io/platform-ui/dimsum.git"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"pnpm": ">=
|
|
29
|
-
"node": ">=
|
|
28
|
+
"pnpm": ">=9",
|
|
29
|
+
"node": ">=22"
|
|
30
30
|
},
|
|
31
31
|
"author": "ICE MT",
|
|
32
32
|
"jestSonar": {
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"react-virtual": "~2.10.4",
|
|
40
40
|
"uid": "~2.0.1",
|
|
41
|
-
"@elliemae/ds-button-v2": "3.51.0-next.
|
|
42
|
-
"@elliemae/ds-circular-progress-indicator": "3.51.0-next.
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-
|
|
45
|
-
"@elliemae/ds-
|
|
46
|
-
"@elliemae/ds-
|
|
47
|
-
"@elliemae/ds-
|
|
48
|
-
"@elliemae/ds-
|
|
49
|
-
"@elliemae/ds-
|
|
50
|
-
"@elliemae/ds-system": "3.51.0-next.
|
|
51
|
-
"@elliemae/ds-truncated-tooltip-text": "3.51.0-next.
|
|
41
|
+
"@elliemae/ds-button-v2": "3.51.0-next.12",
|
|
42
|
+
"@elliemae/ds-circular-progress-indicator": "3.51.0-next.12",
|
|
43
|
+
"@elliemae/ds-floating-context": "3.51.0-next.12",
|
|
44
|
+
"@elliemae/ds-form-checkbox": "3.51.0-next.12",
|
|
45
|
+
"@elliemae/ds-grid": "3.51.0-next.12",
|
|
46
|
+
"@elliemae/ds-menu-items": "3.51.0-next.12",
|
|
47
|
+
"@elliemae/ds-icons": "3.51.0-next.12",
|
|
48
|
+
"@elliemae/ds-pills-v2": "3.51.0-next.12",
|
|
49
|
+
"@elliemae/ds-props-helpers": "3.51.0-next.12",
|
|
50
|
+
"@elliemae/ds-system": "3.51.0-next.12",
|
|
51
|
+
"@elliemae/ds-truncated-tooltip-text": "3.51.0-next.12"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@elliemae/pui-cli": "9.0.0-next.
|
|
54
|
+
"@elliemae/pui-cli": "9.0.0-next.55",
|
|
55
55
|
"@elliemae/pui-theme": "~2.10.0",
|
|
56
56
|
"jest": "~29.7.0",
|
|
57
57
|
"styled-components": "~5.3.9",
|
|
58
58
|
"styled-system": "^5.1.5",
|
|
59
|
-
"@elliemae/ds-form-helpers-mask-hooks": "3.51.0-next.
|
|
60
|
-
"@elliemae/ds-monorepo-devops": "3.51.0-next.
|
|
59
|
+
"@elliemae/ds-form-helpers-mask-hooks": "3.51.0-next.12",
|
|
60
|
+
"@elliemae/ds-monorepo-devops": "3.51.0-next.12"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"@elliemae/pui-theme": "~2.10.0",
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var HeaderList_exports = {};
|
|
30
|
-
__export(HeaderList_exports, {
|
|
31
|
-
HeaderList: () => HeaderList
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(HeaderList_exports);
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
-
var import_react = require("react");
|
|
37
|
-
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
38
|
-
var import_ds_form_checkbox = require("@elliemae/ds-form-checkbox");
|
|
39
|
-
var import_ds_truncated_tooltip_text = require("@elliemae/ds-truncated-tooltip-text");
|
|
40
|
-
var import_ComboBoxCTX = require("../../ComboBoxCTX.js");
|
|
41
|
-
var import_styled = require("./styled.js");
|
|
42
|
-
var import_ComboboxDataTestids = require("../../ComboboxDataTestids.js");
|
|
43
|
-
var import_useHeaderListHandlers = require("./useHeaderListHandlers.js");
|
|
44
|
-
const HeaderList = () => {
|
|
45
|
-
const {
|
|
46
|
-
props: { selectedValues, onSelectAll },
|
|
47
|
-
showSelectedOptions,
|
|
48
|
-
selectAllCheckboxRef,
|
|
49
|
-
toggleSelectionButtonRef,
|
|
50
|
-
correctOptions: filteredOptions
|
|
51
|
-
} = (0, import_react.useContext)(import_ComboBoxCTX.ComboBoxContext);
|
|
52
|
-
const multiSelectedValues = selectedValues;
|
|
53
|
-
const {
|
|
54
|
-
handleKeyDown,
|
|
55
|
-
handleOnMouseDown,
|
|
56
|
-
handleFilterSelectionBtnOnTab,
|
|
57
|
-
handleToggleSelectedValuesFilter,
|
|
58
|
-
handleCheckAllOnTab,
|
|
59
|
-
checkboxStatus,
|
|
60
|
-
handleSelectAllCheckboxChange
|
|
61
|
-
} = (0, import_useHeaderListHandlers.useHeaderListHandlers)();
|
|
62
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
63
|
-
import_styled.StyledHeaderListWrapper,
|
|
64
|
-
{
|
|
65
|
-
onKeyDown: handleKeyDown,
|
|
66
|
-
onMouseDown: handleOnMouseDown,
|
|
67
|
-
"data-testid": import_ComboboxDataTestids.ComboboxDataTestid.MULTISELECT.HEADER_LIST,
|
|
68
|
-
children: [
|
|
69
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSelectAllCheckbox, { children: onSelectAll && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
70
|
-
import_ds_form_checkbox.DSControlledCheckbox,
|
|
71
|
-
{
|
|
72
|
-
checked: checkboxStatus,
|
|
73
|
-
"aria-controls": filteredOptions.map((item) => item.dsId).join(" "),
|
|
74
|
-
name: "select-all-checkbox",
|
|
75
|
-
"aria-label": "Select/Unselect All Items",
|
|
76
|
-
"aria-labelledby": "",
|
|
77
|
-
id: "select-all-checkbox",
|
|
78
|
-
onChange: handleSelectAllCheckboxChange,
|
|
79
|
-
onKeyDown: handleCheckAllOnTab,
|
|
80
|
-
innerRef: selectAllCheckboxRef
|
|
81
|
-
}
|
|
82
|
-
) }),
|
|
83
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledSelectedItems, { children: multiSelectedValues.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
84
|
-
import_styled.StyledButtonSelection,
|
|
85
|
-
{
|
|
86
|
-
onKeyDown: handleFilterSelectionBtnOnTab,
|
|
87
|
-
buttonType: import_ds_button_v2.BUTTON_TYPES.TEXT,
|
|
88
|
-
onClick: handleToggleSelectedValuesFilter,
|
|
89
|
-
size: import_ds_button_v2.BUTTON_SIZES.S,
|
|
90
|
-
"data-testid": import_ComboboxDataTestids.ComboboxDataTestid.MULTISELECT.SHOW_SELECTED_OPTIONS_TOGGLE,
|
|
91
|
-
innerRef: toggleSelectionButtonRef,
|
|
92
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
93
|
-
import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText,
|
|
94
|
-
{
|
|
95
|
-
value: !showSelectedOptions ? `SHOW SELECTED [${multiSelectedValues.length}]` : "SHOW ALL"
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledNoOptionsSelected, { children: "0 SELECTED" }) })
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
};
|
|
104
|
-
//# sourceMappingURL=HeaderList.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/parts/header-list/HeaderList.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable jsx-a11y/click-events-have-key-events */\nimport React, { useContext } from 'react';\nimport { BUTTON_SIZES, BUTTON_TYPES } from '@elliemae/ds-button-v2';\nimport { DSControlledCheckbox } from '@elliemae/ds-form-checkbox';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { ComboBoxContext } from '../../ComboBoxCTX.js';\nimport {\n StyledHeaderListWrapper,\n StyledButtonSelection,\n StyledSelectedItems,\n StyledSelectAllCheckbox,\n StyledNoOptionsSelected,\n} from './styled.js';\nimport type { DSComboboxT } from '../../react-desc-prop-types.js';\nimport { ComboboxDataTestid } from '../../ComboboxDataTestids.js';\nimport { useHeaderListHandlers } from './useHeaderListHandlers.js';\nexport const HeaderList = (): JSX.Element => {\n const {\n props: { selectedValues, onSelectAll },\n showSelectedOptions,\n selectAllCheckboxRef,\n toggleSelectionButtonRef,\n correctOptions: filteredOptions,\n } = useContext(ComboBoxContext);\n\n const multiSelectedValues = selectedValues as DSComboboxT.ItemOption[];\n const {\n handleKeyDown,\n handleOnMouseDown,\n handleFilterSelectionBtnOnTab,\n handleToggleSelectedValuesFilter,\n handleCheckAllOnTab,\n checkboxStatus,\n handleSelectAllCheckboxChange,\n } = useHeaderListHandlers();\n\n return (\n <StyledHeaderListWrapper\n onKeyDown={handleKeyDown}\n onMouseDown={handleOnMouseDown}\n data-testid={ComboboxDataTestid.MULTISELECT.HEADER_LIST}\n >\n <StyledSelectAllCheckbox>\n {onSelectAll && (\n <DSControlledCheckbox\n checked={checkboxStatus}\n aria-controls={filteredOptions.map((item) => item.dsId).join(' ')}\n name=\"select-all-checkbox\"\n aria-label=\"Select/Unselect All Items\"\n aria-labelledby=\"\"\n id=\"select-all-checkbox\"\n onChange={handleSelectAllCheckboxChange}\n onKeyDown={handleCheckAllOnTab}\n innerRef={selectAllCheckboxRef}\n />\n )}\n </StyledSelectAllCheckbox>\n <StyledSelectedItems>\n {multiSelectedValues.length > 0 ? (\n <StyledButtonSelection\n onKeyDown={handleFilterSelectionBtnOnTab}\n buttonType={BUTTON_TYPES.TEXT}\n onClick={handleToggleSelectedValuesFilter}\n size={BUTTON_SIZES.S}\n data-testid={ComboboxDataTestid.MULTISELECT.SHOW_SELECTED_OPTIONS_TOGGLE}\n innerRef={toggleSelectionButtonRef}\n >\n <SimpleTruncatedTooltipText\n value={!showSelectedOptions ? `SHOW SELECTED [${multiSelectedValues.length}]` : 'SHOW ALL'}\n ></SimpleTruncatedTooltipText>\n </StyledButtonSelection>\n ) : (\n <StyledNoOptionsSelected>0 SELECTED</StyledNoOptionsSelected>\n )}\n </StyledSelectedItems>\n </StyledHeaderListWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADuCnB;AApCJ,mBAAkC;AAClC,0BAA2C;AAC3C,8BAAqC;AACrC,uCAA2C;AAC3C,yBAAgC;AAChC,oBAMO;AAEP,iCAAmC;AACnC,mCAAsC;AAC/B,MAAM,aAAa,MAAmB;AAC3C,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB,YAAY;AAAA,IACrC;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB;AAAA,EAClB,QAAI,yBAAW,kCAAe;AAE9B,QAAM,sBAAsB;AAC5B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,oDAAsB;AAE1B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,aAAa;AAAA,MACb,eAAa,8CAAmB,YAAY;AAAA,MAE5C;AAAA,oDAAC,yCACE,yBACC;AAAA,UAAC;AAAA;AAAA,YACC,SAAS;AAAA,YACT,iBAAe,gBAAgB,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE,KAAK,GAAG;AAAA,YAChE,MAAK;AAAA,YACL,cAAW;AAAA,YACX,mBAAgB;AAAA,YAChB,IAAG;AAAA,YACH,UAAU;AAAA,YACV,WAAW;AAAA,YACX,UAAU;AAAA;AAAA,QACZ,GAEJ;AAAA,QACA,4CAAC,qCACE,8BAAoB,SAAS,IAC5B;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,YACX,YAAY,iCAAa;AAAA,YACzB,SAAS;AAAA,YACT,MAAM,iCAAa;AAAA,YACnB,eAAa,8CAAmB,YAAY;AAAA,YAC5C,UAAU;AAAA,YAEV;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO,CAAC,sBAAsB,kBAAkB,oBAAoB,MAAM,MAAM;AAAA;AAAA,YACjF;AAAA;AAAA,QACH,IAEA,4CAAC,yCAAwB,wBAAU,GAEvC;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/parts/header-list/index.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export { HeaderList } from './HeaderList.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA2B;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var styled_exports = {};
|
|
30
|
-
__export(styled_exports, {
|
|
31
|
-
StyledButtonSelection: () => StyledButtonSelection,
|
|
32
|
-
StyledHeaderListWrapper: () => StyledHeaderListWrapper,
|
|
33
|
-
StyledNoOptionsSelected: () => StyledNoOptionsSelected,
|
|
34
|
-
StyledSelectAllCheckbox: () => StyledSelectAllCheckbox,
|
|
35
|
-
StyledSelectedItems: () => StyledSelectedItems
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(styled_exports);
|
|
38
|
-
var React = __toESM(require("react"));
|
|
39
|
-
var import_ds_system = require("@elliemae/ds-system");
|
|
40
|
-
var import_ds_button_v2 = require("@elliemae/ds-button-v2");
|
|
41
|
-
const StyledHeaderListWrapper = import_ds_system.styled.div`
|
|
42
|
-
display: flex;
|
|
43
|
-
position: sticky;
|
|
44
|
-
top: 0;
|
|
45
|
-
z-index: 10;
|
|
46
|
-
justify-content: space-between;
|
|
47
|
-
width: inherit;
|
|
48
|
-
padding: 5px 12px 5px 16px;
|
|
49
|
-
@media (max-width: ${import_ds_system.th.breakpoint("small")}) {
|
|
50
|
-
padding: 3.25px 12px 3.25px 16px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
background-color: #fff;
|
|
54
|
-
box-shadow: 0 4px 2px -4px ${(props) => props.theme.colors.neutral[700]};
|
|
55
|
-
overflow-x: hidden;
|
|
56
|
-
|
|
57
|
-
& button {
|
|
58
|
-
font-size: 1rem;
|
|
59
|
-
}
|
|
60
|
-
`;
|
|
61
|
-
const StyledButtonSelection = (0, import_ds_system.styled)(import_ds_button_v2.DSButtonV2)`
|
|
62
|
-
border-radius: 0px;
|
|
63
|
-
padding: 0 ${(props) => props.theme.space.xxs};
|
|
64
|
-
margin: 0;
|
|
65
|
-
font-size: 1rem;
|
|
66
|
-
align-items: center;
|
|
67
|
-
transition: unset;
|
|
68
|
-
&:hover:not([disabled]) {
|
|
69
|
-
background-color: transparent;
|
|
70
|
-
color: ${(props) => props.theme.colors.brand["700"]};
|
|
71
|
-
}
|
|
72
|
-
`;
|
|
73
|
-
const StyledSelectedItems = import_ds_system.styled.div`
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
`;
|
|
77
|
-
const StyledNoOptionsSelected = import_ds_system.styled.div`
|
|
78
|
-
padding: 0 ${(props) => props.theme.space.xxs};
|
|
79
|
-
font-size: 1rem;
|
|
80
|
-
`;
|
|
81
|
-
const StyledSelectAllCheckbox = import_ds_system.styled.div`
|
|
82
|
-
display: flex;
|
|
83
|
-
align-items: center;
|
|
84
|
-
`;
|
|
85
|
-
//# sourceMappingURL=styled.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/parts/header-list/styled.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable max-len */\nimport { styled, th } from '@elliemae/ds-system';\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\n\nexport const StyledHeaderListWrapper = styled.div`\n display: flex;\n position: sticky;\n top: 0;\n z-index: 10;\n justify-content: space-between;\n width: inherit;\n padding: 5px 12px 5px 16px;\n @media (max-width: ${th.breakpoint('small')}) {\n padding: 3.25px 12px 3.25px 16px;\n }\n\n background-color: #fff;\n box-shadow: 0 4px 2px -4px ${(props) => props.theme.colors.neutral[700]};\n overflow-x: hidden;\n\n & button {\n font-size: 1rem;\n }\n`;\n\nexport const StyledButtonSelection = styled(DSButtonV2)`\n border-radius: 0px;\n padding: 0 ${(props) => props.theme.space.xxs};\n margin: 0;\n font-size: 1rem;\n align-items: center;\n transition: unset;\n &:hover:not([disabled]) {\n background-color: transparent;\n color: ${(props) => props.theme.colors.brand['700']};\n }\n`;\n\nexport const StyledSelectedItems = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const StyledNoOptionsSelected = styled.div`\n padding: 0 ${(props) => props.theme.space.xxs};\n font-size: 1rem;\n`;\n\nexport const StyledSelectAllCheckbox = styled.div`\n display: flex;\n align-items: center;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,uBAA2B;AAC3B,0BAA2B;AAEpB,MAAM,0BAA0B,wBAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAQvB,oBAAG,WAAW,OAAO,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,+BAKd,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ,GAAG,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQlE,MAAM,4BAAwB,yBAAO,8BAAU;AAAA;AAAA,eAEvC,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAOlC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM,KAAK,CAAC;AAAA;AAAA;AAIhD,MAAM,sBAAsB,wBAAO;AAAA;AAAA;AAAA;AAKnC,MAAM,0BAA0B,wBAAO;AAAA,eAC/B,CAAC,UAAU,MAAM,MAAM,MAAM,GAAG;AAAA;AAAA;AAIxC,MAAM,0BAA0B,wBAAO;AAAA;AAAA;AAAA;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|