impaktapps-ui-builder 0.0.101-alpha.22 → 0.0.101-alpha.230

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.
Files changed (21) hide show
  1. package/dist/impaktapps-ui-builder.es.js +538 -289
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +15 -15
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +10 -10
  6. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +6 -0
  7. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +6 -0
  8. package/package.json +1 -1
  9. package/src/impaktapps-ui-builder/builder/build/buildText.ts +21 -18
  10. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +14 -10
  11. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +88 -73
  12. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +2 -2
  13. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +5 -5
  14. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +68 -9
  15. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +41 -17
  16. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +15 -12
  17. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +41 -201
  18. package/src/impaktapps-ui-builder/builder/services/component.ts +161 -32
  19. package/src/impaktapps-ui-builder/builder/services/event.ts +159 -59
  20. package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -1
  21. package/src/impaktapps-ui-builder/runtime/services/service.ts +29 -4
@@ -1,3 +1,13 @@
1
+ export declare const emptyBox: (scope: string, layout?: any) => {
2
+ type: string;
3
+ scope: string;
4
+ options: {
5
+ widget: string;
6
+ };
7
+ config: {
8
+ layout: any;
9
+ };
10
+ };
1
11
  export declare const getRadioInputField: (scope: String, label: String, options: string[]) => {
2
12
  type: string;
3
13
  scope: string;
@@ -24,16 +34,6 @@ export declare const buildWrapper: (label: string, elements: any[]) => {
24
34
  label: string;
25
35
  isAccordion: boolean;
26
36
  };
27
- wrapperStyle: {
28
- marginTop: string;
29
- marginBottom: string;
30
- marginLeft: string;
31
- width: string;
32
- };
33
- componentsBoxStyle: {
34
- marginLeft: string;
35
- };
36
- defaultStyle: boolean;
37
37
  };
38
38
  elements: any[];
39
39
  };
@@ -71,6 +71,12 @@ export declare const EventSchema: {
71
71
  RemoveItemButton: {
72
72
  disabled: boolean;
73
73
  };
74
+ pageName: {
75
+ path: {
76
+ label: string;
77
+ path: string;
78
+ }[];
79
+ };
74
80
  };
75
81
  required: string[];
76
82
  };
@@ -79,6 +79,12 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
79
79
  RemoveItemButton: {
80
80
  disabled: boolean;
81
81
  };
82
+ pageName: {
83
+ path: {
84
+ label: string;
85
+ path: string;
86
+ }[];
87
+ };
82
88
  };
83
89
  required: string[];
84
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.101-alpha.22",
3
+ "version": "0.0.101-alpha.230",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -2,22 +2,25 @@ import _ from "lodash";
2
2
  import TextInputField from "./uischema/textInputField";
3
3
  import { createLayoutFormat } from "./buildConfig";
4
4
 
