@sheinx/base 3.6.6-beta.6 → 3.6.6-fix.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":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoB9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDAkVtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoB9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDAiWtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -67,7 +67,8 @@ var Modal = function Modal(props) {
67
67
  renderEd: false,
68
68
  isMask: false,
69
69
  mouseDownTarget: null,
70
- mouseUpTarget: null
70
+ mouseUpTarget: null,
71
+ content: null
71
72
  }),
72
73
  context = _useRef.current;
73
74
  var _useState3 = (0, _react.useState)(props.visible || props.autoShow),
@@ -310,6 +311,14 @@ var Modal = function Modal(props) {
310
311
  if (props.moveable && !props.fullScreen) {
311
312
  panelStyle.transform = "translate(".concat(moveInfo.pos.x, "px, ").concat(moveInfo.pos.y, "px)");
312
313
  }
314
+ var renderContent = function renderContent() {
315
+ if (!props.visible && context.content !== null) return context.content;
316
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.default.Fragment, {
317
+ children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
318
+ });
319
+ };
320
+ var content = renderContent();
321
+ context.content = content;
313
322
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_formFooterContext.FormFooterProvider, {
314
323
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
315
324
  onClick: function onClick(e) {
@@ -328,11 +337,11 @@ var Modal = function Modal(props) {
328
337
  onMouseUp: handleMaskMouseUp,
329
338
  onClick: handleMaskClick,
330
339
  onAnimationStart: updateOrigin,
331
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
340
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
332
341
  ref: panelRef,
333
342
  className: (0, _classnames.default)(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.panel, props.className),
334
343
  style: panelStyle,
335
- children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
344
+ children: content
336
345
  })
337
346
  }))
338
347
  })
@@ -1 +1 @@
1
- {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoB9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDAkVtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["modal-content.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAoB9D,QAAA,MAAM,KAAK,UAAW,iBAAiB,mDAiWtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -61,7 +61,8 @@ var Modal = function Modal(props) {
61
61
  renderEd: false,
62
62
  isMask: false,
63
63
  mouseDownTarget: null,
64
- mouseUpTarget: null
64
+ mouseUpTarget: null,
65
+ content: null
65
66
  }),
66
67
  context = _useRef.current;
67
68
  var _useState3 = useState(props.visible || props.autoShow),
@@ -304,6 +305,14 @@ var Modal = function Modal(props) {
304
305
  if (props.moveable && !props.fullScreen) {
305
306
  panelStyle.transform = "translate(".concat(moveInfo.pos.x, "px, ").concat(moveInfo.pos.y, "px)");
306
307
  }
308
+ var renderContent = function renderContent() {
309
+ if (!props.visible && context.content !== null) return context.content;
310
+ return /*#__PURE__*/_jsxs(React.Fragment, {
311
+ children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
312
+ });
313
+ };
314
+ var content = renderContent();
315
+ context.content = content;
307
316
  return /*#__PURE__*/_jsx(FormFooterProvider, {
308
317
  children: /*#__PURE__*/_jsx("div", {
309
318
  onClick: function onClick(e) {
@@ -322,11 +331,11 @@ var Modal = function Modal(props) {
322
331
  onMouseUp: handleMaskMouseUp,
323
332
  onClick: handleMaskClick,
324
333
  onAnimationStart: updateOrigin,
325
- children: /*#__PURE__*/_jsxs("div", {
334
+ children: /*#__PURE__*/_jsx("div", {
326
335
  ref: panelRef,
327
336
  className: classNames(modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.panel, props.className),
328
337
  style: panelStyle,
329
- children: [renderHeader(), renderBody(), renderFooter(), renderResize()]
338
+ children: content
330
339
  })
331
340
  }))
332
341
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sheinx/base",
3
- "version": "3.6.6-beta.6",
3
+ "version": "3.6.6-fix.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.6.6-beta.6",
13
+ "@sheinx/hooks": "3.6.6-fix.1",
14
14
  "immer": "^10.0.0",
15
15
  "classnames": "^2.0.0",
16
16
  "@shined/reactive": "^0.1.3-alpha.0"