impaktapps-ui-builder 1.0.77 → 1.0.78

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 buildUploadArray: (config: any, componentScope: string) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.77",
3
+ "version": "1.0.78",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -44,6 +44,7 @@ import { buildHorizontalLayout } from "./buildHorizontalLayout";
44
44
  import { buildImage } from "./buildImage";
45
45
  import { buildUploadFileIcon } from "./buildUploadFileIcon";
46
46
  import { buildDeleteFileIcon } from "./buildDeleteFileIcon"
47
+ import { buildUploadArray } from "./buildUploadArray";
47
48
  export let schema = {
48
49
  type: "object",
49
50
  properties: {},
@@ -160,6 +161,21 @@ export const buildSchema = (config: any, tableName?: string, isArrayType?: boole
160
161
  buildSchema(e, config.name, config.type === "Array" ? true : false)
161
162
  })
162
163
  }
164
+ else if(( config.type == "UploadArray")){
165
+ if (!schema.properties[config.name]) {
166
+ schema.properties[config.name] = {
167
+ type: "array",
168
+ items: {
169
+ type: "object",
170
+ properties: {},
171
+ required: []
172
+ }
173
+ }
174
+ }
175
+ config.elements.map((e, elemInd) => {
176
+ buildSchema(e, config.name, config.type === "UploadArray" ? true : false)
177
+ })
178
+ }
163
179
  else {
164
180
  config.elements.map((e, elemInd) => {
165
181
  buildSchema(e)
@@ -238,6 +254,9 @@ const buildUiSchema = (config: any, store?: any) => {
238
254
  case "Array":
239
255
  elements = buildArray(config, componentScope);
240
256
  break;
257
+ case "UploadArray":
258
+ elements = buildUploadArray(config, componentScope);
259
+ break;
241
260
  case "Box":
242
261
  elements = buildLabel(config, componentScope);
243
262
  break;
@@ -0,0 +1,23 @@
1
+ import _ from "lodash";
2
+
3
+ const UploadArrayUiSchema: any = {
4
+ type: "Control",
5
+ scope: "#/properties/uploadArray",
6
+ options: {
7
+ widget: "UploadArray"
8
+ },
9
+ layout: 12,
10
+ elements: [],
11
+ config: {
12
+ main: {}
13
+ }
14
+
15
+ }
16
+ export const buildUploadArray = (config: any, componentScope: string) => {
17
+ const array = _.cloneDeep(UploadArrayUiSchema);
18
+ if (config.style) {
19
+ array.config.style = JSON.parse(config.style)
20
+ }
21
+ array.scope = componentScope;
22
+ return array;
23
+ }
@@ -6,6 +6,7 @@ export const ComponentSchema: any = {
6
6
  oneOf: [
7
7
  { title: "Masked Aadhar Card", const: "AadharcardText" },
8
8
  { title: "Array", const: "Array" },
9
+ { title: "Upload Array", const: "UploadArray" },
9
10
  { title: "Button", const: "Button" },
10
11
  { title: "Data Card", const: "card" },
11
12
  { title: "Check Box", const: "CheckBox" },
@@ -20,7 +20,7 @@ const sectionLabels = {
20
20
  SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
21
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
22
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
23
- UploadFileIcon: ["Core", "Events", "Style"],
23
+ UploadFileIcon: ["Core", "Events", "Style","Validation"],
24
24
  DeleteFileIcon: ["Core", "Events", "Style"],
25
25
  Graph: ["Core", "Properties", "Events", "Style", "Validation"],
26
26
  DownloadFile: ["Core", "Events", "Style", "Validation"],
@@ -33,6 +33,7 @@ const sectionLabels = {
33
33
  Rank: ["Core", "Events", "Style", "Validation"],
34
34
  Button: ["Core", "Properties", "Events", "Style", "Validation"],
35
35
  Array: ["Core", "Components", "Properties","Validation"],
36
+ UploadArray: ["Core", "Components","Validation"],
36
37
  Radio: ["Core", "Properties", "Events", "Style", "Validation"],
37
38
  Text: ["Core", "Properties", "Events", "Style", "Validation"],
38
39
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],