@trustpayments/js-payments-card 2.2.932 → 2.2.936
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/dist/components/card/Card.component.d.ts +47 -0
- package/dist/components/card/Card.interface.d.ts +9 -0
- package/dist/components/card/Card.spec.d.ts +4 -0
- package/dist/components/card/CardLogos.const.d.ts +3 -0
- package/dist/components/card/CardProperties.const.d.ts +36 -0
- package/dist/components/card/CardSelectors.const.d.ts +30 -0
- package/dist/components/card/CardType.const.d.ts +18 -0
- package/dist/components/card-wrapper/CardWrapper.d.ts +35 -0
- package/dist/components/card-wrapper/CardWrapper.interface.d.ts +20 -0
- package/dist/components/card-wrapper/CardWrapper.spec.d.ts +4 -0
- package/dist/example.js +1 -1
- package/dist/index.d.ts +3 -58
- package/dist/index.js +1 -1
- package/dist/services/dom-methods/DomMethods.service.d.ts +8 -0
- package/dist/services/dom-methods/DomMethods.service.spec.d.ts +4 -0
- package/dist/services/formatter/Formatter.service.d.ts +15 -0
- package/dist/services/formatter/Formatter.service.spec.d.ts +4 -0
- package/dist/services/translator/Translation.service.spec.d.ts +4 -0
- package/dist/services/translator/Translator.service.d.ts +11 -0
- package/dist/services/utils/Utils.service.d.ts +17 -0
- package/dist/services/utils/Utils.service.spec.d.ts +4 -0
- package/dist/services/validator/Validator.service.d.ts +38 -0
- package/dist/services/validator/Validator.service.spec.d.ts +4 -0
- package/dist/shared/imports/polyfills.d.ts +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class DomMethods {
|
|
2
|
+
static addClass: (element: HTMLElement, classToAdd: string) => void;
|
|
3
|
+
static appendChildIntoDOM(target: string, child: HTMLElement): HTMLElement;
|
|
4
|
+
static createHtmlElement: (attributes: Record<string, string>, markup: string) => HTMLElement;
|
|
5
|
+
static removeClass: (element: HTMLElement, classToRemove: string) => void;
|
|
6
|
+
static removeChildFromDOM(parentId: string, childId: string): HTMLElement;
|
|
7
|
+
static setProperty(attr: string, value: string, elementId: string): HTMLElement;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Validator } from "../validator/Validator.service";
|
|
2
|
+
export declare class Formatter extends Validator {
|
|
3
|
+
private blocks;
|
|
4
|
+
private cardNumberFormatted;
|
|
5
|
+
private dateBlocks;
|
|
6
|
+
constructor(locale: string);
|
|
7
|
+
number(cardNumber: string, id: string): {
|
|
8
|
+
value: string;
|
|
9
|
+
nonformat: string;
|
|
10
|
+
};
|
|
11
|
+
date(value: string, id?: string, outsideValue?: boolean): string;
|
|
12
|
+
code(value: string, id?: string, outsideValue?: boolean): string;
|
|
13
|
+
private dateISO;
|
|
14
|
+
private dateFixed;
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Translator {
|
|
2
|
+
static get translations(): {
|
|
3
|
+
LABEL_CARD_NUMBER: string;
|
|
4
|
+
LABEL_EXPIRATION_DATE: string;
|
|
5
|
+
LABEL_SECURITY_CODE: string;
|
|
6
|
+
PLACEHOLDER_EXPIRATION_DATE: string;
|
|
7
|
+
};
|
|
8
|
+
private translationLookup;
|
|
9
|
+
constructor(locale: string);
|
|
10
|
+
translate: (text: string) => string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Translator } from "../translator/Translator.service";
|
|
2
|
+
export declare class Utils {
|
|
3
|
+
static ifElementExists(id: string): HTMLInputElement;
|
|
4
|
+
static inArray<T>(array: ArrayLike<T>, item: T): boolean;
|
|
5
|
+
static getLastElementOfArray: (array: number[]) => number;
|
|
6
|
+
static setElementAttributes(attributes: Record<string, string>, element: HTMLInputElement): void;
|
|
7
|
+
static stripChars(string: string, regex?: RegExp): string;
|
|
8
|
+
static forEachBreak<TInputType, TReturnType>(iterable: ArrayLike<TInputType>, callback: (item: TInputType) => TReturnType): TReturnType | null;
|
|
9
|
+
protected translator: Translator;
|
|
10
|
+
constructor();
|
|
11
|
+
protected getElement: (id: string) => HTMLInputElement;
|
|
12
|
+
protected getContent: (value: string, placeholder: string) => string;
|
|
13
|
+
protected setContent: (id: string, text: string) => string;
|
|
14
|
+
protected setAttr: (id: string, attr: string, value: string) => void;
|
|
15
|
+
protected toLower: (content: string | null) => string;
|
|
16
|
+
protected clearContent: (id: string) => string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BrandDetailsType } from "@trustpayments/ts-iin-lookup/dist/types";
|
|
2
|
+
export declare class Validator {
|
|
3
|
+
protected static STANDARD_FORMAT_PATTERN: string;
|
|
4
|
+
private static backspaceKeyCode;
|
|
5
|
+
private static cardNumberDefaultLength;
|
|
6
|
+
private static deleteKeyCode;
|
|
7
|
+
private static matchChars;
|
|
8
|
+
private static matchDigits;
|
|
9
|
+
private static securityCodeDefaultLength;
|
|
10
|
+
private static errorClass;
|
|
11
|
+
private static cursorSingleSkip;
|
|
12
|
+
private static cursorDoubleSkip;
|
|
13
|
+
protected cardNumberValue: string;
|
|
14
|
+
protected expirationDateValue: string;
|
|
15
|
+
protected securityCodeValue: string;
|
|
16
|
+
private translator;
|
|
17
|
+
private currentKeyCode;
|
|
18
|
+
private selectionRangeEnd;
|
|
19
|
+
private selectionRangeStart;
|
|
20
|
+
private matchDigitsRegexp;
|
|
21
|
+
private cursorSkip;
|
|
22
|
+
constructor(locale: string);
|
|
23
|
+
setKeyDownProperties(element: HTMLInputElement, event: KeyboardEvent): void;
|
|
24
|
+
keepCursorAtSamePosition(element: HTMLInputElement): void;
|
|
25
|
+
luhnCheck(element: HTMLInputElement): void;
|
|
26
|
+
validate(element: HTMLInputElement, errorContainer: HTMLElement): void;
|
|
27
|
+
onPaste(event: ClipboardEvent): DataTransfer | string;
|
|
28
|
+
protected cardNumber(value: string): void;
|
|
29
|
+
protected expirationDate(value: string): void;
|
|
30
|
+
protected securityCode(value: string): void;
|
|
31
|
+
protected getCardDetails(cardNumber?: string): BrandDetailsType;
|
|
32
|
+
protected isPressedKeyBackspace(): boolean;
|
|
33
|
+
protected isPressedKeyDelete(): boolean;
|
|
34
|
+
protected limitLength(value: string, length: number): string;
|
|
35
|
+
protected removeNonDigits(value: string): string;
|
|
36
|
+
private setError;
|
|
37
|
+
private removeError;
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trustpayments/js-payments-card",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.936",
|
|
4
4
|
"description": "TypeScript Payment Card",
|
|
5
5
|
"author": "Trust Payments <support@trustpayments.com>",
|
|
6
6
|
"homepage": "https://docs.trustpayments.com",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"build": "npm run build:prod && npm run build:declarations",
|
|
50
50
|
"build:prod": "webpack --config webpack.prod.js",
|
|
51
51
|
"build:dev": "webpack --config webpack.dev.js",
|
|
52
|
-
"build:declarations": "
|
|
52
|
+
"build:declarations": "tsc --declaration --emitDeclarationOnly --outDir ./dist",
|
|
53
53
|
"start": "webpack serve --color --progress --config webpack.dev.js",
|
|
54
54
|
"example": "ws --rewrite '/* -> /dist/$1' --https",
|
|
55
55
|
"prod": "npm run build",
|
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
"promise-polyfill": "8.3.0",
|
|
125
125
|
"terser-webpack-plugin": "^5.3.14"
|
|
126
126
|
},
|
|
127
|
-
"gitHead": "
|
|
127
|
+
"gitHead": "894c123ecd8e50b37eb459b15ca49fd256f80309"
|
|
128
128
|
}
|