shineout 3.9.3-beta.2 → 3.9.3-beta.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
@@ -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.9.3-beta.2'
525
+ version: '3.9.3-beta.4'
526
526
  };
package/dist/shineout.js CHANGED
@@ -12402,7 +12402,7 @@ var handleStyle = function handleStyle(style) {
12402
12402
  };
12403
12403
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
12404
12404
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
12405
- /* harmony default export */ var version = ('3.9.3-beta.2');
12405
+ /* harmony default export */ var version = ('3.9.3-beta.4');
12406
12406
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
12407
12407
 
12408
12408
 
@@ -64429,6 +64429,10 @@ var scroll_table_Scroll = function Scroll(props) {
64429
64429
  });
64430
64430
  };
64431
64431
  /* harmony default export */ var scroll_table = (scroll_table_Scroll);
64432
+ ;// CONCATENATED MODULE: ../hooks/src/components/use-table/table-nested-context.tsx
64433
+
64434
+ var TableContext = /*#__PURE__*/(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.createContext)({});
64435
+ /* harmony default export */ var table_nested_context = (TableContext);
64432
64436
  ;// CONCATENATED MODULE: ../hooks/src/common/use-scrollbar-width/index.ts
64433
64437
 
64434
64438
 
@@ -64641,6 +64645,7 @@ var useColumns = function useColumns(props) {
64641
64645
  columnInfo: {
64642
64646
  handleScroll: handleScroll
64643
64647
  },
64648
+ currentColIndex: startIndex,
64644
64649
  expandHideCol: context.expandHideCol
64645
64650
  };
64646
64651
  };
