@sheinx/base 3.6.4-beta.8 → 3.7.0-beta.10
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/popover/popover.d.ts +1 -1
- package/cjs/popover/popover.d.ts.map +1 -1
- package/cjs/popover/popover.js +10 -8
- package/cjs/popover/popover.type.d.ts +6 -0
- package/cjs/popover/popover.type.d.ts.map +1 -1
- package/cjs/sticky/sticky.d.ts.map +1 -1
- package/cjs/sticky/sticky.js +6 -3
- package/cjs/sticky/sticky.type.d.ts +2 -2
- package/cjs/sticky/sticky.type.d.ts.map +1 -1
- package/cjs/table/table.d.ts.map +1 -1
- package/cjs/table/table.js +156 -98
- package/cjs/table/table.type.d.ts +15 -2
- package/cjs/table/table.type.d.ts.map +1 -1
- package/cjs/table/tbody.d.ts +1 -1
- package/cjs/table/tbody.d.ts.map +1 -1
- package/cjs/table/tbody.js +28 -10
- package/cjs/table/tbody.type.d.ts +2 -3
- package/cjs/table/tbody.type.d.ts.map +1 -1
- package/cjs/table/td.d.ts +21 -0
- package/cjs/table/td.d.ts.map +1 -0
- package/cjs/table/td.js +74 -0
- 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 +7 -19
- 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 -2
- package/cjs/table/tr.d.ts.map +1 -1
- package/cjs/table/tr.js +33 -29
- package/cjs/tabs/tabs.d.ts.map +1 -1
- package/cjs/tabs/tabs.js +10 -1
- package/cjs/tabs/tabs.type.d.ts +6 -0
- package/cjs/tabs/tabs.type.d.ts.map +1 -1
- package/cjs/tag/tag.d.ts.map +1 -1
- package/cjs/tag/tag.js +1 -1
- package/cjs/tooltip/tooltip.d.ts.map +1 -1
- package/cjs/tooltip/tooltip.js +10 -2
- package/cjs/virtual-scroll/scroll-table.d.ts +28 -0
- package/cjs/virtual-scroll/scroll-table.d.ts.map +1 -0
- package/cjs/virtual-scroll/scroll-table.js +155 -0
- package/cjs/virtual-scroll/scroll.d.ts.map +1 -1
- package/cjs/virtual-scroll/scroll.js +4 -4
- package/esm/popover/popover.d.ts +1 -1
- package/esm/popover/popover.d.ts.map +1 -1
- package/esm/popover/popover.js +10 -8
- package/esm/popover/popover.type.d.ts +6 -0
- package/esm/popover/popover.type.d.ts.map +1 -1
- package/esm/sticky/sticky.d.ts.map +1 -1
- package/esm/sticky/sticky.js +6 -3
- package/esm/sticky/sticky.type.d.ts +2 -2
- package/esm/sticky/sticky.type.d.ts.map +1 -1
- package/esm/table/table.d.ts.map +1 -1
- package/esm/table/table.js +157 -99
- package/esm/table/table.type.d.ts +15 -2
- package/esm/table/table.type.d.ts.map +1 -1
- package/esm/table/tbody.d.ts +1 -1
- package/esm/table/tbody.d.ts.map +1 -1
- package/esm/table/tbody.js +29 -11
- package/esm/table/tbody.type.d.ts +2 -3
- package/esm/table/tbody.type.d.ts.map +1 -1
- package/esm/table/td.d.ts +21 -0
- package/esm/table/td.d.ts.map +1 -0
- package/esm/table/td.js +66 -0
- 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 +7 -19
- 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 -2
- package/esm/table/tr.d.ts.map +1 -1
- package/esm/table/tr.js +33 -29
- package/esm/tabs/tabs.d.ts.map +1 -1
- package/esm/tabs/tabs.js +10 -1
- package/esm/tabs/tabs.type.d.ts +6 -0
- package/esm/tabs/tabs.type.d.ts.map +1 -1
- package/esm/tag/tag.d.ts.map +1 -1
- package/esm/tag/tag.js +1 -1
- package/esm/tooltip/tooltip.d.ts.map +1 -1
- package/esm/tooltip/tooltip.js +11 -3
- package/esm/virtual-scroll/scroll-table.d.ts +28 -0
- package/esm/virtual-scroll/scroll-table.d.ts.map +1 -0
- package/esm/virtual-scroll/scroll-table.js +148 -0
- package/esm/virtual-scroll/scroll.d.ts.map +1 -1
- package/esm/virtual-scroll/scroll.js +4 -4
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { shouldCellUpdate } from '@sheinx/hooks';
|
|
3
|
+
import type { TableFormatColumn } from '@sheinx/hooks';
|
|
4
|
+
interface TdProps<T> {
|
|
5
|
+
col: TableFormatColumn<any>;
|
|
6
|
+
data: any[];
|
|
7
|
+
colSpan: number;
|
|
8
|
+
rowSpan: number;
|
|
9
|
+
className: string;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
direction: 'ltr' | 'rtl';
|
|
12
|
+
role?: string;
|
|
13
|
+
onMouseEnter?: () => void;
|
|
14
|
+
onMouseLeave?: () => void;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
shouldCellUpdate?: shouldCellUpdate<T>;
|
|
17
|
+
renderContent: (col: TableFormatColumn<any>, data: any[]) => React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export default function Td<T>(props: TdProps<T>): JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=td.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"td.d.ts","sourceRoot":"","sources":["td.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAA0B,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,UAAU,OAAO,CAAC,CAAC;IACjB,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACvC,aAAa,EAAE,CAAC,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,KAAK,CAAC,SAAS,CAAC;CAC9E;AAED,MAAM,CAAC,OAAO,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAiF5D"}
|
package/esm/table/td.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
6
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
import React, { useEffect } from 'react';
|
|
13
|
+
import { useComponentMemo, util } from '@sheinx/hooks';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
export default function Td(props) {
|
|
16
|
+
var _React$useState = React.useState(),
|
|
17
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
18
|
+
style = _React$useState2[0],
|
|
19
|
+
setStyle = _React$useState2[1];
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
if (!props.style) return;
|
|
22
|
+
if (util.shallowEqual(props.style, style)) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
setStyle(props.style);
|
|
26
|
+
}, [props.style]);
|
|
27
|
+
var col = props.col,
|
|
28
|
+
colSpan = props.colSpan,
|
|
29
|
+
rowSpan = props.rowSpan,
|
|
30
|
+
className = props.className,
|
|
31
|
+
direction = props.direction,
|
|
32
|
+
role = props.role,
|
|
33
|
+
data = props.data,
|
|
34
|
+
onClick = props.onClick,
|
|
35
|
+
onMouseEnter = props.onMouseEnter,
|
|
36
|
+
onMouseLeave = props.onMouseLeave,
|
|
37
|
+
renderContent = props.renderContent;
|
|
38
|
+
var externalDependencies = _typeof(props.shouldCellUpdate) === 'object' && props.shouldCellUpdate.dependencies ? props.shouldCellUpdate.dependencies : [];
|
|
39
|
+
var updateFn = _typeof(props.shouldCellUpdate) === 'object' && 'update' in props.shouldCellUpdate ? props.shouldCellUpdate.update : props.shouldCellUpdate;
|
|
40
|
+
var $td = useComponentMemo(function () {
|
|
41
|
+
var content = renderContent(props.col, props.data);
|
|
42
|
+
return /*#__PURE__*/_jsx("td", {
|
|
43
|
+
colSpan: colSpan,
|
|
44
|
+
rowSpan: rowSpan,
|
|
45
|
+
onMouseEnter: onMouseEnter,
|
|
46
|
+
onMouseLeave: onMouseLeave,
|
|
47
|
+
className: className,
|
|
48
|
+
style: style,
|
|
49
|
+
dir: direction,
|
|
50
|
+
"data-role": role,
|
|
51
|
+
onClick: onClick,
|
|
52
|
+
children: content
|
|
53
|
+
}, col.key);
|
|
54
|
+
}, [data, className, style, col.type, col.treeColumnsName].concat(_toConsumableArray(externalDependencies)), updateFn ? function (prev, next) {
|
|
55
|
+
if (col.type || col.treeColumnsName) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
return prev.some(function (_, index) {
|
|
59
|
+
if (index === 0) {
|
|
60
|
+
return updateFn(prev[index], next[index]);
|
|
61
|
+
}
|
|
62
|
+
return !util.shallowEqual(prev[index], next[index]);
|
|
63
|
+
});
|
|
64
|
+
} : undefined);
|
|
65
|
+
return $td;
|
|
66
|
+
}
|
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,wBAyTE"}
|
package/esm/table/thead.js
CHANGED
|
@@ -152,44 +152,32 @@ export default (function (props) {
|
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
154
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan, level) {
|
|
155
|
+
// 累加level 至 0 的所有高度
|
|
156
|
+
var top = context.trHeights.slice(0, level).reduce(function (a, b) {
|
|
157
|
+
return toNum(a) + toNum(b);
|
|
158
|
+
}, 0);
|
|
155
159
|
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
160
|
var left = colgroup.slice(0, index).reduce(function (a, b) {
|
|
163
161
|
return toNum(a) + toNum(b);
|
|
164
162
|
}, 0);
|
|
165
|
-
// 这是base table场景下的th样式
|
|
166
163
|
return {
|
|
167
164
|
left: left,
|
|
168
|
-
top:
|
|
165
|
+
top: top,
|
|
169
166
|
position: 'sticky'
|
|
170
167
|
};
|
|
171
168
|
}
|
|
172
169
|
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
170
|
var right = colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
180
171
|
return toNum(a) + toNum(b);
|
|
181
172
|
}, 0);
|
|
182
|
-
// 这是base table场景下的th样式
|
|
183
173
|
return {
|
|
184
174
|
right: right,
|
|
185
|
-
top:
|
|
175
|
+
top: top,
|
|
186
176
|
position: 'sticky'
|
|
187
177
|
};
|
|
188
178
|
}
|
|
189
|
-
|
|
190
|
-
// 这是base table场景下的非fixed th样式
|
|
191
179
|
return {
|
|
192
|
-
top:
|
|
180
|
+
top: top,
|
|
193
181
|
position: 'sticky'
|
|
194
182
|
};
|
|
195
183
|
};
|
|
@@ -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,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AC,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' | 'shouldCellUpdate'> {
|
|
4
4
|
row: {
|
|
5
5
|
data: any[];
|
|
6
6
|
colSpan: number;
|
|
@@ -17,7 +17,6 @@ interface TrProps extends Pick<TbodyProps, 'jssStyle' | 'rowClassName' | 'datum'
|
|
|
17
17
|
handleExpandClick: (col: TableFormatColumn<any>, data: any, index: number) => void;
|
|
18
18
|
treeColumnsName?: string;
|
|
19
19
|
originKey: string | number;
|
|
20
|
-
isCellHover: UseTableRowResult['isCellHover'];
|
|
21
20
|
hover?: boolean;
|
|
22
21
|
handleCellHover: UseTableRowResult['handleCellHover'];
|
|
23
22
|
hoverIndex: UseTableRowResult['hoverIndex'];
|
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;
|
|
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,kBAAkB,CACrB;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,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,4CAkazB,CAAC;AAEF,eAAe,EAAE,CAAC"}
|
package/esm/table/tr.js
CHANGED
|
@@ -21,6 +21,7 @@ import Spin from "../spin";
|
|
|
21
21
|
import Icons from "../icons";
|
|
22
22
|
import Checkbox from "../checkbox";
|
|
23
23
|
import Radio from "../radio";
|
|
24
|
+
import Td from "./td";
|
|
24
25
|
import { useConfig } from "../config";
|
|
25
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -38,11 +39,6 @@ var Tr = function Tr(props) {
|
|
|
38
39
|
var getFixedStyle = function getFixedStyle(fixed, index, colSpan) {
|
|
39
40
|
if (!props.isScrollX) return;
|
|
40
41
|
if (fixed === 'left') {
|
|
41
|
-
if (props.fixLeftNum !== undefined) {
|
|
42
|
-
return {
|
|
43
|
-
transform: "translate3d(".concat(props.fixLeftNum, "px, 0, 0)")
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
42
|
var left = props.colgroup.slice(0, index).reduce(function (a, b) {
|
|
47
43
|
return toNum(a) + toNum(b);
|
|
48
44
|
}, 0);
|
|
@@ -52,11 +48,6 @@ var Tr = function Tr(props) {
|
|
|
52
48
|
};
|
|
53
49
|
}
|
|
54
50
|
if (fixed === 'right') {
|
|
55
|
-
if (props.fixRightNum !== undefined) {
|
|
56
|
-
return {
|
|
57
|
-
transform: "translate3d(".concat(0 - props.fixRightNum, "px, 0, 0)")
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
51
|
var right = props.colgroup.slice(index + colSpan).reduce(function (a, b) {
|
|
61
52
|
return toNum(a) + toNum(b);
|
|
62
53
|
}, 0);
|
|
@@ -65,13 +56,14 @@ var Tr = function Tr(props) {
|
|
|
65
56
|
right: right
|
|
66
57
|
};
|
|
67
58
|
}
|
|
68
|
-
return
|
|
59
|
+
return undefined;
|
|
69
60
|
};
|
|
70
|
-
var getTdStyle = function
|
|
61
|
+
var getTdStyle = usePersistFn(function (column, colSpan) {
|
|
71
62
|
var index = column.index;
|
|
72
63
|
var fixedStyle = getFixedStyle(column.fixed, index, colSpan);
|
|
64
|
+
if (!fixedStyle && !column.style) return;
|
|
73
65
|
return _objectSpread(_objectSpread({}, column.style), fixedStyle);
|
|
74
|
-
};
|
|
66
|
+
});
|
|
75
67
|
var handleCellClick = usePersistFn(function (data, colIndex) {
|
|
76
68
|
if (!props.onCellClick) return;
|
|
77
69
|
props.onCellClick(data, {
|
|
@@ -134,7 +126,7 @@ var Tr = function Tr(props) {
|
|
|
134
126
|
return _ref.apply(this, arguments);
|
|
135
127
|
};
|
|
136
128
|
}());
|
|
137
|
-
var renderTreeExpand = function
|
|
129
|
+
var renderTreeExpand = usePersistFn(function (content) {
|
|
138
130
|
var treeIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 22;
|
|
139
131
|
var level = props.treeExpandLevel.get(props.originKey) || 0;
|
|
140
132
|
var className = tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.expandWrapper;
|
|
@@ -187,8 +179,8 @@ var Tr = function Tr(props) {
|
|
|
187
179
|
},
|
|
188
180
|
children: [$expandIconWrapper, content]
|
|
189
181
|
});
|
|
190
|
-
};
|
|
191
|
-
var renderContent = function
|
|
182
|
+
});
|
|
183
|
+
var renderContent = usePersistFn(function (col, data) {
|
|
192
184
|
if (col.type === 'expand' || col.type === 'row-expand') {
|
|
193
185
|
var renderResult = typeof col.render === 'function' ? col.render(props.rawData, props.rowIndex) : undefined;
|
|
194
186
|
if (typeof renderResult !== 'function') return null;
|
|
@@ -254,8 +246,8 @@ var Tr = function Tr(props) {
|
|
|
254
246
|
return renderTreeExpand(content, col.treeIndent);
|
|
255
247
|
}
|
|
256
248
|
return content;
|
|
257
|
-
};
|
|
258
|
-
var renderTds = function
|
|
249
|
+
});
|
|
250
|
+
var renderTds = usePersistFn(function (cols, data) {
|
|
259
251
|
var tds = [];
|
|
260
252
|
var skip = 0;
|
|
261
253
|
var lastRowIndex = data.length - 1;
|
|
@@ -271,25 +263,37 @@ var Tr = function Tr(props) {
|
|
|
271
263
|
if (data[i]) {
|
|
272
264
|
var last = cols[i + (data[i].colSpan || 1) - 1] || {};
|
|
273
265
|
var isRowSpanTd = data[i].rowSpan > 1;
|
|
274
|
-
var
|
|
275
|
-
var
|
|
266
|
+
var shouldBindMouseEvent = props.hover && hasSiblingRowSpan || isRowSpanTd;
|
|
267
|
+
var showCellHover = props.hoverIndex.has(props.rowIndex);
|
|
268
|
+
if (!showCellHover && data[i].rowSpan > 1) {
|
|
269
|
+
for (var j = 0; j < data[i].rowSpan; j++) {
|
|
270
|
+
if (props.hoverIndex.has(props.rowIndex + j)) {
|
|
271
|
+
showCellHover = true;
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
var td = /*#__PURE__*/_jsx(Td, {
|
|
277
|
+
col: col,
|
|
278
|
+
data: data[i].data,
|
|
276
279
|
colSpan: data[i].colSpan,
|
|
277
280
|
rowSpan: data[i].rowSpan,
|
|
278
|
-
onMouseEnter:
|
|
279
|
-
props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
281
|
+
onMouseEnter: shouldBindMouseEvent ? function () {
|
|
282
|
+
return props.handleCellHover(props.rowIndex, data[i].rowSpan);
|
|
280
283
|
} : undefined,
|
|
281
|
-
onMouseLeave:
|
|
282
|
-
props.handleCellHover(-1, 0);
|
|
284
|
+
onMouseLeave: shouldBindMouseEvent ? function () {
|
|
285
|
+
return props.handleCellHover(-1, 0);
|
|
283
286
|
} : undefined,
|
|
284
|
-
className: classNames(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder),
|
|
287
|
+
className: classNames(col.className, col.type === 'checkbox' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellCheckbox), col.fixed === 'left' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLeft), col.fixed === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedRight), col.align === 'center' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignCenter), col.align === 'right' && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellAlignRight), (col.lastFixed || col.firstFixed || last.lastFixed) && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellFixedLast), lastRowIndex === i && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellIgnoreBorder), showCellHover && (tableClasses === null || tableClasses === void 0 ? void 0 : tableClasses.cellHover)),
|
|
285
288
|
style: getTdStyle(col, data[i].colSpan),
|
|
286
|
-
|
|
289
|
+
direction: config.direction,
|
|
287
290
|
"data-role": col.type === 'checkbox' ? 'checkbox' : undefined,
|
|
288
291
|
onClick: props.onCellClick ? function () {
|
|
289
292
|
return handleCellClick(data[i].data, i);
|
|
290
293
|
} : undefined,
|
|
291
|
-
|
|
292
|
-
|
|
294
|
+
shouldCellUpdate: col.shouldCellUpdate || props.shouldCellUpdate,
|
|
295
|
+
renderContent: renderContent
|
|
296
|
+
}, "".concat(col.key, "-").concat(props.rowIndex, "-").concat(i));
|
|
293
297
|
tds.push(td);
|
|
294
298
|
if (data[i].colSpan) skip = data[i].colSpan - 1;
|
|
295
299
|
}
|
|
@@ -298,7 +302,7 @@ var Tr = function Tr(props) {
|
|
|
298
302
|
if (_loop(i)) continue;
|
|
299
303
|
}
|
|
300
304
|
return tds;
|
|
301
|
-
};
|
|
305
|
+
});
|
|
302
306
|
var renderExpand = function renderExpand() {
|
|
303
307
|
if (!props.expanded) return null;
|
|
304
308
|
var expandCol = props.expandCol;
|
package/esm/tabs/tabs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnD,QAAA,MAAM,IAAI;YAAW,SAAS;;
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["tabs.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAe,SAAS,EAAE,MAAM,aAAa,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAOnD,QAAA,MAAM,IAAI;YAAW,SAAS;;CAwR7B,CAAC;AAIF,eAAe,IAAI,CAAC"}
|
package/esm/tabs/tabs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["jssStyle", "align", "children", "shape", "position", "lazy", "autoFill", "hideSplit", "collapsible", "defaultCollapsed", "onChange", "extra", "border", "splitColor", "tabBarExtraContent", "background", "activeBackground", "inactiveBackground", "defaultActive", "tabBarStyle", "color", "sticky", "allowNonPanel", "className"];
|
|
2
|
+
var _excluded = ["jssStyle", "align", "children", "shape", "position", "lazy", "autoFill", "hideSplit", "collapsible", "defaultCollapsed", "onChange", "extra", "border", "splitColor", "tabBarExtraContent", "background", "activeBackground", "inactiveBackground", "defaultActive", "tabBarStyle", "color", "sticky", "allowNonPanel", "renderTabsHeader", "className"];
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -69,6 +69,7 @@ var Tabs = function Tabs(props) {
|
|
|
69
69
|
color = props.color,
|
|
70
70
|
sticky = props.sticky,
|
|
71
71
|
allowNonPanel = props.allowNonPanel,
|
|
72
|
+
renderTabsHeader = props.renderTabsHeader,
|
|
72
73
|
tabsClassName = props.className,
|
|
73
74
|
rest = _objectWithoutProperties(props, _excluded);
|
|
74
75
|
var shape = shapeProps && shapeProps !== 'bordered' ? shapeProps : 'card';
|
|
@@ -229,10 +230,18 @@ var Tabs = function Tabs(props) {
|
|
|
229
230
|
className: classNames(stickyClassName, sticky.className)
|
|
230
231
|
});
|
|
231
232
|
}
|
|
233
|
+
if (renderTabsHeader) {
|
|
234
|
+
return renderTabsHeader( /*#__PURE__*/_jsx(Sticky, _objectSpread(_objectSpread({}, stickyProps), {}, {
|
|
235
|
+
children: header
|
|
236
|
+
})), props);
|
|
237
|
+
}
|
|
232
238
|
return /*#__PURE__*/_jsx(Sticky, _objectSpread(_objectSpread({}, stickyProps), {}, {
|
|
233
239
|
children: header
|
|
234
240
|
}));
|
|
235
241
|
}
|
|
242
|
+
if (renderTabsHeader) {
|
|
243
|
+
return renderTabsHeader(header, props);
|
|
244
|
+
}
|
|
236
245
|
return header;
|
|
237
246
|
};
|
|
238
247
|
var renderTabs = function renderTabs() {
|
package/esm/tabs/tabs.type.d.ts
CHANGED
|
@@ -155,5 +155,11 @@ export interface TabsProps extends BaseTabsProps, Pick<CommonType, 'className' |
|
|
|
155
155
|
* @version 3.5.3
|
|
156
156
|
*/
|
|
157
157
|
allowNonPanel?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* @en Custom render header content
|
|
160
|
+
* @cn 自定义渲染 header 内容
|
|
161
|
+
* @version 3.7.0
|
|
162
|
+
*/
|
|
163
|
+
renderTabsHeader?: (header: React.ReactNode, props: Omit<TabsProps, 'renderTabsHeader'>) => React.ReactNode;
|
|
158
164
|
}
|
|
159
165
|
//# sourceMappingURL=tabs.type.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.type.d.ts","sourceRoot":"","sources":["tabs.type.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,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,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAE5B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1C;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,KAAK,CAAC,SAAS,EACvB,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,KACvC,KAAK,CAAC,SAAS,CAAC;CACtB"}
|
package/esm/tag/tag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["tag.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAc,QAAQ,EAAE,MAAM,YAAY,CAAC;AASlD,QAAA,MAAM,GAAG;YAAW,QAAQ;;CAmI3B,CAAC;AAIF,eAAe,GAAG,CAAC"}
|
package/esm/tag/tag.js
CHANGED
|
@@ -8,10 +8,10 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
8
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
import classNames from 'classnames';
|
|
11
|
+
import Icons from "../icons";
|
|
11
12
|
import useTag from "./use-tag";
|
|
12
13
|
import { util } from '@sheinx/hooks';
|
|
13
14
|
import TagInput from "./tag-input";
|
|
14
|
-
import Icons from "../icons";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
var devUseWarning = util.devUseWarning;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQ9C,QAAA,MAAM,OAAO,UAAW,YAAY,mDAoJnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/esm/tooltip/tooltip.js
CHANGED
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
-
import {
|
|
13
|
+
import { getClosestScrollContainer, usePopup, util } from '@sheinx/hooks';
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import React, { cloneElement, isValidElement, useEffect } from 'react';
|
|
16
16
|
import AbsoluteList from "../absolute-list";
|
|
@@ -63,11 +63,11 @@ var Tooltip = function Tooltip(props) {
|
|
|
63
63
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
64
64
|
updateKey = _React$useState2[0],
|
|
65
65
|
setUpdateKey = _React$useState2[1];
|
|
66
|
-
var handleUpdateKey =
|
|
66
|
+
var handleUpdateKey = function handleUpdateKey() {
|
|
67
67
|
setUpdateKey(function (prev) {
|
|
68
68
|
return (prev + 1) % 2;
|
|
69
69
|
});
|
|
70
|
-
}
|
|
70
|
+
};
|
|
71
71
|
var bindEvents = function bindEvents() {
|
|
72
72
|
var _window;
|
|
73
73
|
var targetEl = targetRef.current;
|
|
@@ -76,6 +76,10 @@ var Tooltip = function Tooltip(props) {
|
|
|
76
76
|
if (events.onMouseLeave) targetEl.addEventListener('mouseleave', events.onMouseLeave);
|
|
77
77
|
if (events.onClick) targetEl.addEventListener('click', events.onClick);
|
|
78
78
|
(_window = window) === null || _window === void 0 || _window.addEventListener('resize', handleUpdateKey);
|
|
79
|
+
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
80
|
+
if (scrollContainer) {
|
|
81
|
+
scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
82
|
+
}
|
|
79
83
|
};
|
|
80
84
|
var unbindEvents = function unbindEvents() {
|
|
81
85
|
var _window2;
|
|
@@ -87,6 +91,10 @@ var Tooltip = function Tooltip(props) {
|
|
|
87
91
|
if (events.onClick) targetEl.removeEventListener('click', events.onClick);
|
|
88
92
|
targetEl.removeEventListener('click', closePop);
|
|
89
93
|
(_window2 = window) === null || _window2 === void 0 || _window2.removeEventListener('resize', handleUpdateKey);
|
|
94
|
+
var scrollContainer = getClosestScrollContainer(targetEl);
|
|
95
|
+
if (scrollContainer) {
|
|
96
|
+
scrollContainer.addEventListener('scroll', handleUpdateKey);
|
|
97
|
+
}
|
|
90
98
|
};
|
|
91
99
|
useEffect(function () {
|
|
92
100
|
if (!persistent) return;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface scrollProps {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
scrollHeight: number;
|
|
5
|
+
scrollWidth: number | string;
|
|
6
|
+
height?: number | string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
keepScrollTop?: boolean;
|
|
9
|
+
wrapperRef?: React.RefObject<HTMLDivElement>;
|
|
10
|
+
tbodyRef?: React.RefObject<HTMLTableElement>;
|
|
11
|
+
onScroll?: (info: {
|
|
12
|
+
scrollLeft: number;
|
|
13
|
+
scrollTop: number;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
fromDrag: boolean;
|
|
17
|
+
height: number;
|
|
18
|
+
width: number;
|
|
19
|
+
}) => void;
|
|
20
|
+
onScrollToBottom?: (options?: any) => void;
|
|
21
|
+
className?: string;
|
|
22
|
+
childrenStyle?: React.CSSProperties;
|
|
23
|
+
defaultHeight?: number;
|
|
24
|
+
isScrollY?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare const Scroll: (props: scrollProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default Scroll;
|
|
28
|
+
//# sourceMappingURL=scroll-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll-table.d.ts","sourceRoot":"","sources":["scroll-table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAI/C,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,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,KAAK,CAAC,SAAS,CAAC,gBAAgB,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,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAWD,QAAA,MAAM,MAAM,UAAW,WAAW,4CA2HjC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|