@hw-component/table 1.2.1 → 1.2.3

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.
Files changed (41) hide show
  1. package/.eslintcache +1 -1
  2. package/es/HTableBody/RowSelection.d.ts +2 -1
  3. package/es/HTableBody/RowSelection.js +4 -3
  4. package/es/HTableBody/hooks.js +2 -1
  5. package/es/HTableBody/index.d.ts +1 -1
  6. package/es/HTableBody/index.js +63 -63
  7. package/es/HTableHeader/index.js +6 -15
  8. package/es/HTablePagination/index.js +7 -2
  9. package/es/Table.js +5 -4
  10. package/es/TableConfig.d.ts +7 -1
  11. package/es/TableConfig.js +12 -3
  12. package/es/context.d.ts +0 -1
  13. package/es/index.css +27 -5
  14. package/es/modal.d.ts +3 -2
  15. package/lib/HTableBody/RowSelection.d.ts +2 -1
  16. package/lib/HTableBody/RowSelection.js +4 -3
  17. package/lib/HTableBody/hooks.js +2 -1
  18. package/lib/HTableBody/index.d.ts +1 -1
  19. package/lib/HTableBody/index.js +62 -62
  20. package/lib/HTableHeader/index.js +6 -15
  21. package/lib/HTablePagination/index.js +7 -2
  22. package/lib/Table.js +9 -8
  23. package/lib/TableConfig.d.ts +7 -1
  24. package/lib/TableConfig.js +12 -3
  25. package/lib/context.d.ts +0 -1
  26. package/lib/index.css +27 -5
  27. package/lib/modal.d.ts +3 -2
  28. package/package.json +1 -1
  29. package/src/components/HTableBody/Options/index.tsx +26 -20
  30. package/src/components/HTableBody/Options/modal.d.ts +2 -2
  31. package/src/components/HTableBody/RowSelection.tsx +5 -3
  32. package/src/components/HTableBody/hooks.tsx +2 -1
  33. package/src/components/HTableBody/index.tsx +75 -78
  34. package/src/components/HTableHeader/index.tsx +3 -5
  35. package/src/components/HTablePagination/index.tsx +5 -2
  36. package/src/components/Table.tsx +6 -4
  37. package/src/components/TableConfig.tsx +11 -1
  38. package/src/components/context.ts +0 -1
  39. package/src/components/index.less +30 -6
  40. package/src/components/modal.ts +4 -3
  41. package/src/pages/Table/index.tsx +85 -79
@@ -1,7 +1,7 @@
1
- import { HTable, useHTable } from "@/components";
2
- import {Button, Tooltip} from "antd";
1
+ import { HTable, useHTable ,HTableConfig} from "@/components";
2
+ import {Button, Card, Tooltip} from "antd";
3
3
  import { HFormConfigProvider } from "@hw-component/form";
4
- import {SettingOutlined} from "@ant-design/icons";
4
+ import { SettingOutlined } from "@ant-design/icons";
5
5
 
