@apexcura/ui-components 0.0.11-Beta53 → 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,30 +461,29 @@ 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 = [];
465
- rowElements.push(mainRow);
466
- const medicineInputElement = {
467
- [eachRow.label]: renderInputElement({
468
- element: eachRow.element,
469
- label: eachRow.label
470
- })
471
- };
472
- rowElements.push(medicineInputElement);
464
+ const subRowElements = [];
473
465
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
474
466
  eachRow.variable_data.forEach((variable, subIndex) => {
475
- const subRowElements = {};
467
+ const subRowElement = {};
476
468
  Object.entries(variable).forEach(([key, value]) => {
477
469
  if (key === "icons" && value) {
478
- 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)));
479
471
  } else if (value && value.element && value.label) {
480
- subRowElements[value.label] = renderInputElement(value);
472
+ subRowElement[value.label] = renderInputElement(value);
481
473
  }
482
474
  });
483
- rowElements.push(subRowElements);
475
+ subRowElements.push(subRowElement);
484
476
  });
485
477
  }
486
- rowData.push(...rowElements);
487
- console.log("rowData");
478
+ rowData.push({
479
+ ...mainRow,
480
+ "Medicine": renderInputElement({
481
+ element: eachRow.element,
482
+ label: eachRow.label
483
+ }),
484
+ "sub rows": subRowElements
485
+ });
486
+ console.log(rowData);
488
487
  return rowData;
489
488
  });
490
489
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
package/dist/index.mjs CHANGED
@@ -414,30 +414,29 @@ 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 = [];
418
- rowElements.push(mainRow);
419
- const medicineInputElement = {
420
- [eachRow.label]: renderInputElement({
421
- element: eachRow.element,
422
- label: eachRow.label
423
- })
424
- };
425
- rowElements.push(medicineInputElement);
417
+ const subRowElements = [];
426
418
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
427
419
  eachRow.variable_data.forEach((variable, subIndex) => {
428
- const subRowElements = {};
420
+ const subRowElement = {};
429
421
  Object.entries(variable).forEach(([key, value]) => {
430
422
  if (key === "icons" && value) {
431
- 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)));
432
424
  } else if (value && value.element && value.label) {
433
- subRowElements[value.label] = renderInputElement(value);
425
+ subRowElement[value.label] = renderInputElement(value);
434
426
  }
435
427
  });
436
- rowElements.push(subRowElements);
428
+ subRowElements.push(subRowElement);
437
429
  });
438
430
  }
439
- rowData.push(...rowElements);
440
- console.log("rowData");
431
+ rowData.push({
432
+ ...mainRow,
433
+ "Medicine": renderInputElement({
434
+ element: eachRow.element,
435
+ label: eachRow.label
436
+ }),
437
+ "sub rows": subRowElements
438
+ });
439
+ console.log(rowData);
441
440
  return rowData;
442
441
  });
443
442
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta53",
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
  }