impaktapps-ui-builder 0.0.281 → 0.0.282
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 +97 -8
- 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/buildTable.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.d.ts +14 -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/buildTable.ts +36 -8
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +5 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +8 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.ts +14 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +2 -2
- package/src/impaktapps-ui-builder/builder/services/event.ts +2 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +15 -12
- package/src/impaktapps-ui-builder/runtime/services/service.ts +21 -0
|
@@ -11,6 +11,7 @@ interface funcParamsProps {
|
|
|
11
11
|
declare const _default: (funcParams: funcParamsProps) => {
|
|
12
12
|
setPage: () => Promise<void>;
|
|
13
13
|
onClick: () => Promise<void>;
|
|
14
|
+
onPaginationChange: (paginationValues: any) => Promise<void>;
|
|
14
15
|
onChange: () => Promise<void>;
|
|
15
16
|
downloadFile: (obj: any) => void;
|
|
16
17
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,41 @@
|
|
|
1
1
|
import Table from "./uischema/table";
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
import buildUiSchema from "./buildUiSchema";
|
|
4
|
+
import lazyLoadingTable from "./uischema/lazyLoadingTable";
|
|
4
5
|
|
|
5
|
-
export const buildTable = (config:any,componentScope:string)=>{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
export const buildTable = (config: any, componentScope: string) => {
|
|
7
|
+
const table: any = _.cloneDeep(Table);
|
|
8
|
+
table.scope = componentScope;
|
|
9
|
+
if (config.style) {
|
|
10
|
+
table.config.style = JSON.parse(config.style)
|
|
11
|
+
}
|
|
12
|
+
if (config.SelectionAvailable) {
|
|
13
|
+
table.config.main.Selection = config.SelectionAvailable === "YES" ? true : false
|
|
14
|
+
};
|
|
15
|
+
if (config.ColumnResizingAvailable) {
|
|
16
|
+
table.config.main.disableColumnResizing = config.ColumnResizingAvailable === "YES" ? true : false
|
|
17
|
+
};
|
|
18
|
+
if (config.DragAvailable) {
|
|
19
|
+
table.config.main.enableDrag = config.DragAvailable === "YES" ? true : false
|
|
20
|
+
};
|
|
21
|
+
return table;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const buildLazyLoadingTable = (config: any, componentScope: string) => {
|
|
25
|
+
const table: any = _.cloneDeep(lazyLoadingTable);
|
|
26
|
+
table.scope = componentScope;
|
|
27
|
+
if (config.style) {
|
|
28
|
+
table.config.style = JSON.parse(config.style)
|
|
29
|
+
}
|
|
30
|
+
if (config.SelectionAvailable) {
|
|
31
|
+
table.config.main.Selection = config.SelectionAvailable === "YES" ? true : false
|
|
32
|
+
};
|
|
33
|
+
if (config.ColumnResizingAvailable) {
|
|
34
|
+
table.config.main.disableColumnResizing = config.ColumnResizingAvailable === "YES" ? false : true
|
|
35
|
+
};
|
|
36
|
+
if (config.DragAvailable) {
|
|
37
|
+
table.config.main.enableDrag = config.DragAvailable === "YES" ? true : false
|
|
38
|
+
};
|
|
39
|
+
table.config.main.label = config.label;
|
|
40
|
+
return table;
|
|
13
41
|
}
|
|
@@ -14,7 +14,7 @@ import { buildWrapperSection } from "./buildWrapperSection";
|
|
|
14
14
|
import { buildTextField } from "./buildText";
|
|
15
15
|
import { buildSelect } from "./buildSelect";
|
|
16
16
|
import { buildButton } from "./buildButton";
|
|
17
|
-
import { buildTable } from "./buildTable";
|
|
17
|
+
import { buildLazyLoadingTable, buildTable } from "./buildTable";
|
|
18
18
|
import { buildLabel } from "./buildLabel";
|
|
19
19
|
import { buildUploadFile } from "./buildUplaodFile";
|
|
20
20
|
import { buildDownloadFile } from "./buildDownloadFile";
|
|
@@ -144,6 +144,10 @@ const buildUiSchema = (config: any) => {
|
|
|
144
144
|
case "Table":
|
|
145
145
|
elements = buildTable(config, componentScope);
|
|
146
146
|
break;
|
|
147
|
+
|
|
148
|
+
case "LazyLoadingTable" :
|
|
149
|
+
elements = buildLazyLoadingTable(config, componentScope)
|
|
150
|
+
break;
|
|
147
151
|
case "Box":
|
|
148
152
|
elements = buildLabel(config, componentScope);
|
|
149
153
|
break;
|
|
@@ -248,6 +248,14 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
248
248
|
getArrayControl("sectionLabels", "label"),
|
|
249
249
|
]
|
|
250
250
|
}
|
|
251
|
+
else if(type === "Table"||type === "LazyLoadingTable"){
|
|
252
|
+
uiSchema.elements =[
|
|
253
|
+
getRadioInputField("SelectionAvailable","Selection Available",["YES","NO"]),
|
|
254
|
+
getRadioInputField("ColumnResizingAvailable","ColumnResizing Available",["YES","NO"]),
|
|
255
|
+
getRadioInputField("DragAvailable","Drag Available",["YES","NO"]),
|
|
256
|
+
EmptyBox
|
|
257
|
+
]
|
|
258
|
+
}
|
|
251
259
|
else if (type === "Radio") {
|
|
252
260
|
uiSchema.elements = [
|
|
253
261
|
getArrayControl("sectionLabels", "label", "Options Of Radio"),
|
|
@@ -18,6 +18,7 @@ export const CoreSection = {
|
|
|
18
18
|
{ title: "Date", const: "Date" },
|
|
19
19
|
{ title: "CheckBox", const: "CheckBox" },
|
|
20
20
|
{ title: "Table", const: "Table" },
|
|
21
|
+
{ title: "Lazy Loading Table", const: "LazyLoadingTable" },
|
|
21
22
|
{ title: "Array", const: "Array" },
|
|
22
23
|
{ title: "Container", const: "WrapperSection" },
|
|
23
24
|
{ title: "Tabs", const: "TabSection" },
|
|
@@ -106,6 +106,7 @@ export const componentBasicUiSchema: any = {
|
|
|
106
106
|
{ title: "Date", const: "Date" },
|
|
107
107
|
{ title: "CheckBox", const: "CheckBox" },
|
|
108
108
|
{ title: "Table", const: "Table" },
|
|
109
|
+
{ title: "Lazy Loading Table", const: "LazyLoadingTable" },
|
|
109
110
|
{ title: "Array", const: "Array" },
|
|
110
111
|
{ title: "Container", const: "WrapperSection" },
|
|
111
112
|
{ title: "Tabs", const: "TabSection" },
|
|
@@ -9,11 +9,11 @@ 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
|
-
|
|
13
12
|
const sectionLabels = {
|
|
14
13
|
Select: ["Core", "Value", "style", "Event","Validation"],
|
|
15
14
|
MultipleSelect: ["Core", "Value", "style", "Event","Validation"],
|
|
16
|
-
Table: ["Core", "Components",
|
|
15
|
+
Table: ["Core", "Components", "Properties","style", "Event","Validation"],
|
|
16
|
+
LazyLoadingTable:["Core", "Components", "Properties", "style", "Event","Validation"],
|
|
17
17
|
LeaderBoard: ["Core", "Components", "Properties", "style", "Event","Validation"],
|
|
18
18
|
WrapperSection: ["Core", "Components","Properties", "style","Validation"],
|
|
19
19
|
TabSection: ["Core", "Components", "Properties", "style","Validation"],
|
|
@@ -39,6 +39,7 @@ export default (
|
|
|
39
39
|
}
|
|
40
40
|
store.setUiSchema(uiSchema)
|
|
41
41
|
},
|
|
42
|
+
|
|
42
43
|
getFormData: Component(store, dynamicData).getFormdata,
|
|
43
44
|
getUiSchema: async function () {
|
|
44
45
|
return EventUiSchema;
|
|
@@ -54,6 +55,7 @@ export default (
|
|
|
54
55
|
this.refreshPage(store.newData.Handler||store.formdata.Handler,store)
|
|
55
56
|
}
|
|
56
57
|
},
|
|
58
|
+
|
|
57
59
|
saveHandler: Component(store, dynamicData).saveHandler,
|
|
58
60
|
addEvent: async function () {
|
|
59
61
|
const path = store.searchParams?.get("path");
|
|
@@ -161,7 +161,9 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
})
|
|
164
|
-
|
|
164
|
+
}
|
|
165
|
+
else if (eventConfig.type === "LazyLoadingTable") {
|
|
166
|
+
store.setFormdata((pre) => { return { ...pre, [`${componentName}Backend`]: handlerResponse } });
|
|
165
167
|
}
|
|
166
168
|
else if (eventConfig.type === "page") {
|
|
167
169
|
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
@@ -180,15 +182,19 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
|
|
|
180
182
|
const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
|
|
181
183
|
const finalBody = { ...userValue?.payload };
|
|
182
184
|
body.map((elem) => {
|
|
183
|
-
if (elem?.value
|
|
184
|
-
const finalpath = elem.value.substring(11);
|
|
185
|
-
finalBody[elem.key] = _.get(userValue, finalpath);;
|
|
186
|
-
}
|
|
187
|
-
else if (elem?.value?.startsWith("$")) {
|
|
188
|
-
const finalpath = elem.value.substring(1);
|
|
189
|
-
finalBody[elem.key] = _.get(formData, finalpath);;
|
|
190
|
-
} else {
|
|
185
|
+
if (elem?.value !== "string") {
|
|
191
186
|
finalBody[elem.key] = elem.value;
|
|
187
|
+
} else {
|
|
188
|
+
if (elem?.value?.startsWith("$userValue")) {
|
|
189
|
+
const finalpath = elem.value.substring(11);
|
|
190
|
+
finalBody[elem.key] = _.get(userValue, finalpath);;
|
|
191
|
+
}
|
|
192
|
+
else if (elem?.value?.startsWith("$")) {
|
|
193
|
+
const finalpath = elem.value.substring(1);
|
|
194
|
+
finalBody[elem.key] = _.get(formData, finalpath);;
|
|
195
|
+
} else {
|
|
196
|
+
finalBody[elem.key] = elem.value;
|
|
197
|
+
}
|
|
192
198
|
}
|
|
193
199
|
})
|
|
194
200
|
return finalBody;
|
|
@@ -216,9 +222,6 @@ async function shouldEventExecute(config, componentName,
|
|
|
216
222
|
return response
|
|
217
223
|
}
|
|
218
224
|
}
|
|
219
|
-
// if(!response){
|
|
220
|
-
// return {response:undefined,events:undefined};
|
|
221
|
-
// }
|
|
222
225
|
export async function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service) {
|
|
223
226
|
if (compConfig?.headers) {
|
|
224
227
|
headers = buildHeadersFormat(compConfig.headers)
|
|
@@ -75,6 +75,27 @@ export default (funcParams: funcParamsProps) => {
|
|
|
75
75
|
this, eventGroups)
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
|
+
onPaginationChange: async (paginationValues) => {
|
|
79
|
+
for (const eventConfig of eventGroups?.onLoad[paginationValues.path]) {
|
|
80
|
+
;
|
|
81
|
+
const bodyValues = [
|
|
82
|
+
{key: "size",value: paginationValues.pagination.pageSize},
|
|
83
|
+
{key: "start",value: paginationValues.pagination.pageIndex * paginationValues.pagination.pageSize},
|
|
84
|
+
{key:"filters",value: paginationValues.columnFilters || []},
|
|
85
|
+
{key:"globalFilter",value: paginationValues.globalFilter ?? ''}
|
|
86
|
+
]
|
|
87
|
+
if (eventConfig.body) {
|
|
88
|
+
eventConfig.body = [
|
|
89
|
+
...eventConfig.body,
|
|
90
|
+
...bodyValues
|
|
91
|
+
]
|
|
92
|
+
} else { eventConfig.body = bodyValues; };
|
|
93
|
+
await executeEvents(
|
|
94
|
+
eventConfig, paginationValues.path,
|
|
95
|
+
funcParams.store, funcParams.dynamicData, funcParams.userValue, funcParams.service,
|
|
96
|
+
this, eventGroups)
|
|
97
|
+
}
|
|
98
|
+
},
|
|
78
99
|
onChange: async function () {
|
|
79
100
|
if (eventGroups.onChange) {
|
|
80
101
|
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|