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

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
@@ -405,6 +405,7 @@ var AddMoreTable = (props) => {
405
405
  label: "Medicine",
406
406
  name: "Medicine",
407
407
  type: "text",
408
+ element: "single-select",
408
409
  variable_data: [
409
410
  {
410
411
  id: 1,
@@ -477,20 +478,21 @@ var AddMoreTable = (props) => {
477
478
  }
478
479
  };
479
480
  const dataSource = rows.map((eachRow, rowIndex) => {
480
- let rowData = {
481
+ const rowData = {
481
482
  key: eachRow.id,
482
483
  "#": rowIndex + 1,
483
- Medicine: renderInputElement({
484
+ "Medicine": renderInputElement({
484
485
  element: eachRow.element,
485
486
  label: eachRow.label
486
487
  })
487
488
  };
488
- eachRow.variable_data.forEach((subRow, subRowIndex) => {
489
- Object.entries(subRow).forEach(([key, value]) => {
489
+ eachRow.variable_data.forEach((variable, subIndex) => {
490
+ console.log(variable, subIndex);
491
+ Object.keys(variable).forEach((key) => {
490
492
  if (key === "SubRows") {
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
+ 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)));
492
494
  } else {
493
- rowData[`${key}${subRowIndex}`] = renderInputElement(value);
495
+ rowData[`${key}`] = renderInputElement(variable[key]);
494
496
  }
495
497
  });
496
498
  });
package/dist/index.mjs CHANGED
@@ -358,6 +358,7 @@ var AddMoreTable = (props) => {
358
358
  label: "Medicine",
359
359
  name: "Medicine",
360
360
  type: "text",
361
+ element: "single-select",
361
362
  variable_data: [
362
363
  {
363
364
  id: 1,
@@ -430,20 +431,21 @@ var AddMoreTable = (props) => {
430
431
  }
431
432
  };
432
433
  const dataSource = rows.map((eachRow, rowIndex) => {
433
- let rowData = {
434
+ const rowData = {
434
435
  key: eachRow.id,
435
436
  "#": rowIndex + 1,
436
- Medicine: renderInputElement({
437
+ "Medicine": renderInputElement({
437
438
  element: eachRow.element,
438
439
  label: eachRow.label
439
440
  })
440
441
  };
441
- eachRow.variable_data.forEach((subRow, subRowIndex) => {
442
- Object.entries(subRow).forEach(([key, value]) => {
442
+ eachRow.variable_data.forEach((variable, subIndex) => {
443
+ console.log(variable, subIndex);
444
+ Object.keys(variable).forEach((key) => {
443
445
  if (key === "SubRows") {
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
+ 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)));
445
447
  } else {
446
- rowData[`${key}${subRowIndex}`] = renderInputElement(value);
448
+ rowData[`${key}`] = renderInputElement(variable[key]);
447
449
  }
448
450
  });
449
451
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta44",
3
+ "version": "0.0.12-Beta46",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",