@apexcura/ui-components 0.0.11-Beta92 → 0.0.11-Beta94

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
@@ -372,6 +372,7 @@ var AddMoreTable = (props) => {
372
372
  variable_data: [
373
373
  {
374
374
  id: 1,
375
+ Medicine: { label: "Medicine", element: "single-select", type: "text" },
375
376
  Route: { label: "Route", element: "single-select", type: "text" },
376
377
  Dose: { label: "Dose", element: "single-select", type: "text" },
377
378
  Frequency: { label: "Frequency", element: "single-select", type: "text" },
@@ -393,6 +394,7 @@ var AddMoreTable = (props) => {
393
394
  if (index === rowIndex) {
394
395
  const newSubRow = {
395
396
  id: row.variable_data.length + 1,
397
+ Medicine: { label: "Medicine", element: "single-select", type: "text" },
396
398
  Route: { label: "Route", element: "single-select", type: "text" },
397
399
  Dose: { label: "Dose", element: "single-select", type: "text" },
398
400
  Frequency: { label: "Frequency", element: "single-select", type: "text" },
@@ -440,22 +442,23 @@ var AddMoreTable = (props) => {
440
442
  return null;
441
443
  }
442
444
  };
443
- const dataSource = rows.map((eachRow, rowIndex) => {
444
- const rowData = {
445
- key: eachRow.id,
446
- "#": rowIndex + 1
447
- };
448
- eachRow.variable_data.forEach((variable, subIndex) => {
445
+ const dataSource = rows.flatMap((eachRow, rowIndex) => {
446
+ return eachRow.variable_data.map((variable, subIndex) => {
447
+ const rowData = {
448
+ key: `${eachRow.id}-${variable.id}`,
449
+ "#": rowIndex + 1,
450
+ "Medicine": renderInputElement(variable.Medicine)
451
+ };
449
452
  Object.keys(variable).forEach((key) => {
450
453
  if (key === "SubRows") {
451
454
  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)));
452
- } else {
455
+ } else if (key !== "Medicine") {
453
456
  rowData[`${key}`] = renderInputElement(variable[key]);
454
457
  }
455
458
  });
459
+ rowData.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)), rowIndex === rows.length - 1 && subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
460
+ return rowData;
456
461
  });
457
- rowData.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)), rowIndex === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
458
- return rowData;
459
462
  });
460
463
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
461
464
  title: eachHeadEl.label,
package/dist/index.mjs CHANGED
@@ -325,6 +325,7 @@ var AddMoreTable = (props) => {
325
325
  variable_data: [
326
326
  {
327
327
  id: 1,
328
+ Medicine: { label: "Medicine", element: "single-select", type: "text" },
328
329
  Route: { label: "Route", element: "single-select", type: "text" },
329
330
  Dose: { label: "Dose", element: "single-select", type: "text" },
330
331
  Frequency: { label: "Frequency", element: "single-select", type: "text" },
@@ -346,6 +347,7 @@ var AddMoreTable = (props) => {
346
347
  if (index === rowIndex) {
347
348
  const newSubRow = {
348
349
  id: row.variable_data.length + 1,
350
+ Medicine: { label: "Medicine", element: "single-select", type: "text" },
349
351
  Route: { label: "Route", element: "single-select", type: "text" },
350
352
  Dose: { label: "Dose", element: "single-select", type: "text" },
351
353
  Frequency: { label: "Frequency", element: "single-select", type: "text" },
@@ -393,22 +395,23 @@ var AddMoreTable = (props) => {
393
395
  return null;
394
396
  }
395
397
  };
396
- const dataSource = rows.map((eachRow, rowIndex) => {
397
- const rowData = {
398
- key: eachRow.id,
399
- "#": rowIndex + 1
400
- };
401
- eachRow.variable_data.forEach((variable, subIndex) => {
398
+ const dataSource = rows.flatMap((eachRow, rowIndex) => {
399
+ return eachRow.variable_data.map((variable, subIndex) => {
400
+ const rowData = {
401
+ key: `${eachRow.id}-${variable.id}`,
402
+ "#": rowIndex + 1,
403
+ "Medicine": renderInputElement(variable.Medicine)
404
+ };
402
405
  Object.keys(variable).forEach((key) => {
403
406
  if (key === "SubRows") {
404
407
  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)));
405
- } else {
408
+ } else if (key !== "Medicine") {
406
409
  rowData[`${key}`] = renderInputElement(variable[key]);
407
410
  }
408
411
  });
412
+ rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
413
+ return rowData;
409
414
  });
410
- rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
411
- return rowData;
412
415
  });
413
416
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
414
417
  title: eachHeadEl.label,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta92",
3
+ "version": "0.0.11-Beta94",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",