impaktapps-ui-builder 0.0.101-alpha.6 → 0.0.101-alpha.60

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 (31) hide show
  1. package/dist/impaktapps-ui-builder.es.js +971 -787
  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/apiSection.d.ts +62 -59
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +17 -21
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +98 -95
  8. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +26 -33
  9. package/dist/src/impaktapps-ui-builder/builder/build/uischema/refresh.d.ts +52 -38
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/styleSection.d.ts +7 -8
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +29 -33
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +56 -37
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +56 -36
  14. package/package.json +1 -1
  15. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +12 -10
  16. package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +111 -96
  17. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +100 -94
  18. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +189 -110
  19. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +39 -17
  20. package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +44 -44
  21. package/src/impaktapps-ui-builder/builder/build/uischema/styleSection.ts +9 -13
  22. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +40 -18
  23. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +117 -48
  24. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +113 -45
  25. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +23 -23
  26. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +99 -41
  27. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +9 -8
  28. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +12 -12
  29. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +200 -289
  30. package/src/impaktapps-ui-builder/builder/services/component.ts +134 -33
  31. package/src/impaktapps-ui-builder/builder/services/event.ts +13 -14
@@ -10,54 +10,123 @@ import { ValueTab } from "../build/uischema/valueTab";
10
10
  import { ValidationSection } from "../build/uischema/validationSections";
