@hw-component/table 1.10.32 → 1.10.36

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/es/index.css CHANGED
@@ -1,3 +1,15 @@
1
+ .ant-hw-table-render-tag {
2
+ position: relative;
3
+ max-width: 100%;
4
+ }
5
+ .ant-hw-table-render-tag .ant-tag-close-icon {
6
+ position: absolute;
7
+ right: 7px;
8
+ top: 50%;
9
+ -webkit-transform: translateY(-50%);
10
+ -ms-transform: translateY(-50%);
11
+ transform: translateY(-50%);
12
+ }
1
13
  .ant-hw-table-content .ant-hw-table-body {
2
14
  padding-top: 0;
3
15
  border-top-left-radius: 0;
@@ -16,6 +16,7 @@ import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance
16
16
  import { jsxs, jsx } from 'react/jsx-runtime';
17
17
  import { Row, Tooltip, Tag, Popover, Typography } from 'antd';
18
18
  import { useMemo } from 'react';
19
+ import { useClassName } from '../hooks/index.js';
19
20
 
20
21
  var _excluded = ["contentItemRender"];
21
22
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
@@ -44,13 +45,15 @@ var getTooltipProps = function getTooltipProps(item, tooltip) {
44
45
  var Text = function Text(_ref) {
45
46
  var children = _ref.children,
46
47
  closable = _ref.closable;
47
- var maxWidth = closable ? "calc(100% - 18px)" : "100%";
48
48
  return jsx(Typography.Text, {
49
49
  ellipsis: {
50
- tooltip: children
50
+ tooltip: {
51
+ title: children,
52
+ placement: "topLeft"
53
+ }
51
54
  },
52
55
  style: {
53
- maxWidth: maxWidth
56
+ paddingRight: closable ? 17 : 0
54
57
  },
55
58
  children: children
56
59
  });
@@ -69,6 +72,7 @@ var TagsComponent = function TagsComponent(props) {
69
72
  popoverContentRender = props.popoverContentRender,
70
73
  extra = props.extra,
71
74
  tagStyle = props.tagStyle;
75
+ var tagClassName = useClassName("hw-table-render-tag");
72
76
  var _fieldNames$label = fieldNames.label,
73
77
  label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
74
78
  _fieldNames$value = fieldNames.value,
@@ -112,9 +116,8 @@ var TagsComponent = function TagsComponent(props) {
112
116
  });
113
117
  return jsx(Tooltip, _objectSpread(_objectSpread({}, _tooltipProps), {}, {
114
118
  children: jsx(Tag, _objectSpread(_objectSpread({
115
- style: _objectSpread({
116
- maxWidth: "100%"
117
- }, tagStyle)
119
+ className: tagClassName,
120
+ style: tagStyle
118
121
  }, tagProps), {}, {
119
122
  onClose: function onClose(e) {
120
123
  e.preventDefault();
@@ -139,9 +142,8 @@ var TagsComponent = function TagsComponent(props) {
139
142
  });
140
143
  return jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
141
144
  children: jsx(Tag, _objectSpread(_objectSpread({
142
- style: _objectSpread({
143
- maxWidth: "100%"
144
- }, tagStyle)
145
+ className: "tagClassName",
146
+ style: tagStyle
145
147
  }, cuTagProps), {}, {
146
148
  onClose: function onClose(e) {
147
149
  e.preventDefault();
package/lib/index.css CHANGED
@@ -1,3 +1,15 @@
1
+ .ant-hw-table-render-tag {
2
+ position: relative;
3
+ max-width: 100%;
4
+ }
5
+ .ant-hw-table-render-tag .ant-tag-close-icon {
6
+ position: absolute;
7
+ right: 7px;
8
+ top: 50%;
9
+ -webkit-transform: translateY(-50%);
10
+ -ms-transform: translateY(-50%);
11
+ transform: translateY(-50%);
12
+ }
1
13
  .ant-hw-table-content .ant-hw-table-body {
2
14
  padding-top: 0;
3
15
  border-top-left-radius: 0;
@@ -19,6 +19,7 @@ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instan
19
19
  var jsxRuntime = require('react/jsx-runtime');
20
20
  var antd = require('antd');
21
21
  var React = require('react');
22
+ var index = require('../hooks/index.js');
22
23
 
23
24
  var _excluded = ["contentItemRender"];
24
25
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
@@ -47,13 +48,15 @@ var getTooltipProps = function getTooltipProps(item, tooltip) {
47
48
  var Text = function Text(_ref) {
48
49
  var children = _ref.children,
49
50
  closable = _ref.closable;
50
- var maxWidth = closable ? "calc(100% - 18px)" : "100%";
51
51
  return jsxRuntime.jsx(antd.Typography.Text, {
52
52
  ellipsis: {
53
- tooltip: children
53
+ tooltip: {
54
+ title: children,
55
+ placement: "topLeft"
56
+ }
54
57
  },
55
58
  style: {
56
- maxWidth: maxWidth
59
+ paddingRight: closable ? 17 : 0
57
60
  },
58
61
  children: children
59
62
  });
@@ -72,6 +75,7 @@ var TagsComponent = function TagsComponent(props) {
72
75
  popoverContentRender = props.popoverContentRender,
73
76
  extra = props.extra,
74
77
  tagStyle = props.tagStyle;
78
+ var tagClassName = index.useClassName("hw-table-render-tag");
75
79
  var _fieldNames$label = fieldNames.label,
76
80
  label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
77
81
  _fieldNames$value = fieldNames.value,
@@ -115,9 +119,8 @@ var TagsComponent = function TagsComponent(props) {
115
119
  });
116
120
  return jsxRuntime.jsx(antd.Tooltip, _objectSpread(_objectSpread({}, _tooltipProps), {}, {
117
121
  children: jsxRuntime.jsx(antd.Tag, _objectSpread(_objectSpread({
118
- style: _objectSpread({
119
- maxWidth: "100%"
120
- }, tagStyle)
122
+ className: tagClassName,
123
+ style: tagStyle
121
124
  }, tagProps), {}, {
122
125
  onClose: function onClose(e) {
123
126
  e.preventDefault();
@@ -142,9 +145,8 @@ var TagsComponent = function TagsComponent(props) {
142
145
  });
143
146
  return jsxRuntime.jsx(antd.Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
144
147
  children: jsxRuntime.jsx(antd.Tag, _objectSpread(_objectSpread({
145
- style: _objectSpread({
146
- maxWidth: "100%"
147
- }, tagStyle)
148
+ className: "tagClassName",
149
+ style: tagStyle
148
150
  }, cuTagProps), {}, {
149
151
  onClose: function onClose(e) {
150
152
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.10.32",
3
+ "version": "1.10.36",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -1,4 +1,15 @@
1
1
  @import "./styles/local.less";
2
+
3
+ .@{ant-prefix}-hw-table-render-tag {
4
+ position: relative;
5
+ max-width: 100%;
6
+ .@{ant-prefix}-tag-close-icon{
7
+ position: absolute;
8
+ right: 7px;
9
+ top: 50%;
10
+ transform: translateY(-50%);
11
+ }
12
+ }
2
13
  .@{ant-prefix}-hw-table-content {
3
14
  .@{ant-prefix}-hw-table-body {
4
15
  padding-top: 0;
@@ -2,6 +2,7 @@ import {Row, Tag, Tooltip, Popover, Typography} from "antd";
2
2
  import React, { useMemo } from "react";
3
3
  import type { TooltipProps } from "antd/lib/tooltip";
4
4
  import type { HTableInstance } from "../modal";
5
+ import {useClassName} from "../hooks";
5
6
 
6
7
  type CloseFn = (key: string, tableInstance?: HTableInstance) => void;
7
8
  type TooltipRender = (item: any) => TooltipProps;
@@ -48,8 +49,7 @@ interface TextProps {
48
49
  closable?: boolean;
49
50
  }
50
51
  export const Text:React.FC<TextProps>=({children,closable})=>{
51
- const maxWidth=closable?`calc(100% - 18px)`:"100%";
52
- return <Typography.Text ellipsis={{tooltip:children}} style={{maxWidth}}>{children}</Typography.Text>
52
+ return <Typography.Text ellipsis={{tooltip:{title:children,placement:"topLeft"}}} style={{paddingRight:closable?17:0}}>{children}</Typography.Text>
53
53
  }
54
54
  const TagsComponent = (props: IProps) => {
55
55
  const {
@@ -66,6 +66,7 @@ const TagsComponent = (props: IProps) => {
66
66
  extra,
67
67
  tagStyle
68
68
  } = props;
69
+ const tagClassName=useClassName("hw-table-render-tag");
69
70
  const { label = "label", value = "value" } = fieldNames;
70
71
  const { tagData, moreTag } = useMemo(() => {
71
72
  if (!maxLen || !data) {
@@ -91,7 +92,6 @@ const TagsComponent = (props: IProps) => {
91
92
  color,
92
93
  icon,
93
94
  };
94
- const tagWidth=closable?`calc(100% - 18px)`:"100%";
95
95
  const indexKey = index.toString();
96
96
  if (typeof tagItem === "string") {
97
97
  const tooltipProps = getTooltipProps({ title: tagItem }, tooltip);
@@ -100,10 +100,8 @@ const TagsComponent = (props: IProps) => {
100
100
  <Tooltip {...tooltipProps}>
101
101
  <Tag
102
102
  key={indexKey}
103
- style={{
104
- maxWidth:"100%",
105
- ...tagStyle
106
- }}
103
+ className={tagClassName}
104
+ style={tagStyle}
107
105
  {...tagProps}
108
106
  onClose={(e) => {
109
107
  e.preventDefault();
@@ -130,10 +128,8 @@ const TagsComponent = (props: IProps) => {
130
128
  <Tooltip {...tooltipProps}>
131
129
  <Tag
132
130
  key={cuKey}
133
- style={{
134
- maxWidth:"100%",
135
- ...tagStyle
136
- }}
131
+ className="tagClassName"
132
+ style={tagStyle}
137
133
  {...cuTagProps}
138
134
  onClose={(e) => {
139
135
  e.preventDefault();
@@ -97,6 +97,7 @@ const listReq = (params) => {
97
97
  records.push({
98
98
  id: `${current}-${i}`,
99
99
  lastPullGroupTime: 1760420231,
100
+ op3:["1231231232132131231321321312331231331321","2222"]
100
101
  });
101
102
  }
102
103
  resolve({
@@ -163,6 +164,10 @@ export default () => {
163
164
  dataIndex: "op3",
164
165
  width: 120,
165
166
  fixed: "right",
167
+ valueType:"tags",
168
+ valueTypeProps: {
169
+ closable: true,
170
+ }
166
171
  },
167
172
  ]);
168
173
  return (