tabler-react-2 0.1.133-beta.2 → 0.1.133
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/dist/modal/modal.js +7 -12
- package/docs/src/docs/changelog.mdx +0 -4
- package/package.json +1 -1
package/dist/modal/modal.js
CHANGED
|
@@ -123,22 +123,19 @@ var useModal = exports.useModal = function useModal(options) {
|
|
|
123
123
|
var handleDecision = function handleDecision(decision) {
|
|
124
124
|
if (modalState.resolve) {
|
|
125
125
|
modalState.resolve(decision);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
setModalState(function (prevState) {
|
|
127
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
128
|
+
open: false,
|
|
129
|
+
resolve: null
|
|
130
|
+
});
|
|
131
131
|
});
|
|
132
|
-
}
|
|
132
|
+
}
|
|
133
133
|
};
|
|
134
134
|
var update = function update() {
|
|
135
135
|
setModalState(_objectSpread(_objectSpread({}, modalState), {}, {
|
|
136
136
|
text: options.text
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
|
-
(0, _react.useEffect)(function () {
|
|
140
|
-
console.log("modalState updated", modalState);
|
|
141
|
-
}, [modalState]);
|
|
142
139
|
var ModalElement = /*#__PURE__*/_react["default"].createElement(Modal, _extends({
|
|
143
140
|
open: modalState.open,
|
|
144
141
|
onClose: function onClose() {
|
|
@@ -155,9 +152,7 @@ var useModal = exports.useModal = function useModal(options) {
|
|
|
155
152
|
} // Fix onClick behavior
|
|
156
153
|
};
|
|
157
154
|
})
|
|
158
|
-
}, options.modalProps || {}),
|
|
159
|
-
text: undefined
|
|
160
|
-
})), modalState.text);
|
|
155
|
+
}, options.modalProps || {}), modalState.text);
|
|
161
156
|
return {
|
|
162
157
|
modal: modal,
|
|
163
158
|
ModalElement: ModalElement,
|