@ngrdt/core 0.0.82 → 0.0.85

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/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import * as i0 from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, AfterViewInit, OnDestroy, OnInit, Type, DestroyRef, ComponentRef, PipeTransform, ElementRef, WritableSignal, Signal } from '@angular/core';
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable } from 'rxjs';
5
5
  import * as _ngrdt_core from '@ngrdt/core';
6
6
  import { Nullable } from '@ngrdt/utils';
7
+ import { Locale } from 'date-fns';
7
8
 
8
9
  type RdtBooleanResult = Observable<boolean> | Promise<boolean> | boolean;
9
10
  declare function rdtGetAllResultsTrue$(inputFactories: (() => RdtBooleanResult)[]): Observable<boolean>;
@@ -27,15 +28,15 @@ declare class RdtAutoFocusOnInitDirective implements AfterViewInit, OnDestroy {
27
28
  private readonly autofocusable;
28
29
  ngOnDestroy(): void;
29
30
  ngAfterViewInit(): void;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtAutoFocusOnInitDirective, never>;
31
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtAutoFocusOnInitDirective, "[rdtAutofocusOnInit]", never, {}, {}, never, never, true, never>;
31
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtAutoFocusOnInitDirective, never>;
32
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtAutoFocusOnInitDirective, "[rdtAutofocusOnInit]", never, {}, {}, never, never, true, never>;
32
33
  }
33
34
 
34
35
  declare class RdtAutofocusableDirective implements OnInit {
35
36
  readonly component: _ngrdt_core.RdtAutofocusable | null;
36
37
  ngOnInit(): void;
37
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtAutofocusableDirective, never>;
38
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtAutofocusableDirective, "[rdtAutofocusable]", never, {}, {}, never, never, true, never>;
38
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtAutofocusableDirective, never>;
39
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtAutofocusableDirective, "[rdtAutofocusable]", never, {}, {}, never, never, true, never>;
39
40
  }
40
41
 
41
42
  declare function getRdtAutofocusable(src: Iterable<RdtAutofocusableDirective>): RdtAutofocusable | null;
@@ -52,8 +53,8 @@ declare class RdtContainerDirective extends RdtChildDirective {
52
53
  getChildrenByClass<T>(childClass: Type<T>): T[];
53
54
  private _getChildrenRecursive;
54
55
  private _getChildrenByClassRecursive;
55
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtContainerDirective, never>;
56
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtContainerDirective, "[rdtContainer]", never, {}, {}, never, never, true, never>;
56
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtContainerDirective, never>;
57
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtContainerDirective, "[rdtContainer]", never, {}, {}, never, never, true, never>;
57
58
  }
58
59
 
