@zohodesk/dot 1.2.0 → 1.2.1

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 (144) hide show
  1. package/.cli/MissedPropType_Keys.html +101 -0
  2. package/.cli/PropLessFiles.html +101 -0
  3. package/.cli/PropValidationExcludeFilesArray.js +1 -0
  4. package/.cli/propValidation_report.html +160 -0
  5. package/README.md +28 -21
  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/Image/Image.js.html +1 -1
  13. package/coverage/Image/Image.module.css.html +1 -1
  14. package/coverage/Image/index.html +1 -1
  15. package/coverage/Image/props/defaultProps.js.html +1 -1
  16. package/coverage/Image/props/index.html +1 -1
  17. package/coverage/Image/props/propTypes.js.html +1 -1
  18. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
  19. package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
  20. package/coverage/avatar/AvatarWithTeam/index.html +1 -1
  21. package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
  22. package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
  23. package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
  24. package/coverage/index.html +1 -1
  25. package/es/ActionButton/ActionButton.js +5 -2
  26. package/es/ActionButton/props/propTypes.js +3 -2
  27. package/es/AlphabeticList/props/propTypes.js +1 -1
  28. package/es/Attachment/props/propTypes.js +2 -1
  29. package/es/Drawer/props/propTypes.js +2 -1
  30. package/es/Link/props/propTypes.js +5 -1
  31. package/es/Message/Message.js +4 -2
  32. package/es/Message/props/propTypes.js +11 -4
  33. package/es/Separator/props/propTypes.js +1 -1
  34. package/es/TagWithIcon/props/propTypes.js +2 -1
  35. package/es/ToastMessage/props/propTypes.js +4 -3
  36. package/es/actions/props/propTypes.js +2 -1
  37. package/es/alert/AlertLookup/props/propTypes.js +0 -1
  38. package/es/avatar/AvatarThread/props/propTypes.js +1 -1
  39. package/es/deprecated/SelectDropdown/SelectDropdown.js +3 -8
  40. package/es/dropdown/ToggleDropDown/props/propTypes.js +4 -1
  41. package/es/emptystate/EditionPage/props/propTypes.js +6 -2
  42. package/es/form/fields/CheckBoxField/props/propTypes.js +1 -1
  43. package/es/form/fields/CurrencyField/props/propTypes.js +4 -1
  44. package/es/form/fields/DateField/props/propTypes.js +1 -1
  45. package/es/form/fields/FieldContainer/props/propTypes.js +17 -3
  46. package/es/form/fields/MultiSelectField/props/propTypes.js +2 -2
  47. package/es/form/fields/PhoneField/props/propTypes.js +8 -1
  48. package/es/form/fields/RadioField/props/propTypes.js +2 -2
  49. package/es/form/fields/SelectField/SelectField.js +1 -2
  50. package/es/form/fields/SelectField/props/propTypes.js +2 -2
  51. package/es/form/fields/TagsMultiSelect/props/propTypes.js +2 -1
  52. package/es/form/fields/TagsMultiSelectField/props/propTypes.js +13 -2
  53. package/es/form/fields/TextBoxField/props/propTypes.js +8 -1
  54. package/es/form/fields/TextEditor/props/propTypes.js +7 -1
  55. package/es/form/fields/TextEditorField/props/propTypes.js +13 -1
  56. package/es/form/fields/TextEditorWrapper/props/propTypes.js +2 -1
  57. package/es/form/fields/TextareaField/props/propTypes.js +2 -2
  58. package/es/form/fields/ValidationMessage/props/propTypes.js +4 -2
  59. package/es/form/fields/props/FieldCommonPropTypes.js +16 -22
  60. package/es/form/layout/Section/props/propTypes.js +3 -1
  61. package/es/list/Comment/props/propTypes.js +0 -3
  62. package/es/list/GridStencils/props/propTypes.js +2 -1
  63. package/es/list/Icons/props/propTypes.js +0 -2
  64. package/es/list/SecondaryText/props/propTypes.js +0 -1
  65. package/es/list/UserTime/props/propTypes.js +5 -1
  66. package/es/list/status/StatusDropdown/props/propTypes.js +3 -1
  67. package/es/lookup/Lookup/props/propTypes.js +4 -1
  68. package/es/lookup/header/ViewDropDown/props/propTypes.js +6 -11
  69. package/es/setup/table/TableHead/props/propTypes.js +2 -1
  70. package/es/v1/ChannelIcon/ChannelIcon.js +92 -0
  71. package/es/v1/ExternalLink/ExternalLink.js +49 -0
  72. package/es/v1/NewStar/NewStar.js +61 -0
  73. package/es/v1/lookup/header/Close/Close.js +30 -0
  74. package/es/v1/lookup/header/ModuleHeader/ModuleHeader.js +75 -0
  75. package/es/v1/lookup/header/Search/Search.js +177 -0
  76. package/es/v1/lookup/header/TicketHeader/TicketHeader.js +90 -0
  77. package/es/v1/lookup/header/Title/Title.js +27 -0
  78. package/es/v1/version2/GlobalNotification/GlobalNotification.js +4 -2
  79. package/es/version2/GlobalNotification/GlobalNotification.js +4 -2
  80. package/es/version2/GlobalNotification/props/propTypes.js +19 -1
  81. package/es/version2/lookup/AlertLookup/props/propTypes.js +0 -1
  82. package/es/version2/notification/DesktopNotification/DesktopNotification.js +2 -1
  83. package/es/version2/notification/DesktopNotification/props/propTypes.js +13 -9
  84. package/lib/ActionButton/ActionButton.js +5 -3
  85. package/lib/ActionButton/props/propTypes.js +3 -2
  86. package/lib/AlphabeticList/props/propTypes.js +1 -1
  87. package/lib/Attachment/props/propTypes.js +2 -1
  88. package/lib/Drawer/props/propTypes.js +2 -1
  89. package/lib/Link/props/propTypes.js +5 -1
  90. package/lib/Message/Message.js +5 -1
  91. package/lib/Message/props/propTypes.js +23 -6
  92. package/lib/Separator/props/propTypes.js +1 -1
  93. package/lib/TagWithIcon/props/propTypes.js +2 -1
  94. package/lib/ToastMessage/props/propTypes.js +4 -3
  95. package/lib/actions/props/propTypes.js +2 -1
  96. package/lib/alert/AlertLookup/props/propTypes.js +0 -1
  97. package/lib/avatar/AvatarThread/props/propTypes.js +1 -1
  98. package/lib/deprecated/SelectDropdown/SelectDropdown.js +3 -7
  99. package/lib/dropdown/ToggleDropDown/props/propTypes.js +4 -1
  100. package/lib/emptystate/EditionPage/props/propTypes.js +6 -2
  101. package/lib/form/fields/CheckBoxField/props/propTypes.js +1 -1
  102. package/lib/form/fields/CurrencyField/props/propTypes.js +5 -2
  103. package/lib/form/fields/DateField/props/propTypes.js +1 -1
  104. package/lib/form/fields/FieldContainer/props/propTypes.js +21 -16
  105. package/lib/form/fields/MultiSelectField/props/propTypes.js +3 -3
  106. package/lib/form/fields/PhoneField/props/propTypes.js +8 -1
  107. package/lib/form/fields/RadioField/props/propTypes.js +2 -2
  108. package/lib/form/fields/SelectField/SelectField.js +1 -2
  109. package/lib/form/fields/SelectField/props/propTypes.js +3 -3
  110. package/lib/form/fields/TagsMultiSelect/props/propTypes.js +2 -1
  111. package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +16 -11
  112. package/lib/form/fields/TextBoxField/props/propTypes.js +8 -1
  113. package/lib/form/fields/TextEditor/props/propTypes.js +7 -1
  114. package/lib/form/fields/TextEditorField/props/propTypes.js +51 -49
  115. package/lib/form/fields/TextEditorWrapper/props/propTypes.js +2 -1
  116. package/lib/form/fields/TextareaField/props/propTypes.js +3 -3
  117. package/lib/form/fields/ValidationMessage/props/propTypes.js +4 -2
  118. package/lib/form/fields/props/FieldCommonPropTypes.js +16 -23
  119. package/lib/form/layout/Section/props/propTypes.js +3 -1
  120. package/lib/list/Comment/props/propTypes.js +0 -3
  121. package/lib/list/GridStencils/props/propTypes.js +2 -1
  122. package/lib/list/Icons/props/propTypes.js +0 -2
  123. package/lib/list/SecondaryText/props/propTypes.js +0 -1
  124. package/lib/list/UserTime/props/propTypes.js +5 -1
  125. package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
  126. package/lib/lookup/Lookup/props/propTypes.js +4 -1
  127. package/lib/lookup/header/ViewDropDown/props/propTypes.js +6 -11
  128. package/lib/setup/table/TableHead/props/propTypes.js +2 -1
  129. package/lib/v1/ChannelIcon/ChannelIcon.js +113 -0
  130. package/lib/v1/ExternalLink/ExternalLink.js +57 -0
  131. package/lib/v1/NewStar/NewStar.js +74 -0
  132. package/lib/v1/lookup/header/Close/Close.js +47 -0
  133. package/lib/v1/lookup/header/ModuleHeader/ModuleHeader.js +101 -0
  134. package/lib/v1/lookup/header/Search/Search.js +208 -0
  135. package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +108 -0
  136. package/lib/v1/lookup/header/Title/Title.js +44 -0
  137. package/lib/v1/version2/GlobalNotification/GlobalNotification.js +5 -1
  138. package/lib/version2/GlobalNotification/GlobalNotification.js +5 -1
  139. package/lib/version2/GlobalNotification/props/propTypes.js +23 -3
  140. package/lib/version2/lookup/AlertLookup/props/propTypes.js +0 -1
  141. package/lib/version2/notification/DesktopNotification/DesktopNotification.js +2 -0
  142. package/lib/version2/notification/DesktopNotification/props/propTypes.js +16 -11
  143. package/package.json +11 -9
  144. package/result.json +1 -1
