@apexcura/ui-components 0.0.11-Beta26 → 0.0.11-Beta28
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 +3 -69
- package/dist/index.mjs +3 -69
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -378,11 +378,7 @@ var AddMoreTable = (props) => {
|
|
|
378
378
|
const newId = lastRow ? lastRow.id + 1 : 1;
|
|
379
379
|
let newRow = {
|
|
380
380
|
...lastRow,
|
|
381
|
-
id: newId
|
|
382
|
-
variable_data: lastRow ? lastRow.variable_data.map((item) => ({
|
|
383
|
-
...item,
|
|
384
|
-
id: item.id + 1
|
|
385
|
-
})) : []
|
|
381
|
+
id: newId
|
|
386
382
|
};
|
|
387
383
|
setRows((prevData) => [...prevData, newRow]);
|
|
388
384
|
};
|
|
@@ -392,56 +388,6 @@ var AddMoreTable = (props) => {
|
|
|
392
388
|
setRows(remainingRows);
|
|
393
389
|
}
|
|
394
390
|
};
|
|
395
|
-
const onHandleVariableData = (rowId) => {
|
|
396
|
-
setRows((prevRows) => prevRows.map((row) => {
|
|
397
|
-
if (row.id === rowId) {
|
|
398
|
-
const newVariableDataId = row.variable_data.length > 0 ? row.variable_data[row.variable_data.length - 1].id + 1 : 1;
|
|
399
|
-
const newVariableData = {
|
|
400
|
-
id: newVariableDataId,
|
|
401
|
-
Route: {
|
|
402
|
-
label: "Route",
|
|
403
|
-
element: "single-select",
|
|
404
|
-
type: "text"
|
|
405
|
-
},
|
|
406
|
-
Dose: {
|
|
407
|
-
label: "Dose",
|
|
408
|
-
element: "single-select",
|
|
409
|
-
type: "text"
|
|
410
|
-
},
|
|
411
|
-
Frequency: {
|
|
412
|
-
label: "Frequency",
|
|
413
|
-
element: "single-select",
|
|
414
|
-
type: "text"
|
|
415
|
-
},
|
|
416
|
-
When: {
|
|
417
|
-
label: "When",
|
|
418
|
-
element: "textarea",
|
|
419
|
-
type: "text"
|
|
420
|
-
},
|
|
421
|
-
Duration: {
|
|
422
|
-
label: "Duration",
|
|
423
|
-
element: "textarea",
|
|
424
|
-
type: "text"
|
|
425
|
-
},
|
|
426
|
-
Instructions: {
|
|
427
|
-
label: "Instructions",
|
|
428
|
-
element: "textarea",
|
|
429
|
-
type: "text"
|
|
430
|
-
},
|
|
431
|
-
icons: { delete: "delete", plus: "plus" }
|
|
432
|
-
};
|
|
433
|
-
const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
|
|
434
|
-
...item,
|
|
435
|
-
icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
|
|
436
|
-
}));
|
|
437
|
-
return {
|
|
438
|
-
...row,
|
|
439
|
-
variable_data: updatedVariableData
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
return row;
|
|
443
|
-
}));
|
|
444
|
-
};
|
|
445
391
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
446
392
|
title: eachHeadEl.label,
|
|
447
393
|
dataIndex: eachHeadEl.name,
|
|
@@ -454,7 +400,7 @@ var AddMoreTable = (props) => {
|
|
|
454
400
|
} else if (type === "textarea") {
|
|
455
401
|
return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
456
402
|
} else {
|
|
457
|
-
return null;
|
|
403
|
+
return /* @__PURE__ */ import_react13.default.createElement("p", null, "Hi");
|
|
458
404
|
}
|
|
459
405
|
};
|
|
460
406
|
const dataSource = rows.map((eachRow, index) => {
|
|
@@ -463,23 +409,11 @@ var AddMoreTable = (props) => {
|
|
|
463
409
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
464
410
|
}
|
|
465
411
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
466
|
-
eachRow.variable_data.forEach((variable
|
|
412
|
+
eachRow.variable_data.forEach((variable) => {
|
|
467
413
|
Object.entries(variable).forEach(([key, value]) => {
|
|
468
414
|
if (value && value.element && value.label) {
|
|
469
415
|
rowElements[value.label] = renderInputElement(value);
|
|
470
416
|
}
|
|
471
|
-
if (key === "icons") {
|
|
472
|
-
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => {
|
|
473
|
-
const updatedRows = rows.map((row) => {
|
|
474
|
-
if (row.id === eachRow.id) {
|
|
475
|
-
const updatedVariableData = row.variable_data.filter((item) => item.id !== variable.id);
|
|
476
|
-
return { ...row, variable_data: updatedVariableData };
|
|
477
|
-
}
|
|
478
|
-
return row;
|
|
479
|
-
});
|
|
480
|
-
setRows(updatedRows);
|
|
481
|
-
} }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), value && value.plus && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
|
|
482
|
-
}
|
|
483
417
|
});
|
|
484
418
|
});
|
|
485
419
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -331,11 +331,7 @@ var AddMoreTable = (props) => {
|
|
|
331
331
|
const newId = lastRow ? lastRow.id + 1 : 1;
|
|
332
332
|
let newRow = {
|
|
333
333
|
...lastRow,
|
|
334
|
-
id: newId
|
|
335
|
-
variable_data: lastRow ? lastRow.variable_data.map((item) => ({
|
|
336
|
-
...item,
|
|
337
|
-
id: item.id + 1
|
|
338
|
-
})) : []
|
|
334
|
+
id: newId
|
|
339
335
|
};
|
|
340
336
|
setRows((prevData) => [...prevData, newRow]);
|
|
341
337
|
};
|
|
@@ -345,56 +341,6 @@ var AddMoreTable = (props) => {
|
|
|
345
341
|
setRows(remainingRows);
|
|
346
342
|
}
|
|
347
343
|
};
|
|
348
|
-
const onHandleVariableData = (rowId) => {
|
|
349
|
-
setRows((prevRows) => prevRows.map((row) => {
|
|
350
|
-
if (row.id === rowId) {
|
|
351
|
-
const newVariableDataId = row.variable_data.length > 0 ? row.variable_data[row.variable_data.length - 1].id + 1 : 1;
|
|
352
|
-
const newVariableData = {
|
|
353
|
-
id: newVariableDataId,
|
|
354
|
-
Route: {
|
|
355
|
-
label: "Route",
|
|
356
|
-
element: "single-select",
|
|
357
|
-
type: "text"
|
|
358
|
-
},
|
|
359
|
-
Dose: {
|
|
360
|
-
label: "Dose",
|
|
361
|
-
element: "single-select",
|
|
362
|
-
type: "text"
|
|
363
|
-
},
|
|
364
|
-
Frequency: {
|
|
365
|
-
label: "Frequency",
|
|
366
|
-
element: "single-select",
|
|
367
|
-
type: "text"
|
|
368
|
-
},
|
|
369
|
-
When: {
|
|
370
|
-
label: "When",
|
|
371
|
-
element: "textarea",
|
|
372
|
-
type: "text"
|
|
373
|
-
},
|
|
374
|
-
Duration: {
|
|
375
|
-
label: "Duration",
|
|
376
|
-
element: "textarea",
|
|
377
|
-
type: "text"
|
|
378
|
-
},
|
|
379
|
-
Instructions: {
|
|
380
|
-
label: "Instructions",
|
|
381
|
-
element: "textarea",
|
|
382
|
-
type: "text"
|
|
383
|
-
},
|
|
384
|
-
icons: { delete: "delete", plus: "plus" }
|
|
385
|
-
};
|
|
386
|
-
const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
|
|
387
|
-
...item,
|
|
388
|
-
icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
|
|
389
|
-
}));
|
|
390
|
-
return {
|
|
391
|
-
...row,
|
|
392
|
-
variable_data: updatedVariableData
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
return row;
|
|
396
|
-
}));
|
|
397
|
-
};
|
|
398
344
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
399
345
|
title: eachHeadEl.label,
|
|
400
346
|
dataIndex: eachHeadEl.name,
|
|
@@ -407,7 +353,7 @@ var AddMoreTable = (props) => {
|
|
|
407
353
|
} else if (type === "textarea") {
|
|
408
354
|
return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value) => onHandleChange(label, value) });
|
|
409
355
|
} else {
|
|
410
|
-
return null;
|
|
356
|
+
return /* @__PURE__ */ React12.createElement("p", null, "Hi");
|
|
411
357
|
}
|
|
412
358
|
};
|
|
413
359
|
const dataSource = rows.map((eachRow, index) => {
|
|
@@ -416,23 +362,11 @@ var AddMoreTable = (props) => {
|
|
|
416
362
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
417
363
|
}
|
|
418
364
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
419
|
-
eachRow.variable_data.forEach((variable
|
|
365
|
+
eachRow.variable_data.forEach((variable) => {
|
|
420
366
|
Object.entries(variable).forEach(([key, value]) => {
|
|
421
367
|
if (value && value.element && value.label) {
|
|
422
368
|
rowElements[value.label] = renderInputElement(value);
|
|
423
369
|
}
|
|
424
|
-
if (key === "icons") {
|
|
425
|
-
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => {
|
|
426
|
-
const updatedRows = rows.map((row) => {
|
|
427
|
-
if (row.id === eachRow.id) {
|
|
428
|
-
const updatedVariableData = row.variable_data.filter((item) => item.id !== variable.id);
|
|
429
|
-
return { ...row, variable_data: updatedVariableData };
|
|
430
|
-
}
|
|
431
|
-
return row;
|
|
432
|
-
});
|
|
433
|
-
setRows(updatedRows);
|
|
434
|
-
} }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), value && value.plus && /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
435
|
-
}
|
|
436
370
|
});
|
|
437
371
|
});
|
|
438
372
|
}
|