shineout 3.8.0-beta.27 → 3.8.0-beta.28

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.0-beta.27'
525
+ version: '3.8.0-beta.28'
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.0-beta.27');
12389
+ /* harmony default export */ var version = ('3.8.0-beta.28');
12390
12390
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12391
12391
 
12392
12392
 
@@ -58645,7 +58645,7 @@ var list_list_List = function List(props) {
58645
58645
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58646
58646
  className: listClasses === null || listClasses === void 0 ? void 0 : listClasses.row,
58647
58647
  style: {
58648
- height: props.fixed ? lineHeight : 'auto'
58648
+ height: props.fixed && !props.dynamicHeight ? lineHeight : 'auto'
58649
58649
  },
58650
58650
  children: columnData.map(function (item, rowIndex) {
58651
58651
  var index = rowIndex + columnIndex * colNum;
@@ -58653,6 +58653,35 @@ var list_list_List = function List(props) {
58653
58653
  })
58654
58654
  }, columnIndex);
58655
58655
  });
58656
+ var DynamicRow = function DynamicRow(_ref) {
58657
+ var columnData = _ref.columnData,
58658
+ columnIndex = _ref.columnIndex,
58659
+ setRowHeight = _ref.setRowHeight;
58660
+ var rowRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
58661
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useLayoutEffect)(function () {
58662
+ if (rowRef.current && setRowHeight) {
58663
+ var rect = rowRef.current.getBoundingClientRect();
58664
+ if (rect.height > 0) {
58665
+ setRowHeight(columnIndex, rect.height);
58666
+ }
58667
+ }
58668
+ });
58669
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
58670
+ ref: rowRef,
58671
+ className: listClasses === null || listClasses === void 0 ? void 0 : listClasses.row,
58672
+ children: columnData.map(function (item, rowIndex) {
58673
+ var index = rowIndex + columnIndex * colNum;
58674
+ return renderItem(item, index);
58675
+ })
58676
+ });
58677
+ };
58678
+ var renderDynamicColumn = usePersistFn(function (columnData, columnIndex, _relativeIndex, setRowHeight) {
58679
+ return /*#__PURE__*/(0,jsx_runtime.jsx)(DynamicRow, {
58680
+ columnData: columnData,
58681
+ columnIndex: columnIndex,
58682
+ setRowHeight: setRowHeight
58683
+ }, columnIndex);
58684
+ });
58656
58685
  var loadingPosition = props.loadingPosition || 'center';
58657
58686
  var renderCenterLoading = function renderCenterLoading() {
58658
58687
  if (!props.loading || loadingPosition !== 'center') return null;
@@ -58711,27 +58740,30 @@ var list_list_List = function List(props) {
58711
58740
  });
58712
58741
  var renderList = function renderList() {
58713
58742
  if (isEmpty) return null;
58714
- if (props.fixed) return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58715
- children: [/*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
58716
- data: columnData,
58717
- renderItem: renderColumn,
58718
- lineHeight: lineHeight,
58719
- rowsInView: rowsInView,
58720
- onScroll: handleVirtualScroll,
58721
- height: 'auto',
58722
- style: {
58723
- flex: '1',
58724
- minHeight: '0',
58725
- display: 'flex'
58726
- },
58727
- scrollerStyle: {
58728
- flex: 1,
58729
- minHeight: 0,
58730
- minWidth: 0,
58731
- overflow: 'auto'
58732
- }
58733
- }), renderFooter()]
58734
- });
58743
+ if (props.fixed) {
58744
+ return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
58745
+ children: [/*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_list, {
58746
+ data: columnData,
58747
+ renderItem: props.dynamicHeight ? renderDynamicColumn : renderColumn,
58748
+ lineHeight: lineHeight,
58749
+ rowsInView: rowsInView,
58750
+ onScroll: handleVirtualScroll,
58751
+ height: 'auto',
58752
+ style: {
58753
+ flex: '1',
58754
+ minHeight: '0',
58755
+ display: 'flex'
58756
+ },
58757
+ scrollerStyle: {
58758
+ flex: 1,
58759
+ minHeight: 0,
58760
+ minWidth: 0,
58761
+ overflow: 'auto'
58762
+ },
58763
+ dynamicVirtual: props.dynamicHeight
58764
+ }), renderFooter()]
58765
+ });
58766
+ }
58735
58767
  return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", {
58736
58768
  className: listClasses === null || listClasses === void 0 ? void 0 : listClasses.scrollContainer,
58737
58769
  onScroll: handleListScroll,
@@ -72750,7 +72782,7 @@ var upload_interface = __webpack_require__(8821);
72750
72782
 
72751
72783
 
72752
72784
  /* harmony default export */ var src_0 = ({
72753
- version: '3.8.0-beta.27'
72785
+ version: '3.8.0-beta.28'
72754
72786
  });
72755
72787
  }();
72756
72788
  /******/ return __webpack_exports__;