impaktapps-ui-builder 0.0.374 → 0.0.376

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.374",
3
+ "version": "0.0.376",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -25,19 +25,25 @@ const dataGrid = {
25
25
  export const buildDataGrid = (config, componentScope) => {
26
26
  const DataGrid: any = _.cloneDeep(dataGrid);
27
27
  DataGrid.scope = componentScope;
28
- DataGrid.config.main.useWrapper = config.useWrapper === "NO" ? false : true;
29
28
  if (config.elevation) {
30
29
  DataGrid.config.main.elevation = +config.elevation;
31
30
  }
31
+ DataGrid.config.main.divider = config.divider === "NO" ? false : true;
32
32
  if (config.height) {
33
33
  DataGrid.config.main.height = `${config.height}px`;
34
34
  }
35
+ if (config.justifyContent) {
36
+ DataGrid.config.main.justifyContent = config.justifyContent;
37
+ }
35
38
  if (config.label) {
36
39
  DataGrid.config.main.label = config.label;
37
40
  }
38
41
  if (config.layout) {
39
42
  DataGrid.config.layout = createLayoutFormat(config.layout)
40
43
  }
44
+ if (config.cardLayout) {
45
+ DataGrid.config.cardLayout = createLayoutFormat(config.cardLayout)
46
+ }
41
47
  if (config.style) {
42
48
  DataGrid.config.style = JSON.parse(config.style)
43
49
  }
@@ -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
@@ -67,14 +67,14 @@ function buildRule(configObj: any, tableName?: string, arrayHolderName?: boolean
67
67
  }
68
68
  }
69
69
  } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && configObj.value?.length > 0) {
70
- if (configObj.type === "Select") {
70
+ if (configObj.type === "Select" ) {
71
71
  schema.properties[configObj.name] = {
72
72
  oneOf: configObj.value.map((e) => {
73
73
  return { const: e.value, title: e.label }
74
74
  })
75
75
  }
76
76
  }
77
- else if (configObj.type === "MultipleSelect") {
77
+ else if (configObj.type === "MultipleSelect" ) {
78
78
  schema.properties[configObj.name] = {
79
79
  items: {
80
80
  oneOf: configObj.value.map((e) => {
@@ -182,15 +182,15 @@ const buildUiSchema = (config: any) => {
182
182
  case "AadharcardText":
183
183
  elements = buildAdhaarField(config, componentScope);
184
184
  break;
185
- case "PanCardText":
185
+ case "PanCardText":
186
186
  elements = buildPanField(config, componentScope);
187
187
  break;
188
- case "TabSection":
189
- elements = buildTabSection(config, componentScope);
190
- break;
188
+ case "TabSection":
189
+ elements = buildTabSection(config, componentScope);
190
+ break;
191
191
  case "RunnerBoyProgressBar":
192
192
  elements = RunnerBoyProgressbar(config, componentScope);
193
- break;
193
+ break;
194
194
  case "WrapperSection":
195
195
  elements = buildWrapperSection(config, componentScope);
196
196
  break;
@@ -299,25 +299,17 @@ const buildUiSchema = (config: any) => {
299
299
  return elements;
300
300
  }
301
301
  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
302
  elements.elements = config.elements.map((e, elemInd) => {
309
303
  if (e.type) {
310
304
  return {
311
305
  accessorKey: e.name,
312
306
  header: e.label || e.name,
313
- size: sizeMap[e.name]|| 180,
314
307
  widget: buildUiSchema(e)
315
308
  }
316
309
  }
317
310
  return {
318
311
  accessorKey: e.name,
319
- header: e.label || e.name,
320
- size: sizeMap[e.name]|| 180
312
+ header: e.label || e.name
321
313
  }
322
314
  })
323
315
  }
@@ -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
  }
@@ -1,4 +1,3 @@
1
-
2
1
  import _ from "lodash";
3
2
  const EmptyBox = {
4
3
  type: "Control",
@@ -19,6 +18,61 @@ const EmptyBox = {
19
18
  },
20
19
  },
21
20
  };
21
+ const cardLayout = {
22
+ type: "Control",
23
+ scope: "#/properties/cardLayout",
24
+ layout: 11.5,
25
+ options: {
26
+ detail: {
27
+ type: "HorizontalLayout",
28
+ elements: [
29
+ {
30
+ type: "Control",
31
+ scope: "#/properties/key",
32
+ options: {
33
+ widget: "SelectInputField",
34
+ },
35
+ config: {
36
+ layout: {
37
+ xs: 11,
38
+ sm: 11,
39
+ md: 5.5,
40
+ lg: 5.5,
41
+ },
42
+ main: {
43
+ label: "Screen Size",
44
+
45
+ },
46
+ },
47
+ },
48
+ {
49
+ type: "Control",
50
+ scope: "#/properties/value",
51
+
52
+ options: {
53
+ widget: "InputField",
54
+ },
55
+ config: {
56
+ layout: {
57
+ xs: 11,
58
+ sm: 11,
59
+ md: 5.5,
60
+ lg: 5.5,
61
+ },
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.",
68
+
69
+ },
70
+ },
71
+ },
72
+ ],
73
+ },
74
+ },
75
+ };
22
76
  const getArrayControl = (parentScope: string, childScope: string, childLabel?: string,) => {
23
77
  return {
24
78
  type: "Control",
@@ -182,21 +236,23 @@ export const buildPropertiesSection = function (type: String) {
182
236
  switch (type) {
183
237
  case "DataGrid":
184
238
  uiSchema.elements = [
185
- getRadioInputField("useWrapper", "use Item Wrapper", ["YES", "NO"]),
186
- getInputField("elevation", "Item Wrapper Elevation"),
239
+ getRadioInputField("divider", "Use Header divider", ["YES", "NO"]),
240
+ getInputField("elevation", "Card Elevation"),
241
+ getInputField("height", "Grid height"),
242
+ getInputField("justifyContent", "justifyContent"),
243
+ cardLayout,
187
244
  ]
188
245
  break;
189
246
  case "Stepper":
190
247
  uiSchema.elements = [
191
248
  getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
192
- getRadioInputField("defaultButtonAvailable", "Use Default Buttons ", ["YES", "NO"]),
193
249
  getInputField("resetText", "Reset Text"),
194
250
  getInputField("completeText", "Complete Text"),
195
251
  getSelectField("orientation", "Orientation Type", [
196
252
  { label: "Horizontal", value: "horizontal" },
197
253
  { label: "Vertical", value: "vertical" },
198
254
  ]),
199
-
255
+ EmptyBox,
200
256
  getArrayControl("sectionLabels", "label")
201
257
 
202
258
  ]
@@ -318,7 +374,6 @@ export const buildPropertiesSection = function (type: String) {
318
374
  getRadioInputField("downloadAllData", "Download All Data", ["YES", "NO"]),
319
375
  getInputField("selectKey", "Selection Key"),
320
376
  getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
321
- sizeHolder
322
377
  ]
323
378
  break;
324
379
  case "Radio":
@@ -73,6 +73,27 @@ export const ComponentSchema: any = {
73
73
  },
74
74
  },
75
75
  },
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
+ },
76
97
  value: {
77
98
  type: "array",
78
99
  items: {
@@ -142,20 +163,6 @@ export const ComponentSchema: any = {
142
163
  },
143
164
  },
144
165
  },
145
- sizeHolder: {
146
- type: "array",
147
- items: {
148
- type: "object",
149
- properties: {
150
- keyName: {
151
- type: "string",
152
- },
153
- value:{
154
- type:"string"
155
- }
156
- },
157
- },
158
- },
159
166
  legendLabels: {
160
167
  type: "array",
161
168
  items: {
@@ -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"]
@@ -17,11 +17,11 @@ export const downloadFile = (obj: any) => {
17
17
  };
18
18
 
19
19
  export const download = (response: any) => {
20
- const url = window.URL.createObjectURL(new Blob([response.data]));
21
- const link = document.createElement('a');
22
- link.href = url;
23
- link.setAttribute('download', `${response.headers.data}`);
24
- document.body.appendChild(link);
25
- link.click();
26
- link.parentNode.removeChild(link);
27
- };
20
+ const url = window.URL.createObjectURL(new Blob([response.data]));
21
+ const link = document.createElement('a');
22
+ link.href = url;
23
+ link.setAttribute('download', `${response.headers.filename}`);
24
+ document.body.appendChild(link);
25
+ link.click();
26
+ link.parentNode.removeChild(link);
27
+ };
@@ -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 }, eventGroups
65
+ serviceHolder: { downloadFile,download }, eventGroups
66
66
  };
67
67
  return {
68
68
  setPage: async function () {
@@ -192,7 +192,7 @@ export default (funcParams: funcParamsProps) => {
192
192
  }
193
193
  },
194
194
  downloadFile: downloadFile,
195
- download:download,
195
+ download:download
196
196
  };
197
197
  };
198
198