@synerise/ds-alert 0.8.10 → 0.8.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/dist/Notification/Notification.js +46 -48
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [0.8.11](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.8.10...@synerise/ds-alert@0.8.11) (2024-05-08)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @synerise/ds-alert
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
## [0.8.10](https://github.com/Synerise/synerise-design/compare/@synerise/ds-alert@0.8.9...@synerise/ds-alert@0.8.10) (2024-04-15)
|
7
15
|
|
8
16
|
**Note:** Version bump only for package @synerise/ds-alert
|
@@ -118,64 +118,62 @@ function _notificationOpen() {
|
|
118
118
|
var _ref3$type, type, _ref3$className, className, message, icon, onClick, onClose, _ref3$closeIconClassN, closeIconClassName, _ref3$placement, placement, props, api, el, containerPromise, _mountInstance, getContainer, maybeCloseClick;
|
119
119
|
|
120
120
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
121
|
-
while (1) {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
api = notificationApi || notification; // TODO: check if context is actually available
|
126
|
-
|
127
|
-
el = document.body.querySelector("." + className);
|
128
|
-
|
129
|
-
if (!el) {
|
130
|
-
_mountInstance = mountInstance(contextHolder, {
|
131
|
-
className: className
|
132
|
-
});
|
133
|
-
containerPromise = _mountInstance[0];
|
134
|
-
el = _mountInstance[1];
|
135
|
-
}
|
121
|
+
while (1) switch (_context.prev = _context.next) {
|
122
|
+
case 0:
|
123
|
+
_ref3$type = _ref3.type, type = _ref3$type === void 0 ? 'info' : _ref3$type, _ref3$className = _ref3.className, className = _ref3$className === void 0 ? 'popup-container' : _ref3$className, message = _ref3.message, icon = _ref3.icon, onClick = _ref3.onClick, onClose = _ref3.onClose, _ref3$closeIconClassN = _ref3.closeIconClassName, closeIconClassName = _ref3$closeIconClassN === void 0 ? 'ds-close-icon' : _ref3$closeIconClassN, _ref3$placement = _ref3.placement, placement = _ref3$placement === void 0 ? 'bottom' : _ref3$placement, props = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
124
|
+
api = notificationApi || notification; // TODO: check if context is actually available
|
136
125
|
|
137
|
-
|
138
|
-
return containerPromise;
|
126
|
+
el = document.body.querySelector("." + className);
|
139
127
|
|
140
|
-
|
141
|
-
|
142
|
-
|
128
|
+
if (!el) {
|
129
|
+
_mountInstance = mountInstance(contextHolder, {
|
130
|
+
className: className
|
131
|
+
});
|
132
|
+
containerPromise = _mountInstance[0];
|
133
|
+
el = _mountInstance[1];
|
134
|
+
}
|
143
135
|
|
144
|
-
|
145
|
-
|
146
|
-
/** a workaround for handling close clicks,
|
147
|
-
* since there's no way for injecting other element triggering onClose listener.
|
148
|
-
* It is set as a listener for all the clicks
|
149
|
-
* and fires onClose when close-icon was clicked */
|
136
|
+
_context.next = 6;
|
137
|
+
return containerPromise;
|
150
138
|
|
139
|
+
case 6:
|
140
|
+
getContainer = function getContainer() {
|
141
|
+
var _el;
|
151
142
|
|
152
|
-
|
153
|
-
|
143
|
+
return (_el = el) == null ? void 0 : _el.querySelector('div>div,.NotificationsBottomPlacementWrapper>.NotificationsWrapper');
|
144
|
+
};
|
145
|
+
/** a workaround for handling close clicks,
|
146
|
+
* since there's no way for injecting other element triggering onClose listener.
|
147
|
+
* It is set as a listener for all the clicks
|
148
|
+
* and fires onClose when close-icon was clicked */
|
154
149
|
|
155
|
-
var isClickedElementChildOfCloseIcon = ev.target.closest("." + closeIconClassName);
|
156
|
-
var isThisCloseIcon = ev == null ? void 0 : (_ev$currentTarget = ev.currentTarget) == null ? void 0 : _ev$currentTarget.classList.contains("" + closeIconClassName);
|
157
150
|
|
158
|
-
|
159
|
-
|
160
|
-
}
|
151
|
+
maybeCloseClick = function maybeCloseClick(ev) {
|
152
|
+
var _ev$currentTarget;
|
161
153
|
|
162
|
-
|
163
|
-
|
154
|
+
var isClickedElementChildOfCloseIcon = ev.target.closest("." + closeIconClassName);
|
155
|
+
var isThisCloseIcon = ev == null || (_ev$currentTarget = ev.currentTarget) == null ? void 0 : _ev$currentTarget.classList.contains("" + closeIconClassName);
|
164
156
|
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
placement: placement,
|
169
|
-
getContainer: getContainer,
|
170
|
-
icon: icon,
|
171
|
-
onClick: maybeCloseClick,
|
172
|
-
bottom: 16
|
173
|
-
}, props)));
|
157
|
+
if (isClickedElementChildOfCloseIcon || isThisCloseIcon) {
|
158
|
+
return onClose && onClose();
|
159
|
+
}
|
174
160
|
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
161
|
+
return onClick && onClick();
|
162
|
+
};
|
163
|
+
|
164
|
+
return _context.abrupt("return", api.open(_objectSpread({
|
165
|
+
message: message,
|
166
|
+
type: type,
|
167
|
+
placement: placement,
|
168
|
+
getContainer: getContainer,
|
169
|
+
icon: icon,
|
170
|
+
onClick: maybeCloseClick,
|
171
|
+
bottom: 16
|
172
|
+
}, props)));
|
173
|
+
|
174
|
+
case 9:
|
175
|
+
case "end":
|
176
|
+
return _context.stop();
|
179
177
|
}
|
180
178
|
}, _callee);
|
181
179
|
}));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@synerise/ds-alert",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.11",
|
4
4
|
"description": "Alert UI Component for the Synerise Design System",
|
5
5
|
"license": "ISC",
|
6
6
|
"repository": "Synerise/synerise-design",
|
@@ -33,8 +33,8 @@
|
|
33
33
|
],
|
34
34
|
"types": "dist/index.d.ts",
|
35
35
|
"dependencies": {
|
36
|
-
"@synerise/ds-button": "^0.19.
|
37
|
-
"@synerise/ds-icon": "^0.60.
|
36
|
+
"@synerise/ds-button": "^0.19.8",
|
37
|
+
"@synerise/ds-icon": "^0.60.8",
|
38
38
|
"animate.css": "^4.1.1",
|
39
39
|
"react-animate-height": "^2.0.23",
|
40
40
|
"react-dom": "16.13.0",
|
@@ -47,9 +47,9 @@
|
|
47
47
|
"styled-components": "5.0.1"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
|
-
"@synerise/ds-utils": "^0.26.
|
50
|
+
"@synerise/ds-utils": "^0.26.4",
|
51
51
|
"@testing-library/jest-dom": "5.1.1",
|
52
52
|
"@testing-library/react": "10.0.1"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "1ad18b4b850f614943cd940a6b509d215ec025c7"
|
55
55
|
}
|