@zohodesk/dot 1.2.4 → 1.3.0
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/.cli/PropLessFiles.html +1 -1
- package/.cli/PropValidationExcludeFilesArray.js +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +9 -0
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +12 -12
- package/coverage/coverage-summary.json +12 -12
- package/coverage/index.html +1 -1
- package/es/Drawer/Drawer.js +3 -2
- package/es/v1/ActionButton/ActionButton.js +11 -8
- package/es/v1/AlphabeticList/AlphabeticList.js +2 -2
- package/es/v1/Attachment/Attachment.js +1 -1
- package/es/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/es/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/es/v1/Drawer/Drawer.js +6 -6
- package/es/v1/FlipCard/FlipCard.js +4 -4
- package/es/v1/FormAction/FormAction.js +1 -1
- package/es/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/es/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/es/v1/IconButton/IconButton.js +3 -3
- package/es/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/es/v1/Loader/Loader.js +1 -1
- package/es/v1/MessageBanner/MessageBanner.js +1 -1
- package/es/v1/NewStar/NewStar.js +1 -1
- package/es/v1/Separator/Separator.js +1 -1
- package/es/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/es/v1/ToastMessage/ToastMessage.js +4 -4
- package/es/v1/Upload/Upload.js +1 -1
- package/es/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/es/v1/alert/AlertHeader/AlertHeader.js +58 -49
- package/es/v1/alert/AlertLookup/AlertLookup.js +101 -41
- package/es/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/es/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/es/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -15
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +53 -80
- package/es/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -73
- package/es/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +102 -118
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +128 -154
- package/es/v1/form/fields/DateField/DateField.js +131 -162
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +52 -57
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +144 -168
- package/es/v1/form/fields/PhoneField/PhoneField.js +128 -156
- package/es/v1/form/fields/RadioField/RadioField.js +2 -2
- package/es/v1/form/fields/SelectField/SelectField.js +3 -3
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/es/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/es/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/es/v1/list/AvatarFlip/AvatarFlip.js +61 -64
- package/es/v1/list/BluePrintStatus/BluePrintStatus.js +11 -18
- package/es/v1/list/Comment/Comment.js +25 -32
- package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +57 -72
- package/es/v1/list/Dot/Dot.js +9 -16
- package/es/v1/list/DotNew/DotNew.js +11 -18
- package/es/v1/list/GridStencils/GridStencils.js +21 -24
- package/es/v1/list/Icons/AddNewIcon.js +19 -22
- package/es/v1/list/Icons/CompleteIcon.js +21 -24
- package/es/v1/list/Icons/DeleteIcon.js +22 -25
- package/es/v1/list/Icons/EditIcon.js +22 -25
- package/es/v1/list/Icons/FloatingIcons.js +12 -19
- package/es/v1/list/Icons/ReadUnreadIcon.js +24 -27
- package/es/v1/list/Icons/SmartIcon.js +20 -23
- package/es/v1/list/ListLayout/ListLayout.js +54 -68
- package/es/v1/list/ListStencils/ListStencils.js +28 -31
- package/es/v1/list/SecondaryText/AccountName.js +1 -1
- package/es/v1/list/SecondaryText/ContactName.js +1 -1
- package/es/v1/list/SecondryPanel/SecondryPanel.js +1 -2
- package/es/v1/list/Thread/Thread.js +1 -1
- package/es/v1/list/UserTime/UserTime.js +1 -1
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +266 -357
- package/es/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/es/v1/lookup/Lookup/Lookup.js +4 -3
- package/es/v1/lookup/Section/Section.js +1 -1
- package/es/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/es/v1/lookup/header/Search/Search.js +3 -3
- package/es/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/es/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/es/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/es/v1/setup/header/Button/Button.js +1 -1
- package/es/v1/setup/header/Link/Link.js +1 -1
- package/es/v1/setup/header/Search/Search.js +1 -1
- package/es/v1/setup/table/Table/Table.js +1 -1
- package/es/v1/setup/table/TableBody/TableBody.js +1 -1
- package/es/v1/setup/table/TableData/TableData.js +1 -1
- package/es/v1/setup/table/TableHead/TableHead.js +1 -1
- package/es/v1/setup/table/TableRow/TableRow.js +1 -1
- package/lib/Drawer/Drawer.js +3 -2
- package/lib/v1/ActionButton/ActionButton.js +11 -9
- package/lib/v1/AlphabeticList/AlphabeticList.js +2 -4
- package/lib/v1/Attachment/Attachment.js +1 -1
- package/lib/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/lib/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/v1/Drawer/Drawer.js +6 -6
- package/lib/v1/FlipCard/FlipCard.js +4 -4
- package/lib/v1/FormAction/FormAction.js +1 -1
- package/lib/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/lib/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/lib/v1/IconButton/IconButton.js +3 -3
- package/lib/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/lib/v1/Loader/Loader.js +1 -1
- package/lib/v1/MessageBanner/MessageBanner.js +1 -1
- package/lib/v1/NewStar/NewStar.js +1 -1
- package/lib/v1/Separator/Separator.js +1 -1
- package/lib/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/lib/v1/ToastMessage/ToastMessage.js +4 -4
- package/lib/v1/Upload/Upload.js +1 -1
- package/lib/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/lib/v1/alert/AlertHeader/AlertHeader.js +68 -50
- package/lib/v1/alert/AlertLookup/AlertLookup.js +109 -42
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -16
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +53 -115
- package/lib/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -108
- package/lib/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +107 -159
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +152 -193
- package/lib/v1/form/fields/DateField/DateField.js +140 -206
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +60 -91
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +168 -228
- package/lib/v1/form/fields/PhoneField/PhoneField.js +150 -193
- package/lib/v1/form/fields/RadioField/RadioField.js +2 -2
- package/lib/v1/form/fields/SelectField/SelectField.js +3 -3
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +11 -8
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/lib/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/lib/v1/list/AvatarFlip/AvatarFlip.js +61 -106
- package/lib/v1/list/BluePrintStatus/BluePrintStatus.js +11 -51
- package/lib/v1/list/Comment/Comment.js +24 -69
- package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +67 -122
- package/lib/v1/list/Dot/Dot.js +9 -54
- package/lib/v1/list/DotNew/DotNew.js +11 -56
- package/lib/v1/list/GridStencils/GridStencils.js +21 -62
- package/lib/v1/list/Icons/AddNewIcon.js +19 -60
- package/lib/v1/list/Icons/CompleteIcon.js +21 -62
- package/lib/v1/list/Icons/DeleteIcon.js +22 -63
- package/lib/v1/list/Icons/EditIcon.js +22 -63
- package/lib/v1/list/Icons/FloatingIcons.js +17 -62
- package/lib/v1/list/Icons/ReadUnreadIcon.js +24 -65
- package/lib/v1/list/Icons/SmartIcon.js +20 -65
- package/lib/v1/list/ListLayout/ListLayout.js +53 -116
- package/lib/v1/list/ListStencils/ListStencils.js +33 -72
- package/lib/v1/list/SecondaryText/AccountName.js +1 -1
- package/lib/v1/list/SecondaryText/ContactName.js +1 -1
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +3 -5
- package/lib/v1/list/Thread/Thread.js +1 -1
- package/lib/v1/list/UserTime/UserTime.js +1 -1
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +367 -472
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/lib/v1/lookup/Lookup/Lookup.js +5 -3
- package/lib/v1/lookup/Section/Section.js +1 -1
- package/lib/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/lib/v1/lookup/header/Search/Search.js +3 -3
- package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/lib/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/lib/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/lib/v1/setup/header/Button/Button.js +1 -1
- package/lib/v1/setup/header/Link/Link.js +1 -1
- package/lib/v1/setup/header/Search/Search.js +1 -1
- package/lib/v1/setup/table/Table/Table.js +1 -1
- package/lib/v1/setup/table/TableBody/TableBody.js +1 -1
- package/lib/v1/setup/table/TableData/TableData.js +1 -1
- package/lib/v1/setup/table/TableHead/TableHead.js +1 -1
- package/lib/v1/setup/table/TableRow/TableRow.js +1 -1
- package/package.json +8 -8
- package/result.json +1 -1
- package/es/v1/errorstate/LinkText/LinkText.js +0 -29
- package/es/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -84
- package/es/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -83
- package/es/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -84
- package/es/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -86
- package/es/v1/errorstate/WillBack/WillBack.js +0 -75
- package/es/v1/errorstate/index.js +0 -8
- package/es/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -63
- package/es/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -65
- package/es/v1/version2/index.js +0 -12
- package/es/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -79
- package/es/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -164
- package/lib/v1/errorstate/LinkText/LinkText.js +0 -80
- package/lib/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -135
- package/lib/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -134
- package/lib/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -135
- package/lib/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -137
- package/lib/v1/errorstate/WillBack/WillBack.js +0 -125
- package/lib/v1/errorstate/index.js +0 -71
- package/lib/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -79
- package/lib/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -81
- package/lib/v1/version2/index.js +0 -58
- package/lib/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -104
- package/lib/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -185
- /package/es/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/index.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/index.js +0 -0
|
@@ -1,158 +1,136 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
|
+
import { useEffectCallOnlyAfterState } from '@zohodesk/hooks';
|
|
2
3
|
import { defaultProps } from '../../../../list/status/StatusDropdown/props/defaultProps';
|
|
3
4
|
import { propTypes } from '../../../../list/status/StatusDropdown/props/propTypes';
|
|
4
5
|
import { Icon } from '@zohodesk/icons';
|
|
5
|
-
import Popup from '@zohodesk/components/
|
|
6
|
-
import { Box, Container } from '@zohodesk/components/
|
|
7
|
-
import DropDownHeading from '@zohodesk/components/
|
|
8
|
-
import TextBoxIcon from '@zohodesk/components/
|
|
6
|
+
import Popup from '@zohodesk/components/es/v1/Popup/Popup';
|
|
7
|
+
import { Box, Container } from '@zohodesk/components/es/v1/Layout';
|
|
8
|
+
import DropDownHeading from '@zohodesk/components/es/v1/DropDown/DropDownHeading';
|
|
9
|
+
import TextBoxIcon from '@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon';
|
|
9
10
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
10
11
|
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
11
|
-
import { scrollTo } from '@zohodesk/components/
|
|
12
|
-
import TextBox from '@zohodesk/components/
|
|
12
|
+
import { scrollTo } from '@zohodesk/components/es/utils/Common';
|
|
13
|
+
import TextBox from '@zohodesk/components/es/v1/TextBox/TextBox';
|
|
13
14
|
import CommonEmptyState from '../../../emptystate/CommonEmptyState/CommonEmptyState';
|
|
14
15
|
import StatusListItem from '../StatusListItem/StatusListItem';
|
|
15
|
-
import commonStyle from '@zohodesk/components/
|
|
16
|
-
import ResponsiveDropBox from '@zohodesk/components/
|
|
17
|
-
import { ResponsiveReceiver } from '@zohodesk/components/
|
|
18
|
-
import {
|
|
19
|
-
import btnStyle from '@zohodesk/components/
|
|
16
|
+
import commonStyle from '@zohodesk/components/es/common/common.module.css';
|
|
17
|
+
import ResponsiveDropBox from '@zohodesk/components/es/v1/ResponsiveDropBox/ResponsiveDropBox';
|
|
18
|
+
import { ResponsiveReceiver } from '@zohodesk/components/es/v1/Responsive/CustomResponsive';
|
|
19
|
+
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
20
|
+
import btnStyle from '@zohodesk/components/es/semantic/Button/semanticButton.module.css';
|
|
20
21
|
import style from '../../../../list/status/StatusDropdown/StatusDropdown.module.css';
|
|
21
|
-
export class StatusDropdown extends React.Component {
|
|
22
|
-
constructor(props) {
|
|
23
|
-
super(props);
|
|
24
|
-
this.state = {
|
|
25
|
-
searchString: '',
|
|
26
|
-
selectedIndex: 0,
|
|
27
|
-
options: props.options
|
|
28
|
-
};
|
|
29
|
-
this.handleChange = this.handleChange.bind(this);
|
|
30
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
31
|
-
this.onSelect = this.onSelect.bind(this);
|
|
32
|
-
this.handleTogglePopup = this.handleTogglePopup.bind(this);
|
|
33
|
-
this.onSearchClear = this.onSearchClear.bind(this);
|
|
34
|
-
this.searchList = this.searchList.bind(this);
|
|
35
|
-
this.scrollContentRef = this.scrollContentRef.bind(this);
|
|
36
|
-
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
37
|
-
this.searchInputRef = this.searchInputRef.bind(this);
|
|
38
|
-
this.itemRef = this.itemRef.bind(this);
|
|
39
|
-
this.inputRef = this.inputRef.bind(this);
|
|
40
|
-
this.handleScroll = this.handleScroll.bind(this);
|
|
41
|
-
this.emptySearchSVG = this.emptySearchSVG.bind(this);
|
|
42
|
-
this.getAriaId = getUniqueId(this);
|
|
43
|
-
}
|
|
44
22
|
|
|
45
|
-
|
|
23
|
+
function StatusDropdown(props) {
|
|
24
|
+
let {
|
|
25
|
+
value,
|
|
26
|
+
removeClose,
|
|
27
|
+
boxSize,
|
|
28
|
+
keyName,
|
|
29
|
+
idName,
|
|
30
|
+
title,
|
|
31
|
+
isSearch,
|
|
32
|
+
isArrow,
|
|
33
|
+
placeHolderText,
|
|
34
|
+
className,
|
|
35
|
+
right,
|
|
36
|
+
left,
|
|
37
|
+
top,
|
|
38
|
+
bottom,
|
|
39
|
+
isPopupOpen: isOpen,
|
|
40
|
+
isPopupReady,
|
|
41
|
+
position,
|
|
42
|
+
getTargetRef,
|
|
43
|
+
getContainerRef,
|
|
44
|
+
dataId,
|
|
45
|
+
searchBoxSize,
|
|
46
|
+
searchEmptyHint,
|
|
47
|
+
searchErrorText,
|
|
48
|
+
activeStyle,
|
|
49
|
+
showOnHover = false,
|
|
50
|
+
isDisabled,
|
|
51
|
+
showIconOnHover,
|
|
52
|
+
isReadOnly,
|
|
53
|
+
hoverStyle,
|
|
54
|
+
isEditable,
|
|
55
|
+
needTick,
|
|
56
|
+
dataTitle,
|
|
57
|
+
isDataLoaded,
|
|
58
|
+
children,
|
|
59
|
+
targetAlign,
|
|
60
|
+
needResponsive,
|
|
61
|
+
arrowIconPosition,
|
|
62
|
+
statusColor,
|
|
63
|
+
needExternalPopupState = false,
|
|
64
|
+
isPopupActive = false,
|
|
65
|
+
needMultiLineText,
|
|
66
|
+
boxPosition,
|
|
67
|
+
togglePopup,
|
|
68
|
+
onTogglePopup,
|
|
69
|
+
onClick,
|
|
70
|
+
onSelectLabel,
|
|
71
|
+
isNextOptions,
|
|
72
|
+
getNextOptions,
|
|
73
|
+
options,
|
|
74
|
+
a11y = {}
|
|
75
|
+
} = props;
|
|
76
|
+
const [optionsList, setOptionsList] = useState(options);
|
|
77
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
78
|
+
const [searchString, setSearchString] = useState('');
|
|
79
|
+
const hiddenInput = useRef(null);
|
|
80
|
+
const searchInput = useRef(null);
|
|
81
|
+
const optionsContainer = useRef(null);
|
|
82
|
+
const dropdown = useRef({});
|
|
83
|
+
const getAriaId = useUniqueId();
|
|
84
|
+
const {
|
|
85
|
+
tabIndex = 0,
|
|
86
|
+
ariaLabelledby,
|
|
87
|
+
ariaLabel
|
|
88
|
+
} = a11y;
|
|
89
|
+
let isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
|
|
90
|
+
let containerClass = `${className ? className : ''} ${isPopupReady ? activeStyle ? activeStyle : '' : showIconOnHover ? style.hoverIcon : ''} ${isDisabled ? commonStyle.disabled : isReadOnly ? style.readOnly : !isEditable ? style.cursorDefault : !showOnHover ? `${style.cursor} ${hoverStyle ? hoverStyle : ''}` : `${hoverStyle ? hoverStyle : ''} ${style.cursorDefault}`}`;
|
|
91
|
+
let ariaTitleId = getAriaId();
|
|
92
|
+
|
|
93
|
+
function emptySearchSVG() {
|
|
46
94
|
return /*#__PURE__*/React.createElement(EmptySearch, {
|
|
47
95
|
size: "small"
|
|
48
96
|
});
|
|
49
97
|
}
|
|
50
98
|
|
|
51
|
-
|
|
52
|
-
|
|
99
|
+
function handleInputRef(el) {
|
|
100
|
+
hiddenInput.current = el;
|
|
53
101
|
}
|
|
54
102
|
|
|
55
|
-
itemRef(ele, index, id) {
|
|
56
|
-
|
|
103
|
+
function itemRef(ele, index, id) {
|
|
104
|
+
dropdown.current[`suggestion_${id}`] = ele;
|
|
57
105
|
}
|
|
58
106
|
|
|
59
|
-
searchInputRef(el) {
|
|
60
|
-
|
|
107
|
+
function searchInputRef(el) {
|
|
108
|
+
searchInput.current = el;
|
|
61
109
|
}
|
|
62
110
|
|
|
63
|
-
handleTogglePopup(e) {
|
|
64
|
-
let {
|
|
65
|
-
togglePopup,
|
|
66
|
-
boxPosition,
|
|
67
|
-
onSelectLabel,
|
|
68
|
-
isPopupOpen,
|
|
69
|
-
onTogglePopup
|
|
70
|
-
} = this.props;
|
|
111
|
+
function handleTogglePopup(e) {
|
|
71
112
|
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
72
113
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
73
114
|
togglePopup(e, boxPosition);
|
|
74
115
|
}
|
|
75
116
|
|
|
76
|
-
scrollContentRef(el) {
|
|
77
|
-
let {
|
|
78
|
-
isPopupOpen
|
|
79
|
-
} = this.props;
|
|
80
|
-
|
|
117
|
+
function scrollContentRef(el) {
|
|
81
118
|
if (isPopupOpen) {
|
|
82
|
-
|
|
119
|
+
optionsContainer.current = el;
|
|
83
120
|
}
|
|
84
121
|
}
|
|
85
122
|
|
|
86
|
-
|
|
87
|
-
if (nextProps.options.length != this.props.options.length) {
|
|
88
|
-
this.setState({
|
|
89
|
-
options: nextProps.options
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
onSelect(element, e) {
|
|
95
|
-
let {
|
|
96
|
-
onClick,
|
|
97
|
-
togglePopup,
|
|
98
|
-
isPopupOpen,
|
|
99
|
-
onTogglePopup
|
|
100
|
-
} = this.props;
|
|
123
|
+
function onSelect(element, e) {
|
|
101
124
|
onClick && onClick(e, element);
|
|
102
125
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
103
126
|
togglePopup(e);
|
|
104
127
|
}
|
|
105
128
|
|
|
106
|
-
|
|
107
|
-
let {
|
|
108
|
-
isPopupOpen,
|
|
109
|
-
isSearch,
|
|
110
|
-
idName
|
|
111
|
-
} = this.props;
|
|
112
|
-
let {
|
|
113
|
-
selectedIndex,
|
|
114
|
-
options
|
|
115
|
-
} = this.state;
|
|
116
|
-
|
|
117
|
-
if (prevProps.isPopupOpen != isPopupOpen) {
|
|
118
|
-
setTimeout(() => {
|
|
119
|
-
isPopupOpen && isSearch ? this.searchInput && this.searchInput.focus() : this.hiddenInput && this.hiddenInput.focus();
|
|
120
|
-
}, 10);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
let mergeOptions = options;
|
|
124
|
-
let option = mergeOptions[selectedIndex];
|
|
125
|
-
let id = option && option[idName] || {};
|
|
126
|
-
let selSuggestion = this[`suggestion_${id}`];
|
|
127
|
-
|
|
128
|
-
if (isPopupOpen) {
|
|
129
|
-
this.optionsContainer && scrollTo(this.optionsContainer, selSuggestion);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (!prevProps.isPopupOpen && this.props.isPopupOpen) {
|
|
133
|
-
this.onSearchClear();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
handleKeyDown(e) {
|
|
129
|
+
function handleKeyDown(e) {
|
|
138
130
|
let {
|
|
139
131
|
keyCode
|
|
140
132
|
} = e;
|
|
141
|
-
let
|
|
142
|
-
selectedIndex,
|
|
143
|
-
options
|
|
144
|
-
} = this.state;
|
|
145
|
-
let totalIndex = options.length;
|
|
146
|
-
let {
|
|
147
|
-
togglePopup,
|
|
148
|
-
onClick,
|
|
149
|
-
boxPosition,
|
|
150
|
-
isPopupReady,
|
|
151
|
-
isNextOptions,
|
|
152
|
-
getNextOptions,
|
|
153
|
-
onTogglePopup,
|
|
154
|
-
isPopupOpen
|
|
155
|
-
} = this.props;
|
|
133
|
+
let totalIndex = optionsList.length;
|
|
156
134
|
|
|
157
135
|
if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
158
136
|
e.preventDefault(); //prevent body scroll
|
|
@@ -162,36 +140,28 @@ export class StatusDropdown extends React.Component {
|
|
|
162
140
|
switch (keyCode) {
|
|
163
141
|
case 40:
|
|
164
142
|
if (selectedIndex === totalIndex - 1) {
|
|
165
|
-
|
|
166
|
-
selectedIndex: 0
|
|
167
|
-
});
|
|
143
|
+
setSelectedIndex(0);
|
|
168
144
|
} else {
|
|
169
145
|
if (selectedIndex === totalIndex - 3) {
|
|
170
146
|
isNextOptions && getNextOptions && getNextOptions();
|
|
171
147
|
}
|
|
172
148
|
|
|
173
|
-
|
|
174
|
-
selectedIndex: selectedIndex + 1
|
|
175
|
-
});
|
|
149
|
+
setSelectedIndex(selectedIndex + 1);
|
|
176
150
|
}
|
|
177
151
|
|
|
178
152
|
break;
|
|
179
153
|
|
|
180
154
|
case 38:
|
|
181
155
|
if (selectedIndex === 0) {
|
|
182
|
-
|
|
183
|
-
selectedIndex: totalIndex - 1
|
|
184
|
-
});
|
|
156
|
+
setSelectedIndex(totalIndex - 1);
|
|
185
157
|
} else {
|
|
186
|
-
|
|
187
|
-
selectedIndex: selectedIndex - 1
|
|
188
|
-
});
|
|
158
|
+
setSelectedIndex(selectedIndex - 1);
|
|
189
159
|
}
|
|
190
160
|
|
|
191
161
|
break;
|
|
192
162
|
|
|
193
163
|
case 13:
|
|
194
|
-
onClick && onClick(
|
|
164
|
+
onClick && onClick(optionsList[selectedIndex].name, e);
|
|
195
165
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
196
166
|
togglePopup(e, boxPosition);
|
|
197
167
|
break;
|
|
@@ -206,50 +176,35 @@ export class StatusDropdown extends React.Component {
|
|
|
206
176
|
}
|
|
207
177
|
}
|
|
208
178
|
|
|
209
|
-
searchList(value) {
|
|
210
|
-
let {
|
|
211
|
-
options,
|
|
212
|
-
keyName
|
|
213
|
-
} = this.props;
|
|
179
|
+
function searchList(value) {
|
|
214
180
|
let foptions = options.filter(dept => dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1);
|
|
215
181
|
return foptions;
|
|
216
182
|
}
|
|
217
183
|
|
|
218
|
-
handleChange(value, e) {
|
|
219
|
-
let foptions =
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
options: foptions
|
|
224
|
-
});
|
|
184
|
+
function handleChange(value, e) {
|
|
185
|
+
let foptions = searchList(value);
|
|
186
|
+
setSearchString(value);
|
|
187
|
+
setSelectedIndex(-1);
|
|
188
|
+
setOptionsList(foptions);
|
|
225
189
|
}
|
|
226
190
|
|
|
227
|
-
onSearchClear() {
|
|
228
|
-
let foptions =
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
options: foptions
|
|
232
|
-
});
|
|
191
|
+
function onSearchClear() {
|
|
192
|
+
let foptions = searchList('');
|
|
193
|
+
setSearchString('');
|
|
194
|
+
setOptionsList(foptions);
|
|
233
195
|
}
|
|
234
196
|
|
|
235
|
-
handleMouseEnter(id, value, index, e) {
|
|
236
|
-
|
|
237
|
-
selectedIndex: index
|
|
238
|
-
});
|
|
197
|
+
function handleMouseEnter(id, value, index, e) {
|
|
198
|
+
setSelectedIndex(index);
|
|
239
199
|
}
|
|
240
200
|
|
|
241
|
-
handleScroll(e) {
|
|
242
|
-
const {
|
|
243
|
-
isNextOptions,
|
|
244
|
-
getNextOptions
|
|
245
|
-
} = this.props;
|
|
246
|
-
|
|
201
|
+
function handleScroll(e) {
|
|
247
202
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
248
203
|
isNextOptions && getNextOptions && getNextOptions(e);
|
|
249
204
|
}
|
|
250
205
|
}
|
|
251
206
|
|
|
252
|
-
responsiveFunc(_ref) {
|
|
207
|
+
function responsiveFunc(_ref) {
|
|
253
208
|
let {
|
|
254
209
|
mediaQueryOR
|
|
255
210
|
} = _ref;
|
|
@@ -260,206 +215,160 @@ export class StatusDropdown extends React.Component {
|
|
|
260
215
|
};
|
|
261
216
|
}
|
|
262
217
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
218
|
+
useEffectCallOnlyAfterState(() => {
|
|
219
|
+
setOptionsList(options);
|
|
220
|
+
}, [options.length]);
|
|
221
|
+
useEffectCallOnlyAfterState(() => {
|
|
222
|
+
setTimeout(() => {
|
|
223
|
+
isPopupOpen && isSearch ? searchInput.current && searchInput.current.focus() : hiddenInput.current && hiddenInput.current.focus();
|
|
224
|
+
}, 10);
|
|
225
|
+
let mergeOptions = optionsList;
|
|
226
|
+
let option = mergeOptions[selectedIndex];
|
|
227
|
+
let id = option && option[idName] || {};
|
|
228
|
+
let selSuggestion = dropdown.current[`suggestion_${id}`];
|
|
229
|
+
|
|
230
|
+
if (isPopupOpen) {
|
|
231
|
+
optionsContainer.current && scrollTo(optionsContainer.current, selSuggestion);
|
|
232
|
+
onSearchClear();
|
|
233
|
+
}
|
|
234
|
+
}, [isPopupOpen]);
|
|
235
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
236
|
+
className: style.posRel,
|
|
237
|
+
onMouseEnter: showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : undefined,
|
|
238
|
+
onMouseLeave: showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : undefined
|
|
239
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
240
|
+
tagName: "button",
|
|
241
|
+
alignBox: "row",
|
|
242
|
+
className: `${style.container} ${containerClass} ${btnStyle.buttonReset}`,
|
|
243
|
+
onMouseDown: !showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : null,
|
|
244
|
+
eleRef: getTargetRef,
|
|
245
|
+
align: targetAlign,
|
|
246
|
+
isCover: false,
|
|
247
|
+
dataId: dataId,
|
|
248
|
+
onClick: removeClose,
|
|
249
|
+
disabled: isDisabled || isReadOnly ? true : false,
|
|
250
|
+
"aria-haspopup": true,
|
|
251
|
+
"aria-expanded": isPopupOpen && isEditable ? true : false,
|
|
252
|
+
tabIndex: tabIndex,
|
|
253
|
+
"aria-labelledby": ariaLabelledby,
|
|
254
|
+
"aria-label": ariaLabel,
|
|
255
|
+
"aria-disabled": isDisabled || isReadOnly
|
|
256
|
+
}, isEditable ? /*#__PURE__*/React.createElement("div", {
|
|
257
|
+
className: style.hiddenInput
|
|
258
|
+
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
259
|
+
type: "text",
|
|
260
|
+
inputRef: handleInputRef,
|
|
261
|
+
onKeyDown: handleKeyDown,
|
|
262
|
+
needAppearance: false,
|
|
263
|
+
placeHolder: placeHolderText
|
|
264
|
+
})) : null, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
265
|
+
className: `${style.value} toggleDropText`,
|
|
266
|
+
shrink: true,
|
|
267
|
+
tagName: "span",
|
|
268
|
+
"data-title": dataTitle
|
|
269
|
+
}, value), isEditable ? /*#__PURE__*/React.createElement(Icon, {
|
|
270
|
+
"aria-hidden": true,
|
|
271
|
+
size: "7",
|
|
272
|
+
name: "ZD-down",
|
|
273
|
+
iconClass: `${'toggleDropIcon'} ${style.arrow} ${style[`${arrowIconPosition}_arrow`]}`,
|
|
274
|
+
dataId: "statusdownarrow"
|
|
275
|
+
}) : null), isPopupOpen && isEditable ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
276
|
+
query: responsiveFunc,
|
|
277
|
+
responsiveId: "Helmet"
|
|
278
|
+
}, _ref2 => {
|
|
318
279
|
let {
|
|
319
|
-
|
|
320
|
-
} =
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
className: style.posRel,
|
|
325
|
-
onMouseEnter: showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : undefined,
|
|
326
|
-
onMouseLeave: showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : undefined
|
|
327
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
328
|
-
tagName: "button",
|
|
329
|
-
alignBox: "row",
|
|
330
|
-
className: `${style.container} ${containerClass} ${btnStyle.buttonReset}`,
|
|
331
|
-
onMouseDown: !showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : null,
|
|
332
|
-
eleRef: getTargetRef,
|
|
333
|
-
align: targetAlign,
|
|
334
|
-
isCover: false,
|
|
335
|
-
dataId: dataId,
|
|
280
|
+
tabletMode
|
|
281
|
+
} = _ref2;
|
|
282
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
283
|
+
boxPosition: position,
|
|
284
|
+
isActive: isPopupReady,
|
|
336
285
|
onClick: removeClose,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
286
|
+
size: boxSize,
|
|
287
|
+
right: right,
|
|
288
|
+
left: left,
|
|
289
|
+
top: top,
|
|
290
|
+
bottom: bottom,
|
|
291
|
+
isArrow: isArrow,
|
|
292
|
+
isAnimate: true,
|
|
293
|
+
getRef: getContainerRef,
|
|
294
|
+
customClass: {
|
|
295
|
+
customDropBoxWrap: style.dropBoxContainer
|
|
296
|
+
},
|
|
297
|
+
needResponsive: needResponsive,
|
|
298
|
+
isResponsivePadding: true
|
|
299
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
300
|
+
className: style.search
|
|
301
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
302
|
+
placeHolder: placeHolderText,
|
|
303
|
+
onChange: handleChange,
|
|
304
|
+
value: searchString,
|
|
305
|
+
onClear: onSearchClear,
|
|
306
|
+
size: searchBoxSize,
|
|
307
|
+
inputRef: searchInputRef,
|
|
308
|
+
onKeyDown: handleKeyDown,
|
|
309
|
+
a11y: {
|
|
310
|
+
ariaHaspopup: true,
|
|
311
|
+
ariaExpanded: true,
|
|
312
|
+
role: 'combobox',
|
|
313
|
+
ariaActivedescendant: value,
|
|
314
|
+
ariaOwns: ariaTitleId
|
|
315
|
+
}
|
|
316
|
+
})) : null, title && optionsList.length != 0 && /*#__PURE__*/React.createElement(Box, {
|
|
317
|
+
className: style.title
|
|
318
|
+
}, /*#__PURE__*/React.createElement(DropDownHeading, {
|
|
319
|
+
htmlId: ariaTitleId,
|
|
320
|
+
text: title,
|
|
321
|
+
a11y: {
|
|
322
|
+
role: 'heading'
|
|
323
|
+
}
|
|
324
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
325
|
+
scroll: "vertical",
|
|
326
|
+
flexible: true,
|
|
354
327
|
shrink: true,
|
|
355
|
-
|
|
356
|
-
"
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
inputRef: this.searchInputRef,
|
|
396
|
-
onKeyDown: this.handleKeyDown,
|
|
397
|
-
a11y: {
|
|
398
|
-
ariaHaspopup: true,
|
|
399
|
-
ariaExpanded: true,
|
|
400
|
-
role: 'combobox',
|
|
401
|
-
ariaActivedescendant: value,
|
|
402
|
-
ariaOwns: ariaTitleId
|
|
403
|
-
}
|
|
404
|
-
})) : null, title && options.length != 0 && /*#__PURE__*/React.createElement(Box, {
|
|
405
|
-
className: style.title
|
|
406
|
-
}, /*#__PURE__*/React.createElement(DropDownHeading, {
|
|
407
|
-
htmlId: ariaTitleId,
|
|
408
|
-
text: title,
|
|
409
|
-
a11y: {
|
|
410
|
-
role: 'heading'
|
|
411
|
-
}
|
|
412
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
413
|
-
scroll: "vertical",
|
|
414
|
-
flexible: true,
|
|
415
|
-
shrink: true,
|
|
416
|
-
dataId: `${dataId}_list`,
|
|
417
|
-
preventParentScroll: "vertical",
|
|
418
|
-
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
419
|
-
eleRef: this.scrollContentRef,
|
|
420
|
-
onScroll: this.handleScroll,
|
|
421
|
-
role: isSearch ? 'listbox' : 'menu',
|
|
422
|
-
"aria-labelledby": ariaTitleId,
|
|
423
|
-
tabindex: "0"
|
|
424
|
-
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
425
|
-
key: i
|
|
426
|
-
}, /*#__PURE__*/React.createElement(StatusListItem, {
|
|
427
|
-
dataId: `dataid_${i}`,
|
|
428
|
-
value: item[keyName],
|
|
429
|
-
id: item[idName],
|
|
430
|
-
active: value === item[keyName],
|
|
431
|
-
onClick: this.onSelect.bind(this, item),
|
|
432
|
-
index: i,
|
|
433
|
-
highlight: selectedIndex === i,
|
|
434
|
-
needTick: needTick,
|
|
435
|
-
needBorder: false,
|
|
436
|
-
onMouseEnter: this.handleMouseEnter,
|
|
437
|
-
getRef: this.itemRef,
|
|
438
|
-
bulletColor: item[statusColor],
|
|
439
|
-
title: item[keyName],
|
|
440
|
-
needMultiLineText: needMultiLineText,
|
|
441
|
-
a11y: {
|
|
442
|
-
role: isSearch ? 'option' : 'menuitem',
|
|
443
|
-
ariaSelected: value === item[keyName]
|
|
444
|
-
}
|
|
445
|
-
})))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
446
|
-
className: style.svgWrapper,
|
|
447
|
-
title: searchErrorText || 'No results',
|
|
448
|
-
description: searchEmptyHint,
|
|
449
|
-
size: "small",
|
|
450
|
-
getEmptyState: this.emptySearchSVG
|
|
451
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
452
|
-
className: style.loader
|
|
453
|
-
}, /*#__PURE__*/React.createElement(Loader, null)))));
|
|
454
|
-
}) : null);
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
} // if (__DOCS__) {
|
|
458
|
-
// StatusDropdown.docs = {
|
|
459
|
-
// componentGroup: 'Molecule'
|
|
460
|
-
// };
|
|
461
|
-
// }
|
|
328
|
+
dataId: `${dataId}_list`,
|
|
329
|
+
preventParentScroll: "vertical",
|
|
330
|
+
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
331
|
+
eleRef: scrollContentRef,
|
|
332
|
+
onScroll: handleScroll,
|
|
333
|
+
role: isSearch ? 'listbox' : 'menu',
|
|
334
|
+
"aria-labelledby": ariaTitleId,
|
|
335
|
+
tabindex: "0"
|
|
336
|
+
}, optionsList.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, optionsList.map((item, i) => /*#__PURE__*/React.createElement(React.Fragment, {
|
|
337
|
+
key: i
|
|
338
|
+
}, /*#__PURE__*/React.createElement(StatusListItem, {
|
|
339
|
+
dataId: `dataid_${i}`,
|
|
340
|
+
value: item[keyName],
|
|
341
|
+
id: item[idName],
|
|
342
|
+
active: value === item[keyName],
|
|
343
|
+
onClick: e => onSelect(item, e),
|
|
344
|
+
index: i,
|
|
345
|
+
highlight: selectedIndex === i,
|
|
346
|
+
needTick: needTick,
|
|
347
|
+
needBorder: false,
|
|
348
|
+
onMouseEnter: handleMouseEnter,
|
|
349
|
+
getRef: itemRef,
|
|
350
|
+
bulletColor: item[statusColor],
|
|
351
|
+
title: item[keyName],
|
|
352
|
+
needMultiLineText: needMultiLineText,
|
|
353
|
+
a11y: {
|
|
354
|
+
role: isSearch ? 'option' : 'menuitem',
|
|
355
|
+
ariaSelected: value === item[keyName]
|
|
356
|
+
}
|
|
357
|
+
})))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
358
|
+
className: style.svgWrapper,
|
|
359
|
+
title: searchErrorText || 'No results',
|
|
360
|
+
description: searchEmptyHint,
|
|
361
|
+
size: "small",
|
|
362
|
+
getEmptyState: emptySearchSVG
|
|
363
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
364
|
+
className: style.loader
|
|
365
|
+
}, /*#__PURE__*/React.createElement(Loader, null)))));
|
|
366
|
+
}) : null);
|
|
367
|
+
}
|
|
462
368
|
|
|
463
369
|
StatusDropdown.defaultProps = defaultProps;
|
|
464
370
|
StatusDropdown.propTypes = propTypes;
|
|
465
|
-
|
|
371
|
+
const StatusDropdown_Component = Popup(StatusDropdown);
|
|
372
|
+
StatusDropdown_Component.defaultProps = StatusDropdown.defaultProps;
|
|
373
|
+
StatusDropdown_Component.propTypes = StatusDropdown.propTypes;
|
|
374
|
+
export default StatusDropdown_Component;
|