impaktapps-ui-builder 0.0.409-c → 0.0.409-f

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.
@@ -3,11 +3,10 @@ interface funcParamsProps {
3
3
  dynamicData: any;
4
4
  submitHandler: any;
5
5
  service: any;
6
- config?: any;
7
6
  }
8
7
  declare const _default: (funcParams: funcParamsProps) => {
9
8
  setPage: () => Promise<void>;
10
- getFormdata: () => any;
9
+ getFormdata: () => Promise<any>;
11
10
  getUiSchema: () => any;
12
11
  getSchema: () => {
13
12
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.409c",
3
+ "version": "0.0.409f",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -171,6 +171,7 @@ const buildUiSchema = (config: any) => {
171
171
  switch (config.type) {
172
172
  case "TreeMap":
173
173
  elements = buildTreeMap(config,componentScope)
174
+ break;
174
175
  case "DateTime":
175
176
  elements = buildDateTime(config, componentScope);
176
177
  break;
@@ -11,10 +11,9 @@ interface funcParamsProps {
11
11
 
12
12
  submitHandler: any,
13
13
  service: any
14
- config?: any
15
14
  }
16
15
  export default (funcParams: funcParamsProps) => {
17
- const { store, dynamicData, config, submitHandler, service } = funcParams
16
+ const { store, dynamicData, submitHandler, service } = funcParams
18
17
  return {
19
18
  setPage: async function () {
20
19
  const formdata = await this.getFormdata();
@@ -24,8 +23,14 @@ export default (funcParams: funcParamsProps) => {
24
23
  store.setSchema(schema);
25
24
  store.setUiSchema(uiSchema);
26
25
  },
27
- getFormdata: function () {
26
+ getFormdata: async function () {
28
27
  const id = store.searchParams?.get("id");
28
+ let config: any = {};
29
+ if (id) {
30
+ await service.get(`/page/getById?id=${id}`).then((res: any) => {
31
+ config = res.data?.config;
32
+ });
33
+ }
29
34
  const formData = getFormdataFromLocalStorage()
30
35
  if (formData) {
31
36
  return formData;