@xsolla/payment-client-core 0.1.2 → 0.1.4
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/esm2020/lib/core/credit-card/credit-card-settings.interface.mjs +2 -0
- package/esm2020/lib/core/credit-card/credit-card-types.enum.mjs +20 -0
- package/esm2020/lib/core/credit-card/credit-card.interface.mjs +2 -0
- package/esm2020/lib/core/credit-card/credit-card.service.mjs +41 -0
- package/esm2020/lib/core/credit-card/credit-cards-map.const.mjs +36 -0
- package/esm2020/lib/core/credit-card/default-mask.const.mjs +2 -0
- package/esm2020/lib/core/credit-card/four-block-mask.const.mjs +2 -0
- package/esm2020/lib/core/credit-card/ordered-cards-settings.const.mjs +45 -0
- package/esm2020/lib/core/credit-card/types/american-express.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/aura.mjs +15 -0
- package/esm2020/lib/core/credit-card/types/china-union-pay.mjs +12 -0
- package/esm2020/lib/core/credit-card/types/dankort.mjs +15 -0
- package/esm2020/lib/core/credit-card/types/default-card.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/diners-clubs.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/discover.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/elo.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/hipercard.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/jcb.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/maestro.mjs +14 -0
- package/esm2020/lib/core/credit-card/types/mastercard.mjs +16 -0
- package/esm2020/lib/core/credit-card/types/mir.mjs +15 -0
- package/esm2020/lib/core/credit-card/types/naranja.mjs +15 -0
- package/esm2020/lib/core/credit-card/types/postepay.mjs +13 -0
- package/esm2020/lib/core/credit-card/types/visa.mjs +13 -0
- package/esm2020/lib/core/payment/actions/next-action.interface.mjs +1 -1
- package/esm2020/lib/core/payment/actions/next-actions.mjs +1 -3
- package/esm2020/lib/core/payment/actions/show-fields/show-fields.action.token.mjs +3 -2
- package/esm2020/lib/core/payment/credit-card-state/credit-card-state.interface.mjs +2 -0
- package/esm2020/lib/core/payment/credit-card-state/credit-card-state.service.mjs +14 -0
- package/esm2020/lib/core/payment/form/controls/card-number-control.config.mjs +10 -0
- package/esm2020/lib/core/payment/form/converters/card-number.converter.mjs +45 -0
- package/esm2020/lib/core/payment/form/converters/converter.abstract.mjs +8 -6
- package/esm2020/lib/core/payment/form/converters/converters-map.mjs +3 -1
- package/esm2020/lib/core/payment/form/converters/email.converter.mjs +3 -3
- package/esm2020/lib/core/payment/form/converters/zip.converter.mjs +4 -5
- package/esm2020/lib/core/payment/form/field-status.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/form-fields-status.interface.mjs +2 -0
- package/esm2020/lib/core/payment/form/form.module.mjs +8 -4
- package/esm2020/lib/core/payment/form/input-event.enum.mjs +6 -0
- package/esm2020/lib/core/payment/form/validators/async-validator-fn.type.mjs +2 -0
- package/esm2020/lib/core/payment/form/validators/convert.function.mjs +6 -14
- package/esm2020/lib/core/payment/form/validators/credit-card-min-length.validator.mjs +32 -0
- package/esm2020/lib/core/payment/form/validators/email-validator.mjs +3 -4
- package/esm2020/lib/core/payment/form/validators/is-empty-input-value.function.mjs +4 -0
- package/esm2020/lib/core/payment/form/validators/luhn-formula-validator/luhn-formula.validator.mjs +40 -0
- package/esm2020/lib/core/payment/form/validators/required-validator.mjs +3 -4
- package/esm2020/lib/core/payment/form/validators/validation-error.interface.mjs +1 -1
- package/esm2020/lib/core/payment/form/validators/validators.module.mjs +18 -0
- package/esm2020/lib/core/payment/payment.interface.mjs +1 -1
- package/esm2020/lib/core/payment/payment.service.mjs +57 -46
- package/esm2020/lib/core/payment/sync/field-async-validation.interface.mjs +2 -0
- package/esm2020/lib/core/payment/sync/sync-response.class.mjs +7 -4
- package/esm2020/lib/core/payment/sync/sync.service.mjs +14 -11
- package/esm2020/lib/core/payment/xps-response.interface.mjs +1 -1
- package/esm2020/lib/core/type-guards/is-string.function.mjs +4 -0
- package/esm2020/lib/core-library.service.mjs +20 -7
- package/fesm2015/xsolla-payment-client-core.mjs +559 -120
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +558 -119
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core/credit-card/credit-card-settings.interface.d.ts +10 -0
- package/lib/core/credit-card/credit-card-types.enum.d.ts +18 -0
- package/lib/core/credit-card/credit-card.interface.d.ts +9 -0
- package/lib/core/credit-card/credit-card.service.d.ts +11 -0
- package/lib/core/credit-card/credit-cards-map.const.d.ts +5 -0
- package/lib/core/credit-card/default-mask.const.d.ts +1 -0
- package/lib/core/credit-card/four-block-mask.const.d.ts +1 -0
- package/lib/core/credit-card/ordered-cards-settings.const.d.ts +12 -0
- package/lib/core/credit-card/types/american-express.d.ts +2 -0
- package/lib/core/credit-card/types/aura.d.ts +2 -0
- package/lib/core/credit-card/types/china-union-pay.d.ts +2 -0
- package/lib/core/credit-card/types/dankort.d.ts +2 -0
- package/lib/core/credit-card/types/default-card.d.ts +2 -0
- package/lib/core/credit-card/types/diners-clubs.d.ts +2 -0
- package/lib/core/credit-card/types/discover.d.ts +2 -0
- package/lib/core/credit-card/types/elo.d.ts +2 -0
- package/lib/core/credit-card/types/hipercard.d.ts +2 -0
- package/lib/core/credit-card/types/jcb.d.ts +2 -0
- package/lib/core/credit-card/types/maestro.d.ts +2 -0
- package/lib/core/credit-card/types/mastercard.d.ts +2 -0
- package/lib/core/credit-card/types/mir.d.ts +2 -0
- package/lib/core/credit-card/types/naranja.d.ts +2 -0
- package/lib/core/credit-card/types/postepay.d.ts +2 -0
- package/lib/core/credit-card/types/visa.d.ts +2 -0
- package/lib/core/payment/actions/next-action.interface.d.ts +1 -2
- package/lib/core/payment/credit-card-state/credit-card-state.interface.d.ts +3 -0
- package/lib/core/payment/credit-card-state/credit-card-state.service.d.ts +7 -0
- package/lib/core/payment/form/controls/card-number-control.config.d.ts +11 -0
- package/lib/core/payment/form/converters/card-number.converter.d.ts +19 -0
- package/lib/core/payment/form/converters/converter.abstract.d.ts +4 -1
- package/lib/core/payment/form/converters/email.converter.d.ts +1 -1
- package/lib/core/payment/form/field-status.interface.d.ts +7 -0
- package/lib/core/payment/form/form-fields-status.interface.d.ts +4 -0
- package/lib/core/payment/form/form.module.d.ts +2 -1
- package/lib/core/payment/form/validators/async-validator-fn.type.d.ts +4 -0
- package/lib/core/payment/form/validators/convert.function.d.ts +1 -1
- package/lib/core/payment/form/validators/credit-card-min-length.validator.d.ts +12 -0
- package/lib/core/payment/form/validators/email-validator.d.ts +1 -1
- package/lib/core/payment/form/validators/is-empty-input-value.function.d.ts +1 -0
- package/lib/core/payment/form/validators/luhn-formula-validator/luhn-formula.validator.d.ts +6 -0
- package/lib/core/payment/form/validators/required-validator.d.ts +1 -1
- package/lib/core/payment/form/validators/validation-error.interface.d.ts +0 -1
- package/lib/core/payment/form/validators/validators.module.d.ts +7 -0
- package/lib/core/payment/payment.interface.d.ts +3 -1
- package/lib/core/payment/payment.service.d.ts +12 -4
- package/lib/core/payment/sync/field-async-validation.interface.d.ts +7 -0
- package/lib/core/payment/sync/sync-response.class.d.ts +2 -4
- package/lib/core/payment/sync/sync.service.d.ts +4 -0
- package/lib/core/payment/xps-response.interface.d.ts +1 -0
- package/lib/core/type-guards/is-string.function.d.ts +1 -0
- package/lib/core-library.service.d.ts +10 -1
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.1.4.tgz +0 -0
- package/esm2020/lib/core/payment/actions/show-field-state/show-field-state.action.class.mjs +0 -12
- package/esm2020/lib/core/payment/actions/show-field-state/show-field-state.action.token.mjs +0 -13
- package/esm2020/lib/core/payment/actions/show-field-state/show-field-state.action.type.mjs +0 -2
- package/esm2020/lib/core/payment/form/input-events.enum.mjs +0 -6
- package/esm2020/lib/core/payment/form/validators/errors-codes.enum.mjs +0 -8
- package/esm2020/lib/core/payment/show-field-state.interface.mjs +0 -2
- package/lib/core/payment/actions/show-field-state/show-field-state.action.class.d.ts +0 -8
- package/lib/core/payment/actions/show-field-state/show-field-state.action.token.d.ts +0 -4
- package/lib/core/payment/actions/show-field-state/show-field-state.action.type.d.ts +0 -11
- package/lib/core/payment/form/validators/errors-codes.enum.d.ts +0 -6
- package/lib/core/payment/show-field-state.interface.d.ts +0 -8
- package/xsolla-payment-client-core-0.1.2.tgz +0 -0
- /package/lib/core/payment/form/{input-events.enum.d.ts → input-event.enum.d.ts} +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { InjectionToken, Injectable, Inject, isDevMode, NgModule } from '@angular/core';
|
|
4
|
-
import { firstValueFrom, lastValueFrom, map, Subject, tap, BehaviorSubject, filter as filter$1, takeUntil, skip,
|
|
4
|
+
import { firstValueFrom, lastValueFrom, map, Subject, tap, BehaviorSubject, filter as filter$1, takeUntil, skip, throwError } from 'rxjs';
|
|
5
5
|
import * as i1 from '@angular/common/http';
|
|
6
6
|
import { HttpParams, HttpHeaders, HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
7
7
|
import { UntypedFormGroup, Validators, UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
|
8
8
|
import { filter, map as map$1, catchError } from 'rxjs/operators';
|
|
9
9
|
import * as i1$1 from '@angular/router';
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
10
11
|
|
|
11
12
|
const masksFunctionsMap = {
|
|
12
13
|
zip: () => {
|
|
@@ -598,18 +599,6 @@ const isSubmitResponse = (value) => {
|
|
|
598
599
|
return value instanceof SubmitResponse;
|
|
599
600
|
};
|
|
600
601
|
|
|
601
|
-
class ShowFieldStateAction {
|
|
602
|
-
constructor(control) {
|
|
603
|
-
this.type = 'show_field_state';
|
|
604
|
-
this.data = {
|
|
605
|
-
fieldName: control.fieldName,
|
|
606
|
-
fieldState: control.fieldState,
|
|
607
|
-
error: control.error,
|
|
608
|
-
isFocused: control.isFocused,
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
}
|
|
612
|
-
|
|
613
602
|
var InputEventName;
|
|
614
603
|
(function (InputEventName) {
|
|
615
604
|
InputEventName["blur"] = "blur";
|
|
@@ -697,7 +686,8 @@ const showFieldsActionFactoryProvider = {
|
|
|
697
686
|
useValue: {
|
|
698
687
|
factory: (...args) => new ShowFieldsAction(...args),
|
|
699
688
|
isSuitable: (response) => {
|
|
700
|
-
return response.currentCommand === XpsCommand.check
|
|
689
|
+
return (response.currentCommand === XpsCommand.check ||
|
|
690
|
+
response.currentCommand === XpsCommand.form);
|
|
701
691
|
},
|
|
702
692
|
},
|
|
703
693
|
};
|
|
@@ -797,17 +787,6 @@ const showErrorsActionFactoryProvider = {
|
|
|
797
787
|
},
|
|
798
788
|
};
|
|
799
789
|
|
|
800
|
-
const showFieldStateActionFactoryToken = new InjectionToken('ShowFieldStateAction');
|
|
801
|
-
const showFieldStateActionFactoryProvider = {
|
|
802
|
-
provide: showFieldStateActionFactoryToken,
|
|
803
|
-
useValue: {
|
|
804
|
-
factory: (...args) => new ShowFieldStateAction(...args),
|
|
805
|
-
isSuitable: () => {
|
|
806
|
-
return true;
|
|
807
|
-
},
|
|
808
|
-
},
|
|
809
|
-
};
|
|
810
|
-
|
|
811
790
|
const nextActionsToken = new InjectionToken('Action');
|
|
812
791
|
const nextActions = [
|
|
813
792
|
showFieldsActionFactoryProvider,
|
|
@@ -817,7 +796,6 @@ const nextActions = [
|
|
|
817
796
|
const flowUpdateNextActions = [
|
|
818
797
|
statusUpdatedActionFactoryProvider,
|
|
819
798
|
showErrorsActionFactoryProvider,
|
|
820
|
-
showFieldStateActionFactoryProvider,
|
|
821
799
|
];
|
|
822
800
|
|
|
823
801
|
class NextActionService {
|
|
@@ -1273,11 +1251,14 @@ const syncRequestFactoryProvider = {
|
|
|
1273
1251
|
class SyncResponse {
|
|
1274
1252
|
constructor(changedField, response) {
|
|
1275
1253
|
var _a;
|
|
1254
|
+
this.error = null;
|
|
1276
1255
|
const fieldError = (_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a.find((error) => error.element_name === changedField.name);
|
|
1277
1256
|
if (fieldError) {
|
|
1278
|
-
this.
|
|
1279
|
-
|
|
1280
|
-
|
|
1257
|
+
this.error = {
|
|
1258
|
+
asyncError: {
|
|
1259
|
+
code: fieldError.code,
|
|
1260
|
+
message: fieldError.message,
|
|
1261
|
+
},
|
|
1281
1262
|
};
|
|
1282
1263
|
}
|
|
1283
1264
|
this.fields = Object.keys(response.form).map((key) => response.form[key]);
|
|
@@ -1303,6 +1284,10 @@ class SyncService extends EmitDataService {
|
|
|
1303
1284
|
this.prevFieldSyncStates = {};
|
|
1304
1285
|
this.form = new UntypedFormGroup({});
|
|
1305
1286
|
this.fields = [];
|
|
1287
|
+
this.fieldAsyncValidation = new Subject();
|
|
1288
|
+
}
|
|
1289
|
+
get fieldAsyncValidation$() {
|
|
1290
|
+
return this.fieldAsyncValidation.asObservable();
|
|
1306
1291
|
}
|
|
1307
1292
|
setup(form, fields) {
|
|
1308
1293
|
this.reset();
|
|
@@ -1329,27 +1314,26 @@ class SyncService extends EmitDataService {
|
|
|
1329
1314
|
if (prevFieldState && value === prevFieldState.value) {
|
|
1330
1315
|
return Promise.resolve(prevFieldState.result).then((response) => {
|
|
1331
1316
|
var _a;
|
|
1332
|
-
return (_a = response === null || response === void 0 ? void 0 : response.
|
|
1317
|
+
return (_a = response === null || response === void 0 ? void 0 : response.error) !== null && _a !== void 0 ? _a : null;
|
|
1333
1318
|
});
|
|
1334
1319
|
}
|
|
1335
1320
|
const requestPromise = this.request(field);
|
|
1336
1321
|
this.setPrevFieldSyncState(field, value, requestPromise);
|
|
1337
1322
|
return requestPromise.then((response) => {
|
|
1338
1323
|
var _a;
|
|
1339
|
-
|
|
1324
|
+
this.fieldAsyncValidation.next({
|
|
1325
|
+
value,
|
|
1326
|
+
field,
|
|
1327
|
+
response,
|
|
1328
|
+
});
|
|
1329
|
+
return (_a = response.error) !== null && _a !== void 0 ? _a : null;
|
|
1340
1330
|
});
|
|
1341
1331
|
});
|
|
1342
1332
|
}
|
|
1343
1333
|
getSyncValidationErrors(field) {
|
|
1344
1334
|
var _a;
|
|
1345
1335
|
const control = this.form.get(field.name);
|
|
1346
|
-
|
|
1347
|
-
return null;
|
|
1348
|
-
}
|
|
1349
|
-
const rewritableError = (_a = control.errors) === null || _a === void 0 ? void 0 : _a.rewritableError;
|
|
1350
|
-
return rewritableError
|
|
1351
|
-
? { message: rewritableError.message, code: rewritableError.code }
|
|
1352
|
-
: null;
|
|
1336
|
+
return (_a = control === null || control === void 0 ? void 0 : control.errors) !== null && _a !== void 0 ? _a : null;
|
|
1353
1337
|
}
|
|
1354
1338
|
request(field) {
|
|
1355
1339
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1415,44 +1399,28 @@ class TextControlConfig extends ControlConfig {
|
|
|
1415
1399
|
}
|
|
1416
1400
|
}
|
|
1417
1401
|
|
|
1418
|
-
function convert(validator, message
|
|
1402
|
+
function convert(validator, message) {
|
|
1419
1403
|
return (control) => {
|
|
1420
1404
|
const errors = validator(control);
|
|
1421
1405
|
if (!errors) {
|
|
1422
1406
|
return errors;
|
|
1423
1407
|
}
|
|
1424
1408
|
const firstErrorKey = Object.keys(errors)[0];
|
|
1425
|
-
|
|
1426
|
-
error = typeof
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
rewritableError.code = errorCode;
|
|
1430
|
-
if (error[firstErrorKey] != null) {
|
|
1431
|
-
rewritableError.value = error[firstErrorKey];
|
|
1432
|
-
}
|
|
1433
|
-
if (rewritableError.requiredLength) {
|
|
1434
|
-
rewritableError.number = rewritableError.requiredLength;
|
|
1435
|
-
}
|
|
1436
|
-
errors.rewritableError = rewritableError;
|
|
1409
|
+
const firstError = errors[firstErrorKey];
|
|
1410
|
+
const error = typeof firstError === 'object' && firstError !== null ? firstError : {};
|
|
1411
|
+
error.message = message;
|
|
1412
|
+
errors[firstErrorKey] = error;
|
|
1437
1413
|
return errors;
|
|
1438
1414
|
};
|
|
1439
1415
|
}
|
|
1440
1416
|
|
|
1441
|
-
var ErrorsCodes;
|
|
1442
|
-
(function (ErrorsCodes) {
|
|
1443
|
-
ErrorsCodes["minLength"] = "min-length";
|
|
1444
|
-
ErrorsCodes["maxLength"] = "max-length";
|
|
1445
|
-
ErrorsCodes["invalidValue"] = "invalid-value";
|
|
1446
|
-
ErrorsCodes["required"] = "required";
|
|
1447
|
-
})(ErrorsCodes || (ErrorsCodes = {}));
|
|
1448
|
-
|
|
1449
1417
|
const emailRegexp = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i; // eslint-disable-line
|
|
1450
|
-
function
|
|
1451
|
-
return convert(Validators.pattern(emailRegexp), 'Enter a valid email'
|
|
1418
|
+
function convertedEmailValidator() {
|
|
1419
|
+
return convert(Validators.pattern(emailRegexp), 'Enter a valid email');
|
|
1452
1420
|
}
|
|
1453
1421
|
|
|
1454
|
-
function
|
|
1455
|
-
return convert(Validators.required, 'Required'
|
|
1422
|
+
function convertedRequiredValidator() {
|
|
1423
|
+
return convert(Validators.required, 'Required');
|
|
1456
1424
|
}
|
|
1457
1425
|
|
|
1458
1426
|
class Converter {
|
|
@@ -1467,12 +1435,12 @@ class Converter {
|
|
|
1467
1435
|
return config;
|
|
1468
1436
|
}
|
|
1469
1437
|
convertToFormControl(field) {
|
|
1470
|
-
return new UntypedFormControl(this.getValue(field), this.getValidators(field));
|
|
1438
|
+
return new UntypedFormControl(this.getValue(field), this.getValidators(field), this.getAsyncValidators(field));
|
|
1471
1439
|
}
|
|
1472
1440
|
getValidators(field) {
|
|
1473
1441
|
const validators = [];
|
|
1474
1442
|
if (field.isMandatory === "1" /* XpsBoolean.true */) {
|
|
1475
|
-
validators.push(
|
|
1443
|
+
validators.push(convertedRequiredValidator());
|
|
1476
1444
|
}
|
|
1477
1445
|
if (field.regex) {
|
|
1478
1446
|
const match = /^\/(.*)\/([gim]*)$/.exec(field.regex);
|
|
@@ -1481,11 +1449,14 @@ class Converter {
|
|
|
1481
1449
|
const errorMessage = field.validation_error_msg
|
|
1482
1450
|
? field.validation_error_msg
|
|
1483
1451
|
: 'Enter valid data';
|
|
1484
|
-
validators.push(convert(Validators.pattern(pattern), errorMessage
|
|
1452
|
+
validators.push(convert(Validators.pattern(pattern), errorMessage));
|
|
1485
1453
|
}
|
|
1486
1454
|
}
|
|
1487
1455
|
return validators;
|
|
1488
1456
|
}
|
|
1457
|
+
getAsyncValidators(field) {
|
|
1458
|
+
return () => __awaiter(this, void 0, void 0, function* () { return this.syncService.validate(field); });
|
|
1459
|
+
}
|
|
1489
1460
|
createDefaultControlConfig(controlConfigClass, field) {
|
|
1490
1461
|
const config = new controlConfigClass();
|
|
1491
1462
|
this.copyCommonOptions(config, field);
|
|
@@ -1529,7 +1500,7 @@ class EmailConverter extends Converter {
|
|
|
1529
1500
|
super(syncService);
|
|
1530
1501
|
}
|
|
1531
1502
|
getValidators(field) {
|
|
1532
|
-
return super.getValidators(field).concat([
|
|
1503
|
+
return super.getValidators(field).concat([convertedEmailValidator()]);
|
|
1533
1504
|
}
|
|
1534
1505
|
createControlConfig(field) {
|
|
1535
1506
|
const config = this.createDefaultControlConfig(TextControlConfig, field);
|
|
@@ -1570,11 +1541,11 @@ class ZipConverter extends Converter {
|
|
|
1570
1541
|
const validators = super
|
|
1571
1542
|
.getValidators(field)
|
|
1572
1543
|
.concat([
|
|
1573
|
-
convert(Validators.minLength(minLength), `Enter at least ${minLength} characters
|
|
1574
|
-
convert(Validators.maxLength(maxLength), `Enter no more than ${maxLength} characters
|
|
1544
|
+
convert(Validators.minLength(minLength), `Enter at least ${minLength} characters`),
|
|
1545
|
+
convert(Validators.maxLength(maxLength), `Enter no more than ${maxLength} characters`),
|
|
1575
1546
|
]);
|
|
1576
1547
|
if (this.isUsCountry) {
|
|
1577
|
-
validators.push(convert(restrictedValueValidator('00000'), 'Enter a valid ZIP code'
|
|
1548
|
+
validators.push(convert(restrictedValueValidator('00000'), 'Enter a valid ZIP code'));
|
|
1578
1549
|
}
|
|
1579
1550
|
return validators;
|
|
1580
1551
|
}
|
|
@@ -1610,10 +1581,431 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
1610
1581
|
type: Injectable
|
|
1611
1582
|
}], ctorParameters: function () { return [{ type: SyncService }, { type: CountryService }]; } });
|
|
1612
1583
|
|
|
1584
|
+
function isEmptyInputValue(value) {
|
|
1585
|
+
return value == null || value.length === 0;
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
function isString(value) {
|
|
1589
|
+
return typeof value === 'string';
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
/**
|
|
1593
|
+
* Checks number match Luhn algorithm.
|
|
1594
|
+
* Based on http://en.wikipedia.org/wiki/Luhn.
|
|
1595
|
+
*/
|
|
1596
|
+
const luhnFormulaValidator = ({ value }) => {
|
|
1597
|
+
if (isEmptyInputValue(value) || !isString(value)) {
|
|
1598
|
+
return null;
|
|
1599
|
+
}
|
|
1600
|
+
const error = {
|
|
1601
|
+
rewritableError: {
|
|
1602
|
+
message: `Enter a valid card number`,
|
|
1603
|
+
},
|
|
1604
|
+
};
|
|
1605
|
+
if (/[^0-9 -]+/.test(value)) {
|
|
1606
|
+
// accept only spaces, digits and dashes
|
|
1607
|
+
return error;
|
|
1608
|
+
}
|
|
1609
|
+
let resultSum = 0;
|
|
1610
|
+
let digit = 0;
|
|
1611
|
+
let isEven = false;
|
|
1612
|
+
const modBase = 10;
|
|
1613
|
+
const digitRadix = 10;
|
|
1614
|
+
const maxNumber = 9;
|
|
1615
|
+
const digits = value.replace(/\D/g, '');
|
|
1616
|
+
// Checks if number match Luhn algorithm
|
|
1617
|
+
// based on http://en.wikipedia.org/wiki/Luhn
|
|
1618
|
+
for (let index = digits.length - 1; index >= 0; index--) {
|
|
1619
|
+
const char = digits.charAt(index);
|
|
1620
|
+
digit = parseInt(char, digitRadix);
|
|
1621
|
+
if (isEven && (digit *= 2) > maxNumber) {
|
|
1622
|
+
digit -= maxNumber;
|
|
1623
|
+
}
|
|
1624
|
+
resultSum += digit;
|
|
1625
|
+
isEven = !isEven;
|
|
1626
|
+
}
|
|
1627
|
+
return resultSum % modBase === 0 ? null : error;
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
class CardNumberConfig extends ControlConfig {
|
|
1631
|
+
constructor() {
|
|
1632
|
+
super(...arguments);
|
|
1633
|
+
this.controlType = 'card-number';
|
|
1634
|
+
this.availableCardTypes = [];
|
|
1635
|
+
this.customError = '';
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
const fourBlockMask = '9999 9999 9999 9999';
|
|
1640
|
+
|
|
1641
|
+
var CreditCardTypes;
|
|
1642
|
+
(function (CreditCardTypes) {
|
|
1643
|
+
CreditCardTypes["DEFAULT"] = "0";
|
|
1644
|
+
CreditCardTypes["VISA"] = "1";
|
|
1645
|
+
CreditCardTypes["MASTERCARD"] = "2";
|
|
1646
|
+
CreditCardTypes["MAESTRO"] = "3";
|
|
1647
|
+
CreditCardTypes["AMERICAN_EXPRESS"] = "4";
|
|
1648
|
+
CreditCardTypes["DINERS_CLUBS"] = "5";
|
|
1649
|
+
CreditCardTypes["DISCOVER"] = "6";
|
|
1650
|
+
CreditCardTypes["JCB"] = "9";
|
|
1651
|
+
CreditCardTypes["DANKORT"] = "11";
|
|
1652
|
+
CreditCardTypes["HIPERCARD"] = "12";
|
|
1653
|
+
CreditCardTypes["ELO"] = "13";
|
|
1654
|
+
CreditCardTypes["AURA"] = "14";
|
|
1655
|
+
CreditCardTypes["NARANJA"] = "15";
|
|
1656
|
+
CreditCardTypes["MIR"] = "16";
|
|
1657
|
+
CreditCardTypes["CHINA_UNION_PAY"] = "17";
|
|
1658
|
+
CreditCardTypes["POSTEPAY"] = "18";
|
|
1659
|
+
})(CreditCardTypes || (CreditCardTypes = {}));
|
|
1660
|
+
|
|
1661
|
+
const visa = {
|
|
1662
|
+
id: CreditCardTypes.VISA,
|
|
1663
|
+
minLength: 13,
|
|
1664
|
+
maxLength: 16,
|
|
1665
|
+
iconName: 'visa',
|
|
1666
|
+
mask: fourBlockMask,
|
|
1667
|
+
checkNumber(number) {
|
|
1668
|
+
return number.startsWith('4');
|
|
1669
|
+
},
|
|
1670
|
+
};
|
|
1671
|
+
|
|
1672
|
+
const mastercard = {
|
|
1673
|
+
id: CreditCardTypes.MASTERCARD,
|
|
1674
|
+
minLength: 16,
|
|
1675
|
+
maxLength: 16,
|
|
1676
|
+
iconName: 'mastercard',
|
|
1677
|
+
mask: fourBlockMask,
|
|
1678
|
+
checkNumber(number) {
|
|
1679
|
+
const subLength = 6;
|
|
1680
|
+
const cardNumberSub = number.substring(0, subLength);
|
|
1681
|
+
return (new RegExp(/^5[1-5]/).test(number) ||
|
|
1682
|
+
(cardNumberSub >= '222100' && cardNumberSub <= '272099'));
|
|
1683
|
+
},
|
|
1684
|
+
};
|
|
1685
|
+
|
|
1686
|
+
const defaultMask = '9999 9999 9999 9999 999';
|
|
1687
|
+
|
|
1688
|
+
const maestro = {
|
|
1689
|
+
id: CreditCardTypes.MAESTRO,
|
|
1690
|
+
minLength: 12,
|
|
1691
|
+
maxLength: 19,
|
|
1692
|
+
iconName: 'maestro',
|
|
1693
|
+
mask: defaultMask,
|
|
1694
|
+
checkNumber(number) {
|
|
1695
|
+
return new RegExp(/^(5018)|^(5020)|^(5038)|^(5893)|^(6304)|^(6759)|^(6761)|^(6762)|^(6763)|^(0604)|^(6706)|^(6771)|^(6709)/).test(number);
|
|
1696
|
+
},
|
|
1697
|
+
maxCvvLength: 3,
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
const americanExpress = {
|
|
1701
|
+
id: CreditCardTypes.AMERICAN_EXPRESS,
|
|
1702
|
+
minLength: 15,
|
|
1703
|
+
maxLength: 15,
|
|
1704
|
+
iconName: 'american-express',
|
|
1705
|
+
mask: '9999 999999 99999',
|
|
1706
|
+
checkNumber(number) {
|
|
1707
|
+
return new RegExp(/^(34)|^(37)/).test(number);
|
|
1708
|
+
},
|
|
1709
|
+
maxCvvLength: 4,
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
const dinersClubs = {
|
|
1713
|
+
id: CreditCardTypes.DINERS_CLUBS,
|
|
1714
|
+
minLength: 14,
|
|
1715
|
+
maxLength: 14,
|
|
1716
|
+
iconName: 'dinersclub',
|
|
1717
|
+
mask: '9999 9999 9999 99',
|
|
1718
|
+
checkNumber(number) {
|
|
1719
|
+
const regex = /^(36[0-9]|3(?:0[0-59]|[68][0-9])[0-9])/;
|
|
1720
|
+
return regex.test(number);
|
|
1721
|
+
},
|
|
1722
|
+
};
|
|
1723
|
+
|
|
1724
|
+
const discover = {
|
|
1725
|
+
id: CreditCardTypes.DISCOVER,
|
|
1726
|
+
minLength: 16,
|
|
1727
|
+
maxLength: 19,
|
|
1728
|
+
iconName: 'discover',
|
|
1729
|
+
mask: defaultMask,
|
|
1730
|
+
checkNumber(number) {
|
|
1731
|
+
return new RegExp(/^(6011)|^(622(1(2[6-9]|[3-9][0-9])|[2-8][0-9]{2}|9([01][0-9]|2[0-5])))|^(64[4-9])|^65/).test(number);
|
|
1732
|
+
},
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
const jcb = {
|
|
1736
|
+
id: CreditCardTypes.JCB,
|
|
1737
|
+
minLength: 15,
|
|
1738
|
+
maxLength: 16,
|
|
1739
|
+
iconName: 'jcb',
|
|
1740
|
+
mask: fourBlockMask,
|
|
1741
|
+
checkNumber(number) {
|
|
1742
|
+
return new RegExp(/^35(2[89]|[3-8][0-9])/).test(number);
|
|
1743
|
+
},
|
|
1744
|
+
};
|
|
1745
|
+
|
|
1746
|
+
const dankort = {
|
|
1747
|
+
id: CreditCardTypes.DANKORT,
|
|
1748
|
+
minLength: 16,
|
|
1749
|
+
maxLength: 16,
|
|
1750
|
+
iconName: 'dankort',
|
|
1751
|
+
mask: fourBlockMask,
|
|
1752
|
+
checkNumber(number) {
|
|
1753
|
+
const subLength = 4;
|
|
1754
|
+
const cardNumberSub = number.substring(0, subLength);
|
|
1755
|
+
return cardNumberSub === '5019';
|
|
1756
|
+
},
|
|
1757
|
+
};
|
|
1758
|
+
|
|
1759
|
+
const hipercard = {
|
|
1760
|
+
id: CreditCardTypes.HIPERCARD,
|
|
1761
|
+
minLength: 13,
|
|
1762
|
+
maxLength: 19,
|
|
1763
|
+
iconName: 'hipercard',
|
|
1764
|
+
mask: defaultMask,
|
|
1765
|
+
checkNumber(number) {
|
|
1766
|
+
return new RegExp(/^((606282|637095|637568)[0-9]|38[0-9]{14,17})/).test(number);
|
|
1767
|
+
},
|
|
1768
|
+
};
|
|
1769
|
+
|
|
1770
|
+
const elo = {
|
|
1771
|
+
id: CreditCardTypes.ELO,
|
|
1772
|
+
minLength: 16,
|
|
1773
|
+
maxLength: 19,
|
|
1774
|
+
iconName: 'elo',
|
|
1775
|
+
mask: defaultMask,
|
|
1776
|
+
checkNumber(number) {
|
|
1777
|
+
return new RegExp(/^(40117[8-9]|431274|438935|451416|457393|45763[1-2]|506(699|7[0-6][0-9]|77[0-8])|509\d{3}|504175|627780|636297|636368|65003[1-3]|6500(3[5-9]|4[0-9]|5[0-1])|6504(0[5-9]|[1-3][0-9])|650(4[8-9][0-9]|5[0-2][0-9]|53[0-8])|6505(4[1-9]|[5-8][0-9]|9[0-8])|6507(0[0-9]|1[0-8])|65072[0-7]|6509(0[1-9]|1[0-9]|20)|6516(5[2-9]|[6-7][0-9])|6550([0-1][0-9]|2[1-9]|[3-4][0-9]|5[0-8]))/).test(number);
|
|
1778
|
+
},
|
|
1779
|
+
};
|
|
1780
|
+
|
|
1781
|
+
const aura = {
|
|
1782
|
+
id: CreditCardTypes.AURA,
|
|
1783
|
+
minLength: 16,
|
|
1784
|
+
maxLength: 19,
|
|
1785
|
+
iconName: 'aura',
|
|
1786
|
+
mask: defaultMask,
|
|
1787
|
+
checkNumber(number) {
|
|
1788
|
+
const subLength = 8;
|
|
1789
|
+
const cardNumberSub = number.substring(0, subLength);
|
|
1790
|
+
return ['50786000', '50786018', '50786019'].includes(cardNumberSub);
|
|
1791
|
+
},
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1794
|
+
const naranja = {
|
|
1795
|
+
id: CreditCardTypes.NARANJA,
|
|
1796
|
+
minLength: 12,
|
|
1797
|
+
maxLength: 19,
|
|
1798
|
+
iconName: 'naranja',
|
|
1799
|
+
mask: defaultMask,
|
|
1800
|
+
checkNumber(number) {
|
|
1801
|
+
const subLength = 6;
|
|
1802
|
+
const cardNumberSub = number.substring(0, subLength);
|
|
1803
|
+
return cardNumberSub === '589562';
|
|
1804
|
+
},
|
|
1805
|
+
};
|
|
1806
|
+
|
|
1807
|
+
const mir = {
|
|
1808
|
+
id: CreditCardTypes.MIR,
|
|
1809
|
+
minLength: 16,
|
|
1810
|
+
maxLength: 16,
|
|
1811
|
+
iconName: 'mir',
|
|
1812
|
+
mask: defaultMask,
|
|
1813
|
+
checkNumber(number) {
|
|
1814
|
+
const subLength = 4;
|
|
1815
|
+
const cardNumberSub = number.substring(0, subLength);
|
|
1816
|
+
return cardNumberSub >= '2200' && cardNumberSub <= '2204';
|
|
1817
|
+
},
|
|
1818
|
+
};
|
|
1819
|
+
|
|
1820
|
+
const chinaUnionPay = {
|
|
1821
|
+
id: CreditCardTypes.CHINA_UNION_PAY,
|
|
1822
|
+
minLength: 16,
|
|
1823
|
+
maxLength: 19,
|
|
1824
|
+
iconName: 'unionpay',
|
|
1825
|
+
mask: '999 9999 9999 99999999',
|
|
1826
|
+
checkNumber(number) {
|
|
1827
|
+
return number.startsWith('62');
|
|
1828
|
+
},
|
|
1829
|
+
};
|
|
1830
|
+
|
|
1831
|
+
const defaultCard = {
|
|
1832
|
+
id: CreditCardTypes.DEFAULT,
|
|
1833
|
+
minLength: 12,
|
|
1834
|
+
maxLength: 19,
|
|
1835
|
+
iconName: null,
|
|
1836
|
+
mask: defaultMask,
|
|
1837
|
+
checkNumber() {
|
|
1838
|
+
return false;
|
|
1839
|
+
},
|
|
1840
|
+
};
|
|
1841
|
+
|
|
1842
|
+
const postePay = {
|
|
1843
|
+
id: CreditCardTypes.POSTEPAY,
|
|
1844
|
+
minLength: 12,
|
|
1845
|
+
maxLength: 19,
|
|
1846
|
+
iconName: 'poste_pay',
|
|
1847
|
+
mask: '9999 9999 9999 9999 999',
|
|
1848
|
+
checkNumber(number) {
|
|
1849
|
+
const regex = /^(5018)|^(5020)|^(5038)|^(5893)|^(6304)|^(6759)|^(6761)|^(6762)|^(6763)|^(0604)|^(6706)|^(6771)|^(6709)/;
|
|
1850
|
+
return regex.test(number);
|
|
1851
|
+
},
|
|
1852
|
+
};
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* order does matter
|
|
1856
|
+
* settings with more specific pattern should be placed above
|
|
1857
|
+
* Example:
|
|
1858
|
+
* - 12*
|
|
1859
|
+
* - 12
|
|
1860
|
+
* - 1
|
|
1861
|
+
* "12*" pattern should be checked first, otherwise pattern "1" will be taken
|
|
1862
|
+
* before "12*" checked
|
|
1863
|
+
*/
|
|
1864
|
+
const orderedCardSettings = [
|
|
1865
|
+
aura,
|
|
1866
|
+
naranja,
|
|
1867
|
+
maestro,
|
|
1868
|
+
postePay,
|
|
1869
|
+
elo,
|
|
1870
|
+
discover,
|
|
1871
|
+
dankort,
|
|
1872
|
+
hipercard,
|
|
1873
|
+
mir,
|
|
1874
|
+
jcb,
|
|
1875
|
+
dinersClubs,
|
|
1876
|
+
americanExpress,
|
|
1877
|
+
mastercard,
|
|
1878
|
+
chinaUnionPay,
|
|
1879
|
+
visa,
|
|
1880
|
+
defaultCard,
|
|
1881
|
+
];
|
|
1882
|
+
|
|
1883
|
+
const creditCardsMap = {
|
|
1884
|
+
[CreditCardTypes.DEFAULT]: defaultCard,
|
|
1885
|
+
[CreditCardTypes.VISA]: visa,
|
|
1886
|
+
[CreditCardTypes.MASTERCARD]: mastercard,
|
|
1887
|
+
[CreditCardTypes.MAESTRO]: maestro,
|
|
1888
|
+
[CreditCardTypes.AMERICAN_EXPRESS]: americanExpress,
|
|
1889
|
+
[CreditCardTypes.DINERS_CLUBS]: dinersClubs,
|
|
1890
|
+
[CreditCardTypes.DISCOVER]: discover,
|
|
1891
|
+
[CreditCardTypes.JCB]: jcb,
|
|
1892
|
+
[CreditCardTypes.DANKORT]: dankort,
|
|
1893
|
+
[CreditCardTypes.HIPERCARD]: hipercard,
|
|
1894
|
+
[CreditCardTypes.ELO]: elo,
|
|
1895
|
+
[CreditCardTypes.AURA]: aura,
|
|
1896
|
+
[CreditCardTypes.NARANJA]: naranja,
|
|
1897
|
+
[CreditCardTypes.MIR]: mir,
|
|
1898
|
+
[CreditCardTypes.CHINA_UNION_PAY]: chinaUnionPay,
|
|
1899
|
+
[CreditCardTypes.POSTEPAY]: postePay,
|
|
1900
|
+
};
|
|
1901
|
+
|
|
1902
|
+
class CreditCardService {
|
|
1903
|
+
getBinNumber(cardNumber) {
|
|
1904
|
+
const binNumberLength = 6;
|
|
1905
|
+
return cardNumber.replace(/\s+/g, '').substring(0, binNumberLength);
|
|
1906
|
+
}
|
|
1907
|
+
getAccountSuffix(cardNumber) {
|
|
1908
|
+
const accountSuffixLength = 4;
|
|
1909
|
+
return cardNumber
|
|
1910
|
+
.replace(/\s+/g, '')
|
|
1911
|
+
.substring(cardNumber.length - accountSuffixLength);
|
|
1912
|
+
}
|
|
1913
|
+
getTypeByNumber(cardNumber) {
|
|
1914
|
+
cardNumber = cardNumber.replace(/\s+/g, '');
|
|
1915
|
+
const cardSettings = orderedCardSettings.find((settings) => {
|
|
1916
|
+
const isNumberMatched = settings.checkNumber(cardNumber);
|
|
1917
|
+
return isNumberMatched ? settings.id : false;
|
|
1918
|
+
});
|
|
1919
|
+
return cardSettings ? cardSettings.id : defaultCard.id;
|
|
1920
|
+
}
|
|
1921
|
+
getCreditCardSettings(cardType) {
|
|
1922
|
+
const creditCard = creditCardsMap[cardType];
|
|
1923
|
+
if (!creditCard) {
|
|
1924
|
+
return defaultCard;
|
|
1925
|
+
}
|
|
1926
|
+
return creditCard;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
CreditCardService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1930
|
+
CreditCardService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardService, providedIn: 'root' });
|
|
1931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardService, decorators: [{
|
|
1932
|
+
type: Injectable,
|
|
1933
|
+
args: [{
|
|
1934
|
+
providedIn: 'root',
|
|
1935
|
+
}]
|
|
1936
|
+
}] });
|
|
1937
|
+
|
|
1938
|
+
class CreditCardMinLengthValidator {
|
|
1939
|
+
constructor(creditService) {
|
|
1940
|
+
this.creditService = creditService;
|
|
1941
|
+
this.validate = (field) => {
|
|
1942
|
+
if (isEmptyInputValue(field.value) || !isString(field.value)) {
|
|
1943
|
+
return null;
|
|
1944
|
+
}
|
|
1945
|
+
const length = field.value.length;
|
|
1946
|
+
const cardType = this.creditService.getTypeByNumber(field.value);
|
|
1947
|
+
const { minLength } = this.creditService.getCreditCardSettings(cardType);
|
|
1948
|
+
return length < minLength
|
|
1949
|
+
? {
|
|
1950
|
+
rewritableError: {
|
|
1951
|
+
message: `Enter at least ${minLength} characters`,
|
|
1952
|
+
number: minLength,
|
|
1953
|
+
},
|
|
1954
|
+
}
|
|
1955
|
+
: null;
|
|
1956
|
+
};
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
CreditCardMinLengthValidator.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardMinLengthValidator, deps: [{ token: CreditCardService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1960
|
+
CreditCardMinLengthValidator.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardMinLengthValidator });
|
|
1961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardMinLengthValidator, decorators: [{
|
|
1962
|
+
type: Injectable
|
|
1963
|
+
}], ctorParameters: function () { return [{ type: CreditCardService }]; } });
|
|
1964
|
+
|
|
1965
|
+
class CardNumberConverter extends Converter {
|
|
1966
|
+
constructor(syncService, maxLengthValidator, minLengthValidator) {
|
|
1967
|
+
super(syncService);
|
|
1968
|
+
this.maxLengthValidator = maxLengthValidator;
|
|
1969
|
+
this.minLengthValidator = minLengthValidator;
|
|
1970
|
+
}
|
|
1971
|
+
getValidators(field) {
|
|
1972
|
+
return super
|
|
1973
|
+
.getValidators(field)
|
|
1974
|
+
.concat([
|
|
1975
|
+
luhnFormulaValidator,
|
|
1976
|
+
this.minLengthValidator.validate,
|
|
1977
|
+
this.maxLengthValidator.validate,
|
|
1978
|
+
]);
|
|
1979
|
+
}
|
|
1980
|
+
createControlConfig(field, formState) {
|
|
1981
|
+
var _a, _b;
|
|
1982
|
+
const config = this.createDefaultControlConfig(CardNumberConfig, field);
|
|
1983
|
+
config.placeholder = config.title;
|
|
1984
|
+
config.availableCardTypes =
|
|
1985
|
+
(_a = formState === null || formState === void 0 ? void 0 : formState.availableCardTypes) !== null && _a !== void 0 ? _a : [];
|
|
1986
|
+
config.activeCardType = formState === null || formState === void 0 ? void 0 : formState.activeCardType;
|
|
1987
|
+
config.customError = formState === null || formState === void 0 ? void 0 : formState.customError;
|
|
1988
|
+
config.disabled = (_b = formState === null || formState === void 0 ? void 0 : formState.disabled) !== null && _b !== void 0 ? _b : false;
|
|
1989
|
+
return config;
|
|
1990
|
+
}
|
|
1991
|
+
getAutocomplete() {
|
|
1992
|
+
return 'cc-number';
|
|
1993
|
+
}
|
|
1994
|
+
getDataType() {
|
|
1995
|
+
return 'text';
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
CardNumberConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CardNumberConverter, deps: [{ token: SyncService }, { token: CreditCardMinLengthValidator }, { token: CreditCardMinLengthValidator }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1999
|
+
CardNumberConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CardNumberConverter });
|
|
2000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CardNumberConverter, decorators: [{
|
|
2001
|
+
type: Injectable
|
|
2002
|
+
}], ctorParameters: function () { return [{ type: SyncService }, { type: CreditCardMinLengthValidator }, { type: CreditCardMinLengthValidator }]; } });
|
|
2003
|
+
|
|
1613
2004
|
const convertersMapToken = new InjectionToken('ConvertersTokensMap');
|
|
1614
2005
|
const convertersMap = {
|
|
1615
2006
|
zip: ZipConverter,
|
|
1616
2007
|
email: EmailConverter,
|
|
2008
|
+
card_number: CardNumberConverter,
|
|
1617
2009
|
};
|
|
1618
2010
|
|
|
1619
2011
|
class ControlConfigService {
|
|
@@ -3127,22 +3519,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3127
3519
|
}] }];
|
|
3128
3520
|
} });
|
|
3129
3521
|
|
|
3522
|
+
class CreditCardStateService extends EmitDataService {
|
|
3523
|
+
}
|
|
3524
|
+
CreditCardStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardStateService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
3525
|
+
CreditCardStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardStateService, providedIn: 'root' });
|
|
3526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CreditCardStateService, decorators: [{
|
|
3527
|
+
type: Injectable,
|
|
3528
|
+
args: [{
|
|
3529
|
+
providedIn: 'root',
|
|
3530
|
+
}]
|
|
3531
|
+
}] });
|
|
3532
|
+
|
|
3130
3533
|
class PaymentService {
|
|
3131
|
-
|
|
3534
|
+
get formFieldsStatus$() {
|
|
3535
|
+
return this.formFieldsStatusSubject.asObservable().pipe(filter$1(Boolean));
|
|
3536
|
+
}
|
|
3537
|
+
constructor(initializeService, submitService, syncService, formService, statusService, financeDetailsService, creditCardStateService, nextActionService, controlConfigService) {
|
|
3132
3538
|
this.initializeService = initializeService;
|
|
3133
3539
|
this.submitService = submitService;
|
|
3134
3540
|
this.syncService = syncService;
|
|
3135
3541
|
this.formService = formService;
|
|
3136
3542
|
this.statusService = statusService;
|
|
3137
3543
|
this.financeDetailsService = financeDetailsService;
|
|
3544
|
+
this.creditCardStateService = creditCardStateService;
|
|
3138
3545
|
this.nextActionService = nextActionService;
|
|
3139
3546
|
this.controlConfigService = controlConfigService;
|
|
3140
3547
|
this.form = null;
|
|
3141
3548
|
this.data = null;
|
|
3142
3549
|
this.financeDetails = null;
|
|
3550
|
+
this.focusFieldName = null;
|
|
3143
3551
|
this.fields = [];
|
|
3144
3552
|
this.destroy$ = new Subject();
|
|
3145
3553
|
this.formDestroy$ = new Subject();
|
|
3554
|
+
this.formFieldsStatusSubject = new BehaviorSubject(null);
|
|
3146
3555
|
}
|
|
3147
3556
|
initialize(config) {
|
|
3148
3557
|
var _a;
|
|
@@ -3154,9 +3563,10 @@ class PaymentService {
|
|
|
3154
3563
|
this.data = yield this.initializeService.request(config);
|
|
3155
3564
|
this.fields = this.getFields();
|
|
3156
3565
|
this.form = this.formService.createForm(this.fields);
|
|
3157
|
-
this.listenSyncValidationErrors(this.form);
|
|
3158
|
-
this.emitFinanceDetails((_a = this.data.paymentForm) === null || _a === void 0 ? void 0 : _a.summary);
|
|
3159
3566
|
this.setupSyncService(this.form, this.fields);
|
|
3567
|
+
this.listenFormStatusChanges(this.form);
|
|
3568
|
+
this.emitFinanceDetails((_a = this.data.paymentForm) === null || _a === void 0 ? void 0 : _a.summary);
|
|
3569
|
+
this.emitFormFieldsStatus(this.form);
|
|
3160
3570
|
return this.fields.filter((field) => (field === null || field === void 0 ? void 0 : field.isVisible) === "1" /* XpsBoolean.true */);
|
|
3161
3571
|
});
|
|
3162
3572
|
}
|
|
@@ -3167,14 +3577,7 @@ class PaymentService {
|
|
|
3167
3577
|
}
|
|
3168
3578
|
if (!this.form.valid) {
|
|
3169
3579
|
this.form.markAllAsTouched();
|
|
3170
|
-
|
|
3171
|
-
var _a;
|
|
3172
|
-
const control = (_a = this.form) === null || _a === void 0 ? void 0 : _a.get(controlKey);
|
|
3173
|
-
if (control) {
|
|
3174
|
-
const controlObject = this.getControlState(controlKey, control);
|
|
3175
|
-
this.nextActionService.emitFlowUpdates(new ShowFieldStateAction(Object.assign(Object.assign({}, controlObject), { isFocused: true })));
|
|
3176
|
-
}
|
|
3177
|
-
});
|
|
3580
|
+
this.emitFormFieldsStatus(this.form);
|
|
3178
3581
|
return;
|
|
3179
3582
|
}
|
|
3180
3583
|
const submitResponse = yield this.submitService.request(this.fields, this.form);
|
|
@@ -3231,22 +3634,22 @@ class PaymentService {
|
|
|
3231
3634
|
changeFieldState(name, state) {
|
|
3232
3635
|
var _a;
|
|
3233
3636
|
const formControl = (_a = this.form) === null || _a === void 0 ? void 0 : _a.get(name);
|
|
3234
|
-
if (!formControl) {
|
|
3637
|
+
if (!this.form || !formControl) {
|
|
3235
3638
|
return;
|
|
3236
3639
|
}
|
|
3237
|
-
const controlObject = this.getControlState(name, formControl);
|
|
3238
3640
|
switch (state) {
|
|
3239
3641
|
case InputEventName.blur: {
|
|
3240
3642
|
formControl.markAsTouched();
|
|
3241
|
-
this.
|
|
3242
|
-
|
|
3643
|
+
this.focusFieldName = null;
|
|
3644
|
+
break;
|
|
3243
3645
|
}
|
|
3244
3646
|
case InputEventName.focus: {
|
|
3245
3647
|
formControl.markAsUntouched();
|
|
3246
|
-
this.
|
|
3247
|
-
|
|
3648
|
+
this.focusFieldName = name;
|
|
3649
|
+
break;
|
|
3248
3650
|
}
|
|
3249
3651
|
}
|
|
3652
|
+
this.emitFormFieldsStatus(this.form);
|
|
3250
3653
|
}
|
|
3251
3654
|
destroy() {
|
|
3252
3655
|
this.data = null;
|
|
@@ -3259,48 +3662,57 @@ class PaymentService {
|
|
|
3259
3662
|
emitFinanceDetails(summary) {
|
|
3260
3663
|
this.financeDetailsService.emit(summary);
|
|
3261
3664
|
}
|
|
3665
|
+
emitCreditCardState(idCardType) {
|
|
3666
|
+
this.creditCardStateService.emit({ idCardType });
|
|
3667
|
+
}
|
|
3668
|
+
emitFormFieldsStatus(form) {
|
|
3669
|
+
const formFieldsStatus = {};
|
|
3670
|
+
Object.keys(form.controls).forEach((name) => {
|
|
3671
|
+
const control = form.controls[name];
|
|
3672
|
+
formFieldsStatus[name] = {
|
|
3673
|
+
name: name,
|
|
3674
|
+
validationStatus: control.status,
|
|
3675
|
+
errors: control.errors,
|
|
3676
|
+
isFocused: this.focusFieldName === name,
|
|
3677
|
+
};
|
|
3678
|
+
});
|
|
3679
|
+
this.formFieldsStatusSubject.next(formFieldsStatus);
|
|
3680
|
+
}
|
|
3262
3681
|
setupSyncService(form, fields) {
|
|
3263
3682
|
this.syncService.setup(form, fields);
|
|
3264
3683
|
this.syncService.data$
|
|
3265
3684
|
.pipe(takeUntil(this.destroy$))
|
|
3266
|
-
.subscribe((response) =>
|
|
3685
|
+
.subscribe((response) => {
|
|
3686
|
+
this.emitFinanceDetails(response.summary);
|
|
3687
|
+
});
|
|
3688
|
+
this.syncService.fieldAsyncValidation$
|
|
3689
|
+
.pipe(takeUntil(this.destroy$))
|
|
3690
|
+
.subscribe((fieldAsyncValidation) => {
|
|
3691
|
+
switch (fieldAsyncValidation.field.name) {
|
|
3692
|
+
case FieldNames.cardNumber:
|
|
3693
|
+
this.emitCreditCardState(fieldAsyncValidation.response.parameters.idCardType);
|
|
3694
|
+
}
|
|
3695
|
+
});
|
|
3267
3696
|
}
|
|
3268
3697
|
listenFinanceDetails() {
|
|
3269
3698
|
this.financeDetailsService.data$
|
|
3270
3699
|
.pipe(takeUntil(this.destroy$))
|
|
3271
3700
|
.subscribe((financeDetails) => (this.financeDetails = financeDetails));
|
|
3272
3701
|
}
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
control.statusChanges
|
|
3278
|
-
.pipe(distinctUntilChanged(), takeUntil(this.formDestroy$))
|
|
3279
|
-
.subscribe((status) => {
|
|
3280
|
-
const controlObject = this.getControlState(key, control, status);
|
|
3281
|
-
this.nextActionService.emitFlowUpdates(new ShowFieldStateAction(controlObject));
|
|
3282
|
-
});
|
|
3283
|
-
}
|
|
3284
|
-
});
|
|
3285
|
-
}
|
|
3286
|
-
getControlState(controlName, controlObject, status) {
|
|
3287
|
-
var _a, _b;
|
|
3288
|
-
const controlError = (_b = (_a = controlObject.errors) === null || _a === void 0 ? void 0 : _a['rewritableError']) !== null && _b !== void 0 ? _b : null;
|
|
3289
|
-
return {
|
|
3290
|
-
fieldName: controlName,
|
|
3291
|
-
fieldState: status !== null && status !== void 0 ? status : controlObject.status,
|
|
3292
|
-
error: controlError,
|
|
3293
|
-
};
|
|
3702
|
+
listenFormStatusChanges(form) {
|
|
3703
|
+
form.statusChanges
|
|
3704
|
+
.pipe(takeUntil(this.formDestroy$))
|
|
3705
|
+
.subscribe(() => this.emitFormFieldsStatus(form));
|
|
3294
3706
|
}
|
|
3295
3707
|
}
|
|
3296
|
-
PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: FinanceDetailsService }, { token: NextActionService }, { token: ControlConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3708
|
+
PaymentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, deps: [{ token: InitializeService }, { token: SubmitService }, { token: SyncService }, { token: FormService }, { token: StatusService }, { token: FinanceDetailsService }, { token: CreditCardStateService }, { token: NextActionService }, { token: ControlConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3297
3709
|
PaymentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, providedIn: 'root' });
|
|
3298
3710
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PaymentService, decorators: [{
|
|
3299
3711
|
type: Injectable,
|
|
3300
3712
|
args: [{
|
|
3301
3713
|
providedIn: 'root',
|
|
3302
3714
|
}]
|
|
3303
|
-
}], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: FinanceDetailsService }, { type: NextActionService }, { type: ControlConfigService }]; } });
|
|
3715
|
+
}], ctorParameters: function () { return [{ type: InitializeService }, { type: SubmitService }, { type: SyncService }, { type: FormService }, { type: StatusService }, { type: FinanceDetailsService }, { type: CreditCardStateService }, { type: NextActionService }, { type: ControlConfigService }]; } });
|
|
3304
3716
|
|
|
3305
3717
|
class RefundPolicyService {
|
|
3306
3718
|
constructor(settingsService) {
|
|
@@ -3408,7 +3820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3408
3820
|
}], ctorParameters: function () { return [{ type: SettingsService }, { type: RefundPolicyService }, { type: SecureConnectionService }, { type: DisclaimerService }]; } });
|
|
3409
3821
|
|
|
3410
3822
|
class CoreLibraryService {
|
|
3411
|
-
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService) {
|
|
3823
|
+
constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentConfigService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, statusService, nextActionService, creditCardService, creditCardStateService) {
|
|
3412
3824
|
this.settingsService = settingsService;
|
|
3413
3825
|
this.countryService = countryService;
|
|
3414
3826
|
this.paymentMethodsService = paymentMethodsService;
|
|
@@ -3421,6 +3833,8 @@ class CoreLibraryService {
|
|
|
3421
3833
|
this.legalService = legalService;
|
|
3422
3834
|
this.statusService = statusService;
|
|
3423
3835
|
this.nextActionService = nextActionService;
|
|
3836
|
+
this.creditCardService = creditCardService;
|
|
3837
|
+
this.creditCardStateService = creditCardStateService;
|
|
3424
3838
|
this.paymentMethods = {
|
|
3425
3839
|
getList: () => __awaiter(this, void 0, void 0, function* () { return this.paymentMethodsService.getList(); }),
|
|
3426
3840
|
getQuickMethods: () => __awaiter(this, void 0, void 0, function* () { return this.paymentMethodsService.getQuickMethods(); }),
|
|
@@ -3455,14 +3869,23 @@ class CoreLibraryService {
|
|
|
3455
3869
|
flowUpdates$: this.nextActionService.flowUpdates$,
|
|
3456
3870
|
financeDetailsUpdates$: this.financeDetailsService.data$,
|
|
3457
3871
|
form: {
|
|
3872
|
+
fieldsStatus$: this.paymentService.formFieldsStatus$,
|
|
3458
3873
|
getControlConfig: (field) => this.paymentService.getFieldConfig(field),
|
|
3459
3874
|
changeFieldValue: (name, value) => this.paymentService.changeFieldValue(name, value),
|
|
3460
|
-
changeFieldState: (name, state) =>
|
|
3461
|
-
this.paymentService.changeFieldState(name, state);
|
|
3462
|
-
},
|
|
3875
|
+
changeFieldState: (name, state) => this.paymentService.changeFieldState(name, state),
|
|
3463
3876
|
},
|
|
3464
3877
|
};
|
|
3465
3878
|
}
|
|
3879
|
+
getCreditCardService() {
|
|
3880
|
+
return {
|
|
3881
|
+
getTypeByNumber: (cardNumber) => this.creditCardService.getTypeByNumber(cardNumber),
|
|
3882
|
+
getCreditCardSettings: (cardType) => this.creditCardService.getCreditCardSettings(cardType),
|
|
3883
|
+
cardTypeUpdates$: this.creditCardStateService.data$,
|
|
3884
|
+
};
|
|
3885
|
+
}
|
|
3886
|
+
get cardTypeUpdates$() {
|
|
3887
|
+
return this.creditCardStateService.data$;
|
|
3888
|
+
}
|
|
3466
3889
|
getLegalComponentConfig() {
|
|
3467
3890
|
return this.legalService.getLegalComponentConfig();
|
|
3468
3891
|
}
|
|
@@ -3471,14 +3894,14 @@ class CoreLibraryService {
|
|
|
3471
3894
|
return masksFunctionsMap[sanitizedName];
|
|
3472
3895
|
}
|
|
3473
3896
|
}
|
|
3474
|
-
CoreLibraryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, deps: [{ token: SettingsService }, { token: CountryService }, { token: PaymentMethodsService }, { token: SavedMethodsService }, { token: UserBalanceService }, { token: PaymentConfigService }, { token: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: StatusService }, { token: NextActionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3897
|
+
CoreLibraryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, deps: [{ token: SettingsService }, { token: CountryService }, { token: PaymentMethodsService }, { token: SavedMethodsService }, { token: UserBalanceService }, { token: PaymentConfigService }, { token: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: StatusService }, { token: NextActionService }, { token: CreditCardService }, { token: CreditCardStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3475
3898
|
CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
|
|
3476
3899
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, decorators: [{
|
|
3477
3900
|
type: Injectable,
|
|
3478
3901
|
args: [{
|
|
3479
3902
|
providedIn: 'root',
|
|
3480
3903
|
}]
|
|
3481
|
-
}], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentConfigService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: StatusService }, { type: NextActionService }]; } });
|
|
3904
|
+
}], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentConfigService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: StatusService }, { type: NextActionService }, { type: CreditCardService }, { type: CreditCardStateService }]; } });
|
|
3482
3905
|
|
|
3483
3906
|
class HttpError extends AppError {
|
|
3484
3907
|
constructor(error, req) {
|
|
@@ -3533,26 +3956,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
3533
3956
|
type: Injectable
|
|
3534
3957
|
}], ctorParameters: function () { return [{ type: i1$1.Router }]; } });
|
|
3535
3958
|
|
|
3959
|
+
class ValidatorsModule {
|
|
3960
|
+
}
|
|
3961
|
+
ValidatorsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ValidatorsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3962
|
+
ValidatorsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: ValidatorsModule, imports: [CommonModule] });
|
|
3963
|
+
ValidatorsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ValidatorsModule, providers: [CreditCardMinLengthValidator], imports: [CommonModule] });
|
|
3964
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: ValidatorsModule, decorators: [{
|
|
3965
|
+
type: NgModule,
|
|
3966
|
+
args: [{
|
|
3967
|
+
declarations: [],
|
|
3968
|
+
imports: [CommonModule],
|
|
3969
|
+
providers: [CreditCardMinLengthValidator],
|
|
3970
|
+
}]
|
|
3971
|
+
}] });
|
|
3972
|
+
|
|
3536
3973
|
class FormModule {
|
|
3537
3974
|
}
|
|
3538
3975
|
FormModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3539
|
-
FormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: FormModule, imports: [ReactiveFormsModule] });
|
|
3976
|
+
FormModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.7", ngImport: i0, type: FormModule, imports: [ReactiveFormsModule, ValidatorsModule] });
|
|
3540
3977
|
FormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, providers: [
|
|
3541
3978
|
FormService,
|
|
3542
3979
|
ControlConfigService,
|
|
3543
3980
|
ZipConverter,
|
|
3544
3981
|
EmailConverter,
|
|
3982
|
+
CardNumberConverter,
|
|
3545
3983
|
{ provide: convertersMapToken, useValue: convertersMap },
|
|
3546
|
-
], imports: [ReactiveFormsModule] });
|
|
3984
|
+
], imports: [ReactiveFormsModule, ValidatorsModule] });
|
|
3547
3985
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, decorators: [{
|
|
3548
3986
|
type: NgModule,
|
|
3549
3987
|
args: [{
|
|
3550
|
-
imports: [ReactiveFormsModule],
|
|
3988
|
+
imports: [ReactiveFormsModule, ValidatorsModule],
|
|
3551
3989
|
providers: [
|
|
3552
3990
|
FormService,
|
|
3553
3991
|
ControlConfigService,
|
|
3554
3992
|
ZipConverter,
|
|
3555
3993
|
EmailConverter,
|
|
3994
|
+
CardNumberConverter,
|
|
3556
3995
|
{ provide: convertersMapToken, useValue: convertersMap },
|
|
3557
3996
|
],
|
|
3558
3997
|
}]
|