@zohodesk/dot 1.2.2 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli/PropLessFiles.html +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +9 -0
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +12 -12
- package/coverage/coverage-summary.json +12 -12
- package/coverage/index.html +1 -1
- package/es/Drawer/Drawer.js +10 -10
- package/es/TagWithIcon/props/propTypes.js +1 -1
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +5 -2
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +7 -3
- package/es/layout/SubtabLayout/props/propTypes.js +1 -1
- package/es/list/status/StatusDropdown/StatusDropdown.js +4 -1
- package/es/list/status/StatusDropdown/props/propTypes.js +2 -1
- package/es/lookup/Lookup/Lookup.js +10 -10
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +2 -1
- package/es/setup/helptips/ListGroup/ListGroup.js +1 -1
- package/es/v1/Attachment/Attachment.js +88 -0
- package/es/v1/AttachmentViewer/AttachmentImage.js +79 -0
- package/es/v1/AttachmentViewer/AttachmentViewer.js +541 -0
- package/es/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/es/v1/Drawer/Drawer.js +11 -11
- package/es/v1/FlipCard/FlipCard.js +3 -3
- package/es/v1/FreezeLayer/FreezeLayer.js +74 -0
- package/es/v1/Image/Image.js +39 -0
- package/es/v1/Link/Link.js +2 -1
- package/es/v1/Loader/Loader.js +21 -0
- package/es/v1/Message/Message.js +118 -0
- package/es/v1/MessageBanner/MessageBanner.js +1 -1
- package/es/v1/PlusIcon/PlusIcon.js +44 -0
- package/es/v1/Separator/Separator.js +60 -0
- package/es/v1/ToastMessage/ToastMessage.js +203 -0
- package/es/v1/Upload/Upload.js +76 -0
- package/es/v1/actions/AutoClose.js +43 -0
- package/es/v1/alert/index.js +2 -0
- package/es/v1/avatar/AvatarClose/AvatarClose.js +53 -0
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +62 -0
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +54 -0
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +72 -0
- package/es/v1/avatar/AvatarThread/AvatarThread.js +79 -0
- package/es/v1/avatar/AvatarUser/AvatarUser.js +116 -0
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +98 -0
- package/es/v1/avatar/index.js +7 -0
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +861 -0
- package/es/v1/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +86 -0
- package/es/v1/errorstate/LinkText/LinkText.js +29 -0
- package/es/v1/errorstate/NoRequestFound/NoRequestFound.js +84 -0
- package/es/v1/errorstate/PermissionPlay/PermissionPlay.js +83 -0
- package/es/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +84 -0
- package/es/v1/errorstate/UnableToProcess/UnableToProcess.js +86 -0
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +84 -0
- package/es/v1/errorstate/WillBack/WillBack.js +75 -0
- package/es/v1/errorstate/index.js +8 -0
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +141 -0
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +183 -0
- package/es/v1/form/fields/DateField/DateField.js +195 -0
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +71 -0
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +213 -0
- package/es/v1/form/fields/PhoneField/PhoneField.js +189 -0
- package/es/v1/form/fields/RadioField/RadioField.js +116 -0
- package/es/v1/form/fields/SelectField/SelectField.js +183 -0
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +292 -0
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +258 -0
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +164 -0
- package/es/v1/form/fields/TextEditor/TextEditor.js +418 -0
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +178 -0
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +203 -0
- package/es/v1/form/fields/TextareaField/TextareaField.js +161 -0
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +58 -0
- package/es/v1/form/fields/index.js +16 -0
- package/es/v1/form/layout/Field/Field.js +33 -0
- package/es/v1/form/layout/Section/Section.js +37 -0
- package/es/v1/form/layout/index.js +2 -0
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +217 -0
- package/es/v1/layout/SetupDetailLayout/index.js +4 -0
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +144 -0
- package/es/v1/layout/SubtabLayout/index.js +4 -0
- package/es/v1/list/AvatarFlip/AvatarFlip.js +76 -0
- package/es/v1/list/BluePrintStatus/BluePrintStatus.js +28 -0
- package/es/v1/list/Comment/Comment.js +45 -0
- package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +100 -0
- package/es/v1/list/Dot/Dot.js +22 -0
- package/es/v1/list/DotNew/DotNew.js +29 -0
- package/es/v1/list/GridStencils/GridStencils.js +34 -0
- package/es/v1/list/Icons/AddNewIcon.js +28 -0
- package/es/v1/list/Icons/CompleteIcon.js +30 -0
- package/es/v1/list/Icons/DeleteIcon.js +31 -0
- package/es/v1/list/Icons/EditIcon.js +31 -0
- package/es/v1/list/Icons/FloatingIcons.js +30 -0
- package/es/v1/list/Icons/ReadUnreadIcon.js +35 -0
- package/es/v1/list/Icons/SmartIcon.js +28 -0
- package/es/v1/list/Icons/index.js +7 -0
- package/es/v1/list/ListLayout/ListLayout.js +83 -0
- package/es/v1/list/ListStencils/ListStencils.js +47 -0
- package/es/v1/list/SecondaryText/AccountName.js +85 -0
- package/es/v1/list/SecondaryText/ContactName.js +85 -0
- package/es/v1/list/SecondaryText/DepartmentText.js +30 -0
- package/es/v1/list/SecondaryText/Email.js +55 -0
- package/es/v1/list/SecondaryText/HappinessRating.js +31 -0
- package/es/v1/list/SecondaryText/PhoneNumber.js +59 -0
- package/es/v1/list/SecondaryText/PriorityText.js +33 -0
- package/es/v1/list/SecondaryText/SecondaryText.js +40 -0
- package/es/v1/list/SecondaryText/StatusText.js +34 -0
- package/es/v1/list/SecondaryText/TicketId.js +53 -0
- package/es/v1/list/SecondaryText/Website.js +43 -0
- package/es/v1/list/SecondaryText/index.js +11 -0
- package/es/v1/list/SecondryPanel/SecondryPanel.js +105 -0
- package/es/v1/list/SentimentStatus/SentimentStatus.js +34 -0
- package/es/v1/list/Subject/Subject.js +57 -0
- package/es/v1/list/TagNew/TagNew.js +33 -0
- package/es/v1/list/Thread/Thread.js +43 -0
- package/es/v1/list/UserTime/UserTime.js +83 -0
- package/es/v1/list/index.js +17 -0
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +465 -0
- package/es/v1/list/status/StatusListItem/StatusListItem.js +122 -0
- package/es/v1/list/status/index.js +2 -0
- package/es/v1/lookup/EmptyPage/EmptyPage.js +65 -0
- package/es/v1/lookup/Lookup/Lookup.js +12 -10
- package/es/v1/lookup/Section/Section.js +25 -0
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +176 -0
- package/es/v1/lookup/header/index.js +5 -0
- package/es/v1/setup/header/Button/Button.js +36 -0
- package/es/v1/setup/header/Link/Link.js +44 -0
- package/es/v1/setup/header/Search/Search.js +81 -0
- package/es/v1/setup/header/Views/Views.js +46 -0
- package/es/v1/setup/header/index.js +4 -0
- package/es/v1/setup/helptips/Description/Description.js +24 -0
- package/es/v1/setup/helptips/Link/Link.js +41 -0
- package/es/v1/setup/helptips/ListGroup/ListGroup.js +39 -0
- package/es/v1/setup/helptips/Title/Title.js +24 -0
- package/es/v1/setup/helptips/index.js +4 -0
- package/es/v1/setup/index.js +6 -0
- package/es/v1/setup/table/index.js +5 -0
- package/es/v1/svg/PlusIcon.js +32 -0
- package/es/v1/svg/SnippetIcon.js +34 -0
- package/es/v1/svg/TemplateIcon.js +35 -0
- package/es/v1/svg/index.js +3 -0
- package/es/v1/version2/alertIcons/index.js +8 -0
- package/es/v1/version2/index.js +12 -0
- package/es/v1/version2/lookup/AlertHeader/AlertHeader.js +79 -0
- package/es/v1/version2/lookup/AlertLookup/AlertLookup.js +17 -5
- package/es/v1/version2/notification/DesktopNotification/DesktopNotification.js +164 -0
- package/lib/Drawer/Drawer.js +15 -15
- package/lib/TagWithIcon/props/propTypes.js +1 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +5 -3
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/lib/layout/SubtabLayout/props/propTypes.js +1 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +4 -3
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/lookup/Lookup/Lookup.js +15 -15
- package/lib/lookup/header/ViewDropDown/ViewDropDown.js +2 -1
- package/lib/setup/helptips/ListGroup/ListGroup.js +1 -1
- package/lib/v1/Attachment/Attachment.js +140 -0
- package/lib/v1/AttachmentViewer/AttachmentImage.js +124 -0
- package/lib/v1/AttachmentViewer/AttachmentViewer.js +625 -0
- package/lib/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/v1/Drawer/Drawer.js +16 -16
- package/lib/v1/FlipCard/FlipCard.js +3 -3
- package/lib/v1/FreezeLayer/FreezeLayer.js +94 -0
- package/lib/v1/Image/Image.js +89 -0
- package/lib/v1/Link/Link.js +2 -1
- package/lib/v1/Loader/Loader.js +70 -0
- package/lib/v1/Message/Message.js +170 -0
- package/lib/v1/MessageBanner/MessageBanner.js +1 -1
- package/lib/v1/PlusIcon/PlusIcon.js +91 -0
- package/lib/v1/Separator/Separator.js +107 -0
- package/lib/v1/ToastMessage/ToastMessage.js +246 -0
- package/lib/v1/Upload/Upload.js +128 -0
- package/lib/v1/actions/AutoClose.js +75 -0
- package/lib/v1/alert/index.js +23 -0
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +101 -0
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +110 -0
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +106 -0
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +119 -0
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +130 -0
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +167 -0
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +154 -0
- package/lib/v1/avatar/index.js +63 -0
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +932 -0
- package/lib/v1/emptystate/CommonEmptyState/CommonEmptyState.js +1 -0
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +137 -0
- package/lib/v1/errorstate/LinkText/LinkText.js +80 -0
- package/lib/v1/errorstate/NoRequestFound/NoRequestFound.js +135 -0
- package/lib/v1/errorstate/PermissionPlay/PermissionPlay.js +134 -0
- package/lib/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +135 -0
- package/lib/v1/errorstate/UnableToProcess/UnableToProcess.js +137 -0
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +135 -0
- package/lib/v1/errorstate/WillBack/WillBack.js +125 -0
- package/lib/v1/errorstate/index.js +71 -0
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +197 -0
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +234 -0
- package/lib/v1/form/fields/DateField/DateField.js +249 -0
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +118 -0
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +268 -0
- package/lib/v1/form/fields/PhoneField/PhoneField.js +236 -0
- package/lib/v1/form/fields/RadioField/RadioField.js +169 -0
- package/lib/v1/form/fields/SelectField/SelectField.js +236 -0
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +346 -0
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +299 -0
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +219 -0
- package/lib/v1/form/fields/TextEditor/TextEditor.js +463 -0
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +230 -0
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +256 -0
- package/lib/v1/form/fields/TextareaField/TextareaField.js +215 -0
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +110 -0
- package/lib/{docs/formDocs.js → v1/form/fields/index.js} +33 -25
- package/lib/v1/form/layout/Field/Field.js +87 -0
- package/lib/v1/form/layout/Section/Section.js +86 -0
- package/lib/v1/form/layout/index.js +23 -0
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +305 -0
- package/lib/v1/layout/SetupDetailLayout/index.js +37 -0
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +245 -0
- package/lib/v1/layout/SubtabLayout/index.js +37 -0
- package/lib/v1/list/AvatarFlip/AvatarFlip.js +131 -0
- package/lib/v1/list/BluePrintStatus/BluePrintStatus.js +73 -0
- package/lib/v1/list/Comment/Comment.js +98 -0
- package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +157 -0
- package/lib/v1/list/Dot/Dot.js +72 -0
- package/lib/v1/list/DotNew/DotNew.js +79 -0
- package/lib/v1/list/GridStencils/GridStencils.js +83 -0
- package/lib/v1/list/Icons/AddNewIcon.js +79 -0
- package/lib/v1/list/Icons/CompleteIcon.js +81 -0
- package/lib/v1/list/Icons/DeleteIcon.js +82 -0
- package/lib/v1/list/Icons/EditIcon.js +82 -0
- package/lib/v1/list/Icons/FloatingIcons.js +87 -0
- package/lib/v1/list/Icons/ReadUnreadIcon.js +87 -0
- package/lib/v1/list/Icons/SmartIcon.js +83 -0
- package/lib/v1/list/Icons/index.js +63 -0
- package/lib/v1/list/ListLayout/ListLayout.js +145 -0
- package/lib/v1/list/ListStencils/ListStencils.js +96 -0
- package/lib/v1/list/SecondaryText/AccountName.js +136 -0
- package/lib/v1/list/SecondaryText/ContactName.js +144 -0
- package/lib/v1/list/SecondaryText/DepartmentText.js +79 -0
- package/lib/v1/list/SecondaryText/Email.js +103 -0
- package/lib/v1/list/SecondaryText/HappinessRating.js +81 -0
- package/lib/v1/list/SecondaryText/PhoneNumber.js +107 -0
- package/lib/v1/list/SecondaryText/PriorityText.js +83 -0
- package/lib/v1/list/SecondaryText/SecondaryText.js +88 -0
- package/lib/v1/list/SecondaryText/StatusText.js +84 -0
- package/lib/v1/list/SecondaryText/TicketId.js +104 -0
- package/lib/v1/list/SecondaryText/Website.js +91 -0
- package/lib/v1/list/SecondaryText/index.js +95 -0
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +205 -0
- package/lib/v1/list/SentimentStatus/SentimentStatus.js +80 -0
- package/lib/v1/list/Subject/Subject.js +108 -0
- package/lib/v1/list/TagNew/TagNew.js +83 -0
- package/lib/v1/list/Thread/Thread.js +95 -0
- package/lib/v1/list/UserTime/UserTime.js +136 -0
- package/lib/v1/list/index.js +173 -0
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +541 -0
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +168 -0
- package/lib/v1/list/status/index.js +23 -0
- package/lib/v1/lookup/EmptyPage/EmptyPage.js +120 -0
- package/lib/v1/lookup/Lookup/Lookup.js +17 -15
- package/lib/v1/lookup/Section/Section.js +75 -0
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +221 -0
- package/lib/v1/lookup/header/index.js +47 -0
- package/lib/v1/setup/header/Button/Button.js +83 -0
- package/lib/v1/setup/header/Link/Link.js +93 -0
- package/lib/v1/setup/header/Search/Search.js +126 -0
- package/lib/v1/setup/header/Views/Views.js +93 -0
- package/lib/v1/setup/header/index.js +39 -0
- package/lib/v1/setup/helptips/Description/Description.js +68 -0
- package/lib/v1/setup/helptips/Link/Link.js +88 -0
- package/lib/v1/setup/helptips/ListGroup/ListGroup.js +88 -0
- package/lib/v1/setup/helptips/Title/Title.js +68 -0
- package/lib/v1/setup/helptips/index.js +39 -0
- package/lib/v1/setup/index.js +24 -0
- package/lib/v1/setup/table/index.js +47 -0
- package/lib/v1/svg/PlusIcon.js +82 -0
- package/lib/v1/svg/SnippetIcon.js +84 -0
- package/lib/v1/svg/TemplateIcon.js +85 -0
- package/lib/v1/svg/index.js +31 -0
- package/lib/v1/version2/alertIcons/index.js +71 -0
- package/lib/v1/version2/index.js +58 -0
- package/lib/v1/version2/lookup/AlertHeader/AlertHeader.js +104 -0
- package/lib/v1/version2/lookup/AlertLookup/AlertLookup.js +17 -5
- package/lib/v1/version2/notification/DesktopNotification/DesktopNotification.js +193 -0
- package/package.json +9 -9
- package/result.json +1 -1
- package/es/docs/formDocs.js +0 -15
- package/es/docs/generalDocs.js +0 -63
- package/es/docs/lookupDocs.js +0 -17
- package/es/docs/setupDocs.js +0 -11
- package/lib/docs/generalDocs.js +0 -479
- package/lib/docs/lookupDocs.js +0 -135
- package/lib/docs/setupDocs.js +0 -95
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { defaultProps } from '../../../../form/fields/TagsMultiSelect/props/defaultProps';
|
|
3
|
+
import { propTypes } from '../../../../form/fields/TagsMultiSelect/props/propTypes';
|
|
4
|
+
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
5
|
+
import Tag from '@zohodesk/components/lib/Tag/Tag';
|
|
6
|
+
import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
|
|
7
|
+
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
8
|
+
import ListItem from '@zohodesk/components/lib/ListItem/ListItem';
|
|
9
|
+
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
10
|
+
import DropDownSeparator from '@zohodesk/components/lib/DropDown/DropDownSeparator';
|
|
11
|
+
import CommonEmptyState from '../../../emptystate/CommonEmptyState/CommonEmptyState';
|
|
12
|
+
import ResponsiveDropBox from '@zohodesk/components/lib/ResponsiveDropBox/ResponsiveDropBox';
|
|
13
|
+
import { ResponsiveReceiver } from '@zohodesk/components/lib/Responsive/CustomResponsive';
|
|
14
|
+
import { stopBubbling } from '../../../../utils/General';
|
|
15
|
+
import { scrollTo, findScrollEnd } from '@zohodesk/components/lib/utils/Common.js';
|
|
16
|
+
import style from '../../../../form/fields/TagsMultiSelect/TagsMultiSelect.module.css';
|
|
17
|
+
export default class TagsMultiSelect extends React.Component {
|
|
18
|
+
constructor(props) {
|
|
19
|
+
super(props);
|
|
20
|
+
this.state = {
|
|
21
|
+
showAll: false
|
|
22
|
+
};
|
|
23
|
+
this.emptySearchSVG = this.emptySearchSVG.bind(this);
|
|
24
|
+
this.onShowAllClick = this.onShowAllClick.bind(this);
|
|
25
|
+
this.getContainerRef = this.getContainerRef.bind(this);
|
|
26
|
+
this.onScroll = this.onScroll.bind(this);
|
|
27
|
+
this.getSelectedItemRef = this.getSelectedItemRef.bind(this);
|
|
28
|
+
this.textInputRef = this.textInputRef.bind(this);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
textInputRef(el) {
|
|
32
|
+
const {
|
|
33
|
+
getTextInputRef
|
|
34
|
+
} = this.props;
|
|
35
|
+
this.inputEl = el;
|
|
36
|
+
getTextInputRef && getTextInputRef(el);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onScroll() {
|
|
40
|
+
let {
|
|
41
|
+
onScroll,
|
|
42
|
+
name,
|
|
43
|
+
noMoreData,
|
|
44
|
+
searchList
|
|
45
|
+
} = this.props;
|
|
46
|
+
let {
|
|
47
|
+
containerRef
|
|
48
|
+
} = this;
|
|
49
|
+
|
|
50
|
+
if (findScrollEnd(this.containerRef) && !noMoreData) {
|
|
51
|
+
onScroll(name);
|
|
52
|
+
let selectItemRef = this[`selectedList_${searchList.length - 1}`];
|
|
53
|
+
scrollTo(containerRef, selectItemRef);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getSelectedItemRef(el, index) {
|
|
58
|
+
this[`selectedList_${index}`] = el;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
componentDidUpdate(prevProps) {
|
|
62
|
+
let {
|
|
63
|
+
isTagListLoading,
|
|
64
|
+
tagsList,
|
|
65
|
+
isPopupReady,
|
|
66
|
+
selectSearchIndex
|
|
67
|
+
} = this.props;
|
|
68
|
+
|
|
69
|
+
if (prevProps.isTagListLoading !== isTagListLoading && !isTagListLoading || isPopupReady && prevProps.tagsList.length !== tagsList.length) {
|
|
70
|
+
setTimeout(() => {
|
|
71
|
+
if (this.inputEl) {
|
|
72
|
+
this.inputEl.focus();
|
|
73
|
+
}
|
|
74
|
+
}, 300);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (selectSearchIndex != prevProps.selectSearchIndex) {
|
|
78
|
+
let selectItemRef = this[`selectedList_${selectSearchIndex}`];
|
|
79
|
+
let {
|
|
80
|
+
containerRef
|
|
81
|
+
} = this;
|
|
82
|
+
scrollTo(containerRef, selectItemRef);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
emptySearchSVG() {
|
|
87
|
+
return /*#__PURE__*/React.createElement(EmptySearch, {
|
|
88
|
+
size: "small"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
onShowAllClick() {
|
|
93
|
+
this.setState({
|
|
94
|
+
showAll: !this.state.showAll
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
getContainerRef(ele) {
|
|
99
|
+
this.containerRef = ele;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
responsiveFunc(_ref) {
|
|
103
|
+
let {
|
|
104
|
+
mediaQueryOR
|
|
105
|
+
} = _ref;
|
|
106
|
+
return {
|
|
107
|
+
tabletMode: mediaQueryOR([{
|
|
108
|
+
maxWidth: 700
|
|
109
|
+
}])
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
render() {
|
|
114
|
+
let {
|
|
115
|
+
searchList,
|
|
116
|
+
selectSearchIndex,
|
|
117
|
+
tagsList,
|
|
118
|
+
deleteTag,
|
|
119
|
+
name,
|
|
120
|
+
isReadOnly,
|
|
121
|
+
className,
|
|
122
|
+
handleKeyUp,
|
|
123
|
+
handleChange,
|
|
124
|
+
addTag,
|
|
125
|
+
isTagListLoading,
|
|
126
|
+
getContainerRef,
|
|
127
|
+
getTargetRef,
|
|
128
|
+
isPopupReady,
|
|
129
|
+
isPopupOpen,
|
|
130
|
+
boxPosition,
|
|
131
|
+
handleTogglePopup,
|
|
132
|
+
listDisabled,
|
|
133
|
+
chipNeedToShow,
|
|
134
|
+
i18nKeys,
|
|
135
|
+
dataId,
|
|
136
|
+
needBorder,
|
|
137
|
+
borderColor,
|
|
138
|
+
getTextBoxChildren,
|
|
139
|
+
htmlId,
|
|
140
|
+
boxSize,
|
|
141
|
+
onSelectTag,
|
|
142
|
+
clickableTag,
|
|
143
|
+
dataSelectorId
|
|
144
|
+
} = this.props;
|
|
145
|
+
let {
|
|
146
|
+
showAll
|
|
147
|
+
} = this.state;
|
|
148
|
+
let chipLimit = !isPopupReady ? showAll ? tagsList.length : chipNeedToShow : tagsList.length;
|
|
149
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
150
|
+
className: ` ${!isReadOnly ? ` ${needBorder ? style.hasBorder : ''}
|
|
151
|
+
${needBorder ? style[`borderColor_${borderColor}`] : style.borderColor_transparent} ${isPopupReady && needBorder ? style.active : ''}` : ''} ${className}`,
|
|
152
|
+
onClick: stopBubbling,
|
|
153
|
+
"data-id": `${dataId}_tagsContainer`,
|
|
154
|
+
"data-test-id": `${dataId}_tagsContainer`,
|
|
155
|
+
"data-selector-id": dataSelectorId
|
|
156
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
157
|
+
alignBox: "row",
|
|
158
|
+
align: "vertical",
|
|
159
|
+
isCover: false,
|
|
160
|
+
className: style.tagDiv,
|
|
161
|
+
wrap: "wrap",
|
|
162
|
+
eleRef: getTargetRef,
|
|
163
|
+
scroll: "vertical"
|
|
164
|
+
}, tagsList.length ? /*#__PURE__*/React.createElement(React.Fragment, null, tagsList.map((tag, index) => {
|
|
165
|
+
let {
|
|
166
|
+
name,
|
|
167
|
+
tagType,
|
|
168
|
+
id
|
|
169
|
+
} = tag;
|
|
170
|
+
return index < chipLimit ? /*#__PURE__*/React.createElement(Box, {
|
|
171
|
+
className: style.tag,
|
|
172
|
+
key: index
|
|
173
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
|
174
|
+
id: id,
|
|
175
|
+
text: name,
|
|
176
|
+
onRemove: isReadOnly ? null : deleteTag.bind(this, name),
|
|
177
|
+
closeTitle: i18nKeys.deleteText,
|
|
178
|
+
palette: clickableTag ? 'defaultLink' : tagType === 'SYSTEM' ? 'primary' : 'default',
|
|
179
|
+
isReadOnly: isReadOnly,
|
|
180
|
+
onSelectTag: onSelectTag ? onSelectTag : undefined
|
|
181
|
+
})) : null;
|
|
182
|
+
}), tagsList.length > chipNeedToShow && !isPopupReady ? /*#__PURE__*/React.createElement(Box, {
|
|
183
|
+
className: style.moreLess,
|
|
184
|
+
dataId: `${dataId}_tagsMore`,
|
|
185
|
+
onClick: this.onShowAllClick
|
|
186
|
+
}, showAll ? `${i18nKeys.lessText}` : `+${tagsList.length - chipNeedToShow} ${i18nKeys.moreText}`) : null) : null, /*#__PURE__*/React.createElement(Box, {
|
|
187
|
+
flexible: true,
|
|
188
|
+
adjust: true,
|
|
189
|
+
shrink: true,
|
|
190
|
+
className: style.inputWrapper
|
|
191
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
192
|
+
className: style.custmSpan
|
|
193
|
+
}, name), /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
194
|
+
htmlId: htmlId,
|
|
195
|
+
dataId: `${dataId}_tagInp`,
|
|
196
|
+
value: name,
|
|
197
|
+
onKeyUp: handleKeyUp,
|
|
198
|
+
onChange: handleChange,
|
|
199
|
+
maxLength: 50,
|
|
200
|
+
isReadOnly: isReadOnly,
|
|
201
|
+
needBorder: false,
|
|
202
|
+
placeHolder: tagsList.length ? '' : i18nKeys.placeholderText || '-',
|
|
203
|
+
onClick: !isReadOnly ? handleTogglePopup : undefined,
|
|
204
|
+
customClass: {
|
|
205
|
+
customTBoxWrap: style.custmInp,
|
|
206
|
+
customTextBox: style.input
|
|
207
|
+
},
|
|
208
|
+
size: "xsmall",
|
|
209
|
+
inputRef: this.textInputRef
|
|
210
|
+
}, getTextBoxChildren ? getTextBoxChildren() : null))), isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
211
|
+
query: this.responsiveFunc,
|
|
212
|
+
responsiveId: "Helmet"
|
|
213
|
+
}, _ref2 => {
|
|
214
|
+
let {
|
|
215
|
+
tabletMode
|
|
216
|
+
} = _ref2;
|
|
217
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
218
|
+
isAnimate: false,
|
|
219
|
+
isActive: isPopupReady,
|
|
220
|
+
isArrow: false,
|
|
221
|
+
getRef: getContainerRef,
|
|
222
|
+
isBoxPaddingNeed: true,
|
|
223
|
+
size: boxSize,
|
|
224
|
+
boxPosition: boxPosition,
|
|
225
|
+
isPadding: false,
|
|
226
|
+
customClass: {
|
|
227
|
+
customDropBoxWrap: style.dropdown
|
|
228
|
+
},
|
|
229
|
+
dataId: `${dataId}_dropbox`,
|
|
230
|
+
isResponsivePadding: true,
|
|
231
|
+
alignBox: "row"
|
|
232
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
233
|
+
flexible: true
|
|
234
|
+
}, isTagListLoading ? /*#__PURE__*/React.createElement(Container, {
|
|
235
|
+
align: "both",
|
|
236
|
+
className: `${tabletMode ? '' : style.viewpopNew}`
|
|
237
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Container, {
|
|
238
|
+
scroll: "vertical",
|
|
239
|
+
className: `${tabletMode ? '' : style.viewpopNew}`,
|
|
240
|
+
onScroll: this.onScroll,
|
|
241
|
+
eleRef: this.getContainerRef
|
|
242
|
+
}, searchList.length ? /*#__PURE__*/React.createElement(Box, {
|
|
243
|
+
flexible: true,
|
|
244
|
+
shrink: true
|
|
245
|
+
}, searchList.map((item, index) => {
|
|
246
|
+
let {
|
|
247
|
+
name,
|
|
248
|
+
isNew
|
|
249
|
+
} = item;
|
|
250
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, searchList.length > 1 && isNew ? /*#__PURE__*/React.createElement(DropDownSeparator, null) : null, /*#__PURE__*/React.createElement(ListItem, {
|
|
251
|
+
key: index,
|
|
252
|
+
index: index,
|
|
253
|
+
autoHover: true,
|
|
254
|
+
value: isNew ? '' : name,
|
|
255
|
+
title: isNew ? '' : name,
|
|
256
|
+
onClick: addTag.bind(this, item),
|
|
257
|
+
needTick: true,
|
|
258
|
+
highlight: selectSearchIndex === index,
|
|
259
|
+
getRef: this.getSelectedItemRef,
|
|
260
|
+
isDisabled: listDisabled
|
|
261
|
+
}, isNew ? /*#__PURE__*/React.createElement(Container, {
|
|
262
|
+
alignBox: "row",
|
|
263
|
+
align: "vertical"
|
|
264
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
265
|
+
className: style.newTagLabel
|
|
266
|
+
}, i18nKeys.newTagText, ":"), /*#__PURE__*/React.createElement(Box, {
|
|
267
|
+
shrink: true,
|
|
268
|
+
"data-title": name,
|
|
269
|
+
className: `${style.dotted} ${style.newTagText} `,
|
|
270
|
+
dataId: `${dataId}_new_tag_text`
|
|
271
|
+
}, name)) : null));
|
|
272
|
+
})) : /*#__PURE__*/React.createElement(Box, {
|
|
273
|
+
flexible: true,
|
|
274
|
+
dataId: `${dataId}_empty`
|
|
275
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
276
|
+
className: style.searchEmpty
|
|
277
|
+
}, /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
278
|
+
title: i18nKeys.emptyTitleText,
|
|
279
|
+
description: i18nKeys.emptyDescription,
|
|
280
|
+
size: "small",
|
|
281
|
+
getEmptyState: this.emptySearchSVG
|
|
282
|
+
})))))));
|
|
283
|
+
}) : null);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
TagsMultiSelect.propTypes = propTypes;
|
|
288
|
+
TagsMultiSelect.defaultProps = defaultProps; // if (__DOCS__) {
|
|
289
|
+
// TagsMultiSelect.docs = {
|
|
290
|
+
// componentGroup: 'TagsMultiSelect'
|
|
291
|
+
// };
|
|
292
|
+
// }
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React, { useState, useEffect } from 'react';
|
|
4
|
+
import { defaultProps } from '../../../../form/fields/TagsMultiSelectField/props/defaultProps';
|
|
5
|
+
import { propTypes } from '../../../../form/fields/TagsMultiSelectField/props/propTypes';
|
|
6
|
+
import { Box } from '@zohodesk/components/lib/Layout';
|
|
7
|
+
import Label from '@zohodesk/components/lib/Label/Label';
|
|
8
|
+
import Popup from '@zohodesk/components/lib/Popup/Popup';
|
|
9
|
+
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
10
|
+
import TagsMultiSelect from '../TagsMultiSelect/TagsMultiSelect';
|
|
11
|
+
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
12
|
+
/**** css ****/
|
|
13
|
+
|
|
14
|
+
import fieldStyle from '../../../../form/fields/Fields.module.css';
|
|
15
|
+
import style from '../../../../form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css';
|
|
16
|
+
|
|
17
|
+
const TagsMultiSelectField = props => {
|
|
18
|
+
const [selectedSuggestionIndex, updateSelectedSuggestionIndex] = useState(0);
|
|
19
|
+
const [isValueChanged, updateValueChangedState] = useState(false);
|
|
20
|
+
let [searchValue, changeSearchValue] = useState(props.searchValue || '');
|
|
21
|
+
const {
|
|
22
|
+
fieldProperties,
|
|
23
|
+
styleProperties,
|
|
24
|
+
actions,
|
|
25
|
+
dataId,
|
|
26
|
+
htmlId,
|
|
27
|
+
isLoading,
|
|
28
|
+
isListDisabled,
|
|
29
|
+
isNewNeeded,
|
|
30
|
+
isPopupOpen,
|
|
31
|
+
isPopupReady,
|
|
32
|
+
removeClose,
|
|
33
|
+
position,
|
|
34
|
+
togglePopup,
|
|
35
|
+
noMoreData,
|
|
36
|
+
numberOfDisplayedValues,
|
|
37
|
+
getTargetRef,
|
|
38
|
+
getContainerRef,
|
|
39
|
+
i18nKeys = {},
|
|
40
|
+
getTextBoxChildren,
|
|
41
|
+
children,
|
|
42
|
+
ePhiData,
|
|
43
|
+
customProps,
|
|
44
|
+
clickableTag,
|
|
45
|
+
dataSelectorId
|
|
46
|
+
} = props;
|
|
47
|
+
const {
|
|
48
|
+
LabelProps = {},
|
|
49
|
+
TagsMultiSelectProps = {},
|
|
50
|
+
ValidationMessageProps = {}
|
|
51
|
+
} = customProps;
|
|
52
|
+
const {
|
|
53
|
+
labelSize,
|
|
54
|
+
labelPalette,
|
|
55
|
+
labelClass,
|
|
56
|
+
containerClass,
|
|
57
|
+
needBorder,
|
|
58
|
+
borderColor,
|
|
59
|
+
validationPalette,
|
|
60
|
+
errorType
|
|
61
|
+
} = styleProperties;
|
|
62
|
+
let {
|
|
63
|
+
onChange,
|
|
64
|
+
onAdd,
|
|
65
|
+
onDelete,
|
|
66
|
+
onScroll,
|
|
67
|
+
onFocus
|
|
68
|
+
} = actions;
|
|
69
|
+
let {
|
|
70
|
+
id,
|
|
71
|
+
labelName,
|
|
72
|
+
isMandatory,
|
|
73
|
+
isDisabled,
|
|
74
|
+
isReadOnly,
|
|
75
|
+
value,
|
|
76
|
+
selectedValueCount,
|
|
77
|
+
validationMessage,
|
|
78
|
+
options
|
|
79
|
+
} = fieldProperties;
|
|
80
|
+
options = options || [];
|
|
81
|
+
|
|
82
|
+
const handleKeyUp = event => {
|
|
83
|
+
let {
|
|
84
|
+
keyCode
|
|
85
|
+
} = event;
|
|
86
|
+
onAdd = typeof onAdd !== 'function' ? () => {} : onAdd;
|
|
87
|
+
onDelete = typeof onDelete !== 'function' ? () => {} : onDelete;
|
|
88
|
+
|
|
89
|
+
if (keyCode === 13) {
|
|
90
|
+
if (selectedSuggestionIndex > -1 && options.length) {
|
|
91
|
+
if (options.length === 1 && options[0].isNew) {
|
|
92
|
+
searchValue = searchValue.replace(',', '');
|
|
93
|
+
onAdd({
|
|
94
|
+
name: searchValue
|
|
95
|
+
}, event);
|
|
96
|
+
} else {
|
|
97
|
+
onAdd(options[selectedSuggestionIndex], event);
|
|
98
|
+
}
|
|
99
|
+
} else {
|
|
100
|
+
searchValue = searchValue.replace(',', '');
|
|
101
|
+
onAdd({
|
|
102
|
+
name: searchValue
|
|
103
|
+
}, event);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
changeSearchValue('');
|
|
107
|
+
updateSelectedSuggestionIndex(prevSelectedSuggestionIndex => {
|
|
108
|
+
let newIndex = 0;
|
|
109
|
+
|
|
110
|
+
if (options.length) {
|
|
111
|
+
if (options.length === 1 && options[0].isNew) {
|
|
112
|
+
return newIndex;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
newIndex = prevSelectedSuggestionIndex === options.length - 1 ? options.length - 2 : prevSelectedSuggestionIndex;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return newIndex;
|
|
119
|
+
});
|
|
120
|
+
} else if (keyCode === 188 && !event.shiftKey) {
|
|
121
|
+
searchValue = searchValue.replace(',', '');
|
|
122
|
+
|
|
123
|
+
if (options.length === 1 && options[0].isNew) {
|
|
124
|
+
onAdd({
|
|
125
|
+
name: searchValue
|
|
126
|
+
}, event);
|
|
127
|
+
changeSearchValue('');
|
|
128
|
+
}
|
|
129
|
+
} else if (keyCode === 40) {
|
|
130
|
+
updateSelectedSuggestionIndex(prevSelectedSuggestionIndex => {
|
|
131
|
+
let newIndex = prevSelectedSuggestionIndex >= options.length - 1 ? 0 : prevSelectedSuggestionIndex + 1;
|
|
132
|
+
return newIndex;
|
|
133
|
+
});
|
|
134
|
+
} else if (keyCode === 38) {
|
|
135
|
+
updateSelectedSuggestionIndex(prevSelectedSuggestionIndex => {
|
|
136
|
+
let newIndex = prevSelectedSuggestionIndex <= 0 || prevSelectedSuggestionIndex >= options.length - 1 ? options.length - 1 : prevSelectedSuggestionIndex - 1;
|
|
137
|
+
return newIndex;
|
|
138
|
+
});
|
|
139
|
+
} else if (keyCode === 8 && searchValue === '' & !isValueChanged) {
|
|
140
|
+
let valueLength = value.length;
|
|
141
|
+
value.length ? onDelete(value[valueLength - 1].name, event) : undefined;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
updateValueChangedState(false);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const handleChange = (searchValue, event) => {
|
|
148
|
+
updateValueChangedState(true);
|
|
149
|
+
updateSelectedSuggestionIndex(0);
|
|
150
|
+
changeSearchValue(searchValue);
|
|
151
|
+
typeof onChange === 'function' && onChange(searchValue, event);
|
|
152
|
+
|
|
153
|
+
if (!isPopupOpen) {
|
|
154
|
+
togglePopup(event);
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const handleTogglePopup = event => {
|
|
159
|
+
if (isPopupReady) {
|
|
160
|
+
removeClose(event);
|
|
161
|
+
} else {
|
|
162
|
+
togglePopup(event, position);
|
|
163
|
+
!isPopupOpen && typeof onFocus === 'function' ? onFocus(event) : null;
|
|
164
|
+
updateSelectedSuggestionIndex(0);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const handleAdd = value => {
|
|
169
|
+
changeSearchValue('');
|
|
170
|
+
typeof onAdd === 'function' && onAdd(value);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const documentClick = () => {
|
|
174
|
+
changeSearchValue('');
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const renderEnd = () => {
|
|
178
|
+
return children ? children : null;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
window.addEventListener('click', documentClick);
|
|
183
|
+
return () => {
|
|
184
|
+
window.removeEventListener('click', documentClick);
|
|
185
|
+
};
|
|
186
|
+
}, []);
|
|
187
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
className: `${isDisabled ? fieldStyle.disabled : isReadOnly ? fieldStyle.readonly : ''}`,
|
|
189
|
+
tabIndex: "0",
|
|
190
|
+
"aria-label": `${labelName}`,
|
|
191
|
+
"data-selector-id": dataSelectorId
|
|
192
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
193
|
+
ePhiData: ePhiData,
|
|
194
|
+
alignContainer: "baseline",
|
|
195
|
+
renderProps: {
|
|
196
|
+
end: renderEnd
|
|
197
|
+
}
|
|
198
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
199
|
+
text: labelName,
|
|
200
|
+
title: labelName,
|
|
201
|
+
id: id,
|
|
202
|
+
size: labelSize,
|
|
203
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
204
|
+
customClass: `${fieldStyle.fieldLabel} ${isMandatory ? fieldStyle.labelMandatory : ''} ${labelClass ? labelClass : ''}`,
|
|
205
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
|
|
206
|
+
htmlFor: htmlId
|
|
207
|
+
}, LabelProps)), selectedValueCount ? /*#__PURE__*/React.createElement(Box, {
|
|
208
|
+
dataId: `${dataId}_tagCount`,
|
|
209
|
+
className: style.count
|
|
210
|
+
}, `(${selectedValueCount})`) : null), /*#__PURE__*/React.createElement(TagsMultiSelect, _extends({
|
|
211
|
+
addTag: handleAdd,
|
|
212
|
+
deleteTag: onDelete,
|
|
213
|
+
handleChange: handleChange,
|
|
214
|
+
handleKeyUp: handleKeyUp,
|
|
215
|
+
isReadOnly: isReadOnly,
|
|
216
|
+
name: searchValue,
|
|
217
|
+
noMoreData: noMoreData,
|
|
218
|
+
searchList: isNewNeeded && searchValue.length && !options.length ? [{
|
|
219
|
+
isNew: true,
|
|
220
|
+
name: searchValue
|
|
221
|
+
}] : options,
|
|
222
|
+
selectSearchIndex: selectedSuggestionIndex,
|
|
223
|
+
tagsList: value,
|
|
224
|
+
i18nKeys: i18nKeys,
|
|
225
|
+
boxPosition: position,
|
|
226
|
+
getTargetRef: getTargetRef,
|
|
227
|
+
getContainerRef: getContainerRef,
|
|
228
|
+
handleTogglePopup: handleTogglePopup,
|
|
229
|
+
isPopupReady: isPopupReady,
|
|
230
|
+
isPopupOpen: isPopupOpen,
|
|
231
|
+
onScroll: onScroll,
|
|
232
|
+
isTagListLoading: isLoading,
|
|
233
|
+
listDisabled: isListDisabled,
|
|
234
|
+
chipNeedToShow: numberOfDisplayedValues,
|
|
235
|
+
dataId: dataId,
|
|
236
|
+
needBorder: needBorder,
|
|
237
|
+
borderColor: borderColor,
|
|
238
|
+
htmlId: htmlId,
|
|
239
|
+
getTextBoxChildren: getTextBoxChildren,
|
|
240
|
+
className: containerClass
|
|
241
|
+
}, TagsMultiSelectProps, {
|
|
242
|
+
clickableTag: clickableTag
|
|
243
|
+
})), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
244
|
+
text: validationMessage,
|
|
245
|
+
palette: validationPalette,
|
|
246
|
+
type: errorType,
|
|
247
|
+
dataId: `${dataId}_ValidationMessage`,
|
|
248
|
+
htmlFor: htmlId
|
|
249
|
+
}, ValidationMessageProps)));
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export default Popup(TagsMultiSelectField);
|
|
253
|
+
TagsMultiSelectField.propTypes = propTypes;
|
|
254
|
+
TagsMultiSelectField.defaultProps = defaultProps; // if (__DOCS__) {
|
|
255
|
+
// TagsMultiSelectField.docs = {
|
|
256
|
+
// componentGroup: 'TagsMultiSelectField'
|
|
257
|
+
// };
|
|
258
|
+
// }
|