@zohodesk/dot 1.0.0-temp-175.6 → 1.0.0-temp-181

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 (237) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +30 -0
  3. package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +0 -1
  4. package/assets/Appearance/light/mode/Dot_LightMode.module.css +0 -1
  5. package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +0 -1
  6. package/coverage/ExternalLink/ExternalLink.js.html +1 -1
  7. package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
  8. package/coverage/ExternalLink/index.html +1 -1
  9. package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
  10. package/coverage/ExternalLink/props/index.html +1 -1
  11. package/coverage/ExternalLink/props/propTypes.js.html +1 -1
  12. package/coverage/IconButton/IconButton.js.html +7 -7
  13. package/coverage/IconButton/IconButton.module.css.html +1 -1
  14. package/coverage/IconButton/index.html +11 -11
  15. package/coverage/IconButton/props/defaultProps.js.html +1 -1
  16. package/coverage/IconButton/props/index.html +1 -1
  17. package/coverage/IconButton/props/propTypes.js.html +1 -1
  18. package/coverage/Image/Image.js.html +1 -1
  19. package/coverage/Image/Image.module.css.html +1 -1
  20. package/coverage/Image/index.html +1 -1
  21. package/coverage/Image/props/defaultProps.js.html +1 -1
  22. package/coverage/Image/props/index.html +1 -1
  23. package/coverage/Image/props/propTypes.js.html +1 -1
  24. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  25. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  26. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  27. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  28. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  29. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  30. package/coverage/coverage-final.json +16 -16
  31. package/coverage/coverage-summary.json +17 -17
  32. package/coverage/index.html +11 -11
  33. package/es/Drawer/Drawer.js +6 -3
  34. package/es/Drawer/props/defaultProps.js +2 -1
  35. package/es/Drawer/props/propTypes.js +2 -1
  36. package/es/Hooks/Dragger/useDragger.js +4 -3
  37. package/es/IconButton/IconButton.js +2 -2
  38. package/es/NewStar/NewStar.module.css +128 -67
  39. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +4 -0
  40. package/es/form/fields/TextEditor/TextEditor.module.css +63 -47
  41. package/es/list/status/StatusDropdown/StatusDropdown.js +2 -1
  42. package/es/list/status/StatusListItem/StatusListItem.js +12 -5
  43. package/es/list/status/StatusListItem/props/defaultProps.js +2 -1
  44. package/es/list/status/StatusListItem/props/propTypes.js +3 -1
  45. package/es/lookup/Lookup/Lookup.js +6 -3
  46. package/es/v1/DotWrapper/DotWrapper.js +28 -0
  47. package/es/v1/DotWrapper/libraryChunks/appearance/component/DarkMode_Component.js +1 -0
  48. package/es/v1/DotWrapper/libraryChunks/appearance/component/LightMode_Component.js +1 -0
  49. package/es/v1/DotWrapper/libraryChunks/appearance/component/PureDarkMode_Component.js +1 -0
  50. package/es/v1/DotWrapper/libraryChunks/appearance/dot/DarkMode_Dot.js +1 -0
  51. package/es/v1/DotWrapper/libraryChunks/appearance/dot/LightMode_Dot.js +1 -0
  52. package/es/v1/DotWrapper/libraryChunks/appearance/dot/PureDarkMode_Dot.js +1 -0
  53. package/es/v1/DotWrapper/libraryChunks/appearance/svg/DarkMode_SVG.js +1 -0
  54. package/es/v1/DotWrapper/libraryChunks/appearance/svg/LightMode_SVG.js +1 -0
  55. package/es/v1/DotWrapper/libraryChunks/appearance/svg/PureDarkMode_SVG.js +1 -0
  56. package/es/v1/DotWrapper/libraryChunks/dynamicImports.js +19 -0
  57. package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Dark_Component.js +3 -0
  58. package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Light_Component.js +3 -0
  59. package/es/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +3 -0
  60. package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_Dark_Component.js +3 -0
  61. package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_Light_Component.js +3 -0
  62. package/es/v1/DotWrapper/libraryChunks/themes/component/green/Green_PureDark_Component.js +3 -0
  63. package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Dark_Component.js +3 -0
  64. package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Light_Component.js +3 -0
  65. package/es/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +3 -0
  66. package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_Dark_Component.js +3 -0
  67. package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_Light_Component.js +3 -0
  68. package/es/v1/DotWrapper/libraryChunks/themes/component/red/Red_PureDark_Component.js +3 -0
  69. package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +3 -0
  70. package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +3 -0
  71. package/es/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +3 -0
  72. package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +1 -0
  73. package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +1 -0
  74. package/es/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +1 -0
  75. package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Dark_Dot.js +1 -0
  76. package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Light_Dot.js +1 -0
  77. package/es/v1/DotWrapper/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +1 -0
  78. package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +1 -0
  79. package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +1 -0
  80. package/es/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +1 -0
  81. package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Dark_Dot.js +1 -0
  82. package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Light_Dot.js +1 -0
  83. package/es/v1/DotWrapper/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +1 -0
  84. package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +1 -0
  85. package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +1 -0
  86. package/es/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +1 -0
  87. package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +1 -0
  88. package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +1 -0
  89. package/es/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +1 -0
  90. package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Dark_SVG.js +1 -0
  91. package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Light_SVG.js +1 -0
  92. package/es/v1/DotWrapper/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +1 -0
  93. package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +1 -0
  94. package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +1 -0
  95. package/es/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +1 -0
  96. package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Dark_SVG.js +1 -0
  97. package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Light_SVG.js +1 -0
  98. package/es/v1/DotWrapper/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +1 -0
  99. package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +1 -0
  100. package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +1 -0
  101. package/es/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +1 -0
  102. package/es/v1/DotWrapper/props/defaultProps.js +7 -0
  103. package/es/v1/DotWrapper/props/propTypes.js +8 -0
  104. package/es/v1/DotWrapper/utils/appearanceProperties.js +46 -0
  105. package/es/v1/DotWrapper/utils/errorMessage.js +7 -0
  106. package/es/v1/DotWrapper/utils/importFiles.js +18 -0
  107. package/es/v1/DotWrapper/utils/themeProperties.js +220 -0
  108. package/es/v1/Drawer/Drawer.js +6 -3
  109. package/es/v1/Drawer/props/defaultProps.js +2 -1
  110. package/es/v1/Drawer/props/propTypes.js +2 -1
  111. package/es/v1/GlobalNotification/GlobalNotification.js +51 -19
  112. package/es/v1/GlobalNotification/props/defaultProps.js +3 -1
  113. package/es/v1/GlobalNotification/props/propTypes.js +12 -2
  114. package/es/v1/IconButton/IconButton.js +2 -2
  115. package/es/v1/form/fields/SelectField/SelectField.js +1 -9
  116. package/es/v1/form/fields/TextBoxField/TextBoxField.js +122 -142
  117. package/es/v1/form/fields/TextEditorField/TextEditorField.js +133 -153
  118. package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +137 -178
  119. package/es/v1/form/fields/TextareaField/TextareaField.js +113 -137
  120. package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +43 -43
  121. package/es/v1/form/layout/Field/Field.js +24 -28
  122. package/es/v1/form/layout/Section/Section.js +25 -33
  123. package/es/v1/form/layout/Section/props/propTypes.js +0 -1
  124. package/es/v1/list/Subject/Subject.js +39 -48
  125. package/es/v1/list/TagNew/TagNew.js +18 -27
  126. package/es/v1/list/Thread/Thread.js +26 -35
  127. package/es/v1/list/status/StatusDropdown/StatusDropdown.js +2 -1
  128. package/es/v1/list/status/StatusListItem/StatusListItem.js +12 -5
  129. package/es/v1/list/status/StatusListItem/props/defaultProps.js +2 -1
  130. package/es/v1/list/status/StatusListItem/props/propTypes.js +3 -1
  131. package/es/v1/lookup/Lookup/Lookup.js +6 -3
  132. package/es/version2/GlobalNotification/GlobalNotification.module.css +1 -2
  133. package/lib/Drawer/Drawer.js +6 -3
  134. package/lib/Drawer/props/defaultProps.js +2 -1
  135. package/lib/Drawer/props/propTypes.js +2 -1
  136. package/lib/Hooks/Dragger/useDragger.js +4 -3
  137. package/lib/IconButton/IconButton.js +2 -2
  138. package/lib/NewStar/NewStar.module.css +128 -67
  139. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +4 -0
  140. package/lib/form/fields/TextEditor/TextEditor.module.css +63 -47
  141. package/lib/list/status/StatusDropdown/StatusDropdown.js +2 -1
  142. package/lib/list/status/StatusListItem/StatusListItem.js +12 -5
  143. package/lib/list/status/StatusListItem/props/defaultProps.js +2 -1
  144. package/lib/list/status/StatusListItem/props/propTypes.js +3 -1
  145. package/lib/lookup/Lookup/Lookup.js +14 -3
  146. package/lib/v1/DotWrapper/DotWrapper.js +41 -0
  147. package/lib/v1/DotWrapper/libraryChunks/appearance/component/DarkMode_Component.js +3 -0
  148. package/lib/v1/DotWrapper/libraryChunks/appearance/component/LightMode_Component.js +3 -0
  149. package/lib/v1/DotWrapper/libraryChunks/appearance/component/PureDarkMode_Component.js +3 -0
  150. package/lib/v1/DotWrapper/libraryChunks/appearance/dot/DarkMode_Dot.js +3 -0
  151. package/lib/v1/DotWrapper/libraryChunks/appearance/dot/LightMode_Dot.js +3 -0
  152. package/lib/v1/DotWrapper/libraryChunks/appearance/dot/PureDarkMode_Dot.js +3 -0
  153. package/lib/v1/DotWrapper/libraryChunks/appearance/svg/DarkMode_SVG.js +3 -0
  154. package/lib/v1/DotWrapper/libraryChunks/appearance/svg/LightMode_SVG.js +3 -0
  155. package/lib/v1/DotWrapper/libraryChunks/appearance/svg/PureDarkMode_SVG.js +3 -0
  156. package/lib/v1/DotWrapper/libraryChunks/dynamicImports.js +33 -0
  157. package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Dark_Component.js +7 -0
  158. package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_Light_Component.js +7 -0
  159. package/lib/v1/DotWrapper/libraryChunks/themes/component/blue/Blue_PureDark_Component.js +7 -0
  160. package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_Dark_Component.js +7 -0
  161. package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_Light_Component.js +7 -0
  162. package/lib/v1/DotWrapper/libraryChunks/themes/component/green/Green_PureDark_Component.js +7 -0
  163. package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Dark_Component.js +7 -0
  164. package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_Light_Component.js +7 -0
  165. package/lib/v1/DotWrapper/libraryChunks/themes/component/orange/Orange_PureDark_Component.js +7 -0
  166. package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_Dark_Component.js +7 -0
  167. package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_Light_Component.js +7 -0
  168. package/lib/v1/DotWrapper/libraryChunks/themes/component/red/Red_PureDark_Component.js +7 -0
  169. package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Dark_Component.js +7 -0
  170. package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_Light_Component.js +7 -0
  171. package/lib/v1/DotWrapper/libraryChunks/themes/component/yellow/Yellow_PureDark_Component.js +7 -0
  172. package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Dark_Dot.js +3 -0
  173. package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_Light_Dot.js +3 -0
  174. package/lib/v1/DotWrapper/libraryChunks/themes/dot/blue/Blue_PureDark_Dot.js +3 -0
  175. package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Dark_Dot.js +3 -0
  176. package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_Light_Dot.js +3 -0
  177. package/lib/v1/DotWrapper/libraryChunks/themes/dot/green/Green_PureDark_Dot.js +3 -0
  178. package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Dark_Dot.js +3 -0
  179. package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_Light_Dot.js +3 -0
  180. package/lib/v1/DotWrapper/libraryChunks/themes/dot/orange/Orange_PureDark_Dot.js +3 -0
  181. package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Dark_Dot.js +3 -0
  182. package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_Light_Dot.js +3 -0
  183. package/lib/v1/DotWrapper/libraryChunks/themes/dot/red/Red_PureDark_Dot.js +3 -0
  184. package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Dark_Dot.js +3 -0
  185. package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_Light_Dot.js +3 -0
  186. package/lib/v1/DotWrapper/libraryChunks/themes/dot/yellow/Yellow_PureDark_Dot.js +3 -0
  187. package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Dark_SVG.js +3 -0
  188. package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_Light_SVG.js +3 -0
  189. package/lib/v1/DotWrapper/libraryChunks/themes/svg/blue/Blue_PureDark_SVG.js +3 -0
  190. package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Dark_SVG.js +3 -0
  191. package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_Light_SVG.js +3 -0
  192. package/lib/v1/DotWrapper/libraryChunks/themes/svg/green/Green_PureDark_SVG.js +3 -0
  193. package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Dark_SVG.js +3 -0
  194. package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_Light_SVG.js +3 -0
  195. package/lib/v1/DotWrapper/libraryChunks/themes/svg/orange/Orange_PureDark_SVG.js +3 -0
  196. package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Dark_SVG.js +3 -0
  197. package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_Light_SVG.js +3 -0
  198. package/lib/v1/DotWrapper/libraryChunks/themes/svg/red/Red_PureDark_SVG.js +3 -0
  199. package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Dark_SVG.js +3 -0
  200. package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_Light_SVG.js +3 -0
  201. package/lib/v1/DotWrapper/libraryChunks/themes/svg/yellow/Yellow_PureDark_SVG.js +3 -0
  202. package/lib/v1/DotWrapper/props/defaultProps.js +14 -0
  203. package/lib/v1/DotWrapper/props/propTypes.js +19 -0
  204. package/lib/v1/DotWrapper/utils/appearanceProperties.js +79 -0
  205. package/lib/v1/DotWrapper/utils/errorMessage.js +14 -0
  206. package/lib/v1/DotWrapper/utils/importFiles.js +25 -0
  207. package/lib/v1/DotWrapper/utils/themeProperties.js +325 -0
  208. package/lib/v1/Drawer/Drawer.js +6 -3
  209. package/lib/v1/Drawer/props/defaultProps.js +2 -1
  210. package/lib/v1/Drawer/props/propTypes.js +2 -1
  211. package/lib/v1/GlobalNotification/GlobalNotification.js +66 -17
  212. package/lib/v1/GlobalNotification/props/defaultProps.js +3 -1
  213. package/lib/v1/GlobalNotification/props/propTypes.js +17 -4
  214. package/lib/v1/IconButton/IconButton.js +2 -2
  215. package/lib/v1/form/fields/SelectField/SelectField.js +1 -7
  216. package/lib/v1/form/fields/TextBoxField/TextBoxField.js +125 -181
  217. package/lib/v1/form/fields/TextEditorField/TextEditorField.js +138 -193
  218. package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +160 -212
  219. package/lib/v1/form/fields/TextareaField/TextareaField.js +117 -177
  220. package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +41 -80
  221. package/lib/v1/form/layout/Field/Field.js +22 -69
  222. package/lib/v1/form/layout/Section/Section.js +27 -72
  223. package/lib/v1/form/layout/Section/props/propTypes.js +0 -1
  224. package/lib/v1/list/Subject/Subject.js +39 -87
  225. package/lib/v1/list/TagNew/TagNew.js +18 -66
  226. package/lib/v1/list/Thread/Thread.js +25 -73
  227. package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +2 -1
  228. package/lib/v1/list/status/StatusListItem/StatusListItem.js +12 -5
  229. package/lib/v1/list/status/StatusListItem/props/defaultProps.js +2 -1
  230. package/lib/v1/list/status/StatusListItem/props/propTypes.js +3 -1
  231. package/lib/v1/lookup/Lookup/Lookup.js +11 -6
  232. package/lib/version2/GlobalNotification/GlobalNotification.module.css +1 -2
  233. package/package.json +13 -13
  234. package/prePublish.js +0 -69
  235. package/react-cli.config.js +6 -1
  236. package/result.json +1 -1
  237. package/unittest/index.html +1 -1
