shineout 3.7.2-beta.2 → 3.7.2-beta.4

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/cjs/index.js CHANGED
@@ -522,5 +522,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
522
522
  // 此文件由脚本自动生成,请勿直接修改。
523
523
  // This file was generated automatically by a script. Please do not modify it directly.
524
524
  var _default = exports.default = {
525
- version: '3.7.2-beta.2'
525
+ version: '3.7.2-beta.4'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12234,7 +12234,7 @@ var handleStyle = function handleStyle(style) {
12234
12234
  };
12235
12235
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12236
12236
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12237
- /* harmony default export */ var version = ('3.7.2-beta.2');
12237
+ /* harmony default export */ var version = ('3.7.2-beta.4');
12238
12238
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12239
12239
 
12240
12240
 
@@ -14371,6 +14371,7 @@ var selectTokens = {
14371
14371
  selectLargeTagLineHeight: 'Line-height-dynamic',
14372
14372
  selectInnerPaddingX: 'Spacing-8',
14373
14373
  selectInnerPaddingY: 'Spacing-5',
14374
+ selectInnerTitleMarginY: 'Spacing-2',
14374
14375
  selectPlaceholderColor: 'Neutral-text-2',
14375
14376
  selectPlaceholderMarginY: 'Spacing-2',
14376
14377
  selectBackgroundColor: 'Neutral-fill-1',
@@ -17325,6 +17326,7 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
17325
17326
  },
17326
17327
  '& $tag': {
17327
17328
  marginTop: 0,
17329
+ marginBottom: src.selectInnerTitleMarginY,
17328
17330
  paddingTop: 0,
17329
17331
  paddingBottom: 0,
17330
17332
  height: selectTagHeight,
@@ -23189,6 +23191,7 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23189
23191
  },
23190
23192
  '& $tag': {
23191
23193
  marginTop: 0,
23194
+ marginBottom: src.selectInnerTitleMarginY,
23192
23195
  paddingTop: 0,
23193
23196
  paddingBottom: 0,
23194
23197
  height: select_selectTagHeight,
@@ -28724,6 +28727,7 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
28724
28727
  },
28725
28728
  '& $tag': {
28726
28729
  marginTop: 0,
28730
+ marginBottom: src.selectInnerTitleMarginY,
28727
28731
  paddingTop: 0,
28728
28732
  paddingBottom: 0,
28729
28733
  height: tree_select_selectTagHeight,
@@ -48256,7 +48260,11 @@ var Modal = function Modal(props) {
48256
48260
  isMask: false,
48257
48261
  mouseDownTarget: null,
48258
48262
  mouseUpTarget: null,
48259
- content: null
48263
+ content: null,
48264
+ originDocumentStyle: {
48265
+ overflow: '',
48266
+ paddingRight: ''
48267
+ }
48260
48268
  }),
48261
48269
  context = _useRef.current;
48262
48270
  var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.visible || props.autoShow),
@@ -48356,18 +48364,33 @@ var Modal = function Modal(props) {
48356
48364
  setAnimation(true);
48357
48365
  }
48358
48366
  }, [props.visible]);
48367
+
48368
+ // 设置 document.body.style.overflow 和 document.body.style.paddingRight,并记录原始值到 context 中
48369
+ var setDocumentOverflow = usePersistFn(function () {
48370
+ var doc = document.body.parentNode;
48371
+ if (context.isMask) {
48372
+ context.originDocumentStyle.overflow = doc.style.overflow;
48373
+ context.originDocumentStyle.paddingRight = doc.style.paddingRight;
48374
+ }
48375
+ doc.style.overflow = 'hidden';
48376
+ if (!doc.style.paddingRight) {
48377
+ doc.style.paddingRight = "".concat(window.innerWidth - docSize.width, "px");
48378
+ }
48379
+ });
48380
+
48381
+ // 还原 document.body.style.overflow 和 document.body.style.paddingRight
48382
+ var resetDocumentOverflow = usePersistFn(function () {
48383
+ var doc = document.body.parentNode;
48384
+ doc.style.overflow = context.originDocumentStyle.overflow;
48385
+ doc.style.paddingRight = context.originDocumentStyle.paddingRight;
48386
+ });
48359
48387
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48360
48388
  if (!props.hideMask) {
48361
- var doc = document.body.parentNode;
48362
48389
  if (visible) {
48363
- doc.style.overflow = 'hidden';
48364
- if (!doc.style.paddingRight) {
48365
- doc.style.paddingRight = "".concat(window.innerWidth - docSize.width, "px");
48366
- }
48390
+ setDocumentOverflow();
48367
48391
  } else {
48368
48392
  if (!context.isMask) return;
48369
- doc.style.paddingRight = '';
48370
- doc.style.overflow = '';
48393
+ resetDocumentOverflow();
48371
48394
  }
48372
48395
  }
48373
48396
  }, [visible]);
@@ -48381,20 +48404,15 @@ var Modal = function Modal(props) {
48381
48404
  // unmount
48382
48405
  return function () {
48383
48406
  var _props$shouldDestroy2;
48407
+ if (context.isMask) {
48408
+ resetDocumentOverflow();
48409
+ }
48410
+ ;
48384
48411
  (_props$shouldDestroy2 = props.shouldDestroy) === null || _props$shouldDestroy2 === void 0 || _props$shouldDestroy2.call(props, true);
48385
- // if (props.autoShow) {
48386
- // props.onClose?.();
48387
- // }
48388
48412
  if (context.isMask) {
48389
48413
  context.isMask = false;
48390
48414
  hasMask = false;
48391
48415
  }
48392
- {
48393
- if (!context.isMask) return;
48394
- var doc = document.body.parentNode;
48395
- doc.style.paddingRight = '';
48396
- doc.style.overflow = '';
48397
- }
48398
48416
  };
48399
48417
  }, []);
48400
48418
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
@@ -71415,7 +71433,7 @@ var upload_interface = __webpack_require__(8821);
71415
71433
 
71416
71434
 
71417
71435
  /* harmony default export */ var src_0 = ({
71418
- version: '3.7.2-beta.2'
71436
+ version: '3.7.2-beta.4'
71419
71437
  });
71420
71438
  }();
71421
71439
  /******/ return __webpack_exports__;