@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
package/README.md CHANGED
@@ -1,6 +1,21 @@
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
7
+
8
+ - `Accesssility`- Screen Reader fix.
9
+
10
+ # 1.0.0-beta.241
11
+
12
+ - **Drawer, Lookup** - Focus scope navigation support.
13
+
14
+ # 1.0.0-beta.240
15
+
16
+ - `Accesssility`- Screen Reader support for some components.
17
+
18
+ - **CustomResponsive** - performance issue fix.
4
19
 
5
20
  # 1.0.0-beta.239
6
21
 
@@ -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,8 +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 : ''}`,
101
- dataId: arrowBoxDataId
103
+ className: `${btnStyle.buttonReset} ${style[arrowBoxSize + '_arrowBox']} ${style[palette + 'Arw']} ${style.arrowWrapper} ${isPopupOpen ? style.arrowActive : ''}`,
104
+ dataId: arrowBoxDataId,
105
+ tabIndex: "0",
106
+ tagName: "button"
102
107
  }, /*#__PURE__*/React.createElement(Container, {
103
108
  align: "both"
104
109
  }, /*#__PURE__*/React.createElement(Icon, {
@@ -116,7 +121,9 @@ export class ActionButton extends React.Component {
116
121
  },
117
122
  isBoxPaddingNeed: isBoxPaddingNeed,
118
123
  getRef: getContainerRef,
119
- popupGroup: popupGroup
124
+ popupGroup: popupGroup,
125
+ needFocusScope: true,
126
+ onClose: this.handleTogglePopup
120
127
  }, /*#__PURE__*/React.createElement(Box, {
121
128
  flexible: true,
122
129
  shrink: true,
@@ -12,6 +12,7 @@ import IconButton from '../IconButton/IconButton';
12
12
  import Icon from '@zohodesk/icons/lib/Icon';
13
13
  import { getZIndex } from '@zohodesk/components/lib/Provider/ZindexProvider';
14
14
  import style from './Drawer.module.css';
15
+ import FocusScope from "@zohodesk/a11y/es/FocusScope/FocusScope";
15
16
  export class Header extends React.Component {
16
17
  render() {
17
18
  let {
@@ -134,6 +135,7 @@ export default class Drawer extends React.Component {
134
135
  this.drawers = this.drawers.bind(this);
135
136
  this.responsiveFunc = this.responsiveFunc.bind(this);
136
137
  this.getNextIndex = getZIndex(this);
138
+ this.createRef = /*#__PURE__*/React.createRef();
137
139
  }
138
140
  drawers(uptoTablet, styleByResolutions) {
139
141
  let {
@@ -142,7 +144,9 @@ export default class Drawer extends React.Component {
142
144
  paddingSize,
143
145
  subDrawerActive,
144
146
  subDrawerChildren,
145
- onBodyClick
147
+ onBodyClick,
148
+ onClose,
149
+ needFocusScope
146
150
  } = this.props;
147
151
  let childrenWithProps = React.Children.map(children, child => {
148
152
  if (child.type === Header || child.type === Footer || child.type === Content) {
@@ -155,6 +159,17 @@ export default class Drawer extends React.Component {
155
159
  }
156
160
  return child;
157
161
  });
162
+ let content = /*#__PURE__*/React.createElement(Box, {
163
+ className: `${style.container} ${style.columns} ${style.drawerModal} ${uptoTablet ? style.mbleSize : style[size]}`,
164
+ "data-a11y-container-focus": false,
165
+ tabindex: -1,
166
+ eleRef: this.createRef
167
+ }, /*#__PURE__*/React.createElement(Card, {
168
+ onClick: e => {
169
+ e && e.stopPropagation && e.stopPropagation();
170
+ onBodyClick(e);
171
+ }
172
+ }, childrenWithProps));
158
173
  return /*#__PURE__*/React.createElement(React.Fragment, null, subDrawerChildren ? /*#__PURE__*/React.createElement(Box, {
159
174
  className: style.columns
160
175
  }, /*#__PURE__*/React.createElement(VelocityAnimationGroup, {
@@ -167,14 +182,13 @@ export default class Drawer extends React.Component {
167
182
  }
168
183
  }, /*#__PURE__*/React.createElement(Box, {
169
184
  flexible: true
170
- }, subDrawerChildren))))) : null, /*#__PURE__*/React.createElement(Box, {
171
- className: `${style.container} ${style.columns} ${style.drawerModal} ${uptoTablet ? style.mbleSize : style[size]}`
172
- }, /*#__PURE__*/React.createElement(Card, {
173
- onClick: e => {
174
- e && e.stopPropagation && e.stopPropagation();
175
- onBodyClick(e);
176
- }
177
- }, childrenWithProps)));
185
+ }, subDrawerChildren))))) : null, needFocusScope ? /*#__PURE__*/React.createElement(FocusScope, {
186
+ elementRef: this.createRef,
187
+ autoFocus: true,
188
+ focusTabLoop: true,
189
+ restoreFocus: true,
190
+ focusClose: onClose
191
+ }, content) : content);
178
192
  }
179
193
  responsiveFunc(_ref) {
180
194
  let {
@@ -148,4 +148,4 @@
148
148
  }
149
149
  [dir=rtl] .iconWrapper {
150
150
  margin-left: var(--zd_size10);
151
- }
151
+ }
@@ -16,5 +16,6 @@ export const Drawer_defaultProps = {
16
16
  subDrawerClass: '',
17
17
  customClass: '',
18
18
  needAutoZindex: true,
19
- onBodyClick: () => {}
19
+ onBodyClick: () => {},
20
+ needFocusScope: false
20
21
  };
@@ -45,5 +45,6 @@ export const Drawer_propTypes = {
45
45
  subDrawerActive: PropTypes.bool,
46
46
  subDrawerChildren: PropTypes.func,
47
47
  subDrawerClass: PropTypes.string,
48
- subDrawerSize: PropTypes.oneOf(['xsmall', 'small', 'medium'])
48
+ subDrawerSize: PropTypes.oneOf(['xsmall', 'small', 'medium']),
49
+ needFocusScope: PropTypes.bool
49
50
  };
@@ -14,56 +14,6 @@ import FormAction from '../../FormAction/FormAction';
14
14
  /**** CSS ****/
15
15
  import style from './AlertLookup.module.css';
16
16
  export default class AlertLookup extends Component {
17
- constructor(props) {
18
- super(props);
19
- this.documentKeydownHandler = this.documentKeydownHandler.bind(this);
20
- this.getButtonRef = this.getButtonRef.bind(this);
21
- }
22
- componentDidMount() {
23
- let {
24
- isActive
25
- } = this.props;
26
- if (isActive) {
27
- document.addEventListener('keydown', this.documentKeydownHandler);
28
- }
29
- }
30
- componentDidUpdate(prevProps) {
31
- let {
32
- isActive
33
- } = this.props;
34
- if (prevProps.isActive !== isActive) {
35
- isActive ? document.addEventListener('keydown', this.documentKeydownHandler) : document.removeEventListener('keydown', this.documentKeydownHandler);
36
- }
37
- }
38
- componentWillUnmount() {
39
- document.removeEventListener('keydown', this.documentKeydownHandler);
40
- }
41
- documentKeydownHandler() {
42
- let e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
43
- let {
44
- onSubmitClick,
45
- onCancelClick,
46
- isActive,
47
- onEsc,
48
- onClose
49
- } = this.props;
50
- if (e.keyCode === 27 && isActive) {
51
- e && e.preventDefault && e.preventDefault();
52
- onEsc == 'close' ? onClose && onClose(e) : onCancelClick && onCancelClick(e);
53
- } else if (e.keyCode === 13 && isActive) {
54
- e && e.preventDefault && e.preventDefault();
55
- onSubmitClick && onSubmitClick(e);
56
- }
57
- }
58
- getButtonRef(el) {
59
- this.okButton = el;
60
- let {
61
- isDefaultFocus
62
- } = this.props;
63
- if (isDefaultFocus) {
64
- el && el.focus();
65
- }
66
- }
67
17
  render() {
68
18
  let {
69
19
  isActive,
@@ -91,7 +41,8 @@ export default class AlertLookup extends Component {
91
41
  iconClass,
92
42
  iconSize,
93
43
  customProps,
94
- isHtmlContent
44
+ isHtmlContent,
45
+ onEsc
95
46
  } = this.props;
96
47
  const {
97
48
  LookupProps = {},
@@ -100,6 +51,8 @@ export default class AlertLookup extends Component {
100
51
  SecondaryButtonProps = {}
101
52
  } = customProps;
102
53
  return /*#__PURE__*/React.createElement(Lookup, _extends({
54
+ needFocusScope: true,
55
+ onClose: onEsc == 'close' ? onClose : onCancelClick,
103
56
  isActive: isActive,
104
57
  size: size,
105
58
  dataId: dataId,
@@ -134,8 +87,7 @@ export default class AlertLookup extends Component {
134
87
  text: submitText,
135
88
  dataId: dataId === 'alertPopup' ? 'alertConfirmButton' : `${dataId}_confirmButton`,
136
89
  onClick: onSubmitClick,
137
- palette: palette === 'primary' ? 'primaryFilled' : 'dangerFilled',
138
- getRef: this.getButtonRef
90
+ palette: palette === 'primary' ? 'primaryFilled' : 'dangerFilled'
139
91
  }, PrimaryButtonProps)), cancelText && /*#__PURE__*/React.createElement(Button, _extends({
140
92
  dataId: dataId === 'alertPopup' ? 'alertCancelButton' : `${dataId}_cancelButton`,
141
93
  text: cancelText,
@@ -328,20 +328,22 @@ export class ToggleDropDown extends Component {
328
328
  }
329
329
  break;
330
330
  case 13:
331
- const selectedId = optionsArr[selectedIndex][idName] || '';
332
- onClick && onClick(selectedId, optionsArr[selectedIndex]);
333
- if (!preventPopupClose) {
334
- togglePopup(e, boxPosition);
335
- } else if (isSearch) {
336
- this.searchInput.focus({
337
- preventScroll: true
338
- });
339
- } else {
340
- this.hiddenInput.focus({
341
- preventScroll: true
342
- });
331
+ {
332
+ const selectedId = optionsArr[selectedIndex][idName] || '';
333
+ onClick && onClick(selectedId, optionsArr[selectedIndex]);
334
+ if (!preventPopupClose) {
335
+ togglePopup(e, boxPosition);
336
+ } else if (isSearch) {
337
+ this.searchInput.focus({
338
+ preventScroll: true
339
+ });
340
+ } else {
341
+ this.hiddenInput.focus({
342
+ preventScroll: true
343
+ });
344
+ }
345
+ break;
343
346
  }
344
- break;
345
347
  }
346
348
  } else {
347
349
  if (keyCode === 13 || keyCode === 40) {
@@ -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
- return /*#__PURE__*/React.createElement("div", {
114
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
115
- "data-title": isDisabled ? title : null
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;
@@ -11,6 +11,7 @@ export const defaultProps = {
11
11
  isClickable: false,
12
12
  needReadOnlyStyle: true,
13
13
  customProps: {},
14
+ // needFieldStyle:true,
14
15
  formatCurrency: () => {},
15
16
  ...FieldCommonDefaultProps()
16
17
  };
@@ -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
- return /*#__PURE__*/React.createElement("div", {
116
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
117
- "data-title": isDisabled ? title : null
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;
@@ -14,5 +14,6 @@ export const defaultProps = {
14
14
  i18nKeys: {},
15
15
  dataId: 'dateField',
16
16
  customProps: {},
17
+ // needFieldStyle:true,
17
18
  ...FieldCommonDefaultProps()
18
19
  };
@@ -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 */