impaktapps-ui-builder 0.0.382 → 0.0.384

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 (22) hide show
  1. package/dist/impaktapps-ui-builder.es.js +23 -186
  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/elements/UiSchema/PageMaster/schema.d.ts +6 -0
  6. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +6 -0
  7. package/package.json +1 -1
  8. package/src/impaktapps-ui-builder/builder/build/buildStepper.ts +2 -5
  9. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +1 -1
  10. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +8 -20
  11. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +0 -4
  12. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +2 -88
  13. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +0 -36
  14. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +42 -33
  15. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +8 -4
  16. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +1 -1
  17. package/src/impaktapps-ui-builder/builder/services/component.ts +0 -1
  18. package/src/impaktapps-ui-builder/builder/services/event.ts +0 -1
  19. package/src/impaktapps-ui-builder/runtime/services/events.ts +1 -1
  20. package/src/impaktapps-ui-builder/runtime/services/service.ts +1 -1
  21. package/dist/src/impaktapps-ui-builder/builder/build/buildDataGrid.d.ts +0 -1
  22. package/src/impaktapps-ui-builder/builder/build/buildDataGrid.ts +0 -51
@@ -22,6 +22,12 @@ export declare const PageMasterSchema: {
22
22
  };
23
23
  };
24
24
  };
25
+ template: {
26
+ oneOf: {
27
+ const: string;
28
+ title: string;
29
+ }[];
30
+ };
25
31
  sectionLabels: {
26
32
  type: string;
27
33
  items: {
@@ -33,6 +33,12 @@ declare const _default: (funcParams: funcParamsProps) => {
33
33
  };
34
34
  };
35
35
  };
