@hw-component/table 1.9.71 → 1.9.76

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.
@@ -16,6 +16,7 @@ var HeaderTitle = (function (_ref) {
16
16
  allSelectChange = _useHTableContext.allSelectChange;
17
17
  var headerBox = useClassName("hw-table-header-title-box");
18
18
  var headerBoxContent = useClassName("hw-table-header-title-box-content");
19
+ var rightNodeClassname = useClassName("hw-table-header-right-node");
19
20
  if (!headerTitle && !rNode) {
20
21
  return null;
21
22
  }
@@ -34,7 +35,10 @@ var HeaderTitle = (function (_ref) {
34
35
  tableInstance: tableInstance
35
36
  })
36
37
  })
37
- }), rNode && rNode]
38
+ }), rNode && jsx("div", {
39
+ className: rightNodeClassname,
40
+ children: rNode
41
+ })]
38
42
  });
39
43
  });
40
44
 
package/es/index.css CHANGED
@@ -118,12 +118,17 @@
118
118
  display: -ms-flexbox;
119
119
  display: flex;
120
120
  position: relative;
121
- margin-right: 12px;
122
- overflow: auto;
121
+ padding: 10px;
122
+ margin: -10px;
123
+ overflow-x: auto;
124
+ box-sizing: border-box;
123
125
  }
124
126
  .ant-hw-table-header-title-box .ant-hw-table-header-title-box-content {
125
127
  white-space: nowrap;
126
128
  }
129
+ .ant-hw-table-header-right-node {
130
+ padding-left: 12px;
131
+ }
127
132
  .ant-hw-table-render-copy {
128
133
  margin-bottom: 0 !important;
129
134
  color: #1890ff !important;
@@ -17,6 +17,7 @@ interface IProps {
17
17
  maxLen?: number | null;
18
18
  popoverContentRender?: (node: React.ReactNode) => React.ReactNode;
19
19
  contentItemRender?: (item: any) => React.ReactNode;
20
+ extra?: React.ReactNode;
20
21
  }
21
22
  declare const TagsComponent: (props: IProps) => JSX.Element;
22
23
  export default TagsComponent;
@@ -48,7 +48,8 @@ var TagsComponent = function TagsComponent(props) {
48
48
  tooltip = props.tooltip,
49
49
  tableInstance = props.tableInstance,
50
50
  maxLen = props.maxLen,
51
- popoverContentRender = props.popoverContentRender;
51
+ popoverContentRender = props.popoverContentRender,
52
+ extra = props.extra;
52
53
  var _fieldNames$label = fieldNames.label,
53
54
  label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
54
55
  _fieldNames$value = fieldNames.value,
@@ -118,7 +119,7 @@ var TagsComponent = function TagsComponent(props) {
118
119
  children: jsxs(Tag, {
119
120
  children: ["...\u7B49", data.length, "\u4E2A"]
120
121
  })
121
- })]
122
+ }), extra]
122
123
  });
123
124
  };
124
125
 
@@ -19,6 +19,7 @@ var HeaderTitle = (function (_ref) {
19
19
  allSelectChange = _useHTableContext.allSelectChange;
20
20
  var headerBox = index.useClassName("hw-table-header-title-box");
21
21
  var headerBoxContent = index.useClassName("hw-table-header-title-box-content");
22
+ var rightNodeClassname = index.useClassName("hw-table-header-right-node");
22
23
  if (!headerTitle && !rNode) {
23
24
  return null;
24
25
  }
@@ -37,7 +38,10 @@ var HeaderTitle = (function (_ref) {
37
38
  tableInstance: tableInstance
38
39
  })
39
40
  })
40
- }), rNode && rNode]
41
+ }), rNode && jsxRuntime.jsx("div", {
42
+ className: rightNodeClassname,
43
+ children: rNode
44
+ })]
41
45
  });
42
46
  });
43
47
 
package/lib/index.css CHANGED
@@ -118,12 +118,17 @@
118
118
  display: -ms-flexbox;
119
119
  display: flex;
120
120
  position: relative;
121
- margin-right: 12px;
122
- overflow: auto;
121
+ padding: 10px;
122
+ margin: -10px;
123
+ overflow-x: auto;
124
+ box-sizing: border-box;
123
125
  }
124
126
  .ant-hw-table-header-title-box .ant-hw-table-header-title-box-content {
125
127
  white-space: nowrap;
126
128
  }
129
+ .ant-hw-table-header-right-node {
130
+ padding-left: 12px;
131
+ }
127
132
  .ant-hw-table-render-copy {
128
133
  margin-bottom: 0 !important;
129
134
  color: #1890ff !important;
@@ -17,6 +17,7 @@ interface IProps {
17
17
  maxLen?: number | null;
18
18
  popoverContentRender?: (node: React.ReactNode) => React.ReactNode;
19
19
  contentItemRender?: (item: any) => React.ReactNode;
20
+ extra?: React.ReactNode;
20
21
  }
21
22
  declare const TagsComponent: (props: IProps) => JSX.Element;
22
23
  export default TagsComponent;
@@ -51,7 +51,8 @@ var TagsComponent = function TagsComponent(props) {
51
51
  tooltip = props.tooltip,
52
52
  tableInstance = props.tableInstance,
53
53
  maxLen = props.maxLen,
54
- popoverContentRender = props.popoverContentRender;
54
+ popoverContentRender = props.popoverContentRender,
55
+ extra = props.extra;
55
56
  var _fieldNames$label = fieldNames.label,
56
57
  label = _fieldNames$label === void 0 ? "label" : _fieldNames$label,
57
58
  _fieldNames$value = fieldNames.value,
@@ -121,7 +122,7 @@ var TagsComponent = function TagsComponent(props) {
121
122
  children: jsxRuntime.jsxs(antd.Tag, {
122
123
  children: ["...\u7B49", data.length, "\u4E2A"]
123
124
  })
124
- })]
125
+ }), extra]
125
126
  });
