@reportportal/ui-kit 0.0.1-alpha.23 → 0.0.1-alpha.231
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/README.md +29 -3
- package/dist/actionMenu-f8a2f5bb.js +157 -0
- package/dist/actionMenu.js +30 -0
- package/dist/adaptiveTagList.js +189 -0
- package/dist/attachedFile.js +9 -0
- package/dist/autocompletes.js +895 -0
- package/dist/baseIconButton-251479f7.js +25 -0
- package/dist/baseIconButton.js +1 -1
- package/dist/breadcrumbs-5730e318.js +193 -0
- package/dist/breadcrumbs.js +14 -0
- package/dist/bubblesLoader-f3ffa240.js +28 -0
- package/dist/bubblesLoader.js +1 -1
- package/dist/bulkPanel.js +225 -0
- package/dist/button-7ab874f3.js +66 -0
- package/dist/button.js +1 -1
- package/dist/calendarArrow-44c7e60e.js +5 -0
- package/dist/checkbox-76aa8f97.js +73 -0
- package/dist/checkbox.js +1 -1
- package/dist/chevronDownDropdown-0260bb66.js +5 -0
- package/dist/chip.js +72 -0
- package/dist/clear-53660571.js +5 -0
- package/dist/close-4d480ef7.js +5 -0
- package/dist/common/constants/floatingUi.d.ts +8 -0
- package/dist/common/constants/sortable.d.ts +2 -0
- package/dist/common/hooks/index.d.ts +4 -0
- package/dist/common/hooks/useEllipsisTitle.d.ts +6 -0
- package/dist/common/hooks/useOnClickOutside.d.ts +5 -1
- package/dist/common/hooks/useSortable.d.ts +3 -0
- package/dist/common/hooks/useTreeDropValidation.d.ts +5 -0
- package/dist/common/hooks/useTreeSortable.d.ts +3 -0
- package/dist/common/hooks.js +69 -0
- package/dist/common/types/commonTypes.d.ts +4 -0
- package/dist/common/types/index.d.ts +2 -0
- package/dist/common/types/sortableTypes.d.ts +185 -0
- package/dist/common/utils/addMiddleEllipsis.d.ts +1 -0
- package/dist/common/utils/floatingUi.d.ts +3 -0
- package/dist/common/utils/getFileExtension.d.ts +1 -0
- package/dist/common/utils/htmlAttributes.d.ts +20 -0
- package/dist/common/utils/index.d.ts +5 -0
- package/dist/common/utils/isString.d.ts +1 -0
- package/dist/common/utils/testUtils.d.ts +3 -0
- package/dist/common.js +27 -0
- package/dist/components/actionMenu/actionMenu.d.ts +33 -0
- package/dist/components/actionMenu/constants.d.ts +3 -0
- package/dist/components/actionMenu/index.d.ts +18 -0
- package/dist/components/adaptiveTagList/adaptiveTagList.d.ts +11 -0
- package/dist/components/adaptiveTagList/constants.d.ts +6 -0
- package/dist/components/adaptiveTagList/index.d.ts +2 -0
- package/dist/components/attachedFile/attachedFile.d.ts +17 -0
- package/dist/components/attachedFile/index.d.ts +2 -0
- package/dist/components/autocompletes/common/autocompleteMenu/autocompleteMenu.d.ts +13 -0
- package/dist/components/autocompletes/common/autocompleteMenu/index.d.ts +1 -0
- package/dist/components/autocompletes/common/autocompleteOption/autocompleteOption.d.ts +13 -0
- package/dist/components/autocompletes/common/autocompleteOption/index.d.ts +1 -0
- package/dist/components/autocompletes/common/autocompleteOptions.d.ts +22 -0
- package/dist/components/autocompletes/common/autocompletePrompt/autocompletePrompt.d.ts +7 -0
- package/dist/components/autocompletes/common/autocompletePrompt/index.d.ts +1 -0
- package/dist/components/autocompletes/common/index.d.ts +19 -0
- package/dist/components/autocompletes/constants.d.ts +3 -0
- package/dist/components/autocompletes/hooks/usePreventInitialScroll.d.ts +5 -0
- package/dist/components/autocompletes/hooks/useResizeClose.d.ts +11 -0
- package/dist/components/autocompletes/hooks/useScrollClose.d.ts +11 -0
- package/dist/components/autocompletes/index.d.ts +3 -0
- package/dist/components/autocompletes/multipleAutocomplete/index.d.ts +17 -0
- package/dist/components/autocompletes/multipleAutocomplete/multipleAutocomplete.d.ts +56 -0
- package/dist/components/autocompletes/multipleAutocomplete/multipleDownshift.d.ts +26 -0
- package/dist/components/autocompletes/multipleAutocomplete/selectedItems/index.d.ts +1 -0
- package/dist/components/autocompletes/multipleAutocomplete/selectedItems/selectedItems.d.ts +41 -0
- package/dist/components/autocompletes/singleAutocomplete/index.d.ts +1 -0
- package/dist/components/autocompletes/singleAutocomplete/singleAutocomplete.d.ts +54 -0
- package/dist/components/autocompletes/types.d.ts +8 -0
- package/dist/components/autocompletes/utils.d.ts +5 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/baseIconButton.d.ts +1 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/index.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumbs/breadcrumb/index.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/breadcrumbsProvider.d.ts +13 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/hooks.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/index.d.ts +1 -0
- package/dist/components/breadcrumbs/hiddenBreadcrumbs/hiddenBreadcrumbs.d.ts +6 -0
- package/dist/components/breadcrumbs/hiddenBreadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.d.ts +5 -0
- package/dist/components/breadcrumbs/tree/index.d.ts +1 -0
- package/dist/components/breadcrumbs/tree/tree.d.ts +7 -0
- package/dist/components/breadcrumbs/types.d.ts +29 -0
- package/dist/components/bubblesLoader/bubblesLoader.d.ts +2 -0
- package/dist/components/bubblesLoader/index.d.ts +1 -0
- package/dist/components/bulkPanel/bulkPanel.d.ts +3 -0
- package/dist/components/bulkPanel/index.d.ts +2 -0
- package/dist/components/bulkPanel/types.d.ts +47 -0
- package/dist/components/button/button.d.ts +5 -4
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +2 -1
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/chip/chip.d.ts +15 -0
- package/dist/components/chip/index.d.ts +2 -0
- package/dist/components/datePicker/datePicker.d.ts +19 -7
- package/dist/components/datePicker/header/datePickerHeader.d.ts +1 -0
- package/dist/components/datePicker/header/index.d.ts +1 -0
- package/dist/components/datePicker/index.d.ts +3 -1
- package/dist/components/datePicker/utils.d.ts +2 -1
- package/dist/components/dropdown/constants.d.ts +4 -0
- package/dist/components/dropdown/dropdown.d.ts +41 -5
- package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
- package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +2 -0
- package/dist/components/dropdown/types.d.ts +12 -0
- package/dist/components/dropdown/utils.d.ts +6 -2
- package/dist/components/fieldLabel/fieldLabel.d.ts +7 -0
- package/dist/components/fieldLabel/index.d.ts +1 -0
- package/dist/components/fieldNumber/constants.d.ts +3 -1
- package/dist/components/fieldNumber/fieldNumber.d.ts +3 -3
- package/dist/components/fieldNumber/index.d.ts +1 -0
- package/dist/components/fieldText/fieldText.d.ts +12 -4
- package/dist/components/fieldText/index.d.ts +3 -1
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +5 -2
- package/dist/components/fieldTextFlex/index.d.ts +1 -0
- package/dist/components/fileDropArea/attachedFilesList/attachedFilesList.d.ts +21 -0
- package/dist/components/fileDropArea/attachedFilesList/index.d.ts +5 -0
- package/dist/components/fileDropArea/browseButton/browseButton.d.ts +9 -0
- package/dist/components/fileDropArea/browseButton/index.d.ts +4 -0
- package/dist/components/fileDropArea/constants.d.ts +2 -0
- package/dist/components/fileDropArea/dropZone/dropZone.d.ts +10 -0
- package/dist/components/fileDropArea/dropZone/index.d.ts +4 -0
- package/dist/components/fileDropArea/errorMessage/errorMessage.d.ts +5 -0
- package/dist/components/fileDropArea/errorMessage/index.d.ts +4 -0
- package/dist/components/fileDropArea/fileDropArea.d.ts +19 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/fileDropAreaProvider.d.ts +17 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/index.d.ts +1 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/useFileDropAreaContext.d.ts +3 -0
- package/dist/components/fileDropArea/hooks/index.d.ts +1 -0
- package/dist/components/fileDropArea/hooks/useFileDropArea.d.ts +13 -0
- package/dist/components/fileDropArea/hooks/useFileProcessing.d.ts +13 -0
- package/dist/components/fileDropArea/hooks/useOverlayDropArea.d.ts +22 -0
- package/dist/components/fileDropArea/index.d.ts +6 -0
- package/dist/components/fileDropArea/types.d.ts +58 -0
- package/dist/components/fileDropArea/utils/getValidationErrorMessage.d.ts +3 -0
- package/dist/components/fileDropArea/utils/index.d.ts +2 -0
- package/dist/components/fileDropArea/utils/validateFile.d.ts +3 -0
- package/dist/components/filterItem/filterItem.d.ts +18 -0
- package/dist/components/filterItem/index.d.ts +17 -0
- package/dist/components/filtersButton/filtersButton.d.ts +14 -0
- package/dist/components/filtersButton/index.d.ts +2 -0
- package/dist/components/icons/index.d.ts +74 -9
- package/dist/components/index.d.ts +32 -10
- package/dist/components/issueList/constants.d.ts +5 -0
- package/dist/components/issueList/index.d.ts +2 -0
- package/dist/components/issueList/issueList.d.ts +18 -0
- package/dist/components/maxValueDisplay/index.d.ts +4 -0
- package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +8 -0
- package/dist/components/maxValueDisplay/utils/index.d.ts +1 -0
- package/dist/components/maxValueDisplay/utils/isPositiveInteger.d.ts +1 -0
- package/dist/components/modal/index.d.ts +1 -0
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/modal/modalContent/modalContent.d.ts +3 -3
- package/dist/components/modal/modalFooter/modalFooter.d.ts +3 -1
- package/dist/components/modal/modalHeader/modalHeader.d.ts +1 -0
- package/dist/components/modal/types.d.ts +6 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +5 -2
- package/dist/components/pagination/pageControls/activePage/activePage.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageControls.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +6 -2
- package/dist/components/popover/index.d.ts +4 -1
- package/dist/components/popover/popover.d.ts +12 -4
- package/dist/components/radio/index.d.ts +5 -3
- package/dist/components/radio/radio.d.ts +1 -0
- package/dist/components/radio/radioGroup.d.ts +2 -2
- package/dist/components/segmentedControl/index.d.ts +17 -0
- package/dist/components/segmentedControl/segmentedControl.d.ts +4 -0
- package/dist/components/segmentedControl/types.d.ts +18 -0
- package/dist/components/selection/index.d.ts +5 -0
- package/dist/components/selection/selection.d.ts +12 -0
- package/dist/components/selection/types.d.ts +1 -0
- package/dist/components/sidePanel/index.d.ts +2 -0
- package/dist/components/sidePanel/sidePanel.d.ts +22 -0
- package/dist/components/sortable/dragLayer/dragLayer.d.ts +3 -0
- package/dist/components/sortable/dragLayer/index.d.ts +1 -0
- package/dist/components/sortable/helpers.d.ts +12 -0
- package/dist/components/sortable/index.d.ts +5 -0
- package/dist/components/sortable/sortableItem/index.d.ts +1 -0
- package/dist/components/sortable/sortableItem/sortableItem.d.ts +3 -0
- package/dist/components/sortable/sortableList/index.d.ts +1 -0
- package/dist/components/sortable/sortableList/sortableList.d.ts +5 -0
- package/dist/components/sortable/treeSortableContainer/TreeSortableContext.d.ts +11 -0
- package/dist/components/sortable/treeSortableContainer/index.d.ts +2 -0
- package/dist/components/sortable/treeSortableContainer/treeSortableContainer.d.ts +3 -0
- package/dist/components/sortable/treeSortableItem/index.d.ts +1 -0
- package/dist/components/sortable/treeSortableItem/treeSortableItem.d.ts +3 -0
- package/dist/components/spinLoader/index.d.ts +4 -0
- package/dist/components/spinLoader/spinLoader.d.ts +8 -0
- package/dist/components/systemAlert/index.d.ts +1 -0
- package/dist/components/systemAlert/systemAlert.d.ts +4 -0
- package/dist/components/systemAlert/types.d.ts +22 -0
- package/dist/components/systemMessage/index.d.ts +1 -0
- package/dist/components/systemMessage/systemMessage.d.ts +1 -0
- package/dist/components/table/constants.d.ts +6 -0
- package/dist/components/table/gradientOverlay/gradientOverlay.d.ts +19 -0
- package/dist/components/table/gradientOverlay/index.d.ts +2 -0
- package/dist/components/table/hooks/index.d.ts +8 -0
- package/dist/components/table/hooks/useCheckboxRowSync.d.ts +10 -0
- package/dist/components/table/hooks/useColumnResize.d.ts +21 -0
- package/dist/components/table/hooks/useColumnWidths.d.ts +8 -0
- package/dist/components/table/hooks/useGradientPosition.d.ts +24 -0
- package/dist/components/table/hooks/useTableColumns.d.ts +13 -0
- package/dist/components/table/hooks/useTableExpansion.d.ts +15 -0
- package/dist/components/table/hooks/useTableHover.d.ts +10 -0
- package/dist/components/table/index.d.ts +2 -0
- package/dist/components/table/resizeHandle/index.d.ts +1 -0
- package/dist/components/table/resizeHandle/resizeHandle.d.ts +2 -0
- package/dist/components/table/table.d.ts +1 -0
- package/dist/components/table/types.d.ts +45 -9
- package/dist/components/table/utils.d.ts +10 -1
- package/dist/components/themeProvider/index.d.ts +1 -0
- package/dist/components/themeProvider/themeProvider.d.ts +1 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/toggle.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +11 -1
- package/dist/constants-85822a6b.js +6 -0
- package/dist/datePicker-6c001a18.js +229 -0
- package/dist/datePicker.js +38 -0
- package/dist/details-dbb1530b.js +5 -0
- package/dist/dropdown-0260bb66.js +5 -0
- package/dist/dropdown-33f2bf75.js +647 -0
- package/dist/dropdown.js +19 -3
- package/dist/fieldLabel.js +18 -0
- package/dist/fieldNumber-b4aa4d7e.js +141 -0
- package/dist/fieldNumber.js +5 -2
- package/dist/fieldText-1749da7a.js +167 -0
- package/dist/fieldText.js +7 -2
- package/dist/fieldTextFlex-2f51c173.js +80 -0
- package/dist/fieldTextFlex.js +3 -1
- package/dist/fileDropArea.js +325 -0
- package/dist/filterItem.js +89 -0
- package/dist/filterOutline-819b4b0d.js +6 -0
- package/dist/filtersButton.js +77 -0
- package/dist/floatingUi-46f5b896.js +29 -0
- package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
- package/dist/icons.js +100 -0
- package/dist/index-d6e02727.js +129 -0
- package/dist/index.js +203 -242
- package/dist/isEmpty-ccacb5ff.js +38 -0
- package/dist/issueList.js +125 -0
- package/dist/maxValueDisplay-9be01a75.js +13 -0
- package/dist/maxValueDisplay.js +6 -0
- package/dist/minus-2857540f.js +5 -0
- package/dist/modal.js +180 -14
- package/dist/openEye-950159cb.js +6 -0
- package/dist/pagination-53c8a559.js +355 -0
- package/dist/pagination.js +12 -5
- package/dist/plus-199fb2a8.js +5 -0
- package/dist/popover.js +73 -73
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio.js +3 -1
- package/dist/radioGroup-0c132c2e.js +77 -0
- package/dist/resizeColumn-46b5b30f.js +7 -0
- package/dist/segmentedControl.js +62 -0
- package/dist/selection-da1a3528.js +38 -0
- package/dist/selection.js +10 -0
- package/dist/sidePanel.js +136 -0
- package/dist/sortable.js +330 -0
- package/dist/spinLoader-c4a53718.js +11 -0
- package/dist/spinLoader.js +7 -0
- package/dist/style.css +15 -1
- package/dist/success-8fd8bd2c.js +7 -0
- package/dist/systemAlert.js +87 -0
- package/dist/systemMessage-924fdaa6.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-438f1b93.js +1149 -0
- package/dist/table.js +13 -3
- package/dist/toggle-304107fa.js +59 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +96 -57
- package/dist/tree-c3dd3d45.js +6 -0
- package/dist/useEllipsisTitle-462fa254.js +22 -0
- package/dist/useOnClickOutside-8f7d68a1.js +25 -0
- package/dist/useTreeSortable-bc631689.js +208 -0
- package/dist/useWindowResize-a7e1ac92.js +16 -0
- package/dist/warning-537ead32.js +5 -0
- package/dist/xls-995781cc.js +11 -0
- package/package.json +51 -17
- package/dist/baseIconButton-b6adc843.js +0 -25
- package/dist/bubblesLoader-a7e709d4.js +0 -17
- package/dist/button-087f2ed4.js +0 -62
- package/dist/checkbox-6777be17.js +0 -73
- package/dist/dropdown-c21b0d67.js +0 -216
- package/dist/fieldNumber-d20f48d6.js +0 -127
- package/dist/fieldText-6eff8292.js +0 -102
- package/dist/fieldTextFlex-5bddf46a.js +0 -67
- package/dist/index-52b3df93.js +0 -147
- package/dist/pagination-e30cfd70.js +0 -346
- package/dist/radio-c5fae439.js +0 -76
- package/dist/systemMessage-1ced6079.js +0 -30
- package/dist/table-7fdc18e0.js +0 -147
- package/dist/toggle-9284387b.js +0 -67
- package/dist/useOnClickOutside-c332f7d3.js +0 -16
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
import { jsx as r, jsxs as T, Fragment as he } from "react/jsx-runtime";
|
|
2
|
+
import { useState as ne, useRef as Ce, useEffect as we, useCallback as Y, forwardRef as De, useLayoutEffect as je, useMemo as He } from "react";
|
|
3
|
+
import { c as J } from "./bind-06a7ff84.js";
|
|
4
|
+
import { Scrollbars as We } from "rc-scrollbars";
|
|
5
|
+
import { B as Ye } from "./bubblesLoader-f3ffa240.js";
|
|
6
|
+
import { B as Ke } from "./button-7ab874f3.js";
|
|
7
|
+
import { S as Xe } from "./plus-199fb2a8.js";
|
|
8
|
+
import { i as Me } from "./isEmpty-ccacb5ff.js";
|
|
9
|
+
import { createPortal as Ge } from "react-dom";
|
|
10
|
+
import _e from "downshift";
|
|
11
|
+
import { useFloating as Pe, autoUpdate as Be, flip as Je, size as Qe } from "@floating-ui/react";
|
|
12
|
+
import { F as Ze } from "./fieldText-1749da7a.js";
|
|
13
|
+
import { S as Oe } from "./dropdown-0260bb66.js";
|
|
14
|
+
import { E as Te, A as qe, T as Ue } from "./constants-85822a6b.js";
|
|
15
|
+
import { S as Ve } from "./close-4d480ef7.js";
|
|
16
|
+
import { S as et } from "./clear-53660571.js";
|
|
17
|
+
import "./openEye-950159cb.js";
|
|
18
|
+
import "./baseIconButton-251479f7.js";
|
|
19
|
+
import "./spinLoader-c4a53718.js";
|
|
20
|
+
import "./maxValueDisplay-9be01a75.js";
|
|
21
|
+
import "./fieldLabel.js";
|
|
22
|
+
const tt = "_disabled_1rpph_43", ot = "_input_1rpph_107", st = {
|
|
23
|
+
"selected-item": "_selected-item_1rpph_16",
|
|
24
|
+
"validation-error": "_validation-error_1rpph_35",
|
|
25
|
+
"highlight-un-stored-item": "_highlight-un-stored-item_1rpph_40",
|
|
26
|
+
disabled: tt,
|
|
27
|
+
"mobile-disabled": "_mobile-disabled_1rpph_48",
|
|
28
|
+
"selected-item-text": "_selected-item-text_1rpph_54",
|
|
29
|
+
"single-line": "_single-line_1rpph_58",
|
|
30
|
+
"cross-icon": "_cross-icon_1rpph_64",
|
|
31
|
+
input: ot
|
|
32
|
+
}, fe = J.bind(st), nt = (t) => t.scrollWidth > t.clientWidth, rt = ({
|
|
33
|
+
item: t,
|
|
34
|
+
onRemoveItem: e,
|
|
35
|
+
disabled: n = !1,
|
|
36
|
+
mobileDisabled: o = !1,
|
|
37
|
+
parseValueToString: s,
|
|
38
|
+
error: l = !1,
|
|
39
|
+
editItem: h,
|
|
40
|
+
editable: d = !1,
|
|
41
|
+
getAdditionalCreationCondition: b = () => !0,
|
|
42
|
+
storedOption: x = !0,
|
|
43
|
+
highlightUnStoredItem: p = !1,
|
|
44
|
+
variant: L = "light",
|
|
45
|
+
getItemName: M,
|
|
46
|
+
singleLine: u = !1,
|
|
47
|
+
className: P,
|
|
48
|
+
textClassName: O
|
|
49
|
+
}) => {
|
|
50
|
+
const [y, N] = ne(!1), [B, $] = ne(""), [c, i] = ne(!1), a = Ce(null), m = () => {
|
|
51
|
+
!n && d && !x && ($((M == null ? void 0 : M(t)) || (s == null ? void 0 : s(t)) || ""), N(!0));
|
|
52
|
+
}, g = (F) => {
|
|
53
|
+
$(F.target.value);
|
|
54
|
+
}, E = (F) => {
|
|
55
|
+
const D = b(B);
|
|
56
|
+
F.key === "Enter" && D && (h(t, B), N(!1), $(""));
|
|
57
|
+
}, _ = () => {
|
|
58
|
+
N(!1), $("");
|
|
59
|
+
}, I = (F) => {
|
|
60
|
+
F.stopPropagation(), e(t);
|
|
61
|
+
}, z = (s == null ? void 0 : s(t)) || "";
|
|
62
|
+
we(() => {
|
|
63
|
+
if (a.current && u) {
|
|
64
|
+
const F = () => {
|
|
65
|
+
a.current && i(nt(a.current));
|
|
66
|
+
};
|
|
67
|
+
if (F(), typeof ResizeObserver < "u") {
|
|
68
|
+
const D = new ResizeObserver(F);
|
|
69
|
+
return D.observe(a.current), () => D.disconnect();
|
|
70
|
+
}
|
|
71
|
+
} else
|
|
72
|
+
i(!1);
|
|
73
|
+
}, [z, u]);
|
|
74
|
+
const S = fe(
|
|
75
|
+
"selected-item-text",
|
|
76
|
+
{
|
|
77
|
+
"single-line": u
|
|
78
|
+
},
|
|
79
|
+
O
|
|
80
|
+
), R = fe(
|
|
81
|
+
"selected-item",
|
|
82
|
+
L,
|
|
83
|
+
{
|
|
84
|
+
[`validation-${l}`]: l,
|
|
85
|
+
disabled: n,
|
|
86
|
+
"mobile-disabled": o,
|
|
87
|
+
"highlight-un-stored-item": p && !x
|
|
88
|
+
},
|
|
89
|
+
P
|
|
90
|
+
);
|
|
91
|
+
return y ? /* @__PURE__ */ r(
|
|
92
|
+
"input",
|
|
93
|
+
{
|
|
94
|
+
autoFocus: !0,
|
|
95
|
+
value: B,
|
|
96
|
+
onChange: g,
|
|
97
|
+
onKeyDown: E,
|
|
98
|
+
onBlur: _,
|
|
99
|
+
className: fe("input")
|
|
100
|
+
}
|
|
101
|
+
) : /* @__PURE__ */ T("div", { className: R, onClick: m, children: [
|
|
102
|
+
/* @__PURE__ */ r(
|
|
103
|
+
"span",
|
|
104
|
+
{
|
|
105
|
+
ref: a,
|
|
106
|
+
className: S,
|
|
107
|
+
title: u && c ? z : void 0,
|
|
108
|
+
children: z
|
|
109
|
+
}
|
|
110
|
+
),
|
|
111
|
+
!n && /* @__PURE__ */ r(
|
|
112
|
+
"button",
|
|
113
|
+
{
|
|
114
|
+
type: "button",
|
|
115
|
+
className: fe("cross-icon", {
|
|
116
|
+
[`validation-${l}`]: l,
|
|
117
|
+
"mobile-disabled": o,
|
|
118
|
+
disabled: n
|
|
119
|
+
}),
|
|
120
|
+
onClick: I,
|
|
121
|
+
children: /* @__PURE__ */ r(Ve, {})
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
}, lt = ({
|
|
126
|
+
items: t = [],
|
|
127
|
+
parseValueToString: e,
|
|
128
|
+
getItemValidationErrorType: n,
|
|
129
|
+
storedItemsMap: o = {},
|
|
130
|
+
highlightUnStoredItem: s = !1,
|
|
131
|
+
renderCustomSelectedItem: l,
|
|
132
|
+
selectedItemSingleLine: h,
|
|
133
|
+
selectedItemClassName: d,
|
|
134
|
+
selectedItemTextClassName: b,
|
|
135
|
+
...x
|
|
136
|
+
}) => t.map((p) => l ? l(p) : /* @__PURE__ */ r(
|
|
137
|
+
rt,
|
|
138
|
+
{
|
|
139
|
+
parseValueToString: e,
|
|
140
|
+
error: (n == null ? void 0 : n(p)) || "",
|
|
141
|
+
item: p,
|
|
142
|
+
storedOption: !!o[e(p)],
|
|
143
|
+
highlightUnStoredItem: s,
|
|
144
|
+
singleLine: h,
|
|
145
|
+
className: d,
|
|
146
|
+
textClassName: b,
|
|
147
|
+
...x
|
|
148
|
+
},
|
|
149
|
+
e == null ? void 0 : e(p)
|
|
150
|
+
)), ct = "_prompt_1xfmd_16", it = {
|
|
151
|
+
prompt: ct
|
|
152
|
+
}, at = J.bind(it), dt = ({ children: t = null }) => /* @__PURE__ */ r("div", { className: at("prompt"), children: t }), ut = "_item_zw4ux_16", mt = "_divider_zw4ux_24", ft = "_active_zw4ux_49", pt = "_value_zw4ux_55", _t = "_tag_zw4ux_69", ht = "_disabled_zw4ux_80", wt = {
|
|
153
|
+
item: ut,
|
|
154
|
+
divider: mt,
|
|
155
|
+
"new-item": "_new-item_zw4ux_31",
|
|
156
|
+
active: ft,
|
|
157
|
+
value: pt,
|
|
158
|
+
"key-variant": "_key-variant_zw4ux_66",
|
|
159
|
+
tag: _t,
|
|
160
|
+
"button-active": "_button-active_zw4ux_80",
|
|
161
|
+
disabled: ht,
|
|
162
|
+
"value-variant": "_value-variant_zw4ux_100"
|
|
163
|
+
}, V = J.bind(wt), Re = ({
|
|
164
|
+
isActive: t = !1,
|
|
165
|
+
isSelected: e = !1,
|
|
166
|
+
isNew: n = !1,
|
|
167
|
+
children: o = null,
|
|
168
|
+
disabled: s = !1,
|
|
169
|
+
optionVariant: l = "",
|
|
170
|
+
newItemButtonText: h = "",
|
|
171
|
+
...d
|
|
172
|
+
}) => {
|
|
173
|
+
const b = () => h || (l === "key-variant" ? "New key" : "New value");
|
|
174
|
+
return n ? /* @__PURE__ */ T(he, { children: [
|
|
175
|
+
/* @__PURE__ */ r("div", { className: V("divider") }),
|
|
176
|
+
/* @__PURE__ */ T(
|
|
177
|
+
"li",
|
|
178
|
+
{
|
|
179
|
+
className: V("new-item", l, {
|
|
180
|
+
active: t,
|
|
181
|
+
selected: e,
|
|
182
|
+
disabled: s
|
|
183
|
+
}),
|
|
184
|
+
...d,
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ r("span", { className: V("value"), children: o }),
|
|
187
|
+
/* @__PURE__ */ r(
|
|
188
|
+
Ke,
|
|
189
|
+
{
|
|
190
|
+
...!s && d,
|
|
191
|
+
className: V({ "button-active": t }),
|
|
192
|
+
icon: /* @__PURE__ */ r(Xe, {}),
|
|
193
|
+
variant: "text",
|
|
194
|
+
children: b()
|
|
195
|
+
}
|
|
196
|
+
)
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
] }) : /* @__PURE__ */ r(
|
|
201
|
+
"li",
|
|
202
|
+
{
|
|
203
|
+
className: V("item", l, {
|
|
204
|
+
active: t,
|
|
205
|
+
selected: e,
|
|
206
|
+
disabled: s
|
|
207
|
+
}),
|
|
208
|
+
...s ? {} : d,
|
|
209
|
+
children: /* @__PURE__ */ r("span", { className: V("label", "tag"), children: o })
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}, vt = "_container_12uzd_16", bt = {
|
|
213
|
+
container: vt,
|
|
214
|
+
"empty-list-message": "_empty-list-message_12uzd_20",
|
|
215
|
+
"limitation-item": "_limitation-item_12uzd_28"
|
|
216
|
+
}, pe = J.bind(bt), yt = (t) => {
|
|
217
|
+
const {
|
|
218
|
+
options: e,
|
|
219
|
+
async: n,
|
|
220
|
+
inputValue: o,
|
|
221
|
+
loading: s,
|
|
222
|
+
createWithoutConfirmation: l,
|
|
223
|
+
customEmptyListMessage: h,
|
|
224
|
+
customNoMatchesMessage: d,
|
|
225
|
+
optionVariant: b,
|
|
226
|
+
newItemButtonText: x,
|
|
227
|
+
renderOption: p,
|
|
228
|
+
getUniqKey: L,
|
|
229
|
+
getItemProps: M,
|
|
230
|
+
parseValueToString: u,
|
|
231
|
+
limitationText: P = "Too many results. Type to search",
|
|
232
|
+
optionsLimit: O = 0,
|
|
233
|
+
shouldShowEmptyListMessage: y = !0
|
|
234
|
+
} = t, N = Y(() => (e || []).filter((_) => u(_).toUpperCase().indexOf((o.toUpperCase() || "").trim()) > -1), [o, e, u]), B = Y(
|
|
235
|
+
(_, I, z = !1) => p ? p(_, I, z, M) : /* @__PURE__ */ r(
|
|
236
|
+
Re,
|
|
237
|
+
{
|
|
238
|
+
optionVariant: b,
|
|
239
|
+
...M({ item: _, index: I }),
|
|
240
|
+
isNew: z,
|
|
241
|
+
newItemButtonText: x,
|
|
242
|
+
children: u(_)
|
|
243
|
+
},
|
|
244
|
+
(L == null ? void 0 : L(_)) || u(_)
|
|
245
|
+
),
|
|
246
|
+
[M, L, x, b, u, p]
|
|
247
|
+
), $ = Y(
|
|
248
|
+
(_) => _.length ? _.map((I, z) => B(I, z)) : "",
|
|
249
|
+
[B]
|
|
250
|
+
), c = Y(
|
|
251
|
+
(_) => {
|
|
252
|
+
const I = _.length;
|
|
253
|
+
return /* @__PURE__ */ r("div", { className: pe({ container: !I }), children: /* @__PURE__ */ r(
|
|
254
|
+
Re,
|
|
255
|
+
{
|
|
256
|
+
optionVariant: b,
|
|
257
|
+
isNew: !0,
|
|
258
|
+
newItemButtonText: x,
|
|
259
|
+
...M({ item: o, index: I }),
|
|
260
|
+
children: u(o)
|
|
261
|
+
},
|
|
262
|
+
u(o)
|
|
263
|
+
) });
|
|
264
|
+
},
|
|
265
|
+
[M, o, x, b, u]
|
|
266
|
+
), i = Y(
|
|
267
|
+
(_) => s ? /* @__PURE__ */ T(he, { children: [
|
|
268
|
+
/* @__PURE__ */ r(dt, { children: /* @__PURE__ */ r(Ye, {}) }),
|
|
269
|
+
!l && c(_)
|
|
270
|
+
] }) : "",
|
|
271
|
+
[l, s, c]
|
|
272
|
+
), a = Y(() => {
|
|
273
|
+
const _ = (e == null ? void 0 : e.length) === 0 ? h || "No available options" : d || "No matches found";
|
|
274
|
+
return /* @__PURE__ */ r("div", { className: pe("empty-list-message"), children: _ });
|
|
275
|
+
}, [h, d, e == null ? void 0 : e.length]), m = n ? e : N(), g = i(e);
|
|
276
|
+
if (g)
|
|
277
|
+
return g;
|
|
278
|
+
const E = Me(m);
|
|
279
|
+
return E && !y && l ? null : /* @__PURE__ */ T("div", { className: pe({ container: e.length }), children: [
|
|
280
|
+
/* @__PURE__ */ T(We, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
|
|
281
|
+
E ? y && a() : $(m),
|
|
282
|
+
(m == null ? void 0 : m.length) > O && O > 0 && P ? /* @__PURE__ */ r("li", { className: pe("limitation-item"), "aria-hidden": "true", children: P }) : null
|
|
283
|
+
] }),
|
|
284
|
+
!l && c(m)
|
|
285
|
+
] });
|
|
286
|
+
}, gt = "_menu_f64z5_16", xt = "_opened_f64z5_34", Nt = "_dark_f64z5_37", Et = {
|
|
287
|
+
menu: gt,
|
|
288
|
+
opened: xt,
|
|
289
|
+
dark: Nt
|
|
290
|
+
}, It = J.bind(Et), St = (t, e) => !t || t <= e.trim().length, $e = De(
|
|
291
|
+
({
|
|
292
|
+
isOpen: t = !1,
|
|
293
|
+
style: e = {},
|
|
294
|
+
minLength: n = 1,
|
|
295
|
+
isDropdownMode: o,
|
|
296
|
+
inputValue: s = "",
|
|
297
|
+
className: l = "",
|
|
298
|
+
portalMenuAttribute: h = null,
|
|
299
|
+
...d
|
|
300
|
+
}, b) => /* @__PURE__ */ r(
|
|
301
|
+
"ul",
|
|
302
|
+
{
|
|
303
|
+
ref: b,
|
|
304
|
+
className: It(
|
|
305
|
+
"menu",
|
|
306
|
+
{ opened: t && (o || St(n, s)) },
|
|
307
|
+
l
|
|
308
|
+
),
|
|
309
|
+
style: e,
|
|
310
|
+
...h ? { [h]: "" } : {},
|
|
311
|
+
children: /* @__PURE__ */ r(yt, { inputValue: s, ...d })
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
), Fe = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", ee = (t, e) => {
|
|
315
|
+
var o;
|
|
316
|
+
return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((o = Object.entries(t)) != null && o.every(([s, l]) => ee(l, e[s]))));
|
|
317
|
+
}, kt = (t, e, n) => typeof t == "string" ? t === e : n ? (() => {
|
|
318
|
+
const o = n(t);
|
|
319
|
+
return t[o] === e[o];
|
|
320
|
+
})() : !1, At = ({
|
|
321
|
+
options: t = [],
|
|
322
|
+
onChange: e,
|
|
323
|
+
selectedItems: n = [],
|
|
324
|
+
handleUnStoredItemCb: o = null,
|
|
325
|
+
existingItemsMap: s = {},
|
|
326
|
+
children: l,
|
|
327
|
+
customizeNewSelectedValue: h = (p) => p,
|
|
328
|
+
getOptionUniqKey: d,
|
|
329
|
+
getOptionUniqKeyValue: b,
|
|
330
|
+
...x
|
|
331
|
+
}) => {
|
|
332
|
+
const [p, L] = ne(s), M = (c, i) => {
|
|
333
|
+
const a = {
|
|
334
|
+
...p
|
|
335
|
+
};
|
|
336
|
+
c.forEach((m) => {
|
|
337
|
+
if (t.find((g) => kt(g, m, d))) {
|
|
338
|
+
const g = Fe(m, d);
|
|
339
|
+
a[g] = !0;
|
|
340
|
+
}
|
|
341
|
+
}), L(a), i(a);
|
|
342
|
+
}, u = (c, i) => {
|
|
343
|
+
const a = Fe(c, d);
|
|
344
|
+
if (a in p) {
|
|
345
|
+
const m = { ...p };
|
|
346
|
+
delete m[a], L(m), i(m);
|
|
347
|
+
} else
|
|
348
|
+
i(p);
|
|
349
|
+
}, P = (c, i) => {
|
|
350
|
+
const E = (Array.isArray(c) ? c : [c]).map((S) => h(S)).flatMap((S) => Array.isArray(S) ? S : [S]).filter(
|
|
351
|
+
(S, R, F) => F.findIndex((D) => ee(D, S)) === R
|
|
352
|
+
);
|
|
353
|
+
if (!E || E.length === 0)
|
|
354
|
+
return;
|
|
355
|
+
const I = [...n.filter(
|
|
356
|
+
(S) => !E.some((R) => ee(R, S))
|
|
357
|
+
), ...E];
|
|
358
|
+
e == null || e(I, i), M(E, (S) => o == null ? void 0 : o(I, S));
|
|
359
|
+
}, O = (c, i) => {
|
|
360
|
+
const a = n.indexOf(c), m = [...n];
|
|
361
|
+
m.splice(a, 1, i), e == null || e(m, null);
|
|
362
|
+
}, y = (c, i) => {
|
|
363
|
+
const a = n.filter((g) => !ee(g, c));
|
|
364
|
+
e == null || e(a, i), u(c, (g) => o == null ? void 0 : o(a, g));
|
|
365
|
+
}, N = (c, i) => {
|
|
366
|
+
c && P(c, i);
|
|
367
|
+
}, B = (c) => ({
|
|
368
|
+
removeItem: y,
|
|
369
|
+
editItem: O,
|
|
370
|
+
handleChange: e,
|
|
371
|
+
getOptionUniqKeyValue: b,
|
|
372
|
+
storedItemsMap: p,
|
|
373
|
+
batchAddItems: (a) => {
|
|
374
|
+
P(a, c);
|
|
375
|
+
},
|
|
376
|
+
...c
|
|
377
|
+
});
|
|
378
|
+
return /* @__PURE__ */ r(
|
|
379
|
+
_e,
|
|
380
|
+
{
|
|
381
|
+
...x,
|
|
382
|
+
stateReducer: (c, i) => {
|
|
383
|
+
switch (i.type) {
|
|
384
|
+
case _e.stateChangeTypes.keyDownEnter:
|
|
385
|
+
case _e.stateChangeTypes.clickItem:
|
|
386
|
+
return {
|
|
387
|
+
...i,
|
|
388
|
+
highlightedIndex: c.highlightedIndex,
|
|
389
|
+
inputValue: ""
|
|
390
|
+
};
|
|
391
|
+
default:
|
|
392
|
+
return i;
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
onChange: N,
|
|
396
|
+
selectedItem: null,
|
|
397
|
+
children: (c) => l == null ? void 0 : l(B(c))
|
|
398
|
+
}
|
|
399
|
+
);
|
|
400
|
+
}, Ct = "_autocomplete_1so4a_16", Mt = "_disabled_1so4a_32", zt = "_error_1so4a_35", Rt = "_touched_1so4a_35", Ft = "_input_1so4a_77", Lt = {
|
|
401
|
+
autocomplete: Ct,
|
|
402
|
+
"autocomplete-wrapper": "_autocomplete-wrapper_1so4a_28",
|
|
403
|
+
disabled: Mt,
|
|
404
|
+
error: zt,
|
|
405
|
+
touched: Rt,
|
|
406
|
+
"clear-icon": "_clear-icon_1so4a_46",
|
|
407
|
+
"clear-icon--disabled": "_clear-icon--disabled_1so4a_56",
|
|
408
|
+
"autocomplete-input": "_autocomplete-input_1so4a_60",
|
|
409
|
+
"single-line-mode": "_single-line-mode_1so4a_68",
|
|
410
|
+
"mobile-disabled": "_mobile-disabled_1so4a_72",
|
|
411
|
+
input: Ft,
|
|
412
|
+
"type-number": "_type-number_1so4a_101",
|
|
413
|
+
"error-text": "_error-text_1so4a_112",
|
|
414
|
+
"dropdown-button": "_dropdown-button_1so4a_121",
|
|
415
|
+
"icon-reversed": "_icon-reversed_1so4a_129"
|
|
416
|
+
}, G = J.bind(Lt), ao = (t) => {
|
|
417
|
+
const {
|
|
418
|
+
options: e = [],
|
|
419
|
+
loading: n = !1,
|
|
420
|
+
onStateChange: o = () => {
|
|
421
|
+
},
|
|
422
|
+
value: s = [],
|
|
423
|
+
placeholder: l = "",
|
|
424
|
+
error: h = "",
|
|
425
|
+
touched: d = !1,
|
|
426
|
+
creatable: b = !1,
|
|
427
|
+
editable: x = !1,
|
|
428
|
+
onChange: p = () => {
|
|
429
|
+
},
|
|
430
|
+
onFocus: L = () => {
|
|
431
|
+
},
|
|
432
|
+
onBlur: M = () => {
|
|
433
|
+
},
|
|
434
|
+
disabled: u = !1,
|
|
435
|
+
isDropdownMode: P = !1,
|
|
436
|
+
mobileDisabled: O = !1,
|
|
437
|
+
inputProps: y = {},
|
|
438
|
+
parseValueToString: N = (f) => f == null ? "" : String(f),
|
|
439
|
+
maxLength: B = null,
|
|
440
|
+
async: $ = !1,
|
|
441
|
+
customClass: c = "",
|
|
442
|
+
createWithoutConfirmation: i = !1,
|
|
443
|
+
getItemValidationErrorType: a = null,
|
|
444
|
+
clearItemsError: m = () => {
|
|
445
|
+
},
|
|
446
|
+
getAdditionalCreationCondition: g = () => !0,
|
|
447
|
+
highlightUnStoredItem: E = !1,
|
|
448
|
+
parseInputValueFn: _ = null,
|
|
449
|
+
handleUnStoredItemCb: I = null,
|
|
450
|
+
dataAutomationId: z = "",
|
|
451
|
+
existingItemsMap: S = {},
|
|
452
|
+
customizeNewSelectedValue: R = (f) => f,
|
|
453
|
+
renderCustomSelectedItem: F,
|
|
454
|
+
useFixedPositioning: D,
|
|
455
|
+
newItemButtonText: ve = "",
|
|
456
|
+
menuClassName: K = "",
|
|
457
|
+
selectedItemSingleLine: re,
|
|
458
|
+
selectedItemClassName: le,
|
|
459
|
+
selectedItemTextClassName: ce,
|
|
460
|
+
...be
|
|
461
|
+
} = t, { refs: ie, floatingStyles: Q } = Pe({
|
|
462
|
+
placement: "bottom-start",
|
|
463
|
+
strategy: D ? "fixed" : "absolute",
|
|
464
|
+
whileElementsMounted: Be
|
|
465
|
+
}), ye = s.length === 0 && !u ? l : "", te = Ce(null);
|
|
466
|
+
we(() => {
|
|
467
|
+
m();
|
|
468
|
+
}, [m, s]);
|
|
469
|
+
const ge = (f, k) => {
|
|
470
|
+
p(f, k);
|
|
471
|
+
}, xe = (f, k, A) => ({ item: C, index: H, ...q }) => f({
|
|
472
|
+
item: C,
|
|
473
|
+
index: H,
|
|
474
|
+
isSelected: A.some((W) => ee(W, C)),
|
|
475
|
+
...q,
|
|
476
|
+
isActive: k === H
|
|
477
|
+
}), v = ({
|
|
478
|
+
event: f,
|
|
479
|
+
removeItem: k,
|
|
480
|
+
inputValue: A
|
|
481
|
+
}) => {
|
|
482
|
+
f.key === "Backspace" && !A && s.length && k(s[s.length - 1], null);
|
|
483
|
+
}, j = ({
|
|
484
|
+
inputValue: f,
|
|
485
|
+
selectItem: k,
|
|
486
|
+
clearSelection: A,
|
|
487
|
+
batchAddItems: C
|
|
488
|
+
}) => {
|
|
489
|
+
if (_) {
|
|
490
|
+
const H = _(f);
|
|
491
|
+
C(H.length ? H : [f]), A();
|
|
492
|
+
} else
|
|
493
|
+
k(f), A();
|
|
494
|
+
}, Z = (f) => (k) => {
|
|
495
|
+
f(k, null), te.current && te.current.focus();
|
|
496
|
+
}, X = e.filter((f) => s.every((k) => !ee(k, f)));
|
|
497
|
+
return /* @__PURE__ */ r(
|
|
498
|
+
At,
|
|
499
|
+
{
|
|
500
|
+
onChange: ge,
|
|
501
|
+
itemToString: N,
|
|
502
|
+
selectedItems: s,
|
|
503
|
+
onStateChange: o,
|
|
504
|
+
options: e,
|
|
505
|
+
existingItemsMap: S,
|
|
506
|
+
handleUnStoredItemCb: I,
|
|
507
|
+
customizeNewSelectedValue: R,
|
|
508
|
+
children: ({
|
|
509
|
+
getInputProps: f,
|
|
510
|
+
getItemProps: k,
|
|
511
|
+
isOpen: A,
|
|
512
|
+
inputValue: C = "",
|
|
513
|
+
highlightedIndex: H,
|
|
514
|
+
removeItem: q,
|
|
515
|
+
editItem: W,
|
|
516
|
+
openMenu: ae,
|
|
517
|
+
selectItem: de,
|
|
518
|
+
clearSelection: ue,
|
|
519
|
+
toggleMenu: U,
|
|
520
|
+
storedItemsMap: Ne,
|
|
521
|
+
getRootProps: Ee,
|
|
522
|
+
batchAddItems: Ie
|
|
523
|
+
}) => {
|
|
524
|
+
const oe = Ee(void 0, { suppressRefError: !0 }), Se = {
|
|
525
|
+
...oe,
|
|
526
|
+
ref: (w) => (ie.setReference(w), oe.ref(w))
|
|
527
|
+
}, me = C ?? "";
|
|
528
|
+
return /* @__PURE__ */ T("div", { ...Se, className: G("autocomplete-wrapper"), children: [
|
|
529
|
+
/* @__PURE__ */ T(he, { children: [
|
|
530
|
+
/* @__PURE__ */ T(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
className: G("autocomplete", c, {
|
|
534
|
+
"mobile-disabled": O,
|
|
535
|
+
error: h,
|
|
536
|
+
touched: d,
|
|
537
|
+
disabled: u
|
|
538
|
+
}),
|
|
539
|
+
children: [
|
|
540
|
+
/* @__PURE__ */ T(
|
|
541
|
+
"div",
|
|
542
|
+
{
|
|
543
|
+
className: G("autocomplete-input", {
|
|
544
|
+
"mobile-disabled": O,
|
|
545
|
+
"single-line-mode": re
|
|
546
|
+
}),
|
|
547
|
+
children: [
|
|
548
|
+
/* @__PURE__ */ r(
|
|
549
|
+
lt,
|
|
550
|
+
{
|
|
551
|
+
items: s,
|
|
552
|
+
onRemoveItem: Z(q),
|
|
553
|
+
disabled: u,
|
|
554
|
+
mobileDisabled: O,
|
|
555
|
+
parseValueToString: N,
|
|
556
|
+
getItemValidationErrorType: a,
|
|
557
|
+
renderCustomSelectedItem: F,
|
|
558
|
+
editItem: W,
|
|
559
|
+
editable: x,
|
|
560
|
+
getAdditionalCreationCondition: g,
|
|
561
|
+
storedItemsMap: Ne,
|
|
562
|
+
highlightUnStoredItem: E,
|
|
563
|
+
selectedItemSingleLine: re,
|
|
564
|
+
selectedItemClassName: le,
|
|
565
|
+
selectedItemTextClassName: ce
|
|
566
|
+
}
|
|
567
|
+
),
|
|
568
|
+
/* @__PURE__ */ r(
|
|
569
|
+
"input",
|
|
570
|
+
{
|
|
571
|
+
...f({
|
|
572
|
+
ref: te,
|
|
573
|
+
placeholder: ye,
|
|
574
|
+
maxLength: B,
|
|
575
|
+
onFocus: () => {
|
|
576
|
+
P && ae(), L();
|
|
577
|
+
},
|
|
578
|
+
onKeyDown: (w) => {
|
|
579
|
+
w.key === Te && C && b && g(C) && j({
|
|
580
|
+
inputValue: C,
|
|
581
|
+
selectItem: de,
|
|
582
|
+
clearSelection: ue,
|
|
583
|
+
batchAddItems: Ie
|
|
584
|
+
}), v({ event: w, removeItem: q, inputValue: C });
|
|
585
|
+
},
|
|
586
|
+
onBlur: () => {
|
|
587
|
+
M(), C && b && g(C) && j({
|
|
588
|
+
inputValue: C,
|
|
589
|
+
selectItem: de,
|
|
590
|
+
clearSelection: ue,
|
|
591
|
+
batchAddItems: Ie
|
|
592
|
+
});
|
|
593
|
+
},
|
|
594
|
+
disabled: u,
|
|
595
|
+
...y
|
|
596
|
+
}),
|
|
597
|
+
className: G("input", { disabled: u }, y.className),
|
|
598
|
+
"data-automation-id": z
|
|
599
|
+
}
|
|
600
|
+
)
|
|
601
|
+
]
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
(y == null ? void 0 : y.clearable) && !Me(s) && /* @__PURE__ */ r(
|
|
605
|
+
"button",
|
|
606
|
+
{
|
|
607
|
+
type: "button",
|
|
608
|
+
className: G("clear-icon", { "clear-icon--disabled": u }),
|
|
609
|
+
onClick: () => {
|
|
610
|
+
var w;
|
|
611
|
+
return !u && ((w = y == null ? void 0 : y.onClear) == null ? void 0 : w.call(y));
|
|
612
|
+
},
|
|
613
|
+
onMouseDown: (w) => w.preventDefault(),
|
|
614
|
+
children: /* @__PURE__ */ r(et, {})
|
|
615
|
+
}
|
|
616
|
+
),
|
|
617
|
+
P && /* @__PURE__ */ r(
|
|
618
|
+
"button",
|
|
619
|
+
{
|
|
620
|
+
type: "button",
|
|
621
|
+
className: G("dropdown-button", { "icon-reversed": A }),
|
|
622
|
+
onClick: () => U(),
|
|
623
|
+
"aria-label": "Toggle dropdown",
|
|
624
|
+
"aria-expanded": A,
|
|
625
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
626
|
+
}
|
|
627
|
+
)
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
),
|
|
631
|
+
h && d && /* @__PURE__ */ r("span", { className: G("error-text"), children: h })
|
|
632
|
+
] }),
|
|
633
|
+
/* @__PURE__ */ r(
|
|
634
|
+
$e,
|
|
635
|
+
{
|
|
636
|
+
isOpen: A,
|
|
637
|
+
loading: n,
|
|
638
|
+
async: $,
|
|
639
|
+
ref: ie.setFloating,
|
|
640
|
+
newItemButtonText: ve,
|
|
641
|
+
isDropdownMode: P,
|
|
642
|
+
style: Q,
|
|
643
|
+
inputValue: me.trim(),
|
|
644
|
+
getItemProps: xe(k, H, s),
|
|
645
|
+
parseValueToString: N,
|
|
646
|
+
createWithoutConfirmation: i,
|
|
647
|
+
options: X,
|
|
648
|
+
className: K,
|
|
649
|
+
...be
|
|
650
|
+
}
|
|
651
|
+
)
|
|
652
|
+
] });
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
);
|
|
656
|
+
}, Pt = ({ skip: t }) => {
|
|
657
|
+
je(() => {
|
|
658
|
+
if (t)
|
|
659
|
+
return;
|
|
660
|
+
let e = window.scrollY, n = !0;
|
|
661
|
+
const o = 300, s = () => {
|
|
662
|
+
if (!n)
|
|
663
|
+
return;
|
|
664
|
+
window.scrollY !== e && window.scrollTo(0, e);
|
|
665
|
+
}, l = (d) => {
|
|
666
|
+
n && (d.preventDefault(), d.stopImmediatePropagation(), s());
|
|
667
|
+
};
|
|
668
|
+
e = window.scrollY, window.addEventListener("scroll", l, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
|
|
669
|
+
e = window.scrollY, s();
|
|
670
|
+
});
|
|
671
|
+
const h = setTimeout(() => {
|
|
672
|
+
n = !1;
|
|
673
|
+
}, o);
|
|
674
|
+
return () => {
|
|
675
|
+
clearTimeout(h), window.removeEventListener("scroll", l, { capture: !0 });
|
|
676
|
+
};
|
|
677
|
+
}, [t]);
|
|
678
|
+
}, Bt = ({ skip: t, reference: e }) => {
|
|
679
|
+
we(() => {
|
|
680
|
+
if (t)
|
|
681
|
+
return;
|
|
682
|
+
const n = () => {
|
|
683
|
+
const o = e.current;
|
|
684
|
+
o instanceof HTMLElement && o.blur();
|
|
685
|
+
};
|
|
686
|
+
return window.addEventListener("resize", n), () => {
|
|
687
|
+
window.removeEventListener("resize", n);
|
|
688
|
+
};
|
|
689
|
+
}, [t, e]);
|
|
690
|
+
}, Ot = ({ skip: t, onClose: e, menuRef: n }) => {
|
|
691
|
+
we(() => {
|
|
692
|
+
if (t)
|
|
693
|
+
return;
|
|
694
|
+
const o = (s) => {
|
|
695
|
+
var l;
|
|
696
|
+
(l = n.current) != null && l.contains(s.target) || e();
|
|
697
|
+
};
|
|
698
|
+
return window.addEventListener("scroll", o, !0), () => {
|
|
699
|
+
window.removeEventListener("scroll", o, !0);
|
|
700
|
+
};
|
|
701
|
+
}, [t, e, n]);
|
|
702
|
+
}, Tt = {
|
|
703
|
+
"input-wrapper": "_input-wrapper_d9vma_1",
|
|
704
|
+
"dropdown-button": "_dropdown-button_d9vma_6",
|
|
705
|
+
"icon-reversed": "_icon-reversed_d9vma_14"
|
|
706
|
+
}, Le = J.bind(Tt), $t = 0, Dt = Je({
|
|
707
|
+
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
|
|
708
|
+
boundary: document == null ? void 0 : document.documentElement,
|
|
709
|
+
rootBoundary: "viewport"
|
|
710
|
+
}), jt = Qe({
|
|
711
|
+
apply({ rects: t, elements: e }) {
|
|
712
|
+
Object.assign(e.floating.style, {
|
|
713
|
+
width: `${t.reference.width}px`
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
}), uo = (t) => {
|
|
717
|
+
const {
|
|
718
|
+
options: e = [],
|
|
719
|
+
value: n,
|
|
720
|
+
placeholder: o = "",
|
|
721
|
+
onChange: s = () => {
|
|
722
|
+
},
|
|
723
|
+
onFocus: l = () => {
|
|
724
|
+
},
|
|
725
|
+
onBlur: h = () => {
|
|
726
|
+
},
|
|
727
|
+
disabled: d = !1,
|
|
728
|
+
inputProps: b = {},
|
|
729
|
+
parseValueToString: x = (v) => v === null ? "" : String(v),
|
|
730
|
+
minLength: p = 1,
|
|
731
|
+
skipOptionCreation: L = !1,
|
|
732
|
+
maxLength: M = null,
|
|
733
|
+
optionVariant: u = "",
|
|
734
|
+
isRequired: P = !1,
|
|
735
|
+
error: O = "",
|
|
736
|
+
touched: y = !1,
|
|
737
|
+
setTouch: N = () => {
|
|
738
|
+
},
|
|
739
|
+
createWithoutConfirmation: B = !1,
|
|
740
|
+
menuClassName: $ = "",
|
|
741
|
+
icon: c,
|
|
742
|
+
isDropdownMode: i = !1,
|
|
743
|
+
isOptionUnique: a,
|
|
744
|
+
refFunction: m,
|
|
745
|
+
stateReducer: g,
|
|
746
|
+
onStateChange: E,
|
|
747
|
+
useFixedPositioning: _,
|
|
748
|
+
dropdownMatchInputWidth: I = !1,
|
|
749
|
+
withMenuFlip: z = !1,
|
|
750
|
+
newItemButtonText: S = "",
|
|
751
|
+
menuPortalRoot: R,
|
|
752
|
+
...F
|
|
753
|
+
} = t, [D, ve] = ne(!1), K = Ce(null), re = Y(() => {
|
|
754
|
+
var v;
|
|
755
|
+
return (v = K.current) == null ? void 0 : v.call(K);
|
|
756
|
+
}, []), le = !D || !R, ce = R || _ ? "fixed" : "absolute", be = !D || ce === "absolute", ie = He(
|
|
757
|
+
() => [
|
|
758
|
+
...z ? [Dt] : [],
|
|
759
|
+
...I ? [jt] : []
|
|
760
|
+
],
|
|
761
|
+
[z, I]
|
|
762
|
+
), { refs: Q, floatingStyles: ye } = Pe({
|
|
763
|
+
placement: "bottom-start",
|
|
764
|
+
whileElementsMounted: Be,
|
|
765
|
+
strategy: ce,
|
|
766
|
+
middleware: ie
|
|
767
|
+
});
|
|
768
|
+
Pt({ skip: le }), Bt({ skip: le, reference: Q.reference }), Ot({
|
|
769
|
+
skip: be,
|
|
770
|
+
onClose: re,
|
|
771
|
+
menuRef: Q.floating
|
|
772
|
+
});
|
|
773
|
+
const te = (v, j, Z) => ({ item: X, index: f, ...k }) => v({
|
|
774
|
+
item: X,
|
|
775
|
+
index: f,
|
|
776
|
+
isSelected: Z !== null && Z === X,
|
|
777
|
+
...k,
|
|
778
|
+
isActive: j === f
|
|
779
|
+
}), ge = (v, j) => {
|
|
780
|
+
v.key === Ue && (v.preventDefault(), j(e.length));
|
|
781
|
+
}, xe = Y(
|
|
782
|
+
(v, ...j) => {
|
|
783
|
+
(v == null ? void 0 : v.isOpen) !== void 0 && ve(v.isOpen), E == null || E(v, ...j);
|
|
784
|
+
},
|
|
785
|
+
[E]
|
|
786
|
+
);
|
|
787
|
+
return /* @__PURE__ */ r(
|
|
788
|
+
_e,
|
|
789
|
+
{
|
|
790
|
+
onChange: s,
|
|
791
|
+
itemToString: x,
|
|
792
|
+
selectedItem: n,
|
|
793
|
+
onStateChange: xe,
|
|
794
|
+
defaultHighlightedIndex: $t,
|
|
795
|
+
stateReducer: g,
|
|
796
|
+
children: ({
|
|
797
|
+
getInputProps: v,
|
|
798
|
+
getItemProps: j,
|
|
799
|
+
setHighlightedIndex: Z,
|
|
800
|
+
toggleMenu: X,
|
|
801
|
+
openMenu: f,
|
|
802
|
+
closeMenu: k,
|
|
803
|
+
isOpen: A,
|
|
804
|
+
inputValue: C,
|
|
805
|
+
highlightedIndex: H,
|
|
806
|
+
getRootProps: q,
|
|
807
|
+
selectItem: W
|
|
808
|
+
}) => {
|
|
809
|
+
const ae = q(void 0, { suppressRefError: !0 }), de = {
|
|
810
|
+
...ae,
|
|
811
|
+
ref: (w) => (Q.setReference(w), ae.ref(w))
|
|
812
|
+
};
|
|
813
|
+
K.current || (K.current = k);
|
|
814
|
+
const ue = C ?? "", { onClear: U, clearable: Ne, ...Ee } = b, oe = Ne && n !== null, Se = (...w) => {
|
|
815
|
+
W(null), U == null || U(...w);
|
|
816
|
+
}, me = /* @__PURE__ */ r(
|
|
817
|
+
$e,
|
|
818
|
+
{
|
|
819
|
+
isOpen: A,
|
|
820
|
+
isDropdownMode: i,
|
|
821
|
+
style: ye,
|
|
822
|
+
ref: Q.setFloating,
|
|
823
|
+
portalMenuAttribute: R ? qe : null,
|
|
824
|
+
minLength: p,
|
|
825
|
+
inputValue: (C || "").trim(),
|
|
826
|
+
getItemProps: te(j, H, n),
|
|
827
|
+
parseValueToString: x,
|
|
828
|
+
optionVariant: u,
|
|
829
|
+
createWithoutConfirmation: B,
|
|
830
|
+
className: $,
|
|
831
|
+
options: e,
|
|
832
|
+
newItemButtonText: S,
|
|
833
|
+
...F
|
|
834
|
+
}
|
|
835
|
+
);
|
|
836
|
+
return /* @__PURE__ */ T(he, { children: [
|
|
837
|
+
/* @__PURE__ */ T("div", { className: Le("input-wrapper"), ...de, children: [
|
|
838
|
+
/* @__PURE__ */ r(
|
|
839
|
+
Ze,
|
|
840
|
+
{
|
|
841
|
+
...v({
|
|
842
|
+
placeholder: d ? "" : o,
|
|
843
|
+
maxLength: M || void 0,
|
|
844
|
+
onFocus: () => {
|
|
845
|
+
i && !A && (f(), N == null || N(!0)), l();
|
|
846
|
+
},
|
|
847
|
+
ref: m,
|
|
848
|
+
onKeyDown: (w) => {
|
|
849
|
+
w.key === Te && w.preventDefault(), C && A && ge(w, Z);
|
|
850
|
+
},
|
|
851
|
+
onBlur: (w) => {
|
|
852
|
+
const se = ue.trim(), ke = !Me(se), ze = ke ? e.find((Ae) => x(Ae) === se) : void 0;
|
|
853
|
+
W(ze || (!L && B && ke ? se : null)), h(w), a == null || a(
|
|
854
|
+
ke ? !e.some((Ae) => x(Ae) === se) : null
|
|
855
|
+
), i && A && X(), N == null || N(!0);
|
|
856
|
+
},
|
|
857
|
+
disabled: d,
|
|
858
|
+
defaultWidth: !1,
|
|
859
|
+
isRequired: P,
|
|
860
|
+
touched: y,
|
|
861
|
+
error: O,
|
|
862
|
+
...Ee,
|
|
863
|
+
clearable: oe,
|
|
864
|
+
onClear: oe ? Se : U,
|
|
865
|
+
endIcon: i && !c ? /* @__PURE__ */ r(
|
|
866
|
+
"button",
|
|
867
|
+
{
|
|
868
|
+
type: "button",
|
|
869
|
+
className: Le("dropdown-button", { "icon-reversed": A }),
|
|
870
|
+
onClick: () => X(),
|
|
871
|
+
"aria-label": "Toggle dropdown",
|
|
872
|
+
"aria-expanded": A,
|
|
873
|
+
children: /* @__PURE__ */ r(Oe, {})
|
|
874
|
+
}
|
|
875
|
+
) : c,
|
|
876
|
+
minLength: i ? 0 : p
|
|
877
|
+
})
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
!R && me
|
|
881
|
+
] }),
|
|
882
|
+
R && Ge(me, R)
|
|
883
|
+
] });
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
);
|
|
887
|
+
};
|
|
888
|
+
export {
|
|
889
|
+
$e as AutocompleteMenu,
|
|
890
|
+
Re as AutocompleteOption,
|
|
891
|
+
yt as AutocompleteOptions,
|
|
892
|
+
dt as AutocompletePrompt,
|
|
893
|
+
ao as MultipleAutocomplete,
|
|
894
|
+
uo as SingleAutocomplete
|
|
895
|
+
};
|