@apexcura/ui-components 0.0.11-Beta45 → 0.0.11-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
@@ -392,7 +392,6 @@ var AddMoreTable = (props) => {
392
392
  }
393
393
  ]
394
394
  };
395
- console.log(rows);
396
395
  setRows((prevData) => [...prevData, newRow]);
397
396
  };
398
397
  const onHandleDelete = (index) => {
@@ -453,29 +452,29 @@ var AddMoreTable = (props) => {
453
452
  return null;
454
453
  }
455
454
  };
456
- const dataSource = rows.flatMap((eachRow, index) => {
457
- const rowData = [];
458
- const mainRow = {
459
- key: index.toString(),
460
- "#": index + 1,
461
- ...eachRow,
462
- actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, 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)))
463
- };
464
- rowData.push(mainRow);
455
+ const dataSource = rows.map((eachRow, index) => {
456
+ const rowElements = {};
457
+ if (eachRow.element && eachRow.label) {
458
+ rowElements[eachRow.label] = renderInputElement(eachRow);
459
+ }
465
460
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
466
461
  eachRow.variable_data.forEach((variable, subIndex) => {
467
- const subRowElements = {};
468
462
  Object.entries(variable).forEach(([key, value]) => {
469
463
  if (key === "icons" && value) {
470
- subRowElements["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)));
464
+ rowElements["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)));
471
465
  } else if (value && value.element && value.label) {
472
- subRowElements[value.label] = renderInputElement(value);
466
+ rowElements[value.label] = renderInputElement(value);
473
467
  }
474
468
  });
475
- rowData.push(subRowElements);
476
469
  });
477
470
  }
478
- return rowData;
471
+ return {
472
+ key: index.toString(),
473
+ "#": index + 1,
474
+ ...eachRow,
475
+ ...rowElements,
476
+ actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, 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)))
477
+ };
479
478
  });
480
479
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
481
480
  columns.push({
package/dist/index.mjs CHANGED
@@ -345,7 +345,6 @@ var AddMoreTable = (props) => {
345
345
  }
346
346
  ]
347
347
  };
348
- console.log(rows);
349
348
  setRows((prevData) => [...prevData, newRow]);
350
349
  };
351
350
  const onHandleDelete = (index) => {
@@ -406,29 +405,29 @@ var AddMoreTable = (props) => {
406
405
  return null;
407
406
  }
408
407
  };
409
- const dataSource = rows.flatMap((eachRow, index) => {
410
- const rowData = [];
411
- const mainRow = {
412
- key: index.toString(),
413
- "#": index + 1,
414
- ...eachRow,
415
- actions: /* @__PURE__ */ React12.createElement(React12.Fragment, 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)))
416
- };
417
- rowData.push(mainRow);
408
+ const dataSource = rows.map((eachRow, index) => {
409
+ const rowElements = {};
410
+ if (eachRow.element && eachRow.label) {
411
+ rowElements[eachRow.label] = renderInputElement(eachRow);
412
+ }
418
413
  if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
419
414
  eachRow.variable_data.forEach((variable, subIndex) => {
420
- const subRowElements = {};
421
415
  Object.entries(variable).forEach(([key, value]) => {
422
416
  if (key === "icons" && value) {
423
- subRowElements["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)));
417
+ rowElements["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)));
424
418
  } else if (value && value.element && value.label) {
425
- subRowElements[value.label] = renderInputElement(value);
419
+ rowElements[value.label] = renderInputElement(value);
426
420
  }
427
421
  });
428
- rowData.push(subRowElements);
429
422
  });
430
423
  }
431
- return rowData;
424
+ return {
425
+ key: index.toString(),
426
+ "#": index + 1,
427
+ ...eachRow,
428
+ ...rowElements,
429
+ actions: /* @__PURE__ */ React12.createElement(React12.Fragment, 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)))
430
+ };
432
431
  });
433
432
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
434
433
  columns.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta45",
3
+ "version": "0.0.11-Beta46",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",