impaktapps-ui-builder 1.0.1-alpha.3 → 1.0.1-alpha.4

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 buildPhoneInputField: (config: any, componentScope: string) => any;
@@ -0,0 +1,20 @@
1
+ declare const PhoneInput: {
2
+ scope: string;
3
+ type: string;
4
+ options: {
5
+ widget: string;
6
+ };
7
+ config: {
8
+ layout: {
9
+ xs: number;
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ };
14
+ main: {
15
+ defaultCountry: string;
16
+ label: string;
17
+ };
18
+ };
19
+ };
20
+ export default PhoneInput;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.1-alpha.3",
3
+ "version": "1.0.1-alpha.4",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,26 @@
1
+ import _ from "lodash";
2
+ import PhoneInput from "./uischema/phoneInput";
3
+ import { createLayoutFormat } from "./buildConfig";
4
+
5
+ export const buildPhoneInputField = (config: any, componentScope: string) => {
6
+ const phonInputField: any = _.cloneDeep(PhoneInput);
7
+ phonInputField.config.main.label = config.label;
8
+ if (config.style) {
9
+ phonInputField.config.style = JSON.parse(config.style)
10
+ }
11
+ // if (config.multiline) {
12
+ // phonInputField.config.main.multiline = config.multiline === "YES" ? true : false;
13
+ // }
14
+ if (config.InputFormatingAndMasking) {
15
+ phonInputField.config.main.formatStrArray = config.InputFormatingAndMasking.map(e => e.formatElement);
16
+ }
17
+ if (config.placeholder) {
18
+ phonInputField.config.main.placeholder = config.placeholder;
19
+ }
20
+ if (config.layout) {
21
+ phonInputField.config.layout = createLayoutFormat(config.layout)
22
+ }
23
+ phonInputField.config.main.errorMessage = `${config.name} is empty or invalid`;
24
+ phonInputField.scope = componentScope;
25
+ return phonInputField;
26
+ }
@@ -1,6 +1,4 @@
1
1
  import _ from "lodash";
2
- import emptyBox from "./uischema/emptyBox";
3
- import cardSlider from "./uischema/cardSlider";
4
2
  import { buildLeaderBoard } from "./buildLeaderboard";
5
3
  import { buildProgressBarCard } from "./buildProgressBarCard";
6
4
  import { buildProgressBar } from "./buildProgressBar";
@@ -40,6 +38,7 @@ import { buildDataGrid } from "./buildDataGrid";
40
38
  import { buildInputSlider } from "./buildInputSlider";
41
39
  import { buildTreeMap } from "./buildTreeMap";
42
40
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
41
+ import { buildPhoneInputField } from "./buildPhoneInput";
43
42
  export let schema = {
44
43
  type: "object",
45
44
  properties: {},
@@ -307,6 +306,8 @@ const buildUiSchema = (config: any, store?: any) => {
307
306
  case "Thought":
308
307
  elements = buildThoughtOfTheDay(config, componentScope);
309
308
  break;
309
+ case "PhoneInput":
310
+ elements = buildPhoneInputField(config, componentScope);
310
311
  break;
311
312
  default:
312
313
  schema = {
@@ -383,7 +384,7 @@ const buildUiSchema = (config: any, store?: any) => {
383
384
 
384
385
  })
385
386
  elements.elements = rowElements;
386
- elements.config.action = tableActionElement;
387
+ elements.config.actions = tableActionElement;
387
388
  elements.config.main.headerIcons.elements = tableHeaderElements;
388
389
  }
389
390
 
@@ -0,0 +1,16 @@
1
+ const PhoneInput = {
2
+ scope: "#/properties/testPhone",
3
+ type: "Control",
4
+ options: {
5
+ widget: "PhoneInput"
6
+ },
7
+ config: {
8
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
9
+ main: {
10
+ defaultCountry: "in",
11
+ label: "Phone"
12
+ }
13
+ }
14
+ };
15
+
16
+ export default PhoneInput;
@@ -41,7 +41,8 @@ export const ComponentSchema: any = {
41
41
  { title: "Upload", const: "UploadFile" },
42
42
  { title: "Tree ", const: "TreeMap" },
43
43
  { title: "Column Group", const: "ColumnGroup" },
44
- { title: "Thought of the day", const: "Thought" }
44
+ { title: "Thought of the day", const: "Thought" },
45
+ { title: "Phone Input", const: "PhoneInput" }
45
46
  ]
46
47
  },
47
48
  elementType: {