@apexcura/core 0.0.15-Beta1 → 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 -12
- package/dist/index.mjs +6 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -99,24 +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
|
-
|
|
108
|
-
if (fie.element === "radio=input") {
|
|
109
|
-
fie.options.map((eachOption) => {
|
|
110
|
-
if (eachOption.name === name) {
|
|
111
|
-
props.selectedRecord(value);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
106
|
+
fie["value"] = option;
|
|
107
|
+
props.selectedRecord(option);
|
|
114
108
|
}
|
|
115
109
|
if (fie.fields && fie.fields.length) {
|
|
116
110
|
fie.fields.map((sub) => {
|
|
117
111
|
if (sub.name === name) {
|
|
118
|
-
sub["value"] =
|
|
119
|
-
props.selectedRecord(
|
|
112
|
+
sub["value"] = option;
|
|
113
|
+
props.selectedRecord(option);
|
|
120
114
|
}
|
|
121
115
|
return sub;
|
|
122
116
|
});
|
|
@@ -227,7 +221,7 @@ var ElementExecutor = (props) => {
|
|
|
227
221
|
case "div":
|
|
228
222
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: elementProps.className }, elementProps.label);
|
|
229
223
|
case "button":
|
|
230
|
-
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) });
|
|
231
225
|
case "sidebar":
|
|
232
226
|
return /* @__PURE__ */ import_react.default.createElement(import_ui_components.Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
|
|
233
227
|
case "navbar":
|
package/dist/index.mjs
CHANGED
|
@@ -80,24 +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
|
-
|
|
89
|
-
if (fie.element === "radio=input") {
|
|
90
|
-
fie.options.map((eachOption) => {
|
|
91
|
-
if (eachOption.name === name) {
|
|
92
|
-
props.selectedRecord(value);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
87
|
+
fie["value"] = option;
|
|
88
|
+
props.selectedRecord(option);
|
|
95
89
|
}
|
|
96
90
|
if (fie.fields && fie.fields.length) {
|
|
97
91
|
fie.fields.map((sub) => {
|
|
98
92
|
if (sub.name === name) {
|
|
99
|
-
sub["value"] =
|
|
100
|
-
props.selectedRecord(
|
|
93
|
+
sub["value"] = option;
|
|
94
|
+
props.selectedRecord(option);
|
|
101
95
|
}
|
|
102
96
|
return sub;
|
|
103
97
|
});
|
|
@@ -208,7 +202,7 @@ var ElementExecutor = (props) => {
|
|
|
208
202
|
case "div":
|
|
209
203
|
return /* @__PURE__ */ React.createElement("div", { className: elementProps.className }, elementProps.label);
|
|
210
204
|
case "button":
|
|
211
|
-
return /* @__PURE__ */ React.createElement(ButtonElement, { ...elementProps });
|
|
205
|
+
return /* @__PURE__ */ React.createElement(ButtonElement, { ...elementProps, onClick: () => props.selectedRecord(elementProps) });
|
|
212
206
|
case "sidebar":
|
|
213
207
|
return /* @__PURE__ */ React.createElement(Sidebar, { ...elementProps, onChange: (value) => onHandleChange(elementProps.name || "", value) });
|
|
214
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",
|