11
11
  import { getFormdataFromSessionStorage, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
12
12
  const sectionLabels = {
13
- Select: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
14
- MultipleSelect: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
15
- Table: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
16
- LeaderBoard: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
13
+ Select: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
14
+ MultipleSelect: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
15
+ Table: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
16
+ LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
17
17
  WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
18
18
  TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
19
- SpeedoMeter: ["Core", "Properties", "Event", "Style", "Validation"],
20
- card: ["Core", "Properties", "Event", "Style", "Validation"],
21
- UploadFile: ["Core", "Event", "Style", "Validation"],
22
- Graph: ["Core", "Properties", "Event", "Style", "Validation"],
23
- DownloadFile: ["Core", "Event", "Style", "Validation"],
24
- Box: ["Core", "Event", "Style", "Validation"],
25
- Properties: ["Core", "Properties", "Event", "Style", "Validation"],
26
- ProgressBarCard: ["Core", "Properties", "Event", "Style", "Validation"],
27
- RankCard: ["Core", "Properties", "Event", "Style", "Validation"],
28
- Slider: ["Core", "Components", "Event", "Style", "Validation"],
29
- Timer: ["Core", "Event", "Style", "Validation"],
30
- Rank: ["Core", "Event", "Style", "Validation"],
31
- Button: ["Core", "Properties", "Event", "Style", "Validation"],
19
+ SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
20
+ card: ["Core", "Properties", "Events", "Style", "Validation"],
21
+ UploadFile: ["Core", "Events", "Style", "Validation"],
22
+ Graph: ["Core", "Properties", "Events", "Style", "Validation"],
23
+ DownloadFile: ["Core", "Events", "Style", "Validation"],
24
+ Box: ["Core", "Events", "Style", "Validation"],
25
+ Properties: ["Core", "Properties", "Events", "Style", "Validation"],
26
+ ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
27
+ RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
28
+ Slider: ["Core", "Components", "Events", "Style", "Validation"],
29
+ Timer: ["Core", "Events", "Style", "Validation"],
30
+ Rank: ["Core", "Events", "Style", "Validation"],
31
+ Button: ["Core", "Properties", "Events", "Style", "Validation"],
32
32
  Array: ["Core", "Components", "Validation"],
33
- Radio: ["Core", "Properties", "Event", "Style", "Validation"],
34
- Text: ["Core", "Properties", "Event", "Style", "Validation"],
35
- TextArea: ["Core", "Properties", "Event", "Style", "Validation"],
33
+ Radio: ["Core", "Properties", "Events", "Style", "Validation"],
34
+ Text: ["Core", "Properties", "Events", "Style", "Validation"],
35
+ TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
36
36
  PopUp: ["Core", "Components", "Properties", "Style"],
37
- Stepper: ["Core", "Components", "Properties", "Event", "Style"],
38
- DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
39
- InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
40
- TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
37
+ Stepper: ["Core", "Components", "Properties", "Events", "Style"],
38
+ DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
39
+ InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
40
+ TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
41
41
  ColumnGroup: ["Core", "Components"],
42
- Thought: ["Core", "Properties", "Event", "Style", "Validation"]
42
+ Thought: ["Core", "Properties", "Events", "Style", "Validation"]
43
43
  }
44
44
 
45
45
  export function refreshPage (type: string, store: any) {
46
46
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
47
+ const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
47
48
  if (type) {
48
49
  const sectionUiSchema = {
49
50
  Core: CoreSection,
50
51
  Value: ValueTab,
51
52
  Style: StyleSection,
52
- Event: EventSection(store.theme.myTheme),
53
+ Events: EventSection(store.theme.myTheme),
53
54
  Components: TableSection(store.theme.myTheme),
54
55
  Properties: buildPropertiesSection(type),
55
56
  Validation: ValidationSection
56
57
  }
57
58
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
58
- UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
59
- UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
59
+ UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Events", "Validation"];
60
+ UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
60
61
  }
62
+
63
+ // Get Widget Type of parent
64
+ const path = store.searchParams?.get("path");
65
+ const lastDotIndex = path.lastIndexOf('.')
66
+ const parentPath = path.slice(0,lastDotIndex)
67
+
68
+ const parentObj = _.get(currentConfig, parentPath)
69
+
70
+ if(parentObj?.type === "Table"){
71
+ UiSchema.elements[0].elements[0].elements[4] =
72
+ {
73
+ type: "Control",
74
+ scope: "#/properties/columnFormat",
75
+ options: {
76
+ widget: "SelectInputField",
77
+ },
78
+ config: {
79
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
80
+ main: {
81
+ label: "Column Format",
82
+
83
+ },
84
+ },
85
+ };
86
+ UiSchema.elements[0].elements[0].elements[5] =
87
+ {
88
+ type: "Control",
89
+ scope: "#/properties/filteringOptions",
90
+ options: {
91
+ widget: "SelectInputField",
92
+ },
93
+ config: {
94
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
95
+ main: {
96
+ label: "Filter Mode",
97
+ multiple: true
98
+ },
99
+ },
100
+ };
101
+ UiSchema.elements[0].elements[0].elements[6] =
102
+ {
103
+ type: "Control",
104
+ scope: "#/properties/enableFilter",
105
+ options: {
106
+ widget: "RadioInputField",
107
+ },
108
+ config: {
109
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
110
+ main: {
111
+ label: "Enable Filter",
112
+ options: ["Yes", "No"],
113
+ errorMessage: "Active is not marked YES or NO",
114
+ },
115
+ },
116
+ },
117
+ UiSchema.elements[0].elements[0].elements[7] =
118
+ {
119
+ type: "Control",
120
+ scope: "#/properties/proc",
121
+ config: {
122
+ layout: { xs: 0, sm: 0, md: 0, lg: 6 },
123
+ },
124
+ options: {
125
+ widget: "EmptyBox",
126
+ },
127
+ };
128
+ }
129
+
61
130
  if (sessionStorage.getItem("copiedConfig") ) {
62
131
  this.ElementPathSetter(UiSchema);
63
132
  }
@@ -84,6 +153,38 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
84
153
  if (sessionStorage.getItem("copiedConfig") ) {
85
154
  schema.properties.RemoveItemButton.disabled = false;
86
155
  }
156
+
157
+ const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
158
+ const path = store.searchParams?.get("path");
159
+ const id = store.searchParams?.get("id")
160
+
161
+ let pathArray = [];
162
+
163
+ if (path) {
164
+ // let urlRoutes: string = config.name;
165
+ const pathArrayAll = path.split(".");
166
+ const arr: any = []
167
+ pathArrayAll.map((e: string, i: number) => {
168
+ if (i === 0) {
169
+ arr.push(e)
170
+ return;
171
+ }
172
+ arr.push(`${arr[i - 1]}.${e}`)
173
+ })
174
+
175
+
176
+ arr.map((e) => {
177
+ const data = _.get(config, e)
178
+ pathArray.push({
179
+ label: data?.name || data?.eventType || "NewComponent",
180
+ path: `/Component?path=${e}&id=${id}`
181
+ });
182
+ })
183
+ }
184
+
185
+ console.log("pathArray>>",pathArray)
186
+
187
+ schema.properties.pageName.path = pathArray
87
188
  return schema;
88
189
  },
89
190
  okHandler: () => okHandler(store),
@@ -219,16 +320,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
219
320
 
220
321
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
221
322
  const notificationMessages = {
222
- Event: " The event cannot be integrated into the component section.",
223
- Component: "The component cannot be integrated into the event section."
323
+ Events: " The Events cannot be integrated into the component section.",
324
+ Component: "The component cannot be integrated into the Events section."
224
325
  };
225
326
  if(copiedConfig.Handler && elementType === "Component"){
226
327
  store.setNotify({
227
- FailMessage: notificationMessages.Event,
328
+ FailMessage: notificationMessages.Events,
228
329
  Fail: true,
229
330
  });
230
331
  }
231
- else if(copiedConfig.name && elementType === "Event"){
332
+ else if(copiedConfig.name && elementType === "Events"){
232
333
  store.setNotify({
233
334
  FailMessage: notificationMessages.Component,
234
335
  Fail: true,
@@ -256,7 +357,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
256
357
  },
257
358
  ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
258
359
  const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
259
- uiSchema.elements[2].elements[1].config.main.heading = `Copied Path: ${formData.pageName}`;
360
+ // uiSchema.elements[2].elements[1].config.main.heading = `Copied Path: ${formData.pageName}`;
260
361
  }
261
362
  }
262
363
  };
@@ -3,10 +3,9 @@ import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
3
3
  import Component from "./component";
4
4
  import { okHandler, saveFormdataInSessionStorage, saveHandler, getFormdataFromSessionStorage } from "./utils";
5
5
  import { APISection } from "../build/uischema/apiSection";
6
- import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
6
+ import { emptyBox, getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
7
7
  import { refreshSectionUiSchema } from "../build/uischema/refresh";
8
8
  import _ from "lodash";
9
- import emptyBox from "../build/uischema/emptyBox";
10
9
 
11
10
  export default (
12
11
  store: any,
@@ -28,8 +27,8 @@ export default (
28
27
  const schema: any = _.cloneDeep(EventSchema)
29
28
  if (handlerType) {
30
29
  if (handlerType === "custom") {
31
- uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
32
- uiSchema.elements[1].elements[0].elements[3] = {
30
+ uiSchema.elements[0].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
31
+ uiSchema.elements[0].elements[0].elements[3] = {
33
32
  type: "Control",
34
33
  scope: "#/properties/emptyBox",
35
34
  options: {
@@ -37,26 +36,26 @@ export default (
37
36
  },
38
37
 
39
38
  config: {
40
- layout: { xs: 0, sm: 6, md: 0, lg: 0 },
39
+ layout: { xs: 6, sm: 6, md: 0, lg: 3 },
41
40
  main: {},
42
41
  style:{}
43
42
  },
44
43
  };
45
- uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
44
+ uiSchema.elements[0].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
46
45
  schema.required = ["eventType", "Handler", "eventCode"]
47
46
 
48
47
  } else if (handlerType === "api") {
49
- uiSchema.elements[1].elements[0].elements[2] = emptyBox;
50
- uiSchema.elements[1].elements[0].elements[3] = APISection;
48
+ uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {xs: 0,sm: 0,md: 4,lg: 6});
49
+ uiSchema.elements[0].elements[0].elements[3] = APISection;
51
50
  schema.required = ["eventType", "Handler", "method", "path"]
52
51
  } else if (handlerType === "inBuiltFunction") {
53
52
 
54
- uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
53
+ uiSchema.elements[0].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
55
54
  { label: "RankProvider", value: "RankProvider" },
56
55
  { label: "Download File", value: "downloadFile" },
57
56
  { label: "Download Blob File", value: "downloadBlobFile" }
58
57
  ])
59
- uiSchema.elements[1].elements[0].elements[3] = {
58
+ uiSchema.elements[0].elements[0].elements[3] = {
60
59
  type: "Control",
61
60
  scope: "#/properties/emptyBox",
62
61
  options: {
@@ -64,16 +63,16 @@ export default (
64
63
  },
65
64
 
66
65
  config: {
67
- layout: { xs: 6, sm: 6, md: 0, lg: 0 },
66
+ layout: { xs: 6, sm: 6, md: 0, lg: 3 },
68
67
  main: {},
69
68
  style:{}
70
69
  },
71
70
  };
72
- uiSchema.elements[1].elements[0].elements[4] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true);
71
+ uiSchema.elements[0].elements[0].elements[4] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true);
73
72
  schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
74
73
  } else if (handlerType === "refresh") {
75
- uiSchema.elements[1].elements[0].elements[2] = emptyBox;
76
- uiSchema.elements[1].elements[0].elements[3] = refreshSectionUiSchema;
74
+ uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {xs: 0,sm: 0,md: 4,lg: 6});
75
+ uiSchema.elements[0].elements[0].elements[3] = refreshSectionUiSchema;
77
76
  schema.properties.refreshElements.required = ["value"]
78
77
  schema.properties.refreshElements.items.required = ["value"]
79
78
  schema.required = ["eventType", "Handler", "refreshElements"]