shineout 3.2.0-rc.3 → 3.2.0-rc.4

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.2.0-rc.3'
479
+ version: '3.2.0-rc.4'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11949,7 +11949,7 @@ var handleStyle = function handleStyle(style) {
11949
11949
  };
11950
11950
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11951
11951
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11952
- /* harmony default export */ var version = ('3.2.0-rc.3');
11952
+ /* harmony default export */ var version = ('3.2.0-rc.4');
11953
11953
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11954
11954
 
11955
11955
 
@@ -12772,19 +12772,19 @@ var buttonTokens = {
12772
12772
  buttonLinkFocusBackgroundColor: 'transparent',
12773
12773
  buttonLinkFocusBorderColor: 'transparent',
12774
12774
  buttonFontSize: 'Font-14',
12775
- buttonBorderRadius: 'Radius-4',
12775
+ buttonBorderRadius: 'Radius-default',
12776
12776
  buttonPaddingX: 'Spacing-12',
12777
12777
  buttonPaddingY: 'Spacing-5',
12778
12778
  buttonHeight: 'Size-16',
12779
12779
  buttonFontWeight: 'Weight-regular',
12780
12780
  buttonSmallFontSize: 'Font-12',
12781
- buttonSmallBorderRadius: 'Radius-4',
12781
+ buttonSmallBorderRadius: 'Radius-default',
12782
12782
  buttonSmallPaddingX: 'Spacing-8',
12783
12783
  buttonSmallPaddingY: 'Spacing-2',
12784
12784
  buttonSmallHeight: 'Size-12',
12785
12785
  buttonSmallFontWeight: 'Weight-regular',
12786
12786
  buttonLargeFontSize: 'Font-16',
12787
- buttonLargeBorderRadius: 'Radius-4',
12787
+ buttonLargeBorderRadius: 'Radius-default',
12788
12788
  buttonLargePaddingX: 'Spacing-16',
12789
12789
  buttonLargePaddingY: 'Spacing-8',
12790
12790
  buttonLargeHeight: 'Size-20',
@@ -12867,12 +12867,12 @@ var buttonTokens = {
12867
12867
  buttonRoundBorderRadius: 'Radius-full',
12868
12868
  buttonCircleBorderRadius: 'Radius-circle',
12869
12869
  buttonSquareBorderRadius: 'Radius-default',
12870
- buttonSmallRoundBorderRadius: 'Radius-1000',
12870
+ buttonSmallRoundBorderRadius: 'Radius-full',
12871
12871
  buttonSmallCircleBorderRadius: 'Radius-circle',
12872
12872
  buttonSmallSquareBorderRadius: 'Radius-default',
12873
- buttonLargeRoundBorderRadius: 'Radius-1000',
12874
- buttonLargeCircleBorderRadius: 'Radius-50%',
12875
- buttonLargeSquareBorderRadius: 'Radius-4',
12873
+ buttonLargeRoundBorderRadius: 'Radius-full',
12874
+ buttonLargeCircleBorderRadius: 'Radius-circle',
12875
+ buttonLargeSquareBorderRadius: 'Radius-default',
12876
12876
  buttonNearlyMargin: 'Spacing-8',
12877
12877
  buttonSpinMargin: 'Spacing-4'
12878
12878
  };
@@ -14088,12 +14088,24 @@ var tableTokens = {
14088
14088
  tableCellPaddingX: 'Spacing-12',
14089
14089
  tableCellPaddingY: 'Spacing-8',
14090
14090
  tableCellBorderColor: 'Neutral-border-1',
14091
+ tableCellFontSize: 'Font-14',
14092
+ tableCellFontWeight: 'Weight-regular',
14093
+ tableSmallTheadFontSize: 'Font-14',
14094
+ tableSmallTheadFontWeight: 'Weight-medium',
14091
14095
  tableSmallCellPaddingX: 'Spacing-8',
14092
14096
  tableSmallCellPaddingY: 'Spacing-4',
14097
+ tableSmallCellFontSize: 'Font-14',
14098
+ tableSmallCellFontWeight: 'Weight-regular',
14099
+ tableLargeTheadFontSize: 'Font-14',
14100
+ tableLargeTheadFontWeight: 'Weight-medium',
14093
14101
  tableLargeCellPaddingX: 'Spacing-16',
14094
14102
  tableLargeCellPaddingY: 'Spacing-16',
14103
+ tableLargeCellFontSize: 'Font-14',
14104
+ tableLargeCellFontWeight: 'Weight-regular',
14095
14105
  tableFixedShadow: 'rgba(2,11,24,.1)',
14096
14106
  tableTheadBackgroundColor: 'Neutral-fill-2',
14107
+ tableTheadFontSize: 'Font-14',
14108
+ tableTheadFontWeight: 'Weight-medium',
14097
14109
  tableTheadFontColor: 'Neutral-text-5',
14098
14110
  tableTbodyBackgroundColor: 'Neutral-fill-1',
14099
14111
  tableTbodyStripedBackgroundColor: 'Neutral-fill-2',
@@ -14102,6 +14114,7 @@ var tableTokens = {
14102
14114
  tableTbodyFontColor: 'Neutral-text-5',
14103
14115
  tableTfootBackgroundColor: 'Neutral-fill-2',
14104
14116
  tableTfootFontColor: 'Neutral-text-5',
14117
+ tableTfootFontWeight: 'Weight-regular',
14105
14118
  tableExpandIconSize: 'Size-7',
14106
14119
  tableExpandIconColor: 'Neutral-text-2',
14107
14120
  tableExpandIconHoverBackgroundColor: 'Neutral-fill-3',
@@ -23705,6 +23718,8 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
23705
23718
  '& td': {
23706
23719
  background: src.tableTbodyBackgroundColor,
23707
23720
  color: src.tableTbodyFontColor,
23721
+ fontSize: src.tableCellFontSize,
23722
+ fontWeight: src.tableCellFontWeight,
23708
23723
  '&[data-soui-table-selection]::before': {
23709
23724
  content: '""',
23710
23725
  position: 'absolute',
@@ -23720,12 +23735,14 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
23720
23735
  verticalAlign: 'middle',
23721
23736
  background: src.tableTheadBackgroundColor,
23722
23737
  color: src.tableTheadFontColor,
23723
- fontWeight: 'bold',
23724
- boxSizing: 'border-box'
23738
+ boxSizing: 'border-box',
23739
+ fontWeight: src.tableTheadFontWeight,
23740
+ fontSize: src.tableTheadFontSize
23725
23741
  },
23726
23742
  '& tfoot td': {
23727
23743
  background: src.tableTfootBackgroundColor,
23728
- color: src.tableTfootFontColor
23744
+ color: src.tableTfootFontColor,
23745
+ fontWeight: src.tableTfootFontWeight
23729
23746
  },
23730
23747
  '&bordered tr:last-child td': {
23731
23748
  borderBottom: 'none'
@@ -23753,11 +23770,27 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
23753
23770
  small: {
23754
23771
  '& th, & td': {
23755
23772
  padding: "".concat(src.tableSmallCellPaddingY, " ").concat(src.tableSmallCellPaddingX)
23773
+ },
23774
+ '& table th': {
23775
+ fontSize: src.tableSmallTheadFontSize,
23776
+ fontWeight: src.tableSmallTheadFontWeight
23777
+ },
23778
+ '& table td': {
23779
+ fontSize: src.tableSmallCellFontSize,
23780
+ fontWeight: src.tableSmallCellFontWeight
23756
23781
  }
23757
23782
  },
23758
23783
  large: {
23759
23784
  '& th, & td': {
23760
23785
  padding: "".concat(src.tableLargeCellPaddingY, " ").concat(src.tableLargeCellPaddingX)
23786
+ },
23787
+ '& table th': {
23788
+ fontSize: src.tableLargeTheadFontSize,
23789
+ fontWeight: src.tableLargeTheadFontWeight
23790
+ },
23791
+ '& table td': {
23792
+ fontSize: src.tableLargeCellFontSize,
23793
+ fontWeight: src.tableLargeCellFontWeight
23761
23794
  }
23762
23795
  },
23763
23796
  bordered: {
@@ -46904,7 +46937,7 @@ var Scroll = function Scroll(props) {
46904
46937
  position: 'sticky'
46905
46938
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46906
46939
  var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46907
- marginTop: Math.max(0, scrollHeight - height)
46940
+ marginTop: Math.max(0, Math.floor(scrollHeight - height))
46908
46941
  }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46909
46942
  var handleScroll = usePersistFn(function (e) {
46910
46943
  var target = e.currentTarget;
@@ -47931,7 +47964,7 @@ var Node = function Node(props) {
47931
47964
  var children = data[childrenKey];
47932
47965
  var hasChildren = children && children.length > 0;
47933
47966
  var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
47934
- var rootClass = classnames_default()(contentStyle.node, isLeaf() && leafClass, isString(nodeClass) && nodeClass, isFunc(nodeClass) && nodeClass(data), defineProperty_default()({}, contentStyle.leaf, !hasChildren));
47967
+ var rootClass = classnames_default()(contentStyle.node, isLeaf() && (isString(leafClass) ? leafClass : isFunc(leafClass) && leafClass(data)), isString(nodeClass) && nodeClass, isFunc(nodeClass) && nodeClass(data), defineProperty_default()({}, contentStyle.leaf, !hasChildren));
47935
47968
  if (placeElement) {
47936
47969
  placeElement.className = contentStyle.placement;
47937
47970
  }
@@ -48426,6 +48459,10 @@ var Tree = function Tree(props) {
48426
48459
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48427
48460
  handleUpdateExpanded(expanded);
48428
48461
  }, [expanded]);
48462
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48463
+ if (!active) return;
48464
+ handleUpdateActive(active);
48465
+ }, [active]);
48429
48466
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48430
48467
  if (getDatum) getDatum(datum);
48431
48468
  }, []);
@@ -54177,7 +54214,8 @@ var useTableLayout = function useTableLayout(props) {
54177
54214
  changeColGroup(newCols, false);
54178
54215
  });
54179
54216
  var checkFloat = use_persist_fn(function () {
54180
- var scrollEl = scrollRef.current;
54217
+ var scrollEl = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current;
54218
+ if (!scrollEl) return;
54181
54219
  var max = scrollEl.scrollWidth - scrollEl.clientWidth;
54182
54220
  var min = 0;
54183
54221
  var left = scrollEl.scrollLeft;
@@ -55786,10 +55824,12 @@ var Tr = function Tr(props) {
55786
55824
 
55787
55825
 
55788
55826
 
55827
+
55789
55828
  var tfoot_isArray = isArray;
55790
55829
  /* harmony default export */ var tfoot = (function (props) {
55791
55830
  var _props$jssStyle, _props$jssStyle$table;
55792
55831
  var tableClasses = (_props$jssStyle = props.jssStyle) === null || _props$jssStyle === void 0 || (_props$jssStyle$table = _props$jssStyle.table) === null || _props$jssStyle$table === void 0 ? void 0 : _props$jssStyle$table.call(_props$jssStyle);
55832
+ var config = useConfig();
55793
55833
  var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
55794
55834
  var colgroup = props.colgroup;
55795
55835
  if (fixed === 'left') {
@@ -55842,9 +55882,10 @@ var tfoot_isArray = isArray;
55842
55882
  }
55843
55883
  }
55844
55884
  return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
55885
+ dir: config.direction,
55845
55886
  colSpan: colSpan,
55846
55887
  style: getFixedStyle(fixed.fixed, index, colSpan),
55847
- className: classnames_default()(fixed['fixed'] === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed['fixed'] === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), (fixed.lastFixed || fixed.firstFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), isLast && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder)),
55888
+ className: classnames_default()(fixed['fixed'] === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed['fixed'] === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), fixed.firstFixed && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), fixed.lastFixed && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), (fixed.lastFixed || fixed.firstFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), isLast && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder)),
55848
55889
  children: content
55849
55890
  }, index);
