shineout 3.8.7-beta.1 → 3.8.7-beta.3

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.7-beta.1'
525
+ version: '3.8.7-beta.3'
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.7-beta.1');
12389
+ /* harmony default export */ var version = ('3.8.7-beta.3');
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类名添加命名空间
@@ -43576,7 +43580,7 @@ function getRule(rule, props) {
43576
43580
  return;
43577
43581
  }
43578
43582
  if (reg.global) reg.lastIndex = 0;
43579
- if (typeof value === 'string' && reg.test(value)) {
43583
+ if (reg.test(value)) {
43580
43584
  callback(true);
43581
43585
  } else {
43582
43586
  callback(new FormError(po.message, po));
@@ -63252,6 +63256,7 @@ var scroll_table_Scroll = function Scroll(props) {
63252
63256
  // 非定高的Table但依旧采用了virtual渲染方式,需要渲染出全部的data
63253
63257
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
63254
63258
  if (!props.tableRef.current || !props.setFakeVirtual) return;
63259
+ if (props.tableRef.current.style.height || props.tableRef.current.style.flex) return;
63255
63260
  var container = containerRef.current;
63256
63261
  var isContainerVisible = (container === null || container === void 0 ? void 0 : container.offsetParent) !== null;
63257
63262
  if (!isContainerVisible) return;
@@ -65496,29 +65501,31 @@ function Td(props) {
65496
65501
  onMouseEnter = props.onMouseEnter,
65497
65502
  onMouseLeave = props.onMouseLeave,
65498
65503
  renderContent = props.renderContent;
65499
- var $td = useComponentMemo(function () {
65500
- var content = renderContent(props.col, props.data);
65501
- return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
65502
- colSpan: colSpan,
65503
- rowSpan: rowSpan,
65504
- onMouseEnter: onMouseEnter,
65505
- onMouseLeave: onMouseLeave,
65506
- className: className,
65507
- style: props.style,
65508
- dir: direction,
65509
- "data-role": role,
65510
- onClick: onClick,
65511
- children: content
65512
- }, col.key);
65513
- }, [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) {
65514
65522
  if (col.type || col.treeColumnsName) {
65515
65523
  return true;
65516
65524
  }
65517
65525
  return prev.some(function (_, index) {
65518
65526
  return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
65519
65527
  }) || !props.scrolling;
65520
- } : undefined);
65521
- return $td;
65528
+ });
65522
65529
  }
65523
65530
  ;// CONCATENATED MODULE: ../base/src/table/tr.tsx
65524
65531
 
@@ -65571,12 +65578,12 @@ var Tr = function Tr(props) {
65571
65578
  }
65572
65579
  return undefined;
65573
65580
  };
65574
- var getTdStyle = usePersistFn(function (column, colSpan) {
65581
+ var getTdStyle = function getTdStyle(column, colSpan) {
65575
65582
  var index = column.index;
65576
65583
  var fixedStyle = getFixedStyle(column.fixed, index, colSpan);
65577
65584
  if (!fixedStyle && !column.style) return;
65578
65585
  return objectSpread2_default()(objectSpread2_default()({}, column.style), fixedStyle);
65579
- });
65586
+ };
65580
65587
  var handleCellClick = usePersistFn(function (data, colIndex) {
65581
65588
  if (!props.onCellClick) return;
65582
65589
  props.onCellClick(data, {
@@ -65587,15 +65594,14 @@ var Tr = function Tr(props) {
65587
65594
  });
65588
65595
  var setVirtualRowHeight = usePersistFn(function () {
65589
65596
  if (props.setRowHeight && trRef.current) {
65590
- // 祖先元素不可见时(display: none)
65591
- if (!trRef.current.offsetParent) return;
65592
65597
  var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
65593
65598
  props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
65594
65599
  }
65595
65600
  });
65596
65601
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(setVirtualRowHeight, [props.expanded, props.rowIndex, props.bodyScrollWidth, props.resizeFlag]);
65597
65602
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
65598
- if (!trRef.current) return;
65603
+ // 祖先元素不可见时(display: none)
65604
+ if (!trRef.current || !trRef.current.offsetParent) return;
65599
65605
  var cancelObserver = addResizeObserver(trRef.current, setVirtualRowHeight, {
65600
65606
  direction: 'y'
65601
65607
  });
@@ -65641,7 +65647,7 @@ var Tr = function Tr(props) {
65641
65647
  return _ref.apply(this, arguments);
65642
65648
  };
65643
65649
  }());
65644
- var renderTreeExpand = usePersistFn(function (content) {
65650
+ var renderTreeExpand = function renderTreeExpand(content) {
65645
65651
  var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
65646
65652
  var level = props.treeExpandLevel.get(props.originKey) || 0;
65647
65653
  var className = tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.expandWrapper;
@@ -65694,8 +65700,8 @@ var Tr = function Tr(props) {
65694
65700
  },
65695
65701
  children: [$expandIconWrapper, content]
65696
65702
  });
65697
- });
65698
- var renderContent = usePersistFn(function (col, data) {
65703
+ };
65704
+ var renderContent = function renderContent(col, data) {
65699
65705
  if (col.type === 'expand' || col.type === 'row-expand') {
65700
65706
  var renderResult = typeof col.render === 'function' ? col.render(props.rawData, props.rowIndex) : undefined;
65701
65707
  if (typeof renderResult !== 'function') return null;
@@ -65763,8 +65769,8 @@ var Tr = function Tr(props) {
65763
65769
  }
65764
65770
  if (col.render === undefined) return null;
65765
65771
  return content;
65766
- });
65767
- var renderTds = usePersistFn(function (cols, data) {
65772
+ };
65773
+ var renderTds = function renderTds(cols, data) {
65768
65774
  var tds = [];
65769
65775
  var skip = 0;
65770
65776
  var lastRowIndex = data.length - 1;
@@ -65781,7 +65787,7 @@ var Tr = function Tr(props) {
65781
65787
  var last = cols[i + (data[i].colSpan || 1) - 1] || {};
65782
65788
  var isRowSpanTd = data[i].rowSpan > 1;
65783
65789
  var shouldBindMouseEvent = props.hover && hasSiblingRowSpan || isRowSpanTd;
65784
- var showCellHover = props.hoverIndex.has(props.rowIndex);
65790
+ var showCellHover = props.hover && props.hoverIndex.has(props.rowIndex);
65785
65791
  if (!showCellHover && data[i].rowSpan > 1) {
65786
65792
  for (var j = 0; j < data[i].rowSpan; j++) {
65787
65793
  if (props.hoverIndex.has(props.rowIndex + j)) {
@@ -65820,7 +65826,7 @@ var Tr = function Tr(props) {
65820
65826
  if (_loop(i)) continue;
65821
65827
  }
65822
65828
  return tds;
65823
- });
65829
+ };
65824
65830
  var renderExpand = function renderExpand() {
65825
65831
  if (!props.expanded) return null;
65826
65832
  var expandCol = props.expandCol;
@@ -73333,7 +73339,7 @@ var upload_interface = __webpack_require__(8821);
73333
73339
 
73334
73340
 
73335
73341
  /* harmony default export */ var src_0 = ({
73336
- version: '3.8.7-beta.1'
73342
+ version: '3.8.7-beta.3'
73337
73343
  });
73338
73344
  }();
73339
73345
  /******/ return __webpack_exports__;