@synerise/ds-modal 0.15.0 → 0.15.4

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 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.15.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.3...@synerise/ds-modal@0.15.4) (2022-01-17)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-modal
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.15.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.2...@synerise/ds-modal@0.15.3) (2021-12-22)
15
+
16
+ **Note:** Version bump only for package @synerise/ds-modal
17
+
18
+
19
+
20
+
21
+
22
+ ## [0.15.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.15.1...@synerise/ds-modal@0.15.2) (2021-11-22)
23
+
24
+ **Note:** Version bump only for package @synerise/ds-modal
25
+
26
+
27
+
28
+
29
+
30
+ ## [0.15.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.15...@synerise/ds-modal@0.15.1) (2021-11-09)
31
+
32
+ **Note:** Version bump only for package @synerise/ds-modal
33
+
34
+
35
+
36
+
37
+
6
38
  # [0.15.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-modal@0.14.15...@synerise/ds-modal@0.15.0) (2021-11-09)
7
39
 
8
40
  **Note:** Version bump only for package @synerise/ds-modal
package/dist/Modal.js CHANGED
@@ -1,32 +1,12 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
1
  var _excluded = ["texts", "bodyBackground", "closable", "headerActions", "title", "description", "size", "blank", "titleContainerStyle"];
4
2
 
5
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); }
6
4
 
7
- 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; }
8
-
9
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; }
10
6
 
11
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
-
13
- 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); } }
14
-
15
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
16
-
17
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
18
-
19
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
20
-
21
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
22
-
23
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
24
-
25
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
26
-
27
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7
+ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
28
8
 
29
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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; }
30
10
 
31
11
  import * as React from 'react';
32
12
  import Modal from 'antd/lib/modal';
@@ -45,89 +25,90 @@ var mapSizeToWidth = {
45
25
  };
46
26
 
