@zohodesk/dot 1.0.0-temp-110 → 1.0.0-temp-111
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/README.md +8 -0
- package/es/ActionButton/ActionButton.js +8 -4
- package/es/form/fields/CheckBoxField/CheckBoxField.js +3 -2
- package/es/form/fields/CurrencyField/CurrencyField.js +43 -8
- package/es/form/fields/CurrencyField/props/defaultProps.js +1 -0
- package/es/form/fields/DateField/DateField.js +93 -8
- package/es/form/fields/DateField/props/defaultProps.js +1 -0
- package/es/form/fields/Fields.module.css +65 -0
- package/es/form/fields/MultiSelectField/MultiSelectField.js +91 -9
- package/es/form/fields/MultiSelectField/props/defaultProps.js +1 -0
- package/es/form/fields/PhoneField/PhoneField.js +3 -1
- package/es/form/fields/PhoneField/props/defaultProps.js +2 -1
- package/es/form/fields/RadioField/RadioField.js +1 -1
- package/es/form/fields/SelectField/SelectField.js +99 -12
- package/es/form/fields/SelectField/props/defaultProps.js +1 -0
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -1
- package/es/form/fields/TextBoxField/TextBoxField.js +59 -8
- package/es/form/fields/TextBoxField/props/defaultProps.js +1 -0
- package/es/form/fields/TextareaField/TextareaField.js +58 -12
- package/es/form/fields/TextareaField/props/defaultProps.js +1 -0
- package/lib/ActionButton/ActionButton.js +11 -5
- package/lib/AlphabeticList/AlphabeticList.js +3 -1
- package/lib/Attachment/Attachment.js +3 -1
- package/lib/AttachmentViewer/AttachmentImage.js +3 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +3 -1
- package/lib/AttachmentViewer/utils.js +4 -1
- package/lib/ChannelIcon/ChannelIcon.js +3 -1
- package/lib/Drawer/Drawer.js +3 -1
- package/lib/ExternalLink/ExternalLink.js +3 -1
- package/lib/FlipCard/FlipCard.js +3 -1
- package/lib/FormAction/FormAction.js +3 -1
- package/lib/FreezeLayer/FreezeLayer.js +3 -1
- package/lib/IconButton/IconButton.js +3 -1
- package/lib/IconButton/props/propTypes.js +4 -1
- package/lib/Image/Image.js +3 -1
- package/lib/ImportantNotes/ImportantNotes.js +3 -1
- package/lib/Link/Link.js +3 -1
- package/lib/Loader/Loader.js +3 -1
- package/lib/Message/Message.js +3 -1
- package/lib/MessageBanner/MessageBanner.js +3 -1
- package/lib/NewStar/NewStar.js +3 -1
- package/lib/PlusIcon/PlusIcon.js +3 -1
- package/lib/ToastMessage/ToastMessage.js +1 -1
- package/lib/Upload/Upload.js +3 -1
- package/lib/actions/AutoClose.js +1 -1
- package/lib/alert/AlertHeader/AlertHeader.js +3 -1
- package/lib/alert/AlertLookup/AlertLookup.js +3 -1
- package/lib/avatar/AvatarClose/AvatarClose.js +3 -1
- package/lib/avatar/AvatarCollision/AvatarCollision.js +3 -1
- package/lib/avatar/AvatarIcon/AvatarIcon.js +3 -1
- package/lib/avatar/AvatarStatus/AvatarStatus.js +3 -1
- package/lib/avatar/AvatarThread/AvatarThread.js +3 -1
- package/lib/avatar/AvatarUser/AvatarUser.js +5 -2
- package/lib/avatar/AvatarWithTeam/AvatarWithTeam.js +3 -1
- package/lib/deprecated/SelectDropdown/SelectDropdown.js +3 -1
- package/lib/deprecated/utils/KeyboardApi.js +4 -1
- package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +4 -2
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.js +3 -1
- package/lib/emptystate/EditionPage/EditionPage.js +3 -1
- package/lib/errorstate/Inconvenience/Inconvenience.js +3 -1
- package/lib/errorstate/LinkText/LinkText.js +3 -1
- package/lib/errorstate/NoRequestFound/NoRequestFound.js +3 -1
- package/lib/errorstate/PermissionPlay/PermissionPlay.js +3 -1
- package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -1
- package/lib/errorstate/UnableToProcess/UnableToProcess.js +3 -1
- package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
- package/lib/errorstate/WillBack/WillBack.js +3 -1
- package/lib/form/fields/CheckBoxField/CheckBoxField.js +6 -3
- package/lib/form/fields/CheckBoxField/props/defaultProps.js +4 -1
- package/lib/form/fields/CheckBoxField/props/propTypes.js +4 -1
- package/lib/form/fields/CurrencyField/CurrencyField.js +79 -42
- package/lib/form/fields/CurrencyField/props/defaultProps.js +5 -1
- package/lib/form/fields/CurrencyField/props/propTypes.js +4 -1
- package/lib/form/fields/DateField/DateField.js +131 -41
- package/lib/form/fields/DateField/props/defaultProps.js +4 -1
- package/lib/form/fields/DateField/props/propTypes.js +4 -1
- package/lib/form/fields/FieldContainer/FieldContainer.js +3 -1
- package/lib/form/fields/FieldContainer/props/defaultProps.js +4 -1
- package/lib/form/fields/FieldContainer/props/propTypes.js +4 -1
- package/lib/form/fields/Fields.module.css +65 -0
- package/lib/form/fields/MultiSelectField/MultiSelectField.js +138 -53
- package/lib/form/fields/MultiSelectField/props/defaultProps.js +4 -1
- package/lib/form/fields/MultiSelectField/props/propTypes.js +4 -1
- package/lib/form/fields/PhoneField/PhoneField.js +6 -2
- package/lib/form/fields/PhoneField/props/defaultProps.js +2 -1
- package/lib/form/fields/RadioField/RadioField.js +4 -2
- package/lib/form/fields/SelectField/SelectField.js +153 -61
- package/lib/form/fields/SelectField/props/defaultProps.js +6 -2
- package/lib/form/fields/SelectField/props/propTypes.js +4 -1
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -1
- package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +4 -2
- package/lib/form/fields/TagsMultiSelectField/props/defaultProps.js +4 -1
- package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +4 -1
- package/lib/form/fields/TextBoxField/TextBoxField.js +97 -44
- package/lib/form/fields/TextBoxField/props/defaultProps.js +6 -2
- package/lib/form/fields/TextBoxField/props/propTypes.js +4 -1
- package/lib/form/fields/TextEditor/TextEditor.js +4 -2
- package/lib/form/fields/TextEditorField/TextEditorField.js +3 -1
- package/lib/form/fields/TextEditorField/props/defaultProps.js +4 -1
- package/lib/form/fields/TextEditorField/props/propTypes.js +4 -1
- package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.js +5 -2
- package/lib/form/fields/TextareaField/TextareaField.js +92 -45
- package/lib/form/fields/TextareaField/props/defaultProps.js +4 -1
- package/lib/form/fields/TextareaField/props/propTypes.js +4 -1
- package/lib/form/fields/ValidationMessage/ValidationMessage.js +3 -1
- package/lib/form/layout/Field/Field.js +3 -1
- package/lib/form/layout/Section/Section.js +3 -1
- package/lib/layout/SetupDetailLayout/SetupDetailLayout.js +3 -1
- package/lib/layout/SubtabLayout/SubtabLayout.js +3 -1
- package/lib/list/AvatarFlip/AvatarFlip.js +3 -1
- package/lib/list/BluePrintStatus/BluePrintStatus.js +3 -1
- package/lib/list/Comment/Comment.js +3 -1
- package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -1
- package/lib/list/DepartmentDropDown/props/propTypes.js +4 -1
- package/lib/list/Dot/Dot.js +3 -1
- package/lib/list/DotNew/DotNew.js +3 -1
- package/lib/list/GridStencils/GridStencils.js +3 -1
- package/lib/list/Icons/AddNewIcon.js +3 -1
- package/lib/list/Icons/CompleteIcon.js +3 -1
- package/lib/list/Icons/DeleteIcon.js +3 -1
- package/lib/list/Icons/EditIcon.js +3 -1
- package/lib/list/Icons/FloatingIcons.js +3 -1
- package/lib/list/Icons/ReadUnreadIcon.js +3 -1
- package/lib/list/Icons/SmartIcon.js +3 -1
- package/lib/list/ListLayout/ListLayout.js +3 -1
- package/lib/list/ListLayout/props/propTypes.js +4 -1
- package/lib/list/ListStencils/ListStencils.js +3 -1
- package/lib/list/SecondaryText/AccountName.js +3 -1
- package/lib/list/SecondaryText/ContactName.js +3 -1
- package/lib/list/SecondaryText/DepartmentText.js +3 -1
- package/lib/list/SecondaryText/Email.js +3 -1
- package/lib/list/SecondaryText/HappinessRating.js +3 -1
- package/lib/list/SecondaryText/PhoneNumber.js +3 -1
- package/lib/list/SecondaryText/PriorityText.js +3 -1
- package/lib/list/SecondaryText/SecondaryText.js +3 -1
- package/lib/list/SecondaryText/StatusText.js +3 -1
- package/lib/list/SecondaryText/TicketId.js +3 -1
- package/lib/list/SecondaryText/Website.js +3 -1
- package/lib/list/SecondryPanel/SecondryPanel.js +3 -1
- package/lib/list/SentimentStatus/SentimentStatus.js +3 -1
- package/lib/list/Subject/Subject.js +3 -1
- package/lib/list/TagNew/TagNew.js +3 -1
- package/lib/list/Thread/Thread.js +3 -1
- package/lib/list/UserTime/UserTime.js +3 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +3 -1
- package/lib/list/status/StatusDropdown/props/propTypes.js +4 -1
- package/lib/list/status/StatusListItem/StatusListItem.js +3 -1
- package/lib/lookup/EmptyPage/EmptyPage.js +3 -1
- package/lib/lookup/Lookup/Lookup.js +5 -2
- package/lib/lookup/Section/Section.js +3 -1
- package/lib/lookup/header/Close/Close.js +3 -1
- package/lib/lookup/header/ModuleHeader/ModuleHeader.js +5 -2
- package/lib/lookup/header/Search/Search.js +3 -1
- package/lib/lookup/header/TicketHeader/TicketHeader.js +5 -2
- package/lib/lookup/header/Title/Title.js +3 -1
- package/lib/lookup/header/ViewDropDown/ViewDropDown.js +3 -1
- package/lib/setup/header/Button/Button.js +3 -1
- package/lib/setup/header/Link/Link.js +3 -1
- package/lib/setup/header/Search/Search.js +3 -1
- package/lib/setup/header/Views/Views.js +3 -1
- package/lib/setup/helptips/Description/Description.js +3 -1
- package/lib/setup/helptips/Link/Link.js +3 -1
- package/lib/setup/helptips/ListGroup/ListGroup.js +3 -1
- package/lib/setup/helptips/Title/Title.js +3 -1
- package/lib/setup/table/Table/Table.js +3 -1
- package/lib/setup/table/TableBody/TableBody.js +3 -1
- package/lib/setup/table/TableData/TableData.js +3 -1
- package/lib/setup/table/TableHead/TableHead.js +3 -1
- package/lib/setup/table/TableRow/TableRow.js +3 -1
- package/lib/setup/table/Text/Text.js +3 -1
- package/lib/svg/PlusIcon.js +3 -1
- package/lib/svg/SnippetIcon.js +3 -1
- package/lib/svg/TemplateIcon.js +3 -1
- package/lib/version2/AlertClose/AlertClose.js +3 -1
- package/lib/version2/GlobalNotification/GlobalNotification.js +3 -1
- package/lib/version2/alertIcons/AlarmAlertIcon.js +3 -1
- package/lib/version2/alertIcons/AlertIcons.js +3 -1
- package/lib/version2/alertIcons/DangerAlertIcon.js +3 -1
- package/lib/version2/alertIcons/ErrorAlertIcon.js +3 -1
- package/lib/version2/alertIcons/InfoAlertIcon.js +3 -1
- package/lib/version2/alertIcons/NotificationAlertIcon.js +3 -1
- package/lib/version2/alertIcons/SuccessAlertIcon.js +3 -1
- package/lib/version2/alertIcons/WarningAlertIcon.js +3 -1
- package/lib/version2/errorstate/Inconvenience/Inconvenience.js +3 -1
- package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -1
- package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -1
- package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
- package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -1
- package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -1
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +3 -1
- package/lib/version2/lookup/AlertLookup/AlertLookup.js +3 -1
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +3 -1
- package/package.json +4 -4
- package/css_error.log +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
# DOT Design Components
|
|
2
2
|
|
|
3
3
|
In this Library, we Provide Some Basic Components to Build Your Application
|
|
4
|
+
# 1.0.0-temp-111
|
|
5
|
+
Form Fields highlight Active State implementation
|
|
6
|
+
# 1.0.0-beta.242
|
|
4
7
|
|
|
8
|
+
- `Accesssility`- Screen Reader fix.
|
|
9
|
+
|
|
10
|
+
# 1.0.0-beta.241
|
|
11
|
+
|
|
12
|
+
- **Drawer, Lookup** - Focus scope navigation support.
|
|
5
13
|
|
|
6
14
|
# 1.0.0-beta.240
|
|
7
15
|
|
|
@@ -8,6 +8,7 @@ import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
|
8
8
|
import ResponsiveDropBox from '@zohodesk/components/lib/ResponsiveDropBox/ResponsiveDropBox';
|
|
9
9
|
import CssProvider from '@zohodesk/components/lib/Provider/CssProvider';
|
|
10
10
|
import style from './ActionButton.module.css';
|
|
11
|
+
import btnStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css';
|
|
11
12
|
export class ActionButton extends React.Component {
|
|
12
13
|
constructor(props) {
|
|
13
14
|
super(props);
|
|
@@ -72,8 +73,10 @@ export class ActionButton extends React.Component {
|
|
|
72
73
|
flexible: true,
|
|
73
74
|
onClick: onClick,
|
|
74
75
|
dataId: dataId,
|
|
75
|
-
className: `${style.contentBox} ${style[palette + 'Btn']} ${style[size + '_btnBox']} ${children ? style.contentBoxBdr : style.contentBoxBdrRds} ${style.clickable} ${innerClassName} `,
|
|
76
|
-
"data-title": dataTitle
|
|
76
|
+
className: `${btnStyle.buttonReset} ${style.contentBox} ${style[palette + 'Btn']} ${style[size + '_btnBox']} ${children ? style.contentBoxBdr : style.contentBoxBdrRds} ${style.clickable} ${innerClassName} `,
|
|
77
|
+
"data-title": dataTitle,
|
|
78
|
+
tagName: "button",
|
|
79
|
+
tabIndex: "0"
|
|
77
80
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
78
81
|
align: "both"
|
|
79
82
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -97,9 +100,10 @@ export class ActionButton extends React.Component {
|
|
|
97
100
|
onClick: onClick ? !onHover && this.handleTogglePopup : undefined,
|
|
98
101
|
onMouseEnter: onClick ? onHover && this.handleTogglePopup : undefined,
|
|
99
102
|
onMouseLeave: onClick ? onHover && this.handleTogglePopup : undefined,
|
|
100
|
-
className: `${style[arrowBoxSize + '_arrowBox']} ${style[palette + 'Arw']} ${style.arrowWrapper} ${isPopupOpen ? style.arrowActive : ''}`,
|
|
103
|
+
className: `${btnStyle.buttonReset} ${style[arrowBoxSize + '_arrowBox']} ${style[palette + 'Arw']} ${style.arrowWrapper} ${isPopupOpen ? style.arrowActive : ''}`,
|
|
101
104
|
dataId: arrowBoxDataId,
|
|
102
|
-
tabIndex: "0"
|
|
105
|
+
tabIndex: "0",
|
|
106
|
+
tagName: "button"
|
|
103
107
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
104
108
|
align: "both"
|
|
105
109
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -64,7 +64,8 @@ export default class CheckBoxField extends PureComponent {
|
|
|
64
64
|
isLocked,
|
|
65
65
|
lockedInfoText,
|
|
66
66
|
customProps,
|
|
67
|
-
renderLabelProps
|
|
67
|
+
renderLabelProps,
|
|
68
|
+
needFieldStyle
|
|
68
69
|
} = this.props;
|
|
69
70
|
const {
|
|
70
71
|
LabelProps = {},
|
|
@@ -92,7 +93,7 @@ export default class CheckBoxField extends PureComponent {
|
|
|
92
93
|
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
93
94
|
}, LabelProps)));
|
|
94
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
96
|
+
className: `${style.container} ${!isReadOnly && !isDisabled && needFieldStyle ? style.radiobdExxect : ''} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
96
97
|
"data-title": isDisabled ? title : null
|
|
97
98
|
}, isDirectCol && labelElement, /*#__PURE__*/React.createElement("div", {
|
|
98
99
|
className: `${isDirectCol ? style.fieldContainer : style.checkboxFieldContainer} ${isDirectCol && labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
@@ -10,6 +10,7 @@ import TextBox from '@zohodesk/components/lib/TextBox/TextBox';
|
|
|
10
10
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
11
11
|
import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
12
12
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
13
|
+
import RippleEffect from '@zohodesk/components/lib/RippleEffect/RippleEffect';
|
|
13
14
|
|
|
14
15
|
/**** CSS ****/
|
|
15
16
|
import style from '../Fields.module.css';
|
|
@@ -17,8 +18,11 @@ export default class CurrencyField extends PureComponent {
|
|
|
17
18
|
constructor(props) {
|
|
18
19
|
super(props);
|
|
19
20
|
this.state = {
|
|
20
|
-
isActive: false
|
|
21
|
+
isActive: false,
|
|
22
|
+
isFocused: false
|
|
21
23
|
};
|
|
24
|
+
this.handleParentClick = this.handleParentClick.bind(this);
|
|
25
|
+
this.handleFocusToggle = this.handleFocusToggle.bind(this);
|
|
22
26
|
this.handleChange = this.handleChange.bind(this);
|
|
23
27
|
this.handleGetRef = this.handleGetRef.bind(this);
|
|
24
28
|
this.getNextId = getUniqueId(this);
|
|
@@ -40,10 +44,30 @@ export default class CurrencyField extends PureComponent {
|
|
|
40
44
|
this.textBox = el;
|
|
41
45
|
getRef && getRef(el, id);
|
|
42
46
|
}
|
|
47
|
+
handleParentClick() {
|
|
48
|
+
const {
|
|
49
|
+
needFieldStyle
|
|
50
|
+
} = this.props;
|
|
51
|
+
if (needFieldStyle) {
|
|
52
|
+
this.textBox.focus();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
handleFocusToggle(value) {
|
|
56
|
+
const {
|
|
57
|
+
needFieldStyle
|
|
58
|
+
} = this.props;
|
|
59
|
+
if (needFieldStyle) {
|
|
60
|
+
this.setState({
|
|
61
|
+
isFocused: value
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
43
65
|
onFocus() {
|
|
44
66
|
let {
|
|
45
|
-
onFocus
|
|
67
|
+
onFocus,
|
|
68
|
+
needFieldStyle
|
|
46
69
|
} = this.props;
|
|
70
|
+
needFieldStyle && this.handleFocusToggle(true);
|
|
47
71
|
this.setState({
|
|
48
72
|
isActive: true
|
|
49
73
|
});
|
|
@@ -51,8 +75,10 @@ export default class CurrencyField extends PureComponent {
|
|
|
51
75
|
}
|
|
52
76
|
onBlur() {
|
|
53
77
|
let {
|
|
54
|
-
onBlur
|
|
78
|
+
onBlur,
|
|
79
|
+
needFieldStyle
|
|
55
80
|
} = this.props;
|
|
81
|
+
needFieldStyle && this.handleFocusToggle(false);
|
|
56
82
|
this.setState({
|
|
57
83
|
isActive: false
|
|
58
84
|
});
|
|
@@ -92,7 +118,8 @@ export default class CurrencyField extends PureComponent {
|
|
|
92
118
|
userCurrencyType,
|
|
93
119
|
customProps,
|
|
94
120
|
formatCurrency,
|
|
95
|
-
renderLabelProps
|
|
121
|
+
renderLabelProps,
|
|
122
|
+
needFieldStyle
|
|
96
123
|
} = this.props;
|
|
97
124
|
const {
|
|
98
125
|
LabelProps = {},
|
|
@@ -110,9 +137,17 @@ export default class CurrencyField extends PureComponent {
|
|
|
110
137
|
formatValue = value;
|
|
111
138
|
}
|
|
112
139
|
let uniqueId = htmlId ? htmlId : this.getNextId();
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
const {
|
|
141
|
+
isFocused
|
|
142
|
+
} = this.state;
|
|
143
|
+
return /*#__PURE__*/React.createElement(RippleEffect, {
|
|
144
|
+
hoverType: "bg",
|
|
145
|
+
isActive: isFocused,
|
|
146
|
+
isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
|
|
147
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
148
|
+
className: `${needFieldStyle ? style.highlightSpace : ''} ${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
149
|
+
"data-title": isDisabled ? title : null,
|
|
150
|
+
onClick: this.handleParentClick
|
|
116
151
|
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
117
152
|
infoText: infoText,
|
|
118
153
|
isLocked: isLocked,
|
|
@@ -160,7 +195,7 @@ export default class CurrencyField extends PureComponent {
|
|
|
160
195
|
type: errorType,
|
|
161
196
|
htmlFor: uniqueId,
|
|
162
197
|
dataId: `${dataId}_ValidationRuleMessage`
|
|
163
|
-
}, ValidationMessageProps2))));
|
|
198
|
+
}, ValidationMessageProps2)))));
|
|
164
199
|
}
|
|
165
200
|
}
|
|
166
201
|
CurrencyField.propTypes = propTypes;
|
|
@@ -10,6 +10,7 @@ import DateWidget from '@zohodesk/components/lib/DateTime/DateWidget';
|
|
|
10
10
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
11
11
|
import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
12
12
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
13
|
+
import RippleEffect from '@zohodesk/components/lib/RippleEffect/RippleEffect';
|
|
13
14
|
|
|
14
15
|
/**** CSS ****/
|
|
15
16
|
import style from '../Fields.module.css';
|
|
@@ -21,6 +22,17 @@ export default class DateField extends PureComponent {
|
|
|
21
22
|
this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
22
23
|
this.getNextId = getUniqueId(this);
|
|
23
24
|
this.openPopup = this.openPopup.bind(this);
|
|
25
|
+
this.handleParentClick = this.handleParentClick.bind(this);
|
|
26
|
+
this.handleFocusToggle = this.handleFocusToggle.bind(this);
|
|
27
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
28
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
29
|
+
this.getPopupHandlers = this.getPopupHandlers.bind(this);
|
|
30
|
+
this.handleDropBoxOpen = this.handleDropBoxOpen.bind(this);
|
|
31
|
+
this.handleDropBoxClose = this.handleDropBoxClose.bind(this);
|
|
32
|
+
this.state = {
|
|
33
|
+
isFocused: false,
|
|
34
|
+
isPopupOpen: false
|
|
35
|
+
};
|
|
24
36
|
}
|
|
25
37
|
handleChange(value) {
|
|
26
38
|
let {
|
|
@@ -70,6 +82,62 @@ export default class DateField extends PureComponent {
|
|
|
70
82
|
this.dateField.focus();
|
|
71
83
|
}
|
|
72
84
|
}
|
|
85
|
+
handleParentClick(e) {
|
|
86
|
+
const {
|
|
87
|
+
needFieldStyle
|
|
88
|
+
} = this.props;
|
|
89
|
+
if (needFieldStyle) {
|
|
90
|
+
this.dateField.focus();
|
|
91
|
+
this.togglePopup(e);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
handleFocusToggle(value) {
|
|
95
|
+
this.setState({
|
|
96
|
+
isFocused: value
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
handleFocus(e) {
|
|
100
|
+
const {
|
|
101
|
+
onFocus,
|
|
102
|
+
needFieldStyle
|
|
103
|
+
} = this.props;
|
|
104
|
+
needFieldStyle && this.handleFocusToggle(true);
|
|
105
|
+
onFocus && onFocus(e);
|
|
106
|
+
}
|
|
107
|
+
handleBlur(e) {
|
|
108
|
+
const {
|
|
109
|
+
onBlur,
|
|
110
|
+
needFieldStyle
|
|
111
|
+
} = this.props;
|
|
112
|
+
needFieldStyle && this.handleFocusToggle(false);
|
|
113
|
+
onBlur && onBlur(e);
|
|
114
|
+
}
|
|
115
|
+
getPopupHandlers(methods) {
|
|
116
|
+
let {
|
|
117
|
+
togglePopup
|
|
118
|
+
} = methods;
|
|
119
|
+
this.togglePopup = togglePopup;
|
|
120
|
+
}
|
|
121
|
+
handleDropBoxOpen() {
|
|
122
|
+
let {
|
|
123
|
+
isPopupOpen
|
|
124
|
+
} = this.state;
|
|
125
|
+
if (isPopupOpen == false) {
|
|
126
|
+
this.setState({
|
|
127
|
+
isPopupOpen: true
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
handleDropBoxClose() {
|
|
132
|
+
let {
|
|
133
|
+
isPopupOpen
|
|
134
|
+
} = this.state;
|
|
135
|
+
if (isPopupOpen) {
|
|
136
|
+
this.setState({
|
|
137
|
+
isPopupOpen: false
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
73
141
|
render() {
|
|
74
142
|
let {
|
|
75
143
|
labelName,
|
|
@@ -103,7 +171,8 @@ export default class DateField extends PureComponent {
|
|
|
103
171
|
i18nKeys,
|
|
104
172
|
iconOnHover,
|
|
105
173
|
customProps,
|
|
106
|
-
renderLabelProps
|
|
174
|
+
renderLabelProps,
|
|
175
|
+
needFieldStyle
|
|
107
176
|
} = this.props;
|
|
108
177
|
const {
|
|
109
178
|
LabelProps = {},
|
|
@@ -112,9 +181,19 @@ export default class DateField extends PureComponent {
|
|
|
112
181
|
ValidationMessageProps2 = {}
|
|
113
182
|
} = customProps;
|
|
114
183
|
let getAriaId = htmlId ? htmlId : this.getNextId();
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
184
|
+
const {
|
|
185
|
+
isFocused,
|
|
186
|
+
isPopupOpen
|
|
187
|
+
} = this.state;
|
|
188
|
+
let isActive = isPopupOpen || isFocused;
|
|
189
|
+
return /*#__PURE__*/React.createElement(RippleEffect, {
|
|
190
|
+
hoverType: "bg",
|
|
191
|
+
isActive: isFocused,
|
|
192
|
+
isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
|
|
193
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: ` ${needFieldStyle ? style.highlightSpace : ''} ${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''} ${style.hover}`,
|
|
195
|
+
"data-title": isDisabled ? title : null,
|
|
196
|
+
onClick: this.handleParentClick
|
|
118
197
|
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
119
198
|
infoText: infoText,
|
|
120
199
|
isLocked: isLocked,
|
|
@@ -126,12 +205,12 @@ export default class DateField extends PureComponent {
|
|
|
126
205
|
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
127
206
|
palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
|
|
128
207
|
onClick: isDisabled || isReadOnly ? null : this.handleLabelClick,
|
|
129
|
-
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
|
|
208
|
+
customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''} ${style.labelindex}`,
|
|
130
209
|
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
131
210
|
}, LabelProps, {
|
|
132
211
|
id: labelName
|
|
133
212
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
213
|
+
className: `${needFieldStyle ? style.highlightPosition : style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
|
|
135
214
|
}, isLocked && lockedValueText ? /*#__PURE__*/React.createElement("div", {
|
|
136
215
|
className: style.lockText
|
|
137
216
|
}, lockedValueText) : /*#__PURE__*/React.createElement(DateWidget, _extends({
|
|
@@ -141,6 +220,8 @@ export default class DateField extends PureComponent {
|
|
|
141
220
|
onSelect: this.handleChange,
|
|
142
221
|
timeZone: timeZone,
|
|
143
222
|
getRef: this.handleGetRef,
|
|
223
|
+
onFocus: this.handleFocus,
|
|
224
|
+
onBlur: this.handleBlur,
|
|
144
225
|
isReadOnly: isReadOnly,
|
|
145
226
|
value: value,
|
|
146
227
|
popupGroup: popupGroup,
|
|
@@ -152,7 +233,11 @@ export default class DateField extends PureComponent {
|
|
|
152
233
|
isEditable: true,
|
|
153
234
|
htmlId: getAriaId,
|
|
154
235
|
i18nKeys: i18nKeys,
|
|
155
|
-
iconOnHover: iconOnHover
|
|
236
|
+
iconOnHover: iconOnHover,
|
|
237
|
+
getPopupHandlers: this.getPopupHandlers,
|
|
238
|
+
onDropBoxOpen: this.handleDropBoxOpen,
|
|
239
|
+
onDropBoxClose: this.handleDropBoxClose,
|
|
240
|
+
highlightPosition: needFieldStyle ? true : false
|
|
156
241
|
}, DateWidgetProps, {
|
|
157
242
|
a11y: {
|
|
158
243
|
ariaLabelledby: labelName
|
|
@@ -169,7 +254,7 @@ export default class DateField extends PureComponent {
|
|
|
169
254
|
type: errorType,
|
|
170
255
|
htmlFor: getAriaId,
|
|
171
256
|
dataId: `${dataId}_ValidationRuleMessage`
|
|
172
|
-
}, ValidationMessageProps2))));
|
|
257
|
+
}, ValidationMessageProps2)))));
|
|
173
258
|
}
|
|
174
259
|
}
|
|
175
260
|
DateField.propTypes = propTypes;
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
.radiobdExxect
|
|
2
|
+
{
|
|
3
|
+
border-radius: var(--zd_size4);
|
|
4
|
+
padding:var(--zd_size15);
|
|
5
|
+
|
|
6
|
+
}
|
|
7
|
+
.radiobdExxect:hover
|
|
8
|
+
{
|
|
9
|
+
background-color: var(--zdt_rippleeffect_hover_bg);
|
|
10
|
+
}
|
|
11
|
+
.highlightStyle
|
|
12
|
+
{
|
|
13
|
+
padding:var(--zd_size15);
|
|
14
|
+
}
|
|
15
|
+
.highlightSpace
|
|
16
|
+
{
|
|
17
|
+
padding:var(--zd_size14);
|
|
18
|
+
}
|
|
19
|
+
.editetSpace
|
|
20
|
+
{
|
|
21
|
+
padding: var(--zd_size15);
|
|
22
|
+
}
|
|
1
23
|
.container,
|
|
2
24
|
.checkboxFieldContainer {
|
|
3
25
|
position: relative;
|
|
@@ -7,6 +29,11 @@
|
|
|
7
29
|
position: relative;
|
|
8
30
|
min-height: var(--zd_size25);
|
|
9
31
|
}
|
|
32
|
+
.highlightPosition
|
|
33
|
+
{
|
|
34
|
+
position: static;
|
|
35
|
+
min-height: var(--zd_size25);
|
|
36
|
+
}
|
|
10
37
|
.fieldMargin_medium {
|
|
11
38
|
margin-top: var(--zd_size5);
|
|
12
39
|
}
|
|
@@ -181,3 +208,41 @@
|
|
|
181
208
|
[dir=rtl] .ePhiTag {
|
|
182
209
|
margin-right: var(--zd_size8);
|
|
183
210
|
}
|
|
211
|
+
|
|
212
|
+
/* sample css */
|
|
213
|
+
|
|
214
|
+
/* .hover::before{
|
|
215
|
+
position: absolute;
|
|
216
|
+
content: '';
|
|
217
|
+
bottom: -10px;
|
|
218
|
+
left: -10px;
|
|
219
|
+
right: -10px;
|
|
220
|
+
top: -10px;
|
|
221
|
+
border-radius: 4px;
|
|
222
|
+
border: 1px solid transparent;
|
|
223
|
+
} */
|
|
224
|
+
/* .hover{
|
|
225
|
+
border-radius: 4px;
|
|
226
|
+
border: 1px solid transparent;
|
|
227
|
+
padding: 10px;
|
|
228
|
+
}
|
|
229
|
+
.hover:hover
|
|
230
|
+
{
|
|
231
|
+
background-color: var(--zdt_rippleeffect_hover_bg);
|
|
232
|
+
}
|
|
233
|
+
.hover:focus-within{
|
|
234
|
+
background-color: var(--zdt_rippleeffect_primary_light_bg);
|
|
235
|
+
border-color: var(--zdt_rippleeffect_primary_light_border);
|
|
236
|
+
}
|
|
237
|
+
.labelindex
|
|
238
|
+
{
|
|
239
|
+
z-index: 1;
|
|
240
|
+
position: relative;
|
|
241
|
+
}
|
|
242
|
+
.position
|
|
243
|
+
{
|
|
244
|
+
position: relative;
|
|
245
|
+
} */
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
/* sample css */
|
|
@@ -10,6 +10,7 @@ import MultiSelect from '@zohodesk/components/lib/MultiSelect/MultiSelect';
|
|
|
10
10
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
11
11
|
import { getUniqueId } from '@zohodesk/components/lib/Provider/IdProvider';
|
|
12
12
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
13
|
+
import RippleEffect from '@zohodesk/components/lib/RippleEffect/RippleEffect';
|
|
13
14
|
|
|
14
15
|
/** CSS */
|
|
15
16
|
import style from '../Fields.module.css';
|
|
@@ -23,6 +24,16 @@ export default class MultiSelectField extends PureComponent {
|
|
|
23
24
|
this.onSearch = this.onSearch.bind(this);
|
|
24
25
|
this.getNextOptions = this.getNextOptions.bind(this);
|
|
25
26
|
this.getNextId = getUniqueId(this);
|
|
27
|
+
this.handleParentClick = this.handleParentClick.bind(this);
|
|
28
|
+
this.handleFocusToggle = this.handleFocusToggle.bind(this);
|
|
29
|
+
this.handleFocus = this.handleFocus.bind(this);
|
|
30
|
+
this.handleBlur = this.handleBlur.bind(this);
|
|
31
|
+
this.getPopupHandlers = this.getPopupHandlers.bind(this);
|
|
32
|
+
this.handleDropBoxClose = this.handleDropBoxClose.bind(this);
|
|
33
|
+
this.state = {
|
|
34
|
+
isFocused: false,
|
|
35
|
+
isPopupOpen: false
|
|
36
|
+
};
|
|
26
37
|
}
|
|
27
38
|
handleChange(selectedValueIds, selectedValues) {
|
|
28
39
|
let {
|
|
@@ -36,6 +47,14 @@ export default class MultiSelectField extends PureComponent {
|
|
|
36
47
|
onDropBoxOpen,
|
|
37
48
|
id
|
|
38
49
|
} = this.props;
|
|
50
|
+
let {
|
|
51
|
+
isPopupOpen
|
|
52
|
+
} = this.state;
|
|
53
|
+
if (isPopupOpen == false) {
|
|
54
|
+
this.setState({
|
|
55
|
+
isPopupOpen: true
|
|
56
|
+
});
|
|
57
|
+
}
|
|
39
58
|
return onDropBoxOpen && onDropBoxOpen(id);
|
|
40
59
|
}
|
|
41
60
|
onSearch(searchStr) {
|
|
@@ -64,6 +83,53 @@ export default class MultiSelectField extends PureComponent {
|
|
|
64
83
|
this.multiSelectBox = el;
|
|
65
84
|
getRef && getRef(el, id);
|
|
66
85
|
}
|
|
86
|
+
handleParentClick(e) {
|
|
87
|
+
const {
|
|
88
|
+
needFieldStyle
|
|
89
|
+
} = this.props;
|
|
90
|
+
if (needFieldStyle) {
|
|
91
|
+
this.multiSelectBox.focus();
|
|
92
|
+
this.togglePopup(e);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
handleFocusToggle(value) {
|
|
96
|
+
this.setState({
|
|
97
|
+
isFocused: value
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
handleFocus(e) {
|
|
101
|
+
const {
|
|
102
|
+
onFocus,
|
|
103
|
+
needFieldStyle
|
|
104
|
+
} = this.props;
|
|
105
|
+
needFieldStyle && this.handleFocusToggle(true);
|
|
106
|
+
onFocus && onFocus(e);
|
|
107
|
+
}
|
|
108
|
+
handleBlur(e) {
|
|
109
|
+
const {
|
|
110
|
+
onBlur,
|
|
111
|
+
needFieldStyle
|
|
112
|
+
} = this.props;
|
|
113
|
+
needFieldStyle && this.handleFocusToggle(false);
|
|
114
|
+
onBlur && onBlur(e);
|
|
115
|
+
}
|
|
116
|
+
getPopupHandlers(methods) {
|
|
117
|
+
let {
|
|
118
|
+
togglePopup
|
|
119
|
+
} = methods;
|
|
120
|
+
this.togglePopup = togglePopup;
|
|
121
|
+
console.log('togglePopup', togglePopup);
|
|
122
|
+
}
|
|
123
|
+
handleDropBoxClose() {
|
|
124
|
+
let {
|
|
125
|
+
isPopupOpen
|
|
126
|
+
} = this.state;
|
|
127
|
+
if (isPopupOpen) {
|
|
128
|
+
this.setState({
|
|
129
|
+
isPopupOpen: false
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
67
133
|
|
|
68
134
|
// handleLabelClick() {
|
|
69
135
|
// let { isFocusOnLabelClick } = this.props;
|
|
@@ -120,7 +186,8 @@ export default class MultiSelectField extends PureComponent {
|
|
|
120
186
|
onFocus,
|
|
121
187
|
customProps,
|
|
122
188
|
i18nKeys,
|
|
123
|
-
renderLabelProps
|
|
189
|
+
renderLabelProps,
|
|
190
|
+
needFieldStyle
|
|
124
191
|
} = this.props;
|
|
125
192
|
const {
|
|
126
193
|
LabelProps = {},
|
|
@@ -130,9 +197,19 @@ export default class MultiSelectField extends PureComponent {
|
|
|
130
197
|
} = customProps;
|
|
131
198
|
let isDarkPalette = palette === 'dark';
|
|
132
199
|
let uniqueId = htmlId ? htmlId : this.getNextId();
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
200
|
+
const {
|
|
201
|
+
isFocused,
|
|
202
|
+
isPopupOpen
|
|
203
|
+
} = this.state;
|
|
204
|
+
// let isActive = isPopupOpen || isFocused;
|
|
205
|
+
return /*#__PURE__*/React.createElement(RippleEffect, {
|
|
206
|
+
hoverType: "bg",
|
|
207
|
+
isActive: isFocused,
|
|
208
|
+
isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
|
|
209
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
className: `${needFieldStyle ? style.highlightSpace : ''} ${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
211
|
+
"data-title": isDisabled ? title : null,
|
|
212
|
+
onClick: this.handleParentClick
|
|
136
213
|
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
137
214
|
infoText: infoText,
|
|
138
215
|
isLocked: isLocked,
|
|
@@ -146,8 +223,8 @@ export default class MultiSelectField extends PureComponent {
|
|
|
146
223
|
// onClick={this.handleLabelClick}
|
|
147
224
|
,
|
|
148
225
|
customClass: `${style.fieldLabel} ${isMandatory ? style.labelMandatory : ''}`,
|
|
149
|
-
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label
|
|
150
|
-
htmlFor
|
|
226
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
|
|
227
|
+
// htmlFor={uniqueId}
|
|
151
228
|
}, LabelProps))), /*#__PURE__*/React.createElement(MultiSelect, _extends({
|
|
152
229
|
options: options,
|
|
153
230
|
onChange: this.handleChange,
|
|
@@ -178,8 +255,13 @@ export default class MultiSelectField extends PureComponent {
|
|
|
178
255
|
palette: palette,
|
|
179
256
|
i18nKeys: i18nKeys,
|
|
180
257
|
htmlId: uniqueId,
|
|
181
|
-
customChildrenClass: customChildrenClass
|
|
182
|
-
|
|
258
|
+
customChildrenClass: customChildrenClass
|
|
259
|
+
// onFocus={onFocus}
|
|
260
|
+
,
|
|
261
|
+
onFocus: this.handleFocus,
|
|
262
|
+
onBlur: this.handleBlur,
|
|
263
|
+
getPublicMethods: this.getPopupHandlers,
|
|
264
|
+
isPadding: needFieldStyle ? true : false
|
|
183
265
|
}, MultiSelectProps, {
|
|
184
266
|
ariaLabelledby: uniqueId
|
|
185
267
|
}), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
@@ -194,7 +276,7 @@ export default class MultiSelectField extends PureComponent {
|
|
|
194
276
|
type: errorType,
|
|
195
277
|
dataId: `${dataId}_ValidationRuleMessage`,
|
|
196
278
|
htmlFor: uniqueId
|
|
197
|
-
}, ValidationMessageProps2)));
|
|
279
|
+
}, ValidationMessageProps2))));
|
|
198
280
|
}
|
|
199
281
|
}
|
|
200
282
|
MultiSelectField.propTypes = propTypes;
|
|
@@ -92,6 +92,7 @@ export default class PhoneField extends PureComponent {
|
|
|
92
92
|
onCall,
|
|
93
93
|
ePhiData,
|
|
94
94
|
type,
|
|
95
|
+
needFieldStyle,
|
|
95
96
|
customProps
|
|
96
97
|
} = this.props;
|
|
97
98
|
const {
|
|
@@ -149,7 +150,8 @@ export default class PhoneField extends PureComponent {
|
|
|
149
150
|
labelPalette: labelPalette,
|
|
150
151
|
labelCustomClass: labelCustomClass,
|
|
151
152
|
errorType: errorType,
|
|
152
|
-
ePhiData: ePhiData
|
|
153
|
+
ePhiData: ePhiData,
|
|
154
|
+
needFieldStyle: needFieldStyle
|
|
153
155
|
}, TextBoxFieldProps))), /*#__PURE__*/React.createElement(Box, null, isTelephony && value ? /*#__PURE__*/React.createElement(Link, _extends({
|
|
154
156
|
className: style.phoneIcon,
|
|
155
157
|
callfrom: "phone",
|
|
@@ -53,7 +53,7 @@ export default class RadioField extends PureComponent {
|
|
|
53
53
|
ValidationMessageProps2 = {}
|
|
54
54
|
} = customProps;
|
|
55
55
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
56
|
+
className: `${style.container} ${!isDisabled && !isReadOnly && style.radiobdExxect} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
57
57
|
"data-title": isDisabled ? title : null
|
|
58
58
|
}, labelName && /*#__PURE__*/React.createElement(Label, _extends({
|
|
59
59
|
text: labelName,
|