impaktapps-ui-builder 0.0.303 → 0.0.304

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,2 @@
1
+ export declare const buildAdhaarField: (config: any, componentScope: string) => any;
2
+ export declare const buildPanField: (config: any, componentScope: string) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.303",
3
+ "version": "0.0.304",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,95 @@
1
+ import _ from "lodash";
2
+
3
+ import { createLayoutFormat } from "./buildConfig";
4
+
5
+
6
+ const TextField = {
7
+ type: "Control",
8
+ scope: "#/properties/text",
9
+
10
+ options: {
11
+ widget: "InputField",
12
+ },
13
+ config: {
14
+ layout: {
15
+ xs: 11,
16
+ sm: 11,
17
+ md: 5.5,
18
+ lg: 5.5,
19
+ },
20
+ main: {
21
+ label:"Aadhaar No.",
22
+ max:2000,
23
+ step:200,
24
+ autoFormat:true,
25
+ // patternRegex:"^[A-Z]{5}[0-9]{4}[A-Z]$",
26
+ patternRegex:"^[0-9\\s]*$",
27
+ // valueLength:14,
28
+ spaceIndex:4,
29
+ autoMaskLength:4,
30
+ autoMask:true,
31
+ defaultStyle:true
32
+ },
33
+ style:{}
34
+ },
35
+ }
36
+
37
+ export const buildAdhaarField = (config:any,componentScope:string) =>{
38
+ const inputField: any = _.cloneDeep(TextField);
39
+ inputField.config.main.label = config.label;
40
+ if (config.style) {
41
+ inputField.config.style = JSON.parse(config.style)
42
+ }
43
+ if (config.layout) {
44
+ inputField.config.layout = createLayoutFormat(config.layout)
45
+ }
46
+ inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
47
+ inputField.scope = componentScope;
48
+ return inputField;
49
+ }
50
+
51
+
52
+ const PanField = {
53
+ type: "Control",
54
+ scope: "#/properties/text",
55
+
56
+ options: {
57
+ widget: "InputField",
58
+ },
59
+ config: {
60
+ layout: {
61
+ xs: 11,
62
+ sm: 11,
63
+ md: 5.5,
64
+ lg: 5.5,
65
+ },
66
+ main: {
67
+ label:"Aadhaar No.",
68
+ max:2000,
69
+ step:200,
70
+ // autoFormat:true,
71
+ patternRegex:"^[A-Z]{5}[0-9]{4}[A-Z]$",
72
+ // patternRegex:"^[0-9\\s]*$",
73
+ // valueLength:14,
74
+ spaceIndex:4,
75
+ autoMaskLength:4,
76
+ // autoMask:true,
77
+ defaultStyle:true
78
+ },
79
+ style:{}
80
+ },
81
+ }
82
+
83
+ export const buildPanField = (config:any,componentScope:string) =>{
84
+ const inputField: any = _.cloneDeep(PanField);
85
+ inputField.config.main.label = config.label;
86
+ if (config.style) {
87
+ inputField.config.style = JSON.parse(config.style)
88
+ }
89
+ if (config.layout) {
90
+ inputField.config.layout = createLayoutFormat(config.layout)
91
+ }
92
+ inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
93
+ inputField.scope = componentScope;
94
+ return inputField;
95
+ }
@@ -32,6 +32,7 @@ import { buildLineGraph } from "./buildLineGraph";
32
32
  import { buildRadio } from "./buildRadio";
33
33
  import { buildEmptyBox } from "./buildEmptyBox";
34
34
  import { buildArray } from "./buildArray";
35
+ import { buildAdhaarField, buildPanField } from "./buildAadharCard";
35
36
  export let schema = {
36
37
  type: "object",
37
38
  properties: {},
@@ -162,6 +163,15 @@ const buildUiSchema = (config: any) => {
162
163
  let elements: any = {};
163
164
  const componentScope = `#/properties/${config.name}`;
164
165
  switch (config.type) {
166
+ case "AadharcardText":
167
+ elements = buildAdhaarField(config, componentScope);
168
+ break;
169
+ case "PanCardText":
170
+ elements = buildPanField(config, componentScope);
171
+ break;
172
+ case "TabSection":
173
+ elements = buildTabSection(config, componentScope);
174
+ break;
165
175
  case "RunnerBoyProgressBar":
166
176
  elements = RunnerBoyProgressbar(config, componentScope);
167
177
 
@@ -4,6 +4,7 @@ export const ComponentSchema: any = {
4
4
  type: {
5
5
  type: "string",
6
6
  oneOf: [
7
+ { title: "AadharcardText", const: "AadharcardText"},
7
8
  { title: "Array", const: "Array" },
8
9
  { title: "Button", const: "Button" },
9
10
  { title: "Card", const: "card" },
@@ -16,6 +17,7 @@ export const ComponentSchema: any = {
16
17
  { title: "Label", const: "Box" },
17
18
  { title: "LeaderBoard", const: "LeaderBoard" },
18
19
  { title: "MultipleSelect", const: "MultipleSelect" },
20
+ { title: "PanCardText", const: "PanCardText" },
19
21
  { title: "ProgressBar", const: "ProgressBar" },
20
22
  { title: "ProgressBar Card", const: "ProgressBarCard" },
21
23
  { title: "Select", const: "Select" },