ngx-techlify-core 18.86.0 → 18.88.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.
@@ -5,13 +5,13 @@ import { OnInit } from '@angular/core';
5
5
  import { AlertService } from '../core/alert.service';
6
6
  import { ErrorHandlerService } from '../core/error-handler.service';
7
7
  import { ImportCsvConfig } from './import-csv-config';
8
- import { DatePipe } from "@angular/common";
8
+ import { DateUtils } from '../utility/date-utils.service';
9
9
  import * as i0 from "@angular/core";
10
10
  export declare class ImportCsvComponent implements OnInit {
11
11
  private alertService;
12
12
  private errorHandler;
13
13
  private http;
14
- private datePipe;
14
+ private dateUtils;
15
15
  result: any;
16
16
  config: ImportCsvConfig;
17
17
  filesConfig: FileDropperConfig;
@@ -25,7 +25,7 @@ export declare class ImportCsvComponent implements OnInit {
25
25
  selectedFields: any[];
26
26
  importSteps: any;
27
27
  currentStep: any;
28
- constructor(alertService: AlertService, errorHandler: ErrorHandlerService, http: HttpService, datePipe: DatePipe);
28
+ constructor(alertService: AlertService, errorHandler: ErrorHandlerService, http: HttpService, dateUtils: DateUtils);
29
29
  ngOnInit(): void;
30
30
  get step(): any;
31
31
  fileChanged(event: any): Promise<void>;
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class OrdinalPipe implements PipeTransform {
4
+ transform(n: number, keepNumber?: boolean): string;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<OrdinalPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<OrdinalPipe, "ordinal", true>;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { TechlifyService } from '../base-model/techlify-service';
2
+ import { HttpService } from '../core/http.service';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class CountryService extends TechlifyService {
6
+ protected http: HttpService;
7
+ private countries?;
8
+ constructor(http: HttpService);
9
+ getCountriesObservable(reload?: boolean): Observable<any[]>;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountryService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountryService>;
12
+ }
@@ -0,0 +1,47 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { ControlValueAccessor, FormControl, FormGroup } from '@angular/forms';
3
+ import { CountryService } from './country.service';
4
+ import * as i0 from "@angular/core";
5
+ export declare class PhoneNumberSelectorComponent implements ControlValueAccessor, OnInit, OnDestroy {
6
+ private service;
7
+ label: import("@angular/core").InputSignal<string>;
8
+ placeholder: import("@angular/core").InputSignal<string>;
9
+ required: import("@angular/core").InputSignal<boolean>;
10
+ countries: import("@angular/core").WritableSignal<any[]>;
11
+ readonly phoneGroup: FormGroup<{
12
+ country_code: FormControl<string>;
13
+ number: FormControl<string>;
14
+ }>;
15
+ private onChange;
16
+ protected onTouched: () => void;
17
+ private destroy$;
18
+ /**
19
+ * Used to validate inline that the number entered is valid based on the
20
+ * selected country's phone length, with or without its calling code.
21
+ * Countries without a phone length are not validated yet
22
+ */
23
+ private readonly phoneFormatValidator;
24
+ constructor(service: CountryService);
25
+ ngOnInit(): void;
26
+ ngOnDestroy(): void;
27
+ writeValue(value: string | null): void;
28
+ registerOnChange(fn: (value: string) => void): void;
29
+ registerOnTouched(fn: () => void): void;
30
+ setDisabledState(isDisabled: boolean): void;
31
+ /**
32
+ * Adjust the number to be sent to the api in the correct format
33
+ */
34
+ private normalizeForApi;
35
+ private getCountry;
36
+ /**
37
+ * Returns the digits of the number without the country's calling code
38
+ */
39
+ private toLocalDigits;
40
+ /**
41
+ * Finds the country from the calling code the number starts with.
42
+ * +1 is shared by several countries, so it defaults to US like before
43
+ */
44
+ private detectCountry;
45
+ static ɵfac: i0.ɵɵFactoryDeclaration<PhoneNumberSelectorComponent, never>;
46
+ static ɵcmp: i0.ɵɵComponentDeclaration<PhoneNumberSelectorComponent, "app-phone-number-selector", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
47
+ }
@@ -20,6 +20,19 @@ export declare class DateUtils {
20
20
  getMM(inputDate: Date): number;
21
21
  getDateTime(inputDate: Date): string;
22
22
  getMonthName(month: number): string;
23
+ /**
24
+ * Parses a raw date string
25
+ */
26
+ parseLocalDate(rawValue: string): Date;
27
+ /**
28
+ * Builds a timezone-naive "yyyy-MM-dd" string from a raw date string,
29
+ * ignoring any time-of-day it contains.
30
+ */
31
+ toLocalDateString(rawValue: string): string;
32
+ /**
33
+ * Builds a timezone-naive "yyyy-MM-ddTHH:mm:ss" string
34
+ */
35
+ toLocalDateTimeString(rawValue: string): string;
23
36
  static ɵfac: i0.ɵɵFactoryDeclaration<DateUtils, never>;
24
37
  static ɵprov: i0.ɵɵInjectableDeclaration<DateUtils>;
25
38
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-techlify-core",
3
- "version": "18.86.0",
3
+ "version": "18.88.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18",
6
6
  "@angular/core": ">=18",
package/public-api.d.ts CHANGED
@@ -138,6 +138,8 @@ export * from './lib/file-dragdrop-uploader/file-dragdrop-uploader/file-dragdrop
138
138
  export * from './lib/file-dragdrop-uploader/file-dragdrop-uploader.module';
139
139
  export * from './lib/number-input-button';
140
140
  export * from './lib/number-selector/number-selector.component';
141
+ export * from './lib/phone-number-selector/phone-number-selector.component';
142
+ export * from './lib/phone-number-selector/country.service';
141
143
  export * from './lib/column-selector';
142
144
  export * from './lib/reset-password';
143
145
  export * from './lib/reset-password/reset-password.module';
@@ -206,3 +208,4 @@ export * from './lib/tag/techlify-tagger-tag-form/techlify-tagger-tag-form.compo
206
208
  export * from './lib/tag/tag.service';
207
209
  export * from './lib/techlify-auto-complete-select/techlify-auto-complete-select.component';
208
210
  export * from './lib/techlify-currency-pipe/techlify-currency-pipe.directive';
211
+ export * from './lib/ordinal-pipe/ordinal-pipe';