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

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
@@ -456,22 +456,22 @@ var AddMoreTable = (props) => {
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);
473
- return rowData;
474
- });
461
+ const subRowData = eachRow.variable_data.map((variable, subIndex) => ({
462
+ key: `${eachRow.id}-${subIndex}`,
463
+ "#": `${index + 1}.${subIndex + 1}`,
464
+ ...Object.keys(variable).reduce((acc, key) => {
465
+ if (key === "SubRows") {
466
+ 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)));
467
+ } else {
468
+ acc[`${key}`] = renderInputElement(variable[key]);
469
+ }
470
+ return acc;
471
+ }, {})
472
+ }));
473
+ return [rowData, ...subRowData];
474
+ }).flat();
475
475
  if (!columns.some((col) => col.dataIndex === "actions")) {
476
476
  columns.push({
477
477
  title: "Actions",
package/dist/index.mjs CHANGED
@@ -409,22 +409,22 @@ var AddMoreTable = (props) => {
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);
426
- return rowData;
427
- });
414
+ const subRowData = eachRow.variable_data.map((variable, subIndex) => ({
415
+ key: `${eachRow.id}-${subIndex}`,
416
+ "#": `${index + 1}.${subIndex + 1}`,
417
+ ...Object.keys(variable).reduce((acc, key) => {
418
+ if (key === "SubRows") {
419
+ 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)));
420
+ } else {
421
+ acc[`${key}`] = renderInputElement(variable[key]);
422
+ }
423
+ return acc;
424
+ }, {})
425
+ }));
426
+ return [rowData, ...subRowData];
427
+ }).flat();
428
428
  if (!columns.some((col) => col.dataIndex === "actions")) {
429
429
  columns.push({
430
430
  title: "Actions",
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-Beta84",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",