shineout 3.9.0-beta.5 → 3.9.0-beta.7

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.5'
525
+ version: '3.9.0-beta.7'
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.5');
12389
+ /* harmony default export */ var version = ('3.9.0-beta.7');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -17324,7 +17324,7 @@ var supportsHas = function supportsHas() {
17324
17324
  flex: 1,
17325
17325
  minWidth: 0
17326
17326
  },
17327
- '[data-soui-role="input-group"] [data-soui-input-border] + &&&': {
17327
+ '[data-soui-role="input-group"]:not([data-soui-border="false"]) [data-soui-input-border] + &&&': {
17328
17328
  borderLeftWidth: '1px'
17329
17329
  },
17330
17330
  '[data-soui-role="input-group-separate"] &&&, [data-soui-role="input-group-separate"] &&&:hover': {
@@ -49438,9 +49438,11 @@ function _ReactUnmount() {
49438
49438
 
49439
49439
 
49440
49440
 
49441
+
49441
49442
  var hasMask = false;
49442
49443
  var modal_content_config = {
49443
49444
  instanceIds: [],
49445
+ cascadeConfigs: [],
49444
49446
  originDocumentStyle: null
49445
49447
  };
49446
49448
  var modal_content_state = createWithHooks(modal_content_config);
@@ -49450,11 +49452,34 @@ var useModalConfig = function useModalConfig() {
49450
49452
  var addModalInstance = function addModalInstance(instanceId) {
49451
49453
  modal_content_state.mutate.instanceIds.push(instanceId);
49452
49454
  };
49455
+ var addModalCascadeConfig = function addModalCascadeConfig(props) {
49456
+ var width = props.width;
49457
+ var widthNumber = 0;
49458
+ // width 是30% 这种格式的,转为number
49459
+ if (typeof width === 'string' && width.indexOf('%') > -1) {
49460
+ var parentWidth = document.body.clientWidth;
49461
+ var percent = parseInt(width, 10);
49462
+ widthNumber = parentWidth * percent / 100;
49463
+ } else {
49464
+ widthNumber = typeof width === 'number' ? width : parseInt(width, 10) || 0;
49465
+ }
49466
+ modal_content_state.mutate.cascadeConfigs.push({
49467
+ cascade: props.cascade,
49468
+ instanceId: props.instanceId,
49469
+ width: widthNumber
49470
+ });
49471
+ };
49453
49472
  var removeModalInstance = function removeModalInstance(instanceId) {
49454
49473
  modal_content_state.mutate.instanceIds = modal_content_state.mutate.instanceIds.filter(function (id) {
49455
49474
  return id !== instanceId;
49456
49475
  });
49457
49476
  };
49477
+ var removeModalCascadeConfig = function removeModalCascadeConfig(instanceId) {
49478
+ if (!modal_content_state.mutate.cascadeConfigs.length) return;
49479
+ modal_content_state.mutate.cascadeConfigs = modal_content_state.mutate.cascadeConfigs.filter(function (config) {
49480
+ return config.instanceId !== instanceId;
49481
+ });
49482
+ };
49458
49483
  var getInstanceIds = function getInstanceIds() {
49459
49484
  return modal_content_state.mutate.instanceIds;
49460
49485
  };
@@ -49542,9 +49567,15 @@ var Modal = function Modal(props) {
49542
49567
  var index = config.instanceIds.indexOf(context.instanceId);
49543
49568
  if (visible && index === -1) {
49544
49569
  addModalInstance(context.instanceId);
49570
+ addModalCascadeConfig({
49571
+ instanceId: context.instanceId,
49572
+ width: props.width,
49573
+ cascade: !!props.cascade && !!props.width && !!isPositionX
49574
+ });
49545
49575
  }
49546
49576
  if (!visible && index > -1 && !animation) {
49547
49577
  removeModalInstance(context.instanceId);
49578
+ removeModalCascadeConfig(context.instanceId);
49548
49579
  }
49549
49580
  }, [visible, animation, config.instanceIds]);
49550
49581
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(handleMaskVisible, [visible]);
@@ -49577,6 +49608,7 @@ var Modal = function Modal(props) {
49577
49608
  });
49578
49609
  var handleClose = usePersistFn(function () {
49579
49610
  var _props$onClose;
49611
+ removeModalCascadeConfig(context.instanceId);
49580
49612
  if (!visible) return;
49581
49613
  if (props.autoShow) {
49582
49614
  setVisible(false);
@@ -49666,6 +49698,7 @@ var Modal = function Modal(props) {
49666
49698
  return function () {
49667
49699
  var _props$shouldDestroy2;
49668
49700
  removeModalInstance(context.instanceId);
49701
+ removeModalCascadeConfig(context.instanceId);
49669
49702
  var instanceIds = getInstanceIds();
49670
49703
  if (instanceIds.length === 0) {
49671
49704
  resetDocumentOverflow();
@@ -49759,13 +49792,28 @@ var Modal = function Modal(props) {
49759
49792
  };
49760
49793
  if (!context.renderEd && !visible) return null;
49761
49794
  context.renderEd = true;
49795
+ var marginStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
49796
+ if (!props.cascade) return;
49797
+ var idx = config.instanceIds.findIndex(function (id) {
49798
+ return id === context.instanceId;
49799
+ });
49800
+ var afterInstances = config.cascadeConfigs.filter(function (_, index) {
49801
+ return index > idx;
49802
+ }).filter(function (c) {
49803
+ return c.cascade;
49804
+ }).slice(0, 1);
49805
+ var width = afterInstances.reduce(function (ret, cur) {
49806
+ return (ret || 0) + cur.width;
49807
+ }, 0);
49808
+ return defineProperty_default()(defineProperty_default()({}, props.position === 'left' ? 'marginLeft' : 'marginRight', "".concat(width, "px")), "transition", width ? 'margin .3s ease .05s' : 'margin 0.2s ease');
49809
+ }, [config.cascadeConfigs, config.instanceIds]);
49762
49810
  var panelStyle = objectSpread2_default()(objectSpread2_default()({
49763
49811
  transformOrigin: origin,
49764
49812
  top: props.fullScreen ? undefined : top
49765
49813
  }, props.style), {}, {
49766
49814
  width: props.fullScreen ? undefined : width,
49767
49815
  height: props.fullScreen ? undefined : height
49768
- });
49816
+ }, marginStyle);
49769
49817
  if (props.resizable) {
49770
49818
  panelStyle.width = resizeInfo.width;
49771
49819
  panelStyle.height = resizeInfo.height;
@@ -54658,7 +54706,8 @@ input_input_Input.displayName = 'ShineoutInput';
54658
54706
  var shouldSeparate = separate !== null && separate !== void 0 ? separate : seperate;
54659
54707
  var rootClass = classnames_default()(className, inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.group, shouldSeparate && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSeparate), size === 'small' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupSmall), size === 'large' && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupLarge), !!disabled && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupDisabled), !!focus && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupFocus), (status === 'error' || error) && (inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.groupError));
