@zohodesk/dot 1.0.0-temp-109 → 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.
Files changed (212) hide show
  1. package/README.md +15 -0
  2. package/es/ActionButton/ActionButton.js +12 -5
  3. package/es/Drawer/Drawer.js +23 -9
  4. package/es/Drawer/Drawer.module.css +1 -1
  5. package/es/Drawer/props/defaultProps.js +2 -1
  6. package/es/Drawer/props/propTypes.js +2 -1
  7. package/es/alert/AlertLookup/AlertLookup.js +5 -53
  8. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +15 -13
  9. package/es/form/fields/CheckBoxField/CheckBoxField.js +3 -2
  10. package/es/form/fields/CurrencyField/CurrencyField.js +43 -8
  11. package/es/form/fields/CurrencyField/props/defaultProps.js +1 -0
  12. package/es/form/fields/DateField/DateField.js +93 -8
  13. package/es/form/fields/DateField/props/defaultProps.js +1 -0
  14. package/es/form/fields/Fields.module.css +65 -0
  15. package/es/form/fields/MultiSelectField/MultiSelectField.js +91 -9
  16. package/es/form/fields/MultiSelectField/props/defaultProps.js +1 -0
  17. package/es/form/fields/PhoneField/PhoneField.js +3 -1
  18. package/es/form/fields/PhoneField/props/defaultProps.js +2 -1
  19. package/es/form/fields/RadioField/RadioField.js +1 -1
  20. package/es/form/fields/SelectField/SelectField.js +99 -12
  21. package/es/form/fields/SelectField/props/defaultProps.js +1 -0
  22. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +3 -1
  23. package/es/form/fields/TextBoxField/TextBoxField.js +59 -8
  24. package/es/form/fields/TextBoxField/props/defaultProps.js +1 -0
  25. package/es/form/fields/TextareaField/TextareaField.js +58 -12
  26. package/es/form/fields/TextareaField/props/defaultProps.js +1 -0
  27. package/es/list/Icons/DeleteIcon.js +2 -1
  28. package/es/list/Icons/SmartIcon.js +0 -1
  29. package/es/lookup/Lookup/Lookup.js +24 -12
  30. package/es/lookup/Lookup/props/defaultProps.js +2 -1
  31. package/es/lookup/Lookup/props/propTypes.js +2 -1
  32. package/es/lookup/header/Search/Search.js +5 -0
  33. package/es/version2/GlobalNotification/GlobalNotification.js +2 -1
  34. package/es/version2/lookup/AlertLookup/AlertLookup.js +42 -52
  35. package/lib/ActionButton/ActionButton.js +15 -6
  36. package/lib/AlphabeticList/AlphabeticList.js +3 -1
  37. package/lib/Attachment/Attachment.js +3 -1
  38. package/lib/AttachmentViewer/AttachmentImage.js +3 -1
  39. package/lib/AttachmentViewer/AttachmentViewer.js +3 -1
  40. package/lib/AttachmentViewer/utils.js +4 -1
  41. package/lib/ChannelIcon/ChannelIcon.js +3 -1
  42. package/lib/Drawer/Drawer.js +26 -10
  43. package/lib/Drawer/Drawer.module.css +1 -1
  44. package/lib/Drawer/props/defaultProps.js +2 -1
  45. package/lib/Drawer/props/propTypes.js +2 -1
  46. package/lib/ExternalLink/ExternalLink.js +3 -1
  47. package/lib/FlipCard/FlipCard.js +3 -1
  48. package/lib/FormAction/FormAction.js +3 -1
  49. package/lib/FreezeLayer/FreezeLayer.js +3 -1
  50. package/lib/IconButton/IconButton.js +3 -1
  51. package/lib/IconButton/props/propTypes.js +4 -1
  52. package/lib/Image/Image.js +3 -1
  53. package/lib/ImportantNotes/ImportantNotes.js +3 -1
  54. package/lib/Link/Link.js +3 -1
  55. package/lib/Loader/Loader.js +3 -1
  56. package/lib/Message/Message.js +3 -1
  57. package/lib/MessageBanner/MessageBanner.js +3 -1
  58. package/lib/NewStar/NewStar.js +3 -1
  59. package/lib/PlusIcon/PlusIcon.js +3 -1
  60. package/lib/ToastMessage/ToastMessage.js +1 -1
  61. package/lib/Upload/Upload.js +3 -1
  62. package/lib/actions/AutoClose.js +1 -1
  63. package/lib/alert/AlertHeader/AlertHeader.js +3 -1
  64. package/lib/alert/AlertLookup/AlertLookup.js +35 -83
  65. package/lib/avatar/AvatarClose/AvatarClose.js +3 -1
  66. package/lib/avatar/AvatarCollision/AvatarCollision.js +3 -1
  67. package/lib/avatar/AvatarIcon/AvatarIcon.js +3 -1
  68. package/lib/avatar/AvatarStatus/AvatarStatus.js +3 -1
  69. package/lib/avatar/AvatarThread/AvatarThread.js +3 -1
  70. package/lib/avatar/AvatarUser/AvatarUser.js +5 -2
  71. package/lib/avatar/AvatarWithTeam/AvatarWithTeam.js +3 -1
  72. package/lib/deprecated/SelectDropdown/SelectDropdown.js +3 -1
  73. package/lib/deprecated/utils/KeyboardApi.js +4 -1
  74. package/lib/dropdown/ToggleDropDown/ToggleDropDown.js +19 -15
  75. package/lib/emptystate/CommonEmptyState/CommonEmptyState.js +3 -1
  76. package/lib/emptystate/EditionPage/EditionPage.js +3 -1
  77. package/lib/errorstate/Inconvenience/Inconvenience.js +3 -1
  78. package/lib/errorstate/LinkText/LinkText.js +3 -1
  79. package/lib/errorstate/NoRequestFound/NoRequestFound.js +3 -1
  80. package/lib/errorstate/PermissionPlay/PermissionPlay.js +3 -1
  81. package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +3 -1
  82. package/lib/errorstate/UnableToProcess/UnableToProcess.js +3 -1
  83. package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
  84. package/lib/errorstate/WillBack/WillBack.js +3 -1
  85. package/lib/form/fields/CheckBoxField/CheckBoxField.js +6 -3
  86. package/lib/form/fields/CheckBoxField/props/defaultProps.js +4 -1
  87. package/lib/form/fields/CheckBoxField/props/propTypes.js +4 -1
  88. package/lib/form/fields/CurrencyField/CurrencyField.js +79 -42
  89. package/lib/form/fields/CurrencyField/props/defaultProps.js +5 -1
  90. package/lib/form/fields/CurrencyField/props/propTypes.js +4 -1
  91. package/lib/form/fields/DateField/DateField.js +131 -41
  92. package/lib/form/fields/DateField/props/defaultProps.js +4 -1
  93. package/lib/form/fields/DateField/props/propTypes.js +4 -1
  94. package/lib/form/fields/FieldContainer/FieldContainer.js +3 -1
  95. package/lib/form/fields/FieldContainer/props/defaultProps.js +4 -1
  96. package/lib/form/fields/FieldContainer/props/propTypes.js +4 -1
  97. package/lib/form/fields/Fields.module.css +65 -0
  98. package/lib/form/fields/MultiSelectField/MultiSelectField.js +138 -53
  99. package/lib/form/fields/MultiSelectField/props/defaultProps.js +4 -1
  100. package/lib/form/fields/MultiSelectField/props/propTypes.js +4 -1
  101. package/lib/form/fields/PhoneField/PhoneField.js +6 -2
  102. package/lib/form/fields/PhoneField/props/defaultProps.js +2 -1
  103. package/lib/form/fields/RadioField/RadioField.js +4 -2
  104. package/lib/form/fields/SelectField/SelectField.js +153 -61
  105. package/lib/form/fields/SelectField/props/defaultProps.js +6 -2
  106. package/lib/form/fields/SelectField/props/propTypes.js +4 -1
  107. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -1
  108. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +4 -2
  109. package/lib/form/fields/TagsMultiSelectField/props/defaultProps.js +4 -1
  110. package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +4 -1
  111. package/lib/form/fields/TextBoxField/TextBoxField.js +97 -44
  112. package/lib/form/fields/TextBoxField/props/defaultProps.js +6 -2
  113. package/lib/form/fields/TextBoxField/props/propTypes.js +4 -1
  114. package/lib/form/fields/TextEditor/TextEditor.js +4 -2
  115. package/lib/form/fields/TextEditorField/TextEditorField.js +3 -1
  116. package/lib/form/fields/TextEditorField/props/defaultProps.js +4 -1
  117. package/lib/form/fields/TextEditorField/props/propTypes.js +4 -1
  118. package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.js +5 -2
  119. package/lib/form/fields/TextareaField/TextareaField.js +92 -45
  120. package/lib/form/fields/TextareaField/props/defaultProps.js +4 -1
  121. package/lib/form/fields/TextareaField/props/propTypes.js +4 -1
  122. package/lib/form/fields/ValidationMessage/ValidationMessage.js +3 -1
  123. package/lib/form/layout/Field/Field.js +3 -1
  124. package/lib/form/layout/Section/Section.js +3 -1
  125. package/lib/layout/SetupDetailLayout/SetupDetailLayout.js +3 -1
  126. package/lib/layout/SubtabLayout/SubtabLayout.js +3 -1
  127. package/lib/list/AvatarFlip/AvatarFlip.js +3 -1
  128. package/lib/list/BluePrintStatus/BluePrintStatus.js +3 -1
  129. package/lib/list/Comment/Comment.js +3 -1
  130. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -1
  131. package/lib/list/DepartmentDropDown/props/propTypes.js +4 -1
  132. package/lib/list/Dot/Dot.js +3 -1
  133. package/lib/list/DotNew/DotNew.js +3 -1
  134. package/lib/list/GridStencils/GridStencils.js +3 -1
  135. package/lib/list/Icons/AddNewIcon.js +3 -1
  136. package/lib/list/Icons/CompleteIcon.js +3 -1
  137. package/lib/list/Icons/DeleteIcon.js +5 -2
  138. package/lib/list/Icons/EditIcon.js +3 -1
  139. package/lib/list/Icons/FloatingIcons.js +3 -1
  140. package/lib/list/Icons/ReadUnreadIcon.js +3 -1
  141. package/lib/list/Icons/SmartIcon.js +3 -2
  142. package/lib/list/ListLayout/ListLayout.js +3 -1
  143. package/lib/list/ListLayout/props/propTypes.js +4 -1
  144. package/lib/list/ListStencils/ListStencils.js +3 -1
  145. package/lib/list/SecondaryText/AccountName.js +3 -1
  146. package/lib/list/SecondaryText/ContactName.js +3 -1
  147. package/lib/list/SecondaryText/DepartmentText.js +3 -1
  148. package/lib/list/SecondaryText/Email.js +3 -1
  149. package/lib/list/SecondaryText/HappinessRating.js +3 -1
  150. package/lib/list/SecondaryText/PhoneNumber.js +3 -1
  151. package/lib/list/SecondaryText/PriorityText.js +3 -1
  152. package/lib/list/SecondaryText/SecondaryText.js +3 -1
  153. package/lib/list/SecondaryText/StatusText.js +3 -1
  154. package/lib/list/SecondaryText/TicketId.js +3 -1
  155. package/lib/list/SecondaryText/Website.js +3 -1
  156. package/lib/list/SecondryPanel/SecondryPanel.js +3 -1
  157. package/lib/list/SentimentStatus/SentimentStatus.js +3 -1
  158. package/lib/list/Subject/Subject.js +3 -1
  159. package/lib/list/TagNew/TagNew.js +3 -1
  160. package/lib/list/Thread/Thread.js +3 -1
  161. package/lib/list/UserTime/UserTime.js +3 -1
  162. package/lib/list/status/StatusDropdown/StatusDropdown.js +3 -1
  163. package/lib/list/status/StatusDropdown/props/propTypes.js +4 -1
  164. package/lib/list/status/StatusListItem/StatusListItem.js +3 -1
  165. package/lib/lookup/EmptyPage/EmptyPage.js +3 -1
  166. package/lib/lookup/Lookup/Lookup.js +29 -13
  167. package/lib/lookup/Lookup/props/defaultProps.js +2 -1
  168. package/lib/lookup/Lookup/props/propTypes.js +2 -1
  169. package/lib/lookup/Section/Section.js +3 -1
  170. package/lib/lookup/header/Close/Close.js +3 -1
  171. package/lib/lookup/header/ModuleHeader/ModuleHeader.js +5 -2
  172. package/lib/lookup/header/Search/Search.js +8 -1
  173. package/lib/lookup/header/TicketHeader/TicketHeader.js +5 -2
  174. package/lib/lookup/header/Title/Title.js +3 -1
  175. package/lib/lookup/header/ViewDropDown/ViewDropDown.js +3 -1
  176. package/lib/setup/header/Button/Button.js +3 -1
  177. package/lib/setup/header/Link/Link.js +3 -1
  178. package/lib/setup/header/Search/Search.js +3 -1
  179. package/lib/setup/header/Views/Views.js +3 -1
  180. package/lib/setup/helptips/Description/Description.js +3 -1
  181. package/lib/setup/helptips/Link/Link.js +3 -1
  182. package/lib/setup/helptips/ListGroup/ListGroup.js +3 -1
  183. package/lib/setup/helptips/Title/Title.js +3 -1
  184. package/lib/setup/table/Table/Table.js +3 -1
  185. package/lib/setup/table/TableBody/TableBody.js +3 -1
  186. package/lib/setup/table/TableData/TableData.js +3 -1
  187. package/lib/setup/table/TableHead/TableHead.js +3 -1
  188. package/lib/setup/table/TableRow/TableRow.js +3 -1
  189. package/lib/setup/table/Text/Text.js +3 -1
  190. package/lib/svg/PlusIcon.js +3 -1
  191. package/lib/svg/SnippetIcon.js +3 -1
  192. package/lib/svg/TemplateIcon.js +3 -1
  193. package/lib/version2/AlertClose/AlertClose.js +3 -1
  194. package/lib/version2/GlobalNotification/GlobalNotification.js +5 -2
  195. package/lib/version2/alertIcons/AlarmAlertIcon.js +3 -1
  196. package/lib/version2/alertIcons/AlertIcons.js +3 -1
  197. package/lib/version2/alertIcons/DangerAlertIcon.js +3 -1
  198. package/lib/version2/alertIcons/ErrorAlertIcon.js +3 -1
  199. package/lib/version2/alertIcons/InfoAlertIcon.js +3 -1
  200. package/lib/version2/alertIcons/NotificationAlertIcon.js +3 -1
  201. package/lib/version2/alertIcons/SuccessAlertIcon.js +3 -1
  202. package/lib/version2/alertIcons/WarningAlertIcon.js +3 -1
  203. package/lib/version2/errorstate/Inconvenience/Inconvenience.js +3 -1
  204. package/lib/version2/errorstate/OopsSomethingMiss/OopsSomethingMiss.js +3 -1
  205. package/lib/version2/errorstate/UnableToProcessRequest/UnableToProcessRequest.js +3 -1
  206. package/lib/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +3 -1
  207. package/lib/version2/errorstate/UrlNotFound/UrlNotFound.js +3 -1
  208. package/lib/version2/errorstate/WillBeRightBack/WillBeRightBack.js +3 -1
  209. package/lib/version2/lookup/AlertHeader/AlertHeader.js +3 -1
  210. package/lib/version2/lookup/AlertLookup/AlertLookup.js +70 -83
  211. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +3 -1
  212. package/package.json +10 -8
