@hw-component/table 1.10.32 → 1.10.33

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,14 @@
1
+ .ant-hw-table-render-tag {
2
+ position: relative;
3
+ }
4
+ .ant-hw-table-render-tag .ant-tag-close-icon {
5
+ position: absolute;
6
+ right: 7px;
7
+ top: 50%;
8
+ -webkit-transform: translateY(-50%);
9
+ -ms-transform: translateY(-50%);
10
+ transform: translateY(-50%);
11
+ }
1
12
  .ant-hw-table-content .ant-hw-table-body {
2
13
  padding-top: 0;
3
14
  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,6 +116,7 @@ var TagsComponent = function TagsComponent(props) {
112
116
  });
113
117
  return jsx(Tooltip, _objectSpread(_objectSpread({}, _tooltipProps), {}, {
114
118
  children: jsx(Tag, _objectSpread(_objectSpread({
119
+ className: tagClassName,
115
120
  style: _objectSpread({
116
121
  maxWidth: "100%"
117
122
  }, tagStyle)
package/lib/index.css CHANGED
@@ -1,3 +1,14 @@
1
+ .ant-hw-table-render-tag {
2
+ position: relative;
3
+ }
4
+ .ant-hw-table-render-tag .ant-tag-close-icon {
5
+ position: absolute;
6
+ right: 7px;
7
+ top: 50%;
8
+ -webkit-transform: translateY(-50%);
9
+ -ms-transform: translateY(-50%);
10
+ transform: translateY(-50%);
11
+ }
1
12
  .ant-hw-table-content .ant-hw-table-body {
2
13
  padding-top: 0;
3
14
  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,6 +119,7 @@ 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({
122
+ className: tagClassName,
118
123
  style: _objectSpread({
119
124
  maxWidth: "100%"
120
125
  }, tagStyle)
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.33",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -1,4 +1,14 @@
1
1
  @import "./styles/local.less";
2
+
3
+ .@{ant-prefix}-hw-table-render-tag {
4
+ position: relative;
5
+ .@{ant-prefix}-tag-close-icon{
6
+ position: absolute;
7
+ right: 7px;
8
+ top: 50%;
9
+ transform: translateY(-50%);
10
+ }
11
+ }
2
12
  .@{ant-prefix}-hw-table-content {
3
13
  .@{ant-prefix}-hw-table-body {
4
14
  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,6 +100,7 @@ const TagsComponent = (props: IProps) => {
100
100
  <Tooltip {...tooltipProps}>
101
101
  <Tag
102
102
  key={indexKey}
103
+ className={tagClassName}
103
104
  style={{
104
105
  maxWidth:"100%",
105
106
  ...tagStyle
@@ -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 (