impaktapps-ui-builder 0.0.325 → 0.0.326

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.
@@ -1,3 +1,18 @@
1
1
  export declare const refreshPage: (type: string, store: any) => void;
2
- declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => any;
2
+ declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
3
+ setPage: () => Promise<void>;
4
+ refreshPage: (type: string, store: any) => void;
5
+ getFormdata: () => Promise<any>;
6
+ getSchema: () => any;
7
+ saveHandler: () => Promise<void>;
8
+ submitPageHandler: () => Promise<void>;
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>;
16
+ backHandler: () => void;
17
+ };
3
18
  export default _default;
@@ -1,7 +1,7 @@
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: any;
4
+ getFormData: () => Promise<any>;
5
5
  getUiSchema: () => Promise<any>;
6
6
  getSchema: () => Promise<{
7
7
  type: string;
@@ -77,11 +77,11 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
77
77
  required: string[];
78
78
  }>;
79
79
  onChange: () => void;
80
- saveHandler: any;
80
+ saveHandler: () => Promise<void>;
81
81
  addEvent: () => Promise<void>;
82
- submitPageHandler: any;
82
+ submitPageHandler: () => Promise<void>;
83
83
  editEvent: () => Promise<void>;
84
- deleteEvent: any;
84
+ deleteEvent: () => Promise<void>;
85
85
  backHandler: () => void;
86
86
  };
87
87
  export default _default;
@@ -1,3 +1,6 @@
1
+ export declare function submitPageHandlerProvider(store: any, service: any, submitHandler: any): {
2
+ submitPageHandler: () => Promise<void>;
3
+ };
1
4
  interface funcParamsProps {
2
5
  store: any;
3
6
  dynamicData: any;
@@ -5,5 +8,55 @@ interface funcParamsProps {
5
8
  service: any;
6
9
  config?: any;
7
10
  }
8
- declare const _default: (funcParams: funcParamsProps) => any;
11
+ declare const _default: (funcParams: funcParamsProps) => {
12
+ setPage: () => Promise<void>;
13
+ getFormdata: () => Promise<any>;
14
+ getUiSchema: () => Promise<any>;
15
+ getSchema: () => {
16
+ type: string;
17
+ properties: {
18
+ name: {
19
+ type: string;
20
+ minLength: number;
21
+ };
22
+ label: {
23
+ type: string;
24
+ };
25
+ layout: {
26
+ type: string;
27
+ items: {
28
+ type: string;
29
+ properties: {
30
+ layout_key: {
31
+ type: string;
32
+ };
33
+ layout_value: {
34
+ type: string;
35
+ };
36
+ };
37
+ };
38
+ };
39
+ sectionLabels: {
40
+ type: string;
41
+ items: {
42
+ type: string;
43
+ properties: {
44
+ label: {
45
+ type: string;
46
+ };
47
+ };
48
+ };
49
+ };
50
+ };
51
+ required: string[];
52
+ };
53
+ backHandler: () => void;
54
+ onAddClickHandler: () => Promise<void>;
55
+ submitPageHandler: () => Promise<void>;
56
+ Edit_Components: () => Promise<void>;
57
+ Delete_Components: () => Promise<void>;
58
+ eventAddHandler: () => Promise<void>;
59
+ editEvent: () => Promise<void>;
60
+ deleteEvent: () => Promise<void>;
61
+ };
9
62
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.325",
3
+ "version": "0.0.326",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -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,8 +240,8 @@ 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
247
  name: "Save",
@@ -258,7 +258,6 @@ export const componentBasicUiSchema: any = {
258
258
  },
259
259
  },
260
260
  },
261
- ///////////////////////////////////
262
261
  {
263
262
  type: "Control",
264
263
  scope: "#/properties/btnSubmit",
@@ -270,8 +269,8 @@ export const componentBasicUiSchema: any = {
270
269
  layout: {
271
270
  xs: 11,
272
271
  sm: 11,
273
- md: 3,
274
- lg: 3,
272
+ md: 2.5,
273
+ lg: 2.5,
275
274
  },
276
275
  main: {
277
276
  name: "Submit",
@@ -288,7 +287,6 @@ export const componentBasicUiSchema: any = {
288
287
  },
289
288
  },
290
289
  },
291
- //////////////////////////////////
292
290
  {
293
291
  type: "Control",
294
292
  scope: "#/properties/notify",
@@ -242,13 +242,41 @@ 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",
249
249
  },
250
250
  },
