@apexcura/ui-components 0.0.11-Beta67 → 0.0.11-Beta69
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 +18 -16
- package/dist/index.mjs +18 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -445,29 +445,31 @@ var AddMoreTable = (props) => {
|
|
|
445
445
|
return null;
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
const dataSource = rows.
|
|
449
|
-
|
|
450
|
-
const rowData = {
|
|
448
|
+
const dataSource = rows.flatMap((eachRow, index) => {
|
|
449
|
+
const mainRow = {
|
|
451
450
|
key: eachRow.id.toString(),
|
|
452
451
|
"#": index + 1,
|
|
453
452
|
"Medicine": renderInputElement({
|
|
454
453
|
element: eachRow.element,
|
|
455
454
|
label: eachRow.label
|
|
456
455
|
}),
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
456
|
+
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))),
|
|
457
|
+
subRows: eachRow.variable_data.map((variable, subIndex) => {
|
|
458
|
+
const subRow = {
|
|
459
|
+
key: `${eachRow.id}-${subIndex}`,
|
|
460
|
+
...Object.fromEntries(Object.entries(variable).map(([key, value]) => {
|
|
461
|
+
if (key === "icons") {
|
|
462
|
+
return ["actions", /* @__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)))];
|
|
463
|
+
} else {
|
|
464
|
+
return [key, renderInputElement(value)];
|
|
465
|
+
}
|
|
466
|
+
}))
|
|
467
|
+
};
|
|
468
|
+
return subRow;
|
|
469
|
+
})
|
|
468
470
|
};
|
|
469
|
-
return
|
|
470
|
-
})
|
|
471
|
+
return mainRow;
|
|
472
|
+
});
|
|
471
473
|
if (!columns.some((col) => col.dataIndex === "actions")) {
|
|
472
474
|
columns.push({
|
|
473
475
|
title: "Actions",
|
package/dist/index.mjs
CHANGED
|
@@ -398,29 +398,31 @@ var AddMoreTable = (props) => {
|
|
|
398
398
|
return null;
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
const dataSource = rows.
|
|
402
|
-
|
|
403
|
-
const rowData = {
|
|
401
|
+
const dataSource = rows.flatMap((eachRow, index) => {
|
|
402
|
+
const mainRow = {
|
|
404
403
|
key: eachRow.id.toString(),
|
|
405
404
|
"#": index + 1,
|
|
406
405
|
"Medicine": renderInputElement({
|
|
407
406
|
element: eachRow.element,
|
|
408
407
|
label: eachRow.label
|
|
409
408
|
}),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
409
|
+
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))),
|
|
410
|
+
subRows: eachRow.variable_data.map((variable, subIndex) => {
|
|
411
|
+
const subRow = {
|
|
412
|
+
key: `${eachRow.id}-${subIndex}`,
|
|
413
|
+
...Object.fromEntries(Object.entries(variable).map(([key, value]) => {
|
|
414
|
+
if (key === "icons") {
|
|
415
|
+
return ["actions", /* @__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)))];
|
|
416
|
+
} else {
|
|
417
|
+
return [key, renderInputElement(value)];
|
|
418
|
+
}
|
|
419
|
+
}))
|
|
420
|
+
};
|
|
421
|
+
return subRow;
|
|
422
|
+
})
|
|
421
423
|
};
|
|
422
|
-
return
|
|
423
|
-
})
|
|
424
|
+
return mainRow;
|
|
425
|
+
});
|
|
424
426
|
if (!columns.some((col) => col.dataIndex === "actions")) {
|
|
425
427
|
columns.push({
|
|
426
428
|
title: "Actions",
|