@apexcura/ui-components 0.0.11-Beta25 → 0.0.11-Beta27

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
@@ -391,6 +391,7 @@ var AddMoreTable = (props) => {
391
391
  newRow.variable_data = updatedVariableData;
392
392
  }
393
393
  setRows((prevData) => [...prevData, newRow]);
394
+ console.log("rows----------", rows);
394
395
  };
395
396
  const onHandleDelete = (index) => {
396
397
  if (rows.length > 1) {
@@ -398,56 +399,6 @@ var AddMoreTable = (props) => {
398
399
  setRows(remainingRows);
399
400
  }
400
401
  };
401
- const onHandleVariableData = (rowId) => {
402
- setRows((prevRows) => prevRows.map((row) => {
403
- if (row.id === rowId) {
404
- const newVariableDataId = row.variable_data.length > 0 ? row.variable_data[row.variable_data.length - 1].id + 1 : 1;
405
- const newVariableData = {
406
- id: newVariableDataId,
407
- Route: {
408
- label: "Route",
409
- element: "single-select",
410
- type: "text"
411
- },
412
- Dose: {
413
- label: "Dose",
414
- element: "single-select",
415
- type: "text"
416
- },
417
- Frequency: {
418
- label: "Frequency",
419
- element: "single-select",
420
- type: "text"
421
- },
422
- When: {
423
- label: "When",
424
- element: "textarea",
425
- type: "text"
426
- },
427
- Duration: {
428
- label: "Duration",
429
- element: "textarea",
430
- type: "text"
431
- },
432
- Instructions: {
433
- label: "Instructions",
434
- element: "textarea",
435
- type: "text"
436
- },
437
- icons: { delete: "delete", plus: "plus" }
438
- };
439
- const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
440
- ...item,
441
- icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
442
- }));
443
- return {
444
- ...row,
445
- variable_data: updatedVariableData
446
- };
447
- }
448
- return row;
449
- }));
450
- };
451
402
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
452
403
  title: eachHeadEl.label,
453
404
  dataIndex: eachHeadEl.name,
@@ -475,7 +426,7 @@ var AddMoreTable = (props) => {
475
426
  rowElements[value.label] = renderInputElement(value);
476
427
  }
477
428
  if (key === "icons") {
478
- rowElements[`icons_${varIndex}`] = /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, "delete"), varIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, "plus"));
429
+ console.log("-----------key", key);
479
430
  }
480
431
  });
481
432
  });
package/dist/index.mjs CHANGED
@@ -344,6 +344,7 @@ var AddMoreTable = (props) => {
344
344
  newRow.variable_data = updatedVariableData;
345
345
  }
346
346
  setRows((prevData) => [...prevData, newRow]);
347
+ console.log("rows----------", rows);
347
348
  };
348
349
  const onHandleDelete = (index) => {
349
350
  if (rows.length > 1) {
@@ -351,56 +352,6 @@ var AddMoreTable = (props) => {
351
352
  setRows(remainingRows);
352
353
  }
353
354
  };
354
- const onHandleVariableData = (rowId) => {
355
- setRows((prevRows) => prevRows.map((row) => {
356
- if (row.id === rowId) {
357
- const newVariableDataId = row.variable_data.length > 0 ? row.variable_data[row.variable_data.length - 1].id + 1 : 1;
358
- const newVariableData = {
359
- id: newVariableDataId,
360
- Route: {
361
- label: "Route",
362
- element: "single-select",
363
- type: "text"
364
- },
365
- Dose: {
366
- label: "Dose",
367
- element: "single-select",
368
- type: "text"
369
- },
370
- Frequency: {
371
- label: "Frequency",
372
- element: "single-select",
373
- type: "text"
374
- },
375
- When: {
376
- label: "When",
377
- element: "textarea",
378
- type: "text"
379
- },
380
- Duration: {
381
- label: "Duration",
382
- element: "textarea",
383
- type: "text"
384
- },
385
- Instructions: {
386
- label: "Instructions",
387
- element: "textarea",
388
- type: "text"
389
- },
390
- icons: { delete: "delete", plus: "plus" }
391
- };
392
- const updatedVariableData = [...row.variable_data, newVariableData].map((item, index, array) => ({
393
- ...item,
394
- icons: { delete: "delete", plus: index === array.length - 1 ? "plus" : void 0 }
395
- }));
396
- return {
397
- ...row,
398
- variable_data: updatedVariableData
399
- };
400
- }
401
- return row;
402
- }));
403
- };
404
355
  const columns = thead && thead.length > 0 ? thead.map((eachHeadEl) => ({
405
356
  title: eachHeadEl.label,
406
357
  dataIndex: eachHeadEl.name,
@@ -428,7 +379,7 @@ var AddMoreTable = (props) => {
428
379
  rowElements[value.label] = renderInputElement(value);
429
380
  }
430
381
  if (key === "icons") {
431
- rowElements[`icons_${varIndex}`] = /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, "delete"), varIndex === eachRow.variable_data.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleVariableData(eachRow.id) }, "plus"));
382
+ console.log("-----------key", key);
432
383
  }
433
384
  });
434
385
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta25",
3
+ "version": "0.0.11-Beta27",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",