251
- //////////////////////////////
251
+ {
252
+ type: "Control",
253
+ scope: "#/properties/btn",
254
+ options: {
255
+ widget: "Button",
256
+ },
257
+
258
+ config: {
259
+ layout: {
260
+ xs: 11,
261
+ sm: 11,
262
+ md: 2.5,
263
+ lg: 2.5,
264
+ },
265
+ main: {
266
+ name: "Save",
267
+ startIcon: "ApproveIcon",
268
+ variant: "contained",
269
+ color: "info",
270
+ type: "text",
271
+ onClick: "saveHandler",
272
+ size: "small",
273
+ },
274
+ style: {
275
+ marginBottom: "8px",
276
+ float: "right",
277
+ },
278
+ },
279
+ },
252
280
  {
253
281
  type: "Control",
254
282
  scope: "#/properties/btnSubmit",
@@ -260,8 +288,8 @@ export const EventUiSchema: any = {
260
288
  layout: {
261
289
  xs: 11,
262
290
  sm: 11,
263
- md: 3,
264
- lg: 3,
291
+ md: 2.5,
292
+ lg: 2.5,
265
293
  },
266
294
  main: {
267
295
  name: "Submit",
@@ -278,7 +306,6 @@ export const EventUiSchema: any = {
278
306
  },
279
307
  },
280
308
  },
281
- ////////////////////////////////////
282
309
  {
283
310
  type: "Control",
284
311
  scope: "#/properties/notify",
@@ -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 pageMaster from "./pageMaster";
12
+ import { submitPageHandlerProvider } from "./pageMaster";
13
13
  const sectionLabels = {
14
14
  Select: ["Core", "Properties","Value", "style", "Event","Validation"],
15
15
  MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
@@ -95,7 +95,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
95
95
  })
96
96
  }
97
97
  },
98
- submitPageHandler: pageMaster({store,dynamicData,submitHandler,service}).submitPageHandler,
98
+ submitPageHandler: submitPageHandlerProvider(store, service, submitHandler).submitPageHandler,
99
99
  onChange: function () {
100
100
  if (
101
101
  store?.formData?.type !== store?.newData?.type &&
@@ -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 pageMaster from "./pageMaster";
6
+ import { submitPageHandlerProvider } from "./pageMaster";
7
7
  import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
8
8
  import { refreshSectionUiSchema } from "../build/uischema/refresh";
9
9
  import _ from "lodash";
@@ -79,7 +79,7 @@ export default (
79
79
  store.setSearchParams(store.searchParams)
80
80
  this.setPage()
81
81
  },
82
- submitPageHandler: pageMaster({store,dynamicData,submitHandler,service}).submitPageHandler,
82
+ submitPageHandler: submitPageHandlerProvider(store, service, submitHandler).submitPageHandler,
83
83
  editEvent: async function () {
84
84
  const rowId = dynamicData.path.split(".")[1];
85
85
  const path = store.searchParams?.get("path");
@@ -5,6 +5,29 @@ import Component from "./component";
5
5
  import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
6
6
  import { schema } from "../build/buildUiSchema";
7
7
 
8
+ export function submitPageHandlerProvider(store, service, submitHandler) {
9
+ return {
10
+ submitPageHandler: async function () {
11
+ if (_.isEmpty(store.ctx.core.errors)) {
12
+ submitHandler(store, service)
13
+ .then((saveReturn: any) => {
14
+ localStorage.removeItem("pageFormdata")
15
+ store.navigate("/PageMasterRecords")
16
+ store.setNotify({
17
+ SuccessMessage: "Submit Successfully",
18
+ Success: true,
19
+ });
20
+ })
21
+ } else {
22
+ store.setValidation("ValidateAndShow");
23
+ store.setNotify({
24
+ Fail: true,
25
+ FailMessage: "Errors on Page"
26
+ })
27
+ }
28
+ }
29
+ }
30
+ };
8
31
  interface funcParamsProps {
9
32
  store: any,
10
33
  dynamicData: any,
@@ -14,7 +37,7 @@ interface funcParamsProps {
14
37
  config?: any,
15
38
  }
16
39
  export default (funcParams: funcParamsProps) => {
17
- const { store, dynamicData, config, submitHandler,service } = funcParams
40
+ const { store, dynamicData, config, submitHandler, service } = funcParams
18
41
  return {
19
42
  setPage: async function () {
20
43
  const formdata = await this.getFormdata();
@@ -53,27 +76,9 @@ export default (funcParams: funcParamsProps) => {
53
76
  `/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
54
77
  );
55
78
  },
56
- submitPageHandler: async function () {
57
- if (_.isEmpty(funcParams.store.ctx.core.errors)) {
58
- submitHandler(store, funcParams.service)
59
- .then((saveReturn: any) => {
60
- localStorage.removeItem("pageFormdata")
61
- store.navigate("/PageMasterRecords")
62
- store.setNotify({
63
- SuccessMessage: "Submit Successfully",
64
- Success: true,
65
- });
66
- })
67
- } else {
68
- funcParams.store.setValidation("ValidateAndShow");
69
- funcParams.store.setNotify({
70
- Fail:true,
71
- FailMessage:"Errors on Page"
72
- })
73
- }
74
- },
75
- Edit_Components: Component(store, dynamicData,submitHandler,service).editComponents,
76
- Delete_Components: Component(store, dynamicData,submitHandler,service).deleteComponents,
79
+ submitPageHandler: submitPageHandlerProvider(store, service, submitHandler).submitPageHandler,
80
+ Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
81
+ Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
77
82
  eventAddHandler: async function () {
78
83
  const id = store.searchParams?.get("id");
79
84
  if (!Array.isArray(store.formData.events)) {