kwikid-forms 0.5.13 → 0.5.14
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 +172 -42
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/renderer/config-converter/config-converter.constants.js +14 -1
- package/esm2015/lib/renderer/config-converter/config-converter.helper.js +2 -2
- package/esm2015/lib/renderer/config-converter/config-converter.js +10 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +3 -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 +86 -6
- package/esm2015/lib/renderer/renderer.component.js +19 -3
- package/fesm2015/kwikid-forms.js +129 -8
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/renderer/config-converter/config-converter.constants.d.ts +13 -0
- package/lib/renderer/form-view/definitions/form-view.actions.definition.d.ts +4 -2
- package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +2 -1
- package/lib/renderer/form-view/form-view.component.d.ts +8 -4
- package/lib/renderer/renderer.component.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
export declare const FIELD_PROPERTIES: {
|
|
2
|
+
button: {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
styles: string;
|
|
5
|
+
class: string;
|
|
6
|
+
appearance: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
iconRight: string;
|
|
9
|
+
shape: any;
|
|
10
|
+
size: string;
|
|
11
|
+
};
|
|
2
12
|
text: {
|
|
3
13
|
case: string;
|
|
4
14
|
};
|
|
15
|
+
"aadhaar-number": {
|
|
16
|
+
mask: string;
|
|
17
|
+
};
|
|
5
18
|
number: {
|
|
6
19
|
decimal: string;
|
|
7
20
|
min: number;
|
|
@@ -35,9 +35,11 @@ export declare enum EActionKey {
|
|
|
35
35
|
DIALOG_HIDE = "DIALOG_HIDE",
|
|
36
36
|
RESUME_TASK_EXECUTION = "RESUME_TASK_EXECUTION",
|
|
37
37
|
STOP_TASK_EXECUTION = "STOP_TASK_EXECUTION",
|
|
38
|
-
REDIRECT_TO_URL = "REDIRECT_TO_URL"
|
|
38
|
+
REDIRECT_TO_URL = "REDIRECT_TO_URL",
|
|
39
|
+
SAVE_FORM = "SAVE_FORM",
|
|
40
|
+
ALERT_SHOW = "ALERT_SHOW"
|
|
39
41
|
}
|
|
40
|
-
export declare type TActionKey = EActionKey.SET_VALUE | EActionKey.SET_FIELD_DEFAULT_VALUE | EActionKey.FIELD_MESSAGE_SHOW | EActionKey.FIELD_MESSAGES_HIDE | EActionKey.FIELD_ERROR_SHOW | EActionKey.FIELD_ERROR_HIDE | EActionKey.FIELD_SHOW | EActionKey.FIELD_HIDE | EActionKey.FIELD_ENABLE | EActionKey.FIELD_DISABLE | EActionKey.FIELD_RESET | EActionKey.HANDLE_CONNECTED_ELEMENTS | EActionKey.CUSTOM | EActionKey.FIELD_GROUP_SHOW | EActionKey.FIELD_GROUP_HIDE | EActionKey.FIELD_GROUP_ENABLE | EActionKey.FIELD_GROUP_DISABLE | EActionKey.API_CALL | EActionKey.API_CALL_MULTIPLE | EActionKey.API_CALL_MULTIPLE_END | EActionKey.TASK_API_CALL | EActionKey.TASK_API_CALL_MULTIPLE | EActionKey.TASK_API_CALL_MULTIPLE_END | EActionKey.SET_DROPDOWN_OPTIONS | EActionKey.PREVIEW_DIALOG_SHOW | EActionKey.POPUP_FORM_SHOW | EActionKey.STOP_WAITING | EActionKey.NOTIFICATION_ERROR_SHOW | EActionKey.NOTIFICATION_ERROR_HIDE | EActionKey.DIALOG_SHOW | EActionKey.DIALOG_HIDE | EActionKey.RESUME_TASK_EXECUTION | EActionKey.STOP_TASK_EXECUTION | EActionKey.REDIRECT_TO_URL;
|
|
42
|
+
export declare type TActionKey = EActionKey.SET_VALUE | EActionKey.SET_FIELD_DEFAULT_VALUE | EActionKey.FIELD_MESSAGE_SHOW | EActionKey.FIELD_MESSAGES_HIDE | EActionKey.FIELD_ERROR_SHOW | EActionKey.FIELD_ERROR_HIDE | EActionKey.FIELD_SHOW | EActionKey.FIELD_HIDE | EActionKey.FIELD_ENABLE | EActionKey.FIELD_DISABLE | EActionKey.FIELD_RESET | EActionKey.HANDLE_CONNECTED_ELEMENTS | EActionKey.CUSTOM | EActionKey.FIELD_GROUP_SHOW | EActionKey.FIELD_GROUP_HIDE | EActionKey.FIELD_GROUP_ENABLE | EActionKey.FIELD_GROUP_DISABLE | EActionKey.API_CALL | EActionKey.API_CALL_MULTIPLE | EActionKey.API_CALL_MULTIPLE_END | EActionKey.TASK_API_CALL | EActionKey.TASK_API_CALL_MULTIPLE | EActionKey.TASK_API_CALL_MULTIPLE_END | EActionKey.SET_DROPDOWN_OPTIONS | EActionKey.PREVIEW_DIALOG_SHOW | EActionKey.POPUP_FORM_SHOW | EActionKey.STOP_WAITING | EActionKey.NOTIFICATION_ERROR_SHOW | EActionKey.NOTIFICATION_ERROR_HIDE | EActionKey.DIALOG_SHOW | EActionKey.DIALOG_HIDE | EActionKey.RESUME_TASK_EXECUTION | EActionKey.STOP_TASK_EXECUTION | EActionKey.REDIRECT_TO_URL | EActionKey.SAVE_FORM | EActionKey.ALERT_SHOW;
|
|
41
43
|
export declare type TActionSetValue = TAction & {
|
|
42
44
|
key: EActionKey.SET_VALUE;
|
|
43
45
|
props: {
|
|
@@ -7,6 +7,7 @@ export declare enum EFieldType {
|
|
|
7
7
|
HTML = "html",
|
|
8
8
|
TITLE = "title",
|
|
9
9
|
TEXT = "text",
|
|
10
|
+
BUTTON = "button",
|
|
10
11
|
TEXTAREA = "textarea",
|
|
11
12
|
CHECKBOX = "checkbox",
|
|
12
13
|
NUMBER = "number",
|
|
@@ -24,7 +25,7 @@ export declare enum EFieldType {
|
|
|
24
25
|
SLIDER = "slider",
|
|
25
26
|
FILE = "file"
|
|
26
27
|
}
|
|
27
|
-
export declare type TFieldType = EFieldType.HTML | EFieldType.TITLE | 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;
|
|
28
|
+
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;
|
|
28
29
|
export declare type TFieldSelectOption = {
|
|
29
30
|
title: string;
|
|
30
31
|
value: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnInit, SimpleChanges, TemplateRef } from "@angular/core";
|
|
2
2
|
import { FormGroup } from "@angular/forms";
|
|
3
3
|
import { TuiPreviewDialogService } from "@taiga-ui/addon-preview";
|
|
4
|
-
import { TuiAlertService, TuiDialogContext, TuiDialogService } from "@taiga-ui/core";
|
|
4
|
+
import { TuiAlertService, TuiDialogContext, TuiDialogService, TuiNotificationT } from "@taiga-ui/core";
|
|
5
5
|
import { TuiPushService } from "@taiga-ui/kit";
|
|
6
6
|
import { TAction } from "kwikid-toolkit";
|
|
7
7
|
import { KwikUILoaderService } from "kwikui";
|
|
@@ -14,7 +14,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
14
14
|
private cd;
|
|
15
15
|
private formViewService;
|
|
16
16
|
protected readonly push: TuiPushService;
|
|
17
|
-
protected readonly
|
|
17
|
+
protected readonly alertService: TuiAlertService;
|
|
18
18
|
private readonly previewDialogService;
|
|
19
19
|
private readonly dialogService;
|
|
20
20
|
loaderService: KwikUILoaderService;
|
|
@@ -26,6 +26,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
26
26
|
allFormsData: any;
|
|
27
27
|
userConfig: any;
|
|
28
28
|
apiCallResponse: any;
|
|
29
|
+
buttonClickResponse: any;
|
|
29
30
|
popupFormCallback: any;
|
|
30
31
|
onClickGoBack: EventEmitter<any>;
|
|
31
32
|
onClickViewForms: EventEmitter<any>;
|
|
@@ -33,6 +34,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
33
34
|
onClickSaveForm: EventEmitter<any>;
|
|
34
35
|
onClickApiCall: EventEmitter<any>;
|
|
35
36
|
onActionShowPopupForm: EventEmitter<any>;
|
|
37
|
+
onClickFormFieldButton: EventEmitter<any>;
|
|
36
38
|
fieldGroups: any;
|
|
37
39
|
formFields: any[];
|
|
38
40
|
previousFormData: any;
|
|
@@ -59,7 +61,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
59
61
|
taskData: any;
|
|
60
62
|
previewDialogRef: any;
|
|
61
63
|
formGroup: FormGroup;
|
|
62
|
-
constructor(cd: ChangeDetectorRef, formViewService: KwikIDFormViewService, push: TuiPushService,
|
|
64
|
+
constructor(cd: ChangeDetectorRef, formViewService: KwikIDFormViewService, push: TuiPushService, alertService: TuiAlertService, previewDialogService: TuiPreviewDialogService, dialogService: TuiDialogService, loaderService: KwikUILoaderService);
|
|
63
65
|
ngOnInit(): void;
|
|
64
66
|
ngAfterViewInit(): void;
|
|
65
67
|
ngOnChanges(changes: SimpleChanges): void;
|
|
@@ -82,6 +84,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
82
84
|
* 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.
|
|
83
85
|
*/
|
|
84
86
|
uploadFile(key: string, file: any): Promise<void>;
|
|
87
|
+
handleOnClickFormFieldButton(field: any): void;
|
|
85
88
|
handleGetKeyValue(e: any): void;
|
|
86
89
|
handleOnClickResetFormFields(e: any, field: TFieldTitle): Promise<void>;
|
|
87
90
|
handleFieldApiCall(field: TFieldApiCall, api: any): Promise<{
|
|
@@ -144,8 +147,9 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
144
147
|
showPreview(previewProperties: any): void;
|
|
145
148
|
showErrorPreview(previewProperties: any): void;
|
|
146
149
|
showPopupForm(popupFormKey: string, popupType?: "DIALOG" | "POPUP"): void;
|
|
150
|
+
alertShow(type: TuiNotificationT, message: string): void;
|
|
147
151
|
takeActionOnFieldGroup(action: TAction, object: any): Promise<void>;
|
|
148
152
|
takeAction(action: TAction, object: any): Promise<void>;
|
|
149
153
|
static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewComponent, never>;
|
|
150
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormViewComponent, "kwikid-form-view", never, { "formConfig": "formConfig"; "formData": "formData"; "isMobileView": "isMobileView"; "allFormsData": "allFormsData"; "userConfig": "userConfig"; "apiCallResponse": "apiCallResponse"; "popupFormCallback": "popupFormCallback"; }, { "onClickGoBack": "onClickGoBack"; "onClickViewForms": "onClickViewForms"; "getUnsavedDataState": "getUnsavedDataState"; "onClickSaveForm": "onClickSaveForm"; "onClickApiCall": "onClickApiCall"; "onActionShowPopupForm": "onActionShowPopupForm"; }, never, never>;
|
|
154
|
+
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"; "onActionShowPopupForm": "onActionShowPopupForm"; "onClickFormFieldButton": "onClickFormFieldButton"; }, never, never>;
|
|
151
155
|
}
|
|
@@ -17,9 +17,11 @@ export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
|
|
|
17
17
|
formsData: any;
|
|
18
18
|
activeFormData: any;
|
|
19
19
|
apiCallResponse: any;
|
|
20
|
+
buttonClickResponse: any;
|
|
20
21
|
onClickSubmit: EventEmitter<any>;
|
|
21
22
|
getFormData: EventEmitter<any>;
|
|
22
23
|
onClickApiCall: EventEmitter<any>;
|
|
24
|
+
onClickFormFieldButton: EventEmitter<any>;
|
|
23
25
|
loading: boolean;
|
|
24
26
|
showErrorNotification: boolean;
|
|
25
27
|
toggleErrorNotification(show: any): void;
|
|
@@ -91,6 +93,7 @@ export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
|
|
|
91
93
|
*/
|
|
92
94
|
handleGetUnsavedState(e: any): void;
|
|
93
95
|
handleOnClickApiCall(e: any): void;
|
|
96
|
+
handleOnClickFormFieldButton(e: any): void;
|
|
94
97
|
handleOnActionShowPopupForm(e: any, content: any): void;
|
|
95
98
|
/**
|
|
96
99
|
* FormView - Listens to event of getting the Active Form's Data when the Form is Saved and emits (read as passes) the same event to the library consumer.
|
|
@@ -128,5 +131,5 @@ export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
|
|
|
128
131
|
*/
|
|
129
132
|
handleResize(formsList: any[]): void;
|
|
130
133
|
static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormsRendererComponent, never>;
|
|
131
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormsRendererComponent, "kwikid-forms-renderer", never, { "stepConfig": "stepConfig"; "userConfig": "userConfig"; "formsData": "formsData"; "activeFormData": "activeFormData"; "apiCallResponse": "apiCallResponse"; }, { "onClickSubmit": "onClickSubmit"; "getFormData": "getFormData"; "onClickApiCall": "onClickApiCall"; }, never, never>;
|
|
134
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormsRendererComponent, "kwikid-forms-renderer", never, { "stepConfig": "stepConfig"; "userConfig": "userConfig"; "formsData": "formsData"; "activeFormData": "activeFormData"; "apiCallResponse": "apiCallResponse"; "buttonClickResponse": "buttonClickResponse"; }, { "onClickSubmit": "onClickSubmit"; "getFormData": "getFormData"; "onClickApiCall": "onClickApiCall"; "onClickFormFieldButton": "onClickFormFieldButton"; }, never, never>;
|
|
132
135
|
}
|