impaktapps-ui-builder 0.0.341 → 0.0.343

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.
@@ -2,17 +2,17 @@ export declare const refreshPage: (type: string, store: any) => void;
2
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: () => Promise<void>;
7
+ okHandler: () => void;
8
8
  savePageHandler: () => Promise<void>;
9
9
  onChange: () => void;
10
- editComponents: () => Promise<void>;
11
- deleteComponents: () => Promise<void>;
12
- deleteEvent: () => Promise<void>;
13
- widgetAddClickHandler: () => Promise<void>;
14
- eventEditHandler: () => Promise<void>;
15
- eventAddHandler: () => Promise<void>;
10
+ editComponents: () => void;
11
+ deleteComponents: () => void;
12
+ deleteEvent: () => void;
13
+ widgetAddClickHandler: () => void;
14
+ eventEditHandler: () => void;
15
+ eventAddHandler: () => void;
16
16
  backHandler: () => void;
17
17
  };
18
18
  export default _default;
@@ -1,9 +1,9 @@
1
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,13 +75,13 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
75
75
  };
76
76
  };
77
77
  required: string[];
78
- }>;
78
+ };
79
79
  savePageHandler: () => Promise<void>;
80
80
  onChange: () => void;
81
- okHandler: () => Promise<void>;
82
- addEvent: () => Promise<void>;
83
- editEvent: () => Promise<void>;
84
- deleteEvent: () => Promise<void>;
81
+ okHandler: () => void;
82
+ addEvent: () => void;
83
+ editEvent: () => void;
84
+ deleteEvent: () => void;
85
85
  backHandler: () => void;
86
86
  };
87
87
  export default _default;
