impaktapps-ui-builder 1.0.435 → 1.0.437

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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.435",
3
+ "version": "1.0.437",
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.tabLabelsElements) {
26
+ component.tabLabelsElements = formData.tabLabelsElements || [];
27
+ delete formData.tabLabelsElements
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"] =
@@ -11,15 +11,9 @@ export const buildTable = (config: any, componentScope: string) => {
11
11
  if (config.lazyLoading) {
12
12
  table.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
13
13
  }
14
- if (config.lazyLoadTree) {
15
- table.config.main.lazyTree = config.lazyLoadTree === "YES" ? true : false;
16
- }
17
14
  if (config.defaultColumnSize) {
18
15
  table.config.main.defaultColumnSize = config.defaultColumnSize
19
16
  }
20
- if (config.subRowsExpansionPageSize) {
21
- table.config.main.subRowsExpansionPageSize = config.subRowsExpansionPageSize
22
- }
23
17
  if (config.enableRowMovement) {
24
18
  table.config.main.enableRowMovement = config.enableRowMovement === "YES" ? true : false;
25
19
  }
@@ -36,6 +30,9 @@ export const buildTable = (config: any, componentScope: string) => {
36
30
  if (config.paginateExpandedRows) {
37
31
  table.config.main.paginateExpandedRows = config.paginateExpandedRows === "YES" ? true : false;
38
32
  }
33
+ if (config.treeStructure) {
34
+ table.config.main.treeStructure = config.treeStructure === "YES" ? "flatTreeMap" : false;
35
+ }
39
36
  if (config.SelectionAvailable) {
40
37
  table.config.main.Selection = config.SelectionAvailable === "YES" ? true : false
41
38
  };
@@ -295,7 +295,6 @@ const buildUiSchema = (config: any, store?: any) => {
295
295
  case "PdfViewer":
296
296
  elements = buildPdfViewer(config, componentScope);
297
297
  break;
298
- break;
299
298
  default:
300
299
  schema = {
301
300
  type: "object",
@@ -404,6 +403,11 @@ const buildUiSchema = (config: any, store?: any) => {
404
403
  });
405
404
  }
406
405
  }
406
+ if (config.tabLabelsElements) {
407
+ elements.tabLabelsElements = config.tabLabelsElements.map((e: any, elemInd: number) => {
408
+ return buildUiSchema(e, store)
409
+ });
410
+ }
407
411
  return elements;
408
412
  }
409
413
 
@@ -630,7 +630,7 @@ export const buildPropertiesSection = function (type: String) {
630
630
  getRadioInputField("disableDensityToggle", "Disable Density Toggle", ["YES", "NO"]),
631
631
  getRadioInputField("disableDownloadFile", "Disable Download File", ["YES", "NO"]),
632
632
  getRadioInputField("disablePagination", "Disable Pagination", ["YES", "NO"]),
633
- getInputField("selectKey", "Selection Key"),
633
+ getInputField("selectKey", "Selection Key"),//defaultColumnSize
634
634
  getMultiSelectField("filteringOptions", "Filtering Options"),
635
635
  getSelectField("maxPageSize", "Max Page Size", [
636
636
  { label: "10", value: 10 },
@@ -648,12 +648,11 @@ export const buildPropertiesSection = function (type: String) {
648
648
  buildWrapper("Tree Table Properties", [
649
649
  getRadioInputField("enableRowMovement", "Row Rearrangement", ["YES", "NO"]),
650
650
  getRadioInputField("enableExpanding", "Row Expanding", ["YES", "NO"]),
651
- getRadioInputField("lazyLoadTree", "Lazy Load Tree", ["YES", "NO"]),
652
651
  // getRadioInputField("enableExpandAll", "Use All Row Expanding", ["YES", "NO"]),
653
652
  getRadioInputField("paginateExpandedRows", "Multi Page Expansion", ["YES", "NO"]),
653
+ getRadioInputField("treeStructure", "Flat Tree Structure", ["YES", "NO"]),
654
654
  getRadioInputField("filterFromLeafRows", "Filter from tree rows", ["YES", "NO"]),
655
- getInputField("defaultColumnSize", "Default Column Size"),
656
- getInputField("subRowsExpansionPageSize", "Page Size for Subrows Expansion") , emptyBox("LazyLoadingTableEmpty3")
655
+ getInputField("defaultColumnSize", "Default Column Size"), , emptyBox("LazyLoadingTableEmpty3")
657
656
  ]),
658
657
  getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
659
658
  sizeHolder,
@@ -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", "TabLebelComponet", "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"],
@@ -39,7 +39,7 @@ const sectionLabels = {
39
39
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
40
40
  PopUp: ["Core", "Components", "Properties", "Events", "Style"],
41
41
  PopOver: ["Core", "Components", "Properties", "Style"],
42
- PdfViewer: ["Core","Properties", "Style"],
42
+ PdfViewer: ["Core", "Properties", "Style"],
43
43
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
44
44
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
45
45
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
@@ -63,6 +63,7 @@ export function refreshPage(type: string, store: any) {
63
63
  Style: StyleSection,
64
64
  Events: EventSection(store.theme.myTheme),
65
65
  Components: TableSection(store.theme.myTheme),
66
+ TabLebelComponet: TableSection(store.theme.myTheme, "tabLabelsElements"),
66
67
  Properties: buildPropertiesSection(type),
67
68
  Validation: ValidationSection
68
69
  }
@@ -74,7 +75,7 @@ export function refreshPage(type: string, store: any) {
74
75
  // Get Widget Type of parent
75
76
  const path = store.searchParams?.get("path");
76
77
  const lastDotIndex = path.lastIndexOf('.')
77
- const parentPath = path.slice(0,lastDotIndex)
78
+ const parentPath = path.slice(0, lastDotIndex)
78
79
 
79
80
  const parentObj = _.get(currentConfig, parentPath)
80
81
 
@@ -234,7 +235,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
234
235
  if (sessionStorage.getItem("copiedConfig")) {
235
236
  schema.properties.RemoveItemButton.disabled = false;
236
237
  }
237
-
238
+
238
239
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
239
240
  const path = store.searchParams?.get("path");
240
241
  const id = store.searchParams?.get("id")
@@ -283,8 +284,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
283
284
  const id = store.searchParams?.get("id");
284
285
  saveFormdataInSessionStorage(store.ctx.core.data, path)
285
286
  if (path) {
286
- const path = store.searchParams?.get("path");
287
- const finalPath = `${path}.elements[${rowId}]`
287
+ let finalPath = `${path}`;
288
+ if (dynamicData?.path?.startsWith("tabLabels")) {
289
+ finalPath = `${finalPath}.tabLabelsElements[${rowId}]`
290
+ } else {
291
+ finalPath = `${finalPath}.elements[${rowId}]`
292
+ }
288
293
  store.searchParams.set("path", finalPath)
289
294
  store.setSearchParams(store.searchParams)
290
295
  this.setPage()
@@ -295,7 +300,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
295
300
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
296
301
  const path = store.searchParams?.get("path");
297
302
  const rowId = sessionStorage.getItem('rowId');
298
- store.formData.elements.splice(rowId, 1);
303
+ const isTabLabelElements = sessionStorage.getItem('isTabLabelElements') === "true";
304
+ if (isTabLabelElements) {
305
+ store.formData.tabLabelsElements.splice(rowId, 1);
306
+ } else {
307
+ store.formData.elements.splice(rowId, 1);
308
+ }
299
309
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
300
310
  const data = path ? _.get(response, path) : response;
301
311
  store.setFormdata(data);
@@ -303,6 +313,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
303
313
  store.updateDialog("popUpComponentSection");
304
314
  }
305
315
  sessionStorage.removeItem('rowId');
316
+ sessionStorage.removeItem('isTabLabelElements');
306
317
  },
307
318
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
308
319
  const path = store.searchParams?.get("path");
@@ -321,9 +332,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
321
332
  if (!Array.isArray(store.formData.elements)) {
322
333
  store.formData.elements = []
323
334
  }
335
+ if (!Array.isArray(store.formData.tabLabelsElements)) {
336
+ store.formData.tabLabelsElements = []
337
+ }
324
338
  const path = store.searchParams?.get("path");
325
339
  saveFormdataInSessionStorage(store.ctx.core.data, path)
326
- const finalPath = `${path}.elements[${store.formData.elements.length}]`
340
+ let finalPath = `${path}`;
341
+ if (dynamicData.path.startsWith("tabLabels")) {
342
+ finalPath = `${finalPath}.tabLabelsElements[${store.formData.tabLabelsElements.length}]`
343
+ } else {
344
+ finalPath = `${finalPath}.elements[${store.formData.elements.length}]`
345
+ }
327
346
  store.searchParams.set("path", finalPath)
328
347
  store.setSearchParams(store.searchParams)
329
348
  this.setPage()
@@ -355,6 +374,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
355
374
  deletePopUpComponent: function () {
356
375
  const rowId = dynamicData.path.split(".")[1];
357
376
  sessionStorage.setItem('rowId', rowId);
377
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabels") ? "true" : "false");
358
378
  store.updateDialog("popUpComponentSection");
359
379
  },
360
380
  deletePopUpEvent: function () {
@@ -401,9 +421,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
401
421
  if (!Array.isArray(store.formData.events)) {
402
422
  store.formData.events = []
403
423
  }
424
+ if (!Array.isArray(store.formData.tabLabelsElements)) {
425
+ store.formData.tabLabelsElements = []
426
+ }
404
427
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
405
428
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
406
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
429
+ const currentLength = {
430
+ "TabsComponent": formData.tabLabelsElements.length,
431
+ "Component": formData.elements.length,
432
+ "Events": formData.events.length
433
+ };
434
+ const insertElementIndex = currentLength[elementType] || 0;
407
435
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
408
436
 
409
437
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -440,6 +468,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
440
468
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
441
469
  if (elementType === "Component") {
442
470
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
471
+ }
472
+ if(elementType === "TabsComponent"){
473
+ return `${parentPath}.tabLabelsElements[${rowId}]`
443
474
  }
444
475
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
445
476
  },
@@ -190,10 +190,7 @@ export default (funcParams: funcParamsProps) => {
190
190
  { key: "sorting", value: paginationValues.sorting || [] },
191
191
  { key: "filters", value: paginationValues.tableColumnConfig || [] },
192
192
  { key: "globalFilter", value: paginationValues.globalFilter ?? '' },
193
- { key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] },
194
- { key: "parentId", value: paginationValues.parentId },
195
- { key: "prevRowCount", value: paginationValues.prevRowCount },
196
- { key: "newDataCount", value: paginationValues.newDataCount },
193
+ { key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] }
197
194
  ]
198
195
  const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
199
196
  return response?.data;