55850
55891
  };
@@ -55909,6 +55950,9 @@ var virtualScrollerStyle = {
55909
55950
  overflow: 'auto',
55910
55951
  width: '100%'
55911
55952
  };
55953
+ var table_emptyStyle = objectSpread2_default()(objectSpread2_default()({}, virtualScrollerStyle), {}, {
55954
+ height: 0
55955
+ });
55912
55956
  var scrollWrapperStyle = {
55913
55957
  flex: 1,
55914
55958
  minHeight: 0,
@@ -56079,6 +56123,18 @@ var emptyRef = {
56079
56123
  e.preventDefault();
56080
56124
  scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
56081
56125
  });
56126
+ var handleBodyScroll = usePersistFn(function (e) {
56127
+ var target = e.currentTarget;
56128
+ if (!target) return;
56129
+ layoutFunc.checkFloat();
56130
+ if (props.onScroll && typeof props.onScroll === 'function') {
56131
+ var maxWidth = target.scrollWidth - target.clientWidth;
56132
+ var maxHeight = target.scrollHeight - target.clientHeight;
56133
+ var x = Math.min(target.scrollLeft / maxWidth, 1);
56134
+ var y = Math.min(target.scrollTop / maxHeight, 1);
56135
+ props.onScroll(x, y, target.scrollLeft);
56136
+ }
56137
+ });
56082
56138
  var handleVirtualScroll = usePersistFn(function (info) {
56083
56139
  virtualInfo.handleScroll(info);
56084
56140
  layoutFunc.checkFloat();
@@ -56097,7 +56153,7 @@ var emptyRef = {
56097
56153
  });
56098
56154
  };