36
+ template: {
37
+ oneOf: {
38
+ const: string;
39
+ title: string;
40
+ }[];
41
+ };
36
42
  sectionLabels: {
37
43
  type: string;
38
44
  items: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.382",
3
+ "version": "0.0.384",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -10,7 +10,7 @@ const Stepper = {
10
10
 
11
11
  config: {
12
12
  main: {
13
- steps: [{ label: "First" }, { label: "Second" }, { label: "Third" }],
13
+ steps:[{label:"First"}, {label:"Second"},{label: "Third"}],
14
14
  resetButton: false,
15
15
  resetText: "Reset",
16
16
  orientation: "vertical"
@@ -24,14 +24,11 @@ export const buildStepper = (config, componentScope) => {
24
24
  const stepper: any = _.cloneDeep(Stepper);
25
25
  stepper.scope = componentScope;
26
26
  stepper.config.main.resetButton = config.resetButton === "YES" ? true : false;
27
- if (config.defaultButtonAvailable) {
28
- stepper.config.main.defaultButtonAvailable = config.defaultButtonAvailable === "YES" ? true : false;
29
- }
30
27
  stepper.config.main.resetText = config.resetText || "ResetData";
31
28
  stepper.config.main.completeText = config.completeText || "Complete Text";
32
29
  stepper.config.main.orientation = config.orientation || "horizontal";
33
30
  if (config.sectionLabels) {
34
- stepper.config.main.steps = config.sectionLabels.map((e, i: number) => {
31
+ stepper.config.main.label = config.sectionLabels.map((e, i: number) => {
35
32
  return { label: e.label, id: i }
36
33
  });
37
34
  }
@@ -16,7 +16,7 @@ export const buildTable = (config: any, componentScope: string) => {
16
16
  table.config.main.Selection = config.SelectionAvailable === "YES" ? true : false
17
17
  };
18
18
  if (config.ColumnResizingAvailable) {
19
- table.config.main.disableColumnResizing = config.ColumnResizingAvailable === "YES" ? false : true
19
+ table.config.main.disableColumnResizing = config.ColumnResizingAvailable === "YES" ? true : false
20
20
  };
21
21
  if (config.DragAvailable) {
22
22
  table.config.main.enableDrag = config.DragAvailable === "YES" ? true : false
@@ -36,7 +36,6 @@ import { buildAdhaarField, buildPanField } from "./buildAadharCard";
36
36
  import { buildFileInput } from "./buildFileInput";
37
37
  import { buildStepper } from "./buildStepper";
38
38
  import { buildPopUp } from "./buildPop";
39
- import { buildDataGrid } from "./buildDataGrid";
40
39
  export let schema = {
41
40
  type: "object",
42
41
  properties: {},
@@ -67,14 +66,14 @@ function buildRule(configObj: any, tableName?: string, arrayHolderName?: boolean
67
66
  }
68
67
  }
69
68
  } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && configObj.value?.length > 0) {
70
- if (configObj.type === "Select") {
69
+ if (configObj.type === "Select" ) {
71
70
  schema.properties[configObj.name] = {
72
71
  oneOf: configObj.value.map((e) => {
73
72
  return { const: e.value, title: e.label }
74
73
  })
75
74
  }
76
75
  }
77
- else if (configObj.type === "MultipleSelect") {
76
+ else if (configObj.type === "MultipleSelect" ) {
78
77
  schema.properties[configObj.name] = {
79
78
  items: {
80
79
  oneOf: configObj.value.map((e) => {
@@ -167,9 +166,6 @@ const buildUiSchema = (config: any) => {
167
166
  let elements: any = {};
168
167
  const componentScope = `#/properties/${config.name}`;
169
168
  switch (config.type) {
170
- case "DataGrid":
171
- elements = buildDataGrid(config, componentScope);
172
- break;
173
169
  case "Stepper":
174
170
  elements = buildStepper(config, componentScope);
175
171
  break;
@@ -182,15 +178,15 @@ const buildUiSchema = (config: any) => {
182
178
  case "AadharcardText":
183
179
  elements = buildAdhaarField(config, componentScope);
184
180
  break;
185
- case "PanCardText":
181
+ case "PanCardText":
186
182
  elements = buildPanField(config, componentScope);
187
183
  break;
188
- case "TabSection":
189
- elements = buildTabSection(config, componentScope);
190
- break;
184
+ case "TabSection":
185
+ elements = buildTabSection(config, componentScope);
186
+ break;
191
187
  case "RunnerBoyProgressBar":
192
188
  elements = RunnerBoyProgressbar(config, componentScope);
193
- break;
189
+ break;
194
190
  case "WrapperSection":
195
191
  elements = buildWrapperSection(config, componentScope);
196
192
  break;
@@ -299,25 +295,17 @@ const buildUiSchema = (config: any) => {
299
295
  return elements;
300
296
  }
301
297
  else if (config.type == "Table") {
302
- const sizeMap = {}
303
- if (config.sizeHolder) {
304
- config.sizeHolder.map((e, i) => {
305
- sizeMap[e.keyName] = e.value
306
- });
307
- }
308
298
  elements.elements = config.elements.map((e, elemInd) => {
309
299
  if (e.type) {
310
300
  return {
311
301
  accessorKey: e.name,
312
302
  header: e.label || e.name,
313
- size: sizeMap[e.name]|| 180,
314
303
  widget: buildUiSchema(e)
315
304
  }
316
305
  }
317
306
  return {
318
307
  accessorKey: e.name,
319
- header: e.label || e.name,
320
- size: sizeMap[e.name]|| 180
308
+ header: e.label || e.name
321
309
  }
322
310
  })
323
311
  }
@@ -1,4 +1,3 @@
1
- import { createLayoutFormat } from "./buildConfig";
2
1
  import WrapperSection from "./uischema/wrapperSection";
3
2
  import _ from "lodash";
4
3
 
@@ -9,8 +8,5 @@ export const buildWrapperSection = (config,componentScope) =>{
9
8
  if (config.style) {
10
9
  wrapper.config.style = JSON.parse(config.style)
11
10
  }
12
- if (config.layout) {
13
- wrapper.config.layout = createLayoutFormat(config.layout)
14
- }
15
11
  return wrapper;
16
12
  }
@@ -19,61 +19,6 @@ const EmptyBox = {
19
19
  },
20
20
  },
21
21
  };
22
- const cardLayout = {
23
- type: "Control",
24
- scope: "#/properties/cardLayout",
25
- layout: 11.5,
26
- options: {
27
- detail: {
28
- type: "HorizontalLayout",
29
- elements: [
30
- {
31
- type: "Control",
32
- scope: "#/properties/key",
33
- options: {
34
- widget: "SelectInputField",
35
- },
36
- config: {
37
- layout: {
38
- xs: 11,
39
- sm: 11,
40
- md: 5.5,
41
- lg: 5.5,
42
- },
43
- main: {
44
- label: "Screen Size",
45
-
46
- },
47
- },
48
- },
49
- {
50
- type: "Control",
51
- scope: "#/properties/value",
52
-
53
- options: {
54
- widget: "InputField",
55
- },
56
- config: {
57
- layout: {
58
- xs: 11,
59
- sm: 11,
60
- md: 5.5,
61
- lg: 5.5,
62
- },
63
- main: {
64
- label: "Value",
65
- type:"number",
66
- // freeSolo:true,
67
- helperText:'Number should be in range of 0 to 12',
68
- errorMessage:"Number Can't be greater than 12 and can't be less than 0.",
69
-
70
- },
71
- },
72
- },
73
- ],
74
- },
75
- },
76
- };
77
22
  const getArrayControl = (parentScope: string, childScope: string, childLabel?: string,) => {
78
23
  return {
79
24
  type: "Control",
@@ -108,27 +53,7 @@ const getArrayControl = (parentScope: string, childScope: string, childLabel?: s
108
53
  },
109
54
  },
110
55
  }
111
- };
112
- const sizeHolder = getArrayControl("sizeHolder", "keyName", "Component Name");
113
- sizeHolder.options.detail.elements[1] = {
114
- type: "Control",
115
- scope: `#/properties/value`,
116
-
117
- options: {
118
- widget: "InputField",
119
- },
120
- config: {
121
- layout: {
122
- xs: 11,
123
- sm: 11,
124
- md: 5.5,
125
- lg: 5.5,
126
- },
127
- main: {
128
- label: "Size",
129
- },
130
- },
131
- };
56
+ }
132
57
  const getInputField = (scope: String, label: String) => {
133
58
  return {
134
59
  type: "Control",
@@ -235,26 +160,16 @@ const GraphSection = {
235
160
  export const buildPropertiesSection = function (type: String) {
236
161
  let uiSchema = _.cloneDeep(GraphSection);
237
162
  switch (type) {
238
- case "DataGrid":
239
- uiSchema.elements = [
240
- getRadioInputField("divider", "Use Header divider", ["YES", "NO"]),
241
- getInputField("elevation", "Card Elevation"),
242
- getInputField("height", "Grid height"),
243
- getInputField("justifyContent", "justifyContent"),
244
- cardLayout,
245
- ]
246
- break;
247
163
  case "Stepper":
248
164
  uiSchema.elements = [
249
165
  getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
250
- getRadioInputField("defaultButtonAvailable", "Use Default Buttons ", ["YES", "NO"]),
251
166
  getInputField("resetText", "Reset Text"),
252
167
  getInputField("completeText", "Complete Text"),
253
168
  getSelectField("orientation", "Orientation Type", [
254
169
  { label: "Horizontal", value: "horizontal" },
255
170
  { label: "Vertical", value: "vertical" },
256
171
  ]),
257
-
172
+ EmptyBox,
258
173
  getArrayControl("sectionLabels", "label")
259
174
 
260
175
  ]
@@ -376,7 +291,6 @@ export const buildPropertiesSection = function (type: String) {
376
291
  getRadioInputField("downloadAllData", "Download All Data", ["YES", "NO"]),
377
292
  getInputField("selectKey", "Selection Key"),
378
293
  getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
379
- sizeHolder
380
294
  ]
381
295
  break;
382
296
  case "Radio":
@@ -10,7 +10,6 @@ export const ComponentSchema: any = {
10
10
  { title: "Card", const: "card" },
11
11
  { title: "CheckBox", const: "CheckBox" },
12
12
  { title: "Container", const: "WrapperSection" },
13
- { title: "DataGrid", const: "DataGrid" },
14
13
  { title: "Date", const: "Date" },
15
14
  { title: "Download File", const: "DownloadFile" },
16
15
  { title: "Empty Box", const: "EmptyBox" },
@@ -73,27 +72,6 @@ export const ComponentSchema: any = {
73
72
  },
74
73
  },
75
74
  },
76
- cardLayout: {
77
- type: "array",
78
- items: {
79
- type: "object",
80
- properties: {
81
- key: {
82
- type: "string",
83
- oneOf: [
84
- { title: "Extra Small", const: "xs" },
85
- { title: "Small", const: "sm" },
86
- { title: "Medium", const: "md" },
87
- { title: "Large", const: "lg" },
88
- ],
89
- },
90
- value: {
91
- // type: "string",
92
-
93
- },
94
- },
95
- },
96
- },
97
75
  value: {
98
76
  type: "array",
99
77
  items: {
@@ -163,20 +141,6 @@ export const ComponentSchema: any = {
163
141
  },
164
142
  },
165
143
  },
166
- sizeHolder: {
167
- type: "array",
168
- items: {
169
- type: "object",
170
- properties: {
171
- keyName: {
172
- type: "string",
173
- },
174
- value:{
175
- type:"string"
176
- }
177
- },
178
- },
179
- },
180
144
  legendLabels: {
181
145
  type: "array",
182
146
  items: {
@@ -1,39 +1,48 @@
1
- export const PageMasterSchema = {
2
- type: "object",
3
- properties: {
4
- name:{
5
- type:"string",
6
- minLength: 6,
7
- // pattern: '^page_\\w+$'
8
- },
9
- label:{
10
- type:"string",
11
- },
12
- layout: {
13
- type: "array",
14
- items: {
15
- type: "object",
16
- properties: {
17
- layout_key: {
18
- type: "string",
19
- },
20
- layout_value: {
21
- type: "string",
22
- },
1
+ import { template } from "lodash";
2
+
3
+ export const PageMasterSchema = {
4
+ type: "object",
5
+ properties: {
6
+ name: {
7
+ type: "string",
8
+ minLength: 6,
9
+ // pattern: '^page_\\w+$'
10
+ },
11
+ label: {
12
+ type: "string",
13
+ },
14
+ layout: {
15
+ type: "array",
16
+ items: {
17
+ type: "object",
18
+ properties: {
19
+ layout_key: {
20
+ type: "string",
21
+ },
22
+ layout_value: {
23
+ type: "string",
23
24
  },
24
25
  },
25
26
  },
27
+ },
28
+ template: {
29
+ oneOf: [
30
+ { const: "template1", title: "template1" },
31
+ { const: "template2", title: "template2" },
32
+ { const: "template3", title: "template3" }
33
+ ]
34
+ },
26
35
  sectionLabels: {
27
- type: "array",
28
- items: {
29
- type: "object",
30
- properties: {
31
- label: {
32
- type: "string",
33
- }
34
- },
36
+ type: "array",
37
+ items: {
38
+ type: "object",
39
+ properties: {
40
+ label: {
41
+ type: "string",
42
+ }
35
43
  },
36
- }
37
- },
38
- required:["label","name"]
44
+ },
45
+ }
46
+ },
47
+ required: ["template", "name"]
39
48
  }
@@ -80,16 +80,20 @@ export const PageMasterUiSchema: any = {
80
80
  },
81
81
  {
82
82
  type: "Control",
83
- scope: "#/properties/label",
83
+ scope: "#/properties/template",
84
84
 
85
85
  options: {
86
- widget: "InputField",
86
+ widget: "SelectInputField",
87
87
  },
88
88
  config: {
89
89
  layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
90
90
  main: {
91
- label: "Label",
92
- options: [],
91
+ label: "Template",
92
+ options: [
93
+ {const:"template1",title:"template1"},
94
+ {const:"template2",title:"template2"},
95
+ {const:"template3",title:"template3"}
96
+ ],
93
97
  color: "secondary",
94
98
  required: true,
95
99
  },
@@ -65,7 +65,7 @@ export const EventSchema = {
65
65
  oneOf: [
66
66
  { title: "RankProvider", const: "RankProvider" },
67
67
  { title: "Download File", const: "downloadFile" },
68
- { title: "Download", const: "download" }
68
+ { title: "Download", const: "download" },
69
69
  ]
70
70
  },
71
71
  body: {
@@ -35,7 +35,6 @@ const sectionLabels = {
35
35
  TextArea:["Core","Properties","style", "Event","Validation"],
36
36
  PopUp: ["Core", "Components","Properties", "style"],
37
37
  Stepper: ["Core", "Components","Properties","Event", "style"],
38
- DataGrid: ["Core", "Components","Properties","Event", "style"],
39
38
  }
40
39
 
41
40
 
@@ -36,7 +36,6 @@ export default (
36
36
  uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
37
37
  { label: "RankProvider", value: "RankProvider" },
38
38
  { label: "Download File", value: "downloadFile" },
39
- { label: "Download Blob File", value: "downloadBlobFile" }
40
39
  ])
41
40
  uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
42
41
  schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
@@ -87,7 +87,7 @@ async function executeInBuiltFunctionHandler(params: handlersProps) {
87
87
  const makeFunc = eval(params.config.funcParametersCode)
88
88
  parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
89
89
  }
90
- params.serviceHolder[params.config.inBuiltFunctionType](parameter,params.service)
90
+ params.serviceHolder[params.config.inBuiltFunctionType](parameter)
91
91
  }
92
92
 
93
93
  async function executeCustomHandler(params: handlersProps) {
@@ -62,7 +62,7 @@ export default (funcParams: funcParamsProps) => {
62
62
  let executeEventsParameters: handlersProps = {
63
63
  config: {}, componentName: "",
64
64
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
65
- serviceHolder: { downloadFile ,download:doDownload}, eventGroups
65
+ serviceHolder: { downloadFile,download:doDownload }, eventGroups
66
66
  };
67
67
  return {
68
68
  setPage: async function () {
@@ -1 +0,0 @@
1
- export declare const buildDataGrid: (config: any, componentScope: any) => any;
@@ -1,51 +0,0 @@
1
- import _ from "lodash";
2
- import { createLayoutFormat } from "./buildConfig";
3
-
4
- const dataGrid = {
5
- "type": "Control",
6
- "scope": "#/properties/dataGrid",
7
- "layout": 12,
8
- "options": {
9
- "widget": "DataGrid"
10
- },
11
- elements: [
12
- ],
13
- "config": {
14
- "main": {
15
- // "label": "Data Grid",
16
- elevation: 0,
17
- useWrapper: false
18
- },
19
- style: {
20
-
21
- }
22
- }
23
- };
24
-
25
- export const buildDataGrid = (config, componentScope) => {
26
- const DataGrid: any = _.cloneDeep(dataGrid);
27
- DataGrid.scope = componentScope;
28
- if (config.elevation) {
29
- DataGrid.config.main.elevation = +config.elevation;
30
- }
31
- DataGrid.config.main.divider = config.divider === "NO" ? false : true;
32
- if (config.height) {
33
- DataGrid.config.main.height = `${config.height}px`;
34
- }
35
- if (config.justifyContent) {
36
- DataGrid.config.main.justifyContent = config.justifyContent;
37
- }
38
- if (config.label) {
39
- DataGrid.config.main.label = config.label;
40
- }
41
- if (config.layout) {
42
- DataGrid.config.layout = createLayoutFormat(config.layout)
43
- }
44
- if (config.cardLayout) {
45
- DataGrid.config.cardLayout = createLayoutFormat(config.cardLayout)
46
- }
47
- if (config.style) {
48
- DataGrid.config.style = JSON.parse(config.style)
49
- }
50
- return DataGrid;
51
- }