@@ -66754,7 +66759,6 @@ function useComponentMemo(getValue, condition, shouldUpdate) {
66754
66759
  ;// CONCATENATED MODULE: ../base/src/table/td.tsx
66755
66760
 
66756
66761
 
66757
-
66758
66762
  function Td(props) {
66759
66763
  var col = props.col,
66760
66764
  colSpan = props.colSpan,
@@ -66762,12 +66766,11 @@ function Td(props) {
66762
66766
  className = props.className,
66763
66767
  direction = props.direction,
66764
66768
  role = props.role,
66765
- data = props.data,
66766
66769
  onClick = props.onClick,
66767
66770
  onMouseEnter = props.onMouseEnter,
66768
66771
  onMouseLeave = props.onMouseLeave,
66769
66772
  renderContent = props.renderContent;
66770
- var $td = /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
66773
+ return /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
66771
66774
  colSpan: colSpan,
66772
66775
  rowSpan: rowSpan,
66773
66776
  onMouseEnter: onMouseEnter,
@@ -66779,20 +66782,6 @@ function Td(props) {
66779
66782
  onClick: onClick,
66780
66783
  children: renderContent(props.col, props.data)
66781
66784
  }, col.key);
66782
- if (props.virtual === 'lazy') {
66783
- var _props$style, _props$style2;
66784
- return useComponentMemo(function () {
66785
- return $td;
66786
- }, [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) {
66787
- if (col.type || col.treeColumnsName) {
66788
- return true;
66789
- }
66790
- return prev.some(function (_, index) {
66791
- return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
66792
- }) || !props.scrolling;
66793
- });
66794
- }
66795
- return $td;
66796
66785
  }
66797
66786
  ;// CONCATENATED MODULE: ../base/src/table/tr.tsx
66798
66787
 
@@ -67101,6 +67090,7 @@ var Tr = function Tr(props) {
67101
67090
  if (expandCol && typeof expandCol.render === 'function') {
67102
67091
  var renderFunc = expandCol.render(props.rawData, props.rowIndex);
67103
67092
  if (typeof renderFunc === 'function') {
67093
+ var _props$scrollRef;
67104
67094
  return /*#__PURE__*/(0,jsx_runtime.jsx)("tr", {
67105
67095
  className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowExpand,
67106
67096
  ref: expandRef,
@@ -67111,7 +67101,12 @@ var Tr = function Tr(props) {
67111
67101
  style: {
67112
67102
  padding: 0
67113
67103
  },
67114
- children: renderFunc()
67104
+ children: /*#__PURE__*/(0,jsx_runtime.jsx)(table_nested_context.Provider, {
67105
+ value: {
67106
+ parentTableWidth: (_props$scrollRef = props.scrollRef) === null || _props$scrollRef === void 0 || (_props$scrollRef = _props$scrollRef.current) === null || _props$scrollRef === void 0 ? void 0 : _props$scrollRef.clientWidth
67107
+ },
67108
+ children: renderFunc()
67109
+ })
67115
67110
  })
67116
67111
  });
67117
67112
  }
@@ -67188,8 +67183,9 @@ var Tr = function Tr(props) {
67188
67183
  /* harmony default export */ var tbody = (function (props) {
67189
67184
  var _props$columns = props.columns,
67190
67185
  columns = _props$columns === void 0 ? [] : _props$columns,
67191
- _props$currentIndex = props.currentIndex,
67192
- currentIndex = _props$currentIndex === void 0 ? 0 : _props$currentIndex,
67186
+ _props$currentRowInde = props.currentRowIndex,
67187
+ currentRowIndex = _props$currentRowInde === void 0 ? 0 : _props$currentRowInde,
67188
+ currentColIndex = props.currentColIndex,
67193
67189
  _props$hover = props.hover,
67194
67190
  hover = _props$hover === void 0 ? true : _props$hover;
67195
67191
  var _useTableExpand = use_table_expand({
@@ -67202,7 +67198,7 @@ var Tr = function Tr(props) {
67202
67198
  var _useTableRow = use_table_row({
67203
67199
  columns: props.columns,
67204
67200
  data: props.data,
67205
- currentIndex: currentIndex,
67201
+ currentIndex: currentRowIndex,
67206
67202
  hover: hover
67207
67203
  }),
67208
67204
  rowData = _useTableRow.rowData,
@@ -67214,7 +67210,7 @@ var Tr = function Tr(props) {
67214
67210
  });
67215
67211
  var renderRow = function renderRow(item, index) {
67216
67212
  var _props$rowEvents;
67217
- var rowIndex = index + currentIndex;
67213
+ var rowIndex = index + currentRowIndex;
67218
67214
  var originKey = getKey(props.keygen, item, rowIndex);
67219
67215
  var trRenderKey = props.loader || (_props$rowEvents = props.rowEvents) !== null && _props$rowEvents !== void 0 && _props$rowEvents.draggable ? originKey : "".concat(originKey, "-").concat(rowIndex);
67220
67216
 
@@ -67266,6 +67262,7 @@ var Tr = function Tr(props) {
67266
67262
  rowEvents: props.rowEvents,
67267
67263
  disabled: props.datum.disabledCheck(item),
67268
67264
  bodyScrollWidth: props.bodyScrollWidth,
67265
+ scrollRef: props.scrollRef,
67269
67266
  resizeFlag: props.resizeFlag,
67270
67267
  treeCheckAll: props.treeCheckAll,
67271
67268
  onCellClick: props.onCellClick,
@@ -67282,7 +67279,7 @@ var Tr = function Tr(props) {
67282
67279
  if (props.virtual === 'lazy') {
67283
67280
  return useComponentMemo(function () {
67284
67281
  return $tbody;
67285
- }, [props.data, currentIndex], function (prev, next) {
67282
+ }, [currentRowIndex, currentColIndex, props.data], function (prev, next) {
67286
67283
  return prev.some(function (_, index) {
67287
67284
  return !shallowEqual(prev === null || prev === void 0 ? void 0 : prev[index], next === null || next === void 0 ? void 0 : next[index]);
67288
67285
  }) || !props.scrolling;
@@ -67442,6 +67439,7 @@ function Table(props) {
67442
67439
  _props$pagination = props.pagination,
67443
67440
  pagination = _props$pagination === void 0 ? {} : _props$pagination;
67444
67441
  var config = useConfig();
67442
+ var nestedContext = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useContext)(table_nested_context);
67445
67443
  var isRtl = config.direction === 'rtl';
67446
67444
  var tableClasses = props === null || props === void 0 || (_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);
67447
67445
  var tbodyRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
@@ -67528,7 +67526,8 @@ function Table(props) {
67528
67526
  }),
67529
67527
  columns = _useTableColumns.columns,
67530
67528
  expandHideCol = _useTableColumns.expandHideCol,
67531
- columnInfo = _useTableColumns.columnInfo;
67529
+ columnInfo = _useTableColumns.columnInfo,
67530
+ currentColIndex = _useTableColumns.currentColIndex;
67532
67531
  var _useTableLayout = use_table_layout({
67533
67532
  theadRef: theadRef,
67534
67533
  tbodyRef: tbodyRef,
@@ -67802,7 +67801,8 @@ function Table(props) {
67802
67801
  resizeFlag: resizeFlag,
67803
67802
  treeCheckAll: props.treeCheckAll,
67804
67803
  onCellClick: props.onCellClick,
67805
- strictRowHeight: props.strictRowHeight
67804
+ strictRowHeight: props.strictRowHeight,
67805
+ scrollRef: scrollRef
67806
67806
  };
67807
67807
  var headCommonProps = {
67808
67808
  disabled: props.disabled,
@@ -67973,7 +67973,8 @@ function Table(props) {
67973
67973
  }),
67974
67974
  ref: tbodyRef,
67975
67975
  children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
67976
- currentIndex: virtualInfo.startIndex,
67976
+ currentRowIndex: virtualInfo.startIndex,
67977
+ currentColIndex: currentColIndex,
67977
67978
  data: virtualInfo.data,
67978
67979
  setRowHeight: virtualInfo.setRowHeight,
67979
67980
  scrolling: scrolling,
@@ -68084,6 +68085,19 @@ function Table(props) {
68084
68085
  scrollElRef: scrollRef
68085
68086
  };
68086
68087
  }, [scrollRef]);
68088
+ var tableWrapperStyle = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
68089
+ if (nestedContext.parentTableWidth && props.width) {
68090
+ return objectSpread2_default()({
68091
+ width: nestedContext.parentTableWidth,
68092
+ position: 'sticky',
68093
+ left: 0,
68094
+ height: defaultHeight
68095
+ }, props.style);
68096
+ }
68097
+ return objectSpread2_default()({
68098
+ height: defaultHeight
68099
+ }, props.style);
68100
+ }, [nestedContext.parentTableWidth, defaultHeight, props.style, props.width]);
68087
68101
  var tableWrapperClass = classnames_default()(props.className, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rootClass, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.wrapper, props.bordered && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bordered), verticalAlign === 'top' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.verticalAlignTop), verticalAlign === 'middle' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.verticalAlignMiddle), size === 'small' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.small), size === 'large' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.large), size === 'default' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.default));
68088
68102
  if (!props.columns || columns.length === 0) return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
68089
68103
  className: classnames_default()(tableWrapperClass, tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.simple, props.striped && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.striped)),
@@ -68099,9 +68113,7 @@ function Table(props) {
68099
68113
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
68100
68114
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({
68101
68115
  className: classnames_default()(tableWrapperClass, defineProperty_default()(defineProperty_default()(defineProperty_default()({}, tableClasses.sticky, props.sticky), tableClasses.floatLeft, floatLeft), tableClasses.floatRight, floatRight)),
68102
- style: objectSpread2_default()({
68103
- height: defaultHeight
68104
- }, props.style)
68116
+ style: tableWrapperStyle
68105
68117
  }, selection.getTableProps()), {}, {
68106
68118
  ref: tableRef,
68107
68119
  dir: config.direction,
@@ -74634,7 +74646,7 @@ var upload_interface = __webpack_require__(8821);
74634
74646
 
74635
74647
 
74636
74648
  /* harmony default export */ var src_0 = ({
74637
- version: '3.9.3-beta.2'
74649
+ version: '3.9.3-beta.4'
74638
74650
  });
74639
74651
  }();
74640
74652
  /******/ return __webpack_exports__;