@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,178 @@
|
|
|
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, { PureComponent } from 'react';
|
|
5
|
+
import { defaultProps } from '../../../../form/fields/TextEditorField/props/defaultProps';
|
|
6
|
+
import { propTypes } from '../../../../form/fields/TextEditorField/props/propTypes';
|
|
7
|
+
/**** Components ****/
|
|
8
|
+
|
|
9
|
+
import Label from '@zohodesk/components/lib/Label/Label';
|
|
10
|
+
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
11
|
+
import TextEditorWrapper from '../TextEditorWrapper/TextEditorWrapper';
|
|
12
|
+
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
13
|
+
/** Css */
|
|
14
|
+
|
|
15
|
+
import style from '../../../../form/fields/Fields.module.css';
|
|
16
|
+
export default class TextEditorField extends PureComponent {
|
|
17
|
+
constructor(props) {
|
|
18
|
+
super(props);
|
|
19
|
+
this.handleChange = this.handleChange.bind(this);
|
|
20
|
+
this.handleGetRef = this.handleGetRef.bind(this);
|
|
21
|
+
this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
22
|
+
this.renderEnd = this.renderEnd.bind(this);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
handleChange(value) {
|
|
26
|
+
let {
|
|
27
|
+
id,
|
|
28
|
+
onChange
|
|
29
|
+
} = this.props;
|
|
30
|
+
onChange && onChange(id, value);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
handleGetRef(el) {
|
|
34
|
+
let {
|
|
35
|
+
getRef,
|
|
36
|
+
id
|
|
37
|
+
} = this.props;
|
|
38
|
+
this.textEditor = el;
|
|
39
|
+
getRef && getRef(el, id);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
handleLabelClick() {
|
|
43
|
+
let {
|
|
44
|
+
isFocusOnLabelClick,
|
|
45
|
+
isDisabled,
|
|
46
|
+
isReadOnly
|
|
47
|
+
} = this.props;
|
|
48
|
+
|
|
49
|
+
if (isFocusOnLabelClick && !isDisabled && !isReadOnly && this.textEditor && this.textEditor.focus) {
|
|
50
|
+
this.textEditor.focus();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
renderEnd() {
|
|
55
|
+
let {
|
|
56
|
+
children
|
|
57
|
+
} = this.props;
|
|
58
|
+
return children ? children : null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
render() {
|
|
62
|
+
let {
|
|
63
|
+
labelName,
|
|
64
|
+
id,
|
|
65
|
+
isMandatory,
|
|
66
|
+
value,
|
|
67
|
+
validationMessage,
|
|
68
|
+
validationPalette,
|
|
69
|
+
isReadOnly,
|
|
70
|
+
onAttachmentUpload,
|
|
71
|
+
needEditor,
|
|
72
|
+
dataId,
|
|
73
|
+
dataSelectorId,
|
|
74
|
+
isDisabled,
|
|
75
|
+
fieldSize,
|
|
76
|
+
textBoxSize,
|
|
77
|
+
textBoxVariant,
|
|
78
|
+
labelPalette,
|
|
79
|
+
labelCustomClass,
|
|
80
|
+
infoText,
|
|
81
|
+
isLocked,
|
|
82
|
+
lockedInfoText,
|
|
83
|
+
errorType,
|
|
84
|
+
EDITORURL,
|
|
85
|
+
editorMode,
|
|
86
|
+
isCustomScroll,
|
|
87
|
+
initCallback,
|
|
88
|
+
loadingComponent,
|
|
89
|
+
handleAlertMessage,
|
|
90
|
+
editorCallback,
|
|
91
|
+
editorBlurCallback,
|
|
92
|
+
editorOptions,
|
|
93
|
+
onFocus,
|
|
94
|
+
isEditorDefaultOpen,
|
|
95
|
+
changeEditorContent,
|
|
96
|
+
shouldEditorUpdateContent,
|
|
97
|
+
setInlineAttachmentInProgress,
|
|
98
|
+
handleEditorDropUpload,
|
|
99
|
+
ImgLazyLoad,
|
|
100
|
+
needInlineAttachment,
|
|
101
|
+
i18nKeys,
|
|
102
|
+
className,
|
|
103
|
+
children,
|
|
104
|
+
ePhiData,
|
|
105
|
+
customProps
|
|
106
|
+
} = this.props;
|
|
107
|
+
const {
|
|
108
|
+
LabelProps = {},
|
|
109
|
+
TextEditorWrapperProps = {},
|
|
110
|
+
ValidationMessageProps = {}
|
|
111
|
+
} = customProps;
|
|
112
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''} ${className || ''}`,
|
|
114
|
+
"data-selector-id": dataSelectorId
|
|
115
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
116
|
+
infoText: infoText,
|
|
117
|
+
isLocked: isLocked,
|
|
118
|
+
lockedInfoText: lockedInfoText,
|
|
119
|
+
ePhiData: ePhiData,
|
|
120
|
+
dataId: dataId,
|
|
121
|
+
renderProps: {
|
|
122
|
+
end: this.renderEnd
|
|
123
|
+
}
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
125
|
+
text: labelName,
|
|
126
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
127
|
+
htmlFor: !isReadOnly && !isDisabled ? id : undefined,
|
|
128
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
129
|
+
onClick: this.handleLabelClick,
|
|
130
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
131
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
132
|
+
}, LabelProps))), /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
134
|
+
}, /*#__PURE__*/React.createElement(TextEditorWrapper, _extends({
|
|
135
|
+
needEditor: needEditor,
|
|
136
|
+
onChange: this.handleChange,
|
|
137
|
+
id: id,
|
|
138
|
+
value: value,
|
|
139
|
+
isReadOnly: isReadOnly,
|
|
140
|
+
getRef: this.handleGetRef,
|
|
141
|
+
onAttachmentUpload: onAttachmentUpload,
|
|
142
|
+
dataId: dataId,
|
|
143
|
+
isDisabled: isDisabled,
|
|
144
|
+
textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
145
|
+
textBoxVariant: textBoxVariant,
|
|
146
|
+
EDITORURL: EDITORURL,
|
|
147
|
+
editorMode: editorMode,
|
|
148
|
+
isCustomScroll: isCustomScroll,
|
|
149
|
+
initCallback: initCallback,
|
|
150
|
+
loadingComponent: loadingComponent,
|
|
151
|
+
handleAlertMessage: handleAlertMessage,
|
|
152
|
+
editorCallback: editorCallback,
|
|
153
|
+
i18nKeys: i18nKeys,
|
|
154
|
+
ImgLazyLoad: ImgLazyLoad,
|
|
155
|
+
editorOptions: editorOptions,
|
|
156
|
+
editorBlurCallback: editorBlurCallback,
|
|
157
|
+
onFocus: onFocus,
|
|
158
|
+
isEditorDefaultOpen: isEditorDefaultOpen,
|
|
159
|
+
changeEditorContent: changeEditorContent,
|
|
160
|
+
shouldEditorUpdateContent: shouldEditorUpdateContent,
|
|
161
|
+
setInlineAttachmentInProgress: setInlineAttachmentInProgress,
|
|
162
|
+
handleEditorDropUpload: handleEditorDropUpload,
|
|
163
|
+
needInlineAttachment: needInlineAttachment
|
|
164
|
+
}, TextEditorWrapperProps))), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
165
|
+
text: validationMessage,
|
|
166
|
+
palette: validationPalette,
|
|
167
|
+
type: errorType,
|
|
168
|
+
dataId: `${dataId}_ValidationMessage`
|
|
169
|
+
}, ValidationMessageProps)));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
TextEditorField.propTypes = propTypes;
|
|
174
|
+
TextEditorField.defaultProps = defaultProps; // if (__DOCS__) {
|
|
175
|
+
// TextEditorField.docs = {
|
|
176
|
+
// componentGroup: 'Fields'
|
|
177
|
+
// };
|
|
178
|
+
// }
|
|
@@ -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, { Component } from 'react';
|
|
4
|
+
import { defaultProps } from '../../../../form/fields/TextEditorWrapper/props/defaultProps';
|
|
5
|
+
import { propTypes } from '../../../../form/fields/TextEditorWrapper/props/propTypes';
|
|
6
|
+
/**** Components ****/
|
|
7
|
+
|
|
8
|
+
import TextEditor from '../TextEditor/TextEditor';
|
|
9
|
+
import Textarea from '@zohodesk/components/lib/Textarea/Textarea';
|
|
10
|
+
import VelocityAnimationGroup from '@zohodesk/components/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup';
|
|
11
|
+
import { editorContentValidate } from '../../../../utils/editorUtils';
|
|
12
|
+
import style from './TextEditorWrapper.module.css';
|
|
13
|
+
/* eslint-disable react/no-deprecated */
|
|
14
|
+
|
|
15
|
+
export default class TextEditorWrapper extends Component {
|
|
16
|
+
constructor(props) {
|
|
17
|
+
super(props);
|
|
18
|
+
let {
|
|
19
|
+
value,
|
|
20
|
+
isEditorDefaultOpen
|
|
21
|
+
} = props;
|
|
22
|
+
this.state = {
|
|
23
|
+
isEditorShow: isEditorDefaultOpen ? true : !!value
|
|
24
|
+
};
|
|
25
|
+
this.handleTextareaFocus = this.handleTextareaFocus.bind(this);
|
|
26
|
+
this.toggleEdit = this.toggleEdit.bind(this);
|
|
27
|
+
this.focusCallback = this.focusCallback.bind(this);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
handleTextareaFocus() {
|
|
31
|
+
let {
|
|
32
|
+
isReadOnly,
|
|
33
|
+
isDisabled
|
|
34
|
+
} = this.props;
|
|
35
|
+
|
|
36
|
+
if (!isReadOnly && !isDisabled) {
|
|
37
|
+
this.setState({
|
|
38
|
+
isEditorShow: true
|
|
39
|
+
}, () => {
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
editor[this.props.id].squireInstance.focus();
|
|
42
|
+
}, 300);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
toggleEdit(value) {
|
|
48
|
+
this.setState({
|
|
49
|
+
isEditorShow: value
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
focusCallback() {
|
|
54
|
+
let {
|
|
55
|
+
onFocus
|
|
56
|
+
} = this.props;
|
|
57
|
+
this.setState({
|
|
58
|
+
isEditorFocus: true
|
|
59
|
+
});
|
|
60
|
+
onFocus && onFocus();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
componentWillReceiveProps(np) {
|
|
64
|
+
let {
|
|
65
|
+
id,
|
|
66
|
+
value
|
|
67
|
+
} = this.props;
|
|
68
|
+
|
|
69
|
+
if (np.value || typeof editor != 'undefined' && editorContentValidate(editor[id])) {
|
|
70
|
+
this.setState({
|
|
71
|
+
isEditorShow: true
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
if (!this.state.isEditorFocus && !this.props.isEditorDefaultOpen) {
|
|
75
|
+
this.setState({
|
|
76
|
+
isEditorShow: false
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
} // if (np.value !== value && np.value == '') {
|
|
80
|
+
// editor[id].setContent('');
|
|
81
|
+
// }
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
render() {
|
|
86
|
+
let {
|
|
87
|
+
isEditorShow
|
|
88
|
+
} = this.state;
|
|
89
|
+
let {
|
|
90
|
+
id,
|
|
91
|
+
onChange,
|
|
92
|
+
value,
|
|
93
|
+
onAttachmentUpload,
|
|
94
|
+
needEditor,
|
|
95
|
+
dataId,
|
|
96
|
+
isReadOnly,
|
|
97
|
+
isDisabled,
|
|
98
|
+
getRef,
|
|
99
|
+
textBoxSize,
|
|
100
|
+
textBoxVariant,
|
|
101
|
+
editorMode,
|
|
102
|
+
editorSize,
|
|
103
|
+
editorBorder,
|
|
104
|
+
EDITORURL,
|
|
105
|
+
isCustomScroll,
|
|
106
|
+
initCallback,
|
|
107
|
+
loadingComponent,
|
|
108
|
+
handleAlertMessage,
|
|
109
|
+
editorCallback,
|
|
110
|
+
editorBlurCallback,
|
|
111
|
+
editorOptions,
|
|
112
|
+
changeEditorContent,
|
|
113
|
+
shouldEditorUpdateContent,
|
|
114
|
+
setInlineAttachmentInProgress,
|
|
115
|
+
handleEditorDropUpload,
|
|
116
|
+
ImgLazyLoad,
|
|
117
|
+
i18nKeys,
|
|
118
|
+
isEditorDefaultOpen,
|
|
119
|
+
needInlineAttachment,
|
|
120
|
+
customProps,
|
|
121
|
+
dataSelectorId
|
|
122
|
+
} = this.props;
|
|
123
|
+
const {
|
|
124
|
+
Textarea1Props = {},
|
|
125
|
+
Textarea2Props = {},
|
|
126
|
+
TextEditorProps = {}
|
|
127
|
+
} = customProps;
|
|
128
|
+
let defaultObj = {
|
|
129
|
+
needEditorFocus: !value
|
|
130
|
+
};
|
|
131
|
+
let editorOptionsObject = Object.assign(defaultObj, editorOptions);
|
|
132
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: style.container,
|
|
134
|
+
"data-selector-id": dataSelectorId
|
|
135
|
+
}, !isEditorShow ? /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
136
|
+
onFocus: this.handleTextareaFocus,
|
|
137
|
+
text: value,
|
|
138
|
+
animated: !needEditor,
|
|
139
|
+
onChange: onChange,
|
|
140
|
+
dataId: dataId,
|
|
141
|
+
isReadOnly: isReadOnly,
|
|
142
|
+
isDisabled: isDisabled,
|
|
143
|
+
needEffect: !(isReadOnly || isDisabled),
|
|
144
|
+
getRef: getRef,
|
|
145
|
+
size: textBoxSize,
|
|
146
|
+
variant: textBoxVariant,
|
|
147
|
+
customClass: style.textBox
|
|
148
|
+
}, Textarea1Props)) : null, /*#__PURE__*/React.createElement(VelocityAnimationGroup, {
|
|
149
|
+
name: "slideDown",
|
|
150
|
+
runOnMount: true,
|
|
151
|
+
enterDuration: '300',
|
|
152
|
+
exitDuration: '400',
|
|
153
|
+
isActive: isEditorShow,
|
|
154
|
+
component: "div"
|
|
155
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: style.textEditor
|
|
157
|
+
}, isEditorShow && needEditor ? /*#__PURE__*/React.createElement(TextEditor, _extends({
|
|
158
|
+
id: id,
|
|
159
|
+
value: value,
|
|
160
|
+
onChange: !isReadOnly && !isDisabled ? onChange : null,
|
|
161
|
+
editorOptions: editorOptionsObject,
|
|
162
|
+
onUpload: onAttachmentUpload,
|
|
163
|
+
editorMode: editorMode,
|
|
164
|
+
type: editorSize,
|
|
165
|
+
border: editorBorder,
|
|
166
|
+
dataId: dataId,
|
|
167
|
+
getRef: getRef,
|
|
168
|
+
plainTextSwitchCallback: !isReadOnly && !isDisabled ? onChange : null,
|
|
169
|
+
EDITORURL: EDITORURL,
|
|
170
|
+
isCustomScroll: isCustomScroll,
|
|
171
|
+
initCallback: initCallback,
|
|
172
|
+
loadingComponent: loadingComponent,
|
|
173
|
+
handleAlertMessage: handleAlertMessage,
|
|
174
|
+
toggleEdit: this.toggleEdit,
|
|
175
|
+
isEditorDefaultOpen: isEditorDefaultOpen,
|
|
176
|
+
editorCallback: editorCallback,
|
|
177
|
+
i18nKeys: i18nKeys,
|
|
178
|
+
ImgLazyLoad: ImgLazyLoad,
|
|
179
|
+
blurCallback: editorBlurCallback,
|
|
180
|
+
changeEditorContent: changeEditorContent,
|
|
181
|
+
shouldUpdateContent: shouldEditorUpdateContent,
|
|
182
|
+
setInlineAttachmentInProgress: setInlineAttachmentInProgress,
|
|
183
|
+
handleDropUpload: handleEditorDropUpload,
|
|
184
|
+
onFocus: this.focusCallback,
|
|
185
|
+
needInlineAttachment: needInlineAttachment
|
|
186
|
+
}, TextEditorProps)) : /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
187
|
+
onFocus: this.handleTextareaFocus,
|
|
188
|
+
text: value,
|
|
189
|
+
animated: !needEditor,
|
|
190
|
+
onChange: onChange,
|
|
191
|
+
dataId: dataId,
|
|
192
|
+
isReadOnly: isReadOnly,
|
|
193
|
+
isDisabled: isDisabled,
|
|
194
|
+
needEffect: !(isReadOnly || isDisabled),
|
|
195
|
+
getRef: getRef,
|
|
196
|
+
size: textBoxSize,
|
|
197
|
+
variant: textBoxVariant
|
|
198
|
+
}, Textarea2Props)))));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
}
|
|
202
|
+
TextEditorWrapper.propTypes = propTypes;
|
|
203
|
+
TextEditorWrapper.defaultProps = defaultProps;
|
|
@@ -0,0 +1,161 @@
|
|
|
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, { PureComponent } from 'react';
|
|
5
|
+
import { defaultProps } from '../../../../form/fields/TextareaField/props/defaultProps';
|
|
6
|
+
import { propTypes } from '../../../../form/fields/TextareaField/props/propTypes';
|
|
7
|
+
/**** Components ****/
|
|
8
|
+
|
|
9
|
+
import Label from '@zohodesk/components/lib/Label/Label';
|
|
10
|
+
import Textarea from '@zohodesk/components/lib/Textarea/Textarea';
|
|
11
|
+
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
|
+
import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
13
|
+
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
|
+
/**** CSS ****/
|
|
15
|
+
|
|
16
|
+
import style from '../../../../form/fields/Fields.module.css';
|
|
17
|
+
export default class TextareaField extends PureComponent {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.handleChange = this.handleChange.bind(this);
|
|
21
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
22
|
+
this.handleGetRef = this.handleGetRef.bind(this); // this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
23
|
+
|
|
24
|
+
this.getNextId = getUniqueId(this);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
handleChange(value) {
|
|
28
|
+
let {
|
|
29
|
+
id,
|
|
30
|
+
onChange
|
|
31
|
+
} = this.props;
|
|
32
|
+
onChange && onChange(id, value);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
handleBlur(value) {
|
|
36
|
+
let {
|
|
37
|
+
id,
|
|
38
|
+
onBlur
|
|
39
|
+
} = this.props;
|
|
40
|
+
onBlur && onBlur(id, value);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
handleGetRef(el) {
|
|
44
|
+
let {
|
|
45
|
+
getRef,
|
|
46
|
+
id
|
|
47
|
+
} = this.props;
|
|
48
|
+
this.textarea = el;
|
|
49
|
+
getRef && getRef(el, id);
|
|
50
|
+
} // handleLabelClick() {
|
|
51
|
+
// let { isFocusOnLabelClick } = this.props;
|
|
52
|
+
// if (isFocusOnLabelClick && this.textarea && this.textarea.focus) {
|
|
53
|
+
// this.textarea.focus();
|
|
54
|
+
// }
|
|
55
|
+
// }
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
render() {
|
|
59
|
+
let {
|
|
60
|
+
labelName,
|
|
61
|
+
id,
|
|
62
|
+
isMandatory,
|
|
63
|
+
textBoxSize,
|
|
64
|
+
animated,
|
|
65
|
+
textBoxVariant,
|
|
66
|
+
isReadOnly,
|
|
67
|
+
validationMessage,
|
|
68
|
+
validationPalette,
|
|
69
|
+
maxLength,
|
|
70
|
+
value,
|
|
71
|
+
errorType,
|
|
72
|
+
isDisabled,
|
|
73
|
+
title,
|
|
74
|
+
placeHolder,
|
|
75
|
+
dataId,
|
|
76
|
+
dataSelectorId,
|
|
77
|
+
validationRuleMessage,
|
|
78
|
+
validationRulePalette,
|
|
79
|
+
// onKeyDown,
|
|
80
|
+
infoText,
|
|
81
|
+
borderColor,
|
|
82
|
+
fieldSize,
|
|
83
|
+
labelPalette,
|
|
84
|
+
labelCustomClass,
|
|
85
|
+
htmlId,
|
|
86
|
+
lockedInfoText,
|
|
87
|
+
isLocked,
|
|
88
|
+
customProps,
|
|
89
|
+
renderLabelProps
|
|
90
|
+
} = this.props;
|
|
91
|
+
const {
|
|
92
|
+
LabelProps = {},
|
|
93
|
+
TextareaProps = {},
|
|
94
|
+
ValidationMessageProps1 = {},
|
|
95
|
+
ValidationMessageProps2 = {}
|
|
96
|
+
} = customProps;
|
|
97
|
+
let uniqueId = htmlId ? htmlId : this.getNextId();
|
|
98
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
99
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
100
|
+
"data-title": isDisabled ? title : null,
|
|
101
|
+
"data-selector-id": dataSelectorId
|
|
102
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
103
|
+
infoText: infoText,
|
|
104
|
+
isLocked: isLocked,
|
|
105
|
+
lockedInfoText: lockedInfoText,
|
|
106
|
+
renderProps: renderLabelProps
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
108
|
+
text: labelName,
|
|
109
|
+
id: id,
|
|
110
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
111
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
112
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
113
|
+
htmlFor: uniqueId,
|
|
114
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
115
|
+
}, LabelProps))), /*#__PURE__*/React.createElement("div", {
|
|
116
|
+
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Textarea, _extends({
|
|
118
|
+
onChange: this.handleChange,
|
|
119
|
+
animated: animated,
|
|
120
|
+
size: fieldSize === 'medium' ? textBoxSize : 'xmedium',
|
|
121
|
+
variant: textBoxVariant,
|
|
122
|
+
isReadOnly: isReadOnly,
|
|
123
|
+
isDisabled: isDisabled,
|
|
124
|
+
getRef: this.handleGetRef,
|
|
125
|
+
maxLength: maxLength,
|
|
126
|
+
text: value,
|
|
127
|
+
placeHolder: placeHolder,
|
|
128
|
+
dataId: `property(${dataId})`,
|
|
129
|
+
onBlur: this.handleBlur,
|
|
130
|
+
borderColor: borderColor,
|
|
131
|
+
needEffect: isReadOnly || isDisabled ? false : true,
|
|
132
|
+
resize: "vertical" // onKeyDown={onKeyDown}
|
|
133
|
+
,
|
|
134
|
+
htmlId: uniqueId
|
|
135
|
+
}, TextareaProps, {
|
|
136
|
+
a11y: {
|
|
137
|
+
ariaLabelledby: labelName
|
|
138
|
+
}
|
|
139
|
+
})), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
140
|
+
text: validationMessage,
|
|
141
|
+
palette: validationPalette,
|
|
142
|
+
type: errorType,
|
|
143
|
+
htmlFor: uniqueId,
|
|
144
|
+
dataId: `${dataId}_ValidationMessage`
|
|
145
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
146
|
+
text: validationRuleMessage,
|
|
147
|
+
palette: validationRulePalette,
|
|
148
|
+
type: errorType,
|
|
149
|
+
htmlFor: uniqueId,
|
|
150
|
+
dataId: `${dataId}_ValidationRuleMessage`
|
|
151
|
+
}, ValidationMessageProps2))));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
TextareaField.propTypes = propTypes;
|
|
156
|
+
TextareaField.defaultProps = defaultProps; // if (__DOCS__) {
|
|
157
|
+
// TextareaField.docs = {
|
|
158
|
+
// componentGroup: 'Form Fields',
|
|
159
|
+
// folderName: 'General'
|
|
160
|
+
// };
|
|
161
|
+
// }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../../../form/fields/ValidationMessage/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../../../form/fields/ValidationMessage/props/propTypes';
|
|
4
|
+
import Label from '@zohodesk/components/lib/Label/Label';
|
|
5
|
+
import colors from '@zohodesk/components/lib/Label/LabelColors.module.css';
|
|
6
|
+
import style from '../../../../form/fields/ValidationMessage/ValidationMessage.module.css';
|
|
7
|
+
import { Icon } from '@zohodesk/icons';
|
|
8
|
+
export default class ValidationMessage extends React.Component {
|
|
9
|
+
render() {
|
|
10
|
+
let {
|
|
11
|
+
palette,
|
|
12
|
+
text,
|
|
13
|
+
htmlFor,
|
|
14
|
+
onClick,
|
|
15
|
+
type,
|
|
16
|
+
size,
|
|
17
|
+
dataId,
|
|
18
|
+
clipped,
|
|
19
|
+
a11y,
|
|
20
|
+
tooltip,
|
|
21
|
+
dataSelectorId
|
|
22
|
+
} = this.props;
|
|
23
|
+
let {
|
|
24
|
+
role = 'alert'
|
|
25
|
+
} = a11y;
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
role: role,
|
|
28
|
+
onClick: onClick,
|
|
29
|
+
className: `${type === 'primary' ? style.primary : style.secondary}`,
|
|
30
|
+
"data-id": "errorMsgContainer",
|
|
31
|
+
"data-test-id": "errorMsgContainer",
|
|
32
|
+
"data-selector-id": dataSelectorId
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Label, {
|
|
34
|
+
text: text,
|
|
35
|
+
htmlFor: htmlFor,
|
|
36
|
+
palette: palette,
|
|
37
|
+
size: size,
|
|
38
|
+
dataId: dataId,
|
|
39
|
+
clipped: clipped,
|
|
40
|
+
title: clipped ? text : '',
|
|
41
|
+
customClass: style.lable
|
|
42
|
+
}), tooltip ? /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: `${style.icon} ${colors[palette]}`,
|
|
44
|
+
"data-title": tooltip
|
|
45
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
46
|
+
name: "ZD-information57",
|
|
47
|
+
size: "14"
|
|
48
|
+
})) : null);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
ValidationMessage.propTypes = propTypes;
|
|
53
|
+
ValidationMessage.defaultProps = defaultProps; // if (__DOCS__) {
|
|
54
|
+
// ValidationMessage.docs = {
|
|
55
|
+
// componentGroup: 'Form Fields',
|
|
56
|
+
// folderName: 'Style Guide'
|
|
57
|
+
// };
|
|
58
|
+
// }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { default as CheckBoxField } from './CheckBoxField/CheckBoxField';
|
|
2
|
+
export { default as CurrencyField } from './CurrencyField/CurrencyField';
|
|
3
|
+
export { default as DateField } from './DateField/DateField';
|
|
4
|
+
export { default as FieldContainer } from './FieldContainer/FieldContainer';
|
|
5
|
+
export { default as MultiSelectField } from './MultiSelectField/MultiSelectField';
|
|
6
|
+
export { default as PhoneField } from './PhoneField/PhoneField';
|
|
7
|
+
export { default as RadioField } from './RadioField/RadioField';
|
|
8
|
+
export { default as SelectField } from './SelectField/SelectField';
|
|
9
|
+
export { default as TagsMultiSelect } from './TagsMultiSelect/TagsMultiSelect';
|
|
10
|
+
export { default as TagsMultiSelectField } from './TagsMultiSelectField/TagsMultiSelectField';
|
|
11
|
+
export { default as TextareaField } from './TextareaField/TextareaField';
|
|
12
|
+
export { default as TextBoxField } from './TextBoxField/TextBoxField';
|
|
13
|
+
export { default as TextEditor } from './TextEditor/TextEditor';
|
|
14
|
+
export { default as TextEditorField } from './TextEditorField/TextEditorField';
|
|
15
|
+
export { default as TextEditorWrapper } from './TextEditorWrapper/TextEditorWrapper';
|
|
16
|
+
export { default as ValidationMessage } from './ValidationMessage/ValidationMessage';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { defaultProps } from '../../../../form/layout/Field/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../../../form/layout/Field/props/propTypes';
|
|
4
|
+
import style from '../../../../form/layout/Field/Field.module.css';
|
|
5
|
+
export default class Field extends Component {
|
|
6
|
+
render() {
|
|
7
|
+
let {
|
|
8
|
+
width,
|
|
9
|
+
children,
|
|
10
|
+
rowBreak,
|
|
11
|
+
column,
|
|
12
|
+
className,
|
|
13
|
+
containerClass,
|
|
14
|
+
dataId
|
|
15
|
+
} = this.props;
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: `${containerClass ? containerClass : ''} ${column == 'single' ? `${style.singleColumn}` : `${style[width]} `}`,
|
|
18
|
+
"data-id": dataId,
|
|
19
|
+
"data-test-id": dataId
|
|
20
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
className: `${className ? className : ''} ${`fieldWidth_${width}`}`
|
|
22
|
+
}, children)), rowBreak && /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: style.rowBreak
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
Field.propTypes = propTypes;
|
|
29
|
+
Field.defaultProps = defaultProps; // if (__DOCS__) {
|
|
30
|
+
// Field.docs = {
|
|
31
|
+
// componentGroup: 'ModuleAddForm'
|
|
32
|
+
// };
|
|
33
|
+
// }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import { propTypes } from '../../../../form/layout/Section/props/propTypes';
|
|
3
|
+
import style from '../../../../form/layout/Section/ModuleFormSection.module.css';
|
|
4
|
+
export default class Section extends Component {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
render() {
|
|
10
|
+
let {
|
|
11
|
+
title,
|
|
12
|
+
dataId,
|
|
13
|
+
containerClass,
|
|
14
|
+
titleClass,
|
|
15
|
+
className,
|
|
16
|
+
column,
|
|
17
|
+
formName
|
|
18
|
+
} = this.props;
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
"data-id": dataId,
|
|
21
|
+
"data-test-id": dataId,
|
|
22
|
+
className: containerClass ? containerClass : ''
|
|
23
|
+
}, title && /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: titleClass ? titleClass : ''
|
|
25
|
+
}, title), /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
className: `${className ? className : ''} ${column == 'single' ? style.singleColumn : ''}`,
|
|
27
|
+
"data-id": formName && formName,
|
|
28
|
+
"data-test-id": formName && formName
|
|
29
|
+
}, this.props.children));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
Section.propTypes = propTypes; // if (__DOCS__) {
|
|
34
|
+
// Section.docs = {
|
|
35
|
+
// componentGroup: 'ModuleAddForm'
|
|
36
|
+
// };
|
|
37
|
+
// }
|