shineout 3.9.0-beta.12 → 3.9.0-beta.14

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.0-beta.12'
525
+ version: '3.9.0-beta.14'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12386,7 +12386,7 @@ var handleStyle = function handleStyle(style) {
12386
12386
  };
12387
12387
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12388
12388
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12389
- /* harmony default export */ var version = ('3.9.0-beta.12');
12389
+ /* harmony default export */ var version = ('3.9.0-beta.14');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -49532,20 +49532,10 @@ var addModalInstance = function addModalInstance(instanceId) {
49532
49532
  modal_content_state.mutate.instanceIds.push(instanceId);
49533
49533
  };
49534
49534
  var addModalCascadeConfig = function addModalCascadeConfig(props) {
49535
- var width = props.width;
49536
- var widthNumber = 0;
49537
- // width 是30% 这种格式的,转为number
49538
- if (typeof width === 'string' && width.indexOf('%') > -1) {
49539
- var parentWidth = document.body.clientWidth;
49540
- var percent = parseInt(width, 10);
49541
- widthNumber = parentWidth * percent / 100;
49542
- } else {
49543
- widthNumber = typeof width === 'number' ? width : parseInt(width, 10) || 0;
49544
- }
49545
49535
  modal_content_state.mutate.cascadeConfigs.push({
49546
49536
  cascade: props.cascade,
49547
- instanceId: props.instanceId,
49548
- width: widthNumber
49537
+ cascadeWidth: props.cascadeWidth,
49538
+ instanceId: props.instanceId
49549
49539
  });
49550
49540
  };
49551
49541
  var removeModalInstance = function removeModalInstance(instanceId) {
@@ -49648,8 +49638,8 @@ var Modal = function Modal(props) {
49648
49638
  addModalInstance(context.instanceId);
49649
49639
  addModalCascadeConfig({
49650
49640
  instanceId: context.instanceId,
49651
- width: props.width,
49652
- cascade: !!props.cascade && !!props.width && !!isPositionX
49641
+ cascade: !!props.cascade && !!isPositionX,
49642
+ cascadeWidth: typeof_default()(props.cascade) === 'object' ? props.cascade.width || 180 : 180
49653
49643
  });
49654
49644
  }
49655
49645
  if (!visible && index > -1 && !animation) {
@@ -49825,6 +49815,7 @@ var Modal = function Modal(props) {
49825
49815
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
49826
49816
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.header,
49827
49817
  onMouseDown: props.moveable && !props.fullScreen ? moveInfo.handleMouseDown : undefined,
49818
+ style: props.headerStyle,
49828
49819
  children: [renderIcon(), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
49829
49820
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.headerTitle,
49830
49821
  children: props.title
@@ -49849,6 +49840,7 @@ var Modal = function Modal(props) {
49849
49840
  if (!props.footer) return null;
49850
49841
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
49851
49842
  className: modalClasses === null || modalClasses === void 0 ? void 0 : modalClasses.footer,
49843
+ style: props.footerStyle,
49852
49844
  children: props.footer
49853
49845
  });
49854
49846
  };
@@ -49871,20 +49863,22 @@ var Modal = function Modal(props) {
49871
49863
  };
49872
49864
  if (!context.renderEd && !visible) return null;
49873
49865
  context.renderEd = true;
49874
- var marginStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
49866
+ var cascadeStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
49875
49867
  if (!props.cascade) return;
49876
49868
  var idx = config.instanceIds.findIndex(function (id) {
49877
49869
  return id === context.instanceId;
49878
49870
  });
49879
- var afterInstances = config.cascadeConfigs.filter(function (_, index) {
49880
- return index > idx;
49881
- }).filter(function (c) {
49882
- return c.cascade;
49883
- }).slice(0, 1);
49884
- var width = afterInstances.reduce(function (ret, cur) {
49885
- return (ret || 0) + cur.width;
49886
- }, 0);
49887
- return defineProperty_default()(defineProperty_default()({}, props.position === 'left' ? 'marginLeft' : 'marginRight', "".concat(width, "px")), "transition", width ? 'margin .3s ease .05s' : 'margin 0.2s ease');
49871
+ var instance = 0;
49872
+ var curCascadeConfig = config.cascadeConfigs.find(function (c) {
49873
+ return c.instanceId === context.instanceId;
49874
+ });
49875
+ if (curCascadeConfig && idx < config.cascadeConfigs.length - 1) {
49876
+ instance = curCascadeConfig.cascadeWidth;
49877
+ }
49878
+ return {
49879
+ transform: props.position === 'left' ? "translateX(".concat(instance, "px)") : "translateX(-".concat(instance, "px)"),
49880
+ transition: instance ? 'transform 0.3s ease 0.05s' : 'transform 0.2s ease'
49881
+ };
49888
49882
  }, [config.cascadeConfigs, config.instanceIds]);
49889
49883
  var panelStyle = objectSpread2_default()(objectSpread2_default()({
49890
49884
  transformOrigin: origin,
@@ -49892,7 +49886,7 @@ var Modal = function Modal(props) {
49892
49886
  }, props.style), {}, {
49893
49887
  width: props.fullScreen ? undefined : width,
49894
49888
  height: props.fullScreen ? undefined : height
49895
- }, marginStyle);
49889
+ }, cascadeStyle);
49896
49890
  if (props.resizable) {
49897
49891
  panelStyle.width = resizeInfo.width;
49898
49892
  panelStyle.height = resizeInfo.height;
@@ -73611,7 +73605,7 @@ var upload_interface = __webpack_require__(8821);
73611
73605
 
73612
73606
 
73613
73607
  /* harmony default export */ var src_0 = ({
73614
- version: '3.9.0-beta.12'
73608
+ version: '3.9.0-beta.14'
73615
73609
  });
73616
73610
  }();
73617
73611
  /******/ return __webpack_exports__;