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

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
@@ -429,29 +429,32 @@ var AddMoreTable = (props) => {
429
429
  (0, import_react13.useEffect)(() => {
430
430
  console.log(rows);
431
431
  }, [rows]);
432
- const renderInputElement = (element) => {
432
+ const renderInputElement = (element, value) => {
433
433
  const { element: type, label } = element;
434
434
  if (type === "single-select") {
435
- let onHandleChange2 = function(label2, value) {
435
+ let onHandleChange2 = function(label2, value2) {
436
436
  throw new Error("Function not implemented.");
437
437
  };
438
438
  var onHandleChange = onHandleChange2;
439
- return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value) => onHandleChange2(label, value) });
439
+ return /* @__PURE__ */ import_react13.default.createElement(SingleSelectElement, { onChange: (value2) => onHandleChange2(label, value2) });
440
440
  } else if (type === "textarea") {
441
- let onHandleChange2 = function(label2, value) {
441
+ let onHandleChange2 = function(label2, value2) {
442
442
  throw new Error("Function not implemented.");
443
443
  };
444
444
  var onHandleChange = onHandleChange2;
445
- return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value) => onHandleChange2(label, value) });
445
+ return /* @__PURE__ */ import_react13.default.createElement(TextareaElement, { onChange: (value2) => onHandleChange2(label, value2) });
446
446
  } else {
447
447
  return null;
448
448
  }
449
449
  };
450
450
  const dataSource = rows.map((eachRow, index) => {
451
+ console.log(...eachRow.variable_data);
451
452
  const rowData = {
452
453
  key: eachRow.id,
453
454
  "#": index + 1,
455
+ "Medicine": renderInputElement(eachRow.element, eachRow.value),
454
456
  ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
457
+ console.log("variable", variable);
455
458
  Object.keys(variable).forEach((key) => {
456
459
  if (key === "SubRows") {
457
460
  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
@@ -382,29 +382,32 @@ var AddMoreTable = (props) => {
382
382
  useEffect(() => {
383
383
  console.log(rows);
384
384
  }, [rows]);
385
- const renderInputElement = (element) => {
385
+ const renderInputElement = (element, value) => {
386
386
  const { element: type, label } = element;
387
387
  if (type === "single-select") {
388
- let onHandleChange2 = function(label2, value) {
388
+ let onHandleChange2 = function(label2, value2) {
389
389
  throw new Error("Function not implemented.");
390
390
  };
391
391
  var onHandleChange = onHandleChange2;
392
- return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value) => onHandleChange2(label, value) });
392
+ return /* @__PURE__ */ React12.createElement(SingleSelectElement, { onChange: (value2) => onHandleChange2(label, value2) });
393
393
  } else if (type === "textarea") {
394
- let onHandleChange2 = function(label2, value) {
394
+ let onHandleChange2 = function(label2, value2) {
395
395
  throw new Error("Function not implemented.");
396
396
  };
397
397
  var onHandleChange = onHandleChange2;
398
- return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value) => onHandleChange2(label, value) });
398
+ return /* @__PURE__ */ React12.createElement(TextareaElement, { onChange: (value2) => onHandleChange2(label, value2) });
399
399
  } else {
400
400
  return null;
401
401
  }
402
402
  };
403
403
  const dataSource = rows.map((eachRow, index) => {
404
+ console.log(...eachRow.variable_data);
404
405
  const rowData = {
405
406
  key: eachRow.id,
406
407
  "#": index + 1,
408
+ "Medicine": renderInputElement(eachRow.element, eachRow.value),
407
409
  ...eachRow.variable_data.reduce((acc, variable, subIndex) => {
410
+ console.log("variable", variable);
408
411
  Object.keys(variable).forEach((key) => {
409
412
  if (key === "SubRows") {
410
413
  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-Beta89",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",