@apexcura/ui-components 0.0.11-Beta30 → 0.0.11-Beta32
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 -5
- package/dist/index.mjs +3 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -393,7 +393,7 @@ var AddMoreTable = (props) => {
|
|
|
393
393
|
dataIndex: eachHeadEl.name,
|
|
394
394
|
key: eachHeadEl.id
|
|
395
395
|
})) : [];
|
|
396
|
-
const renderInputElement = (element) => {
|
|
396
|
+
const renderInputElement = (element, id) => {
|
|
397
397
|
const { element: type, label } = element;
|
|
398
398
|
if (type === "single-select") {
|
|
399
399
|
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
@@ -409,15 +409,13 @@ var AddMoreTable = (props) => {
|
|
|
409
409
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
410
410
|
}
|
|
411
411
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
412
|
-
eachRow.variable_data.forEach((variable) => {
|
|
412
|
+
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
413
413
|
Object.entries(variable).forEach(([key, value]) => {
|
|
414
414
|
if (value && value.element && value.label) {
|
|
415
|
-
rowElements[value.label] = renderInputElement(value);
|
|
415
|
+
rowElements[value.label] = /* @__PURE__ */ import_react13.default.createElement("div", { style: { display: "flex", alignItems: "center" } }, renderInputElement(value, eachRow.id), /* @__PURE__ */ import_react13.default.createElement("div", null, /* @__PURE__ */ import_react13.default.createElement("button", { style: { marginLeft: 8 } }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { style: { marginLeft: 8 } }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null))));
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
418
|
});
|
|
419
|
-
console.log("rowElements/////", rowElements);
|
|
420
|
-
rowElements[""] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement("button", null, "delete"), eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", null, "Add"));
|
|
421
419
|
}
|
|
422
420
|
return {
|
|
423
421
|
key: index.toString(),
|
package/dist/index.mjs
CHANGED
|
@@ -346,7 +346,7 @@ var AddMoreTable = (props) => {
|
|
|
346
346
|
dataIndex: eachHeadEl.name,
|
|
347
347
|
key: eachHeadEl.id
|
|
348
348
|
})) : [];
|
|
349
|
-
const renderInputElement = (element) => {
|
|
349
|
+
const renderInputElement = (element, id) => {
|
|
350
350
|
const { element: type, label } = element;
|
|
351
351
|
if (type === "single-select") {
|
|
352
352
|
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
@@ -362,15 +362,13 @@ var AddMoreTable = (props) => {
|
|
|
362
362
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
363
363
|
}
|
|
364
364
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
365
|
-
eachRow.variable_data.forEach((variable) => {
|
|
365
|
+
eachRow.variable_data.forEach((variable, subIndex) => {
|
|
366
366
|
Object.entries(variable).forEach(([key, value]) => {
|
|
367
367
|
if (value && value.element && value.label) {
|
|
368
|
-
rowElements[value.label] = renderInputElement(value);
|
|
368
|
+
rowElements[value.label] = /* @__PURE__ */ React12.createElement("div", { style: { display: "flex", alignItems: "center" } }, renderInputElement(value, eachRow.id), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("button", { style: { marginLeft: 8 } }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement("button", { style: { marginLeft: 8 } }, /* @__PURE__ */ React12.createElement(PlusOutlined, null))));
|
|
369
369
|
}
|
|
370
370
|
});
|
|
371
371
|
});
|
|
372
|
-
console.log("rowElements/////", rowElements);
|
|
373
|
-
rowElements[""] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement("button", null, "delete"), eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement("button", null, "Add"));
|
|
374
372
|
}
|
|
375
373
|
return {
|
|
376
374
|
key: index.toString(),
|