shineout 3.1.8 → 3.1.9

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.1.8'
479
+ version: '3.1.9'
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.1.8');
11952
+ /* harmony default export */ var version = ('3.1.9');
11953
11953
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11954
11954
 
11955
11955
 
@@ -46603,7 +46603,7 @@ var Scroll = function Scroll(props) {
46603
46603
  position: 'sticky'
46604
46604
  }, isRtl ? 'right' : 'left', 0), "top", 0);
46605
46605
  var placeStyle = defineProperty_default()(defineProperty_default()(defineProperty_default()(defineProperty_default()({
46606
- marginTop: Math.max(0, scrollHeight - height)
46606
+ marginTop: Math.max(0, Math.floor(scrollHeight - height))
46607
46607
  }, "margin".concat(isRtl ? 'Left' : 'Right'), scrollWidth), "height", 0), "width", 0), "overflow", 'hidden');
46608
46608
  var handleScroll = usePersistFn(function (e) {
46609
46609
  var target = e.currentTarget;
@@ -47630,7 +47630,7 @@ var Node = function Node(props) {
47630
47630
  var children = data[childrenKey];
47631
47631
  var hasChildren = children && children.length > 0;
47632
47632
  var contentStyle = (jssStyle === null || jssStyle === void 0 ? void 0 : jssStyle.tree()) || {};
47633
- var rootClass = classnames_default()(contentStyle.node, isLeaf() && leafClass, isString(nodeClass) && nodeClass, isFunc(nodeClass) && nodeClass(data), defineProperty_default()({}, contentStyle.leaf, !hasChildren));
47633
+ 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));
47634
47634
  if (placeElement) {
47635
47635
  placeElement.className = contentStyle.placement;
47636
47636
  }
@@ -48125,6 +48125,10 @@ var Tree = function Tree(props) {
48125
48125
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48126
48126
  handleUpdateExpanded(expanded);
48127
48127
  }, [expanded]);
48128
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48129
+ if (!active) return;
48130
+ handleUpdateActive(active);
48131
+ }, [active]);
48128
48132
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
48129
48133
  if (getDatum) getDatum(datum);
48130
48134
  }, []);
@@ -53833,7 +53837,8 @@ var useTableLayout = function useTableLayout(props) {
53833
53837
  changeColGroup(newCols, false);
53834
53838
  });
53835
53839
  var checkFloat = use_persist_fn(function () {
53836
- var scrollEl = scrollRef.current;
53840
+ var scrollEl = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current;
53841
+ if (!scrollEl) return;
53837
53842
  var max = scrollEl.scrollWidth - scrollEl.clientWidth;
53838
53843
  var min = 0;
53839
53844
  var left = scrollEl.scrollLeft;
@@ -55442,10 +55447,12 @@ var Tr = function Tr(props) {
55442
55447
 
55443
55448
 
55444
55449
 
55450
+
55445
55451
  var tfoot_isArray = isArray;
55446
55452
  /* harmony default export */ var tfoot = (function (props) {
55447
55453
  var _props$jssStyle, _props$jssStyle$table;
55448
55454
  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);
55455
+ var config = useConfig();
55449
55456
  var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
55450
55457
  var colgroup = props.colgroup;
55451
55458
  if (fixed === 'left') {
@@ -55498,9 +55505,10 @@ var tfoot_isArray = isArray;
55498
55505
  }
55499
55506
  }
55500
55507
  return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
55508
+ dir: config.direction,
55501
55509
  colSpan: colSpan,
55502
55510
  style: getFixedStyle(fixed.fixed, index, colSpan),
55503
- 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)),
55511
+ 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)),
55504
55512
  children: content
55505
55513
  }, index);
55506
55514
  };
@@ -55565,6 +55573,9 @@ var virtualScrollerStyle = {
55565
55573
  overflow: 'auto',
55566
55574
  width: '100%'
55567
55575
  };
55576
+ var table_emptyStyle = objectSpread2_default()(objectSpread2_default()({}, virtualScrollerStyle), {}, {
55577
+ height: 0
55578
+ });
55568
55579
  var scrollWrapperStyle = {
55569
55580
  flex: 1,
55570
55581
  minHeight: 0,
@@ -55735,6 +55746,18 @@ var emptyRef = {
55735
55746
  e.preventDefault();
55736
55747
  scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
55737
55748
  });
