@apexcura/ui-components 0.0.11-Beta89 → 0.0.11-Beta90
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 +2 -4
- package/dist/index.mjs +2 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -366,8 +366,7 @@ var AddMoreTable = (props) => {
|
|
|
366
366
|
const { thead, tbody } = props;
|
|
367
367
|
const [rows, setRows] = (0, import_react13.useState)(tbody || []);
|
|
368
368
|
const onHandleRows = () => {
|
|
369
|
-
const
|
|
370
|
-
const newId = lastRow ? lastRow.id + 1 : 1;
|
|
369
|
+
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
371
370
|
let newRow = {
|
|
372
371
|
id: newId,
|
|
373
372
|
variable_data: [
|
|
@@ -448,11 +447,10 @@ var AddMoreTable = (props) => {
|
|
|
448
447
|
}
|
|
449
448
|
};
|
|
450
449
|
const dataSource = rows.map((eachRow, index) => {
|
|
451
|
-
console.log(...eachRow
|
|
450
|
+
console.log(...eachRow);
|
|
452
451
|
const rowData = {
|
|
453
452
|
key: eachRow.id,
|
|
454
453
|
"#": index + 1,
|
|
455
|
-
"Medicine": renderInputElement(eachRow.element, eachRow.value),
|
|
456
454
|
...eachRow.variable_data.reduce((acc, variable, subIndex) => {
|
|
457
455
|
console.log("variable", variable);
|
|
458
456
|
Object.keys(variable).forEach((key) => {
|
package/dist/index.mjs
CHANGED
|
@@ -319,8 +319,7 @@ var AddMoreTable = (props) => {
|
|
|
319
319
|
const { thead, tbody } = props;
|
|
320
320
|
const [rows, setRows] = useState3(tbody || []);
|
|
321
321
|
const onHandleRows = () => {
|
|
322
|
-
const
|
|
323
|
-
const newId = lastRow ? lastRow.id + 1 : 1;
|
|
322
|
+
const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
|
|
324
323
|
let newRow = {
|
|
325
324
|
id: newId,
|
|
326
325
|
variable_data: [
|
|
@@ -401,11 +400,10 @@ var AddMoreTable = (props) => {
|
|
|
401
400
|
}
|
|
402
401
|
};
|
|
403
402
|
const dataSource = rows.map((eachRow, index) => {
|
|
404
|
-
console.log(...eachRow
|
|
403
|
+
console.log(...eachRow);
|
|
405
404
|
const rowData = {
|
|
406
405
|
key: eachRow.id,
|
|
407
406
|
"#": index + 1,
|
|
408
|
-
"Medicine": renderInputElement(eachRow.element, eachRow.value),
|
|
409
407
|
...eachRow.variable_data.reduce((acc, variable, subIndex) => {
|
|
410
408
|
console.log("variable", variable);
|
|
411
409
|
Object.keys(variable).forEach((key) => {
|