@apexcura/ui-components 0.0.11-Beta94 → 0.0.11-Beta97
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 +13 -12
- package/dist/index.mjs +13 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -369,10 +369,12 @@ 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,
|
|
375
|
-
Medicine: { label: "Medicine", element: "single-select", type: "text" },
|
|
376
378
|
Route: { label: "Route", element: "single-select", type: "text" },
|
|
377
379
|
Dose: { label: "Dose", element: "single-select", type: "text" },
|
|
378
380
|
Frequency: { label: "Frequency", element: "single-select", type: "text" },
|
|
@@ -394,7 +396,6 @@ var AddMoreTable = (props) => {
|
|
|
394
396
|
if (index === rowIndex) {
|
|
395
397
|
const newSubRow = {
|
|
396
398
|
id: row.variable_data.length + 1,
|
|
397
|
-
Medicine: { label: "Medicine", element: "single-select", type: "text" },
|
|
398
399
|
Route: { label: "Route", element: "single-select", type: "text" },
|
|
399
400
|
Dose: { label: "Dose", element: "single-select", type: "text" },
|
|
400
401
|
Frequency: { label: "Frequency", element: "single-select", type: "text" },
|
|
@@ -442,23 +443,23 @@ var AddMoreTable = (props) => {
|
|
|
442
443
|
return null;
|
|
443
444
|
}
|
|
444
445
|
};
|
|
445
|
-
const dataSource = rows.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
446
|
+
const dataSource = rows.map((eachRow, rowIndex) => {
|
|
447
|
+
const rowData = {
|
|
448
|
+
key: eachRow.id,
|
|
449
|
+
"#": rowIndex + 1
|
|
450
|
+
};
|
|
451
|
+
rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
|
|
452
|
+
eachRow.variable_data.map((variable, subIndex) => {
|
|
452
453
|
Object.keys(variable).forEach((key) => {
|
|
453
454
|
if (key === "SubRows") {
|
|
454
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)));
|
|
455
|
-
} else
|
|
456
|
+
} else {
|
|
456
457
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
457
458
|
}
|
|
458
459
|
});
|
|
459
|
-
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 && subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
|
|
460
|
-
return rowData;
|
|
461
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)));
|
|
462
|
+
return rowData;
|
|
462
463
|
});
|
|
463
464
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
464
465
|
title: eachHeadEl.label,
|
package/dist/index.mjs
CHANGED
|
@@ -322,10 +322,12 @@ 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,
|
|
328
|
-
Medicine: { label: "Medicine", element: "single-select", type: "text" },
|
|
329
331
|
Route: { label: "Route", element: "single-select", type: "text" },
|
|
330
332
|
Dose: { label: "Dose", element: "single-select", type: "text" },
|
|
331
333
|
Frequency: { label: "Frequency", element: "single-select", type: "text" },
|
|
@@ -347,7 +349,6 @@ var AddMoreTable = (props) => {
|
|
|
347
349
|
if (index === rowIndex) {
|
|
348
350
|
const newSubRow = {
|
|
349
351
|
id: row.variable_data.length + 1,
|
|
350
|
-
Medicine: { label: "Medicine", element: "single-select", type: "text" },
|
|
351
352
|
Route: { label: "Route", element: "single-select", type: "text" },
|
|
352
353
|
Dose: { label: "Dose", element: "single-select", type: "text" },
|
|
353
354
|
Frequency: { label: "Frequency", element: "single-select", type: "text" },
|
|
@@ -395,23 +396,23 @@ var AddMoreTable = (props) => {
|
|
|
395
396
|
return null;
|
|
396
397
|
}
|
|
397
398
|
};
|
|
398
|
-
const dataSource = rows.
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
399
|
+
const dataSource = rows.map((eachRow, rowIndex) => {
|
|
400
|
+
const rowData = {
|
|
401
|
+
key: eachRow.id,
|
|
402
|
+
"#": rowIndex + 1
|
|
403
|
+
};
|
|
404
|
+
rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
|
|
405
|
+
eachRow.variable_data.map((variable, subIndex) => {
|
|
405
406
|
Object.keys(variable).forEach((key) => {
|
|
406
407
|
if (key === "SubRows") {
|
|
407
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)));
|
|
408
|
-
} else
|
|
409
|
+
} else {
|
|
409
410
|
rowData[`${key}`] = renderInputElement(variable[key]);
|
|
410
411
|
}
|
|
411
412
|
});
|
|
412
|
-
rowData.actions = /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), rowIndex === rows.length - 1 && subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
413
|
-
return rowData;
|
|
414
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)));
|
|
415
|
+
return rowData;
|
|
415
416
|
});
|
|
416
417
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
417
418
|
title: eachHeadEl.label,
|