@apexcura/ui-components 0.0.11-Beta88 → 0.0.11-Beta90

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
@@ -366,8 +366,7 @@ var AddMoreTable = (props) => {
366
366
  const { thead, tbody } = props;
367
367
  const [rows, setRows] = (0, import_react13.useState)(tbody || []);
368
368
  const onHandleRows = () => {
369
- const lastRow = rows[rows.length - 1];
370
- const newId = lastRow ? lastRow.id + 1 : 1;
369
+ const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
371
370
  let newRow = {
372
371
  id: newId,
373
372
  variable_data: [
@@ -429,29 +428,31 @@ var AddMoreTable = (props) => {
429
428
  (0, import_react13.useEffect)(() => {
430
429
  console.log(rows);
431
430
  }, [rows]);
432
- const renderInputElement = (element) => {
431
+ const renderInputElement = (element, value) => {
433
432
  const { element: type, label } = element;
434
433
  if (type === "single-select") {
435
- let onHandleChange2 = function(label2, value) {
434
+ let onHandleChange2 = function(label2, value2) {
436
435
  throw new Error("Function not implemented.");
437
436
  };
438
437
  var onHandleChange = onHandleChange2;
439
- return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange2(label, value) });
438
+ return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value2) => onHandleChange2(label, value2) });
440
439
  } else if (type === "textarea") {
441
- let onHandleChange2 = function(label2, value) {
440
+ let onHandleChange2 = function(label2, value2) {
442
441
  throw new Error("Function not implemented.");
443
442
  };
444
443
  var onHandleChange = onHandleChange2;
445
- return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value) => onHandleChange2(label, value) });
444
+ return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value2) => onHandleChange2(label, value2) });
446
445
  } else {
447
446
  return null;
448
447
  }
449
448
  };
450
449
  const dataSource = rows.map((eachRow, index) => {
450
+ console.log(...eachRow);
451
451
  const rowData = {
452
452
  key: eachRow.id,
453
453
  "#": index + 1,
454
454
  ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
455
+ console.log("variable", variable);
455
456
  Object.keys(variable).forEach((key) => {
456
457
  if (key === "SubRows") {
457
458
  acc[`${key}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(index, subIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsAdd(index) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
package/dist/index.mjs CHANGED
@@ -319,8 +319,7 @@ var AddMoreTable = (props) => {
319
319
  const { thead, tbody } = props;
320
320
  const [rows, setRows] = useState3(tbody || []);
321
321
  const onHandleRows = () => {
322
- const lastRow = rows[rows.length - 1];
323
- const newId = lastRow ? lastRow.id + 1 : 1;
322
+ const newId = rows.length > 0 ? rows[rows.length - 1].id + 1 : 1;
324
323
  let newRow = {
325
324
  id: newId,
326
325
  variable_data: [
@@ -382,29 +381,31 @@ var AddMoreTable = (props) => {
382
381
  useEffect(() => {
383
382
  console.log(rows);
384
383
  }, [rows]);
385
- const renderInputElement = (element) => {
384
+ const renderInputElement = (element, value) => {
386
385
  const { element: type, label } = element;
387
386
  if (type === "single-select") {
388
- let onHandleChange2 = function(label2, value) {
387
+ let onHandleChange2 = function(label2, value2) {
389
388
  throw new Error("Function not implemented.");
390
389
  };
391
390
  var onHandleChange = onHandleChange2;
392
- return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange2(label, value) });
391
+ return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => onHandleChange2(label, value2) });
393
392
  } else if (type === "textarea") {
394
- let onHandleChange2 = function(label2, value) {
393
+ let onHandleChange2 = function(label2, value2) {
395
394
  throw new Error("Function not implemented.");
396
395
  };
397
396
  var onHandleChange = onHandleChange2;
398
- return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value) => onHandleChange2(label, value) });
397
+ return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => onHandleChange2(label, value2) });
399
398
  } else {
400
399
  return null;
401
400
  }
402
401
  };
403
402
  const dataSource = rows.map((eachRow, index) => {
403
+ console.log(...eachRow);
404
404
  const rowData = {
405
405
  key: eachRow.id,
406
406
  "#": index + 1,
407
407
  ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
408
+ console.log("variable", variable);
408
409
  Object.keys(variable).forEach((key) => {
409
410
  if (key === "SubRows") {
410
411
  acc[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(index, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(index) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta88",
3
+ "version": "0.0.11-Beta90",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",