impaktapps-ui-builder 0.0.409-o → 0.0.409-q
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 +54 -128
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +13 -13
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.d.ts +4 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +0 -30
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.ts +9 -6
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +26 -47
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +0 -22
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +0 -23
- package/src/impaktapps-ui-builder/builder/services/component.ts +2 -1
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +4 -9
- package/src/impaktapps-ui-builder/runtime/services/service.ts +17 -31
|
@@ -18,9 +18,6 @@ export declare const CoreSection: {
|
|
|
18
18
|
main: {
|
|
19
19
|
label: string;
|
|
20
20
|
type: string;
|
|
21
|
-
options?: undefined;
|
|
22
|
-
color?: undefined;
|
|
23
|
-
required?: undefined;
|
|
24
21
|
};
|
|
25
22
|
};
|
|
26
23
|
layout?: undefined;
|
|
@@ -42,33 +39,6 @@ export declare const CoreSection: {
|
|
|
42
39
|
main: {
|
|
43
40
|
label: string;
|
|
44
41
|
type?: undefined;
|
|
45
|
-
options?: undefined;
|
|
46
|
-
color?: undefined;
|
|
47
|
-
required?: undefined;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
layout?: undefined;
|
|
51
|
-
} | {
|
|
52
|
-
type: string;
|
|
53
|
-
scope: string;
|
|
54
|
-
options: {
|
|
55
|
-
widget: string;
|
|
56
|
-
elementLabelProp?: undefined;
|
|
57
|
-
detail?: undefined;
|
|
58
|
-
};
|
|
59
|
-
config: {
|
|
60
|
-
layout: {
|
|
61
|
-
xs: number;
|
|
62
|
-
sm: number;
|
|
63
|
-
md: number;
|
|
64
|
-
lg: number;
|
|
65
|
-
};
|
|
66
|
-
main: {
|
|
67
|
-
label: string;
|
|
68
|
-
options: any[];
|
|
69
|
-
color: string;
|
|
70
|
-
required: boolean;
|
|
71
|
-
type?: undefined;
|
|
72
42
|
};
|
|
73
43
|
};
|
|
74
44
|
layout?: undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export const buildBasicUiSchema = (config)=>{
|
|
2
|
-
return
|
|
1
|
+
export const buildBasicUiSchema = (config) => {
|
|
2
|
+
return {
|
|
3
3
|
"type": "HorizontalLayout",
|
|
4
|
-
pageName
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
pageName: config.name,
|
|
5
|
+
name: config.name,
|
|
6
|
+
accessorKey: config.name,
|
|
7
|
+
header: config.label || config.name,
|
|
8
|
+
"elements": []
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -289,7 +289,13 @@ const buildUiSchema = (config: any) => {
|
|
|
289
289
|
case "Timer":
|
|
290
290
|
elements = buildTimer(config, componentScope);
|
|
291
291
|
break;
|
|
292
|
-
|
|
292
|
+
case "ColumnGroup":
|
|
293
|
+
elements = {
|
|
294
|
+
accessorKey: config.name,
|
|
295
|
+
header: config.label || config.name,
|
|
296
|
+
elements: [],
|
|
297
|
+
}
|
|
298
|
+
break;
|
|
293
299
|
case "MultipleSelect":
|
|
294
300
|
elements = buildMultiSelect(config, componentScope);
|
|
295
301
|
break;
|
|
@@ -309,60 +315,33 @@ const buildUiSchema = (config: any) => {
|
|
|
309
315
|
if (config?.type === "LeaderBoard") {
|
|
310
316
|
return elements;
|
|
311
317
|
}
|
|
312
|
-
else if (config.type == "Table") {
|
|
318
|
+
else if (config.type == "Table" || config.type == "ColumnGroup") {
|
|
313
319
|
const sizeMap = {}
|
|
314
320
|
if (config.sizeHolder) {
|
|
315
321
|
config.sizeHolder.map((e, i) => {
|
|
316
322
|
sizeMap[e.keyName] = e.value
|
|
317
323
|
});
|
|
318
324
|
}
|
|
319
|
-
|
|
320
|
-
if (
|
|
325
|
+
elements.elements = config.elements.map((cellElem, elemInd) => {
|
|
326
|
+
if (cellElem.type) {
|
|
321
327
|
return {
|
|
322
|
-
accessorKey:
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
widget: buildUiSchema(
|
|
327
|
-
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
return {
|
|
331
|
-
accessorKey: element.name,
|
|
332
|
-
type: element.columnFormat,
|
|
333
|
-
header: element.label || element.name,
|
|
334
|
-
size: sizeMap[element.name] || 180,
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function buildHierarchy(elements, parentName = null) {
|
|
339
|
-
const result = [];
|
|
340
|
-
for (const element of elements) {
|
|
341
|
-
if (element?.parent === parentName) {
|
|
342
|
-
const children = buildHierarchy(elements, element.name);
|
|
343
|
-
const node: any = nodeProvider(element)
|
|
344
|
-
if (children.length > 0) {
|
|
345
|
-
node.columns = children;
|
|
346
|
-
node.type = "group";
|
|
347
|
-
}
|
|
348
|
-
result.push(node);
|
|
328
|
+
accessorKey: cellElem.name,
|
|
329
|
+
header: cellElem.label || cellElem.name,
|
|
330
|
+
size: sizeMap[cellElem.name] || 180,
|
|
331
|
+
type: cellElem.columnFormat,
|
|
332
|
+
widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem) : undefined,
|
|
333
|
+
elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem)) : []
|
|
349
334
|
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const hierarchy = buildHierarchy(config.elements, config.name);
|
|
357
|
-
for (const element of config.elements) {
|
|
358
|
-
const parentExists = config.elements.some(e => e.name === element.parent);
|
|
359
|
-
if (!parentExists && element.parent !== config.name) {
|
|
360
|
-
output.push(nodeProvider(element))
|
|
335
|
+
} else {
|
|
336
|
+
return {
|
|
337
|
+
accessorKey: cellElem.name,
|
|
338
|
+
type: cellElem.columnFormat,
|
|
339
|
+
header: cellElem.label || cellElem.name,
|
|
340
|
+
size: sizeMap[cellElem.name] || 180
|
|
361
341
|
}
|
|
362
342
|
}
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
elements.elements = transformConfigToOutput(config)
|
|
343
|
+
|
|
344
|
+
})
|
|
366
345
|
}
|
|
367
346
|
else if (config.type == "Array") {
|
|
368
347
|
elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
|
|
@@ -445,11 +424,11 @@ function buildHierarchy(elements, parentName = null, sizeMap) {
|
|
|
445
424
|
|
|
446
425
|
function transformConfigToOutput(config, sizeMap) {
|
|
447
426
|
const output = [];
|
|
448
|
-
const hierarchy = buildHierarchy(config.elements, config.name,schema);
|
|
427
|
+
const hierarchy = buildHierarchy(config.elements, config.name, schema);
|
|
449
428
|
for (const element of config.elements) {
|
|
450
429
|
const parentExists = config.elements.some(e => e.name === element.parent);
|
|
451
430
|
if (!parentExists && element.parent !== config.name) {
|
|
452
|
-
output.push(nodeProvider(element,sizeMap))
|
|
431
|
+
output.push(nodeProvider(element, sizeMap))
|
|
453
432
|
}
|
|
454
433
|
}
|
|
455
434
|
return [...hierarchy, ...output,];
|
|
@@ -54,28 +54,6 @@ export const CoreSection = {
|
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
|
-
{
|
|
58
|
-
type: "Control",
|
|
59
|
-
scope: "#/properties/parent",
|
|
60
|
-
|
|
61
|
-
options: {
|
|
62
|
-
widget: "InputField",
|
|
63
|
-
},
|
|
64
|
-
config: {
|
|
65
|
-
layout: {
|
|
66
|
-
xs: 12,
|
|
67
|
-
sm: 12,
|
|
68
|
-
md: 6,
|
|
69
|
-
lg: 6,
|
|
70
|
-
},
|
|
71
|
-
main: {
|
|
72
|
-
label: "parent",
|
|
73
|
-
options: [],
|
|
74
|
-
color: "secondary",
|
|
75
|
-
required: true,
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
57
|
{
|
|
80
58
|
type: "Control",
|
|
81
59
|
scope: "#/properties/columnFormat",
|
|
@@ -41,8 +41,8 @@ export const ComponentSchema: any = {
|
|
|
41
41
|
{ title: "Upload File", const: "UploadFile" },
|
|
42
42
|
{ title: "Timer", const: "Timer" },
|
|
43
43
|
{ title: "Upload File", const: "UploadFile" },
|
|
44
|
-
|
|
45
44
|
{ title: "TreeMap", const: "TreeMap" },
|
|
45
|
+
{ title: "ColumnGroup", const: "ColumnGroup" },
|
|
46
46
|
]
|
|
47
47
|
},
|
|
48
48
|
columnFormat: {
|
|
@@ -148,29 +148,6 @@ export const componentBasicUiSchema: any = {
|
|
|
148
148
|
},
|
|
149
149
|
},
|
|
150
150
|
},
|
|
151
|
-
|
|
152
|
-
{
|
|
153
|
-
type: "Control",
|
|
154
|
-
scope: "#/properties/parent",
|
|
155
|
-
|
|
156
|
-
options: {
|
|
157
|
-
widget: "InputField",
|
|
158
|
-
},
|
|
159
|
-
config: {
|
|
160
|
-
layout: {
|
|
161
|
-
xs: 12,
|
|
162
|
-
sm: 12,
|
|
163
|
-
md: 6,
|
|
164
|
-
lg: 6,
|
|
165
|
-
},
|
|
166
|
-
main: {
|
|
167
|
-
label: "parent",
|
|
168
|
-
options: [],
|
|
169
|
-
color: "secondary",
|
|
170
|
-
required: true,
|
|
171
|
-
},
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
151
|
{
|
|
175
152
|
type: "Control",
|
|
176
153
|
scope: "#/properties/columnFormat",
|
|
@@ -37,7 +37,8 @@ const sectionLabels = {
|
|
|
37
37
|
Stepper: ["Core", "Components", "Properties", "Event", "Style"],
|
|
38
38
|
DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
|
|
39
39
|
InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
40
|
-
TreeMap: ["Core", "Components", "Properties", "Event", "Style"
|
|
40
|
+
TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
|
|
41
|
+
ColumnGroup: ["Core", "Components"]
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
|
|
@@ -8,12 +8,12 @@ import { getFormdataFromLocalStorage, saveFormdataInLocalStorage, saveHandler }
|
|
|
8
8
|
interface funcParamsProps {
|
|
9
9
|
store: any,
|
|
10
10
|
dynamicData: any,
|
|
11
|
-
|
|
11
|
+
pageConfigProvider: any,
|
|
12
12
|
submitHandler: any,
|
|
13
13
|
service: any
|
|
14
14
|
}
|
|
15
15
|
export default (funcParams: funcParamsProps) => {
|
|
16
|
-
const { store, dynamicData,
|
|
16
|
+
const { store, dynamicData, submitHandler, service } = funcParams
|
|
17
17
|
return {
|
|
18
18
|
setPage: async function () {
|
|
19
19
|
const formdata = await this.getFormdata();
|
|
@@ -25,12 +25,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
25
25
|
},
|
|
26
26
|
getFormdata: async function () {
|
|
27
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
|
-
}
|
|
28
|
+
let config: any = await funcParams.pageConfigProvider()
|
|
34
29
|
const formData = getFormdataFromLocalStorage()
|
|
35
30
|
if (formData) {
|
|
36
31
|
return formData;
|
|
@@ -58,7 +53,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
58
53
|
store.navigate(
|
|
59
54
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
60
55
|
);
|
|
61
|
-
}else{
|
|
56
|
+
} else {
|
|
62
57
|
store.navigate(
|
|
63
58
|
`/Component?path=${`elements[${response?.elements.length}]`}`
|
|
64
59
|
);
|
|
@@ -18,6 +18,7 @@ interface funcParamsProps {
|
|
|
18
18
|
dynamicData: any,
|
|
19
19
|
service: any,
|
|
20
20
|
userValue: any,
|
|
21
|
+
pageDataProvider: any,
|
|
21
22
|
functionsProvider?: Record<string, any>
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -64,29 +65,13 @@ export default (funcParams: funcParamsProps) => {
|
|
|
64
65
|
return {
|
|
65
66
|
setPage: async function () {
|
|
66
67
|
funcParams.store.setFormdata({})
|
|
67
|
-
|
|
68
|
-
pageName: funcParams.store.pageName
|
|
69
|
-
});
|
|
68
|
+
|
|
70
69
|
let pageData;
|
|
71
70
|
const pageBasicDetailString = localStorage.getItem("pagemasterMetaData")
|
|
72
71
|
if (pageBasicDetailString) {
|
|
73
72
|
pageData = JSON.parse(pageBasicDetailString)
|
|
74
73
|
} else {
|
|
75
|
-
|
|
76
|
-
.post("/page/getByName", data, {
|
|
77
|
-
headers: {
|
|
78
|
-
"Content-Type": "application/json",
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const response = await funcParams.service.get(
|
|
82
|
-
`/page/getById?id=${pageId?.data?.id}`,
|
|
83
|
-
{
|
|
84
|
-
headers: {
|
|
85
|
-
"Content-Type": "application/json",
|
|
86
|
-
},
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
pageData = response.data;
|
|
74
|
+
pageData = funcParams.pageDataProvider();
|
|
90
75
|
localStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
91
76
|
schema: pageData?.schema,
|
|
92
77
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
@@ -121,19 +106,20 @@ export default (funcParams: funcParamsProps) => {
|
|
|
121
106
|
|
|
122
107
|
},
|
|
123
108
|
onCellRenderer: (cellParams) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
109
|
+
if (eventGroups.onCellRenderer) {
|
|
110
|
+
let finalResponse = {};
|
|
111
|
+
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
112
|
+
for (const eventConfig of eventGroups?.onCellRenderer[path]) {
|
|
113
|
+
executeEventsParameters.store.functionParameters = cellParams
|
|
114
|
+
finalResponse = executeEvents({
|
|
115
|
+
...executeEventsParameters,
|
|
116
|
+
config: eventConfig,
|
|
117
|
+
componentName: path
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
return finalResponse
|
|
134
121
|
}
|
|
135
|
-
|
|
136
|
-
return finalResponse
|
|
122
|
+
return {}
|
|
137
123
|
},
|
|
138
124
|
onClick: function () {
|
|
139
125
|
this.callHandler("onClick")
|
|
@@ -237,7 +223,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
237
223
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
238
224
|
for (const eventConfig of eventGroups?.[eventType]?.[path]) {
|
|
239
225
|
executeEventsParameters.store.functionParameters = functionParameters
|
|
240
|
-
|
|
226
|
+
executeEvents({
|
|
241
227
|
...executeEventsParameters,
|
|
242
228
|
config: eventConfig,
|
|
243
229
|
componentName: path
|