@@ -7,28 +7,50 @@ import AutoClose from '../../actions/AutoClose';
7
7
  import AlertIcons from '../alert/alertIcons/AlertIcons';
8
8
  import AlertClose from '../alert/AlertClose/AlertClose';
9
9
  import { Container, Box } from '@zohodesk/components/es/v1/Layout';
10
+ import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
10
11
  import style from '../../version2/GlobalNotification/GlobalNotification.module.css';
11
12
  export default function GlobalNotification(props) {
12
13
  let {
13
14
  type,
14
15
  message,
15
16
  hideMessage,
17
+ hideTime,
16
18
  onClick,
19
+ onClose,
20
+ needAutoClose,
17
21
  i18nKeys = {},
18
22
  customProps,
19
23
  dataSelectorId,
20
- showMessage
24
+ id,
25
+ needShadow,
26
+ shadowCount,
27
+ eleRef
21
28
  } = props;
29
+ const hideMessageTimer = useRef(null);
30
+ const [shadowClose, setShadowClose] = useState(true);
22
31
  useEffect(() => {
23
- if (!['danger', 'error', 'warning'].includes(type)) {
24
- setTimeout(() => {
25
- hideMessage();
26
- }, 3000);
32
+ if (needAutoClose) {
33
+ hideMessageTimer.current = setTimeout(() => {
34
+ hideMessage(id);
35
+ }, hideTime);
27
36
  }
28
- }, [showMessage, type]);
37
+
38
+ return () => {
39
+ if (hideMessageTimer.current) {
40
+ clearTimeout(hideMessageTimer.current);
41
+ }
42
+ };
43
+ }, []);
29
44
  let {
30
45
  closeTitle = 'Close'
31
46
  } = i18nKeys;
