@zohodesk/dot 1.2.2 → 1.2.4
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/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 +10 -10
- package/es/TagWithIcon/props/propTypes.js +1 -1
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +5 -2
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +7 -3
- package/es/layout/SubtabLayout/props/propTypes.js +1 -1
- package/es/list/status/StatusDropdown/StatusDropdown.js +4 -1
- package/es/list/status/StatusDropdown/props/propTypes.js +2 -1
- package/es/lookup/Lookup/Lookup.js +10 -10
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +2 -1
- package/es/setup/helptips/ListGroup/ListGroup.js +1 -1
- package/es/v1/Attachment/Attachment.js +88 -0
- package/es/v1/AttachmentViewer/AttachmentImage.js +79 -0
- package/es/v1/AttachmentViewer/AttachmentViewer.js +541 -0
- package/es/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/es/v1/Drawer/Drawer.js +11 -11
- package/es/v1/FlipCard/FlipCard.js +3 -3
- package/es/v1/FreezeLayer/FreezeLayer.js +74 -0
- package/es/v1/Image/Image.js +39 -0
- package/es/v1/Link/Link.js +2 -1
- package/es/v1/Loader/Loader.js +21 -0
- package/es/v1/Message/Message.js +118 -0
- package/es/v1/MessageBanner/MessageBanner.js +1 -1
- package/es/v1/PlusIcon/PlusIcon.js +44 -0
- package/es/v1/Separator/Separator.js +60 -0
- package/es/v1/ToastMessage/ToastMessage.js +203 -0
- package/es/v1/Upload/Upload.js +76 -0
- package/es/v1/actions/AutoClose.js +43 -0
- package/es/v1/alert/index.js +2 -0
- package/es/v1/avatar/AvatarClose/AvatarClose.js +53 -0
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +62 -0
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +54 -0
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +72 -0
- package/es/v1/avatar/AvatarThread/AvatarThread.js +79 -0
- package/es/v1/avatar/AvatarUser/AvatarUser.js +116 -0
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +98 -0
- package/es/v1/avatar/index.js +7 -0
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +861 -0
- package/es/v1/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +86 -0
- package/es/v1/errorstate/LinkText/LinkText.js +29 -0
- package/es/v1/errorstate/NoRequestFound/NoRequestFound.js +84 -0
- package/es/v1/errorstate/PermissionPlay/PermissionPlay.js +83 -0
- package/es/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +84 -0
- package/es/v1/errorstate/UnableToProcess/UnableToProcess.js +86 -0
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +84 -0
- package/es/v1/errorstate/WillBack/WillBack.js +75 -0
- package/es/v1/errorstate/index.js +8 -0
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +141 -0
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +183 -0
- package/es/v1/form/fields/DateField/DateField.js +195 -0
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +71 -0
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +213 -0
- package/es/v1/form/fields/PhoneField/PhoneField.js +189 -0
- package/es/v1/form/fields/RadioField/RadioField.js +116 -0
- package/es/v1/form/fields/SelectField/SelectField.js +183 -0
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +292 -0
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +258 -0
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +164 -0
- package/es/v1/form/fields/TextEditor/TextEditor.js +418 -0
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +178 -0
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +203 -0
- package/es/v1/form/fields/TextareaField/TextareaField.js +161 -0
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +58 -0
- package/es/v1/form/fields/index.js +16 -0
- package/es/v1/form/layout/Field/Field.js +33 -0
- package/es/v1/form/layout/Section/Section.js +37 -0
- package/es/v1/form/layout/index.js +2 -0
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +217 -0
- package/es/v1/layout/SetupDetailLayout/index.js +4 -0
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +144 -0
- package/es/v1/layout/SubtabLayout/index.js +4 -0
- package/es/v1/list/AvatarFlip/AvatarFlip.js +76 -0
- package/es/v1/list/BluePrintStatus/BluePrintStatus.js +28 -0
- package/es/v1/list/Comment/Comment.js +45 -0
- package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +100 -0
- package/es/v1/list/Dot/Dot.js +22 -0
- package/es/v1/list/DotNew/DotNew.js +29 -0
- package/es/v1/list/GridStencils/GridStencils.js +34 -0
- package/es/v1/list/Icons/AddNewIcon.js +28 -0
- package/es/v1/list/Icons/CompleteIcon.js +30 -0
- package/es/v1/list/Icons/DeleteIcon.js +31 -0
- package/es/v1/list/Icons/EditIcon.js +31 -0
- package/es/v1/list/Icons/FloatingIcons.js +30 -0
- package/es/v1/list/Icons/ReadUnreadIcon.js +35 -0
- package/es/v1/list/Icons/SmartIcon.js +28 -0
- package/es/v1/list/Icons/index.js +7 -0
- package/es/v1/list/ListLayout/ListLayout.js +83 -0
- package/es/v1/list/ListStencils/ListStencils.js +47 -0
- package/es/v1/list/SecondaryText/AccountName.js +85 -0
- package/es/v1/list/SecondaryText/ContactName.js +85 -0
- package/es/v1/list/SecondaryText/DepartmentText.js +30 -0
- package/es/v1/list/SecondaryText/Email.js +55 -0
- package/es/v1/list/SecondaryText/HappinessRating.js +31 -0
- package/es/v1/list/SecondaryText/PhoneNumber.js +59 -0
- package/es/v1/list/SecondaryText/PriorityText.js +33 -0
- package/es/v1/list/SecondaryText/SecondaryText.js +40 -0
- package/es/v1/list/SecondaryText/StatusText.js +34 -0
- package/es/v1/list/SecondaryText/TicketId.js +53 -0
- package/es/v1/list/SecondaryText/Website.js +43 -0
- package/es/v1/list/SecondaryText/index.js +11 -0
- package/es/v1/list/SecondryPanel/SecondryPanel.js +105 -0
- package/es/v1/list/SentimentStatus/SentimentStatus.js +34 -0
- package/es/v1/list/Subject/Subject.js +57 -0
- package/es/v1/list/TagNew/TagNew.js +33 -0
- package/es/v1/list/Thread/Thread.js +43 -0
- package/es/v1/list/UserTime/UserTime.js +83 -0
- package/es/v1/list/index.js +17 -0
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +465 -0
- package/es/v1/list/status/StatusListItem/StatusListItem.js +122 -0
- package/es/v1/list/status/index.js +2 -0
- package/es/v1/lookup/EmptyPage/EmptyPage.js +65 -0
- package/es/v1/lookup/Lookup/Lookup.js +12 -10
- package/es/v1/lookup/Section/Section.js +25 -0
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +176 -0
- package/es/v1/lookup/header/index.js +5 -0
- package/es/v1/setup/header/Button/Button.js +36 -0
- package/es/v1/setup/header/Link/Link.js +44 -0
- package/es/v1/setup/header/Search/Search.js +81 -0
- package/es/v1/setup/header/Views/Views.js +46 -0
- package/es/v1/setup/header/index.js +4 -0
- package/es/v1/setup/helptips/Description/Description.js +24 -0
- package/es/v1/setup/helptips/Link/Link.js +41 -0
- package/es/v1/setup/helptips/ListGroup/ListGroup.js +39 -0
- package/es/v1/setup/helptips/Title/Title.js +24 -0
- package/es/v1/setup/helptips/index.js +4 -0
- package/es/v1/setup/index.js +6 -0
- package/es/v1/setup/table/index.js +5 -0
- package/es/v1/svg/PlusIcon.js +32 -0
- package/es/v1/svg/SnippetIcon.js +34 -0
- package/es/v1/svg/TemplateIcon.js +35 -0
- package/es/v1/svg/index.js +3 -0
- package/es/v1/version2/alertIcons/index.js +8 -0
- package/es/v1/version2/index.js +12 -0
- package/es/v1/version2/lookup/AlertHeader/AlertHeader.js +79 -0
- package/es/v1/version2/lookup/AlertLookup/AlertLookup.js +17 -5
- package/es/v1/version2/notification/DesktopNotification/DesktopNotification.js +164 -0
- package/lib/Drawer/Drawer.js +15 -15
- package/lib/TagWithIcon/props/propTypes.js +1 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +5 -3
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/lib/layout/SubtabLayout/props/propTypes.js +1 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +4 -3
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/lookup/Lookup/Lookup.js +15 -15
- package/lib/lookup/header/ViewDropDown/ViewDropDown.js +2 -1
- package/lib/setup/helptips/ListGroup/ListGroup.js +1 -1
- package/lib/v1/Attachment/Attachment.js +140 -0
- package/lib/v1/AttachmentViewer/AttachmentImage.js +124 -0
- package/lib/v1/AttachmentViewer/AttachmentViewer.js +625 -0
- package/lib/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/v1/Drawer/Drawer.js +16 -16
- package/lib/v1/FlipCard/FlipCard.js +3 -3
- package/lib/v1/FreezeLayer/FreezeLayer.js +94 -0
- package/lib/v1/Image/Image.js +89 -0
- package/lib/v1/Link/Link.js +2 -1
- package/lib/v1/Loader/Loader.js +70 -0
- package/lib/v1/Message/Message.js +170 -0
- package/lib/v1/MessageBanner/MessageBanner.js +1 -1
- package/lib/v1/PlusIcon/PlusIcon.js +91 -0
- package/lib/v1/Separator/Separator.js +107 -0
- package/lib/v1/ToastMessage/ToastMessage.js +246 -0
- package/lib/v1/Upload/Upload.js +128 -0
- package/lib/v1/actions/AutoClose.js +75 -0
- package/lib/v1/alert/index.js +23 -0
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +101 -0
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +110 -0
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +106 -0
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +119 -0
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +130 -0
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +167 -0
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +154 -0
- package/lib/v1/avatar/index.js +63 -0
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +932 -0
- package/lib/v1/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +137 -0
- package/lib/v1/errorstate/LinkText/LinkText.js +80 -0
- package/lib/v1/errorstate/NoRequestFound/NoRequestFound.js +135 -0
- package/lib/v1/errorstate/PermissionPlay/PermissionPlay.js +134 -0
- package/lib/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +135 -0
- package/lib/v1/errorstate/UnableToProcess/UnableToProcess.js +137 -0
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +135 -0
- package/lib/v1/errorstate/WillBack/WillBack.js +125 -0
- package/lib/v1/errorstate/index.js +71 -0
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +197 -0
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +234 -0
- package/lib/v1/form/fields/DateField/DateField.js +249 -0
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +118 -0
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +268 -0
- package/lib/v1/form/fields/PhoneField/PhoneField.js +236 -0
- package/lib/v1/form/fields/RadioField/RadioField.js +169 -0
- package/lib/v1/form/fields/SelectField/SelectField.js +236 -0
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +346 -0
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +299 -0
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +219 -0
- package/lib/v1/form/fields/TextEditor/TextEditor.js +463 -0
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +230 -0
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +256 -0
- package/lib/v1/form/fields/TextareaField/TextareaField.js +215 -0
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +110 -0
- package/lib/{docs/formDocs.js → v1/form/fields/index.js} +33 -25
- package/lib/v1/form/layout/Field/Field.js +87 -0
- package/lib/v1/form/layout/Section/Section.js +86 -0
- package/lib/v1/form/layout/index.js +23 -0
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +305 -0
- package/lib/v1/layout/SetupDetailLayout/index.js +37 -0
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +245 -0
- package/lib/v1/layout/SubtabLayout/index.js +37 -0
- package/lib/v1/list/AvatarFlip/AvatarFlip.js +131 -0
- package/lib/v1/list/BluePrintStatus/BluePrintStatus.js +73 -0
- package/lib/v1/list/Comment/Comment.js +98 -0
- package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +157 -0
- package/lib/v1/list/Dot/Dot.js +72 -0
- package/lib/v1/list/DotNew/DotNew.js +79 -0
- package/lib/v1/list/GridStencils/GridStencils.js +83 -0
- package/lib/v1/list/Icons/AddNewIcon.js +79 -0
- package/lib/v1/list/Icons/CompleteIcon.js +81 -0
- package/lib/v1/list/Icons/DeleteIcon.js +82 -0
- package/lib/v1/list/Icons/EditIcon.js +82 -0
- package/lib/v1/list/Icons/FloatingIcons.js +87 -0
- package/lib/v1/list/Icons/ReadUnreadIcon.js +87 -0
- package/lib/v1/list/Icons/SmartIcon.js +83 -0
- package/lib/v1/list/Icons/index.js +63 -0
- package/lib/v1/list/ListLayout/ListLayout.js +145 -0
- package/lib/v1/list/ListStencils/ListStencils.js +96 -0
- package/lib/v1/list/SecondaryText/AccountName.js +136 -0
- package/lib/v1/list/SecondaryText/ContactName.js +144 -0
- package/lib/v1/list/SecondaryText/DepartmentText.js +79 -0
- package/lib/v1/list/SecondaryText/Email.js +103 -0
- package/lib/v1/list/SecondaryText/HappinessRating.js +81 -0
- package/lib/v1/list/SecondaryText/PhoneNumber.js +107 -0
- package/lib/v1/list/SecondaryText/PriorityText.js +83 -0
- package/lib/v1/list/SecondaryText/SecondaryText.js +88 -0
- package/lib/v1/list/SecondaryText/StatusText.js +84 -0
- package/lib/v1/list/SecondaryText/TicketId.js +104 -0
- package/lib/v1/list/SecondaryText/Website.js +91 -0
- package/lib/v1/list/SecondaryText/index.js +95 -0
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +205 -0
- package/lib/v1/list/SentimentStatus/SentimentStatus.js +80 -0
- package/lib/v1/list/Subject/Subject.js +108 -0
- package/lib/v1/list/TagNew/TagNew.js +83 -0
- package/lib/v1/list/Thread/Thread.js +95 -0
- package/lib/v1/list/UserTime/UserTime.js +136 -0
- package/lib/v1/list/index.js +173 -0
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +541 -0
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +168 -0
- package/lib/v1/list/status/index.js +23 -0
- package/lib/v1/lookup/EmptyPage/EmptyPage.js +120 -0
- package/lib/v1/lookup/Lookup/Lookup.js +17 -15
- package/lib/v1/lookup/Section/Section.js +75 -0
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +221 -0
- package/lib/v1/lookup/header/index.js +47 -0
- package/lib/v1/setup/header/Button/Button.js +83 -0
- package/lib/v1/setup/header/Link/Link.js +93 -0
- package/lib/v1/setup/header/Search/Search.js +126 -0
- package/lib/v1/setup/header/Views/Views.js +93 -0
- package/lib/v1/setup/header/index.js +39 -0
- package/lib/v1/setup/helptips/Description/Description.js +68 -0
- package/lib/v1/setup/helptips/Link/Link.js +88 -0
- package/lib/v1/setup/helptips/ListGroup/ListGroup.js +88 -0
- package/lib/v1/setup/helptips/Title/Title.js +68 -0
- package/lib/v1/setup/helptips/index.js +39 -0
- package/lib/v1/setup/index.js +24 -0
- package/lib/v1/setup/table/index.js +47 -0
- package/lib/v1/svg/PlusIcon.js +82 -0
- package/lib/v1/svg/SnippetIcon.js +84 -0
- package/lib/v1/svg/TemplateIcon.js +85 -0
- package/lib/v1/svg/index.js +31 -0
- package/lib/v1/version2/alertIcons/index.js +71 -0
- package/lib/v1/version2/index.js +58 -0
- package/lib/v1/version2/lookup/AlertHeader/AlertHeader.js +104 -0
- package/lib/v1/version2/lookup/AlertLookup/AlertLookup.js +17 -5
- package/lib/v1/version2/notification/DesktopNotification/DesktopNotification.js +193 -0
- package/package.json +9 -9
- package/result.json +1 -1
- package/es/docs/formDocs.js +0 -15
- package/es/docs/generalDocs.js +0 -63
- package/es/docs/lookupDocs.js +0 -17
- package/es/docs/setupDocs.js +0 -11
- package/lib/docs/generalDocs.js +0 -479
- package/lib/docs/lookupDocs.js +0 -135
- package/lib/docs/setupDocs.js +0 -95
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { default as AvatarFlip } from './AvatarFlip/AvatarFlip';
|
|
2
|
+
export { default as BluePrintStatus } from './BluePrintStatus/BluePrintStatus';
|
|
3
|
+
export { default as Comment } from './Comment/Comment';
|
|
4
|
+
export { default as DepartmentDropDown } from './DepartmentDropDown/DepartmentDropDown';
|
|
5
|
+
export { default as Dot } from './Dot/Dot';
|
|
6
|
+
export { default as DotNew } from './DotNew/DotNew';
|
|
7
|
+
export { default as GridStencils } from './GridStencils/GridStencils';
|
|
8
|
+
export { default as ListLayout, Column } from './ListLayout/ListLayout';
|
|
9
|
+
export { default as ListStencils } from './ListStencils/ListStencils';
|
|
10
|
+
export { default as SecondryPanel, SecondryPanelUL, SecondryPanelLI, SecondryPanelItem } from './SecondryPanel/SecondryPanel';
|
|
11
|
+
export { default as SentimentStatus } from './SentimentStatus/SentimentStatus';
|
|
12
|
+
export { default as StatusDropdown } from './status/StatusDropdown/StatusDropdown';
|
|
13
|
+
export { default as StatusListItem } from './status/StatusListItem/StatusListItem';
|
|
14
|
+
export { default as Subject } from './Subject/Subject';
|
|
15
|
+
export { default as TagNew } from './TagNew/TagNew';
|
|
16
|
+
export { default as Thread } from './Thread/Thread';
|
|
17
|
+
export { default as UserTime } from './UserTime/UserTime';
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../../../list/status/StatusDropdown/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../../../list/status/StatusDropdown/props/propTypes';
|
|
4
|
+
import { Icon } from '@zohodesk/icons';
|
|
5
|
+
import Popup from '@zohodesk/components/lib/Popup/Popup';
|
|
6
|
+
import { Box, Container } from '@zohodesk/components/lib/Layout';
|
|
7
|
+
import DropDownHeading from '@zohodesk/components/lib/DropDown/DropDownHeading';
|
|
8
|
+
import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
|
|
9
|
+
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
10
|
+
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
11
|
+
import { scrollTo } from '@zohodesk/components/lib/utils/Common.js';
|
|
12
|
+
import TextBox from '@zohodesk/components/lib/TextBox/TextBox';
|
|
13
|
+
import CommonEmptyState from '../../../emptystate/CommonEmptyState/CommonEmptyState';
|
|
14
|
+
import StatusListItem from '../StatusListItem/StatusListItem';
|
|
15
|
+
import commonStyle from '@zohodesk/components/lib/common/common.module.css';
|
|
16
|
+
import ResponsiveDropBox from '@zohodesk/components/lib/ResponsiveDropBox/ResponsiveDropBox';
|
|
17
|
+
import { ResponsiveReceiver } from '@zohodesk/components/lib/Responsive/CustomResponsive';
|
|
18
|
+
import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
19
|
+
import btnStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css';
|
|
20
|
+
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
|
+
|
|
45
|
+
emptySearchSVG() {
|
|
46
|
+
return /*#__PURE__*/React.createElement(EmptySearch, {
|
|
47
|
+
size: "small"
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
inputRef(el) {
|
|
52
|
+
this.hiddenInput = el;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
itemRef(ele, index, id) {
|
|
56
|
+
this[`suggestion_${id}`] = ele;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
searchInputRef(el) {
|
|
60
|
+
this.searchInput = el;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
handleTogglePopup(e) {
|
|
64
|
+
let {
|
|
65
|
+
togglePopup,
|
|
66
|
+
boxPosition,
|
|
67
|
+
onSelectLabel,
|
|
68
|
+
isPopupOpen,
|
|
69
|
+
onTogglePopup
|
|
70
|
+
} = this.props;
|
|
71
|
+
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
72
|
+
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
73
|
+
togglePopup(e, boxPosition);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
scrollContentRef(el) {
|
|
77
|
+
let {
|
|
78
|
+
isPopupOpen
|
|
79
|
+
} = this.props;
|
|
80
|
+
|
|
81
|
+
if (isPopupOpen) {
|
|
82
|
+
this.optionsContainer = el;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
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;
|
|
101
|
+
onClick && onClick(e, element);
|
|
102
|
+
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
103
|
+
togglePopup(e);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
componentDidUpdate(prevProps) {
|
|
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) {
|
|
138
|
+
let {
|
|
139
|
+
keyCode
|
|
140
|
+
} = 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;
|
|
156
|
+
|
|
157
|
+
if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
158
|
+
e.preventDefault(); //prevent body scroll
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (isPopupReady) {
|
|
162
|
+
switch (keyCode) {
|
|
163
|
+
case 40:
|
|
164
|
+
if (selectedIndex === totalIndex - 1) {
|
|
165
|
+
this.setState({
|
|
166
|
+
selectedIndex: 0
|
|
167
|
+
});
|
|
168
|
+
} else {
|
|
169
|
+
if (selectedIndex === totalIndex - 3) {
|
|
170
|
+
isNextOptions && getNextOptions && getNextOptions();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
this.setState({
|
|
174
|
+
selectedIndex: selectedIndex + 1
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
break;
|
|
179
|
+
|
|
180
|
+
case 38:
|
|
181
|
+
if (selectedIndex === 0) {
|
|
182
|
+
this.setState({
|
|
183
|
+
selectedIndex: totalIndex - 1
|
|
184
|
+
});
|
|
185
|
+
} else {
|
|
186
|
+
this.setState({
|
|
187
|
+
selectedIndex: selectedIndex - 1
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
break;
|
|
192
|
+
|
|
193
|
+
case 13:
|
|
194
|
+
onClick && onClick(options[selectedIndex].name, e);
|
|
195
|
+
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
196
|
+
togglePopup(e, boxPosition);
|
|
197
|
+
break;
|
|
198
|
+
|
|
199
|
+
default:
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
} else {
|
|
203
|
+
if (keyCode === 13 || keyCode === 40) {
|
|
204
|
+
togglePopup(e, boxPosition);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
searchList(value) {
|
|
210
|
+
let {
|
|
211
|
+
options,
|
|
212
|
+
keyName
|
|
213
|
+
} = this.props;
|
|
214
|
+
let foptions = options.filter(dept => dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1);
|
|
215
|
+
return foptions;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
handleChange(value, e) {
|
|
219
|
+
let foptions = this.searchList(value);
|
|
220
|
+
this.setState({
|
|
221
|
+
searchString: value,
|
|
222
|
+
selectedIndex: -1,
|
|
223
|
+
options: foptions
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
onSearchClear() {
|
|
228
|
+
let foptions = this.searchList('');
|
|
229
|
+
this.setState({
|
|
230
|
+
searchString: '',
|
|
231
|
+
options: foptions
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
handleMouseEnter(id, value, index, e) {
|
|
236
|
+
this.setState({
|
|
237
|
+
selectedIndex: index
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
handleScroll(e) {
|
|
242
|
+
const {
|
|
243
|
+
isNextOptions,
|
|
244
|
+
getNextOptions
|
|
245
|
+
} = this.props;
|
|
246
|
+
|
|
247
|
+
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
248
|
+
isNextOptions && getNextOptions && getNextOptions(e);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
responsiveFunc(_ref) {
|
|
253
|
+
let {
|
|
254
|
+
mediaQueryOR
|
|
255
|
+
} = _ref;
|
|
256
|
+
return {
|
|
257
|
+
tabletMode: mediaQueryOR([{
|
|
258
|
+
maxWidth: 700
|
|
259
|
+
}])
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
render() {
|
|
264
|
+
let {
|
|
265
|
+
options,
|
|
266
|
+
selectedIndex
|
|
267
|
+
} = this.state;
|
|
268
|
+
let {
|
|
269
|
+
value,
|
|
270
|
+
removeClose,
|
|
271
|
+
boxSize,
|
|
272
|
+
keyName,
|
|
273
|
+
idName,
|
|
274
|
+
title,
|
|
275
|
+
isSearch,
|
|
276
|
+
isArrow,
|
|
277
|
+
placeHolderText,
|
|
278
|
+
className,
|
|
279
|
+
right,
|
|
280
|
+
left,
|
|
281
|
+
top,
|
|
282
|
+
bottom,
|
|
283
|
+
isPopupOpen: isOpen,
|
|
284
|
+
isPopupReady,
|
|
285
|
+
position,
|
|
286
|
+
getTargetRef,
|
|
287
|
+
getContainerRef,
|
|
288
|
+
dataId,
|
|
289
|
+
searchBoxSize,
|
|
290
|
+
searchEmptyHint,
|
|
291
|
+
searchErrorText,
|
|
292
|
+
activeStyle,
|
|
293
|
+
showOnHover = false,
|
|
294
|
+
isDisabled,
|
|
295
|
+
showIconOnHover,
|
|
296
|
+
isReadOnly,
|
|
297
|
+
hoverStyle,
|
|
298
|
+
isEditable,
|
|
299
|
+
needTick,
|
|
300
|
+
dataTitle,
|
|
301
|
+
isDataLoaded,
|
|
302
|
+
children,
|
|
303
|
+
targetAlign,
|
|
304
|
+
needResponsive,
|
|
305
|
+
arrowIconPosition,
|
|
306
|
+
statusColor,
|
|
307
|
+
needExternalPopupState = false,
|
|
308
|
+
isPopupActive = false,
|
|
309
|
+
needMultiLineText,
|
|
310
|
+
a11y = {}
|
|
311
|
+
} = this.props;
|
|
312
|
+
const {
|
|
313
|
+
tabIndex = 0,
|
|
314
|
+
ariaLabelledby,
|
|
315
|
+
ariaLabel
|
|
316
|
+
} = a11y;
|
|
317
|
+
let isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
|
|
318
|
+
let {
|
|
319
|
+
searchString
|
|
320
|
+
} = this.state;
|
|
321
|
+
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}`}`;
|
|
322
|
+
let ariaTitleId = this.getAriaId();
|
|
323
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
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,
|
|
336
|
+
onClick: removeClose,
|
|
337
|
+
disabled: isDisabled || isReadOnly ? true : false,
|
|
338
|
+
"aria-haspopup": true,
|
|
339
|
+
"aria-expanded": isPopupOpen && isEditable ? true : false,
|
|
340
|
+
tabIndex: tabIndex,
|
|
341
|
+
"aria-labelledby": ariaLabelledby,
|
|
342
|
+
"aria-label": ariaLabel,
|
|
343
|
+
"aria-disabled": isDisabled || isReadOnly
|
|
344
|
+
}, isEditable ? /*#__PURE__*/React.createElement("div", {
|
|
345
|
+
className: style.hiddenInput
|
|
346
|
+
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
347
|
+
type: "text",
|
|
348
|
+
inputRef: this.inputRef,
|
|
349
|
+
onKeyDown: this.handleKeyDown,
|
|
350
|
+
needAppearance: false,
|
|
351
|
+
placeHolder: placeHolderText
|
|
352
|
+
})) : null, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
353
|
+
className: `${style.value} toggleDropText`,
|
|
354
|
+
shrink: true,
|
|
355
|
+
tagName: "span",
|
|
356
|
+
"data-title": dataTitle
|
|
357
|
+
}, value), isEditable ? /*#__PURE__*/React.createElement(Icon, {
|
|
358
|
+
"aria-hidden": true,
|
|
359
|
+
size: "7",
|
|
360
|
+
name: "ZD-down",
|
|
361
|
+
iconClass: `${'toggleDropIcon'} ${style.arrow} ${style[`${arrowIconPosition}_arrow`]}`,
|
|
362
|
+
dataId: "statusdownarrow"
|
|
363
|
+
}) : null), isPopupOpen && isEditable ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
364
|
+
query: this.responsiveFunc,
|
|
365
|
+
responsiveId: "Helmet"
|
|
366
|
+
}, _ref2 => {
|
|
367
|
+
let {
|
|
368
|
+
tabletMode
|
|
369
|
+
} = _ref2;
|
|
370
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
371
|
+
boxPosition: position,
|
|
372
|
+
isActive: isPopupReady,
|
|
373
|
+
onClick: removeClose,
|
|
374
|
+
size: boxSize,
|
|
375
|
+
right: right,
|
|
376
|
+
left: left,
|
|
377
|
+
top: top,
|
|
378
|
+
bottom: bottom,
|
|
379
|
+
isArrow: isArrow,
|
|
380
|
+
isAnimate: true,
|
|
381
|
+
getRef: getContainerRef,
|
|
382
|
+
customClass: {
|
|
383
|
+
customDropBoxWrap: style.dropBoxContainer
|
|
384
|
+
},
|
|
385
|
+
needResponsive: needResponsive,
|
|
386
|
+
isResponsivePadding: true
|
|
387
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
388
|
+
className: style.search
|
|
389
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
390
|
+
placeHolder: placeHolderText,
|
|
391
|
+
onChange: this.handleChange,
|
|
392
|
+
value: searchString,
|
|
393
|
+
onClear: this.onSearchClear,
|
|
394
|
+
size: searchBoxSize,
|
|
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
|
+
// }
|
|
462
|
+
|
|
463
|
+
StatusDropdown.defaultProps = defaultProps;
|
|
464
|
+
StatusDropdown.propTypes = propTypes;
|
|
465
|
+
export default Popup(StatusDropdown);
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
/**** Libraries ****/
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { defaultProps } from './props/defaultProps';
|
|
6
|
+
import { propTypes } from './props/propTypes';
|
|
7
|
+
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
8
|
+
/**** Components ****/
|
|
9
|
+
|
|
10
|
+
import { Icon } from '@zohodesk/icons';
|
|
11
|
+
import CssProvider from '@zohodesk/components/lib/Provider/CssProvider';
|
|
12
|
+
/**** CSS ****/
|
|
13
|
+
|
|
14
|
+
import style from './StatusListItem.module.css';
|
|
15
|
+
export default class StatusListItem extends React.Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
this.handleClick = this.handleClick.bind(this);
|
|
19
|
+
this.getRef = this.getRef.bind(this);
|
|
20
|
+
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getRef(ele) {
|
|
24
|
+
this.ele = ele;
|
|
25
|
+
let {
|
|
26
|
+
index,
|
|
27
|
+
getRef,
|
|
28
|
+
id
|
|
29
|
+
} = this.props;
|
|
30
|
+
getRef && getRef(ele, index, id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
handleClick(e) {
|
|
34
|
+
let {
|
|
35
|
+
onClick,
|
|
36
|
+
id,
|
|
37
|
+
value,
|
|
38
|
+
index
|
|
39
|
+
} = this.props;
|
|
40
|
+
onClick && onClick(id, value, index, e);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleMouseEnter(e) {
|
|
44
|
+
let {
|
|
45
|
+
onMouseEnter,
|
|
46
|
+
id,
|
|
47
|
+
value,
|
|
48
|
+
index
|
|
49
|
+
} = this.props;
|
|
50
|
+
onMouseEnter && onMouseEnter(id, value, index, e);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
render() {
|
|
54
|
+
let {
|
|
55
|
+
size,
|
|
56
|
+
active,
|
|
57
|
+
highlight,
|
|
58
|
+
value,
|
|
59
|
+
autoHover,
|
|
60
|
+
palette,
|
|
61
|
+
title,
|
|
62
|
+
disableTitle,
|
|
63
|
+
needTick,
|
|
64
|
+
isLink,
|
|
65
|
+
href,
|
|
66
|
+
target,
|
|
67
|
+
needBorder,
|
|
68
|
+
isDisabled,
|
|
69
|
+
bulletColor,
|
|
70
|
+
a11y,
|
|
71
|
+
needMultiLineText
|
|
72
|
+
} = this.props;
|
|
73
|
+
let options = {};
|
|
74
|
+
let {
|
|
75
|
+
role,
|
|
76
|
+
ariaSelected,
|
|
77
|
+
ariaHidden = true
|
|
78
|
+
} = a11y;
|
|
79
|
+
|
|
80
|
+
if (isLink) {
|
|
81
|
+
options.href = href;
|
|
82
|
+
options.target = `_${target}`;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
86
|
+
role: role,
|
|
87
|
+
"aria-selected": ariaSelected,
|
|
88
|
+
isCover: false,
|
|
89
|
+
align: "baseline",
|
|
90
|
+
alignBox: "row",
|
|
91
|
+
className: `${style.list} ${style[size]} ${style[palette]} ${active ? style.active : highlight && !isDisabled ? style.hover : ''} ${autoHover && !isDisabled ? style.effect : ''} ${needTick ? style.withTick : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? style.withBorder : ''}`,
|
|
92
|
+
dataId: String(value).replace("'", '_'),
|
|
93
|
+
onClick: !isDisabled && this.handleClick,
|
|
94
|
+
onMouseEnter: this.handleMouseEnter,
|
|
95
|
+
eleRef: this.getRef,
|
|
96
|
+
tagName: isLink ? 'a' : 'li',
|
|
97
|
+
"data-title": isDisabled ? disableTitle : null,
|
|
98
|
+
tabindex: isDisabled ? '-1' : '0'
|
|
99
|
+
}, options), /*#__PURE__*/React.createElement(Box, {
|
|
100
|
+
className: `${style.statusType} ${style[bulletColor]}`
|
|
101
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
102
|
+
"data-title": isDisabled ? null : title,
|
|
103
|
+
flexible: true,
|
|
104
|
+
shrink: true,
|
|
105
|
+
className: needMultiLineText ? style.multiLineValue : style.value
|
|
106
|
+
}, value), needTick && active ? /*#__PURE__*/React.createElement("div", {
|
|
107
|
+
className: style.tickIcon,
|
|
108
|
+
"aria-hidden": ariaHidden
|
|
109
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
110
|
+
name: "ZD-ticknew",
|
|
111
|
+
size: "8"
|
|
112
|
+
})) : null);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
StatusListItem.defaultProps = defaultProps;
|
|
117
|
+
StatusListItem.propTypes = propTypes; // if (__DOCS__) {
|
|
118
|
+
// StatusListItem.docs = {
|
|
119
|
+
// componentGroup: 'StatusListItem',
|
|
120
|
+
// folderName: 'List'
|
|
121
|
+
// };
|
|
122
|
+
// }
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*** Libraries ***/
|
|
2
|
+
import React, { Component } from 'react';
|
|
3
|
+
import { defaultProps } from '../../../lookup/EmptyPage/props/defaultProps';
|
|
4
|
+
import { propTypes } from '../../../lookup/EmptyPage/props/propTypes';
|
|
5
|
+
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
6
|
+
import EmptyAccounts from '@zohodesk/svg/lib/emptystate/version3/EmptyAccounts';
|
|
7
|
+
import EmptyContact from '@zohodesk/svg/lib/emptystate/version3/EmptyContact';
|
|
8
|
+
import EmptyProducts from '@zohodesk/svg/lib/emptystate/version3/EmptyProducts';
|
|
9
|
+
/*** CSS ***/
|
|
10
|
+
|
|
11
|
+
import style from '../../../lookup/EmptyPage/LookupEmptyPage.module.css';
|
|
12
|
+
export default class EmptyPage extends Component {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
this.renderEmptyState = this.renderEmptyState.bind();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
renderEmptyState(type) {
|
|
19
|
+
switch (type) {
|
|
20
|
+
case 'search':
|
|
21
|
+
return /*#__PURE__*/React.createElement(EmptySearch, {
|
|
22
|
+
className: style.image
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
case 'account':
|
|
26
|
+
return /*#__PURE__*/React.createElement(EmptyAccounts, {
|
|
27
|
+
className: style.image
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
case 'contact':
|
|
31
|
+
return /*#__PURE__*/React.createElement(EmptyContact, {
|
|
32
|
+
className: style.image
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
case 'product':
|
|
36
|
+
return /*#__PURE__*/React.createElement(EmptyProducts, {
|
|
37
|
+
className: style.image
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
default:
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
let {
|
|
47
|
+
type,
|
|
48
|
+
title
|
|
49
|
+
} = this.props;
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: style.container,
|
|
52
|
+
"data-id": `empty_${type}`,
|
|
53
|
+
"data-test-id": `empty_${type}`
|
|
54
|
+
}, this.renderEmptyState(type), /*#__PURE__*/React.createElement("div", {
|
|
55
|
+
className: style.contentDiv
|
|
56
|
+
}, title));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
EmptyPage.propTypes = propTypes;
|
|
61
|
+
EmptyPage.defaultProps = defaultProps; // if (__DOCS__) {
|
|
62
|
+
// EmptyPage.docs = {
|
|
63
|
+
// componentGroup: 'Lookup'
|
|
64
|
+
// };
|
|
65
|
+
// }
|