@apexcura/ui-components 0.0.11-Beta83 → 0.0.11-Beta85

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
@@ -452,24 +452,15 @@ var AddMoreTable = (props) => {
452
452
  const rowData = {
453
453
  key: eachRow.id,
454
454
  "#": index + 1,
455
- "Medicine": renderInputElement({
455
+ Medicine: renderInputElement({
456
456
  element: eachRow.element,
457
457
  label: eachRow.label
458
458
  }),
459
- ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
460
- Object.keys(variable).forEach((key) => {
461
- console.log("key------", key);
462
- if (key === "SubRows") {
463
- acc[`${key}`] = /* @__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)));
464
- } else {
465
- acc[`${key}`] = renderInputElement(variable[key]);
466
- }
467
- });
468
- return acc;
469
- }, {}),
470
459
  actions: /* @__PURE__ */ import_react13.default.createElement("div", 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)))
471
460
  };
472
- console.log(rowData);
461
+ eachRow.variable_data.forEach((variable, subIndex) => {
462
+ rowData[`subRow-${subIndex}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex, style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Route)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Dose)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Frequency)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.When)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Duration)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Instructions)), /* @__PURE__ */ import_react13.default.createElement("div", { style: { flex: 1 } }, 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))));
463
+ });
473
464
  return rowData;
474
465
  });
475
466
  if (!columns.some((col) => col.dataIndex === "actions")) {
@@ -479,6 +470,22 @@ var AddMoreTable = (props) => {
479
470
  key: "actions"
480
471
  });
481
472
  }
473
+ const subRowColumns = [
474
+ { title: "Route", dataIndex: "Route", key: "Route" },
475
+ { title: "Dose", dataIndex: "Dose", key: "Dose" },
476
+ { title: "Frequency", dataIndex: "Frequency", key: "Frequency" },
477
+ { title: "When", dataIndex: "When", key: "When" },
478
+ { title: "Duration", dataIndex: "Duration", key: "Duration" },
479
+ { title: "Instructions", dataIndex: "Instructions", key: "Instructions" },
480
+ { title: "SubRows", dataIndex: "SubRows", key: "SubRows" }
481
+ ];
482
+ subRowColumns.forEach((col, index) => {
483
+ columns.push({
484
+ title: col.title,
485
+ dataIndex: `subRow-${index}`,
486
+ key: `subRow-${index}`
487
+ });
488
+ });
482
489
  return /* @__PURE__ */ import_react13.default.createElement(
483
490
  import_antd11.Table,
484
491
  {
package/dist/index.mjs CHANGED
@@ -405,24 +405,15 @@ var AddMoreTable = (props) => {
405
405
  const rowData = {
406
406
  key: eachRow.id,
407
407
  "#": index + 1,
408
- "Medicine": renderInputElement({
408
+ Medicine: renderInputElement({
409
409
  element: eachRow.element,
410
410
  label: eachRow.label
411
411
  }),
412
- ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
413
- Object.keys(variable).forEach((key) => {
414
- console.log("key------", key);
415
- if (key === "SubRows") {
416
- acc[`${key}`] = /* @__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)));
417
- } else {
418
- acc[`${key}`] = renderInputElement(variable[key]);
419
- }
420
- });
421
- return acc;
422
- }, {}),
423
412
  actions: /* @__PURE__ */ React12.createElement("div", 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)))
424
413
  };
425
- console.log(rowData);
414
+ eachRow.variable_data.forEach((variable, subIndex) => {
415
+ rowData[`subRow-${subIndex}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex, style: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Route)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Dose)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Frequency)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.When)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Duration)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, renderInputElement(variable.Instructions)), /* @__PURE__ */ React12.createElement("div", { style: { flex: 1 } }, 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))));
416
+ });
426
417
  return rowData;
427
418
  });
428
419
  if (!columns.some((col) => col.dataIndex === "actions")) {
@@ -432,6 +423,22 @@ var AddMoreTable = (props) => {
432
423
  key: "actions"
433
424
  });
434
425
  }
426
+ const subRowColumns = [
427
+ { title: "Route", dataIndex: "Route", key: "Route" },
428
+ { title: "Dose", dataIndex: "Dose", key: "Dose" },
429
+ { title: "Frequency", dataIndex: "Frequency", key: "Frequency" },
430
+ { title: "When", dataIndex: "When", key: "When" },
431
+ { title: "Duration", dataIndex: "Duration", key: "Duration" },
432
+ { title: "Instructions", dataIndex: "Instructions", key: "Instructions" },
433
+ { title: "SubRows", dataIndex: "SubRows", key: "SubRows" }
434
+ ];
435
+ subRowColumns.forEach((col, index) => {
436
+ columns.push({
437
+ title: col.title,
438
+ dataIndex: `subRow-${index}`,
439
+ key: `subRow-${index}`
440
+ });
441
+ });
435
442
  return /* @__PURE__ */ React12.createElement(
436
443
  Table,
437
444
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta83",
3
+ "version": "0.0.11-Beta85",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",