shineout 3.8.6-beta.5 → 3.8.6-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.8.6-beta.5'
525
+ version: '3.8.6-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.8.6-beta.5');
12389
+ /* harmony default export */ var version = ('3.8.6-beta.7');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -17548,12 +17548,6 @@ var cascaderStyle = objectSpread2_default()(objectSpread2_default()({
17548
17548
  right: src.cascaderSmallPaddingX
17549
17549
  }
17550
17550
  }), '&$wrapperLarge', {
17551
- '& $tag': {
17552
- height: selectLargeTagHeight,
17553
- '& *': {
17554
- lineHeight: selectLargeTagHeight
17555
- }
17556
- },
17557
17551
  '& $placeholder,$ellipsis,$space,input': {
17558
17552
  marginTop: src.cascaderLargePlaceholderMarginY,
17559
17553
  marginBottom: src.cascaderLargePlaceholderMarginY
@@ -23802,12 +23796,6 @@ var selectStyle = objectSpread2_default()(objectSpread2_default()({
23802
23796
  marginBottom: 0
23803
23797
  }
23804
23798
  }), '&$wrapperLarge', {
23805
- '& $tag': {
23806
- height: select_selectLargeTagHeight,
23807
- '& *': {
23808
- lineHeight: select_selectLargeTagHeight
23809
- }
23810
- },
23811
23799
  '& $placeholder,$ellipsis,$space,input': {
23812
23800
  marginTop: src.selectLargePlaceholderMarginY,
23813
23801
  marginBottom: src.selectLargePlaceholderMarginY
@@ -29133,12 +29121,6 @@ var treeSelectStyle = objectSpread2_default()(objectSpread2_default()({
29133
29121
  right: src.treeSelectSmallPaddingX
29134
29122
  }
29135
29123
  }), '&$wrapperLarge', {
29136
- '& $tag': {
29137
- height: tree_select_selectLargeTagHeight,
29138
- '& *': {
29139
- lineHeight: tree_select_selectLargeTagHeight
29140
- }
29141
- },
29142
29124
  '& $placeholder,$ellipsis,$space,input': {
29143
29125
  marginTop: src.treeSelectLargePlaceholderMarginY,
29144
29126
  marginBottom: src.treeSelectLargePlaceholderMarginY
@@ -31147,7 +31129,7 @@ var getPositionStyle = function getPositionStyle(position, config) {
31147
31129
  return newStyle;
31148
31130
  };
31149
31131
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/get-sizing-style.ts
31150
- // 第一阶段:支持上下边界的高度限制
31132
+ // 第一阶段:支持上下边界的高度限制,为vertical模式的Menu实现的
31151
31133
  // TODO 后续支持左右边界的宽度限制
31152
31134
  var getSizingStyle = function getSizingStyle(position, _ref) {
31153
31135
  var boundary = _ref.boundary,
@@ -31483,7 +31465,6 @@ var getScrollPosition = function getScrollPosition(element) {
31483
31465
 
31484
31466
 
31485
31467
 
31486
-
31487
31468
  var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
31488
31469
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
31489
31470
  var hideStyle = {
@@ -31522,12 +31503,15 @@ var usePositionStyle = function usePositionStyle(config) {
31522
31503
  updateKey = _ref.updateKey,
31523
31504
  adjust = _ref.adjust,
31524
31505
  offset = _ref.offset,
31525
- checkPosition = _ref.checkPosition;
31506
+ checkPosition = _ref.checkPosition,
31507
+ setSizingStyle = _ref.setSizingStyle;
31526
31508
  // 初次渲染无样式的时候, 隐藏展示
31527
31509
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(hideStyle),
31528
31510
  _useState2 = slicedToArray_default()(_useState, 2),
31529
31511
  style = _useState2[0],
31530
31512
  setStyle = _useState2[1];
31513
+ // const [sizingStyle, setSizingStyle] = useState<React.CSSProperties>();
31514
+
31531
31515
  var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef({
31532
31516
  containerRect: {
31533
31517
  left: 0,
@@ -31696,7 +31680,7 @@ var usePositionStyle = function usePositionStyle(config) {
31696
31680
  if (verticalPosition.includes(targetPosition)) {
31697
31681
  var _targetPosition$split = targetPosition.split('-'),
31698
31682
  _targetPosition$split2 = slicedToArray_default()(_targetPosition$split, 2),
31699
- v = _targetPosition$split2[0],
31683
+ _v = _targetPosition$split2[0],
31700
31684
  h = _targetPosition$split2[1];
31701
31685
  var overRight = 0;
31702
31686
  var overLeft = 0;
@@ -31734,7 +31718,7 @@ var usePositionStyle = function usePositionStyle(config) {
31734
31718
  style.left += overLeft;
31735
31719
  }
31736
31720
  }
31737
- if (v === 'bottom') {
31721
+ if (_v === 'bottom') {
31738
31722
  style.top = rect.bottom - containerRect.top + containerScroll.top + popupGap;
31739
31723
  } else {
31740
31724
  style.top = rect.top - containerRect.top + containerScroll.top - popupGap;
@@ -31744,11 +31728,11 @@ var usePositionStyle = function usePositionStyle(config) {
31744
31728
  var _targetPosition$split3 = targetPosition.split('-'),
31745
31729
  _targetPosition$split4 = slicedToArray_default()(_targetPosition$split3, 2),
31746
31730
  _h = _targetPosition$split4[0],
31747
- _v = _targetPosition$split4[1];
31748
- if (_v === 'top') {
31731
+ _v2 = _targetPosition$split4[1];
31732
+ if (_v2 === 'top') {
31749
31733
  style.top = rect.top - containerRect.top + containerScroll.top - (offset ? offset[1] : 0);
31750
31734
  setTransform(style, 'translateX(0%)');
31751
- } else if (_v === 'bottom') {
31735
+ } else if (_v2 === 'bottom') {
31752
31736
  style.top = rect.bottom - containerRect.top + containerScroll.top + (offset ? offset[1] : 0);
31753
31737
  setTransform(style, 'translateY(-100%)');
31754
31738
  } else {
@@ -31814,7 +31798,9 @@ var usePositionStyle = function usePositionStyle(config) {
31814
31798
  var _ref2 = config || {},
31815
31799
  position = _ref2.position,
31816
31800
  absolute = _ref2.absolute;
31817
- if (!position || !show || !parentElRef.current) return style;
31801
+ if (!position || !show || !parentElRef.current) return {
31802
+ newStyle: style
31803
+ };
31818
31804
  context.parentRect = parentElRef.current.getBoundingClientRect();
31819
31805
  var realPosition = position;
31820
31806
  if (adjust) {
@@ -31842,19 +31828,27 @@ var usePositionStyle = function usePositionStyle(config) {
31842
31828
  newStyle.transformOrigin = 'center top';
31843
31829
  }
31844
31830
  if (boundary && show && popupElRef.current) {
31845
- var sizingStyle = getSizingStyle(realPosition, {
31831
+ var newSizingStyle = getSizingStyle(realPosition, {
31846
31832
  boundary: boundary,
31847
31833
  parentRect: context.parentRect
31848
31834
  });
31849
- return objectSpread2_default()(objectSpread2_default()({}, newStyle), sizingStyle);
31835
+ return {
31836
+ newStyle: newStyle,
31837
+ newSizingStyle: newSizingStyle
31838
+ };
31850
31839
  }
31851
- return newStyle;
31840
+ return {
31841
+ newStyle: newStyle
31842
+ };
31852
31843
  };
31853
31844
  var updateStyle = use_persist_fn(function () {
31854
- var newStyle = getStyle();
31845
+ var _getStyle = getStyle(),
31846
+ newStyle = _getStyle.newStyle,
31847
+ newSizingStyle = _getStyle.newSizingStyle;
31855
31848
  if (newStyle && !shallow_equal(style, newStyle)) {
31856
31849
  setStyle(newStyle);
31857
31850
  }
31851
+ setSizingStyle === null || setSizingStyle === void 0 || setSizingStyle(newSizingStyle);
31858
31852
 
31859
31853
  // 当父元素的滚动容器滚动时,判断是否需要更新弹出层位置,包括是否隐藏弹出层(通过hideStyle隐藏,不是show状态)
31860
31854
  if (show) {
@@ -32531,6 +32525,7 @@ var AbsoluteList = function AbsoluteList(props) {
32531
32525
  adjust = props.adjust,
32532
32526
  onAdjust = props.onAdjust,
32533
32527
  offset = props.offset,
32528
+ setSizingStyle = props.setSizingStyle,
32534
32529
  _props$destroy = props.destroy,
32535
32530
  destroy = _props$destroy === void 0 ? false : _props$destroy,
32536
32531
  _props$lazy = props.lazy,
@@ -32578,7 +32573,8 @@ var AbsoluteList = function AbsoluteList(props) {
32578
32573
  adjust: adjust,
32579
32574
  offset: offset,
32580
32575
  onAdjust: onAdjust,
32581
- checkPosition: checkPosition
32576
+ checkPosition: checkPosition,
32577
+ setSizingStyle: setSizingStyle
32582
32578
  }),
32583
32579
  style = _usePositionStyle.style;
32584
32580
  var childStyle = children.props.style;
@@ -32673,11 +32669,15 @@ var Popover = function Popover(props) {
32673
32669
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
32674
32670
  positionState = _React$useState2[0],
32675
32671
  setPositionState = _React$useState2[1];
32676
- var events = getTargetProps();
32677
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
32672
+ var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(),
32678
32673
  _React$useState4 = slicedToArray_default()(_React$useState3, 2),
32679
- updateKey = _React$useState4[0],
32680
- setUpdateKey = _React$useState4[1];
32674
+ contentStyle = _React$useState4[0],
32675
+ setContentStyle = _React$useState4[1];
32676
+ var events = getTargetProps();
32677
+ var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
32678
+ _React$useState6 = slicedToArray_default()(_React$useState5, 2),
32679
+ updateKey = _React$useState6[0],
32680
+ setUpdateKey = _React$useState6[1];
32681
32681
  var handleUpdateKey = usePersistFn(function () {
32682
32682
  setUpdateKey(function (prev) {
32683
32683
  return (prev + 1) % 2;
@@ -32786,6 +32786,7 @@ var Popover = function Popover(props) {
32786
32786
  lazy: props.lazy,
32787
32787
  offset: props.offset,
32788
32788
  updateKey: updateKey,
32789
+ setSizingStyle: props.boundary ? setContentStyle : undefined,
32789
32790
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
32790
32791
  className: classnames_default()(className, popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.rootClass, popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.wrapper, open && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.wrapperOpen), !showArrow && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.hideArrow)),
32791
32792
  style: containerStyle
@@ -32801,7 +32802,7 @@ var Popover = function Popover(props) {
32801
32802
  className: classnames_default()(popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.arrow, props.arrowClass),
32802
32803
  dir: config.direction
32803
32804
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
32804
- style: style,
32805
+ style: objectSpread2_default()(objectSpread2_default()({}, contentStyle), style),
32805
32806
  onClick: emptyEvent,
32806
32807
  className: classnames_default()(popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.content, (typeof childrened === 'string' || props.useTextStyle) && (popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.text)),
32807
32808
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
@@ -49665,7 +49666,6 @@ var Modal = function Modal(props) {
49665
49666
  if (props.setInnerClose) {
49666
49667
  props.setInnerClose(function () {
49667
49668
  setVisible(false);
49668
- setAnimation(true);
49669
49669
  });
49670
49670
  }
49671
49671
  }, [props.setInnerClose]);
@@ -59787,7 +59787,10 @@ var MenuItem = function MenuItem(props) {
59787
59787
  minWidth: liRef.current.clientWidth
59788
59788
  };
59789
59789
  }
59790
- return /*#__PURE__*/(0,jsx_runtime.jsx)(src_popover_popover, {
59790
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(src_popover_popover
59791
+ // popover现在有出现动画了,避免快速切换子菜单时的动画太多,也加上toggleDuration
59792
+ , {
59793
+ mouseEnterDelay: toggleDuration,
59791
59794
  mouseLeaveDelay: toggleDuration,
59792
59795
  className: classnames_default()(classes === null || classes === void 0 ? void 0 : classes.popover),
59793
59796
  attributes: getDataAttribute({
@@ -73329,7 +73332,7 @@ var upload_interface = __webpack_require__(8821);
73329
73332
 
73330
73333
 
73331
73334
  /* harmony default export */ var src_0 = ({
73332
- version: '3.8.6-beta.5'
73335
+ version: '3.8.6-beta.7'
73333
73336
  });
73334
73337
  }();
73335
73338
  /******/ return __webpack_exports__;