shineout 3.3.6-beta.4 → 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 +1 -1
- package/dist/shineout.js +56 -11
- package/dist/shineout.js.map +1 -1
- package/dist/shineout.min.js +1 -1
- package/dist/shineout.min.js.map +1 -1
- package/esm/index.js +1 -1
- package/package.json +5 -5
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.
|
|
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.
|
|
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': {
|
|
@@ -48068,6 +48076,8 @@ var usePaginationList = function usePaginationList(props) {
|
|
|
48068
48076
|
|
|
48069
48077
|
var Scroll = function Scroll(props) {
|
|
48070
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);
|
|
48071
48081
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
48072
48082
|
timer: null,
|
|
48073
48083
|
isMouseDown: false,
|
|
@@ -48141,6 +48151,13 @@ var Scroll = function Scroll(props) {
|
|
|
48141
48151
|
fromDrag: context.isMouseDown
|
|
48142
48152
|
});
|
|
48143
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
|
+
});
|
|
48144
48161
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
48145
48162
|
className: props.className,
|
|
48146
48163
|
style: props.style,
|
|
@@ -48150,7 +48167,7 @@ var Scroll = function Scroll(props) {
|
|
|
48150
48167
|
})), {}, {
|
|
48151
48168
|
style: scrollerStyle,
|
|
48152
48169
|
onScroll: handleScroll,
|
|
48153
|
-
ref:
|
|
48170
|
+
ref: wrapperRef,
|
|
48154
48171
|
onMouseDown: function onMouseDown() {
|
|
48155
48172
|
context.isMouseDown = true;
|
|
48156
48173
|
},
|
|
@@ -48162,6 +48179,7 @@ var Scroll = function Scroll(props) {
|
|
|
48162
48179
|
})), {}, {
|
|
48163
48180
|
style: containerStyle,
|
|
48164
48181
|
ref: containerRef,
|
|
48182
|
+
onScroll: handleInnerScroll,
|
|
48165
48183
|
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
48166
48184
|
style: objectSpread2_default()({
|
|
48167
48185
|
flexGrow: 1
|
|
@@ -55913,7 +55931,9 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
55913
55931
|
topTimer: null,
|
|
55914
55932
|
controlScrollRate: null,
|
|
55915
55933
|
heightCallback: null,
|
|
55916
|
-
preIndex: null
|
|
55934
|
+
preIndex: null,
|
|
55935
|
+
rowSpanRows: 0,
|
|
55936
|
+
autoAddRows: 0
|
|
55917
55937
|
}),
|
|
55918
55938
|
context = _useRef.current;
|
|
55919
55939
|
var getTranslate = usePersistFn(function (left, top) {
|
|
@@ -55964,6 +55984,7 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
55964
55984
|
var top = 0;
|
|
55965
55985
|
var maxIndex = Math.max(props.data.length - rowsInView, 0);
|
|
55966
55986
|
for (var i = 0; i <= maxIndex; i++) {
|
|
55987
|
+
context.rowSpanRows = 0;
|
|
55967
55988
|
sum += context.cachedHeight[i] || props.rowHeight;
|
|
55968
55989
|
var rowSpanHeight = 0;
|
|
55969
55990
|
if (rowSpanInfos) {
|
|
@@ -55975,6 +55996,7 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
55975
55996
|
}
|
|
55976
55997
|
for (var j = 0; j < siblingsIndexs.length; j++) {
|
|
55977
55998
|
var index = siblingsIndexs[j];
|
|
55999
|
+
context.rowSpanRows += 1;
|
|
55978
56000
|
rowSpanHeight += context.cachedHeight[index] || props.rowHeight;
|
|
55979
56001
|
}
|
|
55980
56002
|
}
|
|
@@ -56065,6 +56087,24 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
56065
56087
|
props.scrollRef.current.scrollTop = beforeHeight;
|
|
56066
56088
|
}
|
|
56067
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
|
+
}, []);
|
|
56068
56108
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
56069
56109
|
// 记录preIndex
|
|
56070
56110
|
context.preIndex = startIndex;
|
|
@@ -56099,7 +56139,8 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
56099
56139
|
cb();
|
|
56100
56140
|
}
|
|
56101
56141
|
}, [scrollHeight]);
|
|
56102
|
-
var
|
|
56142
|
+
var finalRowsInView = rowsInView + context.rowSpanRows + context.autoAddRows;
|
|
56143
|
+
var renderData = props.disabled ? props.data : toConsumableArray_default()(props.data).slice(startIndex, startIndex + finalRowsInView);
|
|
56103
56144
|
return {
|
|
56104
56145
|
scrollHeight: scrollHeight,
|
|
56105
56146
|
startIndex: startIndex,
|
|
@@ -57018,6 +57059,9 @@ var Tr = function Tr(props) {
|
|
|
57018
57059
|
var tds = [];
|
|
57019
57060
|
var skip = 0;
|
|
57020
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
|
+
});
|
|
57021
57065
|
var _loop = function _loop(i) {
|
|
57022
57066
|
if (skip > 0) {
|
|
57023
57067
|
skip--;
|
|
@@ -57029,13 +57073,13 @@ var Tr = function Tr(props) {
|
|
|
57029
57073
|
var td = /*#__PURE__*/(0,jsx_runtime.jsx)("td", {
|
|
57030
57074
|
colSpan: data[i].colSpan,
|
|
57031
57075
|
rowSpan: data[i].rowSpan,
|
|
57032
|
-
onMouseEnter: function
|
|
57076
|
+
onMouseEnter: props.hover && hasSiblingRowSpan ? function () {
|
|
57033
57077
|
props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
57034
|
-
},
|
|
57035
|
-
onMouseLeave: function
|
|
57078
|
+
} : undefined,
|
|
57079
|
+
onMouseLeave: props.hover && hasSiblingRowSpan ? function () {
|
|
57036
57080
|
props.handleCellHover(-1, 0);
|
|
57037
|
-
},
|
|
57038
|
-
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)),
|
|
57039
57083
|
style: getTdStyle(col, data[i].colSpan),
|
|
57040
57084
|
dir: config.direction,
|
|
57041
57085
|
onClick: props.onCellClick ? function () {
|
|
@@ -57101,7 +57145,7 @@ var Tr = function Tr(props) {
|
|
|
57101
57145
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
57102
57146
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("tr", objectSpread2_default()(objectSpread2_default()({
|
|
57103
57147
|
ref: trRef,
|
|
57104
|
-
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))
|
|
57105
57149
|
}, props.rowEvents), {}, {
|
|
57106
57150
|
onClick: handleRowClick,
|
|
57107
57151
|
children: renderTds(props.columns, props.row)
|
|
@@ -57172,6 +57216,7 @@ var Tr = function Tr(props) {
|
|
|
57172
57216
|
striped: props.striped,
|
|
57173
57217
|
radio: props.radio,
|
|
57174
57218
|
isCellHover: isCellHover,
|
|
57219
|
+
hover: hover,
|
|
57175
57220
|
isSelect: props.datum.check(rowSelectMergeStartData[index]),
|
|
57176
57221
|
handleCellHover: handleCellHover
|
|
57177
57222
|
// to update
|
|
@@ -63886,7 +63931,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
63886
63931
|
|
|
63887
63932
|
|
|
63888
63933
|
/* harmony default export */ var src_0 = ({
|
|
63889
|
-
version: '3.3.6-beta.
|
|
63934
|
+
version: '3.3.6-beta.6'
|
|
63890
63935
|
});
|
|
63891
63936
|
}();
|
|
63892
63937
|
/******/ return __webpack_exports__;
|