@@ -1,4 +1,4 @@
1
- export declare function saveHandler(store: any, service: any, submitHandler: any): Promise<boolean>;
1
+ export declare function saveHandler(store: any, service: any, submitHandler: any, config: any): Promise<boolean>;
2
2
  interface funcParamsProps {
3
3
  store: any;
4
4
  dynamicData: any;
@@ -8,8 +8,8 @@ interface funcParamsProps {
8
8
  }
9
9
  declare const _default: (funcParams: funcParamsProps) => {
10
10
  setPage: () => Promise<void>;
11
- getFormdata: () => Promise<any>;
12
- getUiSchema: () => Promise<any>;
11
+ getFormdata: () => any;
12
+ getUiSchema: () => any;
13
13
  getSchema: () => {
14
14
  type: string;
15
15
  properties: {
@@ -49,12 +49,12 @@ declare const _default: (funcParams: funcParamsProps) => {
49
49
  required: string[];
50
50
  };
51
51
  backHandler: () => void;
52
- onAddClickHandler: () => Promise<void>;
52
+ onAddClickHandler: () => void;
53
53
  savePageHandler: () => Promise<void>;
54
- Edit_Components: () => Promise<void>;
55
- Delete_Components: () => Promise<void>;
56
- eventAddHandler: () => Promise<void>;
57
- editEvent: () => Promise<void>;
58
- deleteEvent: () => Promise<void>;
54
+ Edit_Components: () => void;
55
+ Delete_Components: () => void;
56
+ eventAddHandler: () => void;
57
+ editEvent: () => void;
58
+ deleteEvent: () => void;
59
59
  };
60
60
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.341",
3
+ "version": "0.0.343",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -70,14 +70,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
70
70
 
71
71
  },
72
72
  refreshPage:refreshPage,
73
- getFormdata: async function () {
73
+ getFormdata: function () {
74
74
  const path = store.searchParams?.get("path");
75
75
  return getFormdataFromLocalStorage(path)
76
76
  },
77
77
  getSchema: function () {
78
78
  return ComponentSchema;
79
79
  },
80
- okHandler: async function () {
80
+ okHandler: 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)) {
@@ -97,7 +97,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
97
97
  },
98
98
  savePageHandler: async () => {
99
99
  const id = store.searchParams?.get("id");
100
- const isSubmitted = await saveHandler(store, service, submitHandler);
100
+ saveFormdataInLocalStorage(store.ctx.core.data);
101
+ const config = localStorage.getItem("pageFormdata");
102
+ const isSubmitted = await saveHandler(store, service, submitHandler,config);
101
103
  if (isSubmitted) {
102
104
  localStorage.removeItem("pageFormdata");
103
105
  store.navigate(`/PageMaster?id=${id}`);
@@ -122,7 +124,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
122
124
  this.refreshPage(store?.newData?.type,store);
123
125
  }
124
126
  },
125
- editComponents: async function () {
127
+ editComponents: function () {
126
128
  const rowId = dynamicData.path.split(".")[1];
127
129
  const path = store.searchParams?.get("path");
128
130
  const id = store.searchParams?.get("id");
@@ -137,7 +139,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
137
139
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
138
140
  }
139
141
  },
140
- deleteComponents: async function () {
142
+ deleteComponents: function () {
141
143
  const path = store.searchParams?.get("path");
142
144
  const rowId = dynamicData.path.split(".")[1];
143
145
  store.formData.elements.splice(rowId, 1);
@@ -145,14 +147,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
145
147
  const data = path ? _.get(response, path) : response;
146
148
  store.setFormdata(data);
147
149
  },
148
- deleteEvent: async function () {
150
+ deleteEvent: function () {
149
151
  const path = store.searchParams?.get("path");
150
152
  const rowId = dynamicData.path.split(".")[1];
151
153
  store.formData.events.splice(rowId, 1);
152
154
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
153
155
  store.setFormdata(_.get(response, path));
154
156
  },
155
- widgetAddClickHandler: async function () {
157
+ widgetAddClickHandler: function () {
156
158
  if (!Array.isArray(store.formData.elements)) {
157
159
  store.formData.elements = []
158
160
  }
@@ -164,7 +166,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
164
166
  this.setPage()
165
167
 
166
168
  },
167
- eventEditHandler: async function () {
169
+ eventEditHandler: function () {
168
170
  const rowId = dynamicData.path.split(".")[1];
169
171
  const path = store.searchParams?.get("path");
170
172
  const id = store.searchParams?.get("id");
@@ -172,7 +174,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
172
174
  const finalPath = `${path}.events[${rowId}]`
173
175
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
174
176
  },
175
- eventAddHandler: async function () {
177
+ eventAddHandler: function () {
176
178
  const path = store.searchParams?.get("path");
177
179
  const id = store.searchParams?.get("id");
178
180
  if (!Array.isArray(store.formData.events)) {
@@ -52,15 +52,17 @@ export default (
52
52
  },
53
53
 
54
54
  getFormData: Component(store, dynamicData,submitHandler,service).getFormdata,
55
- getUiSchema: async function () {
55
+ getUiSchema: function () {
56
56
  return EventUiSchema;
57
57
  },
58
- getSchema: async () => {
58
+ getSchema: () => {
59
59
  return EventSchema;
60
60
  },
61
61
  savePageHandler: async () => {
62
62
  const id = store.searchParams?.get("id");
63
- const isSubmitted = await saveHandler(store, service, submitHandler);
63
+ saveFormdataInLocalStorage(store.ctx.core.data);
64
+ const config = localStorage.getItem("pageFormdata");
65
+ const isSubmitted = await saveHandler(store, service, submitHandler,config);
64
66
  if (isSubmitted) {
65
67
  localStorage.removeItem("pageFormdata");
66
68
  store.navigate(`/PageMaster?id=${id}`);
@@ -87,7 +89,7 @@ export default (
87
89
  },
88
90
 
89
91
  okHandler: Component(store, dynamicData,submitHandler,service).okHandler,
90
- addEvent: async function () {
92
+ addEvent: function () {
91
93
  const path = store.searchParams?.get("path");
92
94
  if (!Array.isArray(store.formData.events)) {
93
95
  store.formData.events = []
@@ -98,7 +100,7 @@ export default (
98
100
  store.setSearchParams(store.searchParams)
99
101
  this.setPage()
100
102
  },
101
- editEvent: async function () {
103
+ editEvent: function () {
102
104
  const rowId = dynamicData.path.split(".")[1];
103
105
  const path = store.searchParams?.get("path");
104
106
  saveFormdataInLocalStorage(store.ctx.core.data, path)
@@ -5,11 +5,11 @@ import Component from "./component";
5
5
  import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
6
6
  import { schema } from "../build/buildUiSchema";
7
7
 
8
- export async function saveHandler(store, service, submitHandler) {
8
+ export async function saveHandler(store, service, submitHandler, config) {
9
9
  let isTrue = false;
10
10
  if (_.isEmpty(store.ctx.core.errors)) {
11
11
  try {
12
- const saveReturn = await submitHandler(store, service);
12
+ const saveReturn = await submitHandler(store, service,config);
13
13
  isTrue = true;
14
14
  } catch (err) {
15
15
  isTrue = false;
@@ -36,7 +36,7 @@ export default (funcParams: funcParamsProps) => {
36
36
  store.setSchema(schema);
37
37
  store.setUiSchema(uiSchema);
38
38
  },
39
- getFormdata: async function () {
39
+ getFormdata: function () {
40
40
  const id = store.searchParams?.get("id");
41
41
  const formData = getFormdataFromLocalStorage()
42
42
  if (formData) {
@@ -45,7 +45,7 @@ export default (funcParams: funcParamsProps) => {
45
45
  saveFormdataInLocalStorage(config)
46
46
  return config
47
47
  },
48
- getUiSchema: async function () {
48
+ getUiSchema: function () {
49
49
  return PageMasterUiSchema;
50
50
  },
51
51
  getSchema: () => {
@@ -55,7 +55,7 @@ export default (funcParams: funcParamsProps) => {
55
55
  localStorage.removeItem("pageFormdata")
56
56
  store.navigate("/PageMasterRecords");
57
57
  },
58
- onAddClickHandler: async function () {
58
+ onAddClickHandler: function () {
59
59
  const id = store.searchParams?.get("id");
60
60
  if (!Array.isArray(store.formData.elements)) {
61
61
  store.formData.elements = []
@@ -66,7 +66,9 @@ export default (funcParams: funcParamsProps) => {
66
66
  );
67
67
  },
68
68
  savePageHandler: async () => {
69
- const isSubmitted = await saveHandler(store, service, submitHandler);
69
+ saveFormdataInLocalStorage(store.ctx.core.data);
70
+ const config = localStorage.getItem("pageFormdata");
71
+ const isSubmitted = await saveHandler(store, service, submitHandler,config);
70
72
  if (isSubmitted) {
71
73
  localStorage.removeItem("pageFormdata");
72
74
  store.navigate('/PageMasterRecords');
@@ -84,7 +86,7 @@ export default (funcParams: funcParamsProps) => {
84
86
  },
85
87
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
86
88
  Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
87
- eventAddHandler: async function () {
89
+ eventAddHandler: function () {
88
90
  const id = store.searchParams?.get("id");
89
91
  if (!Array.isArray(store.formData.events)) {
90
92
  store.formData.events = []
@@ -93,14 +95,14 @@ export default (funcParams: funcParamsProps) => {
93
95
  const finalPath = `events[${store.formData.events.length}]`
94
96
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
95
97
  },
96
- editEvent: async function () {
98
+ editEvent: function () {
97
99
  const rowId = dynamicData.path.split(".")[1];
98
100
  const id = store.searchParams?.get("id");
99
101
  saveFormdataInLocalStorage(store.ctx.core.data)
100
102
  const finalPath = `events[${rowId}]`
101
103
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
102
104
  },
103
- deleteEvent: async function () {
105
+ deleteEvent: function () {
104
106
  const rowId = dynamicData.path.split(".")[1];
105
107
  store.formData.events.splice(rowId, 1);
106
108
  const response = saveFormdataInLocalStorage(store.ctx.core.data)