47
27
  var ModalProxy = /*#__PURE__*/function (_React$Component) {
48
- _inherits(ModalProxy, _React$Component);
49
-
50
- var _super = _createSuper(ModalProxy);
28
+ _inheritsLoose(ModalProxy, _React$Component);
51
29
 
52
30
  function ModalProxy() {
53
- _classCallCheck(this, ModalProxy);
54
-
55
- return _super.apply(this, arguments);
31
+ return _React$Component.apply(this, arguments) || this;
56
32
  }
57
33
 
58
- _createClass(ModalProxy, [{
59
- key: "render",
60
- value: function render() {
61
- var _this$props = this.props,
62
- texts = _this$props.texts,
63
- bodyBackground = _this$props.bodyBackground,
64
- closable = _this$props.closable,
65
- headerActions = _this$props.headerActions,
66
- title = _this$props.title,
67
- description = _this$props.description,
68
- size = _this$props.size,
69
- blank = _this$props.blank,
70
- titleContainerStyle = _this$props.titleContainerStyle,
71
- antModalProps = _objectWithoutProperties(_this$props, _excluded);
72
-
73
- var handleOnClose = antModalProps.onCancel;
74
- var className = classnames("bodybg-".concat(bodyBackground), antModalProps.className, {
75
- 'modal-blank': Boolean(blank)
76
- }, {
77
- 'with-description': Boolean(description)
78
- });
79
- var titleContainer = /*#__PURE__*/React.createElement(React.Fragment, null, blank && closable && /*#__PURE__*/React.createElement(Button, {
80
- mode: "single-icon",
81
- "data-testid": "modal-close",
82
- className: "close-modal",
83
- type: "ghost",
84
- onClick: handleOnClose
85
- }, /*#__PURE__*/React.createElement(Icon, {
86
- component: /*#__PURE__*/React.createElement(CloseM, null)
87
- })), title && /*#__PURE__*/React.createElement(S.TitleContainer, {
88
- style: titleContainerStyle
89
- }, /*#__PURE__*/React.createElement(S.Title, {
90
- level: 3
91
- }, title), /*#__PURE__*/React.createElement(S.ActionButtons, null, headerActions, closable && /*#__PURE__*/React.createElement(Button, {
92
- mode: "single-icon",
93
- "data-testid": "modal-close",
94
- className: "close-modal",
95
- type: "ghost",
96
- onClick: handleOnClose
97
- }, /*#__PURE__*/React.createElement(Icon, {
98
- component: /*#__PURE__*/React.createElement(CloseM, null)
99
- })))), description && /*#__PURE__*/React.createElement(S.Description, null, description));
100
- var footerContainer = antModalProps.footer || /*#__PURE__*/React.createElement(S.FooterContainer, null, /*#__PURE__*/React.createElement(Button, _extends({
101
- type: "ghost",
102
- onClick: antModalProps.onCancel
103
- }, antModalProps.cancelButtonProps), texts && texts.cancelButton), /*#__PURE__*/React.createElement(Button, _extends({
104
- type: antModalProps.okType || 'primary',
105
- onClick: antModalProps.onOk
106
- }, antModalProps.okButtonProps), texts && texts.okButton));
107
- return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
108
- className: className,
109
- width: !size ? undefined : mapSizeToWidth[size],
110
- closable: false,
111
- title: (title || description || blank) && titleContainer,
112
- footer: antModalProps.footer !== null ? footerContainer : null
113
- }));
114
- }
115
- }]);
34
+ var _proto = ModalProxy.prototype;
35
+
36
+ _proto.render = function render() {
37
+ var _this$props = this.props,
38
+ texts = _this$props.texts,
39
+ bodyBackground = _this$props.bodyBackground,
40
+ closable = _this$props.closable,
41
+ headerActions = _this$props.headerActions,
42
+ title = _this$props.title,
43
+ description = _this$props.description,
44
+ size = _this$props.size,
45
+ blank = _this$props.blank,
46
+ titleContainerStyle = _this$props.titleContainerStyle,
47
+ antModalProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
48
+
49
+ var handleOnClose = antModalProps.onCancel;
50
+ var className = classnames("bodybg-" + bodyBackground, antModalProps.className, {
51
+ 'modal-blank': Boolean(blank)
52
+ }, {
53
+ 'with-description': Boolean(description)
54
+ });
55
+ var titleContainer = /*#__PURE__*/React.createElement(React.Fragment, null, blank && closable && /*#__PURE__*/React.createElement(Button, {
56
+ mode: "single-icon",
57
+ "data-testid": "modal-close",
58
+ className: "close-modal",
59
+ type: "ghost",
60
+ onClick: handleOnClose
61
+ }, /*#__PURE__*/React.createElement(Icon, {
62
+ component: /*#__PURE__*/React.createElement(CloseM, null)
63
+ })), title && /*#__PURE__*/React.createElement(S.TitleContainer, {
64
+ style: titleContainerStyle
65
+ }, /*#__PURE__*/React.createElement(S.Title, {
66
+ level: 3
67
+ }, title), /*#__PURE__*/React.createElement(S.ActionButtons, null, headerActions, closable && /*#__PURE__*/React.createElement(Button, {
68
+ mode: "single-icon",
69
+ "data-testid": "modal-close",
70
+ className: "close-modal",
71
+ type: "ghost",
72
+ onClick: handleOnClose
73
+ }, /*#__PURE__*/React.createElement(Icon, {
74
+ component: /*#__PURE__*/React.createElement(CloseM, null)
75
+ })))), description && /*#__PURE__*/React.createElement(S.Description, null, description));
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));
83
+ return /*#__PURE__*/React.createElement(S.AntdModal, _extends({}, antModalProps, {
84
+ className: className,
85
+ width: !size ? undefined : mapSizeToWidth[size],
86
+ closable: false,
87
+ title: (title || description || blank) && titleContainer,
88
+ footer: antModalProps.footer !== null ? footerContainer : null
89
+ }));
90
+ };
116
91
 
117
92
  return ModalProxy;
118
93
  }(React.Component);
119
94
 
120
- ModalProxy.defaultProps = {
95
+ _defineProperty(ModalProxy, "defaultProps", {
121
96
  closable: true,
122
97
  bodyBackground: 'white',
123
98
  texts: {
124
99
  okButton: 'Apply',
125
100
  cancelButton: 'Cancel'
126
101
  }
127
- };
128
- ModalProxy.info = Modal.info;
129
- ModalProxy.success = Modal.success;
130
- ModalProxy.error = Modal.error;
131
- ModalProxy.warning = Modal.warning;
132
- ModalProxy.confirm = Modal.confirm;
102
+ });
103
+
104
+ _defineProperty(ModalProxy, "info", Modal.info);
105
+
106
+ _defineProperty(ModalProxy, "success", Modal.success);
107
+
108
+ _defineProperty(ModalProxy, "error", Modal.error);
109
+
110
+ _defineProperty(ModalProxy, "warning", Modal.warning);
111
+
112
+ _defineProperty(ModalProxy, "confirm", Modal.confirm);
113
+
133
114
  export default ModalProxy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-modal",
3
- "version": "0.15.0",
3
+ "version": "0.15.4",
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.16.0",
36
- "@synerise/ds-icon": "^0.46.0",
37
- "@synerise/ds-typography": "^0.12.0",
35
+ "@synerise/ds-button": "^0.16.4",
36
+ "@synerise/ds-icon": "^0.47.0",
37
+ "@synerise/ds-typography": "^0.12.2",
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": "a797e1d5e1233f121f8f7dfbeaf97b48a8195d25"
48
+ "gitHead": "56c08eca6e2a1e41b8a39e28a9ec657ac1bdec83"
49
49
  }