@idscan/idvc2 3.2.0 → 3.3.0

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.
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -29,9 +29,10 @@ export type DocumentType = {
29
29
  type: DocumentTypeName;
30
30
  steps: StepConfig[];
31
31
  mode?: StepMode;
32
+ tooltipText?: string;
32
33
  };
33
34
  type ImageURI = 'png' | 'jpeg' | 'webp';
34
- export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
35
+ export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'language' | 'customTranslations' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autocaptureConfidence' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'fixFrontOrientAfterUpload' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onDocumentTypeSelect' | 'onReloaded';
35
36
  /**
36
37
  * IDefaultConfig
37
38
  * @param {string} name,
@@ -29,6 +29,7 @@ export declare class WeblibUI {
29
29
  private setFaceOffsets;
30
30
  private setCropFace;
31
31
  private initMainScreenComponents;
32
+ private getDocumentsFromAllowedTypes;
32
33
  private initStepsList;
33
34
  updateInitScreenDocuments(allowedTypesIds: any): void;
34
35
  private initDocumentsList;
@@ -6,7 +6,7 @@ import { DocumentTypeName } from '../environment/documentTypes';
6
6
  import { DeepPartial } from '../types/helpers/DeepPartial';
7
7
  import { IDocumentTypeConfig } from './validator';
8
8
  import { IStepCallback } from './Step';
9
- import { IDataForSubmit } from '../util';
9
+ import { IDataForDocumentTypeSelect, IDataForSubmit } from '../util';
10
10
  import ValidateDocumentTypes from './validation/ValidateDocumentTypes';
11
11
  /**
12
12
  * @param {string} el,
@@ -126,8 +126,15 @@ export interface IConfig {
126
126
  onReset?: (data: IDataForSubmit) => void;
127
127
  /** function which will be called in case the camera is not available */
128
128
  onCameraError?: (data: Error) => void;
129
- /** function which will be called after clicking the submit button */
129
+ /** function which will be called after clicking the submit button
130
+ *
131
+ * This option switches on/off the HEIC image processing (HEIC is Apple’s proprietary version of the Image File format). It’s possible to upload an image of this type only using a Mac/MacBook
132
+ */
130
133
  submit?: (data: IDataForSubmit) => void;
134
+ /**
135
+ * Function that will be called when a document type is selected.
136
+ */
137
+ onDocumentTypeSelect?: (data: IDataForDocumentTypeSelect) => void;
131
138
  }
132
139
  declare class Config implements IConfig {
133
140
  el: string;
@@ -0,0 +1,3 @@
1
+ import { TemplateResult } from 'lit-html';
2
+ export declare function toggleTooltip(event: Event): void;
3
+ export declare function HelpTooltipTemplate(tooltipText: string): TemplateResult;
@@ -0,0 +1 @@
1
+ export { HelpTooltipTemplate } from './HelpTooltip';
@@ -16,5 +16,5 @@ export type InitScreenEvents = {
16
16
  export declare class InitScreen extends ComponentLit<InitScreenState> {
17
17
  constructor(mountElement: HTMLElement | string, state: InitScreenState, events?: InitScreenEvents);
18
18
  protected renderTemplate(): void;
19
- private handleDocumentClick;
19
+ handleDocumentClick: (event: Event) => void;
20
20
  }
@@ -1,6 +1,7 @@
1
1
  import Modal from './Modal';
2
2
  import { DocumentRecord, DocumentTypeName } from '../../environment/documentTypes';
3
3
  import { ModalPositionKeys } from '../../environment/modalPosition';
4
+ import { IDataForDocumentTypeSelect } from '../../util';
4
5
  interface ILoader {
5
6
  addState: () => void;
6
7
  showLoader: () => void;
@@ -9,17 +10,20 @@ interface ILoader {
9
10
  hideLoader: () => void;
10
11
  }
11
12
  declare class SelectDocumentType extends Modal {
13
+ #private;
12
14
  private elementsList;
13
15
  private header;
14
16
  private list;
15
17
  private loader;
16
- constructor(componentWrapper: HTMLElement, loader: ILoader, modalPositionClass: ModalPositionKeys);
18
+ constructor(componentWrapper: HTMLElement, loader: ILoader, modalPositionClass: ModalPositionKeys, onDocumentTypeSelect: (params: IDataForDocumentTypeSelect) => void);
17
19
  show(currentDocument: DocumentTypeName | ''): void;
18
20
  hide(): void;
19
21
  showCancelButton(): void;
20
22
  addCancelHandler(handler: (e?: Event) => void): void;
21
23
  clearList(): void;
22
- addType({ name: docType, humanName, id }: DocumentRecord): void;
24
+ addType({ name: docType, humanName, id, tooltipText, }: DocumentRecord & {
25
+ tooltipText?: string;
26
+ }): void;
23
27
  render(): void;
24
28
  private hideCancelButton;
25
29
  private createElement;
@@ -7,12 +7,14 @@ export interface IValidateDocumentTypes {
7
7
  steps: any[];
8
8
  commonStepTypes: Set<StepType>;
9
9
  documentTypes: IDocumentTypeConfig;
10
+ tooltipTextMap: Partial<Record<DocumentTypeName, string>>;
10
11
  }
11
12
  declare class ValidateDocumentTypes implements IValidator<DocumentType[]> {
12
13
  types: any[];
13
14
  steps: any[];
14
15
  commonStepTypes: Set<StepType>;
15
16
  documentTypes: IDocumentTypeConfig;
17
+ tooltipTextMap: Partial<Record<DocumentTypeName, string>>;
16
18
  static checkIsDocumentTypes(obj: unknown): obj is IValidateDocumentTypes;
17
19
  validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): IValidateDocumentTypes;
18
20
  validateTypes(types: string[]): DocumentTypeName[];
@@ -1,7 +1,11 @@
1
1
  import { Base64Image } from './helpers/image';
2
2
  import { IStepCallback } from './modules/Step';
3
- import { DocumentTypeIndex } from './environment/documentTypes';
3
+ import { DocumentTypeIndex, DocumentTypeName } from './environment/documentTypes';
4
4
  import { Context } from './types/context';
5
+ export interface IDataForDocumentTypeSelect {
6
+ docType: DocumentTypeName;
7
+ id: 0 | DocumentTypeIndex;
8
+ }
5
9
  export interface IDataForSubmit {
6
10
  metaData?: string;
7
11
  payload?: Record<string, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",