@synerise/ds-modal 0.16.0 → 0.16.3
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 +13 -6
- package/README.md +0 -1
- package/dist/Modal.d.ts +0 -10
- package/dist/Modal.js +13 -30
- package/dist/Modal.styles.d.ts +0 -3
- package/dist/Modal.styles.js +2 -14
- package/dist/Modal.types.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/style/index.css +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,18 +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
|
-
|
|
6
|
+
## [0.16.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.16.2...@synerise/ds-modal@0.16.3) (2022-08-04)
|
|
7
7
|
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-modal
|
|
8
9
|
|
|
9
|
-
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
* **modal:** add new option of footers in modal ([61aacf8](https://github.com/synerise/synerise-design/commit/61aacf8b256e4a7e17daeecd374bc7029f8b9bdb))
|
|
12
|
-
* **modal:** fix footer prop with buttons ([0d7b347](https://github.com/synerise/synerise-design/commit/0d7b347947c15be616b34cd963ef68aec8e4b45b))
|
|
13
11
|
|
|
14
12
|
|
|
15
|
-
### Features
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
## [0.16.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.9...@synerise/ds-modal@0.16.2) (2022-08-04)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-modal
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.16.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.9...@synerise/ds-modal@0.16.1) (2022-08-04)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-modal
|
|
18
25
|
|
|
19
26
|
|
|
20
27
|
|
package/README.md
CHANGED
|
@@ -46,4 +46,3 @@ Modal UI Component
|
|
|
46
46
|
| bodyBackground | Set color for body of modal | `white` / `grey` | `white` |
|
|
47
47
|
| texts | Labels to render | `{ okButton: string; cancelButton: string }` | `{ okButton: 'Apply', cancelButton: 'Cancel' }` |
|
|
48
48
|
| blank | Modal with header which contains only close button | Boolean | `false` |
|
|
49
|
-
| settingButtonText | Text of the setting button | string | `Setting` |
|
package/dist/Modal.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { ButtonProps } from 'antd/lib/button';
|
|
3
2
|
import '@synerise/ds-core/dist/js/style';
|
|
4
3
|
import './style/index.less';
|
|
5
4
|
import { Props } from './Modal.types';
|
|
6
|
-
export declare type ModalFooterBuilder = {
|
|
7
|
-
prefix?: React.ReactNode;
|
|
8
|
-
infix?: React.ReactNode;
|
|
9
|
-
suffix?: React.ReactNode;
|
|
10
|
-
okButton?: React.ReactNode;
|
|
11
|
-
cancelButton?: React.ReactNode;
|
|
12
|
-
DSButton?: React.FC<ButtonProps>;
|
|
13
|
-
};
|
|
14
|
-
export declare function buildModalFooter({ DSButton, prefix, infix, suffix, ...antModalProps }: Props & ModalFooterBuilder): React.ReactNode;
|
|
15
5
|
declare class ModalProxy extends React.Component<Props> {
|
|
16
6
|
static defaultProps: {
|
|
17
7
|
closable: boolean;
|
package/dist/Modal.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
var _excluded = ["
|
|
2
|
-
_excluded2 = ["texts", "bodyBackground", "closable", "headerActions", "title", "description", "size", "blank", "settingButtonText", "titleContainerStyle"];
|
|
3
|
-
|
|
4
|
-
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
5
|
-
|
|
6
|
-
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; }
|
|
1
|
+
var _excluded = ["texts", "bodyBackground", "closable", "headerActions", "title", "description", "size", "blank", "titleContainerStyle"];
|
|
7
2
|
|
|
8
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); }
|
|
9
4
|
|
|
10
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; }
|
|
11
6
|
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
12
11
|
import * as React from 'react';
|
|
13
12
|
import Modal from 'antd/lib/modal';
|
|
14
13
|
import Icon, { CloseM } from '@synerise/ds-icon';
|
|
@@ -24,27 +23,6 @@ var mapSizeToWidth = {
|
|
|
24
23
|
extraLarge: 1280,
|
|
25
24
|
fullSize: '100%'
|
|
26
25
|
};
|
|
27
|
-
export function buildModalFooter(_ref) {
|
|
28
|
-
var _ref$DSButton = _ref.DSButton,
|
|
29
|
-
DSButton = _ref$DSButton === void 0 ? Button : _ref$DSButton,
|
|
30
|
-
prefix = _ref.prefix,
|
|
31
|
-
infix = _ref.infix,
|
|
32
|
-
suffix = _ref.suffix,
|
|
33
|
-
antModalProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
|
-
|
|
35
|
-
var onOk = antModalProps.onOk,
|
|
36
|
-
onCancel = antModalProps.onCancel,
|
|
37
|
-
texts = antModalProps.texts;
|
|
38
|
-
return /*#__PURE__*/React.createElement(S.FooterContainer, null, prefix, antModalProps.cancelButton || /*#__PURE__*/React.createElement(DSButton, _extends({
|
|
39
|
-
type: "ghost",
|
|
40
|
-
onClick: onCancel,
|
|
41
|
-
disabled: !onCancel
|
|
42
|
-
}, antModalProps.cancelButtonProps), antModalProps.cancelText || (texts == null ? void 0 : texts.cancelButton)), infix, antModalProps.okButton || /*#__PURE__*/React.createElement(DSButton, _extends({
|
|
43
|
-
type: antModalProps.okType || 'primary',
|
|
44
|
-
onClick: onOk,
|
|
45
|
-
disabled: !onOk
|
|
46
|
-
}, antModalProps.okButtonProps), antModalProps.okText || (texts == null ? void 0 : texts.okButton)), suffix);
|
|
47
|
-
}
|
|
48
26
|
|
|
49
27
|
var ModalProxy = /*#__PURE__*/function (_React$Component) {
|
|
50
28
|
_inheritsLoose(ModalProxy, _React$Component);
|
|
@@ -65,9 +43,8 @@ var ModalProxy = /*#__PURE__*/function (_React$Component) {
|
|
|
65
43
|
description = _this$props.description,
|
|
66
44
|
size = _this$props.size,
|
|
67
45
|
blank = _this$props.blank,
|
|
68
|
-
settingButtonText = _this$props.settingButtonText,
|
|
69
46
|
titleContainerStyle = _this$props.titleContainerStyle,
|
|
70
|
-
antModalProps = _objectWithoutPropertiesLoose(_this$props,
|
|
47
|
+
antModalProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
71
48
|
|
|
72
49
|
var handleOnClose = antModalProps.onCancel;
|
|
73
50
|
var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
|
|
@@ -96,7 +73,13 @@ var ModalProxy = /*#__PURE__*/function (_React$Component) {
|
|
|
96
73
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
97
74
|
component: /*#__PURE__*/React.createElement(CloseM, null)
|
|
98
75
|
})))), description && /*#__PURE__*/React.createElement(S.Description, null, description));
|
|
99
|
-
var footerContainer = antModalProps.footer ||
|
|
76
|
+
var footerContainer = antModalProps.footer || /*#__PURE__*/React.createElement(S.FooterContainer, null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
77
|
+
type: "ghost",
|
|
78
|
+
onClick: antModalProps.onCancel
|
|
79
|
+
}, antModalProps.cancelButtonProps), texts && texts.cancelButton), /*#__PURE__*/React.createElement(Button, _extends({
|
|
80
|
+
type: antModalProps.okType || 'primary',
|
|
81
|
+
onClick: antModalProps.onOk
|
|
82
|
+
}, antModalProps.okButtonProps), texts && texts.okButton));
|
|
100
83
|
return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
|
|
101
84
|
className: className,
|
|
102
85
|
width: !size ? undefined : mapSizeToWidth[size],
|
package/dist/Modal.styles.d.ts
CHANGED
|
@@ -7,7 +7,4 @@ export declare const Title: import("styled-components").StyledComponent<import("
|
|
|
7
7
|
export declare const Description: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
8
8
|
export declare const ActionButtons: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
9
|
export declare const FooterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
-
export declare const CustomFooterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
-
export declare const SettingButton: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
|
-
export declare const ButtonsWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
13
10
|
export declare const AntdModal: import("styled-components").StyledComponent<any, any, object & ModalProps, string | number | symbol>;
|
package/dist/Modal.styles.js
CHANGED
|
@@ -26,22 +26,10 @@ export var ActionButtons = styled.div.withConfig({
|
|
|
26
26
|
export var FooterContainer = styled.div.withConfig({
|
|
27
27
|
displayName: "Modalstyles__FooterContainer",
|
|
28
28
|
componentId: "jdspxw-4"
|
|
29
|
-
})(["display:flex;align-items:center;justify-content:flex-end;"]);
|
|
30
|
-
export var CustomFooterContainer = styled.div.withConfig({
|
|
31
|
-
displayName: "Modalstyles__CustomFooterContainer",
|
|
32
|
-
componentId: "jdspxw-5"
|
|
33
|
-
})(["display:flex;flex-wrap:nowrap;"]);
|
|
34
|
-
export var SettingButton = styled.div.withConfig({
|
|
35
|
-
displayName: "Modalstyles__SettingButton",
|
|
36
|
-
componentId: "jdspxw-6"
|
|
37
|
-
})(["display:flex;width:100%;"]);
|
|
38
|
-
export var ButtonsWrapper = styled.div.withConfig({
|
|
39
|
-
displayName: "Modalstyles__ButtonsWrapper",
|
|
40
|
-
componentId: "jdspxw-7"
|
|
41
|
-
})(["display:flex;"]); // FIXME: Exported variable 'AntdModal' has or is using name 'ModalInterface' from external module (probabli Antd's types issue)
|
|
29
|
+
})(["display:flex;align-items:center;justify-content:flex-end;"]); // FIXME: Exported variable 'AntdModal' has or is using name 'ModalInterface' from external module (probabli Antd's types issue)
|
|
42
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
31
|
|
|
44
32
|
export var AntdModal = styled(Modal).withConfig({
|
|
45
33
|
displayName: "Modalstyles__AntdModal",
|
|
46
|
-
componentId: "jdspxw-
|
|
34
|
+
componentId: "jdspxw-5"
|
|
47
35
|
})([""]);
|
package/dist/Modal.types.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Modal';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default
|
|
1
|
+
export { default } from './Modal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ant-image-preview,.ant-modal{pointer-events:none}.ant-image-preview.zoom-appear,.ant-image-preview.zoom-enter,.ant-modal.zoom-appear,.ant-modal.zoom-enter{transform:none;opacity:0;animation-duration:.3s;user-select:none}.ant-image-preview-mask,.ant-modal-mask{position:fixed;top:0;right:0;bottom:0;left:0;z-index:991000;height:100%;background-color:rgba(0,0,0,.2);filter:alpha(opacity=50)}.ant-image-preview-mask-hidden,.ant-modal-mask-hidden{display:none}.ant-image-preview-wrap,.ant-modal-wrap{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;outline:0;-webkit-overflow-scrolling:touch}.ant-modal{box-sizing:border-box;margin:0;padding:0;color:#6a7580;font-size:13px;font-variant:tabular-nums;line-height:1.38;list-style:none;font-feature-settings:'tnum';position:relative;top:100px;width:auto;max-width:calc(100vw - 32px);margin:0 auto;padding-bottom:24px}.ant-modal-wrap{z-index:991000}.ant-modal-title{margin:0;color:#384350;font-weight:500;font-size:13px;line-height:22px;word-wrap:break-word}.ant-modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:0;border-radius:3px;box-shadow:0 2px 6px rgba(171,178,183,.12);pointer-events:auto}.ant-modal-close{position:absolute;top:0;right:0;z-index:10;padding:0;color:#232936;font-weight:700;line-height:1;text-decoration:none;background:0 0;border:0;outline:0;cursor:pointer;transition:color .3s}.ant-modal-close-x{display:block;width:56px;height:56px;font-size:13px;font-style:normal;line-height:56px;text-align:center;text-transform:none;text-rendering:auto}.ant-modal-close:focus,.ant-modal-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-modal-header{padding:16px 32px;color:#6a7580;background:#fff;border-bottom:1px solid #e9edee;border-radius:3px 3px 0 0}.ant-modal-body{padding:32px;font-size:13px;line-height:1.38;word-wrap:break-word}.ant-modal-footer{padding:10px 16px;text-align:right;background:0 0;border-top:1px solid #e9edee;border-radius:0 0 3px 3px}.ant-modal-footer button+button{margin-bottom:0;margin-left:8px}.ant-modal-open{overflow:hidden}.ant-modal-centered{text-align:center}.ant-modal-centered::before{display:inline-block;width:0;height:100%;vertical-align:middle;content:''}.ant-modal-centered .ant-modal{top:0;display:inline-block;text-align:left;vertical-align:middle}@media (max-width:767px){.ant-modal{max-width:calc(100vw - 16px);margin:8px auto}.ant-modal-centered .ant-modal{flex:1}}.ant-modal-confirm .ant-modal-header{display:none}.ant-modal-confirm .ant-modal-close{display:none}.ant-modal-confirm .ant-modal-body{padding:32px 32px 24px}.ant-modal-confirm-body-wrapper::before{display:table;content:''}.ant-modal-confirm-body-wrapper::after{display:table;clear:both;content:''}.ant-modal-confirm-body .ant-modal-confirm-title{display:block;overflow:hidden;color:#384350;font-weight:500;font-size:13px;line-height:1.4}.ant-modal-confirm-body .ant-modal-confirm-content{margin-top:8px;color:#6a7580;font-size:13px}.ant-modal-confirm-body>.anticon{float:left;margin-right:16px;font-size:22px}.ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:38px}.ant-modal-confirm .ant-modal-confirm-btns{float:right;margin-top:24px}.ant-modal-confirm .ant-modal-confirm-btns button+button{margin-bottom:0;margin-left:8px}.ant-modal-confirm-error .ant-modal-confirm-body>.anticon{color:#f52922}.ant-modal-confirm-confirm .ant-modal-confirm-body>.anticon,.ant-modal-confirm-warning .ant-modal-confirm-body>.anticon{color:#fab700}.ant-modal-confirm-info .ant-modal-confirm-body>.anticon{color:#0b68ff}.ant-modal-confirm-success .ant-modal-confirm-body>.anticon{color:#54cb0b}.ant-modal-wrap-rtl{direction:rtl}.ant-modal-wrap-rtl .ant-modal-close{right:initial;left:0}.ant-modal-wrap-rtl .ant-modal-footer{text-align:left}.ant-modal-wrap-rtl .ant-modal-footer button+button{margin-right:8px;margin-left:0}.ant-modal-wrap-rtl .ant-modal-confirm-body{direction:rtl}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon{float:right;margin-right:0;margin-left:16px}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-right:38px;margin-left:0}.ant-modal-wrap-rtl .ant-modal-confirm-btns{float:left}.ant-modal-wrap-rtl .ant-modal-confirm-btns button+button{margin-right:8px;margin-left:0}.ant-modal-wrap-rtl.ant-modal-centered .ant-modal{text-align:right}.ant-modal{transform-origin:center!important}.ant-modal.with-description .ant-modal-header{padding:20px 24px 12px}.ant-modal-title{margin:0;font-size:18px;line-height:32px;font-weight:500;color:#384350}.ant-modal-content{position:relative;background-color:#fff;border:0;border-radius:3px;background-clip:padding-box;box-shadow:0 8px 16px rgba(171,178,183,.32)}.ant-modal-mask.ant-modal-mask{background-color:rgba(56,67,80,.2);filter:alpha(opacity=20)}.ant-modal-close{color:#6a7580;height:72px}.ant-modal-close:focus,.ant-modal-close:hover{color:#384350}.ant-modal-header.ant-modal-header{padding:20px 24px;background:#fff;color:#6a7580;border-bottom:1px solid #f3f5f6}.ant-modal-header .close-modal{height:32px;width:32px;margin:0 0 0 4px;text-align:center;padding:0!important;line-height:34px;display:flex!important;justify-content:center;align-items:center}.ant-modal-header .close-modal i{font-size:15px}.ant-modal-body.ant-modal-body{padding:24px;font-size:13px;line-height:1.38}.ant-modal-footer.ant-modal-footer{min-height:81px;background-color:#f9fafb;padding:24px 24px;border-top:1px solid #f3f5f6}.ant-modal-footer button+button{margin-left:8px;margin-bottom:0}.ant-modal.ant-modal.bodybg-grey .ant-modal-body{background-color:#f9fafb}.ant-modal.modal-blank .ant-modal-header{border:0;padding:0}.ant-modal.modal-blank .ant-modal-header .close-modal{position:absolute;top:20px;right:24px;z-index:1;margin:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-modal",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "Modal UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-button": "^0.17.
|
|
36
|
-
"@synerise/ds-icon": "^0.49.
|
|
37
|
-
"@synerise/ds-typography": "^0.12.
|
|
35
|
+
"@synerise/ds-button": "^0.17.5",
|
|
36
|
+
"@synerise/ds-icon": "^0.49.3",
|
|
37
|
+
"@synerise/ds-typography": "^0.12.5",
|
|
38
38
|
"classnames": "^2.2.6"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@synerise/ds-utils": "^0.19.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "28486eab4b37b485cbe2a383e3ae9b8e9d789862"
|
|
49
49
|
}
|