55749
+ var handleBodyScroll = usePersistFn(function (e) {
55750
+ var target = e.currentTarget;
55751
+ if (!target) return;
55752
+ layoutFunc.checkFloat();
55753
+ if (props.onScroll && typeof props.onScroll === 'function') {
55754
+ var maxWidth = target.scrollWidth - target.clientWidth;
55755
+ var maxHeight = target.scrollHeight - target.clientHeight;
55756
+ var x = Math.min(target.scrollLeft / maxWidth, 1);
55757
+ var y = Math.min(target.scrollTop / maxHeight, 1);
55758
+ props.onScroll(x, y, target.scrollLeft);
55759
+ }
55760
+ });
55738
55761
  var handleVirtualScroll = usePersistFn(function (info) {
55739
55762
  virtualInfo.handleScroll(info);
55740
55763
  layoutFunc.checkFloat();
@@ -55753,7 +55776,7 @@ var emptyRef = {
55753
55776
  });
55754
55777
  };
55755
55778
  var renderTable = function renderTable() {
55756
- var _props$summary, _sticky$top;
55779
+ var _props$summary, _sticky$top, _props$data3, _props$data4;
55757
55780
  var Group = /*#__PURE__*/(0,jsx_runtime.jsx)(table_colgroup, {
55758
55781
  colgroup: colgroup,
55759
55782
  columns: columns,
@@ -55826,6 +55849,20 @@ var emptyRef = {
55826
55849
  css: sticky === null || sticky === void 0 ? void 0 : sticky.css,
55827
55850
  parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
55828
55851
  };
55852
+ if (!virtual && !isScrollY && !props.sticky && (_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length) {
55853
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
55854
+ ref: scrollRef,
55855
+ className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
55856
+ onScroll: handleBodyScroll,
55857
+ children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
55858
+ style: {
55859
+ width: width
55860
+ },
55861
+ ref: tbodyRef,
55862
+ 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))]
55863
+ })
55864
+ });
55865
+ }
55829
55866
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
55830
55867
  children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(Wrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
55831
55868
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
@@ -55844,7 +55881,7 @@ var emptyRef = {
55844
55881
  })
55845
55882
  })), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
55846
55883
  style: scrollWrapperStyle,
55847
- scrollerStyle: virtualScrollerStyle,
55884
+ scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : table_emptyStyle,
55848
55885
  wrapperRef: scrollRef,
55849
55886
  scrollWidth: width || 1,
55850
55887
  scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
@@ -57846,13 +57883,13 @@ var useTreeSelect = function useTreeSelect(props) {
57846
57883
  }
57847
57884
  if (!multiple && isArray(v)) {
57848
57885
  onChange === null || onChange === void 0 || onChange.apply(void 0, [v[0]].concat(reset));
57849
- }
57850
- if (multiple && !isArray(v)) {
57886
+ } else if (multiple && !isArray(v)) {
57851
57887
  if (v === undefined || v === null) {
57852
57888
  onChange === null || onChange === void 0 || onChange.apply(void 0, [[]].concat(reset));
57853
57889
  } else onChange === null || onChange === void 0 || onChange.apply(void 0, [[v]].concat(reset));
57890
+ } else {
57891
+ onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
57854
57892
  }
57855
- onChange === null || onChange === void 0 || onChange.apply(void 0, [v].concat(reset));
57856
57893
  });
57857
57894
  return {
57858
57895
  value: valueArr,
@@ -58014,6 +58051,7 @@ var TreeSelect = function TreeSelect(props0) {
58014
58051
  data: data,
58015
58052
  unmatch: unmatch,
58016
58053
  disabled: disabled,
58054
+ active: multiple ? undefined : value[0],
58017
58055
  childrenKey: childrenKey,
58018
58056
  keygen: keygen,
58019
58057
  onExpand: onExpand,
@@ -58379,7 +58417,7 @@ var TreeSelect = function TreeSelect(props0) {
58379
58417
  } else {
58380
58418
  treeProps.onClick = handleTreeClick;
58381
58419
  treeProps.renderItem = renderActive;
58382
- treeProps.active = value;
58420
+ treeProps.active = value[0];
58383
58421
  }
58384
58422
  if ('expanded' in props) {
58385
58423
  treeProps.expanded = expanded;
@@ -58400,6 +58438,7 @@ var TreeSelect = function TreeSelect(props0) {
58400
58438
  keygen: keygen,
58401
58439
  unmatch: unmatch,
58402
58440
  value: value,
58441
+ highlight: true,
58403
58442
  loader: loader,
58404
58443
  onExpand: onExpandTree,
58405
58444
  expanded: controlExpanded,
@@ -62037,7 +62076,7 @@ var upload_interface = __webpack_require__(4412);
62037
62076
 
62038
62077
 
62039
62078
  /* harmony default export */ var src_0 = ({
62040
- version: '3.1.8'
62079
+ version: '3.1.9'
62041
62080
  });
62042
62081
  }();
62043
62082
  /******/ return __webpack_exports__;