@nokecy/qc-ui 0.3.4 → 0.3.6
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.
|
@@ -281,7 +281,7 @@ function AgGridPlus(props) {
|
|
|
281
281
|
return child.props;
|
|
282
282
|
});
|
|
283
283
|
|
|
284
|
-
return !columnProps ? [] : columnProps === null || columnProps === void 0 ? void 0 : columnProps.filter(function (x) {
|
|
284
|
+
return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps === null || columnProps === void 0 ? void 0 : columnProps.filter(function (x) {
|
|
285
285
|
return !x.hideInTable;
|
|
286
286
|
});
|
|
287
287
|
}, []);
|
|
@@ -376,7 +376,7 @@ function AgGridPlus(props) {
|
|
|
376
376
|
animateRows: true //停用默认分页组件
|
|
377
377
|
,
|
|
378
378
|
suppressPaginationPanel: true,
|
|
379
|
-
columnDefs: colDefs
|
|
379
|
+
columnDefs: colDefs
|
|
380
380
|
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
381
381
|
style: {
|
|
382
382
|
marginTop: 12,
|
|
@@ -150,6 +150,8 @@ var FormRender = function FormRender(props) {
|
|
|
150
150
|
};
|
|
151
151
|
|
|
152
152
|
var getSchema = function getSchema() {
|
|
153
|
+
var _columns, _columns2;
|
|
154
|
+
|
|
153
155
|
var rootSchema = {
|
|
154
156
|
type: 'object',
|
|
155
157
|
properties: {}
|
|
@@ -167,16 +169,16 @@ var FormRender = function FormRender(props) {
|
|
|
167
169
|
},
|
|
168
170
|
properties: {}
|
|
169
171
|
};
|
|
170
|
-
var columns = colDefs.map(function (colDef) {
|
|
172
|
+
var columns = colDefs === null || colDefs === void 0 ? void 0 : colDefs.map(function (colDef) {
|
|
171
173
|
var state = columnStates.find(function (x) {
|
|
172
174
|
return x.colId == colDef.field;
|
|
173
175
|
});
|
|
174
176
|
console.log("state", state);
|
|
175
177
|
return _objectSpread(_objectSpread({}, colDef), state);
|
|
176
178
|
});
|
|
177
|
-
columns = columns.filter(function (i) {
|
|
179
|
+
columns = columns ? (_columns = columns) === null || _columns === void 0 ? void 0 : _columns.filter(function (i) {
|
|
178
180
|
return (i === null || i === void 0 ? void 0 : i.visible) != false && !(i !== null && i !== void 0 && i.hide) && !(i !== null && i !== void 0 && i.hideInSearch) || (i === null || i === void 0 ? void 0 : i.hideInTable);
|
|
179
|
-
});
|
|
181
|
+
}) : [];
|
|
180
182
|
columns.map(function (col) {
|
|
181
183
|
var _colDef$queryField;
|
|
182
184
|
|
|
@@ -214,7 +216,7 @@ var FormRender = function FormRender(props) {
|
|
|
214
216
|
|
|
215
217
|
rootSchema.properties["grid"] = gridSchema;
|
|
216
218
|
|
|
217
|
-
if (!columns.length) {
|
|
219
|
+
if (!((_columns2 = columns) !== null && _columns2 !== void 0 && _columns2.length)) {
|
|
218
220
|
///@ts-ignore
|
|
219
221
|
delete rootSchema.properties["grid"];
|
|
220
222
|
}
|
|
@@ -253,7 +253,7 @@ function AgGridPlus(props) {
|
|
|
253
253
|
var columnProps = React.Children.map(children, function (child, index) {
|
|
254
254
|
return child.props;
|
|
255
255
|
});
|
|
256
|
-
return !columnProps ? [] : columnProps === null || columnProps === void 0 ? void 0 : columnProps.filter(function (x) {
|
|
256
|
+
return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps === null || columnProps === void 0 ? void 0 : columnProps.filter(function (x) {
|
|
257
257
|
return !x.hideInTable;
|
|
258
258
|
});
|
|
259
259
|
}, []);
|
|
@@ -348,7 +348,7 @@ function AgGridPlus(props) {
|
|
|
348
348
|
animateRows: true //停用默认分页组件
|
|
349
349
|
,
|
|
350
350
|
suppressPaginationPanel: true,
|
|
351
|
-
columnDefs: colDefs
|
|
351
|
+
columnDefs: colDefs
|
|
352
352
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
353
353
|
style: {
|
|
354
354
|
marginTop: 12,
|
|
@@ -129,6 +129,8 @@ var FormRender = function FormRender(props) {
|
|
|
129
129
|
};
|
|
130
130
|
|
|
131
131
|
var getSchema = function getSchema() {
|
|
132
|
+
var _columns, _columns2;
|
|
133
|
+
|
|
132
134
|
var rootSchema = {
|
|
133
135
|
type: 'object',
|
|
134
136
|
properties: {}
|
|
@@ -146,16 +148,16 @@ var FormRender = function FormRender(props) {
|
|
|
146
148
|
},
|
|
147
149
|
properties: {}
|
|
148
150
|
};
|
|
149
|
-
var columns = colDefs.map(function (colDef) {
|
|
151
|
+
var columns = colDefs === null || colDefs === void 0 ? void 0 : colDefs.map(function (colDef) {
|
|
150
152
|
var state = columnStates.find(function (x) {
|
|
151
153
|
return x.colId == colDef.field;
|
|
152
154
|
});
|
|
153
155
|
console.log("state", state);
|
|
154
156
|
return _objectSpread(_objectSpread({}, colDef), state);
|
|
155
157
|
});
|
|
156
|
-
columns = columns.filter(function (i) {
|
|
158
|
+
columns = columns ? (_columns = columns) === null || _columns === void 0 ? void 0 : _columns.filter(function (i) {
|
|
157
159
|
return (i === null || i === void 0 ? void 0 : i.visible) != false && !(i !== null && i !== void 0 && i.hide) && !(i !== null && i !== void 0 && i.hideInSearch) || (i === null || i === void 0 ? void 0 : i.hideInTable);
|
|
158
|
-
});
|
|
160
|
+
}) : [];
|
|
159
161
|
columns.map(function (col) {
|
|
160
162
|
var _colDef$queryField;
|
|
161
163
|
|
|
@@ -193,7 +195,7 @@ var FormRender = function FormRender(props) {
|
|
|
193
195
|
|
|
194
196
|
rootSchema.properties["grid"] = gridSchema;
|
|
195
197
|
|
|
196
|
-
if (!columns.length) {
|
|
198
|
+
if (!((_columns2 = columns) !== null && _columns2 !== void 0 && _columns2.length)) {
|
|
197
199
|
///@ts-ignore
|
|
198
200
|
delete rootSchema.properties["grid"];
|
|
199
201
|
}
|