@zohodesk/dot 1.2.0 → 1.2.2
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 +38 -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/coverage-final.json +12 -12
- package/coverage/coverage-summary.json +12 -12
- 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/Attachment.js +2 -1
- package/es/Attachment/Attachment.module.css +10 -6
- package/es/Attachment/props/propTypes.js +2 -1
- package/es/Drawer/props/propTypes.js +2 -1
- package/es/Link/Link.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/CommonEmptyState/CommonEmptyState.js +1 -0
- 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/AddNewIcon.js +3 -2
- package/es/list/Icons/CompleteIcon.js +3 -2
- package/es/list/Icons/DeleteIcon.js +4 -3
- package/es/list/Icons/EditIcon.js +5 -3
- package/es/list/Icons/ReadUnreadIcon.js +5 -3
- package/es/list/Icons/SmartIcon.js +5 -3
- package/es/list/Icons/props/propTypes.js +0 -2
- package/es/list/ListLayout/ListLayout.module.css +24 -8
- package/es/list/SecondaryText/props/propTypes.js +0 -1
- package/es/list/UserTime/props/propTypes.js +5 -1
- package/es/list/listCommon.module.css +23 -5
- package/es/list/status/StatusDropdown/StatusDropdown.js +12 -2
- package/es/list/status/StatusDropdown/props/propTypes.js +3 -1
- package/es/lookup/Lookup/Lookup.js +2 -0
- 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/AlertLookup.js +14 -2
- 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/Attachment.js +2 -1
- package/lib/Attachment/Attachment.module.css +10 -6
- package/lib/Attachment/props/propTypes.js +2 -1
- package/lib/Drawer/props/propTypes.js +2 -1
- package/lib/Link/Link.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/CommonEmptyState/CommonEmptyState.js +1 -0
- 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/AddNewIcon.js +4 -2
- package/lib/list/Icons/CompleteIcon.js +4 -2
- package/lib/list/Icons/DeleteIcon.js +5 -3
- package/lib/list/Icons/EditIcon.js +6 -3
- package/lib/list/Icons/ReadUnreadIcon.js +6 -3
- package/lib/list/Icons/SmartIcon.js +6 -3
- package/lib/list/Icons/props/propTypes.js +0 -2
- package/lib/list/ListLayout/ListLayout.module.css +24 -8
- package/lib/list/SecondaryText/props/propTypes.js +0 -1
- package/lib/list/UserTime/props/propTypes.js +5 -1
- package/lib/list/listCommon.module.css +23 -5
- package/lib/list/status/StatusDropdown/StatusDropdown.js +12 -2
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/lookup/Lookup/Lookup.js +2 -0
- 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/AlertLookup.js +14 -2
- 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 +12 -10
- package/result.json +1 -1
|
@@ -2,59 +2,77 @@
|
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
}
|
|
5
|
+
|
|
5
6
|
.inlineFlex {
|
|
6
7
|
composes: dInflex alignVertical from '~@zohodesk/components/lib/common/common.module.css';
|
|
7
8
|
}
|
|
9
|
+
|
|
8
10
|
[dir=ltr] .avatarMargin {
|
|
9
11
|
margin-right: var(--zd_size25) ;
|
|
10
12
|
}
|
|
13
|
+
|
|
11
14
|
[dir=rtl] .avatarMargin {
|
|
12
15
|
margin-left: var(--zd_size25) ;
|
|
13
16
|
}
|
|
17
|
+
|
|
14
18
|
.subject {
|
|
15
19
|
composes: dotted from '~@zohodesk/components/lib/common/common.module.css';
|
|
16
20
|
font-size: var(--zd_font_size16) ;
|
|
17
21
|
}
|
|
22
|
+
|
|
18
23
|
.secondaryPanel {
|
|
19
24
|
line-height: var(--zd_size18);
|
|
20
25
|
composes: dflex alignVertical flexwrap from '~@zohodesk/components/lib/common/common.module.css';
|
|
21
26
|
}
|
|
27
|
+
|
|
22
28
|
.statusColumn {
|
|
23
29
|
composes: inlineBlockMiddle;
|
|
24
30
|
}
|
|
31
|
+
|
|
25
32
|
[dir=ltr] .statusColumn {
|
|
26
33
|
text-align: right;
|
|
27
34
|
}
|
|
35
|
+
|
|
28
36
|
[dir=rtl] .statusColumn {
|
|
29
37
|
text-align: left;
|
|
30
38
|
}
|
|
39
|
+
|
|
31
40
|
.classic .floatingIconContainer {
|
|
32
41
|
display: none;
|
|
33
42
|
}
|
|
43
|
+
|
|
34
44
|
.compact .floatingIconContainer,
|
|
35
45
|
.superCompact .floatingIconContainer,
|
|
36
46
|
.listContainer:hover .classic .floatingIconContainer,
|
|
37
|
-
.hoveredStyle .classic .floatingIconContainer
|
|
47
|
+
.hoveredStyle .classic .floatingIconContainer,
|
|
48
|
+
.compact:focus-within .floatingIconContainer,
|
|
49
|
+
.superCompact:focus-within .floatingIconContainer,
|
|
50
|
+
.listContainer:focus-within .classic .floatingIconContainer,
|
|
51
|
+
.hoveredStyle .classic:focus-within .floatingIconContainer {
|
|
38
52
|
display: inline-flex;
|
|
39
53
|
align-items: center;
|
|
40
54
|
}
|
|
55
|
+
|
|
41
56
|
.compact .floatingIconContainer,
|
|
42
57
|
.superCompact .floatingIconContainer {
|
|
43
58
|
opacity: 0;
|
|
44
59
|
visibility: hidden;
|
|
45
60
|
}
|
|
61
|
+
|
|
46
62
|
.floatingIcons {
|
|
47
63
|
font-size: var(--zd_font_size15) ;
|
|
48
64
|
}
|
|
49
|
-
|
|
65
|
+
|
|
66
|
+
.listContainer,
|
|
67
|
+
.listLayoutContainer {
|
|
50
68
|
position: relative;
|
|
51
69
|
transition: var(--zd_transition3) all ease;
|
|
52
70
|
}
|
|
71
|
+
|
|
53
72
|
.listContainer:hover .compact .floatingIconContainer,
|
|
54
73
|
.listContainer:hover .superCompact .floatingIconContainer,
|
|
55
74
|
.hoveredStyle .compact .floatingIconContainer,
|
|
56
|
-
.hoveredStyle .superCompact .floatingIconContainer
|
|
57
|
-
{
|
|
75
|
+
.hoveredStyle .superCompact .floatingIconContainer {
|
|
58
76
|
opacity: 1;
|
|
59
77
|
visibility: visible;
|
|
60
|
-
}
|
|
78
|
+
}
|
|
@@ -306,8 +306,14 @@ export class StatusDropdown extends React.Component {
|
|
|
306
306
|
statusColor,
|
|
307
307
|
needExternalPopupState = false,
|
|
308
308
|
isPopupActive = false,
|
|
309
|
-
needMultiLineText
|
|
309
|
+
needMultiLineText,
|
|
310
|
+
a11y = {}
|
|
310
311
|
} = this.props;
|
|
312
|
+
const {
|
|
313
|
+
tabIndex = 0,
|
|
314
|
+
ariaLabelledby,
|
|
315
|
+
ariaLabel
|
|
316
|
+
} = a11y;
|
|
311
317
|
let isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
|
|
312
318
|
let {
|
|
313
319
|
searchString
|
|
@@ -330,7 +336,11 @@ export class StatusDropdown extends React.Component {
|
|
|
330
336
|
onClick: removeClose,
|
|
331
337
|
disabled: isDisabled || isReadOnly ? true : false,
|
|
332
338
|
"aria-haspopup": true,
|
|
333
|
-
"aria-expanded": isPopupOpen && isEditable ? true : false
|
|
339
|
+
"aria-expanded": isPopupOpen && isEditable ? true : false,
|
|
340
|
+
tabIndex: tabIndex,
|
|
341
|
+
"aria-labelledby": ariaLabelledby,
|
|
342
|
+
"aria-label": ariaLabel,
|
|
343
|
+
"aria-disabled": isDisabled || isReadOnly
|
|
334
344
|
}, isEditable ? /*#__PURE__*/React.createElement("div", {
|
|
335
345
|
className: style.hiddenInput
|
|
336
346
|
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
@@ -60,6 +60,7 @@ export default class Lookup extends Component {
|
|
|
60
60
|
role = 'dialog',
|
|
61
61
|
ariaLabelledby,
|
|
62
62
|
ariaDescribedby,
|
|
63
|
+
ariaLabel,
|
|
63
64
|
ariaModal = isActive ? true : undefined
|
|
64
65
|
} = a11y;
|
|
65
66
|
const {
|
|
@@ -79,6 +80,7 @@ export default class Lookup extends Component {
|
|
|
79
80
|
role: role,
|
|
80
81
|
"aria-labelledby": ariaLabelledby,
|
|
81
82
|
"aria-describedby": ariaDescribedby,
|
|
83
|
+
"aria-label": ariaLabel,
|
|
82
84
|
"aria-modal": ariaModal,
|
|
83
85
|
id: htmlId,
|
|
84
86
|
className: `${style.box} ${style[`${size}Size`]}`,
|
|
@@ -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;
|