@apexcura/ui-components 0.0.12-Beta42 → 0.0.12-Beta44

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
@@ -103,7 +103,7 @@ var NumberElement = (props) => {
103
103
  const newValue = e.target.value.replace(/[^0-9]/g, "");
104
104
  props.onChange(newValue);
105
105
  };
106
- return /* @__PURE__ */ import_react3.default.createElement("span", { className: props.className }, /* @__PURE__ */ import_react3.default.createElement(
106
+ return /* @__PURE__ */ import_react3.default.createElement(
107
107
  import_antd3.Input,
108
108
  {
109
109
  placeholder: props.placeholder,
@@ -115,11 +115,12 @@ var NumberElement = (props) => {
115
115
  prefix: props.prefix,
116
116
  type: props.type,
117
117
  status: props.status,
118
+ className: props.className,
118
119
  variant: props.variant,
119
120
  name: props.name,
120
121
  onChange: handleInputChange
121
122
  }
122
- ));
123
+ );
123
124
  };
124
125
 
125
126
  // src/Components/TextareaElement.tsx
@@ -476,21 +477,20 @@ var AddMoreTable = (props) => {
476
477
  }
477
478
  };
478
479
  const dataSource = rows.map((eachRow, rowIndex) => {
479
- const rowData = {
480
+ let rowData = {
480
481
  key: eachRow.id,
481
482
  "#": rowIndex + 1,
482
- "Medicine": renderInputElement({
483
+ Medicine: renderInputElement({
483
484
  element: eachRow.element,
484
485
  label: eachRow.label
485
486
  })
486
487
  };
487
- rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
488
- eachRow.variable_data.map((variable, subIndex) => {
489
- Object.keys(variable).forEach((key) => {
488
+ eachRow.variable_data.forEach((subRow, subRowIndex) => {
489
+ Object.entries(subRow).forEach(([key, value]) => {
490
490
  if (key === "SubRows") {
491
- rowData[`${key}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, 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(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
491
+ rowData[`${key}${subRowIndex}`] = /* @__PURE__ */ import_react13.default.createElement("div", { key: subRowIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsDelete(rowIndex, subRowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), subRowIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement(import_antd11.Button, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)));
492
492
  } else {
493
- rowData[`${key}`] = renderInputElement(variable[key]);
493
+ rowData[`${key}${subRowIndex}`] = renderInputElement(value);
494
494
  }
495
495
  });
496
496
  });
package/dist/index.mjs CHANGED
@@ -56,7 +56,7 @@ var NumberElement = (props) => {
56
56
  const newValue = e.target.value.replace(/[^0-9]/g, "");
57
57
  props.onChange(newValue);
58
58
  };
59
- return /* @__PURE__ */ React3.createElement("span", { className: props.className }, /* @__PURE__ */ React3.createElement(
59
+ return /* @__PURE__ */ React3.createElement(
60
60
  AntInput2,
61
61
  {
62
62
  placeholder: props.placeholder,
@@ -68,11 +68,12 @@ var NumberElement = (props) => {
68
68
  prefix: props.prefix,
69
69
  type: props.type,
70
70
  status: props.status,
71
+ className: props.className,
71
72
  variant: props.variant,
72
73
  name: props.name,
73
74
  onChange: handleInputChange
74
75
  }
75
- ));
76
+ );
76
77
  };
77
78
 
78
79
  // src/Components/TextareaElement.tsx
@@ -429,21 +430,20 @@ var AddMoreTable = (props) => {
429
430
  }
430
431
  };
431
432
  const dataSource = rows.map((eachRow, rowIndex) => {
432
- const rowData = {
433
+ let rowData = {
433
434
  key: eachRow.id,
434
435
  "#": rowIndex + 1,
435
- "Medicine": renderInputElement({
436
+ Medicine: renderInputElement({
436
437
  element: eachRow.element,
437
438
  label: eachRow.label
438
439
  })
439
440
  };
440
- rowData["Medicine"] = renderInputElement(eachRow.variable_data[0].Medicine);
441
- eachRow.variable_data.map((variable, subIndex) => {
442
- Object.keys(variable).forEach((key) => {
441
+ eachRow.variable_data.forEach((subRow, subRowIndex) => {
442
+ Object.entries(subRow).forEach(([key, value]) => {
443
443
  if (key === "SubRows") {
444
- rowData[`${key}`] = /* @__PURE__ */ React12.createElement("div", { key: subIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(rowIndex, subIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
444
+ rowData[`${key}${subRowIndex}`] = /* @__PURE__ */ React12.createElement("div", { key: subRowIndex }, eachRow.variable_data.length > 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsDelete(rowIndex, subRowIndex) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), subRowIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement(Button3, { onClick: () => onHandleSubRowsAdd(rowIndex) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)));
445
445
  } else {
446
- rowData[`${key}`] = renderInputElement(variable[key]);
446
+ rowData[`${key}${subRowIndex}`] = renderInputElement(value);
447
447
  }
448
448
  });
449
449
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.12-Beta42",
3
+ "version": "0.0.12-Beta44",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",