@acorex/core 21.0.3-next.1 → 21.0.3-next.11

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.
@@ -150,6 +150,73 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
150
150
  }]
151
151
  }] });
152
152
 
153
+ const AXAULocaleProfile = {
154
+ localeInfo: {
155
+ code: 'en-AU',
156
+ language: 'en',
157
+ region: 'AU',
158
+ timezone: 'Australia/Sydney',
159
+ },
160
+ calendar: {
161
+ system: 'gregorian',
162
+ week: {
163
+ startsOn: 1, // Monday
164
+ weekends: [0, 6], // Sunday + Saturday
165
+ },
166
+ clock: {
167
+ format24Hour: true,
168
+ },
169
+ },
170
+ formats: {
171
+ date: {
172
+ short: 'DD/MM/YY',
173
+ medium: 'DD/MM/YYYY',
174
+ long: 'DD MMMM YYYY',
175
+ full: 'dddd, DD MMMM YYYY',
176
+ },
177
+ time: {
178
+ short: 'HH:mm',
179
+ medium: 'HH:mm:ss',
180
+ long: 'HH:mm:ss Z',
181
+ full: 'HH:mm:ss ZZZZ',
182
+ },
183
+ datetime: {
184
+ short: 'DD/MM/YY HH:mm',
185
+ medium: 'DD/MM/YYYY HH:mm:ss',
186
+ long: 'DD MMMM YYYY HH:mm:ss Z',
187
+ full: 'dddd, DD MMMM YYYY HH:mm:ss ZZZZ',
188
+ },
189
+ numbers: {
190
+ decimalPattern: '1,000.00',
191
+ currency: {
192
+ code: 'AUD',
193
+ },
194
+ },
195
+ contacts: {
196
+ phone: '04XX XXX XXX',
197
+ postalCode: '0000',
198
+ },
199
+ },
200
+ units: {
201
+ temperature: 'celsius',
202
+ distance: 'kilometers',
203
+ weight: 'kilograms',
204
+ volume: 'liters',
205
+ speed: 'kmh',
206
+ area: 'square-meters',
207
+ },
208
+ i18nMeta: {
209
+ rtl: false,
210
+ fallbackLocales: ['en-US'],
211
+ supportedLanguages: ['en-AU'],
212
+ },
213
+ };
214
+
215
+ var enAU_profile = /*#__PURE__*/Object.freeze({
216
+ __proto__: null,
217
+ AXAULocaleProfile: AXAULocaleProfile
218
+ });
219
+
153
220
  const AXUSLocaleProfile = {
154
221
  localeInfo: {
155
222
  code: 'en-US',
@@ -217,6 +284,78 @@ var enUS_profile = /*#__PURE__*/Object.freeze({
217
284
  AXUSLocaleProfile: AXUSLocaleProfile
218
285
  });
219
286
 
287
+ const AXIRLocaleProfile = {
288
+ localeInfo: {
289
+ code: 'fa-IR',
290
+ language: 'fa',
291
+ region: 'IR',
292
+ timezone: 'Asia/Tehran',
293
+ },
294
+ calendar: {
295
+ system: 'solar-hijri',
296
+ week: {
297
+ startsOn: 6, // Saturday
298
+ weekends: [5], // Friday
299
+ },
300
+ clock: {
301
+ format24Hour: true,
302
+ },
303
+ },
304
+ formats: {
305
+ date: {
306
+ short: 'YY/MM/DD',
307
+ medium: 'YYYY/MM/DD',
308
+ long: 'dddd، D MMMM YYYY',
309
+ full: 'dddd، D MMMM YYYY',
310
+ },
311
+ time: {
312
+ short: 'HH:mm',
313
+ medium: 'HH:mm:ss',
314
+ long: 'HH:mm:ss Z',
315
+ full: 'HH:mm:ss ZZZZ',
316
+ },
317
+ datetime: {
318
+ short: 'YY/MM/DD HH:mm',
319
+ medium: 'YYYY/MM/DD HH:mm:ss',
320
+ long: 'dddd، D MMMM YYYY HH:mm:ss Z',
321
+ full: 'dddd، D MMMM YYYY HH:mm:ss ZZZZ',
322
+ },
323
+ numbers: {
324
+ decimalPattern: '1٬000٫00',
325
+ currency: {
326
+ code: 'IRR',
327
+ },
328
+ },
329
+ contacts: {
330
+ phone: '09XX XXX XXXX',
331
+ postalCode: 'XXXXX-XXXXX',
332
+ },
333
+ },
334
+ units: {
335
+ temperature: 'celsius',
336
+ distance: 'kilometers',
337
+ weight: 'kilograms',
338
+ volume: 'liters',
339
+ speed: 'kmh',
340
+ area: 'square-meters',
341
+ },
342
+ i18nMeta: {
343
+ rtl: true,
344
+ fallbackLocales: ['en-US'],
345
+ supportedLanguages: ['fa-IR', 'en-US'],
346
+ },
347
+ };
348
+
349
+ var faIR_profile = /*#__PURE__*/Object.freeze({
350
+ __proto__: null,
351
+ AXIRLocaleProfile: AXIRLocaleProfile
352
+ });
353
+
354
+ const BUILTIN_LOCALE_PROFILES = {
355
+ 'en-US': AXUSLocaleProfile,
356
+ 'en-AU': AXAULocaleProfile,
357
+ 'fa-IR': AXIRLocaleProfile,
358
+ };
220
359
  class AXLocaleService {
221
360
  /**
222
361
  * Loads and activates a locale profile by its code (e.g., 'en-US', 'fa-IR').
@@ -257,8 +396,17 @@ class AXLocaleService {
257
396
  this.isRtl = computed(() => !!this._activeProfile()?.i18nMeta?.rtl, ...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
258
397
  this.profileChanged$ = toObservable(this._activeProfile);
259
398
  this.originalProfile = cloneDeep(AXUSLocaleProfile);
399
+ const defaultCode = this.config.default;
400
+ const builtinProfile = BUILTIN_LOCALE_PROFILES[defaultCode];
401
+ if (builtinProfile) {
402
+ this.originalProfile = cloneDeep(builtinProfile);
403
+ this._activeProfile.set(cloneDeep(builtinProfile));
404
+ this.applyDocumentDirection(builtinProfile);
405
+ void this.provider.getByLocale(defaultCode);
406
+ return;
407
+ }
260
408
  this.applyDocumentDirection(this._activeProfile());
261
- this.setProfile(this.config.default);
409
+ void this.setProfile(defaultCode);
262
410
  }
263
411
  apply(arg1, arg2) {
264
412
  const current = this.activeProfile();
@@ -302,140 +450,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
302
450
  }]
303
451
  }], ctorParameters: () => [] });
304
452
 
305
- const AXIRLocaleProfile = {
306
- localeInfo: {
307
- code: 'fa-IR',
308
- language: 'fa',
309
- region: 'IR',
310
- timezone: 'Asia/Tehran',
311
- },
312
- calendar: {
313
- system: 'solar-hijri',
314
- week: {
315
- startsOn: 6, // Saturday
316
- weekends: [5], // Friday
317
- },
318
- clock: {
319
- format24Hour: true,
320
- },
321
- },
322
- formats: {
323
- date: {
324
- short: 'YY/MM/DD',
325
- medium: 'YYYY/MM/DD',
326
- long: 'dddd، D MMMM YYYY',
327
- full: 'dddd، D MMMM YYYY',
328
- },
329
- time: {
330
- short: 'HH:mm',
331
- medium: 'HH:mm:ss',
332
- long: 'HH:mm:ss Z',
333
- full: 'HH:mm:ss ZZZZ',
334
- },
335
- datetime: {
336
- short: 'YY/MM/DD HH:mm',
337
- medium: 'YYYY/MM/DD HH:mm:ss',
338
- long: 'dddd، D MMMM YYYY HH:mm:ss Z',
339
- full: 'dddd، D MMMM YYYY HH:mm:ss ZZZZ',
340
- },
341
- numbers: {
342
- decimalPattern: '1٬000٫00',
343
- currency: {
344
- code: 'IRR',
345
- },
346
- },
347
- contacts: {
348
- phone: '09XX XXX XXXX',
349
- postalCode: 'XXXXX-XXXXX',
350
- },
351
- },
352
- units: {
353
- temperature: 'celsius',
354
- distance: 'kilometers',
355
- weight: 'kilograms',
356
- volume: 'liters',
357
- speed: 'kmh',
358
- area: 'square-meters',
359
- },
360
- i18nMeta: {
361
- rtl: true,
362
- fallbackLocales: ['en-US'],
363
- supportedLanguages: ['fa-IR', 'en-US'],
364
- },
365
- };
366
-
367
- var faIR_profile = /*#__PURE__*/Object.freeze({
368
- __proto__: null,
369
- AXIRLocaleProfile: AXIRLocaleProfile
370
- });
371
-
372
- const AXAULocaleProfile = {
373
- localeInfo: {
374
- code: 'en-AU',
375
- language: 'en',
376
- region: 'AU',
377
- timezone: 'Australia/Sydney',
378
- },
379
- calendar: {
380
- system: 'gregorian',
381
- week: {
382
- startsOn: 1, // Monday
383
- weekends: [0, 6], // Sunday + Saturday
384
- },
385
- clock: {
386
- format24Hour: true,
387
- },
388
- },
389
- formats: {
390
- date: {
391
- short: 'DD/MM/YY',
392
- medium: 'DD/MM/YYYY',
393
- long: 'DD MMMM YYYY',
394
- full: 'dddd, DD MMMM YYYY',
395
- },
396
- time: {
397
- short: 'HH:mm',
398
- medium: 'HH:mm:ss',
399
- long: 'HH:mm:ss Z',
400
- full: 'HH:mm:ss ZZZZ',
401
- },
402
- datetime: {
403
- short: 'DD/MM/YY HH:mm',
404
- medium: 'DD/MM/YYYY HH:mm:ss',
405
- long: 'DD MMMM YYYY HH:mm:ss Z',
406
- full: 'dddd, DD MMMM YYYY HH:mm:ss ZZZZ',
407
- },
408
- numbers: {
409
- decimalPattern: '1,000.00',
410
- currency: {
411
- code: 'AUD',
412
- },
413
- },
414
- contacts: {
415
- phone: '04XX XXX XXX',
416
- postalCode: '0000',
417
- },
418
- },
419
- units: {
420
- temperature: 'celsius',
421
- distance: 'kilometers',
422
- weight: 'kilograms',
423
- volume: 'liters',
424
- speed: 'kmh',
425
- area: 'square-meters',
426
- },
427
- i18nMeta: {
428
- rtl: false,
429
- fallbackLocales: ['en-US'],
430
- supportedLanguages: ['en-AU'],
431
- },
432
- };
433
-
434
- var enAU_profile = /*#__PURE__*/Object.freeze({
435
- __proto__: null,
436
- AXAULocaleProfile: AXAULocaleProfile
437
- });
438
-
439
453
  /**
440
454
  * Generated bundle index. Do not edit.
441
455
  */
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-locale.mjs","sources":["../../../../packages/core/locale/src/lib/formatters/currency.formatter.ts","../../../../packages/core/locale/src/lib/locale-profile-provider.service.ts","../../../../packages/core/locale/src/lib/locale.config.ts","../../../../packages/core/locale/src/lib/locale.module.ts","../../../../packages/core/locale/src/lib/profiles/en-US.profile.ts","../../../../packages/core/locale/src/lib/locale.service.ts","../../../../packages/core/locale/src/lib/profiles/fa-IR.profile.ts","../../../../packages/core/locale/src/lib/profiles/en-AU.profile.ts","../../../../packages/core/locale/src/acorex-core-locale.ts"],"sourcesContent":["import { AXFormatOptions } from '@acorex/core/format';\n\nexport interface AXCurrencyFormatterOptions extends AXFormatOptions {\n locale?: string;\n currency?: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n currency: AXCurrencyFormatterOptions;\n }\n}\n\n// @Injectable()\n// export class AXCurrencyFormatter implements AXFormatter {\n\n// get name(): string {\n// return 'currency';\n// }\n\n// format(value: number, options: AXCurrencyFormatterOptions): string {\n// return value.toLocaleString(options.locale, { style: 'currency', currency: options.currency });\n// }\n// }\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { AXLocaleProfile } from './locale.types';\n\n// Record of locale code → loader function (returns profile or Promise<profile>)\nexport type AXLocaleProfileProviderResult = Record<string, () => Promise<AXLocaleProfile> | AXLocaleProfile>;\n\nexport interface AXLocaleProfileProvider {\n provide(): Promise<AXLocaleProfileProviderResult>;\n}\n\nexport const AX_LOCALE_PROFILE_PROVIDERS = new InjectionToken<AXLocaleProfileProvider[]>(\n 'AX_LOCALE_PROFILE_PROVIDERS',\n {\n providedIn: 'root',\n factory: () => [new AXLocaleProfileProviderDefault()],\n },\n);\n\n// ✅ Lazy-loaded default provider\nexport class AXLocaleProfileProviderDefault implements AXLocaleProfileProvider {\n async provide(): Promise<AXLocaleProfileProviderResult> {\n return {\n 'en-AU': () => import('./profiles/en-AU.profile').then((m) => m.AXAULocaleProfile),\n 'en-US': () => import('./profiles/en-US.profile').then((m) => m.AXUSLocaleProfile),\n 'fa-IR': () => import('./profiles/fa-IR.profile').then((m) => m.AXIRLocaleProfile),\n };\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXLocaleProfileProviderService {\n private providers: AXLocaleProfileProvider[] = inject(AX_LOCALE_PROFILE_PROVIDERS);\n\n private registry = new Map<string, () => Promise<AXLocaleProfile>>();\n private resolvedCache = new Map<string, AXLocaleProfile>();\n private isInitialized = false;\n\n private async init(): Promise<void> {\n if (this.isInitialized) return;\n\n for (const provider of this.providers) {\n const result: AXLocaleProfileProviderResult = await provider.provide();\n\n for (const [localeCode, loaderFn] of Object.entries(result)) {\n if (typeof loaderFn === 'function') {\n this.registry.set(localeCode, async () => {\n const profile = await loaderFn();\n return profile;\n });\n } else {\n console.warn(`[AXLocaleService] Profile for \"${localeCode}\" is not a function. Skipped.`);\n }\n }\n }\n\n this.isInitialized = true;\n }\n\n /**\n * Returns all available locale profiles by loading each registered provider.\n *\n * @returns Promise<AXLocaleProfile[]>\n */\n\n public async getList(): Promise<AXLocaleProfile[]> {\n await this.init();\n\n const profiles: AXLocaleProfile[] = [];\n\n for (const localeCode of this.registry.keys()) {\n const profile = await this.getByLocale(localeCode);\n if (profile) profiles.push(profile);\n }\n\n return profiles;\n }\n\n /**\n * Loads or returns from cache the locale profile associated with the given code.\n *\n * @param localeCode - The locale code to resolve.\n * @returns Promise<AXLocaleProfile | undefined>\n */\n\n public async getByLocale(localeCode: string): Promise<AXLocaleProfile | undefined> {\n await this.init();\n\n // If already loaded, return from cache\n if (this.resolvedCache.has(localeCode)) {\n return this.resolvedCache.get(localeCode);\n }\n\n // Otherwise, try to load it\n const loader = this.registry.get(localeCode);\n if (!loader) {\n console.warn(`[AXLocaleService] No profile loader found for locale: \"${localeCode}\"`);\n return undefined;\n }\n\n const profile = await loader();\n this.resolvedCache.set(localeCode, profile);\n return profile;\n }\n\n /**\n * Clears caches and reloads all providers.\n *\n * @returns Promise<void>\n */\n\n public async reload(): Promise<void> {\n this.registry.clear();\n this.resolvedCache.clear();\n this.isInitialized = false;\n await this.init();\n }\n\n /**\n * Indicates whether a loader has been registered for the given locale code.\n *\n * @param localeCode - The locale code to check.\n * @returns boolean - True if a loader exists.\n */\n\n public has(localeCode: string): boolean {\n return this.registry.has(localeCode);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface AXLocaleConfig {\n default: string;\n}\n\nexport const AX_LOCALE_CONFIG = new InjectionToken<AXLocaleConfig>('AX_LOCALE_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return {\n default: 'en-US',\n };\n },\n});\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\n\n@NgModule({\n imports: [\n AXFormatModule.forChild({\n formatters: [],\n }),\n ],\n})\nexport class AXLocaleModule {}\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXUSLocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'en-US',\n language: 'en',\n region: 'US',\n timezone: 'America/New_York',\n },\n calendar: {\n system: 'gregorian',\n week: {\n startsOn: 0, // Sunday\n weekends: [0, 6], // Sunday + Saturday\n },\n clock: {\n format24Hour: false,\n },\n },\n formats: {\n date: {\n short: 'MM/DD/YY',\n medium: 'MM/DD/YYYY',\n long: 'MMMM DD, YYYY',\n full: 'dddd, MMMM DD, YYYY',\n },\n time: {\n short: 'hh:mm A',\n medium: 'hh:mm:ss A',\n long: 'hh:mm:ss A Z',\n full: 'hh:mm:ss A ZZZZ',\n },\n datetime: {\n short: 'MM/DD/YY hh:mm A',\n medium: 'MM/DD/YYYY hh:mm:ss A',\n long: 'MMMM DD, YYYY hh:mm:ss A Z',\n full: 'dddd, MMMM DD, YYYY hh:mm:ss A ZZZZ',\n },\n numbers: {\n decimalPattern: '1,000.00',\n currency: {\n code: 'USD',\n },\n },\n contacts: {\n phone: '(000) 000-0000',\n postalCode: '00000',\n },\n },\n units: {\n temperature: 'fahrenheit',\n distance: 'miles',\n weight: 'pounds',\n volume: 'gallons',\n speed: 'mph',\n area: 'square-feet',\n },\n i18nMeta: {\n rtl: false,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['en-US'],\n },\n};\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { computed, Injectable, inject, PLATFORM_ID, signal } from '@angular/core';\nimport { AXLocaleProfileProviderService } from './locale-profile-provider.service';\nimport { AXLocaleProfile } from './locale.types';\n\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cloneDeep, merge, set } from 'lodash-es';\nimport { AX_LOCALE_CONFIG } from './locale.config';\nimport { AXUSLocaleProfile } from './profiles/en-US.profile';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXLocaleService {\n private provider = inject(AXLocaleProfileProviderService);\n private config = inject(AX_LOCALE_CONFIG);\n private document = inject(DOCUMENT);\n private platformId = inject(PLATFORM_ID);\n\n private _activeProfile = signal<AXLocaleProfile>(AXUSLocaleProfile);\n public activeProfile = this._activeProfile.asReadonly();\n\n /** Whether the active locale uses right-to-left layout. */\n public readonly isRtl = computed(() => !!this._activeProfile()?.i18nMeta?.rtl);\n\n public profileChanged$ = toObservable(this._activeProfile);\n\n private originalProfile: AXLocaleProfile = cloneDeep(AXUSLocaleProfile);\n\n /**\n * Loads and activates a locale profile by its code (e.g., 'en-US', 'fa-IR').\n *\n * @param localeCode - Locale identifier to load.\n * @returns Promise<void> - Resolves when the profile is loaded and activated.\n */\n\n public async setProfile(localeCode: string): Promise<void> {\n const profile = await this.provider.getByLocale(localeCode);\n if (profile) {\n this.originalProfile = cloneDeep(profile);\n this._activeProfile.set(cloneDeep(profile));\n this.applyDocumentDirection(profile);\n } else {\n console.warn(`[AXLocaleService] Locale not found: ${localeCode}`);\n }\n }\n\n private applyDocumentDirection(profile: AXLocaleProfile): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const isRtl = !!profile.i18nMeta?.rtl;\n this.document.documentElement.setAttribute('dir', isRtl ? 'rtl' : 'ltr');\n this.document.documentElement.setAttribute('lang', profile.localeInfo.language);\n }\n\n /**\n *\n */\n constructor() {\n this.applyDocumentDirection(this._activeProfile());\n this.setProfile(this.config.default);\n }\n\n /**\n * Applies overrides to the active profile using a deep-merge object.\n *\n * @param profile - Partial profile object whose properties override the active profile.\n * @returns void\n */\n\n public apply(profile: Partial<AXLocaleProfile>): void;\n\n /**\n * Applies a single value override at the given path (dot notation).\n *\n * @param path - Dot-notated path (e.g., 'formats.date.short').\n * @param value - The value to set at the path.\n * @returns void\n */\n\n public apply(path: string, value: any): void;\n\n public apply(arg1: any, arg2?: any): void {\n const current = this.activeProfile();\n if (!current) {\n console.warn('[AXLocaleService] No active profile found');\n return;\n }\n\n const updated = cloneDeep(current);\n\n if (typeof arg1 === 'string' && arg2 !== undefined) {\n // Overload: updateProfile('formats.date.full', 'YYYY-MM-DD')\n set(updated, arg1, arg2);\n } else if (typeof arg1 === 'object') {\n // Overload: updateProfile({ formats: { date: { short: '...' } } })\n merge(updated, arg1);\n } else {\n console.warn('[AXLocaleService] Invalid arguments passed to updateProfile()');\n return;\n }\n }\n\n /**\n * Resets the active profile to its original loaded state (clears overrides).\n *\n * @returns void\n */\n\n public reset(): void {\n if (this.originalProfile) {\n const profile = cloneDeep(this.originalProfile);\n this._activeProfile.set(profile);\n this.applyDocumentDirection(profile);\n }\n }\n}\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXIRLocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'fa-IR',\n language: 'fa',\n region: 'IR',\n timezone: 'Asia/Tehran',\n },\n calendar: {\n system: 'solar-hijri',\n week: {\n startsOn: 6, // Saturday\n weekends: [5], // Friday\n },\n clock: {\n format24Hour: true,\n },\n },\n formats: {\n date: {\n short: 'YY/MM/DD',\n medium: 'YYYY/MM/DD',\n long: 'dddd، D MMMM YYYY',\n full: 'dddd، D MMMM YYYY',\n },\n time: {\n short: 'HH:mm',\n medium: 'HH:mm:ss',\n long: 'HH:mm:ss Z',\n full: 'HH:mm:ss ZZZZ',\n },\n datetime: {\n short: 'YY/MM/DD HH:mm',\n medium: 'YYYY/MM/DD HH:mm:ss',\n long: 'dddd، D MMMM YYYY HH:mm:ss Z',\n full: 'dddd، D MMMM YYYY HH:mm:ss ZZZZ',\n },\n numbers: {\n decimalPattern: '1٬000٫00',\n currency: {\n code: 'IRR',\n },\n },\n contacts: {\n phone: '09XX XXX XXXX',\n postalCode: 'XXXXX-XXXXX',\n },\n },\n units: {\n temperature: 'celsius',\n distance: 'kilometers',\n weight: 'kilograms',\n volume: 'liters',\n speed: 'kmh',\n area: 'square-meters',\n },\n i18nMeta: {\n rtl: true,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['fa-IR', 'en-US'],\n },\n};\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXAULocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'en-AU',\n language: 'en',\n region: 'AU',\n timezone: 'Australia/Sydney',\n },\n calendar: {\n system: 'gregorian',\n week: {\n startsOn: 1, // Monday\n weekends: [0, 6], // Sunday + Saturday\n },\n clock: {\n format24Hour: true,\n },\n },\n formats: {\n date: {\n short: 'DD/MM/YY',\n medium: 'DD/MM/YYYY',\n long: 'DD MMMM YYYY',\n full: 'dddd, DD MMMM YYYY',\n },\n time: {\n short: 'HH:mm',\n medium: 'HH:mm:ss',\n long: 'HH:mm:ss Z',\n full: 'HH:mm:ss ZZZZ',\n },\n datetime: {\n short: 'DD/MM/YY HH:mm',\n medium: 'DD/MM/YYYY HH:mm:ss',\n long: 'DD MMMM YYYY HH:mm:ss Z',\n full: 'dddd, DD MMMM YYYY HH:mm:ss ZZZZ',\n },\n numbers: {\n decimalPattern: '1,000.00',\n currency: {\n code: 'AUD',\n },\n },\n contacts: {\n phone: '04XX XXX XXX',\n postalCode: '0000',\n },\n },\n\n units: {\n temperature: 'celsius',\n distance: 'kilometers',\n weight: 'kilograms',\n volume: 'liters',\n speed: 'kmh',\n area: 'square-meters',\n },\n\n i18nMeta: {\n rtl: false,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['en-AU'],\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;MCba,2BAA2B,GAAG,IAAI,cAAc,CAC3D,6BAA6B,EAC7B;AACE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAM,CAAC,IAAI,8BAA8B,EAAE,CAAC;AACtD,CAAA;AAGH;MACa,8BAA8B,CAAA;AACzC,IAAA,MAAM,OAAO,GAAA;QACX,OAAO;AACL,YAAA,OAAO,EAAE,MAAM,4DAAkC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AAClF,YAAA,OAAO,EAAE,MAAM,4DAAkC,CAAC,IAAI,CA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K;AACZ,QAAA,IAAI,EAAE,eAAe;AACtB,KAAA;AAED,IAAA,QAAQ,EAAE;AACR,QAAA,GAAG,EAAE,KAAK;QACV,eAAe,EAAE,CAAC,OAAO,CAAC;QAC1B,kBAAkB,EAAE,CAAC,OAAO,CAAC;AAC9B,KAAA;;;;;;;;AC/DH;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-locale.mjs","sources":["../../../../packages/core/locale/src/lib/formatters/currency.formatter.ts","../../../../packages/core/locale/src/lib/locale-profile-provider.service.ts","../../../../packages/core/locale/src/lib/locale.config.ts","../../../../packages/core/locale/src/lib/locale.module.ts","../../../../packages/core/locale/src/lib/profiles/en-AU.profile.ts","../../../../packages/core/locale/src/lib/profiles/en-US.profile.ts","../../../../packages/core/locale/src/lib/profiles/fa-IR.profile.ts","../../../../packages/core/locale/src/lib/locale.service.ts","../../../../packages/core/locale/src/acorex-core-locale.ts"],"sourcesContent":["import { AXFormatOptions } from '@acorex/core/format';\n\nexport interface AXCurrencyFormatterOptions extends AXFormatOptions {\n locale?: string;\n currency?: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n currency: AXCurrencyFormatterOptions;\n }\n}\n\n// @Injectable()\n// export class AXCurrencyFormatter implements AXFormatter {\n\n// get name(): string {\n// return 'currency';\n// }\n\n// format(value: number, options: AXCurrencyFormatterOptions): string {\n// return value.toLocaleString(options.locale, { style: 'currency', currency: options.currency });\n// }\n// }\n","import { inject, Injectable, InjectionToken } from '@angular/core';\nimport { AXLocaleProfile } from './locale.types';\n\n// Record of locale code → loader function (returns profile or Promise<profile>)\nexport type AXLocaleProfileProviderResult = Record<string, () => Promise<AXLocaleProfile> | AXLocaleProfile>;\n\nexport interface AXLocaleProfileProvider {\n provide(): Promise<AXLocaleProfileProviderResult>;\n}\n\nexport const AX_LOCALE_PROFILE_PROVIDERS = new InjectionToken<AXLocaleProfileProvider[]>(\n 'AX_LOCALE_PROFILE_PROVIDERS',\n {\n providedIn: 'root',\n factory: () => [new AXLocaleProfileProviderDefault()],\n },\n);\n\n// ✅ Lazy-loaded default provider\nexport class AXLocaleProfileProviderDefault implements AXLocaleProfileProvider {\n async provide(): Promise<AXLocaleProfileProviderResult> {\n return {\n 'en-AU': () => import('./profiles/en-AU.profile').then((m) => m.AXAULocaleProfile),\n 'en-US': () => import('./profiles/en-US.profile').then((m) => m.AXUSLocaleProfile),\n 'fa-IR': () => import('./profiles/fa-IR.profile').then((m) => m.AXIRLocaleProfile),\n };\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXLocaleProfileProviderService {\n private providers: AXLocaleProfileProvider[] = inject(AX_LOCALE_PROFILE_PROVIDERS);\n\n private registry = new Map<string, () => Promise<AXLocaleProfile>>();\n private resolvedCache = new Map<string, AXLocaleProfile>();\n private isInitialized = false;\n\n private async init(): Promise<void> {\n if (this.isInitialized) return;\n\n for (const provider of this.providers) {\n const result: AXLocaleProfileProviderResult = await provider.provide();\n\n for (const [localeCode, loaderFn] of Object.entries(result)) {\n if (typeof loaderFn === 'function') {\n this.registry.set(localeCode, async () => {\n const profile = await loaderFn();\n return profile;\n });\n } else {\n console.warn(`[AXLocaleService] Profile for \"${localeCode}\" is not a function. Skipped.`);\n }\n }\n }\n\n this.isInitialized = true;\n }\n\n /**\n * Returns all available locale profiles by loading each registered provider.\n *\n * @returns Promise<AXLocaleProfile[]>\n */\n\n public async getList(): Promise<AXLocaleProfile[]> {\n await this.init();\n\n const profiles: AXLocaleProfile[] = [];\n\n for (const localeCode of this.registry.keys()) {\n const profile = await this.getByLocale(localeCode);\n if (profile) profiles.push(profile);\n }\n\n return profiles;\n }\n\n /**\n * Loads or returns from cache the locale profile associated with the given code.\n *\n * @param localeCode - The locale code to resolve.\n * @returns Promise<AXLocaleProfile | undefined>\n */\n\n public async getByLocale(localeCode: string): Promise<AXLocaleProfile | undefined> {\n await this.init();\n\n // If already loaded, return from cache\n if (this.resolvedCache.has(localeCode)) {\n return this.resolvedCache.get(localeCode);\n }\n\n // Otherwise, try to load it\n const loader = this.registry.get(localeCode);\n if (!loader) {\n console.warn(`[AXLocaleService] No profile loader found for locale: \"${localeCode}\"`);\n return undefined;\n }\n\n const profile = await loader();\n this.resolvedCache.set(localeCode, profile);\n return profile;\n }\n\n /**\n * Clears caches and reloads all providers.\n *\n * @returns Promise<void>\n */\n\n public async reload(): Promise<void> {\n this.registry.clear();\n this.resolvedCache.clear();\n this.isInitialized = false;\n await this.init();\n }\n\n /**\n * Indicates whether a loader has been registered for the given locale code.\n *\n * @param localeCode - The locale code to check.\n * @returns boolean - True if a loader exists.\n */\n\n public has(localeCode: string): boolean {\n return this.registry.has(localeCode);\n }\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface AXLocaleConfig {\n default: string;\n}\n\nexport const AX_LOCALE_CONFIG = new InjectionToken<AXLocaleConfig>('AX_LOCALE_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return {\n default: 'en-US',\n };\n },\n});\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\n\n@NgModule({\n imports: [\n AXFormatModule.forChild({\n formatters: [],\n }),\n ],\n})\nexport class AXLocaleModule {}\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXAULocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'en-AU',\n language: 'en',\n region: 'AU',\n timezone: 'Australia/Sydney',\n },\n calendar: {\n system: 'gregorian',\n week: {\n startsOn: 1, // Monday\n weekends: [0, 6], // Sunday + Saturday\n },\n clock: {\n format24Hour: true,\n },\n },\n formats: {\n date: {\n short: 'DD/MM/YY',\n medium: 'DD/MM/YYYY',\n long: 'DD MMMM YYYY',\n full: 'dddd, DD MMMM YYYY',\n },\n time: {\n short: 'HH:mm',\n medium: 'HH:mm:ss',\n long: 'HH:mm:ss Z',\n full: 'HH:mm:ss ZZZZ',\n },\n datetime: {\n short: 'DD/MM/YY HH:mm',\n medium: 'DD/MM/YYYY HH:mm:ss',\n long: 'DD MMMM YYYY HH:mm:ss Z',\n full: 'dddd, DD MMMM YYYY HH:mm:ss ZZZZ',\n },\n numbers: {\n decimalPattern: '1,000.00',\n currency: {\n code: 'AUD',\n },\n },\n contacts: {\n phone: '04XX XXX XXX',\n postalCode: '0000',\n },\n },\n\n units: {\n temperature: 'celsius',\n distance: 'kilometers',\n weight: 'kilograms',\n volume: 'liters',\n speed: 'kmh',\n area: 'square-meters',\n },\n\n i18nMeta: {\n rtl: false,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['en-AU'],\n },\n};\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXUSLocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'en-US',\n language: 'en',\n region: 'US',\n timezone: 'America/New_York',\n },\n calendar: {\n system: 'gregorian',\n week: {\n startsOn: 0, // Sunday\n weekends: [0, 6], // Sunday + Saturday\n },\n clock: {\n format24Hour: false,\n },\n },\n formats: {\n date: {\n short: 'MM/DD/YY',\n medium: 'MM/DD/YYYY',\n long: 'MMMM DD, YYYY',\n full: 'dddd, MMMM DD, YYYY',\n },\n time: {\n short: 'hh:mm A',\n medium: 'hh:mm:ss A',\n long: 'hh:mm:ss A Z',\n full: 'hh:mm:ss A ZZZZ',\n },\n datetime: {\n short: 'MM/DD/YY hh:mm A',\n medium: 'MM/DD/YYYY hh:mm:ss A',\n long: 'MMMM DD, YYYY hh:mm:ss A Z',\n full: 'dddd, MMMM DD, YYYY hh:mm:ss A ZZZZ',\n },\n numbers: {\n decimalPattern: '1,000.00',\n currency: {\n code: 'USD',\n },\n },\n contacts: {\n phone: '(000) 000-0000',\n postalCode: '00000',\n },\n },\n units: {\n temperature: 'fahrenheit',\n distance: 'miles',\n weight: 'pounds',\n volume: 'gallons',\n speed: 'mph',\n area: 'square-feet',\n },\n i18nMeta: {\n rtl: false,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['en-US'],\n },\n};\n","import { AXLocaleProfile } from '../locale.types';\n\nexport const AXIRLocaleProfile: AXLocaleProfile = {\n localeInfo: {\n code: 'fa-IR',\n language: 'fa',\n region: 'IR',\n timezone: 'Asia/Tehran',\n },\n calendar: {\n system: 'solar-hijri',\n week: {\n startsOn: 6, // Saturday\n weekends: [5], // Friday\n },\n clock: {\n format24Hour: true,\n },\n },\n formats: {\n date: {\n short: 'YY/MM/DD',\n medium: 'YYYY/MM/DD',\n long: 'dddd، D MMMM YYYY',\n full: 'dddd، D MMMM YYYY',\n },\n time: {\n short: 'HH:mm',\n medium: 'HH:mm:ss',\n long: 'HH:mm:ss Z',\n full: 'HH:mm:ss ZZZZ',\n },\n datetime: {\n short: 'YY/MM/DD HH:mm',\n medium: 'YYYY/MM/DD HH:mm:ss',\n long: 'dddd، D MMMM YYYY HH:mm:ss Z',\n full: 'dddd، D MMMM YYYY HH:mm:ss ZZZZ',\n },\n numbers: {\n decimalPattern: '1٬000٫00',\n currency: {\n code: 'IRR',\n },\n },\n contacts: {\n phone: '09XX XXX XXXX',\n postalCode: 'XXXXX-XXXXX',\n },\n },\n units: {\n temperature: 'celsius',\n distance: 'kilometers',\n weight: 'kilograms',\n volume: 'liters',\n speed: 'kmh',\n area: 'square-meters',\n },\n i18nMeta: {\n rtl: true,\n fallbackLocales: ['en-US'],\n supportedLanguages: ['fa-IR', 'en-US'],\n },\n};\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { computed, Injectable, inject, PLATFORM_ID, signal } from '@angular/core';\nimport { AXLocaleProfileProviderService } from './locale-profile-provider.service';\nimport { AXLocaleProfile } from './locale.types';\n\nimport { toObservable } from '@angular/core/rxjs-interop';\nimport { cloneDeep, merge, set } from 'lodash-es';\nimport { AX_LOCALE_CONFIG } from './locale.config';\nimport { AXAULocaleProfile } from './profiles/en-AU.profile';\nimport { AXUSLocaleProfile } from './profiles/en-US.profile';\nimport { AXIRLocaleProfile } from './profiles/fa-IR.profile';\n\nconst BUILTIN_LOCALE_PROFILES: Record<string, AXLocaleProfile> = {\n 'en-US': AXUSLocaleProfile,\n 'en-AU': AXAULocaleProfile,\n 'fa-IR': AXIRLocaleProfile,\n};\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXLocaleService {\n private provider = inject(AXLocaleProfileProviderService);\n private config = inject(AX_LOCALE_CONFIG);\n private document = inject(DOCUMENT);\n private platformId = inject(PLATFORM_ID);\n\n private _activeProfile = signal<AXLocaleProfile>(AXUSLocaleProfile);\n public activeProfile = this._activeProfile.asReadonly();\n\n /** Whether the active locale uses right-to-left layout. */\n public readonly isRtl = computed(() => !!this._activeProfile()?.i18nMeta?.rtl);\n\n public profileChanged$ = toObservable(this._activeProfile);\n\n private originalProfile: AXLocaleProfile = cloneDeep(AXUSLocaleProfile);\n\n /**\n * Loads and activates a locale profile by its code (e.g., 'en-US', 'fa-IR').\n *\n * @param localeCode - Locale identifier to load.\n * @returns Promise<void> - Resolves when the profile is loaded and activated.\n */\n\n public async setProfile(localeCode: string): Promise<void> {\n const profile = await this.provider.getByLocale(localeCode);\n if (profile) {\n this.originalProfile = cloneDeep(profile);\n this._activeProfile.set(cloneDeep(profile));\n this.applyDocumentDirection(profile);\n } else {\n console.warn(`[AXLocaleService] Locale not found: ${localeCode}`);\n }\n }\n\n private applyDocumentDirection(profile: AXLocaleProfile): void {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n const isRtl = !!profile.i18nMeta?.rtl;\n this.document.documentElement.setAttribute('dir', isRtl ? 'rtl' : 'ltr');\n this.document.documentElement.setAttribute('lang', profile.localeInfo.language);\n }\n\n /**\n *\n */\n constructor() {\n const defaultCode = this.config.default;\n const builtinProfile = BUILTIN_LOCALE_PROFILES[defaultCode];\n\n if (builtinProfile) {\n this.originalProfile = cloneDeep(builtinProfile);\n this._activeProfile.set(cloneDeep(builtinProfile));\n this.applyDocumentDirection(builtinProfile);\n void this.provider.getByLocale(defaultCode);\n return;\n }\n\n this.applyDocumentDirection(this._activeProfile());\n void this.setProfile(defaultCode);\n }\n\n /**\n * Applies overrides to the active profile using a deep-merge object.\n *\n * @param profile - Partial profile object whose properties override the active profile.\n * @returns void\n */\n\n public apply(profile: Partial<AXLocaleProfile>): void;\n\n /**\n * Applies a single value override at the given path (dot notation).\n *\n * @param path - Dot-notated path (e.g., 'formats.date.short').\n * @param value - The value to set at the path.\n * @returns void\n */\n\n public apply(path: string, value: any): void;\n\n public apply(arg1: any, arg2?: any): void {\n const current = this.activeProfile();\n if (!current) {\n console.warn('[AXLocaleService] No active profile found');\n return;\n }\n\n const updated = cloneDeep(current);\n\n if (typeof arg1 === 'string' && arg2 !== undefined) {\n // Overload: updateProfile('formats.date.full', 'YYYY-MM-DD')\n set(updated, arg1, arg2);\n } else if (typeof arg1 === 'object') {\n // Overload: updateProfile({ formats: { date: { short: '...' } } })\n merge(updated, arg1);\n } else {\n console.warn('[AXLocaleService] Invalid arguments passed to updateProfile()');\n return;\n }\n }\n\n /**\n * Resets the active profile to its original loaded state (clears overrides).\n *\n * @returns void\n */\n\n public reset(): void {\n if (this.originalProfile) {\n const profile = cloneDeep(this.originalProfile);\n this._activeProfile.set(profile);\n this.applyDocumentDirection(profile);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAaA;AACA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;;MCba,2BAA2B,GAAG,IAAI,cAAc,CAC3D,6BAA6B,EAC7B;AACE,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAM,CAAC,IAAI,8BAA8B,EAAE,CAAC;AACtD,CAAA;AAGH;MACa,8BAA8B,CAAA;AACzC,IAAA,MAAM,OAAO,GAAA;QACX,OAAO;AACL,YAAA,OAAO,EAAE,MAAM,4DAAkC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AAClF,YAAA,OAAO,EAAE,MAAM,4DAAkC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,CAAC;AAClF,YAAA,OAAO,EAAE,MAAM,4DA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AI,IAAI,CAAC,eAAe,EAAE;YACxB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC;AAC/C,YAAA,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC;AAChC,YAAA,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC;QACtC;IACF;8GAlHW,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA;;2FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACpBD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "21.0.3-next.1",
3
+ "version": "21.0.3-next.11",
4
4
  "peerDependencies": {
5
5
  "lodash-es": ">=4.17.21",
6
6
  "memoizee": ">=0.4.15",
@@ -46,6 +46,16 @@ type AXFileCopyResult = string | AXFileCopyData | null | undefined;
46
46
  /** Resolves clipboard/plain text from a copy result. */
47
47
  declare function resolveFileCopyText(result: AXFileCopyResult): string | null;
48
48
 
49
+ /** Metadata key for catalog usage context. */
50
+ declare const AX_FILE_TYPE_METADATA_PURPOSE: "purpose";
51
+ /** Catalog metadata bag; `purpose` lists usage contexts (e.g. `['system']`). */
52
+ type AXFileTypeMetadata = Record<string, unknown> & {
53
+ [AX_FILE_TYPE_METADATA_PURPOSE]?: string[];
54
+ };
55
+ /** Filter catalog entries by {@link AX_FILE_TYPE_METADATA_PURPOSE}. */
56
+ interface AXFileTypeQuery {
57
+ purpose?: string | string[];
58
+ }
49
59
  /** Generic rule executed via {@link AXValidationService}. */
50
60
  interface AXFileValidationRule {
51
61
  rule: string;
@@ -81,6 +91,7 @@ interface AXFileType<T = Record<string, (ctx: {
81
91
  name: string;
82
92
  title?: string;
83
93
  icon?: string;
94
+ metadata?: AXFileTypeMetadata;
84
95
  validations?: AXFileValidations;
85
96
  extensions?: AXFileTypeExtension[];
86
97
  /** Dynamic utility functions available for this file type. */
@@ -93,6 +104,11 @@ interface AXFileType<T = Record<string, (ctx: {
93
104
  copy?: (payload: unknown) => Promise<AXFileCopyResult> | AXFileCopyResult;
94
105
  }
95
106
 
107
+ declare function getFileTypePurposes(type: AXFileType): string[];
108
+ declare function fileTypeMatchesPurpose(type: AXFileType, purpose: string | string[]): boolean;
109
+ declare function filterFileTypesByPurpose(types: AXFileType[], purpose?: string | string[]): AXFileType[];
110
+ declare function createFileTypeMetadata(purpose: string | string[]): NonNullable<AXFileType['metadata']>;
111
+
96
112
  /** Contributes {@link AXFileType} entries (multi provider). */
97
113
  declare abstract class AXFileTypeInfoProvider {
98
114
  abstract items(): Promise<AXFileType[]>;
@@ -109,7 +125,7 @@ declare class AXFileTypeRegistryService {
109
125
  registerTypes(types: AXFileType[]): void;
110
126
  invalidateCache(): void;
111
127
  private resolveTypes;
112
- getTypes(): Promise<AXFileType[]>;
128
+ getTypes(query?: AXFileTypeQuery): Promise<AXFileType[]>;
113
129
  get(name: string): Promise<AXFileType | undefined>;
114
130
  accept(typeNames?: string | string[]): Promise<string>;
115
131
  matchType(file: File): Promise<AXFileType | undefined>;
@@ -309,5 +325,5 @@ declare class AXFileService {
309
325
  static ɵprov: i0.ɵɵInjectableDeclaration<AXFileService>;
310
326
  }
311
327
 
312
- export { AXAudioFileTypeProvider, AXDocumentFileTypeProvider, AXFileFileTypeProvider, AXFileMaxSizeValidationRule, AXFileMimeTypeValidationRule, AXFileMinSizeValidationRule, AXFileModule, AXFileService, AXFileSizeFormatter, AXFileTypeInfoProvider, AXFileTypeRegistryService, AXImageFileTypeProvider, AXVideoFileTypeProvider, AX_AUDIO_FILE_TYPE, AX_BUILTIN_FILE_TYPE_PROVIDERS, AX_DOCUMENT_FILE_TYPE, AX_FILE_FILE_TYPE, AX_FILE_TYPE_INFO_PROVIDER, AX_FILE_VALIDATION_RULES, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE, fileValidationsToRules, findFileTypeExtension, formatFileSizeBytes, getFileExtension, isEmptyFileValidations, isExtensionsOnlyType, mergeFileValidations, provideBuiltinFileTypeProviders, provideDefaultFileTypeProviders, provideFileTypeInfoProvider, provideFileTypeSystem, provideFileValidationRules, resolveFileCopyText, resolveFileValidations, validateFileAgainstType, validateFileWithValidations };
313
- export type { AXFileChooseOptions, AXFileCopyData, AXFileCopyResult, AXFileMaxSizeValidationRuleOptions, AXFileMimeTypeValidationRuleOptions, AXFileMinSizeValidationRuleOptions, AXFileModuleConfig, AXFileSizeFormatterOptions, AXFileType, AXFileTypeExtension, AXFileValidationRule, AXFileValidations };
328
+ export { AXAudioFileTypeProvider, AXDocumentFileTypeProvider, AXFileFileTypeProvider, AXFileMaxSizeValidationRule, AXFileMimeTypeValidationRule, AXFileMinSizeValidationRule, AXFileModule, AXFileService, AXFileSizeFormatter, AXFileTypeInfoProvider, AXFileTypeRegistryService, AXImageFileTypeProvider, AXVideoFileTypeProvider, AX_AUDIO_FILE_TYPE, AX_BUILTIN_FILE_TYPE_PROVIDERS, AX_DOCUMENT_FILE_TYPE, AX_FILE_FILE_TYPE, AX_FILE_TYPE_INFO_PROVIDER, AX_FILE_TYPE_METADATA_PURPOSE, AX_FILE_VALIDATION_RULES, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE, createFileTypeMetadata, fileTypeMatchesPurpose, fileValidationsToRules, filterFileTypesByPurpose, findFileTypeExtension, formatFileSizeBytes, getFileExtension, getFileTypePurposes, isEmptyFileValidations, isExtensionsOnlyType, mergeFileValidations, provideBuiltinFileTypeProviders, provideDefaultFileTypeProviders, provideFileTypeInfoProvider, provideFileTypeSystem, provideFileValidationRules, resolveFileCopyText, resolveFileValidations, validateFileAgainstType, validateFileWithValidations };
329
+ export type { AXFileChooseOptions, AXFileCopyData, AXFileCopyResult, AXFileMaxSizeValidationRuleOptions, AXFileMimeTypeValidationRuleOptions, AXFileMinSizeValidationRuleOptions, AXFileModuleConfig, AXFileSizeFormatterOptions, AXFileType, AXFileTypeExtension, AXFileTypeMetadata, AXFileTypeQuery, AXFileValidationRule, AXFileValidations };