@@ -14,7 +14,6 @@ export const propTypes = {
14
14
  maxLength: PropTypes.number,
15
15
  onBlur: PropTypes.func,
16
16
  onChange: PropTypes.func,
17
- onKeyDown: PropTypes.func,
18
17
  placeHolder: PropTypes.string,
19
18
  textBoxSize: PropTypes.string,
20
19
  textBoxVariant: PropTypes.string,
@@ -30,5 +29,6 @@ export const propTypes = {
30
29
  ValidationMessageProps1: PropTypes.object,
31
30
  ValidationMessageProps2: PropTypes.object
32
31
  }),
33
- ...FieldCommonPropTypes()
32
+ htmlId: PropTypes.string,
33
+ ...FieldCommonPropTypes
34
34
  };
@@ -1,7 +1,6 @@
1
1
  import PropTypes from 'prop-types';
2
2
  export const propTypes = {
3
3
  clipped: PropTypes.bool,
4
- id: PropTypes.string,
5
4
  onClick: PropTypes.func,
6
5
  palette: PropTypes.oneOf(['primary', 'mandatory', 'danger']),
7
6
  size: PropTypes.oneOf(['xsmall', 'small', 'medium', 'large']),
@@ -10,5 +9,8 @@ export const propTypes = {
10
9
  a11y: PropTypes.shape({
11
10
  role: PropTypes.string
12
11
  }),
13
- tooltip: PropTypes.string
12
+ tooltip: PropTypes.string,
13
+ htmlFor: PropTypes.string,
14
+ dataId: PropTypes.string,
15
+ dataSelectorId: PropTypes.string
14
16
  };
@@ -1,23 +1,17 @@
1
1
  import PropTypes from 'prop-types';
2
- export const FieldCommonPropTypes = () => {
3
- return {
4
- ePhiData: PropTypes.shape({
5
- ePhiTitle: PropTypes.string,
6
- ePhiText: PropTypes.string,
7
- ePhiStatus: PropTypes.bool
8
- }),
9
- dataId: PropTypes.string,
10
- infoText: PropTypes.string,
11
- lockedInfoText: PropTypes.string,
12
- isLocked: PropTypes.bool,
13
- isDisabled: PropTypes.bool,
14
- isReadOnly: PropTypes.bool,
15
- isMandatory: PropTypes.bool,
16
- renderLabelProps: PropTypes.shape({
17
- start: PropTypes.func,
18
- middle: PropTypes.func,
19
- end: PropTypes.func
20
- }),
21
- dataSelectorId: PropTypes.bool
22
- };
23
- };
2
+ export const FieldCommonPropTypes = {
3
+ dataId: PropTypes.string,
4
+ infoText: PropTypes.string,
5
+ lockedInfoText: PropTypes.string,
6
+ isLocked: PropTypes.bool,
7
+ isDisabled: PropTypes.bool,
8
+ isReadOnly: PropTypes.bool,
9
+ isMandatory: PropTypes.bool,
10
+ renderLabelProps: PropTypes.shape({
11
+ start: PropTypes.func,
12
+ middle: PropTypes.func,
13
+ end: PropTypes.func
14
+ }),
15
+ dataSelectorId: PropTypes.bool
16
+ };
17
+ ;
@@ -5,5 +5,7 @@ export const propTypes = {
5
5
  containerClass: PropTypes.string,
6
6
  dataId: PropTypes.string,
7
7
  title: PropTypes.string,
8
- titleClass: PropTypes.string
8
+ titleClass: PropTypes.string,
9
+ column: PropTypes.string,
10
+ formName: PropTypes.string
9
11
  };
@@ -2,8 +2,5 @@ import PropTypes from 'prop-types';
2
2
  export const propTypes = {
3
3
  className: PropTypes.string,
4
4
  count: PropTypes.string,
5
- features: PropTypes.array,
6
- iconTitle: PropTypes.string,
7
- module: PropTypes.string,
8
5
  onClick: PropTypes.func
9
6
  };
@@ -3,5 +3,6 @@ export const propTypes = {
3
3
  from: PropTypes.string,
4
4
  isThreeLayout: PropTypes.bool,
5
5
  lineBar: PropTypes.string,
6
- styles: PropTypes.object
6
+ styles: PropTypes.object,
7
+ order: PropTypes.number
7
8
  };
@@ -48,8 +48,6 @@ export const SmartIcon_propTypes = {
48
48
  className: PropTypes.string,
49
49
  dataId: PropTypes.string,
50
50
  dataTitle: PropTypes.string,
51
- features: PropTypes.array,
52
51
  iconClass: PropTypes.string,
53
- module: PropTypes.string,
54
52
  onClick: PropTypes.func
55
53
  };
@@ -30,7 +30,6 @@ export const ContactName_propTypes = {
30
30
  isPaidUser: PropTypes.bool,
31
31
  notAccessible: PropTypes.bool,
32
32
  onClick: PropTypes.func,
33
- sentimentTitle: PropTypes.string,
34
33
  sentimentType: PropTypes.oneOf(['positive', 'negative', 'neutral']),
35
34
  text: PropTypes.string,
36
35
  urlData: PropTypes.object,
@@ -10,5 +10,9 @@ export const propTypes = {
10
10
  later: PropTypes.string,
11
11
  textClass: PropTypes.string,
12
12
  title: PropTypes.string,
13
- to: PropTypes.string
13
+ to: PropTypes.string,
14
+ type: PropTypes.string,
15
+ page: PropTypes.string,
16
+ isNeedTime: PropTypes.bool,
17
+ isOverdue: PropTypes.bool
14
18
  };
@@ -47,5 +47,7 @@ export const propTypes = {
47
47
  title: PropTypes.string,
48
48
  togglePopup: PropTypes.func,
49
49
  value: PropTypes.node,
50
- needMultiLineText: PropTypes.bool
50
+ needMultiLineText: PropTypes.bool,
51
+ onSelectLabel: PropTypes.func,
52
+ top: PropTypes.number
51
53
  };
@@ -15,5 +15,8 @@ export const propTypes = {
15
15
  onKeyDown: PropTypes.func,
16
16
  childAnimationName: PropTypes.oneOf(['expand', 'flyDown']),
17
17
  needFocusScope: PropTypes.bool,
18
- customProps: PropTypes.object
18
+ customProps: PropTypes.object,
19
+ forwardRef: PropTypes.object,
20
+ onClick: PropTypes.func,
21
+ onClose: PropTypes.func
19
22
  };
@@ -2,26 +2,21 @@ import PropTypes from 'prop-types';
2
2
  export const propTypes = {
3
3
  emptyMessage: PropTypes.string,
4
4
  needSearch: PropTypes.bool,
5
- onChange: PropTypes.func.isRequired,
6
- options: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.string), PropTypes.arrayOf(PropTypes.shape({
7
- id: PropTypes.string,
8
- text: PropTypes.string
9
- }))]).isRequired,
10
5
  searchBoxPlaceHolder: PropTypes.string,
