@zohodesk/dot 1.2.2 → 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 +5 -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/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/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/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/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/package.json +10 -10
- 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,236 @@
|
|
|
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/PhoneField/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _propTypes = require("../../../../form/fields/PhoneField/props/propTypes");
|
|
15
|
+
|
|
16
|
+
var _icons = require("@zohodesk/icons");
|
|
17
|
+
|
|
18
|
+
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
19
|
+
|
|
20
|
+
var _TextBoxField = _interopRequireDefault(require("../TextBoxField/TextBoxField"));
|
|
21
|
+
|
|
22
|
+
var _Link = _interopRequireDefault(require("../../../Link/Link"));
|
|
23
|
+
|
|
24
|
+
var _FieldsModule = _interopRequireDefault(require("../../../../form/fields/Fields.module.css"));
|
|
25
|
+
|
|
26
|
+
var _General = require("../../../../utils/General");
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
+
|
|
38
|
+
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); } }
|
|
39
|
+
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
+
|
|
42
|
+
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); }
|
|
43
|
+
|
|
44
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
+
|
|
46
|
+
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); }; }
|
|
47
|
+
|
|
48
|
+
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); }
|
|
49
|
+
|
|
50
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
+
|
|
52
|
+
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; } }
|
|
53
|
+
|
|
54
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
+
|
|
56
|
+
var PhoneField = /*#__PURE__*/function (_PureComponent) {
|
|
57
|
+
_inherits(PhoneField, _PureComponent);
|
|
58
|
+
|
|
59
|
+
var _super = _createSuper(PhoneField);
|
|
60
|
+
|
|
61
|
+
function PhoneField(props) {
|
|
62
|
+
var _this;
|
|
63
|
+
|
|
64
|
+
_classCallCheck(this, PhoneField);
|
|
65
|
+
|
|
66
|
+
_this = _super.call(this, props);
|
|
67
|
+
_this.state = {
|
|
68
|
+
isActive: false
|
|
69
|
+
};
|
|
70
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
71
|
+
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this));
|
|
72
|
+
_this.focusInput = _this.focusInput.bind(_assertThisInitialized(_this));
|
|
73
|
+
_this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));
|
|
74
|
+
_this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));
|
|
75
|
+
return _this;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_createClass(PhoneField, [{
|
|
79
|
+
key: "handleChange",
|
|
80
|
+
value: function handleChange(id, value) {
|
|
81
|
+
var onChange = this.props.onChange;
|
|
82
|
+
onChange && onChange(id, value);
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "handleGetRef",
|
|
86
|
+
value: function handleGetRef(el) {
|
|
87
|
+
var _this$props = this.props,
|
|
88
|
+
getRef = _this$props.getRef,
|
|
89
|
+
id = _this$props.id;
|
|
90
|
+
this.textBoxElem = el;
|
|
91
|
+
getRef && getRef(el, id);
|
|
92
|
+
}
|
|
93
|
+
}, {
|
|
94
|
+
key: "focusInput",
|
|
95
|
+
value: function focusInput(e) {
|
|
96
|
+
this.textBoxElem.focus();
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
key: "onFocus",
|
|
100
|
+
value: function onFocus() {
|
|
101
|
+
var onFocus = this.props.onFocus;
|
|
102
|
+
this.setState({
|
|
103
|
+
isActive: true
|
|
104
|
+
});
|
|
105
|
+
onFocus && onFocus();
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
key: "onBlur",
|
|
109
|
+
value: function onBlur() {
|
|
110
|
+
var onBlur = this.props.onBlur;
|
|
111
|
+
this.setState({
|
|
112
|
+
isActive: false
|
|
113
|
+
});
|
|
114
|
+
onBlur && onBlur();
|
|
115
|
+
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "render",
|
|
118
|
+
value: function render() {
|
|
119
|
+
var _this$props2 = this.props,
|
|
120
|
+
labelName = _this$props2.labelName,
|
|
121
|
+
id = _this$props2.id,
|
|
122
|
+
textBoxSize = _this$props2.textBoxSize,
|
|
123
|
+
textBoxVariant = _this$props2.textBoxVariant,
|
|
124
|
+
textBoxType = _this$props2.textBoxType,
|
|
125
|
+
isMandatory = _this$props2.isMandatory,
|
|
126
|
+
validationMessage = _this$props2.validationMessage,
|
|
127
|
+
maxLength = _this$props2.maxLength,
|
|
128
|
+
isReadOnly = _this$props2.isReadOnly,
|
|
129
|
+
value = _this$props2.value,
|
|
130
|
+
errorType = _this$props2.errorType,
|
|
131
|
+
isDisabled = _this$props2.isDisabled,
|
|
132
|
+
title = _this$props2.title,
|
|
133
|
+
onBlur = _this$props2.onBlur,
|
|
134
|
+
dataId = _this$props2.dataId,
|
|
135
|
+
dataSelectorId = _this$props2.dataSelectorId,
|
|
136
|
+
onKeyDown = _this$props2.onKeyDown,
|
|
137
|
+
placeHolder = _this$props2.placeHolder,
|
|
138
|
+
infoText = _this$props2.infoText,
|
|
139
|
+
isTelephony = _this$props2.isTelephony,
|
|
140
|
+
providerName = _this$props2.providerName,
|
|
141
|
+
ticketId = _this$props2.ticketId,
|
|
142
|
+
contactId = _this$props2.contactId,
|
|
143
|
+
borderColor = _this$props2.borderColor,
|
|
144
|
+
fieldSize = _this$props2.fieldSize,
|
|
145
|
+
labelPalette = _this$props2.labelPalette,
|
|
146
|
+
labelCustomClass = _this$props2.labelCustomClass,
|
|
147
|
+
i18nKeys = _this$props2.i18nKeys,
|
|
148
|
+
onCall = _this$props2.onCall,
|
|
149
|
+
ePhiData = _this$props2.ePhiData,
|
|
150
|
+
type = _this$props2.type,
|
|
151
|
+
customProps = _this$props2.customProps;
|
|
152
|
+
var _customProps$TextBoxF = customProps.TextBoxFieldProps,
|
|
153
|
+
TextBoxFieldProps = _customProps$TextBoxF === void 0 ? {} : _customProps$TextBoxF,
|
|
154
|
+
_customProps$LinkProp = customProps.LinkProps,
|
|
155
|
+
LinkProps = _customProps$LinkProp === void 0 ? {} : _customProps$LinkProp;
|
|
156
|
+
var isActive = this.state.isActive;
|
|
157
|
+
var callTitle = i18nKeys.callTitle;
|
|
158
|
+
var callBackparam = {
|
|
159
|
+
contact_id: contactId ? contactId : '',
|
|
160
|
+
request_id: ticketId,
|
|
161
|
+
activity_id: '',
|
|
162
|
+
entity_module: 'Requests'
|
|
163
|
+
};
|
|
164
|
+
var phoneValue = value;
|
|
165
|
+
|
|
166
|
+
if (isActive) {
|
|
167
|
+
phoneValue = value;
|
|
168
|
+
} else {
|
|
169
|
+
phoneValue = (0, _General.formatPhoneUrl)(value);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
173
|
+
alignBox: "row",
|
|
174
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : ''),
|
|
175
|
+
"data-title": isDisabled ? title : null,
|
|
176
|
+
dataSelectorId: dataSelectorId
|
|
177
|
+
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
178
|
+
flexible: true
|
|
179
|
+
}, /*#__PURE__*/_react["default"].createElement(_TextBoxField["default"], _extends({
|
|
180
|
+
labelName: labelName,
|
|
181
|
+
id: id,
|
|
182
|
+
palette: isMandatory ? 'mandatory' : 'default',
|
|
183
|
+
onClick: this.focusInput,
|
|
184
|
+
infoText: infoText,
|
|
185
|
+
type: textBoxType,
|
|
186
|
+
textBoxVariant: textBoxVariant,
|
|
187
|
+
size: textBoxSize,
|
|
188
|
+
maxLength: maxLength,
|
|
189
|
+
isReadOnly: isReadOnly,
|
|
190
|
+
getRef: this.handleGetRef,
|
|
191
|
+
value: phoneValue,
|
|
192
|
+
onChange: this.handleChange,
|
|
193
|
+
dataId: dataId,
|
|
194
|
+
onBlur: this.onBlur,
|
|
195
|
+
onFocus: this.onFocus,
|
|
196
|
+
onKeyDown: onKeyDown,
|
|
197
|
+
placeHolder: placeHolder,
|
|
198
|
+
validationMessage: validationMessage,
|
|
199
|
+
borderColor: borderColor,
|
|
200
|
+
isDisabled: isDisabled,
|
|
201
|
+
fieldSize: fieldSize,
|
|
202
|
+
isMandatory: isMandatory,
|
|
203
|
+
labelPalette: labelPalette,
|
|
204
|
+
labelCustomClass: labelCustomClass,
|
|
205
|
+
errorType: errorType,
|
|
206
|
+
ePhiData: ePhiData
|
|
207
|
+
}, TextBoxFieldProps))), /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, isTelephony && value ? /*#__PURE__*/_react["default"].createElement(_Link["default"], _extends({
|
|
208
|
+
className: _FieldsModule["default"].phoneIcon,
|
|
209
|
+
callfrom: "phone",
|
|
210
|
+
pbxname: providerName,
|
|
211
|
+
phonenum: value,
|
|
212
|
+
module: "RequestDetailsView",
|
|
213
|
+
title: callTitle,
|
|
214
|
+
callBackParam: JSON.stringify(callBackparam),
|
|
215
|
+
callto: 'RequestPhoneNumber',
|
|
216
|
+
href: true,
|
|
217
|
+
onClick: onCall,
|
|
218
|
+
type: type
|
|
219
|
+
}, LinkProps), /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
220
|
+
name: "ZD-GN-phone",
|
|
221
|
+
size: "14"
|
|
222
|
+
})) : null));
|
|
223
|
+
}
|
|
224
|
+
}]);
|
|
225
|
+
|
|
226
|
+
return PhoneField;
|
|
227
|
+
}(_react.PureComponent);
|
|
228
|
+
|
|
229
|
+
exports["default"] = PhoneField;
|
|
230
|
+
PhoneField.propTypes = _propTypes.propTypes;
|
|
231
|
+
PhoneField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
232
|
+
// PhoneField.docs = {
|
|
233
|
+
// componentGroup: 'Form Fields',
|
|
234
|
+
// folderName: 'General'
|
|
235
|
+
// };
|
|
236
|
+
// }
|
|
@@ -0,0 +1,169 @@
|
|
|
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/RadioField/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _propTypes = require("../../../../form/fields/RadioField/props/propTypes");
|
|
15
|
+
|
|
16
|
+
var _Label = _interopRequireDefault(require("@zohodesk/components/lib/Label/Label"));
|
|
17
|
+
|
|
18
|
+
var _Radio = _interopRequireDefault(require("@zohodesk/components/lib/Radio/Radio"));
|
|
19
|
+
|
|
20
|
+
var _ValidationMessage = _interopRequireDefault(require("../ValidationMessage/ValidationMessage"));
|
|
21
|
+
|
|
22
|
+
var _FieldsModule = _interopRequireDefault(require("../../../../form/fields/Fields.module.css"));
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
|
+
|
|
34
|
+
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); } }
|
|
35
|
+
|
|
36
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
|
+
|
|
38
|
+
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); }
|
|
39
|
+
|
|
40
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
|
+
|
|
42
|
+
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); }; }
|
|
43
|
+
|
|
44
|
+
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); }
|
|
45
|
+
|
|
46
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
47
|
+
|
|
48
|
+
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; } }
|
|
49
|
+
|
|
50
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
51
|
+
|
|
52
|
+
var RadioField = /*#__PURE__*/function (_PureComponent) {
|
|
53
|
+
_inherits(RadioField, _PureComponent);
|
|
54
|
+
|
|
55
|
+
var _super = _createSuper(RadioField);
|
|
56
|
+
|
|
57
|
+
function RadioField(props) {
|
|
58
|
+
var _this;
|
|
59
|
+
|
|
60
|
+
_classCallCheck(this, RadioField);
|
|
61
|
+
|
|
62
|
+
_this = _super.call(this, props);
|
|
63
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
64
|
+
return _this;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
_createClass(RadioField, [{
|
|
68
|
+
key: "handleChange",
|
|
69
|
+
value: function handleChange(value) {
|
|
70
|
+
var _this$props = this.props,
|
|
71
|
+
id = _this$props.id,
|
|
72
|
+
onChange = _this$props.onChange;
|
|
73
|
+
onChange && onChange(id, value);
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
key: "render",
|
|
77
|
+
value: function render() {
|
|
78
|
+
var _this2 = this;
|
|
79
|
+
|
|
80
|
+
var _this$props2 = this.props,
|
|
81
|
+
labelName = _this$props2.labelName,
|
|
82
|
+
id = _this$props2.id,
|
|
83
|
+
isMandatory = _this$props2.isMandatory,
|
|
84
|
+
options = _this$props2.options,
|
|
85
|
+
validationMessage = _this$props2.validationMessage,
|
|
86
|
+
validationPalette = _this$props2.validationPalette,
|
|
87
|
+
errorType = _this$props2.errorType,
|
|
88
|
+
isDisabled = _this$props2.isDisabled,
|
|
89
|
+
title = _this$props2.title,
|
|
90
|
+
labelPalette = _this$props2.labelPalette,
|
|
91
|
+
labelSize = _this$props2.labelSize,
|
|
92
|
+
size = _this$props2.size,
|
|
93
|
+
selectedValue = _this$props2.selectedValue,
|
|
94
|
+
isActive = _this$props2.isActive,
|
|
95
|
+
dataId = _this$props2.dataId,
|
|
96
|
+
dataSelectorId = _this$props2.dataSelectorId,
|
|
97
|
+
validationRuleMessage = _this$props2.validationRuleMessage,
|
|
98
|
+
validationRulePalette = _this$props2.validationRulePalette,
|
|
99
|
+
isReadOnly = _this$props2.isReadOnly,
|
|
100
|
+
variant = _this$props2.variant,
|
|
101
|
+
customProps = _this$props2.customProps;
|
|
102
|
+
var _customProps$LabelPro = customProps.LabelProps,
|
|
103
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
104
|
+
_customProps$RadioPro = customProps.RadioProps,
|
|
105
|
+
RadioProps = _customProps$RadioPro === void 0 ? {} : _customProps$RadioPro,
|
|
106
|
+
_customProps$Validati = customProps.ValidationMessageProps1,
|
|
107
|
+
ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
|
|
108
|
+
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
109
|
+
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
110
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
111
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
112
|
+
"data-title": isDisabled ? title : null,
|
|
113
|
+
"data-selector-id": dataSelectorId
|
|
114
|
+
}, labelName && /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
115
|
+
text: labelName,
|
|
116
|
+
size: "medium",
|
|
117
|
+
id: id,
|
|
118
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : 'default',
|
|
119
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
|
|
120
|
+
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
121
|
+
}, LabelProps)), /*#__PURE__*/_react["default"].createElement("div", {
|
|
122
|
+
className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"].fieldMargin_medium : '', " ").concat(_FieldsModule["default"].radioContainer)
|
|
123
|
+
}, options.map(function (option, index) {
|
|
124
|
+
var text = option.text,
|
|
125
|
+
value = option.value;
|
|
126
|
+
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
127
|
+
key: index,
|
|
128
|
+
className: "".concat(_FieldsModule["default"].radio)
|
|
129
|
+
}, /*#__PURE__*/_react["default"].createElement(_Radio["default"], _extends({
|
|
130
|
+
id: index,
|
|
131
|
+
value: value,
|
|
132
|
+
name: id,
|
|
133
|
+
text: text,
|
|
134
|
+
labelPalette: labelPalette,
|
|
135
|
+
labelSize: labelSize,
|
|
136
|
+
active: isActive,
|
|
137
|
+
disabled: isDisabled,
|
|
138
|
+
onChange: _this2.handleChange,
|
|
139
|
+
size: size,
|
|
140
|
+
checked: selectedValue == value,
|
|
141
|
+
dataId: dataId,
|
|
142
|
+
isReadOnly: isReadOnly,
|
|
143
|
+
variant: variant
|
|
144
|
+
}, RadioProps)));
|
|
145
|
+
})), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
146
|
+
text: validationMessage,
|
|
147
|
+
palette: validationPalette,
|
|
148
|
+
type: errorType,
|
|
149
|
+
dataId: "".concat(dataId, "_ValidationMessage")
|
|
150
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
151
|
+
text: validationRuleMessage,
|
|
152
|
+
palette: validationRulePalette,
|
|
153
|
+
type: errorType,
|
|
154
|
+
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
155
|
+
}, ValidationMessageProps2)));
|
|
156
|
+
}
|
|
157
|
+
}]);
|
|
158
|
+
|
|
159
|
+
return RadioField;
|
|
160
|
+
}(_react.PureComponent);
|
|
161
|
+
|
|
162
|
+
exports["default"] = RadioField;
|
|
163
|
+
RadioField.propTypes = _propTypes.propTypes;
|
|
164
|
+
RadioField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
165
|
+
// RadioField.docs = {
|
|
166
|
+
// componentGroup: 'Form Fields',
|
|
167
|
+
// folderName: 'General'
|
|
168
|
+
// };
|
|
169
|
+
// }
|
|
@@ -0,0 +1,236 @@
|
|
|
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/SelectField/props/defaultProps");
|
|
13
|
+
|
|
14
|
+
var _propTypes = require("../../../../form/fields/SelectField/props/propTypes");
|
|
15
|
+
|
|
16
|
+
var _Label = _interopRequireDefault(require("@zohodesk/components/lib/Label/Label"));
|
|
17
|
+
|
|
18
|
+
var _Select = _interopRequireDefault(require("@zohodesk/components/lib/Select/Select"));
|
|
19
|
+
|
|
20
|
+
var _ValidationMessage = _interopRequireDefault(require("../ValidationMessage/ValidationMessage"));
|
|
21
|
+
|
|
22
|
+
var _IdProvider = require("@zohodesk/components/lib/Provider/IdProvider");
|
|
23
|
+
|
|
24
|
+
var _FieldContainer = _interopRequireDefault(require("../FieldContainer/FieldContainer"));
|
|
25
|
+
|
|
26
|
+
var _FieldsModule = _interopRequireDefault(require("../../../../form/fields/Fields.module.css"));
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
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; }
|
|
33
|
+
|
|
34
|
+
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); }
|
|
35
|
+
|
|
36
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
37
|
+
|
|
38
|
+
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); } }
|
|
39
|
+
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
41
|
+
|
|
42
|
+
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); }
|
|
43
|
+
|
|
44
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
45
|
+
|
|
46
|
+
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); }; }
|
|
47
|
+
|
|
48
|
+
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); }
|
|
49
|
+
|
|
50
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
+
|
|
52
|
+
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; } }
|
|
53
|
+
|
|
54
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
55
|
+
|
|
56
|
+
var SelectField = /*#__PURE__*/function (_PureComponent) {
|
|
57
|
+
_inherits(SelectField, _PureComponent);
|
|
58
|
+
|
|
59
|
+
var _super = _createSuper(SelectField);
|
|
60
|
+
|
|
61
|
+
function SelectField(props) {
|
|
62
|
+
var _this;
|
|
63
|
+
|
|
64
|
+
_classCallCheck(this, SelectField);
|
|
65
|
+
|
|
66
|
+
_this = _super.call(this, props);
|
|
67
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
68
|
+
_this.handleGetRef = _this.handleGetRef.bind(_assertThisInitialized(_this)); // this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
69
|
+
|
|
70
|
+
_this.getNextId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
71
|
+
return _this;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_createClass(SelectField, [{
|
|
75
|
+
key: "handleChange",
|
|
76
|
+
value: function handleChange(selctedId, selectedValue) {
|
|
77
|
+
var _this$props = this.props,
|
|
78
|
+
fieldId = _this$props.id,
|
|
79
|
+
onChange = _this$props.onChange,
|
|
80
|
+
propValue = _this$props.selectedValue;
|
|
81
|
+
onChange && propValue !== selctedId && onChange(fieldId, selctedId, selectedValue);
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "handleGetRef",
|
|
85
|
+
value: function handleGetRef(el) {
|
|
86
|
+
var _this$props2 = this.props,
|
|
87
|
+
getRef = _this$props2.getRef,
|
|
88
|
+
id = _this$props2.id;
|
|
89
|
+
this.selectBox = el;
|
|
90
|
+
getRef && getRef(el, id);
|
|
91
|
+
} // handleLabelClick() {
|
|
92
|
+
// let { isFocusOnLabelClick } = this.props;
|
|
93
|
+
// if (isFocusOnLabelClick && this.selectBox && this.selectBox.focus) {
|
|
94
|
+
// this.selectBox.focus();
|
|
95
|
+
// }
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
}, {
|
|
99
|
+
key: "render",
|
|
100
|
+
value: function render() {
|
|
101
|
+
var _this$props3 = this.props,
|
|
102
|
+
labelName = _this$props3.labelName,
|
|
103
|
+
id = _this$props3.id,
|
|
104
|
+
isMandatory = _this$props3.isMandatory,
|
|
105
|
+
options = _this$props3.options,
|
|
106
|
+
selectedValue = _this$props3.selectedValue,
|
|
107
|
+
needSearch = _this$props3.needSearch,
|
|
108
|
+
emptyMessage = _this$props3.emptyMessage,
|
|
109
|
+
animationStyle = _this$props3.animationStyle,
|
|
110
|
+
textBoxSize = _this$props3.textBoxSize,
|
|
111
|
+
textBoxVariant = _this$props3.textBoxVariant,
|
|
112
|
+
searchBoxSize = _this$props3.searchBoxSize,
|
|
113
|
+
searchBoxPlaceHolder = _this$props3.searchBoxPlaceHolder,
|
|
114
|
+
validationMessage = _this$props3.validationMessage,
|
|
115
|
+
validationPalette = _this$props3.validationPalette,
|
|
116
|
+
isReadOnly = _this$props3.isReadOnly,
|
|
117
|
+
valueField = _this$props3.valueField,
|
|
118
|
+
textField = _this$props3.textField,
|
|
119
|
+
excludeOptions = _this$props3.excludeOptions,
|
|
120
|
+
errorType = _this$props3.errorType,
|
|
121
|
+
isDisabled = _this$props3.isDisabled,
|
|
122
|
+
title = _this$props3.title,
|
|
123
|
+
dataId = _this$props3.dataId,
|
|
124
|
+
dataSelectorId = _this$props3.dataSelectorId,
|
|
125
|
+
fieldClass = _this$props3.fieldClass,
|
|
126
|
+
validationRuleMessage = _this$props3.validationRuleMessage,
|
|
127
|
+
validationRulePalette = _this$props3.validationRulePalette,
|
|
128
|
+
onKeyDown = _this$props3.onKeyDown,
|
|
129
|
+
infoText = _this$props3.infoText,
|
|
130
|
+
isLocked = _this$props3.isLocked,
|
|
131
|
+
lockedInfoText = _this$props3.lockedInfoText,
|
|
132
|
+
borderColor = _this$props3.borderColor,
|
|
133
|
+
fieldSize = _this$props3.fieldSize,
|
|
134
|
+
isNextOptions = _this$props3.isNextOptions,
|
|
135
|
+
getNextOptions = _this$props3.getNextOptions,
|
|
136
|
+
popupGroup = _this$props3.popupGroup,
|
|
137
|
+
onSearch = _this$props3.onSearch,
|
|
138
|
+
labelPalette = _this$props3.labelPalette,
|
|
139
|
+
labelCustomClass = _this$props3.labelCustomClass,
|
|
140
|
+
htmlId = _this$props3.htmlId,
|
|
141
|
+
needLocalSearch = _this$props3.needLocalSearch,
|
|
142
|
+
isDefaultSelectValue = _this$props3.isDefaultSelectValue,
|
|
143
|
+
placeHolder = _this$props3.placeHolder,
|
|
144
|
+
children = _this$props3.children,
|
|
145
|
+
onFocus = _this$props3.onFocus,
|
|
146
|
+
iconOnHover = _this$props3.iconOnHover,
|
|
147
|
+
customProps = _this$props3.customProps,
|
|
148
|
+
renderLabelProps = _this$props3.renderLabelProps;
|
|
149
|
+
var _customProps$LabelPro = customProps.LabelProps,
|
|
150
|
+
LabelProps = _customProps$LabelPro === void 0 ? {} : _customProps$LabelPro,
|
|
151
|
+
_customProps$SelectPr = customProps.SelectProps,
|
|
152
|
+
SelectProps = _customProps$SelectPr === void 0 ? {} : _customProps$SelectPr,
|
|
153
|
+
_customProps$Validati = customProps.ValidationMessageProps1,
|
|
154
|
+
ValidationMessageProps1 = _customProps$Validati === void 0 ? {} : _customProps$Validati,
|
|
155
|
+
_customProps$Validati2 = customProps.ValidationMessageProps2,
|
|
156
|
+
ValidationMessageProps2 = _customProps$Validati2 === void 0 ? {} : _customProps$Validati2;
|
|
157
|
+
var uniqueId = htmlId ? htmlId : this.getNextId();
|
|
158
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
159
|
+
className: "".concat(_FieldsModule["default"].container, " ").concat(isDisabled ? _FieldsModule["default"].disabled : isReadOnly ? _FieldsModule["default"].readonly : ''),
|
|
160
|
+
"data-title": isDisabled ? title : null,
|
|
161
|
+
"data-selector-id": dataSelectorId
|
|
162
|
+
}, labelName && /*#__PURE__*/_react["default"].createElement(_FieldContainer["default"], {
|
|
163
|
+
infoText: infoText,
|
|
164
|
+
isLocked: isLocked,
|
|
165
|
+
lockedInfoText: lockedInfoText,
|
|
166
|
+
renderProps: renderLabelProps
|
|
167
|
+
}, /*#__PURE__*/_react["default"].createElement(_Label["default"], _extends({
|
|
168
|
+
text: labelName,
|
|
169
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
170
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
171
|
+
customClass: "".concat(_FieldsModule["default"].fieldLabel, " ").concat(labelCustomClass, " ").concat(isMandatory ? _FieldsModule["default"].labelMandatory : ''),
|
|
172
|
+
htmlFor: uniqueId,
|
|
173
|
+
dataId: isDisabled ? "".concat(dataId, "_label_disabled") : isMandatory ? "".concat(dataId, "_label_mandatory") : "".concat(dataId, "_label")
|
|
174
|
+
}, LabelProps, {
|
|
175
|
+
id: uniqueId
|
|
176
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
177
|
+
className: "".concat(_FieldsModule["default"].fieldContainer, " ").concat(labelName ? _FieldsModule["default"]["fieldMargin_".concat(fieldSize)] : '', " ").concat(fieldClass ? fieldClass : '')
|
|
178
|
+
}, /*#__PURE__*/_react["default"].createElement(_Select["default"], _extends({
|
|
179
|
+
options: options,
|
|
180
|
+
selectedValue: selectedValue,
|
|
181
|
+
onChange: this.handleChange,
|
|
182
|
+
onFocus: onFocus,
|
|
183
|
+
getRef: this.handleGetRef,
|
|
184
|
+
needSearch: needSearch,
|
|
185
|
+
emptyMessage: emptyMessage,
|
|
186
|
+
animationStyle: animationStyle,
|
|
187
|
+
textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
188
|
+
textBoxVariant: textBoxVariant,
|
|
189
|
+
searchBoxSize: searchBoxSize,
|
|
190
|
+
searchBoxPlaceHolder: searchBoxPlaceHolder,
|
|
191
|
+
valueField: valueField,
|
|
192
|
+
textField: textField,
|
|
193
|
+
excludeOptions: excludeOptions,
|
|
194
|
+
dataId: dataId,
|
|
195
|
+
onKeyDown: onKeyDown,
|
|
196
|
+
borderColor: borderColor,
|
|
197
|
+
isDisabled: isDisabled,
|
|
198
|
+
isReadOnly: isReadOnly,
|
|
199
|
+
isNextOptions: isNextOptions,
|
|
200
|
+
getNextOptions: getNextOptions,
|
|
201
|
+
popupGroup: popupGroup,
|
|
202
|
+
onSearch: onSearch,
|
|
203
|
+
htmlId: uniqueId,
|
|
204
|
+
needLocalSearch: needLocalSearch,
|
|
205
|
+
isDefaultSelectValue: isDefaultSelectValue,
|
|
206
|
+
placeHolder: placeHolder,
|
|
207
|
+
iconOnHover: iconOnHover
|
|
208
|
+
}, SelectProps, {
|
|
209
|
+
ariaLabelledby: uniqueId
|
|
210
|
+
}), children ? children : null)), validationMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
211
|
+
text: validationMessage,
|
|
212
|
+
palette: validationPalette,
|
|
213
|
+
type: errorType,
|
|
214
|
+
htmlFor: uniqueId,
|
|
215
|
+
dataId: "".concat(dataId, "_ValidationMessage")
|
|
216
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/_react["default"].createElement(_ValidationMessage["default"], _extends({
|
|
217
|
+
text: validationRuleMessage,
|
|
218
|
+
palette: validationRulePalette,
|
|
219
|
+
type: errorType,
|
|
220
|
+
htmlFor: uniqueId,
|
|
221
|
+
dataId: "".concat(dataId, "_ValidationRuleMessage")
|
|
222
|
+
}, ValidationMessageProps2)));
|
|
223
|
+
}
|
|
224
|
+
}]);
|
|
225
|
+
|
|
226
|
+
return SelectField;
|
|
227
|
+
}(_react.PureComponent);
|
|
228
|
+
|
|
229
|
+
exports["default"] = SelectField;
|
|
230
|
+
SelectField.propTypes = _propTypes.propTypes;
|
|
231
|
+
SelectField.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
232
|
+
// SelectField.docs = {
|
|
233
|
+
// componentGroup: 'Form Fields',
|
|
234
|
+
// folderName: 'General'
|
|
235
|
+
// };
|
|
236
|
+
// }
|