@apexcura/ui-components 0.0.11-Beta8 → 0.0.12-Beta1

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.d.mts CHANGED
@@ -22,6 +22,7 @@ type ElementType = {
22
22
  id?: number;
23
23
  thead?: any[];
24
24
  tbody?: any[];
25
+ variable_data?: any[];
25
26
  };
26
27
 
27
28
  interface ElementExecuterProps$3 extends ElementType {
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ type ElementType = {
22
22
  id?: number;
23
23
  thead?: any[];
24
24
  tbody?: any[];
25
+ variable_data?: any[];
25
26
  };
26
27
 
27
28
  interface ElementExecuterProps$3 extends ElementType {
package/dist/index.js CHANGED
@@ -374,7 +374,8 @@ var AddMoreTable = (props) => {
374
374
  key: eachHeadEl.id
375
375
  })) : [];
376
376
  const renderInputElement = (element) => {
377
- const { type, label } = element;
377
+ const { element: type, label } = element;
378
+ console.log("type....", type);
378
379
  if (type === "single-select") {
379
380
  return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
380
381
  } else if (type === "textarea") {
@@ -384,13 +385,22 @@ var AddMoreTable = (props) => {
384
385
  }
385
386
  };
386
387
  const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
387
- const variableData = eachRow.variable_data.reduce((acc, curr) => {
388
+ const rowElements = {};
389
+ if (eachRow.element && eachRow.label) {
390
+ rowElements[eachRow.label] = renderInputElement(eachRow);
391
+ }
392
+ const variableData = eachRow.variable_data && Array.isArray(eachRow.variable_data) ? eachRow.variable_data.reduce((acc, curr) => {
393
+ if (!curr.label || !curr.element) {
394
+ console.error(`Invalid element in row ${index}:`, curr);
395
+ return acc;
396
+ }
388
397
  acc[curr.label] = renderInputElement(curr);
389
398
  return acc;
390
- }, {});
399
+ }, {}) : {};
391
400
  return {
392
401
  key: index.toString(),
393
402
  ...eachRow,
403
+ ...rowElements,
394
404
  ...variableData
395
405
  };
396
406
  }) : [];
package/dist/index.mjs CHANGED
@@ -327,7 +327,8 @@ var AddMoreTable = (props) => {
327
327
  key: eachHeadEl.id
328
328
  })) : [];
329
329
  const renderInputElement = (element) => {
330
- const { type, label } = element;
330
+ const { element: type, label } = element;
331
+ console.log("type....", type);
331
332
  if (type === "single-select") {
332
333
  return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange(label, value) });
333
334
  } else if (type === "textarea") {
@@ -337,13 +338,22 @@ var AddMoreTable = (props) => {
337
338
  }
338
339
  };
339
340
  const dataSource = tbody && tbody.length > 0 ? tbody.map((eachRow, index) => {
340
- const variableData = eachRow.variable_data.reduce((acc, curr) => {
341
+ const rowElements = {};
342
+ if (eachRow.element && eachRow.label) {
343
+ rowElements[eachRow.label] = renderInputElement(eachRow);
344
+ }
345
+ const variableData = eachRow.variable_data && Array.isArray(eachRow.variable_data) ? eachRow.variable_data.reduce((acc, curr) => {
346
+ if (!curr.label || !curr.element) {
347
+ console.error(`Invalid element in row ${index}:`, curr);
348
+ return acc;
349
+ }
341
350
  acc[curr.label] = renderInputElement(curr);
342
351
  return acc;
343
- }, {});
352
+ }, {}) : {};
344
353
  return {
345
354
  key: index.toString(),
346
355
  ...eachRow,
356
+ ...rowElements,
347
357
  ...variableData
348
358
  };
349
359
  }) : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta8",
3
+ "version": "0.0.12-Beta1",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",