47
+
48
+ function onCloseLocal(e) {
49
+ setShadowClose(false);
50
+ hideMessage && hideMessage(id);
51
+ onClose && onClose(e);
52
+ }
53
+
32
54
  return /*#__PURE__*/React.createElement(GlobalNotificationUI, {
33
55
  type: type,
34
56
  message: message,
@@ -36,7 +58,12 @@ export default function GlobalNotification(props) {
36
58
  onClick: onClick,
37
59
  closeTitle: closeTitle,
38
60
  customProps: customProps,
39
- dataSelectorId: dataSelectorId
61
+ dataSelectorId: dataSelectorId,
62
+ id: id,
63
+ shadowCount: shadowCount,
64
+ onClose: onCloseLocal,
65
+ needShadow: shadowClose && needShadow,
66
+ eleRef: eleRef
40
67
  });
41
68
  }
42
69
  GlobalNotification.propTypes = propTypes;
@@ -48,28 +75,33 @@ GlobalNotification.defaultProps = defaultProps; // if (__DOCS__) {
48
75
  // }
49
76
 
50
77
  export function GlobalNotificationUI(props) {
51
- function onClose(e) {
52
- let {
53
- hideMessage,
54
- onClose
55
- } = props;
56
- hideMessage && hideMessage(e);
57
- onClose && onClose(e);
58
- }
59
-
60
78
  let {
61
79
  type = '',
62
80
  message,
63
81
  onClick,
64
82
  closeTitle = '',
65
83
  customProps = {},
66
- dataSelectorId
84
+ dataSelectorId,
85
+ shadowCount,
86
+ needShadow,
87
+ eleRef,
88
+ onClose
67
89
  } = props;
68
90
  let {
69
91
  ExtraProps = {}
70
92
  } = customProps;
93
+
94
+ function onCloseLocal(e) {
95
+ cancelBubblingEffect(e);
96
+ onClose && onClose(e);
97
+ }
98
+
71
99
  return /*#__PURE__*/React.createElement("div", _extends({
72
- className: `${style.message} ${type ? style[type] : ''}`,
100
+ ref: eleRef,
101
+ className: ` ${style.message}
102
+ ${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
103
+ ${type ? style[type] : ''}
104
+ `,
73
105
  "data-id": `show_${type}_message`,
74
106
  "data-test-id": `show_${type}_message`,
75
107
  tabIndex: 0,
@@ -100,7 +132,7 @@ export function GlobalNotificationUI(props) {
100
132
  }, /*#__PURE__*/React.createElement(AlertClose, {
101
133
  dataId: `close_${type}_message`,
102
134
  dataTitle: closeTitle,
103
- onClose: onClose,
135
+ onClose: onCloseLocal,
104
136
  type: type
105
137
  }))));
106
138
  }
