impaktapps-ui-builder 0.0.382-alpha.62 → 0.0.382-alpha.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.382-alpha.62",
3
+ "version": "0.0.382-alpha.63",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -277,250 +277,107 @@ export const componentBasicUiSchema: any = (theme) => {
277
277
  {
278
278
  type: "HorizontalLayout",
279
279
  config: {
280
- layout: 12,
281
- style: {
282
- position: "absolute",
283
- bottom: 5,
284
- overflow: 'hidden'
285
- }
280
+ main: {
281
+ direction: 'row'
282
+ },
283
+ style: {
284
+ flexDirection: "row",
285
+ position: "absolute",
286
+ bottom: 0,
287
+ marginBottom: '-8px',
288
+ height: 'fit-content',
289
+ overflow: 'hidden',
290
+ zIndex: 1000,
291
+ width: 'inherit'
292
+ }
286
293
  },
287
294
  elements: [
288
- {
289
-
290
- type: "Control",
291
- scope: "#/properties/FooterText",
292
- options: {
293
- widget: "Box",
294
- },
295
- config: {
296
- layout: 9.5,
297
- main: {
298
- heading: "Copywriter@ACT21.IO"
299
- },
300
- style: {
301
- color: theme?.palette?.text.disabled || "#AFAFAF",
302
- fontSize: '12px',
303
- textAlign: 'center'
304
- }
305
- },
295
+ {
296
+
297
+ type: "Control",
298
+ scope: "#/properties/FooterText",
299
+ options: {
300
+ widget: "Box",
306
301
  },
307
- {
308
- type: "HorizontalLayout",
309
- config: {
310
- layout: 2.5,
311
- style: {
312
- }
313
- },
314
- elements: [
315
- {
316
- type: "Control",
317
- scope: "#/properties/EmptyBox",
318
- options: {
319
- widget: "EmptyBox",
320
- },
321
- config: {
322
- layout: 6,
323
- style: {
324
- flexGrow: 1
325
- }
326
- },
327
- },
328
- {
329
- type: "Control",
330
- scope: "#/properties/backIcon",
331
- options: {
332
- widget: "Box",
333
- },
334
- config: {
335
- layout: 1,
336
- main: {
337
- iconName: 'PrevIcon',
338
- onClick: "backHandler"
339
- },
340
- style: {
341
- fill: theme.palette.primary.main,
342
- width: 20,
343
- height: 20,
344
- display: 'flex',
345
- alignItems: 'center',
346
- justifyContent: 'center',
347
- marginRight: '-8px',
348
- cursor: 'pointer',
349
- ':hover': {
350
- fill: theme.palette.primary.dark,
351
- }
352
- }
353
- }
354
- },
355
- {
356
- type: "Control",
357
- scope: "#/properties/text",
358
-
359
- options: {
360
- widget: "Box",
361
- },
362
- config: {
363
- layout: 5,
364
- main: {
365
- heading: "Previous Page",
366
- onClick: "backHandler"
367
- },
368
- style: {
369
- width: 'fit-content',
370
- color: theme.palette.primary.main,
371
- fontSize: "12px",
372
- cursor: 'pointer',
373
- marginLeft: '2px',
374
- marginRight: 0,
375
- ':hover': {
376
- color: theme.palette.primary.dark,
377
- }
378
- }
379
- },
380
- },
381
- ],
302
+ config: {
303
+ main: {
304
+ heading: "Copywriter@ACT21.IO"
305
+ },
306
+ style: {
307
+ color: theme?.palette?.text.disabled || "#AFAFAF",
308
+ fontSize: '12px',
309
+ textAlign: 'center',
310
+ lineHeight: 1,
311
+ width: 'fit-content',
312
+ left: '50%',
313
+ position: 'relative',
314
+ margin: 0,
315
+ flexGrow: 1,
316
+ height: 0
317
+ }
382
318
  },
383
- ]
384
- }
385
- // {
386
- // type: "HorizontalLayout",
387
- // config: {
388
- // style: {
389
- // position: "fixed",
390
- // bottom: 5,
391
- // overflow: 'visible',
392
- // margin: "0",
393
- // width: "100vw",
394
- // }
395
- // },
396
- // elements: [
397
- // {
398
- // type: "Control",
399
- // scope: "#/properties/EmptyBox",
400
- // options: {
401
- // widget: "EmptyBox",
402
- // },
403
- // config: {
404
- // layout: { xs: 0, sm: 4, md: 4, lg: 4 },
405
- // },
406
- // },
407
- // {
408
-
409
- // type: "Control",
410
- // scope: "#/properties/FooterText",
411
- // options: {
412
- // widget: "Box",
413
- // },
414
- // config: {
415
- // layout: { xs: 11, sm: 4, md: 4, lg: 4 },
416
- // main: {
417
- // heading: "Copywriter@ACT21.IO"
418
- // },
419
- // style: {
420
- // color: theme?.palette?.text.disabled || "#AFAFAF",
421
- // fontSize: '12px',
422
- // }
423
- // },
424
- // },
425
- // {
426
- // type: "HorizontalLayout",
427
- // config: {
428
- // layout: { xs: 11, sm: 4, md: 4, lg: 4 },
429
- // },
430
- // elements: [
431
- // {
432
- // type: "Control",
433
- // scope: "#/properties/EmptyBox",
434
- // options: {
435
- // widget: "EmptyBox",
436
- // },
437
- // config: {
438
- // layout: 2,
439
- // },
440
- // },
441
- // {
442
- // type: "Control",
443
- // scope: "#/properties/backIcon",
444
- // options: {
445
- // widget: "Box",
446
- // },
447
- // config: {
448
- // layout: 1,
449
- // main: {
450
- // iconName: 'PrevIcon',
451
- // onClick: "backHandler"
452
- // },
453
- // style: {
454
- // fill: theme.palette.primary.dark,
455
- // width: 20,
456
- // height: 20,
457
- // display: 'flex',
458
- // alignItems: 'center',
459
- // justifyContent: 'center',
460
- // marginRight: '-8px',
461
- // cursor: 'pointer'
462
- // }
463
- // }
464
- // },
465
- // {
466
- // type: "Control",
467
- // scope: "#/properties/text",
468
-
469
- // options: {
470
- // widget: "Box",
471
- // },
472
- // config: {
473
- // layout: 9,
474
- // main: {
475
- // heading: "Previous Page",
476
- // onClick: "backHandler"
477
- // },
478
- // style: {
479
- // color: theme.palette.primary.dark,
480
- // fontSize: "12px",
481
- // cursor: 'pointer',
482
- // marginLeft: '-6px'
483
- // }
484
- // },
485
- // },
486
- // ],
487
- // },
488
- // // {
489
- // // type: "Control",
490
- // // scope: "#/properties/pageName",
319
+ },
320
+ {
321
+ type: "Control",
322
+ scope: "#/properties/backIcon",
323
+ options: {
324
+ widget: "Box",
325
+ },
326
+ config: {
327
+ main: {
328
+ iconName: 'PrevIcon',
329
+ onClick: "backHandler",
330
+ width: 'fit-content',
331
+ },
332
+ style: {
333
+ fill: theme.palette.primary.main,
334
+ width: 20,
335
+ height: 0,
336
+ margin: 0,
337
+ top: 0,
338
+ right: '90px',
339
+ position: 'absolute',
340
+ fontSize: '12px',
341
+ cursor: 'pointer',
342
+ ':hover': {
343
+ fill: theme.palette.primary.dark,
344
+ }
345
+ }
346
+ }
347
+ },
348
+ {
349
+ type: "Control",
350
+ scope: "#/properties/text",
491
351
 
492
- // // options: {
493
- // // widget: "Box",
494
- // // },
495
- // // config: {
496
- // // layout: 9.7,
497
- // // main: {
498
- // // heading: " ",
499
- // // },
500
- // // style: {
501
- // // color: theme.palette.text.disabled,
502
- // // // float: 'right',
503
- // // textAlign: 'right',
504
- // // // width: 'fit-content',
505
- // // fontSize: "12px",
506
- // // marginTop: '-16px',
507
- // // // marginRight: '100px'
508
- // // // marginLeft: '-6px'
509
- // // }
510
- // // },
511
- // // },
512
- // // {
513
- // // type: "Control",
514
- // // scope: "#/properties/emptyBox",
515
- // // options: {
516
- // // widget: "EmptyBox",
517
- // // },
518
- // // config: {
519
- // // layout: 2.3
520
- // // }
521
- // // },
522
- // ]
523
- // }
352
+ options: {
353
+ widget: "Box",
354
+ },
355
+ config: {
356
+ main: {
357
+ heading: "Previous Page",
358
+ onClick: "backHandler"
359
+ },
360
+ style: {
361
+ textAlign: 'left',
362
+ lineHeight: 1,
363
+ height: 0,
364
+ width: 'fit-content',
365
+ color: theme.palette.primary.main,
366
+ fontSize: "12px",
367
+ cursor: 'pointer',
368
+ marginLeft: '2px',
369
+ marginRight: 0,
370
+ top: 3,
371
+ right: '20px',
372
+ position: 'absolute',
373
+ ':hover': {
374
+ color: theme.palette.primary.dark,
375
+ }
376
+ }
377
+ },
378
+ },
379
+ ]
380
+ }
524
381
  ],