126
127
  };
127
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/table",
3
- "version": "1.9.71",
3
+ "version": "1.9.76",
4
4
  "description": "基于antd二次开发table组件",
5
5
  "keywords": [
6
6
  "table"
@@ -14,7 +14,7 @@ export default ({ headerTitle, contentStyle, rNode }: IProps) => {
14
14
  useHTableContext();
15
15
  const headerBox = useClassName("hw-table-header-title-box");
16
16
  const headerBoxContent = useClassName("hw-table-header-title-box-content");
17
-
17
+ const rightNodeClassname=useClassName("hw-table-header-right-node");
18
18
  if (!headerTitle && !rNode) {
19
19
  return null;
20
20
  }
@@ -29,7 +29,7 @@ export default ({ headerTitle, contentStyle, rNode }: IProps) => {
29
29
  )}
30
30
  </div>
31
31
  </div>
32
- {rNode && rNode}
32
+ {rNode && <div className={rightNodeClassname}>{rNode}</div>}
33
33
  </Row>
34
34
  );
35
35
  };
@@ -109,16 +109,22 @@
109
109
  .@{ant-prefix}-hw-table-pointer-not-hover{
110
110
  cursor: pointer;
111
111
  }
112
+
112
113
  .@{ant-prefix}-hw-table-header-title-box{
113
114
  flex: 1;
114
115
  display: flex;
115
116
  position: relative;
116
- margin-right: 12px;
117
- overflow: auto;
117
+ padding: 10px;
118
+ margin: -10px;
119
+ overflow-x: auto;
120
+ box-sizing: border-box;
118
121
  .@{ant-prefix}-hw-table-header-title-box-content{
119
122
  white-space: nowrap;
120
123
  }
121
124
  }
125
+ .@{ant-prefix}-hw-table-header-right-node{
126
+ padding-left: 12px;
127
+ }
122
128
 
123
129
  .@{ant-prefix}-hw-table-render-copy{
124
130
  margin-bottom: 0 !important;
@@ -15,6 +15,7 @@ interface IProps {
15
15
  maxLen?: number | null;
16
16
  popoverContentRender?:(node:React.ReactNode)=>React.ReactNode;
17
17
  contentItemRender?:(item:any)=>React.ReactNode;
18
+ extra?:React.ReactNode;
18
19
  }
19
20
  const getTooltipProps = (
20
21
  title: string,
@@ -46,7 +47,8 @@ const TagsComponent = (props: IProps) => {
46
47
  tooltip,
47
48
  tableInstance,
48
49
  maxLen,
49
- popoverContentRender
50
+ popoverContentRender,
51
+ extra
50
52
  } = props;
51
53
  const { label = "label", value = "value" } = fieldNames;
52
54
  const { tagData, moreTag } = useMemo(() => {
@@ -118,6 +120,7 @@ const TagsComponent = (props: IProps) => {
118
120
  <Tag>...等{data.length}个</Tag>
119
121
  </Popover>
120
122
  )}
123
+ {extra}
121
124
  </Row>
122
125
  );
123
126
  };
@@ -5,7 +5,7 @@ import {
5
5
  HTableHeaderSubBtn,
6
6
  HTableHeader,
7
7
  } from "@/components";
8
- import { Button, Card, Tooltip, Typography, Tag, Row } from "antd";
8
+ import {Button, Card, Tooltip, Typography, Tag, Row, Space} from "antd";
9
9
  import { HFormConfigProvider } from "@hw-component/form";
10
10
  import { SettingOutlined } from "@ant-design/icons";
11
11
  import ProTable from "@ant-design/pro-table";
@@ -230,22 +230,32 @@ export default () => {
230
230
  total: 100,
231
231
  });
232
232
  }}
233
- tableExtraRender={() => {
234
- return <div>ffff</div>;
235
- }}
236
233
  headerTitle={
237
- <div>
238
- <div style={{ width: "2000px", backgroundColor: "red" }}>
239
- <Button
240
- type={"primary"}
234
+ <Space size={8} style={{backgroundColor:"red"}}>
235
+ <div style={{width:2000}}>
236
+ <Button
237
+ onClick={() => {
238
+ console.log(hTable.table.getColSettingKeys());
239
+ }}
240
+ >
241
+ 操作
242
+ </Button>
243
+ </div>
244
+ <Button
245
+ onClick={() => {
246
+ console.log(hTable.table.getColSettingKeys());
247
+ }}
248
+ >
249
+ 操作
250
+ </Button>
251
+ <Button
241
252
  onClick={() => {
242
253
  console.log(hTable.table.getColSettingKeys());
243
254
  }}
244
- >
245
- 操作
246
- </Button>
247
- </div>
248
- </div>
255
+ >
256
+ 操作
257
+ </Button>
258
+ </Space>
249
259
  }
250
260
  options={{
251
261
  settingRender: () => {