@@ -1,4 +1,6 @@
1
1
  export const defaultProps = {
2
2
  customProps: {},
3
- dataSelectorId: 'globalNotification'
3
+ dataSelectorId: 'globalNotification',
4
+ needAutoClose: true,
5
+ hideTime: 3000
4
6
  };
@@ -9,7 +9,13 @@ export const propTypes = {
9
9
  i18nKeys: PropTypes.object,
10
10
  customProps: PropTypes.shape({
11
11
  ExtraProps: PropTypes.object
12
- })
12
+ }),
13
+ id: PropTypes.number,
14
+ hideTime: PropTypes.number,
15
+ needAutoClose: PropTypes.bool,
16
+ isCollapseView: PropTypes.bool,
17
+ shadowCount: PropTypes.number,
18
+ needShadow: PropTypes.bool
13
19
  };
14
20
  export const UI_propTypes = {
15
21
  dataSelectorId: PropTypes.string,
@@ -21,7 +27,11 @@ export const UI_propTypes = {
21
27
  type: PropTypes.oneOf(['success', 'danger', 'info', 'warning', 'error']),
22
28
  customProps: PropTypes.shape({
23
29
  ExtraProps: PropTypes.object
24
- })
30
+ }),
31
+ needShadow: PropTypes.bool,
32
+ shadowCount: PropTypes.number,
33
+ id: PropTypes.number,
34
+ onClose: PropTypes.func
25
35
  };
