@apexcura/ui-components 0.0.12-Beta20 → 0.0.12-Beta22
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 +7 -13
- package/dist/index.mjs +7 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -385,13 +385,9 @@ var AddMoreTable = (props) => {
|
|
|
385
385
|
const { icons, ...rest } = item;
|
|
386
386
|
return {
|
|
387
387
|
...rest,
|
|
388
|
-
icons: {
|
|
388
|
+
icons: { delete: "", plus: index === newRow.variable_data.length - 1 ? "" : void 0 }
|
|
389
389
|
};
|
|
390
390
|
});
|
|
391
|
-
updatedVariableData[updatedVariableData.length - 1] = {
|
|
392
|
-
...updatedVariableData[updatedVariableData.length - 1],
|
|
393
|
-
icons: { ...updatedVariableData[updatedVariableData.length - 1].icons, plus: /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null) }
|
|
394
|
-
};
|
|
395
391
|
newRow.variable_data = updatedVariableData;
|
|
396
392
|
}
|
|
397
393
|
setRows((prevData) => [...prevData, newRow]);
|
|
@@ -438,14 +434,12 @@ var AddMoreTable = (props) => {
|
|
|
438
434
|
element: "textarea",
|
|
439
435
|
type: "text"
|
|
440
436
|
},
|
|
441
|
-
icons: { delete:
|
|
437
|
+
icons: { delete: "delete", plus: "plus" }
|
|
442
438
|
};
|
|
443
|
-
const updatedVariableData = [...row.variable_data, newVariableData]
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}
|
|
448
|
-
});
|
|
439
|
+
const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
|
|
440
|
+
...item,
|
|
441
|
+
icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
|
|
442
|
+
}));
|
|
449
443
|
return {
|
|
450
444
|
...row,
|
|
451
445
|
variable_data: updatedVariableData
|
|
@@ -481,7 +475,7 @@ var AddMoreTable = (props) => {
|
|
|
481
475
|
rowElements[value.label] = renderInputElement(value);
|
|
482
476
|
}
|
|
483
477
|
if (key === "icons") {
|
|
484
|
-
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) },
|
|
478
|
+
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, "delete"), varIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, "plus"));
|
|
485
479
|
}
|
|
486
480
|
});
|
|
487
481
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -338,13 +338,9 @@ var AddMoreTable = (props) => {
|
|
|
338
338
|
const { icons, ...rest } = item;
|
|
339
339
|
return {
|
|
340
340
|
...rest,
|
|
341
|
-
icons: {
|
|
341
|
+
icons: { delete: "", plus: index === newRow.variable_data.length - 1 ? "" : void 0 }
|
|
342
342
|
};
|
|
343
343
|
});
|
|
344
|
-
updatedVariableData[updatedVariableData.length - 1] = {
|
|
345
|
-
...updatedVariableData[updatedVariableData.length - 1],
|
|
346
|
-
icons: { ...updatedVariableData[updatedVariableData.length - 1].icons, plus: /* @__PURE__ */ React12.createElement(PlusOutlined, null) }
|
|
347
|
-
};
|
|
348
344
|
newRow.variable_data = updatedVariableData;
|
|
349
345
|
}
|
|
350
346
|
setRows((prevData) => [...prevData, newRow]);
|
|
@@ -391,14 +387,12 @@ var AddMoreTable = (props) => {
|
|
|
391
387
|
element: "textarea",
|
|
392
388
|
type: "text"
|
|
393
389
|
},
|
|
394
|
-
icons: { delete:
|
|
390
|
+
icons: { delete: "delete", plus: "plus" }
|
|
395
391
|
};
|
|
396
|
-
const updatedVariableData = [...row.variable_data, newVariableData]
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
});
|
|
392
|
+
const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
|
|
393
|
+
...item,
|
|
394
|
+
icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
|
|
395
|
+
}));
|
|
402
396
|
return {
|
|
403
397
|
...row,
|
|
404
398
|
variable_data: updatedVariableData
|
|
@@ -434,7 +428,7 @@ var AddMoreTable = (props) => {
|
|
|
434
428
|
rowElements[value.label] = renderInputElement(value);
|
|
435
429
|
}
|
|
436
430
|
if (key === "icons") {
|
|
437
|
-
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) },
|
|
431
|
+
rowElements[`icons_${varIndex}`] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, "delete"), varIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, "plus"));
|
|
438
432
|
}
|
|
439
433
|
});
|
|
440
434
|
});
|