kwikid-forms 0.6.16 → 0.6.18

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,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;
@@ -6,5 +6,4 @@ export declare const setFieldAsFormElement: (field: any, value: boolean) => any;
6
6
  export declare const getMinDate: (field: any) => any;
7
7
  export declare const getMaxDate: (field: any) => any;
8
8
  export declare const updateLanguage: (object: any, language: string) => any;
9
- export declare const isObject: (variable: any) => boolean;
10
9
  export declare const getLanguage: () => string;
@@ -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;
@@ -205,7 +239,9 @@ export declare type TField = {
205
239
  default: TFieldDefault;
206
240
  validators: TValidator;
207
241
  validation: TValidation;
242
+ api?: TApi;
208
243
  properties: TFieldProperties;
244
+ options?: Array<any>;
209
245
  };
210
246
  export declare type TFieldTitle = {
211
247
  type: TFieldType;
@@ -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
- readonly preview: TemplateRef<TuiDialogContext<void>>;
22
+ private cameraRecordService;
23
+ private ref;
22
24
  readonly dialog: TemplateRef<TuiDialogContext<void>>;
23
- formConfig: any;
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
- onClickGoBack: EventEmitter<any>;
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
- readonly DEFAULT_CAMERA_CAPTURE_CONFIG: any;
43
- isShowCameraCapture: boolean;
45
+ isShowCamera: boolean;
44
46
  isShowCameraFullscreen: boolean;
45
- cameraCaptureFieldKey: string;
46
- cameraCaptureImage: string;
47
- cameraCaptureConfig: any;
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
- setImage(image: string): Promise<void>;
92
- handleOnClickSaveCameraCapture(e: any): void;
93
- handleGetImage(e: any): void;
94
- handleOnClickCloseCamera(e: any): void;
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, { "formConfig": "formConfig"; "formData": "formData"; "isMobileView": "isMobileView"; "allFormsData": "allFormsData"; "userConfig": "userConfig"; "apiCallResponse": "apiCallResponse"; "buttonClickResponse": "buttonClickResponse"; "popupFormCallback": "popupFormCallback"; }, { "onClickGoBack": "onClickGoBack"; "onClickViewForms": "onClickViewForms"; "getUnsavedDataState": "getUnsavedDataState"; "onClickSaveForm": "onClickSaveForm"; "onClickApiCall": "onClickApiCall"; "getLogs": "getLogs"; "onActionShowPopupForm": "onActionShowPopupForm"; "onClickFormFieldButton": "onClickFormFieldButton"; }, never, 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 "@angular/common";
5
- import * as i4 from "@angular/forms";
6
- import * as i5 from "@taiga-ui/core";
7
- import * as i6 from "@taiga-ui/kit";
8
- import * as i7 from "@taiga-ui/addon-preview";
9
- import * as i8 from "kwikui";
10
- import * as i9 from "kwikid-camera";
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 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]>;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwikid-forms",
3
- "version": "0.6.16",
3
+ "version": "0.6.18",
4
4
  "description": "KwikID's JSON Configuration based Forms Renderer and Builder",
5
5
  "author": {
6
6
  "name": "Baiju Dodhia"
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "jsonpath": "^1.1.1",
25
25
  "kwikid-camera": "0.0.8",
26
- "kwikid-toolkit": "^0.1.6",
26
+ "kwikid-toolkit": "^0.2.1",
27
27
  "kwikui": "^0.3.4",
28
28
  "lodash": "^4.17.21",
29
29
  "tslib": "^2.2.0"