@zohodesk/dot 1.2.1 → 1.2.3
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 +15 -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/index.html +1 -1
- package/es/Attachment/Attachment.js +2 -1
- package/es/Attachment/Attachment.module.css +10 -6
- package/es/Link/Link.js +2 -1
- package/es/TagWithIcon/props/propTypes.js +1 -1
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +5 -2
- package/es/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +7 -3
- package/es/layout/SubtabLayout/props/propTypes.js +1 -1
- package/es/list/Icons/AddNewIcon.js +3 -2
- package/es/list/Icons/CompleteIcon.js +3 -2
- package/es/list/Icons/DeleteIcon.js +4 -3
- package/es/list/Icons/EditIcon.js +5 -3
- package/es/list/Icons/ReadUnreadIcon.js +5 -3
- package/es/list/Icons/SmartIcon.js +5 -3
- package/es/list/ListLayout/ListLayout.module.css +24 -8
- package/es/list/listCommon.module.css +23 -5
- package/es/list/status/StatusDropdown/StatusDropdown.js +16 -3
- package/es/list/status/StatusDropdown/props/propTypes.js +2 -1
- package/es/lookup/Lookup/Lookup.js +2 -0
- 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 +1 -1
- 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 +2 -0
- 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/es/version2/lookup/AlertLookup/AlertLookup.js +14 -2
- package/lib/Attachment/Attachment.js +2 -1
- package/lib/Attachment/Attachment.module.css +10 -6
- package/lib/Link/Link.js +2 -1
- package/lib/TagWithIcon/props/propTypes.js +1 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +5 -3
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/lib/layout/SubtabLayout/props/propTypes.js +1 -1
- package/lib/list/Icons/AddNewIcon.js +4 -2
- package/lib/list/Icons/CompleteIcon.js +4 -2
- package/lib/list/Icons/DeleteIcon.js +5 -3
- package/lib/list/Icons/EditIcon.js +6 -3
- package/lib/list/Icons/ReadUnreadIcon.js +6 -3
- package/lib/list/Icons/SmartIcon.js +6 -3
- package/lib/list/ListLayout/ListLayout.module.css +24 -8
- package/lib/list/listCommon.module.css +23 -5
- package/lib/list/status/StatusDropdown/StatusDropdown.js +16 -5
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/lookup/Lookup/Lookup.js +2 -0
- 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 +1 -1
- 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 +2 -0
- 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/lib/version2/lookup/AlertLookup/AlertLookup.js +14 -2
- 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,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getZIndex } from '@zohodesk/components/lib/Provider/ZindexProvider';
|
|
3
|
+
import style from '../../Loader/Loader.module.css';
|
|
4
|
+
export default class Loader extends React.Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.getNextIndex = getZIndex(this);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
render() {
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
className: style.ajaxLoader,
|
|
13
|
+
style: {
|
|
14
|
+
zIndex: `${this.getNextIndex()}`
|
|
15
|
+
}
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: style.loader
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
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
|
+
import React from 'react';
|
|
4
|
+
import { defaultProps } from '../../Message/props/defaultProps';
|
|
5
|
+
import { propTypes, MessageUI_propTypes, MessageNew_propTypes } from '../../Message/props/propTypes';
|
|
6
|
+
import { Icon } from '@zohodesk/icons';
|
|
7
|
+
import AutoClose from '../actions/AutoClose';
|
|
8
|
+
import style from '../../Message/Message.module.css';
|
|
9
|
+
export default class Message extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.state = {
|
|
13
|
+
hideMessage: false
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
18
|
+
let {
|
|
19
|
+
showMessage,
|
|
20
|
+
hideMessage
|
|
21
|
+
} = this.props;
|
|
22
|
+
|
|
23
|
+
if (showMessage !== nextProps.showMessage) {
|
|
24
|
+
if (nextProps.type != 'alert') {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
hideMessage();
|
|
27
|
+
}, 3000);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
componentDidMount() {
|
|
33
|
+
let {
|
|
34
|
+
type,
|
|
35
|
+
hideMessage
|
|
36
|
+
} = this.props;
|
|
37
|
+
|
|
38
|
+
if (type != 'alert') {
|
|
39
|
+
setTimeout(() => {
|
|
40
|
+
hideMessage();
|
|
41
|
+
}, 3000);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
render() {
|
|
46
|
+
return /*#__PURE__*/React.createElement(MessageUI, this.props);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
Message.propTypes = propTypes;
|
|
51
|
+
Message.defaultProps = defaultProps; // if (__DOCS__) {
|
|
52
|
+
// Message.docs = {
|
|
53
|
+
// componentGroup: 'Atom'
|
|
54
|
+
// };
|
|
55
|
+
// }
|
|
56
|
+
|
|
57
|
+
export function MessageUI(props) {
|
|
58
|
+
function onClose(e) {
|
|
59
|
+
let {
|
|
60
|
+
hideMessage,
|
|
61
|
+
onClose
|
|
62
|
+
} = props;
|
|
63
|
+
hideMessage && hideMessage(e);
|
|
64
|
+
onClose && onClose(e);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let {
|
|
68
|
+
type,
|
|
69
|
+
message,
|
|
70
|
+
onClick,
|
|
71
|
+
i18nKeys,
|
|
72
|
+
dataSelectorId
|
|
73
|
+
} = props;
|
|
74
|
+
let {
|
|
75
|
+
closeTitle = 'Close'
|
|
76
|
+
} = i18nKeys;
|
|
77
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
78
|
+
className: style.message,
|
|
79
|
+
"data-id": `show_${type}_message`,
|
|
80
|
+
"data-test-id": `show_${type}_message`,
|
|
81
|
+
"data-selector-id": dataSelectorId
|
|
82
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
83
|
+
className: style.container
|
|
84
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
85
|
+
className: style[type]
|
|
86
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
87
|
+
className: style.tickIcn
|
|
88
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
89
|
+
name: type == 'alert' ? 'ZD-notifiExclamation' : type == 'info' ? 'ZD-info31' : 'ZD-check',
|
|
90
|
+
isBold: true,
|
|
91
|
+
size: "10"
|
|
92
|
+
}))), /*#__PURE__*/React.createElement("span", {
|
|
93
|
+
className: style.text,
|
|
94
|
+
onClick: onClick,
|
|
95
|
+
"data-id": "infoMessage",
|
|
96
|
+
"data-test-id": "infoMessage",
|
|
97
|
+
dangerouslySetInnerHTML: {
|
|
98
|
+
__html: message
|
|
99
|
+
}
|
|
100
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
101
|
+
className: style.close,
|
|
102
|
+
"data-title": closeTitle,
|
|
103
|
+
onClick: onClose,
|
|
104
|
+
"data-id": `close_${type}_message`,
|
|
105
|
+
"data-test-id": `close_${type}_message`
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
107
|
+
name: "ZD-closee",
|
|
108
|
+
isBold: true,
|
|
109
|
+
size: "10"
|
|
110
|
+
}))));
|
|
111
|
+
}
|
|
112
|
+
MessageUI.propTypes = MessageUI_propTypes;
|
|
113
|
+
export function MessageNew(props) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(AutoClose, _extends({}, props, {
|
|
115
|
+
Element: MessageUI
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
MessageNew.propTypes = MessageNew_propTypes;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { defaultProps } from '../../MessageBanner/props/defaultProps';
|
|
3
3
|
import { propTypes } from '../../MessageBanner/props/propTypes';
|
|
4
|
-
import Link from '
|
|
4
|
+
import Link from '../Link/Link';
|
|
5
5
|
import { Icon } from '@zohodesk/icons';
|
|
6
6
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
7
7
|
import style from '../../MessageBanner/MessageBanner.module.css';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../PlusIcon/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../PlusIcon/props/propTypes';
|
|
4
|
+
import style from '../../PlusIcon/PlusIcon.module.css';
|
|
5
|
+
import AvatarIcon from '../avatar/AvatarIcon/AvatarIcon';
|
|
6
|
+
export default class PlusIcon extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
let {
|
|
13
|
+
dataId,
|
|
14
|
+
iconName,
|
|
15
|
+
iconClass,
|
|
16
|
+
iconSize,
|
|
17
|
+
size,
|
|
18
|
+
onClick,
|
|
19
|
+
title,
|
|
20
|
+
customClass
|
|
21
|
+
} = this.props;
|
|
22
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
23
|
+
className: style.container,
|
|
24
|
+
onClick: onClick,
|
|
25
|
+
"data-id": dataId,
|
|
26
|
+
"data-test-id": dataId,
|
|
27
|
+
"data-title": title
|
|
28
|
+
}, /*#__PURE__*/React.createElement(AvatarIcon, {
|
|
29
|
+
name: iconName,
|
|
30
|
+
iconClass: `${iconClass} ${style.icon}`,
|
|
31
|
+
iconSize: iconSize,
|
|
32
|
+
size: size,
|
|
33
|
+
className: `${customClass} ${style.plusIcon}`
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
PlusIcon.defaultProps = defaultProps;
|
|
39
|
+
PlusIcon.propTypes = propTypes; // if (__DOCS__) {
|
|
40
|
+
// PlusIcon.docs = {
|
|
41
|
+
// componentGroup: 'Common',
|
|
42
|
+
// folderName: 'Ticket DetailView'
|
|
43
|
+
// };
|
|
44
|
+
// }
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
3
|
+
import { defaultProps } from '../../Separator/props/defaultProps';
|
|
4
|
+
import { propTypes } from '../../Separator/props/propTypes';
|
|
5
|
+
import style from '../../Separator/Separator.module.css';
|
|
6
|
+
export default class Separator extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
render() {
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
type,
|
|
15
|
+
customSeparatorType,
|
|
16
|
+
palette,
|
|
17
|
+
wrap,
|
|
18
|
+
shrink,
|
|
19
|
+
aligndirection,
|
|
20
|
+
customClass
|
|
21
|
+
} = this.props;
|
|
22
|
+
const {
|
|
23
|
+
customWrapper,
|
|
24
|
+
customSeparator,
|
|
25
|
+
customChildren
|
|
26
|
+
} = customClass;
|
|
27
|
+
const data = children.filter(el => el !== null && el !== undefined && el !== false);
|
|
28
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
29
|
+
alignBox: aligndirection,
|
|
30
|
+
align: aligndirection === 'row' ? 'vertical' : '',
|
|
31
|
+
wrap: wrap,
|
|
32
|
+
isCover: false,
|
|
33
|
+
className: `${style.varClass} ${customWrapper}`
|
|
34
|
+
}, data.map((child, i) => {
|
|
35
|
+
if (child) {
|
|
36
|
+
if (data.length - 1 == i || aligndirection == 'column') {
|
|
37
|
+
return child && /*#__PURE__*/React.createElement(Box, {
|
|
38
|
+
shrink: shrink,
|
|
39
|
+
key: i,
|
|
40
|
+
className: customChildren
|
|
41
|
+
}, child);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return child && /*#__PURE__*/React.createElement(React.Fragment, {
|
|
45
|
+
key: i
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
47
|
+
shrink: shrink,
|
|
48
|
+
key: i,
|
|
49
|
+
className: customChildren
|
|
50
|
+
}, child), /*#__PURE__*/React.createElement(Box, {
|
|
51
|
+
className: `${style.separator} ${style[palette]} ${customSeparatorType ? '' : style[type]} ${customSeparator} `,
|
|
52
|
+
key: i
|
|
53
|
+
}, customSeparatorType ? customSeparatorType : type == 'slash' ? '/' : type == 'arrow' ? '>' : type == 'comma' ? ',' : '\u2022'));
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
Separator.defaultProps = defaultProps;
|
|
60
|
+
Separator.propTypes = propTypes;
|
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { defaultProps } from '../../ToastMessage/props/defaultProps';
|
|
5
|
+
import { propTypes } from '../../ToastMessage/props/propTypes'; //components
|
|
6
|
+
|
|
7
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
8
|
+
import { Icon } from '@zohodesk/icons';
|
|
9
|
+
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
10
|
+
import { useZIndex } from '@zohodesk/components/lib/Provider/ZindexProvider';
|
|
11
|
+
import { useUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
12
|
+
import AutoClose from '../actions/AutoClose';
|
|
13
|
+
import a11yStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css'; //style
|
|
14
|
+
|
|
15
|
+
import style from '../../ToastMessage/ToastMessage.module.css';
|
|
16
|
+
|
|
17
|
+
function ToastMessageUI(props) {
|
|
18
|
+
let [messageState, setMessageState] = useState(props.messageState);
|
|
19
|
+
let {
|
|
20
|
+
type,
|
|
21
|
+
subject,
|
|
22
|
+
info,
|
|
23
|
+
submitText,
|
|
24
|
+
cancelText,
|
|
25
|
+
iconName,
|
|
26
|
+
iconSize,
|
|
27
|
+
submitType,
|
|
28
|
+
isIconMid,
|
|
29
|
+
needClose,
|
|
30
|
+
iconPalette,
|
|
31
|
+
isMore,
|
|
32
|
+
message,
|
|
33
|
+
isAnimate,
|
|
34
|
+
getLeftContainer,
|
|
35
|
+
getInnerBottomContainer,
|
|
36
|
+
getBottomContainer,
|
|
37
|
+
getSubmitContainer,
|
|
38
|
+
onSubmit,
|
|
39
|
+
onCancel,
|
|
40
|
+
dataId,
|
|
41
|
+
dataSelectorId,
|
|
42
|
+
isClose,
|
|
43
|
+
onClose,
|
|
44
|
+
needAutoZindex,
|
|
45
|
+
a11y
|
|
46
|
+
} = props;
|
|
47
|
+
|
|
48
|
+
function onClickSubmit(e) {
|
|
49
|
+
onSubmit && onSubmit();
|
|
50
|
+
onClose && onClose();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function onClickCancel(e) {
|
|
54
|
+
onCancel && onCancel();
|
|
55
|
+
onClose && onClose();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function changeMessageState(e) {
|
|
59
|
+
cancelBubblingEffect(e);
|
|
60
|
+
setMessageState(!messageState);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let animateClass = isClose ? style.rightanimate : style.leftanimate;
|
|
64
|
+
let animateRemoveClass = isClose ? style.rightanimate : style.leftnoanimate;
|
|
65
|
+
let channelIcon = /*#__PURE__*/React.createElement(Icon, {
|
|
66
|
+
iconClass: style[iconPalette],
|
|
67
|
+
name: iconName,
|
|
68
|
+
size: iconSize
|
|
69
|
+
});
|
|
70
|
+
let getNextIndex = useZIndex();
|
|
71
|
+
let Zindex = isAnimate ? getNextIndex() : null,
|
|
72
|
+
getNextId = useUniqueId(),
|
|
73
|
+
titleId = getNextId(),
|
|
74
|
+
infoId = getNextId();
|
|
75
|
+
let {
|
|
76
|
+
role = 'alert',
|
|
77
|
+
ariaLive = 'assertive',
|
|
78
|
+
ariaAtomic = true,
|
|
79
|
+
ariaDescribedby = infoId,
|
|
80
|
+
ariaLabelledby = titleId
|
|
81
|
+
} = a11y;
|
|
82
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
83
|
+
className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass} ${style[`alert${type}`] ? style[`alert${type}`] : ''}`,
|
|
84
|
+
isCover: false,
|
|
85
|
+
dataId: dataId,
|
|
86
|
+
style: needAutoZindex && isAnimate ? {
|
|
87
|
+
zIndex: `${Zindex}`
|
|
88
|
+
} : {},
|
|
89
|
+
role: role,
|
|
90
|
+
"aria-live": ariaLive,
|
|
91
|
+
"aria-atomic": ariaAtomic,
|
|
92
|
+
"aria-describedby": ariaDescribedby,
|
|
93
|
+
"aria-labelledby": ariaLabelledby,
|
|
94
|
+
dataSelectorId: dataSelectorId
|
|
95
|
+
}, type !== 'custom' ? /*#__PURE__*/React.createElement(Box, {
|
|
96
|
+
className: style.alertifychild,
|
|
97
|
+
flexible: true
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
99
|
+
alignBox: "row",
|
|
100
|
+
className: style.alertifybanner
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
102
|
+
className: style.alertleft,
|
|
103
|
+
flexible: true
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
105
|
+
align: isIconMid ? 'vertical' : '',
|
|
106
|
+
alignBox: "row"
|
|
107
|
+
}, type != 'success' && !getLeftContainer ? /*#__PURE__*/React.createElement(Box, {
|
|
108
|
+
className: `${style.alertico}`
|
|
109
|
+
}, /*#__PURE__*/React.createElement("span", null, channelIcon)) : getLeftContainer ? /*#__PURE__*/React.createElement(Box, {
|
|
110
|
+
className: `${style.alertico}`
|
|
111
|
+
}, getLeftContainer()) : null, /*#__PURE__*/React.createElement(Box, {
|
|
112
|
+
flexible: true
|
|
113
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
114
|
+
align: "vertical",
|
|
115
|
+
alignBox: "row",
|
|
116
|
+
isCover: false
|
|
117
|
+
}, type == 'success' ? /*#__PURE__*/React.createElement(Box, {
|
|
118
|
+
className: style.alertTitleLeft
|
|
119
|
+
}, channelIcon) : null, /*#__PURE__*/React.createElement(Box, {
|
|
120
|
+
className: style.alertTitle,
|
|
121
|
+
flexible: true,
|
|
122
|
+
"data-title": subject,
|
|
123
|
+
id: titleId
|
|
124
|
+
}, subject)), info ? /*#__PURE__*/React.createElement("p", {
|
|
125
|
+
className: style.alertMessage,
|
|
126
|
+
"data-title": info,
|
|
127
|
+
id: infoId
|
|
128
|
+
}, info) : null, getInnerBottomContainer ? /*#__PURE__*/React.createElement("div", null, getInnerBottomContainer()) : null), type == 'information' && needClose ? /*#__PURE__*/React.createElement(Box, {
|
|
129
|
+
className: `${a11yStyle.buttonReset} ${style.closeIconPrimary}`,
|
|
130
|
+
onClick: onClose,
|
|
131
|
+
dataId: `${dataId}_close`,
|
|
132
|
+
tagName: "button"
|
|
133
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
134
|
+
isBold: true,
|
|
135
|
+
name: "ZD-close",
|
|
136
|
+
size: "18"
|
|
137
|
+
})) : null)), type != 'information' ? /*#__PURE__*/React.createElement(Box, {
|
|
138
|
+
className: style.alertright
|
|
139
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
140
|
+
className: style.alerttab
|
|
141
|
+
}, needClose ? /*#__PURE__*/React.createElement("button", {
|
|
142
|
+
className: `${a11yStyle.buttonReset} ${style.closeIcon}`,
|
|
143
|
+
onClick: onClose,
|
|
144
|
+
"data-id": `${dataId}_closeRight`,
|
|
145
|
+
"data-test-id": `${dataId}_closeRight`
|
|
146
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
147
|
+
name: "ZD-close",
|
|
148
|
+
size: "18"
|
|
149
|
+
})) : null, submitText ? /*#__PURE__*/React.createElement(Box, {
|
|
150
|
+
className: `${getSubmitContainer ? style.sumbitBorder : cancelText ? style.notSolo : style.mainbutton} ${getSubmitContainer ? '' : style[submitType]} `,
|
|
151
|
+
flexible: true,
|
|
152
|
+
onClick: onClickSubmit,
|
|
153
|
+
dataId: `${dataId}_submitButton`
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
155
|
+
align: "vertical",
|
|
156
|
+
alignBox: "row"
|
|
157
|
+
}, getSubmitContainer ? /*#__PURE__*/React.createElement(Box, {
|
|
158
|
+
flexible: true
|
|
159
|
+
}, getSubmitContainer()) : /*#__PURE__*/React.createElement(Box, {
|
|
160
|
+
className: `${a11yStyle.buttonReset} ${style.buttonText}`,
|
|
161
|
+
flexible: true,
|
|
162
|
+
tagName: "button"
|
|
163
|
+
}, submitText))) : null, cancelText ? /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
className: `${style.cancelButton}`,
|
|
165
|
+
flexible: true,
|
|
166
|
+
onClick: onClose,
|
|
167
|
+
dataId: `${dataId}_cancelButton`
|
|
168
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
169
|
+
align: "vertical",
|
|
170
|
+
alignBox: "row"
|
|
171
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
172
|
+
className: `${a11yStyle.buttonReset} ${style.buttonText}`,
|
|
173
|
+
flexible: true,
|
|
174
|
+
onClick: onClickCancel,
|
|
175
|
+
dataId: `${dataId}_cancelButtonInner`,
|
|
176
|
+
tagName: "button"
|
|
177
|
+
}, cancelText), isMore ? /*#__PURE__*/React.createElement(Box, {
|
|
178
|
+
className: `${a11yStyle.buttonReset} ${style.dropdown}`,
|
|
179
|
+
onClick: changeMessageState,
|
|
180
|
+
dataId: `${dataId}_moreIcon`,
|
|
181
|
+
tagName: "button",
|
|
182
|
+
"aria-expanded": messageState ? true : false,
|
|
183
|
+
"aria-haspopup": true
|
|
184
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
185
|
+
name: "ZD-down",
|
|
186
|
+
size: "7"
|
|
187
|
+
})) : null)) : null)) : null)) : null, isMore ? /*#__PURE__*/React.createElement(Box, {
|
|
188
|
+
className: `${style.message} ${messageState ? '' : style.messageOff}`,
|
|
189
|
+
tagName: "p"
|
|
190
|
+
}, message) : null, getBottomContainer ? /*#__PURE__*/React.createElement(Box, null, getBottomContainer()) : null);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export default function ToastMessage(props) {
|
|
194
|
+
return /*#__PURE__*/React.createElement(AutoClose, _extends({}, props, {
|
|
195
|
+
Element: ToastMessageUI
|
|
196
|
+
}));
|
|
197
|
+
}
|
|
198
|
+
ToastMessage.propTypes = propTypes;
|
|
199
|
+
ToastMessage.defaultProps = defaultProps; // if (__DOCS__) {
|
|
200
|
+
// ToastMessage.docs = {
|
|
201
|
+
// componentGroup: 'Atom'
|
|
202
|
+
// };
|
|
203
|
+
// }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../Upload/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../Upload/props/propTypes';
|
|
4
|
+
import { Icon } from '@zohodesk/icons';
|
|
5
|
+
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
6
|
+
import Image from '../Image/Image';
|
|
7
|
+
import style from '../../Upload/Upload.module.css';
|
|
8
|
+
export default class Upload extends React.Component {
|
|
9
|
+
render() {
|
|
10
|
+
let {
|
|
11
|
+
isPreview,
|
|
12
|
+
tooltip,
|
|
13
|
+
dataId,
|
|
14
|
+
dataSelectorId,
|
|
15
|
+
progressValue,
|
|
16
|
+
onClick,
|
|
17
|
+
iconName,
|
|
18
|
+
fileSize,
|
|
19
|
+
imgSrc,
|
|
20
|
+
isPreviewType,
|
|
21
|
+
onRemove,
|
|
22
|
+
size,
|
|
23
|
+
getRef,
|
|
24
|
+
palette
|
|
25
|
+
} = this.props;
|
|
26
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
27
|
+
isInline: true,
|
|
28
|
+
className: `${style.container} ${style[palette]} ${style[size]} ${isPreview ? style.preview : ''}
|
|
29
|
+
`,
|
|
30
|
+
dataId: dataId,
|
|
31
|
+
"data-title": tooltip,
|
|
32
|
+
isCover: false,
|
|
33
|
+
eleRef: getRef,
|
|
34
|
+
dataSelectorId: dataSelectorId
|
|
35
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, isPreview ? /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
"data-id": `${dataId}_attachLoading`,
|
|
37
|
+
"data-test-id": `${dataId}_attachLoading`,
|
|
38
|
+
className: style.loader,
|
|
39
|
+
style: {
|
|
40
|
+
width: `${progressValue}%`
|
|
41
|
+
}
|
|
42
|
+
}) : null, isPreviewType ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Image, {
|
|
43
|
+
src: imgSrc,
|
|
44
|
+
className: `${style.uploadimage} `,
|
|
45
|
+
alt: "Uploaded Image",
|
|
46
|
+
dataId: `${dataId}_fileName`
|
|
47
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
className: style.overlay,
|
|
49
|
+
onClick: onClick
|
|
50
|
+
})) : /*#__PURE__*/React.createElement(Box, {
|
|
51
|
+
className: style.attachInfo,
|
|
52
|
+
onClick: onClick,
|
|
53
|
+
dataId: `${dataId}_openNewTab`
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
55
|
+
name: iconName,
|
|
56
|
+
iconClass: style.fileIcon
|
|
57
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
className: style.attachsize
|
|
59
|
+
}, fileSize))), typeof onRemove !== 'undefined' && onRemove != null ? /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
className: style.uploadclose,
|
|
61
|
+
onClick: onRemove,
|
|
62
|
+
"data-id": `${dataId}_deleteUpload`,
|
|
63
|
+
"data-test-id": `${dataId}_deleteUpload`
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
65
|
+
name: "ZD-close",
|
|
66
|
+
isBold: true
|
|
67
|
+
})) : null);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
Upload.propTypes = propTypes;
|
|
72
|
+
Upload.defaultProps = defaultProps; // if (__DOCS__) {
|
|
73
|
+
// Upload.docs = {
|
|
74
|
+
// componentGroup: 'Upload'
|
|
75
|
+
// };
|
|
76
|
+
// }
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
3
|
+
import { defaultProps } from '../../actions/props/defaultProps';
|
|
4
|
+
import { propTypes } from '../../actions/props/propTypes';
|
|
5
|
+
export default function AutoClose(props) {
|
|
6
|
+
let {
|
|
7
|
+
Element,
|
|
8
|
+
isClose: givenClose,
|
|
9
|
+
onPortalClose,
|
|
10
|
+
autoClose,
|
|
11
|
+
hideTime
|
|
12
|
+
} = props;
|
|
13
|
+
let [isClose, setClose] = useState(givenClose);
|
|
14
|
+
|
|
15
|
+
function onClose(e) {
|
|
16
|
+
cancelBubblingEffect(e);
|
|
17
|
+
onPortalClose && onPortalClose();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
let id;
|
|
22
|
+
|
|
23
|
+
if (autoClose) {
|
|
24
|
+
id = setTimeout(() => {
|
|
25
|
+
setClose(true);
|
|
26
|
+
setTimeout(onClose, 300); // For animation
|
|
27
|
+
}, hideTime);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return () => {
|
|
31
|
+
if (autoClose) {
|
|
32
|
+
clearTimeout(id);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}, []);
|
|
36
|
+
let newProps = Object.assign({}, props, {
|
|
37
|
+
isClose,
|
|
38
|
+
onClose
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/React.createElement(Element, newProps);
|
|
41
|
+
}
|
|
42
|
+
AutoClose.propTypes = propTypes;
|
|
43
|
+
AutoClose.defaultProps = defaultProps;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import React from 'react';
|
|
4
|
+
import { defaultProps } from '../../../avatar/AvatarClose/props/defaultProps';
|
|
5
|
+
import { propTypes } from '../../../avatar/AvatarClose/props/propTypes';
|
|
6
|
+
import Avatar from '@zohodesk/components/lib/Avatar/Avatar';
|
|
7
|
+
import { Icon } from '@zohodesk/icons';
|
|
8
|
+
import style from '../../../avatar/AvatarClose/AvatarClose.module.css';
|
|
9
|
+
export default class AvatarClose extends React.Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render() {
|
|
15
|
+
let {
|
|
16
|
+
title,
|
|
17
|
+
src,
|
|
18
|
+
name,
|
|
19
|
+
size,
|
|
20
|
+
isClose,
|
|
21
|
+
onClick,
|
|
22
|
+
customProps,
|
|
23
|
+
dataSelectorId
|
|
24
|
+
} = this.props;
|
|
25
|
+
let {
|
|
26
|
+
AvatarCloseProps = {},
|
|
27
|
+
AvatarProps = {}
|
|
28
|
+
} = customProps;
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
30
|
+
className: style.container,
|
|
31
|
+
"data-selector-id": dataSelectorId
|
|
32
|
+
}, AvatarCloseProps), /*#__PURE__*/React.createElement(Avatar, _extends({
|
|
33
|
+
src: src,
|
|
34
|
+
name: name,
|
|
35
|
+
title: title,
|
|
36
|
+
size: size
|
|
37
|
+
}, AvatarProps)), isClose && /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
className: style.pop,
|
|
39
|
+
onClick: onClick
|
|
40
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
41
|
+
className: style.icon
|
|
42
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
+
name: "ZD-plus"
|
|
44
|
+
}))));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
AvatarClose.propTypes = propTypes;
|
|
49
|
+
AvatarClose.defaultProps = defaultProps; // if (__DOCS__) {
|
|
50
|
+
// AvatarClose.docs = {
|
|
51
|
+
// componentGroup: 'Avatar Group'
|
|
52
|
+
// };
|
|
53
|
+
// }
|