11
6
  searchEmptyMessage: PropTypes.string,
12
- selectedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
13
- valueField: PropTypes.string,
14
- textField: PropTypes.string,
15
- needLocalSearch: PropTypes.bool,
16
7
  dropBoxSize: PropTypes.oneOf(['small', 'medium', 'large']),
17
8
 
18
9
  /**** Popup props ****/
19
10
  isPopupOpen: PropTypes.bool,
20
11
  isPopupReady: PropTypes.bool,
21
- togglePopup: PropTypes.func,
22
12
  removeClose: PropTypes.func,
23
13
  closePopupOnly: PropTypes.func,
24
14
  position: PropTypes.string,
25
15
  getTargetRef: PropTypes.func,
26
- getContainerRef: PropTypes.func
16
+ getContainerRef: PropTypes.func,
17
+ defaultDropBoxPosition: PropTypes.string,
18
+ animationStyle: PropTypes.string,
19
+ searchBoxSize: PropTypes.string,
20
+ searchBoxVariant: PropTypes.string,
21
+ maxLength: PropTypes.string
27
22
  };
@@ -3,5 +3,6 @@ export const propTypes = {
3
3
  children: PropTypes.element,
4
4
  className: PropTypes.string,
5
5
  onMouseEnter: PropTypes.func,
6
- onMouseLeave: PropTypes.func
6
+ onMouseLeave: PropTypes.func,
7
+ dataId: PropTypes.string
7
8
  };
