impaktapps-ui-builder 0.0.101-alpha.266 → 0.0.101-alpha.268

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;
@@ -9,7 +9,6 @@ declare const _default: {
9
9
  main: {
10
10
  onMount: string;
11
11
  enableExpandAll: boolean;
12
- headerIcons: {};
13
12
  allRowData: any[];
14
13
  downloadAllData: boolean;
15
14
  columns: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.101-alpha.266",
3
+ "version": "0.0.101-alpha.268",
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 = {
@@ -337,56 +338,40 @@ const buildUiSchema = (config: any, store?: any) => {
337
338
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : []
338
339
  }
339
340
  })
340
- } else if (config.type == "Table") {
341
+ } else if (config.type == "Table") {
341
342
  const sizeMap = {}
342
-
343
+
343
344
  if (config.sizeHolder) {
344
345
  config.sizeHolder.map((e, i) => {
345
346
  sizeMap[e.keyName] = e.value
346
347
  });
347
348
  }
348
- const tableHeaderElements = [];
349
- const tableActionElement = [];
350
- const rowElements = []
351
- config.elements.filter((cellElem, elemInd) => {
349
+
350
+ elements.elements = config.elements.map((cellElem, elemInd) => {
352
351
  const commonProperties = {
353
352
  accessorKey: cellElem.name,
354
353
  type: cellElem.columnFormat,
355
354
  header: cellElem.label || cellElem.name,
356
355
  size: sizeMap[cellElem.name] || 180,
357
- enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
356
+ enableColumnFilter: cellElem.enableFilter === "No"?false:true,
358
357
  columnFilterModeOptions: cellElem.filteringOptions,
359
358
  enableSorting: cellElem.enableSorting === "No" ? false : true,
360
359
  columnKey: cellElem.columnKey
361
360
  }
362
361
  if (cellElem.type) {
363
- if (cellElem.elementType == "action") {
364
- const actionElem = buildUiSchema(cellElem, store);
365
- tableActionElement.push(actionElem);
366
- return false;
367
- }
368
- if (cellElem.elementType == "tableHeader") {
369
- const headerElem = buildUiSchema(cellElem, store);
370
- tableHeaderElements.push({widget:headerElem});
371
- return false;
372
- }
373
- const tableElem = {
362
+ return {
374
363
  widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
375
364
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
376
365
  ...commonProperties
377
-
366
+
378
367
  }
379
- rowElements.push(tableElem)
380
368
  } else {
381
- rowElements.push({ ...commonProperties })
369
+ return commonProperties
382
370
  }
383
-
371
+
384
372
  })
385
- elements.elements = rowElements;
386
- elements.config.action = tableActionElement;
387
- elements.config.main.headerIcons.elements = tableHeaderElements;
388
373
  }
389
-
374
+
390
375
  else if (config.type == "Array") {
391
376
  elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
392
377
  return buildUiSchema(e, store)
@@ -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;
@@ -9,7 +9,6 @@ export default {
9
9
  main: {
10
10
  onMount: "onMount",
11
11
  enableExpandAll: true,
12
- headerIcons:{},
13
12
  allRowData: [],
14
13
  downloadAllData: false,
15
14
  columns: {
@@ -1,4 +1,3 @@
1
- //headerIcons //action //elements
2
1
  export const ComponentSchema: any = {
3
2
  type: "object",
4
3
  properties: {
@@ -41,14 +40,8 @@ export const ComponentSchema: any = {
41
40
  { title: "Upload", const: "UploadFile" },
42
41
  { title: "Tree ", const: "TreeMap" },
43
42
  { title: "Column Group", const: "ColumnGroup" },
44
- { title: "Thought of the day", const: "Thought" }
45
- ]
46
- },
47
- elementType: {
48
- oneOf: [
49
- { title: "Table Action Element", const: "action" },
50
- { title: "Table Header Element", const: "tableHeader" },
51
- { title: "Table Element", const: "element" },
43
+ { title: "Thought of the day", const: "Thought" },
44
+ { title: "Phone Input", const: "PhoneInput" }
52
45
  ]
53
46
  },
54
47
  columnFormat: {
@@ -143,19 +143,16 @@ export function refreshPage(type: string, store: any) {
143
143
  },
144
144
  },
145
145
  UiSchema.elements[0].elements[0].elements[9] =
146
- {
146
+ {
147
147
  type: "Control",
148
- scope: "#/properties/elementType",
149
- options: {
150
- widget: "SelectInputField",
151
- },
148
+ scope: "#/properties/proc",
152
149
  config: {
153
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
154
- main: {
155
- label: "Element Type",
156
- },
150
+ layout: { xs: 0, sm: 0, md: 4, lg: 0 },
157
151
  },
158
- }
152
+ options: {
153
+ widget: "EmptyBox",
154
+ },
155
+ };
159
156
  }
160
157
 
161
158
  if (sessionStorage.getItem("copiedConfig") ) {
@@ -78,7 +78,6 @@ export default (funcParams: funcParamsProps) => {
78
78
  setPage: async function () {
79
79
  funcParams.store.setAdditionalErrors([]);
80
80
  funcParams.store.setFormdata({});
81
- funcParams.store.setSchema({ type: "object", properties: {} });
82
81
  funcParams.store.newData = {};
83
82
  const pageBasicDetailString = sessionStorage.getItem("pagemasterMetaData")
84
83
  if (pageBasicDetailString) {
@@ -286,7 +285,7 @@ export default (funcParams: funcParamsProps) => {
286
285
  { key: "searchValue", value: param.serachValue },
287
286
  { key: "currentValue", value: param.currentValue }
288
287
  ]
289
- const response = await this.callExecuteEvents(param, apiBody, "onLoad");
288
+ const response = await this.callExecuteEvents(param, apiBody);
290
289
  return response?.data;
291
290
  }
292
291
  },