@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.
- package/.cli/MissedPropType_Keys.html +101 -0
- package/.cli/PropLessFiles.html +101 -0
- package/.cli/PropValidationExcludeFilesArray.js +1 -0
- package/.cli/propValidation_report.html +160 -0
- package/README.md +28 -21
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/index.html +1 -1
- package/es/ActionButton/ActionButton.js +5 -2
- package/es/ActionButton/props/propTypes.js +3 -2
- package/es/AlphabeticList/props/propTypes.js +1 -1
- package/es/Attachment/props/propTypes.js +2 -1
- package/es/Drawer/props/propTypes.js +2 -1
- package/es/Link/props/propTypes.js +5 -1
- package/es/Message/Message.js +4 -2
- package/es/Message/props/propTypes.js +11 -4
- package/es/Separator/props/propTypes.js +1 -1
- package/es/TagWithIcon/props/propTypes.js +2 -1
- package/es/ToastMessage/props/propTypes.js +4 -3
- package/es/actions/props/propTypes.js +2 -1
- package/es/alert/AlertLookup/props/propTypes.js +0 -1
- package/es/avatar/AvatarThread/props/propTypes.js +1 -1
- package/es/deprecated/SelectDropdown/SelectDropdown.js +3 -8
- package/es/dropdown/ToggleDropDown/props/propTypes.js +4 -1
- package/es/emptystate/EditionPage/props/propTypes.js +6 -2
- package/es/form/fields/CheckBoxField/props/propTypes.js +1 -1
- package/es/form/fields/CurrencyField/props/propTypes.js +4 -1
- package/es/form/fields/DateField/props/propTypes.js +1 -1
- package/es/form/fields/FieldContainer/props/propTypes.js +17 -3
- package/es/form/fields/MultiSelectField/props/propTypes.js +2 -2
- package/es/form/fields/PhoneField/props/propTypes.js +8 -1
- package/es/form/fields/RadioField/props/propTypes.js +2 -2
- package/es/form/fields/SelectField/SelectField.js +1 -2
- package/es/form/fields/SelectField/props/propTypes.js +2 -2
- package/es/form/fields/TagsMultiSelect/props/propTypes.js +2 -1
- package/es/form/fields/TagsMultiSelectField/props/propTypes.js +13 -2
- package/es/form/fields/TextBoxField/props/propTypes.js +8 -1
- package/es/form/fields/TextEditor/props/propTypes.js +7 -1
- package/es/form/fields/TextEditorField/props/propTypes.js +13 -1
- package/es/form/fields/TextEditorWrapper/props/propTypes.js +2 -1
- package/es/form/fields/TextareaField/props/propTypes.js +2 -2
- package/es/form/fields/ValidationMessage/props/propTypes.js +4 -2
- package/es/form/fields/props/FieldCommonPropTypes.js +16 -22
- package/es/form/layout/Section/props/propTypes.js +3 -1
- package/es/list/Comment/props/propTypes.js +0 -3
- package/es/list/GridStencils/props/propTypes.js +2 -1
- package/es/list/Icons/props/propTypes.js +0 -2
- package/es/list/SecondaryText/props/propTypes.js +0 -1
- package/es/list/UserTime/props/propTypes.js +5 -1
- package/es/list/status/StatusDropdown/props/propTypes.js +3 -1
- package/es/lookup/Lookup/props/propTypes.js +4 -1
- package/es/lookup/header/ViewDropDown/props/propTypes.js +6 -11
- package/es/setup/table/TableHead/props/propTypes.js +2 -1
- package/es/v1/ChannelIcon/ChannelIcon.js +92 -0
- package/es/v1/ExternalLink/ExternalLink.js +49 -0
- package/es/v1/NewStar/NewStar.js +61 -0
- package/es/v1/lookup/header/Close/Close.js +30 -0
- package/es/v1/lookup/header/ModuleHeader/ModuleHeader.js +75 -0
- package/es/v1/lookup/header/Search/Search.js +177 -0
- package/es/v1/lookup/header/TicketHeader/TicketHeader.js +90 -0
- package/es/v1/lookup/header/Title/Title.js +27 -0
- package/es/v1/version2/GlobalNotification/GlobalNotification.js +4 -2
- package/es/version2/GlobalNotification/GlobalNotification.js +4 -2
- package/es/version2/GlobalNotification/props/propTypes.js +19 -1
- package/es/version2/lookup/AlertLookup/props/propTypes.js +0 -1
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +2 -1
- package/es/version2/notification/DesktopNotification/props/propTypes.js +13 -9
- package/lib/ActionButton/ActionButton.js +5 -3
- package/lib/ActionButton/props/propTypes.js +3 -2
- package/lib/AlphabeticList/props/propTypes.js +1 -1
- package/lib/Attachment/props/propTypes.js +2 -1
- package/lib/Drawer/props/propTypes.js +2 -1
- package/lib/Link/props/propTypes.js +5 -1
- package/lib/Message/Message.js +5 -1
- package/lib/Message/props/propTypes.js +23 -6
- package/lib/Separator/props/propTypes.js +1 -1
- package/lib/TagWithIcon/props/propTypes.js +2 -1
- package/lib/ToastMessage/props/propTypes.js +4 -3
- package/lib/actions/props/propTypes.js +2 -1
- package/lib/alert/AlertLookup/props/propTypes.js +0 -1
- package/lib/avatar/AvatarThread/props/propTypes.js +1 -1
- package/lib/deprecated/SelectDropdown/SelectDropdown.js +3 -7
- package/lib/dropdown/ToggleDropDown/props/propTypes.js +4 -1
- package/lib/emptystate/EditionPage/props/propTypes.js +6 -2
- package/lib/form/fields/CheckBoxField/props/propTypes.js +1 -1
- package/lib/form/fields/CurrencyField/props/propTypes.js +5 -2
- package/lib/form/fields/DateField/props/propTypes.js +1 -1
- package/lib/form/fields/FieldContainer/props/propTypes.js +21 -16
- package/lib/form/fields/MultiSelectField/props/propTypes.js +3 -3
- package/lib/form/fields/PhoneField/props/propTypes.js +8 -1
- package/lib/form/fields/RadioField/props/propTypes.js +2 -2
- package/lib/form/fields/SelectField/SelectField.js +1 -2
- package/lib/form/fields/SelectField/props/propTypes.js +3 -3
- package/lib/form/fields/TagsMultiSelect/props/propTypes.js +2 -1
- package/lib/form/fields/TagsMultiSelectField/props/propTypes.js +16 -11
- package/lib/form/fields/TextBoxField/props/propTypes.js +8 -1
- package/lib/form/fields/TextEditor/props/propTypes.js +7 -1
- package/lib/form/fields/TextEditorField/props/propTypes.js +51 -49
- package/lib/form/fields/TextEditorWrapper/props/propTypes.js +2 -1
- package/lib/form/fields/TextareaField/props/propTypes.js +3 -3
- package/lib/form/fields/ValidationMessage/props/propTypes.js +4 -2
- package/lib/form/fields/props/FieldCommonPropTypes.js +16 -23
- package/lib/form/layout/Section/props/propTypes.js +3 -1
- package/lib/list/Comment/props/propTypes.js +0 -3
- package/lib/list/GridStencils/props/propTypes.js +2 -1
- package/lib/list/Icons/props/propTypes.js +0 -2
- package/lib/list/SecondaryText/props/propTypes.js +0 -1
- package/lib/list/UserTime/props/propTypes.js +5 -1
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/lookup/Lookup/props/propTypes.js +4 -1
- package/lib/lookup/header/ViewDropDown/props/propTypes.js +6 -11
- package/lib/setup/table/TableHead/props/propTypes.js +2 -1
- package/lib/v1/ChannelIcon/ChannelIcon.js +113 -0
- package/lib/v1/ExternalLink/ExternalLink.js +57 -0
- package/lib/v1/NewStar/NewStar.js +74 -0
- package/lib/v1/lookup/header/Close/Close.js +47 -0
- package/lib/v1/lookup/header/ModuleHeader/ModuleHeader.js +101 -0
- package/lib/v1/lookup/header/Search/Search.js +208 -0
- package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +108 -0
- package/lib/v1/lookup/header/Title/Title.js +44 -0
- package/lib/v1/version2/GlobalNotification/GlobalNotification.js +5 -1
- package/lib/version2/GlobalNotification/GlobalNotification.js +5 -1
- package/lib/version2/GlobalNotification/props/propTypes.js +23 -3
- package/lib/version2/lookup/AlertLookup/props/propTypes.js +0 -1
- package/lib/version2/notification/DesktopNotification/DesktopNotification.js +2 -0
- package/lib/version2/notification/DesktopNotification/props/propTypes.js +16 -11
- package/package.json +11 -9
- 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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
;
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|
|
@@ -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;
|