26
36
  export const new_propTypes = {
27
37
  Element: PropTypes.element,
@@ -38,8 +38,8 @@ export default function IconButton(props) {
38
38
 
39
39
  function handleToggle(e) {
40
40
  if (e.key === ' ' || e.key === 'Enter' || e.key === 'Spacebar') {
41
- e.preventDefault();
42
- triggerClick(e);
41
+ e.preventDefault(); // triggerClick(e);
42
+
43
43
  triggerMouseDown(e);
44
44
  }
45
45
  }
@@ -11,8 +11,6 @@ import Select from '@zohodesk/components/es/v1/Select/Select';
11
11
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
12
12
  import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
13
13
  import FieldContainer from '../FieldContainer/FieldContainer';
14
- /**** props ****/
15
-
16
14
  /** CSS */
17
15
 
18
16
  import style from '../../../../form/fields/Fields.module.css';
@@ -84,13 +82,7 @@ const SelectField = props => {
84
82
 
85
83
  const handleGetRef = el => {
86
84
  getRef && getRef(el, id);
87
- }; // handleLabelClick() {
88
- // let { isFocusOnLabelClick } = this.props;
89
- // if (isFocusOnLabelClick && this.selectBox && this.selectBox.focus) {
90
- // this.selectBox.focus();
91
- // }
92
- // }
93
-
85
+ };
94
86
 
95
87
  return /*#__PURE__*/React.createElement("div", {
96
88
  className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
@@ -1,7 +1,7 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
3
  /**** Libraries ****/
4
- import React, { PureComponent } from 'react';
4
+ import React, { memo } from 'react';
5
5
  import { defaultProps } from './props/defaultProps';
6
6
  import { propTypes } from './props/propTypes';
7
7
  /**** Components ****/
@@ -9,156 +9,136 @@ import { propTypes } from './props/propTypes';
9
9
  import Label from '@zohodesk/components/es/v1/Label/Label';
10
10
  import TextBoxIcon from '@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon';
11
11
  import ValidationMessage from '../ValidationMessage/ValidationMessage';
12
- import { getUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
12
+ import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
13
13
  import FieldContainer from '../FieldContainer/FieldContainer';
14
14
  /**** CSS ****/
15
15
 
16
16
  import style from '../../../../form/fields/Fields.module.css';
17
- export default class TextBoxField extends PureComponent {
18
- constructor(props) {
19
- super(props);
20
- this.handleChange = this.handleChange.bind(this);
21
- this.handleGetRef = this.handleGetRef.bind(this); // this.handleLabelClick = this.handleLabelClick.bind(this);
22
17
 
23
- this.getNextId = getUniqueId(this);
24
- }
18
+ const TextBoxField = props => {
19
+ const {
20
+ labelName,
21
+ id,
22
+ textBoxSize,
23
+ textBoxVariant,
24
+ textBoxType,
25
+ isMandatory,
26
+ validationMessage,
27
+ validationPalette,
28
+ maxLength,
29
+ isReadOnly,
30
+ value,
31
+ errorType,
32
+ isDisabled,
33
+ title,
34
+ onBlur,
35
+ dataId,
36
+ dataSelectorId,
37
+ validationRuleMessage,
38
+ validationRulePalette,
39
+ onKeyDown,
40
+ placeHolder,
41
+ infoText,
42
+ borderColor,
43
+ fieldSize,
44
+ labelPalette,
45
+ labelCustomClass,
46
+ htmlId,
47
+ lockedInfoText,
48
+ isLocked,
49
+ needReadOnlyStyle,
50
+ isClickable,
51
+ onFocus,
52
+ ePhiData,
53
+ children,
54
+ customProps,
55
+ renderLabelProps,
56
+ onChange,
57
+ getRef
58
+ } = props;
59
+ const {
60
+ LabelProps = {},
61
+ TextBoxIconProps = {},
62
+ ValidationMessageProps1 = {},
63
+ ValidationMessageProps2 = {}
64
+ } = customProps;
65
+ const getNextId = useUniqueId();
66
+ let uniqueId = htmlId ? htmlId : getNextId();
25
67
 
26
- handleChange(value) {
27
- let {
28
- id,
29
- onChange
30
- } = this.props;
68
+ const handleChange = value => {
31
69
  onChange && onChange(id, value);
32
- }
70
+ };
33
71
 
34
- handleGetRef(el) {
35
- let {
36
- getRef,
37
- id
38
- } = this.props;
39
- this.textBox = el;
72
+ const handleGetRef = el => {
40
73
  getRef && getRef(el, id);
41
- } // handleLabelClick() {
42
- // // let { isFocusOnLabelClick } = this.props;
43
- // // if (isFocusOnLabelClick && this.textBox && this.textBox.focus) {
44
- // // this.textBox.focus();
45
- // // }
46
- // }
74
+ };
47
75
 
76
+ return /*#__PURE__*/React.createElement("div", {
77
+ className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
78
+ "data-title": isDisabled ? title : null,
79
+ "data-selector-id": dataSelectorId
80
+ }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
81
+ infoText: infoText,
82
+ isLocked: isLocked,
83
+ lockedInfoText: lockedInfoText,
84
+ ePhiData: ePhiData,
85
+ dataId: dataId,
86
+ renderProps: renderLabelProps
87
+ }, /*#__PURE__*/React.createElement(Label, _extends({
88
+ text: labelName,
89
+ size: fieldSize === 'small' ? 'small' : 'medium',
90
+ palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
91
+ customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
92
+ htmlFor: uniqueId,
93
+ dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
94
+ }, LabelProps, {
95
+ id: labelName
96
+ }))), /*#__PURE__*/React.createElement("div", {
97
+ className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
98
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
99
+ htmlId: uniqueId,
100
+ id: id,
101
+ type: textBoxType,
102
+ variant: textBoxVariant,
103
+ size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
104
+ maxLength: maxLength,
105
+ isReadOnly: isReadOnly,
106
+ inputRef: handleGetRef,
107
+ value: value,
108
+ onChange: handleChange,
109
+ dataId: dataId,
110
+ onBlur: onBlur,
111
+ onKeyDown: onKeyDown,
112
+ placeHolder: placeHolder,
113
+ borderColor: borderColor,
114
+ onFocus: onFocus,
115
+ isDisabled: isDisabled,
116
+ needEffect: isReadOnly || isDisabled ? false : true,
117
+ isClickable: isClickable,
118
+ needReadOnlyStyle: needReadOnlyStyle
119
+ }, TextBoxIconProps, {
120
+ a11y: {
121
+ ariaLabelledby: labelName
122
+ }
123
+ }), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
124
+ text: validationMessage,
125
+ palette: validationPalette,
126
+ type: errorType,
127
+ dataId: `${dataId}_ValidationMessage`,
128
+ htmlFor: uniqueId
129
+ }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
130
+ text: validationRuleMessage,
131
+ palette: validationRulePalette,
132
+ type: errorType,
133
+ htmlFor: uniqueId,
134
+ dataId: `${dataId}_ValidationRuleMessage`
135
+ }, ValidationMessageProps2))));
136
+ };
48
137
 
