@zohodesk/dot 1.2.3 → 1.3.0
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/PropValidationExcludeFilesArray.js +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +13 -0
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/es/Drawer/Drawer.js +13 -12
- package/es/lookup/Lookup/Lookup.js +10 -10
- package/es/v1/ActionButton/ActionButton.js +11 -8
- package/es/v1/AlphabeticList/AlphabeticList.js +2 -2
- package/es/v1/Attachment/Attachment.js +1 -1
- package/es/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/es/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/es/v1/Drawer/Drawer.js +16 -16
- package/es/v1/FlipCard/FlipCard.js +4 -4
- package/es/v1/FormAction/FormAction.js +1 -1
- package/es/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/es/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/es/v1/IconButton/IconButton.js +3 -3
- package/es/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/es/v1/Loader/Loader.js +1 -1
- package/es/v1/MessageBanner/MessageBanner.js +1 -1
- package/es/v1/NewStar/NewStar.js +1 -1
- package/es/v1/Separator/Separator.js +1 -1
- package/es/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/es/v1/ToastMessage/ToastMessage.js +4 -4
- package/es/v1/Upload/Upload.js +1 -1
- package/es/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/es/v1/alert/AlertHeader/AlertHeader.js +58 -49
- package/es/v1/alert/AlertLookup/AlertLookup.js +101 -41
- package/es/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/es/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/es/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -15
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +53 -80
- package/es/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -73
- package/es/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +102 -118
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +128 -154
- package/es/v1/form/fields/DateField/DateField.js +131 -162
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +52 -57
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +144 -168
- package/es/v1/form/fields/PhoneField/PhoneField.js +128 -156
- package/es/v1/form/fields/RadioField/RadioField.js +2 -2
- package/es/v1/form/fields/SelectField/SelectField.js +3 -3
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/es/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/es/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/es/v1/list/AvatarFlip/AvatarFlip.js +61 -64
- package/es/v1/list/BluePrintStatus/BluePrintStatus.js +11 -18
- package/es/v1/list/Comment/Comment.js +25 -32
- package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +57 -72
- package/es/v1/list/Dot/Dot.js +9 -16
- package/es/v1/list/DotNew/DotNew.js +11 -18
- package/es/v1/list/GridStencils/GridStencils.js +21 -24
- package/es/v1/list/Icons/AddNewIcon.js +19 -22
- package/es/v1/list/Icons/CompleteIcon.js +21 -24
- package/es/v1/list/Icons/DeleteIcon.js +22 -25
- package/es/v1/list/Icons/EditIcon.js +22 -25
- package/es/v1/list/Icons/FloatingIcons.js +12 -19
- package/es/v1/list/Icons/ReadUnreadIcon.js +24 -27
- package/es/v1/list/Icons/SmartIcon.js +20 -23
- package/es/v1/list/ListLayout/ListLayout.js +54 -68
- package/es/v1/list/ListStencils/ListStencils.js +28 -31
- package/es/v1/list/SecondaryText/AccountName.js +1 -1
- package/es/v1/list/SecondaryText/ContactName.js +1 -1
- package/es/v1/list/SecondryPanel/SecondryPanel.js +1 -2
- package/es/v1/list/Thread/Thread.js +1 -1
- package/es/v1/list/UserTime/UserTime.js +1 -1
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +266 -357
- package/es/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/es/v1/lookup/Lookup/Lookup.js +14 -13
- package/es/v1/lookup/Section/Section.js +1 -1
- package/es/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/es/v1/lookup/header/Search/Search.js +3 -3
- package/es/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/es/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/es/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/es/v1/setup/header/Button/Button.js +1 -1
- package/es/v1/setup/header/Link/Link.js +1 -1
- package/es/v1/setup/header/Search/Search.js +1 -1
- package/es/v1/setup/table/Table/Table.js +1 -1
- package/es/v1/setup/table/TableBody/TableBody.js +1 -1
- package/es/v1/setup/table/TableData/TableData.js +1 -1
- package/es/v1/setup/table/TableHead/TableHead.js +1 -1
- package/es/v1/setup/table/TableRow/TableRow.js +1 -1
- package/lib/Drawer/Drawer.js +18 -17
- package/lib/lookup/Lookup/Lookup.js +15 -15
- package/lib/v1/ActionButton/ActionButton.js +11 -9
- package/lib/v1/AlphabeticList/AlphabeticList.js +2 -4
- package/lib/v1/Attachment/Attachment.js +1 -1
- package/lib/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/lib/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/v1/Drawer/Drawer.js +21 -21
- package/lib/v1/FlipCard/FlipCard.js +4 -4
- package/lib/v1/FormAction/FormAction.js +1 -1
- package/lib/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/lib/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/lib/v1/IconButton/IconButton.js +3 -3
- package/lib/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/lib/v1/Loader/Loader.js +1 -1
- package/lib/v1/MessageBanner/MessageBanner.js +1 -1
- package/lib/v1/NewStar/NewStar.js +1 -1
- package/lib/v1/Separator/Separator.js +1 -1
- package/lib/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/lib/v1/ToastMessage/ToastMessage.js +4 -4
- package/lib/v1/Upload/Upload.js +1 -1
- package/lib/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/lib/v1/alert/AlertHeader/AlertHeader.js +68 -50
- package/lib/v1/alert/AlertLookup/AlertLookup.js +109 -42
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -16
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +53 -115
- package/lib/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -108
- package/lib/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +107 -159
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +152 -193
- package/lib/v1/form/fields/DateField/DateField.js +140 -206
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +60 -91
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +168 -228
- package/lib/v1/form/fields/PhoneField/PhoneField.js +150 -193
- package/lib/v1/form/fields/RadioField/RadioField.js +2 -2
- package/lib/v1/form/fields/SelectField/SelectField.js +3 -3
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +11 -8
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/lib/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/lib/v1/list/AvatarFlip/AvatarFlip.js +61 -106
- package/lib/v1/list/BluePrintStatus/BluePrintStatus.js +11 -51
- package/lib/v1/list/Comment/Comment.js +24 -69
- package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +67 -122
- package/lib/v1/list/Dot/Dot.js +9 -54
- package/lib/v1/list/DotNew/DotNew.js +11 -56
- package/lib/v1/list/GridStencils/GridStencils.js +21 -62
- package/lib/v1/list/Icons/AddNewIcon.js +19 -60
- package/lib/v1/list/Icons/CompleteIcon.js +21 -62
- package/lib/v1/list/Icons/DeleteIcon.js +22 -63
- package/lib/v1/list/Icons/EditIcon.js +22 -63
- package/lib/v1/list/Icons/FloatingIcons.js +17 -62
- package/lib/v1/list/Icons/ReadUnreadIcon.js +24 -65
- package/lib/v1/list/Icons/SmartIcon.js +20 -65
- package/lib/v1/list/ListLayout/ListLayout.js +53 -116
- package/lib/v1/list/ListStencils/ListStencils.js +33 -72
- package/lib/v1/list/SecondaryText/AccountName.js +1 -1
- package/lib/v1/list/SecondaryText/ContactName.js +1 -1
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +3 -5
- package/lib/v1/list/Thread/Thread.js +1 -1
- package/lib/v1/list/UserTime/UserTime.js +1 -1
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +367 -472
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/lib/v1/lookup/Lookup/Lookup.js +20 -18
- package/lib/v1/lookup/Section/Section.js +1 -1
- package/lib/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/lib/v1/lookup/header/Search/Search.js +3 -3
- package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/lib/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/lib/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/lib/v1/setup/header/Button/Button.js +1 -1
- package/lib/v1/setup/header/Link/Link.js +1 -1
- package/lib/v1/setup/header/Search/Search.js +1 -1
- package/lib/v1/setup/table/Table/Table.js +1 -1
- package/lib/v1/setup/table/TableBody/TableBody.js +1 -1
- package/lib/v1/setup/table/TableData/TableData.js +1 -1
- package/lib/v1/setup/table/TableHead/TableHead.js +1 -1
- package/lib/v1/setup/table/TableRow/TableRow.js +1 -1
- package/package.json +11 -11
- package/result.json +1 -1
- package/es/v1/errorstate/LinkText/LinkText.js +0 -29
- package/es/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -84
- package/es/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -83
- package/es/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -84
- package/es/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -86
- package/es/v1/errorstate/WillBack/WillBack.js +0 -75
- package/es/v1/errorstate/index.js +0 -8
- package/es/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -63
- package/es/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -65
- package/es/v1/version2/index.js +0 -12
- package/es/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -79
- package/es/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -164
- package/lib/v1/errorstate/LinkText/LinkText.js +0 -80
- package/lib/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -135
- package/lib/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -134
- package/lib/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -135
- package/lib/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -137
- package/lib/v1/errorstate/WillBack/WillBack.js +0 -125
- package/lib/v1/errorstate/index.js +0 -71
- package/lib/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -79
- package/lib/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -81
- package/lib/v1/version2/index.js +0 -58
- package/lib/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -104
- package/lib/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -185
- /package/es/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/index.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/index.js +0 -0
|
@@ -1,183 +1,157 @@
|
|
|
1
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
2
|
|
|
3
3
|
/**** Libraries ****/
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { memo, useRef, useState } from 'react';
|
|
5
5
|
import { defaultProps } from '../../../../form/fields/CurrencyField/props/defaultProps';
|
|
6
6
|
import { propTypes } from '../../../../form/fields/CurrencyField/props/propTypes';
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
-
import Label from '@zohodesk/components/
|
|
10
|
-
import TextBox from '@zohodesk/components/
|
|
9
|
+
import Label from '@zohodesk/components/es/v1/Label/Label';
|
|
10
|
+
import TextBox from '@zohodesk/components/es/v1/TextBox/TextBox';
|
|
11
11
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
|
-
import {
|
|
12
|
+
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
13
13
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
14
|
/**** CSS ****/
|
|
15
15
|
|
|
16
16
|
import style from '../../../../form/fields/Fields.module.css';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
|
|
18
|
+
function CurrencyField(props) {
|
|
19
|
+
let {
|
|
20
|
+
labelName,
|
|
21
|
+
id,
|
|
22
|
+
textBoxSize,
|
|
23
|
+
textBoxVariant,
|
|
24
|
+
textBoxType,
|
|
25
|
+
isMandatory,
|
|
26
|
+
validationMessage,
|
|
27
|
+
validationPalette,
|
|
28
|
+
maxLength,
|
|
29
|
+
isReadOnly,
|
|
30
|
+
value,
|
|
31
|
+
errorType,
|
|
32
|
+
isDisabled,
|
|
33
|
+
title,
|
|
34
|
+
dataId,
|
|
35
|
+
validationRuleMessage,
|
|
36
|
+
validationRulePalette,
|
|
37
|
+
onKeyDown,
|
|
38
|
+
placeHolder,
|
|
39
|
+
infoText,
|
|
40
|
+
borderColor,
|
|
41
|
+
fieldSize,
|
|
42
|
+
labelPalette,
|
|
43
|
+
labelCustomClass,
|
|
44
|
+
htmlId,
|
|
45
|
+
dataSelectorId,
|
|
46
|
+
lockedInfoText,
|
|
47
|
+
isLocked,
|
|
48
|
+
needReadOnlyStyle,
|
|
49
|
+
isClickable,
|
|
50
|
+
userCurrencyType,
|
|
51
|
+
customProps,
|
|
52
|
+
formatCurrency,
|
|
53
|
+
renderLabelProps,
|
|
54
|
+
onBlur,
|
|
55
|
+
onFocus,
|
|
56
|
+
getRef,
|
|
57
|
+
onChange
|
|
58
|
+
} = props;
|
|
59
|
+
const {
|
|
60
|
+
LabelProps = {},
|
|
61
|
+
TextBoxProps = {},
|
|
62
|
+
ValidationMessageProps1 = {},
|
|
63
|
+
ValidationMessageProps2 = {}
|
|
64
|
+
} = customProps;
|
|
65
|
+
const getNextId = useUniqueId();
|
|
66
|
+
const [isActive, setActive] = useState(false);
|
|
67
|
+
const textBox = useRef(null);
|
|
68
|
+
let formatValue = value;
|
|
69
|
+
|
|
70
|
+
if (!isActive) {
|
|
71
|
+
formatValue = formatCurrency(value, userCurrencyType);
|
|
72
|
+
} else {
|
|
73
|
+
formatValue = value;
|
|
28
74
|
}
|
|
29
75
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
onChange
|
|
34
|
-
} = this.props;
|
|
76
|
+
let uniqueId = htmlId ? htmlId : getNextId();
|
|
77
|
+
|
|
78
|
+
function handleChange(value) {
|
|
35
79
|
onChange && onChange(id, value);
|
|
36
80
|
}
|
|
37
81
|
|
|
38
|
-
handleGetRef(el) {
|
|
39
|
-
|
|
40
|
-
getRef,
|
|
41
|
-
id
|
|
42
|
-
} = this.props;
|
|
43
|
-
this.textBox = el;
|
|
82
|
+
function handleGetRef(el) {
|
|
83
|
+
textBox.current = el;
|
|
44
84
|
getRef && getRef(el, id);
|
|
45
85
|
}
|
|
46
86
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
onFocus
|
|
50
|
-
} = this.props;
|
|
51
|
-
this.setState({
|
|
52
|
-
isActive: true
|
|
53
|
-
});
|
|
87
|
+
function handleonFocus() {
|
|
88
|
+
setActive(true);
|
|
54
89
|
onFocus && onFocus();
|
|
55
90
|
}
|
|
56
91
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
onBlur
|
|
60
|
-
} = this.props;
|
|
61
|
-
this.setState({
|
|
62
|
-
isActive: false
|
|
63
|
-
});
|
|
92
|
+
function handleonBlur() {
|
|
93
|
+
setActive(false);
|
|
64
94
|
onBlur && onBlur();
|
|
65
95
|
}
|
|
66
96
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
99
|
+
"data-title": isDisabled ? title : null,
|
|
100
|
+
"data-selector-id": dataSelectorId
|
|
101
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
102
|
+
infoText: infoText,
|
|
103
|
+
isLocked: isLocked,
|
|
104
|
+
lockedInfoText: lockedInfoText,
|
|
105
|
+
renderProps: renderLabelProps
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
107
|
+
text: labelName,
|
|
108
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
109
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
110
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
111
|
+
htmlFor: uniqueId,
|
|
112
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
113
|
+
}, LabelProps))), /*#__PURE__*/React.createElement("div", {
|
|
114
|
+
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
115
|
+
}, /*#__PURE__*/React.createElement(TextBox, _extends({
|
|
116
|
+
htmlId: uniqueId,
|
|
117
|
+
id: id,
|
|
118
|
+
type: textBoxType,
|
|
119
|
+
variant: textBoxVariant,
|
|
120
|
+
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
121
|
+
maxLength: maxLength,
|
|
122
|
+
isReadOnly: isReadOnly,
|
|
123
|
+
inputRef: handleGetRef,
|
|
124
|
+
value: formatValue,
|
|
125
|
+
onChange: handleChange,
|
|
126
|
+
dataId: dataId,
|
|
127
|
+
onBlur: handleonBlur,
|
|
128
|
+
onFocus: handleonFocus,
|
|
129
|
+
onKeyDown: onKeyDown,
|
|
130
|
+
placeHolder: placeHolder,
|
|
131
|
+
borderColor: borderColor,
|
|
132
|
+
isDisabled: isDisabled,
|
|
133
|
+
needEffect: isReadOnly || isDisabled ? false : true,
|
|
134
|
+
isClickable: isClickable,
|
|
135
|
+
needReadOnlyStyle: needReadOnlyStyle
|
|
136
|
+
}, TextBoxProps)), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
137
|
+
text: validationMessage,
|
|
138
|
+
palette: validationPalette,
|
|
139
|
+
type: errorType,
|
|
140
|
+
dataId: `${dataId}_ValidationMessage`,
|
|
141
|
+
htmlFor: uniqueId
|
|
142
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
143
|
+
text: validationRuleMessage,
|
|
144
|
+
palette: validationRulePalette,
|
|
145
|
+
type: errorType,
|
|
146
|
+
htmlFor: uniqueId,
|
|
147
|
+
dataId: `${dataId}_ValidationRuleMessage`
|
|
148
|
+
}, ValidationMessageProps2))));
|
|
149
|
+
} // const MomoizedCurrencyField = memo(CurrencyField);
|
|
150
|
+
// export default MomoizedCurrencyField;
|
|
151
|
+
// MomoizedCurrencyField.propTypes = propTypes;
|
|
152
|
+
// MomoizedCurrencyField.defaultProps = defaultProps;
|
|
114
153
|
|
|
115
|
-
if (!isActive) {
|
|
116
|
-
formatValue = formatCurrency(value, userCurrencyType);
|
|
117
|
-
} else {
|
|
118
|
-
formatValue = value;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
let uniqueId = htmlId ? htmlId : this.getNextId();
|
|
122
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
123
|
-
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
124
|
-
"data-title": isDisabled ? title : null,
|
|
125
|
-
"data-selector-id": dataSelectorId
|
|
126
|
-
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
127
|
-
infoText: infoText,
|
|
128
|
-
isLocked: isLocked,
|
|
129
|
-
lockedInfoText: lockedInfoText,
|
|
130
|
-
renderProps: renderLabelProps
|
|
131
|
-
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
132
|
-
text: labelName,
|
|
133
|
-
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
134
|
-
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
135
|
-
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
136
|
-
htmlFor: uniqueId,
|
|
137
|
-
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
138
|
-
}, LabelProps))), /*#__PURE__*/React.createElement("div", {
|
|
139
|
-
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
140
|
-
}, /*#__PURE__*/React.createElement(TextBox, _extends({
|
|
141
|
-
htmlId: uniqueId,
|
|
142
|
-
id: id,
|
|
143
|
-
type: textBoxType,
|
|
144
|
-
variant: textBoxVariant,
|
|
145
|
-
size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
146
|
-
maxLength: maxLength,
|
|
147
|
-
isReadOnly: isReadOnly,
|
|
148
|
-
inputRef: this.handleGetRef,
|
|
149
|
-
value: formatValue,
|
|
150
|
-
onChange: this.handleChange,
|
|
151
|
-
dataId: dataId,
|
|
152
|
-
onBlur: this.onBlur,
|
|
153
|
-
onFocus: this.onFocus,
|
|
154
|
-
onKeyDown: onKeyDown,
|
|
155
|
-
placeHolder: placeHolder,
|
|
156
|
-
borderColor: borderColor,
|
|
157
|
-
isDisabled: isDisabled,
|
|
158
|
-
needEffect: isReadOnly || isDisabled ? false : true,
|
|
159
|
-
isClickable: isClickable,
|
|
160
|
-
needReadOnlyStyle: needReadOnlyStyle
|
|
161
|
-
}, TextBoxProps)), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
162
|
-
text: validationMessage,
|
|
163
|
-
palette: validationPalette,
|
|
164
|
-
type: errorType,
|
|
165
|
-
dataId: `${dataId}_ValidationMessage`,
|
|
166
|
-
htmlFor: uniqueId
|
|
167
|
-
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
168
|
-
text: validationRuleMessage,
|
|
169
|
-
palette: validationRulePalette,
|
|
170
|
-
type: errorType,
|
|
171
|
-
htmlFor: uniqueId,
|
|
172
|
-
dataId: `${dataId}_ValidationRuleMessage`
|
|
173
|
-
}, ValidationMessageProps2))));
|
|
174
|
-
}
|
|
175
154
|
|
|
176
|
-
}
|
|
177
155
|
CurrencyField.propTypes = propTypes;
|
|
178
|
-
CurrencyField.defaultProps = defaultProps;
|
|
179
|
-
|
|
180
|
-
// componentGroup: 'Form Fields',
|
|
181
|
-
// folderName: 'General'
|
|
182
|
-
// };
|
|
183
|
-
// }
|
|
156
|
+
CurrencyField.defaultProps = defaultProps;
|
|
157
|
+
export default CurrencyField;
|
|
@@ -1,195 +1,164 @@
|
|
|
1
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
2
|
|
|
3
3
|
/**** Libraries ****/
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { memo, useEffect, useRef } from 'react';
|
|
5
5
|
import { defaultProps } from '../../../../form/fields/DateField/props/defaultProps';
|
|
6
6
|
import { propTypes } from '../../../../form/fields/DateField/props/propTypes';
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
-
import Label from '@zohodesk/components/
|
|
10
|
-
import DateWidget from '@zohodesk/components/
|
|
9
|
+
import Label from '@zohodesk/components/es/v1/Label/Label';
|
|
10
|
+
import DateWidget from '@zohodesk/components/es/v1/DateTime/DateWidget';
|
|
11
11
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
|
-
import {
|
|
12
|
+
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
13
13
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
14
|
/**** CSS ****/
|
|
15
15
|
|
|
16
16
|
import style from '../../../../form/fields/Fields.module.css';
|
|
17
|
-
export default class DateField extends PureComponent {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.handleChange = this.handleChange.bind(this);
|
|
21
|
-
this.handleGetRef = this.handleGetRef.bind(this);
|
|
22
|
-
this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
23
|
-
this.getNextId = getUniqueId(this);
|
|
24
|
-
this.openPopup = this.openPopup.bind(this);
|
|
25
|
-
}
|
|
26
17
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
function DateField(props) {
|
|
19
|
+
let {
|
|
20
|
+
labelName,
|
|
21
|
+
isMandatory,
|
|
22
|
+
isDateTime,
|
|
23
|
+
validationMessage,
|
|
24
|
+
validationPalette,
|
|
25
|
+
textBoxSize,
|
|
26
|
+
textBoxVariant,
|
|
27
|
+
isReadOnly,
|
|
28
|
+
value,
|
|
29
|
+
errorType,
|
|
30
|
+
isDisabled,
|
|
31
|
+
title,
|
|
32
|
+
popupGroup,
|
|
33
|
+
dataId,
|
|
34
|
+
dataSelectorId,
|
|
35
|
+
validationRuleMessage,
|
|
36
|
+
validationRulePalette,
|
|
37
|
+
onKeyDown,
|
|
38
|
+
infoText,
|
|
39
|
+
borderColor,
|
|
40
|
+
fieldSize,
|
|
41
|
+
datePattern,
|
|
42
|
+
isLocked,
|
|
43
|
+
lockedInfoText,
|
|
44
|
+
lockedValueText,
|
|
45
|
+
labelPalette,
|
|
46
|
+
labelCustomClass,
|
|
47
|
+
htmlId,
|
|
48
|
+
timeZone,
|
|
49
|
+
i18nKeys,
|
|
50
|
+
iconOnHover,
|
|
51
|
+
customProps,
|
|
52
|
+
renderLabelProps,
|
|
53
|
+
onChange,
|
|
54
|
+
id,
|
|
55
|
+
getRef,
|
|
56
|
+
openPopupOnMount,
|
|
57
|
+
isFocusOnLabelClick
|
|
58
|
+
} = props;
|
|
59
|
+
const {
|
|
60
|
+
LabelProps = {},
|
|
61
|
+
DateWidgetProps = {},
|
|
62
|
+
ValidationMessageProps1 = {},
|
|
63
|
+
ValidationMessageProps2 = {}
|
|
64
|
+
} = customProps;
|
|
65
|
+
const dateField = useRef(null);
|
|
66
|
+
const getNextId = useUniqueId();
|
|
67
|
+
let getAriaId = htmlId ? htmlId : getNextId();
|
|
68
|
+
|
|
69
|
+
function handleChange(value) {
|
|
32
70
|
onChange && onChange(id, value);
|
|
33
71
|
}
|
|
34
72
|
|
|
35
|
-
handleGetRef(el) {
|
|
36
|
-
|
|
37
|
-
getRef,
|
|
38
|
-
id
|
|
39
|
-
} = this.props;
|
|
40
|
-
this.dateField = el;
|
|
73
|
+
function handleGetRef(el) {
|
|
74
|
+
dateField.current = el;
|
|
41
75
|
getRef && getRef(el, id);
|
|
42
76
|
}
|
|
43
77
|
|
|
44
|
-
|
|
45
|
-
this.openPopup();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
openPopup() {
|
|
49
|
-
let {
|
|
50
|
-
openPopupOnMount
|
|
51
|
-
} = this.props;
|
|
52
|
-
|
|
78
|
+
function openPopup() {
|
|
53
79
|
if (openPopupOnMount) {
|
|
54
80
|
setTimeout(() => {
|
|
55
|
-
|
|
56
|
-
|
|
81
|
+
dateField.current && dateField.current.click && dateField.current.click();
|
|
82
|
+
handleLabelClick();
|
|
57
83
|
}, 100);
|
|
58
84
|
}
|
|
59
85
|
}
|
|
60
86
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = prevProps;
|
|
65
|
-
let {
|
|
66
|
-
openPopupOnMount
|
|
67
|
-
} = this.props;
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
openPopup();
|
|
89
|
+
}, [openPopupOnMount]);
|
|
68
90
|
|
|
69
|
-
|
|
70
|
-
|
|
91
|
+
function handleLabelClick() {
|
|
92
|
+
if (isFocusOnLabelClick && dateField.current && dateField.current.focus) {
|
|
93
|
+
dateField.current.focus();
|
|
71
94
|
}
|
|
72
95
|
}
|
|
73
96
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
97
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
99
|
+
"data-title": isDisabled ? title : null,
|
|
100
|
+
"data-selector-id": dataSelectorId
|
|
101
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
102
|
+
infoText: infoText,
|
|
103
|
+
isLocked: isLocked,
|
|
104
|
+
lockedInfoText: lockedInfoText,
|
|
105
|
+
renderProps: renderLabelProps
|
|
106
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
107
|
+
text: labelName,
|
|
108
|
+
htmlFor: getAriaId,
|
|
109
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
110
|
+
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
111
|
+
onClick: isDisabled || isReadOnly ? null : handleLabelClick,
|
|
112
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
113
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
114
|
+
}, LabelProps, {
|
|
115
|
+
id: labelName
|
|
116
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
118
|
+
}, isLocked && lockedValueText ? /*#__PURE__*/React.createElement("div", {
|
|
119
|
+
className: style.lockText
|
|
120
|
+
}, lockedValueText) : /*#__PURE__*/React.createElement(DateWidget, _extends({
|
|
121
|
+
textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
122
|
+
textBoxVariant: textBoxVariant,
|
|
123
|
+
isDateTime: isDateTime,
|
|
124
|
+
onSelect: handleChange,
|
|
125
|
+
timeZone: timeZone,
|
|
126
|
+
getRef: handleGetRef,
|
|
127
|
+
isReadOnly: isReadOnly,
|
|
128
|
+
value: value,
|
|
129
|
+
popupGroup: popupGroup,
|
|
130
|
+
dataId: `${dataId}(formatted_${labelName})`,
|
|
131
|
+
onKeyDown: onKeyDown,
|
|
132
|
+
borderColor: borderColor,
|
|
133
|
+
isDisabled: isDisabled,
|
|
134
|
+
dateFormat: datePattern,
|
|
135
|
+
isEditable: true,
|
|
136
|
+
htmlId: getAriaId,
|
|
137
|
+
i18nKeys: i18nKeys,
|
|
138
|
+
iconOnHover: iconOnHover
|
|
139
|
+
}, DateWidgetProps, {
|
|
140
|
+
a11y: {
|
|
141
|
+
ariaLabelledby: labelName
|
|
81
142
|
}
|
|
82
|
-
}
|
|
143
|
+
})), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
144
|
+
text: validationMessage,
|
|
145
|
+
palette: validationPalette,
|
|
146
|
+
type: errorType,
|
|
147
|
+
htmlFor: getAriaId,
|
|
148
|
+
dataId: `${dataId}_ValidationMessage`
|
|
149
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
150
|
+
text: validationRuleMessage,
|
|
151
|
+
palette: validationRulePalette,
|
|
152
|
+
type: errorType,
|
|
153
|
+
htmlFor: getAriaId,
|
|
154
|
+
dataId: `${dataId}_ValidationRuleMessage`
|
|
155
|
+
}, ValidationMessageProps2))));
|
|
156
|
+
} // const MomoizedDateField = memo(DateField);
|
|
157
|
+
// export default MomoizedDateField;
|
|
158
|
+
// MomoizedDateField.propTypes = propTypes;
|
|
159
|
+
// MomoizedDateField.defaultProps = defaultProps;
|
|
83
160
|
|
|
84
|
-
render() {
|
|
85
|
-
let {
|
|
86
|
-
labelName,
|
|
87
|
-
isMandatory,
|
|
88
|
-
isDateTime,
|
|
89
|
-
validationMessage,
|
|
90
|
-
validationPalette,
|
|
91
|
-
textBoxSize,
|
|
92
|
-
textBoxVariant,
|
|
93
|
-
isReadOnly,
|
|
94
|
-
value,
|
|
95
|
-
errorType,
|
|
96
|
-
isDisabled,
|
|
97
|
-
title,
|
|
98
|
-
popupGroup,
|
|
99
|
-
dataId,
|
|
100
|
-
dataSelectorId,
|
|
101
|
-
validationRuleMessage,
|
|
102
|
-
validationRulePalette,
|
|
103
|
-
onKeyDown,
|
|
104
|
-
infoText,
|
|
105
|
-
borderColor,
|
|
106
|
-
fieldSize,
|
|
107
|
-
datePattern,
|
|
108
|
-
isLocked,
|
|
109
|
-
lockedInfoText,
|
|
110
|
-
lockedValueText,
|
|
111
|
-
labelPalette,
|
|
112
|
-
labelCustomClass,
|
|
113
|
-
htmlId,
|
|
114
|
-
timeZone,
|
|
115
|
-
i18nKeys,
|
|
116
|
-
iconOnHover,
|
|
117
|
-
customProps,
|
|
118
|
-
renderLabelProps
|
|
119
|
-
} = this.props;
|
|
120
|
-
const {
|
|
121
|
-
LabelProps = {},
|
|
122
|
-
DateWidgetProps = {},
|
|
123
|
-
ValidationMessageProps1 = {},
|
|
124
|
-
ValidationMessageProps2 = {}
|
|
125
|
-
} = customProps;
|
|
126
|
-
let getAriaId = htmlId ? htmlId : this.getNextId();
|
|
127
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
128
|
-
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
129
|
-
"data-title": isDisabled ? title : null,
|
|
130
|
-
"data-selector-id": dataSelectorId
|
|
131
|
-
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
132
|
-
infoText: infoText,
|
|
133
|
-
isLocked: isLocked,
|
|
134
|
-
lockedInfoText: lockedInfoText,
|
|
135
|
-
renderProps: renderLabelProps
|
|
136
|
-
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
137
|
-
text: labelName,
|
|
138
|
-
htmlFor: getAriaId,
|
|
139
|
-
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
140
|
-
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
141
|
-
onClick: isDisabled || isReadOnly ? null : this.handleLabelClick,
|
|
142
|
-
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
143
|
-
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
144
|
-
}, LabelProps, {
|
|
145
|
-
id: labelName
|
|
146
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
147
|
-
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
148
|
-
}, isLocked && lockedValueText ? /*#__PURE__*/React.createElement("div", {
|
|
149
|
-
className: style.lockText
|
|
150
|
-
}, lockedValueText) : /*#__PURE__*/React.createElement(DateWidget, _extends({
|
|
151
|
-
textBoxSize: fieldSize === 'medium' ? textBoxSize : 'xsmall',
|
|
152
|
-
textBoxVariant: textBoxVariant,
|
|
153
|
-
isDateTime: isDateTime,
|
|
154
|
-
onSelect: this.handleChange,
|
|
155
|
-
timeZone: timeZone,
|
|
156
|
-
getRef: this.handleGetRef,
|
|
157
|
-
isReadOnly: isReadOnly,
|
|
158
|
-
value: value,
|
|
159
|
-
popupGroup: popupGroup,
|
|
160
|
-
dataId: `${dataId}(formatted_${labelName})`,
|
|
161
|
-
onKeyDown: onKeyDown,
|
|
162
|
-
borderColor: borderColor,
|
|
163
|
-
isDisabled: isDisabled,
|
|
164
|
-
dateFormat: datePattern,
|
|
165
|
-
isEditable: true,
|
|
166
|
-
htmlId: getAriaId,
|
|
167
|
-
i18nKeys: i18nKeys,
|
|
168
|
-
iconOnHover: iconOnHover
|
|
169
|
-
}, DateWidgetProps, {
|
|
170
|
-
a11y: {
|
|
171
|
-
ariaLabelledby: labelName
|
|
172
|
-
}
|
|
173
|
-
})), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
174
|
-
text: validationMessage,
|
|
175
|
-
palette: validationPalette,
|
|
176
|
-
type: errorType,
|
|
177
|
-
htmlFor: getAriaId,
|
|
178
|
-
dataId: `${dataId}_ValidationMessage`
|
|
179
|
-
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
180
|
-
text: validationRuleMessage,
|
|
181
|
-
palette: validationRulePalette,
|
|
182
|
-
type: errorType,
|
|
183
|
-
htmlFor: getAriaId,
|
|
184
|
-
dataId: `${dataId}_ValidationRuleMessage`
|
|
185
|
-
}, ValidationMessageProps2))));
|
|
186
|
-
}
|
|
187
161
|
|
|
188
|
-
}
|
|
189
162
|
DateField.propTypes = propTypes;
|
|
190
|
-
DateField.defaultProps = defaultProps;
|
|
191
|
-
|
|
192
|
-
// componentGroup: 'Form Fields',
|
|
193
|
-
// folderName: 'General'
|
|
194
|
-
// };
|
|
195
|
-
// }
|
|
163
|
+
DateField.defaultProps = defaultProps;
|
|
164
|
+
export default DateField;
|