kwikid-forms 0.6.6 → 0.6.8

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.
Files changed (25) hide show
  1. package/bundles/kwikid-forms.umd.js +438 -72
  2. package/bundles/kwikid-forms.umd.js.map +1 -1
  3. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.component.js +40 -4
  4. package/esm2015/lib/builder/builder-form-editor/builder-form-editor.module.js +4 -3
  5. package/esm2015/lib/builder/builder-form-editor/builder.form-editor.constants.js +34 -5
  6. package/esm2015/lib/builder/builder-form-editor/pipes/json-formatter.pipe.js +19 -0
  7. package/esm2015/lib/renderer/config-converter/config-converter.constants.js +39 -1
  8. package/esm2015/lib/renderer/config-converter/config-converter.js +26 -1
  9. package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +3 -1
  10. package/esm2015/lib/renderer/form-view/form-view.component.js +196 -32
  11. package/esm2015/lib/renderer/form-view/form-view.module.js +15 -5
  12. package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +34 -2
  13. package/esm2015/lib/renderer/renderer.component.js +2 -2
  14. package/fesm2015/kwikid-forms.js +394 -42
  15. package/fesm2015/kwikid-forms.js.map +1 -1
  16. package/lib/builder/builder-form-editor/builder-form-editor.component.d.ts +4 -0
  17. package/lib/builder/builder-form-editor/builder-form-editor.module.d.ts +6 -5
  18. package/lib/builder/builder-form-editor/builder.form-editor.constants.d.ts +102 -0
  19. package/lib/builder/builder-form-editor/pipes/json-formatter.pipe.d.ts +7 -0
  20. package/lib/renderer/config-converter/config-converter.constants.d.ts +38 -0
  21. package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +48 -2
  22. package/lib/renderer/form-view/form-view.component.d.ts +16 -1
  23. package/lib/renderer/form-view/form-view.module.d.ts +2 -1
  24. package/lib/renderer/form-view/helpers/form-view.fields.helper.d.ts +1 -0
  25. package/package.json +4 -3
@@ -25,6 +25,8 @@ export declare class KwikIDBuilderFormEditorComponent implements OnInit, OnChang
25
25
  activeFieldConfigValidatorsConfig: any;
26
26
  showFieldConfigPropertiesConfigEditor: boolean;
27
27
  activeFieldConfigPropertiesConfig: any;
28
+ showFieldConfigOptionsConfigEditor: boolean;
29
+ activeFieldConfigOptionsConfig: any;
28
30
  editorTypeOptions: any[];
29
31
  activeEditorType: TFormEditorType;
30
32
  activeFormConfig_Fields: any[];
@@ -64,12 +66,14 @@ export declare class KwikIDBuilderFormEditorComponent implements OnInit, OnChang
64
66
  */
65
67
  handleOnClickEditValidators(e: any): void;
66
68
  handleOnClickEditProperties(e: any): void;
69
+ handleOnClickEditOptions(e: any): void;
67
70
  /**
68
71
  * Methods to handle change in input values for Fields Keys
69
72
  */
70
73
  handleOnInput(e: any): void;
71
74
  handleOnInputFieldConfigValidatorsConfig(e: any): void;
72
75
  handleOnInputFieldConfigPropertiesConfig(e: any): void;
76
+ handleOnInputFieldConfigOptionsConfig(e: any): void;
73
77
  /**
74
78
  * Methods to handle deletion of field
75
79
  */
@@ -1,11 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./builder-form-editor.component";
3
- import * as i2 from "@angular/common";
4
- import * as i3 from "@angular/forms";
5
- import * as i4 from "kwikui";
6
- import * as i5 from "@taiga-ui/core";
3
+ import * as i2 from "./pipes/json-formatter.pipe";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/forms";
6
+ import * as i5 from "kwikui";
7
+ import * as i6 from "@taiga-ui/core";
7
8
  export declare class KwikIDBuilderFormEditorModule {
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDBuilderFormEditorModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDBuilderFormEditorModule, [typeof i1.KwikIDBuilderFormEditorComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.KwikUIModule, typeof i5.TuiSvgModule], [typeof i1.KwikIDBuilderFormEditorComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDBuilderFormEditorModule, [typeof i1.KwikIDBuilderFormEditorComponent, typeof i2.JsonFormatPipe], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.KwikUIModule, typeof i6.TuiSvgModule], [typeof i1.KwikIDBuilderFormEditorComponent]>;
10
11
  static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDBuilderFormEditorModule>;
11
12
  }
@@ -42,6 +42,7 @@ export declare const OPTIONS: {
42
42
  loadingType: string[];
43
43
  };
44
44
  file: {};
45
+ capture: {};
45
46
  };
