@hw-component/table 1.9.4 → 1.9.6

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.
@@ -14,6 +14,11 @@ var CopyComponent = (function (_ref) {
14
14
  return jsx(Paragraph, {
15
15
  ellipsis: ellipsis,
16
16
  className: className,
17
+ style: {
18
+ margin: 0,
19
+ width: "100%",
20
+ padding: 0
21
+ },
17
22
  onClick: function onClick() {
18
23
  copy(cpText || text);
19
24
  message.success(successMsg);
@@ -91,7 +91,10 @@ var linkRender = function linkRender(config, itemData) {
91
91
  target: target,
92
92
  ellipsis: ellipsis,
93
93
  style: {
94
- wordBreak: "break-all"
94
+ wordBreak: "break-all",
95
+ margin: 0,
96
+ width: "100%",
97
+ padding: 0
95
98
  },
96
99
  children: tableVal
97
100
  });
@@ -108,8 +111,9 @@ var textRender = function textRender(config, itemData) {
108
111
  type: type,
109
112
  ellipsis: ellipsis,
110
113
  style: {
111
- marginBottom: 0,
112
- maxWidth: "100%"
114
+ margin: 0,
115
+ width: "100%",
116
+ padding: 0
113
117
  },
114
118
  children: [addonBefore, tableVal, addonAfter]
115
119
  });
@@ -1,5 +1,7 @@
1
1
  // welcome to hoo hoo hoo
2
+ import { jsx } from 'react/jsx-runtime';
2
3
  import config from './config.js';
4
+ import { Typography } from 'antd';
3
5
 
4
6
  var configRender = (function (item, tableInstance, valueTypeConfig) {
5
7
  var render = item.render,
@@ -8,6 +10,19 @@ var configRender = (function (item, tableInstance, valueTypeConfig) {
8
10
  return function (dom, itemData, index) {
9
11
  var valType = valueType;
10
12
  var node = dom;
13
+ if (valType === "text") {
14
+ return jsx(Typography.Paragraph, {
15
+ ellipsis: {
16
+ tooltip: true
17
+ },
18
+ style: {
19
+ width: "100%",
20
+ margin: 0,
21
+ padding: 0
22
+ },
23
+ children: "fsafjsakfjsaklfjsaklfjsakfjaskfjakfjsaklfjsakfjsakfjskfjskfjfskjfksjffaskfjsak"
24
+ });
25
+ }
11
26
  if (config[valType]) {
12
27
  node = config[valType](item, itemData, index, tableInstance);
13
28
  }
@@ -17,6 +17,11 @@ var CopyComponent = (function (_ref) {
17
17
  return jsxRuntime.jsx(Paragraph, {
18
18
  ellipsis: ellipsis,
19
19
  className: className,
20
+ style: {
21
+ margin: 0,
22
+ width: "100%",
23
+ padding: 0
24
+ },
20
25
  onClick: function onClick() {
21
26
  copy(cpText || text);
22
27
  antd.message.success(successMsg);
@@ -94,7 +94,10 @@ var linkRender = function linkRender(config, itemData) {
94
94
  target: target,
95
95
  ellipsis: ellipsis,
96
96
  style: {
97
- wordBreak: "break-all"
97
+ wordBreak: "break-all",
98
+ margin: 0,
99
+ width: "100%",
100
+ padding: 0
98
101
  },
99
102
  children: tableVal
100
103
  });
@@ -111,8 +114,9 @@ var textRender = function textRender(config, itemData) {
111
114
  type: type,
112
115
  ellipsis: ellipsis,
113
116
  style: {
114
- marginBottom: 0,
115
- maxWidth: "100%"
117
+ margin: 0,
118
+ width: "100%",
119
+ padding: 0
116
120
  },
117
121
  children: [addonBefore, tableVal, addonAfter]
118
122
  });
@@ -2,7 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var jsxRuntime = require('react/jsx-runtime');
5
6
  var config = require('./config.js');
7
+ var antd = require('antd');
6
8
 
7
9
  var configRender = (function (item, tableInstance, valueTypeConfig) {
8
10
  var render = item.render,
@@ -11,6 +13,19 @@ var configRender = (function (item, tableInstance, valueTypeConfig) {
11
13
  return function (dom, itemData, index) {
12
14
  var valType = valueType;
13
15
  var node = dom;
16
+ if (valType === "text") {
17
+ return jsxRuntime.jsx(antd.Typography.Paragraph, {
18
+ ellipsis: {
19
+ tooltip: true
20
+ },
21
+ style: {
22
+ width: "100%",
23
+ margin: 0,
24
+ padding: 0
25
+ },
26
+ children: "fsafjsakfjsaklfjsaklfjsakfjaskfjakfjsaklfjsakfjsakfjskfjskfjfskjfksjffaskfjsak"
27
+ });
28
+ }
14
29
  if (config.default[valType]) {
15
30
  node = config.default[valType](item, itemData, index, tableInstance);
16
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.4",
3
+ "version": "1.9.6",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -15,6 +15,7 @@ export default ({ cpText, text, successMsg, ellipsis }: IProps) => {
15
15
  <Paragraph
16
16
  ellipsis={ellipsis}
17
17
  className={className}
18
+ style={{ margin: 0 ,width:"100%",padding:0}}
18
19
  onClick={() => {
19
20
  copy(cpText || text);
20
21
  message.success(successMsg);
@@ -74,7 +74,7 @@ const linkRender = (config: ConfigItemModal, itemData: any) => {
74
74
  href={hrefUrl || tableVal}
75
75
  target={target}
76
76
  ellipsis={ellipsis}
77
- style={{ wordBreak: "break-all" }}
77
+ style={{ wordBreak: "break-all" , margin: 0 ,width:"100%",padding:0}}
78
78
  >
79
79
  {tableVal}
80
80
  </Link>
@@ -85,7 +85,7 @@ const textRender = (config: ConfigItemModal, itemData: any) => {
85
85
  const { addonBefore, addonAfter, type, ellipsis } = valueTypeProps;
86
86
  const tableVal = getTableVal(config, itemData);
87
87
  return (
88
- <Paragraph type={type} ellipsis={ellipsis} style={{ marginBottom: 0 ,maxWidth:"100%"}}>
88
+ <Paragraph type={type} ellipsis={ellipsis} style={{ margin: 0 ,width:"100%",padding:0}}>
89
89
  {addonBefore}
90
90
  {tableVal}
91
91
  {addonAfter}
@@ -2,6 +2,7 @@ import type { ConfigItemModal, HTableInstance } from "@/components/modal";
2
2
  import type React from "react";
3
3
  import config from "./config";
4
4
  import type { ValueTypeConfigModal } from "../modal";
5
+ import {Typography} from 'antd';
5
6
  export default (
6
7
  item: ConfigItemModal,
7
8
  tableInstance: HTableInstance,
@@ -11,6 +12,11 @@ export default (
11
12
  return (dom: React.ReactNode, itemData: any, index: number) => {
12
13
  const valType = valueType as string;
13
14
  let node = dom;
15
+ if (valType==="text"){
16
+ return <Typography.Paragraph ellipsis={{tooltip:true}} style={{width:"100%",margin:0,padding:0}}>
17
+ fsafjsakfjsaklfjsaklfjsakfjaskfjakfjsaklfjsakfjsakfjskfjskfjfskjfksjffaskfjsak
18
+ </Typography.Paragraph>
19
+ }
14
20
  if (config[valType]) {
15
21
  node = config[valType](item, itemData, index, tableInstance);
16
22
  }
@@ -33,7 +33,7 @@ export const configData = [
33
33
  title: "报警联系人名称",
34
34
  width: 120,
35
35
  dataIndex: "name",
36
- valueType: "copy",
36
+ valueType: "text",
37
37
  valueTypeProps: {
38
38
  ellipsis: {
39
39
  tooltip: true,