impaktapps-ui-builder 0.0.21 → 0.0.22

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.
@@ -147,142 +147,292 @@ const PageMasterUiSchema = {
147
147
  ]
148
148
  },
149
149
  {
150
- type: "WrapperLayout",
150
+ type: "TabLayout",
151
151
  config: {
152
152
  main: {
153
- label: "Page Components",
153
+ tabLabels: ["Components", "events"],
154
154
  divider: true
155
155
  },
156
156
  defaultStyle: true
157
157
  },
158
158
  elements: [
159
159
  {
160
- type: "Control",
161
- scope: "#/properties/elements",
162
- options: {
163
- widget: "Table"
164
- },
160
+ type: "WrapperLayout",
165
161
  config: {
166
162
  main: {
167
- disableAction: true,
168
- disableSelection: true,
169
- enableDrag: true
163
+ divider: true
164
+ },
165
+ wrapperStyle: {
166
+ border: "1px solid gray"
170
167
  }
171
168
  },
172
169
  elements: [
173
170
  {
174
- accessorKey: "name",
175
- header: "Name"
176
- },
177
- {
178
- accessorKey: "type",
179
- header: "Type"
171
+ type: "Control",
172
+ scope: "#/properties/heading",
173
+ options: {
174
+ widget: "Box"
175
+ },
176
+ config: {
177
+ layout: 8,
178
+ main: {
179
+ heading: "Components Table"
180
+ },
181
+ style: {
182
+ fontFamily: "Roboto",
183
+ fontWeight: "500",
184
+ paddingLeft: "-10px",
185
+ fontSize: "20px"
186
+ }
187
+ }
180
188
  },
181
189
  {
182
- header: "Edit",
183
- field: "Reject_Records",
184
- flex: 1,
185
- widget: {
186
- type: "Control",
187
- scope: "#/properties/RejectButton",
188
- options: {
189
- widget: "IconButton"
190
+ type: "Control",
191
+ scope: "#/properties/AddButton",
192
+ options: {
193
+ widget: "IconButton"
194
+ },
195
+ config: {
196
+ layout: 3,
197
+ main: {
198
+ icon: "AddIcon",
199
+ styleDefault: true,
200
+ size: "small",
201
+ onClick: "onAddClickHandler",
202
+ tooltipMessage: "Back"
190
203
  },
191
- config: {
192
- main: {
193
- icon: "EditIcon",
194
- color: "primary",
195
- onClick: "Edit_Components",
196
- tooltipMessage: "Reject This Record"
197
- }
204
+ style: {
205
+ float: "right"
198
206
  }
199
207
  }
200
208
  },
201
209
  {
202
- header: "Delete",
203
- field: "Reject_Records",
204
- flex: 1,
205
- widget: {
206
- type: "Control",
207
- scope: "#/properties/RejectButton",
208
- options: {
209
- widget: "IconButton"
210
+ type: "Control",
211
+ scope: "#/properties/elements",
212
+ options: {
213
+ widget: "Table"
214
+ },
215
+ config: {
216
+ main: {
217
+ disableAction: true,
218
+ disableSelection: true,
219
+ enableDrag: true
220
+ }
221
+ },
222
+ elements: [
223
+ {
224
+ accessorKey: "name",
225
+ header: "Name"
210
226
  },
211
- config: {
212
- main: {
213
- icon: "RejectIcon",
214
- color: "error",
215
- onClick: "Delete_Components",
216
- tooltipMessage: "Reject This Record"
227
+ {
228
+ accessorKey: "type",
229
+ header: "Type"
230
+ },
231
+ {
232
+ header: "Edit",
233
+ field: "Reject_Records",
234
+ flex: 1,
235
+ widget: {
236
+ type: "Control",
237
+ scope: "#/properties/RejectButton",
238
+ options: {
239
+ widget: "IconButton"
240
+ },
241
+ config: {
242
+ main: {
243
+ icon: "EditIcon",
244
+ color: "primary",
245
+ onClick: "Edit_Components",
246
+ tooltipMessage: "Reject This Record"
247
+ }
248
+ }
249
+ }
250
+ },
251
+ {
252
+ header: "Delete",
253
+ field: "Reject_Records",
254
+ flex: 1,
255
+ widget: {
256
+ type: "Control",
257
+ scope: "#/properties/RejectButton",
258
+ options: {
259
+ widget: "IconButton"
260
+ },
261
+ config: {
262
+ main: {
263
+ icon: "RejectIcon",
264
+ color: "error",
265
+ onClick: "Delete_Components",
266
+ tooltipMessage: "Reject This Record"
267
+ }
268
+ }
217
269
  }
218
270
  }
219
- }
271
+ ]
220
272
  }
221
273
  ]
222
274
  },
223
275
  {
224
- type: "Control",
225
- scope: "#/properties/btn",
226
- options: {
227
- widget: "EmptyBox"
228
- },
229
- config: {
230
- layout: { xs: 0, sm: 0, md: 8, lg: 7 }
231
- }
232
- },
233
- {
234
- type: "Control",
235
- scope: "#/properties/btn",
236
- options: {
237
- widget: "Button"
238
- },
276
+ type: "WrapperLayout",
239
277
  config: {
240
- layout: { xs: 12, sm: 12, md: 3, lg: 2.5 },
241
278
  main: {
242
- name: "Submit Page",
243
- startIcon: "ApproveIcon",
244
- variant: "contained",
245
- color: "info",
246
- type: "text",
247
- onClick: "submitPageHandler",
248
- size: "small"
279
+ divider: true
249
280
  },
250
- style: {
251
- marginBottom: "8px"
281
+ wrapperStyle: {
282
+ border: "1px solid gray"
252
283
  }
253
- }
254
- },
255
- {
256
- type: "Control",
257
- scope: "#/properties/btn",
258
- options: {
259
- widget: "Button"
260
284
  },
261
- config: {
262
- layout: { xs: 12, sm: 12, md: 2, lg: 1.5 },
263
- main: {
264
- name: "Add",
265
- startIcon: "ApproveIcon",
266
- variant: "contained",
267
- color: "info",
268
- type: "text",
269
- onClick: "onAddClickHandler",
270
- size: "small"
285
+ elements: [
286
+ {
287
+ type: "Control",
288
+ scope: "#/properties/heading",
289
+ options: {
290
+ widget: "Box"
291
+ },
292
+ config: {
293
+ layout: 8,
294
+ main: {
295
+ heading: "Event Table"
296
+ },
297
+ style: {
298
+ fontFamily: "Roboto",
299
+ fontWeight: "500",
300
+ paddingLeft: "-10px",
301
+ fontSize: "20px"
302
+ }
303
+ }
271
304
  },
272
- style: {
273
- marginBottom: "8px"
305
+ {
306
+ type: "Control",
307
+ scope: "#/properties/AddButton",
308
+ options: {
309
+ widget: "IconButton"
310
+ },
311
+ config: {
312
+ layout: 3,
313
+ main: {
314
+ icon: "AddIcon",
315
+ styleDefault: true,
316
+ size: "small",
317
+ onClick: "eventAddHandler",
318
+ tooltipMessage: "Back"
319
+ },
320
+ style: {
321
+ float: "right"
322
+ }
323
+ }
324
+ },
325
+ {
326
+ type: "Control",
327
+ scope: "#/properties/events",
328
+ options: {
329
+ widget: "Table"
330
+ },
331
+ config: {
332
+ main: {
333
+ disableAction: true,
334
+ disableSelection: true,
335
+ enableDrag: true
336
+ }
337
+ },
338
+ elements: [
339
+ {
340
+ accessorKey: "eventType",
341
+ header: "Event Type"
342
+ },
343
+ {
344
+ accessorKey: "Handler",
345
+ header: "Handler"
346
+ },
347
+ {
348
+ accessorKey: "Edit_Approve_Records",
349
+ header: "Edit Widget",
350
+ widget: {
351
+ type: "Control",
352
+ scope: "#/properties/Edit_Records",
353
+ options: {
354
+ widget: "IconButton"
355
+ },
356
+ config: {
357
+ main: {
358
+ color: "info",
359
+ size: "small",
360
+ icon: "EditIcon",
361
+ tooltipMessage: "Edit This Record",
362
+ onClick: "editEvent"
363
+ },
364
+ style: {
365
+ color: "#3949ab"
366
+ }
367
+ }
368
+ }
369
+ },
370
+ {
371
+ accessorKey: "Reject_Records",
372
+ header: "Delete",
373
+ widget: {
374
+ type: "Control",
375
+ scope: "#/properties/RejectButton",
376
+ options: {
377
+ widget: "IconButton"
378
+ },
379
+ config: {
380
+ main: {
381
+ icon: "RejectIcon",
382
+ color: "error",
383
+ tooltipMessage: "Reject This Record",
384
+ onClick: "deleteEvent"
385
+ }
386
+ }
387
+ }
388
+ }
389
+ ]
274
390
  }
275
- }
276
- },
277
- {
278
- type: "Control",
279
- scope: "#/properties/notify",
280
- options: {
281
- widget: "Notify"
282
- },
283
- layout: 6
391
+ ]
284
392
  }
285
393
  ]
394
+ },
395
+ {
396
+ type: "Control",
397
+ scope: "#/properties/btn",
398
+ options: {
399
+ widget: "EmptyBox"
400
+ },
401
+ config: {
402
+ layout: { xs: 0, sm: 0, md: 8, lg: 7 }
403
+ }
404
+ },
405
+ {
406
+ type: "Control",
407
+ scope: "#/properties/btn",
408
+ options: {
409
+ widget: "Button"
410
+ },
411
+ config: {
412
+ layout: 11.7,
413
+ main: {
414
+ name: "Submit Page",
415
+ startIcon: "ApproveIcon",
416
+ variant: "contained",
417
+ color: "info",
418
+ type: "text",
419
+ onClick: "submitPageHandler",
420
+ size: "small"
421
+ },
422
+ style: {
423
+ marginBottom: "8px",
424
+ width: { xs: "100%", sm: "100%", md: "25%", lg: "20%" },
425
+ float: "right"
426
+ }
427
+ }
428
+ },
429
+ {
430
+ type: "Control",
431
+ scope: "#/properties/notify",
432
+ options: {
433
+ widget: "Notify"
434
+ },
435
+ layout: 6
286
436
  }
287
437
  ]
288
438
  };
@@ -7030,7 +7180,31 @@ var pageMaster = (funcParams) => {
7030
7180
  });
7031
7181
  },
7032
7182
  Edit_Components: Component(store2, dynamicData2).editComponents,
7033
- Delete_Components: Component(store2, dynamicData2).deleteComponents
7183
+ Delete_Components: Component(store2, dynamicData2).deleteComponents,
7184
+ eventAddHandler: async function() {
7185
+ var _a;
7186
+ const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
7187
+ if (!Array.isArray(store2.formData.events)) {
7188
+ store2.formData.events = [];
7189
+ }
7190
+ saveFormdataInLocalStorage(store2.formData);
7191
+ const finalPath = `events[${store2.formData.events.length}]`;
7192
+ store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7193
+ },
7194
+ editEvent: async function() {
7195
+ var _a;
7196
+ const rowId = dynamicData2.path.split(".")[1];
7197
+ const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
7198
+ saveFormdataInLocalStorage(store2.formData);
7199
+ const finalPath = `events[${rowId}]`;
7200
+ store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7201
+ },
7202
+ deleteEvent: async function() {
7203
+ const rowId = dynamicData2.path.split(".")[1];
7204
+ store2.formData.events.splice(rowId, 1);
7205
+ const response = saveFormdataInLocalStorage(store2.formData);
7206
+ store2.setFormdata(response);
7207
+ }
7034
7208
  };
7035
7209
  };
7036
7210
  const EventSchema = {
@@ -7771,6 +7945,10 @@ async function mergeFormdata(handlerResponse, componentName2, eventConfig, store
7771
7945
  handlerResponse && store2.setFormdata((pre) => {
7772
7946
  return { ...pre, [componentName2]: { rows: handlerResponse.data } };
7773
7947
  });
7948
+ } else if (eventConfig.type === "page") {
7949
+ store2.setFormdata((pre) => {
7950
+ return { ...pre, ...handlerResponse.data };
7951
+ });
7774
7952
  } else {
7775
7953
  handlerResponse && store2.setFormdata((pre) => {
7776
7954
  return { ...pre, [componentName2]: handlerResponse.data };
@@ -7863,6 +8041,7 @@ const extractEvents = (eventConfig) => {
7863
8041
  var service = (funcParams) => {
7864
8042
  return {
7865
8043
  setPage: async function() {
8044
+ eventGroups = {};
7866
8045
  eventGroups = extractEvents(funcParams.config);
7867
8046
  await executeEvents(
7868
8047
  { Handler: "refresh", eventType: "onPageRefresh" },