@pisell/materials 1.0.406 → 1.0.408
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/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +4 -4
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +16 -59
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +19 -62
- package/dist/umd/materials.min.css +1 -0
- package/dist/umd/materials.min.js +1 -0
- package/dist/umd/static/DotsSix.57d66266.svg +1 -0
- package/dist/umd/static/arrow-left.e542294f.svg +1 -0
- package/dist/umd/static/arrow-right.763f03e0.svg +1 -0
- package/dist/umd/static/filter-lines.04a54ae9.svg +1 -0
- package/dist/umd/static/help-circle.31c9be40.svg +1 -0
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +1 -0
- package/es/components/date-picker/index.js +2 -2
- package/es/components/drag-sort-tree/index.d.ts +1 -0
- package/es/components/drag-sort-tree/index.js +1 -2
- package/es/components/page/index.js +2 -4
- package/es/components/pisell-config-provider/index.js +0 -2
- package/es/components/pisellModal/components/functions/index.d.ts +5 -23
- package/es/components/pisellModal/components/functions/index.js +2 -7
- package/es/components/pisellModal/index.d.ts +5 -20
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.js +26 -30
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.js +1 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.js +21 -25
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.js +31 -34
- package/es/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/es/components/table/Actions/component/ExportImport/index.js +25 -32
- package/es/components/table/BasicTable/index.js +3 -5
- package/es/components/table/Gallery/index.js +1 -2
- package/es/components/table/Table/fields/rangePicker/Edit/index.js +11 -13
- package/es/components/table/Table/index.d.ts +2 -2
- package/es/components/table/Table/index.js +42 -68
- package/es/components/table/Table/index.less +0 -3
- package/es/components/table/Table/utils.d.ts +2 -14
- package/es/components/table/Table/utils.js +2 -6
- package/es/components/table/View/index.d.ts +2 -2
- package/es/components/table/View/index.js +16 -27
- package/es/components/table/hooks/useGenScroll.js +1 -1
- package/es/components/table/hooks/useTableSetting.js +7 -29
- package/es/components/table/hooks/useTransDataSource.d.ts +0 -1
- package/es/components/table/hooks/useTransDataSource.js +6 -8
- package/es/components/table/index.js +5 -7
- package/es/components/table/index.less +0 -9
- package/es/components/table/serve.d.ts +0 -1
- package/es/components/table/serve.js +7 -38
- package/es/components/table/types.d.ts +0 -2
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -3
- package/es/locales/en-US.d.ts +0 -12
- package/es/locales/en-US.js +0 -13
- package/es/locales/zh-CN.d.ts +0 -12
- package/es/locales/zh-CN.js +0 -13
- package/es/locales/zh-TW.d.ts +0 -12
- package/es/locales/zh-TW.js +0 -13
- package/lib/components/date-picker/index.js +2 -2
- package/lib/components/drag-sort-tree/index.d.ts +1 -0
- package/lib/components/drag-sort-tree/index.js +1 -0
- package/lib/components/page/index.js +2 -3
- package/lib/components/pisell-config-provider/index.js +0 -2
- package/lib/components/pisellModal/components/functions/index.d.ts +5 -23
- package/lib/components/pisellModal/components/functions/index.js +7 -13
- package/lib/components/pisellModal/index.d.ts +5 -20
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.js +2 -6
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js +1 -2
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.js +2 -6
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.js +2 -4
- package/lib/components/table/Actions/component/ExportImport/index.d.ts +3 -3
- package/lib/components/table/Actions/component/ExportImport/index.js +8 -13
- package/lib/components/table/BasicTable/index.js +3 -2
- package/lib/components/table/Gallery/index.js +1 -2
- package/lib/components/table/Table/fields/rangePicker/Edit/index.js +9 -1
- package/lib/components/table/Table/index.d.ts +2 -2
- package/lib/components/table/Table/index.js +34 -61
- package/lib/components/table/Table/index.less +0 -3
- package/lib/components/table/Table/utils.d.ts +2 -14
- package/lib/components/table/Table/utils.js +1 -7
- package/lib/components/table/View/index.d.ts +2 -2
- package/lib/components/table/View/index.js +19 -28
- package/lib/components/table/hooks/useGenScroll.js +1 -1
- package/lib/components/table/hooks/useTableSetting.js +11 -26
- package/lib/components/table/hooks/useTransDataSource.d.ts +0 -1
- package/lib/components/table/hooks/useTransDataSource.js +5 -6
- package/lib/components/table/index.js +4 -4
- package/lib/components/table/index.less +0 -9
- package/lib/components/table/serve.d.ts +0 -1
- package/lib/components/table/serve.js +4 -24
- package/lib/components/table/types.d.ts +0 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +0 -6
- package/lib/locales/en-US.d.ts +0 -12
- package/lib/locales/en-US.js +0 -13
- package/lib/locales/zh-CN.d.ts +0 -12
- package/lib/locales/zh-CN.js +0 -13
- package/lib/locales/zh-TW.d.ts +0 -12
- package/lib/locales/zh-TW.js +0 -13
- package/package.json +3 -3
- package/es/components/browserSelect/chevron-down.png +0 -0
- package/es/components/browserSelect/index.d.ts +0 -15
- package/es/components/browserSelect/index.js +0 -36
- package/es/components/browserSelect/index.less +0 -18
- package/es/components/date-picker/constants.d.ts +0 -39
- package/es/components/date-picker/constants.js +0 -76
- package/es/components/date-picker/datePickerCpt.d.ts +0 -8
- package/es/components/date-picker/datePickerCpt.js +0 -370
- package/es/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
- package/es/components/date-picker/hooks/useMediaQuery.js +0 -28
- package/es/components/date-picker/index.less +0 -1880
- package/es/components/picker-view/index.d.ts +0 -2
- package/es/components/picker-view/index.js +0 -2
- package/es/components/pisellTags/index.d.ts +0 -13
- package/es/components/pisellTags/index.js +0 -83
- package/es/components/pisellTags/index.less +0 -17
- package/es/components/pisellTags/utils.d.ts +0 -1
- package/es/components/pisellTags/utils.js +0 -89
- package/lib/components/browserSelect/chevron-down.png +0 -0
- package/lib/components/browserSelect/index.d.ts +0 -15
- package/lib/components/browserSelect/index.js +0 -59
- package/lib/components/browserSelect/index.less +0 -18
- package/lib/components/date-picker/constants.d.ts +0 -39
- package/lib/components/date-picker/constants.js +0 -78
- package/lib/components/date-picker/datePickerCpt.d.ts +0 -8
- package/lib/components/date-picker/datePickerCpt.js +0 -403
- package/lib/components/date-picker/hooks/useMediaQuery.d.ts +0 -2
- package/lib/components/date-picker/hooks/useMediaQuery.js +0 -43
- package/lib/components/date-picker/index.less +0 -1880
- package/lib/components/picker-view/index.d.ts +0 -2
- package/lib/components/picker-view/index.js +0 -36
- package/lib/components/pisellTags/index.d.ts +0 -13
- package/lib/components/pisellTags/index.js +0 -113
- package/lib/components/pisellTags/index.less +0 -17
- package/lib/components/pisellTags/utils.d.ts +0 -1
- package/lib/components/pisellTags/utils.js +0 -86
|
@@ -32,27 +32,12 @@ export interface PisellModalProps extends ModalProps {
|
|
|
32
32
|
}
|
|
33
33
|
declare const PisellModal: {
|
|
34
34
|
(props: PisellModalProps): React.JSX.Element;
|
|
35
|
-
confirm: (props: import("./components/functions").PisellModalFuncProps) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
};
|
|
39
|
-
info: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
40
|
-
destroy: () => void;
|
|
41
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
42
|
-
};
|
|
43
|
-
error: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
44
|
-
destroy: () => void;
|
|
45
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
46
|
-
};
|
|
35
|
+
confirm: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
36
|
+
info: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
37
|
+
error: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
47
38
|
warn: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
48
|
-
warning: (props: import("./components/functions").PisellModalFuncProps) =>
|
|
49
|
-
|
|
50
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
51
|
-
};
|
|
52
|
-
success: (props: import("./components/functions").PisellModalFuncProps) => {
|
|
53
|
-
destroy: () => void;
|
|
54
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
55
|
-
};
|
|
39
|
+
warning: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
40
|
+
success: (props: import("./components/functions").PisellModalFuncProps) => any;
|
|
56
41
|
Information: (props: import("./components/Information").InformationProps) => React.JSX.Element;
|
|
57
42
|
};
|
|
58
43
|
export default PisellModal;
|
package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
4
|
declare const ExportFile: (props: {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
}) => React.JSX.Element;
|
|
@@ -56,7 +56,7 @@ var exportStatusOptions = {
|
|
|
56
56
|
};
|
|
57
57
|
var ExportFile = (props) => {
|
|
58
58
|
const { exportImport } = props;
|
|
59
|
-
const { formId, formCode
|
|
59
|
+
const { formId, formCode } = exportImport;
|
|
60
60
|
const [list, setList] = (0, import_react.useState)([]);
|
|
61
61
|
const [defaultParams, setDefaultParams] = (0, import_react.useState)(defaultData);
|
|
62
62
|
const context = (0, import_useEngineContext.default)();
|
|
@@ -85,11 +85,7 @@ var ExportFile = (props) => {
|
|
|
85
85
|
});
|
|
86
86
|
const init = () => {
|
|
87
87
|
if ((defaultParams == null ? void 0 : defaultParams.form_id) || (defaultParams == null ? void 0 : defaultParams.code)) {
|
|
88
|
-
|
|
89
|
-
...defaultParams,
|
|
90
|
-
url: apiUrl
|
|
91
|
-
};
|
|
92
|
-
_historyList.run(_defaultParams);
|
|
88
|
+
_historyList.run(defaultParams);
|
|
93
89
|
}
|
|
94
90
|
};
|
|
95
91
|
(0, import_react.useEffect)(() => {
|
package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.js
CHANGED
|
@@ -40,7 +40,7 @@ var _batchExport = async (params) => {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
var batchExport = (exportParams, exportImport) => {
|
|
43
|
-
const { selectLists, formId, formCode
|
|
43
|
+
const { selectLists, formId, formCode } = exportImport;
|
|
44
44
|
let _name = (0, import_file.getFileDateName)();
|
|
45
45
|
let params = {};
|
|
46
46
|
if (formId) {
|
|
@@ -49,7 +49,6 @@ var batchExport = (exportParams, exportImport) => {
|
|
|
49
49
|
if (formCode) {
|
|
50
50
|
params.code = formCode;
|
|
51
51
|
}
|
|
52
|
-
params.url = apiUrl;
|
|
53
52
|
console.log("exportParams", exportParams);
|
|
54
53
|
const type = (exportParams == null ? void 0 : exportParams.type) || import_status.defaultOptions.exportType;
|
|
55
54
|
if (type === import_status.defaultOptions.exportType) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
4
|
declare const ImportLog: (props: {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
}) => React.JSX.Element;
|
|
@@ -50,7 +50,7 @@ var defaultData = {
|
|
|
50
50
|
};
|
|
51
51
|
var ImportLog = (props) => {
|
|
52
52
|
const { exportImport } = props;
|
|
53
|
-
const { formId, formCode
|
|
53
|
+
const { formId, formCode } = exportImport;
|
|
54
54
|
const detailRef = (0, import_react.useRef)(null);
|
|
55
55
|
const [list, setList] = (0, import_react.useState)([]);
|
|
56
56
|
const [defaultParams, setDefaultParams] = (0, import_react.useState)(defaultData);
|
|
@@ -80,11 +80,7 @@ var ImportLog = (props) => {
|
|
|
80
80
|
});
|
|
81
81
|
const init = () => {
|
|
82
82
|
if ((defaultParams == null ? void 0 : defaultParams.form_id) || (defaultParams == null ? void 0 : defaultParams.code)) {
|
|
83
|
-
|
|
84
|
-
...defaultParams,
|
|
85
|
-
url: apiUrl
|
|
86
|
-
};
|
|
87
|
-
_historyList.run(_defaultParams);
|
|
83
|
+
_historyList.run(defaultParams);
|
|
88
84
|
}
|
|
89
85
|
};
|
|
90
86
|
(0, import_react.useEffect)(() => {
|
package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
4
|
declare type ImportTableProps = {
|
|
5
5
|
onChange: any;
|
|
6
6
|
exportImport: ExportImportType;
|
|
@@ -46,7 +46,7 @@ var import_index = require("./index.less");
|
|
|
46
46
|
var loadingKey = import_status.defaultOptions.importValue;
|
|
47
47
|
var ImportTable = (props) => {
|
|
48
48
|
const { onChange, exportImport, errorStatus } = props;
|
|
49
|
-
const { formId, formCode, templateFileUrl
|
|
49
|
+
const { formId, formCode, templateFileUrl } = exportImport;
|
|
50
50
|
const [file, setFile] = (0, import_react.useState)(null);
|
|
51
51
|
const context = (0, import_useEngineContext.default)();
|
|
52
52
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
@@ -55,9 +55,7 @@ var ImportTable = (props) => {
|
|
|
55
55
|
(0, import_download.default)(templateFileUrl);
|
|
56
56
|
} else {
|
|
57
57
|
import_antd.message.loading({ content: "Loading...", key: loadingKey });
|
|
58
|
-
const params = {
|
|
59
|
-
url: apiUrl
|
|
60
|
-
};
|
|
58
|
+
const params = {};
|
|
61
59
|
if (formId) {
|
|
62
60
|
params.form_id = formId;
|
|
63
61
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ExportImportType } from
|
|
3
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExportImportType } from "../../../types";
|
|
3
|
+
import "./index.less";
|
|
4
4
|
declare type ExportImportProps = {
|
|
5
5
|
exportImport: ExportImportType;
|
|
6
6
|
};
|
|
@@ -68,23 +68,19 @@ var ExportImport = ({ exportImport }) => {
|
|
|
68
68
|
const context = (0, import_useEngineContext.default)();
|
|
69
69
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
70
70
|
const _items = (0, import_react.useMemo)(() => {
|
|
71
|
-
|
|
72
|
-
const result = (_a = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
|
|
73
|
-
var _a2;
|
|
74
|
-
if (Array.isArray(exportImport == null ? void 0 : exportImport.hiddenKeys) && ((_a2 = exportImport == null ? void 0 : exportImport.hiddenKeys) == null ? void 0 : _a2.includes(key))) {
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
71
|
+
const result = Object.entries(import_status.exportImportOptions).map(([key, value2]) => {
|
|
77
72
|
return {
|
|
78
73
|
key,
|
|
79
74
|
label: value2
|
|
80
75
|
};
|
|
81
|
-
})
|
|
76
|
+
});
|
|
82
77
|
return result;
|
|
83
|
-
}, [
|
|
78
|
+
}, []);
|
|
84
79
|
const Content = (0, import_react.useMemo)(() => {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
if (!value)
|
|
81
|
+
return null;
|
|
82
|
+
return Com[value];
|
|
83
|
+
}, [value]);
|
|
88
84
|
const _footer = (0, import_react.useMemo)(() => {
|
|
89
85
|
const types = import_status.defaultOptions.footerHintTypes;
|
|
90
86
|
if (types.includes(value)) {
|
|
@@ -142,7 +138,7 @@ var ExportImport = ({ exportImport }) => {
|
|
|
142
138
|
}
|
|
143
139
|
});
|
|
144
140
|
const onOk = async () => {
|
|
145
|
-
const { formId, formCode
|
|
141
|
+
const { formId, formCode } = exportImport;
|
|
146
142
|
if (value === import_status.defaultOptions.exportValue) {
|
|
147
143
|
const _params = {
|
|
148
144
|
type,
|
|
@@ -162,7 +158,6 @@ var ExportImport = ({ exportImport }) => {
|
|
|
162
158
|
if (formCode) {
|
|
163
159
|
formData.append("code", formCode);
|
|
164
160
|
}
|
|
165
|
-
formData.append("url", apiUrl || "");
|
|
166
161
|
if (formData) {
|
|
167
162
|
import_antd.message.loading({ content: "Loading...", key: value });
|
|
168
163
|
_batchImport.run(formData);
|
|
@@ -93,6 +93,7 @@ var BasicTable = (props) => {
|
|
|
93
93
|
sort,
|
|
94
94
|
other.columns
|
|
95
95
|
]);
|
|
96
|
+
console.log(pagination, "wh8888");
|
|
96
97
|
const total = (0, import_react.useMemo)(() => {
|
|
97
98
|
if (localPagination) {
|
|
98
99
|
return (_dataSource == null ? void 0 : _dataSource.total) || 0;
|
|
@@ -114,7 +115,7 @@ var BasicTable = (props) => {
|
|
|
114
115
|
type: "setCurrentDataSource",
|
|
115
116
|
payload: (_dataSource == null ? void 0 : _dataSource.list) || []
|
|
116
117
|
});
|
|
117
|
-
}, [
|
|
118
|
+
}, [_dataSource == null ? void 0 : _dataSource.list]);
|
|
118
119
|
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
119
120
|
import_antd.Table,
|
|
120
121
|
{
|
|
@@ -147,7 +148,7 @@ var BasicTable = (props) => {
|
|
|
147
148
|
defaultExpandAllRows: true
|
|
148
149
|
}
|
|
149
150
|
}
|
|
150
|
-
), total > ((pagination == null ? void 0 : pagination.pageSize) || ((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) || (pagination == null ? void 0 : pagination.showPagination) && total > 10 ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination"
|
|
151
|
+
), total > ((pagination == null ? void 0 : pagination.pageSize) || ((_a = pagination == null ? void 0 : pagination.pageSizeOptions) == null ? void 0 : _a[0]) || 10) || (pagination == null ? void 0 : pagination.showPagination) && total > 10 ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "pagination" }, /* @__PURE__ */ import_react.default.createElement(
|
|
151
152
|
import_Pagination.FormPagination,
|
|
152
153
|
{
|
|
153
154
|
...pagination,
|
|
@@ -71,8 +71,7 @@ var Gallery = (props) => {
|
|
|
71
71
|
form,
|
|
72
72
|
localPagination: !!(pagination == null ? void 0 : pagination.localPagination),
|
|
73
73
|
rowKey,
|
|
74
|
-
filter
|
|
75
|
-
currentView: "gallery"
|
|
74
|
+
filter
|
|
76
75
|
});
|
|
77
76
|
(0, import_react.useEffect)(() => {
|
|
78
77
|
onDataSourceChange == null ? void 0 : onDataSourceChange(dataSource);
|
|
@@ -94,12 +94,20 @@ var Edit = (props, ref) => {
|
|
|
94
94
|
value: [(0, import_dayjs.default)().add(-90, "d").startOf("day"), (0, import_dayjs.default)().endOf("day")]
|
|
95
95
|
}
|
|
96
96
|
];
|
|
97
|
+
const _showTime = (0, import_react.useMemo)(() => {
|
|
98
|
+
if ((0, import_utils.isBoolean)(showTime)) {
|
|
99
|
+
return showTime;
|
|
100
|
+
} else if (typeof showTime === "object") {
|
|
101
|
+
return showTime;
|
|
102
|
+
}
|
|
103
|
+
return true;
|
|
104
|
+
}, [showTime]);
|
|
97
105
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
98
106
|
RangePicker,
|
|
99
107
|
{
|
|
100
108
|
...others,
|
|
101
109
|
format,
|
|
102
|
-
showTime,
|
|
110
|
+
showTime: _showTime,
|
|
103
111
|
presets: presets || rangePresets,
|
|
104
112
|
ref,
|
|
105
113
|
value: dayjsVal,
|
|
@@ -52,11 +52,13 @@ var GridViewTable = ({
|
|
|
52
52
|
setTableSetting,
|
|
53
53
|
onDataSourceChange
|
|
54
54
|
}) => {
|
|
55
|
-
var _a, _b;
|
|
55
|
+
var _a, _b, _c, _d, _e, _f;
|
|
56
|
+
const responsive = (0, import_hooks.useResponsive)();
|
|
56
57
|
const { state, dispatch } = (0, import_hooks.useSharedState)(import_model.Context);
|
|
57
58
|
const form = import_antd.Form.useFormInstance();
|
|
58
59
|
const column_setting = import_antd.Form.useWatch("column_setting", { form, preserve: true }) || [];
|
|
59
60
|
const tableWrapRef = (0, import_react.useRef)(null);
|
|
61
|
+
const { height } = (0, import_ahooks.useSize)(tableWrapRef) || {};
|
|
60
62
|
const { dataSource: defaultDataSource, originDataSource } = state;
|
|
61
63
|
const handleSave = (0, import_ahooks.useMemoizedFn)((row) => {
|
|
62
64
|
const newData = [...defaultDataSource];
|
|
@@ -94,8 +96,7 @@ var GridViewTable = ({
|
|
|
94
96
|
form,
|
|
95
97
|
localPagination: !!((_b = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b.localPagination),
|
|
96
98
|
rowKey: tableProps.rowKey,
|
|
97
|
-
filter
|
|
98
|
-
currentView: "table"
|
|
99
|
+
filter
|
|
99
100
|
});
|
|
100
101
|
(0, import_react.useEffect)(() => {
|
|
101
102
|
dispatch({
|
|
@@ -109,6 +110,25 @@ var GridViewTable = ({
|
|
|
109
110
|
const components = (0, import_useGenTableComponents.default)({
|
|
110
111
|
form
|
|
111
112
|
});
|
|
113
|
+
const isShowPagination = (0, import_react.useMemo)(() => {
|
|
114
|
+
var _a2, _b2, _c2, _d2;
|
|
115
|
+
let total = ((_a2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a2.total) || (dataSource == null ? void 0 : dataSource.length) || 0;
|
|
116
|
+
if ((_b2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b2.localPagination) {
|
|
117
|
+
total = (dataSource == null ? void 0 : dataSource.length) || 0;
|
|
118
|
+
}
|
|
119
|
+
return total > (((_d2 = (_c2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c2.pageSizeOptions) == null ? void 0 : _d2[0]) || 10);
|
|
120
|
+
}, [
|
|
121
|
+
(_c = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c.localPagination,
|
|
122
|
+
(_d = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _d.total,
|
|
123
|
+
dataSource.length,
|
|
124
|
+
(_f = (_e = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _e.pageSizeOptions) == null ? void 0 : _f[0]
|
|
125
|
+
]);
|
|
126
|
+
const scroll = (0, import_useGenScroll.default)({
|
|
127
|
+
wrapHeight: height || 500,
|
|
128
|
+
scroll: tableProps.scroll,
|
|
129
|
+
columns,
|
|
130
|
+
isShowPagination
|
|
131
|
+
});
|
|
112
132
|
const showTotal = (0, import_react.useCallback)(
|
|
113
133
|
(total, range, pageSize) => {
|
|
114
134
|
let start = range[0] - 1;
|
|
@@ -129,73 +149,26 @@ var GridViewTable = ({
|
|
|
129
149
|
...tableProps.pagination,
|
|
130
150
|
showTotal
|
|
131
151
|
};
|
|
132
|
-
}, [tableProps.pagination]);
|
|
152
|
+
}, [responsive, tableProps.pagination]);
|
|
133
153
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: "materials-grid-table-wrap", ref: tableWrapRef }, /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
-
|
|
154
|
+
import_SortRow.default,
|
|
135
155
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
paginationConfig: _paginationConfig,
|
|
141
|
-
components
|
|
142
|
-
}
|
|
143
|
-
));
|
|
144
|
-
};
|
|
145
|
-
var AutoSizerContent = (props) => {
|
|
146
|
-
var _a, _b, _c, _d;
|
|
147
|
-
const {
|
|
148
|
-
tableProps,
|
|
149
|
-
dataSource,
|
|
150
|
-
paginationConfig: paginationConfig2,
|
|
151
|
-
columns,
|
|
152
|
-
components,
|
|
153
|
-
tableWrapRef
|
|
154
|
-
} = props;
|
|
155
|
-
const { height } = (0, import_ahooks.useSize)(tableWrapRef) || {};
|
|
156
|
-
const debouncedHeight = (0, import_ahooks.useDebounce)(height, { wait: 500 });
|
|
157
|
-
const isShowPagination = (0, import_react.useMemo)(() => {
|
|
158
|
-
var _a2, _b2, _c2, _d2, _e, _f;
|
|
159
|
-
let total = ((_a2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a2.total) || (dataSource == null ? void 0 : dataSource.length) || 0;
|
|
160
|
-
if ((_b2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b2.localPagination) {
|
|
161
|
-
total = (dataSource == null ? void 0 : dataSource.length) || 0;
|
|
162
|
-
}
|
|
163
|
-
return total > (((_c2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c2.pageSize) || ((_e = (_d2 = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _d2.pageSizeOptions) == null ? void 0 : _e[0]) || 10) || ((_f = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _f.showPagination) && total > 10;
|
|
164
|
-
}, [
|
|
165
|
-
(_a = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _a.localPagination,
|
|
166
|
-
(_b = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _b.total,
|
|
167
|
-
dataSource.length,
|
|
168
|
-
(_d = (_c = tableProps == null ? void 0 : tableProps.pagination) == null ? void 0 : _c.pageSizeOptions) == null ? void 0 : _d[0]
|
|
169
|
-
]);
|
|
170
|
-
const scroll = (0, import_useGenScroll.default)({
|
|
171
|
-
wrapHeight: debouncedHeight || 500,
|
|
172
|
-
scroll: tableProps.scroll,
|
|
173
|
-
columns,
|
|
174
|
-
isShowPagination
|
|
175
|
-
});
|
|
176
|
-
const debouncedScroll = (0, import_ahooks.useDebounce)(scroll, { wait: 200 });
|
|
177
|
-
const basicTable = (0, import_react.useMemo)(() => {
|
|
178
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
156
|
+
rowKey: tableProps.rowKey,
|
|
157
|
+
onSortChange: tableProps.onSortChange
|
|
158
|
+
},
|
|
159
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
179
160
|
import_BasicTable.default,
|
|
180
161
|
{
|
|
181
|
-
key:
|
|
162
|
+
key: scroll == null ? void 0 : scroll.y,
|
|
182
163
|
dataSource,
|
|
183
164
|
columns,
|
|
184
165
|
className: "grid-view-table",
|
|
185
166
|
components,
|
|
186
167
|
...tableProps,
|
|
187
|
-
scroll
|
|
188
|
-
pagination:
|
|
168
|
+
scroll,
|
|
169
|
+
pagination: _paginationConfig
|
|
189
170
|
}
|
|
190
|
-
)
|
|
191
|
-
|
|
192
|
-
debouncedScroll,
|
|
193
|
-
dataSource,
|
|
194
|
-
columns,
|
|
195
|
-
components,
|
|
196
|
-
paginationConfig2,
|
|
197
|
-
tableProps
|
|
198
|
-
]);
|
|
199
|
-
return /* @__PURE__ */ import_react.default.createElement(import_SortRow.default, { rowKey: tableProps.rowKey, onSortChange: tableProps.onSortChange }, basicTable);
|
|
171
|
+
)
|
|
172
|
+
));
|
|
200
173
|
};
|
|
201
174
|
var Table_default = (0, import_react.memo)(GridViewTable);
|
|
@@ -81,10 +81,7 @@ export declare const setTableSettingToLocalStorage: ({ tableId, tableSettingObj,
|
|
|
81
81
|
}>;
|
|
82
82
|
currentViewMode: ModeType;
|
|
83
83
|
currentSettingHash: string;
|
|
84
|
-
}) =>
|
|
85
|
-
key: string;
|
|
86
|
-
value: Record<string, any>;
|
|
87
|
-
} | undefined;
|
|
84
|
+
}) => void;
|
|
88
85
|
export declare const clearTableSettingToLocalStorage: (tableId?: string) => void;
|
|
89
86
|
/**
|
|
90
87
|
* 从本地存储中获取表格设置, 全部配置
|
|
@@ -115,16 +112,7 @@ export declare const setFormValuesToLocalStorage: ({ tableId, allValues, keys, c
|
|
|
115
112
|
keys?: string[] | undefined;
|
|
116
113
|
currentViewMode: ModeType;
|
|
117
114
|
currentSettingHash: string;
|
|
118
|
-
}) =>
|
|
119
|
-
key: string;
|
|
120
|
-
value: Record<string, any>;
|
|
121
|
-
} | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* 获取表格键值
|
|
124
|
-
* @param tableId 表格ID
|
|
125
|
-
* @returns 返回格式化后的表格键值
|
|
126
|
-
*/
|
|
127
|
-
export declare const getTableKey: (tableId: string) => string;
|
|
115
|
+
}) => void;
|
|
128
116
|
/**
|
|
129
117
|
* 合并筛选设置
|
|
130
118
|
* @param list 列表数据
|
|
@@ -36,7 +36,6 @@ __export(utils_exports, {
|
|
|
36
36
|
getHash: () => getHash,
|
|
37
37
|
getIdByRowKey: () => getIdByRowKey,
|
|
38
38
|
getSettingKeyArrByMode: () => getSettingKeyArrByMode,
|
|
39
|
-
getTableKey: () => getTableKey,
|
|
40
39
|
getTableSettingByCurrentViewMode: () => getTableSettingByCurrentViewMode,
|
|
41
40
|
getTableSettingFromLocalStorage: () => getTableSettingFromLocalStorage,
|
|
42
41
|
groupDataSource: () => groupDataSource,
|
|
@@ -271,10 +270,6 @@ var setTableSettingToLocalStorage = ({
|
|
|
271
270
|
}
|
|
272
271
|
};
|
|
273
272
|
localStorage.setItem(getTableKey(tableId), JSON.stringify(newData));
|
|
274
|
-
return {
|
|
275
|
-
key: getTableKey(tableId),
|
|
276
|
-
value: newData
|
|
277
|
-
};
|
|
278
273
|
};
|
|
279
274
|
var clearTableSettingToLocalStorage = (tableId) => {
|
|
280
275
|
if (!tableId)
|
|
@@ -311,7 +306,7 @@ var setFormValuesToLocalStorage = ({
|
|
|
311
306
|
keys == null ? void 0 : keys.forEach((key) => {
|
|
312
307
|
obj[key] = allValues == null ? void 0 : allValues[key];
|
|
313
308
|
});
|
|
314
|
-
|
|
309
|
+
setTableSettingToLocalStorage({
|
|
315
310
|
tableId,
|
|
316
311
|
tableSettingObj: obj,
|
|
317
312
|
currentViewMode,
|
|
@@ -465,7 +460,6 @@ var stringify = (obj) => {
|
|
|
465
460
|
getHash,
|
|
466
461
|
getIdByRowKey,
|
|
467
462
|
getSettingKeyArrByMode,
|
|
468
|
-
getTableKey,
|
|
469
463
|
getTableSettingByCurrentViewMode,
|
|
470
464
|
getTableSettingFromLocalStorage,
|
|
471
465
|
groupDataSource,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { GridViewProps } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GridViewProps } from "../types";
|
|
3
3
|
declare const View: (props: GridViewProps & {
|
|
4
4
|
setTableSetting: (values: Record<string, any>) => void;
|
|
5
5
|
}) => React.JSX.Element;
|
|
@@ -36,8 +36,6 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_Table = __toESM(require("../Table"));
|
|
38
38
|
var import_Gallery = __toESM(require("../Gallery"));
|
|
39
|
-
var import_utils = require("../Table/utils");
|
|
40
|
-
var import_ahooks = require("ahooks");
|
|
41
39
|
var View = (props) => {
|
|
42
40
|
const {
|
|
43
41
|
dataSource,
|
|
@@ -64,31 +62,24 @@ var View = (props) => {
|
|
|
64
62
|
form,
|
|
65
63
|
preserve: true
|
|
66
64
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
filter,
|
|
87
|
-
rowKey: other.rowKey,
|
|
88
|
-
onDataSourceChange: memoOnDataSourceChange
|
|
89
|
-
}
|
|
90
|
-
));
|
|
91
|
-
}, [viewMode, (0, import_utils.stringify)(other), debouncedFilter, memoOnDataSourceChange, gallery]);
|
|
92
|
-
return memoContent;
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, viewMode === "grid" && /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
import_Table.default,
|
|
67
|
+
{
|
|
68
|
+
tableProps: other,
|
|
69
|
+
filter,
|
|
70
|
+
setTableSetting,
|
|
71
|
+
onDataSourceChange
|
|
72
|
+
}
|
|
73
|
+
), viewMode === "gallery" && /* @__PURE__ */ import_react.default.createElement(
|
|
74
|
+
import_Gallery.default,
|
|
75
|
+
{
|
|
76
|
+
loading: other == null ? void 0 : other.loading,
|
|
77
|
+
gallery,
|
|
78
|
+
pagination: other.pagination,
|
|
79
|
+
filter,
|
|
80
|
+
rowKey: other.rowKey,
|
|
81
|
+
onDataSourceChange
|
|
82
|
+
}
|
|
83
|
+
));
|
|
93
84
|
};
|
|
94
85
|
var View_default = View;
|
|
@@ -31,7 +31,7 @@ var useGenScroll = (params) => {
|
|
|
31
31
|
x: (propsScroll == null ? void 0 : propsScroll.x) || columns.reduce((p, c) => {
|
|
32
32
|
return p + (c.width || 250);
|
|
33
33
|
}, 0) || 2e3,
|
|
34
|
-
y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 :
|
|
34
|
+
y: (propsScroll == null ? void 0 : propsScroll.y) || Math.max(wrapHeight - 48 - (isShowPagination ? 50 + 24 : 0), 100),
|
|
35
35
|
scrollToFirstRowOnChange: propsScroll == null ? void 0 : propsScroll.scrollToFirstRowOnChange
|
|
36
36
|
};
|
|
37
37
|
}
|