@hw-component/table 0.0.2-beta-v1 → 0.0.2-beta-v2
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/Body/hooks.d.ts +1046 -2542
- package/es/Body/hooks.js +35 -90
- package/es/Body/index.d.ts +6 -20
- package/es/Body/index.js +62 -134
- package/es/Footer/index.d.ts +4 -12
- package/es/Footer/index.js +52 -103
- package/es/Header/index.d.ts +6 -12
- package/es/Header/index.js +32 -76
- package/es/Header/utils.d.ts +3 -5
- package/es/Header/utils.js +14 -21
- package/es/Table.d.ts +1 -16
- package/es/Table.js +53 -119
- package/es/TableConfig.d.ts +5 -10
- package/es/TableConfig.js +6 -6
- package/es/context.d.ts +5 -5
- package/es/context.js +2 -2
- package/es/hooks/useCurrentTable.d.ts +5 -10
- package/es/hooks/useCurrentTable.js +11 -14
- package/es/hooks/useHTable.d.ts +6 -6
- package/es/hooks/useHTable.js +6 -6
- package/es/hooks/useRowObj.d.ts +2 -2
- package/es/hooks/useRowObj.js +6 -6
- package/es/index.js +3 -3
- package/es/modal.d.ts +35 -54
- package/lib/Body/hooks.d.ts +1046 -2542
- package/lib/Body/hooks.js +36 -91
- package/lib/Body/index.d.ts +6 -20
- package/lib/Body/index.js +64 -136
- package/lib/Footer/index.d.ts +4 -12
- package/lib/Footer/index.js +54 -105
- package/lib/Header/index.d.ts +6 -12
- package/lib/Header/index.js +34 -78
- package/lib/Header/utils.d.ts +3 -5
- package/lib/Header/utils.js +15 -22
- package/lib/Table.d.ts +1 -16
- package/lib/Table.js +55 -121
- package/lib/TableConfig.d.ts +5 -10
- package/lib/TableConfig.js +8 -8
- package/lib/context.d.ts +5 -5
- package/lib/context.js +3 -3
- package/lib/hooks/useCurrentTable.d.ts +5 -10
- package/lib/hooks/useCurrentTable.js +13 -16
- package/lib/hooks/useHTable.d.ts +6 -6
- package/lib/hooks/useHTable.js +8 -8
- package/lib/hooks/useRowObj.d.ts +2 -2
- package/lib/hooks/useRowObj.js +8 -8
- package/lib/index.js +6 -4
- package/lib/modal.d.ts +35 -54
- package/package.json +1 -1
- package/src/components/Body/index.tsx +4 -1
- package/src/components/Footer/index.tsx +5 -1
- package/src/components/Header/index.tsx +1 -0
package/es/hooks/useRowObj.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
import _slicedToArray from
|
|
3
|
-
import { useState } from
|
|
2
|
+
import _slicedToArray from '@babel/runtime-corejs3/helpers/slicedToArray';
|
|
3
|
+
import { useState } from 'react';
|
|
4
4
|
|
|
5
|
-
var useRowObj = function () {
|
|
5
|
+
var useRowObj = (function () {
|
|
6
6
|
var _useState = useState({}),
|
|
7
7
|
_useState2 = _slicedToArray(_useState, 2),
|
|
8
8
|
selectedRowData = _useState2[0],
|
|
@@ -10,14 +10,14 @@ var useRowObj = function () {
|
|
|
10
10
|
var rowOnChange = function rowOnChange(keys, rowData) {
|
|
11
11
|
setSelectedRowData({
|
|
12
12
|
keys: keys,
|
|
13
|
-
rowData: rowData
|
|
13
|
+
rowData: rowData
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
return {
|
|
17
17
|
rowOnChange: rowOnChange,
|
|
18
|
-
selectedRowData: selectedRowData
|
|
18
|
+
selectedRowData: selectedRowData
|
|
19
19
|
};
|
|
20
|
-
};
|
|
20
|
+
});
|
|
21
21
|
|
|
22
22
|
export { useRowObj as default };
|
|
23
23
|
// powered by hdj
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// welcome to hoo hoo hoo
|
|
2
|
-
export { default as HTable } from
|
|
3
|
-
export { default as useHTable } from
|
|
4
|
-
export { default as HTableConfig } from
|
|
2
|
+
export { default as HTable } from './Table.js';
|
|
3
|
+
export { default as useHTable } from './hooks/useHTable.js';
|
|
4
|
+
export { default as HTableConfig } from './TableConfig.js';
|
|
5
5
|
// powered by hdj
|
package/es/modal.d.ts
CHANGED
|
@@ -1,76 +1,57 @@
|
|
|
1
1
|
import type { ProColumns } from "@ant-design/pro-table/lib/typing";
|
|
2
2
|
import type { ProTableProps } from "@ant-design/pro-table";
|
|
3
|
-
import type {
|
|
4
|
-
HItemProps,
|
|
5
|
-
HFormInstance,
|
|
6
|
-
} from "@hw-component/form/es/Form/modal";
|
|
3
|
+
import type { HItemProps, HFormInstance } from "@hw-component/form/es/Form/modal";
|
|
7
4
|
import type { ColProps } from "antd";
|
|
8
5
|
import type React from "react";
|
|
9
6
|
export interface RowObj {
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
keys?: React.Key[];
|
|
8
|
+
rowData?: any[];
|
|
12
9
|
}
|
|
13
10
|
export interface ResultModal {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
records: any[];
|
|
12
|
+
current: string;
|
|
13
|
+
size: string;
|
|
14
|
+
total: string;
|
|
18
15
|
}
|
|
19
16
|
export interface ParamsModal extends Record<string, any> {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
size?: number;
|
|
18
|
+
current?: number;
|
|
22
19
|
}
|
|
23
20
|
interface HColumns extends Omit<ProColumns, "render"> {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
tableInstance: HTableInstance
|
|
29
|
-
) => React.ReactNode;
|
|
30
|
-
showSearch?: boolean;
|
|
31
|
-
searchType?: HItemProps["type"];
|
|
32
|
-
searchRender?: HItemProps["render"];
|
|
21
|
+
render?: (dom: React.ReactNode, data: any, index: number, tableInstance: HTableInstance) => React.ReactNode;
|
|
22
|
+
showSearch?: boolean;
|
|
23
|
+
searchType?: HItemProps["type"];
|
|
24
|
+
searchRender?: HItemProps["render"];
|
|
33
25
|
}
|
|
34
26
|
export type ConfigItemModal = Omit<HItemProps, "render" | "type"> & HColumns;
|
|
35
27
|
export type ConfigDataModal = ConfigItemModal[];
|
|
36
|
-
export type ActionRenderFn = (
|
|
37
|
-
allCheck: boolean,
|
|
38
|
-
selectedRowKeys: RowObj,
|
|
39
|
-
tableInstance: HTableInstance
|
|
40
|
-
) => React.ReactNode;
|
|
28
|
+
export type ActionRenderFn = (allCheck: boolean, selectedRowKeys: RowObj, tableInstance: HTableInstance) => React.ReactNode;
|
|
41
29
|
type actionFn = (...arg: any[]) => void;
|
|
42
|
-
type FooterRenderFn = (
|
|
43
|
-
tableInstance: HTableInstance,
|
|
44
|
-
selectedRowData: RowObj,
|
|
45
|
-
data?: ResultModal
|
|
46
|
-
) => React.ReactNode;
|
|
30
|
+
type FooterRenderFn = (tableInstance: HTableInstance, selectedRowData: RowObj, data?: ResultModal) => React.ReactNode;
|
|
47
31
|
export interface HTableProps extends Omit<ProTableProps<any, any>, "request"> {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
footerStyle?: React.CSSProperties;
|
|
64
|
-
spaceSize?: number;
|
|
65
|
-
className?: string;
|
|
32
|
+
request: (params: ParamsModal) => Promise<ResultModal>;
|
|
33
|
+
configData: ConfigDataModal;
|
|
34
|
+
searchSpan?: ColProps;
|
|
35
|
+
table?: HTableInstance;
|
|
36
|
+
actionRender?: ActionRenderFn;
|
|
37
|
+
emptyRender?: (tableInstance: HTableInstance) => React.ReactNode;
|
|
38
|
+
errorRender?: (tableInstance: HTableInstance, error: Error) => React.ReactNode;
|
|
39
|
+
footerRender?: FooterRenderFn | false;
|
|
40
|
+
hideHeader?: boolean;
|
|
41
|
+
action?: Record<string, actionFn>;
|
|
42
|
+
headerStyle?: React.CSSProperties;
|
|
43
|
+
tableStyle?: React.CSSProperties;
|
|
44
|
+
footerStyle?: React.CSSProperties;
|
|
45
|
+
spaceSize?: number;
|
|
46
|
+
className?: string;
|
|
66
47
|
}
|
|
67
48
|
export interface TableInstance {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
49
|
+
reload: (params?: ParamsModal) => void;
|
|
50
|
+
setSelectedRowData: (keys: React.Key[], data: any) => void;
|
|
51
|
+
dispatch: (key: string, params: any) => void;
|
|
71
52
|
}
|
|
72
53
|
export interface HTableInstance {
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
form: HFormInstance;
|
|
55
|
+
table: TableInstance;
|
|
75
56
|
}
|
|
76
57
|
export {};
|