@apexcura/ui-components 0.0.11-Beta16 → 0.0.11-Beta18

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/dist/index.js CHANGED
@@ -403,29 +403,28 @@ var AddMoreTable = (props) => {
403
403
  }
404
404
  };
405
405
  const dataSource = rows.map((eachRow, index) => {
406
- console.log("eachRow=======", eachRow);
407
406
  const rowElements = {};
408
407
  if (eachRow.element && eachRow.label) {
409
408
  rowElements[eachRow.label] = renderInputElement(eachRow);
410
409
  }
411
- const variableData = eachRow.variable_data && Array.isArray(eachRow.variable_data) ? eachRow.variable_data.reduce((acc, curr) => {
412
- for (let i = 0; i < curr.length; i++) {
413
- Object.keys(curr[i].forEach((key) => {
414
- if (curr[i][key] && curr[i][key].element) {
415
- rowElements[eachRow.label] = renderInputElement(curr[i][key] && curr[i][key]);
416
- console.log("++++++++++", curr[i][key] && curr[i][key]);
410
+ if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
411
+ eachRow.variable_data.forEach((variable) => {
412
+ Object.entries(variable).forEach(([key, value]) => {
413
+ if (value && value.element && value.label) {
414
+ rowElements[value.label] = renderInputElement(value);
417
415
  }
418
- }));
416
+ });
417
+ });
418
+ if (eachRow.variable_data.length > 0) {
419
+ const addSubRow = /* @__PURE__ */ import_react13.default.createElement("button", null, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null));
420
+ rowElements[""] = addSubRow;
419
421
  }
420
- return acc;
421
- }, {}) : {};
422
- console.log("-----------");
422
+ }
423
423
  return {
424
424
  key: index.toString(),
425
425
  "#": index + 1,
426
426
  ...eachRow,
427
427
  ...rowElements,
428
- ...variableData,
429
428
  actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)))
430
429
  };
431
430
  });
package/dist/index.mjs CHANGED
@@ -356,29 +356,28 @@ var AddMoreTable = (props) => {
356
356
  }
357
357
  };
358
358
  const dataSource = rows.map((eachRow, index) => {
359
- console.log("eachRow=======", eachRow);
360
359
  const rowElements = {};
361
360
  if (eachRow.element && eachRow.label) {
362
361
  rowElements[eachRow.label] = renderInputElement(eachRow);
363
362
  }
364
- const variableData = eachRow.variable_data && Array.isArray(eachRow.variable_data) ? eachRow.variable_data.reduce((acc, curr) => {
365
- for (let i = 0; i < curr.length; i++) {
366
- Object.keys(curr[i].forEach((key) => {
367
- if (curr[i][key] && curr[i][key].element) {
368
- rowElements[eachRow.label] = renderInputElement(curr[i][key] && curr[i][key]);
369
- console.log("++++++++++", curr[i][key] && curr[i][key]);
363
+ if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
364
+ eachRow.variable_data.forEach((variable) => {
365
+ Object.entries(variable).forEach(([key, value]) => {
366
+ if (value && value.element && value.label) {
367
+ rowElements[value.label] = renderInputElement(value);
370
368
  }
371
- }));
369
+ });
370
+ });
371
+ if (eachRow.variable_data.length > 0) {
372
+ const addSubRow = /* @__PURE__ */ React12.createElement("button", null, /* @__PURE__ */ React12.createElement(PlusOutlined, null));
373
+ rowElements[""] = addSubRow;
372
374
  }
373
- return acc;
374
- }, {}) : {};
375
- console.log("-----------");
375
+ }
376
376
  return {
377
377
  key: index.toString(),
378
378
  "#": index + 1,
379
379
  ...eachRow,
380
380
  ...rowElements,
381
- ...variableData,
382
381
  actions: /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)))
383
382
  };
384
383
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta16",
3
+ "version": "0.0.11-Beta18",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",