56099
56155
  var renderTable = function renderTable() {
56100
- var _props$summary, _sticky$top;
56156
+ var _props$summary, _sticky$top, _props$data3, _props$data4;
56101
56157
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
56102
56158
  colgroup: colgroup,
56103
56159
  columns: columns,
@@ -56170,6 +56226,20 @@ var emptyRef = {
56170
56226
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
56171
56227
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
56172
56228
  };
56229
+ if (!virtual && !isScrollY && !props.sticky && (_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) {
56230
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
56231
+ ref: scrollRef,
56232
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
56233
+ onScroll: handleBodyScroll,
56234
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
56235
+ style: {
56236
+ width: width
56237
+ },
56238
+ ref: tbodyRef,
56239
+ children: [Group, !props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
56240
+ })
56241
+ });
56242
+ }
56173
56243
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
56174
56244
  children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
56175
56245
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -56188,7 +56258,7 @@ var emptyRef = {
56188
56258
  })
56189
56259
  })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
56190
56260
  style: scrollWrapperStyle,
56191
- scrollerStyle: virtualScrollerStyle,
56261
+ scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : table_emptyStyle,
56192
56262
  wrapperRef: scrollRef,
56193
56263
  scrollWidth: width || 1,
56194
56264
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
@@ -58190,13 +58260,13 @@ var useTreeSelect = function useTreeSelect(props) {
58190
58260
  }
