@zohodesk/dot 1.0.0-temp-203.5 → 1.0.0-temp-203.6
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/PropLessFiles.html +1 -1
- package/.cli/PropUnificationExcludeFilesArray.js +0 -3
- package/.cli/UnValidatedFiles.html +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +15 -0
- package/assets/Appearance/dark/mode/Dot_DarkMode.module.css +0 -3
- package/assets/Appearance/dark/themes/blue/blue_DotTheme_DarkTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/green/green_DotTheme_DarkTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/orange/orange_DotTheme_DarkTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/red/red_DotTheme_DarkTheme.module.css +3 -0
- package/assets/Appearance/dark/themes/yellow/yellow_DotTheme_DarkTheme.module.css +3 -0
- package/assets/Appearance/light/mode/Dot_LightMode.module.css +0 -3
- package/assets/Appearance/light/themes/blue/blue_DotTheme_LightTheme.module.css +3 -0
- package/assets/Appearance/light/themes/green/green_DotTheme_LightTheme.module.css +3 -0
- package/assets/Appearance/light/themes/orange/orange_DotTheme_LightTheme.module.css +3 -0
- package/assets/Appearance/light/themes/red/red_DotTheme_LightTheme.module.css +3 -0
- package/assets/Appearance/light/themes/yellow/yellow_DotTheme_LightTheme.module.css +3 -0
- package/assets/Appearance/pureDark/mode/Dot_PureDarkMode.module.css +0 -3
- package/assets/Appearance/pureDark/themes/blue/blue_DotTheme_PureDarkTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/green/green_DotTheme_PureDarkTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/orange/orange_DotTheme_PureDarkTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/red/red_DotTheme_PureDarkTheme.module.css +3 -0
- package/assets/Appearance/pureDark/themes/yellow/yellow_DotTheme_PureDarkTheme.module.css +3 -0
- package/es/AttachmentViewer/AttachmentViewer.js +7 -2
- package/es/AttachmentViewer/props/defaultProps.js +2 -1
- package/es/AttachmentViewer/props/propTypes.js +5 -1
- package/es/ChannelIcon/ChannelIcon.js +15 -5
- package/es/ChannelIcon/props/defaultProps.js +2 -1
- package/es/ChannelIcon/props/propTypes.js +9 -1
- package/es/Loader/Loader.module.css +8 -7
- package/es/PlusIcon/PlusIcon.js +4 -2
- package/es/PlusIcon/props/defaultProps.js +2 -1
- package/es/PlusIcon/props/propTypes.js +3 -1
- package/es/utils/getCurrentTime.js +10 -0
- package/es/version2/GlobalNotification/GlobalNotification.js +48 -8
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +6 -3
- package/lib/AttachmentViewer/props/defaultProps.js +2 -1
- package/lib/AttachmentViewer/props/propTypes.js +6 -1
- package/lib/ChannelIcon/ChannelIcon.js +15 -6
- package/lib/ChannelIcon/props/defaultProps.js +2 -1
- package/lib/ChannelIcon/props/propTypes.js +12 -1
- package/lib/Loader/Loader.module.css +8 -7
- package/lib/PlusIcon/PlusIcon.js +4 -2
- package/lib/PlusIcon/props/defaultProps.js +2 -1
- package/lib/PlusIcon/props/propTypes.js +4 -1
- package/lib/utils/getCurrentTime.js +17 -0
- package/lib/version2/GlobalNotification/GlobalNotification.js +75 -24
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +1 -1
- package/package.json +6 -9
- package/propValidationArg.json +1 -1
- package/result.json +1 -1
- package/unittest/index.html +1 -1
- package/es/services/components/Attachment/AttachmentViewer.js +0 -24
- package/es/services/components/Attachment/AttachmentViewerWrapper.js +0 -114
- package/es/services/components/Attachment/props/defaultProps.js +0 -4
- package/es/services/components/Attachment/props/propTypes.js +0 -9
- package/es/services/components/ToastNotification/ToastNotification.js +0 -43
- package/es/services/components/ToastNotification/ToastNotificationWrapper.js +0 -156
- package/es/services/components/ToastNotification/ToastNotificationWrapper.module.css +0 -193
- package/es/services/components/ToastNotification/props/defaultProps.js +0 -12
- package/es/services/components/ToastNotification/props/propTypes.js +0 -17
- package/es/services/context/DOTAttachmentService.js +0 -15
- package/es/services/context/DOTToastNotificationService.js +0 -16
- package/es/services/helpers/utils.js +0 -60
- package/es/utils/constants.js +0 -3
- package/lib/services/components/Attachment/AttachmentViewer.js +0 -41
- package/lib/services/components/Attachment/AttachmentViewerWrapper.js +0 -137
- package/lib/services/components/Attachment/props/defaultProps.js +0 -11
- package/lib/services/components/Attachment/props/propTypes.js +0 -20
- package/lib/services/components/ToastNotification/ToastNotification.js +0 -55
- package/lib/services/components/ToastNotification/ToastNotificationWrapper.js +0 -207
- package/lib/services/components/ToastNotification/ToastNotificationWrapper.module.css +0 -193
- package/lib/services/components/ToastNotification/props/defaultProps.js +0 -19
- package/lib/services/components/ToastNotification/props/propTypes.js +0 -28
- package/lib/services/context/DOTAttachmentService.js +0 -32
- package/lib/services/context/DOTToastNotificationService.js +0 -33
- package/lib/services/helpers/utils.js +0 -67
- package/lib/utils/constants.js +0 -14
- /package/es/version2/GlobalNotification/{v2GlobalNotification.module.css → GlobalNotification.module.css} +0 -0
- /package/lib/version2/GlobalNotification/{v2GlobalNotification.module.css → GlobalNotification.module.css} +0 -0
|
@@ -29,6 +29,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
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); }
|
|
33
|
+
|
|
32
34
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
33
35
|
|
|
34
36
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -85,7 +87,14 @@ var ChannelIcon = /*#__PURE__*/function (_Component) {
|
|
|
85
87
|
renderIconOnly = _this$props.renderIconOnly,
|
|
86
88
|
iconName = _this$props.iconName,
|
|
87
89
|
title = _this$props.title,
|
|
88
|
-
dataSelectorId = _this$props.dataSelectorId
|
|
90
|
+
dataSelectorId = _this$props.dataSelectorId,
|
|
91
|
+
customProps = _this$props.customProps;
|
|
92
|
+
var _customProps$avatarPr = customProps.avatarProps,
|
|
93
|
+
avatarProps = _customProps$avatarPr === void 0 ? {} : _customProps$avatarPr,
|
|
94
|
+
_customProps$avatarIc = customProps.avatarIconProps,
|
|
95
|
+
avatarIconProps = _customProps$avatarIc === void 0 ? {} : _customProps$avatarIc,
|
|
96
|
+
_customProps$iconProp = customProps.iconProps,
|
|
97
|
+
iconProps = _customProps$iconProp === void 0 ? {} : _customProps$iconProp;
|
|
89
98
|
var defaultChannelObj = name && !iconName && (0, _ChannelIconMapping.getChannelMappingObj)()[name.toUpperCase()];
|
|
90
99
|
var customizedChannelName = null;
|
|
91
100
|
|
|
@@ -98,7 +107,7 @@ var ChannelIcon = /*#__PURE__*/function (_Component) {
|
|
|
98
107
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
99
108
|
className: _ChannelIconModule["default"].container,
|
|
100
109
|
"data-selector-id": dataSelectorId
|
|
101
|
-
}, customizedChannelName ? /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
|
|
110
|
+
}, customizedChannelName ? /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({
|
|
102
111
|
name: customizedChannelName,
|
|
103
112
|
size: size,
|
|
104
113
|
palette: palette,
|
|
@@ -107,7 +116,7 @@ var ChannelIcon = /*#__PURE__*/function (_Component) {
|
|
|
107
116
|
dataId: dataId,
|
|
108
117
|
needTitle: title,
|
|
109
118
|
title: title
|
|
110
|
-
}) : !renderIconOnly ? iconName ? /*#__PURE__*/_react["default"].createElement(_AvatarIcon["default"], {
|
|
119
|
+
}, avatarProps)) : !renderIconOnly ? iconName ? /*#__PURE__*/_react["default"].createElement(_AvatarIcon["default"], _extends({
|
|
111
120
|
name: iconName,
|
|
112
121
|
iconSize: iconSize,
|
|
113
122
|
size: size,
|
|
@@ -116,7 +125,7 @@ var ChannelIcon = /*#__PURE__*/function (_Component) {
|
|
|
116
125
|
className: className,
|
|
117
126
|
iconColor: iconColor,
|
|
118
127
|
title: iconTitle
|
|
119
|
-
}) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
|
|
128
|
+
}, avatarIconProps)) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], _extends({
|
|
120
129
|
name: name,
|
|
121
130
|
size: size,
|
|
122
131
|
palette: palette,
|
|
@@ -125,13 +134,13 @@ var ChannelIcon = /*#__PURE__*/function (_Component) {
|
|
|
125
134
|
dataId: dataId,
|
|
126
135
|
needTitle: title,
|
|
127
136
|
title: title
|
|
128
|
-
}) : /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
137
|
+
}, avatarProps)) : /*#__PURE__*/_react["default"].createElement(_icons.Icon, _extends({
|
|
129
138
|
name: iconName,
|
|
130
139
|
size: iconSize,
|
|
131
140
|
iconClass: "".concat(iconClass ? iconClass : '', " ").concat(_ChannelIconModule["default"].iconStyle, " ").concat(name && action ? _ChannelIconModule["default"]["".concat(name.toLowerCase(), "_").concat(action.toLowerCase())] : ''),
|
|
132
141
|
title: iconTitle,
|
|
133
142
|
dataId: dataId
|
|
134
|
-
}), topicIcon ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
143
|
+
}, iconProps)), topicIcon ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
135
144
|
className: "".concat(_ChannelIconModule["default"].thread, " ").concat(needTopicBorder ? _ChannelIconModule["default"].threadBorder : '', " ").concat(topicClass ? topicClass : ''),
|
|
136
145
|
"data-title": topicIconTitle
|
|
137
146
|
}, /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
|
|
@@ -7,6 +7,12 @@ exports.propTypes = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
+
var _propTypes2 = require("@zohodesk/components/es/Avatar/props/propTypes");
|
|
11
|
+
|
|
12
|
+
var _propTypes3 = require("../../avatar/AvatarIcon/props/propTypes");
|
|
13
|
+
|
|
14
|
+
var _propTypes4 = require("@zohodesk/icons/es/Icon/props/propTypes");
|
|
15
|
+
|
|
10
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
17
|
|
|
12
18
|
var propTypes = {
|
|
@@ -31,6 +37,11 @@ var propTypes = {
|
|
|
31
37
|
topicIconColor: _propTypes["default"].string,
|
|
32
38
|
topicIconSize: _propTypes["default"].string,
|
|
33
39
|
topicIconTitle: _propTypes["default"].string,
|
|
34
|
-
dataSelectorId: _propTypes["default"].string
|
|
40
|
+
dataSelectorId: _propTypes["default"].string,
|
|
41
|
+
customProps: _propTypes["default"].shape({
|
|
42
|
+
avatarProps: _propTypes["default"].exact(_propTypes2.propTypes),
|
|
43
|
+
avatarIconProps: _propTypes["default"].exact(_propTypes3.propTypes),
|
|
44
|
+
iconProps: _propTypes["default"].exact(_propTypes4.IconProps)
|
|
45
|
+
})
|
|
35
46
|
};
|
|
36
47
|
exports.propTypes = propTypes;
|
|
@@ -11,19 +11,20 @@
|
|
|
11
11
|
.loader {
|
|
12
12
|
width: 100% ;
|
|
13
13
|
/* Variable:Ignore */
|
|
14
|
-
height:
|
|
15
|
-
background-
|
|
16
|
-
background-size: 200% auto;
|
|
14
|
+
height: 5px;
|
|
15
|
+
background-size: 50% auto;
|
|
17
16
|
}
|
|
18
17
|
[dir=ltr] .loader {
|
|
18
|
+
background-image: linear-gradient(to right, var(--zdt_loader_bg) 30%, var(--dot_solitude) 50%, var(--zdt_loader_bg) 90%);
|
|
19
19
|
background-position: 0 100%;
|
|
20
|
-
animation: loading-ltr
|
|
20
|
+
animation: loading-ltr 2s infinite;
|
|
21
21
|
animation-fill-mode: forwards;
|
|
22
22
|
animation-timing-function: linear;
|
|
23
23
|
}
|
|
24
24
|
[dir=rtl] .loader {
|
|
25
|
+
background-image: linear-gradient(to left, var(--zdt_loader_bg) 30%, var(--dot_solitude) 50%, var(--zdt_loader_bg) 90%);
|
|
25
26
|
background-position: 100% 100%;
|
|
26
|
-
animation: loading-rtl
|
|
27
|
+
animation: loading-rtl 2s infinite;
|
|
27
28
|
animation-fill-mode: forwards;
|
|
28
29
|
animation-timing-function: linear;
|
|
29
30
|
}
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
background-position: 0 0;
|
|
34
35
|
}
|
|
35
36
|
100% {
|
|
36
|
-
background-position:
|
|
37
|
+
background-position: 200% 0;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
@@ -42,6 +43,6 @@
|
|
|
42
43
|
background-position: 100% 0;
|
|
43
44
|
}
|
|
44
45
|
100% {
|
|
45
|
-
background-position:
|
|
46
|
+
background-position: -100% 0;
|
|
46
47
|
}
|
|
47
48
|
}
|
package/lib/PlusIcon/PlusIcon.js
CHANGED
|
@@ -61,7 +61,8 @@ var PlusIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
61
61
|
size = _this$props.size,
|
|
62
62
|
onClick = _this$props.onClick,
|
|
63
63
|
title = _this$props.title,
|
|
64
|
-
customClass = _this$props.customClass
|
|
64
|
+
customClass = _this$props.customClass,
|
|
65
|
+
customProps = _this$props.customProps;
|
|
65
66
|
return /*#__PURE__*/_react["default"].createElement("span", {
|
|
66
67
|
className: _PlusIconModule["default"].container,
|
|
67
68
|
onClick: onClick,
|
|
@@ -73,7 +74,8 @@ var PlusIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
73
74
|
iconClass: "".concat(iconClass, " ").concat(_PlusIconModule["default"].icon),
|
|
74
75
|
iconSize: iconSize,
|
|
75
76
|
size: size,
|
|
76
|
-
className: "".concat(customClass, " ").concat(_PlusIconModule["default"].plusIcon)
|
|
77
|
+
className: "".concat(customClass, " ").concat(_PlusIconModule["default"].plusIcon),
|
|
78
|
+
customProps: customProps
|
|
77
79
|
}));
|
|
78
80
|
}
|
|
79
81
|
}]);
|
|
@@ -7,6 +7,8 @@ exports.propTypes = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
+
var _propTypes2 = require("../../avatar/AvatarIcon/props/propTypes.js");
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
12
14
|
var propTypes = {
|
|
@@ -17,6 +19,7 @@ var propTypes = {
|
|
|
17
19
|
onClick: _propTypes["default"].func,
|
|
18
20
|
size: _propTypes["default"].oneOf(['small', 'xsmall', 'xxsmall', 'medium', 'xmedium', 'xlarge']),
|
|
19
21
|
title: _propTypes["default"].string,
|
|
20
|
-
customClass: _propTypes["default"].string
|
|
22
|
+
customClass: _propTypes["default"].string,
|
|
23
|
+
customProps: _propTypes["default"].exact(_propTypes2.propTypes)
|
|
21
24
|
};
|
|
22
25
|
exports.propTypes = propTypes;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = getCurrentTime;
|
|
7
|
+
|
|
8
|
+
function getCurrentTime() {
|
|
9
|
+
var now = new Date();
|
|
10
|
+
var hours = now.getHours();
|
|
11
|
+
var minutes = now.getMinutes().toString().padStart(2, '0');
|
|
12
|
+
var seconds = now.getSeconds().toString().padStart(2, '0');
|
|
13
|
+
var ampm = hours >= 12 ? 'PM' : 'AM';
|
|
14
|
+
var formattedHours = hours % 12 || 12; // Convert 24-hour time to 12-hour format
|
|
15
|
+
|
|
16
|
+
return "".concat(formattedHours, ":").concat(minutes, ":").concat(seconds, " ").concat(ampm);
|
|
17
|
+
}
|
|
@@ -21,16 +21,24 @@ var _AlertIcons = _interopRequireDefault(require("../alertIcons/AlertIcons"));
|
|
|
21
21
|
|
|
22
22
|
var _AlertClose = _interopRequireDefault(require("../AlertClose/AlertClose"));
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _GlobalNotificationModule = _interopRequireDefault(require("./GlobalNotification.module.css"));
|
|
25
25
|
|
|
26
26
|
var _Layout = require("@zohodesk/components/lib/Layout");
|
|
27
27
|
|
|
28
28
|
var _Common = require("@zohodesk/components/es/utils/Common");
|
|
29
29
|
|
|
30
|
+
var _getCurrentTime = _interopRequireDefault(require("../../utils/getCurrentTime"));
|
|
31
|
+
|
|
30
32
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
31
33
|
|
|
32
34
|
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); }
|
|
33
35
|
|
|
36
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
37
|
+
|
|
38
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
39
|
+
|
|
40
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
41
|
+
|
|
34
42
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
35
43
|
|
|
36
44
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
@@ -67,31 +75,65 @@ var GlobalNotification = /*#__PURE__*/function (_React$Component) {
|
|
|
67
75
|
shadowClose: true
|
|
68
76
|
};
|
|
69
77
|
_this.onClose = _this.onClose.bind(_assertThisInitialized(_this));
|
|
78
|
+
_this.getNotiifcationData = _this.getNotiifcationData.bind(_assertThisInitialized(_this));
|
|
79
|
+
_this.handleStatusChange = _this.handleStatusChange.bind(_assertThisInitialized(_this));
|
|
70
80
|
return _this;
|
|
71
81
|
}
|
|
72
82
|
|
|
73
83
|
_createClass(GlobalNotification, [{
|
|
74
84
|
key: "componentDidMount",
|
|
75
85
|
value: function componentDidMount() {
|
|
86
|
+
var _this2 = this;
|
|
87
|
+
|
|
76
88
|
var _this$props = this.props,
|
|
77
89
|
hideMessage = _this$props.hideMessage,
|
|
78
90
|
hideTime = _this$props.hideTime,
|
|
79
91
|
id = _this$props.id,
|
|
80
92
|
needAutoClose = _this$props.needAutoClose;
|
|
93
|
+
this.handleStatusChange('mounted');
|
|
81
94
|
|
|
82
95
|
if (needAutoClose) {
|
|
83
96
|
this.hideMessageTimer = setTimeout(function () {
|
|
84
97
|
hideMessage(id);
|
|
98
|
+
|
|
99
|
+
_this2.handleStatusChange('dismissing');
|
|
85
100
|
}, hideTime);
|
|
86
101
|
}
|
|
87
102
|
}
|
|
103
|
+
}, {
|
|
104
|
+
key: "componentDidUpdate",
|
|
105
|
+
value: function componentDidUpdate(prevProps) {
|
|
106
|
+
if (prevProps.id !== this.props.id && (prevProps.message !== this.props.message || prevProps.type !== this.props.type)) {
|
|
107
|
+
this.handleStatusChange('updated');
|
|
108
|
+
}
|
|
109
|
+
}
|
|
88
110
|
}, {
|
|
89
111
|
key: "componentWillUnmount",
|
|
90
112
|
value: function componentWillUnmount() {
|
|
91
113
|
if (this.hideMessageTimer) {
|
|
92
114
|
clearTimeout(this.hideMessageTimer);
|
|
93
115
|
}
|
|
116
|
+
|
|
117
|
+
this.handleStatusChange('unmounted');
|
|
94
118
|
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "handleStatusChange",
|
|
121
|
+
value: function handleStatusChange(status) {
|
|
122
|
+
var onStatusChange = this.props.onStatusChange;
|
|
123
|
+
var notificationData = this.getNotiifcationData();
|
|
124
|
+
var currentTime = (0, _getCurrentTime["default"])();
|
|
125
|
+
|
|
126
|
+
if (typeof onStatusChange == 'function') {
|
|
127
|
+
onStatusChange(_objectSpread(_objectSpread({
|
|
128
|
+
status: status
|
|
129
|
+
}, notificationData), {}, {
|
|
130
|
+
time: currentTime
|
|
131
|
+
}));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
key: "handleNotificationClose",
|
|
136
|
+
value: function handleNotificationClose() {}
|
|
95
137
|
}, {
|
|
96
138
|
key: "onClose",
|
|
97
139
|
value: function onClose(e) {
|
|
@@ -102,42 +144,51 @@ var GlobalNotification = /*#__PURE__*/function (_React$Component) {
|
|
|
102
144
|
this.setState({
|
|
103
145
|
shadowClose: false
|
|
104
146
|
});
|
|
147
|
+
this.handleStatusChange('dismissing');
|
|
105
148
|
hideMessage && hideMessage(id);
|
|
106
149
|
onClose && onClose(e);
|
|
107
150
|
}
|
|
108
151
|
}, {
|
|
109
|
-
key: "
|
|
110
|
-
value: function
|
|
152
|
+
key: "getNotiifcationData",
|
|
153
|
+
value: function getNotiifcationData() {
|
|
111
154
|
var _this$props3 = this.props,
|
|
112
|
-
type = _this$props3.type,
|
|
113
|
-
message = _this$props3.message,
|
|
114
|
-
hideMessage = _this$props3.hideMessage,
|
|
115
|
-
onClick = _this$props3.onClick,
|
|
116
|
-
_this$props3$i18nKeys = _this$props3.i18nKeys,
|
|
117
|
-
i18nKeys = _this$props3$i18nKeys === void 0 ? {} : _this$props3$i18nKeys,
|
|
118
|
-
customProps = _this$props3.customProps,
|
|
119
|
-
dataSelectorId = _this$props3.dataSelectorId,
|
|
120
155
|
id = _this$props3.id,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
156
|
+
type = _this$props3.type,
|
|
157
|
+
message = _this$props3.message;
|
|
158
|
+
return {
|
|
159
|
+
id: id,
|
|
160
|
+
type: type,
|
|
161
|
+
message: message
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "render",
|
|
166
|
+
value: function render() {
|
|
167
|
+
var _this$props4 = this.props,
|
|
168
|
+
hideMessage = _this$props4.hideMessage,
|
|
169
|
+
onClick = _this$props4.onClick,
|
|
170
|
+
_this$props4$i18nKeys = _this$props4.i18nKeys,
|
|
171
|
+
i18nKeys = _this$props4$i18nKeys === void 0 ? {} : _this$props4$i18nKeys,
|
|
172
|
+
customProps = _this$props4.customProps,
|
|
173
|
+
dataSelectorId = _this$props4.dataSelectorId,
|
|
174
|
+
needShadow = _this$props4.needShadow,
|
|
175
|
+
shadowCount = _this$props4.shadowCount,
|
|
176
|
+
eleRef = _this$props4.eleRef;
|
|
124
177
|
var shadowClose = this.state.shadowClose;
|
|
125
178
|
var _i18nKeys$closeTitle = i18nKeys.closeTitle,
|
|
126
179
|
closeTitle = _i18nKeys$closeTitle === void 0 ? 'Close' : _i18nKeys$closeTitle;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
message: message,
|
|
180
|
+
var notificationData = this.getNotiifcationData();
|
|
181
|
+
return /*#__PURE__*/_react["default"].createElement(GlobalNotificationUI, _extends({}, notificationData, {
|
|
130
182
|
hideMessage: hideMessage,
|
|
131
183
|
onClick: onClick,
|
|
132
184
|
closeTitle: closeTitle,
|
|
133
185
|
customProps: customProps,
|
|
134
186
|
dataSelectorId: dataSelectorId,
|
|
135
|
-
id: id,
|
|
136
187
|
shadowCount: shadowCount,
|
|
137
188
|
onClose: this.onClose,
|
|
138
189
|
needShadow: shadowClose && needShadow,
|
|
139
190
|
eleRef: eleRef
|
|
140
|
-
});
|
|
191
|
+
}));
|
|
141
192
|
}
|
|
142
193
|
}]);
|
|
143
194
|
|
|
@@ -176,26 +227,26 @@ function GlobalNotificationUI(props) {
|
|
|
176
227
|
ExtraProps = _customProps$ExtraPro === void 0 ? {} : _customProps$ExtraPro;
|
|
177
228
|
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
178
229
|
ref: eleRef,
|
|
179
|
-
className: " ".concat(
|
|
230
|
+
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 "),
|
|
180
231
|
"data-id": "show_".concat(type, "_message"),
|
|
181
232
|
"data-test-id": "show_".concat(type, "_message"),
|
|
182
233
|
tabIndex: 0,
|
|
183
234
|
"data-selector-id": dataSelectorId
|
|
184
235
|
}, ExtraProps), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
185
|
-
className: "".concat(
|
|
236
|
+
className: "".concat(_GlobalNotificationModule["default"].container),
|
|
186
237
|
alignBox: "row",
|
|
187
238
|
isCover: false,
|
|
188
239
|
align: "vertical",
|
|
189
240
|
isInline: true
|
|
190
241
|
}, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
191
|
-
className:
|
|
242
|
+
className: _GlobalNotificationModule["default"].icon
|
|
192
243
|
}, /*#__PURE__*/_react["default"].createElement(_AlertIcons["default"], {
|
|
193
244
|
type: type,
|
|
194
245
|
variant: "secondary"
|
|
195
246
|
})), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
196
247
|
flexible: true
|
|
197
248
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
198
|
-
className:
|
|
249
|
+
className: _GlobalNotificationModule["default"].text,
|
|
199
250
|
onClick: onClick,
|
|
200
251
|
"data-id": "infoMessage",
|
|
201
252
|
"data-test-id": "infoMessage",
|
|
@@ -203,7 +254,7 @@ function GlobalNotificationUI(props) {
|
|
|
203
254
|
__html: message
|
|
204
255
|
}
|
|
205
256
|
})), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
206
|
-
className:
|
|
257
|
+
className: _GlobalNotificationModule["default"].close
|
|
207
258
|
}, /*#__PURE__*/_react["default"].createElement(_AlertClose["default"], {
|
|
208
259
|
dataId: "close_".concat(type, "_message"),
|
|
209
260
|
dataTitle: closeTitle,
|
|
@@ -21,7 +21,7 @@ var _AlertIcons = _interopRequireDefault(require("../../alertIcons/AlertIcons"))
|
|
|
21
21
|
|
|
22
22
|
var _CustomResponsive = require("@zohodesk/components/lib/Responsive/CustomResponsive");
|
|
23
23
|
|
|
24
|
-
var _Typography = _interopRequireDefault(require("@zohodesk/components/es/
|
|
24
|
+
var _Typography = _interopRequireDefault(require("@zohodesk/components/es/Typography/Typography"));
|
|
25
25
|
|
|
26
26
|
var _DesktopNotificationHeaderModule = _interopRequireDefault(require("./DesktopNotificationHeader.module.css"));
|
|
27
27
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/dot",
|
|
3
|
-
"version": "1.0.0-temp-203.
|
|
3
|
+
"version": "1.0.0-temp-203.6",
|
|
4
4
|
"main": "lib/index",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"private": false,
|
|
@@ -62,9 +62,8 @@
|
|
|
62
62
|
"@zohodesk-private/css-variable-migrator": "^1.0.7",
|
|
63
63
|
"@zohodesk-private/node-plugins": "1.1.8",
|
|
64
64
|
"@zohodesk-private/react-prop-validator": "1.2.3",
|
|
65
|
-
"@zohodesk/a11y": "2.2.
|
|
66
|
-
"@zohodesk/components": "1.2.
|
|
67
|
-
"@zohodesk/dotkit": "1.0.0-temp-0.5",
|
|
65
|
+
"@zohodesk/a11y": "2.2.7",
|
|
66
|
+
"@zohodesk/components": "1.2.55",
|
|
68
67
|
"@zohodesk/hooks": "2.0.5",
|
|
69
68
|
"@zohodesk/icons": "1.0.70",
|
|
70
69
|
"@zohodesk/svg": "1.1.22",
|
|
@@ -72,20 +71,18 @@
|
|
|
72
71
|
"@zohodesk/variables": "1.0.0",
|
|
73
72
|
"@zohodesk/virtualizer": "1.0.3",
|
|
74
73
|
"react-sortable-hoc": "^0.8.3",
|
|
75
|
-
"velocity-react": "1.4.3"
|
|
76
|
-
"react-transition-group": "^4.4.5"
|
|
74
|
+
"velocity-react": "1.4.3"
|
|
77
75
|
},
|
|
78
76
|
"peerDependencies": {
|
|
79
77
|
"velocity-react": "1.4.3",
|
|
80
78
|
"@zohodesk/variables": "1.0.0",
|
|
81
|
-
"@zohodesk/components": "1.2.
|
|
79
|
+
"@zohodesk/components": "1.2.55",
|
|
82
80
|
"@zohodesk/icons": "1.0.70",
|
|
83
81
|
"@zohodesk/svg": "1.1.22",
|
|
84
82
|
"@zohodesk/virtualizer": "1.0.3",
|
|
85
83
|
"react-sortable-hoc": "^0.8.3",
|
|
86
84
|
"@zohodesk/hooks": "2.0.5",
|
|
87
85
|
"@zohodesk/utils": "1.3.14",
|
|
88
|
-
"@zohodesk/a11y": "2.2.
|
|
89
|
-
"react-transition-group": "^4.4.5"
|
|
86
|
+
"@zohodesk/a11y": "2.2.7"
|
|
90
87
|
}
|
|
91
88
|
}
|