shineout 3.10.2-beta.4 → 3.10.2-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 +115 -57
- 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.6'
|
|
549
549
|
};
|
package/dist/shineout.js
CHANGED
|
@@ -2242,20 +2242,6 @@ function getDisplayName(Component) {
|
|
|
2242
2242
|
|
|
2243
2243
|
/***/ }),
|
|
2244
2244
|
|
|
2245
|
-
/***/ 1717:
|
|
2246
|
-
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
2247
|
-
|
|
2248
|
-
"use strict";
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
var m = __webpack_require__(5156);
|
|
2252
|
-
if (true) {
|
|
2253
|
-
exports.createRoot = m.createRoot;
|
|
2254
|
-
exports.hydrateRoot = m.hydrateRoot;
|
|
2255
|
-
} else { var i; }
|
|
2256
|
-
|
|
2257
|
-
/***/ }),
|
|
2258
|
-
|
|
2259
2245
|
/***/ 5284:
|
|
2260
2246
|
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
2261
2247
|
|
|
@@ -3190,6 +3176,21 @@ if (true) {
|
|
|
3190
3176
|
|
|
3191
3177
|
/***/ }),
|
|
3192
3178
|
|
|
3179
|
+
/***/ 8035:
|
|
3180
|
+
/***/ (function(module) {
|
|
3181
|
+
|
|
3182
|
+
function webpackEmptyContext(req) {
|
|
3183
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
3184
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
3185
|
+
throw e;
|
|
3186
|
+
}
|
|
3187
|
+
webpackEmptyContext.keys = function() { return []; };
|
|
3188
|
+
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
3189
|
+
webpackEmptyContext.id = 8035;
|
|
3190
|
+
module.exports = webpackEmptyContext;
|
|
3191
|
+
|
|
3192
|
+
/***/ }),
|
|
3193
|
+
|
|
3193
3194
|
/***/ 297:
|
|
3194
3195
|
/***/ (function(module) {
|
|
3195
3196
|
|
|
@@ -13735,7 +13736,7 @@ var handleStyle = function handleStyle(style) {
|
|
|
13735
13736
|
};
|
|
13736
13737
|
/* harmony default export */ var jss_style_handleStyle = (handleStyle);
|
|
13737
13738
|
;// CONCATENATED MODULE: ../shineout-style/src/version.ts
|
|
13738
|
-
/* harmony default export */ var version = ('3.10.2-beta.
|
|
13739
|
+
/* harmony default export */ var version = ('3.10.2-beta.6');
|
|
13739
13740
|
;// CONCATENATED MODULE: ../shineout-style/src/jss-style/index.tsx
|
|
13740
13741
|
|
|
13741
13742
|
|
|
@@ -51770,8 +51771,10 @@ if (mainVersion >= 18 && typeof fullClone.createRoot === 'function') {
|
|
|
51770
51771
|
var pendingQueue = null;
|
|
51771
51772
|
if (!createRoot && mainVersion >= 18) {
|
|
51772
51773
|
pendingQueue = [];
|
|
51773
|
-
|
|
51774
|
-
|
|
51774
|
+
// 用字符串拼接绕过 webpack 静态分析,避免 React 17 下因 react-dom/client 不存在而构建报错
|
|
51775
|
+
var clientModule = 'react-dom' + '/client';
|
|
51776
|
+
Promise.resolve("".concat( /* webpackIgnore: true */clientModule)).then(function (s) {
|
|
51777
|
+
return interopRequireWildcard_default()(__webpack_require__(8035)(s));
|
|
51775
51778
|
}).then(function (client) {
|
|
51776
51779
|
createRoot = client.createRoot;
|
|
51777
51780
|
}).catch(function () {
|
|
@@ -67541,6 +67544,18 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67541
67544
|
scrollRef = props.scrollRef;
|
|
67542
67545
|
var preColumns = use_previous(props.columns);
|
|
67543
67546
|
var preData = use_previous(props.data);
|
|
67547
|
+
|
|
67548
|
+
// 按需启用 floatLeft/floatRight:只有存在对应方向的固定列时才跟踪状态
|
|
67549
|
+
var hasFixedLeft = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
67550
|
+
return props.columns.some(function (col) {
|
|
67551
|
+
return col.fixed === 'left';
|
|
67552
|
+
});
|
|
67553
|
+
}, [props.columns]);
|
|
67554
|
+
var hasFixedRight = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useMemo)(function () {
|
|
67555
|
+
return props.columns.some(function (col) {
|
|
67556
|
+
return col.fixed === 'right';
|
|
67557
|
+
});
|
|
67558
|
+
}, [props.columns]);
|
|
67544
67559
|
var _useRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)({
|
|
67545
67560
|
checkNum: 0,
|
|
67546
67561
|
cachedWidth: null,
|
|
@@ -67560,36 +67575,33 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67560
67575
|
_React$useState6 = slicedToArray_default()(_React$useState5, 2),
|
|
67561
67576
|
isScrollY = _React$useState6[0],
|
|
67562
67577
|
setIsScrollY = _React$useState6[1];
|
|
67563
|
-
|
|
67578
|
+
// floatLeft/floatRight 改用 ref 跟踪,通过 DOM classList 直接切换,避免 setState 触发整棵树 re-render
|
|
67579
|
+
var floatLeftRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
67580
|
+
var floatRightRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(false);
|
|
67581
|
+
var floatClassRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(null);
|
|
67582
|
+
var checkFloatRafRef = (0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useRef)(0);
|
|
67583
|
+
var _React$useState7 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
|
|
67564
67584
|
_React$useState8 = slicedToArray_default()(_React$useState7, 2),
|
|
67565
|
-
|
|
67566
|
-
|
|
67567
|
-
var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(
|
|
67585
|
+
resizeFlag = _React$useState8[0],
|
|
67586
|
+
setResizeFlag = _React$useState8[1];
|
|
67587
|
+
var _React$useState9 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
|
|
67568
67588
|
_React$useState10 = slicedToArray_default()(_React$useState9, 2),
|
|
67569
|
-
|
|
67570
|
-
|
|
67589
|
+
scrollBarWidth = _React$useState10[0],
|
|
67590
|
+
setScrollBarWidth = _React$useState10[1];
|
|
67571
67591
|
var _React$useState11 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
|
|
67572
67592
|
_React$useState12 = slicedToArray_default()(_React$useState11, 2),
|
|
67573
|
-
|
|
67574
|
-
|
|
67575
|
-
var _React$useState13 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(
|
|
67576
|
-
_React$useState14 = slicedToArray_default()(_React$useState13, 2),
|
|
67577
|
-
scrollBarWidth = _React$useState14[0],
|
|
67578
|
-
setScrollBarWidth = _React$useState14[1];
|
|
67579
|
-
var _React$useState15 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(0),
|
|
67580
|
-
_React$useState16 = slicedToArray_default()(_React$useState15, 2),
|
|
67581
|
-
scrollWidth = _React$useState16[0],
|
|
67582
|
-
setScrollWidth = _React$useState16[1];
|
|
67583
|
-
var _React$useState17 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(props.columns.map(function (v) {
|
|
67593
|
+
scrollWidth = _React$useState12[0],
|
|
67594
|
+
setScrollWidth = _React$useState12[1];
|
|
67595
|
+
var _React$useState13 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(props.columns.map(function (v) {
|
|
67584
67596
|
return v.width;
|
|
67585
67597
|
})),
|
|
67586
|
-
_React$
|
|
67587
|
-
colgroup = _React$
|
|
67588
|
-
setColgroup = _React$
|
|
67589
|
-
var _React$
|
|
67590
|
-
_React$
|
|
67591
|
-
adjust = _React$
|
|
67592
|
-
setAdjust = _React$
|
|
67598
|
+
_React$useState14 = slicedToArray_default()(_React$useState13, 2),
|
|
67599
|
+
colgroup = _React$useState14[0],
|
|
67600
|
+
setColgroup = _React$useState14[1];
|
|
67601
|
+
var _React$useState15 = external_root_React_commonjs2_react_commonjs_react_amd_react_default().useState(true),
|
|
67602
|
+
_React$useState16 = slicedToArray_default()(_React$useState15, 2),
|
|
67603
|
+
adjust = _React$useState16[0],
|
|
67604
|
+
setAdjust = _React$useState16[1];
|
|
67593
67605
|
|
|
67594
67606
|
// 检查滚动状态
|
|
67595
67607
|
var checkScroll = use_persist_fn(function () {
|
|
@@ -67796,6 +67808,7 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67796
67808
|
changeColGroup(newCols, false);
|
|
67797
67809
|
});
|
|
67798
67810
|
var checkFloat = use_persist_fn(function () {
|
|
67811
|
+
var _props$tableElRef;
|
|
67799
67812
|
var scrollEl = scrollRef === null || scrollRef === void 0 ? void 0 : scrollRef.current;
|
|
67800
67813
|
if (!scrollEl || !(scrollEl !== null && scrollEl !== void 0 && scrollEl.offsetParent)) return;
|
|
67801
67814
|
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
@@ -67804,11 +67817,36 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67804
67817
|
if (props.isRtl) {
|
|
67805
67818
|
left = left * -1;
|
|
67806
67819
|
}
|
|
67807
|
-
|
|
67808
|
-
//
|
|
67809
|
-
var
|
|
67810
|
-
|
|
67811
|
-
if (
|
|
67820
|
+
|
|
67821
|
+
// 直接操作 DOM classList,不触发 React re-render
|
|
67822
|
+
var classes = floatClassRef.current;
|
|
67823
|
+
var el = (_props$tableElRef = props.tableElRef) === null || _props$tableElRef === void 0 ? void 0 : _props$tableElRef.current;
|
|
67824
|
+
if (!classes || !el) return;
|
|
67825
|
+
if (hasFixedLeft) {
|
|
67826
|
+
var l = left > min;
|
|
67827
|
+
if (l !== floatLeftRef.current) {
|
|
67828
|
+
floatLeftRef.current = l;
|
|
67829
|
+
el.classList.toggle(classes.left, l);
|
|
67830
|
+
}
|
|
67831
|
+
}
|
|
67832
|
+
if (hasFixedRight) {
|
|
67833
|
+
// 缩放比例小于1时,会出现小数,导致判断错误
|
|
67834
|
+
var r = max - left > 1;
|
|
67835
|
+
if (r !== floatRightRef.current) {
|
|
67836
|
+
floatRightRef.current = r;
|
|
67837
|
+
el.classList.toggle(classes.right, r);
|
|
67838
|
+
}
|
|
67839
|
+
}
|
|
67840
|
+
});
|
|
67841
|
+
|
|
67842
|
+
// rAF 节流版:高频滚动路径使用,一帧最多执行一次 checkFloat
|
|
67843
|
+
var scheduleCheckFloat = use_persist_fn(function () {
|
|
67844
|
+
if (!hasFixedLeft && !hasFixedRight) return;
|
|
67845
|
+
if (checkFloatRafRef.current) return;
|
|
67846
|
+
checkFloatRafRef.current = requestAnimationFrame(function () {
|
|
67847
|
+
checkFloatRafRef.current = 0;
|
|
67848
|
+
checkFloat();
|
|
67849
|
+
});
|
|
67812
67850
|
});
|
|
67813
67851
|
var syncScrollWidth = use_persist_fn(function () {
|
|
67814
67852
|
if (!scrollRef.current) return;
|
|
@@ -67831,8 +67869,18 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67831
67869
|
resetColGroup: resetColGroup,
|
|
67832
67870
|
resizeCol: resizeCol,
|
|
67833
67871
|
dragCol: dragCol,
|
|
67834
|
-
checkFloat: checkFloat
|
|
67872
|
+
checkFloat: checkFloat,
|
|
67873
|
+
scheduleCheckFloat: scheduleCheckFloat
|
|
67835
67874
|
});
|
|
67875
|
+
|
|
67876
|
+
// 组件卸载时清理 rAF
|
|
67877
|
+
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
67878
|
+
return function () {
|
|
67879
|
+
if (checkFloatRafRef.current) {
|
|
67880
|
+
cancelAnimationFrame(checkFloatRafRef.current);
|
|
67881
|
+
}
|
|
67882
|
+
};
|
|
67883
|
+
}, []);
|
|
67836
67884
|
(0,external_root_React_commonjs2_react_commonjs_react_amd_react_.useEffect)(function () {
|
|
67837
67885
|
if (!colgroup) return;
|
|
67838
67886
|
// columns 增加或者减少列, 或者宽度发生变化且和colgroup的宽度不一致时
|
|
@@ -67910,18 +67958,25 @@ var useTableLayout = function useTableLayout(props) {
|
|
|
67910
67958
|
} else {
|
|
67911
67959
|
tableWidth = undefined;
|
|
67912
67960
|
}
|
|
67961
|
+
|
|
67962
|
+
// 注册 float class name,由 table.tsx 初始化时调用
|
|
67963
|
+
var registerFloatClass = use_persist_fn(function (left, right) {
|
|
67964
|
+
floatClassRef.current = {
|
|
67965
|
+
left: left,
|
|
67966
|
+
right: right
|
|
67967
|
+
};
|
|
67968
|
+
});
|
|
67913
67969
|
return {
|
|
67914
67970
|
isScrollX: !!isScrollX,
|
|
67915
67971
|
isScrollY: !!isScrollY,
|
|
67916
|
-
floatLeft: floatLeft,
|
|
67917
|
-
floatRight: floatRight,
|
|
67918
67972
|
scrollBarWidth: scrollBarWidth,
|
|
67919
67973
|
colgroup: colgroup ? colgroup : [],
|
|
67920
67974
|
func: func,
|
|
67921
67975
|
width: tableWidth,
|
|
67922
67976
|
shouldLastColAuto: props.columnResizable && !adjust,
|
|
67923
67977
|
scrollWidth: scrollWidth,
|
|
67924
|
-
resizeFlag: resizeFlag
|
|
67978
|
+
resizeFlag: resizeFlag,
|
|
67979
|
+
registerFloatClass: registerFloatClass
|
|
67925
67980
|
};
|
|
67926
67981
|
};
|
|
67927
67982
|
/* harmony default export */ var use_table_layout = (useTableLayout);
|
|
@@ -70681,6 +70736,7 @@ function Table(props) {
|
|
|
70681
70736
|
theadRef: theadRef,
|
|
70682
70737
|
tbodyRef: tbodyRef,
|
|
70683
70738
|
scrollRef: scrollRef,
|
|
70739
|
+
tableElRef: tableRef,
|
|
70684
70740
|
columns: columns,
|
|
70685
70741
|
data: props.data,
|
|
70686
70742
|
dataChangeResize: !!props.dataChangeResize,
|
|
@@ -70694,13 +70750,15 @@ function Table(props) {
|
|
|
70694
70750
|
colgroup = _useTableLayout.colgroup,
|
|
70695
70751
|
isScrollY = _useTableLayout.isScrollY,
|
|
70696
70752
|
isScrollX = _useTableLayout.isScrollX,
|
|
70697
|
-
floatLeft = _useTableLayout.floatLeft,
|
|
70698
|
-
floatRight = _useTableLayout.floatRight,
|
|
70699
70753
|
width = _useTableLayout.width,
|
|
70700
70754
|
shouldLastColAuto = _useTableLayout.shouldLastColAuto,
|
|
70701
70755
|
scrollBarWidth = _useTableLayout.scrollBarWidth,
|
|
70702
70756
|
scrollWidth = _useTableLayout.scrollWidth,
|
|
70703
|
-
resizeFlag = _useTableLayout.resizeFlag
|
|
70757
|
+
resizeFlag = _useTableLayout.resizeFlag,
|
|
70758
|
+
registerFloatClass = _useTableLayout.registerFloatClass;
|
|
70759
|
+
|
|
70760
|
+
// 注册 floatLeft/floatRight 的 CSS class 名,供 checkFloat 直接操作 DOM
|
|
70761
|
+
registerFloatClass(tableClasses.floatLeft, tableClasses.floatRight);
|
|
70704
70762
|
var _useTableFilter = use_table_filter({
|
|
70705
70763
|
keygen: props.keygen,
|
|
70706
70764
|
data: props.data,
|
|
@@ -70851,7 +70909,7 @@ function Table(props) {
|
|
|
70851
70909
|
var handleBodyScroll = usePersistFn(function (e) {
|
|
70852
70910
|
var target = e.currentTarget;
|
|
70853
70911
|
if (!target) return;
|
|
70854
|
-
layoutFunc.
|
|
70912
|
+
layoutFunc.scheduleCheckFloat();
|
|
70855
70913
|
if (isVirtualColumnEnabled) columnInfo.handleScroll({
|
|
70856
70914
|
scrollLeft: target.scrollLeft
|
|
70857
70915
|
});
|
|
@@ -70878,7 +70936,7 @@ function Table(props) {
|
|
|
70878
70936
|
var handleVirtualScroll = usePersistFn(function (info) {
|
|
70879
70937
|
virtualInfo.handleScroll(info);
|
|
70880
70938
|
if (isVirtualColumnEnabled) columnInfo.handleScroll(info);
|
|
70881
|
-
layoutFunc.
|
|
70939
|
+
layoutFunc.scheduleCheckFloat();
|
|
70882
70940
|
if (headMirrorScrollRef.current) {
|
|
70883
70941
|
headMirrorScrollRef.current.scrollLeft = info.scrollLeft;
|
|
70884
70942
|
}
|
|
@@ -71360,7 +71418,7 @@ function Table(props) {
|
|
|
71360
71418
|
});
|
|
71361
71419
|
return /*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment, {
|
|
71362
71420
|
children: [/*#__PURE__*/(0,jsx_runtime.jsx)("div", objectSpread2_default()(objectSpread2_default()({
|
|
71363
|
-
className: classnames_default()(tableWrapperClass, defineProperty_default()(
|
|
71421
|
+
className: classnames_default()(tableWrapperClass, defineProperty_default()({}, tableClasses.sticky, props.sticky)),
|
|
71364
71422
|
style: tableWrapperStyle
|
|
71365
71423
|
}, selection.getTableProps()), {}, {
|
|
71366
71424
|
ref: tableRef,
|
|
@@ -80080,7 +80138,7 @@ var watermark_interface = __webpack_require__(6640);
|
|
|
80080
80138
|
|
|
80081
80139
|
|
|
80082
80140
|
/* harmony default export */ var src_0 = ({
|
|
80083
|
-
version: '3.10.2-beta.
|
|
80141
|
+
version: '3.10.2-beta.6'
|
|
80084
80142
|
});
|
|
80085
80143
|
}();
|
|
80086
80144
|
/******/ return __webpack_exports__;
|