@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,346 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _defaultProps = require("../../../../form/fields/TagsMultiSelect/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _propTypes = require("../../../../form/fields/TagsMultiSelect/props/propTypes");
|
|
15
|
+
|
|
16
|
+
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
17
|
+
|
|
18
|
+
var _Tag = _interopRequireDefault(require("@zohodesk/components/lib/Tag/Tag"));
|
|
19
|
+
|
|
20
|
+
var _TextBoxIcon = _interopRequireDefault(require("@zohodesk/components/lib/TextBoxIcon/TextBoxIcon"));
|
|
21
|
+
|
|
22
|
+
var _EmptySearch = _interopRequireDefault(require("@zohodesk/svg/lib/emptystate/version3/EmptySearch"));
|
|
23
|
+
|
|
24
|
+
var _ListItem = _interopRequireDefault(require("@zohodesk/components/lib/ListItem/ListItem"));
|
|
25
|
+
|
|
26
|
+
var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
|
|
27
|
+
|
|
28
|
+
var _DropDownSeparator = _interopRequireDefault(require("@zohodesk/components/lib/DropDown/DropDownSeparator"));
|
|
29
|
+
|
|
30
|
+
var _CommonEmptyState = _interopRequireDefault(require("../../../emptystate/CommonEmptyState/CommonEmptyState"));
|
|
31
|
+
|
|
32
|
+
var _ResponsiveDropBox = _interopRequireDefault(require("@zohodesk/components/lib/ResponsiveDropBox/ResponsiveDropBox"));
|
|
33
|
+
|
|
34
|
+
var _CustomResponsive = require("@zohodesk/components/lib/Responsive/CustomResponsive");
|
|
35
|
+
|
|
36
|
+
var _General = require("../../../../utils/General");
|
|
37
|
+
|
|
38
|
+
var _Common = require("@zohodesk/components/lib/utils/Common.js");
|
|
39
|
+
|
|
40
|
+
var _TagsMultiSelectModule = _interopRequireDefault(require("../../../../form/fields/TagsMultiSelect/TagsMultiSelect.module.css"));
|
|
41
|
+
|
|
42
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
43
|
+
|
|
44
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
|
+
|
|
46
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
47
|
+
|
|
48
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
49
|
+
|
|
50
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
51
|
+
|
|
52
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
53
|
+
|
|
54
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
55
|
+
|
|
56
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
57
|
+
|
|
58
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
|
+
|
|
60
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
61
|
+
|
|
62
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
63
|
+
|
|
64
|
+
var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
65
|
+
_inherits(TagsMultiSelect, _React$Component);
|
|
66
|
+
|
|
67
|
+
var _super = _createSuper(TagsMultiSelect);
|
|
68
|
+
|
|
69
|
+
function TagsMultiSelect(props) {
|
|
70
|
+
var _this;
|
|
71
|
+
|
|
72
|
+
_classCallCheck(this, TagsMultiSelect);
|
|
73
|
+
|
|
74
|
+
_this = _super.call(this, props);
|
|
75
|
+
_this.state = {
|
|
76
|
+
showAll: false
|
|
77
|
+
};
|
|
78
|
+
_this.emptySearchSVG = _this.emptySearchSVG.bind(_assertThisInitialized(_this));
|
|
79
|
+
_this.onShowAllClick = _this.onShowAllClick.bind(_assertThisInitialized(_this));
|
|
80
|
+
_this.getContainerRef = _this.getContainerRef.bind(_assertThisInitialized(_this));
|
|
81
|
+
_this.onScroll = _this.onScroll.bind(_assertThisInitialized(_this));
|
|
82
|
+
_this.getSelectedItemRef = _this.getSelectedItemRef.bind(_assertThisInitialized(_this));
|
|
83
|
+
_this.textInputRef = _this.textInputRef.bind(_assertThisInitialized(_this));
|
|
84
|
+
return _this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
_createClass(TagsMultiSelect, [{
|
|
88
|
+
key: "textInputRef",
|
|
89
|
+
value: function textInputRef(el) {
|
|
90
|
+
var getTextInputRef = this.props.getTextInputRef;
|
|
91
|
+
this.inputEl = el;
|
|
92
|
+
getTextInputRef && getTextInputRef(el);
|
|
93
|
+
}
|
|
94
|
+
}, {
|
|
95
|
+
key: "onScroll",
|
|
96
|
+
value: function onScroll() {
|
|
97
|
+
var _this$props = this.props,
|
|
98
|
+
onScroll = _this$props.onScroll,
|
|
99
|
+
name = _this$props.name,
|
|
100
|
+
noMoreData = _this$props.noMoreData,
|
|
101
|
+
searchList = _this$props.searchList;
|
|
102
|
+
var containerRef = this.containerRef;
|
|
103
|
+
|
|
104
|
+
if ((0, _Common.findScrollEnd)(this.containerRef) && !noMoreData) {
|
|
105
|
+
onScroll(name);
|
|
106
|
+
var selectItemRef = this["selectedList_".concat(searchList.length - 1)];
|
|
107
|
+
(0, _Common.scrollTo)(containerRef, selectItemRef);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
key: "getSelectedItemRef",
|
|
112
|
+
value: function getSelectedItemRef(el, index) {
|
|
113
|
+
this["selectedList_".concat(index)] = el;
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
key: "componentDidUpdate",
|
|
117
|
+
value: function componentDidUpdate(prevProps) {
|
|
118
|
+
var _this2 = this;
|
|
119
|
+
|
|
120
|
+
var _this$props2 = this.props,
|
|
121
|
+
isTagListLoading = _this$props2.isTagListLoading,
|
|
122
|
+
tagsList = _this$props2.tagsList,
|
|
123
|
+
isPopupReady = _this$props2.isPopupReady,
|
|
124
|
+
selectSearchIndex = _this$props2.selectSearchIndex;
|
|
125
|
+
|
|
126
|
+
if (prevProps.isTagListLoading !== isTagListLoading && !isTagListLoading || isPopupReady && prevProps.tagsList.length !== tagsList.length) {
|
|
127
|
+
setTimeout(function () {
|
|
128
|
+
if (_this2.inputEl) {
|
|
129
|
+
_this2.inputEl.focus();
|
|
130
|
+
}
|
|
131
|
+
}, 300);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (selectSearchIndex != prevProps.selectSearchIndex) {
|
|
135
|
+
var selectItemRef = this["selectedList_".concat(selectSearchIndex)];
|
|
136
|
+
var containerRef = this.containerRef;
|
|
137
|
+
(0, _Common.scrollTo)(containerRef, selectItemRef);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, {
|
|
141
|
+
key: "emptySearchSVG",
|
|
142
|
+
value: function emptySearchSVG() {
|
|
143
|
+
return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
|
|
144
|
+
size: "small"
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}, {
|
|
148
|
+
key: "onShowAllClick",
|
|
149
|
+
value: function onShowAllClick() {
|
|
150
|
+
this.setState({
|
|
151
|
+
showAll: !this.state.showAll
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}, {
|
|
155
|
+
key: "getContainerRef",
|
|
156
|
+
value: function getContainerRef(ele) {
|
|
157
|
+
this.containerRef = ele;
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "responsiveFunc",
|
|
161
|
+
value: function responsiveFunc(_ref) {
|
|
162
|
+
var mediaQueryOR = _ref.mediaQueryOR;
|
|
163
|
+
return {
|
|
164
|
+
tabletMode: mediaQueryOR([{
|
|
165
|
+
maxWidth: 700
|
|
166
|
+
}])
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "render",
|
|
171
|
+
value: function render() {
|
|
172
|
+
var _this3 = this;
|
|
173
|
+
|
|
174
|
+
var _this$props3 = this.props,
|
|
175
|
+
searchList = _this$props3.searchList,
|
|
176
|
+
selectSearchIndex = _this$props3.selectSearchIndex,
|
|
177
|
+
tagsList = _this$props3.tagsList,
|
|
178
|
+
deleteTag = _this$props3.deleteTag,
|
|
179
|
+
name = _this$props3.name,
|
|
180
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
181
|
+
className = _this$props3.className,
|
|
182
|
+
handleKeyUp = _this$props3.handleKeyUp,
|
|
183
|
+
handleChange = _this$props3.handleChange,
|
|
184
|
+
addTag = _this$props3.addTag,
|
|
185
|
+
isTagListLoading = _this$props3.isTagListLoading,
|
|
186
|
+
getContainerRef = _this$props3.getContainerRef,
|
|
187
|
+
getTargetRef = _this$props3.getTargetRef,
|
|
188
|
+
isPopupReady = _this$props3.isPopupReady,
|
|
189
|
+
isPopupOpen = _this$props3.isPopupOpen,
|
|
190
|
+
boxPosition = _this$props3.boxPosition,
|
|
191
|
+
handleTogglePopup = _this$props3.handleTogglePopup,
|
|
192
|
+
listDisabled = _this$props3.listDisabled,
|
|
193
|
+
chipNeedToShow = _this$props3.chipNeedToShow,
|
|
194
|
+
i18nKeys = _this$props3.i18nKeys,
|
|
195
|
+
dataId = _this$props3.dataId,
|
|
196
|
+
needBorder = _this$props3.needBorder,
|
|
197
|
+
borderColor = _this$props3.borderColor,
|
|
198
|
+
getTextBoxChildren = _this$props3.getTextBoxChildren,
|
|
199
|
+
htmlId = _this$props3.htmlId,
|
|
200
|
+
boxSize = _this$props3.boxSize,
|
|
201
|
+
onSelectTag = _this$props3.onSelectTag,
|
|
202
|
+
clickableTag = _this$props3.clickableTag,
|
|
203
|
+
dataSelectorId = _this$props3.dataSelectorId;
|
|
204
|
+
var showAll = this.state.showAll;
|
|
205
|
+
var chipLimit = !isPopupReady ? showAll ? tagsList.length : chipNeedToShow : tagsList.length;
|
|
206
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
207
|
+
className: " ".concat(!isReadOnly ? " ".concat(needBorder ? _TagsMultiSelectModule["default"].hasBorder : '', "\n ").concat(needBorder ? _TagsMultiSelectModule["default"]["borderColor_".concat(borderColor)] : _TagsMultiSelectModule["default"].borderColor_transparent, " ").concat(isPopupReady && needBorder ? _TagsMultiSelectModule["default"].active : '') : '', " ").concat(className),
|
|
208
|
+
onClick: _General.stopBubbling,
|
|
209
|
+
"data-id": "".concat(dataId, "_tagsContainer"),
|
|
210
|
+
"data-test-id": "".concat(dataId, "_tagsContainer"),
|
|
211
|
+
"data-selector-id": dataSelectorId
|
|
212
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
213
|
+
alignBox: "row",
|
|
214
|
+
align: "vertical",
|
|
215
|
+
isCover: false,
|
|
216
|
+
className: _TagsMultiSelectModule["default"].tagDiv,
|
|
217
|
+
wrap: "wrap",
|
|
218
|
+
eleRef: getTargetRef,
|
|
219
|
+
scroll: "vertical"
|
|
220
|
+
}, tagsList.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, tagsList.map(function (tag, index) {
|
|
221
|
+
var name = tag.name,
|
|
222
|
+
tagType = tag.tagType,
|
|
223
|
+
id = tag.id;
|
|
224
|
+
return index < chipLimit ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
225
|
+
className: _TagsMultiSelectModule["default"].tag,
|
|
226
|
+
key: index
|
|
227
|
+
}, /*#__PURE__*/_react["default"].createElement(_Tag["default"], {
|
|
228
|
+
id: id,
|
|
229
|
+
text: name,
|
|
230
|
+
onRemove: isReadOnly ? null : deleteTag.bind(_this3, name),
|
|
231
|
+
closeTitle: i18nKeys.deleteText,
|
|
232
|
+
palette: clickableTag ? 'defaultLink' : tagType === 'SYSTEM' ? 'primary' : 'default',
|
|
233
|
+
isReadOnly: isReadOnly,
|
|
234
|
+
onSelectTag: onSelectTag ? onSelectTag : undefined
|
|
235
|
+
})) : null;
|
|
236
|
+
}), tagsList.length > chipNeedToShow && !isPopupReady ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
237
|
+
className: _TagsMultiSelectModule["default"].moreLess,
|
|
238
|
+
dataId: "".concat(dataId, "_tagsMore"),
|
|
239
|
+
onClick: this.onShowAllClick
|
|
240
|
+
}, showAll ? "".concat(i18nKeys.lessText) : "+".concat(tagsList.length - chipNeedToShow, " ").concat(i18nKeys.moreText)) : null) : null, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
241
|
+
flexible: true,
|
|
242
|
+
adjust: true,
|
|
243
|
+
shrink: true,
|
|
244
|
+
className: _TagsMultiSelectModule["default"].inputWrapper
|
|
245
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
246
|
+
className: _TagsMultiSelectModule["default"].custmSpan
|
|
247
|
+
}, name), /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
248
|
+
htmlId: htmlId,
|
|
249
|
+
dataId: "".concat(dataId, "_tagInp"),
|
|
250
|
+
value: name,
|
|
251
|
+
onKeyUp: handleKeyUp,
|
|
252
|
+
onChange: handleChange,
|
|
253
|
+
maxLength: 50,
|
|
254
|
+
isReadOnly: isReadOnly,
|
|
255
|
+
needBorder: false,
|
|
256
|
+
placeHolder: tagsList.length ? '' : i18nKeys.placeholderText || '-',
|
|
257
|
+
onClick: !isReadOnly ? handleTogglePopup : undefined,
|
|
258
|
+
customClass: {
|
|
259
|
+
customTBoxWrap: _TagsMultiSelectModule["default"].custmInp,
|
|
260
|
+
customTextBox: _TagsMultiSelectModule["default"].input
|
|
261
|
+
},
|
|
262
|
+
size: "xsmall",
|
|
263
|
+
inputRef: this.textInputRef
|
|
264
|
+
}, getTextBoxChildren ? getTextBoxChildren() : null))), isPopupOpen ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
|
|
265
|
+
query: this.responsiveFunc,
|
|
266
|
+
responsiveId: "Helmet"
|
|
267
|
+
}, function (_ref2) {
|
|
268
|
+
var tabletMode = _ref2.tabletMode;
|
|
269
|
+
return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
|
|
270
|
+
isAnimate: false,
|
|
271
|
+
isActive: isPopupReady,
|
|
272
|
+
isArrow: false,
|
|
273
|
+
getRef: getContainerRef,
|
|
274
|
+
isBoxPaddingNeed: true,
|
|
275
|
+
size: boxSize,
|
|
276
|
+
boxPosition: boxPosition,
|
|
277
|
+
isPadding: false,
|
|
278
|
+
customClass: {
|
|
279
|
+
customDropBoxWrap: _TagsMultiSelectModule["default"].dropdown
|
|
280
|
+
},
|
|
281
|
+
dataId: "".concat(dataId, "_dropbox"),
|
|
282
|
+
isResponsivePadding: true,
|
|
283
|
+
alignBox: "row"
|
|
284
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
285
|
+
flexible: true
|
|
286
|
+
}, isTagListLoading ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
287
|
+
align: "both",
|
|
288
|
+
className: "".concat(tabletMode ? '' : _TagsMultiSelectModule["default"].viewpopNew)
|
|
289
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)) : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
290
|
+
scroll: "vertical",
|
|
291
|
+
className: "".concat(tabletMode ? '' : _TagsMultiSelectModule["default"].viewpopNew),
|
|
292
|
+
onScroll: _this3.onScroll,
|
|
293
|
+
eleRef: _this3.getContainerRef
|
|
294
|
+
}, searchList.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
295
|
+
flexible: true,
|
|
296
|
+
shrink: true
|
|
297
|
+
}, searchList.map(function (item, index) {
|
|
298
|
+
var name = item.name,
|
|
299
|
+
isNew = item.isNew;
|
|
300
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, searchList.length > 1 && isNew ? /*#__PURE__*/_react["default"].createElement(_DropDownSeparator["default"], null) : null, /*#__PURE__*/_react["default"].createElement(_ListItem["default"], {
|
|
301
|
+
key: index,
|
|
302
|
+
index: index,
|
|
303
|
+
autoHover: true,
|
|
304
|
+
value: isNew ? '' : name,
|
|
305
|
+
title: isNew ? '' : name,
|
|
306
|
+
onClick: addTag.bind(_this3, item),
|
|
307
|
+
needTick: true,
|
|
308
|
+
highlight: selectSearchIndex === index,
|
|
309
|
+
getRef: _this3.getSelectedItemRef,
|
|
310
|
+
isDisabled: listDisabled
|
|
311
|
+
}, isNew ? /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
312
|
+
alignBox: "row",
|
|
313
|
+
align: "vertical"
|
|
314
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
315
|
+
className: _TagsMultiSelectModule["default"].newTagLabel
|
|
316
|
+
}, i18nKeys.newTagText, ":"), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
317
|
+
shrink: true,
|
|
318
|
+
"data-title": name,
|
|
319
|
+
className: "".concat(_TagsMultiSelectModule["default"].dotted, " ").concat(_TagsMultiSelectModule["default"].newTagText, " "),
|
|
320
|
+
dataId: "".concat(dataId, "_new_tag_text")
|
|
321
|
+
}, name)) : null));
|
|
322
|
+
})) : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
323
|
+
flexible: true,
|
|
324
|
+
dataId: "".concat(dataId, "_empty")
|
|
325
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
326
|
+
className: _TagsMultiSelectModule["default"].searchEmpty
|
|
327
|
+
}, /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
|
|
328
|
+
title: i18nKeys.emptyTitleText,
|
|
329
|
+
description: i18nKeys.emptyDescription,
|
|
330
|
+
size: "small",
|
|
331
|
+
getEmptyState: _this3.emptySearchSVG
|
|
332
|
+
})))))));
|
|
333
|
+
}) : null);
|
|
334
|
+
}
|
|
335
|
+
}]);
|
|
336
|
+
|
|
337
|
+
return TagsMultiSelect;
|
|
338
|
+
}(_react["default"].Component);
|
|
339
|
+
|
|
340
|
+
exports["default"] = TagsMultiSelect;
|
|
341
|
+
TagsMultiSelect.propTypes = _propTypes.propTypes;
|
|
342
|
+
TagsMultiSelect.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
343
|
+
// TagsMultiSelect.docs = {
|
|
344
|
+
// componentGroup: 'TagsMultiSelect'
|
|
345
|
+
// };
|
|
346
|
+
// }
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _defaultProps = require("../../../../form/fields/TagsMultiSelectField/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _propTypes = require("../../../../form/fields/TagsMultiSelectField/props/propTypes");
|
|
15
|
+
|
|
16
|
+
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
17
|
+
|
|
18
|
+
var _Label = _interopRequireDefault(require("@zohodesk/components/lib/Label/Label"));
|
|
19
|
+
|
|
20
|
+
var _Popup = _interopRequireDefault(require("@zohodesk/components/lib/Popup/Popup"));
|
|
21
|
+
|
|
22
|
+
var _ValidationMessage = _interopRequireDefault(require("../ValidationMessage/ValidationMessage"));
|
|
23
|
+
|
|
24
|
+
var _TagsMultiSelect = _interopRequireDefault(require("../TagsMultiSelect/TagsMultiSelect"));
|
|
25
|
+
|
|
26
|
+
var _FieldContainer = _interopRequireDefault(require("../FieldContainer/FieldContainer"));
|
|
27
|
+
|
|
28
|
+
var _FieldsModule = _interopRequireDefault(require("../../../../form/fields/Fields.module.css"));
|
|
29
|
+
|
|
30
|
+
var _TagsMultiSelectFieldModule = _interopRequireDefault(require("../../../../form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css"));
|
|
31
|
+
|
|
32
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
33
|
+
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
41
|
+
|
|
42
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
43
|
+
|
|
44
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
45
|
+
|
|
46
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
47
|
+
|
|
48
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
49
|
+
|
|
50
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
51
|
+
|
|
52
|
+
var TagsMultiSelectField = function TagsMultiSelectField(props) {
|
|
53
|
+
var _useState = (0, _react.useState)(0),
|
|
54
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
55
|
+
selectedSuggestionIndex = _useState2[0],
|
|
56
|
+
updateSelectedSuggestionIndex = _useState2[1];
|
|
57
|
+
|
|
58
|
+
var _useState3 = (0, _react.useState)(false),
|
|
59
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
60
|
+
isValueChanged = _useState4[0],
|
|
61
|
+
updateValueChangedState = _useState4[1];
|
|
62
|
+
|
|
63
|
+
var _useState5 = (0, _react.useState)(props.searchValue || ''),
|
|
64
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
65
|
+
searchValue = _useState6[0],
|
|
66
|
+
changeSearchValue = _useState6[1];
|
|
67
|
+
|
|
68
|
+
var fieldProperties = props.fieldProperties,
|
|
69
|
+
styleProperties = props.styleProperties,
|
|
70
|
+
actions = props.actions,
|
|
71
|
+
dataId = props.dataId,
|
|
72
|
+
htmlId = props.htmlId,
|
|
73
|
+
isLoading = props.isLoading,
|
|
74
|
+
isListDisabled = props.isListDisabled,
|
|
75
|
+
isNewNeeded = props.isNewNeeded,
|
|
76
|
+
isPopupOpen = props.isPopupOpen,
|
|
77
|
+
isPopupReady = props.isPopupReady,
|
|
78
|
+
removeClose = props.removeClose,
|
|
79
|
+
position = props.position,
|
|
80
|
+
togglePopup = props.togglePopup,
|
|
81
|
+
noMoreData = props.noMoreData,
|
|
82
|
+
numberOfDisplayedValues = props.numberOfDisplayedValues,
|
|
83
|
+
getTargetRef = props.getTargetRef,
|
|
84
|
+
getContainerRef = props.getContainerRef,
|
|
85
|
+
_props$i18nKeys = props.i18nKeys,
|
|
86
|
+
i18nKeys = _props$i18nKeys === void 0 ? {} : _props$i18nKeys,
|
|
87
|
+
getTextBoxChildren = props.getTextBoxChildren,
|
|
88
|
+
children = props.children,
|
|
89
|
+
ePhiData = props.ePhiData,
|
|
90
|
+
customProps = props.customProps,
|
|
91
|
+
clickableTag = props.clickableTag,
|
|
92
|
+
dataSelectorId = props.dataSelectorId;
|
|
93
|
+
var _customProps$LabelPro = customProps.LabelProps,
|
|
94
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
95
|
+
_customProps$TagsMult = customProps.TagsMultiSelectProps,
|
|
96
|
+
TagsMultiSelectProps = _customProps$TagsMult === void 0 ? {} : _customProps$TagsMult,
|
|
97
|
+
_customProps$Validati = customProps.ValidationMessageProps,
|
|
98
|
+
ValidationMessageProps = _customProps$Validati === void 0 ? {} : _customProps$Validati;
|
|
99
|
+
var labelSize = styleProperties.labelSize,
|
|
100
|
+
labelPalette = styleProperties.labelPalette,
|
|
101
|
+
labelClass = styleProperties.labelClass,
|
|
102
|
+
containerClass = styleProperties.containerClass,
|
|
103
|
+
needBorder = styleProperties.needBorder,
|
|
104
|
+
borderColor = styleProperties.borderColor,
|
|
105
|
+
validationPalette = styleProperties.validationPalette,
|
|
106
|
+
errorType = styleProperties.errorType;
|
|
107
|
+
var onChange = actions.onChange,
|
|
108
|
+
onAdd = actions.onAdd,
|
|
109
|
+
onDelete = actions.onDelete,
|
|
110
|
+
onScroll = actions.onScroll,
|
|
111
|
+
onFocus = actions.onFocus;
|
|
112
|
+
var id = fieldProperties.id,
|
|
113
|
+
labelName = fieldProperties.labelName,
|
|
114
|
+
isMandatory = fieldProperties.isMandatory,
|
|
115
|
+
isDisabled = fieldProperties.isDisabled,
|
|
116
|
+
isReadOnly = fieldProperties.isReadOnly,
|
|
117
|
+
value = fieldProperties.value,
|
|
118
|
+
selectedValueCount = fieldProperties.selectedValueCount,
|
|
119
|
+
validationMessage = fieldProperties.validationMessage,
|
|
120
|
+
options = fieldProperties.options;
|
|
121
|
+
options = options || [];
|
|
122
|
+
|
|
123
|
+
var handleKeyUp = function handleKeyUp(event) {
|
|
124
|
+
var keyCode = event.keyCode;
|
|
125
|
+
onAdd = typeof onAdd !== 'function' ? function () {} : onAdd;
|
|
126
|
+
onDelete = typeof onDelete !== 'function' ? function () {} : onDelete;
|
|
127
|
+
|
|
128
|
+
if (keyCode === 13) {
|
|
129
|
+
if (selectedSuggestionIndex > -1 && options.length) {
|
|
130
|
+
if (options.length === 1 && options[0].isNew) {
|
|
131
|
+
searchValue = searchValue.replace(',', '');
|
|
132
|
+
onAdd({
|
|
133
|
+
name: searchValue
|
|
134
|
+
}, event);
|
|
135
|
+
} else {
|
|
136
|
+
onAdd(options[selectedSuggestionIndex], event);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
searchValue = searchValue.replace(',', '');
|
|
140
|
+
onAdd({
|
|
141
|
+
name: searchValue
|
|
142
|
+
}, event);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
changeSearchValue('');
|
|
146
|
+
updateSelectedSuggestionIndex(function (prevSelectedSuggestionIndex) {
|
|
147
|
+
var newIndex = 0;
|
|
148
|
+
|
|
149
|
+
if (options.length) {
|
|
150
|
+
if (options.length === 1 && options[0].isNew) {
|
|
151
|
+
return newIndex;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
newIndex = prevSelectedSuggestionIndex === options.length - 1 ? options.length - 2 : prevSelectedSuggestionIndex;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return newIndex;
|
|
158
|
+
});
|
|
159
|
+
} else if (keyCode === 188 && !event.shiftKey) {
|
|
160
|
+
searchValue = searchValue.replace(',', '');
|
|
161
|
+
|
|
162
|
+
if (options.length === 1 && options[0].isNew) {
|
|
163
|
+
onAdd({
|
|
164
|
+
name: searchValue
|
|
165
|
+
}, event);
|
|
166
|
+
changeSearchValue('');
|
|
167
|
+
}
|
|
168
|
+
} else if (keyCode === 40) {
|
|
169
|
+
updateSelectedSuggestionIndex(function (prevSelectedSuggestionIndex) {
|
|
170
|
+
var newIndex = prevSelectedSuggestionIndex >= options.length - 1 ? 0 : prevSelectedSuggestionIndex + 1;
|
|
171
|
+
return newIndex;
|
|
172
|
+
});
|
|
173
|
+
} else if (keyCode === 38) {
|
|
174
|
+
updateSelectedSuggestionIndex(function (prevSelectedSuggestionIndex) {
|
|
175
|
+
var newIndex = prevSelectedSuggestionIndex <= 0 || prevSelectedSuggestionIndex >= options.length - 1 ? options.length - 1 : prevSelectedSuggestionIndex - 1;
|
|
176
|
+
return newIndex;
|
|
177
|
+
});
|
|
178
|
+
} else if (keyCode === 8 && searchValue === '' & !isValueChanged) {
|
|
179
|
+
var valueLength = value.length;
|
|
180
|
+
value.length ? onDelete(value[valueLength - 1].name, event) : undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
updateValueChangedState(false);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
var handleChange = function handleChange(searchValue, event) {
|
|
187
|
+
updateValueChangedState(true);
|
|
188
|
+
updateSelectedSuggestionIndex(0);
|
|
189
|
+
changeSearchValue(searchValue);
|
|
190
|
+
typeof onChange === 'function' && onChange(searchValue, event);
|
|
191
|
+
|
|
192
|
+
if (!isPopupOpen) {
|
|
193
|
+
togglePopup(event);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var handleTogglePopup = function handleTogglePopup(event) {
|
|
198
|
+
if (isPopupReady) {
|
|
199
|
+
removeClose(event);
|
|
200
|
+
} else {
|
|
201
|
+
togglePopup(event, position);
|
|
202
|
+
!isPopupOpen && typeof onFocus === 'function' ? onFocus(event) : null;
|
|
203
|
+
updateSelectedSuggestionIndex(0);
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
var handleAdd = function handleAdd(value) {
|
|
208
|
+
changeSearchValue('');
|
|
209
|
+
typeof onAdd === 'function' && onAdd(value);
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
var documentClick = function documentClick() {
|
|
213
|
+
changeSearchValue('');
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
var renderEnd = function renderEnd() {
|
|
217
|
+
return children ? children : null;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
(0, _react.useEffect)(function () {
|
|
221
|
+
window.addEventListener('click', documentClick);
|
|
222
|
+
return function () {
|
|
223
|
+
window.removeEventListener('click', documentClick);
|
|
224
|
+
};
|
|
225
|
+
}, []);
|
|
226
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
227
|
+
className: "".concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
228
|
+
tabIndex: "0",
|
|
229
|
+
"aria-label": "".concat(labelName),
|
|
230
|
+
"data-selector-id": dataSelectorId
|
|
231
|
+
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
232
|
+
ePhiData: ePhiData,
|
|
233
|
+
alignContainer: "baseline",
|
|
234
|
+
renderProps: {
|
|
235
|
+
end: renderEnd
|
|
236
|
+
}
|
|
237
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
238
|
+
text: labelName,
|
|
239
|
+
title: labelName,
|
|
240
|
+
id: id,
|
|
241
|
+
size: labelSize,
|
|
242
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
243
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : '', " ").concat(labelClass ? labelClass : ''),
|
|
244
|
+
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label"),
|
|
245
|
+
htmlFor: htmlId
|
|
246
|
+
}, LabelProps)), selectedValueCount ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
247
|
+
dataId: "".concat(dataId, "_tagCount"),
|
|
248
|
+
className: _TagsMultiSelectFieldModule["default"].count
|
|
249
|
+
}, "(".concat(selectedValueCount, ")")) : null), /*#__PURE__*/_react["default"].createElement(_TagsMultiSelect["default"], _extends({
|
|
250
|
+
addTag: handleAdd,
|
|
251
|
+
deleteTag: onDelete,
|
|
252
|
+
handleChange: handleChange,
|
|
253
|
+
handleKeyUp: handleKeyUp,
|
|
254
|
+
isReadOnly: isReadOnly,
|
|
255
|
+
name: searchValue,
|
|
256
|
+
noMoreData: noMoreData,
|
|
257
|
+
searchList: isNewNeeded && searchValue.length && !options.length ? [{
|
|
258
|
+
isNew: true,
|
|
259
|
+
name: searchValue
|
|
260
|
+
}] : options,
|
|
261
|
+
selectSearchIndex: selectedSuggestionIndex,
|
|
262
|
+
tagsList: value,
|
|
263
|
+
i18nKeys: i18nKeys,
|
|
264
|
+
boxPosition: position,
|
|
265
|
+
getTargetRef: getTargetRef,
|
|
266
|
+
getContainerRef: getContainerRef,
|
|
267
|
+
handleTogglePopup: handleTogglePopup,
|
|
268
|
+
isPopupReady: isPopupReady,
|
|
269
|
+
isPopupOpen: isPopupOpen,
|
|
270
|
+
onScroll: onScroll,
|
|
271
|
+
isTagListLoading: isLoading,
|
|
272
|
+
listDisabled: isListDisabled,
|
|
273
|
+
chipNeedToShow: numberOfDisplayedValues,
|
|
274
|
+
dataId: dataId,
|
|
275
|
+
needBorder: needBorder,
|
|
276
|
+
borderColor: borderColor,
|
|
277
|
+
htmlId: htmlId,
|
|
278
|
+
getTextBoxChildren: getTextBoxChildren,
|
|
279
|
+
className: containerClass
|
|
280
|
+
}, TagsMultiSelectProps, {
|
|
281
|
+
clickableTag: clickableTag
|
|
282
|
+
})), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
283
|
+
text: validationMessage,
|
|
284
|
+
palette: validationPalette,
|
|
285
|
+
type: errorType,
|
|
286
|
+
dataId: "".concat(dataId, "_ValidationMessage"),
|
|
287
|
+
htmlFor: htmlId
|
|
288
|
+
}, ValidationMessageProps)));
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
var _default = (0, _Popup["default"])(TagsMultiSelectField);
|
|
292
|
+
|
|
293
|
+
exports["default"] = _default;
|
|
294
|
+
TagsMultiSelectField.propTypes = _propTypes.propTypes;
|
|
295
|
+
TagsMultiSelectField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
296
|
+
// TagsMultiSelectField.docs = {
|
|
297
|
+
// componentGroup: 'TagsMultiSelectField'
|
|
298
|
+
// };
|
|
299
|
+
// }
|