kwikid-forms 0.6.27 → 0.6.28

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 (25) hide show
  1. package/bundles/kwikid-forms.umd.js +903 -513
  2. package/bundles/kwikid-forms.umd.js.map +1 -1
  3. package/esm2015/lib/renderer/form-view/definitions/form-view.logs.definition.js +44 -0
  4. package/esm2015/lib/renderer/form-view/form-view.component.js +261 -20
  5. package/esm2015/lib/renderer/form-view/helpers/form-view.logs.helper.js +19 -0
  6. package/esm2015/lib/renderer/forms-list/forms-list.component.js +22 -5
  7. package/esm2015/lib/renderer/forms-list/forms-list.definitions.js +7 -1
  8. package/esm2015/lib/renderer/forms-list/forms-list.helper.js +19 -0
  9. package/esm2015/lib/renderer/renderer.component.js +62 -16
  10. package/esm2015/lib/renderer/renderer.definitions.js +10 -1
  11. package/esm2015/lib/renderer/renderer.helper.js +19 -1
  12. package/fesm2015/kwikid-forms.js +446 -38
  13. package/fesm2015/kwikid-forms.js.map +1 -1
  14. package/lib/renderer/form-view/definitions/form-view.logs.definition.d.ts +42 -0
  15. package/lib/renderer/form-view/form-view.component.d.ts +4 -1
  16. package/lib/renderer/form-view/helpers/form-view.logs.helper.d.ts +7 -0
  17. package/lib/renderer/forms-list/forms-list.component.d.ts +4 -1
  18. package/lib/renderer/forms-list/forms-list.definitions.d.ts +5 -0
  19. package/lib/renderer/forms-list/forms-list.helper.d.ts +7 -0
  20. package/lib/renderer/renderer.component.d.ts +3 -1
  21. package/lib/renderer/renderer.definitions.d.ts +8 -0
  22. package/lib/renderer/renderer.helper.d.ts +7 -0
  23. package/package.json +1 -1
  24. package/esm2015/lib/renderer/form-view/definitions/from-view.logs.definition.js +0 -5
  25. package/lib/renderer/form-view/definitions/from-view.logs.definition.d.ts +0 -3
@@ -0,0 +1,42 @@
1
+ export declare enum ELogEventType {
2
+ FORM__ACTION_EXECUTE = "FORM__ACTION_EXECUTE",
3
+ FORM__ACTION_EXECUTE_GROUP = "FORM__ACTION_EXECUTE_GROUP",
4
+ FORM__ALERT_ERROR = "FORM__ALERT_ERROR",
5
+ FORM__ALERT_HIDE = "FORM__ALERT_HIDE",
6
+ FORM__ALERT_SHOW = "FORM__ALERT_SHOW",
7
+ FORM__API_BUTTON_CLICK = "FORM__API_BUTTON_CLICK",
8
+ FORM__API_REQUEST = "FORM__API_REQUEST",
9
+ FORM__API_REQUEST_INVALID = "FORM__API_REQUEST_INVALID",
10
+ FORM__API_RESPONSE = "FORM__API_RESPONSE",
11
+ FORM__CAMERA_BACK_BUTTON_CLICK = "FORM__CAMERA_BACK_BUTTON_CLICK",
12
+ FORM__CAMERA_CLOSE_BUTTON_CLICK = "FORM__CAMERA_CLOSE_BUTTON_CLICK",
13
+ FORM__CAMERA_SAVE_BUTTON_CLICK = "FORM__CAMERA_SAVE_BUTTON_CLICK",
14
+ FORM__CONFIG_LOAD_SUCCESS = "FORM__CONFIG_LOAD_SUCCESS",
15
+ FORM__DIALOG_ERROR = "FORM__DIALOG_ERROR",
16
+ FORM__DIALOG_HIDE = "FORM__DIALOG_HIDE",
17
+ FORM__DIALOG_SHOW = "FORM__DIALOG_SHOW",
18
+ FORM__FIELD_BUTTON_CLICK = "FORM__FIELD_BUTTON_CLICK",
19
+ FORM__FIELD_CAMERA_BUTTON_CLICK = "FORM__FIELD_CAMERA_BUTTON_CLICK",
20
+ FORM__FIELD_DISABLE = "FORM__FIELD_DISABLE",
21
+ FORM__FIELD_ENABLE = "FORM__FIELD_ENABLE",
22
+ FORM__FIELD_ERROR_HIDE = "FORM__FIELD_ERROR_HIDE",
23
+ FORM__FIELD_ERROR_SHOW = "FORM__FIELD_ERROR_SHOW",
24
+ FORM__FIELD_FILE_ADD = "FORM__FIELD_FILE_ADD",
25
+ FORM__FIELD_FILE_REMOVE = "FORM__FIELD_FILE_REMOVE",
26
+ FORM__FIELD_HIDE = "FORM__FIELD_HIDE",
27
+ FORM__FIELD_MEDIA_FILE_REMOVE = "FORM__FIELD_MEDIA_FILE_REMOVE",
28
+ FORM__FIELD_MESSAGE_HIDE = "FORM__FIELD_MESSAGE_HIDE",
29
+ FORM__FIELD_MESSAGE_SHOW = "FORM__FIELD_MESSAGE_SHOW",
30
+ FORM__FIELD_RESET = "FORM__FIELD_RESET",
31
+ FORM__FIELD_RESET_BUTTON_CLICK = "FORM__FIELD_RESET_BUTTON_CLICK",
32
+ FORM__FIELD_SHOW = "FORM__FIELD_SHOW",
33
+ FORM__PREVIEW_ERROR = "FORM__PREVIEW_ERROR",
34
+ FORM__PREVIEW_HIDE = "FORM__PREVIEW_HIDE",
35
+ FORM__PREVIEW_SHOW = "FORM__PREVIEW_SHOW",
36
+ FORM__REDIRECT_URL = "FORM__REDIRECT_URL",
37
+ FORM__SAVE_AUTO = "FORM__SAVE_AUTO",
38
+ FORM__SAVE_BUTTON_CLICK = "FORM__SAVE_BUTTON_CLICK",
39
+ FORM__TASK_POST = "FORM__TASK_POST",
40
+ FORM__TASK_PRE = "FORM__TASK_PRE",
41
+ FORM__VIEW_BUTTON_CLICK = "FORM__VIEW_BUTTON_CLICK"
42
+ }
@@ -9,6 +9,7 @@ import { KwikUILoaderService } from "kwikui";
9
9
  import { TApi } from "./definitions/form-view.apis.definition";
