kwikid-forms 0.0.0-watch

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 (87) hide show
  1. package/README.md +44 -0
  2. package/assets/done1.png +0 -0
  3. package/assets/edit.png +0 -0
  4. package/assets/lock.png +0 -0
  5. package/esm2015/kwikid-forms.js +5 -0
  6. package/esm2015/lib/builder/builder.component.js +138 -0
  7. package/esm2015/lib/builder/builder.module.js +21 -0
  8. package/esm2015/lib/kwikid-forms.module.js +53 -0
  9. package/esm2015/lib/renderer/form-view/definitions/actions/form-view.actions.enum.definitions.js +16 -0
  10. package/esm2015/lib/renderer/form-view/definitions/actions/form-view.actions.type.definitions.js +2 -0
  11. package/esm2015/lib/renderer/form-view/definitions/apis/form-view.apis.enum.definitions.js +8 -0
  12. package/esm2015/lib/renderer/form-view/definitions/apis/form-view.apis.type.definitions.js +2 -0
  13. package/esm2015/lib/renderer/form-view/definitions/common/form-view.common.enum.definitions.js +47 -0
  14. package/esm2015/lib/renderer/form-view/definitions/common/form-view.common.type.definitions.js +2 -0
  15. package/esm2015/lib/renderer/form-view/definitions/fields/form-view.fields.enum.definitions.js +15 -0
  16. package/esm2015/lib/renderer/form-view/definitions/fields/form-view.fields.type.definitions.js +2 -0
  17. package/esm2015/lib/renderer/form-view/definitions/rules/form-view.rules.enum.definitions.js +7 -0
  18. package/esm2015/lib/renderer/form-view/definitions/rules/form-view.rules.type.definitions.js +2 -0
  19. package/esm2015/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.js +16 -0
  20. package/esm2015/lib/renderer/form-view/definitions/sources/form-view.sources.type.definitions.js +2 -0
  21. package/esm2015/lib/renderer/form-view/definitions/triggers/form-view.triggers.type.definitions.js +2 -0
  22. package/esm2015/lib/renderer/form-view/definitions/validations/form-view.validations.type.definitions.js +2 -0
  23. package/esm2015/lib/renderer/form-view/form-view.component.js +654 -0
  24. package/esm2015/lib/renderer/form-view/form-view.decorators.js +93 -0
  25. package/esm2015/lib/renderer/form-view/form-view.module.js +37 -0
  26. package/esm2015/lib/renderer/form-view/form-view.service.js +27 -0
  27. package/esm2015/lib/renderer/form-view/helpers/form-view.actions.helper.js +27 -0
  28. package/esm2015/lib/renderer/form-view/helpers/form-view.apis.helper.js +105 -0
  29. package/esm2015/lib/renderer/form-view/helpers/form-view.common.helper.js +136 -0
  30. package/esm2015/lib/renderer/form-view/helpers/form-view.condition.helper.js +46 -0
  31. package/esm2015/lib/renderer/form-view/helpers/form-view.defaults.helper.js +52 -0
  32. package/esm2015/lib/renderer/form-view/helpers/form-view.fields.helper.js +146 -0
  33. package/esm2015/lib/renderer/form-view/helpers/form-view.rules.helper.js +86 -0
  34. package/esm2015/lib/renderer/form-view/helpers/form-view.sources.helper.js +161 -0
  35. package/esm2015/lib/renderer/form-view/helpers/form-view.validations.helper.js +156 -0
  36. package/esm2015/lib/renderer/forms-list/forms-list.component.js +61 -0
  37. package/esm2015/lib/renderer/forms-list/forms-list.helper.js +4 -0
  38. package/esm2015/lib/renderer/forms-list/forms-list.module.js +37 -0
  39. package/esm2015/lib/renderer/renderer.component.js +201 -0
  40. package/esm2015/lib/renderer/renderer.config-converter.helper.js +530 -0
  41. package/esm2015/lib/renderer/renderer.helper.js +50 -0
  42. package/esm2015/lib/renderer/renderer.module.js +39 -0
  43. package/esm2015/lib/renderer/renderer.service.js +115 -0
  44. package/esm2015/public_api.js +17 -0
  45. package/fesm2015/kwikid-forms.js +2970 -0
  46. package/fesm2015/kwikid-forms.js.map +1 -0
  47. package/kwikid-forms.d.ts +5 -0
  48. package/lib/builder/builder.component.d.ts +68 -0
  49. package/lib/builder/builder.module.d.ts +10 -0
  50. package/lib/kwikid-forms.module.d.ts +13 -0
  51. package/lib/renderer/form-view/definitions/actions/form-view.actions.enum.definitions.d.ts +14 -0
  52. package/lib/renderer/form-view/definitions/actions/form-view.actions.type.definitions.d.ts +91 -0
  53. package/lib/renderer/form-view/definitions/apis/form-view.apis.enum.definitions.d.ts +6 -0
  54. package/lib/renderer/form-view/definitions/apis/form-view.apis.type.definitions.d.ts +40 -0
  55. package/lib/renderer/form-view/definitions/common/form-view.common.enum.definitions.d.ts +43 -0
  56. package/lib/renderer/form-view/definitions/common/form-view.common.type.definitions.d.ts +7 -0
  57. package/lib/renderer/form-view/definitions/fields/form-view.fields.enum.definitions.d.ts +13 -0
  58. package/lib/renderer/form-view/definitions/fields/form-view.fields.type.definitions.d.ts +137 -0
  59. package/lib/renderer/form-view/definitions/rules/form-view.rules.enum.definitions.d.ts +5 -0
  60. package/lib/renderer/form-view/definitions/rules/form-view.rules.type.definitions.d.ts +41 -0
  61. package/lib/renderer/form-view/definitions/sources/form-view.sources.enum.definitions.d.ts +13 -0
  62. package/lib/renderer/form-view/definitions/sources/form-view.sources.type.definitions.d.ts +16 -0
  63. package/lib/renderer/form-view/definitions/triggers/form-view.triggers.type.definitions.d.ts +1 -0
  64. package/lib/renderer/form-view/definitions/validations/form-view.validations.type.definitions.d.ts +17 -0
  65. package/lib/renderer/form-view/form-view.component.d.ts +66 -0
  66. package/lib/renderer/form-view/form-view.decorators.d.ts +7 -0
  67. package/lib/renderer/form-view/form-view.module.d.ts +11 -0
  68. package/lib/renderer/form-view/form-view.service.d.ts +5 -0
  69. package/lib/renderer/form-view/helpers/form-view.actions.helper.d.ts +13 -0
  70. package/lib/renderer/form-view/helpers/form-view.apis.helper.d.ts +17 -0
  71. package/lib/renderer/form-view/helpers/form-view.common.helper.d.ts +19 -0
  72. package/lib/renderer/form-view/helpers/form-view.condition.helper.d.ts +8 -0
  73. package/lib/renderer/form-view/helpers/form-view.defaults.helper.d.ts +10 -0
  74. package/lib/renderer/form-view/helpers/form-view.fields.helper.d.ts +20 -0
  75. package/lib/renderer/form-view/helpers/form-view.rules.helper.d.ts +12 -0
  76. package/lib/renderer/form-view/helpers/form-view.sources.helper.d.ts +29 -0
  77. package/lib/renderer/form-view/helpers/form-view.validations.helper.d.ts +25 -0
  78. package/lib/renderer/forms-list/forms-list.component.d.ts +18 -0
  79. package/lib/renderer/forms-list/forms-list.helper.d.ts +1 -0
  80. package/lib/renderer/forms-list/forms-list.module.d.ts +11 -0
  81. package/lib/renderer/renderer.component.d.ts +30 -0
  82. package/lib/renderer/renderer.config-converter.helper.d.ts +7 -0
  83. package/lib/renderer/renderer.helper.d.ts +6 -0
  84. package/lib/renderer/renderer.module.d.ts +12 -0
  85. package/lib/renderer/renderer.service.d.ts +27 -0
  86. package/package.json +47 -0
  87. package/public_api.d.ts +9 -0
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="kwikid-forms" />
5
+ export * from './public_api';
@@ -0,0 +1,68 @@
1
+ import { OnInit } from "@angular/core";
2
+ import { FormGroup } from "@angular/forms";
3
+ import * as i0 from "@angular/core";
4
+ declare type IMenu = {
5
+ title: string;
6
+ id?: string;
7
+ key?: string;
8
+ temp?: string;
9
+ component?: any;
10
+ props?: any;
11
+ };
12
+ export declare class KwikIDFormsBuilderComponent implements OnInit {
13
+ buttonComponent: {
14
+ disabled: boolean;
15
+ id: string;
16
+ label: string;
17
+ showLoader: boolean;
18
+ styles: string;
19
+ class: string;
20
+ type: string;
21
+ appearance: string;
22
+ icon: string;
23
+ iconRight: string;
24
+ shape: any;
25
+ size: string;
26
+ };
27
+ progressSegmentedComponent: {
28
+ colors: string;
29
+ max: string;
30
+ size: string;
31
+ value: string;
32
+ };
33
+ inputComponent: {
34
+ case: string;
35
+ disabled: boolean;
36
+ focus: boolean;
37
+ id: string;
38
+ invalid: boolean;
39
+ label: string;
40
+ placeholder: string;
41
+ type: string;
42
+ validators: {
43
+ required: boolean;
44
+ };
45
+ };
46
+ formGroup: FormGroup;
47
+ constructor();
48
+ ngOnInit(): void;
49
+ revisedRandId(): string;
50
+ handleOnChange(event: {
51
+ target: {
52
+ value: any;
53
+ };
54
+ }, id: string | number, key: string | number, idx: any): void;
55
+ toggleShow(id: any): void;
56
+ name: string;
57
+ menu: Array<IMenu>;
58
+ table: Array<IMenu>;
59
+ drop(event: any): void;
60
+ exited(event: any): void;
61
+ entered(): void;
62
+ isNumber(val: any): "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
63
+ removeElement(idx: number, id: string): void;
64
+ getJSON(): void;
65
+ static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormsBuilderComponent, never>;
66
+ static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormsBuilderComponent, "kwikid-forms-builder", never, {}, {}, never, never>;
67
+ }
68
+ export {};
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./builder.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "@angular/cdk/drag-drop";
6
+ export declare class KwikIDFormBuilderModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormBuilderModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormBuilderModule, [typeof i1.KwikIDFormsBuilderComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.DragDropModule], [typeof i1.KwikIDFormsBuilderComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDFormBuilderModule>;
10
+ }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "@angular/platform-browser";
4
+ import * as i3 from "@angular/platform-browser/animations";
5
+ import * as i4 from "@angular/forms";
6
+ import * as i5 from "./builder/builder.module";
7
+ import * as i6 from "./renderer/renderer.module";
8
+ import * as i7 from "@taiga-ui/core";
9
+ export declare class KwikIDFormsModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormsModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormsModule, never, [typeof i1.CommonModule, typeof i2.BrowserModule, typeof i3.BrowserAnimationsModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.KwikIDFormBuilderModule, typeof i6.KwikIDFormRendererModule, typeof i7.TuiRootModule, typeof i7.TuiAlertModule], [typeof i5.KwikIDFormBuilderModule, typeof i6.KwikIDFormRendererModule]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDFormsModule>;
13
+ }
@@ -0,0 +1,14 @@
1
+ export declare enum EActionKey {
2
+ SET_VALUE = "SET_VALUE",
3
+ FIELD_MESSAGE_SHOW = "FIELD_MESSAGE_SHOW",
4
+ FIELD_MESSAGES_HIDE = "FIELD_MESSAGES_HIDE",
5
+ FIELD_ERROR_SHOW = "FIELD_ERROR_SHOW",
6
+ FIELD_ERROR_HIDE = "FIELD_ERROR_HIDE",
7
+ FIELD_SHOW = "FIELD_SHOW",
8
+ FIELD_HIDE = "FIELD_HIDE",
9
+ FIELD_ENABLE = "FIELD_ENABLE",
10
+ FIELD_DISABLE = "FIELD_DISABLE",
11
+ FIELD_RESET = "FIELD_RESET",
12
+ HANDLE_CONNECTED_ELEMENTS = "HANDLE_CONNECTED_ELEMENTS",
13
+ CUSTOM = "CUSTOM"
14
+ }
@@ -0,0 +1,91 @@
1
+ import { TMessage } from "../common/form-view.common.type.definitions";
2
+ import { TSourceKey } from "../sources/form-view.sources.type.definitions";
3
+ import { EActionKey } from "./form-view.actions.enum.definitions";
4
+ export declare type TActionKey = EActionKey.SET_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;
5
+ export declare type TAction = {
6
+ id: string;
7
+ key: TActionKey;
8
+ condition: string;
9
+ props: any;
10
+ };
11
+ export declare type TActionSetValue = TAction & {
12
+ key: EActionKey.SET_VALUE;
13
+ props: {
14
+ value: {
15
+ source: {
16
+ key: TSourceKey;
17
+ path?: string;
18
+ value?: any;
19
+ };
20
+ destination: {
21
+ key: TSourceKey;
22
+ path?: string;
23
+ value?: any;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ export declare type TActionFieldMessageShow = TAction & {
29
+ key: EActionKey.FIELD_MESSAGE_SHOW;
30
+ props: {
31
+ fieldKey: string;
32
+ message: TMessage;
33
+ };
34
+ };
35
+ export declare type TActionFieldMessageHide = TAction & {
36
+ key: EActionKey.FIELD_MESSAGES_HIDE;
37
+ props: {
38
+ fieldKey: string;
39
+ message: TMessage;
40
+ };
41
+ };
42
+ export declare type TActionFieldErrorShow = TAction & {
43
+ key: EActionKey.FIELD_ERROR_SHOW;
44
+ props: {
45
+ fieldKey: string;
46
+ message: TMessage;
47
+ };
48
+ };
49
+ export declare type IFieldErrorHide = TAction & {
50
+ key: EActionKey.FIELD_ERROR_HIDE;
51
+ props: {
52
+ fieldKey: string;
53
+ message: TMessage;
54
+ };
55
+ };
56
+ export declare type TActionFieldShow = TAction & {
57
+ key: EActionKey.FIELD_SHOW;
58
+ props: {
59
+ fieldKey: string;
60
+ };
61
+ };
62
+ export declare type TActionFieldHide = TAction & {
63
+ key: EActionKey.FIELD_HIDE;
64
+ props: {
65
+ fieldKey: string;
66
+ };
67
+ };
68
+ export declare type TActionFieldEnable = TAction & {
69
+ key: EActionKey.FIELD_ENABLE;
70
+ props: {
71
+ fieldKey: string;
72
+ };
73
+ };
74
+ export declare type TActionFieldDisable = TAction & {
75
+ key: EActionKey.FIELD_DISABLE;
76
+ props: {
77
+ fieldKey: string;
78
+ };
79
+ };
80
+ export declare type TActionFieldReset = TAction & {
81
+ key: EActionKey.FIELD_RESET;
82
+ props: {
83
+ fieldKey: string;
84
+ };
85
+ };
86
+ export declare type TActionHandleConnectedElement = TAction & {
87
+ key: EActionKey.HANDLE_CONNECTED_ELEMENTS;
88
+ props: {
89
+ fieldKey: string;
90
+ };
91
+ };
@@ -0,0 +1,6 @@
1
+ export declare enum EApiStatusType {
2
+ DEFAULT = "default",
3
+ LOADING = "loading",
4
+ SUCCESS = "success",
5
+ FAILED = "failed"
6
+ }
@@ -0,0 +1,40 @@
1
+ import { TSource } from "../sources/form-view.sources.type.definitions";
2
+ import { TValidation } from "../validations/form-view.validations.type.definitions";
3
+ import { EApiStatusType } from "./form-view.apis.enum.definitions";
4
+ export declare type TApiRequestBodyParam = {
5
+ key: string;
6
+ sources: Array<TSource>;
7
+ value: any;
8
+ };
9
+ export declare type TApiRequestBody = {
10
+ value: any;
11
+ params: Array<TApiRequestBodyParam>;
12
+ validation: TValidation;
13
+ };
14
+ export declare type TApiRequestHeaders = any;
15
+ export declare type TApiRequest = {
16
+ headers?: TApiRequestHeaders;
17
+ body: TApiRequestBody;
18
+ };
19
+ export declare type TApiResponseBody = any;
20
+ export declare type TApiResponse = {
21
+ is_valid: boolean;
22
+ body: TApiResponseBody;
23
+ validation: TValidation;
24
+ };
25
+ export declare type TApiStatusType = EApiStatusType.DEFAULT | EApiStatusType.LOADING | EApiStatusType.SUCCESS | EApiStatusType.FAILED;
26
+ export declare type TApiStatus = {
27
+ value: TApiStatusType;
28
+ labels: {
29
+ default: EApiStatusType.DEFAULT;
30
+ loading: EApiStatusType.LOADING;
31
+ success: EApiStatusType.SUCCESS;
32
+ failed: EApiStatusType.FAILED;
33
+ };
34
+ };
35
+ export declare type TApi = {
36
+ url: string;
37
+ request: TApiRequest;
38
+ response: TApiResponse;
39
+ status: TApiStatus;
40
+ };
@@ -0,0 +1,43 @@
1
+ export declare enum EPatternKey {
2
+ CUSTOM = "CUSTOM",
3
+ IS_PAN_NUMBER = "IS_PAN_NUMBER",
4
+ IS_AADHAAR_NUMBER = "IS_AADHAAR_NUMBER",
5
+ IS_EMPTY = "IS_EMPTY",
6
+ IS_NOT_EMPTY = "IS_NOT_EMPTY",
7
+ IS_EMAIL = "IS_EMAIL",
8
+ IS_NUMBER = "IS_NUMBER",
9
+ IS_INTEGER = "IS_INTEGER",
10
+ IS_URL = "IS_URL",
11
+ IS_ALPHA = "IS_ALPHA",
12
+ IS_ALPHANUMERIC = "IS_ALPHANUMERIC",
13
+ IS_UPPERCASE = "IS_UPPERCASE",
14
+ IS_LOWERCASE = "IS_LOWERCASE",
15
+ IS_IP_ADDRESS = "IS_IP_ADDRESS",
16
+ IS_JSON = "IS_JSON",
17
+ IS_HTML = "IS_HTML",
18
+ IS_TRUE = "IS_TRUE"
19
+ }
20
+ export declare enum EPattern {
21
+ IS_EMPTY = "^$",
22
+ IS_PAN_NUMBER = "^[A-Z]{5}[[0-9]{4}[A-Z]{1}$",
23
+ IS_AADHAAR_NUMBER = "^[0-9]{12}$",
24
+ IS_NOT_EMPTY = "^.+$",
25
+ IS_EMAIL = "^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$",
26
+ IS_NUMBER = "^[+-]?d+(.d+)?$",
27
+ IS_INTEGER = "^[+-]?d+$",
28
+ IS_URL = "^(?:http(s)?://)?[w.-]+(?:.[w.-]+)+[w-._~:/?#[]@!$&'()*+,;=.]+$",
29
+ IS_ALPHA = "^[a-zA-Z]+$",
30
+ IS_ALPHANUMERIC = "^[a-zA-Z0-9]+$",
31
+ IS_UPPERCASE = "^[A-Z]+$",
32
+ IS_LOWERCASE = "^[a-z]+$",
33
+ IS_IP_ADDRESS = "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$",
34
+ IS_JSON = "^\\s*({(.|\\s)}|[(.|\\s)])\\s*$",
35
+ IS_HTML = "^<([a-z]+)([^<]+)(?:>(.)</\\1>|\\s+/>)$",
36
+ IS_TRUE = "true"
37
+ }
38
+ export declare enum EMessageType {
39
+ DEFAULT = "default",
40
+ ERROR = "error",
41
+ SUCCESS = "success",
42
+ WARNING = "warning"
43
+ }
@@ -0,0 +1,7 @@
1
+ import { EMessageType, EPatternKey } from "./form-view.common.enum.definitions";
2
+ export declare type TMessageType = EMessageType.DEFAULT | EMessageType.ERROR | EMessageType.SUCCESS | EMessageType.WARNING;
3
+ export declare type TMessage = {
4
+ message: string;
5
+ type: TMessageType;
6
+ };
7
+ export declare type TPatternKey = EPatternKey.CUSTOM | EPatternKey.IS_AADHAAR_NUMBER | EPatternKey.IS_PAN_NUMBER | EPatternKey.IS_EMPTY | EPatternKey.IS_NOT_EMPTY | EPatternKey.IS_EMAIL | EPatternKey.IS_NUMBER | EPatternKey.IS_INTEGER | EPatternKey.IS_URL | EPatternKey.IS_ALPHA | EPatternKey.IS_ALPHANUMERIC | EPatternKey.IS_UPPERCASE | EPatternKey.IS_LOWERCASE | EPatternKey.IS_IP_ADDRESS | EPatternKey.IS_JSON | EPatternKey.IS_HTML;
@@ -0,0 +1,13 @@
1
+ export declare enum EFieldType {
2
+ TITLE = "title",
3
+ TEXT = "text",
4
+ CHECKBOX = "checkbox",
5
+ NUMBER = "number",
6
+ DATE = "date",
7
+ PHONE = "phone",
8
+ RADIO = "radio",
9
+ DROPDOWN_WITH_SEARCH = "dropdown-with-search",
10
+ API_CALL = "api-call",
11
+ OTP = "otp",
12
+ AADHAAR_NUMBER = "aadhaar-number"
13
+ }
@@ -0,0 +1,137 @@
1
+ import { TAction } from "../actions/form-view.actions.type.definitions";
2
+ import { TApi } from "../apis/form-view.apis.type.definitions";
3
+ import { TMessage } from "../common/form-view.common.type.definitions";
4
+ import { TSource } from "../sources/form-view.sources.type.definitions";
5
+ import { TValidation, TValidator } from "../validations/form-view.validations.type.definitions";
6
+ import { EFieldType } from "./form-view.fields.enum.definitions";
7
+ export declare type TFieldType = 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;
8
+ export declare type TFieldDropdownWithSearchOption = {
9
+ title: string;
10
+ value: string;
11
+ };
12
+ export declare type TFieldRadioOption = {
13
+ label: string;
14
+ disabled: boolean;
15
+ };
16
+ export declare type TFieldDefaultValue = {
17
+ is_found: boolean;
18
+ value: any;
19
+ sources: Array<TSource>;
20
+ };
21
+ export declare type TFieldDefault = {
22
+ value: TFieldDefaultValue;
23
+ };
24
+ export declare type TFieldProperties = {};
25
+ export declare type TFieldTextProperties = TFieldProperties & {
26
+ case: string;
27
+ placeholder: string;
28
+ readOnly: string;
29
+ };
30
+ export declare type TFieldCheckboxProperties = TFieldProperties & {
31
+ contentAlign: string;
32
+ size: string;
33
+ readOnly: string;
34
+ };
35
+ export declare type TFieldNumberProperties = TFieldProperties & {
36
+ min: number;
37
+ max: number;
38
+ prefix: number;
39
+ postfix: number;
40
+ precision: number;
41
+ placeholder: string;
42
+ decimal: number;
43
+ readOnly: boolean;
44
+ };
45
+ export declare type TFieldDateProperties = TFieldProperties & {
46
+ placeholder: string;
47
+ min: {
48
+ year: number;
49
+ month: number;
50
+ day: number;
51
+ };
52
+ max: {
53
+ year: number;
54
+ month: number;
55
+ day: number;
56
+ };
57
+ readOnly: boolean;
58
+ };
59
+ export declare type TFieldPhoneProperties = TFieldProperties & {
60
+ countryCode: string;
61
+ phoneMaskAfterCountryCode: string;
62
+ placeholder: string;
63
+ readOnly: boolean;
64
+ };
65
+ export declare type TFieldRadioProperties = TFieldProperties & {
66
+ size: string;
67
+ orientation: string;
68
+ readOnly: string;
69
+ };
70
+ export declare type TFieldDropdownWithSearchProperties = TFieldProperties & {
71
+ placeholder: string;
72
+ readOnly: boolean;
73
+ };
74
+ export declare type TFieldApiCallProperties = TFieldProperties & {};
75
+ export declare type TFieldOtpProperties = TFieldProperties & {
76
+ placeholder: string;
77
+ mask: string;
78
+ };
79
+ export declare type TFieldAadhaarNumberProperties = TFieldProperties & {
80
+ mask: string;
81
+ readOnly: string;
82
+ };
83
+ export declare type TField = {
84
+ label: string;
85
+ type: TFieldType;
86
+ key: string;
87
+ disabled: boolean;
88
+ messages: Array<TMessage>;
89
+ default: TFieldDefault;
90
+ validators: TValidator;
91
+ validation: TValidation;
92
+ properties: TFieldProperties;
93
+ };
94
+ export declare type TFieldTitle = {
95
+ type: TFieldType;
96
+ label: string;
97
+ key: string;
98
+ reset?: {
99
+ fields: Array<{
100
+ fieldKey: string;
101
+ actions: Array<TAction>;
102
+ }>;
103
+ };
104
+ };
105
+ export declare type TFieldText = TField & {
106
+ properties: TFieldTextProperties;
107
+ };
108
+ export declare type TFieldCheckbox = TField & {
109
+ properties: TFieldCheckboxProperties;
110
+ };
111
+ export declare type TFieldNumber = TField & {
112
+ properties: TFieldNumberProperties;
113
+ };
114
+ export declare type TFieldDate = TField & {
115
+ properties: TFieldDateProperties;
116
+ };
117
+ export declare type TFieldPhone = TField & {
118
+ properties: TFieldPhoneProperties;
119
+ };
120
+ export declare type TFieldRadio = TField & {
121
+ options: Array<TFieldRadioOption>;
122
+ properties: TFieldRadioProperties;
123
+ };
124
+ export declare type TFieldDropdownWithSearch = TField & {
125
+ options: Array<TFieldDropdownWithSearchOption>;
126
+ properties: TFieldDropdownWithSearchProperties;
127
+ };
128
+ export declare type TFieldApiCall = TField & {
129
+ api: TApi;
130
+ properties: TFieldApiCallProperties;
131
+ };
132
+ export declare type TFieldOtp = TField & {
133
+ properties: TFieldOtpProperties;
134
+ };
135
+ export declare type TFieldAadhaarNumber = TField & {
136
+ properties: TFieldAadhaarNumberProperties;
137
+ };
@@ -0,0 +1,5 @@
1
+ export declare enum ERuleKey {
2
+ OBJECT_PATH_EXISTS = "OBJECT_PATH_EXISTS",
3
+ VALUE_CHECK = "VALUE_CHECK",
4
+ VALUE_CHANGE = "VALUE_CHANGE"
5
+ }
@@ -0,0 +1,41 @@
1
+ import { TPatternKey } from "../common/form-view.common.type.definitions";
2
+ import { TSource, TSourceKey } from "../sources/form-view.sources.type.definitions";
3
+ import { ERuleKey } from "./form-view.rules.enum.definitions";
4
+ export declare type TRuleType = ERuleKey.OBJECT_PATH_EXISTS | ERuleKey.VALUE_CHECK | ERuleKey.VALUE_CHANGE;
5
+ export declare type TRule = {
6
+ id: string;
7
+ key: TRuleType;
8
+ props: any;
9
+ };
10
+ export declare type TRuleObjectPathExists = TRule & {
11
+ key: ERuleKey.OBJECT_PATH_EXISTS;
12
+ props: {
13
+ object: TSourceKey;
14
+ path: string;
15
+ };
16
+ };
17
+ export declare type TRuleValueCheck = TRule & {
18
+ key: ERuleKey.VALUE_CHECK;
19
+ props: {
20
+ value: {
21
+ source: TSource;
22
+ };
23
+ pattern: {
24
+ key: TPatternKey;
25
+ pattern?: string;
26
+ };
27
+ };
28
+ };
29
+ export declare type TRuleValueChange = TRule & {
30
+ key: ERuleKey.VALUE_CHANGE;
31
+ props: {
32
+ value: {
33
+ previous: {
34
+ source: TSource;
35
+ };
36
+ current: {
37
+ source: TSource;
38
+ };
39
+ };
40
+ };
41
+ };
@@ -0,0 +1,13 @@
1
+ export declare enum ESourceKey {
2
+ FIELD_CONFIG = "FIELD_CONFIG",
3
+ FORM_DATA = "FORM_DATA",
4
+ PREVIOUS_FORM_DATA = "PREVIOUS_FORM_DATA",
5
+ ALL_FORMS_DATA = "ALL_FORMS_DATA",
6
+ BROWSER_STORAGE = "BROWSER_STORAGE",
7
+ PREDEFINED = "PREDEFINED",
8
+ CUSTOM = "CUSTOM"
9
+ }
10
+ export declare enum EBrowserStorageType {
11
+ LOCAL_STORAGE = "LOCAL_STORAGE",
12
+ SESSION_STORAGE = "SESSION_STORAGE"
13
+ }
@@ -0,0 +1,16 @@
1
+ import { TValidation } from "../validations/form-view.validations.type.definitions";
2
+ import { EBrowserStorageType, ESourceKey } from "./form-view.sources.enum.definitions";
3
+ export declare type TSourceKey = ESourceKey.FIELD_CONFIG | ESourceKey.FORM_DATA | ESourceKey.ALL_FORMS_DATA | ESourceKey.PREVIOUS_FORM_DATA | ESourceKey.BROWSER_STORAGE | ESourceKey.PREDEFINED | ESourceKey.CUSTOM;
4
+ export declare type TBrowserStorageType = EBrowserStorageType.LOCAL_STORAGE | EBrowserStorageType.SESSION_STORAGE;
5
+ export declare type TSource = {
6
+ key: TSourceKey;
7
+ props: {
8
+ path?: string;
9
+ browserStorage?: {
10
+ type: TBrowserStorageType;
11
+ key: string;
12
+ };
13
+ };
14
+ value?: "";
15
+ validation?: TValidation;
16
+ };
@@ -0,0 +1 @@
1
+ export declare type TTrigger = string;
@@ -0,0 +1,17 @@
1
+ import { TAction } from "../actions/form-view.actions.type.definitions";
2
+ import { TRule } from "../rules/form-view.rules.type.definitions";
3
+ import { TTrigger } from "../triggers/form-view.triggers.type.definitions";
4
+ export declare type TValidator = {
5
+ max: number | null;
6
+ maxLength: number | null;
7
+ min: number | null;
8
+ minLength: number | null;
9
+ pattern: string | null;
10
+ required: boolean;
11
+ };
12
+ export declare type TValidation = {
13
+ is_valid: boolean;
14
+ triggers: Array<TTrigger>;
15
+ rules: Array<TRule>;
16
+ actions: Array<TAction>;
17
+ };
@@ -0,0 +1,66 @@
1
+ import { AfterViewInit, EventEmitter, OnInit, SimpleChanges } from "@angular/core";
2
+ import { FormGroup } from "@angular/forms";
3
+ import { TAction } from "./definitions/actions/form-view.actions.type.definitions";
4
+ import { TMessage } from "./definitions/common/form-view.common.type.definitions";
5
+ import { TField, TFieldTitle } from "./definitions/fields/form-view.fields.type.definitions";
6
+ import { KwikIDFormViewService } from "./form-view.service";
7
+ import * as i0 from "@angular/core";
8
+ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit {
9
+ private formViewService;
10
+ componentThis: this;
11
+ formConfig: any;
12
+ formData: any;
13
+ apiCallResponse: any;
14
+ isMobileView: boolean;
15
+ allFormsData: any;
16
+ formsList: any[];
17
+ onClickViewForms: EventEmitter<any>;
18
+ onClickSaveForm: EventEmitter<any>;
19
+ onClickApiCall: EventEmitter<any>;
20
+ getActiveFormData: EventEmitter<any>;
21
+ formFields: any[];
22
+ previousFormData: any;
23
+ loading: boolean;
24
+ viewFormsButton: {
25
+ disabled: boolean;
26
+ showLoader: boolean;
27
+ };
28
+ saveFormButton: {
29
+ disabled: boolean;
30
+ showLoader: boolean;
31
+ };
32
+ formGroup: FormGroup;
33
+ constructor(formViewService: KwikIDFormViewService);
34
+ ngOnInit(): void;
35
+ ngAfterViewInit(): void;
36
+ ngOnChanges(changes: SimpleChanges): void;
37
+ initFormConfig(formConfig: any): Promise<void>;
38
+ setFormFieldsFromFormConfig(formConfig: any): void;
39
+ setFormDataFromAllFormsData(): void;
40
+ handleConnectedElementFieldActions(connectedFieldConfig: any, connectedField: any): Promise<any>;
41
+ handleConnectedElementFields(currentField: any, connectedFieldConfig: any, eventType: string): Promise<any>;
42
+ handleConnectedElements(e: any, eventType: string): void;
43
+ handleGetKeyValue(e: any): void;
44
+ handleOnClickResetFormFields(e: any, field: TFieldTitle): Promise<void>;
45
+ handleOnClickApiCall(e: any): Promise<void>;
46
+ handleOnClickViewForms(e: any): void;
47
+ handleOnClickSaveForm(e: any): void;
48
+ fieldHide(fieldKey: string): void;
49
+ fieldShow(fieldKey: string): void;
50
+ fieldDisable(fieldKey: string): void;
51
+ fieldEnable(fieldKey: string): void;
52
+ fieldReset(fieldKey: string): void;
53
+ fieldErrorShow(fieldKey: string, message: TMessage): void;
54
+ fieldErrorHide(fieldKey: string, message: TMessage): void;
55
+ fieldMessageShow(fieldKey: string, message: TMessage): void;
56
+ fieldMessageHide(fieldKey: string, message: TMessage): void;
57
+ setObjectValue(field: any, path: string, value: any): void;
58
+ patchFieldControlValue(key: string, value: any): void;
59
+ isFieldValid(fieldKey: string): boolean;
60
+ isFieldEnabled(fieldKey: string): boolean;
61
+ getFormGroupRawValues(): any;
62
+ handleFieldTypeSearchText(field: any, childField: any): Promise<any>;
63
+ takeAction(action: TAction, field: TField, allFormsData: any, formData: any, previousFormData: any): Promise<void>;
64
+ static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewComponent, never>;
65
+ static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormViewComponent, "kwikid-form-view", never, { "formConfig": "formConfig"; "formData": "formData"; "apiCallResponse": "apiCallResponse"; "isMobileView": "isMobileView"; "allFormsData": "allFormsData"; "formsList": "formsList"; }, { "onClickViewForms": "onClickViewForms"; "onClickSaveForm": "onClickSaveForm"; "onClickApiCall": "onClickApiCall"; "getActiveFormData": "getActiveFormData"; }, never, never>;
66
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * A function that logs the execution of a method.
3
+ * @param {any} target - The object the method belongs to.
4
+ * @param {string} propertyKey - The name of the method.
5
+ * @param {PropertyDescriptor} descriptor - The property descriptor for the method.
6
+ */
7
+ export declare function log(target: any, propertyKey: string, descriptor: PropertyDescriptor): void;
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./form-view.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/forms";
5
+ import * as i4 from "@taiga-ui/core";
6
+ import * as i5 from "kwikui";
7
+ export declare class KwikIDFormViewModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<KwikIDFormViewModule, [typeof i1.KwikIDFormViewComponent], [typeof i2.CommonModule, typeof i3.FormsModule, typeof i3.ReactiveFormsModule, typeof i4.TuiLabelModule, typeof i5.KwikUIModule], [typeof i1.KwikIDFormViewComponent]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<KwikIDFormViewModule>;
11
+ }
@@ -0,0 +1,5 @@
1
+ import { FormGroup } from "@angular/forms";
2
+ export declare class KwikIDFormViewService {
3
+ constructor();
4
+ createFormGroup(fields: any, formData: any, previousFormData: any, allFormsData: any, takeAction: Function): Promise<FormGroup>;
5
+ }
@@ -0,0 +1,13 @@
1
+ import { TAction } from "../definitions/actions/form-view.actions.type.definitions";
2
+ import { TField } from "../definitions/fields/form-view.fields.type.definitions";
3
+ export declare class Actions {
4
+ private _action;
5
+ private _allFormsData;
6
+ private _field;
7
+ private _formData;
8
+ private _previousFormData;
9
+ private _ruleMapping;
10
+ private _takeAction;
11
+ constructor(action: TAction, field: TField, ruleMapping: any, allFormsData: any, formData: any, previousFormData: any, takeAction: Function);
12
+ execute(): Promise<any>;
13
+ }