@apexcura/ui-components 0.0.12-Beta43 → 0.0.12-Beta44

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
@@ -477,21 +477,20 @@ var AddMoreTable = (props) => {
477
477
  }
478
478
  };
479
479
  const dataSource = rows.map((eachRow, rowIndex) => {
480
- const rowData = {
480
+ let rowData = {
481
481
  key: eachRow.id,
482
482
  "#": rowIndex + 1,
483
- "Medicine": renderInputElement({
483
+ Medicine: renderInputElement({
484
484
  element: eachRow.element,
485
485
  label: eachRow.label
486
486
  })
487
487
  };
488
- rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
489
- eachRow.variable_data.map((variable, subIndex) => {
490
- Object.keys(variable).forEach((key) => {
488
+ eachRow.variable_data.forEach((subRow, subRowIndex) => {
489
+ Object.entries(subRow).forEach(([key, value]) => {
491
490
  if (key === "SubRows") {
492
- rowData[`${key}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
491
+ rowData[`${key}${subRowIndex}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subRowIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subRowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subRowIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
493
492
  } else {
494
- rowData[`${key}`] = renderInputElement(variable[key]);
493
+ rowData[`${key}${subRowIndex}`] = renderInputElement(value);
495
494
  }
496
495
  });
497
496
  });
package/dist/index.mjs CHANGED
@@ -430,21 +430,20 @@ var AddMoreTable = (props) => {
430
430
  }
431
431
  };
432
432
  const dataSource = rows.map((eachRow, rowIndex) => {
433
- const rowData = {
433
+ let rowData = {
434
434
  key: eachRow.id,
435
435
  "#": rowIndex + 1,
436
- "Medicine": renderInputElement({
436
+ Medicine: renderInputElement({
437
437
  element: eachRow.element,
438
438
  label: eachRow.label
439
439
  })
440
440
  };
441
- rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
442
- eachRow.variable_data.map((variable, subIndex) => {
443
- Object.keys(variable).forEach((key) => {
441
+ eachRow.variable_data.forEach((subRow, subRowIndex) => {
442
+ Object.entries(subRow).forEach(([key, value]) => {
444
443
  if (key === "SubRows") {
445
- rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
444
+ rowData[`${key}${subRowIndex}`] = /* @__PURE__ */ React12.createElement("div", { key: subRowIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(rowIndex, subRowIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subRowIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
446
445
  } else {
447
- rowData[`${key}`] = renderInputElement(variable[key]);
446
+ rowData[`${key}${subRowIndex}`] = renderInputElement(value);
448
447
  }
449
448
  });
450
449
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta43",
3
+ "version": "0.0.12-Beta44",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",