@@ -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
- return /*#__PURE__*/React.createElement("div", {
134
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
135
- "data-title": isDisabled ? title : null
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: uniqueId
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
- onFocus: onFocus
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;
@@ -12,5 +12,6 @@ export const defaultProps = {
12
12
  labelPalette: 'default',
13
13
  customProps: {},
14
14
  i18nKeys: {},
15
+ // needFieldStyle:true,
15
16
  ...FieldCommonDefaultProps()
16
17
  };
@@ -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",
@@ -11,5 +11,6 @@ export const defaultProps = {
11
11
  labelPalette: 'default',
12
12
  labelCustomClass: '',
13
13
  i18nKeys: {},
14
- customProps: {}
14
+ customProps: {},
15
+ needFieldStyle: false
15
16
  };
@@ -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,
@@ -10,6 +10,7 @@ import Select from '@zohodesk/components/lib/Select/Select';
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
  /**** props ****/
15
16
 
@@ -22,6 +23,17 @@ export default class SelectField extends PureComponent {
22
23
  this.handleGetRef = this.handleGetRef.bind(this);
23
24
  // this.handleLabelClick = this.handleLabelClick.bind(this);
24
25
  this.getNextId = getUniqueId(this);
26
+ this.handleParentClick = this.handleParentClick.bind(this);
27
+ this.handleFocusToggle = this.handleFocusToggle.bind(this);
28
+ this.handleFocus = this.handleFocus.bind(this);
29
+ this.handleBlur = this.handleBlur.bind(this);
30
+ this.getPopupHandlers = this.getPopupHandlers.bind(this);
31
+ this.handleDropBoxOpen = this.handleDropBoxOpen.bind(this);
32
+ this.handleDropBoxClose = this.handleDropBoxClose.bind(this);
33
+ this.state = {
34
+ isFocused: false,
35
+ isPopupOpen: false
36
+ };
25
37
  }
26
38
  handleChange(selctedId, selectedValue) {
27
39
  let {
@@ -36,9 +48,65 @@ export default class SelectField extends PureComponent {
36
48
  getRef,
37
49
  id
38
50
  } = this.props;
39
- this.selectBox = el;
51
+ this.textBox = el;
40
52
  getRef && getRef(el, id);
41
53
  }
54
+ handleParentClick(e) {
55
+ const {
56
+ needFieldStyle
57
+ } = this.props;
58
+ if (needFieldStyle) {
59
+ this.textBox.focus();
60
+ this.togglePopup(e);
61
+ }
62
+ }
63
+ handleFocusToggle(value) {
64
+ this.setState({
65
+ isFocused: value
66
+ });
67
+ }
68
+ handleFocus(e) {
69
+ const {
70
+ onFocus,
71
+ needFieldStyle
72
+ } = this.props;
73
+ needFieldStyle && this.handleFocusToggle(true);
74
+ onFocus && onFocus(e);
75
+ }
76
+ handleBlur(e) {
77
+ const {
78
+ onBlur,
79
+ needFieldStyle
80
+ } = this.props;
81
+ needFieldStyle && this.handleFocusToggle(false);
82
+ onBlur && onBlur(e);
83
+ }
84
+ getPopupHandlers(methods) {
85
+ let {
86
+ togglePopup
87
+ } = methods;
88
+ this.togglePopup = togglePopup;
89
+ }
90
+ handleDropBoxOpen() {
91
+ let {
92
+ isPopupOpen
93
+ } = this.state;
94
+ if (isPopupOpen == false) {
95
+ this.setState({
96
+ isPopupOpen: true
97
+ });
98
+ }
99
+ }
100
+ handleDropBoxClose() {
101
+ let {
102
+ isPopupOpen
103
+ } = this.state;
104
+ if (isPopupOpen) {
105
+ this.setState({
106
+ isPopupOpen: false
107
+ });
108
+ }
109
+ }
42
110
 
43
111
  // handleLabelClick() {
44
112
  // let { isFocusOnLabelClick } = this.props;
@@ -95,6 +163,8 @@ export default class SelectField extends PureComponent {
95
163
  iconOnHover,
96
164
  customProps,
97
165
  renderLabelProps,
166
+ handleDropBoxOpen,
167
+ needFieldStyle,
98
168
  ariaLabelledby
99
169
  } = this.props;
100
170
  const {
@@ -104,9 +174,19 @@ export default class SelectField extends PureComponent {
104
174
  ValidationMessageProps2 = {}
105
175
  } = customProps;
106
176
  let uniqueId = htmlId ? htmlId : this.getNextId();
107
- return /*#__PURE__*/React.createElement("div", {
108
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
109
- "data-title": isDisabled ? title : null
177
+ const {
178
+ isFocused,
179
+ isPopupOpen
180
+ } = this.state;
181
+ let isActive = isPopupOpen || isFocused;
182
+ return /*#__PURE__*/React.createElement(RippleEffect, {
183
+ hoverType: "bg",
184
+ isActive: isActive,
185
+ isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
186
+ }, /*#__PURE__*/React.createElement("div", {
187
+ className: `${style.container} ${needFieldStyle ? style.highlightSpace : ''} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
188
+ "data-title": isDisabled ? title : null,
189
+ onClick: this.handleParentClick
110
190
  }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
111
191
  infoText: infoText,
112
192
  isLocked: isLocked,
@@ -116,18 +196,20 @@ export default class SelectField extends PureComponent {
116
196
  text: labelName,
117
197
  size: fieldSize === 'small' ? 'small' : 'medium',
118
198
  palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
119
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
120
- htmlFor: uniqueId,
199
+ customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''} ${style.labelindex}`
200
+ // htmlFor={uniqueId}
201
+ ,
121
202
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
122
203
  }, LabelProps, {
123
204
  id: uniqueId
124
205
  }))), /*#__PURE__*/React.createElement("div", {
125
- className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''} ${fieldClass ? fieldClass : ''}`
206
+ className: `${needFieldStyle ? style.highlightPosition : style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''} ${fieldClass ? fieldClass : ''}`
126
207
  }, /*#__PURE__*/React.createElement(Select, _extends({
127
208
  options: options,
128
209
  selectedValue: selectedValue,
129
210
  onChange: this.handleChange,
130
- onFocus: onFocus,
211
+ onFocus: this.handleFocus,
212
+ onBlur: this.handleBlur,
131
213
  getRef: this.handleGetRef,
132
214
  needSearch: needSearch,
133
215
  emptyMessage: emptyMessage,
@@ -147,12 +229,17 @@ export default class SelectField extends PureComponent {
147
229
  isNextOptions: isNextOptions,
148
230
  getNextOptions: getNextOptions,
149
231
  popupGroup: popupGroup,
150
- onSearch: onSearch,
151
- htmlId: uniqueId,
232
+ onSearch: onSearch
233
+ // htmlId={uniqueId}
234
+ ,
152
235
  needLocalSearch: needLocalSearch,
153
236
  isDefaultSelectValue: isDefaultSelectValue,
154
237
  placeHolder: placeHolder,
155
- iconOnHover: iconOnHover
238
+ iconOnHover: iconOnHover,
239
+ needPosition: needFieldStyle ? true : false,
240
+ getPopupHandlers: this.getPopupHandlers,
241
+ onDropBoxOpen: this.handleDropBoxOpen,
242
+ onDropBoxClose: this.handleDropBoxClose
156
243
  }, SelectProps, {
157
244
  ariaLabelledby: uniqueId
158
245
  }), children ? children : null)), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
@@ -167,7 +254,7 @@ export default class SelectField extends PureComponent {
167
254
  type: errorType,
168
255
  htmlFor: uniqueId,
169
256
  dataId: `${dataId}_ValidationRuleMessage`
170
- }, ValidationMessageProps2)));
257
+ }, ValidationMessageProps2))));
171
258
  }
172
259
  }
173
260
  SelectField.propTypes = propTypes;
@@ -13,5 +13,6 @@ export const defaultProps = {
13
13
  isDefaultSelectValue: true,
14
14
  placeHolder: '',
15
15
  customProps: {},
16
+ needFieldStyle: false,
16
17
  ...FieldCommonDefaultProps()
17
18
  };
@@ -167,7 +167,9 @@ const TagsMultiSelectField = props => {
167
167
  };
168
168
  }, []);
169
169
  return /*#__PURE__*/React.createElement("div", {
170
- className: `${isDisabled ? fieldStyle.disabled : isReadOnly ? fieldStyle.readonly : ''}`
170
+ className: `${isDisabled ? fieldStyle.disabled : isReadOnly ? fieldStyle.readonly : ''}`,
171
+ tabIndex: "0",
172
+ "aria-label": `${labelName}`
171
173
  }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
172
174
  ePhiData: ePhiData,
173
175
  alignContainer: "baseline",
@@ -10,6 +10,7 @@ import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
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';
@@ -20,6 +21,13 @@ export default class TextBoxField extends PureComponent {
20
21
  this.handleGetRef = this.handleGetRef.bind(this);
21
22
  // this.handleLabelClick = this.handleLabelClick.bind(this);
22
23
  this.getNextId = getUniqueId(this);
24
+ this.handleParentClick = this.handleParentClick.bind(this);
25
+ this.handleFocusToggle = this.handleFocusToggle.bind(this);
26
+ this.handleFocus = this.handleFocus.bind(this);
27
+ this.handleBlur = this.handleBlur.bind(this);
28
+ this.state = {
29
+ isFocused: false
30
+ };
23
31
  }
24
32
  handleChange(value) {
25
33
  let {
@@ -44,6 +52,40 @@ export default class TextBoxField extends PureComponent {
44
52
  // // }
45
53
  // }
46
54
 
55
+ handleParentClick() {
56
+ const {
57
+ needFieldStyle
58
+ } = this.props;
59
+ if (needFieldStyle) {
60
+ this.textBox.focus();
61
+ }
62
+ }
63
+ handleFocusToggle(value) {
64
+ const {
65
+ needFieldStyle
66
+ } = this.props;
67
+ if (needFieldStyle) {
68
+ this.setState({
69
+ isFocused: value
70
+ });
71
+ }
72
+ }
73
+ handleFocus(e) {
74
+ const {
75
+ onFocus,
76
+ needFieldStyle
77
+ } = this.props;
78
+ needFieldStyle && this.handleFocusToggle(true);
79
+ onFocus && onFocus(e);
80
+ }
81
+ handleBlur(e) {
82
+ const {
83
+ onBlur,
84
+ needFieldStyle
85
+ } = this.props;
86
+ needFieldStyle && this.handleFocusToggle(false);
87
+ onBlur && onBlur(e);
88
+ }
47
89
  render() {
48
90
  let {
49
91
  labelName,
@@ -80,7 +122,8 @@ export default class TextBoxField extends PureComponent {
80
122
  ePhiData,
81
123
  children,
82
124
  customProps,
83
- renderLabelProps
125
+ renderLabelProps,
126
+ needFieldStyle
84
127
  } = this.props;
85
128
  const {
86
129
  LabelProps = {},
@@ -89,9 +132,17 @@ export default class TextBoxField extends PureComponent {
89
132
  ValidationMessageProps2 = {}
90
133
  } = customProps;
91
134
  let uniqueId = htmlId ? htmlId : this.getNextId();
92
- return /*#__PURE__*/React.createElement("div", {
93
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
94
- "data-title": isDisabled ? title : null
135
+ const {
136
+ isFocused
137
+ } = this.state;
138
+ return /*#__PURE__*/React.createElement(RippleEffect, {
139
+ hoverType: "bg",
140
+ isActive: isFocused,
141
+ isNeedEffect: !isReadOnly && !isDisabled && needFieldStyle ? true : false
142
+ }, /*#__PURE__*/React.createElement("div", {
143
+ className: `${style.container} ${needFieldStyle ? style.highlightSpace : ''} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
144
+ "data-title": isDisabled ? title : null,
145
+ onClick: this.handleParentClick
95
146
  }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
96
147
  infoText: infoText,
97
148
  isLocked: isLocked,
@@ -103,7 +154,7 @@ export default class TextBoxField extends PureComponent {
103
154
  text: labelName,
104
155
  size: fieldSize === 'small' ? 'small' : 'medium',
105
156
  palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
106
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
157
+ customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''} ${style.labelindex}`,
107
158
  htmlFor: uniqueId,
108
159
  dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
109
160
  }, LabelProps, {
@@ -122,11 +173,11 @@ export default class TextBoxField extends PureComponent {
122
173
  value: value,
123
174
  onChange: this.handleChange,
124
175
  dataId: dataId,
125
- onBlur: onBlur,
176
+ onBlur: this.handleBlur,
126
177
  onKeyDown: onKeyDown,
127
178
  placeHolder: placeHolder,
128
179
  borderColor: borderColor,
129
- onFocus: onFocus,
180
+ onFocus: this.handleFocus,
130
181
  isDisabled: isDisabled,
131
182
  needEffect: isReadOnly || isDisabled ? false : true,
132
183
  isClickable: isClickable,
@@ -147,7 +198,7 @@ export default class TextBoxField extends PureComponent {
147
198
  type: errorType,
148
199
  htmlFor: uniqueId,
149
200
  dataId: `${dataId}_ValidationRuleMessage`
150
- }, ValidationMessageProps2))));
201
+ }, ValidationMessageProps2)))));
151
202
  }
152
203
  }
153
204
  TextBoxField.propTypes = propTypes;
@@ -12,5 +12,6 @@ export const defaultProps = {
12
12
  isClickable: false,
13
13
  needReadOnlyStyle: true,
14
14
  customProps: {},
15
+ needFieldStyle: false,
15
16
  ...FieldCommonDefaultProps()
16
17
  };
@@ -10,6 +10,7 @@ import Textarea from '@zohodesk/components/lib/Textarea/Textarea';
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,13 @@ export default class TextareaField extends PureComponent {
21
22
  this.handleGetRef = this.handleGetRef.bind(this);
22
23
  // this.handleLabelClick = this.handleLabelClick.bind(this);
23
24
  this.getNextId = getUniqueId(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.state = {
30
+ isFocused: false
31
+ };
24
32
  }
25
33
  handleChange(value) {
26
34
  let {
@@ -29,13 +37,6 @@ export default class TextareaField extends PureComponent {
29
37
  } = this.props;
30
38
  onChange && onChange(id, value);
31
39
  }
32
- handleBlur(value) {
33
- let {
34
- id,
35
- onBlur
36
- } = this.props;
37
- onBlur && onBlur(id, value);
38
- }
39
40
  handleGetRef(el) {
40
41
  let {
41
42
  getRef,
@@ -44,6 +45,41 @@ export default class TextareaField extends PureComponent {
44
45
  this.textarea = el;
45
46
  getRef && getRef(el, id);
46
47
  }
48
+ handleParentClick() {
49
+ const {
50
+ needFieldStyle
51
+ } = this.props;
52
+ if (needFieldStyle) {
53
+ this.textarea.focus();
54
+ }
55
+ }
56
+ handleFocusToggle(value) {
57
+ const {
58
+ needFieldStyle
59
+ } = this.props;
60
+ if (needFieldStyle) {
61
+ this.setState({
62
+ isFocused: value
63
+ });
64
+ }
65
+ }
66
+ handleFocus(e) {
67
+ const {
68
+ onFocus,
69
+ needFieldStyle
70
+ } = this.props;
71
+ needFieldStyle && this.handleFocusToggle(true);
72
+ onFocus && onFocus(e);
73
+ }
74
+ handleBlur(value) {
75
+ let {
76
+ id,
77
+ onBlur,
78
+ needFieldStyle
79
+ } = this.props;
80
+ needFieldStyle && this.handleFocusToggle(false);
81
+ onBlur && onBlur(id, value);
82
+ }
47
83
 
48
84
  // handleLabelClick() {
49
85
  // let { isFocusOnLabelClick } = this.props;
@@ -82,7 +118,8 @@ export default class TextareaField extends PureComponent {
82
118
  lockedInfoText,
83
119
  isLocked,
84
120
  customProps,
85
- renderLabelProps
121
+ renderLabelProps,
122
+ needFieldStyle
86
123
  } = this.props;
87
124
  const {
88
125
  LabelProps = {},
@@ -91,9 +128,17 @@ export default class TextareaField extends PureComponent {
91
128
  ValidationMessageProps2 = {}
92
129
  } = customProps;
93
130
  let uniqueId = htmlId ? htmlId : this.getNextId();
94
- return /*#__PURE__*/React.createElement("div", {
95
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
96
- "data-title": isDisabled ? title : null
131
+ const {
132
+ isFocused
133
+ } = this.state;
134
+ return /*#__PURE__*/React.createElement(RippleEffect, {
135
+ hoverType: "bg",
136
+ isActive: isFocused,
137
+ isNeedEffect: needFieldStyle ? true : false
138
+ }, /*#__PURE__*/React.createElement("div", {
139
+ className: `${style.container} ${needFieldStyle ? style.highlightSpace : ''} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
140
+ "data-title": isDisabled ? title : null,
141
+ onClick: this.handleParentClick
97
142
  }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
98
143
  infoText: infoText,
99
144
  isLocked: isLocked,
@@ -122,6 +167,7 @@ export default class TextareaField extends PureComponent {
122
167
  placeHolder: placeHolder,
123
168
  dataId: `property(${dataId})`,
124
169
  onBlur: this.handleBlur,
170
+ onFocus: this.handleFocus,
125
171
  borderColor: borderColor,
126
172
  needEffect: isReadOnly || isDisabled ? false : true,
127
173
  resize: "vertical"
@@ -144,7 +190,7 @@ export default class TextareaField extends PureComponent {
144
190
  type: errorType,
145
191
  htmlFor: uniqueId,
146
192
  dataId: `${dataId}_ValidationRuleMessage`
147
- }, ValidationMessageProps2))));
193
+ }, ValidationMessageProps2)))));
148
194
  }
