@apexcura/core 0.0.15-Beta0 → 0.0.15-Beta10
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 +6 -13
- package/dist/index.mjs +6 -13
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -99,25 +99,18 @@ function postService(url, method, data) {
|
|
|
99
99
|
var ElementExecutor = (props) => {
|
|
100
100
|
const [data, setData] = (0, import_react.useState)([]);
|
|
101
101
|
const [schema, setSchema] = (0, import_react.useState)(props.data.schema);
|
|
102
|
-
const onHandleChange = (name,
|
|
102
|
+
const onHandleChange = (name, option) => {
|
|
103
103
|
let prev = schema;
|
|
104
104
|
prev?.map((fie) => {
|
|
105
105
|
if (fie.name === name) {
|
|
106
|
-
fie["value"] =
|
|
107
|
-
props.selectedRecord(
|
|
108
|
-
}
|
|
109
|
-
if (fie.element === "radio=input") {
|
|
110
|
-
fie.options.map((eachOption) => {
|
|
111
|
-
if (eachOption.name === name) {
|
|
112
|
-
props.selectedRecord(eachOption);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
106
|
+
fie["value"] = option;
|
|
107
|
+
props.selectedRecord(option);
|
|
115
108
|
}
|
|
116
109
|
if (fie.fields && fie.fields.length) {
|
|
117
110
|
fie.fields.map((sub) => {
|
|
118
111
|
if (sub.name === name) {
|
|
119
|
-
sub["value"] =
|
|
120
|
-
props.selectedRecord(
|
|
112
|
+
sub["value"] = option;
|
|
113
|
+
props.selectedRecord(option);
|
|
121
114
|
}
|
|
122
115
|
return sub;
|
|
123
116
|
});
|
|
@@ -228,7 +221,7 @@ var ElementExecutor = (props) => {
|
|
|
228
221
|
case "div":
|
|
229
222
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: elementProps.className }, elementProps.label);
|
|
230
223
|
case "button":
|
|
231
|
-
return /* @__PURE__ */ import_react.default.createElement(import_ui_components.ButtonElement, { ...elementProps });
|
|
224
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ui_components.ButtonElement, { ...elementProps, onClick: () => props.selectedRecord(elementProps) });
|
|
232
225
|
case "sidebar":
|
|
233
226
|
return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
|
|
234
227
|
case "navbar":
|
package/dist/index.mjs
CHANGED
|
@@ -80,25 +80,18 @@ function postService(url, method, data) {
|
|
|
80
80
|
var ElementExecutor = (props) => {
|
|
81
81
|
const [data, setData] = useState([]);
|
|
82
82
|
const [schema, setSchema] = useState(props.data.schema);
|
|
83
|
-
const onHandleChange = (name,
|
|
83
|
+
const onHandleChange = (name, option) => {
|
|
84
84
|
let prev = schema;
|
|
85
85
|
prev?.map((fie) => {
|
|
86
86
|
if (fie.name === name) {
|
|
87
|
-
fie["value"] =
|
|
88
|
-
props.selectedRecord(
|
|
89
|
-
}
|
|
90
|
-
if (fie.element === "radio=input") {
|
|
91
|
-
fie.options.map((eachOption) => {
|
|
92
|
-
if (eachOption.name === name) {
|
|
93
|
-
props.selectedRecord(eachOption);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
87
|
+
fie["value"] = option;
|
|
88
|
+
props.selectedRecord(option);
|
|
96
89
|
}
|
|
97
90
|
if (fie.fields && fie.fields.length) {
|
|
98
91
|
fie.fields.map((sub) => {
|
|
99
92
|
if (sub.name === name) {
|
|
100
|
-
sub["value"] =
|
|
101
|
-
props.selectedRecord(
|
|
93
|
+
sub["value"] = option;
|
|
94
|
+
props.selectedRecord(option);
|
|
102
95
|
}
|
|
103
96
|
return sub;
|
|
104
97
|
});
|
|
@@ -209,7 +202,7 @@ var ElementExecutor = (props) => {
|
|
|
209
202
|
case "div":
|
|
210
203
|
return /* @__PURE__ */ React.createElement("div", { className: elementProps.className }, elementProps.label);
|
|
211
204
|
case "button":
|
|
212
|
-
return /* @__PURE__ */ React.createElement(ButtonElement, { ...elementProps });
|
|
205
|
+
return /* @__PURE__ */ React.createElement(ButtonElement, { ...elementProps, onClick: () => props.selectedRecord(elementProps) });
|
|
213
206
|
case "sidebar":
|
|
214
207
|
return /* @__PURE__ */ React.createElement(Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
|
|
215
208
|
case "navbar":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apexcura/core",
|
|
3
|
-
"version": "0.0.15-
|
|
3
|
+
"version": "0.0.15-Beta10",
|
|
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.13-
|
|
31
|
+
"@apexcura/ui-components": "^0.0.13-Beta5",
|
|
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",
|