impaktapps-ui-builder 0.0.338 → 0.0.340
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/impaktapps-ui-builder.es.js +25 -29
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +2 -2
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +2 -2
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +2 -2
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +2 -4
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +3 -3
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +3 -3
- package/src/impaktapps-ui-builder/builder/services/component.ts +4 -4
- package/src/impaktapps-ui-builder/builder/services/event.ts +4 -4
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +13 -18
|
@@ -4,8 +4,8 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
4
4
|
refreshPage: (type: string, store: any) => void;
|
|
5
5
|
getFormdata: () => Promise<any>;
|
|
6
6
|
getSchema: () => any;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
okHandler: () => Promise<void>;
|
|
8
|
+
savePageHandler: () => Promise<void>;
|
|
9
9
|
onChange: () => void;
|
|
10
10
|
editComponents: () => Promise<void>;
|
|
11
11
|
deleteComponents: () => Promise<void>;
|
|
@@ -76,9 +76,9 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
76
76
|
};
|
|
77
77
|
required: string[];
|
|
78
78
|
}>;
|
|
79
|
-
|
|
79
|
+
savePageHandler: () => Promise<void>;
|
|
80
80
|
onChange: () => void;
|
|
81
|
-
|
|
81
|
+
okHandler: () => Promise<void>;
|
|
82
82
|
addEvent: () => Promise<void>;
|
|
83
83
|
editEvent: () => Promise<void>;
|
|
84
84
|
deleteEvent: () => Promise<void>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
submitPageHandler: () => Promise<boolean>;
|
|
3
|
-
};
|
|
1
|
+
export declare function saveHandler(store: any, service: any, submitHandler: any): Promise<boolean>;
|
|
4
2
|
interface funcParamsProps {
|
|
5
3
|
store: any;
|
|
6
4
|
dynamicData: any;
|
|
@@ -52,7 +50,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
52
50
|
};
|
|
53
51
|
backHandler: () => void;
|
|
54
52
|
onAddClickHandler: () => Promise<void>;
|
|
55
|
-
|
|
53
|
+
savePageHandler: () => Promise<void>;
|
|
56
54
|
Edit_Components: () => Promise<void>;
|
|
57
55
|
Delete_Components: () => Promise<void>;
|
|
58
56
|
eventAddHandler: () => Promise<void>;
|
package/package.json
CHANGED
|
@@ -244,12 +244,12 @@ export const componentBasicUiSchema: any = {
|
|
|
244
244
|
lg: 2.5,
|
|
245
245
|
},
|
|
246
246
|
main: {
|
|
247
|
-
name: "
|
|
247
|
+
name: "Ok",
|
|
248
248
|
startIcon: "ApproveIcon",
|
|
249
249
|
variant: "contained",
|
|
250
250
|
color: "info",
|
|
251
251
|
type: "text",
|
|
252
|
-
onClick: "
|
|
252
|
+
onClick: "okHandler",
|
|
253
253
|
size: "small",
|
|
254
254
|
},
|
|
255
255
|
style: {
|
|
@@ -278,7 +278,7 @@ export const componentBasicUiSchema: any = {
|
|
|
278
278
|
variant: "contained",
|
|
279
279
|
color: "info",
|
|
280
280
|
type: "text",
|
|
281
|
-
onClick: "
|
|
281
|
+
onClick: "savePageHandler",
|
|
282
282
|
size: "small",
|
|
283
283
|
},
|
|
284
284
|
style: {
|
|
@@ -263,12 +263,12 @@ export const EventUiSchema: any = {
|
|
|
263
263
|
lg: 2.5,
|
|
264
264
|
},
|
|
265
265
|
main: {
|
|
266
|
-
name: "
|
|
266
|
+
name: "Ok",
|
|
267
267
|
startIcon: "ApproveIcon",
|
|
268
268
|
variant: "contained",
|
|
269
269
|
color: "info",
|
|
270
270
|
type: "text",
|
|
271
|
-
onClick: "
|
|
271
|
+
onClick: "okHandler",
|
|
272
272
|
size: "small",
|
|
273
273
|
},
|
|
274
274
|
style: {
|
|
@@ -297,7 +297,7 @@ export const EventUiSchema: any = {
|
|
|
297
297
|
variant: "contained",
|
|
298
298
|
color: "info",
|
|
299
299
|
type: "text",
|
|
300
|
-
onClick: "
|
|
300
|
+
onClick: "savePageHandler",
|
|
301
301
|
size: "small",
|
|
302
302
|
},
|
|
303
303
|
style: {
|
|
@@ -9,7 +9,7 @@ import { StyleSection } from "../build/uischema/styleSection";
|
|
|
9
9
|
import { TableSection } from "../build/uischema/tableSection";
|
|
10
10
|
import { ValueTab } from "../build/uischema/valueTab";
|
|
11
11
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
12
|
-
import {
|
|
12
|
+
import { saveHandler } from "./pageMaster";
|
|
13
13
|
const sectionLabels = {
|
|
14
14
|
Select: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
15
15
|
MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
@@ -77,7 +77,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
77
77
|
getSchema: function () {
|
|
78
78
|
return ComponentSchema;
|
|
79
79
|
},
|
|
80
|
-
|
|
80
|
+
okHandler: async function () {
|
|
81
81
|
const path = store.searchParams?.get("path");
|
|
82
82
|
console.log(store.ctx.core.errors)
|
|
83
83
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
@@ -95,9 +95,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
95
95
|
})
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
-
|
|
98
|
+
savePageHandler: async () => {
|
|
99
99
|
const id = store.searchParams?.get("id");
|
|
100
|
-
const isSubmitted = await
|
|
100
|
+
const isSubmitted = await saveHandler(store, service, submitHandler);
|
|
101
101
|
if (isSubmitted) {
|
|
102
102
|
localStorage.removeItem("pageFormdata");
|
|
103
103
|
store.navigate(`/PageMaster?id=${id}`);
|
|
@@ -3,7 +3,7 @@ import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
|
|
|
3
3
|
import Component from "./component";
|
|
4
4
|
import { saveFormdataInLocalStorage } from "./saveHandler";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import {
|
|
6
|
+
import { saveHandler } from "./pageMaster";
|
|
7
7
|
import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
8
8
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
9
9
|
import _ from "lodash";
|
|
@@ -58,9 +58,9 @@ export default (
|
|
|
58
58
|
getSchema: async () => {
|
|
59
59
|
return EventSchema;
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
savePageHandler: async () => {
|
|
62
62
|
const id = store.searchParams?.get("id");
|
|
63
|
-
const isSubmitted = await
|
|
63
|
+
const isSubmitted = await saveHandler(store, service, submitHandler);
|
|
64
64
|
if (isSubmitted) {
|
|
65
65
|
localStorage.removeItem("pageFormdata");
|
|
66
66
|
store.navigate(`/PageMaster?id=${id}`);
|
|
@@ -86,7 +86,7 @@ export default (
|
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
okHandler: Component(store, dynamicData,submitHandler,service).okHandler,
|
|
90
90
|
addEvent: async function () {
|
|
91
91
|
const path = store.searchParams?.get("path");
|
|
92
92
|
if (!Array.isArray(store.formData.events)) {
|
|
@@ -5,22 +5,17 @@ import Component from "./component";
|
|
|
5
5
|
import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
|
|
6
6
|
import { schema } from "../build/buildUiSchema";
|
|
7
7
|
|
|
8
|
-
export function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return isTrue;
|
|
22
|
-
},
|
|
23
|
-
};
|
|
8
|
+
export async function saveHandler(store, service, submitHandler) {
|
|
9
|
+
let isTrue = false;
|
|
10
|
+
if (_.isEmpty(store.ctx.core.errors)) {
|
|
11
|
+
try {
|
|
12
|
+
const saveReturn = await submitHandler(store, service);
|
|
13
|
+
isTrue = true;
|
|
14
|
+
} catch (err) {
|
|
15
|
+
isTrue = false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return isTrue;
|
|
24
19
|
}
|
|
25
20
|
interface funcParamsProps {
|
|
26
21
|
store: any,
|
|
@@ -70,8 +65,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
70
65
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
71
66
|
);
|
|
72
67
|
},
|
|
73
|
-
|
|
74
|
-
const isSubmitted = await
|
|
68
|
+
savePageHandler: async () => {
|
|
69
|
+
const isSubmitted = await saveHandler(store, service, submitHandler);
|
|
75
70
|
if (isSubmitted) {
|
|
76
71
|
localStorage.removeItem("pageFormdata");
|
|
77
72
|
store.navigate('/PageMasterRecords');
|