shineout 3.3.3-beta.5 → 3.3.3-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
@@ -476,5 +476,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
476
476
  // 此文件由脚本自动生成,请勿直接修改。
477
477
  // This file was generated automatically by a script. Please do not modify it directly.
478
478
  var _default = exports.default = {
479
- version: '3.3.3-beta.5'
479
+ version: '3.3.3-beta.7'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11968,7 +11968,7 @@ var handleStyle = function handleStyle(style) {
11968
11968
  };
11969
11969
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11970
11970
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11971
- /* harmony default export */ var version = ('3.3.3-beta.5');
11971
+ /* harmony default export */ var version = ('3.3.3-beta.7');
11972
11972
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11973
11973
 
11974
11974
 
@@ -36729,7 +36729,7 @@ var result_Result = function Result(props) {
36729
36729
  onRemove = props.onRemove,
36730
36730
  onResultItemClick = props.onResultItemClick,
36731
36731
  data = props.data;
36732
- var value = result_isArray(valueProp) ? valueProp : [valueProp];
36732
+ var value = [null, undefined].includes(valueProp) ? [] : Array.isArray(valueProp) ? valueProp : [valueProp];
36733
36733
  var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(-1),
36734
36734
  _useState2 = slicedToArray_default()(_useState, 2),
36735
36735
  more = _useState2[0],
@@ -36886,7 +36886,9 @@ var result_Result = function Result(props) {
36886
36886
  }, 'single');
36887
36887
  };
36888
36888
  var getValueArr = function getValueArr(v) {
36889
- return result_isArray(v) ? v : [v];
36889
+ return (result_isArray(v) ? v : [v]).filter(function (v) {
36890
+ return v !== undefined && v !== null;
36891
+ });
36890
36892
  };
36891
36893
  var renderMultipleResult = function renderMultipleResult() {
36892
36894
  if (isEmptyResult()) return renderNbsp();
@@ -43687,7 +43689,7 @@ DrawerComp.Submit = src_modal_0.Submit;
43687
43689
 
43688
43690
 
43689
43691
  var Item_excluded = ["className"],
43690
- Item_excluded2 = ["className"];
43692
+ Item_excluded2 = ["className", "onClick"];
43691
43693
 
43692
43694
 
43693
43695
 
@@ -43749,10 +43751,15 @@ var Item_Item = /*#__PURE__*/function (_React$PureComponent) {
43749
43751
  var _ref2 = content.props,
43750
43752
  _ref2$className = _ref2.className,
43751
43753
  contentPropsClassName = _ref2$className === void 0 ? '' : _ref2$className,
43754
+ contentPropsOnClick = _ref2.onClick,
43752
43755
  otherContentProps = objectWithoutProperties_default()(_ref2, Item_excluded2);
43753
43756
  var className = classnames_default()(propsClassName, contentPropsClassName);
43754
43757
  return /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.cloneElement)(content, Object.assign(otherProps, otherContentProps, {
43755
- className: className
43758
+ className: className,
43759
+ onClick: function onClick(e) {
43760
+ if (contentPropsOnClick) contentPropsOnClick(e);
43761
+ if (props.onClick) props.onClick(e);
43762
+ }
43756
43763
  }));
43757
43764
  }