54660
54708
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
54661
- role: shouldSeparate ? 'input-group-separate' : 'input-group'
54709
+ role: shouldSeparate ? 'input-group-separate' : 'input-group',
54710
+ border: props.seamless ? 'false' : undefined
54662
54711
  })), {}, {
54663
54712
  className: rootClass,
54664
54713
  style: objectSpread2_default()({
@@ -54674,8 +54723,7 @@ input_input_Input.displayName = 'ShineoutInput';
54674
54723
  if ( /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_.isValidElement(child)) {
54675
54724
  return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(child, objectSpread2_default()(objectSpread2_default()({}, getProps(child)), {}, {
54676
54725
  disabled: child.props.disabled || disabled,
54677
- size: child.props.size || size,
54678
- border: props.seamless ? false : child.props.border
54726
+ size: child.props.size || size
54679
54727
  }));
54680
54728
  }
54681
54729
  return /*#__PURE__*/(0,jsx_runtime.jsx)("span", {
@@ -73367,7 +73415,7 @@ var upload_interface = __webpack_require__(8821);
73367
73415
 
73368
73416
 
73369
73417
  /* harmony default export */ var src_0 = ({
73370
- version: '3.9.0-beta.5'
73418
+ version: '3.9.0-beta.7'
73371
73419
  });
73372
73420
  }();
73373
73421
  /******/ return __webpack_exports__;