6
6
  const configData = [
7
7
  {
@@ -9,7 +9,6 @@ const configData = [
9
9
  showSearch: true,
10
10
  searchType: "rangePicker",
11
11
  dataIndex: "id",
12
- searchLabel: "fff",
13
12
  sorter: true,
14
13
  itemProps: {
15
14
  options: [{ label: "1", value: 1 }],
@@ -22,7 +21,6 @@ const configData = [
22
21
  },
23
22
  {
24
23
  title: "座位断开",
25
- showSearch: true,
26
24
  dataIndex: "name1",
27
25
  childrenDataIndex: [
28
26
  {
@@ -41,7 +39,6 @@ const configData = [
41
39
  {
42
40
  title: <div>座位fff</div>,
43
41
  titleStr: "座位",
44
- showSearch: true,
45
42
  dataIndex: "name2",
46
43
  searchType: "select",
47
44
  sorter: true,
@@ -54,9 +51,8 @@ const configData = [
54
51
  name: "aaa",
55
52
  fixed: "right",
56
53
  width: 200,
57
- showSearch: true,
58
54
  render: () => {
59
- return <div>fff</div>;
55
+ return <Card>fff</Card>;
60
56
  },
61
57
  },
62
58
  ];
@@ -67,7 +63,9 @@ const Test = ({ name, selectedRowData }) => {
67
63
  export default () => {
68
64
  const hTable = useHTable();
69
65
  return (
70
- <HFormConfigProvider>
66
+ <HFormConfigProvider
67
+
68
+ >
71
69
  <div>
72
70
  <div
73
71
  onClick={() => {
@@ -76,78 +74,86 @@ export default () => {
76
74
  >
77
75
  获取
78
76
  </div>
79
- <HTable
80
- configData={configData}
81
- rowKey={"id"}
82
- table={hTable}
83
- onReset={() => {
84
- hTable.form.setFieldsValue({
85
- name1: "ffff",
86
- });
87
- }}
88
- hideLabel={false}
89
- labelWidth={88}
90
- action={{
91
- test: (params) => {
92
- console.log(params, "lllll");
93
- },
94
- }}
95
- rowSelection={{
96
- allPageCheck: false,
97
- }}
98
- affixProps={{
99
- target: () => document.querySelector(".body"),
100
- }}
101
- scroll={{
102
- x: 1000,
103
- }}
104
- columnsState={{
105
- persistenceKey: "test",
106
- persistenceType: "localStorage",
107
- }}
108
- formInitValues={{
109
- name2: 1,
110
- }}
111
- headerTitle={
112
- <Button
113
- type={"primary"}
114
- onClick={() => {
115
- console.log(hTable.table.getColSettingKeys());
77
+ <HTableConfig>
78
+ <HTable
79
+ configData={configData}
80
+ rowKey={(data,index)=>{
81
+ return index;
116
82
  }}
117
- >
118
- 操作
119
- </Button>
120
- }
121
- paginationActionRender={() => {
122
- return <div>你大爷</div>;
123
- }}
124
- request={(params) => {
125
- const { current = 1, size = "10" } = params;
126
- const arrayData = [];
127
- for (let i = 0; i < 100; i = i + 1) {
128
- arrayData.push({
129
- id: i,
130
- name: "11",
131
- });
132
- }
133
- return new Promise((resolve, reject) => {
134
- setTimeout(() => {
135
- // reject(new Error("错误"));
136
- resolve({
137
- size: size,
138
- current: current.toString(10),
139
- total: "1000",
140
- records: arrayData,
83
+ table={hTable}
84
+ onReset={() => {
85
+ hTable.form.setFieldsValue({
86
+ name1: "ffff",
141
87
  });
142
- }, 2000);
143
- });
144
- }}
145
- options={{
146
- settingRender:()=>{
147
- return <Tooltip title="321312312312321"><SettingOutlined width={24} /></Tooltip>
148
- }
149
- }}
150
- />
88
+ }}
89
+ hideLabel={false}
90
+ labelWidth={88}
91
+ action={{
92
+ test: (params) => {
93
+ console.log(params, "lllll");
94
+ },
95
+ }}
96
+ rowSelection={{
97
+ allPageCheck: false,
98
+ }}
99
+ affixProps={{
100
+ target: () => document.querySelector(".body"),
101
+ }}
102
+ scroll={{
103
+ x: 1000,
104
+ }}
105
+ columnsState={{
106
+ persistenceKey: "test",
107
+ persistenceType: "localStorage",
108
+ }}
109
+ formInitValues={{
110
+ name2: 1,
111
+ }}
112
+ headerTitle={
113
+ <Button
114
+ type={"primary"}
115
+ onClick={() => {
116
+ console.log(hTable.table.getColSettingKeys());
117
+ }}
118
+ >
119
+ 操作
120
+ </Button>
121
+ }
122
+ paginationActionRender={() => {
123
+ return <div>你大爷</div>;
124
+ }}
125
+ request={(params) => {
126
+ const { current = 1, size = "10" } = params;
127
+ const arrayData = [];
128
+ for (let i = 0; i < 100; i = i + 1) {
129
+ arrayData.push({
130
+ id: i,
131
+ name: "11",
132
+ });
133
+ }
134
+ return new Promise((resolve, reject) => {
135
+ setTimeout(() => {
136
+ // reject(new Error("错误"));
137
+ resolve({
138
+ size: size,
139
+ current: current.toString(10),
140
+ total: "1000",
141
+ records: arrayData,
142
+ });
143
+ }, 2000);
144
+ });
145
+ }}
146
+ options={{
147
+ settingRender: () => {
148
+ return (
149
+ <Tooltip title="321312312312321">
150
+ <SettingOutlined width={24} />
151
+ </Tooltip>
152
+ );
153
+ },
154
+ }}
155
+ />
156
+ </HTableConfig>
151
157
  </div>
152
158
  </HFormConfigProvider>
153
159
  );