impaktapps-ui-builder 1.0.290 → 1.0.291

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.
@@ -1,4 +1,4 @@
1
- export declare const TableSection: (theme: any) => {
1
+ export declare const TableSection: (theme: any, scopeName?: string) => {
2
2
  type: string;
3
3
  elements: {
4
4
  type: string;
@@ -24,8 +24,6 @@ declare const _default: (funcParams: funcParamsProps) => {
24
24
  onRowMovement: (paginationValues: any) => Promise<any>;
25
25
  onPaginationChange: (paginationValues: any) => Promise<any>;
26
26
  onNodeExpandChange: (param: any) => Promise<any>;
27
- onNodeSearchChange: (param: any) => Promise<any>;
28
- onSearchNodeSelect: (param: any) => Promise<any>;
29
27
  getSelectOptions: (param: any) => Promise<any>;
30
28
  onChange: () => void;
31
29
  callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.290",
3
+ "version": "1.0.291",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -22,27 +22,31 @@ export default (FormData: any) => {
22
22
  if (formData.events) {
23
23
  delete formData.events
24
24
  }
25
+ if (formData.tabLabelElements) {
26
+ component.tabLabelElements = formData.tabLabelElements || [];
27
+ delete formData.tabLabelElements
28
+ }
25
29
  component = { ...formData, ...component };
26
30
  return component;
27
31
  };
28
32
 
29
33
  export const createLayoutFormat = (layout: any[], type?: string) => {
30
34
  if (_.isEmpty(layout)) {
31
- const fullLayoutComponents: string[] = ["WrapperSection", "DataGrid", "LeaderBoard", "PopUp", "TextArea", "TreeMap", "Thought", "HorizontalLayout","Table"]
32
- if(fullLayoutComponents.includes(type)){
35
+ const fullLayoutComponents: string[] = ["WrapperSection", "DataGrid", "LeaderBoard", "PopUp", "TextArea", "TreeMap", "Thought", "HorizontalLayout", "Table"]
36
+ if (fullLayoutComponents.includes(type)) {
33
37
  return { xs: 12, sm: 12, md: 12, lg: 12 }
34
38
  }
35
- else if(type === "Graph"){
36
- return {xs :12,sm:12,md:12,lg:6}
39
+ else if (type === "Graph") {
40
+ return { xs: 12, sm: 12, md: 12, lg: 6 }
37
41
  }
38
- else if(type === "Button"){
42
+ else if (type === "Button") {
39
43
  return { xs: 4, sm: 2.5, md: 2, lg: 1.5 }
40
44
  }
41
- else{
45
+ else {
42
46
  return { xs: 6, sm: 6, md: 4, lg: 3 }
43
47
  }
44
48
  }
45
- let data: any = { };
49
+ let data: any = {};
46
50
 
47
51
  layout.map((e: any) => {
48
52
  data[e.key || "xs"] =
@@ -299,7 +299,6 @@ const buildUiSchema = (config: any, store?: any) => {
299
299
  case "PdfViewer":
300
300
  elements = buildPdfViewer(config, componentScope);
301
301
  break;
302
- break;
303
302
  default:
304
303
  schema = {
305
304
  type: "object",
@@ -408,6 +407,11 @@ const buildUiSchema = (config: any, store?: any) => {
408
407
  });
409
408
  }
410
409
  }
410
+ if (config.tabLabelElements) {
411
+ elements.tabLabelElements = config.tabLabelElements.map((e: any, elemInd: number) => {
412
+ return buildUiSchema(e, store)
413
+ });
414
+ }
411
415
  return elements;
412
416
  }
413
417
 
@@ -1,10 +1,10 @@
1
- export const TableSection = (theme) => {
1
+ export const TableSection = (theme,scopeName="elements") => {
2
2
  const uiSchema = {
3
3
  type: "HorizontalLayout",
4
4
  elements: [
5
5
  {
6
6
  type: "Control",
7
- scope: "#/properties/elements",
7
+ scope: `#/properties/${scopeName}`,
8
8
  options: {
9
9
  widget: "Table",
10
10
  },
@@ -15,8 +15,7 @@ export const TableSection = (theme) => {
15
15
  {
16
16
  widget: {
17
17
  type: "Control",
18
- scope: "#/properties/New_Record",
19
-
18
+ scope: `#/properties/${scopeName}_New_Record`,
20
19
  options: {
21
20
  widget: "IconButton",
22
21
  },
@@ -43,7 +42,7 @@ export const TableSection = (theme) => {
43
42
  {
44
43
  widget: {
45
44
  type: "Control",
46
- scope: "#/properties/Paste_Component",
45
+ scope: scopeName === "elements" ? `#/properties/Paste_Component` : `#/properties/Paste_TabsComponent`,
47
46
  options: {
48
47
  widget: "IconButton",
49
48
  },
@@ -109,7 +108,7 @@ export const TableSection = (theme) => {
109
108
  },
110
109
  {
111
110
  type: "Control",
112
- scope: "#/properties/Copy_Component",
111
+ scope: scopeName === "elements" ? `#/properties/Copy_Component` : `#/properties/Copy_TabsComponent`,
113
112
  options: {
114
113
  widget: "Button",
115
114
  },
@@ -16,7 +16,7 @@ const sectionLabels = {
16
16
  LeaderBoard: ["Core", "Components", "Properties", "Events", "Style",],
17
17
  WrapperSection: ["Core", "Components", "Properties", "Style",],
18
18
  HorizontalLayout: ["Core", "Components", "Properties", "Style",],
19
- TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
19
+ TabSection: ["Core", "Components", "TabTitles", "Properties", "Style", "Validation"],
20
20
  SpeedoMeter: ["Core", "Properties", "Events", "Style",],
21
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
22
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
@@ -40,7 +40,7 @@ const sectionLabels = {
40
40
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
41
41
  PopUp: ["Core", "Components", "Properties", "Events", "Style"],
42
42
  PopOver: ["Core", "Components", "Properties", "Style"],
43
- PdfViewer: ["Core","Properties", "Style"],
43
+ PdfViewer: ["Core", "Properties", "Style"],
44
44
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
45
45
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
46
46
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
@@ -64,6 +64,7 @@ export function refreshPage(type: string, store: any) {
64
64
  Style: StyleSection,
65
65
  Events: EventSection(store.theme.myTheme),
66
66
  Components: TableSection(store.theme.myTheme),
67
+ TabTitles: TableSection(store.theme.myTheme, "tabLabelElements"),
67
68
  Properties: buildPropertiesSection(type),
68
69
  Validation: ValidationSection
69
70
  }
@@ -75,7 +76,7 @@ export function refreshPage(type: string, store: any) {
75
76
  // Get Widget Type of parent
76
77
  const path = store.searchParams?.get("path");
77
78
  const lastDotIndex = path.lastIndexOf('.')
78
- const parentPath = path.slice(0,lastDotIndex)
79
+ const parentPath = path.slice(0, lastDotIndex)
79
80
 
80
81
  const parentObj = _.get(currentConfig, parentPath)
81
82
 
@@ -235,7 +236,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
235
236
  if (sessionStorage.getItem("copiedConfig")) {
236
237
  schema.properties.RemoveItemButton.disabled = false;
237
238
  }
238
-
239
+
239
240
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
240
241
  const path = store.searchParams?.get("path");
241
242
  const id = store.searchParams?.get("id")
@@ -284,8 +285,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
284
285
  const id = store.searchParams?.get("id");
285
286
  saveFormdataInSessionStorage(store.ctx.core.data, path)
286
287
  if (path) {
287
- const path = store.searchParams?.get("path");
288
- const finalPath = `${path}.elements[${rowId}]`
288
+ let finalPath = `${path}`;
289
+ if (dynamicData?.path?.startsWith("tabLabel")) {
290
+ finalPath = `${finalPath}.tabLabelElements[${rowId}]`
291
+ } else {
292
+ finalPath = `${finalPath}.elements[${rowId}]`
293
+ }
289
294
  store.searchParams.set("path", finalPath)
290
295
  store.setSearchParams(store.searchParams)
291
296
  this.setPage()
@@ -296,7 +301,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
296
301
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
297
302
  const path = store.searchParams?.get("path");
298
303
  const rowId = sessionStorage.getItem('rowId');
299
- store.formData.elements.splice(rowId, 1);
304
+ const isTabLabelElements = sessionStorage.getItem('isTabLabelElements') === "true";
305
+ if (isTabLabelElements) {
306
+ store.formData.tabLabelElements.splice(rowId, 1);
307
+ } else {
308
+ store.formData.elements.splice(rowId, 1);
309
+ }
300
310
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
301
311
  const data = path ? _.get(response, path) : response;
302
312
  store.setFormdata(data);
@@ -304,6 +314,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
304
314
  store.updateDialog("popUpComponentSection");
305
315
  }
306
316
  sessionStorage.removeItem('rowId');
317
+ sessionStorage.removeItem('isTabLabelElements');
307
318
  },
308
319
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
309
320
  const path = store.searchParams?.get("path");
@@ -322,9 +333,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
322
333
  if (!Array.isArray(store.formData.elements)) {
323
334
  store.formData.elements = []
324
335
  }
336
+ if (!Array.isArray(store.formData.tabLabelElements)) {
337
+ store.formData.tabLabelElements = []
338
+ }
325
339
  const path = store.searchParams?.get("path");
326
340
  saveFormdataInSessionStorage(store.ctx.core.data, path)
327
- const finalPath = `${path}.elements[${store.formData.elements.length}]`
341
+ let finalPath = `${path}`;
342
+ if (dynamicData.path.startsWith("tabLabel")) {
343
+ finalPath = `${finalPath}.tabLabelElements[${store.formData.tabLabelElements.length}]`
344
+ } else {
345
+ finalPath = `${finalPath}.elements[${store.formData.elements.length}]`
346
+ }
328
347
  store.searchParams.set("path", finalPath)
329
348
  store.setSearchParams(store.searchParams)
330
349
  this.setPage()
@@ -356,6 +375,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
356
375
  deletePopUpComponent: function () {
357
376
  const rowId = dynamicData.path.split(".")[1];
358
377
  sessionStorage.setItem('rowId', rowId);
378
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabel") ? "true" : "false");
359
379
  store.updateDialog("popUpComponentSection");
360
380
  },
361
381
  deletePopUpEvent: function () {
@@ -402,9 +422,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
402
422
  if (!Array.isArray(store.formData.events)) {
403
423
  store.formData.events = []
404
424
  }
425
+ if (!Array.isArray(store.formData.tabLabelElements)) {
426
+ store.formData.tabLabelElements = []
427
+ }
405
428
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
406
429
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
407
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
430
+ const currentLength = {
431
+ "TabsComponent": formData.tabLabelElements.length,
432
+ "Component": formData.elements.length,
433
+ "Events": formData.events.length
434
+ };
435
+ const insertElementIndex = currentLength[elementType] || 0;
408
436
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
409
437
 
410
438
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -441,6 +469,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
441
469
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
442
470
  if (elementType === "Component") {
443
471
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
472
+ }
473
+ if(elementType === "TabsComponent"){
474
+ return `${parentPath}.tabLabelElements[${rowId}]`
444
475
  }
445
476
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
446
477
  },
@@ -202,21 +202,6 @@ export default (funcParams: funcParamsProps) => {
202
202
  const response = await this.callExecuteEvents(param, apiBody, "onLoad");
203
203
  return response?.data;
204
204
  },
205
- onNodeSearchChange: async function (param) {
206
- const apiBody = [
207
- { key: "searchTerm", value: param.searchTerm }
208
- ]
209
- const response = await this.callExecuteEvents(param, apiBody, "onLoad");
210
- return response?.data;
211
- },
212
- onSearchNodeSelect: async function (param) {
213
- const apiBody = [
214
- { key: "selectedNodeId", value: param.selectedNodeId },
215
- { key: "uncollapsedIds", value: param.uncollapsedIds }
216
- ]
217
- const response = await this.callExecuteEvents(param, apiBody, "onLoad");
218
- return response?.data;
219
- },
220
205
  getSelectOptions: async function (param) {
221
206
  if (param.serachValue !== "" && param.serachValue !== undefined) {
222
207
  const apiBody = [