tabler-react-2 0.1.67 → 0.1.68

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/dist/modal/modal.js +12 -27
  2. package/package.json +1 -1
@@ -31,32 +31,15 @@ var Modal = exports.Modal = function Modal(_ref) {
31
31
  children = _ref.children,
32
32
  modalId = _ref.modalId,
33
33
  status = _ref.status;
34
- var modalRef = (0, _react.useRef)(null);
35
- (0, _react.useEffect)(function () {
36
- var modalElement = modalRef.current;
37
- var modalInstance;
38
- if (open) {
39
- modalInstance = new window.bootstrap.Modal(modalElement, {
40
- backdrop: true,
41
- keyboard: true
42
- });
43
- modalInstance.show();
44
- modalElement.addEventListener("hidden.bs.modal", onClose);
45
- } else {
46
- modalInstance = window.bootstrap.Modal.getInstance(modalElement);
47
- if (modalInstance) modalInstance.hide();
48
- }
49
- return function () {
50
- if (modalElement) {
51
- modalElement.removeEventListener("hidden.bs.modal", onClose);
52
- }
53
- };
54
- }, [open, onClose]);
55
- return /*#__PURE__*/_react["default"].createElement("div", {
56
- className: "modal",
34
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
35
+ className: "modal fade ".concat(open ? "show" : ""),
57
36
  id: modalId,
58
- ref: modalRef,
59
- tabIndex: "-1"
37
+ tabIndex: "-1",
38
+ role: "dialog",
39
+ "aria-modal": "true",
40
+ style: {
41
+ display: open ? "block" : "none"
42
+ }
60
43
  }, /*#__PURE__*/_react["default"].createElement("div", {
61
44
  className: "modal-dialog",
62
45
  role: "document"
@@ -86,14 +69,16 @@ var Modal = exports.Modal = function Modal(_ref) {
86
69
  }
87
70
  }, children), /*#__PURE__*/_react["default"].createElement("div", {
88
71
  className: "modal-footer"
89
- }, buttons && buttons.map(function (button, index) {
72
+ }, buttons === null || buttons === void 0 ? void 0 : buttons.map(function (button, index) {
90
73
  return /*#__PURE__*/_react["default"].createElement(_button.Button, _extends({
91
74
  variant: button.variant,
92
75
  key: index
93
76
  }, button.attrs, {
94
77
  onClick: button.onClick
95
78
  }), button.text);
96
- })))));
79
+ }))))), open && /*#__PURE__*/_react["default"].createElement("div", {
80
+ className: "modal-backdrop fade show"
81
+ }));
97
82
  };
98
83
  Modal.propTypes = {
99
84
  open: _propTypes["default"].bool.isRequired,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabler-react-2",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "description": "A react implementation of Tabler ui",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {