@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 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, id) => {
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, subIndex) => {
414
+ eachRow.variable_data.forEach((variable) => {
413
415
  Object.entries(variable).forEach(([key, value]) => {
414
- if (value && value.element && value.label) {
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
+ 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, id) => {
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, subIndex) => {
367
+ eachRow.variable_data.forEach((variable) => {
366
368
  Object.entries(variable).forEach(([key, value]) => {
367
- if (value && value.element && value.label) {
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
+ 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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta32",
3
+ "version": "0.0.11-Beta34",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",