@apexcura/ui-components 0.0.11-Beta76 → 0.0.11-Beta78

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
@@ -446,26 +446,28 @@ var AddMoreTable = (props) => {
446
446
  }
447
447
  };
448
448
  const dataSource = rows.map((eachRow, index) => {
449
- const subRow = eachRow.variable_data.map((variable, subIndex) => ({
450
- key: `${eachRow.id}-${subIndex}`,
451
- ...Object.fromEntries(Object.entries(variable).map(([key, value]) => {
452
- if (key === "icons") {
453
- return ["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)))];
454
- } else {
455
- return [key, renderInputElement(value)];
456
- }
457
- }))
458
- }));
459
449
  const rowData = {
460
- "9": index + 1,
450
+ key: eachRow.id,
451
+ "#": index + 1,
461
452
  "Medicine": renderInputElement({
462
453
  element: eachRow.element,
463
454
  label: eachRow.label
464
455
  }),
456
+ ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
457
+ Object.keys(variable).forEach((key) => {
458
+ if (key === "icons") {
459
+ acc[`icons-${subIndex}`] = /* @__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)));
460
+ } else {
461
+ acc[`${key}-${subIndex}`] = renderInputElement(variable[key]);
462
+ }
463
+ });
464
+ return acc;
465
+ }, {}),
465
466
  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)))
466
467
  };
467
- return [rowData, ...subRow];
468
- }).flat();
468
+ console.log(rowData);
469
+ return rowData;
470
+ });
469
471
  if (!columns.some((col) => col.dataIndex === "actions")) {
470
472
  columns.push({
471
473
  title: "Actions",
package/dist/index.mjs CHANGED
@@ -399,26 +399,28 @@ var AddMoreTable = (props) => {
399
399
  }
400
400
  };
401
401
  const dataSource = rows.map((eachRow, index) => {
402
- const subRow = eachRow.variable_data.map((variable, subIndex) => ({
403
- key: `${eachRow.id}-${subIndex}`,
404
- ...Object.fromEntries(Object.entries(variable).map(([key, value]) => {
405
- if (key === "icons") {
406
- return ["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)))];
407
- } else {
408
- return [key, renderInputElement(value)];
409
- }
410
- }))
411
- }));
412
402
  const rowData = {
413
- "9": index + 1,
403
+ key: eachRow.id,
404
+ "#": index + 1,
414
405
  "Medicine": renderInputElement({
415
406
  element: eachRow.element,
416
407
  label: eachRow.label
417
408
  }),
409
+ ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
410
+ Object.keys(variable).forEach((key) => {
411
+ if (key === "icons") {
412
+ acc[`icons-${subIndex}`] = /* @__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)));
413
+ } else {
414
+ acc[`${key}-${subIndex}`] = renderInputElement(variable[key]);
415
+ }
416
+ });
417
+ return acc;
418
+ }, {}),
418
419
  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)))
419
420
  };
420
- return [rowData, ...subRow];
421
- }).flat();
421
+ console.log(rowData);
422
+ return rowData;
423
+ });
422
424
  if (!columns.some((col) => col.dataIndex === "actions")) {
423
425
  columns.push({
424
426
  title: "Actions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta76",
3
+ "version": "0.0.11-Beta78",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",