@apexcura/core 0.0.14-Beta8 → 0.0.14-Beta80

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.d.mts CHANGED
@@ -40,6 +40,7 @@ declare const ElementExecutor: (props: ElementExecutorProps & styling) => React.
40
40
 
41
41
  type TableExecutorProps = {
42
42
  data: {
43
+ name: string;
43
44
  label: string;
44
45
  element: string;
45
46
  type: string;
@@ -52,10 +53,40 @@ type TableExecutorProps = {
52
53
  label: string;
53
54
  element: string;
54
55
  type: string;
55
- variableData?: {
56
- label: string;
57
- element: string;
58
- type: string;
56
+ variable_data?: {
57
+ id: {
58
+ id: number;
59
+ };
60
+ Route: {
61
+ label: string;
62
+ element: string;
63
+ type: string;
64
+ };
65
+ Dose: {
66
+ label: string;
67
+ element: string;
68
+ type: string;
69
+ };
70
+ Frequency: {
71
+ label: string;
72
+ element: string;
73
+ type: string;
74
+ };
75
+ When: {
76
+ label: string;
77
+ element: string;
78
+ type: string;
79
+ };
80
+ Duration: {
81
+ label: string;
82
+ element: string;
83
+ type: string;
84
+ };
85
+ Instructions: {
86
+ label: string;
87
+ element: string;
88
+ type: string;
89
+ };
59
90
  }[];
60
91
  }[];
61
92
  }[];
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ declare const ElementExecutor: (props: ElementExecutorProps & styling) => React.
40
40
 
41
41
  type TableExecutorProps = {
42
42
  data: {
43
+ name: string;
43
44
  label: string;
44
45
  element: string;
45
46
  type: string;
@@ -52,10 +53,40 @@ type TableExecutorProps = {
52
53
  label: string;
53
54
  element: string;
54
55
  type: string;
55
- variableData?: {
56
- label: string;
57
- element: string;
58
- type: string;
56
+ variable_data?: {
57
+ id: {
58
+ id: number;
59
+ };
60
+ Route: {
61
+ label: string;
62
+ element: string;
63
+ type: string;
64
+ };
65
+ Dose: {
66
+ label: string;
67
+ element: string;
68
+ type: string;
69
+ };
70
+ Frequency: {
71
+ label: string;
72
+ element: string;
73
+ type: string;
74
+ };
75
+ When: {
76
+ label: string;
77
+ element: string;
78
+ type: string;
79
+ };
80
+ Duration: {
81
+ label: string;
82
+ element: string;
83
+ type: string;
84
+ };
85
+ Instructions: {
86
+ label: string;
87
+ element: string;
88
+ type: string;
89
+ };
59
90
  }[];
60
91
  }[];
61
92
  }[];
package/dist/index.js CHANGED
@@ -173,8 +173,18 @@ var ElementExecutor = (props) => {
173
173
  var import_react2 = __toESM(require("react"));
174
174
  var import_ui_components2 = require("@apexcura/ui-components");
175
175
  var TableExecutor = (props) => {
176
+ const [tableData, setTableData] = (0, import_react2.useState)({});
177
+ const onHandleChange = (name, value) => {
178
+ setTableData((prev) => ({ ...prev, [name]: value }));
179
+ };
180
+ console.log(tableData);
176
181
  return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, props.data?.map((eachEl) => {
177
- return /* @__PURE__ */ import_react2.default.createElement("div", null, /* @__PURE__ */ import_react2.default.createElement("h1", null, eachEl.label), /* @__PURE__ */ import_react2.default.createElement(import_ui_components2.AddMoreTable, { ...eachEl }));
182
+ if (eachEl.element === "input-text") {
183
+ return /* @__PURE__ */ import_react2.default.createElement("div", { key: eachEl.name }, /* @__PURE__ */ import_react2.default.createElement(import_ui_components2.TextElement, { ...eachEl, onChange: (value) => onHandleChange(eachEl.name || "", value) }));
184
+ } else if (eachEl.element === "add_more") {
185
+ return /* @__PURE__ */ import_react2.default.createElement("div", { key: eachEl.name }, /* @__PURE__ */ import_react2.default.createElement(import_ui_components2.AddMoreTable, { ...eachEl }));
186
+ }
187
+ return null;
178
188
  }));
179
189
  };
180
190
  // Annotate the CommonJS export names for ESM import in node:
package/dist/index.mjs CHANGED
@@ -133,11 +133,21 @@ var ElementExecutor = (props) => {
133
133
  };
134
134
 
135
135
  // src/libraries/table-executor.tsx
136
- import React2 from "react";
137
- import { AddMoreTable } from "@apexcura/ui-components";
136
+ import React2, { useState as useState2 } from "react";
137
+ import { AddMoreTable, TextElement as TextElement2 } from "@apexcura/ui-components";
138
138
  var TableExecutor = (props) => {
139
+ const [tableData, setTableData] = useState2({});
140
+ const onHandleChange = (name, value) => {
141
+ setTableData((prev) => ({ ...prev, [name]: value }));
142
+ };
143
+ console.log(tableData);
139
144
  return /* @__PURE__ */ React2.createElement(React2.Fragment, null, props.data?.map((eachEl) => {
140
- return /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement("h1", null, eachEl.label), /* @__PURE__ */ React2.createElement(AddMoreTable, { ...eachEl }));
145
+ if (eachEl.element === "input-text") {
146
+ return /* @__PURE__ */ React2.createElement("div", { key: eachEl.name }, /* @__PURE__ */ React2.createElement(TextElement2, { ...eachEl, onChange: (value) => onHandleChange(eachEl.name || "", value) }));
147
+ } else if (eachEl.element === "add_more") {
148
+ return /* @__PURE__ */ React2.createElement("div", { key: eachEl.name }, /* @__PURE__ */ React2.createElement(AddMoreTable, { ...eachEl }));
149
+ }
150
+ return null;
141
151
  }));
142
152
  };
143
153
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apexcura/core",
3
- "version": "0.0.14-Beta8",
3
+ "version": "0.0.14-Beta80",
4
4
  "description": "Apex cura React components library",
5
5
  "keywords": [
6
6
  "apex cura",
@@ -28,7 +28,7 @@
28
28
  "build": "tsup"
29
29
  },
30
30
  "dependencies": {
31
- "@apexcura/ui-components": "^0.0.12",
31
+ "@apexcura/ui-components": "^0.0.11-Beta39",
32
32
  "@testing-library/jest-dom": "^6.4.2",
33
33
  "@testing-library/react": "^15.0.6",
34
34
  "@types/react-global-configuration": "^1.3.3",