149
195
  }
150
196
  TextareaField.propTypes = propTypes;
@@ -10,5 +10,6 @@ export const defaultProps = {
10
10
  labelPalette: 'default',
11
11
  labelCustomClass: '',
12
12
  customProps: {},
13
+ // needFieldStyle:true,
13
14
  ...FieldCommonDefaultProps()
14
15
  };
@@ -16,7 +16,8 @@ export default class DeleteComponent extends React.Component {
16
16
  onClick: onClick,
17
17
  className: `${style.iconStyle} ${style.redHover} ${className ? className : ''}`,
18
18
  "data-id": dataId,
19
- "data-title": dataTitle
19
+ "data-title": dataTitle,
20
+ tabIndex: 0
20
21
  }, /*#__PURE__*/React.createElement(Icon, {
21
22
  name: "ZD-GN-delete",
22
23
  iconClass: iconClass ? iconClass : '',
@@ -2,7 +2,6 @@ import React, { Component } from 'react';
2
2
  import { SmartIcon_propTypes } from './props/propTypes';
3
3
  import style from './Icons.module.css';
4
4
  import Icon from '@zohodesk/icons/lib/Icon';
5
- import btnStyle from '@zohodesk/components/lib/semantic/Button/semanticButton.module.css';
6
5
  export default class SmartIcon extends Component {
7
6
  render() {
8
7
  let {