impaktapps-ui-builder 0.0.352 → 0.0.353

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.
Files changed (38) hide show
  1. package/README.md +92 -0
  2. package/dist/impaktapps-ui-builder.es.js +391 -248
  3. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  4. package/dist/impaktapps-ui-builder.umd.js +15 -15
  5. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildPop.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildStepper.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +9 -8
  9. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +10 -9
  10. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +10 -10
  11. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +10 -0
  12. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -1
  13. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +4 -0
  14. package/package.json +2 -1
  15. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
  16. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +43 -0
  17. package/src/impaktapps-ui-builder/builder/build/buildStepper.ts +49 -0
  18. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +7 -3
  19. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +20 -5
  20. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +14 -1
  21. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +33 -4
  22. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +2 -2
  23. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +7 -3
  24. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +33 -4
  25. package/src/impaktapps-ui-builder/builder/services/component.ts +21 -34
  26. package/src/impaktapps-ui-builder/builder/services/event.ts +22 -20
  27. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -36
  28. package/src/impaktapps-ui-builder/builder/services/utils.ts +109 -0
  29. package/src/impaktapps-ui-builder/lib/index.ts +1 -1
  30. package/src/impaktapps-ui-builder/runtime/services/service.ts +33 -32
  31. package/dist/src/impaktapps-ui-builder/builder/build/buildInputSlider.d.ts +0 -1
  32. package/dist/src/impaktapps-ui-builder/builder/services/clearLocalStorage.d.ts +0 -2
  33. package/dist/src/impaktapps-ui-builder/builder/services/getNavigationHistory.d.ts +0 -3
  34. package/dist/src/impaktapps-ui-builder/builder/services/saveHandler.d.ts +0 -2
  35. package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +0 -46
  36. package/src/impaktapps-ui-builder/builder/services/clearLocalStorage.ts +0 -3
  37. package/src/impaktapps-ui-builder/builder/services/getNavigationHistory.ts +0 -27
  38. package/src/impaktapps-ui-builder/builder/services/saveHandler.ts +0 -29
@@ -0,0 +1 @@
1
+ export declare const buildPopUp: (config: any, componentScope: any) => any;
@@ -0,0 +1 @@
1
+ export declare const buildStepper: (config: any, componentScope: any) => any;
@@ -1,17 +1,18 @@
1
1
  export declare const refreshPage: (type: string, store: any) => void;
2
- declare const _default: (store: any, dynamicData: any) => {
2
+ declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
3
3
  setPage: () => Promise<void>;
4
4
  refreshPage: (type: string, store: any) => void;
5
- getFormdata: () => Promise<any>;
5
+ getFormdata: () => any;
6
6
  getSchema: () => any;
7
+ okHandler: () => void;
7
8
  saveHandler: () => Promise<void>;
8
9
  onChange: () => void;
9
- editComponents: () => Promise<void>;
10
- deleteComponents: () => Promise<void>;
11
- deleteEvent: () => Promise<void>;
12
- widgetAddClickHandler: () => Promise<void>;
13
- eventEditHandler: () => Promise<void>;
14
- eventAddHandler: () => Promise<void>;
10
+ editComponents: () => void;
11
+ deleteComponents: () => void;
12
+ deleteEvent: () => void;
13
+ widgetAddClickHandler: () => void;
14
+ eventEditHandler: () => void;
15
+ eventAddHandler: () => void;
15
16
  backHandler: () => void;
16
17
  };
17
18
  export default _default;