58191
58261
  if (!multiple && isArray(v)) {
58192
58262
  onChange === null || onChange === void 0 || onChange.apply(void 0, [v[0]].concat(reset));
58193
- }
58194
- if (multiple && !isArray(v)) {
58263
+ } else if (multiple && !isArray(v)) {
58195
58264
  if (v === undefined || v === null) {
58196
58265
  onChange === null || onChange === void 0 || onChange.apply(void 0, [[]].concat(reset));
58197
58266
  } else onChange === null || onChange === void 0 || onChange.apply(void 0, [[v]].concat(reset));
58267
+ } else {
58268
+ onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
58198
58269
  }
58199
- onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
58200
58270
  });
58201
58271
  return {
58202
58272
  value: valueArr,
@@ -58360,6 +58430,7 @@ var TreeSelect = function TreeSelect(props0) {
58360
58430
  data: data,
58361
58431
  unmatch: unmatch,
58362
58432
  disabled: disabled,
58433
+ active: multiple ? undefined : value[0],
58363
58434
  childrenKey: childrenKey,
58364
58435
  keygen: keygen,
58365
58436
  onExpand: onExpand,
@@ -58725,7 +58796,7 @@ var TreeSelect = function TreeSelect(props0) {
58725
58796
  } else {
58726
58797
  treeProps.onClick = handleTreeClick;
58727
58798
  treeProps.renderItem = renderActive;
58728
- treeProps.active = value;
58799
+ treeProps.active = value[0];
58729
58800
  }
58730
58801
  if ('expanded' in props) {
58731
58802
  treeProps.expanded = expanded;
@@ -58746,6 +58817,7 @@ var TreeSelect = function TreeSelect(props0) {
58746
58817
  keygen: keygen,
58747
58818
  unmatch: unmatch,
58748
58819
  value: value,
58820
+ highlight: true,
58749
58821
  loader: loader,
58750
58822
  onExpand: onExpandTree,
58751
58823
  expanded: controlExpanded,
@@ -62383,7 +62455,7 @@ var upload_interface = __webpack_require__(4412);
62383
62455
 
62384
62456
 
62385
62457
  /* harmony default export */ var src_0 = ({
62386
- version: '3.2.0-rc.3'
62458
+ version: '3.2.0-rc.4'
62387
62459
  });
62388
62460
  }();
62389
62461
  /******/ return __webpack_exports__;