5
- export const buildTextField = (config:any,componentScope:string) =>{
6
- const inputField: any = _.cloneDeep(TextInputField);
7
- inputField.config.main.label = config.label;
8
- if (config.style) {
9
- inputField.config.style = JSON.parse(config.style)
10
- }
11
- if (config.InputFormatingAndMasking) {
12
- inputField.config.main.formatStrArray = config.InputFormatingAndMasking.map(e => e.formatElement);
13
- }
14
- if (config.placeholder) {
15
- inputField.config.main.placeholder = config.placeholder;
16
- }
17
- if (config.layout) {
18
- inputField.config.layout = createLayoutFormat(config.layout)
19
- }
20
- inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
21
- inputField.scope = componentScope;
22
- return inputField;
5
+ export const buildTextField = (config: any, componentScope: string) => {
6
+ const inputField: any = _.cloneDeep(TextInputField);
7
+ inputField.config.main.label = config.label;
8
+ if (config.style) {
9
+ inputField.config.style = JSON.parse(config.style)
10
+ }
11
+ if (config.multiline) {
12
+ inputField.config.main.multiline = config.multiline === "YES" ? true : false;
13
+ }
14
+ if (config.InputFormatingAndMasking) {
15
+ inputField.config.main.formatStrArray = config.InputFormatingAndMasking.map(e => e.formatElement);
16
+ }
17
+ if (config.placeholder) {
18
+ inputField.config.main.placeholder = config.placeholder;
19
+ }
20
+ if (config.layout) {
21
+ inputField.config.layout = createLayoutFormat(config.layout)
22
+ }
23
+ inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
24
+ inputField.scope = componentScope;
25
+ return inputField;
23
26
  }
@@ -343,17 +343,17 @@ const buildUiSchema = (config: any, store?: any) => {
343
343
  }
344
344
  else if (config.type == "Table") {
345
345
  const sizeMap = {}
346
- const filterMap = {}
346
+ // const filterMap = {}
347
347
  if (config.sizeHolder) {
348
348
  config.sizeHolder.map((e, i) => {
349
349
  sizeMap[e.keyName] = e.value
350
350
  });
351
351
  }
352
- if(config.enableColumnFilter){
353
- config.enableColumnFilter.map((e)=>{
354
- filterMap[e.keyName] = true
355
- })
356
- }
352
+ // if(config.enableColumnFilter){
353
+ // config.enableColumnFilter.map((e)=>{
354
+ // filterMap[e.keyName] = true
355
+ // })
356
+ // }
357
357
  elements.elements = config.elements.map((cellElem, elemInd) => {
358
358
  if (cellElem.type) {
359
359
  return {
@@ -363,8 +363,10 @@ const buildUiSchema = (config: any, store?: any) => {
363
363
  type: cellElem.columnFormat,
364
364
  widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
365
365
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
366
- enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
367
- columnFilterModeOptions: config.filteringOptions
366
+ // enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
367
+ columnFilterModeOptions: cellElem.filteringOptions,
368
+ enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false,
369
+ enableSorting: cellElem.enableSorting === "Yes" ? true : false
368
370
  }
369
371
  } else {
370
372
  return {
@@ -372,8 +374,10 @@ const buildUiSchema = (config: any, store?: any) => {
372
374
  type: cellElem.columnFormat,
373
375
  header: cellElem.label || cellElem.name,
374
376
  size: sizeMap[cellElem.name] || 180,
375
- enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
376
- columnFilterModeOptions: config.filteringOptions
377
+ // enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
378
+ columnFilterModeOptions: cellElem.filteringOptions,
379
+ enableColumnFilter: cellElem.enableFilter === "Yes" ? true : false,
380
+ enableSorting: cellElem.enableSorting === "Yes" ? true : false
377
381
  }
378
382
  }
379
383
 
@@ -1,8 +1,6 @@
1
1
 
2
2
  import _ from "lodash";
3
- import { buildLabel } from "../buildLabel";
4
- import Box from "./box";
5
- const emptyBox = (scope:string,layout?: any) => {
3
+ export const emptyBox = (scope:string,layout?: any) => {
6
4
 
7
5
  if(layout !== undefined){
8
6
  return {
@@ -31,82 +29,108 @@ const emptyBox = (scope:string,layout?: any) => {
31
29
  const cardLayout = {
32
30
  type: "Control",
33
31
  scope: "#/properties/cardLayout",
34
- layout: 11.5,
35
32
  options: {
36
- detail: {
37
- type: "HorizontalLayout",
38
- elements: [
39
- {
40
- type: "Control",
41
- scope: "#/properties/key",
42
- options: {
43
- widget: "SelectInputField",
44
- },
45
- config: {
46
- layout: { xs: 6, sm: 6, md: 4, lg: 4 },
47
- main: {
48
- label: "Screen Size",
33
+ widget: "Array",
34
+ },
35
+ config: {
36
+ layout: 12,
37
+ main: {
38
+ label: "Card Layout",
39
+ childElementLabel: "Card Layout",
40
+ },
41
+ style: {
42
+ marginLeft: "-24px",
43
+ marginBottom: "24px !important",
44
+ labelStyle: {
45
+ marginLeft: "24px",
46
+ },
47
+ detailsStyle: {
48
+ marginLeft: "24px",
49
+ }
50
+ }
51
+ },
52
+ elements: [
53
+ {
54
+ type: "Control",
55
+ scope: "#/properties/key",
56
+ options: {
57
+ widget: "SelectInputField",
58
+ },
59
+ config: {
60
+ layout: { xs: 6, sm: 6, md: 4, lg: 4 },
61
+ main: {
62
+ label: "Screen Size",
49
63
 
50
- },
51
- },
52
64
  },
53
- {
54
- type: "Control",
55
- scope: "#/properties/value",
65
+ },
66
+ },
67
+ {
68
+ type: "Control",
69
+ scope: "#/properties/value",
56
70
 
57
- options: {
58
- widget: "InputField",
59
- },
60
- config: {
61
- layout: { xs: 6, sm: 6, md: 4, lg: 4 },
62
- main: {
63
- label: "Value",
64
- type: "number",
65
- // freeSolo:true,
66
- helperText: 'Number should be in range of 0 to 12',
67
- errorMessage: "Number Can't be greater than 12 and can't be less than 0.",
71
+ options: {
72
+ widget: "InputField",
73
+ },
74
+ config: {
75
+ layout: { xs: 6, sm: 6, md: 4, lg: 4 },
76
+ main: {
77
+ label: "Value",
78
+ type: "number",
79
+ // freeSolo:true,
80
+ helperText: 'Number should be in range of 0 to 12',
81
+ errorMessage: "Number Can't be greater than 12 and can't be less than 0.",
68
82
 
69
- },
70
- },
71
83
  },
72
- emptyBox("cardEmpty")
73
- ],
84
+ },
74
85
  },
75
- },
86
+ emptyBox("cardEmpty")
87
+ ],
76
88
  };
77
89
  const getArrayControl = (parentScope: string, childScope: string, childLabel?: string,) => {
78
90
  return {
79
91
  type: "Control",
80
92
  scope: `#/properties/${parentScope}`,
81
- layout: 12,
82
93
  options: {
83
- "elementLabelProp": childScope,
84
- detail: {
85
- type: "HorizontalLayout",
86
- elements: [
87
- {
88
- type: "Control",
89
- scope: `#/properties/${childScope}`,
94
+ widget: "Array"
95
+ },
96
+ config: {
97
+ layout: 12,
98
+ main: {
99
+ label: childLabel,
100
+ childElementLabel: childLabel,
101
+ },
102
+ style: {
103
+ marginLeft: "-24px",
104
+ marginBottom: "24px !important",
105
+ labelStyle: {
106
+ marginLeft: "24px",
107
+ },
108
+ detailsStyle: {
109
+ marginLeft: "24px",
110
+ }
111
+ }
112
+ },
113
+ elements: [
114
+ {
115
+ type: "Control",
116
+ scope: `#/properties/${childScope}`,
90
117
 
91
- options: {
92
- widget: "InputField",
93
- },
94
- config: {
95
- layout: { xs: 6, sm: 6, md: 4, lg: 4 },
96
- main: {
97
- label: childLabel || "Labels for Tab",
98
- },
99
- },
118
+ options: {
119
+ widget: "InputField",
120
+ },
121
+ config: {
122
+ layout: { xs: 6, sm: 6, md: 4, lg: 4 },
123
+ main: {
124
+ label: childLabel || "Labels for Tab",
100
125
  },
101
- emptyBox("ArrayControlEmpty1", {xs: 6, sm: 6, md: 4, lg: 4 }),
102
- emptyBox("ArrayControlEmpty2", {xs: 0, sm: 0, md: 4, lg: 4 })
103
- ],
126
+ },
104
127
  },
105
- },
128
+ emptyBox("ArrayControlEmpty1", {xs: 6, sm: 6, md: 8, lg: 8 }),
129
+ ],
106
130
  }
107
131
  };
108
132
  const sizeHolder = getArrayControl("sizeHolder", "keyName", "Component Name");
109
- sizeHolder.options.detail.elements[1] = {
133
+ sizeHolder.elements[1] = {
110
134
  type: "Control",
111
135
  scope: `#/properties/value`,
112
136
 
@@ -120,7 +144,7 @@ sizeHolder.options.detail.elements[1] = {
120
144
  },
121
145
  },
122
146
  };
123
- sizeHolder.options.detail.elements[2] = emptyBox("sizeHolderempty")
147
+ sizeHolder.elements[2] = emptyBox("sizeHolderempty")
124
148
  const getInputField = (scope: String, label: String) => {
125
149
  return {
126
150
  type: "Control",
@@ -164,16 +188,6 @@ export const buildWrapper = (label: string, elements: any[]) => {
164
188
  label: label || "Details",
165
189
  isAccordion: true,
166
190
  },
167
- wrapperStyle: {
168
- marginTop: '-6px',
169
- marginBottom: '-8px',
170
- marginLeft: "-34px",
171
- width: "108%"
172
- },
173
- componentsBoxStyle: {
174
- marginLeft: "12px",
175
- },
176
- defaultStyle: true
177
191
  },
178
192
  elements: elements || []
179
193
  }
@@ -308,7 +322,7 @@ export const buildPropertiesSection = function (type: String) {
308
322
  case "Text":
309
323
  uiSchema.elements = [
310
324
  getInputField("placeholder", "Placeholder"),
311
- emptyBox("TextEmpty1", {xs: 6, sm: 6, md: 4, lg: 4 }),
325
+ getRadioInputField("multiline", "Multiline", ["YES", "NO"]),
312
326
  emptyBox("TextEmpty1", {xs: 0, sm: 0, md: 4, lg: 4 }),
313
327
  getArrayControl("InputFormatingAndMasking", "formatElement", "Format Element")
314
328
  ]
@@ -318,6 +332,7 @@ export const buildPropertiesSection = function (type: String) {
318
332
  getInputField("placeholder", "Placeholder"),
319
333
  getRadioInputField("enableCodeEditor", "Enable Code Editor",["YES", "NO"]),
320
334
  getInputField("codeEditorLanguage", "Enter Code Language"),
335
+ emptyBox("TextEmpty1", {xs: 0, sm: 0, md: 0, lg: 3 }),
321
336
  ]
322
337
  break;
323
338
 
@@ -404,7 +419,7 @@ export const buildPropertiesSection = function (type: String) {
404
419
  getInputField("xAxisValue", "X-AxisValue"),
405
420
  getRadioInputField("bottomAxisAngle", "Bottom Axis Angled", ["YES", "No"]),
406
421
  getInputField("leftMargin", "Left Margin"),
407
- emptyBox("GraphEmpty1", {xs: 6, sm: 0, md: 8, lg: 8 }),
422
+ emptyBox("GraphEmpty1", {xs: 6, sm: 0, md: 8, lg: 6 }),
408
423
  getArrayControl("legendLabels", "label"),
409
424
  getArrayControl("pieArcColors", "color"),
410
425
  ];
@@ -79,7 +79,7 @@ export const EventSection = (theme)=>{
79
79
 
80
80
  {
81
81
  accessorKey: "eventType",
82
- header: "Event Type",
82
+ header: "Event's Type",
83
83
  type: "string",
84
84
  size: 300,
85
85
  },
@@ -91,7 +91,7 @@ export const EventSection = (theme)=>{
91
91
  },
92
92
  {
93
93
  accessorKey: "Edit_Approve_Records",
94
- header: "Edit Widget",
94
+ header: "Edit",
95
95
  size: 150,
96
96
  type: "action",
97
97
  widget: {
@@ -4,7 +4,7 @@ export const ComponentSchema: any = {
4
4
  type: {
5
5
  // type: "string",
6
6
  oneOf: [
7
- { title: "Masked Aadhaar", const: "AadharcardText" },
7
+ { title: "Masked Aadhar Card", const: "AadharcardText" },
8
8
  { title: "Array", const: "Array" },
9
9
  { title: "Button", const: "Button" },
10
10
  { title: "Data Card", const: "card" },
@@ -19,7 +19,7 @@ export const ComponentSchema: any = {
19
19
  { title: "Graph", const: "Graph" },
20
20
  { title: "Input Slider", const: "InputSlider" },
21
21
  { title: "Label", const: "Box" },
22
- { title: "LeaderBoard", const: "LeaderBoard" },
22
+ { title: "Leaderboard", const: "LeaderBoard" },
23
23
  { title: "Multi-Select Dropdown", const: "MultipleSelect" },
24
24
  { title: "Pan Card Masked", const: "PanCardText" },
25
25
  { title: "Pop Up", const: "PopUp" },
@@ -204,8 +204,6 @@ export const ComponentSchema: any = {
204
204
  },
205
205
  },
206
206
  filteringOptions:{
207
- type: "array",
208
- items:{
209
207
  oneOf: [
210
208
  { const: 'fuzzy', title: 'Fuzzy' },
211
209
  { const: 'contains', title: 'Contain' },
@@ -220,7 +218,6 @@ export const ComponentSchema: any = {
220
218
  { const: 'lessThan', title: 'Less than' },
221
219
  { const: 'lessThanOrEqualTo', title: 'Less than or equal to' },
222
220
  ]
223
- },
224
221
  },
225
222
  legendLabels: {
226
223
  type: "array",
@@ -340,6 +337,9 @@ export const ComponentSchema: any = {
340
337
  { title: "Info", const: "info" },
341
338
  ]
342
339
  },
340
+ pageName: {
341
+ path: []
342
+ },
343
343
  name: {
344
344
  type: "string",
345
345
  },
@@ -407,15 +407,16 @@ export const componentBasicUiSchema: any = (theme)=>{
407
407
  config: {
408
408
  layout: 11,
409
409
  main: {
410
- heading: "Are you sure you want to delete ?",
410
+ heading: "Are you sure you want to delete this Component ?",
411
411
  },
412
412
  style:{
413
- marginTop: "-20px",
414
- fontSize: "20px",
415
413
  "&.MuiTypography-root": {
416
- padding: "10px 30px 20px 30px",
414
+ padding: "0px 20px",
417
415
  textAlign: "center",
418
- lineHeight: "1"
416
+ lineHeight: "1.2",
417
+ fontWeight: "normal",
418
+ fontSize: "18px",
419
+ marginBottom: theme.spacing(5)
419
420
  }
420
421
  }
421
422
  },
@@ -445,6 +446,8 @@ export const componentBasicUiSchema: any = (theme)=>{
445
446
  },
446
447
  style: {
447
448
  position: "absolute",
449
+ padding: "8px 0px",
450
+ fontSize: "16px",
448
451
  bottom: 0,
449
452
  left: 0,
450
453
  width: "50%",
@@ -480,6 +483,8 @@ export const componentBasicUiSchema: any = (theme)=>{
480
483
  },
481
484
  style: {
482
485
  position: "absolute",
486
+ padding: "8px 0px",
487
+ fontSize: "16px",
483
488
  bottom: 0,
484
489
  right: 0,
485
490
  width: "50%",
@@ -530,15 +535,17 @@ export const componentBasicUiSchema: any = (theme)=>{
530
535
  config: {
531
536
  layout: 11,
532
537
  main: {
533
- heading: "Are you sure you want to delete ?",
538
+ heading: "Are you sure you want to delete this Event ?",
534
539
  },
535
540
  style:{
536
- marginTop: "-20px",
537
541
  fontSize: "20px",
538
542
  "&.MuiTypography-root": {
539
- padding: "10px 30px 20px 30px",
543
+ padding: "0px 20px",
540
544
  textAlign: "center",
541
- lineHeight: "1"
545
+ lineHeight: "1.2",
546
+ fontWeight: "normal",
547
+ fontSize: "18px",
548
+ marginBottom: theme.spacing(5)
542
549
  }
543
550
  }
544
551
  },
@@ -568,6 +575,8 @@ export const componentBasicUiSchema: any = (theme)=>{
568
575
  },
569
576
  style: {
570
577
  position: "absolute",
578
+ padding: "8px 0px",
579
+ fontSize: "16px",
571
580
  bottom: 0,
572
581
  left: 0,
573
582
  width: "50%",
@@ -603,6 +612,8 @@ export const componentBasicUiSchema: any = (theme)=>{
603
612
  },
604
613
  style: {
605
614
  position: "absolute",
615
+ padding: "8px 0px",
616
+ fontSize: "16px",
606
617
  bottom: 0,
607
618
  right: 0,
608
619
  width: "50%",
@@ -623,6 +634,54 @@ export const componentBasicUiSchema: any = (theme)=>{
623
634
  },
624
635
  ]
625
636
  },
637
+ // {
638
+ // type: "Control",
639
+ // scope: "#/properties/pageName",
640
+
641
+ // options: {
642
+ // widget: "Box",
643
+ // },
644
+ // config: {
645
+ // layout: 12,
646
+ // main: {
647
+ // heading: "",
648
+ // },
649
+ // style: {
650
+ // paddingLeft: theme.spacing(3),
651
+ // width:"100%",
652
+ // fontSize:"10px",
653
+ // color:theme.palette.grey[600],
654
+ // position: "fixed",
655
+ // bottom: "24px",
656
+ // backgroundColor: theme.palette.background.default,
657
+ // borderBottom: `1px solid ${theme.palette.common.black}29`,
658
+ // borderTop: `1px solid ${theme.palette.common.black}29`,
659
+ // },
660
+ // },
661
+ // },
662
+ {
663
+ type: "Control",
664
+ scope: "#/properties/pageName",
665
+
666
+ options: {
667
+ widget: "Breadcrumb",
668
+ },
669
+ config: {
670
+ layout: 12,
671
+ main: {
672
+ },
673
+ style: {
674
+ paddingLeft: theme.spacing(3),
675
+ color:theme.palette.grey[600],
676
+ fontSize:"10px",
677
+ position: "fixed",
678
+ bottom: "24px",
679
+ borderBottom: `1px solid ${theme.palette.common.black}29`,
680
+ borderTop: `1px solid ${theme.palette.common.black}29`,
681
+ backgroundColor: theme.palette.background.default,
682
+ },
683
+ },
684
+ },
626
685
  {
627
686
  type: "Control",
628
687
  scope: "#/properties/notify",