@@ -1,9 +1,9 @@
1
- declare const _default: (store: any, dynamicData: any) => {
1
+ declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
2
2
  setPage: () => Promise<void>;
3
3
  refreshPage: (handlerType: any, store: any) => void;
4
- getFormData: () => Promise<any>;
5
- getUiSchema: () => Promise<any>;
6
- getSchema: () => Promise<{
4
+ getFormData: () => any;
5
+ getUiSchema: () => any;
6
+ getSchema: () => {
7
7
  type: string;
8
8
  properties: {
9
9
  headers: {
@@ -75,12 +75,13 @@ declare const _default: (store: any, dynamicData: any) => {
75
75
  };
76
76
  };
77
77
  required: string[];
78
- }>;
79
- onChange: () => void;
78
+ };
79
+ okHandler: () => void;
80
80
  saveHandler: () => Promise<void>;
81
- addEvent: () => Promise<void>;
82
- editEvent: () => Promise<void>;
83
- deleteEvent: () => Promise<void>;
81
+ onChange: () => void;
82
+ addEvent: () => void;
83
+ editEvent: () => void;
84
+ deleteEvent: () => void;
84
85
  backHandler: () => void;
85
86
  };
86
87
  export default _default;
@@ -1,14 +1,14 @@
1
1
  interface funcParamsProps {
2
2
  store: any;
3
3
  dynamicData: any;
4
- config: any;
5
4
  submitHandler: any;
6
5
  service: any;
6
+ config?: any;
7
7
  }
8
8
  declare const _default: (funcParams: funcParamsProps) => {
9
9
  setPage: () => Promise<void>;
10
- getFormdata: () => Promise<any>;
11
- getUiSchema: () => Promise<any>;
10
+ getFormdata: () => any;
11
+ getUiSchema: () => any;
12
12
  getSchema: () => {
13
13
  type: string;
14
14
  properties: {
@@ -48,12 +48,12 @@ declare const _default: (funcParams: funcParamsProps) => {
48
48
  required: string[];
49
49
  };
50
50
  backHandler: () => void;
51
- onAddClickHandler: () => Promise<void>;
52
- submitPageHandler: () => Promise<void>;
53
- Edit_Components: () => Promise<void>;
54
- Delete_Components: () => Promise<void>;
55
- eventAddHandler: () => Promise<void>;
56
- editEvent: () => Promise<void>;
57
- deleteEvent: () => Promise<void>;
51
+ onAddClickHandler: () => void;
52
+ saveHandler: () => Promise<void>;
53
+ Edit_Components: () => void;
54
+ Delete_Components: () => void;
55
+ eventAddHandler: () => void;
56
+ editEvent: () => void;
57
+ deleteEvent: () => void;
58
58
  };
59
59
  export default _default;
@@ -0,0 +1,10 @@
1
+ declare const clearFromLocalStorage: () => void;
2
+ export default clearFromLocalStorage;
3
+ export declare const getNavigationHistory: (config: any, path: string | undefined) => {
4
+ pageName: string;
5
+ };
6
+ export declare const saveFormdataInLocalStorage: (formData: any, path?: string) => any;
7
+ export declare const getFormdataFromLocalStorage: (path?: string) => any;
8
+ export declare function saveHandler(store: any, service: any, submitHandler: any, pageName?: string): Promise<void>;
9
+ export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
10
+ export declare function okHandler(store: any): void;
@@ -6,4 +6,4 @@ export { schema } from "../builder/build/buildUiSchema";
6
6
  export { default as buildConfig } from "../builder/build/buildConfig";
7
7
  export { default as buildUiSchema } from "../builder/build/buildUiSchema";
8
8
  export { buildSchema } from "../builder/build/buildUiSchema";
9
- export { default as clearPreviousCache } from "../builder/services/clearLocalStorage";
9
+ export { default as clearFromLocalStorage } from "../builder/services/utils";
@@ -17,6 +17,10 @@ declare const _default: (funcParams: funcParamsProps) => {
17
17
  getSelectOptions: (param: any) => Promise<any>;
18
18
  onChange: () => Promise<void>;
19
19
  updateConfigApiBody: (paramValue: any, apiBody: any) => Promise<any>;
20
+ StepperBackHandler: (param: any) => Promise<void>;
21
+ StepperSkipHandler: (param: any) => Promise<void>;
22
+ StepperNextHandler: (param: any) => Promise<void>;
23
+ callHandler: (eventType: string) => Promise<void>;
20
24
  downloadFile: (obj: any) => void;
21
25
  };
22
26
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.352",
3
+ "version": "0.0.353",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -13,6 +13,7 @@
13
13
  "@vitejs/plugin-react": "^1.1.4",
14
14
  "acorn-jsx": "^5.3.2",
15
15
  "babel-loader": "^8.2.3",
16
+ "lodash": "^4.17.21",
16
17
  "react": "^18.2.0",
17
18
  "react-ace": "^10.1.0",
18
19
  "react-dom": "^18.2.0",
@@ -13,7 +13,7 @@ const FileInput = {
13
13
  required: false,
14
14
  onUpload: "onFileUpload",
15
15
  onDownload:"onFileDownload",
16
- label:"label"
16
+ label:"Aggrement Copy"
17
17
  // iconStyleDefault:true,
18
18
  },
19
19
  style: {
@@ -0,0 +1,43 @@
1
+ import { createLayoutFormat } from "./buildConfig";
2
+ import WrapperSection from "./uischema/wrapperSection";
3
+ import _ from "lodash";
4
+
5
+ const PopUP = {
6
+ type: "Control",
7
+ scope: "#/properties/text",
8
+ options: {
9
+ widget: "PopUp",
10
+ },
11
+ config: {
12
+ layout: {
13
+ xs: 12,
14
+ sm: 12,
15
+ md: 12,
16
+ lg: 12,
17
+ },
18
+ main: {
19
+ label: "PopUp",
20
+ fullScreen:false,
21
+ fullWidth:false,
22
+ maxWidth:false,
23
+ alignItems:false,
24
+ spacing:2
25
+ },
26
+ style:{}
27
+ },
28
+ }
29
+ export const buildPopUp = (config,componentScope) =>{
30
+ const popup: any = _.cloneDeep(PopUP);
31
+ popup.scope = componentScope;
32
+ popup.config.main.label = config.label;
33
+ popup.config.main.fullScreen = config.fullScreen === "YES" ? true : false;
34
+ popup.config.main.fullWidth = config.fullWidth === "YES" ? true : false;
35
+ popup.config.main.maxWidth = config.maxWidth||false;
36
+ if (config.layout) {
37
+ popup.config.layout = createLayoutFormat(config.layout)
38
+ }
39
+ if (config.style) {
40
+ PopUP.config.style = JSON.parse(config.style)
41
+ }
42
+ return popup;
43
+ }
@@ -0,0 +1,49 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat } from "./buildConfig";
3
+
4
+ const Stepper =
5
+
6
+ {
7
+ type: "Control",
8
+ scope: "#/properties/Stepper",
9
+ options: {
10
+ widget: "Stepper",
11
+ },
12
+
13
+ config: {
14
+ main: {
15
+ label: ["First", "Second", "Third"],
16
+ stepsSkip: { 0: "false", 1: "false" },
17
+ resetButton: false,
18
+ resetText: "RESETdaad",
19
+ orientation: "vertical"
20
+ },
21
+ },
22
+ "elements":
23
+ [],
24
+ };
25
+
26
+ export const buildStepper = (config, componentScope) => {
27
+ const stepper: any = _.cloneDeep(Stepper);
28
+ stepper.scope = componentScope;
29
+ stepper.config.main.complete = config.fullScreen === "YES" ? true : false;
30
+ stepper.config.main.resetButton = config.fullWidth === "YES" ? true : false;
31
+ stepper.config.main.resetText = config.resetText || "ResetData";
32
+ stepper.config.main.completeText = config.completeText || "CompleteText";
33
+ stepper.config.main.orientation = config.orientation || "horizontal";
34
+ if (config.sectionLabels) {
35
+ stepper.config.main.tabLabels = config.sectionLabels.map((e,i:number) =>{
36
+ return {label:e.label,id:i}});
37
+ }
38
+ if (config.skipAvailable) {
39
+ stepper.config.main.tabLabels = config.skipAvailable.map((e,i:number) =>{
40
+ return {[e.skipId]:true}});
41
+ }
42
+ if (config.layout) {
43
+ stepper.config.layout = createLayoutFormat(config.layout)
44
+ }
45
+ if (config.style) {
46
+ stepper.config.style = JSON.parse(config.style)
47
+ }
48
+ return stepper;
49
+ }
@@ -34,7 +34,8 @@ import { buildEmptyBox } from "./buildEmptyBox";
34
34
  import { buildArray } from "./buildArray";
35
35
  import { buildAdhaarField, buildPanField } from "./buildAadharCard";
36
36
  import { buildFileInput } from "./buildFileInput";
37
- import { buildInputSlider } from "./buildInputSlider";
37
+ import { buildStepper } from "./buildStepper";
38
+ import { buildPopUp } from "./buildPop";
38
39
  export let schema = {
39
40
  type: "object",
40
41
  properties: {},
@@ -165,8 +166,11 @@ const buildUiSchema = (config: any) => {
165
166
  let elements: any = {};
166
167
  const componentScope = `#/properties/${config.name}`;
167
168
  switch (config.type) {
168
- case "InputSlider":
169
- elements = buildInputSlider(config, componentScope);
169
+ case "Stepper":
170
+ elements = buildStepper(config, componentScope);
171
+ break;
172
+ case "PopUp":
173
+ elements = buildPopUp(config, componentScope);
170
174
  break;
171
175
  case "FileInput":
172
176
  elements = buildFileInput(config, componentScope);
@@ -160,12 +160,27 @@ const GraphSection = {
160
160
  export const buildPropertiesSection = function (type: String) {
161
161
  let uiSchema = _.cloneDeep(GraphSection);
162
162
  switch (type) {
163
- case "InputSlider":
163
+ case "Stepper":
164
164
  uiSchema.elements = [
165
- getInputField("max", "Max Limit"),
166
- getInputField("step", "Step"),
167
- getInputField("min", "Min Limit"),
168
- getRadioInputField("limitToMax", "Applly Max. Limit", ["YES", "NO"]),
165
+ getRadioInputField("complete", "Complete Needed", ["YES", "NO"]),
166
+ getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
167
+ getInputField("resetText", "Reset Text"),
168
+ getInputField("completeText", "Complete Text"),
169
+ getSelectField("orientation", "Orientation Type", [
170
+ { label: "Horizontal", value: "horizontal" },
171
+ { label: "Vertical", value: "vertical" },
172
+ ]),
173
+ getArrayControl("sectionLabels", "label"),
174
+ getArrayControl("skipAvailable", "skipId"),
175
+ EmptyBox
176
+ ]
177
+ break;
178
+ case "PopUp":
179
+ uiSchema.elements = [
180
+ getRadioInputField("fullScreen", "FullScreen", ["YES", "NO"]),
181
+ getRadioInputField("fullWidth", "FullWidth", ["YES", "NO"]),
182
+ getInputField("maxWidth", "Max. Width"),
183
+ EmptyBox
169
184
  ]
170
185
  break;
171
186
  case "Text":
@@ -15,16 +15,17 @@ export const ComponentSchema: any = {
15
15
  { title: "Empty Box", const: "EmptyBox" },
16
16
  { title: "File", const: "FileInput" },
17
17
  { title: "Graph", const: "Graph" },
18
- { title: "Input Slider", const: "InputSlider" },
19
18
  { title: "Label", const: "Box" },
20
19
  { title: "LeaderBoard", const: "LeaderBoard" },
21
20
  { title: "MultipleSelect", const: "MultipleSelect" },
22
21
  { title: "PanCardText", const: "PanCardText" },
22
+ { title: "Popup Container", const: "PopUp" },
23
23
  { title: "ProgressBar", const: "ProgressBar" },
24
24
  { title: "ProgressBar Card", const: "ProgressBarCard" },
25
25
  { title: "Select", const: "Select" },
26
26
  { title: "Slider", const: "Slider" },
27
27
  { title: "SpeedoMeter", const: "SpeedoMeter" },
28
+ { title: "Stepper Container", const: "Stepper" },
28
29
  { title: "Radio", const: "Radio" },
29
30
  { title: "Rank", const: "Rank" },
30
31
  { title: "Rank Card", const: "RankCard" },
@@ -123,6 +124,18 @@ export const ComponentSchema: any = {
123
124
  },
124
125
  },
125
126
  },
127
+ skipAvailable: {
128
+ type: "array",
129
+ items: {
130
+ type: "object",
131
+ properties: {
132
+ skipId: {
133
+ type: "string",
134
+ },
135
+
136
+ },
137
+ },
138
+ },
126
139
  Table_Download_Keys_Name: {
127
140
  type: "array",
128
141
  items: {
@@ -223,7 +223,7 @@ export const componentBasicUiSchema: any = {
223
223
  type: "Control",
224
224
  scope: "#/properties/proc",
225
225
  config: {
226
- layout: { xs: 11, sm: 11, md: 8, lg: 8 },
226
+ layout: { xs: 11, sm: 11, md: 6, lg: 6 },
227
227
  },
228
228
  options: {
229
229
  widget: "EmptyBox",
@@ -240,11 +240,40 @@ export const componentBasicUiSchema: any = {
240
240
  layout: {
241
241
  xs: 11,
242
242
  sm: 11,
243
- md: 3,
244
- lg: 3,
243
+ md: 2.5,
244
+ lg: 2.5,
245
245
  },
246
246
  main: {
247
- name: "Save",
247
+ name: "Ok",
248
+ startIcon: "ApproveIcon",
249
+ variant: "contained",
250
+ color: "info",
251
+ type: "text",
252
+ onClick: "okHandler",
253
+ size: "small",
254
+ },
255
+ style: {
256
+ marginBottom: "8px",
257
+ float: "right",
258
+ },
259
+ },
260
+ },
261
+ {
262
+ type: "Control",
263
+ scope: "#/properties/btnSubmit",
264
+ options: {
265
+ widget: "Button",
266
+ },
267
+
268
+ config: {
269
+ layout: {
270
+ xs: 11,
271
+ sm: 11,
272
+ md: 2.5,
273
+ lg: 2.5,
274
+ },
275
+ main: {
276
+ name: "Save & Exit",
248
277
  startIcon: "ApproveIcon",
249
278
  variant: "contained",
250
279
  color: "info",
@@ -370,12 +370,12 @@ export const PageMasterUiSchema: any = {
370
370
  config: {
371
371
  layout: 11.7,
372
372
  main: {
373
- name: "Submit Page",
373
+ name: "Save",
374
374
  startIcon: "ApproveIcon",
375
375
  variant: "contained",
376
376
  color: "info",
377
377
  type: "text",
378
- onClick: "submitPageHandler",
378
+ onClick: "saveHandler",
379
379
  size: "small",
380
380
  },
381
381
  style: {
@@ -39,12 +39,16 @@ export const EventSchema = {
39
39
  type: "string",
40
40
  oneOf: [
41
41
  { title: "Click Event", const: "onClick" },
42
- { title: "onStart", const: "onStart" },
43
42
  { title: "Load Event", const: "onLoad" },
44
- { title: "File Upload Event", const: "onUpload" },
45
- { title: "File Download Event", const: "onDownload" },
46
43
  { title: "Change Event", const: "onChange" },
47
44
  { title: "Success", const: "Success" },
45
+ { title: "onStart", const: "onStart" },
46
+
47
+ { title: "File Upload Event", const: "onUpload" },
48
+ { title: "Stepper Back Event", const: "onStepperBack" },
49
+ { title: "Stepper Next Event", const: "onStepperNext" },
50
+ { title: "Stepper Skip Event", const: "onStepperSkip" },
51
+ { title: "File Download Event", const: "onDownload" },
48
52
  { title: "Fail", const: "Fail" }
49
53
  ]
50
54
  },
@@ -242,7 +242,7 @@ export const EventUiSchema: any = {
242
242
  type: "Control",
243
243
  scope: "#/properties/proc",
244
244
  config: {
245
- layout: { xs: 11, sm: 11, md: 8, lg: 8 },
245
+ layout: { xs: 11, sm: 11, md: 6, lg: 6 },
246
246
  },
247
247
  options: {
248
248
  widget: "EmptyBox",
@@ -259,11 +259,40 @@ export const EventUiSchema: any = {
259
259
  layout: {
260
260
  xs: 11,
261
261
  sm: 11,
262
- md: 3,
263
- lg: 3,
262
+ md: 2.5,
263
+ lg: 2.5,
264
264
  },
265
265
  main: {
266
- name: "Save",
266
+ name: "Ok",
267
+ startIcon: "ApproveIcon",
268
+ variant: "contained",
269
+ color: "info",
270
+ type: "text",
271
+ onClick: "okHandler",
272
+ size: "small",
273
+ },
274
+ style: {
275
+ marginBottom: "8px",
276
+ float: "right",
277
+ },
278
+ },
279
+ },
280
+ {
281
+ type: "Control",
282
+ scope: "#/properties/btnSubmit",
283
+ options: {
284
+ widget: "Button",
285
+ },
286
+
287
+ config: {
288
+ layout: {
289
+ xs: 11,
290
+ sm: 11,
291
+ md: 2.5,
292
+ lg: 2.5,
293
+ },
294
+ main: {
295
+ name: "Save & Exit",
267
296
  startIcon: "ApproveIcon",
268
297
  variant: "contained",
269
298
  color: "info",
@@ -1,7 +1,6 @@
1
1
  import _ from "lodash";
2
2
  import { ComponentSchema } from "../elements/UiSchema/Component/schema";
3
3
  import { componentBasicUiSchema } from "../elements/UiSchema/Component/uiSchema";
4
- import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
5
4
  import { CoreSection } from "../build/uischema/coreSection";
6
5
  import { EventSection } from "../build/uischema/eventSection";
7
6
  import { buildPropertiesSection } from "../build/uischema/buildPropertiesSection";
@@ -9,6 +8,7 @@ import { StyleSection } from "../build/uischema/styleSection";
9
8
  import { TableSection } from "../build/uischema/tableSection";
10
9
  import { ValueTab } from "../build/uischema/valueTab";
11
10
  import { ValidationSection } from "../build/uischema/validationSections";
11
+ import { getFormdataFromLocalStorage, okHandler, saveFormdataInLocalStorage, saveHandler } from "./utils";
12
12
  const sectionLabels = {
13
13
  Select: ["Core", "Properties","Value", "style", "Event","Validation"],
14
14
  MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
@@ -33,9 +33,12 @@ const sectionLabels = {
33
33
  Radio:["Core", "Properties", "style", "Event","Validation"],
34
34
  Text:["Core","Properties","style", "Event","Validation"],
35
35
  TextArea:["Core","Properties","style", "Event","Validation"],
36
- InputSlider:["Core","Properties","style", "Event","Validation"],
36
+ PopUp: ["Core", "Components","Properties", "style"],
37
+ Stepper: ["Core", "Components","Properties","Event", "style"],
37
38
  }
38
39
 
40
+
41
+
39
42
  export const refreshPage = (type:string,store:any) => {
40
43
  const UiSchema = _.cloneDeep(componentBasicUiSchema)
41
44
  if(type){
@@ -57,7 +60,7 @@ export const refreshPage = (type:string,store:any) => {
57
60
  store.setUiSchema(UiSchema);
58
61
  }
59
62
 
60
- export default (store: any, dynamicData: any) => {
63
+ export default (store: any, dynamicData: any, submitHandler: any, service: any) => {
61
64
  return {
62
65
  setPage: async function () {
63
66
  const formdata = await this.getFormdata();
@@ -68,31 +71,15 @@ export default (store: any, dynamicData: any) => {
68
71
 
69
72
  },
70
73
  refreshPage:refreshPage,
71
- getFormdata: async function () {
74
+ getFormdata: function () {
72
75
  const path = store.searchParams?.get("path");
73
76
  return getFormdataFromLocalStorage(path)
74
77
  },
75
78
  getSchema: function () {
76
79
  return ComponentSchema;
77
80
  },
78
- saveHandler: async function () {
79
- const path = store.searchParams?.get("path");
80
- console.log(store.ctx.core.errors)
81
- if (_.isEmpty(store.ctx.core.errors)) {
82
- saveFormdataInLocalStorage(store.formData,path)
83
- store.navigate(-1)
84
- store.setNotify({
85
- SuccessMessage: "Save Successfully",
86
- Success: true,
87
- });
88
- } else {
89
- store.setValidation("ValidateAndShow");
90
- store.setNotify({
91
- Fail:true,
92
- FailMessage:"Errors on Page"
93
- })
94
- }
95
- },
81
+ okHandler:()=>okHandler(store),
82
+ saveHandler: async ()=> await saveHandler(store,service,submitHandler,"PageMaster"),
96
83
  onChange: function () {
97
84
  if (
98
85
  store?.formData?.type !== store?.newData?.type &&
@@ -101,11 +88,11 @@ export default (store: any, dynamicData: any) => {
101
88
  this.refreshPage(store?.newData?.type,store);
102
89
  }
103
90
  },
104
- editComponents: async function () {
91
+ editComponents: function () {
105
92
  const rowId = dynamicData.path.split(".")[1];
106
93
  const path = store.searchParams?.get("path");
107
94
  const id = store.searchParams?.get("id");
108
- saveFormdataInLocalStorage(store.formData, path)
95
+ saveFormdataInLocalStorage(store.ctx.core.data, path)
109
96
  if (path) {
110
97
  const path = store.searchParams?.get("path");
111
98
  const finalPath = `${path}.elements[${rowId}]`
@@ -116,48 +103,48 @@ export default (store: any, dynamicData: any) => {
116
103
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
117
104
  }
118
105
  },
119
- deleteComponents: async function () {
106
+ deleteComponents: function () {
120
107
  const path = store.searchParams?.get("path");
121
108
  const rowId = dynamicData.path.split(".")[1];
122
109
  store.formData.elements.splice(rowId, 1);
123
- const response = saveFormdataInLocalStorage(store.formData, path)
110
+ const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
124
111
  const data = path ? _.get(response, path) : response;
125
112
  store.setFormdata(data);
126
113
  },
127
- deleteEvent: async function () {
114
+ deleteEvent: function () {
128
115
  const path = store.searchParams?.get("path");
129
116
  const rowId = dynamicData.path.split(".")[1];
130
117
  store.formData.events.splice(rowId, 1);
131
- const response = saveFormdataInLocalStorage(store.formData, path)
118
+ const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
132
119
  store.setFormdata(_.get(response, path));
133
120
  },
134
- widgetAddClickHandler: async function () {
121
+ widgetAddClickHandler: function () {
135
122
  if (!Array.isArray(store.formData.elements)) {
136
123
  store.formData.elements = []
137
124
  }
138
125
  const path = store.searchParams?.get("path");
139
- saveFormdataInLocalStorage(store.formData, path)
126
+ saveFormdataInLocalStorage(store.ctx.core.data, path)
140
127
  const finalPath = `${path}.elements[${store.formData.elements.length}]`
141
128
  store.searchParams.set("path", finalPath)
142
129
  store.setSearchParams(store.searchParams)
143
130
  this.setPage()
144
131
 
145
132
  },
146
- eventEditHandler: async function () {
133
+ eventEditHandler: function () {
147
134
  const rowId = dynamicData.path.split(".")[1];
148
135
  const path = store.searchParams?.get("path");
149
136
  const id = store.searchParams?.get("id");
150
- saveFormdataInLocalStorage(store.formData, path)
137
+ saveFormdataInLocalStorage(store.ctx.core.data, path)
151
138
  const finalPath = `${path}.events[${rowId}]`
152
139
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
153
140
  },
154
- eventAddHandler: async function () {
141
+ eventAddHandler: function () {
155
142
  const path = store.searchParams?.get("path");
156
143
  const id = store.searchParams?.get("id");
157
144
  if (!Array.isArray(store.formData.events)) {
158
145
  store.formData.events = []
159
146
  }
160
- saveFormdataInLocalStorage(store.formData, path)
147
+ saveFormdataInLocalStorage(store.ctx.core.data, path)
161
148
  const finalPath = `${path}.events[${store.formData.events.length}]`
162
149
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
163
150
  },