49
- render() {
50
- let {
51
- labelName,
52
- id,
53
- textBoxSize,
54
- textBoxVariant,
55
- textBoxType,
56
- isMandatory,
57
- validationMessage,
58
- validationPalette,
59
- maxLength,
60
- isReadOnly,
61
- value,
62
- errorType,
63
- isDisabled,
64
- title,
65
- onBlur,
66
- dataId,
67
- dataSelectorId,
68
- validationRuleMessage,
69
- validationRulePalette,
70
- onKeyDown,
71
- placeHolder,
72
- infoText,
73
- borderColor,
74
- fieldSize,
75
- labelPalette,
76
- labelCustomClass,
77
- htmlId,
78
- lockedInfoText,
79
- isLocked,
80
- needReadOnlyStyle,
81
- isClickable,
82
- onFocus,
83
- ePhiData,
84
- children,
85
- customProps,
86
- renderLabelProps
87
- } = this.props;
88
- const {
89
- LabelProps = {},
90
- TextBoxIconProps = {},
91
- ValidationMessageProps1 = {},
92
- ValidationMessageProps2 = {}
93
- } = customProps;
94
- let uniqueId = htmlId ? htmlId : this.getNextId();
95
- return /*#__PURE__*/React.createElement("div", {
96
- className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
97
- "data-title": isDisabled ? title : null,
98
- "data-selector-id": dataSelectorId
99
- }, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
100
- infoText: infoText,
101
- isLocked: isLocked,
102
- lockedInfoText: lockedInfoText,
103
- ePhiData: ePhiData,
104
- dataId: dataId,
105
- renderProps: renderLabelProps
106
- }, /*#__PURE__*/React.createElement(Label, _extends({
107
- text: labelName,
108
- size: fieldSize === 'small' ? 'small' : 'medium',
109
- palette: isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette,
110
- customClass: `${style.fieldLabel} ${labelCustomClass} ${isMandatory ? style.labelMandatory : ''}`,
111
- htmlFor: uniqueId,
112
- dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`
113
- }, LabelProps, {
114
- id: labelName
115
- }))), /*#__PURE__*/React.createElement("div", {
116
- className: `${style.fieldContainer} ${labelName ? style[`fieldMargin_${fieldSize}`] : ''}`
117
- }, /*#__PURE__*/React.createElement(TextBoxIcon, _extends({
118
- htmlId: uniqueId,
119
- id: id,
120
- type: textBoxType,
121
- variant: textBoxVariant,
122
- size: fieldSize === 'medium' ? textBoxSize : 'xsmall',
123
- maxLength: maxLength,
124
- isReadOnly: isReadOnly,
125
- inputRef: this.handleGetRef,
126
- value: value,
127
- onChange: this.handleChange,
128
- dataId: dataId,
129
- onBlur: onBlur,
130
- onKeyDown: onKeyDown,
131
- placeHolder: placeHolder,
132
- borderColor: borderColor,
133
- onFocus: onFocus,
134
- isDisabled: isDisabled,
135
- needEffect: isReadOnly || isDisabled ? false : true,
136
- isClickable: isClickable,
137
- needReadOnlyStyle: needReadOnlyStyle
138
- }, TextBoxIconProps, {
139
- a11y: {
140
- ariaLabelledby: labelName
141
- }
142
- }), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
143
- text: validationMessage,
144
- palette: validationPalette,
145
- type: errorType,
146
- dataId: `${dataId}_ValidationMessage`,
147
- htmlFor: uniqueId
148
- }, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
149
- text: validationRuleMessage,
150
- palette: validationRulePalette,
151
- type: errorType,
152
- htmlFor: uniqueId,
153
- dataId: `${dataId}_ValidationRuleMessage`
154
- }, ValidationMessageProps2))));
155
- }
156
-
157
- }
158
138
  TextBoxField.propTypes = propTypes;
159
- TextBoxField.defaultProps = defaultProps; // if (__DOCS__) {
160
- // TextBoxField.docs = {
161
- // componentGroup: 'Form Fields',
162
- // folderName: 'General'
163
- // };
164
- // }
139
+ TextBoxField.defaultProps = defaultProps;
140
+ const MemoizedTextBoxField = /*#__PURE__*/memo(TextBoxField);
141
+ MemoizedTextBoxField.propTypes = propTypes;
142
+ MemoizedTextBoxField.defaultProps = defaultProps;
143
+ MemoizedTextBoxField.displayName = 'TextBoxField';
144
+ export default TextBoxField;