@sheinx/base 3.7.0-beta.15 → 3.7.0-beta.16
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/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +6 -10
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +6 -10
- package/package.json +2 -2
package/cjs/table/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA0oBE"}
|
package/cjs/table/table.js
CHANGED
|
@@ -245,15 +245,11 @@ var _default = exports.default = function _default(props) {
|
|
|
245
245
|
theadAndTfootHeight: context.theadAndTfootHeight
|
|
246
246
|
});
|
|
247
247
|
var syncHeaderScroll = (0, _hooks.usePersistFn)(function (left) {
|
|
248
|
-
var
|
|
248
|
+
var _theadRef$current2;
|
|
249
249
|
if (props.hideHeader || !props.sticky) return;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
if (item.scrollLeft !== left) {
|
|
254
|
-
item.scrollLeft = left;
|
|
255
|
-
}
|
|
256
|
-
});
|
|
250
|
+
if (theadRef && theadRef !== null && theadRef !== void 0 && theadRef.current && theadRef !== null && theadRef !== void 0 && (_theadRef$current2 = theadRef.current) !== null && _theadRef$current2 !== void 0 && _theadRef$current2.parentElement) {
|
|
251
|
+
theadRef.current.parentElement.scrollLeft = left;
|
|
252
|
+
}
|
|
257
253
|
});
|
|
258
254
|
|
|
259
255
|
// 简单表格的滚动事件
|
|
@@ -562,10 +558,10 @@ var _default = exports.default = function _default(props) {
|
|
|
562
558
|
|
|
563
559
|
// handle head and foot scroll
|
|
564
560
|
var handleHeaderWheel = (0, _hooks.usePersistFn)(function (e) {
|
|
565
|
-
var _theadRef$
|
|
561
|
+
var _theadRef$current3;
|
|
566
562
|
var scrollEl = scrollRef.current;
|
|
567
563
|
if (!scrollEl) return;
|
|
568
|
-
if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$
|
|
564
|
+
if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current3 = theadRef.current) !== null && _theadRef$current3 !== void 0 && _theadRef$current3.parentElement)) return;
|
|
569
565
|
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
570
566
|
var scrollLeft = scrollEl.scrollLeft + e.deltaX;
|
|
571
567
|
if (scrollLeft === scrollEl.scrollLeft) {
|
package/esm/table/table.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAgB,UAAU,EAAE,MAAM,cAAc,CAAC;;AAexD,wBA0oBE"}
|
package/esm/table/table.js
CHANGED
|
@@ -238,15 +238,11 @@ export default (function (props) {
|
|
|
238
238
|
theadAndTfootHeight: context.theadAndTfootHeight
|
|
239
239
|
});
|
|
240
240
|
var syncHeaderScroll = usePersistFn(function (left) {
|
|
241
|
-
var
|
|
241
|
+
var _theadRef$current2;
|
|
242
242
|
if (props.hideHeader || !props.sticky) return;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (item.scrollLeft !== left) {
|
|
247
|
-
item.scrollLeft = left;
|
|
248
|
-
}
|
|
249
|
-
});
|
|
243
|
+
if (theadRef && theadRef !== null && theadRef !== void 0 && theadRef.current && theadRef !== null && theadRef !== void 0 && (_theadRef$current2 = theadRef.current) !== null && _theadRef$current2 !== void 0 && _theadRef$current2.parentElement) {
|
|
244
|
+
theadRef.current.parentElement.scrollLeft = left;
|
|
245
|
+
}
|
|
250
246
|
});
|
|
251
247
|
|
|
252
248
|
// 简单表格的滚动事件
|
|
@@ -555,10 +551,10 @@ export default (function (props) {
|
|
|
555
551
|
|
|
556
552
|
// handle head and foot scroll
|
|
557
553
|
var handleHeaderWheel = usePersistFn(function (e) {
|
|
558
|
-
var _theadRef$
|
|
554
|
+
var _theadRef$current3;
|
|
559
555
|
var scrollEl = scrollRef.current;
|
|
560
556
|
if (!scrollEl) return;
|
|
561
|
-
if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$
|
|
557
|
+
if (!(theadRef !== null && theadRef !== void 0 && (_theadRef$current3 = theadRef.current) !== null && _theadRef$current3 !== void 0 && _theadRef$current3.parentElement)) return;
|
|
562
558
|
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
563
559
|
var scrollLeft = scrollEl.scrollLeft + e.deltaX;
|
|
564
560
|
if (scrollLeft === scrollEl.scrollLeft) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheinx/base",
|
|
3
|
-
"version": "3.7.0-beta.
|
|
3
|
+
"version": "3.7.0-beta.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"module": "./esm/index.js",
|
|
11
11
|
"typings": "./cjs/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@sheinx/hooks": "3.7.0-beta.
|
|
13
|
+
"@sheinx/hooks": "3.7.0-beta.16",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|