shineout 3.7.0-beta.2 → 3.7.0-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 +1 -1
- package/cjs/tests/utils.d.ts +2 -2
- package/dist/shineout.js +285 -225
- 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/esm/tests/utils.d.ts +2 -2
- package/package.json +5 -5
package/dist/shineout.js
CHANGED
|
@@ -12142,7 +12142,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
12142
12142
|
};
|
|
12143
12143
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
12144
12144
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
12145
|
-
/* harmony default export */ var version = ('3.7.0-beta.
|
|
12145
|
+
/* harmony default export */ var version = ('3.7.0-beta.4');
|
|
12146
12146
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
12147
12147
|
|
|
12148
12148
|
|
|
@@ -25527,19 +25527,9 @@ var switchStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25527
25527
|
var useSwitchStyle = styled(src_switch_switch, 'switch');
|
|
25528
25528
|
|
|
25529
25529
|
/* harmony default export */ var shineout_style_src_switch = ((/* unused pure expression or super */ null && (useSwitchStyle)));
|
|
25530
|
-
;// CONCATENATED MODULE: ../shineout-style/src/mixin/custom-scrollbar.ts
|
|
25531
|
-
function customScrollBar(info) {
|
|
25532
|
-
return {
|
|
25533
|
-
'scrollbar-color': info.background,
|
|
25534
|
-
'&::-webkit-scrollbar': {
|
|
25535
|
-
background: info.background
|
|
25536
|
-
}
|
|
25537
|
-
};
|
|
25538
|
-
}
|
|
25539
25530
|
;// CONCATENATED MODULE: ../shineout-style/src/table/table.ts
|
|
25540
25531
|
|
|
25541
25532
|
|
|
25542
|
-
|
|
25543
25533
|
var cellBaseIndex = 4;
|
|
25544
25534
|
var fixedIndex = 6;
|
|
25545
25535
|
var resizeIndex = 8;
|
|
@@ -25578,6 +25568,7 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25578
25568
|
borderBottom: "1px solid ".concat(src.tableCellBorderColor),
|
|
25579
25569
|
boxSizing: 'border-box',
|
|
25580
25570
|
lineHeight: src.lineHeightDynamic,
|
|
25571
|
+
zIndex: fixedIndex - 1,
|
|
25581
25572
|
'&$cellFixedLeft, &$cellFixedRight': {
|
|
25582
25573
|
zIndex: fixedIndex
|
|
25583
25574
|
},
|
|
@@ -25704,7 +25695,7 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25704
25695
|
},
|
|
25705
25696
|
headWrapper: {
|
|
25706
25697
|
flex: '0 0 auto',
|
|
25707
|
-
overflow: 'hidden',
|
|
25698
|
+
// overflow: 'hidden',
|
|
25708
25699
|
boxSizing: 'border-box',
|
|
25709
25700
|
background: src.tableTheadBackgroundColor,
|
|
25710
25701
|
'$sticky > &': {
|
|
@@ -25733,13 +25724,22 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25733
25724
|
zIndex: fixedIndex + 1
|
|
25734
25725
|
}
|
|
25735
25726
|
}
|
|
25727
|
+
},
|
|
25728
|
+
'$wrapper & table > tfoot': {
|
|
25729
|
+
position: 'sticky',
|
|
25730
|
+
bottom: 0,
|
|
25731
|
+
zIndex: fixedIndex
|
|
25736
25732
|
}
|
|
25737
25733
|
},
|
|
25738
25734
|
footWrapper: {
|
|
25739
25735
|
flex: '0 0 auto',
|
|
25740
|
-
overflow: 'hidden',
|
|
25741
25736
|
boxSizing: 'border-box',
|
|
25742
|
-
background: src.tableTfootBackgroundColor
|
|
25737
|
+
background: src.tableTfootBackgroundColor,
|
|
25738
|
+
"[data-soui-role='scroll'] &": {
|
|
25739
|
+
position: 'sticky',
|
|
25740
|
+
bottom: 0,
|
|
25741
|
+
zIndex: fixedIndex + 1
|
|
25742
|
+
}
|
|
25743
25743
|
},
|
|
25744
25744
|
emptyWrapper: {
|
|
25745
25745
|
minHeight: '170px',
|
|
@@ -25748,18 +25748,13 @@ var tableStyle = objectSpread2_default()(objectSpread2_default()({
|
|
|
25748
25748
|
position: 'sticky',
|
|
25749
25749
|
left: 0,
|
|
25750
25750
|
top: 0,
|
|
25751
|
-
right: 0,
|
|
25752
25751
|
justifyContent: 'center',
|
|
25753
25752
|
display: 'flex',
|
|
25754
25753
|
alignItems: 'center',
|
|
25755
25754
|
borderBottom: "1px solid ".concat(src.tableCellBorderColor)
|
|
25756
25755
|
},
|
|
25757
|
-
|
|
25758
|
-
|
|
25759
|
-
overflowY: 'scroll'
|
|
25760
|
-
}, customScrollBar({
|
|
25761
|
-
background: 'transparent'
|
|
25762
|
-
}))
|
|
25756
|
+
emptyNoBorder: {
|
|
25757
|
+
borderBottom: 'none'
|
|
25763
25758
|
},
|
|
25764
25759
|
cellFixedLeft: {
|
|
25765
25760
|
position: 'sticky'
|
|
@@ -38724,7 +38719,6 @@ var useResize = function useResize(props) {
|
|
|
38724
38719
|
|
|
38725
38720
|
|
|
38726
38721
|
|
|
38727
|
-
|
|
38728
38722
|
var Scroll = function Scroll(props) {
|
|
38729
38723
|
var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
38730
38724
|
var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
@@ -38756,13 +38750,13 @@ var Scroll = function Scroll(props) {
|
|
|
38756
38750
|
width: '100%',
|
|
38757
38751
|
overflow: 'auto'
|
|
38758
38752
|
};
|
|
38759
|
-
var containerStyle =
|
|
38753
|
+
var containerStyle = {
|
|
38760
38754
|
height: '100%',
|
|
38761
38755
|
width: '100%',
|
|
38762
38756
|
display: 'inline-flex',
|
|
38763
|
-
|
|
38764
|
-
|
|
38765
|
-
}
|
|
38757
|
+
position: 'sticky',
|
|
38758
|
+
top: 0
|
|
38759
|
+
};
|
|
38766
38760
|
|
|
38767
38761
|
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
|
|
38768
38762
|
var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
@@ -49694,12 +49688,10 @@ var useForm = function useForm(props) {
|
|
|
49694
49688
|
context.removeArr.delete(n);
|
|
49695
49689
|
if (df !== undefined && deepGet(context.value, n) === undefined) {
|
|
49696
49690
|
if (!context.mounted) context.defaultValues[n] = df;
|
|
49697
|
-
|
|
49698
|
-
|
|
49699
|
-
deepSet(v, n, df, deepSetOptions);
|
|
49700
|
-
});
|
|
49701
|
-
update(n);
|
|
49691
|
+
onChange(function (v) {
|
|
49692
|
+
deepSet(v, n, df, deepSetOptions);
|
|
49702
49693
|
});
|
|
49694
|
+
update(n);
|
|
49703
49695
|
}
|
|
49704
49696
|
},
|
|
49705
49697
|
unbind: function unbind(n, reserveAble, validateField, update) {
|
|
@@ -59964,6 +59956,12 @@ var Sticky = function Sticky(props) {
|
|
|
59964
59956
|
}
|
|
59965
59957
|
return cancelParentObserver;
|
|
59966
59958
|
}, [props.parent, css, context.target, top, bottom]);
|
|
59959
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
59960
|
+
if (props.onChange) {
|
|
59961
|
+
props.onChange(show);
|
|
59962
|
+
}
|
|
59963
|
+
;
|
|
59964
|
+
}, [show]);
|
|
59967
59965
|
|
|
59968
59966
|
// 纯css方法 直接使用css
|
|
59969
59967
|
// js方法
|
|
@@ -60134,6 +60132,147 @@ var BaseSwitch = function BaseSwitch(props) {
|
|
|
60134
60132
|
var SwitchComp = src_switch_switch_0;
|
|
60135
60133
|
SwitchComp.displayName = 'ShineoutSwitch';
|
|
60136
60134
|
/* harmony default export */ var src_switch_0 = (SwitchComp);
|
|
60135
|
+
;// CONCATENATED MODULE: ../base/src/virtual-scroll/scroll-table.tsx
|
|
60136
|
+
|
|
60137
|
+
|
|
60138
|
+
|
|
60139
|
+
|
|
60140
|
+
|
|
60141
|
+
|
|
60142
|
+
var extractHeightValue = function extractHeightValue(num) {
|
|
60143
|
+
if (isNumber(num)) return num;
|
|
60144
|
+
var match = num.match(/(\d+)/);
|
|
60145
|
+
if (match) {
|
|
60146
|
+
return parseInt(match[0], 10);
|
|
60147
|
+
}
|
|
60148
|
+
return undefined;
|
|
60149
|
+
};
|
|
60150
|
+
var scroll_table_Scroll = function Scroll(props) {
|
|
60151
|
+
var containerRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
60152
|
+
var scrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
60153
|
+
var wrapperRef = useForkRef(scrollRef, props.wrapperRef);
|
|
60154
|
+
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
60155
|
+
timer: null,
|
|
60156
|
+
isMouseDown: false
|
|
60157
|
+
}),
|
|
60158
|
+
context = _useRef.current;
|
|
60159
|
+
// TODO: keepScrollTop考虑做成Table的新feat?
|
|
60160
|
+
var _props$scrollHeight = props.scrollHeight,
|
|
60161
|
+
scrollHeight = _props$scrollHeight === void 0 ? 0 : _props$scrollHeight,
|
|
60162
|
+
_props$scrollWidth = props.scrollWidth,
|
|
60163
|
+
scrollWidth = _props$scrollWidth === void 0 ? 0 : _props$scrollWidth,
|
|
60164
|
+
_props$defaultHeight = props.defaultHeight,
|
|
60165
|
+
defaultHeight = _props$defaultHeight === void 0 ? 0 : _props$defaultHeight,
|
|
60166
|
+
_props$keepScrollTop = props.keepScrollTop,
|
|
60167
|
+
keepScrollTop = _props$keepScrollTop === void 0 ? false : _props$keepScrollTop;
|
|
60168
|
+
var _useResize = useResize({
|
|
60169
|
+
targetRef: containerRef,
|
|
60170
|
+
timer: 100
|
|
60171
|
+
}),
|
|
60172
|
+
width = _useResize.width,
|
|
60173
|
+
h = _useResize.height;
|
|
60174
|
+
var height = h || defaultHeight;
|
|
60175
|
+
var config = useConfig();
|
|
60176
|
+
var isRtl = config.direction === 'rtl';
|
|
60177
|
+
var scrollerStyle = {
|
|
60178
|
+
flex: 1,
|
|
60179
|
+
minWidth: 0,
|
|
60180
|
+
minHeight: 0,
|
|
60181
|
+
overflow: props.isEmptyContent ? 'hidden' : 'auto',
|
|
60182
|
+
width: '100%'
|
|
60183
|
+
};
|
|
60184
|
+
var containerStyle = {
|
|
60185
|
+
height: '100%',
|
|
60186
|
+
width: '100%',
|
|
60187
|
+
display: 'flex',
|
|
60188
|
+
position: 'sticky',
|
|
60189
|
+
flexDirection: 'column',
|
|
60190
|
+
top: 0,
|
|
60191
|
+
overflow: props.isEmptyContent ? 'auto' : undefined
|
|
60192
|
+
};
|
|
60193
|
+
|
|
60194
|
+
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
|
|
60195
|
+
var paddingTop = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
60196
|
+
if (keepScrollTop) return Math.max(0, Math.floor(scrollHeight - height));
|
|
60197
|
+
return height === 0 ? 0 : Math.max(0, Math.floor(scrollHeight - height));
|
|
60198
|
+
}, [scrollHeight, height]);
|
|
60199
|
+
var placeStyle = {
|
|
60200
|
+
paddingTop: paddingTop,
|
|
60201
|
+
width: scrollWidth,
|
|
60202
|
+
overflow: props.isScrollY ? 'hidden' : 'auto hidden',
|
|
60203
|
+
height: props.isScrollY ? 0 : 1,
|
|
60204
|
+
marginTop: props.isScrollY ? 0 : -1,
|
|
60205
|
+
lineHeight: 0
|
|
60206
|
+
};
|
|
60207
|
+
var handleScroll = usePersistFn(function (e) {
|
|
60208
|
+
var onScrollToBottom = props.onScrollToBottom;
|
|
60209
|
+
var target = e.currentTarget;
|
|
60210
|
+
var scrollLeft = target.scrollLeft,
|
|
60211
|
+
scrollTop = target.scrollTop;
|
|
60212
|
+
if (props.height && onScrollToBottom) {
|
|
60213
|
+
var realHeight = extractHeightValue(props.height);
|
|
60214
|
+
if (realHeight !== undefined) {
|
|
60215
|
+
var touchBottom = target.scrollHeight === scrollTop + realHeight;
|
|
60216
|
+
if (touchBottom) onScrollToBottom();
|
|
60217
|
+
}
|
|
60218
|
+
}
|
|
60219
|
+
var maxY = target.scrollHeight - target.clientHeight;
|
|
60220
|
+
var maxX = target.scrollWidth - target.clientWidth;
|
|
60221
|
+
if (!isRtl) {
|
|
60222
|
+
// 解决浏览器缩放以后导致滚动条长度出现小数
|
|
60223
|
+
if (maxX - scrollLeft < 0 || maxX - scrollLeft < 1) scrollLeft = maxX;
|
|
60224
|
+
if (scrollLeft < 0) scrollLeft = 0;
|
|
60225
|
+
} else {
|
|
60226
|
+
if (maxX + scrollLeft < 0 || maxX + scrollLeft < 1) scrollLeft = 0 - maxX;
|
|
60227
|
+
if (scrollLeft > 0) scrollLeft = 0;
|
|
60228
|
+
}
|
|
60229
|
+
if (scrollTop > maxY || maxY - scrollTop < 1) scrollTop = maxY;
|
|
60230
|
+
if (scrollTop < 0) scrollTop = 0;
|
|
60231
|
+
var x = maxX === 0 ? 0 : Math.min(Math.abs(scrollLeft) / maxX, 1);
|
|
60232
|
+
var y = maxY === 0 ? 0 : Math.min(scrollTop / maxY, 1);
|
|
60233
|
+
if (props.onScroll) props.onScroll({
|
|
60234
|
+
scrollLeft: scrollLeft,
|
|
60235
|
+
scrollTop: scrollTop,
|
|
60236
|
+
x: x,
|
|
60237
|
+
y: y,
|
|
60238
|
+
height: height,
|
|
60239
|
+
width: width,
|
|
60240
|
+
fromDrag: context.isMouseDown
|
|
60241
|
+
});
|
|
60242
|
+
});
|
|
60243
|
+
var handleInnerScroll = usePersistFn(function (e) {
|
|
60244
|
+
var scrollTop = e.currentTarget.scrollTop;
|
|
60245
|
+
if (scrollRef.current) {
|
|
60246
|
+
e.currentTarget.scrollTop = 0;
|
|
60247
|
+
scrollRef.current.scrollTop += scrollTop;
|
|
60248
|
+
}
|
|
60249
|
+
});
|
|
60250
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
60251
|
+
role: 'scroll'
|
|
60252
|
+
})), {}, {
|
|
60253
|
+
style: scrollerStyle,
|
|
60254
|
+
onScroll: handleScroll,
|
|
60255
|
+
ref: wrapperRef,
|
|
60256
|
+
onMouseDown: function onMouseDown() {
|
|
60257
|
+
context.isMouseDown = true;
|
|
60258
|
+
},
|
|
60259
|
+
onMouseUp: function onMouseUp() {
|
|
60260
|
+
context.isMouseDown = false;
|
|
60261
|
+
},
|
|
60262
|
+
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({}, getDataAttribute({
|
|
60263
|
+
role: 'scroll-container'
|
|
60264
|
+
})), {}, {
|
|
60265
|
+
style: containerStyle,
|
|
60266
|
+
ref: containerRef,
|
|
60267
|
+
onScroll: handleInnerScroll,
|
|
60268
|
+
children: props.children
|
|
60269
|
+
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
60270
|
+
style: placeStyle,
|
|
60271
|
+
children: "\xA0"
|
|
60272
|
+
})]
|
|
60273
|
+
}));
|
|
60274
|
+
};
|
|
60275
|
+
/* harmony default export */ var scroll_table = (scroll_table_Scroll);
|
|
60137
60276
|
;// CONCATENATED MODULE: ../hooks/src/common/use-scrollbar-width/index.ts
|
|
60138
60277
|
|
|
60139
60278
|
|
|
@@ -60264,6 +60403,34 @@ var useColumns = function useColumns(props) {
|
|
|
60264
60403
|
|
|
60265
60404
|
|
|
60266
60405
|
|
|
60406
|
+
function getDecimalAndIntegerPart(num) {
|
|
60407
|
+
if (!num) return [0, 0];
|
|
60408
|
+
var str = num.toString();
|
|
60409
|
+
var dotIndex = str.indexOf('.');
|
|
60410
|
+
if (dotIndex === -1) return [parseInt(str), 0];
|
|
60411
|
+
var integerPart = parseInt(str.slice(0, dotIndex));
|
|
60412
|
+
var decimalPart = parseFloat("0.".concat(str.slice(dotIndex + 1)));
|
|
60413
|
+
return [integerPart, decimalPart];
|
|
60414
|
+
}
|
|
60415
|
+
|
|
60416
|
+
// 将所有的小数部分转移到最后一列
|
|
60417
|
+
function shiftDecimalToLastColumn(cols) {
|
|
60418
|
+
var decimalSum = 0;
|
|
60419
|
+
cols.forEach(function (v, i) {
|
|
60420
|
+
var _getDecimalAndInteger = getDecimalAndIntegerPart(v),
|
|
60421
|
+
_getDecimalAndInteger2 = slicedToArray_default()(_getDecimalAndInteger, 2),
|
|
60422
|
+
inter = _getDecimalAndInteger2[0],
|
|
60423
|
+
decimal = _getDecimalAndInteger2[1];
|
|
60424
|
+
if (decimal > 0) {
|
|
60425
|
+
decimalSum += decimal;
|
|
60426
|
+
cols[i] = inter;
|
|
60427
|
+
}
|
|
60428
|
+
});
|
|
60429
|
+
if (decimalSum > 0) {
|
|
60430
|
+
cols[cols.length - 1] = Number(cols[cols.length - 1]) + decimalSum;
|
|
60431
|
+
}
|
|
60432
|
+
return cols;
|
|
60433
|
+
}
|
|
60267
60434
|
var MIN_RESIZABLE_WIDTH = 20;
|
|
60268
60435
|
function compareColumnWidth(curCols, preCols) {
|
|
60269
60436
|
if (curCols.length !== preCols.length) return false;
|
|
@@ -60385,7 +60552,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
60385
60552
|
if (cols && cols.every(function (v) {
|
|
60386
60553
|
return v === 0;
|
|
60387
60554
|
})) return;
|
|
60388
|
-
setColgroup(cols);
|
|
60555
|
+
setColgroup(shiftDecimalToLastColumn(cols));
|
|
60389
60556
|
setAdjust(adjust);
|
|
60390
60557
|
if (!adjust) {
|
|
60391
60558
|
updateResizeFlag();
|
|
@@ -60602,7 +60769,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
60602
60769
|
width: tableWidth,
|
|
60603
60770
|
shouldLastColAuto: props.columnResizable && !adjust,
|
|
60604
60771
|
scrollWidth: scrollWidth,
|
|
60605
|
-
maxScrollLeft: scrollWidth - context.clientWidth,
|
|
60772
|
+
// maxScrollLeft: scrollWidth - context.clientWidth,
|
|
60606
60773
|
resizeFlag: resizeFlag
|
|
60607
60774
|
};
|
|
60608
60775
|
};
|
|
@@ -60871,26 +61038,21 @@ function getMaxRowSpanLength(input) {
|
|
|
60871
61038
|
var useTableVirtual = function useTableVirtual(props) {
|
|
60872
61039
|
var _useState = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
60873
61040
|
_useState2 = slicedToArray_default()(_useState, 2),
|
|
60874
|
-
|
|
60875
|
-
|
|
60876
|
-
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
61041
|
+
innerTop = _useState2[0],
|
|
61042
|
+
setTop = _useState2[1];
|
|
61043
|
+
var _useState3 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(props.data.length * props.rowHeight),
|
|
60877
61044
|
_useState4 = slicedToArray_default()(_useState3, 2),
|
|
60878
|
-
|
|
60879
|
-
|
|
60880
|
-
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(
|
|
61045
|
+
scrollHeight = _useState4[0],
|
|
61046
|
+
setHeight = _useState4[1];
|
|
61047
|
+
var _useState5 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
60881
61048
|
_useState6 = slicedToArray_default()(_useState5, 2),
|
|
60882
|
-
|
|
60883
|
-
|
|
61049
|
+
startIndex = _useState6[0],
|
|
61050
|
+
setStartIndex = _useState6[1];
|
|
60884
61051
|
var _useState7 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
60885
61052
|
_useState8 = slicedToArray_default()(_useState7, 2),
|
|
60886
|
-
|
|
60887
|
-
|
|
60888
|
-
var _useState9 = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useState)(0),
|
|
60889
|
-
_useState10 = slicedToArray_default()(_useState9, 2),
|
|
60890
|
-
offsetY = _useState10[0],
|
|
60891
|
-
setOffsetY = _useState10[1];
|
|
61053
|
+
offsetY = _useState8[0],
|
|
61054
|
+
setOffsetY = _useState8[1];
|
|
60892
61055
|
var rowsInView = props.rowsInView === 0 ? props.data.length : props.rowsInView;
|
|
60893
|
-
var sleft = props.scrollLeft !== undefined ? props.scrollLeft : innerLeft;
|
|
60894
61056
|
var rowSpanInfo = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
60895
61057
|
var rowSpanColumns = props.columns.filter(function (col) {
|
|
60896
61058
|
return typeof col.rowSpan === 'function';
|
|
@@ -60963,18 +61125,11 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
60963
61125
|
}),
|
|
60964
61126
|
context = _useRef.current;
|
|
60965
61127
|
var getTranslate = usePersistFn(function (left, top) {
|
|
60966
|
-
var l = left === undefined ? sleft : left;
|
|
60967
61128
|
var t = top === undefined ? innerTop + offsetY : top;
|
|
60968
61129
|
if (t < 0) {
|
|
60969
61130
|
t = 0;
|
|
60970
61131
|
}
|
|
60971
|
-
|
|
60972
|
-
l = 0;
|
|
60973
|
-
}
|
|
60974
|
-
if (props.isRtl && l > 0) {
|
|
60975
|
-
l = 0;
|
|
60976
|
-
}
|
|
60977
|
-
return "translate3d(".concat(0 - l, "px, ").concat(0 - t, "px, 0)");
|
|
61132
|
+
return "translate3d(0, ".concat(0 - t, "px, 0)");
|
|
60978
61133
|
});
|
|
60979
61134
|
var getContentHeight = function getContentHeight(index) {
|
|
60980
61135
|
if (props.disabled) return 0;
|
|
@@ -60982,7 +61137,7 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
60982
61137
|
for (var i = 0; i <= index; i++) {
|
|
60983
61138
|
sum += context.cachedHeight[i] || props.rowHeight;
|
|
60984
61139
|
}
|
|
60985
|
-
return sum;
|
|
61140
|
+
return sum + props.theadAndTfootHeight;
|
|
60986
61141
|
};
|
|
60987
61142
|
var setRowHeight = usePersistFn(function (index, height) {
|
|
60988
61143
|
if (props.disabled) return;
|
|
@@ -61076,12 +61231,10 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
61076
61231
|
setHeight(sumHeight);
|
|
61077
61232
|
});
|
|
61078
61233
|
var handleScroll = function handleScroll(info) {
|
|
61079
|
-
var
|
|
61080
|
-
height = info.height,
|
|
61234
|
+
var height = info.height,
|
|
61081
61235
|
y = info.y,
|
|
61082
61236
|
fromDrag = info.fromDrag;
|
|
61083
61237
|
var scrollTop = info.scrollTop;
|
|
61084
|
-
setLeft(scrollLeft);
|
|
61085
61238
|
if (props.disabled) {
|
|
61086
61239
|
setTop(scrollTop);
|
|
61087
61240
|
return;
|
|
@@ -61138,7 +61291,6 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
61138
61291
|
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
61139
61292
|
var left = Math.min(targetLeft, max);
|
|
61140
61293
|
if (left === scrollEl.scrollLeft) return;
|
|
61141
|
-
setLeft(left);
|
|
61142
61294
|
scrollEl.scrollLeft = left;
|
|
61143
61295
|
});
|
|
61144
61296
|
var scrollColumnIntoView = usePersistFn(function (colKey) {
|
|
@@ -61157,6 +61309,11 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
61157
61309
|
}
|
|
61158
61310
|
scrollColumnByLeft(left);
|
|
61159
61311
|
});
|
|
61312
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
61313
|
+
if (props.scrollLeft) {
|
|
61314
|
+
scrollColumnByLeft(props.scrollLeft);
|
|
61315
|
+
}
|
|
61316
|
+
}, [props.scrollLeft]);
|
|
61160
61317
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
61161
61318
|
var scrollRefHeight = props.scrollRef.current ? props.scrollRef.current.clientHeight : 0;
|
|
61162
61319
|
var tableRefHeight = props.innerRef.current ? props.innerRef.current.clientHeight : 0;
|
|
@@ -61200,7 +61357,7 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
61200
61357
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
61201
61358
|
if (props.disabled) return;
|
|
61202
61359
|
setHeight(getContentHeight(props.data.length - 1));
|
|
61203
|
-
}, [props.data.length]);
|
|
61360
|
+
}, [props.data.length, props.theadAndTfootHeight]);
|
|
61204
61361
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
61205
61362
|
if (props.disabled) return;
|
|
61206
61363
|
if (context.heightCallback) {
|
|
@@ -61216,7 +61373,6 @@ var useTableVirtual = function useTableVirtual(props) {
|
|
|
61216
61373
|
return {
|
|
61217
61374
|
scrollHeight: scrollHeight,
|
|
61218
61375
|
startIndex: startIndex,
|
|
61219
|
-
innerLeft: sleft,
|
|
61220
61376
|
innerTop: innerTop + offsetY,
|
|
61221
61377
|
data: renderData,
|
|
61222
61378
|
handleScroll: handleScroll,
|
|
@@ -61975,44 +62131,32 @@ var thead_toNum = toNum;
|
|
|
61975
62131
|
});
|
|
61976
62132
|
};
|
|
61977
62133
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan, level) {
|
|
62134
|
+
// 累加level 至 0 的所有高度
|
|
62135
|
+
var top = context.trHeights.slice(0, level).reduce(function (a, b) {
|
|
62136
|
+
return thead_toNum(a) + thead_toNum(b);
|
|
62137
|
+
}, 0);
|
|
61978
62138
|
if (fixed === 'left') {
|
|
61979
|
-
if (props.virtual) {
|
|
61980
|
-
// 这是virtual table场景下的th样式
|
|
61981
|
-
return {
|
|
61982
|
-
transform: "translate3d(var(--virtual-fixed-left, 0), 0, 0)"
|
|
61983
|
-
};
|
|
61984
|
-
}
|
|
61985
62139
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
61986
62140
|
return thead_toNum(a) + thead_toNum(b);
|
|
61987
62141
|
}, 0);
|
|
61988
|
-
// 这是base table场景下的th样式
|
|
61989
62142
|
return {
|
|
61990
62143
|
left: left,
|
|
61991
|
-
top:
|
|
62144
|
+
top: top,
|
|
61992
62145
|
position: 'sticky'
|
|
61993
62146
|
};
|
|
61994
62147
|
}
|
|
61995
62148
|
if (fixed === 'right') {
|
|
61996
|
-
if (props.virtual) {
|
|
61997
|
-
// 这是virtual table场景下的th样式
|
|
61998
|
-
return {
|
|
61999
|
-
transform: "translate3d(var(--virtual-fixed-right, 0), 0, 0)"
|
|
62000
|
-
};
|
|
62001
|
-
}
|
|
62002
62149
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
62003
62150
|
return thead_toNum(a) + thead_toNum(b);
|
|
62004
62151
|
}, 0);
|
|
62005
|
-
// 这是base table场景下的th样式
|
|
62006
62152
|
return {
|
|
62007
62153
|
right: right,
|
|
62008
|
-
top:
|
|
62154
|
+
top: top,
|
|
62009
62155
|
position: 'sticky'
|
|
62010
62156
|
};
|
|
62011
62157
|
}
|
|
62012
|
-
|
|
62013
|
-
// 这是base table场景下的非fixed th样式
|
|
62014
62158
|
return {
|
|
62015
|
-
top:
|
|
62159
|
+
top: top,
|
|
62016
62160
|
position: 'sticky'
|
|
62017
62161
|
};
|
|
62018
62162
|
};
|
|
@@ -62229,16 +62373,6 @@ var useTableRow = function useTableRow(props) {
|
|
|
62229
62373
|
}
|
|
62230
62374
|
setHoverIndex(hoverIndex);
|
|
62231
62375
|
});
|
|
62232
|
-
var isCellHover = usePersistFn(function (rowIndex) {
|
|
62233
|
-
var colSpan = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
62234
|
-
if (!props.hover) return false;
|
|
62235
|
-
var isHover = false;
|
|
62236
|
-
for (var i = 0; i < colSpan; i++) {
|
|
62237
|
-
isHover = hoverIndex.has(rowIndex + i);
|
|
62238
|
-
if (isHover) break;
|
|
62239
|
-
}
|
|
62240
|
-
return isHover;
|
|
62241
|
-
});
|
|
62242
62376
|
var rowData = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
62243
62377
|
var rows = [];
|
|
62244
62378
|
context.rowSelectMergeStartData = [];
|
|
@@ -62272,7 +62406,6 @@ var useTableRow = function useTableRow(props) {
|
|
|
62272
62406
|
return {
|
|
62273
62407
|
rowData: rowData,
|
|
62274
62408
|
handleCellHover: handleCellHover,
|
|
62275
|
-
isCellHover: isCellHover,
|
|
62276
62409
|
hoverIndex: hoverIndex,
|
|
62277
62410
|
rowSelectMergeStartData: context.rowSelectMergeStartData
|
|
62278
62411
|
};
|
|
@@ -62369,11 +62502,6 @@ var Tr = function Tr(props) {
|
|
|
62369
62502
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
62370
62503
|
if (!props.isScrollX) return;
|
|
62371
62504
|
if (fixed === 'left') {
|
|
62372
|
-
if (props.virtual) {
|
|
62373
|
-
return {
|
|
62374
|
-
transform: "translate3d(var(--virtual-fixed-left, 0), 0, 0)"
|
|
62375
|
-
};
|
|
62376
|
-
}
|
|
62377
62505
|
var left = props.colgroup.slice(0, index).reduce(function (a, b) {
|
|
62378
62506
|
return tr_toNum(a) + tr_toNum(b);
|
|
62379
62507
|
}, 0);
|
|
@@ -62383,11 +62511,6 @@ var Tr = function Tr(props) {
|
|
|
62383
62511
|
};
|
|
62384
62512
|
}
|
|
62385
62513
|
if (fixed === 'right') {
|
|
62386
|
-
if (props.virtual) {
|
|
62387
|
-
return {
|
|
62388
|
-
transform: "translate3d(var(--virtual-fixed-right, 0), 0, 0)"
|
|
62389
|
-
};
|
|
62390
|
-
}
|
|
62391
62514
|
var right = props.colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
62392
62515
|
return tr_toNum(a) + tr_toNum(b);
|
|
62393
62516
|
}, 0);
|
|
@@ -62602,18 +62725,28 @@ var Tr = function Tr(props) {
|
|
|
62602
62725
|
if (data[i]) {
|
|
62603
62726
|
var last = cols[i + (data[i].colSpan || 1) - 1] || {};
|
|
62604
62727
|
var isRowSpanTd = data[i].rowSpan > 1;
|
|
62728
|
+
var shouldBindMouseEvent = props.hover && hasSiblingRowSpan || isRowSpanTd;
|
|
62729
|
+
var showCellHover = props.hoverIndex.has(props.rowIndex);
|
|
62730
|
+
if (!showCellHover && data[i].rowSpan > 1) {
|
|
62731
|
+
for (var j = 0; j < data[i].rowSpan; j++) {
|
|
62732
|
+
if (props.hoverIndex.has(props.rowIndex + j)) {
|
|
62733
|
+
showCellHover = true;
|
|
62734
|
+
break;
|
|
62735
|
+
}
|
|
62736
|
+
}
|
|
62737
|
+
}
|
|
62605
62738
|
var td = /*#__PURE__*/(0,jsx_runtime.jsx)(Td, {
|
|
62606
62739
|
col: col,
|
|
62607
62740
|
data: data[i].data,
|
|
62608
62741
|
colSpan: data[i].colSpan,
|
|
62609
62742
|
rowSpan: data[i].rowSpan,
|
|
62610
|
-
onMouseEnter:
|
|
62611
|
-
props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
62743
|
+
onMouseEnter: shouldBindMouseEvent ? function () {
|
|
62744
|
+
return props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
62612
62745
|
} : undefined,
|
|
62613
|
-
onMouseLeave:
|
|
62614
|
-
props.handleCellHover(-1, 0);
|
|
62746
|
+
onMouseLeave: shouldBindMouseEvent ? function () {
|
|
62747
|
+
return props.handleCellHover(-1, 0);
|
|
62615
62748
|
} : undefined,
|
|
62616
|
-
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),
|
|
62749
|
+
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), showCellHover && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
|
|
62617
62750
|
style: getTdStyle(col, data[i].colSpan),
|
|
62618
62751
|
direction: config.direction,
|
|
62619
62752
|
"data-role": col.type === 'checkbox' ? 'checkbox' : undefined,
|
|
@@ -62740,7 +62873,6 @@ var Tr = function Tr(props) {
|
|
|
62740
62873
|
hover: hover
|
|
62741
62874
|
}),
|
|
62742
62875
|
rowData = _useTableRow.rowData,
|
|
62743
|
-
isCellHover = _useTableRow.isCellHover,
|
|
62744
62876
|
handleCellHover = _useTableRow.handleCellHover,
|
|
62745
62877
|
hoverIndex = _useTableRow.hoverIndex,
|
|
62746
62878
|
rowSelectMergeStartData = _useTableRow.rowSelectMergeStartData;
|
|
@@ -62775,10 +62907,8 @@ var Tr = function Tr(props) {
|
|
|
62775
62907
|
isEmptyTree: props.isEmptyTree,
|
|
62776
62908
|
treeColumnsName: props.treeColumnsName,
|
|
62777
62909
|
setRowHeight: props.setRowHeight,
|
|
62778
|
-
virtual: props.virtual,
|
|
62779
62910
|
striped: props.striped,
|
|
62780
62911
|
radio: props.radio,
|
|
62781
|
-
isCellHover: isCellHover,
|
|
62782
62912
|
hover: hover,
|
|
62783
62913
|
isSelect: props.datum.check(rowSelectMergeStartData[index]),
|
|
62784
62914
|
handleCellHover: handleCellHover
|
|
@@ -62816,11 +62946,6 @@ var tfoot_isArray = isArray,
|
|
|
62816
62946
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
62817
62947
|
var colgroup = props.colgroup;
|
|
62818
62948
|
if (fixed === 'left') {
|
|
62819
|
-
if (props.virtual) {
|
|
62820
|
-
return {
|
|
62821
|
-
transform: "translate3d(var(--virtual-fixed-left, 0), 0, 0)"
|
|
62822
|
-
};
|
|
62823
|
-
}
|
|
62824
62949
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
62825
62950
|
return tfoot_toNum(a) + tfoot_toNum(b);
|
|
62826
62951
|
}, 0);
|
|
@@ -62830,11 +62955,6 @@ var tfoot_isArray = isArray,
|
|
|
62830
62955
|
};
|
|
62831
62956
|
}
|
|
62832
62957
|
if (fixed === 'right') {
|
|
62833
|
-
if (props.virtual) {
|
|
62834
|
-
return {
|
|
62835
|
-
transform: "translate3d(var(--virtual-fixed-right, 0), 0, 0)"
|
|
62836
|
-
};
|
|
62837
|
-
}
|
|
62838
62958
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
62839
62959
|
return tfoot_toNum(a) + tfoot_toNum(b);
|
|
62840
62960
|
}, 0);
|
|
@@ -62945,19 +63065,6 @@ var table_excluded = ["data"];
|
|
|
62945
63065
|
|
|
62946
63066
|
var table_devUseWarning = devUseWarning;
|
|
62947
63067
|
var table_emptyArr = [];
|
|
62948
|
-
var virtualScrollerStyle = {
|
|
62949
|
-
flex: 1,
|
|
62950
|
-
minWidth: 0,
|
|
62951
|
-
minHeight: 0,
|
|
62952
|
-
overflow: 'auto',
|
|
62953
|
-
width: '100%'
|
|
62954
|
-
};
|
|
62955
|
-
var scrollWrapperStyle = {
|
|
62956
|
-
flex: 1,
|
|
62957
|
-
minHeight: 0,
|
|
62958
|
-
minWidth: 0,
|
|
62959
|
-
display: 'flex'
|
|
62960
|
-
};
|
|
62961
63068
|
var emptyRef = {
|
|
62962
63069
|
current: null
|
|
62963
63070
|
};
|
|
@@ -62979,15 +63086,6 @@ var emptyRef = {
|
|
|
62979
63086
|
var mirrorScrollRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
62980
63087
|
var tableRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
62981
63088
|
var browserScrollbarWidth = useScrollbarWidth();
|
|
62982
|
-
var emptyStyle = objectSpread2_default()(objectSpread2_default()({}, virtualScrollerStyle), {}, {
|
|
62983
|
-
overflow: 'auto hidden',
|
|
62984
|
-
position: 'absolute',
|
|
62985
|
-
zIndex: 1,
|
|
62986
|
-
bottom: 0,
|
|
62987
|
-
left: 0,
|
|
62988
|
-
right: 0,
|
|
62989
|
-
height: browserScrollbarWidth
|
|
62990
|
-
});
|
|
62991
63089
|
if (props.fixed) {
|
|
62992
63090
|
table_devUseWarning.deprecated('fixed', 'virtual', 'Table');
|
|
62993
63091
|
}
|
|
@@ -63008,7 +63106,8 @@ var emptyRef = {
|
|
|
63008
63106
|
};
|
|
63009
63107
|
};
|
|
63010
63108
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
63011
|
-
emptyHeight: 0
|
|
63109
|
+
emptyHeight: 0,
|
|
63110
|
+
theadAndTfootHeight: 0
|
|
63012
63111
|
}),
|
|
63013
63112
|
context = _useRef.current;
|
|
63014
63113
|
var virtual = ((_props$data = props.data) === null || _props$data === void 0 ? void 0 : _props$data.length) && props.rowsInView !== 0 && (!!props.virtual || props.fixed === 'both' || props.fixed === 'y' || props.fixed === 'auto');
|
|
@@ -63057,7 +63156,6 @@ var emptyRef = {
|
|
|
63057
63156
|
floatRight = _useTableLayout.floatRight,
|
|
63058
63157
|
width = _useTableLayout.width,
|
|
63059
63158
|
shouldLastColAuto = _useTableLayout.shouldLastColAuto,
|
|
63060
|
-
maxScrollLeft = _useTableLayout.maxScrollLeft,
|
|
63061
63159
|
scrollBarWidth = _useTableLayout.scrollBarWidth,
|
|
63062
63160
|
scrollWidth = _useTableLayout.scrollWidth,
|
|
63063
63161
|
resizeFlag = _useTableLayout.resizeFlag;
|
|
@@ -63141,6 +63239,10 @@ var emptyRef = {
|
|
|
63141
63239
|
onChange: inputableData.onChange,
|
|
63142
63240
|
disabled: props.disabled
|
|
63143
63241
|
});
|
|
63242
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
63243
|
+
var _theadRef$current, _tfootRef$current;
|
|
63244
|
+
context.theadAndTfootHeight = ((theadRef === null || theadRef === void 0 || (_theadRef$current = theadRef.current) === null || _theadRef$current === void 0 ? void 0 : _theadRef$current.clientHeight) || 0) + (((_tfootRef$current = tfootRef.current) === null || _tfootRef$current === void 0 ? void 0 : _tfootRef$current.clientHeight) || 0);
|
|
63245
|
+
}, [theadRef.current, tfootRef.current]);
|
|
63144
63246
|
var virtualInfo = use_table_virtual({
|
|
63145
63247
|
disabled: !virtual,
|
|
63146
63248
|
data: treeData,
|
|
@@ -63151,21 +63253,11 @@ var emptyRef = {
|
|
|
63151
63253
|
scrollRef: scrollRef,
|
|
63152
63254
|
innerRef: tbodyRef,
|
|
63153
63255
|
scrollLeft: props.scrollLeft,
|
|
63154
|
-
isRtl: isRtl
|
|
63256
|
+
isRtl: isRtl,
|
|
63257
|
+
theadAndTfootHeight: context.theadAndTfootHeight
|
|
63155
63258
|
});
|
|
63156
63259
|
|
|
63157
|
-
//
|
|
63158
|
-
var handleHeaderWheel = usePersistFn(function (e) {
|
|
63159
|
-
var scrollEl = scrollRef.current;
|
|
63160
|
-
if (!scrollEl) return;
|
|
63161
|
-
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
63162
|
-
var scrollLeft = scrollEl.scrollLeft + e.deltaX;
|
|
63163
|
-
if (scrollLeft === scrollEl.scrollLeft) {
|
|
63164
|
-
return;
|
|
63165
|
-
}
|
|
63166
|
-
e.preventDefault();
|
|
63167
|
-
scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
|
|
63168
|
-
});
|
|
63260
|
+
// 简单表格的滚动事件
|
|
63169
63261
|
var handleBodyScroll = usePersistFn(function (e) {
|
|
63170
63262
|
var target = e.currentTarget;
|
|
63171
63263
|
if (!target) return;
|
|
@@ -63181,6 +63273,8 @@ var emptyRef = {
|
|
|
63181
63273
|
props.onScroll(x, y, target.scrollLeft, target.scrollTop);
|
|
63182
63274
|
}
|
|
63183
63275
|
});
|
|
63276
|
+
|
|
63277
|
+
// 虚拟表格的滚动事件
|
|
63184
63278
|
var handleVirtualScroll = usePersistFn(function (info) {
|
|
63185
63279
|
virtualInfo.handleScroll(info);
|
|
63186
63280
|
layoutFunc.checkFloat();
|
|
@@ -63195,7 +63289,7 @@ var emptyRef = {
|
|
|
63195
63289
|
var _props$data2;
|
|
63196
63290
|
if (!((_props$data2 = props.data) !== null && _props$data2 !== void 0 && _props$data2.length) || filteredData !== undefined && filteredData.length === 0) {
|
|
63197
63291
|
return /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
63198
|
-
className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper,
|
|
63292
|
+
className: classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyWrapper, isScrollX && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.emptyNoBorder)),
|
|
63199
63293
|
ref: function ref(el) {
|
|
63200
63294
|
context.emptyHeight = (el === null || el === void 0 ? void 0 : el.clientHeight) || 0;
|
|
63201
63295
|
},
|
|
@@ -63273,7 +63367,6 @@ var emptyRef = {
|
|
|
63273
63367
|
jssStyle: props.jssStyle,
|
|
63274
63368
|
colgroup: colgroup
|
|
63275
63369
|
};
|
|
63276
|
-
var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
|
|
63277
63370
|
var StickyWrapper = props.sticky ? src_sticky_sticky : (external_root_React_commonjs2_react_commonjs_react_amd_react_default()).Fragment;
|
|
63278
63371
|
var sticky = typeof_default()(props.sticky) === 'object' ? props.sticky : {
|
|
63279
63372
|
top: 0
|
|
@@ -63286,8 +63379,8 @@ var emptyRef = {
|
|
|
63286
63379
|
parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
|
|
63287
63380
|
};
|
|
63288
63381
|
var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
|
|
63289
|
-
var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper
|
|
63290
|
-
var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper
|
|
63382
|
+
var headWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper);
|
|
63383
|
+
var footWrapperClass = classnames_default()(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper);
|
|
63291
63384
|
var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
|
|
63292
63385
|
var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
|
|
63293
63386
|
if (!props.showTopScrollbar) return null;
|
|
@@ -63325,61 +63418,49 @@ var emptyRef = {
|
|
|
63325
63418
|
}));
|
|
63326
63419
|
};
|
|
63327
63420
|
if (isRenderVirtualTable) {
|
|
63328
|
-
var _props$data4;
|
|
63329
|
-
var virtualCssVar = {
|
|
63330
|
-
'--virtual-fixed-left': "".concat(virtualInfo.innerLeft, "px"),
|
|
63331
|
-
'--virtual-fixed-right': fixRightNum > 0 ? "-".concat(fixRightNum, "px") : "".concat(fixRightNum, "px")
|
|
63332
|
-
};
|
|
63421
|
+
var _props$data4, _props$data5;
|
|
63333
63422
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
63334
|
-
children: [renderHeadMirrorScroller(),
|
|
63335
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
63336
|
-
className: headWrapperClass,
|
|
63337
|
-
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
63338
|
-
style: objectSpread2_default()({
|
|
63339
|
-
width: width,
|
|
63340
|
-
transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
|
|
63341
|
-
}, virtualCssVar),
|
|
63342
|
-
ref: theadRef,
|
|
63343
|
-
children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()(objectSpread2_default()({}, headCommonProps), {}, {
|
|
63344
|
-
virtual: true
|
|
63345
|
-
}))]
|
|
63346
|
-
})
|
|
63347
|
-
})
|
|
63348
|
-
})), /*#__PURE__*/(0,jsx_runtime.jsx)(virtual_scroll_scroll, {
|
|
63349
|
-
style: scrollWrapperStyle,
|
|
63350
|
-
scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : emptyStyle,
|
|
63423
|
+
children: [renderHeadMirrorScroller(), /*#__PURE__*/(0,jsx_runtime.jsxs)(scroll_table, {
|
|
63351
63424
|
wrapperRef: scrollRef,
|
|
63352
63425
|
scrollWidth: width || 1,
|
|
63353
63426
|
scrollHeight: virtual ? virtualInfo.scrollHeight : tbodyHeight,
|
|
63354
63427
|
onScroll: handleVirtualScroll,
|
|
63355
63428
|
defaultHeight: context.emptyHeight,
|
|
63356
63429
|
isScrollY: isScrollY,
|
|
63357
|
-
|
|
63358
|
-
|
|
63430
|
+
isEmptyContent: !((_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length),
|
|
63431
|
+
children: [!props.hideHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, props.sticky ? stickyProps : {}), {}, {
|
|
63432
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
63433
|
+
className: headWrapperClass,
|
|
63434
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
63435
|
+
style: {
|
|
63436
|
+
width: width
|
|
63437
|
+
},
|
|
63438
|
+
ref: theadRef,
|
|
63439
|
+
children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(thead, objectSpread2_default()({}, headCommonProps))]
|
|
63440
|
+
})
|
|
63441
|
+
})
|
|
63442
|
+
})), !!((_props$data5 = props.data) !== null && _props$data5 !== void 0 && _props$data5.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
63443
|
+
style: {
|
|
63359
63444
|
width: width,
|
|
63360
63445
|
transform: virtualInfo.getTranslate()
|
|
63361
|
-
},
|
|
63446
|
+
},
|
|
63362
63447
|
ref: tbodyRef,
|
|
63363
63448
|
children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()(objectSpread2_default()({}, bodyCommonProps), {}, {
|
|
63364
63449
|
currentIndex: virtualInfo.startIndex,
|
|
63365
63450
|
data: virtualInfo.data,
|
|
63366
|
-
setRowHeight: virtualInfo.setRowHeight
|
|
63367
|
-
virtual: true
|
|
63451
|
+
setRowHeight: virtualInfo.setRowHeight
|
|
63368
63452
|
}))]
|
|
63369
|
-
})
|
|
63370
|
-
|
|
63371
|
-
|
|
63372
|
-
|
|
63373
|
-
|
|
63374
|
-
|
|
63375
|
-
|
|
63376
|
-
|
|
63377
|
-
|
|
63378
|
-
|
|
63379
|
-
|
|
63380
|
-
}))]
|
|
63381
|
-
})
|
|
63382
|
-
}) : null]
|
|
63453
|
+
}), showFoot ? /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
63454
|
+
className: footWrapperClass,
|
|
63455
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
63456
|
+
style: {
|
|
63457
|
+
width: width
|
|
63458
|
+
},
|
|
63459
|
+
ref: tfootRef,
|
|
63460
|
+
children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
|
|
63461
|
+
})
|
|
63462
|
+
}) : null, renderEmpty()]
|
|
63463
|
+
})]
|
|
63383
63464
|
});
|
|
63384
63465
|
}
|
|
63385
63466
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
@@ -63416,27 +63497,6 @@ var emptyRef = {
|
|
|
63416
63497
|
align: "right"
|
|
63417
63498
|
}, pagination), paginationInfo));
|
|
63418
63499
|
};
|
|
63419
|
-
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
63420
|
-
// 绑定 wheel 事件
|
|
63421
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
63422
|
-
theadRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
63423
|
-
passive: false
|
|
63424
|
-
});
|
|
63425
|
-
}
|
|
63426
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
63427
|
-
tfootRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
63428
|
-
passive: false
|
|
63429
|
-
});
|
|
63430
|
-
}
|
|
63431
|
-
return function () {
|
|
63432
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
63433
|
-
theadRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
63434
|
-
}
|
|
63435
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
63436
|
-
tfootRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
63437
|
-
}
|
|
63438
|
-
};
|
|
63439
|
-
}, [theadRef.current, isScrollY]);
|
|
63440
63500
|
var getRenderIndexByData = function getRenderIndexByData(data) {
|
|
63441
63501
|
var originKey = typeof data === 'string' ? data : getKey(props.keygen, data);
|
|
63442
63502
|
var index = treeData.findIndex(function (item) {
|
|
@@ -69812,7 +69872,7 @@ var upload_interface = __webpack_require__(8821);
|
|
|
69812
69872
|
|
|
69813
69873
|
|
|
69814
69874
|
/* harmony default export */ var src_0 = ({
|
|
69815
|
-
version: '3.7.0-beta.
|
|
69875
|
+
version: '3.7.0-beta.4'
|
|
69816
69876
|
});
|
|
69817
69877
|
}();
|
|
69818
69878
|
/******/ return __webpack_exports__;
|