10
10
  import { TFormViewGoBackMode, TMessage } from "./definitions/form-view.commons.definition";
11
11
  import { TFieldApiCall, TFieldTitle } from "./definitions/form-view.fields.definition";
12
+ import { ELogEventType } from "./definitions/form-view.logs.definition";
12
13
  import { KwikIDFormViewService } from "./form-view.service";
13
14
  import * as i0 from "@angular/core";
14
15
  export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit, OnChanges, OnDestroy {
@@ -31,6 +32,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit, O
31
32
  isMobileView: boolean;
32
33
  popupFormCallback: any;
33
34
  userConfig: any;
35
+ stepConfig: any;
34
36
  getLogs: EventEmitter<any>;
35
37
  getUnsavedDataState: EventEmitter<any>;
36
38
  onActionShowPopupForm: EventEmitter<any>;
@@ -84,6 +86,7 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit, O
84
86
  ngAfterViewInit(): void;
85
87
  ngOnChanges(changes: SimpleChanges): void;
86
88
  ngOnDestroy(): void;
89
+ triggerLogs(eventType: ELogEventType, logs: any): void;
87
90
  initFormConfig(formConfig: any): Promise<boolean>;
88
91
  setFormFieldsFromFormConfig(formConfig: any): void;
89
92
  setFormFieldGroupsFromFormConfig(formConfig: any): void;
@@ -188,5 +191,5 @@ export declare class KwikIDFormViewComponent implements OnInit, AfterViewInit, O
188
191
  takeActionOnFieldGroup(action: TAction, object: any): Promise<void>;
189
192
  takeAction(action: TAction, object: any): Promise<void>;
190
193
  static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormViewComponent, never>;
191
- 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>;
194
+ 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"; "stepConfig": "stepConfig"; }, { "getLogs": "getLogs"; "getUnsavedDataState": "getUnsavedDataState"; "onActionShowPopupForm": "onActionShowPopupForm"; "onClickApiCall": "onClickApiCall"; "onClickFormFieldButton": "onClickFormFieldButton"; "onClickGoBack": "onClickGoBack"; "onClickSaveForm": "onClickSaveForm"; "onClickViewForms": "onClickViewForms"; }, never, never>;
192
195
  }