43758
43765
  return /*#__PURE__*/(0,jsx_runtime.jsx)("a", objectSpread2_default()(objectSpread2_default()({}, props), {}, {
@@ -56657,6 +56664,7 @@ var useTableRow = function useTableRow(props) {
56657
56664
 
56658
56665
 
56659
56666
 
56667
+
56660
56668
  var Tr = function Tr(props) {
56661
56669
  var _props$jssStyle, _props$jssStyle$table, _props$rowClassName;
56662
56670
  var treeFunc = props.treeFunc;
@@ -56710,12 +56718,22 @@ var Tr = function Tr(props) {
56710
56718
  columnKey: props.columns[colIndex].key
56711
56719
  });
56712
56720
  });
56713
- (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56721
+ var setVirtualRowHeight = usePersistFn(function () {
56714
56722
  if (props.setRowHeight && trRef.current) {
56715
56723
  var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
56716
56724
  props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
56717
56725
  }
56718
- }, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
56726
+ });
56727
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(setVirtualRowHeight, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
56728
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56729
+ if (!trRef.current) return;
56730
+ var cancelObserver = addResizeObserver(trRef.current, setVirtualRowHeight, {
56731
+ direction: 'y'
56732
+ });
56733
+ return function () {
56734
+ cancelObserver();
56735
+ };
56736
+ }, []);
56719
56737
  var renderTreeExpand = function renderTreeExpand(content) {
56720
56738
  var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
56721
56739
  var level = props.treeExpandLevel.get(props.originKey) || 0;
@@ -57831,10 +57849,11 @@ var useTransform = function useTransform(props) {
57831
57849
 
57832
57850
 
57833
57851
 
57852
+
57834
57853
  var Tab = function Tab(props, ref) {
57835
57854
  var _jssStyle$tabs;
57836
57855
  var jssStyle = props.jssStyle,
57837
- tab = props.tab,
57856
+ propTab = props.tab,
57838
57857
  disabled = props.disabled,
57839
57858
  id = props.id,
57840
57859
  color = props.color;
@@ -57860,13 +57879,11 @@ var Tab = function Tab(props, ref) {
57860
57879
  };
57861
57880
  var handleClick = function handleClick() {
57862
57881
  if (disabled) return;
57863
- if (isLink(tab)) {
57864
- if (tab.props.onClick && typeof tab.props.onClick === 'function') {
57865
- tab.props.onClick();
57866
- }
57867
- }
57868
57882
  onChange === null || onChange === void 0 || onChange(id);
57869
57883
  };
57884
+ var tab = isLink(propTab) ?
57885
+ // 直接返回a标签的内容,不要a标签
57886
+ propTab.props.children : propTab;
57870
57887
  var renderCardTab = function renderCardTab() {
57871
57888
  return tab;
57872
57889
  };
@@ -57898,27 +57915,35 @@ var Tab = function Tab(props, ref) {
57898
57915
  if (shape === 'card') {
57899
57916
  style.color = color;
57900
57917
  }
57901
- if (shape === 'button') return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_button_button, objectSpread2_default()(objectSpread2_default()({
57902
- className: tabClass,
57903
- jssStyle: {
57904
- button: buttonStyle
57905
- }
57906
- }, getStateProps()), {}, {
57907
- style: style,
57908
- disabled: disabled,
57909
- type: isActive ? 'primary' : 'secondary',
57910
- onClick: handleClick,
57911
- dir: config.direction,
57912
- children: tab
57913
- }));
57914
- return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({
57915
- dir: config.direction,
57918
+ var containerProps = objectSpread2_default()(objectSpread2_default()({
57916
57919
  className: tabClass
57917
57920
  }, getStateProps()), {}, {
57918
57921
  style: style,
57919
57922
  onClick: handleClick,
57920
57923
  ref: ref,
57924
+ dir: config.direction
57925
+ });
57926
+ if (shape === 'button') {
57927
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(base_src_button_button, objectSpread2_default()(objectSpread2_default()({
57928
+ jssStyle: {
57929
+ button: buttonStyle
57930
+ },
57931
+ disabled: disabled,
57932
+ type: isActive ? 'primary' : 'secondary'
57933
+ }, containerProps), {}, {
57934
+ children: tab
57935
+ }));
57936
+ }
57937
+ var $children = /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
57921
57938
  children: [shape === 'card' && renderCardTab(), shape === 'line' && renderLineTab(), shape === 'dash' && renderDashTab(), shape === 'fill' && renderFillTab()]
57939
+ });
57940
+ if (isLink(propTab)) {
57941
+ return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().cloneElement(propTab, objectSpread2_default()({
57942
+ children: $children
57943
+ }, containerProps));
57944
+ }
57945
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, containerProps), {}, {
57946
+ children: $children
57922
57947
  }));
57923
57948
  };
57924
57949
  /* harmony default export */ var tabs_tab = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().forwardRef(Tab));
@@ -63661,7 +63686,7 @@ var upload_interface = __webpack_require__(8821);
63661
63686
 
63662
63687
 
63663
63688
  /* harmony default export */ var src_0 = ({
63664
- version: '3.3.3-beta.5'
63689
+ version: '3.3.3-beta.7'
63665
63690
  });
63666
63691
  }();
63667
63692
  /******/ return __webpack_exports__;