tabler-react-2 0.1.132 → 0.1.133-beta.2

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.
@@ -97,7 +97,7 @@ var useModal = exports.useModal = function useModal(options) {
97
97
  var _modalState$buttons;
98
98
  var _useState = (0, _react.useState)({
99
99
  open: false,
100
- resolve: null,
100
+ resolve: function resolve() {},
101
101
  title: options === null || options === void 0 ? void 0 : options.title,
102
102
  text: options === null || options === void 0 ? void 0 : options.text,
103
103
  buttons: options === null || options === void 0 ? void 0 : options.buttons
@@ -121,22 +121,24 @@ var useModal = exports.useModal = function useModal(options) {
121
121
  });
122
122
  }, []);
123
123
  var handleDecision = function handleDecision(decision) {
124
- console.log("Recieved decision", decision);
125
124
  if (modalState.resolve) {
126
125
  modalState.resolve(decision);
127
- setModalState(function (prevState) {
128
- return _objectSpread(_objectSpread({}, prevState), {}, {
129
- open: false,
130
- resolve: null
131
- });
132
- });
133
126
  }
127
+ setModalState(function (prevState) {
128
+ return _objectSpread(_objectSpread({}, prevState), {}, {
129
+ open: false,
130
+ resolve: null
131
+ });
132
+ });
134
133
  };
135
134
  var update = function update() {
136
135
  setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
137
136
  text: options.text
138
137
  }));
139
138
  };
139
+ (0, _react.useEffect)(function () {
140
+ console.log("modalState updated", modalState);
141
+ }, [modalState]);
140
142
  var ModalElement = /*#__PURE__*/_react["default"].createElement(Modal, _extends({
141
143
  open: modalState.open,
142
144
  onClose: function onClose() {
@@ -2,6 +2,10 @@
2
2
  title: Changelog
3
3
  ---
4
4
 
5
+ # 0.1.133
6
+
7
+ - Fixed issue with `useModal` where the `resolve` function was not being set correctly, preventing the modal from being automatically closed.
8
+
5
9
  # 0.1.131
6
10
 
7
11
  - Added more feedback to the `Table` pagination.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabler-react-2",
3
- "version": "0.1.132",
3
+ "version": "0.1.133-beta.2",
4
4
  "description": "A react implementation of Tabler ui",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {