shineout 3.10.2-beta.2 → 3.10.2-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/dist/shineout.js +27 -7
- 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
|
@@ -545,5 +545,5 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
545
545
|
// 此文件由脚本自动生成,请勿直接修改。
|
|
546
546
|
// This file was generated automatically by a script. Please do not modify it directly.
|
|
547
547
|
var _default = exports.default = {
|
|
548
|
-
version: '3.10.2-beta.
|
|
548
|
+
version: '3.10.2-beta.4'
|
|
549
549
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -13735,7 +13735,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
13735
13735
|
};
|
|
13736
13736
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
13737
13737
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
13738
|
-
/* harmony default export */ var version = ('3.10.2-beta.
|
|
13738
|
+
/* harmony default export */ var version = ('3.10.2-beta.4');
|
|
13739
13739
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
13740
13740
|
|
|
13741
13741
|
|
|
@@ -71117,7 +71117,7 @@ function Table(props) {
|
|
|
71117
71117
|
})
|
|
71118
71118
|
}));
|
|
71119
71119
|
if (isRenderVirtualTable) {
|
|
71120
|
-
var _props$data4, _virtualInfo$rowSpanI2;
|
|
71120
|
+
var _props$data4, _props$data5, _virtualInfo$rowSpanI2;
|
|
71121
71121
|
var showStickyHeader = !props.hideHeader && props.sticky;
|
|
71122
71122
|
if (virtualInfo.isExternalScroll) {
|
|
71123
71123
|
var _props$sticky$top, _props$virtualScrollC, _props$data3, _virtualInfo$rowSpanI;
|
|
@@ -71166,6 +71166,26 @@ function Table(props) {
|
|
|
71166
71166
|
})
|
|
71167
71167
|
});
|
|
71168
71168
|
}
|
|
71169
|
+
|
|
71170
|
+
// sticky-only:有 sticky 但不需要 virtual 的轻量路径
|
|
71171
|
+
// 避免 Scroll 组件和虚拟滚动的额外开销
|
|
71172
|
+
var isStickyOnly = !virtual && !!((_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length);
|
|
71173
|
+
if (isStickyOnly) {
|
|
71174
|
+
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
71175
|
+
children: [renderHeadMirrorScroller(), showStickyHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, stickyProps), {}, {
|
|
71176
|
+
children: $headTable
|
|
71177
|
+
})), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
|
|
71178
|
+
ref: scrollRef,
|
|
71179
|
+
className: tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.bodyWrapper,
|
|
71180
|
+
onScroll: handleBodyScroll,
|
|
71181
|
+
children: /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
71182
|
+
style: tableStyle,
|
|
71183
|
+
ref: tbodyRef,
|
|
71184
|
+
children: [Group, /*#__PURE__*/(0,jsx_runtime.jsx)(tbody, objectSpread2_default()({}, bodyCommonProps)), showFoot && /*#__PURE__*/(0,jsx_runtime.jsx)(tfoot, objectSpread2_default()({}, footCommonProps))]
|
|
71185
|
+
})
|
|
71186
|
+
}), renderBottomMirrorScroller()]
|
|
71187
|
+
});
|
|
71188
|
+
}
|
|
71169
71189
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
71170
71190
|
children: [renderHeadMirrorScroller(), showStickyHeader && /*#__PURE__*/(0,jsx_runtime.jsx)(StickyWrapper, objectSpread2_default()(objectSpread2_default()({}, stickyProps), {}, {
|
|
71171
71191
|
children: $headTable
|
|
@@ -71186,7 +71206,7 @@ function Table(props) {
|
|
|
71186
71206
|
isEmpty: !!$empty,
|
|
71187
71207
|
tableRef: tableRef,
|
|
71188
71208
|
setFakeVirtual: scrollAble ? undefined : setFakeVirtual,
|
|
71189
|
-
children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$
|
|
71209
|
+
children: [!props.hideHeader && !props.sticky && $headTable, !!((_props$data5 = props.data) !== null && _props$data5 !== void 0 && _props$data5.length) && /*#__PURE__*/(0,jsx_runtime.jsxs)("table", {
|
|
71190
71210
|
style: objectSpread2_default()(objectSpread2_default()({}, tableStyle), {}, {
|
|
71191
71211
|
transform: virtualInfo.translateStyle
|
|
71192
71212
|
}),
|
|
@@ -71248,6 +71268,7 @@ function Table(props) {
|
|
|
71248
71268
|
};
|
|
71249
71269
|
|
|
71250
71270
|
// handle head and foot scroll
|
|
71271
|
+
// 使用 passive: true 监听 wheel,不调用 preventDefault,避免阻塞合成器线程(优化 INP)
|
|
71251
71272
|
var handleHeaderWheel = usePersistFn(function (e) {
|
|
71252
71273
|
var _theadRef$current2;
|
|
71253
71274
|
var scrollEl = scrollRef.current;
|
|
@@ -71258,7 +71279,6 @@ function Table(props) {
|
|
|
71258
71279
|
if (scrollLeft === scrollEl.scrollLeft) {
|
|
71259
71280
|
return;
|
|
71260
71281
|
}
|
|
71261
|
-
e.preventDefault();
|
|
71262
71282
|
var left = Math.min(Math.max(scrollLeft, 0), max);
|
|
71263
71283
|
scrollEl.scrollLeft = left;
|
|
71264
71284
|
theadRef.current.parentElement.scrollLeft = left;
|
|
@@ -71270,10 +71290,10 @@ function Table(props) {
|
|
|
71270
71290
|
syncHeaderScroll(((_scrollRef$current10 = scrollRef.current) === null || _scrollRef$current10 === void 0 ? void 0 : _scrollRef$current10.scrollLeft) || 0);
|
|
71271
71291
|
}, [isScrollX, props.sticky, $empty]);
|
|
71272
71292
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
71273
|
-
// 绑定 wheel
|
|
71293
|
+
// 绑定 wheel 事件(passive: true 不阻塞合成器线程)
|
|
71274
71294
|
if (props.sticky && theadRef.current && theadRef.current.parentElement) {
|
|
71275
71295
|
theadRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
71276
|
-
passive:
|
|
71296
|
+
passive: true
|
|
71277
71297
|
});
|
|
71278
71298
|
}
|
|
71279
71299
|
return function () {
|
|
@@ -80060,7 +80080,7 @@ var watermark_interface = __webpack_require__(6640);
|
|
|
80060
80080
|
|
|
80061
80081
|
|
|
80062
80082
|
/* harmony default export */ var src_0 = ({
|
|
80063
|
-
version: '3.10.2-beta.
|
|
80083
|
+
version: '3.10.2-beta.4'
|
|
80064
80084
|
});
|
|
80065
80085
|
}();
|
|
80066
80086
|
/******/ return __webpack_exports__;
|