@apexcura/ui-components 0.0.11-Beta91 → 0.0.11-Beta93

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
@@ -369,6 +369,9 @@ var AddMoreTable = (props) => {
369
369
  const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
370
370
  let newRow = {
371
371
  id: newId,
372
+ label: "Medicine",
373
+ name: "Medicine",
374
+ type: "text",
372
375
  variable_data: [
373
376
  {
374
377
  id: 1,
@@ -440,22 +443,22 @@ var AddMoreTable = (props) => {
440
443
  return null;
441
444
  }
442
445
  };
443
- const dataSource = rows.map((eachRow, index) => {
446
+ const dataSource = rows.map((eachRow, rowIndex) => {
444
447
  const rowData = {
445
448
  key: eachRow.id,
446
- "#": index + 1,
447
- ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
448
- Object.keys(variable).forEach((key) => {
449
- if (key === "SubRows") {
450
- 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)));
451
- } else {
452
- acc[`${key}`] = renderInputElement(variable[key]);
453
- }
454
- });
455
- return acc;
456
- }, {}),
457
- 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)))
449
+ "#": rowIndex + 1,
450
+ "Medicine": renderInputElement(eachRow.name, eachRow.label)
458
451
  };
452
+ eachRow.variable_data.map((variable, subIndex) => {
453
+ Object.keys(variable).forEach((key) => {
454
+ if (key === "SubRows") {
455
+ 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)));
456
+ } else {
457
+ rowData[`${key}`] = renderInputElement(variable[key]);
458
+ }
459
+ });
460
+ });
461
+ 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)));
459
462
  return rowData;
460
463
  });
461
464
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
package/dist/index.mjs CHANGED
@@ -322,6 +322,9 @@ var AddMoreTable = (props) => {
322
322
  const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
323
323
  let newRow = {
324
324
  id: newId,
325
+ label: "Medicine",
326
+ name: "Medicine",
327
+ type: "text",
325
328
  variable_data: [
326
329
  {
327
330
  id: 1,
@@ -393,22 +396,22 @@ var AddMoreTable = (props) => {
393
396
  return null;
394
397
  }
395
398
  };
396
- const dataSource = rows.map((eachRow, index) => {
399
+ const dataSource = rows.map((eachRow, rowIndex) => {
397
400
  const rowData = {
398
401
  key: eachRow.id,
399
- "#": index + 1,
400
- ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
401
- Object.keys(variable).forEach((key) => {
402
- if (key === "SubRows") {
403
- 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)));
404
- } else {
405
- acc[`${key}`] = renderInputElement(variable[key]);
406
- }
407
- });
408
- return acc;
409
- }, {}),
410
- 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)))
402
+ "#": rowIndex + 1,
403
+ "Medicine": renderInputElement(eachRow.name, eachRow.label)
411
404
  };
405
+ eachRow.variable_data.map((variable, subIndex) => {
406
+ Object.keys(variable).forEach((key) => {
407
+ if (key === "SubRows") {
408
+ 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)));
409
+ } else {
410
+ rowData[`${key}`] = renderInputElement(variable[key]);
411
+ }
412
+ });
413
+ });
414
+ 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)));
412
415
  return rowData;
413
416
  });
414
417
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta91",
3
+ "version": "0.0.11-Beta93",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",