@hw-component/table 1.9.64 → 1.9.68
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.
|
@@ -46,7 +46,8 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
46
46
|
fieldNames = _props$fieldNames === void 0 ? {} : _props$fieldNames,
|
|
47
47
|
tooltip = props.tooltip,
|
|
48
48
|
tableInstance = props.tableInstance,
|
|
49
|
-
maxLen = props.maxLen
|
|
49
|
+
maxLen = props.maxLen,
|
|
50
|
+
popoverContentRender = props.popoverContentRender;
|
|
50
51
|
var _fieldNames$label = fieldNames.label,
|
|
51
52
|
label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
|
|
52
53
|
_fieldNames$value = fieldNames.value,
|
|
@@ -68,7 +69,7 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
68
69
|
moreTag = _useMemo.moreTag;
|
|
69
70
|
var moreLen = moreTag === null || moreTag === void 0 ? void 0 : moreTag.length;
|
|
70
71
|
return jsxs(Row, {
|
|
71
|
-
gutter: [
|
|
72
|
+
gutter: [0, 8],
|
|
72
73
|
children: [tagData === null || tagData === void 0 ? void 0 : _mapInstanceProperty(tagData).call(tagData, function (tagItem, index) {
|
|
73
74
|
var _context;
|
|
74
75
|
var tagProps = {
|
|
@@ -106,7 +107,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
106
107
|
}), cuKey)
|
|
107
108
|
}));
|
|
108
109
|
}), !moreLen ? null : jsx(Popover, {
|
|
109
|
-
content: jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
110
|
+
content: popoverContentRender ? popoverContentRender(jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
111
|
+
maxLen: null
|
|
112
|
+
}))) : jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
110
113
|
maxLen: null
|
|
111
114
|
})),
|
|
112
115
|
children: jsxs(Tag, {
|
|
@@ -49,7 +49,8 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
49
49
|
fieldNames = _props$fieldNames === void 0 ? {} : _props$fieldNames,
|
|
50
50
|
tooltip = props.tooltip,
|
|
51
51
|
tableInstance = props.tableInstance,
|
|
52
|
-
maxLen = props.maxLen
|
|
52
|
+
maxLen = props.maxLen,
|
|
53
|
+
popoverContentRender = props.popoverContentRender;
|
|
53
54
|
var _fieldNames$label = fieldNames.label,
|
|
54
55
|
label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
|
|
55
56
|
_fieldNames$value = fieldNames.value,
|
|
@@ -71,7 +72,7 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
71
72
|
moreTag = _useMemo.moreTag;
|
|
72
73
|
var moreLen = moreTag === null || moreTag === void 0 ? void 0 : moreTag.length;
|
|
73
74
|
return jsxRuntime.jsxs(antd.Row, {
|
|
74
|
-
gutter: [
|
|
75
|
+
gutter: [0, 8],
|
|
75
76
|
children: [tagData === null || tagData === void 0 ? void 0 : _mapInstanceProperty(tagData).call(tagData, function (tagItem, index) {
|
|
76
77
|
var _context;
|
|
77
78
|
var tagProps = {
|
|
@@ -109,7 +110,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
109
110
|
}), cuKey)
|
|
110
111
|
}));
|
|
111
112
|
}), !moreLen ? null : jsxRuntime.jsx(antd.Popover, {
|
|
112
|
-
content: jsxRuntime.jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
113
|
+
content: popoverContentRender ? popoverContentRender(jsxRuntime.jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
114
|
+
maxLen: null
|
|
115
|
+
}))) : jsxRuntime.jsx(TagsComponent, _objectSpread(_objectSpread({}, props), {}, {
|
|
113
116
|
maxLen: null
|
|
114
117
|
})),
|
|
115
118
|
children: jsxRuntime.jsxs(antd.Tag, {
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ interface IProps {
|
|
|
13
13
|
fieldNames?: { label?: string; value?: string };
|
|
14
14
|
tableInstance?: HTableInstance;
|
|
15
15
|
maxLen?: number | null;
|
|
16
|
+
popoverContentRender?:(node:React.ReactNode)=>React.ReactNode;
|
|
16
17
|
}
|
|
17
18
|
const getTooltipProps = (
|
|
18
19
|
title: string,
|
|
@@ -44,6 +45,7 @@ const TagsComponent = (props: IProps) => {
|
|
|
44
45
|
tooltip,
|
|
45
46
|
tableInstance,
|
|
46
47
|
maxLen,
|
|
48
|
+
popoverContentRender
|
|
47
49
|
} = props;
|
|
48
50
|
const { label = "label", value = "value" } = fieldNames;
|
|
49
51
|
const { tagData, moreTag } = useMemo(() => {
|
|
@@ -62,7 +64,7 @@ const TagsComponent = (props: IProps) => {
|
|
|
62
64
|
const moreLen = moreTag?.length;
|
|
63
65
|
|
|
64
66
|
return (
|
|
65
|
-
<Row gutter={[
|
|
67
|
+
<Row gutter={[0, 8]}>
|
|
66
68
|
{tagData?.map((tagItem, index) => {
|
|
67
69
|
const tagProps = {
|
|
68
70
|
closable,
|
|
@@ -111,7 +113,7 @@ const TagsComponent = (props: IProps) => {
|
|
|
111
113
|
);
|
|
112
114
|
})}
|
|
113
115
|
{!moreLen ? null : (
|
|
114
|
-
<Popover content={<TagsComponent {...props} maxLen={null} />}>
|
|
116
|
+
<Popover content={popoverContentRender?popoverContentRender(<TagsComponent {...props} maxLen={null} />):<TagsComponent {...props} maxLen={null} />}>
|
|
115
117
|
<Tag>...等{data.length}个</Tag>
|
|
116
118
|
</Popover>
|
|
117
119
|
)}
|