@sheinx/base 3.7.0-beta.1 → 3.7.0-beta.3
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 +27 -72
- package/cjs/table/tbody.d.ts.map +1 -1
- package/cjs/table/tbody.js +0 -2
- package/cjs/table/tbody.type.d.ts +0 -2
- package/cjs/table/tbody.type.d.ts.map +1 -1
- package/cjs/table/tfoot.d.ts.map +1 -1
- package/cjs/table/tfoot.js +0 -10
- package/cjs/table/tfoot.type.d.ts +0 -2
- package/cjs/table/tfoot.type.d.ts.map +1 -1
- package/cjs/table/thead.d.ts.map +1 -1
- package/cjs/table/thead.js +0 -16
- package/cjs/table/thead.type.d.ts +0 -2
- package/cjs/table/thead.type.d.ts.map +1 -1
- package/cjs/table/tr.d.ts +1 -1
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +0 -10
- package/cjs/virtual-scroll/scroll.d.ts.map +1 -1
- package/cjs/virtual-scroll/scroll.js +4 -4
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +27 -72
- package/esm/table/tbody.d.ts.map +1 -1
- package/esm/table/tbody.js +0 -2
- package/esm/table/tbody.type.d.ts +0 -2
- package/esm/table/tbody.type.d.ts.map +1 -1
- package/esm/table/tfoot.d.ts.map +1 -1
- package/esm/table/tfoot.js +0 -10
- package/esm/table/tfoot.type.d.ts +0 -2
- package/esm/table/tfoot.type.d.ts.map +1 -1
- package/esm/table/thead.d.ts.map +1 -1
- package/esm/table/thead.js +0 -16
- package/esm/table/thead.type.d.ts +0 -2
- package/esm/table/thead.type.d.ts.map +1 -1
- package/esm/table/tr.d.ts +1 -1
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +0 -10
- package/esm/virtual-scroll/scroll.d.ts.map +1 -1
- package/esm/virtual-scroll/scroll.js +4 -4
- 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,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAwB1C,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAwB1C,wBAyhBE"}
|
package/cjs/table/table.js
CHANGED
|
@@ -147,7 +147,6 @@ var _default = exports.default = function _default(props) {
|
|
|
147
147
|
floatRight = _useTableLayout.floatRight,
|
|
148
148
|
width = _useTableLayout.width,
|
|
149
149
|
shouldLastColAuto = _useTableLayout.shouldLastColAuto,
|
|
150
|
-
maxScrollLeft = _useTableLayout.maxScrollLeft,
|
|
151
150
|
scrollBarWidth = _useTableLayout.scrollBarWidth,
|
|
152
151
|
scrollWidth = _useTableLayout.scrollWidth,
|
|
153
152
|
resizeFlag = _useTableLayout.resizeFlag;
|
|
@@ -243,19 +242,6 @@ var _default = exports.default = function _default(props) {
|
|
|
243
242
|
scrollLeft: props.scrollLeft,
|
|
244
243
|
isRtl: isRtl
|
|
245
244
|
});
|
|
246
|
-
|
|
247
|
-
// handle head and foot scroll
|
|
248
|
-
var handleHeaderWheel = (0, _hooks.usePersistFn)(function (e) {
|
|
249
|
-
var scrollEl = scrollRef.current;
|
|
250
|
-
if (!scrollEl) return;
|
|
251
|
-
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
252
|
-
var scrollLeft = scrollEl.scrollLeft + e.deltaX;
|
|
253
|
-
if (scrollLeft === scrollEl.scrollLeft) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
e.preventDefault();
|
|
257
|
-
scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
|
|
258
|
-
});
|
|
259
245
|
var handleBodyScroll = (0, _hooks.usePersistFn)(function (e) {
|
|
260
246
|
var target = e.currentTarget;
|
|
261
247
|
if (!target) return;
|
|
@@ -363,7 +349,6 @@ var _default = exports.default = function _default(props) {
|
|
|
363
349
|
jssStyle: props.jssStyle,
|
|
364
350
|
colgroup: colgroup
|
|
365
351
|
};
|
|
366
|
-
var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
|
|
367
352
|
var StickyWrapper = props.sticky ? _sticky.default : _react.default.Fragment;
|
|
368
353
|
var sticky = _typeof(props.sticky) === 'object' ? props.sticky : {
|
|
369
354
|
top: 0
|
|
@@ -376,7 +361,8 @@ var _default = exports.default = function _default(props) {
|
|
|
376
361
|
parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
|
|
377
362
|
};
|
|
378
363
|
var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
|
|
379
|
-
var headWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper
|
|
364
|
+
var headWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper // isScrollY && scrollBarWidth && tableClasses?.scrollY,
|
|
365
|
+
);
|
|
380
366
|
var footWrapperClass = (0, _classnames.default)(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
|
|
381
367
|
var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
|
|
382
368
|
var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
|
|
@@ -417,22 +403,7 @@ var _default = exports.default = function _default(props) {
|
|
|
417
403
|
if (isRenderVirtualTable) {
|
|
418
404
|
var _props$data4;
|
|
419
405
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
420
|
-
children: [renderHeadMirrorScroller(),
|
|
421
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
422
|
-
className: headWrapperClass,
|
|
423
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
424
|
-
style: {
|
|
425
|
-
width: width,
|
|
426
|
-
transform: "translate3d(".concat(0 - virtualInfo.innerLeft, "px, 0, 0)")
|
|
427
|
-
},
|
|
428
|
-
ref: theadRef,
|
|
429
|
-
children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_thead.default, _objectSpread(_objectSpread({}, headCommonProps), {}, {
|
|
430
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
431
|
-
fixRightNum: fixRightNum
|
|
432
|
-
}))]
|
|
433
|
-
})
|
|
434
|
-
})
|
|
435
|
-
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_scroll.default, {
|
|
406
|
+
children: [renderHeadMirrorScroller(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_scroll.default, {
|
|
436
407
|
style: scrollWrapperStyle,
|
|
437
408
|
scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : emptyStyle,
|
|
438
409
|
wrapperRef: scrollRef,
|
|
@@ -441,7 +412,18 @@ var _default = exports.default = function _default(props) {
|
|
|
441
412
|
onScroll: handleVirtualScroll,
|
|
442
413
|
defaultHeight: context.emptyHeight,
|
|
443
414
|
isScrollY: isScrollY,
|
|
444
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
415
|
+
children: [!props.hideHeader && /*#__PURE__*/(0, _jsxRuntime.jsx)(StickyWrapper, _objectSpread(_objectSpread({}, props.sticky ? stickyProps : {}), {}, {
|
|
416
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
417
|
+
className: headWrapperClass,
|
|
418
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
419
|
+
style: {
|
|
420
|
+
width: width
|
|
421
|
+
},
|
|
422
|
+
ref: theadRef,
|
|
423
|
+
children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_thead.default, _objectSpread({}, headCommonProps))]
|
|
424
|
+
})
|
|
425
|
+
})
|
|
426
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
445
427
|
style: {
|
|
446
428
|
width: width,
|
|
447
429
|
transform: virtualInfo.getTranslate()
|
|
@@ -450,25 +432,19 @@ var _default = exports.default = function _default(props) {
|
|
|
450
432
|
children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_tbody.default, _objectSpread(_objectSpread({}, bodyCommonProps), {}, {
|
|
451
433
|
currentIndex: virtualInfo.startIndex,
|
|
452
434
|
data: virtualInfo.data,
|
|
453
|
-
setRowHeight: virtualInfo.setRowHeight
|
|
454
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
455
|
-
fixRightNum: fixRightNum
|
|
456
|
-
}))]
|
|
457
|
-
})
|
|
458
|
-
}), renderEmpty(), showFoot ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
459
|
-
className: footWrapperClass,
|
|
460
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
461
|
-
style: {
|
|
462
|
-
width: width,
|
|
463
|
-
transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
|
|
464
|
-
},
|
|
465
|
-
ref: tfootRef,
|
|
466
|
-
children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_tfoot.default, _objectSpread(_objectSpread({}, footCommonProps), {}, {
|
|
467
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
468
|
-
fixRightNum: fixRightNum
|
|
435
|
+
setRowHeight: virtualInfo.setRowHeight
|
|
469
436
|
}))]
|
|
470
|
-
})
|
|
471
|
-
|
|
437
|
+
}), showFoot ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
438
|
+
className: footWrapperClass,
|
|
439
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
440
|
+
style: {
|
|
441
|
+
width: width
|
|
442
|
+
},
|
|
443
|
+
ref: tfootRef,
|
|
444
|
+
children: [Group, /*#__PURE__*/(0, _jsxRuntime.jsx)(_tfoot.default, _objectSpread({}, footCommonProps))]
|
|
445
|
+
})
|
|
446
|
+
}) : null]
|
|
447
|
+
}), renderEmpty()]
|
|
472
448
|
});
|
|
473
449
|
}
|
|
474
450
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -505,27 +481,6 @@ var _default = exports.default = function _default(props) {
|
|
|
505
481
|
align: "right"
|
|
506
482
|
}, pagination), paginationInfo));
|
|
507
483
|
};
|
|
508
|
-
(0, _react.useEffect)(function () {
|
|
509
|
-
// 绑定 wheel 事件
|
|
510
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
511
|
-
theadRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
512
|
-
passive: false
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
516
|
-
tfootRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
517
|
-
passive: false
|
|
518
|
-
});
|
|
519
|
-
}
|
|
520
|
-
return function () {
|
|
521
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
522
|
-
theadRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
523
|
-
}
|
|
524
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
525
|
-
tfootRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
526
|
-
}
|
|
527
|
-
};
|
|
528
|
-
}, [theadRef.current, isScrollY]);
|
|
529
484
|
var getRenderIndexByData = function getRenderIndexByData(data) {
|
|
530
485
|
var originKey = typeof data === 'string' ? data : _hooks.util.getKey(props.keygen, data);
|
|
531
486
|
var index = treeData.findIndex(function (item) {
|
package/cjs/table/tbody.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbody.d.ts","sourceRoot":"","sources":["tbody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAEnB,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"tbody.d.ts","sourceRoot":"","sources":["tbody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAEnB,UAAU;AAAjC,wBAuEE"}
|
package/cjs/table/tbody.js
CHANGED
|
@@ -65,8 +65,6 @@ var _default = exports.default = function _default(props) {
|
|
|
65
65
|
isEmptyTree: props.isEmptyTree,
|
|
66
66
|
treeColumnsName: props.treeColumnsName,
|
|
67
67
|
setRowHeight: props.setRowHeight,
|
|
68
|
-
fixLeftNum: props.fixLeftNum,
|
|
69
|
-
fixRightNum: props.fixRightNum,
|
|
70
68
|
striped: props.striped,
|
|
71
69
|
radio: props.radio,
|
|
72
70
|
isCellHover: isCellHover,
|
|
@@ -16,8 +16,6 @@ export interface TbodyProps extends Pick<OptionalToRequired<TableProps<any, any>
|
|
|
16
16
|
isEmptyTree: boolean | undefined;
|
|
17
17
|
treeColumnsName: string | undefined;
|
|
18
18
|
setRowHeight?: (index: number, height: number) => void;
|
|
19
|
-
fixLeftNum?: number;
|
|
20
|
-
fixRightNum?: number;
|
|
21
19
|
bodyScrollWidth?: number;
|
|
22
20
|
resizeFlag?: number;
|
|
23
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbody.type.d.ts","sourceRoot":"","sources":["tbody.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,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foot.d.ts","sourceRoot":"","sources":["tfoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;gCAMhC,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"tfoot.d.ts","sourceRoot":"","sources":["tfoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;gCAMhC,UAAU;AAAjC,wBA4FE"}
|
package/cjs/table/tfoot.js
CHANGED
|
@@ -19,11 +19,6 @@ var _default = exports.default = function _default(props) {
|
|
|
19
19
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
20
20
|
var colgroup = props.colgroup;
|
|
21
21
|
if (fixed === 'left') {
|
|
22
|
-
if (props.fixLeftNum !== undefined) {
|
|
23
|
-
return {
|
|
24
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
22
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
28
23
|
return toNum(a) + toNum(b);
|
|
29
24
|
}, 0);
|
|
@@ -33,11 +28,6 @@ var _default = exports.default = function _default(props) {
|
|
|
33
28
|
};
|
|
34
29
|
}
|
|
35
30
|
if (fixed === 'right') {
|
|
36
|
-
if (props.fixRightNum !== undefined) {
|
|
37
|
-
return {
|
|
38
|
-
transform: "translate3d(-".concat(props.fixRightNum, "px, 0, 0)")
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
31
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
42
32
|
return toNum(a) + toNum(b);
|
|
43
33
|
}, 0);
|
|
@@ -2,8 +2,6 @@ import { TableProps } from './table.type';
|
|
|
2
2
|
import type { OptionalToRequired, TableFormatColumn } from '@sheinx/hooks';
|
|
3
3
|
export { SummaryItem } from './table.type';
|
|
4
4
|
export interface TfootProps extends Pick<OptionalToRequired<TableProps<any, any>>, 'summary' | 'jssStyle'> {
|
|
5
|
-
fixLeftNum?: number;
|
|
6
|
-
fixRightNum?: number;
|
|
7
5
|
columns: TableFormatColumn<any>[];
|
|
8
6
|
colgroup: (number | string | undefined)[];
|
|
9
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tfoot.type.d.ts","sourceRoot":"","sources":["tfoot.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9E,
|
|
1
|
+
{"version":3,"file":"tfoot.type.d.ts","sourceRoot":"","sources":["tfoot.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9E,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CAC3C"}
|
package/cjs/table/thead.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAuTE"}
|
package/cjs/table/thead.js
CHANGED
|
@@ -160,16 +160,9 @@ var _default = exports.default = function _default(props) {
|
|
|
160
160
|
};
|
|
161
161
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan, level) {
|
|
162
162
|
if (fixed === 'left') {
|
|
163
|
-
if (props.fixLeftNum !== undefined) {
|
|
164
|
-
// 这是virtual table场景下的th样式
|
|
165
|
-
return {
|
|
166
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
163
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
170
164
|
return toNum(a) + toNum(b);
|
|
171
165
|
}, 0);
|
|
172
|
-
// 这是base table场景下的th样式
|
|
173
166
|
return {
|
|
174
167
|
left: left,
|
|
175
168
|
top: context.trHeights[level - 1] || 0,
|
|
@@ -177,24 +170,15 @@ var _default = exports.default = function _default(props) {
|
|
|
177
170
|
};
|
|
178
171
|
}
|
|
179
172
|
if (fixed === 'right') {
|
|
180
|
-
if (props.fixRightNum !== undefined) {
|
|
181
|
-
// 这是virtual table场景下的th样式
|
|
182
|
-
return {
|
|
183
|
-
transform: "translate3d(".concat(0 - props.fixRightNum, "px, 0, 0)")
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
173
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
187
174
|
return toNum(a) + toNum(b);
|
|
188
175
|
}, 0);
|
|
189
|
-
// 这是base table场景下的th样式
|
|
190
176
|
return {
|
|
191
177
|
right: right,
|
|
192
178
|
top: context.trHeights[level - 1] || 0,
|
|
193
179
|
position: 'sticky'
|
|
194
180
|
};
|
|
195
181
|
}
|
|
196
|
-
|
|
197
|
-
// 这是base table场景下的非fixed th样式
|
|
198
182
|
return {
|
|
199
183
|
top: context.trHeights[level - 1] || 0,
|
|
200
184
|
position: 'sticky'
|
|
@@ -8,8 +8,6 @@ export interface TheadProps extends Pick<OptionalToRequired<TableProps<any, any>
|
|
|
8
8
|
bordered?: boolean;
|
|
9
9
|
colgroup: (number | string | undefined)[];
|
|
10
10
|
datum: ListDatum;
|
|
11
|
-
fixLeftNum?: number;
|
|
12
|
-
fixRightNum?: number;
|
|
13
11
|
treeColumnsName: string | undefined;
|
|
14
12
|
}
|
|
15
13
|
//# sourceMappingURL=thead.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.type.d.ts","sourceRoot":"","sources":["thead.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjF,MAAM,WAAW,UACf,SAAQ,IAAI,CACR,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EACtC,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,OAAO,GACP,UAAU,GACV,cAAc,GACd,gBAAgB,CACnB,EACD,IAAI,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC,EACzE,IAAI,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAAC,EAC7E,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,WAAW,CAAC;IACzD,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AAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC"}
|
package/cjs/table/tr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableFormatColumn } from '@sheinx/hooks';
|
|
2
2
|
import { TbodyProps, UseTableRowResult } from './tbody.type';
|
|
3
|
-
interface TrProps extends Pick<TbodyProps, 'jssStyle' | 'rowClassName' | 'datum' | 'treeFunc' | 'treeExpandLevel' | 'treeEmptyExpand' | 'expandIcon' | 'treeExpandIcon' | 'loader' | 'isEmptyTree' | 'setRowHeight' | '
|
|
3
|
+
interface TrProps extends Pick<TbodyProps, 'jssStyle' | 'rowClassName' | 'datum' | 'treeFunc' | 'treeExpandLevel' | 'treeEmptyExpand' | 'expandIcon' | 'treeExpandIcon' | 'loader' | 'isEmptyTree' | 'setRowHeight' | 'striped' | 'radio' | 'onRowClick' | 'rowClickAttr' | 'rowEvents' | 'bodyScrollWidth' | 'resizeFlag' | 'treeCheckAll' | 'onCellClick'> {
|
|
4
4
|
row: {
|
|
5
5
|
data: any[];
|
|
6
6
|
colSpan: number;
|
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,
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","s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C,iBAAiB,CAAC,CAAC;IACtD,UAAU,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,EAAE,UAAW,OAAO,4CA4ZzB,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/cjs/table/tr.js
CHANGED
|
@@ -45,11 +45,6 @@ var Tr = function Tr(props) {
|
|
|
45
45
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
46
46
|
if (!props.isScrollX) return;
|
|
47
47
|
if (fixed === 'left') {
|
|
48
|
-
if (props.fixLeftNum !== undefined) {
|
|
49
|
-
return {
|
|
50
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
48
|
var left = props.colgroup.slice(0, index).reduce(function (a, b) {
|
|
54
49
|
return toNum(a) + toNum(b);
|
|
55
50
|
}, 0);
|
|
@@ -59,11 +54,6 @@ var Tr = function Tr(props) {
|
|
|
59
54
|
};
|
|
60
55
|
}
|
|
61
56
|
if (fixed === 'right') {
|
|
62
|
-
if (props.fixRightNum !== undefined) {
|
|
63
|
-
return {
|
|
64
|
-
transform: "translate3d(".concat(0 - props.fixRightNum, "px, 0, 0)")
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
57
|
var right = props.colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
68
58
|
return toNum(a) + toNum(b);
|
|
69
59
|
}, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC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AC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,gBAAgB,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,4CAgIjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -47,13 +47,13 @@ var Scroll = function Scroll(props) {
|
|
|
47
47
|
width: '100%',
|
|
48
48
|
overflow: 'auto'
|
|
49
49
|
};
|
|
50
|
-
var containerStyle =
|
|
50
|
+
var containerStyle = {
|
|
51
51
|
height: '100%',
|
|
52
52
|
width: '100%',
|
|
53
53
|
display: 'inline-flex',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
54
|
+
position: 'sticky',
|
|
55
|
+
top: 0
|
|
56
|
+
};
|
|
57
57
|
|
|
58
58
|
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
|
|
59
59
|
var paddingTop = (0, _react.useMemo)(function () {
|
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,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAwB1C,
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["table.tsx"],"names":[],"mappings":"AAyBA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;;AAwB1C,wBAyhBE"}
|
package/esm/table/table.js
CHANGED
|
@@ -140,7 +140,6 @@ export default (function (props) {
|
|
|
140
140
|
floatRight = _useTableLayout.floatRight,
|
|
141
141
|
width = _useTableLayout.width,
|
|
142
142
|
shouldLastColAuto = _useTableLayout.shouldLastColAuto,
|
|
143
|
-
maxScrollLeft = _useTableLayout.maxScrollLeft,
|
|
144
143
|
scrollBarWidth = _useTableLayout.scrollBarWidth,
|
|
145
144
|
scrollWidth = _useTableLayout.scrollWidth,
|
|
146
145
|
resizeFlag = _useTableLayout.resizeFlag;
|
|
@@ -236,19 +235,6 @@ export default (function (props) {
|
|
|
236
235
|
scrollLeft: props.scrollLeft,
|
|
237
236
|
isRtl: isRtl
|
|
238
237
|
});
|
|
239
|
-
|
|
240
|
-
// handle head and foot scroll
|
|
241
|
-
var handleHeaderWheel = usePersistFn(function (e) {
|
|
242
|
-
var scrollEl = scrollRef.current;
|
|
243
|
-
if (!scrollEl) return;
|
|
244
|
-
var max = scrollEl.scrollWidth - scrollEl.clientWidth;
|
|
245
|
-
var scrollLeft = scrollEl.scrollLeft + e.deltaX;
|
|
246
|
-
if (scrollLeft === scrollEl.scrollLeft) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
e.preventDefault();
|
|
250
|
-
scrollEl.scrollLeft = Math.min(Math.max(scrollLeft, 0), max);
|
|
251
|
-
});
|
|
252
238
|
var handleBodyScroll = usePersistFn(function (e) {
|
|
253
239
|
var target = e.currentTarget;
|
|
254
240
|
if (!target) return;
|
|
@@ -356,7 +342,6 @@ export default (function (props) {
|
|
|
356
342
|
jssStyle: props.jssStyle,
|
|
357
343
|
colgroup: colgroup
|
|
358
344
|
};
|
|
359
|
-
var fixRightNum = (isRtl ? -1 * maxScrollLeft : maxScrollLeft) - virtualInfo.innerLeft;
|
|
360
345
|
var StickyWrapper = props.sticky ? Sticky : React.Fragment;
|
|
361
346
|
var sticky = _typeof(props.sticky) === 'object' ? props.sticky : {
|
|
362
347
|
top: 0
|
|
@@ -369,7 +354,8 @@ export default (function (props) {
|
|
|
369
354
|
parent: tableRef === null || tableRef === void 0 ? void 0 : tableRef.current
|
|
370
355
|
};
|
|
371
356
|
var isRenderVirtualTable = virtual || props.sticky || !((_props$data3 = props.data) !== null && _props$data3 !== void 0 && _props$data3.length);
|
|
372
|
-
var headWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper
|
|
357
|
+
var headWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.headWrapper // isScrollY && scrollBarWidth && tableClasses?.scrollY,
|
|
358
|
+
);
|
|
373
359
|
var footWrapperClass = classNames(tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.footWrapper, isScrollY && scrollBarWidth && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.scrollY));
|
|
374
360
|
var renderHeadMirrorScroller = function renderHeadMirrorScroller() {
|
|
375
361
|
var _scrollRef$current, _scrollRef$current2, _scrollRef$current3;
|
|
@@ -410,22 +396,7 @@ export default (function (props) {
|
|
|
410
396
|
if (isRenderVirtualTable) {
|
|
411
397
|
var _props$data4;
|
|
412
398
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
413
|
-
children: [renderHeadMirrorScroller(),
|
|
414
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
415
|
-
className: headWrapperClass,
|
|
416
|
-
children: /*#__PURE__*/_jsxs("table", {
|
|
417
|
-
style: {
|
|
418
|
-
width: width,
|
|
419
|
-
transform: "translate3d(".concat(0 - virtualInfo.innerLeft, "px, 0, 0)")
|
|
420
|
-
},
|
|
421
|
-
ref: theadRef,
|
|
422
|
-
children: [Group, /*#__PURE__*/_jsx(Thead, _objectSpread(_objectSpread({}, headCommonProps), {}, {
|
|
423
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
424
|
-
fixRightNum: fixRightNum
|
|
425
|
-
}))]
|
|
426
|
-
})
|
|
427
|
-
})
|
|
428
|
-
})), /*#__PURE__*/_jsx(Scroll, {
|
|
399
|
+
children: [renderHeadMirrorScroller(), /*#__PURE__*/_jsxs(Scroll, {
|
|
429
400
|
style: scrollWrapperStyle,
|
|
430
401
|
scrollerStyle: (_props$data4 = props.data) !== null && _props$data4 !== void 0 && _props$data4.length ? virtualScrollerStyle : emptyStyle,
|
|
431
402
|
wrapperRef: scrollRef,
|
|
@@ -434,7 +405,18 @@ export default (function (props) {
|
|
|
434
405
|
onScroll: handleVirtualScroll,
|
|
435
406
|
defaultHeight: context.emptyHeight,
|
|
436
407
|
isScrollY: isScrollY,
|
|
437
|
-
children: /*#__PURE__*/
|
|
408
|
+
children: [!props.hideHeader && /*#__PURE__*/_jsx(StickyWrapper, _objectSpread(_objectSpread({}, props.sticky ? stickyProps : {}), {}, {
|
|
409
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
410
|
+
className: headWrapperClass,
|
|
411
|
+
children: /*#__PURE__*/_jsxs("table", {
|
|
412
|
+
style: {
|
|
413
|
+
width: width
|
|
414
|
+
},
|
|
415
|
+
ref: theadRef,
|
|
416
|
+
children: [Group, /*#__PURE__*/_jsx(Thead, _objectSpread({}, headCommonProps))]
|
|
417
|
+
})
|
|
418
|
+
})
|
|
419
|
+
})), /*#__PURE__*/_jsxs("table", {
|
|
438
420
|
style: {
|
|
439
421
|
width: width,
|
|
440
422
|
transform: virtualInfo.getTranslate()
|
|
@@ -443,25 +425,19 @@ export default (function (props) {
|
|
|
443
425
|
children: [Group, /*#__PURE__*/_jsx(Tbody, _objectSpread(_objectSpread({}, bodyCommonProps), {}, {
|
|
444
426
|
currentIndex: virtualInfo.startIndex,
|
|
445
427
|
data: virtualInfo.data,
|
|
446
|
-
setRowHeight: virtualInfo.setRowHeight
|
|
447
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
448
|
-
fixRightNum: fixRightNum
|
|
449
|
-
}))]
|
|
450
|
-
})
|
|
451
|
-
}), renderEmpty(), showFoot ? /*#__PURE__*/_jsx("div", {
|
|
452
|
-
className: footWrapperClass,
|
|
453
|
-
children: /*#__PURE__*/_jsxs("table", {
|
|
454
|
-
style: {
|
|
455
|
-
width: width,
|
|
456
|
-
transform: "translate3d(-".concat(virtualInfo.innerLeft, "px, 0, 0)")
|
|
457
|
-
},
|
|
458
|
-
ref: tfootRef,
|
|
459
|
-
children: [Group, /*#__PURE__*/_jsx(Tfoot, _objectSpread(_objectSpread({}, footCommonProps), {}, {
|
|
460
|
-
fixLeftNum: virtualInfo.innerLeft,
|
|
461
|
-
fixRightNum: fixRightNum
|
|
428
|
+
setRowHeight: virtualInfo.setRowHeight
|
|
462
429
|
}))]
|
|
463
|
-
})
|
|
464
|
-
|
|
430
|
+
}), showFoot ? /*#__PURE__*/_jsx("div", {
|
|
431
|
+
className: footWrapperClass,
|
|
432
|
+
children: /*#__PURE__*/_jsxs("table", {
|
|
433
|
+
style: {
|
|
434
|
+
width: width
|
|
435
|
+
},
|
|
436
|
+
ref: tfootRef,
|
|
437
|
+
children: [Group, /*#__PURE__*/_jsx(Tfoot, _objectSpread({}, footCommonProps))]
|
|
438
|
+
})
|
|
439
|
+
}) : null]
|
|
440
|
+
}), renderEmpty()]
|
|
465
441
|
});
|
|
466
442
|
}
|
|
467
443
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -498,27 +474,6 @@ export default (function (props) {
|
|
|
498
474
|
align: "right"
|
|
499
475
|
}, pagination), paginationInfo));
|
|
500
476
|
};
|
|
501
|
-
useEffect(function () {
|
|
502
|
-
// 绑定 wheel 事件
|
|
503
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
504
|
-
theadRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
505
|
-
passive: false
|
|
506
|
-
});
|
|
507
|
-
}
|
|
508
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
509
|
-
tfootRef.current.parentElement.addEventListener('wheel', handleHeaderWheel, {
|
|
510
|
-
passive: false
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
return function () {
|
|
514
|
-
if (theadRef.current && theadRef.current.parentElement) {
|
|
515
|
-
theadRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
516
|
-
}
|
|
517
|
-
if (tfootRef.current && tfootRef.current.parentElement) {
|
|
518
|
-
tfootRef.current.parentElement.removeEventListener('wheel', handleHeaderWheel);
|
|
519
|
-
}
|
|
520
|
-
};
|
|
521
|
-
}, [theadRef.current, isScrollY]);
|
|
522
477
|
var getRenderIndexByData = function getRenderIndexByData(data) {
|
|
523
478
|
var originKey = typeof data === 'string' ? data : util.getKey(props.keygen, data);
|
|
524
479
|
var index = treeData.findIndex(function (item) {
|
package/esm/table/tbody.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbody.d.ts","sourceRoot":"","sources":["tbody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAEnB,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"tbody.d.ts","sourceRoot":"","sources":["tbody.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAEnB,UAAU;AAAjC,wBAuEE"}
|
package/esm/table/tbody.js
CHANGED
|
@@ -58,8 +58,6 @@ export default (function (props) {
|
|
|
58
58
|
isEmptyTree: props.isEmptyTree,
|
|
59
59
|
treeColumnsName: props.treeColumnsName,
|
|
60
60
|
setRowHeight: props.setRowHeight,
|
|
61
|
-
fixLeftNum: props.fixLeftNum,
|
|
62
|
-
fixRightNum: props.fixRightNum,
|
|
63
61
|
striped: props.striped,
|
|
64
62
|
radio: props.radio,
|
|
65
63
|
isCellHover: isCellHover,
|
|
@@ -16,8 +16,6 @@ export interface TbodyProps extends Pick<OptionalToRequired<TableProps<any, any>
|
|
|
16
16
|
isEmptyTree: boolean | undefined;
|
|
17
17
|
treeColumnsName: string | undefined;
|
|
18
18
|
setRowHeight?: (index: number, height: number) => void;
|
|
19
|
-
fixLeftNum?: number;
|
|
20
|
-
fixRightNum?: number;
|
|
21
19
|
bodyScrollWidth?: number;
|
|
22
20
|
resizeFlag?: number;
|
|
23
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tbody.type.d.ts","sourceRoot":"","sources":["tbody.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE3E,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAClE,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAE/D,MAAM,WAAW,UACf,SAAQ,IAAI,CACV,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EACtC,MAAM,GACN,UAAU,GACV,cAAc,GACd,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,YAAY,GACZ,cAAc,GACd,WAAW,GACX,UAAU,GACV,OAAO,GACP,cAAc,GACd,aAAa,CAChB;IACD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS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,CAAC;IAClC,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,gBAAgB,CAAC,eAAe,CAAC,CAAC;IACjD,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAChC,eAAe,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAClD,WAAW,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/esm/table/tfoot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tfoot.d.ts","sourceRoot":"","sources":["tfoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;gCAMhC,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"tfoot.d.ts","sourceRoot":"","sources":["tfoot.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAe,MAAM,cAAc,CAAC;gCAMhC,UAAU;AAAjC,wBA4FE"}
|
package/esm/table/tfoot.js
CHANGED
|
@@ -12,11 +12,6 @@ export default (function (props) {
|
|
|
12
12
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
13
13
|
var colgroup = props.colgroup;
|
|
14
14
|
if (fixed === 'left') {
|
|
15
|
-
if (props.fixLeftNum !== undefined) {
|
|
16
|
-
return {
|
|
17
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
15
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
21
16
|
return toNum(a) + toNum(b);
|
|
22
17
|
}, 0);
|
|
@@ -26,11 +21,6 @@ export default (function (props) {
|
|
|
26
21
|
};
|
|
27
22
|
}
|
|
28
23
|
if (fixed === 'right') {
|
|
29
|
-
if (props.fixRightNum !== undefined) {
|
|
30
|
-
return {
|
|
31
|
-
transform: "translate3d(-".concat(props.fixRightNum, "px, 0, 0)")
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
24
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
35
25
|
return toNum(a) + toNum(b);
|
|
36
26
|
}, 0);
|
|
@@ -2,8 +2,6 @@ import { TableProps } from './table.type';
|
|
|
2
2
|
import type { OptionalToRequired, TableFormatColumn } from '@sheinx/hooks';
|
|
3
3
|
export { SummaryItem } from './table.type';
|
|
4
4
|
export interface TfootProps extends Pick<OptionalToRequired<TableProps<any, any>>, 'summary' | 'jssStyle'> {
|
|
5
|
-
fixLeftNum?: number;
|
|
6
|
-
fixRightNum?: number;
|
|
7
5
|
columns: TableFormatColumn<any>[];
|
|
8
6
|
colgroup: (number | string | undefined)[];
|
|
9
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tfoot.type.d.ts","sourceRoot":"","sources":["tfoot.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9E,
|
|
1
|
+
{"version":3,"file":"tfoot.type.d.ts","sourceRoot":"","sources":["tfoot.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9E,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;CAC3C"}
|
package/esm/table/thead.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,
|
|
1
|
+
{"version":3,"file":"thead.d.ts","sourceRoot":"","sources":["thead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;gCAWnB,UAAU;AAAjC,wBAuTE"}
|
package/esm/table/thead.js
CHANGED
|
@@ -153,16 +153,9 @@ export default (function (props) {
|
|
|
153
153
|
};
|
|
154
154
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan, level) {
|
|
155
155
|
if (fixed === 'left') {
|
|
156
|
-
if (props.fixLeftNum !== undefined) {
|
|
157
|
-
// 这是virtual table场景下的th样式
|
|
158
|
-
return {
|
|
159
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
156
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
163
157
|
return toNum(a) + toNum(b);
|
|
164
158
|
}, 0);
|
|
165
|
-
// 这是base table场景下的th样式
|
|
166
159
|
return {
|
|
167
160
|
left: left,
|
|
168
161
|
top: context.trHeights[level - 1] || 0,
|
|
@@ -170,24 +163,15 @@ export default (function (props) {
|
|
|
170
163
|
};
|
|
171
164
|
}
|
|
172
165
|
if (fixed === 'right') {
|
|
173
|
-
if (props.fixRightNum !== undefined) {
|
|
174
|
-
// 这是virtual table场景下的th样式
|
|
175
|
-
return {
|
|
176
|
-
transform: "translate3d(".concat(0 - props.fixRightNum, "px, 0, 0)")
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
166
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
180
167
|
return toNum(a) + toNum(b);
|
|
181
168
|
}, 0);
|
|
182
|
-
// 这是base table场景下的th样式
|
|
183
169
|
return {
|
|
184
170
|
right: right,
|
|
185
171
|
top: context.trHeights[level - 1] || 0,
|
|
186
172
|
position: 'sticky'
|
|
187
173
|
};
|
|
188
174
|
}
|
|
189
|
-
|
|
190
|
-
// 这是base table场景下的非fixed th样式
|
|
191
175
|
return {
|
|
192
176
|
top: context.trHeights[level - 1] || 0,
|
|
193
177
|
position: 'sticky'
|
|
@@ -8,8 +8,6 @@ export interface TheadProps extends Pick<OptionalToRequired<TableProps<any, any>
|
|
|
8
8
|
bordered?: boolean;
|
|
9
9
|
colgroup: (number | string | undefined)[];
|
|
10
10
|
datum: ListDatum;
|
|
11
|
-
fixLeftNum?: number;
|
|
12
|
-
fixRightNum?: number;
|
|
13
11
|
treeColumnsName: string | undefined;
|
|
14
12
|
}
|
|
15
13
|
//# sourceMappingURL=thead.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thead.type.d.ts","sourceRoot":"","sources":["thead.type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,e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C,CAAC,MAAM,CAAC,CAAC;AAEjF,MAAM,WAAW,UACf,SAAQ,IAAI,CACR,kBAAkB,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EACtC,MAAM,GACN,UAAU,GACV,gBAAgB,GAChB,iBAAiB,GACjB,eAAe,GACf,cAAc,GACd,OAAO,GACP,UAAU,GACV,cAAc,GACd,gBAAgB,CACnB,EACD,IAAI,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,GAAG,gBAAgB,CAAC,EACzE,IAAI,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,gBAAgB,CAAC,EAC7E,IAAI,CAAC,wBAAwB,EAAE,SAAS,GAAG,WAAW,CAAC;IACzD,OAAO,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;IAC1C,KAAK,EAAE,SAAS,CAAC;IACjB,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC"}
|
package/esm/table/tr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableFormatColumn } from '@sheinx/hooks';
|
|
2
2
|
import { TbodyProps, UseTableRowResult } from './tbody.type';
|
|
3
|
-
interface TrProps extends Pick<TbodyProps, 'jssStyle' | 'rowClassName' | 'datum' | 'treeFunc' | 'treeExpandLevel' | 'treeEmptyExpand' | 'expandIcon' | 'treeExpandIcon' | 'loader' | 'isEmptyTree' | 'setRowHeight' | '
|
|
3
|
+
interface TrProps extends Pick<TbodyProps, 'jssStyle' | 'rowClassName' | 'datum' | 'treeFunc' | 'treeExpandLevel' | 'treeEmptyExpand' | 'expandIcon' | 'treeExpandIcon' | 'loader' | 'isEmptyTree' | 'setRowHeight' | 'striped' | 'radio' | 'onRowClick' | 'rowClickAttr' | 'rowEvents' | 'bodyScrollWidth' | 'resizeFlag' | 'treeCheckAll' | 'onCellClick'> {
|
|
4
4
|
row: {
|
|
5
5
|
data: any[];
|
|
6
6
|
colSpan: number;
|
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,
|
|
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,CAChB;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,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,WAAW,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC9C,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;CACpB;AAED,QAAA,MAAM,EAAE,UAAW,OAAO,4CA4ZzB,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/esm/table/tr.js
CHANGED
|
@@ -39,11 +39,6 @@ var Tr = function Tr(props) {
|
|
|
39
39
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
40
40
|
if (!props.isScrollX) return;
|
|
41
41
|
if (fixed === 'left') {
|
|
42
|
-
if (props.fixLeftNum !== undefined) {
|
|
43
|
-
return {
|
|
44
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
42
|
var left = props.colgroup.slice(0, index).reduce(function (a, b) {
|
|
48
43
|
return toNum(a) + toNum(b);
|
|
49
44
|
}, 0);
|
|
@@ -53,11 +48,6 @@ var Tr = function Tr(props) {
|
|
|
53
48
|
};
|
|
54
49
|
}
|
|
55
50
|
if (fixed === 'right') {
|
|
56
|
-
if (props.fixRightNum !== undefined) {
|
|
57
|
-
return {
|
|
58
|
-
transform: "translate3d(".concat(0 - props.fixRightNum, "px, 0, 0)")
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
51
|
var right = props.colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
62
52
|
return toNum(a) + toNum(b);
|
|
63
53
|
}, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["scroll.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,UAAU,WAAW;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,QAAQ,EAAE,OAAO,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,KAAK,IAAI,CAAC;IACX,gBAAgB,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC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B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,MAAM,UAAW,WAAW,4CAgIjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -40,13 +40,13 @@ var Scroll = function Scroll(props) {
|
|
|
40
40
|
width: '100%',
|
|
41
41
|
overflow: 'auto'
|
|
42
42
|
};
|
|
43
|
-
var containerStyle =
|
|
43
|
+
var containerStyle = {
|
|
44
44
|
height: '100%',
|
|
45
45
|
width: '100%',
|
|
46
46
|
display: 'inline-flex',
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
position: 'sticky',
|
|
48
|
+
top: 0
|
|
49
|
+
};
|
|
50
50
|
|
|
51
51
|
// 当滚动容器的高度为 0 时,paddingTop 为 0,避免滚动条抖动现象
|
|
52
52
|
var paddingTop = useMemo(function () {
|
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.3",
|
|
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.3",
|
|
14
14
|
"immer": "^10.0.0",
|
|
15
15
|
"classnames": "^2.0.0",
|
|
16
16
|
"@shined/reactive": "^0.1.3-alpha.0"
|