shineout 3.8.6 → 3.8.7-beta.2

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'
525
+ version: '3.8.7-beta.2'
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');
12389
+ /* harmony default export */ var version = ('3.8.7-beta.2');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -12434,9 +12434,13 @@ var styled = function styled(style, ns) {
12434
12434
  name: ns,
12435
12435
  generateId: createClassname
12436
12436
  });
12437
+ var styledCacheMap = {};
12437
12438
  var getClassName = function getClassName() {
12438
12439
  var classes = hoc();
12439
- return Object.keys(classes).reduce(function (acc, key) {
12440
+ if (styledCacheMap[ns]) {
12441
+ return styledCacheMap[ns];
12442
+ }
12443
+ return styledCacheMap[ns] = Object.keys(classes).reduce(function (acc, key) {
12440
12444
  var k = key;
12441
12445
  var value = '';
12442
12446
  // 给每个组件的root类名添加命名空间
@@ -55046,7 +55050,8 @@ var InputNumber = function InputNumber(props) {
55046
55050
  value: numberFormatProps.value || '',
55047
55051
  className: classnames_default()(forwardProps.className, inputStyle === null || inputStyle === void 0 ? void 0 : inputStyle.wrapperNumber),
55048
55052
  onKeyDown: onKeyDown,
55049
- addEnd: addEnd
55053
+ addEnd: addEnd,
55054
+ showClear: props.showClear
55050
55055
  }));
55051
55056
  };
55052
55057
  /* harmony default export */ var input_number = (/*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default().memo(InputNumber));
@@ -63251,6 +63256,7 @@ var scroll_table_Scroll = function Scroll(props) {
63251
63256
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63252
63257
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63253
63258
  if (!props.tableRef.current || !props.setFakeVirtual) return;
63259
+ if (props.tableRef.current.style.height || props.tableRef.current.style.flex) return;
63254
63260
  var container = containerRef.current;
63255
63261
  var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63256
63262
  if (!isContainerVisible) return;
@@ -65495,29 +65501,31 @@ function Td(props) {
65495
65501
  onMouseEnter = props.onMouseEnter,
65496
65502
  onMouseLeave = props.onMouseLeave,
65497
65503
  renderContent = props.renderContent;
65498
- var $td = useComponentMemo(function () {
65499
- var content = renderContent(props.col, props.data);
65500
- return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
65501
- colSpan: colSpan,
65502
- rowSpan: rowSpan,
65503
- onMouseEnter: onMouseEnter,
65504
- onMouseLeave: onMouseLeave,
65505
- className: className,
65506
- style: props.style,
65507
- dir: direction,
65508
- "data-role": role,
65509
- onClick: onClick,
65510
- children: content
65511
- }, col.key);
65512
- }, [data, className, (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.left, (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.right, col.type, col.treeColumnsName], props.virtual === 'lazy' ? function (prev, next) {
65504
+ var $td = /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
65505
+ colSpan: colSpan,
65506
+ rowSpan: rowSpan,
65507
+ onMouseEnter: onMouseEnter,
65508
+ onMouseLeave: onMouseLeave,
65509
+ className: className,
65510
+ style: props.style,
65511
+ dir: direction,
65512
+ "data-role": role,
65513
+ onClick: onClick,
65514
+ children: renderContent(props.col, props.data)
65515
+ }, col.key);
65516
+ if (props.virtual !== 'lazy') {
65517
+ return $td;
65518
+ }
65519
+ return useComponentMemo(function () {
65520
+ return $td;
65521
+ }, [data, className, (_props$style = props.style) === null || _props$style === void 0 ? void 0 : _props$style.left, (_props$style2 = props.style) === null || _props$style2 === void 0 ? void 0 : _props$style2.right, col.type, col.treeColumnsName], function (prev, next) {
65513
65522
  if (col.type || col.treeColumnsName) {
65514
65523
  return true;
65515
65524
  }
65516
65525
  return prev.some(function (_, index) {
65517
65526
  return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
65518
65527
  }) || !props.scrolling;
65519
- } : undefined);
65520
- return $td;
65528
+ });
65521
65529
  }
65522
65530
  ;// CONCATENATED MODULE: ../base/src/table/tr.tsx
65523
65531
 
@@ -65570,12 +65578,12 @@ var Tr = function Tr(props) {
65570
65578
  }
65571
65579
  return undefined;
65572
65580
  };
65573
- var getTdStyle = usePersistFn(function (column, colSpan) {
65581
+ var getTdStyle = function getTdStyle(column, colSpan) {
65574
65582
  var index = column.index;
65575
65583
  var fixedStyle = getFixedStyle(column.fixed, index, colSpan);
65576
65584
  if (!fixedStyle && !column.style) return;
65577
65585
  return objectSpread2_default()(objectSpread2_default()({}, column.style), fixedStyle);
65578
- });
65586
+ };
65579
65587
  var handleCellClick = usePersistFn(function (data, colIndex) {
65580
65588
  if (!props.onCellClick) return;
65581
65589
  props.onCellClick(data, {
@@ -65586,15 +65594,14 @@ var Tr = function Tr(props) {
65586
65594
  });
65587
65595
  var setVirtualRowHeight = usePersistFn(function () {
65588
65596
  if (props.setRowHeight && trRef.current) {
65589
- // 祖先元素不可见时(display: none)
65590
- if (!trRef.current.offsetParent) return;
65591
65597
  var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
65592
65598
  props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
65593
65599
  }
65594
65600
  });
65595
65601
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(setVirtualRowHeight, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
65596
65602
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
65597
- if (!trRef.current) return;
65603
+ // 祖先元素不可见时(display: none)
65604
+ if (!trRef.current || !trRef.current.offsetParent) return;
65598
65605
  var cancelObserver = addResizeObserver(trRef.current, setVirtualRowHeight, {
65599
65606
  direction: 'y'
65600
65607
  });
@@ -65640,7 +65647,7 @@ var Tr = function Tr(props) {
65640
65647
  return _ref.apply(this, arguments);
65641
65648
  };
65642
65649
  }());
65643
- var renderTreeExpand = usePersistFn(function (content) {
65650
+ var renderTreeExpand = function renderTreeExpand(content) {
65644
65651
  var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
65645
65652
  var level = props.treeExpandLevel.get(props.originKey) || 0;
65646
65653
  var className = tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.expandWrapper;
@@ -65693,8 +65700,8 @@ var Tr = function Tr(props) {
65693
65700
  },
65694
65701
  children: [$expandIconWrapper, content]
65695
65702
  });
65696
- });
65697
- var renderContent = usePersistFn(function (col, data) {
65703
+ };
65704
+ var renderContent = function renderContent(col, data) {
65698
65705
  if (col.type === 'expand' || col.type === 'row-expand') {
65699
65706
  var renderResult = typeof col.render === 'function' ? col.render(props.rawData, props.rowIndex) : undefined;
65700
65707
  if (typeof renderResult !== 'function') return null;
@@ -65762,8 +65769,8 @@ var Tr = function Tr(props) {
65762
65769
  }
65763
65770
  if (col.render === undefined) return null;
65764
65771
  return content;
65765
- });
65766
- var renderTds = usePersistFn(function (cols, data) {
65772
+ };
65773
+ var renderTds = function renderTds(cols, data) {
65767
65774
  var tds = [];
65768
65775
  var skip = 0;
65769
65776
  var lastRowIndex = data.length - 1;
@@ -65780,7 +65787,7 @@ var Tr = function Tr(props) {
65780
65787
  var last = cols[i + (data[i].colSpan || 1) - 1] || {};
65781
65788
  var isRowSpanTd = data[i].rowSpan > 1;
65782
65789
  var shouldBindMouseEvent = props.hover && hasSiblingRowSpan || isRowSpanTd;
65783
- var showCellHover = props.hoverIndex.has(props.rowIndex);
65790
+ var showCellHover = props.hover && props.hoverIndex.has(props.rowIndex);
65784
65791
  if (!showCellHover && data[i].rowSpan > 1) {
65785
65792
  for (var j = 0; j < data[i].rowSpan; j++) {
65786
65793
  if (props.hoverIndex.has(props.rowIndex + j)) {
@@ -65819,7 +65826,7 @@ var Tr = function Tr(props) {
65819
65826
  if (_loop(i)) continue;
65820
65827
  }
65821
65828
  return tds;
65822
- });
65829
+ };
65823
65830
  var renderExpand = function renderExpand() {
65824
65831
  if (!props.expanded) return null;
65825
65832
  var expandCol = props.expandCol;
@@ -73332,7 +73339,7 @@ var upload_interface = __webpack_require__(8821);
73332
73339
 
73333
73340
 
73334
73341
  /* harmony default export */ var src_0 = ({
73335
- version: '3.8.6'
73342
+ version: '3.8.7-beta.2'
73336
73343
  });
73337
73344
  }();
73338
73345
  /******/ return __webpack_exports__;