impaktapps-ui-builder 1.0.482 → 1.0.484

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.482",
3
+ "version": "1.0.484",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -37,6 +37,9 @@ const buildAreaGraph = (config:any,componentScope:string) => {
37
37
  if(config.yAxisTickCount){
38
38
  AreaGraph.config.main.yAxisTickCount = config.yAxisTickCount
39
39
  }
40
+ if(config.xAxisTickCount){
41
+ AreaGraph.config.main.xAxisTickCount = config.xAxisTickCount
42
+ }
40
43
  if (config.xAxisValue) {
41
44
  AreaGraph.config.main.xAxisValue = config.xAxisValue;
42
45
  }
@@ -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"] =
@@ -34,6 +34,9 @@ const buildStackBarLineGraph = (config:any,componentScope:string) => {
34
34
  if(config.yAxisTickCount){
35
35
  StackBarLineGraph.config.main.yAxisTickCount = config.yAxisTickCount
36
36
  }
37
+ if(config.xAxisTickCount){
38
+ StackBarLineGraph.config.main.xAxisTickCount = config.xAxisTickCount
39
+ }
37
40
  if (config.xAxisValue) {
38
41
  StackBarLineGraph.config.main.xAxisValue = config.xAxisValue;
39
42
  }
@@ -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.tabLabelElements) {
407
+ elements.tabLabelElements = config.tabLabelElements.map((e: any, elemInd: number) => {
408
+ return buildUiSchema(e, store)
409
+ });
410
+ }
407
411
  return elements;
408
412
  }
409
413
 
@@ -519,7 +519,7 @@ export const buildPropertiesSection = function (type: String) {
519
519
  { label: "Negative", value: "negative" }
520
520
  ]),
521
521
  getInputField("color", "Card Color"),
522
- emptyBox("MetricEmpty1", { xs: 6, sm: 0, md: 8, lg: 6 }),
522
+ emptyBox("MetricEmpty1", { xs: 6, sm: 6, md: 4, lg: 3 }),
523
523
  ];
524
524
  break;
525
525
  case "Button":
@@ -581,13 +581,13 @@ export const buildPropertiesSection = function (type: String) {
581
581
  getRadioInputField("bottomAxisAngle", "Bottom Axis Angled", ["YES", "No"]),
582
582
  getInputField("leftMargin", "Left Margin"),
583
583
  getInputField("yAxisTickCount", "Y Axis TickCount"),
584
+ getInputField("xAxisTickCount", "X Axis TickCount"),
584
585
  getSelectField("xAxisFormatType", "X Axis Format Type", [
585
586
  { label: "Date and Month", value: "Date and Month" },
586
587
  { label: "Month and Year", value: "Month and Year" }
587
588
  ]),
588
589
  getInputField("growthRateKey", "Growth Rate Key"),
589
590
  getInputField("tooltipUnit", "Tooltip Unit"),
590
- emptyBox("GraphEmpty1", { xs: 6, sm: 6, md: 4, lg: 3 }),
591
591
  getArrayControlMultiField("legendLabels", "key", "value", "Key", "Label", "Configure Bar Labels"),
592
592
  getArrayControlMultiField("pieArcColors", "key", "value", "Key", "Color", "Configure Bar Colors"),
593
593
  ];
@@ -689,7 +689,7 @@ export const buildPropertiesSection = function (type: String) {
689
689
  { label: "Right", value: "right" },
690
690
  { label: "Bottom", value: "bottom" }
691
691
  ]),
692
- getRadioInputField("grouping", "grouping", ["YES", "NO"]),
692
+ getRadioInputField("grouping", "Grouping", ["YES", "NO"]),
693
693
  emptyBox("SelectEmpty", { xs: 0, sm: 0, md: 4, lg: 6 })
694
694
  ]
695
695
  break;
@@ -708,7 +708,7 @@ export const buildPropertiesSection = function (type: String) {
708
708
  { label: "Right", value: "right" },
709
709
  { label: "Bottom", value: "bottom" }
710
710
  ]),
711
- getRadioInputField("grouping", "grouping", ["YES", "NO"]),
711
+ getRadioInputField("grouping", "Grouping", ["YES", "NO"]),
712
712
  emptyBox("MultipleSelectEmpty", { xs: 6, sm: 6, md: 8, lg: 9 })
713
713
  ]
714
714
  break;
@@ -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
  },
@@ -49,7 +49,7 @@ export const ComponentSchema: any = {
49
49
  { title: "Upload", const: "UploadFile" },
50
50
  { title: "Tree ", const: "TreeMap" },
51
51
  { title: "Thought of the day", const: "Thought" },
52
- { title: "PDF", const: "PdfViewer"}
52
+ { title: "PDF", const: "PdfViewer" }
53
53
  ],
54
54
  },
55
55
  elementType: {
@@ -103,35 +103,35 @@ export const ComponentSchema: any = {
103
103
  { title: "Standard", const: "standard" },
104
104
  ],
105
105
  },
106
- positionVertical:{
106
+ positionVertical: {
107
107
  oneOf: [
108
108
  { title: "Top", const: "top" },
109
109
  { title: "Center", const: "center" },
110
110
  { title: "Bottom", const: "bottom" }
111
111
  ],
112
112
  },
113
- positionHorizontal:{
113
+ positionHorizontal: {
114
114
  oneOf: [
115
115
  { title: "Left", const: "left" },
116
116
  { title: "Center", const: "center" },
117
117
  { title: "Right", const: "right" }
118
118
  ],
119
119
  },
120
- contentVertical:{
120
+ contentVertical: {
121
121
  oneOf: [
122
122
  { title: "Top", const: "top" },
123
123
  { title: "Center", const: "center" },
124
124
  { title: "Bottom", const: "bottom" }
125
125
  ],
126
126
  },
127
- contentHorizontal:{
127
+ contentHorizontal: {
128
128
  oneOf: [
129
129
  { title: "Left", const: "left" },
130
130
  { title: "Center", const: "center" },
131
131
  { title: "Right", const: "right" }
132
132
  ],
133
133
  },
134
- toolTipPosition:{
134
+ toolTipPosition: {
135
135
  oneOf: [
136
136
  { title: "Top", const: "top" },
137
137
  { title: "Left", const: "left" },
@@ -495,6 +495,11 @@ export const ComponentSchema: any = {
495
495
  { title: "Detail Icon", const: "DetailIcon" },
496
496
  { title: "Report View Icon", const: "ReportViewIcon" },
497
497
  { title: "Payout", const: "Payout" },
498
+ { title: "Info Outlined", const: "InfoOutlinedIcon" },
499
+ { title: "Territory Add", const: "TerritoryAdd" },
500
+ { title: "Territory Edit", const: "TerritoryEdit" },
501
+ { title: "Territory Delete", const: "TerritoryDelete" },
502
+ { title: "Git Compare", const: "GitCompare" },
498
503
  ],
499
504
  },
500
505
  color: {
@@ -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"],
@@ -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
+ TabTitles: TableSection(store.theme.myTheme, "tabLabelElements"),
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("tabLabel")) {
289
+ finalPath = `${finalPath}.tabLabelElements[${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.tabLabelElements.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.tabLabelElements)) {
336
+ store.formData.tabLabelElements = []
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("tabLabel")) {
342
+ finalPath = `${finalPath}.tabLabelElements[${store.formData.tabLabelElements.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("tabLabel") ? "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.tabLabelElements)) {
425
+ store.formData.tabLabelElements = []
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.tabLabelElements.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}.tabLabelElements[${rowId}]`
443
474
  }
444
475
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
445
476
  },