@apexcura/ui-components 0.0.11-Beta23 → 0.0.11-Beta24

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
@@ -379,15 +379,20 @@ var AddMoreTable = (props) => {
379
379
  let newRow;
380
380
  if (lastRow && lastRow.variable_data && lastRow.variable_data.length > 0) {
381
381
  const lastVariable = lastRow.variable_data[lastRow.variable_data.length - 1];
382
- const newVariableId = lastVariable.id + 1;
382
+ const newVariableId = lastVariable.id.id + 1;
383
383
  newRow = {
384
384
  ...lastRow,
385
385
  id: newId,
386
386
  variable_data: [
387
387
  ...lastRow.variable_data,
388
388
  {
389
- id: newVariableId,
390
- icon: {}
389
+ id: { id: newVariableId },
390
+ Route: { label: "Route", element: "single-select", type: "text" },
391
+ Dose: { label: "Dose", element: "single-select", type: "text" },
392
+ Frequency: { label: "Frequency", element: "single-select", type: "text" },
393
+ When: { label: "When", element: "textarea", type: "text" },
394
+ Duration: { label: "Duration", element: "textarea", type: "text" },
395
+ Instructions: { label: "Instructions", element: "textarea", type: "text" }
391
396
  }
392
397
  ]
393
398
  };
@@ -404,22 +409,23 @@ var AddMoreTable = (props) => {
404
409
  setRows(remainingRows);
405
410
  };
406
411
  const onAddVariableData = (rowIndex) => {
407
- console.log("rowIndex==>", rowIndex);
408
412
  setRows((prevRows) => {
409
- console.log("prevRows===>", prevRows);
410
413
  return prevRows.map((row, index) => {
411
- console.log("row", row);
412
- console.log("index", index);
413
414
  if (index === rowIndex && row.variable_data && row.variable_data.length > 0) {
414
415
  const lastVariable = row.variable_data[row.variable_data.length - 1];
415
- const newVariableId = lastVariable.id + 1;
416
+ const newVariableId = lastVariable.id.id + 1;
416
417
  return {
417
418
  ...row,
418
419
  variable_data: [
419
420
  ...row.variable_data,
420
421
  {
421
- id: newVariableId,
422
- icon: {}
422
+ id: { id: newVariableId },
423
+ Route: { label: "Route", element: "single-select", type: "text" },
424
+ Dose: { label: "Dose", element: "single-select", type: "text" },
425
+ Frequency: { label: "Frequency", element: "single-select", type: "text" },
426
+ When: { label: "When", element: "textarea", type: "text" },
427
+ Duration: { label: "Duration", element: "textarea", type: "text" },
428
+ Instructions: { label: "Instructions", element: "textarea", type: "text" }
423
429
  }
424
430
  ]
425
431
  };
@@ -462,7 +468,7 @@ var AddMoreTable = (props) => {
462
468
  "#": index + 1,
463
469
  ...eachRow,
464
470
  ...rowElements,
465
- actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onAddVariableData(index) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)), /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)))
471
+ actions: /* @__PURE__ */ import_react13.default.createElement(import_react13.default.Fragment, null, /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.DeleteOutlined, null)), /* @__PURE__ */ import_react13.default.createElement("button", { onClick: () => onAddVariableData(index) }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ import_react13.default.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ import_react13.default.createElement(import_icons2.PlusOutlined, null)))
466
472
  };
467
473
  });
468
474
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
package/dist/index.mjs CHANGED
@@ -332,15 +332,20 @@ var AddMoreTable = (props) => {
332
332
  let newRow;
333
333
  if (lastRow && lastRow.variable_data && lastRow.variable_data.length > 0) {
334
334
  const lastVariable = lastRow.variable_data[lastRow.variable_data.length - 1];
335
- const newVariableId = lastVariable.id + 1;
335
+ const newVariableId = lastVariable.id.id + 1;
336
336
  newRow = {
337
337
  ...lastRow,
338
338
  id: newId,
339
339
  variable_data: [
340
340
  ...lastRow.variable_data,
341
341
  {
342
- id: newVariableId,
343
- icon: {}
342
+ id: { id: newVariableId },
343
+ Route: { label: "Route", element: "single-select", type: "text" },
344
+ Dose: { label: "Dose", element: "single-select", type: "text" },
345
+ Frequency: { label: "Frequency", element: "single-select", type: "text" },
346
+ When: { label: "When", element: "textarea", type: "text" },
347
+ Duration: { label: "Duration", element: "textarea", type: "text" },
348
+ Instructions: { label: "Instructions", element: "textarea", type: "text" }
344
349
  }
345
350
  ]
346
351
  };
@@ -357,22 +362,23 @@ var AddMoreTable = (props) => {
357
362
  setRows(remainingRows);
358
363
  };
359
364
  const onAddVariableData = (rowIndex) => {
360
- console.log("rowIndex==>", rowIndex);
361
365
  setRows((prevRows) => {
362
- console.log("prevRows===>", prevRows);
363
366
  return prevRows.map((row, index) => {
364
- console.log("row", row);
365
- console.log("index", index);
366
367
  if (index === rowIndex && row.variable_data && row.variable_data.length > 0) {
367
368
  const lastVariable = row.variable_data[row.variable_data.length - 1];
368
- const newVariableId = lastVariable.id + 1;
369
+ const newVariableId = lastVariable.id.id + 1;
369
370
  return {
370
371
  ...row,
371
372
  variable_data: [
372
373
  ...row.variable_data,
373
374
  {
374
- id: newVariableId,
375
- icon: {}
375
+ id: { id: newVariableId },
376
+ Route: { label: "Route", element: "single-select", type: "text" },
377
+ Dose: { label: "Dose", element: "single-select", type: "text" },
378
+ Frequency: { label: "Frequency", element: "single-select", type: "text" },
379
+ When: { label: "When", element: "textarea", type: "text" },
380
+ Duration: { label: "Duration", element: "textarea", type: "text" },
381
+ Instructions: { label: "Instructions", element: "textarea", type: "text" }
376
382
  }
377
383
  ]
378
384
  };
@@ -415,7 +421,7 @@ var AddMoreTable = (props) => {
415
421
  "#": index + 1,
416
422
  ...eachRow,
417
423
  ...rowElements,
418
- actions: /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onAddVariableData(index) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)), /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)))
424
+ actions: /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement("button", { onClick: () => onHandleDelete(eachRow.id) }, /* @__PURE__ */ React12.createElement(DeleteOutlined, null)), /* @__PURE__ */ React12.createElement("button", { onClick: () => onAddVariableData(index) }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)), index === rows.length - 1 && /* @__PURE__ */ React12.createElement("button", { onClick: onHandleRows }, /* @__PURE__ */ React12.createElement(PlusOutlined, null)))
419
425
  };
420
426
  });
421
427
  if (!columns.some((col) => isColumnType(col) && col.dataIndex === "actions")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/ui-components",
3
- "version": "0.0.11-Beta23",
3
+ "version": "0.0.11-Beta24",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",