@trustpayments/js-payments-card 2.2.933 → 2.2.937

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.
@@ -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,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -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,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -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,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @jest-environment jsdom
3
+ */
4
+ export {};
@@ -0,0 +1,2 @@
1
+ import "promise-polyfill/src/polyfill";
2
+ import "ie-array-find-polyfill";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustpayments/js-payments-card",
3
- "version": "2.2.933",
3
+ "version": "2.2.937",
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": "npx dts-bundle-generator ./src/index.ts -o ./dist/index.d.ts --project tsconfig.json --no-banner",
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",
@@ -81,48 +81,48 @@
81
81
  "babel-loader": "10.0.0",
82
82
  "better-npm-audit": "^3.11.0",
83
83
  "clean-webpack-plugin": "^4.0.0",
84
- "copy-webpack-plugin": "13.0.0",
84
+ "copy-webpack-plugin": "13.0.1",
85
85
  "css-loader": "7.1.2",
86
86
  "dts-bundle-generator": "9.5.1",
87
87
  "eslint-config-prettier": "^10.1.8",
88
88
  "eslint-plugin-compat": "^6.0.2",
89
89
  "eslint-plugin-import": "2.32.0",
90
90
  "eslint-plugin-jest": "^29.0.0",
91
- "eslint-plugin-prettier": "5.5.3",
91
+ "eslint-plugin-prettier": "5.5.4",
92
92
  "eslint-plugin-unused-imports": "^4.1.4",
93
93
  "html-loader": "5.1.0",
94
- "html-webpack-plugin": "5.6.3",
94
+ "html-webpack-plugin": "5.6.5",
95
95
  "jest": "29.7.0",
96
96
  "jest-each": "29.7.0",
97
97
  "jest-environment-jsdom": "29.7.0",
98
98
  "jest-fetch-mock": "3.0.3",
99
- "mini-css-extract-plugin": "2.9.2",
99
+ "mini-css-extract-plugin": "2.9.4",
100
100
  "prettier": "3.6.2",
101
- "sass": "1.89.2",
102
- "sass-loader": "16.0.5",
101
+ "sass": "1.94.2",
102
+ "sass-loader": "16.0.6",
103
103
  "source-map-loader": "5.0.0",
104
104
  "style-loader": "4.0.0",
105
105
  "stylelint": "^16.22.0",
106
106
  "stylelint-scss": "6.12.1",
107
107
  "stylelint-webpack-plugin": "5.0.1",
108
108
  "ts-jest": "^29.4.0",
109
- "ts-loader": "9.5.2",
109
+ "ts-loader": "9.5.4",
110
110
  "typescript": "^5.8.3",
111
111
  "typescript-eslint": "^8.38.0",
112
112
  "url-loader": "4.1.1",
113
- "webpack": "5.100.2",
113
+ "webpack": "5.103.0",
114
114
  "webpack-cli": "^6.0.1",
115
115
  "webpack-dev-server": "5.2.2",
116
116
  "webpack-manifest-plugin": "5.0.1",
117
117
  "webpack-merge": "6.0.1"
118
118
  },
119
119
  "dependencies": {
120
- "@trustpayments/ts-iin-lookup": "2.0.416",
121
- "@trustpayments/ts-luhn-check": "2.0.416",
122
- "core-js": "3.44.0",
120
+ "@trustpayments/ts-iin-lookup": "2.0.505",
121
+ "@trustpayments/ts-luhn-check": "2.0.505",
122
+ "core-js": "3.47.0",
123
123
  "ie-array-find-polyfill": "1.1.0",
124
124
  "promise-polyfill": "8.3.0",
125
125
  "terser-webpack-plugin": "^5.3.14"
126
126
  },
127
- "gitHead": "8da7edca5db2e5490d0706074469d8f368f5501c"
127
+ "gitHead": "77202016d4697b26513ca1682502e62590910d48"
128
128
  }