shineout 3.9.8-beta.10 → 3.9.8-beta.11

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.9.8-beta.10'
525
+ version: '3.9.8-beta.11'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12402,7 +12402,7 @@ var handleStyle = function handleStyle(style) {
12402
12402
  };
12403
12403
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12405
- /* harmony default export */ var version = ('3.9.8-beta.10');
12405
+ /* harmony default export */ var version = ('3.9.8-beta.11');
12406
12406
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12407
12407
 
12408
12408
 
@@ -50470,6 +50470,7 @@ function _ReactUnmount() {
50470
50470
 
50471
50471
 
50472
50472
 
50473
+
50473
50474
  var hasMask = false;
50474
50475
  var modal_content_config = {
50475
50476
  instanceIds: [],
@@ -50528,6 +50529,8 @@ var Modal = function Modal(props) {
50528
50529
  var _props$jssStyle, _props$jssStyle$modal;
50529
50530
  var modalClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$modal = _props$jssStyle.modal) === null || _props$jssStyle$modal === void 0 ? void 0 : _props$jssStyle$modal.call(_props$jssStyle);
50530
50531
  var panelRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
50532
+ var wrapperRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
50533
+ var popupCtx = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(popup_context);
50531
50534
  var isPositionX = ['left', 'right'].includes(props.position || '');
50532
50535
  var isPositionY = ['top', 'bottom'].includes(props.position || '');
50533
50536
  var defaultWidth = isPositionX ? 'auto' : 500;
@@ -50741,6 +50744,22 @@ var Modal = function Modal(props) {
50741
50744
  }
50742
50745
  }, [props.setInnerClose]);
50743
50746
 
50747
+ // 将 Modal 的 ref 注册到父 Popover 的 chain 中,防止点击 Modal 时关闭 Popover
50748
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
50749
+ // Modal 显示或关闭动画播放期间,都需要在 chain 中
50750
+ if (wrapperRef.current) {
50751
+ if (visible) {
50752
+ popupCtx.bindChild(wrapperRef);
50753
+ } else {
50754
+ popupCtx.removeChild(wrapperRef);
50755
+ }
50756
+ }
50757
+ return function () {
50758
+ // 确保清理时移除
50759
+ popupCtx.removeChild(wrapperRef);
50760
+ };
50761
+ }, [visible]);
50762
+
50744
50763
  // render
50745
50764
  var renderIcon = function renderIcon(isEmptyTitle) {
50746
50765
  var iconRoot = classnames_default()(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerIcon, isEmptyTitle && (modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.emptyIcon));
@@ -50869,6 +50888,7 @@ var Modal = function Modal(props) {
50869
50888
  context.content = content;
50870
50889
  return /*#__PURE__*/(0,jsx_runtime.jsx)(FormFooterProvider, {
50871
50890
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
50891
+ ref: wrapperRef,
50872
50892
  onClick: function onClick(e) {
50873
50893
  e.stopPropagation();
50874
50894
  },
@@ -75158,7 +75178,7 @@ var upload_interface = __webpack_require__(8821);
75158
75178
 
75159
75179
 
75160
75180
  /* harmony default export */ var src_0 = ({
75161
- version: '3.9.8-beta.10'
75181
+ version: '3.9.8-beta.11'
75162
75182
  });
75163
75183
  }();
75164
75184
  /******/ return __webpack_exports__;