kwikid-forms 0.6.17 → 0.6.19
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.
- package/bundles/kwikid-forms.umd.js +423 -186
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/common/pipes/timer-formatter.pipe.js +21 -0
- package/esm2015/lib/renderer/config-converter/config-converter.constants.js +34 -1
- package/esm2015/lib/renderer/config-converter/config-converter.js +20 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.fields.definition.js +2 -1
- package/esm2015/lib/renderer/form-view/form-view.component.js +246 -108
- package/esm2015/lib/renderer/form-view/form-view.module.js +4 -3
- package/esm2015/lib/renderer/form-view/form-view.service.js +2 -1
- package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +24 -1
- package/esm2015/lib/renderer/renderer.component.js +1 -1
- package/fesm2015/kwikid-forms.js +352 -119
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/common/pipes/timer-formatter.pipe.d.ts +8 -0
- package/lib/renderer/config-converter/config-converter.constants.d.ts +33 -0
- package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +35 -1
- package/lib/renderer/form-view/form-view.component.d.ts +37 -24
- package/lib/renderer/form-view/form-view.module.d.ts +9 -8
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PipeTransform } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TimerPipe implements PipeTransform {
|
|
4
|
+
transform(value: number): string;
|
|
5
|
+
private pad;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TimerPipe, never>;
|
|
7
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TimerPipe, "formatTimer">;
|
|
8
|
+
}
|
|
@@ -163,6 +163,39 @@ export declare const FIELD_PROPERTIES: {
|
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
};
|
|
166
|
+
record: {
|
|
167
|
+
containerStyles: string;
|
|
168
|
+
buttonText: string;
|
|
169
|
+
icon: string;
|
|
170
|
+
showMediaFiles: boolean;
|
|
171
|
+
uploadFileToServer: boolean;
|
|
172
|
+
cameraConfig: {
|
|
173
|
+
header: {
|
|
174
|
+
title: string;
|
|
175
|
+
isBack: boolean;
|
|
176
|
+
isExpand: boolean;
|
|
177
|
+
isClose: boolean;
|
|
178
|
+
};
|
|
179
|
+
footer: {
|
|
180
|
+
isUpload: boolean;
|
|
181
|
+
isFlip: boolean;
|
|
182
|
+
isSwitch: boolean;
|
|
183
|
+
};
|
|
184
|
+
others: {
|
|
185
|
+
isFrontCamera: boolean;
|
|
186
|
+
flipHorizontal: boolean;
|
|
187
|
+
minRecordingTimeInSeconds: number;
|
|
188
|
+
maxRecordingTimeInSeconds: number;
|
|
189
|
+
preview: {
|
|
190
|
+
show: boolean;
|
|
191
|
+
header: {
|
|
192
|
+
isBack: boolean;
|
|
193
|
+
isClose: boolean;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
};
|
|
166
199
|
select: {
|
|
167
200
|
containerStyles: string;
|
|
168
201
|
searchable: boolean;
|
|
@@ -27,9 +27,10 @@ export declare enum EFieldType {
|
|
|
27
27
|
PASSWORD = "password",
|
|
28
28
|
EMAIL = "email",
|
|
29
29
|
CAPTURE = "capture",
|
|
30
|
+
RECORD = "record",
|
|
30
31
|
STAR_RATING = "star-rating"
|
|
31
32
|
}
|
|
32
|
-
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 | EFieldType.STAR_RATING;
|
|
33
|
+
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 | EFieldType.RECORD | EFieldType.STAR_RATING;
|
|
33
34
|
export declare type TFieldSelectOption = {
|
|
34
35
|
title: string;
|
|
35
36
|
value: string;
|
|
@@ -187,6 +188,39 @@ export declare type TFieldCaptureProperties = TFieldProperties & {
|
|
|
187
188
|
};
|
|
188
189
|
};
|
|
189
190
|
};
|
|
191
|
+
export declare type TFieldRecordProperties = TFieldProperties & {
|
|
192
|
+
containerStyles: string;
|
|
193
|
+
buttonText: string;
|
|
194
|
+
icon: string;
|
|
195
|
+
showMediaFiles: boolean;
|
|
196
|
+
uploadFileToServer: boolean;
|
|
197
|
+
cameraConfig: {
|
|
198
|
+
header: {
|
|
199
|
+
title: string;
|
|
200
|
+
isBack: boolean;
|
|
201
|
+
isExpand: boolean;
|
|
202
|
+
isClose: boolean;
|
|
203
|
+
};
|
|
204
|
+
footer: {
|
|
205
|
+
isUpload: boolean;
|
|
206
|
+
isFlip: boolean;
|
|
207
|
+
isSwitch: boolean;
|
|
208
|
+
};
|
|
209
|
+
others: {
|
|
210
|
+
isFrontCamera: boolean;
|
|
211
|
+
flipHorizontal: boolean;
|
|
212
|
+
minRecordingTimeInSeconds: number;
|
|
213
|
+
maxRecordingTimeInSeconds: number;
|
|
214
|
+
preview: {
|
|
215
|
+
show: boolean;
|
|
216
|
+
header: {
|
|
217
|
+
isBack: boolean;
|
|
218
|
+
isClose: boolean;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
};
|
|
190
224
|
export declare type TFieldStarRatingProperties = TFieldProperties & {
|
|
191
225
|
color: string;
|
|
192
226
|
icon: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
|
|
2
2
|
import { FormGroup } from "@angular/forms";
|
|
3
3
|
import { TuiPreviewDialogService } from "@taiga-ui/addon-preview";
|
|
4
4
|
import { TuiAlertService, TuiDialogContext, TuiDialogService, TuiNotification } from "@taiga-ui/core";
|
|
5
5
|
import { TuiPushService } from "@taiga-ui/kit";
|
|
6
|
+
import { KwikIDCameraRecordService } from "kwikid-camera";
|
|
6
7
|
import { TAction } from "kwikid-toolkit";
|
|
7
8
|
import { KwikUILoaderService } from "kwikui";
|
|
8
9
|
import { TApi } from "./definitions/form-view.apis.definition";
|
|
@@ -10,7 +11,7 @@ import { TFormViewGoBackMode, TMessage } from "./definitions/form-view.commons.d
|
|
|
10
11
|
import { TFieldApiCall, TFieldTitle } from "./definitions/form-view.fields.definition";
|
|
11
12
|
import { KwikIDFormViewService } from "./form-view.service";
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
|
-
export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
14
|
+
export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
|
|
14
15
|
private cd;
|
|
15
16
|
private formViewService;
|
|
16
17
|
protected readonly push: TuiPushService;
|
|
@@ -18,33 +19,41 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
18
19
|
private readonly previewDialogService;
|
|
19
20
|
private readonly dialogService;
|
|
20
21
|
loaderService: KwikUILoaderService;
|
|
21
|
-
|
|
22
|
+
private cameraRecordService;
|
|
23
|
+
private ref;
|
|
22
24
|
readonly dialog: TemplateRef<TuiDialogContext<void>>;
|
|
23
|
-
|
|
24
|
-
formData: any;
|
|
25
|
-
isMobileView: boolean;
|
|
25
|
+
readonly preview: TemplateRef<TuiDialogContext<void>>;
|
|
26
26
|
allFormsData: any;
|
|
27
|
-
userConfig: any;
|
|
28
27
|
apiCallResponse: any;
|
|
29
28
|
buttonClickResponse: any;
|
|
29
|
+
formConfig: any;
|
|
30
|
+
formData: any;
|
|
31
|
+
isMobileView: boolean;
|
|
30
32
|
popupFormCallback: any;
|
|
31
|
-
|
|
32
|
-
onClickViewForms: EventEmitter<any>;
|
|
33
|
-
getUnsavedDataState: EventEmitter<any>;
|
|
34
|
-
onClickSaveForm: EventEmitter<any>;
|
|
35
|
-
onClickApiCall: EventEmitter<any>;
|
|
33
|
+
userConfig: any;
|
|
36
34
|
getLogs: EventEmitter<any>;
|
|
35
|
+
getUnsavedDataState: EventEmitter<any>;
|
|
37
36
|
onActionShowPopupForm: EventEmitter<any>;
|
|
37
|
+
onClickApiCall: EventEmitter<any>;
|
|
38
38
|
onClickFormFieldButton: EventEmitter<any>;
|
|
39
|
+
onClickGoBack: EventEmitter<any>;
|
|
40
|
+
onClickSaveForm: EventEmitter<any>;
|
|
41
|
+
onClickViewForms: EventEmitter<any>;
|
|
39
42
|
fieldGroups: any;
|
|
40
43
|
formFields: any[];
|
|
41
44
|
previousFormData: any;
|
|
42
|
-
|
|
43
|
-
isShowCameraCapture: boolean;
|
|
45
|
+
isShowCamera: boolean;
|
|
44
46
|
isShowCameraFullscreen: boolean;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
cameraFieldKey: string;
|
|
48
|
+
cameraType: "CAPTURE" | "RECORD";
|
|
49
|
+
cameraImage: string;
|
|
50
|
+
cameraVideo: string;
|
|
51
|
+
cameraConfig: any;
|
|
52
|
+
cameraRecordingTime: number;
|
|
53
|
+
cameraRecordingTimerSubcription: any;
|
|
54
|
+
cameraRecordingState: string;
|
|
55
|
+
cameraRecordingStateSubcription: any;
|
|
56
|
+
resetCamera(): void;
|
|
48
57
|
previewProperties: any;
|
|
49
58
|
loading: boolean;
|
|
50
59
|
apiLoading: boolean;
|
|
@@ -69,10 +78,11 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
69
78
|
taskData: any;
|
|
70
79
|
previewDialogRef: any;
|
|
71
80
|
formGroup: FormGroup;
|
|
72
|
-
constructor(cd: ChangeDetectorRef, formViewService: KwikIDFormViewService, push: TuiPushService, alertService: TuiAlertService, previewDialogService: TuiPreviewDialogService, dialogService: TuiDialogService, loaderService: KwikUILoaderService);
|
|
81
|
+
constructor(cd: ChangeDetectorRef, formViewService: KwikIDFormViewService, push: TuiPushService, alertService: TuiAlertService, previewDialogService: TuiPreviewDialogService, dialogService: TuiDialogService, loaderService: KwikUILoaderService, cameraRecordService: KwikIDCameraRecordService, ref: ChangeDetectorRef);
|
|
73
82
|
ngOnInit(): void;
|
|
74
83
|
ngAfterViewInit(): void;
|
|
75
84
|
ngOnChanges(changes: SimpleChanges): void;
|
|
85
|
+
ngOnDestroy(): void;
|
|
76
86
|
initFormConfig(formConfig: any): Promise<boolean>;
|
|
77
87
|
setFormFieldsFromFormConfig(formConfig: any): void;
|
|
78
88
|
setFormFieldGroupsFromFormConfig(formConfig: any): void;
|
|
@@ -84,14 +94,17 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
84
94
|
handleConnectedElements(e: any, eventType: string): Promise<void>;
|
|
85
95
|
handleRemovedFile(e: any): void;
|
|
86
96
|
handleGetKeyValueFile(e: any): Promise<void>;
|
|
87
|
-
/** Methods for Camera related fields like 'CAPTURE' */
|
|
97
|
+
/** Methods for Camera related fields like 'CAPTURE' or 'RECORD' */
|
|
88
98
|
handleOnClickGetRemovedMediaFile(e: any): void;
|
|
89
99
|
handleOnClickInputCamera(e: any, field: any): void;
|
|
90
100
|
/** KwikID Camera Methods */
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
101
|
+
/** CameraType = CAPTURE */
|
|
102
|
+
setCameraMedia(media: string): Promise<void>;
|
|
103
|
+
/** Camera Common Methods */
|
|
104
|
+
handleGetCameraMedia(e: any, cameraType: "CAPTURE" | "RECORD"): void;
|
|
105
|
+
handleOnClickSaveCameraMedia(e: any, cameraType: "CAPTURE" | "RECORD"): void;
|
|
106
|
+
handleOnClickCameraBack(e: any): void;
|
|
107
|
+
handleOnClickCameraClose(e: any): void;
|
|
95
108
|
/**
|
|
96
109
|
* 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.
|
|
97
110
|
*/
|
|
@@ -173,5 +186,5 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
173
186
|
takeActionOnFieldGroup(action: TAction, object: any): Promise<void>;
|
|
174
187
|
takeAction(action: TAction, object: any): Promise<void>;
|
|
175
188
|
static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewComponent, never>;
|
|
176
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormViewComponent, "kwikid-form-view", never, { "
|
|
189
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormViewComponent, "kwikid-form-view", never, { "allFormsData": "allFormsData"; "apiCallResponse": "apiCallResponse"; "buttonClickResponse": "buttonClickResponse"; "formConfig": "formConfig"; "formData": "formData"; "isMobileView": "isMobileView"; "popupFormCallback": "popupFormCallback"; "userConfig": "userConfig"; }, { "getLogs": "getLogs"; "getUnsavedDataState": "getUnsavedDataState"; "onActionShowPopupForm": "onActionShowPopupForm"; "onClickApiCall": "onClickApiCall"; "onClickFormFieldButton": "onClickFormFieldButton"; "onClickGoBack": "onClickGoBack"; "onClickSaveForm": "onClickSaveForm"; "onClickViewForms": "onClickViewForms"; }, never, never>;
|
|
177
190
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import * as i1 from "./form-view.component";
|
|
3
3
|
import * as i2 from "./helpers/styles-sanitizer.pipe";
|
|
4
|
-
import * as i3 from "
|
|
5
|
-
import * as i4 from "@angular/
|
|
6
|
-
import * as i5 from "@
|
|
7
|
-
import * as i6 from "@taiga-ui/
|
|
8
|
-
import * as i7 from "@taiga-ui/
|
|
9
|
-
import * as i8 from "
|
|
10
|
-
import * as i9 from "
|
|
4
|
+
import * as i3 from "../../common/pipes/timer-formatter.pipe";
|
|
5
|
+
import * as i4 from "@angular/common";
|
|
6
|
+
import * as i5 from "@angular/forms";
|
|
7
|
+
import * as i6 from "@taiga-ui/core";
|
|
8
|
+
import * as i7 from "@taiga-ui/kit";
|
|
9
|
+
import * as i8 from "@taiga-ui/addon-preview";
|
|
10
|
+
import * as i9 from "kwikui";
|
|
11
|
+
import * as i10 from "kwikid-camera";
|
|
11
12
|
export declare class KwikIDFormViewModule {
|
|
12
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewModule, never>;
|
|
13
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormViewModule, [typeof i1.KwikIDFormViewComponent, typeof i2.StyleSanitizerPipe], [typeof
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormViewModule, [typeof i1.KwikIDFormViewComponent, typeof i2.StyleSanitizerPipe, typeof i3.TimerPipe], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.TuiLabelModule, typeof i7.TuiPushModule, typeof i6.TuiSvgModule, typeof i8.TuiPreviewModule, typeof i6.TuiButtonModule, typeof i8.TuiPreviewActionModule, typeof i6.TuiDialogModule, typeof i9.KwikUIPipeModule, typeof i9.KwikUIModule, typeof i10.KwikIDCameraModule, typeof i10.KwikUIInputCameraModule, typeof i9.KwikUIInputEmailModule], [typeof i1.KwikIDFormViewComponent]>;
|
|
14
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDFormViewModule>;
|
|
15
16
|
}
|