@@ -0,0 +1,92 @@
1
+ import React, { Component } from 'react';
2
+ import { Icon } from '@zohodesk/icons';
3
+ import Avatar from '@zohodesk/components/lib/Avatar/Avatar';
4
+ import AvatarIcon from '../../avatar/AvatarIcon/AvatarIcon';
5
+ import { defaultProps } from '../../ChannelIcon/props/defaultProps';
6
+ import { propTypes } from '../../ChannelIcon/props/propTypes';
7
+ import { getChannelMappingObj } from '../../utils/ChannelIconMapping';
8
+ import style from '../../ChannelIcon/ChannelIcon.module.css';
9
+
10
+ const ChannelIcon = props => {
11
+ let {
12
+ name,
13
+ action,
14
+ iconSize,
15
+ iconTitle,
16
+ size,
17
+ topicIcon,
18
+ topicIconTitle,
19
+ topicIconSize,
20
+ topicIconColor,
21
+ iconClass,
22
+ dataId,
23
+ className,
24
+ palette,
25
+ textPalette,
26
+ customTextClass,
27
+ iconColor,
28
+ needTopicBorder,
29
+ topicClass,
30
+ renderIconOnly,
31
+ iconName,
32
+ title,
33
+ dataSelectorId
34
+ } = props;
35
+ let defaultChannelObj = name && !iconName && getChannelMappingObj()[name.toUpperCase()];
36
+ let customizedChannelName = null;
37
+
38
+ if (!defaultChannelObj) {
39
+ customizedChannelName = name;
40
+ } else {
41
+ iconName = defaultChannelObj[action];
42
+ }
43
+
44
+ return /*#__PURE__*/React.createElement("span", {
45
+ className: style.container,
46
+ "data-selector-id": dataSelectorId
47
+ }, customizedChannelName ? /*#__PURE__*/React.createElement(Avatar, {
48
+ name: customizedChannelName,
49
+ size: size,
50
+ palette: palette,
51
+ textPalette: textPalette,
52
+ customClass: customTextClass,
53
+ dataId: dataId,
54
+ needTitle: title,
55
+ title: title
56
+ }) : !renderIconOnly ? iconName ? /*#__PURE__*/React.createElement(AvatarIcon, {
57
+ name: iconName,
58
+ iconSize: iconSize,
59
+ size: size,
60
+ iconClass: `${style.iconStyle} ${name && action ? style[`${name.toLowerCase()}_${action.toLowerCase()}`] : ''} ${iconClass ? iconClass : ''} `,
61
+ dataId: dataId,
62
+ className: className,
63
+ iconColor: iconColor,
64
+ title: iconTitle
65
+ }) : /*#__PURE__*/React.createElement(Avatar, {
66
+ name: name,
67
+ size: size,
68
+ palette: palette,
69
+ textPalette: textPalette,
70
+ customClass: customTextClass,
71
+ needTitle: title,
72
+ title: title
73
+ }) : /*#__PURE__*/React.createElement(Icon, {
74
+ name: iconName,
75
+ size: iconSize,
76
+ iconClass: `${iconClass ? iconClass : ''} ${style.iconStyle} ${name && action ? style[`${name.toLowerCase()}_${action.toLowerCase()}`] : ''}`,
77
+ title: iconTitle,
78
+ dataId: dataId
79
+ }), topicIcon ? /*#__PURE__*/React.createElement("span", {
80
+ className: `${style.thread} ${needTopicBorder ? style.threadBorder : ''} ${topicClass ? topicClass : ''}`,
81
+ "data-title": topicIconTitle
82
+ }, /*#__PURE__*/React.createElement(Icon, {
83
+ name: topicIcon,
84
+ size: topicIconSize,
85
+ iconClass: style[`topic_${topicIconColor}`] ? `${style.topicIcon} ${style[`topic_${topicIconColor}`]}` : '',
86
+ dataId: dataId
87
+ })) : null);
88
+ };
89
+
90
+ ChannelIcon.defaultProps = defaultProps;
91
+ ChannelIcon.propTypes = propTypes;
92
+ export default ChannelIcon;
@@ -0,0 +1,49 @@
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
+
3
+ /**** Libraries ****/
4
+ import React from 'react';
5
+ import { defaultProps } from '../../ExternalLink/props/defaultProps';
6
+ import { propTypes } from '../../ExternalLink/props/propTypes';
7
+ /**** CSS ****/
8
+
9
+ import style from '../../ExternalLink/ExternalLink.module.css';
10
+
11
+ const ExternalLink = props => {
12
+ const {
13
+ href,
14
+ title,
15
+ target,
16
+ className,
17
+ children,
18
+ rel,
19
+ dataId,
20
+ onClick,
21
+ customProps
22
+ } = props;
23
+
24
+ let addHttp = url => {
25
+ let regEx = new RegExp(/(^(ftp|https|mailto|tel|http|simplehelp|dynamicsnav?):)/i);
26
+
27
+ if (!regEx.test(url)) {
28
+ return `http://${url}`;
29
+ }
30
+
31
+ return url;
32
+ };
33
+
34
+ let urlOutput = href && typeof href !== 'boolean' ? addHttp(String(href)) : 'javascript:void(0);';
35
+ return /*#__PURE__*/React.createElement("a", _extends({
36
+ href: urlOutput,
37
+ target: target,
38
+ className: `${style.link} ${className ? className : ''}`,
39
+ "data-title": title,
40
+ rel: rel,
41
+ "data-id": dataId,
42
+ "data-test-id": dataId,
43
+ onClick: onClick
44
+ }, customProps), children);
45
+ };
46
+
47
+ ExternalLink.defaultProps = defaultProps;
48
+ ExternalLink.propTypes = propTypes;
49
+ export default ExternalLink;
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+ import { Icon } from '@zohodesk/icons';
3
+ import { Container } from '@zohodesk/components/lib/Layout';
4
+ import { defaultProps } from '../../NewStar/props/defaultProps';
5
+ import { propTypes } from '../../NewStar/props/propTypes';
6
+ import style from '../../NewStar/NewStar.module.css';
7
+
8
+ const NewStar = props => {
9
+ const {
10
+ palette,
11
+ customClass,
12
+ position
13
+ } = props;
14
+ const alignPosition = {
15
+ topRight: {
16
+ className: style.topRight // align: 'right',
17
+ // alignBox: 'row',
18
+ // reverse: 'wrap'
19
+
20
+ },
21
+ topLeft: {
22
+ className: style.topLeft // align: 'left',
23
+ // alignBox: 'row',
24
+ // reverse: 'wrap'
25
+
26
+ },
27
+ bottomLeft: {
28
+ className: style.bottomLeft // align: 'left',
29
+ // alignBox: 'column-reverse',
30
+ // reverse: 'wrap'
31
+
32
+ },
33
+ bottomRight: {
34
+ className: style.bottomRight // align: 'right',
35
+ // alignBox: 'column',
36
+ // reverse: 'wrap-reverse'
37
+
38
+ }
39
+ };
40
+ return /*#__PURE__*/React.createElement(Container, {
41
+ alignBox: "row",
42
+ isCover: false,
43
+ className: `${style.star} ${alignPosition[position].className} ${customClass}`
44
+ }, /*#__PURE__*/React.createElement(Icon, {
45
+ name: "ZD-snippetStar",
46
+ iconClass: `${style[palette]} ${style.starOne}`,
47
+ size: "10"
48
+ }), /*#__PURE__*/React.createElement(Icon, {
49
+ name: "ZD-snippetStar",
50
+ iconClass: `${style[palette]} ${style.starTwo}`,
51
+ size: "10"
52
+ }), /*#__PURE__*/React.createElement(Icon, {
53
+ name: "ZD-snippetStar",
54
+ iconClass: `${style[palette]} ${style.starThree}`,
55
+ size: "10"
56
+ }));
57
+ };
58
+
59
+ NewStar.propTypes = propTypes;
60
+ NewStar.defaultProps = defaultProps;
61
+ export default NewStar;
@@ -0,0 +1,30 @@
1
+ /*** Libraries ***/
2
+ import React, { memo } from 'react';
3
+ import { defaultProps } from '../../../../lookup/header/Close/props/defaultProps';
4
+ import { propTypes } from '../../../../lookup/header/Close/props/propTypes';
5
+ /*** FontIcons ***/
6
+
7
+ import IconButton from './../../../IconButton/IconButton';
8
+
9
+ function Close(props) {
10
+ let {
11
+ onClose,
12
+ dataId,
13
+ title
14
+ } = props;
15
+ return /*#__PURE__*/React.createElement(IconButton, {
16
+ dataId: dataId,
17
+ onClick: onClose,
18
+ iconName: "ZD-cross",
19
+ iconSize: "11",
20
+ title: title
21
+ });
22
+ }
23
+
24
+ Close.propTypes = propTypes;
25
+ Close.defaultProps = defaultProps;
26
+ const MemoizedClose = /*#__PURE__*/memo(Close);
27
+ MemoizedClose.propTypes = propTypes;
28
+ MemoizedClose.defaultProps = defaultProps;
29
+ MemoizedClose.displayName = 'Close';
30
+ export default MemoizedClose;
@@ -0,0 +1,75 @@
1
+ /*** Libraries ***/
2
+ import React, { memo } from 'react';
3
+ import { defaultProps } from '../../../../lookup/header/ModuleHeader/props/defaultProps';
4
+ import { propTypes } from '../../../../lookup/header/ModuleHeader/props/propTypes';
5
+ /*** Components ***/
6
+
7
+ import Title from '../Title/Title';
8
+ import Close from '../Close/Close';
9
+ import Search from '../Search/Search';
10
+ import { Container, Box } from '@zohodesk/components/lib/Layout';
11
+ /*** CSS ***/
12
+
13
+ import commonStyle from '../../../../lookup/header/lookupHeaderCommon.module.css';
14
+ import commonResponsive from '../../../../lookup/header/lookupHeaderCommonResponsive.module.css';
15
+ /*eslint-disable react/forbid-component-props */
16
+
17
+ function ModuleHeader(props) {
18
+ const {
19
+ title = '',
20
+ needSearch = false,
21
+ onLookupClose,
22
+ searchStr = '',
23
+ onSearch,
24
+ onSearchChange,
25
+ searchPlaceHolder,
26
+ needOnTypeSearch,
27
+ getSearchBoxRef,
28
+ miniDescription,
29
+ dataId,
30
+ closeTitle,
31
+ onSearchKeyDown,
32
+ palette
33
+ } = props;
34
+ return /*#__PURE__*/React.createElement(Container, {
35
+ align: "vertical",
36
+ alignBox: "row",
37
+ className: `${commonStyle.container} ${commonStyle[`${palette}`]}`,
38
+ isCover: false,
39
+ wrap: "wrap",
40
+ dataId: dataId
41
+ }, onLookupClose ? /*#__PURE__*/React.createElement("div", {
42
+ className: commonStyle.closeContainer
43
+ }, /*#__PURE__*/React.createElement(Close, {
44
+ dataId: "close",
45
+ onClose: onLookupClose,
46
+ title: closeTitle
47
+ })) : null, /*#__PURE__*/React.createElement(Box, {
48
+ flexible: true
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ className: commonStyle.title
51
+ }, /*#__PURE__*/React.createElement(Title, {
52
+ text: title
53
+ })), miniDescription && /*#__PURE__*/React.createElement("div", {
54
+ className: commonStyle.para
55
+ }, miniDescription)), needSearch && /*#__PURE__*/React.createElement(Box, {
56
+ className: `${commonStyle.searchContainer} ${commonResponsive.searchContainer}`
57
+ }, /*#__PURE__*/React.createElement(Search, {
58
+ onSearch: onSearch,
59
+ searchStr: searchStr,
60
+ onChange: onSearchChange,
61
+ placeHolder: searchPlaceHolder,
62
+ dataId: "search",
63
+ needOnTypeSearch: needOnTypeSearch,
64
+ getRef: getSearchBoxRef,
65
+ onKeyDown: onSearchKeyDown
66
+ })));
67
+ }
68
+
69
+ ModuleHeader.propTypes = propTypes;
70
+ ModuleHeader.defaultProps = defaultProps;
71
+ const MemoizedModuleHeader = /*#__PURE__*/memo(ModuleHeader);
72
+ MemoizedModuleHeader.propTypes = propTypes;
73
+ MemoizedModuleHeader.defaultProps = defaultProps;
74
+ MemoizedModuleHeader.displayName = 'Close';
75
+ export default MemoizedModuleHeader;
@@ -0,0 +1,177 @@
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
+
3
+ /* eslint-disable react/forbid-component-props */
4
+
5
+ /*** Libraries ***/
6
+ import React, { useState } from 'react';
7
+ import { SearchUI_defaultProps } from '../../../../lookup/header/Search/props/defaultProps';
8
+ import { Search_propTypes, SearchUI_propTypes } from '../../../../lookup/header/Search/props/propTypes';
9
+ /** * Components ** */
10
+
11
+ import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
12
+ import { Container, Box } from '@zohodesk/components/lib/Layout';
13
+ import { Icon } from '@zohodesk/icons';
14
+ import ToggleDropDown from '../../../../dropdown/ToggleDropDown/ToggleDropDown';
15
+ /** * Methods ** */
16
+
17
+ import { debounce } from '@zohodesk/components/lib/utils/debounce';
18
+ import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
19
+ /** * CSS ** */
20
+
21
+ import style from '../../../../lookup/header/Search/LookupSearch.module.css';
22
+ export default function Search(props) {
23
+ const {
24
+ options,
25
+ onSelect,
26
+ value,
27
+ selectedId,
28
+ onFocus,
29
+ onBlur,
30
+ getRef
31
+ } = props;
32
+ const [isFocus, setFocus] = useState(false);
33
+ const [isDropDownOpen, setDropDownOpen] = useState(false);
34
+
35
+ const handleDropDownOpen = () => {
36
+ setDropDownOpen(true);
37
+ };
38
+
39
+ const handleDropDownClose = () => {
40
+ setDropDownOpen(false);
41
+ };
42
+
43
+ const handleTextBoxFocus = e => {
44
+ setFocus(true);
45
+ onFocus && onFocus(e);
46
+ };
47
+
48
+ const handleTextBoxBlur = e => {
49
+ setFocus(false);
50
+ onBlur && onBlur(e);
51
+ };
52
+
53
+ const handleGetTextBoxRef = el => {
54
+ // textBox = el;
55
+ getRef && getRef(el);
56
+ };
57
+
58
+ const searchUIExtraProps = {
59
+ isFocus: isFocus || isDropDownOpen,
60
+ onFocus: handleTextBoxFocus,
61
+ onBlur: handleTextBoxBlur,
62
+ getRef: handleGetTextBoxRef
63
+ };
64
+ return options ? /*#__PURE__*/React.createElement(ToggleDropDown, {
65
+ value: value,
66
+ options: options,
67
+ onClick: onSelect,
68
+ needTick: true,
69
+ isArrow: false,
70
+ isToggleStateNeeded: true,
71
+ selectedId: selectedId,
72
+ onDropDownOpen: handleDropDownOpen,
73
+ onDropDownClose: handleDropDownClose
74
+ }, /*#__PURE__*/React.createElement(SearchUI, _extends({}, props, searchUIExtraProps))) : /*#__PURE__*/React.createElement(SearchUI, _extends({}, props, searchUIExtraProps));
75
+ }
76
+ Search.propTypes = Search_propTypes;
77
+
78
+ function SearchUI(props) {
79
+ const {
80
+ dataId,
81
+ searchStr,
82
+ placeHolder,
83
+ getRef,
84
+ title,
85
+ isBoxed,
86
+ isSearchIconNeed,
87
+ options,
88
+ activeClass,
89
+ isFocus,
90
+ onFocus,
91
+ onBlur,
92
+ onSearch,
93
+ needOnTypeSearch,
94
+ onKeyDown,
95
+ onChange
96
+ } = props;
97
+
98
+ const handleSearch = () => {
99
+ onSearch && onSearch();
100
+ };
101
+
102
+ const debounceHandleSearch = debounce(handleSearch, 500);
103
+
104
+ const handleKeyDown = e => {
105
+ const {
106
+ keyCode
107
+ } = e;
108
+ onKeyDown && onKeyDown(e);
109
+
110
+ if (keyCode === 13) {
111
+ !needOnTypeSearch && onSearch && onSearch();
112
+ }
113
+ };
114
+
115
+ const handleChange = value => {
116
+ onChange && onChange(value);
117
+ needOnTypeSearch && debounceHandleSearch();
118
+ };
119
+
120
+ const handleClear = e => {
121
+ cancelBubblingEffect(e);
122
+ onChange && onChange('');
123
+ debounceHandleSearch();
124
+ };
125
+
126
+ return /*#__PURE__*/React.createElement(Container, {
127
+ isCover: false,
128
+ alignBox: "row",
129
+ align: "vertical",
130
+ className: `${style.searchStyle} ${isBoxed ? style.boxStyle : ''} ${isFocus ? `${style.active} ${activeClass ? activeClass : ''} ` : ''} ${searchStr || isFocus ? style.focusWidth : ''}`
131
+ }, options && /*#__PURE__*/React.createElement(Container, {
132
+ className: `${style.drpSearchBox} ${isFocus ? style.lineActive : ''}`,
133
+ isCover: false,
134
+ align: "vertical",
135
+ alignBox: "row",
136
+ "data-title": title
137
+ }, /*#__PURE__*/React.createElement(Icon, {
138
+ name: "ZD-search",
139
+ size: "11"
140
+ }), /*#__PURE__*/React.createElement(Icon, {
141
+ name: "ZD-down",
142
+ size: "7",
143
+ iconClass: style.iconArrow
144
+ })), isSearchIconNeed && /*#__PURE__*/React.createElement(Box, {
145
+ className: style.searchIconBox
146
+ }, /*#__PURE__*/React.createElement(Icon, {
147
+ name: "ZD-search",
148
+ size: "11"
149
+ })), /*#__PURE__*/React.createElement(Box, {
150
+ flexible: true
151
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
152
+ customClass: {
153
+ customTextBox: `${isBoxed ? style.inputBox : ''}`
154
+ },
155
+ customProps: {
156
+ TextBoxProps: {
157
+ 'data-a11y-autofocus': true
158
+ }
159
+ },
160
+ placeHolder: placeHolder,
161
+ value: searchStr,
162
+ onChange: handleChange,
163
+ onClick: cancelBubblingEffect,
164
+ onFocus: onFocus,
165
+ onBlur: onBlur,
166
+ onKeyDown: handleKeyDown,
167
+ onMouseDown: cancelBubblingEffect,
168
+ dataId: dataId,
169
+ size: "small",
170
+ inputRef: getRef,
171
+ onClear: handleClear,
172
+ onClearMouseDown: cancelBubblingEffect
173
+ })));
174
+ }
175
+
176
+ SearchUI.defaultProps = SearchUI_defaultProps;
177
+ SearchUI.propTypes = SearchUI_propTypes;