@zohodesk/dot 1.0.0-temp-179 → 1.0.0-temp-175.5
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/propValidation_report.html +1 -1
- 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/IconButton/IconButton.js.html +1 -1
- package/coverage/IconButton/IconButton.module.css.html +1 -1
- package/coverage/IconButton/index.html +1 -1
- package/coverage/IconButton/props/defaultProps.js.html +1 -1
- package/coverage/IconButton/props/index.html +1 -1
- package/coverage/IconButton/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 +16 -16
- package/coverage/coverage-summary.json +16 -16
- package/coverage/index.html +1 -1
- package/es/common/dot_boxShadow.module.css +3 -1
- package/es/list/status/StatusListItem/StatusListItem.js +4 -11
- package/es/list/status/StatusListItem/props/defaultProps.js +1 -2
- package/es/list/status/StatusListItem/props/propTypes.js +1 -3
- package/es/v1/list/status/StatusListItem/StatusListItem.js +4 -11
- package/es/v1/list/status/StatusListItem/props/defaultProps.js +1 -2
- package/es/v1/list/status/StatusListItem/props/propTypes.js +1 -3
- package/es/version2/GlobalNotification/GlobalNotification.js +52 -26
- package/es/version2/GlobalNotification/GlobalNotification.module.css +57 -4
- package/es/version2/GlobalNotification/props/propTypes.js +12 -4
- package/lib/common/dot_boxShadow.module.css +3 -1
- package/lib/list/status/StatusListItem/StatusListItem.js +4 -11
- package/lib/list/status/StatusListItem/props/defaultProps.js +1 -2
- package/lib/list/status/StatusListItem/props/propTypes.js +1 -3
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +4 -11
- package/lib/v1/list/status/StatusListItem/props/defaultProps.js +1 -2
- package/lib/v1/list/status/StatusListItem/props/propTypes.js +1 -3
- package/lib/version2/GlobalNotification/GlobalNotification.js +52 -29
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +57 -4
- package/lib/version2/GlobalNotification/props/propTypes.js +12 -4
- package/package.json +1 -1
- package/result.json +1 -1
|
@@ -35,9 +35,7 @@ export default function StatusListItem(props) {
|
|
|
35
35
|
getRef,
|
|
36
36
|
id,
|
|
37
37
|
onClick,
|
|
38
|
-
onMouseEnter
|
|
39
|
-
customClass,
|
|
40
|
-
children
|
|
38
|
+
onMouseEnter
|
|
41
39
|
} = props;
|
|
42
40
|
let options = {};
|
|
43
41
|
let {
|
|
@@ -72,7 +70,7 @@ export default function StatusListItem(props) {
|
|
|
72
70
|
isCover: false,
|
|
73
71
|
align: "baseline",
|
|
74
72
|
alignBox: "row",
|
|
75
|
-
className: `${style.list} ${style[size]} ${style[palette]} ${active ? style.active : highlight && !isDisabled ? style.hover : ''} ${autoHover && !isDisabled ? style.effect : ''} ${needTick ? style.withTick : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? style.withBorder : ''}
|
|
73
|
+
className: `${style.list} ${style[size]} ${style[palette]} ${active ? style.active : highlight && !isDisabled ? style.hover : ''} ${autoHover && !isDisabled ? style.effect : ''} ${needTick ? style.withTick : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? style.withBorder : ''}`,
|
|
76
74
|
dataId: String(value).replace("'", '_'),
|
|
77
75
|
onClick: !isDisabled && handleClick,
|
|
78
76
|
onMouseEnter: handleMouseEnter,
|
|
@@ -83,16 +81,11 @@ export default function StatusListItem(props) {
|
|
|
83
81
|
}, options), /*#__PURE__*/React.createElement(Box, {
|
|
84
82
|
className: `${style.statusType} ${style[bulletColor]}`
|
|
85
83
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
86
|
-
flexible: true,
|
|
87
|
-
shrink: true
|
|
88
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
89
|
-
alignBox: "row",
|
|
90
|
-
align: needMultiLineText ? 'top' : 'vertical'
|
|
91
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
92
84
|
"data-title": isDisabled ? null : title,
|
|
85
|
+
flexible: true,
|
|
93
86
|
shrink: true,
|
|
94
87
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
95
|
-
}, value),
|
|
88
|
+
}, value), needTick && active ? /*#__PURE__*/React.createElement("div", {
|
|
96
89
|
className: style.tickIcon,
|
|
97
90
|
"aria-hidden": ariaHidden
|
|
98
91
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -8,43 +8,51 @@ import AlertIcons from '../alertIcons/AlertIcons';
|
|
|
8
8
|
import AlertClose from '../AlertClose/AlertClose';
|
|
9
9
|
import style from './GlobalNotification.module.css';
|
|
10
10
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
11
|
+
import { cancelBubblingEffect } from '@zohodesk/components/es/utils/Common';
|
|
11
12
|
export default class GlobalNotification extends React.Component {
|
|
12
13
|
constructor(props) {
|
|
13
14
|
super(props);
|
|
15
|
+
this.hideMessageTimer = null;
|
|
14
16
|
this.state = {
|
|
15
|
-
|
|
17
|
+
shadowClose: true
|
|
16
18
|
};
|
|
19
|
+
this.onClose = this.onClose.bind(this);
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
componentDidMount() {
|
|
20
23
|
let {
|
|
21
|
-
showMessage,
|
|
22
24
|
hideMessage,
|
|
23
|
-
|
|
25
|
+
hideTime,
|
|
26
|
+
id,
|
|
27
|
+
needAutoClose
|
|
24
28
|
} = this.props;
|
|
25
29
|
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}, 3000);
|
|
31
|
-
}
|
|
30
|
+
if (needAutoClose) {
|
|
31
|
+
this.hideMessageTimer = setTimeout(() => {
|
|
32
|
+
hideMessage(id);
|
|
33
|
+
}, hideTime);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
hideMessage
|
|
39
|
-
} = this.props;
|
|
40
|
-
|
|
41
|
-
if (!['danger', 'error', 'warning'].includes(type)) {
|
|
42
|
-
setTimeout(() => {
|
|
43
|
-
hideMessage();
|
|
44
|
-
}, 3000);
|
|
37
|
+
componentWillUnmount() {
|
|
38
|
+
if (this.hideMessageTimer) {
|
|
39
|
+
clearTimeout(this.hideMessageTimer);
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
42
|
|
|
43
|
+
onClose(e) {
|
|
44
|
+
const {
|
|
45
|
+
onClose,
|
|
46
|
+
hideMessage,
|
|
47
|
+
id
|
|
48
|
+
} = this.props;
|
|
49
|
+
this.setState({
|
|
50
|
+
shadowClose: false
|
|
51
|
+
});
|
|
52
|
+
hideMessage && hideMessage(id);
|
|
53
|
+
onClose && onClose(e);
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
render() {
|
|
49
57
|
let {
|
|
50
58
|
type,
|
|
@@ -53,8 +61,15 @@ export default class GlobalNotification extends React.Component {
|
|
|
53
61
|
onClick,
|
|
54
62
|
i18nKeys = {},
|
|
55
63
|
customProps,
|
|
56
|
-
dataSelectorId
|
|
64
|
+
dataSelectorId,
|
|
65
|
+
id,
|
|
66
|
+
needShadow,
|
|
67
|
+
shadowCount,
|
|
68
|
+
eleRef
|
|
57
69
|
} = this.props;
|
|
70
|
+
let {
|
|
71
|
+
shadowClose
|
|
72
|
+
} = this.state;
|
|
58
73
|
let {
|
|
59
74
|
closeTitle = 'Close'
|
|
60
75
|
} = i18nKeys;
|
|
@@ -65,7 +80,12 @@ export default class GlobalNotification extends React.Component {
|
|
|
65
80
|
onClick: onClick,
|
|
66
81
|
closeTitle: closeTitle,
|
|
67
82
|
customProps: customProps,
|
|
68
|
-
dataSelectorId: dataSelectorId
|
|
83
|
+
dataSelectorId: dataSelectorId,
|
|
84
|
+
id: id,
|
|
85
|
+
shadowCount: shadowCount,
|
|
86
|
+
onClose: this.onClose,
|
|
87
|
+
needShadow: shadowClose && needShadow,
|
|
88
|
+
eleRef: eleRef
|
|
69
89
|
});
|
|
70
90
|
}
|
|
71
91
|
|
|
@@ -81,10 +101,9 @@ GlobalNotification.defaultProps = defaultProps; // if (__DOCS__) {
|
|
|
81
101
|
export function GlobalNotificationUI(props) {
|
|
82
102
|
function onClose(e) {
|
|
83
103
|
let {
|
|
84
|
-
hideMessage,
|
|
85
104
|
onClose
|
|
86
105
|
} = props;
|
|
87
|
-
|
|
106
|
+
cancelBubblingEffect(e);
|
|
88
107
|
onClose && onClose(e);
|
|
89
108
|
}
|
|
90
109
|
|
|
@@ -94,13 +113,20 @@ export function GlobalNotificationUI(props) {
|
|
|
94
113
|
onClick,
|
|
95
114
|
closeTitle = '',
|
|
96
115
|
customProps = {},
|
|
97
|
-
dataSelectorId
|
|
116
|
+
dataSelectorId,
|
|
117
|
+
shadowCount,
|
|
118
|
+
needShadow,
|
|
119
|
+
eleRef
|
|
98
120
|
} = props;
|
|
99
121
|
let {
|
|
100
122
|
ExtraProps = {}
|
|
101
123
|
} = customProps;
|
|
102
124
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
103
|
-
|
|
125
|
+
ref: eleRef,
|
|
126
|
+
className: ` ${style.message}
|
|
127
|
+
${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
|
|
128
|
+
${type ? style[type] : ''}
|
|
129
|
+
`,
|
|
104
130
|
"data-id": `show_${type}_message`,
|
|
105
131
|
"data-test-id": `show_${type}_message`,
|
|
106
132
|
tabIndex: 0,
|
|
@@ -11,19 +11,70 @@
|
|
|
11
11
|
position: absolute;
|
|
12
12
|
top: 0 ;
|
|
13
13
|
z-index: 1000;
|
|
14
|
-
/*Hook for editor alert*/
|
|
15
14
|
pointer-events: none;
|
|
15
|
+
width: var(--zd_size420) ;
|
|
16
16
|
text-align: center;
|
|
17
|
+
margin: auto ;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
[dir=ltr] .message {
|
|
20
|
-
right: 0 ;
|
|
21
21
|
left: 0 ;
|
|
22
|
+
right: 0 ;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
[dir=rtl] .message {
|
|
25
|
-
left: 0 ;
|
|
26
26
|
right: 0 ;
|
|
27
|
+
left: 0 ;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.stackShadowOne::after,
|
|
31
|
+
.stackShadowTwo::before {
|
|
32
|
+
content: '';
|
|
33
|
+
position: absolute;
|
|
34
|
+
/* css:theme-validation:ignore */
|
|
35
|
+
height: var(--zd_size20) ;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.stackShadowOne::after, .stackShadowTwo::before {
|
|
39
|
+
background-color: var(--globalnotification_bg_color);
|
|
40
|
+
border-radius: 0 0 6px 6px;
|
|
41
|
+
box-shadow: var(--zd_bs_globalnotification_container);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[dir=ltr] .stackShadowOne::after, [dir=ltr] .stackShadowTwo::before {
|
|
45
|
+
left: 50% ;
|
|
46
|
+
right: 50% ;
|
|
47
|
+
transform: translate(-50%);
|
|
48
|
+
animation: behindInfo 0.8s forwards;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[dir=rtl] .stackShadowOne::after, [dir=rtl] .stackShadowTwo::before {
|
|
52
|
+
right: 50% ;
|
|
53
|
+
left: 50% ;
|
|
54
|
+
transform: translate(50%);
|
|
55
|
+
animation: behindInfo 0.8s forwards;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.stackShadowTwo::before {
|
|
59
|
+
width: 90% ;
|
|
60
|
+
bottom: calc( var(--zd_size10) * -1 ) ;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.stackShadowOne::after {
|
|
64
|
+
width: 95% ;
|
|
65
|
+
bottom: calc( var(--zd_size5) * -1 ) ;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes behindInfo {
|
|
69
|
+
|
|
70
|
+
0%,
|
|
71
|
+
40% {
|
|
72
|
+
opacity: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
100% {
|
|
76
|
+
opacity: 1;
|
|
77
|
+
}
|
|
27
78
|
}
|
|
28
79
|
|
|
29
80
|
.container {
|
|
@@ -33,8 +84,9 @@
|
|
|
33
84
|
/* css:theme-validation:ignore */
|
|
34
85
|
/* css:theme-validation:ignore */
|
|
35
86
|
color: var(--globalnotification_text_color);
|
|
36
|
-
|
|
87
|
+
z-index: 1;
|
|
37
88
|
composes: wbreak from '~@zohodesk/components/lib/common/common.module.css';
|
|
89
|
+
width: 100% ;
|
|
38
90
|
box-shadow: var(--zd_bs_globalnotification_container);
|
|
39
91
|
border-radius: 0 0 var(--zd_size10) var(--zd_size10);
|
|
40
92
|
background-color: var(--globalnotification_bg_color);
|
|
@@ -103,6 +155,7 @@
|
|
|
103
155
|
font-family: var(--zd_semibold);
|
|
104
156
|
composes: ftsmooth from '~@zohodesk/components/lib/common/common.module.css';
|
|
105
157
|
line-height: 1.4286;
|
|
158
|
+
overflow: hidden;
|
|
106
159
|
}
|
|
107
160
|
|
|
108
161
|
[dir=ltr] .text {
|
|
@@ -9,19 +9,27 @@ export const propTypes = {
|
|
|
9
9
|
i18nKeys: PropTypes.object,
|
|
10
10
|
customProps: PropTypes.shape({
|
|
11
11
|
ExtraProps: PropTypes.object
|
|
12
|
-
})
|
|
12
|
+
}),
|
|
13
|
+
id: PropTypes.number,
|
|
14
|
+
hideTime: PropTypes.number,
|
|
15
|
+
needAutoClose: PropTypes.bool,
|
|
16
|
+
isCollapseView: PropTypes.bool,
|
|
17
|
+
shadowCount: PropTypes.number,
|
|
18
|
+
needShadow: PropTypes.bool
|
|
13
19
|
};
|
|
14
20
|
export const UI_propTypes = {
|
|
15
21
|
dataSelectorId: PropTypes.string,
|
|
16
|
-
onClose: PropTypes.func,
|
|
17
22
|
closeTitle: PropTypes.string,
|
|
18
|
-
hideMessage: PropTypes.func,
|
|
19
23
|
message: PropTypes.string,
|
|
20
24
|
onClick: PropTypes.func,
|
|
21
25
|
type: PropTypes.oneOf(['success', 'danger', 'info', 'warning', 'error']),
|
|
22
26
|
customProps: PropTypes.shape({
|
|
23
27
|
ExtraProps: PropTypes.object
|
|
24
|
-
})
|
|
28
|
+
}),
|
|
29
|
+
needShadow: PropTypes.bool,
|
|
30
|
+
shadowCount: PropTypes.number,
|
|
31
|
+
id: PropTypes.number,
|
|
32
|
+
onClose: PropTypes.func
|
|
25
33
|
};
|
|
26
34
|
export const new_propTypes = {
|
|
27
35
|
Element: PropTypes.element,
|
|
@@ -31,8 +31,10 @@
|
|
|
31
31
|
--zd_bs_toastmessage_container: var(--zd_bs_contrast_outline, 0 5px 40px 7px var(--zdt_toastmessage_default_box_shadow));
|
|
32
32
|
|
|
33
33
|
/* global notification */
|
|
34
|
-
--zd_bs_globalnotification_container: var(--zd_bs_contrast_outline,
|
|
34
|
+
--zd_bs_globalnotification_container: var(--zd_bs_contrast_outline, 0px 4px 4px 0px var(--zdt_message_default_box_shadow));
|
|
35
35
|
|
|
36
36
|
/* desktop notification */
|
|
37
37
|
--zd_bs_desktopnotification_container: var(--zd_bs_contrast_outline, 0 4px 20px var(--zdt_desktopnotification_box_shadow));
|
|
38
|
+
|
|
39
|
+
|
|
38
40
|
}
|
|
@@ -112,9 +112,7 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
112
112
|
isDisabled = _this$props4.isDisabled,
|
|
113
113
|
bulletColor = _this$props4.bulletColor,
|
|
114
114
|
a11y = _this$props4.a11y,
|
|
115
|
-
needMultiLineText = _this$props4.needMultiLineText
|
|
116
|
-
customClass = _this$props4.customClass,
|
|
117
|
-
children = _this$props4.children;
|
|
115
|
+
needMultiLineText = _this$props4.needMultiLineText;
|
|
118
116
|
var options = {};
|
|
119
117
|
var role = a11y.role,
|
|
120
118
|
ariaSelected = a11y.ariaSelected,
|
|
@@ -132,7 +130,7 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
132
130
|
isCover: false,
|
|
133
131
|
align: "baseline",
|
|
134
132
|
alignBox: "row",
|
|
135
|
-
className: "".concat(_StatusListItemModule["default"].list, " ").concat(_StatusListItemModule["default"][size], " ").concat(_StatusListItemModule["default"][palette], " ").concat(active ? _StatusListItemModule["default"].active : highlight && !isDisabled ? _StatusListItemModule["default"].hover : '', " ").concat(autoHover && !isDisabled ? _StatusListItemModule["default"].effect : '', " ").concat(needTick ? _StatusListItemModule["default"].withTick : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? _StatusListItemModule["default"].withBorder : ''
|
|
133
|
+
className: "".concat(_StatusListItemModule["default"].list, " ").concat(_StatusListItemModule["default"][size], " ").concat(_StatusListItemModule["default"][palette], " ").concat(active ? _StatusListItemModule["default"].active : highlight && !isDisabled ? _StatusListItemModule["default"].hover : '', " ").concat(autoHover && !isDisabled ? _StatusListItemModule["default"].effect : '', " ").concat(needTick ? _StatusListItemModule["default"].withTick : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? _StatusListItemModule["default"].withBorder : ''),
|
|
136
134
|
dataId: String(value).replace("'", '_'),
|
|
137
135
|
onClick: !isDisabled && this.handleClick,
|
|
138
136
|
onMouseEnter: this.handleMouseEnter,
|
|
@@ -143,16 +141,11 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
143
141
|
}, options), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
144
142
|
className: "".concat(_StatusListItemModule["default"].statusType, " ").concat(_StatusListItemModule["default"][bulletColor])
|
|
145
143
|
}), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
146
|
-
flexible: true,
|
|
147
|
-
shrink: true
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
149
|
-
alignBox: "row",
|
|
150
|
-
align: needMultiLineText ? 'top' : 'vertical'
|
|
151
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
152
144
|
"data-title": isDisabled ? null : title,
|
|
145
|
+
flexible: true,
|
|
153
146
|
shrink: true,
|
|
154
147
|
className: needMultiLineText ? _StatusListItemModule["default"].multiLineValue : _StatusListItemModule["default"].value
|
|
155
|
-
}, value),
|
|
148
|
+
}, value), needTick && active ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
156
149
|
className: _StatusListItemModule["default"].tickIcon,
|
|
157
150
|
"aria-hidden": ariaHidden
|
|
158
151
|
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
@@ -35,8 +35,6 @@ var propTypes = {
|
|
|
35
35
|
role: _propTypes["default"].string,
|
|
36
36
|
ariaSelected: _propTypes["default"].bool,
|
|
37
37
|
ariaHidden: _propTypes["default"].bool
|
|
38
|
-
})
|
|
39
|
-
customClass: _propTypes["default"].string,
|
|
40
|
-
children: _propTypes["default"].node
|
|
38
|
+
})
|
|
41
39
|
};
|
|
42
40
|
exports.propTypes = propTypes;
|
|
@@ -51,9 +51,7 @@ function StatusListItem(props) {
|
|
|
51
51
|
getRef = props.getRef,
|
|
52
52
|
id = props.id,
|
|
53
53
|
onClick = props.onClick,
|
|
54
|
-
onMouseEnter = props.onMouseEnter
|
|
55
|
-
customClass = props.customClass,
|
|
56
|
-
children = props.children;
|
|
54
|
+
onMouseEnter = props.onMouseEnter;
|
|
57
55
|
var options = {};
|
|
58
56
|
var role = a11y.role,
|
|
59
57
|
ariaSelected = a11y.ariaSelected,
|
|
@@ -86,7 +84,7 @@ function StatusListItem(props) {
|
|
|
86
84
|
isCover: false,
|
|
87
85
|
align: "baseline",
|
|
88
86
|
alignBox: "row",
|
|
89
|
-
className: "".concat(_StatusListItemModule["default"].list, " ").concat(_StatusListItemModule["default"][size], " ").concat(_StatusListItemModule["default"][palette], " ").concat(active ? _StatusListItemModule["default"].active : highlight && !isDisabled ? _StatusListItemModule["default"].hover : '', " ").concat(autoHover && !isDisabled ? _StatusListItemModule["default"].effect : '', " ").concat(needTick ? _StatusListItemModule["default"].withTick : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? _StatusListItemModule["default"].withBorder : ''
|
|
87
|
+
className: "".concat(_StatusListItemModule["default"].list, " ").concat(_StatusListItemModule["default"][size], " ").concat(_StatusListItemModule["default"][palette], " ").concat(active ? _StatusListItemModule["default"].active : highlight && !isDisabled ? _StatusListItemModule["default"].hover : '', " ").concat(autoHover && !isDisabled ? _StatusListItemModule["default"].effect : '', " ").concat(needTick ? _StatusListItemModule["default"].withTick : '', " ").concat(isDisabled ? (0, _CssProvider["default"])('isDisable') : '', " ").concat(needBorder ? _StatusListItemModule["default"].withBorder : ''),
|
|
90
88
|
dataId: String(value).replace("'", '_'),
|
|
91
89
|
onClick: !isDisabled && handleClick,
|
|
92
90
|
onMouseEnter: handleMouseEnter,
|
|
@@ -97,16 +95,11 @@ function StatusListItem(props) {
|
|
|
97
95
|
}, options), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
98
96
|
className: "".concat(_StatusListItemModule["default"].statusType, " ").concat(_StatusListItemModule["default"][bulletColor])
|
|
99
97
|
}), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
100
|
-
flexible: true,
|
|
101
|
-
shrink: true
|
|
102
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
103
|
-
alignBox: "row",
|
|
104
|
-
align: needMultiLineText ? 'top' : 'vertical'
|
|
105
|
-
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
106
98
|
"data-title": isDisabled ? null : title,
|
|
99
|
+
flexible: true,
|
|
107
100
|
shrink: true,
|
|
108
101
|
className: needMultiLineText ? _StatusListItemModule["default"].multiLineValue : _StatusListItemModule["default"].value
|
|
109
|
-
}, value),
|
|
102
|
+
}, value), needTick && active ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
103
|
className: _StatusListItemModule["default"].tickIcon,
|
|
111
104
|
"aria-hidden": ariaHidden
|
|
112
105
|
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
@@ -35,8 +35,6 @@ var propTypes = {
|
|
|
35
35
|
role: _propTypes["default"].string,
|
|
36
36
|
ariaSelected: _propTypes["default"].bool,
|
|
37
37
|
ariaHidden: _propTypes["default"].bool
|
|
38
|
-
})
|
|
39
|
-
customClass: _propTypes["default"].string,
|
|
40
|
-
children: _propTypes["default"].node
|
|
38
|
+
})
|
|
41
39
|
};
|
|
42
40
|
exports.propTypes = propTypes;
|
|
@@ -25,6 +25,8 @@ var _GlobalNotificationModule = _interopRequireDefault(require("./GlobalNotifica
|
|
|
25
25
|
|
|
26
26
|
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
27
27
|
|
|
28
|
+
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
31
|
|
|
30
32
|
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); }
|
|
@@ -60,41 +62,49 @@ var GlobalNotification = /*#__PURE__*/function (_React$Component) {
|
|
|
60
62
|
_classCallCheck(this, GlobalNotification);
|
|
61
63
|
|
|
62
64
|
_this = _super.call(this, props);
|
|
65
|
+
_this.hideMessageTimer = null;
|
|
63
66
|
_this.state = {
|
|
64
|
-
|
|
67
|
+
shadowClose: true
|
|
65
68
|
};
|
|
69
|
+
_this.onClose = _this.onClose.bind(_assertThisInitialized(_this));
|
|
66
70
|
return _this;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
_createClass(GlobalNotification, [{
|
|
70
|
-
key: "
|
|
71
|
-
value: function
|
|
74
|
+
key: "componentDidMount",
|
|
75
|
+
value: function componentDidMount() {
|
|
72
76
|
var _this$props = this.props,
|
|
73
|
-
showMessage = _this$props.showMessage,
|
|
74
77
|
hideMessage = _this$props.hideMessage,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
78
|
+
hideTime = _this$props.hideTime,
|
|
79
|
+
id = _this$props.id,
|
|
80
|
+
needAutoClose = _this$props.needAutoClose;
|
|
81
|
+
|
|
82
|
+
if (needAutoClose) {
|
|
83
|
+
this.hideMessageTimer = setTimeout(function () {
|
|
84
|
+
hideMessage(id);
|
|
85
|
+
}, hideTime);
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
88
|
}, {
|
|
86
|
-
key: "
|
|
87
|
-
value: function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
hideMessage = _this$props2.hideMessage;
|
|
91
|
-
|
|
92
|
-
if (!['danger', 'error', 'warning'].includes(type)) {
|
|
93
|
-
setTimeout(function () {
|
|
94
|
-
hideMessage();
|
|
95
|
-
}, 3000);
|
|
89
|
+
key: "componentWillUnmount",
|
|
90
|
+
value: function componentWillUnmount() {
|
|
91
|
+
if (this.hideMessageTimer) {
|
|
92
|
+
clearTimeout(this.hideMessageTimer);
|
|
96
93
|
}
|
|
97
94
|
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "onClose",
|
|
97
|
+
value: function onClose(e) {
|
|
98
|
+
var _this$props2 = this.props,
|
|
99
|
+
onClose = _this$props2.onClose,
|
|
100
|
+
hideMessage = _this$props2.hideMessage,
|
|
101
|
+
id = _this$props2.id;
|
|
102
|
+
this.setState({
|
|
103
|
+
shadowClose: false
|
|
104
|
+
});
|
|
105
|
+
hideMessage && hideMessage(id);
|
|
106
|
+
onClose && onClose(e);
|
|
107
|
+
}
|
|
98
108
|
}, {
|
|
99
109
|
key: "render",
|
|
100
110
|
value: function render() {
|
|
@@ -106,7 +116,12 @@ var GlobalNotification = /*#__PURE__*/function (_React$Component) {
|
|
|
106
116
|
_this$props3$i18nKeys = _this$props3.i18nKeys,
|
|
107
117
|
i18nKeys = _this$props3$i18nKeys === void 0 ? {} : _this$props3$i18nKeys,
|
|
108
118
|
customProps = _this$props3.customProps,
|
|
109
|
-
dataSelectorId = _this$props3.dataSelectorId
|
|
119
|
+
dataSelectorId = _this$props3.dataSelectorId,
|
|
120
|
+
id = _this$props3.id,
|
|
121
|
+
needShadow = _this$props3.needShadow,
|
|
122
|
+
shadowCount = _this$props3.shadowCount,
|
|
123
|
+
eleRef = _this$props3.eleRef;
|
|
124
|
+
var shadowClose = this.state.shadowClose;
|
|
110
125
|
var _i18nKeys$closeTitle = i18nKeys.closeTitle,
|
|
111
126
|
closeTitle = _i18nKeys$closeTitle === void 0 ? 'Close' : _i18nKeys$closeTitle;
|
|
112
127
|
return /*#__PURE__*/_react["default"].createElement(GlobalNotificationUI, {
|
|
@@ -116,7 +131,12 @@ var GlobalNotification = /*#__PURE__*/function (_React$Component) {
|
|
|
116
131
|
onClick: onClick,
|
|
117
132
|
closeTitle: closeTitle,
|
|
118
133
|
customProps: customProps,
|
|
119
|
-
dataSelectorId: dataSelectorId
|
|
134
|
+
dataSelectorId: dataSelectorId,
|
|
135
|
+
id: id,
|
|
136
|
+
shadowCount: shadowCount,
|
|
137
|
+
onClose: this.onClose,
|
|
138
|
+
needShadow: shadowClose && needShadow,
|
|
139
|
+
eleRef: eleRef
|
|
120
140
|
});
|
|
121
141
|
}
|
|
122
142
|
}]);
|
|
@@ -135,9 +155,8 @@ GlobalNotification.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
|
|
|
135
155
|
|
|
136
156
|
function GlobalNotificationUI(props) {
|
|
137
157
|
function onClose(e) {
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
hideMessage && hideMessage(e);
|
|
158
|
+
var onClose = props.onClose;
|
|
159
|
+
(0, _Common.cancelBubblingEffect)(e);
|
|
141
160
|
onClose && onClose(e);
|
|
142
161
|
}
|
|
143
162
|
|
|
@@ -149,11 +168,15 @@ function GlobalNotificationUI(props) {
|
|
|
149
168
|
closeTitle = _props$closeTitle === void 0 ? '' : _props$closeTitle,
|
|
150
169
|
_props$customProps = props.customProps,
|
|
151
170
|
customProps = _props$customProps === void 0 ? {} : _props$customProps,
|
|
152
|
-
dataSelectorId = props.dataSelectorId
|
|
171
|
+
dataSelectorId = props.dataSelectorId,
|
|
172
|
+
shadowCount = props.shadowCount,
|
|
173
|
+
needShadow = props.needShadow,
|
|
174
|
+
eleRef = props.eleRef;
|
|
153
175
|
var _customProps$ExtraPro = customProps.ExtraProps,
|
|
154
176
|
ExtraProps = _customProps$ExtraPro === void 0 ? {} : _customProps$ExtraPro;
|
|
155
177
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
156
|
-
|
|
178
|
+
ref: eleRef,
|
|
179
|
+
className: " ".concat(_GlobalNotificationModule["default"].message, " \n ").concat(needShadow && shadowCount >= 2 ? shadowCount > 2 ? "".concat(_GlobalNotificationModule["default"].stackShadowTwo, " ").concat(_GlobalNotificationModule["default"].stackShadowOne) : _GlobalNotificationModule["default"].stackShadowOne : '', "\n ").concat(type ? _GlobalNotificationModule["default"][type] : '', "\n "),
|
|
157
180
|
"data-id": "show_".concat(type, "_message"),
|
|
158
181
|
"data-test-id": "show_".concat(type, "_message"),
|
|
159
182
|
tabIndex: 0,
|