@apexcura/ui-components 0.0.11-Beta52 → 0.0.11-Beta54

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
@@ -461,28 +461,28 @@ var AddMoreTable = (props) => {
461
461
  ...eachRow,
462
462
  actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)))
463
463
  };
464
- const rowElements = [mainRow];
465
- const medicineInputElement = {
466
- [eachRow.label]: renderInputElement({
467
- element: eachRow.element,
468
- label: eachRow.label
469
- })
470
- };
471
- rowElements.push(medicineInputElement);
464
+ const subRowElements = [];
472
465
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
473
466
  eachRow.variable_data.forEach((variable, subIndex) => {
474
- const subRowElements = {};
467
+ const subRowElement = {};
475
468
  Object.entries(variable).forEach(([key, value]) => {
476
469
  if (key === "icons" && value) {
477
- subRowElements["sub rows"] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(index, 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(index) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
470
+ subRowElement["sub rows"] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(index, 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(index) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
478
471
  } else if (value && value.element && value.label) {
479
- subRowElements[value.label] = renderInputElement(value);
472
+ subRowElement[value.label] = renderInputElement(value);
480
473
  }
481
474
  });
482
- rowElements.push(subRowElements);
475
+ subRowElements.push(subRowElement);
483
476
  });
484
477
  }
485
- rowData.push(...rowElements);
478
+ rowData.push({
479
+ ...mainRow,
480
+ "Medicine": renderInputElement({
481
+ element: eachRow.element,
482
+ label: eachRow.label
483
+ }),
484
+ "sub rows": subRowElements
485
+ });
486
486
  console.log(rowData);
487
487
  return rowData;
488
488
  });
package/dist/index.mjs CHANGED
@@ -414,28 +414,28 @@ var AddMoreTable = (props) => {
414
414
  ...eachRow,
415
415
  actions: /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)))
416
416
  };
417
- const rowElements = [mainRow];
418
- const medicineInputElement = {
419
- [eachRow.label]: renderInputElement({
420
- element: eachRow.element,
421
- label: eachRow.label
422
- })
423
- };
424
- rowElements.push(medicineInputElement);
417
+ const subRowElements = [];
425
418
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
426
419
  eachRow.variable_data.forEach((variable, subIndex) => {
427
- const subRowElements = {};
420
+ const subRowElement = {};
428
421
  Object.entries(variable).forEach(([key, value]) => {
429
422
  if (key === "icons" && value) {
430
- subRowElements["sub rows"] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(index, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(index) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
423
+ subRowElement["sub rows"] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(index, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(index) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
431
424
  } else if (value && value.element && value.label) {
432
- subRowElements[value.label] = renderInputElement(value);
425
+ subRowElement[value.label] = renderInputElement(value);
433
426
  }
434
427
  });
435
- rowElements.push(subRowElements);
428
+ subRowElements.push(subRowElement);
436
429
  });
437
430
  }
438
- rowData.push(...rowElements);
431
+ rowData.push({
432
+ ...mainRow,
433
+ "Medicine": renderInputElement({
434
+ element: eachRow.element,
435
+ label: eachRow.label
436
+ }),
437
+ "sub rows": subRowElements
438
+ });
439
439
  console.log(rowData);
440
440
  return rowData;
441
441
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta52",
3
+ "version": "0.0.11-Beta54",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
@@ -48,6 +48,7 @@
48
48
  "node": ">=18.0.0"
49
49
  },
50
50
  "dependencies": {
51
+ "@apexcura/ui-components": "^0.0.11-Beta53",
51
52
  "@tinymce/tinymce-react": "^5.0.1"
52
53
  }
53
54
  }