@apexcura/ui-components 0.0.11-Beta32 → 0.0.11-Beta34
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 +8 -4
- package/dist/index.mjs +8 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -388,12 +388,14 @@ var AddMoreTable = (props) => {
|
|
|
388
388
|
setRows(remainingRows);
|
|
389
389
|
}
|
|
390
390
|
};
|
|
391
|
+
const onHandleSubRowsAdd = () => {
|
|
392
|
+
};
|
|
391
393
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
392
394
|
title: eachHeadEl.label,
|
|
393
395
|
dataIndex: eachHeadEl.name,
|
|
394
396
|
key: eachHeadEl.id
|
|
395
397
|
})) : [];
|
|
396
|
-
const renderInputElement = (element
|
|
398
|
+
const renderInputElement = (element) => {
|
|
397
399
|
const { element: type, label } = element;
|
|
398
400
|
if (type === "single-select") {
|
|
399
401
|
return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
@@ -409,10 +411,12 @@ var AddMoreTable = (props) => {
|
|
|
409
411
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
410
412
|
}
|
|
411
413
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
412
|
-
eachRow.variable_data.forEach((variable
|
|
414
|
+
eachRow.variable_data.forEach((variable) => {
|
|
413
415
|
Object.entries(variable).forEach(([key, value]) => {
|
|
414
|
-
if (
|
|
415
|
-
rowElements[
|
|
416
|
+
if (key === "icons" && value) {
|
|
417
|
+
rowElements["sub rows"] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement("button", null, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: onHandleSubRowsAdd }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
|
|
418
|
+
} else if (value && value.element && value.label) {
|
|
419
|
+
rowElements[value.label] = renderInputElement(value);
|
|
416
420
|
}
|
|
417
421
|
});
|
|
418
422
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -341,12 +341,14 @@ var AddMoreTable = (props) => {
|
|
|
341
341
|
setRows(remainingRows);
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
|
+
const onHandleSubRowsAdd = () => {
|
|
345
|
+
};
|
|
344
346
|
const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
|
|
345
347
|
title: eachHeadEl.label,
|
|
346
348
|
dataIndex: eachHeadEl.name,
|
|
347
349
|
key: eachHeadEl.id
|
|
348
350
|
})) : [];
|
|
349
|
-
const renderInputElement = (element
|
|
351
|
+
const renderInputElement = (element) => {
|
|
350
352
|
const { element: type, label } = element;
|
|
351
353
|
if (type === "single-select") {
|
|
352
354
|
return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
|
|
@@ -362,10 +364,12 @@ var AddMoreTable = (props) => {
|
|
|
362
364
|
rowElements[eachRow.label] = renderInputElement(eachRow);
|
|
363
365
|
}
|
|
364
366
|
if (eachRow.variable_data && Array.isArray(eachRow.variable_data)) {
|
|
365
|
-
eachRow.variable_data.forEach((variable
|
|
367
|
+
eachRow.variable_data.forEach((variable) => {
|
|
366
368
|
Object.entries(variable).forEach(([key, value]) => {
|
|
367
|
-
if (
|
|
368
|
-
rowElements[
|
|
369
|
+
if (key === "icons" && value) {
|
|
370
|
+
rowElements["sub rows"] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement("button", null, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: onHandleSubRowsAdd }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
|
|
371
|
+
} else if (value && value.element && value.label) {
|
|
372
|
+
rowElements[value.label] = renderInputElement(value);
|
|
369
373
|
}
|
|
370
374
|
});
|
|
371
375
|
});
|