@synerise/ds-popconfirm 0.10.55 → 0.10.57
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 +19 -0
- package/dist/ConfirmMessage/ConfirmMessage.d.ts +1 -1
- package/dist/ConfirmMessage/ConfirmMessage.js +7 -7
- package/dist/ConfirmMessage/ConfirmMessage.types.d.ts +5 -4
- package/dist/Popconfirm.js +7 -7
- package/dist/Popconfirm.types.d.ts +14 -11
- package/dist/index.d.ts +2 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.10.57](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.56...@synerise/ds-popconfirm@0.10.57) (2024-10-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.10.56](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.55...@synerise/ds-popconfirm@0.10.56) (2024-10-28)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **storybook7:** added popconfirm stories ([73b98df](https://github.com/Synerise/synerise-design/commit/73b98dfba801b9d8fd14ee45c92adb761a04241e))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [0.10.55](https://github.com/Synerise/synerise-design/compare/@synerise/ds-popconfirm@0.10.54...@synerise/ds-popconfirm@0.10.55) (2024-10-23)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @synerise/ds-popconfirm
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ConfirmMessageProps } from './ConfirmMessage.types';
|
|
3
|
-
export declare const ConfirmMessage: React.
|
|
3
|
+
export declare const ConfirmMessage: ({ children, placement, title, onClick, displayDuration, icon, }: ConfirmMessageProps) => React.JSX.Element;
|
|
4
4
|
export default ConfirmMessage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import AntdTooltip from 'antd/lib/tooltip';
|
|
3
3
|
import * as S from './ConfirmMessage.style';
|
|
4
4
|
export var ConfirmMessage = function ConfirmMessage(_ref) {
|
|
@@ -11,11 +11,11 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
|
|
|
11
11
|
displayDuration = _ref$displayDuration === void 0 ? 5000 : _ref$displayDuration,
|
|
12
12
|
icon = _ref.icon;
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
visible =
|
|
16
|
-
setVisible =
|
|
14
|
+
var _useState = useState(false),
|
|
15
|
+
visible = _useState[0],
|
|
16
|
+
setVisible = _useState[1];
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
useEffect(function () {
|
|
19
19
|
var timeout = setTimeout(function () {
|
|
20
20
|
setVisible(false);
|
|
21
21
|
}, displayDuration);
|
|
@@ -28,10 +28,10 @@ export var ConfirmMessage = function ConfirmMessage(_ref) {
|
|
|
28
28
|
setVisible(true);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
var handleClick =
|
|
31
|
+
var handleClick = useCallback(function () {
|
|
32
32
|
onClick && onClick(showMessage);
|
|
33
33
|
}, [onClick]);
|
|
34
|
-
var content =
|
|
34
|
+
var content = useMemo(function () {
|
|
35
35
|
return /*#__PURE__*/React.createElement(S.ConfirmMessage, null, icon, /*#__PURE__*/React.createElement(S.ConfirmMessageTitle, null, title));
|
|
36
36
|
}, [title, icon]);
|
|
37
37
|
return /*#__PURE__*/React.createElement(S.Message, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ConfirmMessageProps = {
|
|
3
3
|
displayDuration?: number;
|
|
4
4
|
title: string;
|
|
5
|
+
children?: ReactNode;
|
|
5
6
|
onClick: (callback: () => void) => void;
|
|
6
|
-
icon?:
|
|
7
|
+
icon?: ReactNode;
|
|
7
8
|
placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
8
|
-
}
|
|
9
|
+
};
|
package/dist/Popconfirm.js
CHANGED
|
@@ -4,7 +4,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
4
4
|
|
|
5
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; }
|
|
6
6
|
|
|
7
|
-
import React from 'react';
|
|
7
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
import '@synerise/ds-core/dist/js/style';
|
|
9
9
|
import "./style/index.css";
|
|
10
10
|
import { Carousel } from 'antd';
|
|
@@ -35,7 +35,7 @@ var Popconfirm = function Popconfirm(_ref) {
|
|
|
35
35
|
buttonsAlign = _ref.buttonsAlign,
|
|
36
36
|
antdProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
37
37
|
|
|
38
|
-
var renderImageCarousel =
|
|
38
|
+
var renderImageCarousel = useMemo(function () {
|
|
39
39
|
return (images == null ? void 0 : images.length) && /*#__PURE__*/React.createElement(Carousel, {
|
|
40
40
|
autoplay: imagesAutoplay,
|
|
41
41
|
autoplaySpeed: imagesAutoplaySpeed,
|
|
@@ -47,16 +47,16 @@ var Popconfirm = function Popconfirm(_ref) {
|
|
|
47
47
|
});
|
|
48
48
|
}));
|
|
49
49
|
}, [images, imagesAutoplay, imagesAutoplaySpeed]);
|
|
50
|
-
var popupRef =
|
|
50
|
+
var popupRef = useRef(null);
|
|
51
51
|
|
|
52
|
-
var
|
|
53
|
-
visible =
|
|
54
|
-
setVisible =
|
|
52
|
+
var _useState = useState(undefined),
|
|
53
|
+
visible = _useState[0],
|
|
54
|
+
setVisible = _useState[1];
|
|
55
55
|
|
|
56
56
|
useOnClickOutside(popupRef, function () {
|
|
57
57
|
setVisible(false);
|
|
58
58
|
});
|
|
59
|
-
|
|
59
|
+
useEffect(function () {
|
|
60
60
|
if (!visible && antdProps.visible) {
|
|
61
61
|
setVisible(antdProps.visible);
|
|
62
62
|
}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { PopconfirmProps } from 'antd/lib/popconfirm';
|
|
1
|
+
import { ReactNode, MouseEvent as ReactMouseEvent } from 'react';
|
|
2
|
+
import { PopconfirmProps as AntdPopconfirmProps } from 'antd/lib/popconfirm';
|
|
3
3
|
import { ConfirmMessageProps } from './ConfirmMessage/ConfirmMessage.types';
|
|
4
|
-
export type
|
|
5
|
-
description?: string |
|
|
4
|
+
export type PopconfirmProps = Omit<AntdPopconfirmProps, 'okType'> & {
|
|
5
|
+
description?: string | ReactNode;
|
|
6
6
|
images?: string[];
|
|
7
7
|
imagesAutoplay?: boolean;
|
|
8
8
|
imagesAutoplaySpeed?: number;
|
|
9
|
-
onClick?: (event:
|
|
10
|
-
withLink?:
|
|
11
|
-
closeIcon?:
|
|
9
|
+
onClick?: (event: ReactMouseEvent<HTMLElement, MouseEvent>) => void;
|
|
10
|
+
withLink?: ReactNode;
|
|
11
|
+
closeIcon?: ReactNode;
|
|
12
12
|
titlePadding?: boolean;
|
|
13
|
-
hideButtons?:
|
|
13
|
+
hideButtons?: ReactNode;
|
|
14
14
|
buttonsAlign?: 'left' | 'right';
|
|
15
|
-
okType?:
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
okType?: AntdPopconfirmProps['okType'] | string;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
};
|
|
18
|
+
export type PopconfirmType = {
|
|
19
|
+
(props: PopconfirmProps): JSX.Element;
|
|
20
|
+
ConfirmMessage: (props: ConfirmMessageProps) => JSX.Element;
|
|
18
21
|
};
|
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-popconfirm",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.57",
|
|
4
4
|
"description": "Popconfirm UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
],
|
|
35
35
|
"types": "dist/index.d.ts",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@synerise/ds-button": "^0.21.
|
|
38
|
-
"@synerise/ds-icon": "^0.66.
|
|
39
|
-
"@synerise/ds-utils": "^0.30.
|
|
37
|
+
"@synerise/ds-button": "^0.21.16",
|
|
38
|
+
"@synerise/ds-icon": "^0.66.2",
|
|
39
|
+
"@synerise/ds-utils": "^0.30.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@synerise/ds-core": "*",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"react": ">=16.9.0 <= 17.0.2",
|
|
45
45
|
"styled-components": "5.0.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c9eddd944cd2f08cb02db807652ba7fb2b536a1c"
|
|
48
48
|
}
|