@pisell/materials 1.0.402 → 1.0.404
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/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 +2 -1
- 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 +3 -15
- 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 -20
- 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 +4 -6
- package/es/components/table/index.js +5 -8
- package/es/components/table/index.less +0 -4
- 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/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 +2 -1
- 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 +3 -15
- 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 -23
- 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 +4 -5
- package/lib/components/table/index.js +4 -5
- package/lib/components/table/index.less +0 -4
- 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
|
@@ -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
|
{
|
|
@@ -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: 500 });
|
|
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 列表数据
|
|
@@ -167,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
167
155
|
sort?: SortType | undefined;
|
|
168
156
|
mode: "" | "localStorage" | "remote";
|
|
169
157
|
currentViewMode: ModeType;
|
|
170
|
-
}) => ("
|
|
158
|
+
}) => ("view_mode" | "column_setting" | "order_by" | "group_by" | "gallery_setting" | "filter_setting")[];
|
|
171
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
172
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
173
161
|
export {};
|
|
@@ -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,7 +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
39
|
var View = (props) => {
|
|
41
40
|
const {
|
|
42
41
|
dataSource,
|
|
@@ -63,27 +62,24 @@ var View = (props) => {
|
|
|
63
62
|
form,
|
|
64
63
|
preserve: true
|
|
65
64
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
));
|
|
86
|
-
}, [viewMode, (0, import_utils.stringify)(other), filter, onDataSourceChange, gallery]);
|
|
87
|
-
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
|
+
));
|
|
88
84
|
};
|
|
89
85
|
var View_default = View;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
|
|
29
19
|
// src/components/table/hooks/useTableSetting.ts
|
|
@@ -34,10 +24,7 @@ __export(useTableSetting_exports, {
|
|
|
34
24
|
module.exports = __toCommonJS(useTableSetting_exports);
|
|
35
25
|
var import_react = require("react");
|
|
36
26
|
var import_utils = require("../Table/utils");
|
|
37
|
-
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
38
|
-
var import_ahooks = require("ahooks");
|
|
39
27
|
var useTableSetting = (params) => {
|
|
40
|
-
var _a;
|
|
41
28
|
const {
|
|
42
29
|
tableId,
|
|
43
30
|
filter,
|
|
@@ -51,29 +38,27 @@ var useTableSetting = (params) => {
|
|
|
51
38
|
currentSettingHash,
|
|
52
39
|
exportImport
|
|
53
40
|
} = params;
|
|
54
|
-
const context = (0, import_useEngineContext.default)();
|
|
55
|
-
const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
56
41
|
const columnsMap = (0, import_react.useMemo)(() => {
|
|
57
42
|
return new Map(propsColumns.map((item) => [item.key, item]));
|
|
58
43
|
}, [propsColumns]);
|
|
59
44
|
const columns = (0, import_react.useMemo)(() => {
|
|
60
|
-
var
|
|
45
|
+
var _a;
|
|
61
46
|
if (currentViewMode === "grid") {
|
|
62
47
|
return propsColumns;
|
|
63
48
|
} else if (currentViewMode === "gallery") {
|
|
64
|
-
return (((
|
|
49
|
+
return (((_a = gallery == null ? void 0 : gallery.content) == null ? void 0 : _a.fields) || []).filter((item) => item.show).map((item) => columnsMap.get(item.columnKey)).filter(Boolean);
|
|
65
50
|
}
|
|
66
51
|
return propsColumns;
|
|
67
52
|
}, [propsColumns, currentViewMode, gallery, columnsMap]);
|
|
68
53
|
const { list, quickFilterMaxLength, sortButtonShow } = filter || {};
|
|
69
54
|
const defaultGalleryCoverSetting = (0, import_react.useMemo)(() => {
|
|
70
|
-
var
|
|
55
|
+
var _a, _b;
|
|
71
56
|
return {
|
|
72
|
-
coverObjectFit: (
|
|
57
|
+
coverObjectFit: (_a = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a.objectFit,
|
|
73
58
|
coverField: (_b = columns.find(
|
|
74
59
|
(column) => {
|
|
75
|
-
var
|
|
76
|
-
return column.key === ((_b2 = (
|
|
60
|
+
var _a2, _b2;
|
|
61
|
+
return column.key === ((_b2 = (_a2 = gallery == null ? void 0 : gallery.cover) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[0]);
|
|
77
62
|
}
|
|
78
63
|
)) == null ? void 0 : _b.dataIndex,
|
|
79
64
|
compactMode: "default",
|
|
@@ -117,7 +102,7 @@ var useTableSetting = (params) => {
|
|
|
117
102
|
);
|
|
118
103
|
const mergedSetting = { ...allSetting, ...currentViewModeSetting };
|
|
119
104
|
localStorageSettingKeyArr.forEach((item) => {
|
|
120
|
-
var
|
|
105
|
+
var _a, _b, _c, _d;
|
|
121
106
|
if (item === "view_mode") {
|
|
122
107
|
setting[item] = view.multiple ? (mergedSetting == null ? void 0 : mergedSetting[item]) || view.defaultViewMode : view.defaultViewMode;
|
|
123
108
|
} else if (item === "filter_setting") {
|
|
@@ -138,7 +123,7 @@ var useTableSetting = (params) => {
|
|
|
138
123
|
setting[item] = {
|
|
139
124
|
...mergedSetting == null ? void 0 : mergedSetting[item],
|
|
140
125
|
// 本地没有默认封面效果时取配置中的
|
|
141
|
-
coverObjectFit: ((
|
|
126
|
+
coverObjectFit: ((_a = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _a.coverObjectFit) || defaultGalleryCoverSetting.coverObjectFit,
|
|
142
127
|
coverField: ((_b = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _b.coverField) || defaultGalleryCoverSetting.coverField,
|
|
143
128
|
compactMode: ((_c = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _c.compactMode) || defaultGalleryCoverSetting.compactMode,
|
|
144
129
|
isShowLabel: ((_d = mergedSetting == null ? void 0 : mergedSetting[item]) == null ? void 0 : _d.isShowLabel) ?? defaultGalleryCoverSetting.isShowLabel
|
|
@@ -200,15 +185,15 @@ var useTableSetting = (params) => {
|
|
|
200
185
|
quickFilterMaxLength,
|
|
201
186
|
sortButtonShow
|
|
202
187
|
]);
|
|
203
|
-
const setTableSetting = (
|
|
204
|
-
|
|
188
|
+
const setTableSetting = (values) => {
|
|
189
|
+
(0, import_utils.setFormValuesToLocalStorage)({
|
|
205
190
|
tableId,
|
|
206
191
|
allValues: values,
|
|
207
192
|
keys: localStorageSettingKeyArr,
|
|
208
193
|
currentViewMode,
|
|
209
194
|
currentSettingHash
|
|
210
195
|
});
|
|
211
|
-
}
|
|
196
|
+
};
|
|
212
197
|
const tableSetting = (0, import_react.useMemo)(() => {
|
|
213
198
|
return {
|
|
214
199
|
...tableLocalSetting,
|
|
@@ -6,7 +6,6 @@ declare type UseTransDataSourceParams = {
|
|
|
6
6
|
dataSource: Record<string, any>[];
|
|
7
7
|
rowKey: string | ((params: any) => string);
|
|
8
8
|
filter: FilterType;
|
|
9
|
-
currentView: 'gallery' | 'table';
|
|
10
9
|
};
|
|
11
10
|
declare const useTransDataSource: (params: UseTransDataSourceParams) => Record<string, any>[];
|
|
12
11
|
export default useTransDataSource;
|
|
@@ -33,8 +33,7 @@ var useTransDataSource = (params) => {
|
|
|
33
33
|
localPagination,
|
|
34
34
|
dataSource: pDataSource,
|
|
35
35
|
rowKey,
|
|
36
|
-
filter
|
|
37
|
-
currentView
|
|
36
|
+
filter
|
|
38
37
|
} = params;
|
|
39
38
|
const sort = import_antd.Form.useWatch("order_by", { form, preserve: true });
|
|
40
39
|
const group = import_antd.Form.useWatch("group_by", { form, preserve: true });
|
|
@@ -73,7 +72,7 @@ var useTransDataSource = (params) => {
|
|
|
73
72
|
if (sortObj) {
|
|
74
73
|
newDataSource = (0, import_utils2.sortDataSource)(newDataSource, sortObj);
|
|
75
74
|
}
|
|
76
|
-
if (groupDetail
|
|
75
|
+
if (groupDetail) {
|
|
77
76
|
newDataSource = (0, import_utils2.groupDataSource)(newDataSource, groupDetail, rowKey);
|
|
78
77
|
}
|
|
79
78
|
return newDataSource;
|
|
@@ -83,9 +82,9 @@ var useTransDataSource = (params) => {
|
|
|
83
82
|
sortObj,
|
|
84
83
|
groupDetail,
|
|
85
84
|
filterLocalArr,
|
|
86
|
-
filters
|
|
87
|
-
currentView
|
|
85
|
+
filters
|
|
88
86
|
]);
|
|
87
|
+
console.log("dataSourcedataSource", dataSource);
|
|
89
88
|
return dataSource;
|
|
90
89
|
};
|
|
91
90
|
var useTransDataSource_default = useTransDataSource;
|
|
@@ -89,9 +89,9 @@ var GridView = (0, import_model.Provider)(
|
|
|
89
89
|
const filterDefaultRef = (0, import_react.useRef)({});
|
|
90
90
|
const initialValuesRef = (0, import_react.useRef)({});
|
|
91
91
|
const { width } = (0, import_ahooks.useSize)(wrapRef) || {};
|
|
92
|
-
const debouncedWidth = (0, import_ahooks.useDebounce)(width, { wait: 500 });
|
|
93
92
|
const utils = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils;
|
|
94
93
|
const tableId = (0, import_react.useMemo)(() => {
|
|
94
|
+
console.log(props, "wh");
|
|
95
95
|
if (props.__designMode === "design") {
|
|
96
96
|
return "designMode-mock-table-id";
|
|
97
97
|
}
|
|
@@ -144,14 +144,13 @@ var GridView = (0, import_model.Provider)(
|
|
|
144
144
|
}
|
|
145
145
|
}, [currentSettingHash, tableId]);
|
|
146
146
|
(0, import_react.useEffect)(() => {
|
|
147
|
-
if (
|
|
148
|
-
console.log("modal.dispatch", "setTableWidth");
|
|
147
|
+
if (width) {
|
|
149
148
|
modal.dispatch({
|
|
150
149
|
type: "setTableWidth",
|
|
151
|
-
payload:
|
|
150
|
+
payload: width || {}
|
|
152
151
|
});
|
|
153
152
|
}
|
|
154
|
-
}, [
|
|
153
|
+
}, [width]);
|
|
155
154
|
const { setTableSetting, tableSetting } = (0, import_useTableSetting.default)({
|
|
156
155
|
tableId,
|
|
157
156
|
filter,
|