kwikid-forms 0.2.9 → 0.2.11
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 +290 -101
- package/bundles/kwikid-forms.umd.js.map +1 -1
- package/esm2015/lib/builder/builder.component.js +1 -1
- package/esm2015/lib/renderer/config-converter.helper.js +35 -2
- package/esm2015/lib/renderer/form-view/definitions/form-view.actions.definition.js +3 -1
- package/esm2015/lib/renderer/form-view/definitions/form-view.apis.definition.js +6 -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 +105 -58
- package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +107 -51
- package/esm2015/lib/renderer/renderer.component.js +4 -5
- package/fesm2015/kwikid-forms.js +250 -108
- package/fesm2015/kwikid-forms.js.map +1 -1
- package/lib/renderer/form-view/definitions/form-view.actions.definition.d.ts +17 -2
- package/lib/renderer/form-view/definitions/form-view.apis.definition.d.ts +20 -2
- package/lib/renderer/form-view/definitions/form-view.fields.definition.d.ts +11 -2
- package/lib/renderer/form-view/form-view.component.d.ts +5 -2
- package/lib/renderer/form-view/helpers/form-view.apis.helper.d.ts +3 -2
- package/package.json +3 -3
|
@@ -18,9 +18,11 @@ export declare enum EActionKey {
|
|
|
18
18
|
FIELD_GROUP_HIDE = "FIELD_GROUP_HIDE",
|
|
19
19
|
FIELD_GROUP_ENABLE = "FIELD_GROUP_ENABLE",
|
|
20
20
|
FIELD_GROUP_DISABLE = "FIELD_GROUP_DISABLE",
|
|
21
|
-
SET_DROPDOWN_OPTIONS = "SET_DROPDOWN_OPTIONS"
|
|
21
|
+
SET_DROPDOWN_OPTIONS = "SET_DROPDOWN_OPTIONS",
|
|
22
|
+
API_CALL = "API_CALL",
|
|
23
|
+
API_CALL_END = "API_CALL_END"
|
|
22
24
|
}
|
|
23
|
-
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;
|
|
25
|
+
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_END;
|
|
24
26
|
export declare type TActionSetValue = TAction & {
|
|
25
27
|
key: EActionKey.SET_VALUE;
|
|
26
28
|
props: {
|
|
@@ -101,3 +103,16 @@ export declare type TActionHandleConnectedElement = TAction & {
|
|
|
101
103
|
fieldKey: string;
|
|
102
104
|
};
|
|
103
105
|
};
|
|
106
|
+
export declare type TActionApiCall = TAction & {
|
|
107
|
+
key: EActionKey.API_CALL;
|
|
108
|
+
props: {
|
|
109
|
+
fieldKey: string;
|
|
110
|
+
apiKey: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
export declare type TActionApiCallsDone = TAction & {
|
|
114
|
+
key: EActionKey.API_CALL;
|
|
115
|
+
props: {
|
|
116
|
+
fieldKey: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TSource, TValidation } from "kwikid-toolkit";
|
|
1
|
+
import { TAction, TRule, TSource, TValidation } from "kwikid-toolkit";
|
|
2
|
+
import { TTrigger } from "./form-view.triggers.definition";
|
|
2
3
|
export declare enum EApiStatusType {
|
|
3
4
|
DEFAULT = "default",
|
|
4
5
|
LOADING = "loading",
|
|
@@ -36,6 +37,7 @@ export declare type TApiResponse = {
|
|
|
36
37
|
is_valid: boolean;
|
|
37
38
|
body: TApiResponseBody;
|
|
38
39
|
validation: TValidation;
|
|
40
|
+
value?: any;
|
|
39
41
|
};
|
|
40
42
|
export declare type TApiStatusType = EApiStatusType.DEFAULT | EApiStatusType.LOADING | EApiStatusType.SUCCESS | EApiStatusType.FAILED;
|
|
41
43
|
export declare type TApiStatus = {
|
|
@@ -47,8 +49,24 @@ export declare type TApiStatus = {
|
|
|
47
49
|
failed: EApiStatusType.FAILED;
|
|
48
50
|
};
|
|
49
51
|
};
|
|
50
|
-
export declare type
|
|
52
|
+
export declare type TApiEntryPoint = {
|
|
53
|
+
triggers: Array<TTrigger>;
|
|
54
|
+
rules: Array<TRule>;
|
|
55
|
+
actions: Array<TAction>;
|
|
56
|
+
};
|
|
57
|
+
export declare type TApiEndpoint = {
|
|
58
|
+
apiKey: string;
|
|
51
59
|
request: TApiRequest;
|
|
52
60
|
response: TApiResponse;
|
|
61
|
+
};
|
|
62
|
+
export declare type TApi = {
|
|
63
|
+
request?: TApiRequest;
|
|
64
|
+
response?: TApiResponse;
|
|
65
|
+
entrypoint: TApiEntryPoint;
|
|
66
|
+
endpoints: Array<TApiEndpoint>;
|
|
53
67
|
status: TApiStatus;
|
|
54
68
|
};
|
|
69
|
+
export declare enum EApiRequestUrlType {
|
|
70
|
+
MOCK = "MOCK",
|
|
71
|
+
CALCULATED = "CALCULATED"
|
|
72
|
+
}
|
|
@@ -15,9 +15,10 @@ export declare enum EFieldType {
|
|
|
15
15
|
DROPDOWN_WITH_SEARCH = "dropdown-with-search",
|
|
16
16
|
API_CALL = "api-call",
|
|
17
17
|
OTP = "otp",
|
|
18
|
-
AADHAAR_NUMBER = "aadhaar-number"
|
|
18
|
+
AADHAAR_NUMBER = "aadhaar-number",
|
|
19
|
+
SLIDER = "slider"
|
|
19
20
|
}
|
|
20
|
-
export declare type TFieldType = EFieldType.HTML | EFieldType.TITLE | EFieldType.TEXT | EFieldType.CHECKBOX | EFieldType.NUMBER | EFieldType.DATE | EFieldType.PHONE | EFieldType.RADIO | EFieldType.DROPDOWN_WITH_SEARCH | EFieldType.API_CALL | EFieldType.OTP | EFieldType.AADHAAR_NUMBER;
|
|
21
|
+
export declare type TFieldType = EFieldType.HTML | EFieldType.TITLE | EFieldType.TEXT | EFieldType.CHECKBOX | EFieldType.NUMBER | EFieldType.DATE | EFieldType.PHONE | EFieldType.RADIO | EFieldType.DROPDOWN_WITH_SEARCH | EFieldType.API_CALL | EFieldType.OTP | EFieldType.AADHAAR_NUMBER | EFieldType.SLIDER;
|
|
21
22
|
export declare type TFieldDropdownWithSearchOption = {
|
|
22
23
|
title: string;
|
|
23
24
|
value: string;
|
|
@@ -82,6 +83,14 @@ export declare type TFieldPhoneProperties = TFieldProperties & {
|
|
|
82
83
|
placeholder: string;
|
|
83
84
|
readOnly: boolean;
|
|
84
85
|
};
|
|
86
|
+
export declare type TFieldSlider = TFieldProperties & {
|
|
87
|
+
min: number;
|
|
88
|
+
max: number;
|
|
89
|
+
step: number;
|
|
90
|
+
quantum: number;
|
|
91
|
+
placeholder: string;
|
|
92
|
+
readOnly: boolean;
|
|
93
|
+
};
|
|
85
94
|
export declare type TFieldRadioProperties = TFieldProperties & {
|
|
86
95
|
size: string;
|
|
87
96
|
orientation: string;
|
|
@@ -4,7 +4,7 @@ import { TuiAlertService } from "@taiga-ui/core";
|
|
|
4
4
|
import { TuiPushService } from "@taiga-ui/kit";
|
|
5
5
|
import { TAction } from "kwikid-toolkit";
|
|
6
6
|
import { TMessage } from "./definitions/form-view.commons.definition";
|
|
7
|
-
import { TFieldTitle } from "./definitions/form-view.fields.definition";
|
|
7
|
+
import { TFieldApiCall, TFieldTitle } from "./definitions/form-view.fields.definition";
|
|
8
8
|
import { KwikIDFormViewService } from "./form-view.service";
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
@@ -46,6 +46,10 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
46
46
|
handleConnectedElements(e: any, eventType: string): Promise<void>;
|
|
47
47
|
handleGetKeyValue(e: any): void;
|
|
48
48
|
handleOnClickResetFormFields(e: any, field: TFieldTitle): Promise<void>;
|
|
49
|
+
handleApiCall(field: TFieldApiCall, api: any): Promise<{
|
|
50
|
+
field: TFieldApiCall;
|
|
51
|
+
api: any;
|
|
52
|
+
}>;
|
|
49
53
|
handleOnClickApiCall(e: any): Promise<void>;
|
|
50
54
|
/**
|
|
51
55
|
* Method to optimize the DOM update by Angular for using *ngFor on large no. of items.
|
|
@@ -71,7 +75,6 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
|
|
|
71
75
|
fieldErrorHide(fieldKey: string, message: TMessage): void;
|
|
72
76
|
fieldMessageShow(fieldKey: string, message: TMessage): void;
|
|
73
77
|
fieldMessageHide(fieldKey: string, message: TMessage): void;
|
|
74
|
-
setObjectValue(field: any, path: string, value: any): void;
|
|
75
78
|
patchFieldControlValue(key: string, value: any): void;
|
|
76
79
|
patchFormGroup(formData: any): void;
|
|
77
80
|
isFieldValid(fieldKey: string): boolean;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import { TValidation } from "kwikid-toolkit";
|
|
1
2
|
import { TFieldApiCall } from "../definitions/form-view.fields.definition";
|
|
2
3
|
export declare class Apis {
|
|
3
4
|
private _object;
|
|
4
5
|
get object(): any;
|
|
5
6
|
set object(value: any);
|
|
6
7
|
private _takeAction;
|
|
7
|
-
private _api;
|
|
8
8
|
private _request;
|
|
9
9
|
private _response;
|
|
10
|
-
private _status;
|
|
11
10
|
constructor(object: any, takeAction: any);
|
|
11
|
+
setUrl(): Promise<TFieldApiCall>;
|
|
12
12
|
setRequestBody(): Promise<TFieldApiCall>;
|
|
13
13
|
validateRequestBody(): Promise<TFieldApiCall>;
|
|
14
14
|
setRequestHeaders(): Promise<TFieldApiCall>;
|
|
15
15
|
validateRequestHeaders(): Promise<TFieldApiCall>;
|
|
16
16
|
validateResponse(): Promise<TFieldApiCall>;
|
|
17
|
+
callNextApi(validation: TValidation): Promise<any>;
|
|
17
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kwikid-forms",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Kwik.ID's JSON based Forms Builder and Renderer.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Baiju Dodhia"
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"jsonpath": "^1.1.1",
|
|
36
|
-
"kwikid-toolkit": "0.
|
|
37
|
-
"kwikui": "^0.2.
|
|
36
|
+
"kwikid-toolkit": "^0.1.1",
|
|
37
|
+
"kwikui": "^0.2.21",
|
|
38
38
|
"lodash": "^4.17.21",
|
|
39
39
|
"tslib": "^2.2.0"
|
|
40
40
|
},
|