@synerise/ds-popconfirm 0.7.2 → 0.8.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/CHANGELOG.md +32 -0
- package/dist/ConfirmMessage/ConfirmMessage.js +5 -18
- package/dist/ConfirmMessage/ConfirmMessage.style.js +1 -1
- package/dist/ConfirmMessage/ConfirmMessage.types.js +1 -0
- package/dist/Popconfirm.js +15 -28
- package/dist/Popconfirm.styles.js +2 -2
- package/dist/Popconfirm.types.js +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
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.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.8.1...@synerise/ds-popconfirm@0.8.2) (2021-11-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.8.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.7.3...@synerise/ds-popconfirm@0.8.1) (2021-11-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.8.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.7.3...@synerise/ds-popconfirm@0.8.0) (2021-11-09)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.7.3](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.7.1...@synerise/ds-popconfirm@0.7.3) (2021-10-26)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [0.7.2](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.7.1...@synerise/ds-popconfirm@0.7.2) (2021-10-19)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import AntdTooltip from 'antd/lib/tooltip';
|
|
15
3
|
import * as S from './ConfirmMessage.style';
|
|
@@ -24,9 +12,8 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
|
|
|
24
12
|
icon = _ref.icon;
|
|
25
13
|
|
|
26
14
|
var _React$useState = React.useState(false),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setVisible = _React$useState2[1];
|
|
15
|
+
visible = _React$useState[0],
|
|
16
|
+
setVisible = _React$useState[1];
|
|
30
17
|
|
|
31
18
|
React.useEffect(function () {
|
|
32
19
|
var timeout = setTimeout(function () {
|
|
@@ -45,12 +32,12 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
|
|
|
45
32
|
onClick && onClick(showMessage);
|
|
46
33
|
}, [onClick]);
|
|
47
34
|
var content = React.useMemo(function () {
|
|
48
|
-
return React.createElement(S.ConfirmMessage, null, icon, React.createElement(S.ConfirmMessageTitle, null, title));
|
|
35
|
+
return /*#__PURE__*/React.createElement(S.ConfirmMessage, null, icon, /*#__PURE__*/React.createElement(S.ConfirmMessageTitle, null, title));
|
|
49
36
|
}, [title, icon]);
|
|
50
|
-
return React.createElement(S.Message, {
|
|
37
|
+
return /*#__PURE__*/React.createElement(S.Message, {
|
|
51
38
|
onClick: handleClick,
|
|
52
39
|
"data-testid": "confirm-message"
|
|
53
|
-
}, React.createElement(AntdTooltip, {
|
|
40
|
+
}, /*#__PURE__*/React.createElement(AntdTooltip, {
|
|
54
41
|
overlayStyle: {
|
|
55
42
|
maxWidth: '300px'
|
|
56
43
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { IconContainer } from '@synerise/ds-icon
|
|
2
|
+
import { IconContainer } from '@synerise/ds-icon'; // eslint-disable-next-line import/prefer-default-export
|
|
3
3
|
|
|
4
4
|
export var Message = styled.div.withConfig({
|
|
5
5
|
displayName: "ConfirmMessagestyle__Message",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/Popconfirm.js
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
-
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
1
|
+
var _excluded = ["icon", "title", "description", "images", "imagesAutoplay", "imagesAutoplaySpeed", "withLink", "closeIcon", "titlePadding", "onCancel", "cancelButtonProps", "onConfirm", "okButtonProps", "okType", "hideButtons", "cancelText", "okText"];
|
|
8
2
|
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
16
4
|
|
|
17
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
6
|
|
|
@@ -44,15 +32,15 @@ var Popconfirm = function Popconfirm(_ref) {
|
|
|
44
32
|
hideButtons = _ref.hideButtons,
|
|
45
33
|
cancelText = _ref.cancelText,
|
|
46
34
|
okText = _ref.okText,
|
|
47
|
-
antdProps =
|
|
35
|
+
antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
48
36
|
|
|
49
37
|
var renderImageCarousel = React.useMemo(function () {
|
|
50
|
-
return (images
|
|
38
|
+
return (images == null ? void 0 : images.length) && /*#__PURE__*/React.createElement(Carousel, {
|
|
51
39
|
autoplay: imagesAutoplay,
|
|
52
40
|
autoplaySpeed: imagesAutoplaySpeed,
|
|
53
41
|
effect: "fade"
|
|
54
42
|
}, images.map(function (image) {
|
|
55
|
-
return React.createElement(S.PopconfirmImage, {
|
|
43
|
+
return /*#__PURE__*/React.createElement(S.PopconfirmImage, {
|
|
56
44
|
key: image,
|
|
57
45
|
src: image
|
|
58
46
|
});
|
|
@@ -61,42 +49,41 @@ var Popconfirm = function Popconfirm(_ref) {
|
|
|
61
49
|
var popupRef = React.useRef(null);
|
|
62
50
|
|
|
63
51
|
var _React$useState = React.useState(undefined),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
setVisible = _React$useState2[1];
|
|
52
|
+
visible = _React$useState[0],
|
|
53
|
+
setVisible = _React$useState[1];
|
|
67
54
|
|
|
68
55
|
useOnClickOutside(popupRef, function () {
|
|
69
56
|
setVisible(false);
|
|
70
57
|
});
|
|
71
|
-
return React.createElement(S.AntdPopconfirm, _extends({}, antdProps, {
|
|
58
|
+
return /*#__PURE__*/React.createElement(S.AntdPopconfirm, _extends({}, antdProps, {
|
|
72
59
|
visible: visible,
|
|
73
60
|
onVisibleChange: function onVisibleChange(isVisible) {
|
|
74
61
|
if (isVisible !== visible) setVisible(isVisible);
|
|
75
62
|
},
|
|
76
|
-
title: React.createElement(S.PopconfirmContent, {
|
|
63
|
+
title: /*#__PURE__*/React.createElement(S.PopconfirmContent, {
|
|
77
64
|
ref: popupRef
|
|
78
|
-
}, React.createElement(S.PopconfirmWrapper, null, React.createElement(S.PopconfirmContentWrapper, null, React.createElement(S.PopconfirmHeaderWrapper, null, icon && React.createElement(S.PopconfirmIcon, null, icon), React.createElement(S.PopconfirmTitle, null, title)), React.createElement(S.PopconfirmTextWrapper, null, description && React.createElement(S.PopconfirmDescription, {
|
|
65
|
+
}, /*#__PURE__*/React.createElement(S.PopconfirmWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmContentWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmHeaderWrapper, null, icon && /*#__PURE__*/React.createElement(S.PopconfirmIcon, null, icon), /*#__PURE__*/React.createElement(S.PopconfirmTitle, null, title)), /*#__PURE__*/React.createElement(S.PopconfirmTextWrapper, null, description && /*#__PURE__*/React.createElement(S.PopconfirmDescription, {
|
|
79
66
|
titlePadding: !titlePadding
|
|
80
|
-
}, description), withLink && React.createElement(S.LinkWrapper, null, withLink))), closeIcon && React.createElement(S.PopconfirmCloseIcon, {
|
|
67
|
+
}, description), withLink && /*#__PURE__*/React.createElement(S.LinkWrapper, null, withLink))), closeIcon && /*#__PURE__*/React.createElement(S.PopconfirmCloseIcon, {
|
|
81
68
|
onClick: function onClick() {
|
|
82
69
|
return setVisible(false);
|
|
83
70
|
},
|
|
84
71
|
titlePadding: titlePadding
|
|
85
|
-
}, closeIcon)), renderImageCarousel, !hideButtons && React.createElement(S.PopconfirmButtonWrapper, null, React.createElement(S.PopconfirmButton, _extends({
|
|
72
|
+
}, closeIcon)), renderImageCarousel, !hideButtons && /*#__PURE__*/React.createElement(S.PopconfirmButtonWrapper, null, /*#__PURE__*/React.createElement(S.PopconfirmButton, _extends({
|
|
86
73
|
type: "secondary"
|
|
87
74
|
}, cancelButtonProps, {
|
|
88
75
|
onClick: function onClick(e) {
|
|
89
76
|
onCancel && onCancel(e);
|
|
90
77
|
setVisible(false);
|
|
91
|
-
(cancelButtonProps
|
|
78
|
+
(cancelButtonProps == null ? void 0 : cancelButtonProps.onClick) && cancelButtonProps.onClick(e);
|
|
92
79
|
}
|
|
93
|
-
}), cancelText), React.createElement(S.PopconfirmButton, _extends({
|
|
80
|
+
}), cancelText), /*#__PURE__*/React.createElement(S.PopconfirmButton, _extends({
|
|
94
81
|
type: okType
|
|
95
82
|
}, okButtonProps, {
|
|
96
83
|
onClick: function onClick(e) {
|
|
97
84
|
onConfirm && onConfirm(e);
|
|
98
85
|
setVisible(false);
|
|
99
|
-
(okButtonProps
|
|
86
|
+
(okButtonProps == null ? void 0 : okButtonProps.onClick) && okButtonProps.onClick(e);
|
|
100
87
|
}
|
|
101
88
|
}), okText)))
|
|
102
89
|
}));
|
|
@@ -7,7 +7,7 @@ import Button from '@synerise/ds-button';
|
|
|
7
7
|
export var AntdPopconfirm = styled(function (_ref) {
|
|
8
8
|
var rest = _extends({}, _ref);
|
|
9
9
|
|
|
10
|
-
return React.createElement(Popconfirm, rest);
|
|
10
|
+
return /*#__PURE__*/React.createElement(Popconfirm, rest);
|
|
11
11
|
}).withConfig({
|
|
12
12
|
displayName: "Popconfirmstyles__AntdPopconfirm",
|
|
13
13
|
componentId: "sc-19dzptq-0"
|
|
@@ -22,7 +22,7 @@ export var PopconfirmContent = styled.div.withConfig({
|
|
|
22
22
|
}, function (props) {
|
|
23
23
|
return props.theme.palette['green-600'];
|
|
24
24
|
}, function (props) {
|
|
25
|
-
return ""
|
|
25
|
+
return "" + props.theme.palette.white;
|
|
26
26
|
});
|
|
27
27
|
export var PopconfirmTitle = styled.div.withConfig({
|
|
28
28
|
displayName: "Popconfirmstyles__PopconfirmTitle",
|
package/dist/Popconfirm.types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-popconfirm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Popconfirm UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^0.
|
|
36
|
-
"@synerise/ds-typography": "^0.
|
|
35
|
+
"@synerise/ds-button": "^0.16.2",
|
|
36
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
37
37
|
"@synerise/ds-utils": "^0.19.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@synerise/ds-utils": "^0.11.5"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
|
|
48
48
|
}
|