@panneau/modal-dialog 3.0.308 → 4.0.1

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.
Files changed (2) hide show
  1. package/es/index.js +22 -40
  2. package/package.json +9 -9
package/es/index.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import classNames from 'classnames';
3
- import PropTypes from 'prop-types';
4
3
  import React from 'react';
5
- import { PropTypes as PropTypes$1 } from '@panneau/core';
6
4
  import { isMessage } from '@panneau/core/utils';
7
5
  import Button from '@panneau/element-button';
8
6
  import Buttons from '@panneau/element-buttons';
@@ -11,46 +9,32 @@ import Modal from '@panneau/element-modal';
11
9
 
12
10
  var styles = {"container":"panneau-modal-dialog-container","closeOutside":"panneau-modal-dialog-closeOutside","closeOutsideButton":"panneau-modal-dialog-closeOutsideButton"};
13
11
 
14
- var propTypes = {
15
- id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
16
- title: PropTypes$1.label,
17
- size: PropTypes.string,
18
- header: PropTypes.node,
19
- children: PropTypes.node,
20
- footer: PropTypes.node,
21
- buttons: PropTypes$1.buttons,
22
- onClose: PropTypes.func,
23
- withCloseOutside: PropTypes.bool,
24
- className: PropTypes.string
25
- };
26
- var defaultProps = {
27
- title: null,
28
- size: null,
29
- header: null,
30
- children: null,
31
- footer: null,
32
- buttons: null,
33
- onClose: null,
34
- withCloseOutside: false,
35
- className: null
36
- };
37
- var ModalDialog = function ModalDialog(_ref) {
12
+ function ModalDialog(_ref) {
38
13
  var id = _ref.id,
39
- title = _ref.title,
40
- size = _ref.size,
41
- header = _ref.header,
42
- children = _ref.children,
43
- buttons = _ref.buttons,
44
- footer = _ref.footer,
45
- onClose = _ref.onClose,
46
- withCloseOutside = _ref.withCloseOutside,
47
- className = _ref.className;
14
+ _ref$title = _ref.title,
15
+ title = _ref$title === void 0 ? null : _ref$title,
16
+ _ref$size = _ref.size,
17
+ size = _ref$size === void 0 ? null : _ref$size,
18
+ _ref$header = _ref.header,
19
+ header = _ref$header === void 0 ? null : _ref$header,
20
+ _ref$children = _ref.children,
21
+ children = _ref$children === void 0 ? null : _ref$children,
22
+ _ref$buttons = _ref.buttons,
23
+ buttons = _ref$buttons === void 0 ? null : _ref$buttons,
24
+ _ref$footer = _ref.footer,
25
+ footer = _ref$footer === void 0 ? null : _ref$footer,
26
+ _ref$onClose = _ref.onClose,
27
+ onClose = _ref$onClose === void 0 ? null : _ref$onClose,
28
+ _ref$withCloseOutside = _ref.withCloseOutside,
29
+ withCloseOutside = _ref$withCloseOutside === void 0 ? false : _ref$withCloseOutside,
30
+ _ref$className = _ref.className,
31
+ className = _ref$className === void 0 ? null : _ref$className;
48
32
  var onCloseButtonOutside = header === null && title === null && onClose !== null || withCloseOutside && onClose !== null;
49
33
  return /*#__PURE__*/React.createElement(Modal, {
50
34
  id: id,
51
35
  onClose: onClose
52
36
  }, /*#__PURE__*/React.createElement("div", {
53
- className: classNames(['modal-dialog', styles.container, _defineProperty(_defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), styles.closeOutside, onCloseButtonOutside), className, className)]),
37
+ className: classNames(['modal-dialog', styles.container, _defineProperty(_defineProperty(_defineProperty({}, "modal-".concat(size), size !== null), styles.closeOutside, onCloseButtonOutside), className, className !== null)]),
54
38
  role: "dialog"
55
39
  }, /*#__PURE__*/React.createElement("div", {
56
40
  className: "modal-content"
@@ -67,7 +51,7 @@ var ModalDialog = function ModalDialog(_ref) {
67
51
  }])
68
52
  }, title !== null ? /*#__PURE__*/React.createElement("h5", {
69
53
  className: "modal-title pe-2"
70
- }, isMessage ? /*#__PURE__*/React.createElement(Label, null, title) : title) : null, title !== null && onClose !== null ? /*#__PURE__*/React.createElement(Button, {
54
+ }, isMessage(title) ? /*#__PURE__*/React.createElement(Label, null, title) : title) : null, title !== null && onClose !== null ? /*#__PURE__*/React.createElement(Button, {
71
55
  type: "button",
72
56
  className: classNames(['btn-close', 'close']),
73
57
  "aria-label": "Close",
@@ -80,8 +64,6 @@ var ModalDialog = function ModalDialog(_ref) {
80
64
  items: buttons,
81
65
  className: styles.buttons
82
66
  }) : null) : null)));
83
- };
84
- ModalDialog.propTypes = propTypes;
85
- ModalDialog.defaultProps = defaultProps;
67
+ }
86
68
 
87
69
  export { ModalDialog as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/modal-dialog",
3
- "version": "3.0.308",
3
+ "version": "4.0.1",
4
4
  "description": "Default modal",
5
5
  "keywords": [
6
6
  "javascript"
@@ -59,19 +59,19 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@babel/runtime": "^7.12.5",
62
- "@panneau/core": "^3.0.307",
63
- "@panneau/element-button": "^3.0.308",
64
- "@panneau/element-buttons": "^3.0.308",
65
- "@panneau/element-label": "^3.0.307",
66
- "@panneau/element-modal": "^3.0.308",
67
- "@panneau/themes": "^3.0.308",
62
+ "@panneau/core": "^4.0.1",
63
+ "@panneau/element-button": "^4.0.1",
64
+ "@panneau/element-buttons": "^4.0.1",
65
+ "@panneau/element-label": "^4.0.1",
66
+ "@panneau/element-modal": "^4.0.1",
67
+ "@panneau/themes": "^4.0.1",
68
68
  "classnames": "^2.5.1",
69
69
  "lodash-es": "^4.17.21",
70
70
  "prop-types": "^15.7.2",
71
- "react-intl": "^5.15.8||^6.0.0"
71
+ "react-intl": "^5.15.8 || ^6.0.0 || ^7.0.0"
72
72
  },
73
73
  "publishConfig": {
74
74
  "access": "public"
75
75
  },
76
- "gitHead": "8711276a09fcda499a4a2f206554f9cd995976f5"
76
+ "gitHead": "dbdf65640625c027ecd56cf2b816b80a5c38cb8d"
77
77
  }