@sheinx/base 3.8.0 → 3.8.1-beta.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -43,6 +43,9 @@ var removeModalInstance = function removeModalInstance(instanceId) {
|
|
|
43
43
|
return id !== instanceId;
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
+
var getInstanceIds = function getInstanceIds() {
|
|
47
|
+
return state.mutate.instanceIds;
|
|
48
|
+
};
|
|
46
49
|
var mousePosition = null;
|
|
47
50
|
var getClickPosition = function getClickPosition(e) {
|
|
48
51
|
mousePosition = {
|
|
@@ -229,8 +232,7 @@ var Modal = function Modal(props) {
|
|
|
229
232
|
if (visible) {
|
|
230
233
|
setDocumentOverflow();
|
|
231
234
|
} else {
|
|
232
|
-
if (config.instanceIds.length
|
|
233
|
-
resetDocumentOverflow();
|
|
235
|
+
if (config.instanceIds.length === 0) resetDocumentOverflow();
|
|
234
236
|
}
|
|
235
237
|
}
|
|
236
238
|
}, [visible, config.instanceIds]);
|
|
@@ -245,10 +247,10 @@ var Modal = function Modal(props) {
|
|
|
245
247
|
return function () {
|
|
246
248
|
var _props$shouldDestroy2;
|
|
247
249
|
removeModalInstance(context.instanceId);
|
|
248
|
-
|
|
250
|
+
var instanceIds = getInstanceIds();
|
|
251
|
+
if (instanceIds.length === 0) {
|
|
249
252
|
resetDocumentOverflow();
|
|
250
253
|
}
|
|
251
|
-
;
|
|
252
254
|
(_props$shouldDestroy2 = props.shouldDestroy) === null || _props$shouldDestroy2 === void 0 || _props$shouldDestroy2.call(props, true);
|
|
253
255
|
if (context.isMask) {
|
|
254
256
|
context.isMask = false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AA8C9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDA0YtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -37,6 +37,9 @@ var removeModalInstance = function removeModalInstance(instanceId) {
|
|
|
37
37
|
return id !== instanceId;
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
+
var getInstanceIds = function getInstanceIds() {
|
|
41
|
+
return state.mutate.instanceIds;
|
|
42
|
+
};
|
|
40
43
|
var mousePosition = null;
|
|
41
44
|
var getClickPosition = function getClickPosition(e) {
|
|
42
45
|
mousePosition = {
|
|
@@ -223,8 +226,7 @@ var Modal = function Modal(props) {
|
|
|
223
226
|
if (visible) {
|
|
224
227
|
setDocumentOverflow();
|
|
225
228
|
} else {
|
|
226
|
-
if (config.instanceIds.length
|
|
227
|
-
resetDocumentOverflow();
|
|
229
|
+
if (config.instanceIds.length === 0) resetDocumentOverflow();
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
232
|
}, [visible, config.instanceIds]);
|
|
@@ -239,10 +241,10 @@ var Modal = function Modal(props) {
|
|
|
239
241
|
return function () {
|
|
240
242
|
var _props$shouldDestroy2;
|
|
241
243
|
removeModalInstance(context.instanceId);
|
|
242
|
-
|
|
244
|
+
var instanceIds = getInstanceIds();
|
|
245
|
+
if (instanceIds.length === 0) {
|
|
243
246
|
resetDocumentOverflow();
|
|
244
247
|
}
|
|
245
|
-
;
|
|
246
248
|
(_props$shouldDestroy2 = props.shouldDestroy) === null || _props$shouldDestroy2 === void 0 || _props$shouldDestroy2.call(props, true);
|
|
247
249
|
if (context.isMask) {
|
|
248
250
|
context.isMask = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"module": "./esm/index.js",
|
|
11
11
|
"typings": "./cjs/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sheinx/hooks": "3.8.
|
|
13
|
+
"@sheinx/hooks": "3.8.1-beta.1",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|