shineout 3.3.6-beta.3 → 3.3.6-beta.6

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.3.6-beta.3'
479
+ version: '3.3.6-beta.6'
480
480
  };
package/dist/shineout.js CHANGED
@@ -11968,7 +11968,7 @@ var handleStyle = function handleStyle(style) {
11968
11968
  };
11969
11969
  /* harmony default export */ var jss_style_handleStyle = (handleStyle);
11970
11970
  ;// CONCATENATED MODULE: ../shineout-style/src/version.ts
11971
- /* harmony default export */ var version = ('3.3.6-beta.3');
11971
+ /* harmony default export */ var version = ('3.3.6-beta.6');
11972
11972
  ;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
11973
11973
 
11974
11974
 
@@ -24444,6 +24444,14 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({}, globalStyle
24444
24444
  background: "".concat(src.tableTbodyHoverBackgroundColor)
24445
24445
  }
24446
24446
  },
24447
+ rowHover: {
24448
+ '& td': {
24449
+ transition: 'background-color 0.2s'
24450
+ },
24451
+ '&&:hover td': {
24452
+ background: "".concat(src.tableTbodyHoverBackgroundColor)
24453
+ }
24454
+ },
24447
24455
  floatLeft: {
24448
24456
  '& $cellFixedLast$cellFixedLeft': {
24449
24457
  '&::after': {
@@ -31064,11 +31072,15 @@ var FormFooterProvider = function FormFooterProvider(props) {
31064
31072
  formStats = _useState2[0],
31065
31073
  setFormS = _useState2[1];
31066
31074
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
31067
- submit: function submit() {}
31075
+ submit: function submit() {},
31076
+ hasSubmit: false
31068
31077
  }),
31069
31078
  context = _useRef.current;
31070
31079
  var setFormInfo = usePersistFn(function (info) {
31071
- context.submit = info.submit;
31080
+ if (!context.hasSubmit) {
31081
+ context.submit = info.submit;
31082
+ context.hasSubmit = true;
31083
+ }
31072
31084
  });
31073
31085
  var setFormStats = usePersistFn(function (disabled) {
31074
31086
  if (disabled !== formStats) {
@@ -45678,7 +45690,9 @@ var Form = function Form(props) {
45678
45690
  if (status !== (modalFormContext === null || modalFormContext === void 0 ? void 0 : modalFormContext.formStats)) {
45679
45691
  modalFormContext === null || modalFormContext === void 0 || modalFormContext.setFormStats(status);
45680
45692
  }
45681
- modalFormContext === null || modalFormContext === void 0 || modalFormContext.setFormInfo(formRefObj);
45693
+ if (props.onSubmit) {
45694
+ modalFormContext === null || modalFormContext === void 0 || modalFormContext.setFormInfo(formRefObj);
45695
+ }
45682
45696
  };
45683
45697
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
45684
45698
  handleFormModalInfo();
@@ -48062,6 +48076,8 @@ var usePaginationList = function usePaginationList(props) {
48062
48076
 
48063
48077
  var Scroll = function Scroll(props) {
48064
48078
  var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
48079
+ var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
48080
+ var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
48065
48081
  var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
48066
48082
  timer: null,
48067
48083
  isMouseDown: false,
@@ -48135,6 +48151,13 @@ var Scroll = function Scroll(props) {
48135
48151
  fromDrag: context.isMouseDown
48136
48152
  });
48137
48153
  });
48154
+ var handleInnerScroll = usePersistFn(function (e) {
48155
+ var scrollTop = e.currentTarget.scrollTop;
48156
+ if (scrollRef.current) {
48157
+ e.currentTarget.scrollTop = 0;
48158
+ scrollRef.current.scrollTop += scrollTop;
48159
+ }
48160
+ });
48138
48161
  return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
48139
48162
  className: props.className,
48140
48163
  style: props.style,
@@ -48144,7 +48167,7 @@ var Scroll = function Scroll(props) {
48144
48167
  })), {}, {
48145
48168
  style: scrollerStyle,
48146
48169
  onScroll: handleScroll,
48147
- ref: props.wrapperRef,
48170
+ ref: wrapperRef,
48148
48171
  onMouseDown: function onMouseDown() {
48149
48172
  context.isMouseDown = true;
48150
48173
  },
@@ -48156,6 +48179,7 @@ var Scroll = function Scroll(props) {
48156
48179
  })), {}, {
48157
48180
  style: containerStyle,
48158
48181
  ref: containerRef,
48182
+ onScroll: handleInnerScroll,
48159
48183
  children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
48160
48184
  style: objectSpread2_default()({
48161
48185
  flexGrow: 1
@@ -55907,7 +55931,9 @@ var useTableVirtual = function useTableVirtual(props) {
55907
55931
  topTimer: null,
55908
55932
  controlScrollRate: null,
55909
55933
  heightCallback: null,
55910
- preIndex: null
55934
+ preIndex: null,
55935
+ rowSpanRows: 0,
55936
+ autoAddRows: 0
55911
55937
  }),
55912
55938
  context = _useRef.current;
55913
55939
  var getTranslate = usePersistFn(function (left, top) {
@@ -55958,6 +55984,7 @@ var useTableVirtual = function useTableVirtual(props) {
55958
55984
  var top = 0;
55959
55985
  var maxIndex = Math.max(props.data.length - rowsInView, 0);
55960
55986
  for (var i = 0; i <= maxIndex; i++) {
55987
+ context.rowSpanRows = 0;
55961
55988
  sum += context.cachedHeight[i] || props.rowHeight;
55962
55989
  var rowSpanHeight = 0;
55963
55990
  if (rowSpanInfos) {
@@ -55969,6 +55996,7 @@ var useTableVirtual = function useTableVirtual(props) {
55969
55996
  }
55970
55997
  for (var j = 0; j < siblingsIndexs.length; j++) {
55971
55998
  var index = siblingsIndexs[j];
55999
+ context.rowSpanRows += 1;
55972
56000
  rowSpanHeight += context.cachedHeight[index] || props.rowHeight;
55973
56001
  }
55974
56002
  }
@@ -56059,6 +56087,24 @@ var useTableVirtual = function useTableVirtual(props) {
56059
56087
  props.scrollRef.current.scrollTop = beforeHeight;
56060
56088
  }
56061
56089
  });
56090
+ (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56091
+ var scrollRefHeight = props.scrollRef.current ? props.scrollRef.current.clientHeight : 0;
56092
+ var tableRefHeight = props.innerRef.current ? props.innerRef.current.clientHeight : 0;
56093
+ var remainHeight = scrollRefHeight - tableRefHeight;
56094
+ if (remainHeight > 0) {
56095
+ var addonHeight = 0;
56096
+ var addonCount = 0;
56097
+ for (var i = startIndex + rowsInView; i < props.data.length; i++) {
56098
+ var height = context.cachedHeight[i] || props.rowHeight;
56099
+ addonHeight += height;
56100
+ addonCount += 1;
56101
+ if (addonHeight >= remainHeight + context.cachedHeight[0]) break;
56102
+ }
56103
+ if (addonCount > 0) {
56104
+ context.autoAddRows = addonCount;
56105
+ }
56106
+ }
56107
+ }, []);
56062
56108
  (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
56063
56109
  // 记录preIndex
56064
56110
  context.preIndex = startIndex;
@@ -56093,7 +56139,8 @@ var useTableVirtual = function useTableVirtual(props) {
56093
56139
  cb();
56094
56140
  }
56095
56141
  }, [scrollHeight]);
56096
- var renderData = props.disabled ? props.data : toConsumableArray_default()(props.data).slice(startIndex, startIndex + rowsInView);
56142
+ var finalRowsInView = rowsInView + context.rowSpanRows + context.autoAddRows;
56143
+ var renderData = props.disabled ? props.data : toConsumableArray_default()(props.data).slice(startIndex, startIndex + finalRowsInView);
56097
56144
  return {
56098
56145
  scrollHeight: scrollHeight,
56099
56146
  startIndex: startIndex,
@@ -57012,6 +57059,9 @@ var Tr = function Tr(props) {
57012
57059
  var tds = [];
57013
57060
  var skip = 0;
57014
57061
  var lastRowIndex = data.length - 1;
57062
+ var hasSiblingRowSpan = data === null || data === void 0 ? void 0 : data.some(function (item) {
57063
+ return item === null;
57064
+ });
57015
57065
  var _loop = function _loop(i) {
57016
57066
  if (skip > 0) {
57017
57067
  skip--;
@@ -57023,13 +57073,13 @@ var Tr = function Tr(props) {
57023
57073
  var td = /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
57024
57074
  colSpan: data[i].colSpan,
57025
57075
  rowSpan: data[i].rowSpan,
57026
- onMouseEnter: function onMouseEnter() {
57076
+ onMouseEnter: props.hover && hasSiblingRowSpan ? function () {
57027
57077
  props.handleCellHover(props.rowIndex, data[i].rowSpan);
57028
- },
57029
- onMouseLeave: function onMouseLeave() {
57078
+ } : undefined,
57079
+ onMouseLeave: props.hover && hasSiblingRowSpan ? function () {
57030
57080
  props.handleCellHover(-1, 0);
57031
- },
57032
- className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
57081
+ } : undefined,
57082
+ className: classnames_default()(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), data[i].rowSpan > 1 && props.isCellHover(props.rowIndex, data[i].rowSpan) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
57033
57083
  style: getTdStyle(col, data[i].colSpan),
57034
57084
  dir: config.direction,
57035
57085
  onClick: props.onCellClick ? function () {
@@ -57095,7 +57145,7 @@ var Tr = function Tr(props) {
57095
57145
  return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
57096
57146
  children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", objectSpread2_default()(objectSpread2_default()({
57097
57147
  ref: trRef,
57098
- className: classnames_default()(props === null || props === void 0 || (_props$rowClassName = props.rowClassName) === null || _props$rowClassName === void 0 ? void 0 : _props$rowClassName.call(props, props.rawData, props.rowIndex), props.striped && props.rowIndex % 2 === 1 && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowStriped), props.isSelect && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowChecked))
57148
+ className: classnames_default()(props === null || props === void 0 || (_props$rowClassName = props.rowClassName) === null || _props$rowClassName === void 0 ? void 0 : _props$rowClassName.call(props, props.rawData, props.rowIndex), props.striped && props.rowIndex % 2 === 1 && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowStriped), props.isSelect && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowChecked), props.hover && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.rowHover))
57099
57149
  }, props.rowEvents), {}, {
57100
57150
  onClick: handleRowClick,
57101
57151
  children: renderTds(props.columns, props.row)
@@ -57166,6 +57216,7 @@ var Tr = function Tr(props) {
57166
57216
  striped: props.striped,
57167
57217
  radio: props.radio,
57168
57218
  isCellHover: isCellHover,
57219
+ hover: hover,
57169
57220
  isSelect: props.datum.check(rowSelectMergeStartData[index]),
57170
57221
  handleCellHover: handleCellHover
57171
57222
  // to update
@@ -63880,7 +63931,7 @@ var upload_interface = __webpack_require__(8821);
63880
63931
 
63881
63932
 
63882
63933
  /* harmony default export */ var src_0 = ({
63883
- version: '3.3.6-beta.3'
63934
+ version: '3.3.6-beta.6'
63884
63935
  });
63885
63936
  }();
63886
63937
  /******/ return __webpack_exports__;