@trackunit/react-modal 1.0.16 → 1.0.17

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/index.cjs.js CHANGED
@@ -173,12 +173,11 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
173
173
  closeOnOutsideClick,
174
174
  closeOnEsc,
175
175
  onPortalClick: ({ target }) => {
176
- var _a;
177
176
  if (!closeOnOutsideClick) {
178
177
  return;
179
178
  }
180
179
  // eslint-disable-next-line local-rules/no-typescript-assertion
181
- const clickingOutsideModal = !((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.contains(target));
180
+ const clickingOutsideModal = !modalRef.current?.contains(target);
182
181
  if (clickingOutsideModal) {
183
182
  closePortal();
184
183
  }
@@ -197,8 +196,8 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
197
196
  openPortal(e);
198
197
  },
199
198
  closeModal: (e) => {
200
- e === null || e === void 0 ? void 0 : e.stopPropagation();
201
- e === null || e === void 0 ? void 0 : e.preventDefault();
199
+ e?.stopPropagation();
200
+ e?.preventDefault();
202
201
  closePortal(e);
203
202
  },
204
203
  // eslint-disable-next-line local-rules/no-typescript-assertion
package/index.esm.js CHANGED
@@ -153,12 +153,11 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
153
153
  closeOnOutsideClick,
154
154
  closeOnEsc,
155
155
  onPortalClick: ({ target }) => {
156
- var _a;
157
156
  if (!closeOnOutsideClick) {
158
157
  return;
159
158
  }
160
159
  // eslint-disable-next-line local-rules/no-typescript-assertion
161
- const clickingOutsideModal = !((_a = modalRef.current) === null || _a === void 0 ? void 0 : _a.contains(target));
160
+ const clickingOutsideModal = !modalRef.current?.contains(target);
162
161
  if (clickingOutsideModal) {
163
162
  closePortal();
164
163
  }
@@ -177,8 +176,8 @@ const useModal = ({ closeOnOutsideClick, bindTo, closeOnEsc = true } = {}) => {
177
176
  openPortal(e);
178
177
  },
179
178
  closeModal: (e) => {
180
- e === null || e === void 0 ? void 0 : e.stopPropagation();
181
- e === null || e === void 0 ? void 0 : e.preventDefault();
179
+ e?.stopPropagation();
180
+ e?.preventDefault();
182
181
  closePortal(e);
183
182
  },
184
183
  // eslint-disable-next-line local-rules/no-typescript-assertion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-modal",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "react": "18.3.1",
11
11
  "react-useportal": "1.0.18",
12
- "@trackunit/react-components": "^1.0.13",
12
+ "@trackunit/react-components": "^1.1.0",
13
13
  "@trackunit/react-core-hooks": "^1.0.5",
14
14
  "@trackunit/css-class-variance-utilities": "^1.0.1",
15
15
  "@trackunit/i18n-library-translation": "^1.0.7"