525
382
  };
526
383
  return uiSchema
@@ -1,242 +1,3 @@
1
- // import _, { cloneDeep } from "lodash";
2
- // import { handlersProps } from "./interface";
3
-
4
-
5
- // export const executeEvents = async (
6
- // params: handlersProps
7
- // ) => {
8
- // let nextEvent = [];
9
- // let finalResponse = null;
10
- // try {
11
- // const shouldExecute = await shouldEventExecute(params)
12
- // if (!shouldExecute) {
13
- // return { response: undefined, events: undefined };
14
- // }
15
- // const response = await executeEventsHandler(params)
16
- // finalResponse = response;
17
- // const SuccessEvent = params.config?.events.filter(e => e.eventType === "Success");
18
- // nextEvent = SuccessEvent;
19
- // } catch (err) {
20
- // const FailEvent = params.config?.events?.filter(e => e.eventType === "Fail")
21
- // const setEvent = FailEvent?.length > 0 ? FailEvent : []
22
- // nextEvent = setEvent;
23
- // }
24
- // if (nextEvent?.length > 0) {
25
- // for (const actionConfig of nextEvent) {
26
- // await executeEvents({ ...params, config: actionConfig, parentEventOutput: finalResponse })
27
- // }
28
- // }
29
- // return finalResponse;
30
- // }
31
-
32
- // async function executeEventsHandler(params: handlersProps) {
33
- // if (params.config.Handler === "api") {
34
- // return await executeApiEventHandler(params)
35
- // }
36
- // else if (params.config.Handler === "inBuiltFunction") {
37
- // return await executeInBuiltFunctionHandler(params)
38
- // }
39
- // else if (params.config.Handler === "custom") {
40
- // return await executeCustomHandler(params)
41
- // }
42
- // else if (params.config.Handler === "refresh") {
43
- // return await executeRefreshHandler(params)
44
- // }
45
- // else if (params.config.Handler === "mergeFormdata") {
46
- // const result = await mergeFormdata(
47
- // params.parentEventOutput, params.componentName, params.config, params.store, params.service)
48
- // return result;
49
- // }
50
- // else if (params.config.Handler === "onBackHandler") {
51
- // return params.store.functionParameters?.handleBack()
52
- // }
53
- // else if (params.config.Handler === "onNextHandler") {
54
- // return params.store.functionParameters?.handleNext()
55
- // }
56
- // else if (params.config.Handler === "onResetHandler") {
57
- // return params.store.functionParameters?.handleReset()
58
- // }
59
- // }
60
- // export async function executeRefreshHandler(params: handlersProps) {
61
- // const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups)
62
- // for (const componentName of compToRefresh) {
63
- // for (const compEventConfig of params.eventGroups.onLoad[componentName]) {
64
- // await executeEvents({ ...params, config: compEventConfig, componentName });
65
- // }
66
- // }
67
- // }
68
- // async function executeApiEventHandler(params: handlersProps) {
69
- // const initialBody = { ...params.userValue?.payload };
70
- // const initialHeaders = {
71
- // "X-Requested-With": "XMLHttpRequest",
72
- // "Access-Control-Allow-Origin": "*"
73
- // };
74
- // const { body, headers } = await buildApiPayload(params.config, initialBody, initialHeaders, params.store, params.dynamicData, params.userValue, params.service)
75
-
76
- // const response = await params.service[params.config.method](
77
- // params.config.path,
78
- // body,
79
- // headers && { headers: headers }
80
- // );
81
- // return response;
82
- // }
83
-
84
- // async function executeInBuiltFunctionHandler(params: handlersProps) {
85
- // let parameter = {};
86
- // if (params.config.funcParametersCode) {
87
- // const makeFunc = eval(params.config.funcParametersCode)
88
- // parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
89
- // }
90
- // params.serviceHolder[params.config.inBuiltFunctionType](parameter)
91
- // }
92
-
93
- // async function executeCustomHandler(params: handlersProps) {
94
- // const makeFunc = eval(params.config.eventCode)
95
- // const response = await makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.componentName);
96
- // return response;
97
- // }
98
-
99
- // async function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
100
- // if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
101
- // store.setSchema((pre) => {
102
- // return {
103
- // ...pre, properties: {
104
- // ...pre.properties, [componentName]: {
105
- // ...pre.properties?.[componentName],
106
- // oneOf: handlerResponse.data
107
- // }
108
- // }
109
- // }
110
- // })
111
- // }
112
- // else if (eventConfig.type === "MultipleSelect" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
113
- // store.setSchema((pre) => {
114
- // return {
115
- // ...pre, properties: {
116
- // ...pre.properties, [componentName]: {
117
- // ...pre.properties?.[componentName],
118
- // type: "array",
119
- // items: {
120
- // oneOf: handlerResponse?.data
121
- // }
122
- // }
123
- // }
124
- // }
125
- // })
126
- // }
127
- // else if (eventConfig.type === "page") {
128
- // if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
129
- // store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
130
- // }
131
- // }
132
- // else {
133
- // if (handlerResponse) {
134
- // store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data } });
135
- // const demoData = await asyncOperation();
136
- // }
137
- // }
138
- // }
139
-
140
- // const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
141
- // const finalBody = { ...userValue?.payload };
142
- // body.map((elem) => {
143
- // if (typeof elem?.value !== "string") {
144
- // finalBody[elem.key] = elem.value;
145
- // } else {
146
- // if (elem?.value?.startsWith("$userValue")) {
147
- // const finalpath = elem.value.substring(11);
148
- // finalBody[elem.key] = _.get(userValue, finalpath);;
149
- // }
150
- // else if (elem?.value?.startsWith("$")) {
151
- // const finalpath = elem.value.substring(1);
152
- // finalBody[elem.key] = _.get(formData, finalpath);;
153
- // } else {
154
- // finalBody[elem.key] = elem.value;
155
- // }
156
- // }
157
- // })
158
- // return finalBody;
159
- // }
160
-
161
- // const buildHeadersFormat = (headers: any[]) => {
162
- // const headerObj = {
163
- // // "Content-Type": "application/json",
164
- // "X-Requested-With": "XMLHttpRequest"
165
- // }
166
- // headers.map((elem) => {
167
- // headerObj[elem.key] = elem.value;
168
- // })
169
- // return headerObj;
170
- // }
171
-
172
- // async function shouldEventExecute(params: handlersProps) {
173
- // const startEvent = params.config?.events?.filter(e => e.eventType === "onStart");
174
- // if (startEvent?.length > 0) {
175
- // const response = await executeEventsHandler({ ...params, config: startEvent[0] });
176
- // return response;
177
- // } else {
178
- // return true
179
- // }
180
- // }
181
-
182
- // export async function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service) {
183
- // if (compConfig?.headers) {
184
- // headers = buildHeadersFormat(compConfig.headers)
185
-
186
- // }
187
- // if (compConfig.body) {
188
- // body = { ...buildBodyFormat(compConfig.body, store.newData || store?.ctx?.core?.data || store.formData, userValue) };
189
- // }
190
- // if (compConfig.apiBody) {
191
- // const makeFunc = eval(compConfig.apiBody);
192
- // const data = await makeFunc(store, dynamicData, userValue, body);
193
- // body = data
194
- // }
195
- // return { body, headers };
196
- // }
197
-
198
- // export function getRefreshElements(eventConfig: any, eventGropus: any) {
199
- // let result: string[] = [];
200
- // if (eventConfig?.refreshElements?.length > 0) {
201
- // result = eventConfig.refreshElements.map((e) => {
202
- // return e.value
203
- // })
204
-
205
- // } else {
206
- // if (eventGropus?.onLoad) {
207
- // result = Object.keys(eventGropus?.onLoad)
208
- // result.push(result[0]);
209
- // }
210
- // }
211
- // console.log(result);
212
- // return result;
213
- // }
214
-
215
-
216
- // function asyncOperation() {
217
- // return new Promise((resolve, reject) => {
218
- // setTimeout(() => {
219
- // const success = true;
220
- // if (success) {
221
- // resolve("Operation completed successfully!");
222
- // reject(new Error("Operation failed!"));
223
- // }
224
- // }, 50);
225
- // });
226
- // }
227
-
228
-
229
-
230
-
231
-
232
-
233
-
234
-
235
-
236
-
237
-
238
-
239
-
240
1
  import _, { cloneDeep } from "lodash";
241
2
  import { handlersProps } from "./interface";
242
3
 
@@ -1,15 +1,3 @@
1
- // export interface handlersProps {
2
- // config: any,
3
- // componentName: string,
4
- // store: any,
5
- // dynamicData: any,
6
- // userValue: any,
7
- // service: any,
8
- // serviceHolder: any,
9
- // eventGroups?: any,
10
- // parentEventOutput?: any
11
- // }
12
-
13
1
  export interface handlersProps {
14
2
  config: any,
15
3
  componentName: string,