@chayns-components/core 5.5.37 → 5.5.41
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/AGENTS.md +3 -1
- package/lib/cjs/components/search-box/SearchBox.js +23 -13
- package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/searchBox.js +6 -0
- package/lib/cjs/utils/searchBox.js.map +1 -1
- package/lib/cjs/utils/searchBox.test.js +54 -0
- package/lib/cjs/utils/searchBox.test.js.map +1 -0
- package/lib/esm/components/search-box/SearchBox.js +22 -13
- package/lib/esm/components/search-box/SearchBox.js.map +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/utils/searchBox.js +6 -0
- package/lib/esm/utils/searchBox.js.map +1 -1
- package/lib/esm/utils/searchBox.test.js +52 -0
- package/lib/esm/utils/searchBox.test.js.map +1 -0
- package/lib/types/components/search-box/SearchBox.d.ts +15 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/utils/searchBox.d.ts +4 -2
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -4736,7 +4736,8 @@ import { SearchBox } from '@chayns-components/core';
|
|
|
4736
4736
|
| name | type | required | description |
|
|
4737
4737
|
| --- | --- | --- | --- |
|
|
4738
4738
|
| `container` | `Element \| undefined` | no | The element where the content of the `ComboBox` should be rendered via React Portal. |
|
|
4739
|
-
| `customFilter` | `((item: ISearchBoxItem) => boolean) \| undefined` | no | An optional callback function to filter the elements to be displayed |
|
|
4739
|
+
| `customFilter` | `((item: ISearchBoxItem, value: string) => boolean) \| undefined` | no | An optional callback function to filter the elements to be displayed |
|
|
4740
|
+
| `customSortFunction` | `SearchBoxSortFunction \| undefined` | no | An optional callback function to sort the filtered elements to be displayed |
|
|
4740
4741
|
| `dropdownDirection` | `DropdownDirection \| undefined` | no | The direction in which the dropdown should be displayed. By default, it is displayed below the input. |
|
|
4741
4742
|
| `hintText` | `string \| undefined` | no | A text that should be displayed if no results are found. |
|
|
4742
4743
|
| `inputProps` | `InputProps \| undefined` | no | Props that are passed to the underlying Input component. |
|
|
@@ -4774,6 +4775,7 @@ import { SearchBox } from '@chayns-components/core';
|
|
|
4774
4775
|
LEFT,
|
|
4775
4776
|
RIGHT,
|
|
4776
4777
|
}`
|
|
4778
|
+
- `SearchBoxSortFunction` -> `type SearchBoxSortFunction = (a: ISearchBoxItem, b: ISearchBoxItem) => number;`
|
|
4777
4779
|
|
|
4778
4780
|
### Usage Notes
|
|
4779
4781
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.filterSearchBoxItems = exports.default = void 0;
|
|
7
7
|
var _chaynsApi = require("chayns-api");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _styledComponents = require("styled-components");
|
|
@@ -24,28 +24,33 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
24
24
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
25
25
|
const filterSearchBoxItems = ({
|
|
26
26
|
customFilter,
|
|
27
|
+
customSortFunction,
|
|
27
28
|
items,
|
|
28
29
|
searchString,
|
|
29
30
|
shouldUseCustomFilterOnly
|
|
30
31
|
}) => {
|
|
31
|
-
if (typeof customFilter !== 'function') {
|
|
32
|
-
return (0, _searchBox.searchList)({
|
|
33
|
-
items,
|
|
34
|
-
searchString
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
32
|
if (shouldUseCustomFilterOnly) {
|
|
38
|
-
const filteredItems = items.filter(customFilter);
|
|
33
|
+
const filteredItems = typeof customFilter === 'function' ? items.filter(item => customFilter(item, searchString)) : items;
|
|
39
34
|
return (0, _searchBox.sortSearchBoxItems)({
|
|
35
|
+
customSortFunction,
|
|
40
36
|
items: filteredItems,
|
|
41
37
|
searchString
|
|
42
38
|
});
|
|
43
39
|
}
|
|
40
|
+
if (typeof customFilter !== 'function') {
|
|
41
|
+
return (0, _searchBox.searchList)({
|
|
42
|
+
customSortFunction,
|
|
43
|
+
items,
|
|
44
|
+
searchString
|
|
45
|
+
});
|
|
46
|
+
}
|
|
44
47
|
return (0, _searchBox.searchList)({
|
|
48
|
+
customSortFunction,
|
|
45
49
|
items,
|
|
46
50
|
searchString
|
|
47
|
-
}).filter(customFilter);
|
|
51
|
+
}).filter(item => customFilter(item, searchString));
|
|
48
52
|
};
|
|
53
|
+
exports.filterSearchBoxItems = filterSearchBoxItems;
|
|
49
54
|
const getDropdownSearchString = ({
|
|
50
55
|
selectedId,
|
|
51
56
|
shouldKeepSelectedItemPosition,
|
|
@@ -54,6 +59,7 @@ const getDropdownSearchString = ({
|
|
|
54
59
|
const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
55
60
|
container,
|
|
56
61
|
customFilter,
|
|
62
|
+
customSortFunction,
|
|
57
63
|
dropdownDirection,
|
|
58
64
|
inputProps,
|
|
59
65
|
isInvalid = false,
|
|
@@ -159,6 +165,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
159
165
|
}) => {
|
|
160
166
|
const newList = filterSearchBoxItems({
|
|
161
167
|
customFilter,
|
|
168
|
+
customSortFunction,
|
|
162
169
|
items: list,
|
|
163
170
|
searchString: dropdownSearchString,
|
|
164
171
|
shouldUseCustomFilterOnly
|
|
@@ -190,7 +197,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
190
197
|
}));
|
|
191
198
|
setMatchingListsItems(filteredMatchingListItems);
|
|
192
199
|
return newLists;
|
|
193
|
-
}, [groups, lists, customFilter, dropdownSearchString, shouldAddInputToList, shouldUseCustomFilterOnly]);
|
|
200
|
+
}, [groups, lists, customFilter, customSortFunction, dropdownSearchString, shouldAddInputToList, shouldUseCustomFilterOnly]);
|
|
194
201
|
const handleOpen = (0, _react.useCallback)(() => {
|
|
195
202
|
setShouldShowBody(true);
|
|
196
203
|
}, []);
|
|
@@ -279,6 +286,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
279
286
|
}) => {
|
|
280
287
|
const newList = filterSearchBoxItems({
|
|
281
288
|
customFilter,
|
|
289
|
+
customSortFunction,
|
|
282
290
|
items: list,
|
|
283
291
|
searchString: dropdownSearchString,
|
|
284
292
|
shouldUseCustomFilterOnly
|
|
@@ -313,7 +321,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
313
321
|
handleOpen();
|
|
314
322
|
}
|
|
315
323
|
}
|
|
316
|
-
}, [shouldShowContentOnEmptyInput, activeList, shouldAddInputToList, hintText, dropdownSearchString, customFilter, shouldUseCustomFilterOnly, handleOpen, inputProps]);
|
|
324
|
+
}, [shouldShowContentOnEmptyInput, activeList, shouldAddInputToList, hintText, dropdownSearchString, customFilter, customSortFunction, shouldUseCustomFilterOnly, handleOpen, inputProps]);
|
|
317
325
|
const handleKeyDown = (0, _react.useCallback)(event => {
|
|
318
326
|
if (typeof onKeyDown === 'function') {
|
|
319
327
|
onKeyDown(event);
|
|
@@ -335,6 +343,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
335
343
|
}) => {
|
|
336
344
|
const newList = filterSearchBoxItems({
|
|
337
345
|
customFilter,
|
|
346
|
+
customSortFunction,
|
|
338
347
|
items: list,
|
|
339
348
|
searchString: dropdownSearchString,
|
|
340
349
|
shouldUseCustomFilterOnly
|
|
@@ -365,7 +374,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
365
374
|
});
|
|
366
375
|
});
|
|
367
376
|
}
|
|
368
|
-
}, [inputToListValue, activeList, shouldAddInputToList, shouldShowContentOnEmptyInput, dropdownSearchString, customFilter, shouldUseCustomFilterOnly]);
|
|
377
|
+
}, [inputToListValue, activeList, shouldAddInputToList, shouldShowContentOnEmptyInput, dropdownSearchString, customFilter, customSortFunction, shouldUseCustomFilterOnly]);
|
|
369
378
|
const handleClick = (0, _react.useCallback)(() => {
|
|
370
379
|
if (shouldShowBody) {
|
|
371
380
|
handleClose();
|
|
@@ -400,6 +409,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
400
409
|
}) => {
|
|
401
410
|
const newList = filterSearchBoxItems({
|
|
402
411
|
customFilter,
|
|
412
|
+
customSortFunction,
|
|
403
413
|
items: list,
|
|
404
414
|
searchString: event.target.value,
|
|
405
415
|
shouldUseCustomFilterOnly
|
|
@@ -434,7 +444,7 @@ const SearchBox = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
434
444
|
if (typeof (inputProps === null || inputProps === void 0 ? void 0 : inputProps.onChange) === 'function') {
|
|
435
445
|
inputProps.onChange(event);
|
|
436
446
|
}
|
|
437
|
-
}, [activeList, customFilter, handleOpen, inputProps, onChange, shouldAddInputToList, shouldShowContentOnEmptyInput, shouldUseCustomFilterOnly]);
|
|
447
|
+
}, [activeList, customFilter, customSortFunction, handleOpen, inputProps, onChange, shouldAddInputToList, shouldShowContentOnEmptyInput, shouldUseCustomFilterOnly]);
|
|
438
448
|
|
|
439
449
|
/**
|
|
440
450
|
* This function handles the blur event of the input
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_styledComponents","_calculate","_searchBox","_Icon","_interopRequireDefault","_Input","_GroupName","_SearchBoxBody","_SearchBoxItem","_SearchBoxItem2","_SearchBox","_uuid","_DropdownBodyWrapper","_TagInput","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","filterSearchBoxItems","customFilter","items","searchString","shouldUseCustomFilterOnly","searchList","filteredItems","filter","sortSearchBoxItems","getDropdownSearchString","selectedId","shouldKeepSelectedItemPosition","value","SearchBox","forwardRef","container","dropdownDirection","inputProps","isInvalid","leftIcons","lists","maxHeight","onBlur","onChange","onKeyDown","onSelect","placeholder","presetValue","hintText","shouldAddInputToList","shouldHideFilterButtons","shouldShowContentOnEmptyInput","shouldShowSmallItems","shouldShowRoundImage","shouldShowToggleIcon","tagInputSettings","shouldEnableKeyboardHighlighting","ref","matchingListsItems","setMatchingListsItems","useState","selectedImage","setSelectedImage","internalValue","setInternalValue","inputValue","setValue","useCallback","nextValue","height","setHeight","focusedIndex","setFocusedIndex","hasMultipleGroups","setHasMultipleGroups","filteredChildrenArray","setFilteredChildrenArray","inputToListValue","setInputToListValue","groups","setGroups","shouldShowBody","setShouldShowBody","uuid","useUuid","boxRef","useRef","contentRef","inputRef","tagInputRef","hasFocusRef","isAnimatingRef","shouldShowPresetValue","theme","useTheme","dropdownSearchString","isTouch","useDevice","useEffect","filterButtons","useMemo","forEach","groupName","push","id","text","activeList","newLists","list","includes","newMatchingItems","newList","undefined","filteredMatchingListItems","map","item","handleOpen","handleClose","handleFilterButtonsGroupSelect","keys","textArray","calculateContentHeight","selectedItem","find","imageUrl","createElement","StyledSearchBoxItemImage","src","$shouldShowRoundImage","current","handleFocus","event","onFocus","handleKeyDown","toLowerCase","handleClick","rightElement","StyledSearchBoxIcon","onClick","icons","color","leftElement","StyledSearchBoxLeftWrapper","handleChange","filteredLists","target","handleBlur","handleDropdownOutsideClick","_tagInputRef$current","blur","handleContainerBlur","_contentRef$current","nextFocusedElement","relatedTarget","currentContainer","currentTarget","contains","handleSelect","newItem","replace","_tagInputRef$current2","resetValue","content","StyledSearchBoxHintText","index","key","name","listIndex","tabIndex","_contentRef$current2","_childrenArray$find","children","childrenArray","Array","from","newChildren","child","startsWith","filteredChildren","dataset","isgroupname","preventDefault","newIndex","prevElement","newElement","stopPropagation","_element$children$","element","textContent","attributes","_element$children$2","nodeValue","newId","document","addEventListener","removeEventListener","handleKeyPress","keyCode","useImperativeHandle","clear","shouldShowDropdown","trim","StyledSearchBox","onAdd","onRemove","size","shouldAllowMultiple","shouldPreventEnter","tags","anchorElement","direction","onClose","onOutsideClick","shouldShow","onGroupSelect","selectedGroups","displayName","_default","exports"],"sources":["../../../../src/components/search-box/SearchBox.tsx"],"sourcesContent":["import { useDevice } from 'chayns-api';\nimport React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n FocusEvent,\n FocusEventHandler,\n forwardRef,\n KeyboardEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport type { IFilterButtonItem } from '../../types/filterButtons';\nimport type { ISearchBoxItem, ISearchBoxItems } from '../../types/searchBox';\nimport { calculateContentHeight } from '../../utils/calculate';\nimport { searchList, sortSearchBoxItems } from '../../utils/searchBox';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport Input, { type InputProps } from '../input/Input';\nimport GroupName from './group-name/GroupName';\nimport SearchBoxBody from './search-box-body/SearchBoxBody';\nimport SearchBoxItem from './search-box-item/SearchBoxItem';\nimport { StyledSearchBoxItemImage } from './search-box-item/SearchBoxItem.styles';\nimport {\n StyledSearchBox,\n StyledSearchBoxHintText,\n StyledSearchBoxIcon,\n StyledSearchBoxLeftWrapper,\n} from './SearchBox.styles';\nimport { useUuid } from '../../hooks/uuid';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport TagInput, { TagInputProps, TagInputRef } from '../tag-input/TagInput';\nimport type { DropdownDirection } from '../../types/dropdown';\n\nexport interface SearchBoxRef {\n clear: VoidFunction;\n}\n\nexport interface TagInputSettings {\n onAdd?: TagInputProps['onAdd'];\n onRemove?: TagInputProps['onRemove'];\n size?: TagInputProps['size'];\n shouldAllowMultiple?: TagInputProps['shouldAllowMultiple'];\n tags?: TagInputProps['tags'];\n}\n\nconst filterSearchBoxItems = ({\n customFilter,\n items,\n searchString,\n shouldUseCustomFilterOnly,\n}: {\n customFilter?: (item: ISearchBoxItem) => boolean;\n items: ISearchBoxItem[];\n searchString: string;\n shouldUseCustomFilterOnly?: boolean;\n}) => {\n if (typeof customFilter !== 'function') {\n return searchList({ items, searchString });\n }\n\n if (shouldUseCustomFilterOnly) {\n const filteredItems = items.filter(customFilter);\n\n return sortSearchBoxItems({ items: filteredItems, searchString });\n }\n\n return searchList({ items, searchString }).filter(customFilter);\n};\n\nconst getDropdownSearchString = ({\n selectedId,\n shouldKeepSelectedItemPosition,\n value,\n}: {\n selectedId?: string;\n shouldKeepSelectedItemPosition?: boolean;\n value: string;\n}) => (shouldKeepSelectedItemPosition && selectedId ? '' : value);\n\nexport type SearchBoxProps = {\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n */\n container?: Element;\n /**\n * An optional callback function to filter the elements to be displayed\n */\n customFilter?: (item: ISearchBoxItem) => boolean;\n /**\n * If true, the custom filter replaces the built-in text search instead of narrowing its results.\n */\n shouldUseCustomFilterOnly?: boolean;\n /**\n * The direction in which the dropdown should be displayed. By default, it is displayed below the input.\n */\n dropdownDirection?: DropdownDirection;\n /**\n * If true, the input field is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * An optional icon that is displayed inside the left side of the input.\n */\n leftIcons?: string[];\n /**\n * Props that are passed to the underlying Input component.\n */\n inputProps?: InputProps;\n /**\n * List of groups with items that can be searched. It is possible to give only one list; if multiple lists are provided, the 'group name' parameter becomes mandatory.\n */\n lists: ISearchBoxItems[];\n /**\n * The maximum height of the dropdown body in pixels.\n */\n maxHeight?: number;\n /**\n * Function to be executed when the input lost focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when an item is selected.\n */\n onSelect?: (item: ISearchBoxItem) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * Set an input for the search box - it is not an item of a list, just a string.\n */\n presetValue?: string;\n /**\n * Control the selected item. If you use this prop, make sure to update it when the user selects an item.\n */\n selectedId?: string;\n /**\n * If true, the selected item keeps its original position in the dropdown list.\n */\n shouldKeepSelectedItemPosition?: boolean;\n /**\n * If true, the value in the Input is displayed in the list.\n */\n shouldAddInputToList: boolean;\n /**\n * If true, the filter buttons are hidden.\n */\n shouldHideFilterButtons?: boolean;\n /**\n * Whether the full list of items should be displayed if the input is empty.\n */\n shouldShowContentOnEmptyInput?: boolean;\n /**\n * If true, the dropdown items are displayed more compactly.\n */\n shouldShowSmallItems?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the icon to open and close the list should be displayed.\n */\n shouldShowToggleIcon?: boolean;\n /**\n * Settings for the TagInput.\n */\n tagInputSettings?: TagInputSettings;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * A text that should be displayed if no results are found.\n */\n hintText?: string;\n};\n\nconst SearchBox: FC<SearchBoxProps> = forwardRef<SearchBoxRef, SearchBoxProps>(\n (\n {\n container,\n customFilter,\n dropdownDirection,\n inputProps,\n isInvalid = false,\n leftIcons,\n lists,\n maxHeight = 300,\n onBlur,\n onChange,\n onKeyDown,\n onSelect,\n placeholder,\n presetValue,\n hintText,\n selectedId,\n shouldAddInputToList = true,\n shouldKeepSelectedItemPosition = false,\n shouldUseCustomFilterOnly = false,\n shouldHideFilterButtons = false,\n shouldShowContentOnEmptyInput = true,\n shouldShowSmallItems = false,\n shouldShowRoundImage,\n shouldShowToggleIcon = false,\n tagInputSettings,\n shouldEnableKeyboardHighlighting,\n },\n ref,\n ) => {\n const [matchingListsItems, setMatchingListsItems] = useState<ISearchBoxItems[]>(lists);\n const [selectedImage, setSelectedImage] = useState<ReactElement>();\n const [internalValue, setInternalValue] = useState(\n typeof presetValue === 'string' && presetValue !== '' ? presetValue : '',\n );\n const inputValue = inputProps?.value;\n const value = inputValue ?? internalValue;\n const setValue = useCallback(\n (nextValue: string) => {\n if (typeof inputValue !== 'string') {\n setInternalValue(nextValue);\n }\n },\n [inputValue],\n );\n const [height, setHeight] = useState<number>(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [hasMultipleGroups, setHasMultipleGroups] = useState<boolean>(lists.length > 1);\n const [filteredChildrenArray, setFilteredChildrenArray] = useState<Element[]>();\n const [inputToListValue, setInputToListValue] = useState<string>('');\n const [groups, setGroups] = useState<string[]>(['all']);\n const [shouldShowBody, setShouldShowBody] = useState(false);\n\n const uuid = useUuid();\n\n const boxRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement | null>(null);\n const tagInputRef = useRef<TagInputRef>(null);\n\n const hasFocusRef = useRef<boolean>(false);\n const isAnimatingRef = useRef<boolean>(false);\n const shouldShowPresetValue = useRef<boolean>(\n typeof presetValue === 'string' && presetValue !== '',\n );\n\n const theme = useTheme() as Theme;\n const dropdownSearchString = getDropdownSearchString({\n selectedId,\n shouldKeepSelectedItemPosition,\n value,\n });\n\n const { isTouch } = useDevice();\n\n /**\n * Checks if there are multiple groups in the lists\n */\n useEffect(() => {\n setHasMultipleGroups(lists.length > 1);\n }, [lists]);\n\n const filterButtons = useMemo(() => {\n const items: IFilterButtonItem[] = [];\n\n if (lists.length <= 1) {\n return items;\n }\n\n lists.forEach(({ groupName }) => {\n if (groupName) {\n items.push({\n id: groupName,\n text: groupName,\n });\n }\n });\n\n return items;\n }, [lists]);\n\n /**\n * Filters the lists by the FilterButtons\n */\n const activeList = useMemo(() => {\n let newLists: ISearchBoxItems[] = [];\n\n if (groups[0] === 'all') {\n newLists = lists;\n } else {\n lists.forEach((list) => {\n if (list.groupName && groups.includes(list.groupName)) {\n newLists.push(list);\n }\n });\n }\n\n const newMatchingItems: ISearchBoxItems[] = [];\n\n newLists.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n const filteredMatchingListItems = newMatchingItems.map(({ list, groupName }) => ({\n groupName,\n list: list.filter((item) => {\n if (typeof customFilter === 'function' && shouldUseCustomFilterOnly) {\n return true;\n }\n\n return !(newMatchingItems.length === 1 && item.text === dropdownSearchString);\n }),\n }));\n\n setMatchingListsItems(filteredMatchingListItems);\n\n return newLists;\n }, [\n groups,\n lists,\n customFilter,\n dropdownSearchString,\n shouldAddInputToList,\n shouldUseCustomFilterOnly,\n ]);\n\n const handleOpen = useCallback(() => {\n setShouldShowBody(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setShouldShowBody(false);\n }, []);\n\n const handleFilterButtonsGroupSelect = (keys: string[]) => {\n setGroups(keys.length === 0 ? ['all'] : keys);\n };\n\n /**\n * This hook calculates the height\n */\n useEffect(() => {\n const textArray: string[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n list.forEach(({ text }) => textArray.push(text));\n if (!groupName) {\n return;\n }\n textArray.push(groupName);\n });\n\n if (shouldAddInputToList && inputToListValue !== '') {\n textArray.push(inputToListValue);\n }\n\n setHeight(calculateContentHeight(textArray));\n }, [inputToListValue, activeList, placeholder, shouldAddInputToList]);\n\n useEffect(() => {\n if (selectedId) {\n activeList.forEach(({ list }) => {\n const selectedItem = list.find(({ id }) => id === selectedId);\n if (selectedItem) {\n setValue(selectedItem.text);\n\n if (selectedItem.imageUrl) {\n setSelectedImage(\n <StyledSearchBoxItemImage\n src={selectedItem.imageUrl}\n $shouldShowRoundImage={shouldShowRoundImage}\n />,\n );\n }\n }\n });\n }\n }, [activeList, selectedId, shouldShowRoundImage]);\n\n /**\n * This hook resets the value if the selectedId changes to undefined. This is an own useEffect because the value\n * should not be reset if the list changes and the selectedId is still undefined.\n */\n useEffect(() => {\n if (!selectedId && !shouldShowPresetValue.current) {\n setValue('');\n }\n }, [selectedId]);\n\n useEffect(() => {\n isAnimatingRef.current = shouldShowBody;\n }, [shouldShowBody]);\n\n useEffect(() => {\n if (\n (matchingListsItems.length !== 0 || hintText) &&\n !isAnimatingRef.current &&\n hasFocusRef.current\n ) {\n handleOpen();\n }\n }, [handleOpen, hintText, matchingListsItems.length]);\n\n /**\n * This function handles the focus event of the input and opens the dropdown if the input\n * should show content on an empty input\n */\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n hasFocusRef.current = true;\n\n if (typeof inputProps?.onFocus === 'function') {\n inputProps.onFocus(event);\n }\n\n if (shouldShowContentOnEmptyInput) {\n const newMatchingItems: ISearchBoxItems[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n const filteredMatchingListItems = newMatchingItems.map(\n ({ list, groupName }) => ({\n groupName,\n list: list.filter((item) => {\n if (\n typeof customFilter === 'function' &&\n shouldUseCustomFilterOnly\n ) {\n return true;\n }\n\n return !(\n newMatchingItems.length === 1 &&\n item.text === dropdownSearchString\n );\n }),\n }),\n );\n\n setMatchingListsItems(filteredMatchingListItems);\n\n if (filteredMatchingListItems.length !== 0 || hintText) {\n handleOpen();\n }\n }\n },\n [\n shouldShowContentOnEmptyInput,\n activeList,\n shouldAddInputToList,\n hintText,\n dropdownSearchString,\n customFilter,\n shouldUseCustomFilterOnly,\n handleOpen,\n inputProps,\n ],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLInputElement>>(\n (event) => {\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n\n if (typeof inputProps?.onKeyDown === 'function') {\n inputProps.onKeyDown(event);\n }\n },\n [inputProps, onKeyDown],\n );\n\n /**\n * This function filters the lists by input\n */\n\n useEffect(() => {\n const newMatchingItems: ISearchBoxItems[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n if (shouldAddInputToList && inputToListValue !== '') {\n newMatchingItems.forEach(({ list }) => {\n list.forEach(({ text }) => {\n if (text.toLowerCase() === inputToListValue.toLowerCase()) {\n setInputToListValue('');\n }\n });\n });\n }\n }, [\n inputToListValue,\n activeList,\n shouldAddInputToList,\n shouldShowContentOnEmptyInput,\n dropdownSearchString,\n customFilter,\n shouldUseCustomFilterOnly,\n ]);\n\n const handleClick = useCallback(() => {\n if (shouldShowBody) {\n handleClose();\n } else {\n handleOpen();\n }\n }, [handleClose, handleOpen, shouldShowBody]);\n\n const rightElement = useMemo(() => {\n if (!shouldShowToggleIcon) {\n return undefined;\n }\n\n return (\n <StyledSearchBoxIcon onClick={handleClick}>\n <Icon icons={['fa fa-chevron-down']} color={theme['006'] as string} />\n </StyledSearchBoxIcon>\n );\n }, [handleClick, shouldShowToggleIcon, theme]);\n\n const leftElement = useMemo(\n () =>\n (leftIcons || selectedImage) && (\n <StyledSearchBoxLeftWrapper>\n {leftIcons && <Icon icons={leftIcons} />}\n {selectedImage && selectedImage}\n </StyledSearchBoxLeftWrapper>\n ),\n [leftIcons, selectedImage],\n );\n\n /**\n * This function handles changes of the input\n */\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const filteredLists: ISearchBoxItems[] = [];\n shouldShowPresetValue.current = false;\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n items: list,\n searchString: event.target.value,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n filteredLists.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (filteredLists.length === 0 && shouldAddInputToList) {\n filteredLists.push({\n groupName: undefined,\n list: [],\n });\n }\n\n setSelectedImage(undefined);\n\n if (!shouldShowContentOnEmptyInput && !event.target.value) {\n setMatchingListsItems([]);\n } else {\n setMatchingListsItems(filteredLists);\n }\n\n if (filteredLists.length !== 0) {\n handleOpen();\n }\n\n setValue(event.target.value);\n setInputToListValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (typeof inputProps?.onChange === 'function') {\n inputProps.onChange(event);\n }\n },\n [\n activeList,\n customFilter,\n handleOpen,\n inputProps,\n onChange,\n shouldAddInputToList,\n shouldShowContentOnEmptyInput,\n shouldUseCustomFilterOnly,\n ],\n );\n\n /**\n * This function handles the blur event of the input\n */\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n hasFocusRef.current = false;\n\n if (typeof onBlur === 'function') {\n onBlur(event);\n }\n\n if (typeof inputProps?.onBlur === 'function') {\n inputProps.onBlur(event);\n }\n },\n [inputProps, onBlur],\n );\n\n const handleDropdownOutsideClick = useCallback(() => {\n tagInputRef.current?.blur();\n\n return hasFocusRef.current && isTouch;\n }, [isTouch]);\n\n const handleContainerBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n const nextFocusedElement = event.relatedTarget as Node | null;\n const currentContainer = event.currentTarget as HTMLElement;\n\n // Check if focus is moving outside the SearchBox container\n // Also check the dropdown content (contentRef) since it's rendered in a portal\n if (\n !nextFocusedElement ||\n (!currentContainer.contains(nextFocusedElement) &&\n !contentRef.current?.contains(nextFocusedElement))\n ) {\n handleClose();\n }\n },\n [handleClose],\n );\n\n /**\n * This function handles the item selection\n */\n const handleSelect = useCallback(\n (item: ISearchBoxItem) => {\n const newItem = {\n ...item,\n text: item.text.replace('<b>', '').replace('</b>', '').replace('</b', ''),\n };\n\n if (tagInputSettings) {\n setValue('');\n setInputToListValue('');\n tagInputRef.current?.resetValue();\n } else {\n setValue(newItem.text);\n }\n\n handleClose();\n\n setSelectedImage(\n newItem.imageUrl ? (\n <StyledSearchBoxItemImage\n src={newItem.imageUrl}\n $shouldShowRoundImage={shouldShowRoundImage}\n />\n ) : undefined,\n );\n\n setMatchingListsItems([]);\n\n if (typeof onSelect === 'function') {\n onSelect(newItem);\n }\n },\n [handleClose, onSelect, shouldShowRoundImage, tagInputSettings],\n );\n\n const content = useMemo(() => {\n if (hintText && matchingListsItems.length === 0) {\n return (\n <StyledSearchBoxHintText>\n {hintText.replace('##value##', value)}\n </StyledSearchBoxHintText>\n );\n }\n\n const items: ReactElement[] = [];\n\n matchingListsItems.forEach(({ groupName, list }, index) => {\n if (hasMultipleGroups) {\n if (list.length <= 0) {\n return;\n }\n\n if (index !== 0) {\n items.push(<GroupName key={groupName} name={groupName ?? ''} />);\n }\n }\n\n list.forEach(({ id, text, imageUrl }, listIndex) => {\n items.push(\n <SearchBoxItem\n key={`${id}_${groupName ?? ''}`}\n id={id}\n text={text}\n imageUrl={imageUrl}\n shouldShowSmallItems={shouldShowSmallItems}\n shouldShowRoundImage={shouldShowRoundImage}\n onSelect={handleSelect}\n groupName={groupName}\n tabIndex={index === 0 && listIndex === 0 ? 0 : -1}\n />,\n );\n });\n });\n\n if (shouldAddInputToList && inputToListValue !== '') {\n items.push(\n <SearchBoxItem\n id=\"input-value\"\n onSelect={handleSelect}\n shouldShowSmallItems={shouldShowSmallItems}\n text={`<b>${inputToListValue}</b`}\n tabIndex={items.length === 0 ? 0 : -1}\n />,\n );\n }\n\n return items;\n }, [\n hintText,\n matchingListsItems,\n shouldAddInputToList,\n inputToListValue,\n value,\n hasMultipleGroups,\n shouldShowSmallItems,\n shouldShowRoundImage,\n handleSelect,\n ]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!shouldShowBody || matchingListsItems.length === 0) {\n return;\n }\n\n const children = contentRef.current?.children;\n\n if (!children) {\n return;\n }\n\n const childrenArray = Array.from(children);\n\n const newChildren = childrenArray.find((child) =>\n child.id.startsWith('searchBoxContent__'),\n )?.children;\n\n if (!(newChildren && newChildren.length > 0)) {\n return;\n }\n\n const filteredChildren = Array.from(newChildren).filter(\n (child) => (child as HTMLElement).dataset.isgroupname !== 'true',\n );\n\n setFilteredChildrenArray(filteredChildren);\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n if (newChildren && newChildren.length > 0) {\n const newIndex =\n focusedIndex !== null\n ? (focusedIndex +\n (e.key === 'ArrowUp' ? -1 : 1) +\n filteredChildren.length) %\n filteredChildren.length\n : 0;\n\n if (focusedIndex !== null) {\n const prevElement = filteredChildren[focusedIndex] as HTMLDivElement;\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const newElement = filteredChildren[newIndex] as HTMLDivElement;\n\n newElement.tabIndex = 0;\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n\n if (filteredChildren) {\n const element = filteredChildren[focusedIndex ?? 0];\n\n if (!element) {\n return;\n }\n\n const { id, textContent } = element;\n\n let imageUrl: string | undefined;\n\n // Just Ignore, it works\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (element.children[0]?.attributes.src) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n imageUrl = element.children[0]?.attributes.src.nodeValue as string;\n }\n\n const newId = id.replace('search-box-item__', '');\n\n handleSelect({\n id: newId === 'input-value' ? textContent : newId,\n text: textContent ?? '',\n imageUrl,\n });\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [\n filteredChildrenArray,\n focusedIndex,\n handleSelect,\n matchingListsItems.length,\n shouldShowBody,\n ]);\n\n const handleKeyPress = useCallback((event: KeyboardEvent) => {\n if (event.keyCode === 27) {\n setMatchingListsItems([]);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n clear: () => setValue(''),\n }),\n [setValue],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyPress);\n\n return () => {\n document.addEventListener('keydown', handleKeyPress);\n };\n }, [handleKeyPress]);\n\n /**\n * Update the value if preset value changes\n */\n useEffect(() => {\n if (presetValue) {\n setValue(presetValue);\n }\n }, [presetValue, setValue]);\n\n const shouldShowDropdown =\n shouldShowBody &&\n (matchingListsItems.length !== 0 || !!hintText) &&\n (value.trim() !== '' || shouldShowContentOnEmptyInput);\n\n return useMemo(\n () => (\n <StyledSearchBox\n ref={boxRef}\n key={`search-box-${uuid}`}\n onBlur={handleContainerBlur}\n >\n <div id={`search_box_input${uuid}`}>\n {tagInputSettings ? (\n <TagInput\n leftElement={leftElement}\n onAdd={tagInputSettings.onAdd}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onRemove={tagInputSettings.onRemove}\n placeholder={placeholder}\n ref={tagInputRef}\n size={tagInputSettings.size}\n shouldAllowMultiple={tagInputSettings.shouldAllowMultiple}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlighting}\n shouldPreventEnter\n tags={tagInputSettings.tags}\n />\n ) : (\n <Input\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...inputProps}\n isInvalid={isInvalid}\n leftElement={leftElement}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n ref={inputRef}\n rightElement={rightElement}\n shouldEnableKeyboardHighlighting={\n inputProps?.shouldEnableKeyboardHighlighting ??\n shouldEnableKeyboardHighlighting\n }\n value={value}\n />\n )}\n </div>\n {boxRef.current && (\n <DropdownBodyWrapper\n anchorElement={boxRef.current}\n container={container}\n direction={dropdownDirection}\n onClose={handleClose}\n onOutsideClick={handleDropdownOutsideClick}\n shouldShowDropdown={shouldShowDropdown}\n >\n <SearchBoxBody\n filterButtons={filterButtons}\n height={height}\n maxHeight={maxHeight}\n shouldShow={shouldShowDropdown}\n key={`search-box-body-${uuid}`}\n onGroupSelect={handleFilterButtonsGroupSelect}\n ref={contentRef}\n selectedGroups={groups}\n shouldHideFilterButtons={shouldHideFilterButtons}\n >\n {content}\n </SearchBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledSearchBox>\n ),\n [\n container,\n content,\n dropdownDirection,\n filterButtons,\n groups,\n handleBlur,\n handleChange,\n handleClose,\n handleDropdownOutsideClick,\n handleFocus,\n handleKeyDown,\n height,\n inputProps,\n isInvalid,\n leftElement,\n maxHeight,\n onKeyDown,\n placeholder,\n rightElement,\n shouldHideFilterButtons,\n shouldShowDropdown,\n shouldEnableKeyboardHighlighting,\n tagInputSettings,\n uuid,\n value,\n ],\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport default SearchBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAgBA,IAAAG,iBAAA,GAAAH,OAAA;AAGA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,UAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,cAAA,GAAAH,sBAAA,CAAAP,OAAA;AACA,IAAAW,cAAA,GAAAJ,sBAAA,CAAAP,OAAA;AACA,IAAAY,eAAA,GAAAZ,OAAA;AACA,IAAAa,U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AEA,MAAO;IACf5B,SAAS,EAAEA,SAAU;IACrB4K,UAAU,EAAEb,kBAAmB;IAC/BnC,GAAG,EAAE,mBAAmBlF,IAAI,EAAG;IAC/BmI,aAAa,EAAEhG,8BAA+B;IAC9C7D,GAAG,EAAE8B,UAAW;IAChBgI,cAAc,EAAExI,MAAO;IACvB7B,uBAAuB,EAAEA;EAAwB,GAEhDgH,OACU,CACE,CAEZ,CACpB,EACD,CACI/H,SAAS,EACT+H,OAAO,EACP9H,iBAAiB,EACjB+D,aAAa,EACbpB,MAAM,EACNmE,UAAU,EACVH,YAAY,EACZ1B,WAAW,EACX8B,0BAA0B,EAC1BjB,WAAW,EACXG,aAAa,EACbhE,MAAM,EACNhC,UAAU,EACVC,SAAS,EACTuG,WAAW,EACXpG,SAAS,EACTG,SAAS,EACTE,WAAW,EACX0F,YAAY,EACZtF,uBAAuB,EACvBsJ,kBAAkB,EAClBhJ,gCAAgC,EAChCD,gBAAgB,EAChB4B,IAAI,EACJnD,KAAK,CAEb,CAAC;AACL,CACJ,CAAC;AAEDC,SAAS,CAACuL,WAAW,GAAG,WAAW;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA7N,OAAA,GAErBoC,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SearchBox.js","names":["_chaynsApi","require","_react","_interopRequireWildcard","_styledComponents","_calculate","_searchBox","_Icon","_interopRequireDefault","_Input","_GroupName","_SearchBoxBody","_SearchBoxItem","_SearchBoxItem2","_SearchBox","_uuid","_DropdownBodyWrapper","_TagInput","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","filterSearchBoxItems","customFilter","customSortFunction","items","searchString","shouldUseCustomFilterOnly","filteredItems","filter","item","sortSearchBoxItems","searchList","exports","getDropdownSearchString","selectedId","shouldKeepSelectedItemPosition","value","SearchBox","forwardRef","container","dropdownDirection","inputProps","isInvalid","leftIcons","lists","maxHeight","onBlur","onChange","onKeyDown","onSelect","placeholder","presetValue","hintText","shouldAddInputToList","shouldHideFilterButtons","shouldShowContentOnEmptyInput","shouldShowSmallItems","shouldShowRoundImage","shouldShowToggleIcon","tagInputSettings","shouldEnableKeyboardHighlighting","ref","matchingListsItems","setMatchingListsItems","useState","selectedImage","setSelectedImage","internalValue","setInternalValue","inputValue","setValue","useCallback","nextValue","height","setHeight","focusedIndex","setFocusedIndex","hasMultipleGroups","setHasMultipleGroups","filteredChildrenArray","setFilteredChildrenArray","inputToListValue","setInputToListValue","groups","setGroups","shouldShowBody","setShouldShowBody","uuid","useUuid","boxRef","useRef","contentRef","inputRef","tagInputRef","hasFocusRef","isAnimatingRef","shouldShowPresetValue","theme","useTheme","dropdownSearchString","isTouch","useDevice","useEffect","filterButtons","useMemo","forEach","groupName","push","id","text","activeList","newLists","list","includes","newMatchingItems","newList","undefined","filteredMatchingListItems","map","handleOpen","handleClose","handleFilterButtonsGroupSelect","keys","textArray","calculateContentHeight","selectedItem","find","imageUrl","createElement","StyledSearchBoxItemImage","src","$shouldShowRoundImage","current","handleFocus","event","onFocus","handleKeyDown","toLowerCase","handleClick","rightElement","StyledSearchBoxIcon","onClick","icons","color","leftElement","StyledSearchBoxLeftWrapper","handleChange","filteredLists","target","handleBlur","handleDropdownOutsideClick","_tagInputRef$current","blur","handleContainerBlur","_contentRef$current","nextFocusedElement","relatedTarget","currentContainer","currentTarget","contains","handleSelect","newItem","replace","_tagInputRef$current2","resetValue","content","StyledSearchBoxHintText","index","key","name","listIndex","tabIndex","_contentRef$current2","_childrenArray$find","children","childrenArray","Array","from","newChildren","child","startsWith","filteredChildren","dataset","isgroupname","preventDefault","newIndex","prevElement","newElement","stopPropagation","_element$children$","element","textContent","attributes","_element$children$2","nodeValue","newId","document","addEventListener","removeEventListener","handleKeyPress","keyCode","useImperativeHandle","clear","shouldShowDropdown","trim","StyledSearchBox","onAdd","onRemove","size","shouldAllowMultiple","shouldPreventEnter","tags","anchorElement","direction","onClose","onOutsideClick","shouldShow","onGroupSelect","selectedGroups","displayName","_default"],"sources":["../../../../src/components/search-box/SearchBox.tsx"],"sourcesContent":["import { useDevice } from 'chayns-api';\nimport React, {\n ChangeEvent,\n ChangeEventHandler,\n FC,\n FocusEvent,\n FocusEventHandler,\n forwardRef,\n KeyboardEventHandler,\n ReactElement,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport type { IFilterButtonItem } from '../../types/filterButtons';\nimport type { ISearchBoxItem, ISearchBoxItems } from '../../types/searchBox';\nimport { calculateContentHeight } from '../../utils/calculate';\nimport { searchList, sortSearchBoxItems, type SearchBoxSortFunction } from '../../utils/searchBox';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport Input, { type InputProps } from '../input/Input';\nimport GroupName from './group-name/GroupName';\nimport SearchBoxBody from './search-box-body/SearchBoxBody';\nimport SearchBoxItem from './search-box-item/SearchBoxItem';\nimport { StyledSearchBoxItemImage } from './search-box-item/SearchBoxItem.styles';\nimport {\n StyledSearchBox,\n StyledSearchBoxHintText,\n StyledSearchBoxIcon,\n StyledSearchBoxLeftWrapper,\n} from './SearchBox.styles';\nimport { useUuid } from '../../hooks/uuid';\nimport DropdownBodyWrapper from '../dropdown-body-wrapper/DropdownBodyWrapper';\nimport TagInput, { TagInputProps, TagInputRef } from '../tag-input/TagInput';\nimport type { DropdownDirection } from '../../types/dropdown';\n\nexport interface SearchBoxRef {\n clear: VoidFunction;\n}\n\nexport interface TagInputSettings {\n onAdd?: TagInputProps['onAdd'];\n onRemove?: TagInputProps['onRemove'];\n size?: TagInputProps['size'];\n shouldAllowMultiple?: TagInputProps['shouldAllowMultiple'];\n tags?: TagInputProps['tags'];\n}\n\nexport const filterSearchBoxItems = ({\n customFilter,\n customSortFunction,\n items,\n searchString,\n shouldUseCustomFilterOnly,\n}: {\n customFilter?: (item: ISearchBoxItem, value: string) => boolean;\n customSortFunction?: SearchBoxSortFunction;\n items: ISearchBoxItem[];\n searchString: string;\n shouldUseCustomFilterOnly?: boolean;\n}) => {\n if (shouldUseCustomFilterOnly) {\n const filteredItems =\n typeof customFilter === 'function'\n ? items.filter((item) => customFilter(item, searchString))\n : items;\n\n return sortSearchBoxItems({ customSortFunction, items: filteredItems, searchString });\n }\n\n if (typeof customFilter !== 'function') {\n return searchList({ customSortFunction, items, searchString });\n }\n\n return searchList({ customSortFunction, items, searchString }).filter((item) =>\n customFilter(item, searchString),\n );\n};\n\nconst getDropdownSearchString = ({\n selectedId,\n shouldKeepSelectedItemPosition,\n value,\n}: {\n selectedId?: string;\n shouldKeepSelectedItemPosition?: boolean;\n value: string;\n}) => (shouldKeepSelectedItemPosition && selectedId ? '' : value);\n\nexport type SearchBoxProps = {\n /**\n * The element where the content of the `ComboBox` should be rendered via React Portal.\n */\n container?: Element;\n /**\n * An optional callback function to filter the elements to be displayed\n * @param item The item to filter.\n * @param value The current input value.\n */\n customFilter?: (item: ISearchBoxItem, value: string) => boolean;\n /**\n * An optional callback function to sort the filtered elements to be displayed\n */\n customSortFunction?: SearchBoxSortFunction;\n /**\n * If true, the custom filter replaces the built-in text search instead of narrowing its results.\n */\n shouldUseCustomFilterOnly?: boolean;\n /**\n * The direction in which the dropdown should be displayed. By default, it is displayed below the input.\n */\n dropdownDirection?: DropdownDirection;\n /**\n * If true, the input field is marked as invalid\n */\n isInvalid?: boolean;\n /**\n * An optional icon that is displayed inside the left side of the input.\n */\n leftIcons?: string[];\n /**\n * Props that are passed to the underlying Input component.\n */\n inputProps?: InputProps;\n /**\n * List of groups with items that can be searched. It is possible to give only one list; if multiple lists are provided, the 'group name' parameter becomes mandatory.\n */\n lists: ISearchBoxItems[];\n /**\n * The maximum height of the dropdown body in pixels.\n */\n maxHeight?: number;\n /**\n * Function to be executed when the input lost focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when the input is changed.\n */\n onChange?: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a letter is pressed\n */\n onKeyDown?: KeyboardEventHandler<HTMLInputElement>;\n /**\n * Function to be executed when an item is selected.\n */\n onSelect?: (item: ISearchBoxItem) => void;\n /**\n * The placeholder that should be displayed.\n */\n placeholder?: string;\n /**\n * Set an input for the search box - it is not an item of a list, just a string.\n */\n presetValue?: string;\n /**\n * Control the selected item. If you use this prop, make sure to update it when the user selects an item.\n */\n selectedId?: string;\n /**\n * If true, the selected item keeps its original position in the dropdown list.\n */\n shouldKeepSelectedItemPosition?: boolean;\n /**\n * If true, the value in the Input is displayed in the list.\n */\n shouldAddInputToList: boolean;\n /**\n * If true, the filter buttons are hidden.\n */\n shouldHideFilterButtons?: boolean;\n /**\n * Whether the full list of items should be displayed if the input is empty.\n */\n shouldShowContentOnEmptyInput?: boolean;\n /**\n * If true, the dropdown items are displayed more compactly.\n */\n shouldShowSmallItems?: boolean;\n /**\n * If true, the images of the items are displayed in a round shape.\n */\n shouldShowRoundImage?: boolean;\n /**\n * Whether the icon to open and close the list should be displayed.\n */\n shouldShowToggleIcon?: boolean;\n /**\n * Settings for the TagInput.\n */\n tagInputSettings?: TagInputSettings;\n /**\n * Enables keyboard-only focus highlighting.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * A text that should be displayed if no results are found.\n */\n hintText?: string;\n};\n\nconst SearchBox: FC<SearchBoxProps> = forwardRef<SearchBoxRef, SearchBoxProps>(\n (\n {\n container,\n customFilter,\n customSortFunction,\n dropdownDirection,\n inputProps,\n isInvalid = false,\n leftIcons,\n lists,\n maxHeight = 300,\n onBlur,\n onChange,\n onKeyDown,\n onSelect,\n placeholder,\n presetValue,\n hintText,\n selectedId,\n shouldAddInputToList = true,\n shouldKeepSelectedItemPosition = false,\n shouldUseCustomFilterOnly = false,\n shouldHideFilterButtons = false,\n shouldShowContentOnEmptyInput = true,\n shouldShowSmallItems = false,\n shouldShowRoundImage,\n shouldShowToggleIcon = false,\n tagInputSettings,\n shouldEnableKeyboardHighlighting,\n },\n ref,\n ) => {\n const [matchingListsItems, setMatchingListsItems] = useState<ISearchBoxItems[]>(lists);\n const [selectedImage, setSelectedImage] = useState<ReactElement>();\n const [internalValue, setInternalValue] = useState(\n typeof presetValue === 'string' && presetValue !== '' ? presetValue : '',\n );\n const inputValue = inputProps?.value;\n const value = inputValue ?? internalValue;\n const setValue = useCallback(\n (nextValue: string) => {\n if (typeof inputValue !== 'string') {\n setInternalValue(nextValue);\n }\n },\n [inputValue],\n );\n const [height, setHeight] = useState<number>(0);\n const [focusedIndex, setFocusedIndex] = useState<number | null>(null);\n const [hasMultipleGroups, setHasMultipleGroups] = useState<boolean>(lists.length > 1);\n const [filteredChildrenArray, setFilteredChildrenArray] = useState<Element[]>();\n const [inputToListValue, setInputToListValue] = useState<string>('');\n const [groups, setGroups] = useState<string[]>(['all']);\n const [shouldShowBody, setShouldShowBody] = useState(false);\n\n const uuid = useUuid();\n\n const boxRef = useRef<HTMLDivElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement | null>(null);\n const tagInputRef = useRef<TagInputRef>(null);\n\n const hasFocusRef = useRef<boolean>(false);\n const isAnimatingRef = useRef<boolean>(false);\n const shouldShowPresetValue = useRef<boolean>(\n typeof presetValue === 'string' && presetValue !== '',\n );\n\n const theme = useTheme() as Theme;\n const dropdownSearchString = getDropdownSearchString({\n selectedId,\n shouldKeepSelectedItemPosition,\n value,\n });\n\n const { isTouch } = useDevice();\n\n /**\n * Checks if there are multiple groups in the lists\n */\n useEffect(() => {\n setHasMultipleGroups(lists.length > 1);\n }, [lists]);\n\n const filterButtons = useMemo(() => {\n const items: IFilterButtonItem[] = [];\n\n if (lists.length <= 1) {\n return items;\n }\n\n lists.forEach(({ groupName }) => {\n if (groupName) {\n items.push({\n id: groupName,\n text: groupName,\n });\n }\n });\n\n return items;\n }, [lists]);\n\n /**\n * Filters the lists by the FilterButtons\n */\n const activeList = useMemo(() => {\n let newLists: ISearchBoxItems[] = [];\n\n if (groups[0] === 'all') {\n newLists = lists;\n } else {\n lists.forEach((list) => {\n if (list.groupName && groups.includes(list.groupName)) {\n newLists.push(list);\n }\n });\n }\n\n const newMatchingItems: ISearchBoxItems[] = [];\n\n newLists.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n customSortFunction,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n const filteredMatchingListItems = newMatchingItems.map(({ list, groupName }) => ({\n groupName,\n list: list.filter((item) => {\n if (typeof customFilter === 'function' && shouldUseCustomFilterOnly) {\n return true;\n }\n\n return !(newMatchingItems.length === 1 && item.text === dropdownSearchString);\n }),\n }));\n\n setMatchingListsItems(filteredMatchingListItems);\n\n return newLists;\n }, [\n groups,\n lists,\n customFilter,\n customSortFunction,\n dropdownSearchString,\n shouldAddInputToList,\n shouldUseCustomFilterOnly,\n ]);\n\n const handleOpen = useCallback(() => {\n setShouldShowBody(true);\n }, []);\n\n const handleClose = useCallback(() => {\n setShouldShowBody(false);\n }, []);\n\n const handleFilterButtonsGroupSelect = (keys: string[]) => {\n setGroups(keys.length === 0 ? ['all'] : keys);\n };\n\n /**\n * This hook calculates the height\n */\n useEffect(() => {\n const textArray: string[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n list.forEach(({ text }) => textArray.push(text));\n if (!groupName) {\n return;\n }\n textArray.push(groupName);\n });\n\n if (shouldAddInputToList && inputToListValue !== '') {\n textArray.push(inputToListValue);\n }\n\n setHeight(calculateContentHeight(textArray));\n }, [inputToListValue, activeList, placeholder, shouldAddInputToList]);\n\n useEffect(() => {\n if (selectedId) {\n activeList.forEach(({ list }) => {\n const selectedItem = list.find(({ id }) => id === selectedId);\n if (selectedItem) {\n setValue(selectedItem.text);\n\n if (selectedItem.imageUrl) {\n setSelectedImage(\n <StyledSearchBoxItemImage\n src={selectedItem.imageUrl}\n $shouldShowRoundImage={shouldShowRoundImage}\n />,\n );\n }\n }\n });\n }\n }, [activeList, selectedId, shouldShowRoundImage]);\n\n /**\n * This hook resets the value if the selectedId changes to undefined. This is an own useEffect because the value\n * should not be reset if the list changes and the selectedId is still undefined.\n */\n useEffect(() => {\n if (!selectedId && !shouldShowPresetValue.current) {\n setValue('');\n }\n }, [selectedId]);\n\n useEffect(() => {\n isAnimatingRef.current = shouldShowBody;\n }, [shouldShowBody]);\n\n useEffect(() => {\n if (\n (matchingListsItems.length !== 0 || hintText) &&\n !isAnimatingRef.current &&\n hasFocusRef.current\n ) {\n handleOpen();\n }\n }, [handleOpen, hintText, matchingListsItems.length]);\n\n /**\n * This function handles the focus event of the input and opens the dropdown if the input\n * should show content on an empty input\n */\n const handleFocus = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n hasFocusRef.current = true;\n\n if (typeof inputProps?.onFocus === 'function') {\n inputProps.onFocus(event);\n }\n\n if (shouldShowContentOnEmptyInput) {\n const newMatchingItems: ISearchBoxItems[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n customSortFunction,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n const filteredMatchingListItems = newMatchingItems.map(\n ({ list, groupName }) => ({\n groupName,\n list: list.filter((item) => {\n if (\n typeof customFilter === 'function' &&\n shouldUseCustomFilterOnly\n ) {\n return true;\n }\n\n return !(\n newMatchingItems.length === 1 &&\n item.text === dropdownSearchString\n );\n }),\n }),\n );\n\n setMatchingListsItems(filteredMatchingListItems);\n\n if (filteredMatchingListItems.length !== 0 || hintText) {\n handleOpen();\n }\n }\n },\n [\n shouldShowContentOnEmptyInput,\n activeList,\n shouldAddInputToList,\n hintText,\n dropdownSearchString,\n customFilter,\n customSortFunction,\n shouldUseCustomFilterOnly,\n handleOpen,\n inputProps,\n ],\n );\n\n const handleKeyDown = useCallback<KeyboardEventHandler<HTMLInputElement>>(\n (event) => {\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n }\n\n if (typeof inputProps?.onKeyDown === 'function') {\n inputProps.onKeyDown(event);\n }\n },\n [inputProps, onKeyDown],\n );\n\n /**\n * This function filters the lists by input\n */\n\n useEffect(() => {\n const newMatchingItems: ISearchBoxItems[] = [];\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n customSortFunction,\n items: list,\n searchString: dropdownSearchString,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n newMatchingItems.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (newMatchingItems.length === 0 && shouldAddInputToList) {\n newMatchingItems.push({\n groupName: undefined,\n list: [],\n });\n }\n\n if (shouldAddInputToList && inputToListValue !== '') {\n newMatchingItems.forEach(({ list }) => {\n list.forEach(({ text }) => {\n if (text.toLowerCase() === inputToListValue.toLowerCase()) {\n setInputToListValue('');\n }\n });\n });\n }\n }, [\n inputToListValue,\n activeList,\n shouldAddInputToList,\n shouldShowContentOnEmptyInput,\n dropdownSearchString,\n customFilter,\n customSortFunction,\n shouldUseCustomFilterOnly,\n ]);\n\n const handleClick = useCallback(() => {\n if (shouldShowBody) {\n handleClose();\n } else {\n handleOpen();\n }\n }, [handleClose, handleOpen, shouldShowBody]);\n\n const rightElement = useMemo(() => {\n if (!shouldShowToggleIcon) {\n return undefined;\n }\n\n return (\n <StyledSearchBoxIcon onClick={handleClick}>\n <Icon icons={['fa fa-chevron-down']} color={theme['006'] as string} />\n </StyledSearchBoxIcon>\n );\n }, [handleClick, shouldShowToggleIcon, theme]);\n\n const leftElement = useMemo(\n () =>\n (leftIcons || selectedImage) && (\n <StyledSearchBoxLeftWrapper>\n {leftIcons && <Icon icons={leftIcons} />}\n {selectedImage && selectedImage}\n </StyledSearchBoxLeftWrapper>\n ),\n [leftIcons, selectedImage],\n );\n\n /**\n * This function handles changes of the input\n */\n const handleChange = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const filteredLists: ISearchBoxItems[] = [];\n shouldShowPresetValue.current = false;\n\n activeList.forEach(({ list, groupName }) => {\n const newList = filterSearchBoxItems({\n customFilter,\n customSortFunction,\n items: list,\n searchString: event.target.value,\n shouldUseCustomFilterOnly,\n });\n\n if (newList.length > 0) {\n filteredLists.push({\n groupName,\n list: newList,\n });\n }\n });\n\n if (filteredLists.length === 0 && shouldAddInputToList) {\n filteredLists.push({\n groupName: undefined,\n list: [],\n });\n }\n\n setSelectedImage(undefined);\n\n if (!shouldShowContentOnEmptyInput && !event.target.value) {\n setMatchingListsItems([]);\n } else {\n setMatchingListsItems(filteredLists);\n }\n\n if (filteredLists.length !== 0) {\n handleOpen();\n }\n\n setValue(event.target.value);\n setInputToListValue(event.target.value);\n\n if (typeof onChange === 'function') {\n onChange(event);\n }\n\n if (typeof inputProps?.onChange === 'function') {\n inputProps.onChange(event);\n }\n },\n [\n activeList,\n customFilter,\n customSortFunction,\n handleOpen,\n inputProps,\n onChange,\n shouldAddInputToList,\n shouldShowContentOnEmptyInput,\n shouldUseCustomFilterOnly,\n ],\n );\n\n /**\n * This function handles the blur event of the input\n */\n const handleBlur = useCallback(\n (event: FocusEvent<HTMLInputElement>) => {\n hasFocusRef.current = false;\n\n if (typeof onBlur === 'function') {\n onBlur(event);\n }\n\n if (typeof inputProps?.onBlur === 'function') {\n inputProps.onBlur(event);\n }\n },\n [inputProps, onBlur],\n );\n\n const handleDropdownOutsideClick = useCallback(() => {\n tagInputRef.current?.blur();\n\n return hasFocusRef.current && isTouch;\n }, [isTouch]);\n\n const handleContainerBlur = useCallback(\n (event: React.FocusEvent<HTMLDivElement>) => {\n const nextFocusedElement = event.relatedTarget as Node | null;\n const currentContainer = event.currentTarget as HTMLElement;\n\n // Check if focus is moving outside the SearchBox container\n // Also check the dropdown content (contentRef) since it's rendered in a portal\n if (\n !nextFocusedElement ||\n (!currentContainer.contains(nextFocusedElement) &&\n !contentRef.current?.contains(nextFocusedElement))\n ) {\n handleClose();\n }\n },\n [handleClose],\n );\n\n /**\n * This function handles the item selection\n */\n const handleSelect = useCallback(\n (item: ISearchBoxItem) => {\n const newItem = {\n ...item,\n text: item.text.replace('<b>', '').replace('</b>', '').replace('</b', ''),\n };\n\n if (tagInputSettings) {\n setValue('');\n setInputToListValue('');\n tagInputRef.current?.resetValue();\n } else {\n setValue(newItem.text);\n }\n\n handleClose();\n\n setSelectedImage(\n newItem.imageUrl ? (\n <StyledSearchBoxItemImage\n src={newItem.imageUrl}\n $shouldShowRoundImage={shouldShowRoundImage}\n />\n ) : undefined,\n );\n\n setMatchingListsItems([]);\n\n if (typeof onSelect === 'function') {\n onSelect(newItem);\n }\n },\n [handleClose, onSelect, shouldShowRoundImage, tagInputSettings],\n );\n\n const content = useMemo(() => {\n if (hintText && matchingListsItems.length === 0) {\n return (\n <StyledSearchBoxHintText>\n {hintText.replace('##value##', value)}\n </StyledSearchBoxHintText>\n );\n }\n\n const items: ReactElement[] = [];\n\n matchingListsItems.forEach(({ groupName, list }, index) => {\n if (hasMultipleGroups) {\n if (list.length <= 0) {\n return;\n }\n\n if (index !== 0) {\n items.push(<GroupName key={groupName} name={groupName ?? ''} />);\n }\n }\n\n list.forEach(({ id, text, imageUrl }, listIndex) => {\n items.push(\n <SearchBoxItem\n key={`${id}_${groupName ?? ''}`}\n id={id}\n text={text}\n imageUrl={imageUrl}\n shouldShowSmallItems={shouldShowSmallItems}\n shouldShowRoundImage={shouldShowRoundImage}\n onSelect={handleSelect}\n groupName={groupName}\n tabIndex={index === 0 && listIndex === 0 ? 0 : -1}\n />,\n );\n });\n });\n\n if (shouldAddInputToList && inputToListValue !== '') {\n items.push(\n <SearchBoxItem\n id=\"input-value\"\n onSelect={handleSelect}\n shouldShowSmallItems={shouldShowSmallItems}\n text={`<b>${inputToListValue}</b`}\n tabIndex={items.length === 0 ? 0 : -1}\n />,\n );\n }\n\n return items;\n }, [\n hintText,\n matchingListsItems,\n shouldAddInputToList,\n inputToListValue,\n value,\n hasMultipleGroups,\n shouldShowSmallItems,\n shouldShowRoundImage,\n handleSelect,\n ]);\n\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!shouldShowBody || matchingListsItems.length === 0) {\n return;\n }\n\n const children = contentRef.current?.children;\n\n if (!children) {\n return;\n }\n\n const childrenArray = Array.from(children);\n\n const newChildren = childrenArray.find((child) =>\n child.id.startsWith('searchBoxContent__'),\n )?.children;\n\n if (!(newChildren && newChildren.length > 0)) {\n return;\n }\n\n const filteredChildren = Array.from(newChildren).filter(\n (child) => (child as HTMLElement).dataset.isgroupname !== 'true',\n );\n\n setFilteredChildrenArray(filteredChildren);\n\n if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n\n if (newChildren && newChildren.length > 0) {\n const newIndex =\n focusedIndex !== null\n ? (focusedIndex +\n (e.key === 'ArrowUp' ? -1 : 1) +\n filteredChildren.length) %\n filteredChildren.length\n : 0;\n\n if (focusedIndex !== null) {\n const prevElement = filteredChildren[focusedIndex] as HTMLDivElement;\n prevElement.tabIndex = -1;\n }\n\n setFocusedIndex(newIndex);\n\n const newElement = filteredChildren[newIndex] as HTMLDivElement;\n\n newElement.tabIndex = 0;\n }\n } else if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n e.stopPropagation();\n\n if (filteredChildren) {\n const element = filteredChildren[focusedIndex ?? 0];\n\n if (!element) {\n return;\n }\n\n const { id, textContent } = element;\n\n let imageUrl: string | undefined;\n\n // Just Ignore, it works\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (element.children[0]?.attributes.src) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n imageUrl = element.children[0]?.attributes.src.nodeValue as string;\n }\n\n const newId = id.replace('search-box-item__', '');\n\n handleSelect({\n id: newId === 'input-value' ? textContent : newId,\n text: textContent ?? '',\n imageUrl,\n });\n }\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [\n filteredChildrenArray,\n focusedIndex,\n handleSelect,\n matchingListsItems.length,\n shouldShowBody,\n ]);\n\n const handleKeyPress = useCallback((event: KeyboardEvent) => {\n if (event.keyCode === 27) {\n setMatchingListsItems([]);\n }\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n clear: () => setValue(''),\n }),\n [setValue],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyPress);\n\n return () => {\n document.addEventListener('keydown', handleKeyPress);\n };\n }, [handleKeyPress]);\n\n /**\n * Update the value if preset value changes\n */\n useEffect(() => {\n if (presetValue) {\n setValue(presetValue);\n }\n }, [presetValue, setValue]);\n\n const shouldShowDropdown =\n shouldShowBody &&\n (matchingListsItems.length !== 0 || !!hintText) &&\n (value.trim() !== '' || shouldShowContentOnEmptyInput);\n\n return useMemo(\n () => (\n <StyledSearchBox\n ref={boxRef}\n key={`search-box-${uuid}`}\n onBlur={handleContainerBlur}\n >\n <div id={`search_box_input${uuid}`}>\n {tagInputSettings ? (\n <TagInput\n leftElement={leftElement}\n onAdd={tagInputSettings.onAdd}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onRemove={tagInputSettings.onRemove}\n placeholder={placeholder}\n ref={tagInputRef}\n size={tagInputSettings.size}\n shouldAllowMultiple={tagInputSettings.shouldAllowMultiple}\n shouldEnableKeyboardHighlighting={shouldEnableKeyboardHighlighting}\n shouldPreventEnter\n tags={tagInputSettings.tags}\n />\n ) : (\n <Input\n /* eslint-disable-next-line react/jsx-props-no-spreading */\n {...inputProps}\n isInvalid={isInvalid}\n leftElement={leftElement}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n ref={inputRef}\n rightElement={rightElement}\n shouldEnableKeyboardHighlighting={\n inputProps?.shouldEnableKeyboardHighlighting ??\n shouldEnableKeyboardHighlighting\n }\n value={value}\n />\n )}\n </div>\n {boxRef.current && (\n <DropdownBodyWrapper\n anchorElement={boxRef.current}\n container={container}\n direction={dropdownDirection}\n onClose={handleClose}\n onOutsideClick={handleDropdownOutsideClick}\n shouldShowDropdown={shouldShowDropdown}\n >\n <SearchBoxBody\n filterButtons={filterButtons}\n height={height}\n maxHeight={maxHeight}\n shouldShow={shouldShowDropdown}\n key={`search-box-body-${uuid}`}\n onGroupSelect={handleFilterButtonsGroupSelect}\n ref={contentRef}\n selectedGroups={groups}\n shouldHideFilterButtons={shouldHideFilterButtons}\n >\n {content}\n </SearchBoxBody>\n </DropdownBodyWrapper>\n )}\n </StyledSearchBox>\n ),\n [\n container,\n content,\n dropdownDirection,\n filterButtons,\n groups,\n handleBlur,\n handleChange,\n handleClose,\n handleDropdownOutsideClick,\n handleFocus,\n handleKeyDown,\n height,\n inputProps,\n isInvalid,\n leftElement,\n maxHeight,\n onKeyDown,\n placeholder,\n rightElement,\n shouldHideFilterButtons,\n shouldShowDropdown,\n shouldEnableKeyboardHighlighting,\n tagInputSettings,\n uuid,\n value,\n ],\n );\n },\n);\n\nSearchBox.displayName = 'SearchBox';\n\nexport default SearchBox;\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAgBA,IAAAG,iBAAA,GAAAH,OAAA;AAGA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAEA,IAAAM,KAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAD,sBAA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DC,SAAS,CAACsL,WAAW,GAAG,WAAW;AAAC,IAAAC,QAAA,GAAA5L,OAAA,CAAAlC,OAAA,GAErBuC,SAAS","ignoreList":[]}
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_VerificationBadge","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_Badge2","_container","_useFocusRingPortal","_dropdown","_element","_ref","_Filter","_AnimatedNumber","_FileList","_FileSelect","_DropdownBodyWrapper","_ComboBox","_ContentCard","_CopyableContent","_HighlightSlider","_ContextMenu","_ContextMenu2","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_GroupedImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_ListItem2","_MentionFinder","_MultiActionButton","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingContextMenu","_SharingBar","_SharingButton","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_contentCard","_file","_filterButtons","_MultiActionButton2","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_ComboBox2","_skeleton","_types","_Masonry","_useKeyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { useFocusRingPortal } from './hooks/useFocusRingPortal';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as CopyableContent,\n CopyableContentAppearance,\n type CopyableContentProps,\n} from './components/copyable-content/CopyableContent';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType, getHumanSize } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\nexport { default as Masonry } from './components/masonry/Masonry';\nexport { useKeyboardFocusHighlighting } from './hooks/useKeyboardFocusHighlighting';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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KAAAU,OAAA,EAAAV,CAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Accordion","_interopRequireDefault","require","_AccordionContent","_AccordionGroup","_AccordionIntro","_AccordionItem","_AmountControl","_VerificationBadge","_AreaContextProvider","_interopRequireWildcard","_Badge","_Button","_Checkbox","_ColorSchemeProvider","_Badge2","_container","_useFocusRingPortal","_dropdown","_element","_ref","_Filter","_AnimatedNumber","_FileList","_FileSelect","_DropdownBodyWrapper","_ComboBox","_ContentCard","_CopyableContent","_HighlightSlider","_ContextMenu","_ContextMenu2","_ExpandableContent","_FileInput","_FilterButton","_FilterButtons","_GridImage","_GroupedImage","_Icon","_Input","_List","_ListItemContent","_ListItem","_ListItem2","_MentionFinder","_MultiActionButton","_NumberInput","_PageProvider","_Popup","_PopupContent","_ProgressBar","_popup","_RadioButtonGroup","_RadioButton","_ScrollView","_SearchBox","_SearchInput","_SelectButton","_SetupWizardItem","_SetupWizard","_SharingContextMenu","_SharingBar","_SharingButton","_Signature","_SliderButton","_Slider","_SmallWaitCursor","_TagInput","_TextArea","_Tooltip","_Truncation","_mentionFinder","_contentCard","_file","_filterButtons","_MultiActionButton2","_truncation","_environment","_fileDialog","_isTobitEmployee","_pageProvider","_uploadFile","_ComboBox2","_skeleton","_types","_Masonry","_useKeyboardFocusHighlighting","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/index.ts"],"sourcesContent":["// noinspection JSUnusedGlobalSymbols\n\nexport { default as Accordion } from './components/accordion/Accordion';\nexport { default as AccordionContent } from './components/accordion/accordion-content/AccordionContent';\nexport { default as AccordionGroup } from './components/accordion/accordion-group/AccordionGroup';\nexport { default as AccordionIntro } from './components/accordion/accordion-intro/AccordionIntro';\nexport { default as AccordionItem } from './components/accordion/accordion-item/AccordionItem';\nexport { default as AmountControl } from './components/amount-control/AmountControl';\nexport { default as VerificationBadge } from './components/verification-badge/VerificationBadge';\nexport {\n AreaContext,\n default as AreaProvider,\n} from './components/area-provider/AreaContextProvider';\nexport { default as Badge } from './components/badge/Badge';\nexport { default as Button } from './components/button/Button';\nexport { default as Checkbox } from './components/checkbox/Checkbox';\nexport {\n default as ColorSchemeProvider,\n useColorScheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { BadgeSize, BadgeDesign } from './components/badge/Badge.types';\nexport type {\n ColorSchemeContextProps,\n WithTheme,\n} from './components/color-scheme-provider/ColorSchemeProvider';\nexport { useContainer, ContainerAnchor } from './hooks/container';\nexport { useFocusRingPortal } from './hooks/useFocusRingPortal';\nexport { DropdownDirection, type DropdownCoordinates } from './types/dropdown';\nexport { useIsMeasuredClone } from './hooks/element';\nexport { useCombinedRefs } from './hooks/ref';\nexport { default as Filter, type FilterRightIcon } from './components/filter/Filter';\nexport {\n type SortItem,\n type SearchConfig,\n type SortConfig,\n type CheckboxConfig,\n type FilterButtonConfig,\n type FilterRef,\n} from './types/filter';\nexport { default as AnimatedNumber } from './components/animated-number/AnimatedNumber';\nexport {\n default as FileList,\n type IFileItem as FileListItem,\n} from './components/file-list/FileList';\nexport { default as FileSelect } from './components/file-select/FileSelect';\nexport { default as DropdownBodyWrapper } from './components/dropdown-body-wrapper/DropdownBodyWrapper';\nexport { default as ComboBox } from './components/combobox/ComboBox';\nexport { default as ContentCard } from './components/content-card/ContentCard';\nexport {\n default as CopyableContent,\n CopyableContentAppearance,\n type CopyableContentProps,\n} from './components/copyable-content/CopyableContent';\nexport { default as HighlightSlider } from './components/highlight-slider/HighlightSlider';\nexport type { HighlightSliderItemColors as HighlightSliderColors } from './components/highlight-slider/highlight-slider-item/HighlightSliderItem';\nexport { default as ContextMenu } from './components/context-menu/ContextMenu';\nexport {\n ContextMenuAlignment,\n type ContextMenuCoordinates,\n type ContextMenuItem,\n type ContextMenuProps,\n type ContextMenuRef,\n} from './components/context-menu/ContextMenu.types';\nexport { default as ExpandableContent } from './components/expandable-content/ExpandableContent';\nexport {\n default as FileInput,\n type FileInputRef,\n STREAMINGSERVICE_FILE_TYPES,\n TSIMG_FILE_TYPES,\n} from './components/file-input/FileInput';\nexport { default as FilterButton } from './components/filter-buttons/filter-button/FilterButton';\nexport { default as FilterButtons } from './components/filter-buttons/FilterButtons';\nexport { default as GridImage } from './components/grid-image/GridImage';\nexport { default as GroupedImage } from './components/grouped-image/GroupedImage';\nexport { default as Icon, type IconProps } from './components/icon/Icon';\nexport { default as Input, InputSize } from './components/input/Input';\nexport { default as List } from './components/list/List';\nexport { default as ListItemContent } from './components/list/list-item/list-item-content/ListItemContent';\nexport {\n default as ListItem,\n type ListItemElements,\n type ListItemProps,\n type ListItemRef,\n type ListItemSize,\n} from './components/list/list-item/ListItem';\nexport {\n type ListItemMarkedForwardRefComponent,\n type ListItemMarkedComponent,\n type ListItemMetaProps,\n LIST_ITEM_MARKER,\n withListItemMarker,\n withListItemMarkerForwardRef,\n} from './components/list/list-item/ListItem.utils';\nexport { default as MentionFinder } from './components/mention-finder/MentionFinder';\nexport type { MentionMember } from './components/mention-finder/MentionFinder';\nexport { default as MultiActionButton } from './components/multi-action-button/MultiActionButton';\nexport { default as NumberInput } from './components/number-input/NumberInput';\nexport { default as PageProvider } from './components/page-provider/PageProvider';\nexport { default as Popup } from './components/popup/Popup';\nexport { default as PopupContent } from './components/popup/popup-content/PopupContent';\nexport { default as ProgressBar } from './components/progress-bar/ProgressBar';\nexport { PopupAlignment } from './types/popup';\nexport type { PopupProps } from './components/popup/Popup.types';\nexport {\n default as RadioButtonGroup,\n type RadioButtonGroupRef,\n} from './components/radio-button/radio-button-group/RadioButtonGroup';\nexport { default as RadioButton } from './components/radio-button/RadioButton';\nexport { default as ScrollView } from './components/scroll-view/ScrollView';\nexport { default as SearchBox } from './components/search-box/SearchBox';\nexport { default as SearchInput } from './components/search-input/SearchInput';\nexport { default as SelectButton } from './components/select-button/SelectButton';\nexport { default as SetupWizardItem } from './components/setup-wizard/setup-wizard-item/SetupWizardItem';\nexport { default as SetupWizard } from './components/setup-wizard/SetupWizard';\nexport type { SetupWizardRef } from './components/setup-wizard/SetupWizard';\nexport { default as SharingContextMenu } from './components/sharing-context-menu/SharingContextMenu';\nexport { default as SharingBar } from './components/sharing-bar/SharingBar';\nexport { default as SharingButton } from './components/sharing-button/SharingButton';\nexport { default as Signature } from './components/signature/Signature';\nexport type { SignatureRef } from './components/signature/Signature';\nexport { default as SliderButton } from './components/slider-button/SliderButton';\nexport { default as Slider } from './components/slider/Slider';\nexport {\n default as SmallWaitCursor,\n SmallWaitCursorSize,\n SmallWaitCursorSpeed,\n} from './components/small-wait-cursor/SmallWaitCursor';\nexport type { Tag } from './types/tagInput';\nexport { default as TagInput } from './components/tag-input/TagInput';\nexport type { TagInputRef } from './components/tag-input/TagInput';\nexport { default as TextArea } from './components/text-area/TextArea';\nexport { default as Tooltip } from './components/tooltip/Tooltip';\nexport { default as Truncation } from './components/truncation/Truncation';\nexport { MentionFinderPopupAlignment } from './constants/mentionFinder';\nexport { useElementSize } from './hooks/element';\nexport type { BrowserName } from './types/chayns';\nexport { ContentCardType } from './types/contentCard';\nexport type { FileItem, Image, InternalFileItem, Meta, Video } from './types/file';\nexport { isValidFileType, getHumanSize } from './utils/file';\nexport type { FileInputFileItem } from './types/fileInput';\nexport { FilterButtonItemShape, FilterButtonSize } from './types/filterButtons';\nexport type { IFilterButtonItem as FilterButtonItem } from './types/filterButtons';\nexport type { IListItemRightElements } from './types/list';\nexport type { PopupRef } from './types/popup';\nexport type { RadioButtonItem } from './types/radioButton';\nexport type {\n ISearchBoxItem as SearchBoxItem,\n ISearchBoxItems as SearchBoxItems,\n} from './types/searchBox';\nexport type { SearchBoxSortFunction } from './utils/searchBox';\nexport type { SelectButtonItem } from './types/selectButton';\nexport type { SliderButtonItem } from './types/slider-button';\nexport {\n type MultiActionButtonAction,\n type MultiActionButtonActionEvent,\n type MultiActionButtonActionStatus,\n MultiActionButtonHeight,\n type MultiActionButtonProps,\n type MultiActionButtonSecondaryContextMenu,\n MultiActionButtonStatusType,\n} from './components/multi-action-button/MultiActionButton.types';\nexport { ClampPosition } from './types/truncation';\nexport { useIsTouch } from './utils/environment';\nexport { filterFilesByMimeType, getFileAsArrayBuffer, selectFiles } from './utils/fileDialog';\nexport { isTobitEmployee } from './utils/isTobitEmployee';\nexport { getUsableHeight } from './utils/pageProvider';\nexport { uploadFile } from './utils/uploadFile';\nexport type { Theme } from './components/color-scheme-provider/ColorSchemeProvider';\nexport { ComboBoxSize } from './components/combobox/ComboBox.types';\nexport type {\n IComboBoxItem as ComboBoxItem,\n ComboBoxTextStyles,\n IComboBoxItems as ComboBoxItems,\n ComboBoxRef,\n} from './components/combobox/ComboBox.types';\nexport { default as Skeleton } from './components/skeleton';\nexport { SkeletonAnimationType } from './components/skeleton/types';\nexport { default as Masonry } from './components/masonry/Masonry';\nexport { useKeyboardFocusHighlighting } from './hooks/useKeyboardFocusHighlighting';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
45
45
|
};
|
|
46
46
|
exports.getCurrentGroupName = getCurrentGroupName;
|
|
47
47
|
const sortSearchBoxItems = ({
|
|
48
|
+
customSortFunction,
|
|
48
49
|
searchString,
|
|
49
50
|
items
|
|
50
51
|
}) => {
|
|
52
|
+
if (customSortFunction) {
|
|
53
|
+
return [...items].sort(customSortFunction);
|
|
54
|
+
}
|
|
51
55
|
const lowercaseSearchString = searchString.toLowerCase();
|
|
52
56
|
return [...items].sort((a, b) => {
|
|
53
57
|
const aStartsWithSearchString = a.text.toLowerCase().startsWith(lowercaseSearchString);
|
|
@@ -63,6 +67,7 @@ const sortSearchBoxItems = ({
|
|
|
63
67
|
};
|
|
64
68
|
exports.sortSearchBoxItems = sortSearchBoxItems;
|
|
65
69
|
const searchList = ({
|
|
70
|
+
customSortFunction,
|
|
66
71
|
searchString,
|
|
67
72
|
items
|
|
68
73
|
}) => {
|
|
@@ -84,6 +89,7 @@ const searchList = ({
|
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
91
|
return sortSearchBoxItems({
|
|
92
|
+
customSortFunction,
|
|
87
93
|
items: matchingItems,
|
|
88
94
|
searchString
|
|
89
95
|
});
|