@xsolla/payment-client-core 0.0.10-4 → 0.0.10-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.
@@ -7,6 +7,10 @@ import { UntypedFormGroup, Validators, UntypedFormControl, ReactiveFormsModule }
7
7
  import { filter, map as map$1, catchError } from 'rxjs/operators';
8
8
  import * as i1$1 from '@angular/router';
9
9
 
10
+ const masksFunctionsMap = {
11
+ zip: () => new Array(5).fill('9').join(''),
12
+ };
13
+
10
14
  class AppError extends Error {
11
15
  constructor(message) {
12
16
  super(message);
@@ -1199,12 +1203,24 @@ class ZipConverter extends Converter {
1199
1203
  config.icon = 'location';
1200
1204
  if (this.isUsCountry) {
1201
1205
  config.maskConfig = {
1202
- mask: () => new Array(this.usCountryLength).fill('9').join(''),
1206
+ // mask: () => new Array(this.usCountryLength).fill('9').join(''),
1207
+ // mask: () => new Array(5).fill('9').join(''),
1208
+ // mask: function() { return new Array(5).fill('9').join('') },
1209
+ // mask: MasksFunctionsMap['zip'],
1210
+ // mask: function mask() {
1211
+ // const length = this.usCountryLength;
1212
+ // return function() {
1213
+ // return new Array(length).fill('9').join('');
1214
+ // }
1215
+ // },
1203
1216
  guide: false,
1204
1217
  unmaskModelValue: true,
1205
1218
  showMask: true,
1206
1219
  };
1207
1220
  config.inputMode = 'numeric';
1221
+ if (masksFunctionsMap['zip']) {
1222
+ config.maskConfig.mask = masksFunctionsMap['zip'];
1223
+ }
1208
1224
  }
1209
1225
  else {
1210
1226
  config.maxLength = this.maxLength;
@@ -2884,26 +2900,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
2884
2900
  }]
2885
2901
  }], ctorParameters: function () { return [{ type: SettingsService }, { type: RefundPolicyService }, { type: SecureConnectionService }, { type: DisclaimerService }]; } });
2886
2902
 
2887
- class MaskConfigService {
2888
- constructor(controlConfigService) {
2889
- this.controlConfigService = controlConfigService;
2890
- }
2891
- getFieldMask(field) {
2892
- const config = this.controlConfigService.getConfig(field);
2893
- if (config?.maskConfig?.mask) {
2894
- return config?.maskConfig?.mask;
2895
- }
2896
- return;
2897
- }
2898
- }
2899
- MaskConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MaskConfigService, deps: [{ token: ControlConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2900
- MaskConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MaskConfigService });
2901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: MaskConfigService, decorators: [{
2902
- type: Injectable
2903
- }], ctorParameters: function () { return [{ type: ControlConfigService }]; } });
2904
-
2905
2903
  class CoreLibraryService {
2906
- constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, nextActionService, maskConfigService) {
2904
+ constructor(settingsService, countryService, paymentMethodsService, savedMethodsService, userBalanceService, paymentService, deviceFingerPrintService, financeDetailsService, legalService, nextActionService) {
2907
2905
  this.settingsService = settingsService;
2908
2906
  this.countryService = countryService;
2909
2907
  this.paymentMethodsService = paymentMethodsService;
@@ -2914,7 +2912,6 @@ class CoreLibraryService {
2914
2912
  this.financeDetailsService = financeDetailsService;
2915
2913
  this.legalService = legalService;
2916
2914
  this.nextActionService = nextActionService;
2917
- this.maskConfigService = maskConfigService;
2918
2915
  this.paymentMethods = {
2919
2916
  getList: async () => this.paymentMethodsService.getList(),
2920
2917
  getQuickMethods: async () => this.paymentMethodsService.getQuickMethods(),
@@ -2949,18 +2946,19 @@ class CoreLibraryService {
2949
2946
  getLegalComponentConfig() {
2950
2947
  return this.legalService.getLegalComponentConfig();
2951
2948
  }
2952
- getControlMask(field) {
2953
- return this.maskConfigService.getFieldMask(field);
2949
+ getFieldMask(field) {
2950
+ const sanitizedName = field.name.replace(/^fix_/i, '');
2951
+ return masksFunctionsMap[sanitizedName];
2954
2952
  }
2955
2953
  }
2956
- 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: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: NextActionService }, { token: MaskConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
2954
+ 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: PaymentService }, { token: DeviceFingerPrintService }, { token: FinanceDetailsService }, { token: LegalService }, { token: NextActionService }], target: i0.ɵɵFactoryTarget.Injectable });
2957
2955
  CoreLibraryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, providedIn: 'root' });
2958
2956
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryService, decorators: [{
2959
2957
  type: Injectable,
2960
2958
  args: [{
2961
2959
  providedIn: 'root',
2962
2960
  }]
2963
- }], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: NextActionService }, { type: MaskConfigService }]; } });
2961
+ }], ctorParameters: function () { return [{ type: SettingsService }, { type: CountryService }, { type: PaymentMethodsService }, { type: SavedMethodsService }, { type: UserBalanceService }, { type: PaymentService }, { type: DeviceFingerPrintService }, { type: FinanceDetailsService }, { type: LegalService }, { type: NextActionService }]; } });
2964
2962
 
2965
2963
  class HttpError extends AppError {
2966
2964
  constructor(error, req) {
@@ -3071,7 +3069,6 @@ CoreLibraryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
3071
3069
  useValue: nextActions,
3072
3070
  },
3073
3071
  ...nextActions,
3074
- MaskConfigService
3075
3072
  ], imports: [HttpClientModule, FormModule] });
3076
3073
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImport: i0, type: CoreLibraryModule, decorators: [{
3077
3074
  type: NgModule,
@@ -3102,7 +3099,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.7", ngImpor
3102
3099
  useValue: nextActions,
3103
3100
  },
3104
3101
  ...nextActions,
3105
- MaskConfigService
3106
3102
  ],
3107
3103
  }]
3108
3104
  }] });