@@ -0,0 +1,7 @@
1
+ import { ELogEventType } from "../definitions/form-view.logs.definition";
2
+ export declare function formatEventLogs(eventType: ELogEventType, stepConfig: any, formConfig: any, extras: any): {
3
+ type: ELogEventType;
4
+ label: string;
5
+ timestamp: number;
6
+ data: any;
7
+ };
@@ -1,4 +1,5 @@
1
1
  import { EventEmitter, OnChanges, OnInit, SimpleChanges } from "@angular/core";
2
+ import { ELogEventType } from "./forms-list.definitions";
2
3
  import * as i0 from "@angular/core";
3
4
  export declare class KwikIDFormsListComponent implements OnInit, OnChanges {
4
5
  showFormFields: any;
@@ -9,6 +10,7 @@ export declare class KwikIDFormsListComponent implements OnInit, OnChanges {
9
10
  formsListCompleted: any[];
10
11
  isMobileView: boolean;
11
12
  isUnsavedData: boolean;
13
+ getLogs: EventEmitter<any>;
12
14
  onClickSetActiveForm: EventEmitter<any>;
13
15
  onClickHideFormsList: EventEmitter<any>;
14
16
  onClickSubmitForms: EventEmitter<any>;
@@ -20,6 +22,7 @@ export declare class KwikIDFormsListComponent implements OnInit, OnChanges {
20
22
  constructor();
21
23
  ngOnInit(): void;
22
24
  ngOnChanges(changes: SimpleChanges): void;
25
+ triggerLogs(eventType: ELogEventType, logs: any): void;
23
26
  formatStepConfig(stepConfig: any): any;
24
27
  filterHiddenForms(formsList: any[]): any[];
25
28
  setFormTitles(formsList: any[]): any[];
@@ -28,5 +31,5 @@ export declare class KwikIDFormsListComponent implements OnInit, OnChanges {
28
31
  handleOnClickSetActiveForm(selectedForm: string): void;
29
32
  handleOnSubmitForms(e: any): void;
30
33
  static ɵfac: i0.ɵɵFactoryDeclaration<KwikIDFormsListComponent, never>;
31
- static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormsListComponent, "kwikid-forms-list", never, { "showFormFields": "showFormFields"; "userConfig": "userConfig"; "stepConfig": "stepConfig"; "activeFormConfig": "activeFormConfig"; "formsList": "formsList"; "formsListCompleted": "formsListCompleted"; "isMobileView": "isMobileView"; "isUnsavedData": "isUnsavedData"; }, { "onClickSetActiveForm": "onClickSetActiveForm"; "onClickHideFormsList": "onClickHideFormsList"; "onClickSubmitForms": "onClickSubmitForms"; }, never, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<KwikIDFormsListComponent, "kwikid-forms-list", never, { "showFormFields": "showFormFields"; "userConfig": "userConfig"; "stepConfig": "stepConfig"; "activeFormConfig": "activeFormConfig"; "formsList": "formsList"; "formsListCompleted": "formsListCompleted"; "isMobileView": "isMobileView"; "isUnsavedData": "isUnsavedData"; }, { "getLogs": "getLogs"; "onClickSetActiveForm": "onClickSetActiveForm"; "onClickHideFormsList": "onClickHideFormsList"; "onClickSubmitForms": "onClickSubmitForms"; }, never, never>;
32
35
  }
@@ -4,3 +4,8 @@ export declare enum EFormsListStatus {
4
4
  LOCKED = "locked"
5
5
  }
6
6
  export declare type TFormsListStatus = EFormsListStatus.COMPLETED | EFormsListStatus.EDITABLE | EFormsListStatus.LOCKED;
7
+ export declare enum ELogEventType {
8
+ FORM__FORM_OPEN_BUTTON_CLICK = "FORM__FORM_OPEN_BUTTON_CLICK",
9
+ FORM__LIST_LOAD_SUCCESS = "FORM__LIST_LOAD_SUCCESS",
10
+ FORM__STEP_CONFIG_LOAD_SUCCESS = "FORM__STEP_CONFIG_LOAD_SUCCESS"
11
+ }
@@ -0,0 +1,7 @@
1
+ import { ELogEventType } from "./forms-list.definitions";
2
+ export declare function formatEventLogs(eventType: ELogEventType, stepConfig: any, extras: any): {
3
+ type: ELogEventType;
4
+ label: string;
5
+ timestamp: number;
6
+ data: any;
7
+ };
@@ -2,6 +2,7 @@ import { ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnInit, SimpleC
2
2
  import { TuiPreviewDialogService } from "@taiga-ui/addon-preview";
3
3
  import { TuiDialogContext, TuiDialogService } from "@taiga-ui/core";
4
4
  import { KwikUILoaderService } from "kwikui";
5
+ import { ELogEventType } from "./renderer.definitions";
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
7
8
  private hostElement;
@@ -44,6 +45,7 @@ export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
44
45
  constructor(hostElement: ElementRef, cdr: ChangeDetectorRef, previewDialogService: TuiPreviewDialogService, loaderService: KwikUILoaderService, dialogs: TuiDialogService);
45
46
  ngOnInit(): void;
46
47
  ngOnChanges(changes: SimpleChanges): void;
48
+ triggerLogs(eventType: ELogEventType, logs: any): void;
47
49
  toggleLoader(loader: any): void;
48
50
  fetchFormConfig(url: string): Promise<any>;
49
51
  initializeForms(eventType: string): Promise<void>;
@@ -87,7 +89,7 @@ export declare class KwikIDFormsRendererComponent implements OnInit, OnChanges {
87
89
  * FormList - Listens to event of opening the FormView of when any form is clicked in FormList
88
90
  * @param selectedForm string
89
91
  */
90
- handleOnClickSetActiveForm(selectedForm: string): Promise<void>;
92
+ handleOnClickSetActiveForm(selectedForm: string, triggerType: any): Promise<void>;
91
93
  /**
92
94
  * FormView - Listens to event of executing an API call from within the FormView and emits (read as passes) the same event to the library consumer.
93
95
  * @param e any
@@ -3,3 +3,11 @@ export declare enum EFormType {
3
3
  HTML = "HTML"
4
4
  }
5
5
  export declare type TActionKey = EFormType.FORM | EFormType.HTML;
6
+ export declare enum ELogEventType {
7
+ FORM__ACTION_EXECUTE = "FORM__ACTION_EXECUTE",
8
+ FORM__FORM_OPEN_AUTO = "FORM__FORM_OPEN_AUTO",
9
+ FORM__FORM_OPEN_BUTTON_CLICK = "FORM__FORM_OPEN_BUTTON_CLICK",
10
+ FORM__SUBMIT_FORM_BUTTON_CLICK = "FORM__SUBMIT_FORM_BUTTON_CLICK",
11
+ FORM__SUBMIT_FORM_BUTTON_CLICK_INVALID = "FORM__SUBMIT_FORM_BUTTON_CLICK_INVALID",
12
+ FORM__STEP_CONFIG_LOAD_SUCCESS = "FORM__STEP_CONFIG_LOAD_SUCCESS"
13
+ }
@@ -1 +1,8 @@
1
+ import { ELogEventType } from "./renderer.definitions";
1
2
  export declare const getFormConfigByKey: (forms: any[], key: string) => any;
3
+ export declare function formatEventLogs(eventType: ELogEventType, stepConfig: any, extras: any): {
4
+ type: ELogEventType;
5
+ label: string;
6
+ timestamp: number;
7
+ data: any;
8
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwikid-forms",
3
- "version": "0.6.27",
3
+ "version": "0.6.28",
4
4
  "description": "KwikID's JSON Configuration based Forms Renderer and Builder",
5
5
  "author": {
6
6
  "name": "Baiju Dodhia"
@@ -1,5 +0,0 @@
1
- export var ETypeLogs;
2
- (function (ETypeLogs) {
3
- ETypeLogs["API"] = "API";
4
- })(ETypeLogs || (ETypeLogs = {}));
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbS12aWV3LmxvZ3MuZGVmaW5pdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2t3aWtpZC1mb3Jtcy9zcmMvbGliL3JlbmRlcmVyL2Zvcm0tdmlldy9kZWZpbml0aW9ucy9mcm9tLXZpZXcubG9ncy5kZWZpbml0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBTixJQUFZLFNBRVg7QUFGRCxXQUFZLFNBQVM7SUFDbkIsd0JBQVcsQ0FBQTtBQUNiLENBQUMsRUFGVyxTQUFTLEtBQVQsU0FBUyxRQUVwQiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBlbnVtIEVUeXBlTG9ncyB7XG4gIEFQSSA9IFwiQVBJXCJcbn1cbiJdfQ==
@@ -1,3 +0,0 @@
1
- export declare enum ETypeLogs {
2
- API = "API"
3
- }