59
60
  interface RdtIsActive {
@@ -81,8 +82,8 @@ declare class RdtComponentGuardStoreService {
81
82
  removeGuard(guard: RdtChildDirective): void;
82
83
  getGuards(): RdtChildDirective[];
83
84
  checkCanLeaveGlobal$(): rxjs.Observable<boolean>;
84
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtComponentGuardStoreService, never>;
85
- static ɵprov: i0.ɵɵInjectableDeclaration<RdtComponentGuardStoreService>;
85
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtComponentGuardStoreService, never>;
86
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<RdtComponentGuardStoreService>;
86
87
  }
87
88
 
88
89
  declare class RdtChildDirective implements OnInit, OnDestroy {
@@ -98,14 +99,14 @@ declare class RdtChildDirective implements OnInit, OnDestroy {
98
99
  onViewWillEnter(): void;
99
100
  onViewWillLeave(): void;
100
101
  getParentByClass<T extends RdtContainerDirective>(parentClass: Type<T>): T | null;
101
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtChildDirective, never>;
102
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtChildDirective, "[rdtChild]", never, {}, {}, never, never, true, never>;
102
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtChildDirective, never>;
103
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtChildDirective, "[rdtChild]", never, {}, {}, never, never, true, never>;
103
104
  }
104
105
 
105
106
  declare abstract class RdtComponentOutletDirective<TComponent, TInputs> {
106
107
  abstract readonly componentClass: Type<TComponent>;
107
108
  private readonly _viewContainerRef;
108
- readonly inputs: i0.InputSignal<Partial<TInputs>>;
109
+ readonly inputs: _angular_core.InputSignal<Partial<TInputs>>;
109
110
  get instance(): TComponent | undefined;
110
111
  get componentRef(): ComponentRef<TComponent> | undefined;
111
112
  private _componentRef?;
@@ -120,74 +121,183 @@ declare abstract class RdtComponentOutletDirective<TComponent, TInputs> {
120
121
  private onInputsChanged;
121
122
  /** @nodoc */
122
123
  private _applyInputStateDiff;
123
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtComponentOutletDirective<any, any>, never>;
124
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtComponentOutletDirective<any, any>, never, never, { "inputs": { "alias": "inputs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
124
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtComponentOutletDirective<any, any>, never>;
125
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtComponentOutletDirective<any, any>, never, never, { "inputs": { "alias": "inputs"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
125
126
  }
126
127
 
127
- type TranslateKey = 'RDT_YES' | 'RDT_NO' | 'RDT_SELECT_DEFAULT_PLACEHOLDER' | 'RDT_SELECT_LOADING' | 'RDT_SELECT_ERROR' | 'RDT_SELECT_ENTER_SEARCH' | 'RDT_SELECT_LOADING_ID' | 'RDT_SELECT_UNKNOWN_ID' | 'RDT_TABLE_NOT_FOUND_HEADER' | 'RDT_TABLE_NOT_FOUND_MESSAGE' | 'RDT_TABLE_ERROR_HEADER' | 'RDT_TABLE_ERROR_MESSAGE' | 'RDT_FILE_LABEL_EMPTY' | 'RDT_FILE_LABEL_SINGLE' | 'RDT_FILE_LABEL_FEW' | 'RDT_FILE_LABEL_MANY' | 'RDT_DATE_TOO_LATE' | 'RDT_DATE_TOO_SOON' | 'RDT_ERROR_REQUIRED' | 'RDT_ERROR_EMAIL_INVALID ' | 'RDT_ERROR_MIN_LENGTH' | 'RDT_ERROR_MAX_LENGTH' | 'RDT_ERROR_NOT_FOUND' | 'RDT_ERROR_MULTIPLE_FOUND' | 'RDT_ERROR_UNKNOWN' | 'RDT_GOV_SELECT_LOADING_VALUES' | 'RDT_GOV_SELECT_NO_VALUES_FOUND' | 'RDT_GOV_SELECT_NO_VALUES_AVAILABLE' | 'RDT_GOV_NOTIFY_SUCCESS' | 'RDT_GOV_NOTIFY_WARNING' | 'RDT_GOV_NOTIFY_ERROR';
128
- type LanguageConfig = {
129
- code: string;
130
- strategy?: FormatStrategy;
128
+ type RdtCurrencyCode = 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UYW' | 'UZS' | 'VED' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XAG' | 'XAU' | 'XBA' | 'XBB' | 'XBC' | 'XBD' | 'XCD' | 'XDR' | 'XOF' | 'XPD' | 'XPF' | 'XPT' | 'XSU' | 'XTS' | 'XUA' | 'XXX' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL';
129
+
130
+ type RdtLocaleCode = 'af-ZA' | 'am-ET' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-OM' | 'ar-QA' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'as-IN' | 'az-AZ' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'bn-IN' | 'bs-BA' | 'ca-ES' | 'cs-CZ' | 'cy-GB' | 'da-DK' | 'de-AT' | 'de-CH' | 'de-DE' | 'de-LI' | 'de-LU' | 'el-GR' | 'en-AU' | 'en-BZ' | 'en-CA' | 'en-CB' | 'en-GB' | 'en-IE' | 'en-JM' | 'en-NZ' | 'en-PH' | 'en-TT' | 'en-US' | 'en-ZA' | 'en-ZW' | 'es-AR' | 'es-BO' | 'es-CL' | 'es-CO' | 'es-CR' | 'es-DO' | 'es-EC' | 'es-ES' | 'es-GT' | 'es-HN' | 'es-MX' | 'es-NI' | 'es-PA' | 'es-PE' | 'es-PR' | 'es-PY' | 'es-SV' | 'es-US' | 'es-UY' | 'es-VE' | 'et-EE' | 'eu-ES' | 'fa-IR' | 'fi-FI' | 'fil-PH' | 'fo-FO' | 'fr-BE' | 'fr-CA' | 'fr-CH' | 'fr-EP' | 'fr-FR' | 'fr-LU' | 'fr-MC' | 'gl-ES' | 'gu-IN' | 'he-IL' | 'hi-IN' | 'hr-BA' | 'hr-HR' | 'hu-HU' | 'hy-AM' | 'id-ID' | 'ig-NG' | 'is-IS' | 'it-CH' | 'it-IT' | 'ja-JP' | 'ka-GE' | 'kk-KZ' | 'km-KH' | 'kn-IN' | 'ko-KR' | 'ky-KG' | 'lo-LA' | 'lt-LT' | 'lv-LV' | 'mi-NZ' | 'mk-MK' | 'ml-IN' | 'mn-MN' | 'mr-IN' | 'ms-BN' | 'ms-MY' | 'mt-MT' | 'nb-NO' | 'ne-NP' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'or-IN' | 'pa-IN' | 'pl-PL' | 'ps-AF' | 'pt-BR' | 'pt-PT' | 'qu-BO' | 'qu-EC' | 'qu-PE' | 'ro-RO' | 'ru-RU' | 'rw-RW' | 'sa-IN' | 'se-FI' | 'se-NO' | 'se-SE' | 'si-LK' | 'sk-SK' | 'sl-SI' | 'sq-AL' | 'sr-BA' | 'sr-RS' | 'sv-FI' | 'sv-SE' | 'sw-KE' | 'ta-IN' | 'te-IN' | 'th-TH' | 'tk-TM' | 'tn-ZA' | 'tr-TR' | 'uk-UA' | 'ur-PK' | 'uz-UZ' | 'vi-VN' | 'wo-SN' | 'xh-ZA' | 'yo-NG' | 'zh-CN' | 'zh-HK' | 'zh-MO' | 'zh-SG' | 'zh-TW' | 'zu-ZA';
131
+
132
+ declare const csRdtDictionary: {
133
+ readonly RDT_YES: "Ano";
134
+ readonly RDT_NO: "Ne";
135
+ readonly RDT_SELECT_DEFAULT_PLACEHOLDER: "Vyberte";
136
+ readonly RDT_SELECT_LOADING: "Načítání";
137
+ readonly RDT_SELECT_ERROR: "Nastala chyba";
138
+ readonly RDT_SELECT_ENTER_SEARCH: "Zadejte hledaný výraz";
139
+ readonly RDT_SELECT_LOADING_ID: "Načítání (ID = {{id}})...";
140
+ readonly RDT_SELECT_UNKNOWN_ID: "Neznámá hodnota (ID = {{id}})";
141
+ readonly RDT_TABLE_NOT_FOUND_HEADER: "Nic nenalezeno";
142
+ readonly RDT_TABLE_NOT_FOUND_MESSAGE: "Nepodařilo se dohledat žádné výsledky, zkuste prosím hledaný výraz upravit.";
143
+ readonly RDT_TABLE_ERROR_HEADER: "Při načítání dat došlo k chybě.";
144
+ readonly RDT_TABLE_ERROR_MESSAGE: "Chyba";
145
+ readonly RDT_FILE_LABEL_EMPTY: "Vyberte soubor";
146
+ readonly RDT_FILE_LABEL_SINGLE: "{{fileName}}";
147
+ readonly RDT_FILE_LABEL_FEW: "Vybrány {{count}} soubory";
148
+ readonly RDT_FILE_LABEL_MANY: "Vybráno {{count}} souborů";
149
+ readonly RDT_DATE_TOO_LATE: "Platnost od musí být dříve než platnost do.";
150
+ readonly RDT_DATE_TOO_SOON: "Platnost do musí být později než platnost od.";
151
+ readonly RDT_ERROR_REQUIRED: "Povinné pole";
152
+ readonly RDT_ERROR_EMAIL_INVALID: "Neplatný email";
153
+ readonly RDT_ERROR_MIN_LENGTH: "Minimální délka je {{requiredLength}} znaků.";
154
+ readonly RDT_ERROR_MAX_LENGTH: "Maximální délka je {{requiredLength}} znaků.";
155
+ readonly RDT_ERROR_NOT_FOUND: "Pro zadaný kód nebyla nalezena žádná položka.";
156
+ readonly RDT_ERROR_MULTIPLE_FOUND: "Pro zadaný kód bylo nalezeno více položek.";
157
+ readonly RDT_ERROR_UNKNOWN: "Neznámá chyba";
158
+ readonly RDT_GOV_SELECT_LOADING_VALUES: "Načítání hodnot..";
159
+ readonly RDT_GOV_SELECT_NO_VALUES_FOUND: "Pro zadaný výraz nejsou k dispozici žádné záznamy";
160
+ readonly RDT_GOV_SELECT_NO_VALUES_AVAILABLE: "Nejsou k dispozici žádné hodnoty";
161
+ readonly RDT_GOV_NOTIFY_SUCCESS: "Operace byla úspěšně dokončena.";
162
+ readonly RDT_GOV_NOTIFY_WARNING: "Operace proběhla s upozorněním.";
163
+ readonly RDT_GOV_NOTIFY_ERROR: "Operace se nezdařila";
164
+ readonly RDT_GOV_DATE_CALENDAR_LABEL: "Kalendář";
165
+ readonly RDT_GOV_DATE_OPEN_CALENDAR: "Otevřít kalendář";
166
+ readonly RDT_GOV_DATE_PREV_MONTH: "Předchozí měsíc";
167
+ readonly RDT_GOV_DATE_NEXT_MONTH: "Další měsíc";
168
+ readonly RDT_GOV_DATE_PREV_YEAR: "Předchozí rok";
169
+ readonly RDT_GOV_DATE_NEXT_YEAR: "Další rok";
131
170
  };
132
- type TranslateParams = Record<string, any>;
133
- type TranslateValue = string | ((params?: TranslateParams) => string);
134
- type TranslateSet = {
135
- [lang: string]: {
136
- [key: TranslateKey | string]: TranslateValue;
137
- };
171
+
172
+ declare const enUsRdtDictionary: {
173
+ readonly RDT_YES: "Yes";
174
+ readonly RDT_NO: "No";
175
+ readonly RDT_SELECT_DEFAULT_PLACEHOLDER: "Select";
176
+ readonly RDT_SELECT_LOADING: "Loading";
177
+ readonly RDT_SELECT_ERROR: "An error occurred";
178
+ readonly RDT_SELECT_ENTER_SEARCH: "Enter search term";
179
+ readonly RDT_SELECT_LOADING_ID: "Loading (ID = {{id}})...";
180
+ readonly RDT_SELECT_UNKNOWN_ID: "Unknown value (ID = {{id}})";
181
+ readonly RDT_TABLE_NOT_FOUND_HEADER: "Nothing found";
182
+ readonly RDT_TABLE_NOT_FOUND_MESSAGE: "No results could be found, please adjust your search term.";
183
+ readonly RDT_TABLE_ERROR_HEADER: "Error loading data.";
184
+ readonly RDT_TABLE_ERROR_MESSAGE: "Error";
185
+ readonly RDT_FILE_LABEL_EMPTY: "Select file";
186
+ readonly RDT_FILE_LABEL_SINGLE: "{{fileName}}";
187
+ readonly RDT_FILE_LABEL_FEW: "{{count}} files selected";
188
+ readonly RDT_FILE_LABEL_MANY: "{{count}} files selected";
189
+ readonly RDT_DATE_TOO_LATE: "Start date must be before end date.";
190
+ readonly RDT_DATE_TOO_SOON: "End date must be after start date.";
191
+ readonly RDT_ERROR_REQUIRED: "Required field";
192
+ readonly RDT_ERROR_EMAIL_INVALID: "Invalid email";
193
+ readonly RDT_ERROR_MIN_LENGTH: "Minimum length is {{requiredLength}} characters.";
194
+ readonly RDT_ERROR_MAX_LENGTH: "Maximum length is {{requiredLength}} characters.";
195
+ readonly RDT_ERROR_NOT_FOUND: "No item found for the provided code.";
196
+ readonly RDT_ERROR_MULTIPLE_FOUND: "Multiple items found for the provided code.";
197
+ readonly RDT_ERROR_UNKNOWN: "Unknown error";
198
+ readonly RDT_GOV_SELECT_LOADING_VALUES: "Loading values...";
199
+ readonly RDT_GOV_SELECT_NO_VALUES_FOUND: "No records available for the entered term";
200
+ readonly RDT_GOV_SELECT_NO_VALUES_AVAILABLE: "No values available";
201
+ readonly RDT_GOV_NOTIFY_SUCCESS: "Operation completed successfully.";
202
+ readonly RDT_GOV_NOTIFY_WARNING: "Operation completed with a warning.";
203
+ readonly RDT_GOV_NOTIFY_ERROR: "Operation failed.";
204
+ readonly RDT_GOV_DATE_CALENDAR_LABEL: "Calendar";
205
+ readonly RDT_GOV_DATE_OPEN_CALENDAR: "Open calendar";
206
+ readonly RDT_GOV_DATE_PREV_MONTH: "Previous month";
207
+ readonly RDT_GOV_DATE_NEXT_MONTH: "Next month";
208
+ readonly RDT_GOV_DATE_PREV_YEAR: "Previous year";
209
+ readonly RDT_GOV_DATE_NEXT_YEAR: "Next year";
138
210
  };
139
- declare const DEFAULT_TRANSLATE_SET: any;
140
- interface FormatStrategy {
211
+
212
+ interface RdtLocaleFormatConfig {
213
+ readonly dateFnsLocale: Locale;
214
+ readonly formatLocale: Intl.LocalesArgument;
215
+ }
216
+
217
+ interface RdtLocaleFormatInt {
218
+ readonly dateFnsLocale: Locale;
141
219
  formatDate: (date: Date) => string;
142
- formatCurrency: (value: number, currency: string) => string;
220
+ formatCurrency: (value: number, currency: RdtCurrencyCode) => string;
143
221
  formatNumber: (value: number) => string;
144
222
  }
145
- declare class CzFormatStrategy implements FormatStrategy {
223
+
224
+ declare class RdtLocaleFormat implements RdtLocaleFormatInt {
225
+ readonly dateFnsLocale: Locale;
226
+ readonly formatLocale: Intl.LocalesArgument;
227
+ constructor(config: RdtLocaleFormatConfig);
146
228
  formatDate(date: Date): string;
147
229
  formatNumber(value: number): string;
148
- formatCurrency(value: number, currency: string): string;
230
+ formatCurrency(value: number, currency: RdtCurrencyCode): string;
149
231
  }
150
- declare class EnFormatStrategy implements FormatStrategy {
151
- formatDate(date: Date): string;
152
- formatNumber(value: number): string;
153
- formatCurrency(value: number, currency: string): string;
232
+
233
+ declare const csRdtLocaleFormat: RdtLocaleFormat;
234
+
235
+ declare const enUsRdtLocaleFormat: RdtLocaleFormat;
236
+
237
+ type RdtTranslateKey = 'RDT_YES' | 'RDT_NO' | 'RDT_SELECT_DEFAULT_PLACEHOLDER' | 'RDT_SELECT_LOADING' | 'RDT_SELECT_ERROR' | 'RDT_SELECT_ENTER_SEARCH' | 'RDT_SELECT_LOADING_ID' | 'RDT_SELECT_UNKNOWN_ID' | 'RDT_TABLE_NOT_FOUND_HEADER' | 'RDT_TABLE_NOT_FOUND_MESSAGE' | 'RDT_TABLE_ERROR_HEADER' | 'RDT_TABLE_ERROR_MESSAGE' | 'RDT_FILE_LABEL_EMPTY' | 'RDT_FILE_LABEL_SINGLE' | 'RDT_FILE_LABEL_FEW' | 'RDT_FILE_LABEL_MANY' | 'RDT_DATE_TOO_LATE' | 'RDT_DATE_TOO_SOON' | 'RDT_ERROR_REQUIRED' | 'RDT_ERROR_EMAIL_INVALID' | 'RDT_ERROR_MIN_LENGTH' | 'RDT_ERROR_MAX_LENGTH' | 'RDT_ERROR_NOT_FOUND' | 'RDT_ERROR_MULTIPLE_FOUND' | 'RDT_ERROR_UNKNOWN' | 'RDT_GOV_SELECT_LOADING_VALUES' | 'RDT_GOV_SELECT_NO_VALUES_FOUND' | 'RDT_GOV_SELECT_NO_VALUES_AVAILABLE' | 'RDT_GOV_NOTIFY_SUCCESS' | 'RDT_GOV_NOTIFY_WARNING' | 'RDT_GOV_NOTIFY_ERROR' | 'RDT_GOV_DATE_CALENDAR_LABEL' | 'RDT_GOV_DATE_OPEN_CALENDAR' | 'RDT_GOV_DATE_PREV_MONTH' | 'RDT_GOV_DATE_NEXT_MONTH' | 'RDT_GOV_DATE_PREV_YEAR' | 'RDT_GOV_DATE_NEXT_YEAR';
238
+
239
+ type RdtTranslateParams = Record<string, any>;
240
+ type RdtTranslateValue = string | ((params?: RdtTranslateParams) => string);
241
+ type RdtDictionary = {
242
+ [key in RdtTranslateKey]: RdtTranslateValue;
243
+ };
244
+
245
+ interface RdtLocale {
246
+ readonly dictionary: Readonly<RdtDictionary>;
247
+ readonly format: Readonly<RdtLocaleFormatInt>;
154
248
  }
155
249
 
250
+ type RdtLocaleStore = {
251
+ [key in RdtLocaleCode]?: RdtLocale;
252
+ };
253
+
156
254
  declare class RdtFormatPipe implements PipeTransform {
157
255
  private translateService;
158
- transform(key: Date | number, currency?: string): string;
159
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtFormatPipe, never>;
160
- static ɵpipe: i0.ɵɵPipeDeclaration<RdtFormatPipe, "rdtFormat", true>;
256
+ transform(key: Date | number, currency?: RdtCurrencyCode): string;
257
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtFormatPipe, never>;
258
+ static ɵpipe: _angular_core.ɵɵPipeDeclaration<RdtFormatPipe, "rdtFormat", true>;
161
259
  }
162
260
 
163
261
  declare class RdtTranslatePipe implements PipeTransform {
164
262
  private translateService;
165
- transform(value: TranslateKey, params?: TranslateParams): string;
166
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtTranslatePipe, never>;
167
- static ɵpipe: i0.ɵɵPipeDeclaration<RdtTranslatePipe, "rdtTranslate", true>;
263
+ transform(value: RdtTranslateKey, params?: RdtTranslateParams): string;
264
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtTranslatePipe, never>;
265
+ static ɵpipe: _angular_core.ɵɵPipeDeclaration<RdtTranslatePipe, "rdtTranslate", true>;
168
266
  }
169
267
 
170
- declare const RDT_TRANSLATE_DEFAULTS_PROVIDER: InjectionToken<FormatStrategy>;
268
+ declare const RDT_DEFAULT_LOCALE_STORE: RdtLocaleStore;
269
+ declare const RDT_LOCALE_STORE_PROVIDER: InjectionToken<RdtLocaleStore>;
171
270
 
172
271
  declare class RdtTranslateService {
173
- private readonly defaultStrategy;
272
+ private readonly _localeStore;
273
+ readonly availableLocales: _angular_core.Signal<RdtLocaleCode[]>;
274
+ private readonly _localeCode;
275
+ readonly currentLocaleCode: _angular_core.Signal<RdtLocaleCode>;
276
+ readonly currentLanguage: _angular_core.Signal<string>;
277
+ readonly currentLocale: _angular_core.Signal<RdtLocale>;
278
+ readonly currentFormat: _angular_core.Signal<Readonly<_ngrdt_core.RdtLocaleFormatInt>>;
279
+ readonly currentDictionary: _angular_core.Signal<Readonly<RdtDictionary>>;
280
+ readonly currentLocaleChange$: Observable<Readonly<RdtLocale>>;
174
281
  constructor();
175
- private translateSet;
176
- private readonly language;
177
- private readonly strategy;
178
- get currentLanguage(): string;
282
+ setCurrentLocale(locale: RdtLocaleCode): void;
179
283
  formatDate(date: Date): string;
180
- formatCurrency(value: number, currency: string): string;
284
+ formatCurrency(value: number, currency: RdtCurrencyCode): string;
181
285
  formatNumber(value: number): string;
182
- instant(key: TranslateKey, params?: TranslateParams | string[]): string;
183
- getLanguage(lang: 'cs' | 'en' | string): {
184
- [key: string]: _ngrdt_core.TranslateValue;
185
- } | undefined;
186
- addLanguage(translations: TranslateSet): void;
187
- editLanguage(lang: 'cs' | 'en' | string, translations: TranslateSet): void;
188
- setLanguage(lang: LanguageConfig): void;
189
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtTranslateService, never>;
190
- static ɵprov: i0.ɵɵInjectableDeclaration<RdtTranslateService>;
286
+ /**
287
+ * Translates given key using current dictionary.
288
+ * Will trigger warnings if translation or parameters are missing.
289
+ * Will trigger effect re-evaluation when current locale changes.
290
+ * @param key RdtTranslateKey
291
+ * @param params RdtTranslateParams | string[]
292
+ * @returns Translated string.
293
+ */
294
+ instant(key: RdtTranslateKey, params?: RdtTranslateParams | string[]): string;
295
+ updateDictionary(localeCode: RdtLocaleCode, dictionary: Partial<RdtDictionary>): void;
296
+ registerLocale(code: RdtLocaleCode, locale: RdtLocale): void;
297
+ isLocaleAvailable(locale: string): locale is RdtLocaleCode;
298
+ private getNearestLocaleCode;
299
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtTranslateService, never>;
300
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<RdtTranslateService>;
191
301
  }
192
302
 
193
303
  declare const RDT_DEFAULT_DISABLED_KEY: unique symbol;
@@ -195,29 +305,29 @@ declare const RDT_DEFAULT_LOADING_KEY: unique symbol;
195
305
  declare abstract class RdtInteractiveElementComponent implements RdtAutofocusable {
196
306
  readonly elementRef: ElementRef<HTMLElement>;
197
307
  readonly destroyRef: DestroyRef;
198
- readonly disabledInput: i0.InputSignalWithTransform<boolean, unknown>;
199
- protected readonly disabledMap: i0.WritableSignal<Record<symbol, boolean>>;
200
- readonly disabled: i0.Signal<boolean>;
201
- protected readonly disabledEffect: i0.EffectRef;
202
- readonly loadingInput: i0.InputSignalWithTransform<boolean, unknown>;
203
- protected readonly loadingMap: i0.WritableSignal<Record<symbol, boolean>>;
204
- readonly loading: i0.Signal<boolean>;
308
+ readonly disabledInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
309
+ protected readonly disabledMap: _angular_core.WritableSignal<Record<symbol, boolean>>;
310
+ readonly disabled: _angular_core.Signal<boolean>;
311
+ protected readonly disabledEffect: _angular_core.EffectRef;
312
+ readonly loadingInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
313
+ protected readonly loadingMap: _angular_core.WritableSignal<Record<symbol, boolean>>;
314
+ readonly loading: _angular_core.Signal<boolean>;
205
315
  get uid(): string;
206
316
  protected _uid: string;
207
- readonly idInput: i0.InputSignalWithTransform<{}, unknown>;
208
- readonly id: i0.WritableSignal<{}>;
209
- readonly autofocusInput: i0.InputSignalWithTransform<boolean, unknown>;
210
- readonly autofocus: i0.WritableSignal<boolean>;
211
- readonly focused: i0.WritableSignal<boolean>;
317
+ readonly idInput: _angular_core.InputSignalWithTransform<{}, unknown>;
318
+ readonly id: _angular_core.WritableSignal<{}>;
319
+ readonly autofocusInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
320
+ readonly autofocus: _angular_core.WritableSignal<boolean>;
321
+ readonly focused: _angular_core.WritableSignal<boolean>;
212
322
  abstract focus(): void;
213
323
  abstract canFocus(): RdtBooleanResult;
214
- protected readonly autofocusEffect: i0.AfterRenderRef;
324
+ protected readonly autofocusEffect: _angular_core.AfterRenderRef;
215
325
  setDisabledState(isDisabled: boolean, key?: symbol): void;
216
326
  setLoadingState(isLoading: boolean, key?: symbol): void;
217
327
  onFocus(): void;
218
328
  onBlur(): void;
219
- static ɵfac: i0.ɵɵFactoryDeclaration<RdtInteractiveElementComponent, never>;
220
- static ɵdir: i0.ɵɵDirectiveDeclaration<RdtInteractiveElementComponent, never, never, { "disabledInput": { "alias": "rdtDisabled"; "required": false; "isSignal": true; }; "loadingInput": { "alias": "loading"; "required": false; "isSignal": true; }; "idInput": { "alias": "id"; "required": false; "isSignal": true; }; "autofocusInput": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
329
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<RdtInteractiveElementComponent, never>;
330
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RdtInteractiveElementComponent, never, never, { "disabledInput": { "alias": "rdtDisabled"; "required": false; "isSignal": true; }; "loadingInput": { "alias": "loading"; "required": false; "isSignal": true; }; "idInput": { "alias": "id"; "required": false; "isSignal": true; }; "autofocusInput": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
221
331
  }
222
332
 
223
333
  type RdtLinkedState<TInput> = {
@@ -229,5 +339,5 @@ type RdtCreateLinkedStateParams<TInput> = {
229
339
  };
230
340
  declare function rdtCreateLinkedState<TInput>(params: RdtCreateLinkedStateParams<TInput>): RdtLinkedState<TInput>;
231
341
 
232
- export { CzFormatStrategy, DEFAULT_TRANSLATE_SET, EnFormatStrategy, RDT_AUTOFOCUSABLE_COMPONENT, RDT_CONTAINER, RDT_DEFAULT_DISABLED_KEY, RDT_DEFAULT_LOADING_KEY, RDT_GUARDED_COMPONENT, RDT_TRANSLATE_DEFAULTS_PROVIDER, RdtAutoFocusOnInitDirective, RdtAutofocusableDirective, RdtChildDirective, RdtComponentGuardStoreService, RdtComponentOutletDirective, RdtContainerDirective, RdtFormatPipe, RdtInteractiveElementComponent, RdtTranslatePipe, RdtTranslateService, canTransition$, getRdtAutofocusable, rdtCreateLinkedState, rdtGetAllResultsTrue$, rdtGetResult$ };
233
- export type { FormatStrategy, LanguageConfig, RdtAutofocusable, RdtBooleanResult, RdtCanEnterView, RdtCanLeaveView, RdtCreateLinkedStateParams, RdtIsActive, RdtLinkedState, RdtOnViewWillEnter, RdtOnViewWillLeave, TranslateKey, TranslateParams, TranslateSet, TranslateValue };
342
+ export { RDT_AUTOFOCUSABLE_COMPONENT, RDT_CONTAINER, RDT_DEFAULT_DISABLED_KEY, RDT_DEFAULT_LOADING_KEY, RDT_DEFAULT_LOCALE_STORE, RDT_GUARDED_COMPONENT, RDT_LOCALE_STORE_PROVIDER, RdtAutoFocusOnInitDirective, RdtAutofocusableDirective, RdtChildDirective, RdtComponentGuardStoreService, RdtComponentOutletDirective, RdtContainerDirective, RdtFormatPipe, RdtInteractiveElementComponent, RdtLocaleFormat, RdtTranslatePipe, RdtTranslateService, canTransition$, csRdtDictionary, csRdtLocaleFormat, enUsRdtDictionary, enUsRdtLocaleFormat, getRdtAutofocusable, rdtCreateLinkedState, rdtGetAllResultsTrue$, rdtGetResult$ };
343
+ export type { RdtAutofocusable, RdtBooleanResult, RdtCanEnterView, RdtCanLeaveView, RdtCreateLinkedStateParams, RdtCurrencyCode, RdtDictionary, RdtIsActive, RdtLinkedState, RdtLocale, RdtLocaleCode, RdtLocaleFormatConfig, RdtLocaleFormatInt, RdtLocaleStore, RdtOnViewWillEnter, RdtOnViewWillLeave, RdtTranslateKey, RdtTranslateParams, RdtTranslateValue };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@ngrdt/core",
3
- "version": "0.0.82",
3
+ "version": "0.0.85",
4
4
  "peerDependencies": {
5
- "@angular/core": ">=18.2.0",
6
- "@angular/common": ">=18.2.0",
5
+ "@angular/core": ">=20.0.0",
6
+ "@angular/common": ">=20.0.0",
7
7
  "rxjs": ">=7.0.0",
8
- "@ngrdt/utils": "^0.0.82"
8
+ "@ngrdt/utils": "^0.0.85"
9
9
  },
10
10
  "sideEffects": false,
11
11
  "module": "fesm2022/ngrdt-core.mjs",