impaktapps-ui-builder 0.0.101-alpha.4 → 0.0.101-alpha.41

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 (30) hide show
  1. package/dist/impaktapps-ui-builder.es.js +970 -919
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +12 -12
  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/uischema/apiSection.ts +111 -96
  16. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +100 -94
  17. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +189 -110
  18. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +39 -17
  19. package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +44 -44
  20. package/src/impaktapps-ui-builder/builder/build/uischema/styleSection.ts +9 -13
  21. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +40 -18
  22. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +117 -48
  23. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +113 -45
  24. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +20 -20
  25. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +297 -346
  26. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +9 -8
  27. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +12 -12
  28. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +200 -289
  29. package/src/impaktapps-ui-builder/builder/services/component.ts +90 -32
  30. package/src/impaktapps-ui-builder/builder/services/event.ts +13 -14
@@ -9,55 +9,113 @@ import { TableSection } from "../build/uischema/tableSection";
9
9
  import { ValueTab } from "../build/uischema/valueTab";
10
10
  import { ValidationSection } from "../build/uischema/validationSections";
11
11
  import { getFormdataFromSessionStorage, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
12
+ import buildConfig from "../build/buildConfig";
12
13
  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"],
14
+ Select: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
15
+ MultipleSelect: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
16
+ Table: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
17
+ LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
17
18
  WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
18
19
  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"],
20
+ SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
21
+ card: ["Core", "Properties", "Events", "Style", "Validation"],
22
+ UploadFile: ["Core", "Events", "Style", "Validation"],
23
+ Graph: ["Core", "Properties", "Events", "Style", "Validation"],
24
+ DownloadFile: ["Core", "Events", "Style", "Validation"],
25
+ Box: ["Core", "Events", "Style", "Validation"],
26
+ Properties: ["Core", "Properties", "Events", "Style", "Validation"],
27
+ ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
28
+ RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
29
+ Slider: ["Core", "Components", "Events", "Style", "Validation"],
30
+ Timer: ["Core", "Events", "Style", "Validation"],
31
+ Rank: ["Core", "Events", "Style", "Validation"],
32
+ Button: ["Core", "Properties", "Events", "Style", "Validation"],
32
33
  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"],
34
+ Radio: ["Core", "Properties", "Events", "Style", "Validation"],
35
+ Text: ["Core", "Properties", "Events", "Style", "Validation"],
36
+ TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
36
37
  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"],
38
+ Stepper: ["Core", "Components", "Properties", "Events", "Style"],
39
+ DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
40
+ InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
41
+ TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
41
42
  ColumnGroup: ["Core", "Components"],
42
- Thought: ["Core", "Properties", "Event", "Style", "Validation"]
43
+ Thought: ["Core", "Properties", "Events", "Style", "Validation"]
43
44
  }
44
45
 
45
46
  export function refreshPage (type: string, store: any) {
46
47
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
48
+ const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
47
49
  if (type) {
48
50
  const sectionUiSchema = {
49
51
  Core: CoreSection,
50
52
  Value: ValueTab,
51
53
  Style: StyleSection,
52
- Event: EventSection(store.theme.myTheme),
54
+ Events: EventSection(store.theme.myTheme),
53
55
  Components: TableSection(store.theme.myTheme),
54
56
  Properties: buildPropertiesSection(type),
55
57
  Validation: ValidationSection
56
58
  }
57
59
  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];
60
+ UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Events", "Validation"];
61
+ UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
60
62
  }
63
+
64
+ // Get Widget Type of parent
65
+ const path = store.searchParams?.get("path");
66
+ const pathArrayAll = path.split(".");
67
+
68
+ const parentObj = pathArrayAll.reduce((currObj, path, index)=>{
69
+ if(index === pathArrayAll.length - 1){
70
+ return currObj
71
+ }
72
+ const currElemIndexWithBracket = path.split('[')[1];
73
+ const currElemIndex = parseInt(currElemIndexWithBracket.slice(0,-1));
74
+ return currObj?.["elements"]?.[currElemIndex]
75
+ }, currentConfig)
76
+ if(parentObj?.type === "Table"){
77
+ UiSchema.elements[0].elements[0].elements[4] =
78
+ {
79
+ type: "Control",
80
+ scope: "#/properties/columnFormat",
81
+ options: {
82
+ widget: "SelectInputField",
83
+ },
84
+ config: {
85
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
86
+ main: {
87
+ label: "Column Format",
88
+
89
+ },
90
+ },
91
+ };UiSchema.elements[0].elements[0].elements[5] =
92
+ {
93
+ type: "Control",
94
+ scope: "#/properties/filteringOptions",
95
+ options: {
96
+ widget: "SelectInputField",
97
+ },
98
+ config: {
99
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
100
+ main: {
101
+ label: "Filter Mode",
102
+ multiple: true
103
+ },
104
+ },
105
+ };
106
+ UiSchema.elements[0].elements[0].elements[6] =
107
+ {
108
+ type: "Control",
109
+ scope: "#/properties/proc",
110
+ config: {
111
+ layout: { xs: 6, sm: 6, md: 4, lg: 9 },
112
+ },
113
+ options: {
114
+ widget: "EmptyBox",
115
+ },
116
+ };
117
+ }
118
+
61
119
  if (sessionStorage.getItem("copiedConfig") ) {
62
120
  this.ElementPathSetter(UiSchema);
63
121
  }
@@ -219,16 +277,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
219
277
 
220
278
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
221
279
  const notificationMessages = {
222
- Event: " The event cannot be integrated into the component section.",
223
- Component: "The component cannot be integrated into the event section."
280
+ Events: " The Events cannot be integrated into the component section.",
281
+ Component: "The component cannot be integrated into the Events section."
224
282
  };
225
283
  if(copiedConfig.Handler && elementType === "Component"){
226
284
  store.setNotify({
227
- FailMessage: notificationMessages.Event,
285
+ FailMessage: notificationMessages.Events,
228
286
  Fail: true,
229
287
  });
230
288
  }
231
- else if(copiedConfig.name && elementType === "Event"){
289
+ else if(copiedConfig.name && elementType === "Events"){
232
290
  store.setNotify({
233
291
  FailMessage: notificationMessages.Component,
234
292
  Fail: true,
@@ -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"]