@nokecy/qc-ui 0.3.5 → 0.3.7

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.
@@ -286,9 +286,11 @@ function AgGridPlus(props) {
286
286
  });
287
287
  }, []);
288
288
  var allColDefs = (0, _react.useMemo)(function () {
289
- return _react.default.Children.map(children, function (child, index) {
289
+ var columnProps = _react.default.Children.map(children, function (child, index) {
290
290
  return child.props;
291
291
  });
292
+
293
+ return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps;
292
294
  }, []);
293
295
  var rowDataMemo = (0, _react.useMemo)(function () {
294
296
  return props.treeData ? (0, _utils.flatten)((0, _utils.toTree)(rowData), treeParentName) : rowData;
@@ -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: {}
@@ -174,9 +176,9 @@ var FormRender = function FormRender(props) {
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
  }
@@ -258,9 +258,10 @@ function AgGridPlus(props) {
258
258
  });
259
259
  }, []);
260
260
  var allColDefs = useMemo(function () {
261
- return React.Children.map(children, function (child, index) {
261
+ var columnProps = React.Children.map(children, function (child, index) {
262
262
  return child.props;
263
263
  });
264
+ return !columnProps ? props.columnDefs ? props.columnDefs : [] : columnProps;
264
265
  }, []);
265
266
  var rowDataMemo = useMemo(function () {
266
267
  return props.treeData ? flatten(toTree(rowData), treeParentName) : rowData;
@@ -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: {}
@@ -153,9 +155,9 @@ var FormRender = function FormRender(props) {
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
  }