@pisell/materials 1.0.223 → 1.0.225
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 +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/table/Table/index.less +0 -1
- package/es/components/table/hooks/useTransColumns.js +2 -1
- package/es/components/table/index.js +11 -1
- package/lib/components/table/Table/index.less +0 -1
- package/lib/components/table/hooks/useTransColumns.js +6 -5
- package/lib/components/table/index.js +1 -1
- package/package.json +1 -1
|
@@ -76,13 +76,14 @@ var useTransColumns = function useTransColumns(params) {
|
|
|
76
76
|
}, /*#__PURE__*/React.createElement("span", null, dom), /*#__PURE__*/React.createElement("span", null, children.length, " ", getText("table-column-group-records")));
|
|
77
77
|
}, [groupField, columns]);
|
|
78
78
|
var _columns = useMemo(function () {
|
|
79
|
+
var _newColumns$;
|
|
79
80
|
// 过滤掉不显示的列
|
|
80
81
|
var newColumns = columns.filter(function (item) {
|
|
81
82
|
return !(isBoolean(item.isShow) && !item.isShow);
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
// 分组后不展示拖拽排序
|
|
85
|
-
if (dragSort && !groupField) {
|
|
86
|
+
if (dragSort && !groupField && (newColumns === null || newColumns === void 0 ? void 0 : (_newColumns$ = newColumns[0]) === null || _newColumns$ === void 0 ? void 0 : _newColumns$.key) !== "__sort") {
|
|
86
87
|
newColumns.unshift({
|
|
87
88
|
key: "__sort",
|
|
88
89
|
width: 60,
|
|
@@ -194,9 +194,19 @@ var GridView = Provider( /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
194
194
|
return wrapRef.current;
|
|
195
195
|
});
|
|
196
196
|
useEffect(function () {
|
|
197
|
+
// 当前视图变更时重置form
|
|
197
198
|
form.resetFields();
|
|
198
199
|
form.setFieldsValue(initialValuesRef.current);
|
|
199
|
-
}, [currentViewMode
|
|
200
|
+
}, [currentViewMode]);
|
|
201
|
+
|
|
202
|
+
// useEffect(() => {
|
|
203
|
+
// // 如果是编辑态修改columns时重置form
|
|
204
|
+
// if (props.__designMode === "design") {
|
|
205
|
+
// form.resetFields();
|
|
206
|
+
// form.setFieldsValue(initialValuesRef.current);
|
|
207
|
+
// }
|
|
208
|
+
// }, [JSON.stringify(columns), props.__designMode]);
|
|
209
|
+
|
|
200
210
|
useEffect(function () {
|
|
201
211
|
form.setFieldsValue(initialValuesRef.current);
|
|
202
212
|
}, [propsFilter]);
|
|
@@ -108,10 +108,11 @@ var useTransColumns = (params) => {
|
|
|
108
108
|
[groupField, columns]
|
|
109
109
|
);
|
|
110
110
|
const _columns = (0, import_react.useMemo)(() => {
|
|
111
|
+
var _a2;
|
|
111
112
|
let newColumns = columns.filter(
|
|
112
113
|
(item) => !((0, import_utils.isBoolean)(item.isShow) && !item.isShow)
|
|
113
114
|
);
|
|
114
|
-
if (dragSort && !groupField) {
|
|
115
|
+
if (dragSort && !groupField && ((_a2 = newColumns == null ? void 0 : newColumns[0]) == null ? void 0 : _a2.key) !== "__sort") {
|
|
115
116
|
newColumns.unshift({
|
|
116
117
|
key: "__sort",
|
|
117
118
|
width: 60,
|
|
@@ -119,7 +120,7 @@ var useTransColumns = (params) => {
|
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
return newColumns.map((col, index) => {
|
|
122
|
-
var
|
|
123
|
+
var _a3;
|
|
123
124
|
let position = "";
|
|
124
125
|
if (index === 0) {
|
|
125
126
|
position = "start";
|
|
@@ -132,11 +133,11 @@ var useTransColumns = (params) => {
|
|
|
132
133
|
fixed: "left",
|
|
133
134
|
width: 350,
|
|
134
135
|
render: (text, record) => {
|
|
135
|
-
var
|
|
136
|
+
var _a4;
|
|
136
137
|
if (record.__is_group && groupFieldRender) {
|
|
137
138
|
return groupFieldRender(text, record);
|
|
138
139
|
}
|
|
139
|
-
return ((
|
|
140
|
+
return ((_a4 = col == null ? void 0 : col.render) == null ? void 0 : _a4.call(col, text, record)) || text;
|
|
140
141
|
}
|
|
141
142
|
};
|
|
142
143
|
}
|
|
@@ -160,7 +161,7 @@ var useTransColumns = (params) => {
|
|
|
160
161
|
filterObj = (0, import_stringFilter.default)({ dataIndex: col.dataIndex });
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
if (((
|
|
164
|
+
if (((_a3 = col.filters) == null ? void 0 : _a3.length) > 0) {
|
|
164
165
|
filterObj = {
|
|
165
166
|
...(0, import_selectFilter.default)({
|
|
166
167
|
dataIndex: col.dataIndex,
|
|
@@ -215,7 +215,7 @@ var GridView = (0, import_model.Provider)(
|
|
|
215
215
|
(0, import_react.useEffect)(() => {
|
|
216
216
|
form.resetFields();
|
|
217
217
|
form.setFieldsValue(initialValuesRef.current);
|
|
218
|
-
}, [currentViewMode
|
|
218
|
+
}, [currentViewMode]);
|
|
219
219
|
(0, import_react.useEffect)(() => {
|
|
220
220
|
form.setFieldsValue(initialValuesRef.current);
|
|
221
221
|
}, [propsFilter]);
|