@elderbyte/ngx-starter 19.18.0 → 19.20.0

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,9 @@
1
+ import { CountryPhoneFormat } from './phone.types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CountryPhoneFormatService {
4
+ getCountryPhoneFormat(dialingCode: string): CountryPhoneFormat | null;
5
+ getCountry(dialingCode: string): string | null;
6
+ protected readonly countryPhoneFormats: Record<string, CountryPhoneFormat>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountryPhoneFormatService, never>;
8
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountryPhoneFormatService>;
9
+ }
@@ -0,0 +1,18 @@
1
+ import { CountryPhoneFormat } from './phone.types';
2
+ import * as i0 from "@angular/core";
3
+ export declare class PhoneFormatService {
4
+ /***************************************************************************
5
+ * *
6
+ * Public static methods *
7
+ * *
8
+ **************************************************************************/
9
+ formatPhoneNumber(nr: string, config: CountryPhoneFormat): string;
10
+ /***************************************************************************
11
+ * *
12
+ * Private static methods *
13
+ * *
14
+ **************************************************************************/
15
+ private removeDialingCode;
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneFormatService, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<PhoneFormatService>;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { PhoneData } from './phone.types';
3
+ import * as i0 from "@angular/core";
4
+ export declare class PhonePipe implements PipeTransform {
5
+ private readonly countryPhoneFormats;
6
+ private readonly phoneFormat;
7
+ transform(phoneData: PhoneData): string;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhonePipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<PhonePipe, "phone", true>;
10
+ }
@@ -0,0 +1,10 @@
1
+ export type PhoneData = {
2
+ phoneNumber: string;
3
+ dialingCode?: string;
4
+ };
5
+ export type CountryPhoneFormat = {
6
+ country: string;
7
+ dialingCode: string;
8
+ bodyFormat?: [RegExp, string];
9
+ customPrefix?: string;
10
+ };
@@ -0,0 +1,4 @@
1
+ export * from './phone-format.service';
2
+ export * from './phone.types';
3
+ export * from './country-phone-format.service';
4
+ export * from './phone.pipe';
@@ -3,3 +3,4 @@ export * from './bytes-format';
3
3
  export * from './curency-format-util';
4
4
  export * from './iso-interval-format-util';
5
5
  export * from './duration-format-util';
6
+ export * from './phone/public_api';
@@ -1,20 +1,38 @@
1
1
  import { OnInit } from '@angular/core';
2
- import { BehaviorSubject } from 'rxjs';
2
+ import { Observable } from 'rxjs';
3
3
  import { ElderUrlFragment } from '../elder-url-fragment';
4
4
  import * as i0 from "@angular/core";
5
+ export declare class ElderUrlFragmentSwitcherCtx {
6
+ readonly availableFragments: ElderUrlFragment[];
7
+ readonly activeFragment: ElderUrlFragment;
8
+ constructor(availableFragments: ElderUrlFragment[], activeFragment: ElderUrlFragment);
9
+ }
5
10
  export declare class ElderUrlFragmentSwitcherComponent implements OnInit {
6
- private readonly logger;
7
11
  /***************************************************************************
8
12
  * *
9
13
  * Fields *
10
14
  * *
11
15
  **************************************************************************/
16
+ /**
17
+ * Disables the component
18
+ */
12
19
  disable: boolean;
13
- urlFragments: ElderUrlFragment[];
20
+ /**
21
+ * Regex which matches the part of the url which will get replaced
22
+ */
14
23
  urlRegex: RegExp;
24
+ /**
25
+ * Index of the regex group which will be replaced
26
+ */
15
27
  regexArrayIndex: number;
28
+ /**
29
+ * Window which will open the created url
30
+ */
16
31
  windowOpenIn: string;
17
- readonly activeUrlFragment$: BehaviorSubject<ElderUrlFragment>;
32
+ readonly fragmentContext$: Observable<ElderUrlFragmentSwitcherCtx>;
33
+ private readonly _activeUrlFragment$;
34
+ private readonly _urlFragments$;
35
+ private readonly logger;
18
36
  /***************************************************************************
19
37
  * *
20
38
  * Constructor *
@@ -27,12 +45,29 @@ export declare class ElderUrlFragmentSwitcherComponent implements OnInit {
27
45
  * *
28
46
  **************************************************************************/
29
47
  ngOnInit(): void;
48
+ /***************************************************************************
49
+ * *
50
+ * Properties *
51
+ * *
52
+ **************************************************************************/
53
+ /**
54
+ * List of url fragments which can replace a part of the window location
55
+ */
56
+ set urlFragments(urlFragments: ElderUrlFragment[]);
57
+ get urlFragments(): ElderUrlFragment[];
58
+ get urlFragments$(): Observable<ElderUrlFragment[]>;
30
59
  /***************************************************************************
31
60
  * *
32
61
  * Public API *
33
62
  * *
34
63
  **************************************************************************/
35
64
  setActiveUrlFragment(urlFragment: string): void;
65
+ /***************************************************************************
66
+ * *
67
+ * Private Methods *
68
+ * *
69
+ **************************************************************************/
70
+ private updateActiveFragment;
36
71
  static ɵfac: i0.ɵɵFactoryDeclaration<ElderUrlFragmentSwitcherComponent, never>;
37
- static ɵcmp: i0.ɵɵComponentDeclaration<ElderUrlFragmentSwitcherComponent, "elder-url-fragment-switcher", never, { "disable": { "alias": "disable"; "required": false; }; "urlFragments": { "alias": "urlFragments"; "required": false; }; "urlRegex": { "alias": "urlRegex"; "required": false; }; "regexArrayIndex": { "alias": "regexArrayIndex"; "required": false; }; "windowOpenIn": { "alias": "windowOpenIn"; "required": false; }; }, {}, never, never, true, never>;
72
+ static ɵcmp: i0.ɵɵComponentDeclaration<ElderUrlFragmentSwitcherComponent, "elder-url-fragment-switcher", never, { "disable": { "alias": "disable"; "required": false; }; "urlRegex": { "alias": "urlRegex"; "required": false; }; "regexArrayIndex": { "alias": "regexArrayIndex"; "required": false; }; "windowOpenIn": { "alias": "windowOpenIn"; "required": false; }; "urlFragments": { "alias": "urlFragments"; "required": false; }; }, {}, never, never, true, never>;
38
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elderbyte/ngx-starter",
3
- "version": "19.18.0",
3
+ "version": "19.20.0",
4
4
  "peerDependencies": {
5
5
  "@angular/core": "^18.0.0 || ^19.0.0",
6
6
  "@angular/common": "^18.0.0 || ^19.0.0",