@hw-component/table 1.9.39 → 1.9.41
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/.eslintcache +1 -1
- package/es/HTableBody/HeaderTitle/index.js +9 -5
- package/es/HTableBody/index.d.ts +1 -1
- package/es/HTableHeader/hooks/config.d.ts +1 -1
- package/es/HTableHeader/hooks/useHeaderDefaultProps.d.ts +1 -1
- package/es/HTableHeader/hooks/useHideMoreTitle.d.ts +3 -3
- package/es/hooks/useCurrentTable.js +4 -1
- package/es/index.css +1 -0
- package/es/modal.d.ts +1 -1
- package/es/render/Text.d.ts +1 -0
- package/lib/HTableBody/HeaderTitle/index.js +9 -5
- package/lib/HTableBody/index.d.ts +1 -1
- package/lib/HTableHeader/hooks/config.d.ts +1 -1
- package/lib/HTableHeader/hooks/useHeaderDefaultProps.d.ts +1 -1
- package/lib/HTableHeader/hooks/useHideMoreTitle.d.ts +3 -3
- package/lib/hooks/useCurrentTable.js +4 -1
- package/lib/index.css +1 -0
- package/lib/modal.d.ts +1 -1
- package/lib/render/Text.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/DialogTable/hooks.ts +10 -10
- package/src/components/HTableBody/HeaderTitle/index.tsx +9 -5
- package/src/components/HTableBody/index.tsx +4 -3
- package/src/components/HTableHeader/hooks/config.tsx +35 -35
- package/src/components/HTableHeader/hooks/useHeaderDefaultProps.ts +33 -25
- package/src/components/HTableHeader/hooks/useHideMoreTitle.tsx +146 -152
- package/src/components/HTableHeader/index.tsx +21 -7
- package/src/components/hooks/useCurrentTable.ts +4 -1
- package/src/components/index.less +2 -0
- package/src/components/modal.ts +1 -1
- package/src/components/render/config.tsx +3 -3
- package/src/pages/DwTable/index.tsx +7 -5
- package/src/pages/Table/index.tsx +15 -10
|
@@ -15,6 +15,7 @@ var HeaderTitle = (function (_ref) {
|
|
|
15
15
|
rowOnChange = _useHTableContext.rowOnChange,
|
|
16
16
|
allSelectChange = _useHTableContext.allSelectChange;
|
|
17
17
|
var headerBox = useClassName("hw-table-header-title-box");
|
|
18
|
+
var headerBoxContent = useClassName("hw-table-header-title-box-content");
|
|
18
19
|
if (!headerTitle && !rNode) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
@@ -24,11 +25,14 @@ var HeaderTitle = (function (_ref) {
|
|
|
24
25
|
style: contentStyle,
|
|
25
26
|
children: [jsx("div", {
|
|
26
27
|
className: headerBox,
|
|
27
|
-
children:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
children: jsx("div", {
|
|
29
|
+
className: headerBoxContent,
|
|
30
|
+
children: headerTitle && /*#__PURE__*/React.cloneElement(headerTitle, {
|
|
31
|
+
selectedRowData: selectedRowData,
|
|
32
|
+
allSelectChange: allSelectChange,
|
|
33
|
+
rowOnChange: rowOnChange,
|
|
34
|
+
tableInstance: tableInstance
|
|
35
|
+
})
|
|
32
36
|
})
|
|
33
37
|
}), rNode && rNode]
|
|
34
38
|
});
|
package/es/HTableBody/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProTableProps } from "@ant-design/pro-table";
|
|
2
2
|
import type { ActionRenderFn, ConfigDataModal, ParamsModal, HTableInstance, HRowSelection } from "../modal";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { IPaginationProps } from "../HTablePagination";
|
|
4
|
+
import type { IPaginationProps } from "../HTablePagination";
|
|
5
5
|
import type { AffixProps } from "antd/lib/affix";
|
|
6
6
|
import type { OptionConfig } from "@ant-design/pro-table/lib/components/ToolBar";
|
|
7
7
|
export interface OptionModal extends OptionConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IHeaderProps } from "../modal";
|
|
2
|
-
declare const _default: ({ configData, loading, onFinish, hideLabel, labelWidth, table }: IHeaderProps) => {
|
|
2
|
+
declare const _default: ({ configData, loading, onFinish, hideLabel, labelWidth, table, }: IHeaderProps) => {
|
|
3
3
|
tableInstance: import("../../modal").HTableInstance;
|
|
4
4
|
tableLabelWidth: number | undefined;
|
|
5
5
|
tableHideLabel: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHeaderProps } from "../modal";
|
|
2
|
-
import { HItemProps } from "@hw-component/form/es/Form/modal";
|
|
3
|
-
declare const _default: ({ searchSpan, configData, table
|
|
1
|
+
import type { IHeaderProps } from "../modal";
|
|
2
|
+
import type { HItemProps } from "@hw-component/form/es/Form/modal";
|
|
3
|
+
declare const _default: ({ searchSpan, configData, table }: IHeaderProps) => HItemProps[];
|
|
4
4
|
export default _default;
|
|
@@ -22,7 +22,10 @@ var useCurrentTable = (function (_ref) {
|
|
|
22
22
|
resultTable.table.getSelectedRowData = function () {
|
|
23
23
|
return selectedRowData;
|
|
24
24
|
};
|
|
25
|
-
resultTable.table.getTableSourceData = function () {
|
|
25
|
+
resultTable.table.getTableSourceData = function (full) {
|
|
26
|
+
if (full) {
|
|
27
|
+
return dataSource;
|
|
28
|
+
}
|
|
26
29
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.records;
|
|
27
30
|
};
|
|
28
31
|
return resultTable;
|
package/es/index.css
CHANGED
package/es/modal.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface TableInstance {
|
|
|
93
93
|
reloadWithParams: (params?: ParamsModal) => Promise<any>;
|
|
94
94
|
getParams: () => any;
|
|
95
95
|
getSelectedRowData: () => RowObj;
|
|
96
|
-
getTableSourceData: () => any;
|
|
96
|
+
getTableSourceData: (full?: boolean) => any;
|
|
97
97
|
getColSettingKeys: () => ColCheckResultKeys;
|
|
98
98
|
}
|
|
99
99
|
export interface HTableInstance {
|
package/es/render/Text.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ var HeaderTitle = (function (_ref) {
|
|
|
18
18
|
rowOnChange = _useHTableContext.rowOnChange,
|
|
19
19
|
allSelectChange = _useHTableContext.allSelectChange;
|
|
20
20
|
var headerBox = index.useClassName("hw-table-header-title-box");
|
|
21
|
+
var headerBoxContent = index.useClassName("hw-table-header-title-box-content");
|
|
21
22
|
if (!headerTitle && !rNode) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
@@ -27,11 +28,14 @@ var HeaderTitle = (function (_ref) {
|
|
|
27
28
|
style: contentStyle,
|
|
28
29
|
children: [jsxRuntime.jsx("div", {
|
|
29
30
|
className: headerBox,
|
|
30
|
-
children:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
children: jsxRuntime.jsx("div", {
|
|
32
|
+
className: headerBoxContent,
|
|
33
|
+
children: headerTitle && /*#__PURE__*/React.cloneElement(headerTitle, {
|
|
34
|
+
selectedRowData: selectedRowData,
|
|
35
|
+
allSelectChange: allSelectChange,
|
|
36
|
+
rowOnChange: rowOnChange,
|
|
37
|
+
tableInstance: tableInstance
|
|
38
|
+
})
|
|
35
39
|
})
|
|
36
40
|
}), rNode && rNode]
|
|
37
41
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProTableProps } from "@ant-design/pro-table";
|
|
2
2
|
import type { ActionRenderFn, ConfigDataModal, ParamsModal, HTableInstance, HRowSelection } from "../modal";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { IPaginationProps } from "../HTablePagination";
|
|
4
|
+
import type { IPaginationProps } from "../HTablePagination";
|
|
5
5
|
import type { AffixProps } from "antd/lib/affix";
|
|
6
6
|
import type { OptionConfig } from "@ant-design/pro-table/lib/components/ToolBar";
|
|
7
7
|
export interface OptionModal extends OptionConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IHeaderProps } from "../modal";
|
|
2
|
-
declare const _default: ({ configData, loading, onFinish, hideLabel, labelWidth, table }: IHeaderProps) => {
|
|
2
|
+
declare const _default: ({ configData, loading, onFinish, hideLabel, labelWidth, table, }: IHeaderProps) => {
|
|
3
3
|
tableInstance: import("../../modal").HTableInstance;
|
|
4
4
|
tableLabelWidth: number | undefined;
|
|
5
5
|
tableHideLabel: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHeaderProps } from "../modal";
|
|
2
|
-
import { HItemProps } from "@hw-component/form/es/Form/modal";
|
|
3
|
-
declare const _default: ({ searchSpan, configData, table
|
|
1
|
+
import type { IHeaderProps } from "../modal";
|
|
2
|
+
import type { HItemProps } from "@hw-component/form/es/Form/modal";
|
|
3
|
+
declare const _default: ({ searchSpan, configData, table }: IHeaderProps) => HItemProps[];
|
|
4
4
|
export default _default;
|
|
@@ -25,7 +25,10 @@ var useCurrentTable = (function (_ref) {
|
|
|
25
25
|
resultTable.table.getSelectedRowData = function () {
|
|
26
26
|
return selectedRowData;
|
|
27
27
|
};
|
|
28
|
-
resultTable.table.getTableSourceData = function () {
|
|
28
|
+
resultTable.table.getTableSourceData = function (full) {
|
|
29
|
+
if (full) {
|
|
30
|
+
return dataSource;
|
|
31
|
+
}
|
|
29
32
|
return dataSource === null || dataSource === void 0 ? void 0 : dataSource.records;
|
|
30
33
|
};
|
|
31
34
|
return resultTable;
|
package/lib/index.css
CHANGED
package/lib/modal.d.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface TableInstance {
|
|
|
93
93
|
reloadWithParams: (params?: ParamsModal) => Promise<any>;
|
|
94
94
|
getParams: () => any;
|
|
95
95
|
getSelectedRowData: () => RowObj;
|
|
96
|
-
getTableSourceData: () => any;
|
|
96
|
+
getTableSourceData: (full?: boolean) => any;
|
|
97
97
|
getColSettingKeys: () => ColCheckResultKeys;
|
|
98
98
|
}
|
|
99
99
|
export interface HTableInstance {
|
package/lib/render/Text.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -35,16 +35,16 @@ export const useTableProps = ({
|
|
|
35
35
|
request,
|
|
36
36
|
dataSource,
|
|
37
37
|
});
|
|
38
|
-
useEffect(()=>{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},[configData])
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (configData) {
|
|
40
|
+
setModalTableParams((oldVal) => {
|
|
41
|
+
return {
|
|
42
|
+
...oldVal,
|
|
43
|
+
configData,
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, [configData]);
|
|
48
48
|
return {
|
|
49
49
|
modalTableParams,
|
|
50
50
|
setModalTableParams,
|
|
@@ -13,17 +13,21 @@ export default ({ headerTitle, contentStyle, rNode }: IProps) => {
|
|
|
13
13
|
const { tableInstance, selectedRowData, rowOnChange, allSelectChange } =
|
|
14
14
|
useHTableContext();
|
|
15
15
|
const headerBox = useClassName("hw-table-header-title-box");
|
|
16
|
+
const headerBoxContent = useClassName("hw-table-header-title-box-content");
|
|
17
|
+
|
|
16
18
|
if (!headerTitle && !rNode) {
|
|
17
19
|
return null;
|
|
18
20
|
}
|
|
19
21
|
return (
|
|
20
22
|
<Row justify={"space-between"} align={"middle"} style={contentStyle}>
|
|
21
23
|
<div className={headerBox}>
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
<div className={headerBoxContent}>
|
|
25
|
+
{headerTitle &&
|
|
26
|
+
React.cloneElement(
|
|
27
|
+
headerTitle as DetailedReactHTMLElement<any, any>,
|
|
28
|
+
{ selectedRowData, allSelectChange, rowOnChange, tableInstance }
|
|
29
|
+
)}
|
|
30
|
+
</div>
|
|
27
31
|
</div>
|
|
28
32
|
{rNode && rNode}
|
|
29
33
|
</Row>
|
|
@@ -17,7 +17,8 @@ import { useHTableContext } from "../context";
|
|
|
17
17
|
import React from "react";
|
|
18
18
|
import { ConfigProvider, Empty, Alert, Space } from "antd";
|
|
19
19
|
import { useHTableConfigContext } from "../TableConfig";
|
|
20
|
-
import
|
|
20
|
+
import type { IPaginationProps } from "../HTablePagination";
|
|
21
|
+
import HTablePagination from "../HTablePagination";
|
|
21
22
|
import { useClassName } from "../hooks";
|
|
22
23
|
import AlertMsg from "./AlertMsg";
|
|
23
24
|
import type { AffixProps } from "antd/lib/affix";
|
|
@@ -31,7 +32,7 @@ export interface OptionModal extends OptionConfig {
|
|
|
31
32
|
export interface HTableBodyProps
|
|
32
33
|
extends Omit<
|
|
33
34
|
ProTableProps<any, any>,
|
|
34
|
-
"dataSource" | "rowSelection" | "options"|"pagination"
|
|
35
|
+
"dataSource" | "rowSelection" | "options" | "pagination"
|
|
35
36
|
> {
|
|
36
37
|
configData?: ConfigDataModal;
|
|
37
38
|
onPageChange?: (params: ParamsModal) => void;
|
|
@@ -51,7 +52,7 @@ export interface HTableBodyProps
|
|
|
51
52
|
localSorter?: boolean;
|
|
52
53
|
options?: OptionModal | false;
|
|
53
54
|
table?: HTableInstance;
|
|
54
|
-
pagination?:IPaginationProps|false;
|
|
55
|
+
pagination?: IPaginationProps | false;
|
|
55
56
|
}
|
|
56
57
|
const defaultRender = () => {
|
|
57
58
|
return <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import {HFormInstance, HItemProps} from "@hw-component/form/es/Form/modal";
|
|
1
|
+
import type { HFormInstance, HItemProps } from "@hw-component/form/es/Form/modal";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {DefaultSubComponent} from "../defaultSubComponent";
|
|
3
|
+
import { DefaultSubComponent } from "../defaultSubComponent";
|
|
4
4
|
|
|
5
5
|
export const sizeObj = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
6
|
+
xl: {
|
|
7
|
+
min: 1200,
|
|
8
|
+
max: 1600,
|
|
9
|
+
},
|
|
10
|
+
xxl: {
|
|
11
|
+
min: 1600,
|
|
12
|
+
},
|
|
13
|
+
lg: {
|
|
14
|
+
min: 992,
|
|
15
|
+
max: 1200,
|
|
16
|
+
},
|
|
17
|
+
md: {
|
|
18
|
+
min: 768,
|
|
19
|
+
max: 992,
|
|
20
|
+
},
|
|
21
|
+
sm: {
|
|
22
|
+
min: 576,
|
|
23
|
+
max: 768,
|
|
24
|
+
},
|
|
25
|
+
xs: {
|
|
26
|
+
max: 576,
|
|
27
|
+
},
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const defaultSubItem = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
type: "submit",
|
|
32
|
+
itemProps: {
|
|
33
|
+
position: "end",
|
|
34
|
+
},
|
|
35
|
+
style: {
|
|
36
|
+
padding: 0,
|
|
37
|
+
marginLeft: -20,
|
|
38
|
+
},
|
|
39
|
+
render: (item: HItemProps, node: React.ReactNode, form: HFormInstance) => {
|
|
40
|
+
return <DefaultSubComponent form={form} />;
|
|
41
|
+
},
|
|
42
42
|
};
|
|
@@ -2,28 +2,36 @@ import type { IHeaderProps } from "../modal";
|
|
|
2
2
|
import { useHTableContext } from "../../context";
|
|
3
3
|
import useHTable from "../../hooks/useHTable";
|
|
4
4
|
|
|
5
|
-
export default ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
5
|
+
export default ({
|
|
6
|
+
configData,
|
|
7
|
+
loading,
|
|
8
|
+
onFinish,
|
|
9
|
+
hideLabel,
|
|
10
|
+
labelWidth,
|
|
11
|
+
table,
|
|
12
|
+
}: IHeaderProps) => {
|
|
13
|
+
const {
|
|
14
|
+
tableInstance: contextTableInstance,
|
|
15
|
+
loading: contextLoading,
|
|
16
|
+
onFinish: contextOnFinish,
|
|
17
|
+
configData: contextConfigData,
|
|
18
|
+
hideLabel: contextHideLabel,
|
|
19
|
+
labelWidth: contextLabelWidth,
|
|
20
|
+
} = useHTableContext();
|
|
21
|
+
const defaultTable = useHTable();
|
|
22
|
+
const headerConfigData = configData || contextConfigData;
|
|
23
|
+
const submitLoading = contextLoading || loading;
|
|
24
|
+
const subOnFinish = onFinish || contextOnFinish;
|
|
25
|
+
const tableHideLabel =
|
|
26
|
+
typeof hideLabel === "undefined" ? contextHideLabel : hideLabel;
|
|
27
|
+
const tableLabelWidth = labelWidth || contextLabelWidth;
|
|
28
|
+
const tableInstance = table || contextTableInstance;
|
|
29
|
+
return {
|
|
30
|
+
tableInstance: tableInstance || defaultTable,
|
|
31
|
+
tableLabelWidth,
|
|
32
|
+
tableHideLabel,
|
|
33
|
+
subOnFinish,
|
|
34
|
+
submitLoading,
|
|
35
|
+
headerConfigData,
|
|
36
|
+
};
|
|
37
|
+
};
|