shineout 3.9.0-beta.6 → 3.9.0-beta.8

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.6'
525
+ version: '3.9.0-beta.8'
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.6');
12389
+ /* harmony default export */ var version = ('3.9.0-beta.8');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -14940,7 +14940,8 @@ var tabsTokens = {
14940
14940
  tabsActionHorizontalPaddingX: 'Spacing-7',
14941
14941
  tabsActionHorizontalPaddingY: 'Spacing-8',
14942
14942
  tabsExtraFillHoverBackgroundColor: 'Neutral-fill-3',
14943
- tabsArrowFontColor: 'Neutral-text-4'
14943
+ tabsArrowFontColor: 'Neutral-text-4',
14944
+ tabsBadgeMargin: 'Spacing-0'
14944
14945
  };
14945
14946
  /* harmony default export */ var tabs = (tabsTokens);
14946
14947
  ;// CONCATENATED MODULE: ../theme/src/tabs/index.ts
@@ -27538,7 +27539,6 @@ var tabsStyle = {
27538
27539
  },
27539
27540
  headerWrapper: objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
27540
27541
  display: 'flex',
27541
- overflow: 'hidden',
27542
27542
  position: 'relative',
27543
27543
  '&[data-soui-position^="top-"],&[data-soui-position^="bottom-"]': {
27544
27544
  alignItems: 'center',
@@ -27737,7 +27737,9 @@ var tabsStyle = {
27737
27737
  whiteSpace: 'nowrap',
27738
27738
  overflow: 'hidden',
27739
27739
  '$headerWrapper[data-soui-shape="card"] &': {
27740
+ marginTop: "calc(-1 * ".concat(src.tabsBadgeMargin, ")"),
27740
27741
  '& $tab': {
27742
+ marginTop: src.tabsBadgeMargin,
27741
27743
  position: 'relative',
27742
27744
  border: "1px solid ".concat(src.tabsCardBorderColor),
27743
27745
  padding: "".concat(src.tabsCardPaddingY, " ").concat(src.tabsCardPaddingX),
@@ -49438,9 +49440,11 @@ function _ReactUnmount() {
49438
49440
 
49439
49441
 
49440
49442
 
49443
+
49441
49444
  var hasMask = false;
49442
49445
  var modal_content_config = {
49443
49446
  instanceIds: [],
49447
+ cascadeConfigs: [],
49444
49448
  originDocumentStyle: null
49445
49449
  };
49446
49450
  var modal_content_state = createWithHooks(modal_content_config);
@@ -49450,11 +49454,34 @@ var useModalConfig = function useModalConfig() {
49450
49454
  var addModalInstance = function addModalInstance(instanceId) {
49451
49455
  modal_content_state.mutate.instanceIds.push(instanceId);
49452
49456
  };
49457
+ var addModalCascadeConfig = function addModalCascadeConfig(props) {
49458
+ var width = props.width;
49459
+ var widthNumber = 0;
49460
+ // width 是30% 这种格式的,转为number
49461
+ if (typeof width === 'string' && width.indexOf('%') > -1) {
49462
+ var parentWidth = document.body.clientWidth;
49463
+ var percent = parseInt(width, 10);
49464
+ widthNumber = parentWidth * percent / 100;
49465
+ } else {
49466
+ widthNumber = typeof width === 'number' ? width : parseInt(width, 10) || 0;
49467
+ }
49468
+ modal_content_state.mutate.cascadeConfigs.push({
49469
+ cascade: props.cascade,
49470
+ instanceId: props.instanceId,
49471
+ width: widthNumber
49472
+ });
49473
+ };
49453
49474
  var removeModalInstance = function removeModalInstance(instanceId) {
49454
49475
  modal_content_state.mutate.instanceIds = modal_content_state.mutate.instanceIds.filter(function (id) {
49455
49476
  return id !== instanceId;
49456
49477
  });
49457
49478
  };
49479
+ var removeModalCascadeConfig = function removeModalCascadeConfig(instanceId) {
49480
+ if (!modal_content_state.mutate.cascadeConfigs.length) return;
49481
+ modal_content_state.mutate.cascadeConfigs = modal_content_state.mutate.cascadeConfigs.filter(function (config) {
49482
+ return config.instanceId !== instanceId;
49483
+ });
49484
+ };
49458
49485
  var getInstanceIds = function getInstanceIds() {
49459
49486
  return modal_content_state.mutate.instanceIds;
49460
49487
  };
@@ -49542,9 +49569,15 @@ var Modal = function Modal(props) {
49542
49569
  var index = config.instanceIds.indexOf(context.instanceId);
49543
49570
  if (visible && index === -1) {
49544
49571
  addModalInstance(context.instanceId);
49572
+ addModalCascadeConfig({
49573
+ instanceId: context.instanceId,
49574
+ width: props.width,
49575
+ cascade: !!props.cascade && !!props.width && !!isPositionX
49576
+ });
49545
49577
  }
49546
49578
  if (!visible && index > -1 && !animation) {
49547
49579
  removeModalInstance(context.instanceId);
49580
+ removeModalCascadeConfig(context.instanceId);
49548
49581
  }
49549
49582
  }, [visible, animation, config.instanceIds]);
49550
49583
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(handleMaskVisible, [visible]);
@@ -49577,6 +49610,7 @@ var Modal = function Modal(props) {
49577
49610
  });
49578
49611
  var handleClose = usePersistFn(function () {
49579
49612
  var _props$onClose;
49613
+ removeModalCascadeConfig(context.instanceId);
49580
49614
  if (!visible) return;
49581
49615
  if (props.autoShow) {
49582
49616
  setVisible(false);
@@ -49666,6 +49700,7 @@ var Modal = function Modal(props) {
49666
49700
  return function () {
49667
49701
  var _props$shouldDestroy2;
49668
49702
  removeModalInstance(context.instanceId);
49703
+ removeModalCascadeConfig(context.instanceId);
49669
49704
  var instanceIds = getInstanceIds();
49670
49705
  if (instanceIds.length === 0) {
49671
49706
  resetDocumentOverflow();
@@ -49759,13 +49794,28 @@ var Modal = function Modal(props) {
49759
49794
  };
49760
49795
  if (!context.renderEd && !visible) return null;
49761
49796
  context.renderEd = true;
49797
+ var marginStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
49798
+ if (!props.cascade) return;
49799
+ var idx = config.instanceIds.findIndex(function (id) {
49800
+ return id === context.instanceId;
49801
+ });
49802
+ var afterInstances = config.cascadeConfigs.filter(function (_, index) {
49803
+ return index > idx;
49804
+ }).filter(function (c) {
49805
+ return c.cascade;
49806
+ }).slice(0, 1);
49807
+ var width = afterInstances.reduce(function (ret, cur) {
49808
+ return (ret || 0) + cur.width;
49809
+ }, 0);
49810
+ return defineProperty_default()(defineProperty_default()({}, props.position === 'left' ? 'marginLeft' : 'marginRight', "".concat(width, "px")), "transition", width ? 'margin .3s ease .05s' : 'margin 0.2s ease');
49811
+ }, [config.cascadeConfigs, config.instanceIds]);
49762
49812
  var panelStyle = objectSpread2_default()(objectSpread2_default()({
49763
49813
  transformOrigin: origin,
49764
49814
  top: props.fullScreen ? undefined : top
49765
49815
  }, props.style), {}, {
49766
49816
  width: props.fullScreen ? undefined : width,
49767
49817
  height: props.fullScreen ? undefined : height
49768
- });
49818
+ }, marginStyle);
49769
49819
  if (props.resizable) {
49770
49820
  panelStyle.width = resizeInfo.width;
49771
49821
  panelStyle.height = resizeInfo.height;
@@ -73367,7 +73417,7 @@ var upload_interface = __webpack_require__(8821);
73367
73417
 
73368
73418
 
73369
73419
  /* harmony default export */ var src_0 = ({
73370
- version: '3.9.0-beta.6'
73420
+ version: '3.9.0-beta.8'
73371
73421
  });
73372
73422
  }();
73373
73423
  /******/ return __webpack_exports__;