@douyinfe/semi-ui 2.38.3-alpha.2-spin → 2.38.3-alpha.2-patch-2395

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.
@@ -94,7 +94,8 @@ class Modal extends _baseComponent.default {
94
94
  // return <ModalContent {...restProps} footer={renderFooter} onClose={this.handleCancel}/>;
95
95
  // };
96
96
  this.renderDialog = () => {
97
- let _a = this.props,
97
+ var _a;
98
+ let _b = this.props,
98
99
  {
99
100
  footer,
100
101
  className,
@@ -105,15 +106,15 @@ class Modal extends _baseComponent.default {
105
106
  zIndex,
106
107
  getPopupContainer,
107
108
  visible
108
- } = _a,
109
- restProps = __rest(_a, ["footer", "className", "motion", "maskStyle", "keepDOM", "style", "zIndex", "getPopupContainer", "visible"]);
109
+ } = _b,
110
+ restProps = __rest(_b, ["footer", "className", "motion", "maskStyle", "keepDOM", "style", "zIndex", "getPopupContainer", "visible"]);
110
111
  let style = styleFromProps;
111
112
  const maskStyle = maskStyleFromProps;
112
113
  const renderFooter = 'footer' in this.props ? footer : this.renderFooter();
113
114
  let wrapperStyle = {
114
115
  zIndex
115
116
  };
116
- if (getPopupContainer) {
117
+ if (getPopupContainer && getPopupContainer() !== ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) {
117
118
  wrapperStyle = {
118
119
  zIndex,
119
120
  position: 'static'
@@ -184,20 +185,22 @@ class Modal extends _baseComponent.default {
184
185
  return Object.assign(Object.assign({}, super.adapter), {
185
186
  getProps: () => this.props,
186
187
  disabledBodyScroll: () => {
188
+ var _a;
187
189
  const {
188
190
  getPopupContainer
189
191
  } = this.props;
190
192
  this.bodyOverflow = document.body.style.overflow || '';
191
- if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
193
+ if ((!getPopupContainer || getPopupContainer() === ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) && this.bodyOverflow !== 'hidden') {
192
194
  document.body.style.overflow = 'hidden';
193
195
  document.body.style.width = `calc(${this.originBodyWidth || '100%'} - ${this.scrollBarWidth}px)`;
194
196
  }
195
197
  },
196
198
  enabledBodyScroll: () => {
199
+ var _a;
197
200
  const {
198
201
  getPopupContainer
199
202
  } = this.props;
200
- if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
203
+ if ((!getPopupContainer || getPopupContainer() === ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
201
204
  document.body.style.overflow = this.bodyOverflow;
202
205
  document.body.style.width = this.originBodyWidth;
203
206
  }
@@ -287,20 +287,21 @@ class ModalContent extends _baseComponent.default {
287
287
  this.foundation.destroy();
288
288
  }
289
289
  render() {
290
- const _a = this.props,
290
+ var _a;
291
+ const _b = this.props,
291
292
  {
292
293
  maskClosable,
293
294
  className,
294
295
  getPopupContainer,
295
296
  maskFixed,
296
297
  getContainerContext
297
- } = _a,
298
- rest = __rest(_a, ["maskClosable", "className", "getPopupContainer", "maskFixed", "getContainerContext"]);
298
+ } = _b,
299
+ rest = __rest(_b, ["maskClosable", "className", "getPopupContainer", "maskFixed", "getContainerContext"]);
299
300
  const {
300
301
  direction
301
302
  } = this.context;
302
303
  const classList = (0, _classnames.default)(className, {
303
- [`${_constants.cssClasses.DIALOG}-popup`]: getPopupContainer && !maskFixed,
304
+ [`${_constants.cssClasses.DIALOG}-popup`]: getPopupContainer && getPopupContainer() !== ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body) && !maskFixed,
304
305
  [`${_constants.cssClasses.DIALOG}-fixed`]: maskFixed,
305
306
  [`${_constants.cssClasses.DIALOG}-rtl`]: direction === 'rtl'
306
307
  });
@@ -83,7 +83,8 @@ class Modal extends BaseComponent {
83
83
  // return <ModalContent {...restProps} footer={renderFooter} onClose={this.handleCancel}/>;
84
84
  // };
85
85
  this.renderDialog = () => {
86
- let _a = this.props,
86
+ var _a;
87
+ let _b = this.props,
87
88
  {
88
89
  footer,
89
90
  className,
@@ -94,15 +95,15 @@ class Modal extends BaseComponent {
94
95
  zIndex,
95
96
  getPopupContainer,
96
97
  visible
97
- } = _a,
98
- restProps = __rest(_a, ["footer", "className", "motion", "maskStyle", "keepDOM", "style", "zIndex", "getPopupContainer", "visible"]);
98
+ } = _b,
99
+ restProps = __rest(_b, ["footer", "className", "motion", "maskStyle", "keepDOM", "style", "zIndex", "getPopupContainer", "visible"]);
99
100
  let style = styleFromProps;
100
101
  const maskStyle = maskStyleFromProps;
101
102
  const renderFooter = 'footer' in this.props ? footer : this.renderFooter();
102
103
  let wrapperStyle = {
103
104
  zIndex
104
105
  };
105
- if (getPopupContainer) {
106
+ if (getPopupContainer && getPopupContainer() !== ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) {
106
107
  wrapperStyle = {
107
108
  zIndex,
108
109
  position: 'static'
@@ -173,20 +174,22 @@ class Modal extends BaseComponent {
173
174
  return Object.assign(Object.assign({}, super.adapter), {
174
175
  getProps: () => this.props,
175
176
  disabledBodyScroll: () => {
177
+ var _a;
176
178
  const {
177
179
  getPopupContainer
178
180
  } = this.props;
179
181
  this.bodyOverflow = document.body.style.overflow || '';
180
- if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
182
+ if ((!getPopupContainer || getPopupContainer() === ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) && this.bodyOverflow !== 'hidden') {
181
183
  document.body.style.overflow = 'hidden';
182
184
  document.body.style.width = `calc(${this.originBodyWidth || '100%'} - ${this.scrollBarWidth}px)`;
183
185
  }
184
186
  },
185
187
  enabledBodyScroll: () => {
188
+ var _a;
186
189
  const {
187
190
  getPopupContainer
188
191
  } = this.props;
189
- if (!getPopupContainer && this.bodyOverflow !== 'hidden') {
192
+ if ((!getPopupContainer || getPopupContainer() === ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body)) && this.bodyOverflow !== null && this.bodyOverflow !== 'hidden') {
190
193
  document.body.style.overflow = this.bodyOverflow;
191
194
  document.body.style.width = this.originBodyWidth;
192
195
  }
@@ -278,20 +278,21 @@ export default class ModalContent extends BaseComponent {
278
278
  this.foundation.destroy();
279
279
  }
280
280
  render() {
281
- const _a = this.props,
281
+ var _a;
282
+ const _b = this.props,
282
283
  {
283
284
  maskClosable,
284
285
  className,
285
286
  getPopupContainer,
286
287
  maskFixed,
287
288
  getContainerContext
288
- } = _a,
289
- rest = __rest(_a, ["maskClosable", "className", "getPopupContainer", "maskFixed", "getContainerContext"]);
289
+ } = _b,
290
+ rest = __rest(_b, ["maskClosable", "className", "getPopupContainer", "maskFixed", "getContainerContext"]);
290
291
  const {
291
292
  direction
292
293
  } = this.context;
293
294
  const classList = cls(className, {
294
- [`${cssClasses.DIALOG}-popup`]: getPopupContainer && !maskFixed,
295
+ [`${cssClasses.DIALOG}-popup`]: getPopupContainer && getPopupContainer() !== ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) === null || _a === void 0 ? void 0 : _a.body) && !maskFixed,
295
296
  [`${cssClasses.DIALOG}-fixed`]: maskFixed,
296
297
  [`${cssClasses.DIALOG}-rtl`]: direction === 'rtl'
297
298
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-ui",
3
- "version": "2.38.3-alpha.2-spin",
3
+ "version": "2.38.3-alpha.2-patch-2395",
4
4
  "description": "",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es/index.js",
@@ -17,12 +17,12 @@
17
17
  "lib/*"
18
18
  ],
19
19
  "dependencies": {
20
- "@douyinfe/semi-animation": "2.38.3-alpha.2-spin",
21
- "@douyinfe/semi-animation-react": "2.38.3-alpha.2-spin",
22
- "@douyinfe/semi-foundation": "2.38.3-alpha.2-spin",
23
- "@douyinfe/semi-icons": "2.38.3-alpha.2-spin",
24
- "@douyinfe/semi-illustrations": "2.38.3-alpha.2-spin",
25
- "@douyinfe/semi-theme-default": "2.38.3-alpha.2-spin",
20
+ "@douyinfe/semi-animation": "2.38.3-alpha.2-patch-2395",
21
+ "@douyinfe/semi-animation-react": "2.38.3-alpha.2-patch-2395",
22
+ "@douyinfe/semi-foundation": "2.38.3-alpha.2-patch-2395",
23
+ "@douyinfe/semi-icons": "2.38.3-alpha.2-patch-2395",
24
+ "@douyinfe/semi-illustrations": "2.38.3-alpha.2-patch-2395",
25
+ "@douyinfe/semi-theme-default": "2.38.3-alpha.2-patch-2395",
26
26
  "async-validator": "^3.5.0",
27
27
  "classnames": "^2.2.6",
28
28
  "copy-text-to-clipboard": "^2.1.1",
@@ -69,7 +69,7 @@
69
69
  ],
70
70
  "author": "",
71
71
  "license": "MIT",
72
- "gitHead": "9ebe9a7f7d63097175ad03eef7a55cdd65a4c3c2",
72
+ "gitHead": "0f229469b42b6f684a9c618153993896a438e303",
73
73
  "devDependencies": {
74
74
  "@babel/plugin-proposal-decorators": "^7.15.8",
75
75
  "@babel/plugin-transform-runtime": "^7.15.8",