impaktapps-ui-builder 0.0.371 → 0.0.373

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.
@@ -0,0 +1 @@
1
+ export declare const buildDataGrid: (config: any, componentScope: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.371",
3
+ "version": "0.0.373",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,45 @@
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
+ DataGrid.config.main.useWrapper = config.useWrapper === "NO" ? false : true;
29
+ if (config.elevation) {
30
+ DataGrid.config.main.elevation = +config.elevation;
31
+ }
32
+ if (config.height) {
33
+ DataGrid.config.main.height = `${config.height}px`;
34
+ }
35
+ if (config.label) {
36
+ DataGrid.config.main.label = config.label;
37
+ }
38
+ if (config.layout) {
39
+ DataGrid.config.layout = createLayoutFormat(config.layout)
40
+ }
41
+ if (config.style) {
42
+ DataGrid.config.style = JSON.parse(config.style)
43
+ }
44
+ return DataGrid;
45
+ }
@@ -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,11 +24,14 @@ 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
+ }
27
30
  stepper.config.main.resetText = config.resetText || "ResetData";
28
31
  stepper.config.main.completeText = config.completeText || "Complete Text";
29
32
  stepper.config.main.orientation = config.orientation || "horizontal";
30
33
  if (config.sectionLabels) {
31
- stepper.config.main.label = config.sectionLabels.map((e, i: number) => {
34
+ stepper.config.main.steps = config.sectionLabels.map((e, i: number) => {
32
35
  return { label: e.label, id: i }
33
36
  });
34
37
  }
@@ -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" ? true : false
19
+ table.config.main.disableColumnResizing = config.ColumnResizingAvailable === "YES" ? false : true
20
20
  };
21
21
  if (config.DragAvailable) {
22
22
  table.config.main.enableDrag = config.DragAvailable === "YES" ? true : false
@@ -36,6 +36,7 @@ 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";
39
40
  export let schema = {
40
41
  type: "object",
41
42
  properties: {},
@@ -66,14 +67,14 @@ function buildRule(configObj: any, tableName?: string, arrayHolderName?: boolean
66
67
  }
67
68
  }
68
69
  } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && configObj.value?.length > 0) {
69
- if (configObj.type === "Select" ) {
70
+ if (configObj.type === "Select") {
70
71
  schema.properties[configObj.name] = {
71
72
  oneOf: configObj.value.map((e) => {
72
73
  return { const: e.value, title: e.label }
73
74
  })
74
75
  }
75
76
  }
76
- else if (configObj.type === "MultipleSelect" ) {
77
+ else if (configObj.type === "MultipleSelect") {
77
78
  schema.properties[configObj.name] = {
78
79
  items: {
79
80
  oneOf: configObj.value.map((e) => {
@@ -166,6 +167,9 @@ const buildUiSchema = (config: any) => {
166
167
  let elements: any = {};
167
168
  const componentScope = `#/properties/${config.name}`;
168
169
  switch (config.type) {
170
+ case "DataGrid":
171
+ elements = buildDataGrid(config, componentScope);
172
+ break;
169
173
  case "Stepper":
170
174
  elements = buildStepper(config, componentScope);
171
175
  break;
@@ -178,15 +182,15 @@ const buildUiSchema = (config: any) => {
178
182
  case "AadharcardText":
179
183
  elements = buildAdhaarField(config, componentScope);
180
184
  break;
181
- case "PanCardText":
185
+ case "PanCardText":
182
186
  elements = buildPanField(config, componentScope);
183
187
  break;
184
- case "TabSection":
185
- elements = buildTabSection(config, componentScope);
186
- break;
188
+ case "TabSection":
189
+ elements = buildTabSection(config, componentScope);
190
+ break;
187
191
  case "RunnerBoyProgressBar":
188
192
  elements = RunnerBoyProgressbar(config, componentScope);
189
- break;
193
+ break;
190
194
  case "WrapperSection":
191
195
  elements = buildWrapperSection(config, componentScope);
192
196
  break;
@@ -295,17 +299,25 @@ const buildUiSchema = (config: any) => {
295
299
  return elements;
296
300
  }
297
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
+ }
298
308
  elements.elements = config.elements.map((e, elemInd) => {
299
309
  if (e.type) {
300
310
  return {
301
311
  accessorKey: e.name,
302
312
  header: e.label || e.name,
313
+ size: sizeMap[e.name]|| 180,
303
314
  widget: buildUiSchema(e)
304
315
  }
305
316
  }
306
317
  return {
307
318
  accessorKey: e.name,
308
- header: e.label || e.name
319
+ header: e.label || e.name,
320
+ size: sizeMap[e.name]|| 180
309
321
  }
310
322
  })
311
323
  }
@@ -53,7 +53,27 @@ const getArrayControl = (parentScope: string, childScope: string, childLabel?: s
53
53
  },
54
54
  },
55
55
  }
56
- }
56
+ };
57
+ const sizeHolder = getArrayControl("sizeHolder", "keyName", "Component Name");
58
+ sizeHolder.options.detail.elements[1] = {
59
+ type: "Control",
60
+ scope: `#/properties/value`,
61
+
62
+ options: {
63
+ widget: "InputField",
64
+ },
65
+ config: {
66
+ layout: {
67
+ xs: 11,
68
+ sm: 11,
69
+ md: 5.5,
70
+ lg: 5.5,
71
+ },
72
+ main: {
73
+ label: "Size",
74
+ },
75
+ },
76
+ };
57
77
  const getInputField = (scope: String, label: String) => {
58
78
  return {
59
79
  type: "Control",
@@ -160,16 +180,23 @@ const GraphSection = {
160
180
  export const buildPropertiesSection = function (type: String) {
161
181
  let uiSchema = _.cloneDeep(GraphSection);
162
182
  switch (type) {
183
+ case "DataGrid":
184
+ uiSchema.elements = [
185
+ getRadioInputField("useWrapper", "use Item Wrapper", ["YES", "NO"]),
186
+ getInputField("elevation", "Item Wrapper Elevation"),
187
+ ]
188
+ break;
163
189
  case "Stepper":
164
190
  uiSchema.elements = [
165
191
  getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
192
+ getRadioInputField("defaultButtonAvailable", "Use Default Buttons ", ["YES", "NO"]),
166
193
  getInputField("resetText", "Reset Text"),
167
194
  getInputField("completeText", "Complete Text"),
168
195
  getSelectField("orientation", "Orientation Type", [
169
196
  { label: "Horizontal", value: "horizontal" },
170
197
  { label: "Vertical", value: "vertical" },
171
198
  ]),
172
- EmptyBox,
199
+
173
200
  getArrayControl("sectionLabels", "label")
174
201
 
175
202
  ]
@@ -291,6 +318,7 @@ export const buildPropertiesSection = function (type: String) {
291
318
  getRadioInputField("downloadAllData", "Download All Data", ["YES", "NO"]),
292
319
  getInputField("selectKey", "Selection Key"),
293
320
  getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
321
+ sizeHolder
294
322
  ]
295
323
  break;
296
324
  case "Radio":
@@ -10,6 +10,7 @@ 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" },
13
14
  { title: "Date", const: "Date" },
14
15
  { title: "Download File", const: "DownloadFile" },
15
16
  { title: "Empty Box", const: "EmptyBox" },
@@ -141,6 +142,20 @@ export const ComponentSchema: any = {
141
142
  },
142
143
  },
143
144
  },
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
+ },
144
159
  legendLabels: {
145
160
  type: "array",
146
161
  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,6 +35,7 @@ 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"],
38
39
  }
39
40
 
40
41
 
@@ -36,6 +36,7 @@ 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" }
39
40
  ])
40
41
  uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
41
42
  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.data}`);
24
+ document.body.appendChild(link);
25
+ link.click();
26
+ link.parentNode.removeChild(link);
27
+ };
@@ -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