shineout 3.8.6-beta.5 → 3.9.0-beta.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.
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.9.0-beta.1'
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.9.0-beta.1');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -31147,7 +31147,7 @@ var getPositionStyle = function getPositionStyle(position, config) {
31147
31147
  return newStyle;
31148
31148
  };
31149
31149
  ;// CONCATENATED MODULE: ../hooks/src/common/use-position-style/get-sizing-style.ts
31150
- // 第一阶段:支持上下边界的高度限制
31150
+ // 第一阶段:支持上下边界的高度限制,为vertical模式的Menu实现的
31151
31151
  // TODO 后续支持左右边界的宽度限制
31152
31152
  var getSizingStyle = function getSizingStyle(position, _ref) {
31153
31153
  var boundary = _ref.boundary,
@@ -31483,7 +31483,6 @@ var getScrollPosition = function getScrollPosition(element) {
31483
31483
 
31484
31484
 
31485
31485
 
31486
-
31487
31486
  var horizontalPosition = ['left-bottom', 'left-top', 'right-bottom', 'right-top', 'left', 'right'];
31488
31487
  var verticalPosition = ['bottom-left', 'bottom-right', 'top-left', 'top-right', 'bottom', 'top'];
31489
31488
  var hideStyle = {
@@ -31522,12 +31521,15 @@ var usePositionStyle = function usePositionStyle(config) {
31522
31521
  updateKey = _ref.updateKey,
31523
31522
  adjust = _ref.adjust,
31524
31523
  offset = _ref.offset,
31525
- checkPosition = _ref.checkPosition;
31524
+ checkPosition = _ref.checkPosition,
31525
+ setSizingStyle = _ref.setSizingStyle;
31526
31526
  // 初次渲染无样式的时候, 隐藏展示
31527
31527
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(hideStyle),
31528
31528
  _useState2 = slicedToArray_default()(_useState, 2),
31529
31529
  style = _useState2[0],
31530
31530
  setStyle = _useState2[1];
31531
+ // const [sizingStyle, setSizingStyle] = useState<React.CSSProperties>();
31532
+
31531
31533
  var _React$useRef = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useRef({
31532
31534
  containerRect: {
31533
31535
  left: 0,
@@ -31696,7 +31698,7 @@ var usePositionStyle = function usePositionStyle(config) {
31696
31698
  if (verticalPosition.includes(targetPosition)) {
31697
31699
  var _targetPosition$split = targetPosition.split('-'),
31698
31700
  _targetPosition$split2 = slicedToArray_default()(_targetPosition$split, 2),
31699
- v = _targetPosition$split2[0],
31701
+ _v = _targetPosition$split2[0],
31700
31702
  h = _targetPosition$split2[1];
31701
31703
  var overRight = 0;
31702
31704
  var overLeft = 0;
@@ -31734,7 +31736,7 @@ var usePositionStyle = function usePositionStyle(config) {
31734
31736
  style.left += overLeft;
31735
31737
  }
31736
31738
  }
31737
- if (v === 'bottom') {
31739
+ if (_v === 'bottom') {
31738
31740
  style.top = rect.bottom - containerRect.top + containerScroll.top + popupGap;
31739
31741
  } else {
31740
31742
  style.top = rect.top - containerRect.top + containerScroll.top - popupGap;
@@ -31744,11 +31746,11 @@ var usePositionStyle = function usePositionStyle(config) {
31744
31746
  var _targetPosition$split3 = targetPosition.split('-'),
31745
31747
  _targetPosition$split4 = slicedToArray_default()(_targetPosition$split3, 2),
31746
31748
  _h = _targetPosition$split4[0],
31747
- _v = _targetPosition$split4[1];
31748
- if (_v === 'top') {
31749
+ _v2 = _targetPosition$split4[1];
31750
+ if (_v2 === 'top') {
31749
31751
  style.top = rect.top - containerRect.top + containerScroll.top - (offset ? offset[1] : 0);
31750
31752
  setTransform(style, 'translateX(0%)');
31751
- } else if (_v === 'bottom') {
31753
+ } else if (_v2 === 'bottom') {
31752
31754
  style.top = rect.bottom - containerRect.top + containerScroll.top + (offset ? offset[1] : 0);
31753
31755
  setTransform(style, 'translateY(-100%)');
31754
31756
  } else {
@@ -31814,7 +31816,9 @@ var usePositionStyle = function usePositionStyle(config) {
31814
31816
  var _ref2 = config || {},
31815
31817
  position = _ref2.position,
31816
31818
  absolute = _ref2.absolute;
31817
- if (!position || !show || !parentElRef.current) return style;
31819
+ if (!position || !show || !parentElRef.current) return {
31820
+ newStyle: style
31821
+ };
31818
31822
  context.parentRect = parentElRef.current.getBoundingClientRect();
31819
31823
  var realPosition = position;
31820
31824
  if (adjust) {
@@ -31842,19 +31846,27 @@ var usePositionStyle = function usePositionStyle(config) {
31842
31846
  newStyle.transformOrigin = 'center top';
31843
31847
  }
31844
31848
  if (boundary && show && popupElRef.current) {
31845
- var sizingStyle = getSizingStyle(realPosition, {
31849
+ var newSizingStyle = getSizingStyle(realPosition, {
31846
31850
  boundary: boundary,
31847
31851
  parentRect: context.parentRect
31848
31852
  });
31849
- return objectSpread2_default()(objectSpread2_default()({}, newStyle), sizingStyle);
31853
+ return {
31854
+ newStyle: newStyle,
31855
+ newSizingStyle: newSizingStyle
31856
+ };
31850
31857
  }
31851
- return newStyle;
31858
+ return {
31859
+ newStyle: newStyle
31860
+ };
31852
31861
  };
31853
31862
  var updateStyle = use_persist_fn(function () {
31854
- var newStyle = getStyle();
31863
+ var _getStyle = getStyle(),
31864
+ newStyle = _getStyle.newStyle,
31865
+ newSizingStyle = _getStyle.newSizingStyle;
31855
31866
  if (newStyle && !shallow_equal(style, newStyle)) {
31856
31867
  setStyle(newStyle);
31857
31868
  }
31869
+ setSizingStyle === null || setSizingStyle === void 0 || setSizingStyle(newSizingStyle);
31858
31870
 
31859
31871
  // 当父元素的滚动容器滚动时,判断是否需要更新弹出层位置,包括是否隐藏弹出层(通过hideStyle隐藏,不是show状态)
31860
31872
  if (show) {
@@ -32531,6 +32543,7 @@ var AbsoluteList = function AbsoluteList(props) {
32531
32543
  adjust = props.adjust,
32532
32544
  onAdjust = props.onAdjust,
32533
32545
  offset = props.offset,
32546
+ setSizingStyle = props.setSizingStyle,
32534
32547
  _props$destroy = props.destroy,
32535
32548
  destroy = _props$destroy === void 0 ? false : _props$destroy,
32536
32549
  _props$lazy = props.lazy,
@@ -32578,7 +32591,8 @@ var AbsoluteList = function AbsoluteList(props) {
32578
32591
  adjust: adjust,
32579
32592
  offset: offset,
32580
32593
  onAdjust: onAdjust,
32581
- checkPosition: checkPosition
32594
+ checkPosition: checkPosition,
32595
+ setSizingStyle: setSizingStyle
32582
32596
  }),
32583
32597
  style = _usePositionStyle.style;
32584
32598
  var childStyle = children.props.style;
@@ -32673,11 +32687,15 @@ var Popover = function Popover(props) {
32673
32687
  _React$useState2 = slicedToArray_default()(_React$useState, 2),
32674
32688
  positionState = _React$useState2[0],
32675
32689
  setPositionState = _React$useState2[1];
32676
- var events = getTargetProps();
32677
- var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
32690
+ var _React$useState3 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(),
32678
32691
  _React$useState4 = slicedToArray_default()(_React$useState3, 2),
32679
- updateKey = _React$useState4[0],
32680
- setUpdateKey = _React$useState4[1];
32692
+ contentStyle = _React$useState4[0],
32693
+ setContentStyle = _React$useState4[1];
32694
+ var events = getTargetProps();
32695
+ var _React$useState5 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
32696
+ _React$useState6 = slicedToArray_default()(_React$useState5, 2),
32697
+ updateKey = _React$useState6[0],
32698
+ setUpdateKey = _React$useState6[1];
32681
32699
  var handleUpdateKey = usePersistFn(function () {
32682
32700
  setUpdateKey(function (prev) {
32683
32701
  return (prev + 1) % 2;
@@ -32786,6 +32804,7 @@ var Popover = function Popover(props) {
32786
32804
  lazy: props.lazy,
32787
32805
  offset: props.offset,
32788
32806
  updateKey: updateKey,
32807
+ setSizingStyle: props.boundary ? setContentStyle : undefined,
32789
32808
  children: /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()(objectSpread2_default()({
32790
32809
  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
32810
  style: containerStyle
@@ -32801,7 +32820,7 @@ var Popover = function Popover(props) {
32801
32820
  className: classnames_default()(popoverStyle === null || popoverStyle === void 0 ? void 0 : popoverStyle.arrow, props.arrowClass),
32802
32821
  dir: config.direction
32803
32822
  }), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
32804
- style: style,
32823
+ style: objectSpread2_default()(objectSpread2_default()({}, contentStyle), style),
32805
32824
  onClick: emptyEvent,
32806
32825
  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
32826
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(Provider, {
@@ -43085,15 +43104,16 @@ var Cascader = function Cascader(props0) {
43085
43104
  });
43086
43105
  };
43087
43106
  var renderEmpty = function renderEmpty() {
43107
+ var $empty = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43108
+ className: styles === null || styles === void 0 ? void 0 : styles.empty,
43109
+ children: emptyText || getLocale(locale, 'noData')
43110
+ });
43088
43111
  if (renderOptionList) {
43089
- return renderOptionList(null, {
43112
+ return renderOptionList($empty, {
43090
43113
  loading: !!loading
43091
43114
  });
43092
43115
  }
43093
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43094
- className: styles === null || styles === void 0 ? void 0 : styles.empty,
43095
- children: emptyText || getLocale(locale, 'noData')
43096
- });
43116
+ return $empty;
43097
43117
  };
43098
43118
  var renderNormalList = function renderNormalList() {
43099
43119
  if (!open && isFirstRender.current) {
@@ -43113,7 +43133,7 @@ var Cascader = function Cascader(props0) {
43113
43133
  } : {
43114
43134
  maxHeight: height
43115
43135
  };
43116
- return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43136
+ var $filterList = /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
43117
43137
  className: classnames_default()(styles.listContent, styles.filterList),
43118
43138
  style: listStyle,
43119
43139
  children: /*#__PURE__*/(0,jsx_runtime.jsx)(filter_list, {
@@ -43137,6 +43157,12 @@ var Cascader = function Cascader(props0) {
43137
43157
  onPathChange: handlePathChange
43138
43158
  })
43139
43159
  });
43160
+ if (renderOptionList) {
43161
+ return renderOptionList($filterList, {
43162
+ loading: !!loading
43163
+ });
43164
+ }
43165
+ return $filterList;
43140
43166
  };
43141
43167
  var renderLoading = function renderLoading() {
43142
43168
  if (loading !== true) {
@@ -49665,7 +49691,6 @@ var Modal = function Modal(props) {
49665
49691
  if (props.setInnerClose) {
49666
49692
  props.setInnerClose(function () {
49667
49693
  setVisible(false);
49668
- setAnimation(true);
49669
49694
  });
49670
49695
  }
49671
49696
  }, [props.setInnerClose]);
@@ -59787,7 +59812,10 @@ var MenuItem = function MenuItem(props) {
59787
59812
  minWidth: liRef.current.clientWidth
59788
59813
  };
59789
59814
  }
59790
- return /*#__PURE__*/(0,jsx_runtime.jsx)(src_popover_popover, {
59815
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(src_popover_popover
59816
+ // popover现在有出现动画了,避免快速切换子菜单时的动画太多,也加上toggleDuration
59817
+ , {
59818
+ mouseEnterDelay: toggleDuration,
59791
59819
  mouseLeaveDelay: toggleDuration,
59792
59820
  className: classnames_default()(classes === null || classes === void 0 ? void 0 : classes.popover),
59793
59821
  attributes: getDataAttribute({
@@ -73329,7 +73357,7 @@ var upload_interface = __webpack_require__(8821);
73329
73357
 
73330
73358
 
73331
73359
  /* harmony default export */ var src_0 = ({
73332
- version: '3.8.6-beta.5'
73360
+ version: '3.9.0-beta.1'
73333
73361
  });
73334
73362
  }();
73335
73363
  /******/ return __webpack_exports__;