@xsolla/payment-client-core 0.1.6-1 → 0.1.6
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/payment/form/converters/converters-map.mjs +1 -3
- package/esm2020/lib/core/payment/form/form.module.mjs +1 -6
- package/esm2020/lib/core-library.service.mjs +1 -4
- package/fesm2015/xsolla-payment-client-core.mjs +0 -55
- package/fesm2015/xsolla-payment-client-core.mjs.map +1 -1
- package/fesm2020/xsolla-payment-client-core.mjs +0 -55
- package/fesm2020/xsolla-payment-client-core.mjs.map +1 -1
- package/lib/core-library.service.d.ts +0 -1
- package/package.json +1 -1
- package/xsolla-payment-client-core-0.1.6.tgz +0 -0
- package/esm2020/lib/core/payment/form/controls/phone-control.config.mjs +0 -8
- package/esm2020/lib/core/payment/form/converters/phone.converter.mjs +0 -37
- package/esm2020/lib/core/payment/form/validators/max-length-validator.mjs +0 -6
- package/esm2020/lib/core/payment/form/validators/min-length-validator.mjs +0 -6
- package/esm2020/lib/core/payment/form/validators/phone-validator.mjs +0 -6
- package/lib/core/payment/form/controls/phone-control.config.d.ts +0 -6
- package/lib/core/payment/form/converters/phone.converter.d.ts +0 -13
- package/lib/core/payment/form/validators/max-length-validator.d.ts +0 -2
- package/lib/core/payment/form/validators/min-length-validator.d.ts +0 -2
- package/lib/core/payment/form/validators/phone-validator.d.ts +0 -2
- package/xsolla-payment-client-core-0.1.6-1.tgz +0 -0
|
@@ -2557,53 +2557,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
2557
2557
|
type: Injectable
|
|
2558
2558
|
}], ctorParameters: function () { return [{ type: SyncService }]; } });
|
|
2559
2559
|
|
|
2560
|
-
function phoneValidator() {
|
|
2561
|
-
return convert(Validators.pattern(/^\d*$/), 'Enter a valid phone');
|
|
2562
|
-
}
|
|
2563
|
-
|
|
2564
|
-
function minLengthValidator(minLength) {
|
|
2565
|
-
return convert(Validators.minLength(minLength), `Enter at least ${minLength} characters`);
|
|
2566
|
-
}
|
|
2567
|
-
|
|
2568
|
-
function maxLengthValidator(maxLength) {
|
|
2569
|
-
return convert(Validators.maxLength(maxLength), `Enter no more than ${maxLength} characters`);
|
|
2570
|
-
}
|
|
2571
|
-
|
|
2572
|
-
class PhoneControlConfig extends ControlConfig {
|
|
2573
|
-
constructor() {
|
|
2574
|
-
super(...arguments);
|
|
2575
|
-
this.controlType = 'phone';
|
|
2576
|
-
}
|
|
2577
|
-
}
|
|
2578
|
-
|
|
2579
|
-
class PhoneConverter extends Converter {
|
|
2580
|
-
constructor(syncService) {
|
|
2581
|
-
super(syncService);
|
|
2582
|
-
}
|
|
2583
|
-
getValidators(field) {
|
|
2584
|
-
const minLength = 10;
|
|
2585
|
-
const maxLength = 15;
|
|
2586
|
-
return super
|
|
2587
|
-
.getValidators(field)
|
|
2588
|
-
.concat([
|
|
2589
|
-
convertedRequiredValidator(),
|
|
2590
|
-
phoneValidator(),
|
|
2591
|
-
minLengthValidator(minLength),
|
|
2592
|
-
maxLengthValidator(maxLength),
|
|
2593
|
-
]);
|
|
2594
|
-
}
|
|
2595
|
-
createControlConfig(field) {
|
|
2596
|
-
const config = this.createDefaultControlConfig(PhoneControlConfig, field);
|
|
2597
|
-
config.inputMode = 'numeric';
|
|
2598
|
-
return config;
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
PhoneConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PhoneConverter, deps: [{ token: SyncService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2602
|
-
PhoneConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PhoneConverter });
|
|
2603
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: PhoneConverter, decorators: [{
|
|
2604
|
-
type: Injectable
|
|
2605
|
-
}], ctorParameters: function () { return [{ type: SyncService }]; } });
|
|
2606
|
-
|
|
2607
2560
|
const convertersMapToken = new InjectionToken('ConvertersTokensMap');
|
|
2608
2561
|
const convertersMap = {
|
|
2609
2562
|
card_number: CardNumberConverter,
|
|
@@ -2628,7 +2581,6 @@ const convertersMap = {
|
|
|
2628
2581
|
sum: PricepointConverter,
|
|
2629
2582
|
out: PricepointConverter,
|
|
2630
2583
|
couponCode: CouponConverter,
|
|
2631
|
-
phone: PhoneConverter,
|
|
2632
2584
|
};
|
|
2633
2585
|
|
|
2634
2586
|
class ControlConfigService {
|
|
@@ -4837,9 +4789,6 @@ class CoreLibraryService {
|
|
|
4837
4789
|
setCountry(country) {
|
|
4838
4790
|
this.countryService.setCountry(country);
|
|
4839
4791
|
}
|
|
4840
|
-
getCountry() {
|
|
4841
|
-
return this.countryService.getCountry();
|
|
4842
|
-
}
|
|
4843
4792
|
createPayment(config) {
|
|
4844
4793
|
const enrichedConfig = this.paymentConfigService.enrich(config);
|
|
4845
4794
|
return {
|
|
@@ -4986,8 +4935,6 @@ FormModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15
|
|
|
4986
4935
|
PricepointConverter,
|
|
4987
4936
|
PricepointConverter,
|
|
4988
4937
|
CouponConverter,
|
|
4989
|
-
TextConverter,
|
|
4990
|
-
PhoneConverter,
|
|
4991
4938
|
{ provide: convertersMapToken, useValue: convertersMap },
|
|
4992
4939
|
], imports: [ReactiveFormsModule, ValidatorsModule] });
|
|
4993
4940
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: FormModule, decorators: [{
|
|
@@ -5019,8 +4966,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
|
|
|
5019
4966
|
PricepointConverter,
|
|
5020
4967
|
PricepointConverter,
|
|
5021
4968
|
CouponConverter,
|
|
5022
|
-
TextConverter,
|
|
5023
|
-
PhoneConverter,
|
|
5024
4969
|
{ provide: convertersMapToken, useValue: convertersMap },
|
|
5025
4970
|
],
|
|
5026
4971
|
}]
|