46
47
  validators: {
47
48
  required: boolean[];
@@ -211,6 +212,48 @@ export declare const FIELD_PROPERTIES_CONFIG: {
211
212
  placeholder: string;
212
213
  };
213
214
  file: {
215
+ accept: string;
216
+ containerStyles: string;
217
+ label: string;
218
+ link: string;
219
+ maxFileSize: number;
220
+ multiple: boolean;
221
+ size: string;
222
+ uploadFileToServer: boolean;
223
+ readOnly: boolean;
224
+ placeholder: string;
225
+ };
226
+ capture: {
227
+ containerStyles: string;
228
+ buttonText: string;
229
+ icon: string;
230
+ showMediaFiles: boolean;
231
+ uploadFileToServer: boolean;
232
+ cameraConfig: {
233
+ header: {
234
+ title: string;
235
+ isBack: boolean;
236
+ isExpand: boolean;
237
+ isClose: boolean;
238
+ };
239
+ footer: {
240
+ isUpload: boolean;
241
+ isFlip: boolean;
242
+ };
243
+ others: {
244
+ flipHorizontal: boolean;
245
+ mask: {
246
+ shape: string;
247
+ };
248
+ preview: {
249
+ show: boolean;
250
+ header: {
251
+ isBack: boolean;
252
+ isClose: boolean;
253
+ };
254
+ };
255
+ };
256
+ };
214
257
  readOnly: boolean;
215
258
  placeholder: string;
216
259
  };
@@ -726,6 +769,65 @@ export declare const FIELD_CONFIG: {
726
769
  file: {
727
770
  type: string;
728
771
  properties: {
772
+ accept: string;
773
+ containerStyles: string;
774
+ label: string;
775
+ link: string;
776
+ maxFileSize: number;
777
+ multiple: boolean;
778
+ size: string;
779
+ uploadFileToServer: boolean;
780
+ readOnly: boolean;
781
+ placeholder: string;
782
+ };
783
+ key: string;
784
+ label: string;
785
+ disabled: boolean;
786
+ validators: {
787
+ required: boolean;
788
+ minLength: number;
789
+ maxLength: number;
790
+ pattern: {
791
+ key: string;
792
+ pattern: string;
793
+ };
794
+ min: number;
795
+ max: number;
796
+ };
797
+ };
798
+ capture: {
799
+ type: string;
800
+ properties: {
801
+ containerStyles: string;
802
+ buttonText: string;
803
+ icon: string;
804
+ showMediaFiles: boolean;
805
+ uploadFileToServer: boolean;
806
+ cameraConfig: {
807
+ header: {
808
+ title: string;
809
+ isBack: boolean;
810
+ isExpand: boolean;
811
+ isClose: boolean;
812
+ };
813
+ footer: {
814
+ isUpload: boolean;
815
+ isFlip: boolean;
816
+ };
817
+ others: {
818
+ flipHorizontal: boolean;
819
+ mask: {
820
+ shape: string;
821
+ };
822
+ preview: {
823
+ show: boolean;
824
+ header: {
825
+ isBack: boolean;
826
+ isClose: boolean;
827
+ };
828
+ };
829
+ };
830
+ };
729
831
  readOnly: boolean;
730
832
  placeholder: string;
731
833
  };
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare class JsonFormatPipe implements PipeTransform {
4
+ transform(value: any): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonFormatPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<JsonFormatPipe, "jsonFormat">;
7
+ }
@@ -16,6 +16,12 @@ export declare const FIELD_PROPERTIES: {
16
16
  postfix: string;
17
17
  prefix: string;
18
18
  };
19
+ email: {
20
+ case: string;
21
+ containerStyles: string;
22
+ postfix: string;
23
+ prefix: string;
24
+ };
19
25
  password: {
20
26
  containerStyles: string;
21
27
  hintContent: string;
@@ -121,6 +127,38 @@ export declare const FIELD_PROPERTIES: {
121
127
  size: string;
122
128
  uploadFileToServer: boolean;
123
129
  };
130
+ capture: {
131
+ containerStyles: string;
132
+ buttonText: string;
133
+ icon: string;
134
+ showMediaFiles: boolean;
135
+ uploadFileToServer: boolean;
136
+ cameraConfig: {
137
+ header: {
138
+ title: string;
139
+ isBack: boolean;
140
+ isExpand: boolean;
141
+ isClose: boolean;
142
+ };
143
+ footer: {
144
+ isUpload: boolean;
145
+ isFlip: boolean;
146
+ };
147
+ others: {
148
+ flipHorizontal: boolean;
149
+ mask: {
150
+ shape: string;
151
+ };
152
+ preview: {
153
+ show: boolean;
154
+ header: {
155
+ isBack: boolean;
156
+ isClose: boolean;
157
+ };
158
+ };
159
+ };
160
+ };
161
+ };
124
162
  select: {
125
163
  containerStyles: string;
126
164
  searchable: boolean;
@@ -24,9 +24,11 @@ export declare enum EFieldType {
24
24
  AADHAAR_NUMBER = "aadhaar-number",
25
25
  SLIDER = "slider",
26
26
  FILE = "file",
27
- PASSWORD = "password"
27
+ PASSWORD = "password",
28
+ EMAIL = "email",
29
+ CAPTURE = "capture"
28
30
  }
29
- export declare type TFieldType = EFieldType.HTML | EFieldType.TITLE | EFieldType.BUTTON | EFieldType.TEXT | EFieldType.TEXTAREA | EFieldType.CHECKBOX | EFieldType.NUMBER | EFieldType.DATE | EFieldType.PREVIEW_IMAGE | EFieldType.PHONE | EFieldType.RADIO | EFieldType.DROPDOWN_WITH_SEARCH | EFieldType.SELECT | EFieldType.API | EFieldType.API_CALL | EFieldType.OTP | EFieldType.AADHAAR_NUMBER | EFieldType.SLIDER | EFieldType.FILE | EFieldType.PASSWORD;
31
+ export declare type TFieldType = EFieldType.HTML | EFieldType.TITLE | EFieldType.BUTTON | EFieldType.TEXT | EFieldType.TEXTAREA | EFieldType.CHECKBOX | EFieldType.NUMBER | EFieldType.DATE | EFieldType.PREVIEW_IMAGE | EFieldType.PHONE | EFieldType.RADIO | EFieldType.DROPDOWN_WITH_SEARCH | EFieldType.SELECT | EFieldType.API | EFieldType.API_CALL | EFieldType.OTP | EFieldType.AADHAAR_NUMBER | EFieldType.SLIDER | EFieldType.FILE | EFieldType.PASSWORD | EFieldType.EMAIL | EFieldType.CAPTURE;
30
32
  export declare type TFieldSelectOption = {
31
33
  title: string;
32
34
  value: string;
@@ -55,6 +57,12 @@ export declare type TFieldTextProperties = TFieldProperties & {
55
57
  placeholder: string;
56
58
  readOnly: string;
57
59
  };
60
+ export declare type TFieldEmailProperties = TFieldProperties & {
61
+ case: string;
62
+ domains: Array<string>;
63
+ placeholder: string;
64
+ readOnly: string;
65
+ };
58
66
  export declare type TFieldPasswordProperties = TFieldProperties & {
59
67
  placeholder: string;
60
68
  hintContent: string;
@@ -136,6 +144,38 @@ export declare type TFieldAadhaarNumberProperties = TFieldProperties & {
136
144
  mask: string;
137
145
  readOnly: string;
138
146
  };
147
+ export declare type TFieldCaptureProperties = TFieldProperties & {
148
+ containerStyles: string;
149
+ buttonText: string;
150
+ icon: string;
151
+ showMediaFiles: boolean;
152
+ uploadFileToServer: boolean;
153
+ cameraConfig: {
154
+ header: {
155
+ title: string;
156
+ isBack: boolean;
157
+ isExpand: boolean;
158
+ isClose: boolean;
159
+ };
160
+ footer: {
161
+ isUpload: boolean;
162
+ isFlip: boolean;
163
+ };
164
+ others: {
165
+ flipHorizontal: boolean;
166
+ mask: {
167
+ shape: string;
168
+ };
169
+ preview: {
170
+ show: boolean;
171
+ header: {
172
+ isBack: boolean;
173
+ isClose: boolean;
174
+ };
175
+ };
176
+ };
177
+ };
178
+ };
139
179
  export declare type TField = {
140
180
  label: string;
141
181
  type: TFieldType;
@@ -183,6 +223,9 @@ export declare type TFieldRadio = TField & {
183
223
  options: Array<TFieldRadioOption>;
184
224
  properties: TFieldRadioProperties;
185
225
  };
226
+ export declare type TFieldEmail = TField & {
227
+ properties: TFieldEmailProperties;
228
+ };
186
229
  export declare type TFieldSelect = TField & {
187
230
  options: Array<TFieldSelectOption>;
188
231
  properties: TFieldSelectProperties;
@@ -200,3 +243,6 @@ export declare type TFieldAadhaarNumber = TField & {
200
243
  export declare type TFieldPreviewImage = TField & {
201
244
  properties: TFieldPreviewImageProperties;
202
245
  };
246
+ export declare type TFieldCapture = TField & {
247
+ properties: TFieldCaptureProperties;
248
+ };
@@ -38,6 +38,12 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
38
38
  fieldGroups: any;
39
39
  formFields: any[];
40
40
  previousFormData: any;
41
+ readonly DEFAULT_CAMERA_CAPTURE_CONFIG: any;
42
+ isShowCameraCapture: boolean;
43
+ isShowCameraFullscreen: boolean;
44
+ cameraCaptureFieldKey: string;
45
+ cameraCaptureImage: string;
46
+ cameraCaptureConfig: any;
41
47
  previewProperties: any;
42
48
  loading: boolean;
43
49
  apiLoading: boolean;
@@ -54,6 +60,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
54
60
  showLoader: boolean;
55
61
  };
56
62
  files: any;
63
+ mediaFiles: any;
57
64
  stopTaskExecution: boolean;
58
65
  waitingForChanges: boolean;
59
66
  popupFormConfig: any;
@@ -76,6 +83,14 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
76
83
  handleConnectedElements(e: any, eventType: string): Promise<void>;
77
84
  handleRemovedFile(e: any): void;
78
85
  handleGetKeyValueFile(e: any): Promise<void>;
86
+ /** Methods for Camera related fields like 'CAPTURE' */
87
+ handleOnClickGetRemovedMediaFile(e: any): void;
88
+ handleOnClickInputCamera(e: any, field: any): void;
89
+ /** KwikID Camera Methods */
90
+ setImage(image: string): Promise<void>;
91
+ handleOnClickSaveCameraCapture(e: any): void;
92
+ handleGetImage(e: any): void;
93
+ handleOnClickCloseCamera(e: any): void;
79
94
  /**
80
95
  * This method is used to update the files array with the new file and it's state and response from the api of uploading the file.
81
96
  */
@@ -83,7 +98,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
83
98
  /**
84
99
  * This is a api upload mocking method. Set's to loading at first at point when API is called and then changes the status to random status after 2 seconds of delay showing a mocked response from API.
85
100
  */
86
- uploadFile(key: string, file: any): Promise<void>;
101
+ uploadFile(field: any, file: any): Promise<void>;
87
102
  handleOnClickFormFieldButton(field: any): void;
88
103
  handleGetKeyValue(e: any): void;
89
104
  handleOnClickResetFormFields(e: any, field: TFieldTitle): Promise<void>;
@@ -7,8 +7,9 @@ import * as i5 from "@taiga-ui/core";
7
7
  import * as i6 from "@taiga-ui/kit";
8
8
  import * as i7 from "@taiga-ui/addon-preview";
9
9
  import * as i8 from "kwikui";
10
+ import * as i9 from "kwikid-camera";
10
11
  export declare class KwikIDFormViewModule {
11
12
  static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewModule, never>;
12
- static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormViewModule, [typeof i1.KwikIDFormViewComponent, typeof i2.StyleSanitizerPipe], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.TuiLabelModule, typeof i6.TuiPushModule, typeof i5.TuiSvgModule, typeof i7.TuiPreviewModule, typeof i5.TuiButtonModule, typeof i7.TuiPreviewActionModule, typeof i5.TuiDialogModule, typeof i8.KwikUIPipeModule, typeof i8.KwikUIModule], [typeof i1.KwikIDFormViewComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormViewModule, [typeof i1.KwikIDFormViewComponent, typeof i2.StyleSanitizerPipe], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.TuiLabelModule, typeof i6.TuiPushModule, typeof i5.TuiSvgModule, typeof i7.TuiPreviewModule, typeof i5.TuiButtonModule, typeof i7.TuiPreviewActionModule, typeof i5.TuiDialogModule, typeof i8.KwikUIPipeModule, typeof i8.KwikUIModule, typeof i9.KwikIDCameraModule, typeof i9.KwikUIInputCameraModule, typeof i8.KwikUIInputEmailModule], [typeof i1.KwikIDFormViewComponent]>;
13
14
  static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDFormViewModule>;
14
15
  }
@@ -7,6 +7,7 @@ export declare const appendFormFieldMessage: (field: any, message: {
7
7
  type: string;
8
8
  message: string;
9
9
  }) => any;
10
+ export declare const filterDuplicatesMediaFiles: (array: string[]) => string[];
10
11
  export declare const filterDuplicatesFiles: (array: any[]) => any[];
11
12
  export declare const removeFormFieldMessage: (field: any, message: {
12
13
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwikid-forms",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "KwikID's JSON Configuration based Forms Renderer and Builder",
5
5
  "author": {
6
6
  "name": "Baiju Dodhia"
@@ -22,9 +22,10 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "jsonpath": "^1.1.1",
25
- "kwikid-toolkit": "^0.1.6",
26
- "kwikui": "^0.3.2",
27
25
  "lodash": "^4.17.21",
26
+ "kwikid-toolkit": "^0.1.6",
27
+ "kwikid-camera": "0.0.8",
28
+ "kwikui": "^0.3.3",
28
29
  "tslib": "^2.2.0"
29
30
  },
30
31
  "main": "bundles/kwikid-forms.umd.js",