@hw-component/table 1.10.29 → 1.10.31
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.
|
@@ -19,6 +19,7 @@ interface IProps {
|
|
|
19
19
|
popoverContentRender?: (node: React.ReactNode) => React.ReactNode;
|
|
20
20
|
contentItemRender?: (item: any) => React.ReactNode;
|
|
21
21
|
extra?: React.ReactNode;
|
|
22
|
+
tagStyle?: React.CSSProperties;
|
|
22
23
|
}
|
|
23
24
|
export declare const Text: React.FC;
|
|
24
25
|
declare const TagsComponent: (props: IProps) => JSX.Element;
|
|
@@ -62,7 +62,8 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
62
62
|
tableInstance = props.tableInstance,
|
|
63
63
|
maxLen = props.maxLen,
|
|
64
64
|
popoverContentRender = props.popoverContentRender,
|
|
65
|
-
extra = props.extra
|
|
65
|
+
extra = props.extra,
|
|
66
|
+
tagStyle = props.tagStyle;
|
|
66
67
|
var _fieldNames$label = fieldNames.label,
|
|
67
68
|
label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
|
|
68
69
|
_fieldNames$value = fieldNames.value,
|
|
@@ -95,6 +96,7 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
95
96
|
color: color,
|
|
96
97
|
icon: icon
|
|
97
98
|
};
|
|
99
|
+
var tagWidth = closable ? "calc(100% - 18px)" : "100%";
|
|
98
100
|
var indexKey = index.toString();
|
|
99
101
|
if (typeof tagItem === "string") {
|
|
100
102
|
var _tooltipProps = getTooltipProps({
|
|
@@ -105,9 +107,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
105
107
|
});
|
|
106
108
|
return jsx(Tooltip, _objectSpread(_objectSpread({}, _tooltipProps), {}, {
|
|
107
109
|
children: jsx(Tag, _objectSpread(_objectSpread({
|
|
108
|
-
style: {
|
|
109
|
-
maxWidth:
|
|
110
|
-
}
|
|
110
|
+
style: _objectSpread({
|
|
111
|
+
maxWidth: tagWidth
|
|
112
|
+
}, tagStyle)
|
|
111
113
|
}, tagProps), {}, {
|
|
112
114
|
onClose: function onClose(e) {
|
|
113
115
|
e.preventDefault();
|
|
@@ -131,9 +133,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
131
133
|
});
|
|
132
134
|
return jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
133
135
|
children: jsx(Tag, _objectSpread(_objectSpread({
|
|
134
|
-
style: {
|
|
135
|
-
maxWidth:
|
|
136
|
-
}
|
|
136
|
+
style: _objectSpread({
|
|
137
|
+
maxWidth: tagWidth
|
|
138
|
+
}, tagStyle)
|
|
137
139
|
}, cuTagProps), {}, {
|
|
138
140
|
onClose: function onClose(e) {
|
|
139
141
|
e.preventDefault();
|
|
@@ -19,6 +19,7 @@ interface IProps {
|
|
|
19
19
|
popoverContentRender?: (node: React.ReactNode) => React.ReactNode;
|
|
20
20
|
contentItemRender?: (item: any) => React.ReactNode;
|
|
21
21
|
extra?: React.ReactNode;
|
|
22
|
+
tagStyle?: React.CSSProperties;
|
|
22
23
|
}
|
|
23
24
|
export declare const Text: React.FC;
|
|
24
25
|
declare const TagsComponent: (props: IProps) => JSX.Element;
|
|
@@ -65,7 +65,8 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
65
65
|
tableInstance = props.tableInstance,
|
|
66
66
|
maxLen = props.maxLen,
|
|
67
67
|
popoverContentRender = props.popoverContentRender,
|
|
68
|
-
extra = props.extra
|
|
68
|
+
extra = props.extra,
|
|
69
|
+
tagStyle = props.tagStyle;
|
|
69
70
|
var _fieldNames$label = fieldNames.label,
|
|
70
71
|
label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
|
|
71
72
|
_fieldNames$value = fieldNames.value,
|
|
@@ -98,6 +99,7 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
98
99
|
color: color,
|
|
99
100
|
icon: icon
|
|
100
101
|
};
|
|
102
|
+
var tagWidth = closable ? "calc(100% - 18px)" : "100%";
|
|
101
103
|
var indexKey = index.toString();
|
|
102
104
|
if (typeof tagItem === "string") {
|
|
103
105
|
var _tooltipProps = getTooltipProps({
|
|
@@ -108,9 +110,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
108
110
|
});
|
|
109
111
|
return jsxRuntime.jsx(antd.Tooltip, _objectSpread(_objectSpread({}, _tooltipProps), {}, {
|
|
110
112
|
children: jsxRuntime.jsx(antd.Tag, _objectSpread(_objectSpread({
|
|
111
|
-
style: {
|
|
112
|
-
maxWidth:
|
|
113
|
-
}
|
|
113
|
+
style: _objectSpread({
|
|
114
|
+
maxWidth: tagWidth
|
|
115
|
+
}, tagStyle)
|
|
114
116
|
}, tagProps), {}, {
|
|
115
117
|
onClose: function onClose(e) {
|
|
116
118
|
e.preventDefault();
|
|
@@ -134,9 +136,9 @@ var TagsComponent = function TagsComponent(props) {
|
|
|
134
136
|
});
|
|
135
137
|
return jsxRuntime.jsx(antd.Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
|
|
136
138
|
children: jsxRuntime.jsx(antd.Tag, _objectSpread(_objectSpread({
|
|
137
|
-
style: {
|
|
138
|
-
maxWidth:
|
|
139
|
-
}
|
|
139
|
+
style: _objectSpread({
|
|
140
|
+
maxWidth: tagWidth
|
|
141
|
+
}, tagStyle)
|
|
140
142
|
}, cuTagProps), {}, {
|
|
141
143
|
onClose: function onClose(e) {
|
|
142
144
|
e.preventDefault();
|
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ interface IProps {
|
|
|
19
19
|
popoverContentRender?: (node: React.ReactNode) => React.ReactNode;
|
|
20
20
|
contentItemRender?: (item: any) => React.ReactNode;
|
|
21
21
|
extra?: React.ReactNode;
|
|
22
|
+
tagStyle?: React.CSSProperties;
|
|
22
23
|
}
|
|
23
24
|
const getTooltipProps = (
|
|
24
25
|
item: any,
|
|
@@ -59,6 +60,7 @@ const TagsComponent = (props: IProps) => {
|
|
|
59
60
|
maxLen,
|
|
60
61
|
popoverContentRender,
|
|
61
62
|
extra,
|
|
63
|
+
tagStyle
|
|
62
64
|
} = props;
|
|
63
65
|
const { label = "label", value = "value" } = fieldNames;
|
|
64
66
|
const { tagData, moreTag } = useMemo(() => {
|
|
@@ -85,6 +87,7 @@ const TagsComponent = (props: IProps) => {
|
|
|
85
87
|
color,
|
|
86
88
|
icon,
|
|
87
89
|
};
|
|
90
|
+
const tagWidth=closable?`calc(100% - 18px)`:"100%";
|
|
88
91
|
const indexKey = index.toString();
|
|
89
92
|
if (typeof tagItem === "string") {
|
|
90
93
|
const tooltipProps = getTooltipProps({ title: tagItem }, tooltip);
|
|
@@ -94,7 +97,8 @@ const TagsComponent = (props: IProps) => {
|
|
|
94
97
|
<Tag
|
|
95
98
|
key={indexKey}
|
|
96
99
|
style={{
|
|
97
|
-
maxWidth:
|
|
100
|
+
maxWidth:tagWidth,
|
|
101
|
+
...tagStyle
|
|
98
102
|
}}
|
|
99
103
|
{...tagProps}
|
|
100
104
|
onClose={(e) => {
|
|
@@ -123,7 +127,8 @@ const TagsComponent = (props: IProps) => {
|
|
|
123
127
|
<Tag
|
|
124
128
|
key={cuKey}
|
|
125
129
|
style={{
|
|
126
|
-
maxWidth:
|
|
130
|
+
maxWidth:tagWidth,
|
|
131
|
+
...tagStyle
|
|
127
132
|
}}
|
|
128
133
|
{...cuTagProps}
|
|
129
134
|
onClose={(e) => {
|