@sheinx/base 3.7.0-beta.15 → 3.7.0-beta.17
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/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +1 -0
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +6 -10
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +1 -0
- 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/cjs/table/tr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["tr.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI7D,UAAU,OACR,SAAQ,IAAI,CACV,UAAU,EACR,UAAU,GACV,cAAc,GACd,OAAO,GACP,UAAU,GACV,iBAAiB,GACjB,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,QAAQ,GACR,aAAa,GACb,cAAc,GACd,SAAS,GACT,OAAO,GACP,YAAY,GACZ,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,cAAc,GACd,aAAa,GACb,SAAS,CACZ;IACD,GAAG,EAAE;QACH,IAAI,EAAE,GAAG,EAAE,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,C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istFn)(function () {
|
|
82
82
|
if (props.setRowHeight && trRef.current) {
|
|
83
|
+
if (trRef.current.getBoundingClientRect().height === 0) return;
|
|
83
84
|
var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
|
|
84
85
|
props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
|
|
85
86
|
}
|
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/esm/table/tr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["tr.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQvD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAI7D,UAAU,OACR,SAAQ,IAAI,CACV,UAAU,EACR,UAAU,GACV,cAAc,GACd,OAAO,GACP,UAAU,GACV,iBAAiB,GACjB,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,QAAQ,GACR,aAAa,GACb,cAAc,GACd,SAAS,GACT,OAAO,GACP,YAAY,GACZ,cAAc,GACd,WAAW,GACX,iBAAiB,GACjB,YAAY,GACZ,cAAc,GACd,aAAa,GACb,SAAS,CACZ;IACD,GAAG,EAAE;QACH,IAAI,EAAE,GAAG,EAAE,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAA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;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,UAAU,CAAC,eAAe,CAAC,GAAG,SAAS,CAAC;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACtD,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,EAAE,UAAW,OAAO,4CAoazB,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/esm/table/tr.js
CHANGED
|
@@ -74,6 +74,7 @@ var Tr = function Tr(props) {
|
|
|
74
74
|
});
|
|
75
75
|
var setVirtualRowHeight = usePersistFn(function () {
|
|
76
76
|
if (props.setRowHeight && trRef.current) {
|
|
77
|
+
if (trRef.current.getBoundingClientRect().height === 0) return;
|
|
77
78
|
var expandHeight = expandRef.current ? expandRef.current.getBoundingClientRect().height : 0;
|
|
78
79
|
props.setRowHeight(props.rowIndex, trRef.current.getBoundingClientRect().height + expandHeight);
|
|
79
80
|
}
|
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.17",
|
|
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.17",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|