@bootkit/ng0 0.0.0-alpha.52 → 0.0.0-alpha.54

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.
@@ -1,3 +1,4 @@
1
+ import { all } from 'deepmerge';
1
2
  import * as i0 from '@angular/core';
2
3
  import { Injectable, Pipe, inject, runInInjectionContext, EnvironmentInjector, NgModule, InjectionToken } from '@angular/core';
3
4
  import { Subject } from 'rxjs';
@@ -103,7 +104,8 @@ class Locale {
103
104
  * Clones and extends this object and returns a new Locale (without modifying this object).
104
105
  */
105
106
  extend(definition) {
106
- return new Locale({ ...this.definition, ...definition });
107
+ const newDefinition = all([this.definition, definition || {}]);
108
+ return new Locale(newDefinition);
107
109
  }
108
110
  /**
109
111
  *
@@ -320,26 +322,46 @@ function createNumberFormatter(minimumIntegerDigits, minimumFractionDigits, maxi
320
322
  }
321
323
  /**
322
324
  * Creates a currency formatter.
323
- * @param minFractions
324
- * @param maxFractions
325
- * @returns
325
+ * @param currency The ISO 4217 currency code (e.g., "USD", "EUR", "IRR").
326
+ * @param minimumIntegerDigits Minimum number of integer digits to use. Default is 1.
327
+ * @param minimumFractionDigits Minimum number of fraction digits to use. Default is 1.
328
+ * @param maximumFractionDigits Maximum number of fraction digits to use. Default is 2.
329
+ * @param notation The notation to use. Default is 'standard'.
330
+ * @param currencySign The currency sign to use. Default is 'standard'.
331
+ * @returns An ObjectFormatter function.
326
332
  */
327
- function createCurrencyFormatter(minFractions = 1, maxFractions = 2) {
328
- return (n, minFractions, maxFractions) => Number.isFinite(n) ? n.toString() : '';
333
+ function createCurrencyFormatter(currency, notation, minimumIntegerDigits, minimumFractionDigits, maximumFractionDigits, currencySign) {
334
+ let locale = inject(LocalizationService, { optional: true })?.get();
335
+ const localeName = locale?.definition.name || 'en-US';
336
+ const f = new Intl.NumberFormat(localeName, {
337
+ style: 'currency',
338
+ currency: currency,
339
+ notation: notation,
340
+ currencySign: currencySign,
341
+ minimumIntegerDigits: minimumIntegerDigits,
342
+ minimumFractionDigits: minimumFractionDigits,
343
+ maximumFractionDigits: maximumFractionDigits,
344
+ });
345
+ return (n) => Number.isFinite(n) ? f.format(n) : '';
329
346
  }
330
347
  function createDateFormatter(options) {
331
348
  const locale = inject(LocalizationService, { optional: true })?.get();
332
349
  let intlOptions;
333
- if (arguments.length == 0 || (typeof arguments[0] == 'object')) {
334
- intlOptions = { ...locale?.definition.intl?.date, ...options };
350
+ let localeOptions = locale?.definition.date?.options;
351
+ let length = arguments.length;
352
+ if (length == 0) {
353
+ intlOptions = { ...localeOptions };
354
+ }
355
+ else if (length == 1 && typeof arguments[0] == 'object') {
356
+ intlOptions = { ...localeOptions, ...arguments[0] };
335
357
  }
336
358
  else {
337
359
  intlOptions = {
338
- dateStyle: arguments[0],
339
- timeStyle: arguments[1],
340
- timeZone: arguments[2]?.[0],
341
- timeZoneName: arguments[2]?.[1],
342
- calendar: arguments[3],
360
+ dateStyle: length > 0 ? arguments[0] : localeOptions?.dateStyle,
361
+ timeStyle: length > 1 ? arguments[1] : localeOptions?.timeStyle,
362
+ timeZone: length > 2 ? arguments[2]?.[0] : localeOptions?.timeZone,
363
+ timeZoneName: length > 2 ? arguments[2]?.[1] : localeOptions?.timeZoneName,
364
+ calendar: length > 3 ? arguments[3] : localeOptions?.calendar,
343
365
  };
344
366
  }
345
367
  let intlFormatter;
@@ -405,7 +427,12 @@ function createCompositeFormatter(...formatters) {
405
427
  /**
406
428
  * Creates an ObjectFormatter from various ObjectFormatterLike types.
407
429
  * @param formatter The ObjectFormatterLike value to convert.
408
- * @param locale Optional locale object for locale-based formatting.
430
+ * A formatter can be:
431
+ * - A function: used directly as the formatter.
432
+ * - A number: creates an index formatter that retrieves the value at the specified index from an array.
433
+ * - A string: can be a field name (e.g., "user.name"), a predefined formatter symbol ("#", "$", "@"), or a locale formatter name (e.g., "*date").
434
+ * - An array: if the first element is a predefined formatter symbol, it creates a formatter using that symbol and the rest of the elements as parameters.
435
+ * Otherwise, it creates a composite formatter that applies each element in sequence.
409
436
  * @param params Additional parameters for the formatter.
410
437
  * @returns An ObjectFormatter function.
411
438
  */
@@ -416,7 +443,7 @@ function createObjectFormatter(formatter, ...params) {
416
443
  case 'number':
417
444
  return createIndexFormatter(formatter);
418
445
  case 'string':
419
- switch (formatter[0]) {
446
+ switch (formatter) {
420
447
  case '#':
421
448
  return createNumberFormatter(...params);
422
449
  case '$':
@@ -1 +1 @@
1
- {"version":3,"file":"bootkit-ng0-localization.mjs","sources":["../../../projects/ng0/localization/locale.ts","../../../projects/ng0/localization/locale-definition.ts","../../../projects/ng0/localization/localization.service.ts","../../../projects/ng0/localization/translate.pipe.ts","../../../projects/ng0/localization/translate-enum.pipe.ts","../../../projects/ng0/localization/translate-boolean-pipe.ts","../../../projects/ng0/localization/formatter.ts","../../../projects/ng0/localization/date.pipe.ts","../../../projects/ng0/localization/localize.pipe.ts","../../../projects/ng0/localization/localize-enum.pipe.ts","../../../projects/ng0/localization/localize-boolean-pipe.ts","../../../projects/ng0/localization/localize-date.pipe.ts","../../../projects/ng0/localization/format.pipe.ts","../../../projects/ng0/localization/localization.module.ts","../../../projects/ng0/localization/types.ts","../../../projects/ng0/localization/bootkit-ng0-localization.ts"],"sourcesContent":["import { LocaleDefinition } from \"./locale-definition\";\nimport { TranslatedValidationError } from \"./types\";\nimport { ObjectFormatter } from \"./formatter\";\n\n/** Locale */\nexport class Locale {\n constructor(public readonly definition: LocaleDefinition) {\n }\n\n /** \n * Returns the name of the locale\n * @returns The name of the locale\n */\n get name(): string {\n return this.definition.name;\n }\n\n /** \n * Translates a key in the dictionary\n * @param key The key to look up\n * @param fallback Optional fallback value if the key is not found\n * @returns The translated string or the fallbackValue if not found\n */\n translate(key: string, fallback?: string): string | undefined {\n return this.definition.dictionary?.[key] ?? fallback;\n }\n\n /**\n * Translates an enum value \n * @param enumName The name of the enum \n * @param enumValue The value of the enum to translate \n * @param fallback\n * @returns The translated string or the enum value itself if not found \n */\n\n translateEnum(enumName: string, enumValue: string | number | null | undefined, fallback?: string): string | undefined {\n let e = this.definition.enums?.[enumName];\n\n if (!e) {\n return fallback || enumValue?.toString();\n }\n\n if (enumValue === null) {\n return e['[null]'] || e['[empty]'];\n } else if (enumValue === undefined) {\n return e['[undefined]'] || e['[empty]'];\n } else if (enumValue === '') {\n return e['empty'];\n } else {\n return e[enumValue] || e['[?]'] || fallback || enumValue?.toString();\n }\n }\n\n /** \n * Translates a form validation error\n * @param errorKey The key of the error to translate\n * @param error The error object\n */\n translateError(errorKey: string, error: any, fallbackMessage: string | undefined = undefined): string | undefined {\n const errors = this.definition?.form?.validation?.errors;\n\n if (!errors) {\n return fallbackMessage;\n }\n\n const translatorFunc = errors[errorKey] ?? errors['*'];\n return typeof translatorFunc === 'function' ? translatorFunc(error) : fallbackMessage;\n }\n\n /** \n * Translates validation errors \n * @param errors Validation errors object\n * @returns Array of translated validation errors\n */\n translateErrors(errors: any): TranslatedValidationError[] {\n const result: TranslatedValidationError[] = [];\n for (const key in errors) {\n if (Object.prototype.hasOwnProperty.call(errors, key)) {\n result.push({\n key: key,\n value: errors[key],\n text: this.translateError(key, errors[key])\n });\n }\n }\n\n return result;\n }\n\n /** \n * Translates the first error in the validation errors object \n * @param errors Validation errors object\n * @returns TranslatedValidationError or undefined if no errors\n */\n translateFirstError(errors: any, fallbackMessage: string | undefined = undefined): TranslatedValidationError | undefined {\n const keys = Object.keys(errors);\n if (keys.length === 0) {\n return undefined;\n }\n\n const key = keys[0];\n const value = errors[key];\n return {\n key,\n value,\n text: this.translateError(key, value, fallbackMessage)\n };\n }\n\n /**\n * Clones and extends this object and returns a new Locale (without modifying this object).\n */\n extend(definition?: Omit<LocaleDefinition, 'name' | 'rtl'>): Locale {\n return new Locale({ ...this.definition, ...definition });\n }\n\n /**\n * \n * @param date Date string or timestamp\n * @returns Formatted date string based on the locale \n */\n formatDate(date: Date | string | number, format?: string): string {\n return date ? new Date(date).toLocaleDateString(this.definition.name, { hour: '2-digit', minute: '2-digit' }) : '';\n }\n\n format(object: any, formatterName: string, ...params: any[]): string {\n let formatter = this.definition.formatters?.[formatterName];\n\n if (!formatter) {\n throw Error(`The formatter \"${formatterName}\" is not defined in locale ${this.definition.name}`);\n }\n\n let formatterType = typeof formatter;\n if (formatterType === 'function') {\n return (formatter as ObjectFormatter)(object, ...params);\n } else if (Array.isArray(formatter)) {\n return formatter[+object];\n } else if (formatterType == 'object' && formatter != null) {\n return (formatter as any)[object] || '';\n } else {\n throw Error(`Invalid locale formatter: ${formatterName}`);\n }\n }\n}\n","import { ObjectFormatter } from \"./formatter\";\n\n/** Locale dictionary */\nexport type LocaleDictionary = { [key: string]: string; };\nexport type LocaleEnums = { [enumName: string]: { [enumValue: string]: string } };\n\n/** Locale Error Translator */\nexport type LocaleValidationErrorTranslator = (error: any) => string;\n\n\n/** Locale validation error translator functions */\nexport type LocaleValidationErrorTranslators = {\n [key: string]: LocaleValidationErrorTranslator;\n};\n\n/**\n * A function to format the paging info of a table.\n * \n */\nexport type TableComponentPagingFormatter = (info: {\n /**\n * The first record in the current page.\n */\n firstRecord: number,\n\n /**\n * The last record in the current page.\n */\n lastRecord: number,\n\n /**\n * The total number of records.\n */\n totalRecords?: number,\n\n /**\n * The current page index.\n */\n currentPage: number\n}) => string;\n\n/** \n * Locale definition\n */\nexport interface LocaleDefinition {\n /** Locale name */\n readonly name: string;\n\n /** Does this locale belongs to a RTL language */\n readonly rtl?: boolean;\n\n /** Intl API default options */\n intl?: {\n date?: Intl.DateTimeFormatOptions\n }\n\n /** Locale dictionary */\n dictionary?: LocaleDictionary;\n enums?: LocaleEnums,\n form?: {\n validation?: {\n /** Form validation error translators. */\n errors?: LocaleValidationErrorTranslators\n }\n },\n data?: {\n logicalOperators?: {\n [operator: string]: string\n }\n },\n components?: {\n table?: {\n /**\n * No records found message.\n */\n noRecords?: string;\n\n /** \n * Error message displayed when loading data fails. \n */\n loadError?: string;\n\n /**\n * A format function to format the paging info.\n */\n pagingInfo?: TableComponentPagingFormatter;\n },\n select?: {\n placeholder?: string;\n }\n },\n\n formatters?: {\n // boolean?: {\n // [booleanKind: string]: string[] // [false, true]\n // },\n // enum?: {\n // [enumName: string]: { [enumValue: string]: string }\n // }\n // custom?: {\n [formatterName: string]: ObjectFormatter | string[] | {\n [value: string]: string\n }\n // },\n // date?: {\n // calendars?: {\n // [calendar: string]: {\n // days: string[],\n // daysShort: string[],\n // months: string[],\n // monthsShort: string[],\n // }\n // }\n // };\n // }\n }\n};\n\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { Locale } from './locale';\nimport { LocaleChangeEvent } from './types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocalizationService {\n private _locales: Locale[] = [];\n private _activeLocale?: Locale;\n private _changeSubject = new Subject<LocaleChangeEvent>();\n readonly change = this._changeSubject.asObservable();\n\n constructor() {\n }\n\n /** \n * Adds a Locale \n */\n add(locale: Locale): void;\n /** Adds an array of Locales to this LocaleProvider */\n add(locales: Locale[]): void;\n add(l: any): void {\n if (l instanceof Locale) {\n this._locales.push(l);\n } else if (Array.isArray(l)) {\n l.forEach(x => this.add(x));\n } else {\n throw Error('Invalid locale');\n }\n\n if (this._locales.length == 1) {\n this._activeLocale = this._locales[0];\n }\n }\n\n /** Changes the active locale */\n set(localeName: string): void {\n const locale = this._locales.find(x => x.name === localeName);\n if (locale) {\n this._changeSubject.next({ old: this._activeLocale, new: locale });\n this._activeLocale = locale;\n return;\n }\n\n throw Error('Locale not found.');\n }\n\n /** Gets the active locale */\n get(): Locale | undefined {\n return this._activeLocale;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n\n/**\n * Pipe to translate a dictionary key into a localized string.\n * It uses the LocalizationService to fetch the translation.\n * If the translation is not found, it returns the fallback string if provided.\n */\n@Pipe({\n name: 'ng0Translate',\n standalone: true,\n pure: true\n})\nexport class TranslatePipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(dictionaryKey: string, fallback?: string) {\n return this._ls.get()?.translate(dictionaryKey, fallback) || dictionaryKey;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0TranslateEnum',\n standalone: true,\n pure: true\n})\nexport class TranslateEnumPipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n /**\n * \n * @param enumValue \n * @param enumName \n * @param nullValueKey \n * @param returnEnumAsFallback\n * @param fallbackKey \n * @returns \n */\n transform(enumValue: string | number | null | undefined, enumName: string, fallback?: string): any {\n return this._ls.get()?.translateEnum(enumName, enumValue, fallback);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0TranslateBool',\n standalone: true,\n pure: true\n})\nexport class TranslateBooleanPipe implements PipeTransform {\n\n constructor(private localeProvider: LocalizationService) {\n }\n\n transform(value: any, falseKey: string = 'true', trueKey: string = 'false'): any {\n return this.localeProvider.get()?.translate(value ? trueKey : falseKey);\n }\n}\n","import { EnvironmentInjector, inject, runInInjectionContext } from \"@angular/core\";\nimport { Locale } from \"./locale\";\nimport { LocalizationService } from \"./localization.service\";\n\n/**\n * Object formatter function type.\n * @param obj The object to format.\n * @param params Additional parameters for formatting.\n * @returns The formatted value.\n */\nexport type ObjectFormatter = (obj: any, ...params: any[]) => any;\n\n/**\n * Object formatter-like types. \n */\nexport type ObjectFormatterLike = ObjectFormatter | string | number | Array<any>;\n\n/**\n * Default object formatter function.\n * @param value The item to format.\n * @returns The formatted string.\n */\nexport function defaultFormatter(obj: any): string {\n return obj?.toString() || '';\n}\n\n/**\n * Creates a field formatter that retrieves the value of a specified field from an object.\n * @param field The field name to retrieve. Supports nested fields using dot notation (e.g., \"user.name\").\n * @returns An ObjectFormatter function.\n */\nexport function createFieldFormatter(field: string): ObjectFormatter {\n var subFields = field.split('.');\n // let value = row[subFields[0]];\n // for (let i = 1; i < subFields.length; i++) {\n // if (value == null) break;\n // value = value[subFields[i]];\n // }\n\n // return value;\n\n return (obj: any) => {\n let value = obj?.[subFields[0]];\n for (let i = 1; i < subFields.length; i++) {\n if (value == null) break;\n value = value?.[subFields[i]];\n }\n return value;\n }\n}\n\n/**\n * Creates an index formatter that retrieves the value at a specified index from an array.\n * @param index The index to retrieve (number or boolean).\n * @returns An ObjectFormatter function.\n */\nexport function createIndexFormatter(index: number | boolean): ObjectFormatter {\n return (obj: any) => {\n if (Array.isArray(obj)) {\n return obj[+index]; // use + to cast boolean values to numbers\n }\n\n throw Error('Object is not an array');\n }\n}\n\n/**\n * Creates a number formatter.\n * @param minimumIntegerDigits \n * @param minimumFractionDigits \n * @param maximumFractionDigits \n * @param useGrouping \n * @returns An ObjectFormatter function.\n */\nexport function createNumberFormatter(\n minimumIntegerDigits?: number,\n minimumFractionDigits?: number,\n maximumFractionDigits?: number,\n useGrouping = true): ObjectFormatter {\n let locale = inject(LocalizationService, { optional: true })?.get();\n const localeName = locale?.definition.name || 'en-US';\n\n const f = new Intl.NumberFormat(localeName, {\n minimumIntegerDigits,\n minimumFractionDigits,\n maximumFractionDigits,\n useGrouping,\n })\n\n return (n: number) => Number.isFinite(n) ? f.format(n) : '';\n}\n\n/**\n * Creates a currency formatter.\n * @param minFractions \n * @param maxFractions \n * @returns \n */\nexport function createCurrencyFormatter(minFractions = 1, maxFractions = 2): ObjectFormatter {\n return (n: number, minFractions, maxFractions) => Number.isFinite(n) ? n.toString() : '';\n}\n\n/**\n * Creates a date formatter.\n */\nexport function createDateFormatter(\n dateStyle?: 'short' | 'medium' | 'long' | 'full',\n timeStyle?: 'short' | 'medium' | 'long' | 'full',\n zone?: string[], // zone[0]: name, zone[1]: display ('long' | 'short' | 'shortOffset' | 'longOffset' | 'narrowOffset' | 'longGeneric' | 'shortGeneric')\n calendar?: string\n): ObjectFormatter;\nexport function createDateFormatter(options?: Intl.DateTimeFormatOptions): ObjectFormatter;\nexport function createDateFormatter(options?: any): ObjectFormatter {\n const locale = inject(LocalizationService, { optional: true })?.get();\n let intlOptions: Intl.DateTimeFormatOptions;\n\n if (arguments.length == 0 || (typeof arguments[0] == 'object')) {\n intlOptions = { ...locale?.definition.intl?.date, ...options };\n } else {\n intlOptions = {\n dateStyle: arguments[0],\n timeStyle: arguments[1],\n timeZone: arguments[2]?.[0],\n timeZoneName: arguments[2]?.[1],\n calendar: arguments[3],\n }\n }\n\n let intlFormatter: Intl.DateTimeFormat;\n\n try {\n intlFormatter = new Intl.DateTimeFormat(locale?.name, intlOptions as Intl.DateTimeFormatOptions);\n return (d: string | number | Date) => intlFormatter.format(new Date(d));\n } catch (err) {\n console.warn('Date formatter options are invalid. A fallback formatter will be used.', intlOptions, err);\n // Return a fallback formatter\n return (d: string | number | Date) => new Date(d).toLocaleString()\n }\n}\n\n/**\n * Creates a locale-based formatter.\n * @param locale The Locale object.\n * @param formatterName The format string in the form of \"formatterName:param1:param2:...\"\n * @returns A ValueFormatterFunction\n * @private\n */\nexport function createLocaleFormatter(formatterName: string): ObjectFormatter {\n let locale = inject(LocalizationService, { optional: true })?.get();\n\n if (locale == null) {\n throw Error('For using locale formatters, provide a Locale object.')\n }\n\n let formatter = locale.definition.formatters?.[formatterName];\n let formatterType = typeof formatter;\n\n if (!formatter) {\n console.warn(`The formatter \"${formatterName}\" is not defined in locale ${locale.definition.name}`);\n return defaultFormatter;\n }\n\n if (formatterType === 'function') {\n return formatter as ObjectFormatter;\n } else if (Array.isArray(formatter)) {\n return (index: number | boolean) => formatter[+index];\n } else if (formatterType == 'object' && formatter != null) {\n return (value: string) => (formatter as any)[value] || '';\n } else {\n throw Error(`Invalid locale formatter: ${formatterName}`);\n }\n}\n\n/**\n * Creates a composite formatter that applies multiple formatters in sequence. \n * @param formatters The list of ObjectFormatterLike values to compose.\n * @returns An ObjectFormatter function.\n */\nexport function createCompositeFormatter(...formatters: ObjectFormatterLike[]): ObjectFormatter {\n if (!Array.isArray(formatters) || formatters.length == 0) {\n throw Error('Composite formatter requires a non-empty array of formatters');\n }\n\n const formattersFuncs = formatters.map(item => createObjectFormatter(item as any));\n\n return (obj: any) => {\n let result = formattersFuncs[0](obj);\n for (let index = 1; index < formatters.length; index++) {\n result = formattersFuncs[index](result);\n }\n return result;\n }\n}\n\n/**\n * Creates an ObjectFormatter from various ObjectFormatterLike types.\n * @param formatter The ObjectFormatterLike value to convert. \n * @param locale Optional locale object for locale-based formatting.\n * @param params Additional parameters for the formatter.\n * @returns An ObjectFormatter function.\n */\nexport function createObjectFormatter(formatter: ObjectFormatterLike, ...params: any[]): ObjectFormatter {\n switch (typeof formatter) {\n case 'function':\n return formatter.bind(null, ...params);\n case 'number':\n return createIndexFormatter(formatter);\n case 'string':\n switch (formatter[0]) {\n case '#':\n return createNumberFormatter(...params);\n case '$':\n return createCurrencyFormatter(...params);\n case '@':\n return createDateFormatter(...params);\n case '*':\n return createLocaleFormatter(formatter.substring(1));\n default:\n return createFieldFormatter(formatter);\n }\n case 'object':\n if (Array.isArray(formatter) && formatter.length > 0) {\n const formatterSymbols = ['#', '$', '@', '*'];\n\n if (formatterSymbols.includes(formatter[0])) {\n return createObjectFormatter(formatter[0], ...formatter.slice(1));\n } else {\n return createCompositeFormatter(...formatter)\n }\n }\n break;\n }\n\n throw Error('invalid formatter', { cause: formatter });\n}\n\n/**\n * Creates a transform function that converts a ObjectFormatterLike value into a ObjectFormatter.\n * @param injector The EnvironmentInjector to use for dependency injection.\n * @returns A function that takes a ObjectFormatterLike and returns a ObjectFormatter.\n */\nexport function objectFormatterAttribute(injector: EnvironmentInjector): ((v: ObjectFormatterLike) => ObjectFormatter) {\n return (x: ObjectFormatterLike) => runInInjectionContext(injector, createObjectFormatter.bind(null, x));\n};\n","import { EnvironmentInjector, inject, Pipe, PipeTransform, runInInjectionContext } from '@angular/core';\nimport { createDateFormatter } from './formatter';\n\n@Pipe({\n name: 'ng0Date',\n standalone: true,\n pure: true\n})\nexport class DatePipe implements PipeTransform {\n private _injector = inject(EnvironmentInjector);\n\n transform(value: Date | string | number,\n dateStyle?: 'short' | 'medium' | 'long' | 'full',\n timeStyle?: 'short' | 'medium' | 'long' | 'full',\n zone?: string[],\n calendar?: string): string;\n transform(value: Date | string | number, options?: Intl.DateTimeFormatOptions): string;\n transform(value: Date | string | number, ...options: any[]): string {\n const formatter = runInInjectionContext(this._injector, createDateFormatter.bind(null, ...options));\n return formatter(value);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0Localize',\n standalone: true,\n pure: false\n})\nexport class LocalizePipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(dictionaryKey: string) {\n return this._ls.get()?.translate(dictionaryKey);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Pipe({\n name: 'ng0LocalizeEnum',\n standalone: true,\n pure: false\n})\nexport class LocalizeEnumPipe implements PipeTransform {\n private _recompute = true;\n private _value?: string;\n\n constructor(private _ls: LocalizationService) {\n _ls.change.pipe(takeUntilDestroyed()).subscribe(x => this._recompute = true);\n }\n\n /**\n * \n * @param enumValue \n * @param enumName \n * @param nullValueKey \n * @param returnEnumAsFallback\n * @param fallbackKey \n * @returns \n */\n transform(enumValue: string | number | null | undefined, enumName: string, fallback?: string): any {\n if (this._recompute) {\n this._value = this._ls.get()?.translateEnum(enumName, enumValue, fallback);\n this._recompute = false;\n }\n\n return this._value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0LocalizeBool',\n standalone: true,\n pure: false\n})\nexport class LocalizeBooleanPipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(value: any, falseKey = 'true', trueKey: 'false') {\n return this._ls.get()?.translate(value ? trueKey : falseKey);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Locale } from './locale';\nimport { LocalizationService } from './localization.service';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Pipe({\n name: 'ng0LocalizeDate',\n standalone: true,\n pure: false\n})\nexport class LocalizeDatePipe implements PipeTransform {\n private _value?: string;\n private _recompute = true;\n\n constructor(private _ls: LocalizationService) {\n _ls.change.pipe(takeUntilDestroyed()).subscribe(x => this._recompute = true);\n }\n\n transform(value: number | string, format?: string) {\n if (this._recompute) {\n this._value = this._ls.get()?.formatDate(value, format);\n this._recompute = false;\n }\n\n return this._value;\n }\n}\n","import { EnvironmentInjector, inject, Pipe, PipeTransform, runInInjectionContext } from '@angular/core';\nimport { createObjectFormatter, ObjectFormatterLike } from './formatter';\n\n/**\n * Format pipe to format objects using various formatter types.\n */\n@Pipe({\n name: 'ng0Format',\n standalone: true,\n pure: true\n})\nexport class FormatPipe implements PipeTransform {\n private _injector = inject(EnvironmentInjector);\n \n transform(obj: any, formatter: ObjectFormatterLike, ...params: any[]): any {\n const frmtFunc = runInInjectionContext(this._injector, createObjectFormatter.bind(null, formatter, ...params));\n return frmtFunc(obj);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { TranslatePipe } from './translate.pipe';\nimport { TranslateEnumPipe } from './translate-enum.pipe';\nimport { TranslateBooleanPipe } from './translate-boolean-pipe';\nimport { DatePipe } from './date.pipe';\nimport { LocalizePipe } from './localize.pipe';\nimport { LocalizeEnumPipe } from './localize-enum.pipe';\nimport { LocalizeBooleanPipe } from './localize-boolean-pipe';\nimport { LocalizeDatePipe } from './localize-date.pipe';\nimport { FormatPipe } from './format.pipe';\n\nconst Declares = [\n // Pure pipes\n TranslatePipe,\n TranslateEnumPipe,\n TranslateBooleanPipe,\n DatePipe,\n FormatPipe,\n\n // Impure pipes\n LocalizePipe,\n LocalizeEnumPipe,\n LocalizeBooleanPipe,\n LocalizeDatePipe\n];\n\n@NgModule({\n imports: Declares,\n exports: Declares\n})\nexport class LocalizationModule {\n}\n\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationService } from './localization.service';\nimport { Locale } from './locale';\n\nexport const LOCALE = new InjectionToken<Locale | LocalizationService>('LOCALE');\n\nexport interface TranslatedValidationError {\n /** Error key */\n key: string;\n \n /** Error object */\n value: any;\n \n /** localized error text */\n text?: string;\n }\n \n export interface LocaleChangeEvent {\n old?: Locale;\n new: Locale;\n }\n ","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LocalizationService"],"mappings":";;;;;AAIA;MACa,MAAM,CAAA;AACW,IAAA,UAAA;AAA5B,IAAA,WAAA,CAA4B,UAA4B,EAAA;QAA5B,IAAA,CAAA,UAAU,GAAV,UAAU;IACtC;AAEA;;;AAGG;AACH,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI;IAC7B;AAEA;;;;;AAKG;IACH,SAAS,CAAC,GAAW,EAAE,QAAiB,EAAA;QACtC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,IAAI,QAAQ;IACtD;AAEA;;;;;;AAMG;AAEH,IAAA,aAAa,CAAC,QAAgB,EAAE,SAA6C,EAAE,QAAiB,EAAA;QAC9F,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,QAAQ,CAAC;QAEzC,IAAI,CAAC,CAAC,EAAE;AACN,YAAA,OAAO,QAAQ,IAAI,SAAS,EAAE,QAAQ,EAAE;QAC1C;AAEA,QAAA,IAAI,SAAS,KAAK,IAAI,EAAE;YACtB,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;QACpC;AAAO,aAAA,IAAI,SAAS,KAAK,SAAS,EAAE;YAClC,OAAO,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC;QACzC;AAAO,aAAA,IAAI,SAAS,KAAK,EAAE,EAAE;AAC3B,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC;QACnB;a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AAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAlB,kBAAkB,EAAA,OAAA,EAAA;;YAjB7B,aAAa;YACb,iBAAiB;YACjB,oBAAoB;YACpB,QAAQ;YACR,UAAU;;YAGV,YAAY;YACZ,gBAAgB;YAChB,mBAAmB;YACnB,gBAAgB,CAAA,EAAA,OAAA,EAAA;;YAVhB,aAAa;YACb,iBAAiB;YACjB,oBAAoB;YACpB,QAAQ;YACR,UAAU;;YAGV,YAAY;YACZ,gBAAgB;YAChB,mBAAmB;YACnB,gBAAgB,CAAA,EAAA,CAAA;yGAOL,kBAAkB,EAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,QAAQ;AACjB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;MC1BY,MAAM,GAAG,IAAI,cAAc,CAA+B,QAAQ;;ACJ/E;;AAEG;;;;"}
1
+ {"version":3,"file":"bootkit-ng0-localization.mjs","sources":["../../../projects/ng0/localization/locale.ts","../../../projects/ng0/localization/locale-definition.ts","../../../projects/ng0/localization/localization.service.ts","../../../projects/ng0/localization/translate.pipe.ts","../../../projects/ng0/localization/translate-enum.pipe.ts","../../../projects/ng0/localization/translate-boolean-pipe.ts","../../../projects/ng0/localization/formatter.ts","../../../projects/ng0/localization/date.pipe.ts","../../../projects/ng0/localization/localize.pipe.ts","../../../projects/ng0/localization/localize-enum.pipe.ts","../../../projects/ng0/localization/localize-boolean-pipe.ts","../../../projects/ng0/localization/localize-date.pipe.ts","../../../projects/ng0/localization/format.pipe.ts","../../../projects/ng0/localization/localization.module.ts","../../../projects/ng0/localization/types.ts","../../../projects/ng0/localization/bootkit-ng0-localization.ts"],"sourcesContent":["import { LocaleDefinition } from \"./locale-definition\";\nimport { TranslatedValidationError } from \"./types\";\nimport { ObjectFormatter } from \"./formatter\";\nimport { all } from 'deepmerge';\n\n/** Locale */\nexport class Locale {\n constructor(public readonly definition: LocaleDefinition) {\n }\n\n /** \n * Returns the name of the locale\n * @returns The name of the locale\n */\n get name(): string {\n return this.definition.name;\n }\n\n /** \n * Translates a key in the dictionary\n * @param key The key to look up\n * @param fallback Optional fallback value if the key is not found\n * @returns The translated string or the fallbackValue if not found\n */\n translate(key: string, fallback?: string): string | undefined {\n return this.definition.dictionary?.[key] ?? fallback;\n }\n\n /**\n * Translates an enum value \n * @param enumName The name of the enum \n * @param enumValue The value of the enum to translate \n * @param fallback\n * @returns The translated string or the enum value itself if not found \n */\n\n translateEnum(enumName: string, enumValue: string | number | null | undefined, fallback?: string): string | undefined {\n let e = this.definition.enums?.[enumName];\n\n if (!e) {\n return fallback || enumValue?.toString();\n }\n\n if (enumValue === null) {\n return e['[null]'] || e['[empty]'];\n } else if (enumValue === undefined) {\n return e['[undefined]'] || e['[empty]'];\n } else if (enumValue === '') {\n return e['empty'];\n } else {\n return e[enumValue] || e['[?]'] || fallback || enumValue?.toString();\n }\n }\n\n /** \n * Translates a form validation error\n * @param errorKey The key of the error to translate\n * @param error The error object\n */\n translateError(errorKey: string, error: any, fallbackMessage: string | undefined = undefined): string | undefined {\n const errors = this.definition?.form?.validation?.errors;\n\n if (!errors) {\n return fallbackMessage;\n }\n\n const translatorFunc = errors[errorKey] ?? errors['*'];\n return typeof translatorFunc === 'function' ? translatorFunc(error) : fallbackMessage;\n }\n\n /** \n * Translates validation errors \n * @param errors Validation errors object\n * @returns Array of translated validation errors\n */\n translateErrors(errors: any): TranslatedValidationError[] {\n const result: TranslatedValidationError[] = [];\n for (const key in errors) {\n if (Object.prototype.hasOwnProperty.call(errors, key)) {\n result.push({\n key: key,\n value: errors[key],\n text: this.translateError(key, errors[key])\n });\n }\n }\n\n return result;\n }\n\n /** \n * Translates the first error in the validation errors object \n * @param errors Validation errors object\n * @returns TranslatedValidationError or undefined if no errors\n */\n translateFirstError(errors: any, fallbackMessage: string | undefined = undefined): TranslatedValidationError | undefined {\n const keys = Object.keys(errors);\n if (keys.length === 0) {\n return undefined;\n }\n\n const key = keys[0];\n const value = errors[key];\n return {\n key,\n value,\n text: this.translateError(key, value, fallbackMessage)\n };\n }\n\n /**\n * Clones and extends this object and returns a new Locale (without modifying this object).\n */\n extend(definition?: Omit<LocaleDefinition, 'name' | 'rtl'>): Locale {\n const newDefinition = all([this.definition, definition || {}]) as LocaleDefinition;\n return new Locale(newDefinition);\n }\n\n /**\n * \n * @param date Date string or timestamp\n * @returns Formatted date string based on the locale \n */\n formatDate(date: Date | string | number, format?: string): string {\n return date ? new Date(date).toLocaleDateString(this.definition.name, { hour: '2-digit', minute: '2-digit' }) : '';\n }\n\n format(object: any, formatterName: string, ...params: any[]): string {\n let formatter = this.definition.formatters?.[formatterName];\n\n if (!formatter) {\n throw Error(`The formatter \"${formatterName}\" is not defined in locale ${this.definition.name}`);\n }\n\n let formatterType = typeof formatter;\n if (formatterType === 'function') {\n return (formatter as ObjectFormatter)(object, ...params);\n } else if (Array.isArray(formatter)) {\n return formatter[+object];\n } else if (formatterType == 'object' && formatter != null) {\n return (formatter as any)[object] || '';\n } else {\n throw Error(`Invalid locale formatter: ${formatterName}`);\n }\n }\n}\n","import { ObjectFormatter } from \"./formatter\";\n\n/** Locale dictionary */\nexport type LocaleDictionary = { [key: string]: string; };\nexport type LocaleEnums = { [enumName: string]: { [enumValue: string]: string } };\n\n/** Locale Error Translator */\nexport type LocaleValidationErrorTranslator = (error: any) => string;\n\n\n/** Locale validation error translator functions */\nexport type LocaleValidationErrorTranslators = {\n [key: string]: LocaleValidationErrorTranslator;\n};\n\n/**\n * A function to format the paging info of a table.\n * \n */\nexport type TableComponentPagingFormatter = (info: {\n /**\n * The first record in the current page.\n */\n firstRecord: number,\n\n /**\n * The last record in the current page.\n */\n lastRecord: number,\n\n /**\n * The total number of records.\n */\n totalRecords?: number,\n\n /**\n * The current page index.\n */\n currentPage: number\n}) => string;\n\n/** \n * Locale definition\n */\nexport interface LocaleDefinition {\n /** Locale name */\n readonly name: string;\n\n /** Does this locale belongs to a RTL language */\n readonly rtl?: boolean;\n\n /** Intl API default options */\n date?: {\n /**\n * Default options for Intl.DateTimeFormat API. \n * For more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#parameters\n */\n options?: Intl.DateTimeFormatOptions\n }\n\n /** Locale dictionary */\n dictionary?: LocaleDictionary;\n enums?: LocaleEnums,\n form?: {\n validation?: {\n /** Form validation error translators. */\n errors?: LocaleValidationErrorTranslators\n }\n },\n data?: {\n logicalOperators?: {\n [operator: string]: string\n }\n },\n components?: {\n table?: {\n /**\n * No records found message.\n */\n noRecords?: string;\n\n /** \n * Error message displayed when loading data fails. \n */\n loadError?: string;\n\n /**\n * A format function to format the paging info.\n */\n pagingInfo?: TableComponentPagingFormatter;\n },\n select?: {\n placeholder?: string;\n }\n },\n\n formatters?: {\n // boolean?: {\n // [booleanKind: string]: string[] // [false, true]\n // },\n // enum?: {\n // [enumName: string]: { [enumValue: string]: string }\n // }\n // custom?: {\n [formatterName: string]: ObjectFormatter | string[] | {\n [value: string]: string\n }\n // },\n // date?: {\n // calendars?: {\n // [calendar: string]: {\n // days: string[],\n // daysShort: string[],\n // months: string[],\n // monthsShort: string[],\n // }\n // }\n // };\n // }\n }\n};\n\n","import { Injectable } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { Locale } from './locale';\nimport { LocaleChangeEvent } from './types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class LocalizationService {\n private _locales: Locale[] = [];\n private _activeLocale?: Locale;\n private _changeSubject = new Subject<LocaleChangeEvent>();\n readonly change = this._changeSubject.asObservable();\n\n constructor() {\n }\n\n /** \n * Adds a Locale \n */\n add(locale: Locale): void;\n /** Adds an array of Locales to this LocaleProvider */\n add(locales: Locale[]): void;\n add(l: any): void {\n if (l instanceof Locale) {\n this._locales.push(l);\n } else if (Array.isArray(l)) {\n l.forEach(x => this.add(x));\n } else {\n throw Error('Invalid locale');\n }\n\n if (this._locales.length == 1) {\n this._activeLocale = this._locales[0];\n }\n }\n\n /** Changes the active locale */\n set(localeName: string): void {\n const locale = this._locales.find(x => x.name === localeName);\n if (locale) {\n this._changeSubject.next({ old: this._activeLocale, new: locale });\n this._activeLocale = locale;\n return;\n }\n\n throw Error('Locale not found.');\n }\n\n /** Gets the active locale */\n get(): Locale | undefined {\n return this._activeLocale;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n\n/**\n * Pipe to translate a dictionary key into a localized string.\n * It uses the LocalizationService to fetch the translation.\n * If the translation is not found, it returns the fallback string if provided.\n */\n@Pipe({\n name: 'ng0Translate',\n standalone: true,\n pure: true\n})\nexport class TranslatePipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(dictionaryKey: string, fallback?: string) {\n return this._ls.get()?.translate(dictionaryKey, fallback) || dictionaryKey;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0TranslateEnum',\n standalone: true,\n pure: true\n})\nexport class TranslateEnumPipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n /**\n * \n * @param enumValue \n * @param enumName \n * @param nullValueKey \n * @param returnEnumAsFallback\n * @param fallbackKey \n * @returns \n */\n transform(enumValue: string | number | null | undefined, enumName: string, fallback?: string): any {\n return this._ls.get()?.translateEnum(enumName, enumValue, fallback);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0TranslateBool',\n standalone: true,\n pure: true\n})\nexport class TranslateBooleanPipe implements PipeTransform {\n\n constructor(private localeProvider: LocalizationService) {\n }\n\n transform(value: any, falseKey: string = 'true', trueKey: string = 'false'): any {\n return this.localeProvider.get()?.translate(value ? trueKey : falseKey);\n }\n}\n","import { EnvironmentInjector, inject, runInInjectionContext } from \"@angular/core\";\nimport { Locale } from \"./locale\";\nimport { LocalizationService } from \"./localization.service\";\n\n/**\n * Object formatter function type.\n * @param obj The object to format.\n * @param params Additional parameters for formatting.\n * @returns The formatted value.\n */\nexport type ObjectFormatter = (obj: any, ...params: any[]) => any;\n\n/**\n * Object formatter-like types. \n */\nexport type ObjectFormatterLike = ObjectFormatter | string | number | Array<any>;\n\n/**\n * Default object formatter function.\n * @param value The item to format.\n * @returns The formatted string.\n */\nexport function defaultFormatter(obj: any): string {\n return obj?.toString() || '';\n}\n\n/**\n * Creates a field formatter that retrieves the value of a specified field from an object.\n * @param field The field name to retrieve. Supports nested fields using dot notation (e.g., \"user.name\").\n * @returns An ObjectFormatter function.\n */\nexport function createFieldFormatter(field: string): ObjectFormatter {\n var subFields = field.split('.');\n // let value = row[subFields[0]];\n // for (let i = 1; i < subFields.length; i++) {\n // if (value == null) break;\n // value = value[subFields[i]];\n // }\n\n // return value;\n\n return (obj: any) => {\n let value = obj?.[subFields[0]];\n for (let i = 1; i < subFields.length; i++) {\n if (value == null) break;\n value = value?.[subFields[i]];\n }\n return value;\n }\n}\n\n/**\n * Creates an index formatter that retrieves the value at a specified index from an array.\n * @param index The index to retrieve (number or boolean).\n * @returns An ObjectFormatter function.\n */\nexport function createIndexFormatter(index: number | boolean): ObjectFormatter {\n return (obj: any) => {\n if (Array.isArray(obj)) {\n return obj[+index]; // use + to cast boolean values to numbers\n }\n\n throw Error('Object is not an array');\n }\n}\n\n/**\n * Creates a number formatter.\n * @param minimumIntegerDigits \n * @param minimumFractionDigits \n * @param maximumFractionDigits \n * @param useGrouping \n * @returns An ObjectFormatter function.\n */\nexport function createNumberFormatter(\n minimumIntegerDigits?: number,\n minimumFractionDigits?: number,\n maximumFractionDigits?: number,\n useGrouping = true): ObjectFormatter {\n let locale = inject(LocalizationService, { optional: true })?.get();\n const localeName = locale?.definition.name || 'en-US';\n\n const f = new Intl.NumberFormat(localeName, {\n minimumIntegerDigits,\n minimumFractionDigits,\n maximumFractionDigits,\n useGrouping,\n })\n\n return (n: number) => Number.isFinite(n) ? f.format(n) : '';\n}\n\n/**\n * Creates a currency formatter.\n * @param currency The ISO 4217 currency code (e.g., \"USD\", \"EUR\", \"IRR\").\n * @param minimumIntegerDigits Minimum number of integer digits to use. Default is 1.\n * @param minimumFractionDigits Minimum number of fraction digits to use. Default is 1.\n * @param maximumFractionDigits Maximum number of fraction digits to use. Default is 2.\n * @param notation The notation to use. Default is 'standard'.\n * @param currencySign The currency sign to use. Default is 'standard'.\n * @returns An ObjectFormatter function.\n */\nexport function createCurrencyFormatter(\n currency?: string,\n notation?: 'standard' | 'scientific' | 'engineering' | 'compact',\n minimumIntegerDigits?: number,\n minimumFractionDigits?: number,\n maximumFractionDigits?: number,\n currencySign?: 'standard' | 'accounting'\n): ObjectFormatter {\n let locale = inject(LocalizationService, { optional: true })?.get();\n const localeName = locale?.definition.name || 'en-US';\n\n const f = new Intl.NumberFormat(localeName, {\n style: 'currency',\n currency: currency,\n notation: notation,\n currencySign: currencySign,\n minimumIntegerDigits: minimumIntegerDigits,\n minimumFractionDigits: minimumFractionDigits,\n maximumFractionDigits: maximumFractionDigits,\n })\n\n return (n: number) => Number.isFinite(n) ? f.format(n) : '';\n}\n\n/**\n * Creates a date formatter.\n * The formatter can be created using predefined styles or custom Intl.DateTimeFormatOptions.\n * Predefined styles:\n * - dateStyle: 'short' | 'medium' | 'long' | 'full'\n * - timeStyle: 'short' | 'medium' | 'long' | 'full'\n * - zone: [name, display?] (e.g., ['UTC', 'short'])\n * - calendar: string (e.g., 'gregory', 'persian', 'islamic')\n * #### Custom options:\n * - Any valid Intl.DateTimeFormatOptions can be used for custom formatting.\n * @returns An ObjectFormatter function.\n */\nexport function createDateFormatter(\n dateStyle?: 'short' | 'medium' | 'long' | 'full',\n timeStyle?: 'short' | 'medium' | 'long' | 'full',\n zone?: string[], // zone[0]: name, zone[1]: display ('long' | 'short' | 'shortOffset' | 'longOffset' | 'narrowOffset' | 'longGeneric' | 'shortGeneric')\n calendar?: string\n): ObjectFormatter;\nexport function createDateFormatter(options?: Intl.DateTimeFormatOptions): ObjectFormatter;\nexport function createDateFormatter(options?: any): ObjectFormatter {\n const locale = inject(LocalizationService, { optional: true })?.get();\n let intlOptions: Intl.DateTimeFormatOptions;\n let localeOptions = locale?.definition.date?.options;\n let length = arguments.length;\n\n if (length == 0) {\n intlOptions = { ...localeOptions };\n } else if (length == 1 && typeof arguments[0] == 'object') {\n intlOptions = { ...localeOptions, ...arguments[0] };\n } else {\n intlOptions = {\n dateStyle: length > 0 ? arguments[0] : localeOptions?.dateStyle,\n timeStyle: length > 1 ? arguments[1] : localeOptions?.timeStyle,\n timeZone: length > 2 ? arguments[2]?.[0] : localeOptions?.timeZone,\n timeZoneName: length > 2 ? arguments[2]?.[1] : localeOptions?.timeZoneName,\n calendar: length > 3 ? arguments[3] : localeOptions?.calendar,\n }\n }\n\n let intlFormatter: Intl.DateTimeFormat;\n\n try {\n intlFormatter = new Intl.DateTimeFormat(locale?.name, intlOptions as Intl.DateTimeFormatOptions);\n return (d: string | number | Date) => intlFormatter.format(new Date(d));\n } catch (err) {\n console.warn('Date formatter options are invalid. A fallback formatter will be used.', intlOptions, err);\n // Return a fallback formatter\n return (d: string | number | Date) => new Date(d).toLocaleString()\n }\n}\n\n/**\n * Creates a locale-based formatter.\n * @param locale The Locale object.\n * @param formatterName The format string in the form of \"formatterName:param1:param2:...\"\n * @returns A ValueFormatterFunction\n * @private\n */\nexport function createLocaleFormatter(formatterName: string): ObjectFormatter {\n let locale = inject(LocalizationService, { optional: true })?.get();\n\n if (locale == null) {\n throw Error('For using locale formatters, provide a Locale object.')\n }\n\n let formatter = locale.definition.formatters?.[formatterName];\n let formatterType = typeof formatter;\n\n if (!formatter) {\n console.warn(`The formatter \"${formatterName}\" is not defined in locale ${locale.definition.name}`);\n return defaultFormatter;\n }\n\n if (formatterType === 'function') {\n return formatter as ObjectFormatter;\n } else if (Array.isArray(formatter)) {\n return (index: number | boolean) => formatter[+index];\n } else if (formatterType == 'object' && formatter != null) {\n return (value: string) => (formatter as any)[value] || '';\n } else {\n throw Error(`Invalid locale formatter: ${formatterName}`);\n }\n}\n\n/**\n * Creates a composite formatter that applies multiple formatters in sequence. \n * @param formatters The list of ObjectFormatterLike values to compose.\n * @returns An ObjectFormatter function.\n */\nexport function createCompositeFormatter(...formatters: ObjectFormatterLike[]): ObjectFormatter {\n if (!Array.isArray(formatters) || formatters.length == 0) {\n throw Error('Composite formatter requires a non-empty array of formatters');\n }\n\n const formattersFuncs = formatters.map(item => createObjectFormatter(item as any));\n\n return (obj: any) => {\n let result = formattersFuncs[0](obj);\n for (let index = 1; index < formatters.length; index++) {\n result = formattersFuncs[index](result);\n }\n return result;\n }\n}\n\n/**\n * Creates an ObjectFormatter from various ObjectFormatterLike types.\n * @param formatter The ObjectFormatterLike value to convert.\n * A formatter can be:\n * - A function: used directly as the formatter.\n * - A number: creates an index formatter that retrieves the value at the specified index from an array.\n * - A string: can be a field name (e.g., \"user.name\"), a predefined formatter symbol (\"#\", \"$\", \"@\"), or a locale formatter name (e.g., \"*date\").\n * - An array: if the first element is a predefined formatter symbol, it creates a formatter using that symbol and the rest of the elements as parameters. \n * Otherwise, it creates a composite formatter that applies each element in sequence.\n * @param params Additional parameters for the formatter.\n * @returns An ObjectFormatter function.\n */\nexport function createObjectFormatter(formatter: ObjectFormatterLike, ...params: any[]): ObjectFormatter {\n switch (typeof formatter) {\n case 'function':\n return formatter.bind(null, ...params);\n case 'number':\n return createIndexFormatter(formatter);\n case 'string':\n switch (formatter) {\n case '#':\n return createNumberFormatter(...params);\n case '$':\n return createCurrencyFormatter(...params);\n case '@':\n return createDateFormatter(...params);\n case '*':\n return createLocaleFormatter(formatter.substring(1));\n default:\n return createFieldFormatter(formatter);\n }\n case 'object':\n if (Array.isArray(formatter) && formatter.length > 0) {\n const formatterSymbols = ['#', '$', '@', '*'];\n\n if (formatterSymbols.includes(formatter[0])) {\n return createObjectFormatter(formatter[0], ...formatter.slice(1));\n } else {\n return createCompositeFormatter(...formatter)\n }\n }\n break;\n }\n\n throw Error('invalid formatter', { cause: formatter });\n}\n\n/**\n * Creates a transform function that converts a ObjectFormatterLike value into a ObjectFormatter.\n * @param injector The EnvironmentInjector to use for dependency injection.\n * @returns A function that takes a ObjectFormatterLike and returns a ObjectFormatter.\n */\nexport function objectFormatterAttribute(injector: EnvironmentInjector): ((v: ObjectFormatterLike) => ObjectFormatter) {\n return (x: ObjectFormatterLike) => runInInjectionContext(injector, createObjectFormatter.bind(null, x));\n};\n","import { EnvironmentInjector, inject, Pipe, PipeTransform, runInInjectionContext } from '@angular/core';\nimport { createDateFormatter } from './formatter';\n\n@Pipe({\n name: 'ng0Date',\n standalone: true,\n pure: true\n})\nexport class DatePipe implements PipeTransform {\n private _injector = inject(EnvironmentInjector);\n\n transform(value: Date | string | number,\n dateStyle?: 'short' | 'medium' | 'long' | 'full',\n timeStyle?: 'short' | 'medium' | 'long' | 'full',\n zone?: string[],\n calendar?: string): string;\n transform(value: Date | string | number, options?: Intl.DateTimeFormatOptions): string;\n transform(value: Date | string | number, ...options: any[]): string {\n const formatter = runInInjectionContext(this._injector, createDateFormatter.bind(null, ...options));\n return formatter(value);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0Localize',\n standalone: true,\n pure: false\n})\nexport class LocalizePipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(dictionaryKey: string) {\n return this._ls.get()?.translate(dictionaryKey);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Pipe({\n name: 'ng0LocalizeEnum',\n standalone: true,\n pure: false\n})\nexport class LocalizeEnumPipe implements PipeTransform {\n private _recompute = true;\n private _value?: string;\n\n constructor(private _ls: LocalizationService) {\n _ls.change.pipe(takeUntilDestroyed()).subscribe(x => this._recompute = true);\n }\n\n /**\n * \n * @param enumValue \n * @param enumName \n * @param nullValueKey \n * @param returnEnumAsFallback\n * @param fallbackKey \n * @returns \n */\n transform(enumValue: string | number | null | undefined, enumName: string, fallback?: string): any {\n if (this._recompute) {\n this._value = this._ls.get()?.translateEnum(enumName, enumValue, fallback);\n this._recompute = false;\n }\n\n return this._value;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { LocalizationService } from './localization.service';\n\n@Pipe({\n name: 'ng0LocalizeBool',\n standalone: true,\n pure: false\n})\nexport class LocalizeBooleanPipe implements PipeTransform {\n constructor(private _ls: LocalizationService) {\n }\n\n transform(value: any, falseKey = 'true', trueKey: 'false') {\n return this._ls.get()?.translate(value ? trueKey : falseKey);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Locale } from './locale';\nimport { LocalizationService } from './localization.service';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\n@Pipe({\n name: 'ng0LocalizeDate',\n standalone: true,\n pure: false\n})\nexport class LocalizeDatePipe implements PipeTransform {\n private _value?: string;\n private _recompute = true;\n\n constructor(private _ls: LocalizationService) {\n _ls.change.pipe(takeUntilDestroyed()).subscribe(x => this._recompute = true);\n }\n\n transform(value: number | string, format?: string) {\n if (this._recompute) {\n this._value = this._ls.get()?.formatDate(value, format);\n this._recompute = false;\n }\n\n return this._value;\n }\n}\n","import { EnvironmentInjector, inject, Pipe, PipeTransform, runInInjectionContext } from '@angular/core';\nimport { createObjectFormatter, ObjectFormatterLike } from './formatter';\n\n/**\n * Format pipe to format objects using various formatter types.\n */\n@Pipe({\n name: 'ng0Format',\n standalone: true,\n pure: true\n})\nexport class FormatPipe implements PipeTransform {\n private readonly _injector = inject(EnvironmentInjector);\n \n transform(obj: any, formatter: ObjectFormatterLike, ...params: any[]): any {\n const frmtFunc = runInInjectionContext(this._injector, createObjectFormatter.bind(null, formatter, ...params));\n return frmtFunc(obj);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { TranslatePipe } from './translate.pipe';\nimport { TranslateEnumPipe } from './translate-enum.pipe';\nimport { TranslateBooleanPipe } from './translate-boolean-pipe';\nimport { DatePipe } from './date.pipe';\nimport { LocalizePipe } from './localize.pipe';\nimport { LocalizeEnumPipe } from './localize-enum.pipe';\nimport { LocalizeBooleanPipe } from './localize-boolean-pipe';\nimport { LocalizeDatePipe } from './localize-date.pipe';\nimport { FormatPipe } from './format.pipe';\n\nconst Declares = [\n // Pure pipes\n TranslatePipe,\n TranslateEnumPipe,\n TranslateBooleanPipe,\n DatePipe,\n FormatPipe,\n\n // Impure pipes\n LocalizePipe,\n LocalizeEnumPipe,\n LocalizeBooleanPipe,\n LocalizeDatePipe\n];\n\n@NgModule({\n imports: Declares,\n exports: Declares\n})\nexport class LocalizationModule {\n}\n\n","import { InjectionToken } from '@angular/core';\nimport { LocalizationService } from './localization.service';\nimport { Locale } from './locale';\n\nexport const LOCALE = new InjectionToken<Locale | LocalizationService>('LOCALE');\n\nexport interface TranslatedValidationError {\n /** Error key */\n key: string;\n \n /** Error object */\n value: any;\n \n /** localized error text */\n text?: string;\n }\n \n export interface LocaleChangeEvent {\n old?: Locale;\n new: Locale;\n }\n ","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.LocalizationService"],"mappings":";;;;;;AAKA;MACa,MAAM,CAAA;AACW,IAAA,UAAA;AAA5B,IAAA,WAAA,CAA4B,UAA4B,EAAA;QAA5B,IAAA,CAAA,UAAU,GAAV,UAAU;IACtC;AAEA;;;AAGG;AACH,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI;IAC7B;AAEA;;;;;AAKG;IACH,SAAS,CAAC,GAAW,EAAE,QAAiB,EAAA;QACtC,OAAO,IAAI,CAAC,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,IAAI,QAAQ;IACtD;AAEA;;;;;;AAMG;AAEH,IAAA,aAAa,CAAC,QAAgB,EAAE,SAA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AU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACP,iBAAA;;;ACED,MAAM,QAAQ,GAAG;;IAEf,aAAa;IACb,iBAAiB;IACjB,oBAAoB;IACpB,QAAQ;IACR,UAAU;;IAGV,YAAY;IACZ,gBAAgB;IAChB,mBAAmB;IACnB;CACD;MAMY,kBAAkB,CAAA;wGAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;yGAAlB,kBAAkB,EAAA,OAAA,EAAA;;YAjB7B,aAAa;YACb,iBAAiB;YACjB,oBAAoB;YACpB,QAAQ;YACR,UAAU;;YAGV,YAAY;YACZ,gBAAgB;YAChB,mBAAmB;YACnB,gBAAgB,CAAA,EAAA,OAAA,EAAA;;YAVhB,aAAa;YACb,iBAAiB;YACjB,oBAAoB;YACpB,QAAQ;YACR,UAAU;;YAGV,YAAY;YACZ,gBAAgB;YAChB,mBAAmB;YACnB,gBAAgB,CAAA,EAAA,CAAA;yGAOL,kBAAkB,EAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,QAAQ;AACjB,oBAAA,OAAO,EAAE;AACV,iBAAA;;;MC1BY,MAAM,GAAG,IAAI,cAAc,CAA+B,QAAQ;;ACJ/E;;AAEG;;;;"}
package/form/index.d.ts CHANGED
@@ -132,10 +132,10 @@ declare class FileExtensionValidatorDirective implements Validator {
132
132
  /**
133
133
  * Allowed file extensions.
134
134
  */
135
- readonly allowedExtensions: i0.InputSignal<string[]>;
135
+ readonly allowedExtensions: i0.InputSignal<string[] | undefined>;
136
136
  validate(control: AbstractControl): ValidationErrors | null;
137
137
  static ɵfac: i0.ɵɵFactoryDeclaration<FileExtensionValidatorDirective, never>;
138
- static ɵdir: i0.ɵɵDirectiveDeclaration<FileExtensionValidatorDirective, "[ngModel][ng0File][ng0FileExtension]", ["ng0MaxFileSize"], { "allowedExtensions": { "alias": "ng0FileExtension"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
138
+ static ɵdir: i0.ɵɵDirectiveDeclaration<FileExtensionValidatorDirective, "[ngModel][ng0File][ng0FileExtension]", ["ng0FileExtension"], { "allowedExtensions": { "alias": "ng0FileExtension"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
139
139
  }
140
140
 
141
141
  declare class EqualWithValidatorDirective implements Validator {
@@ -187,6 +187,6 @@ declare function fileMinSizeValidator(size: number): ValidatorFn;
187
187
 
188
188
  declare function fileMaxSizeValidator(size: number): ValidatorFn;
189
189
 
190
- declare function fileExtensionValidator(allowedExtensions: string[]): ValidatorFn;
190
+ declare function fileExtensionValidator(allowedExtensions?: string[]): ValidatorFn;
191
191
 
192
192
  export { CustomValidatorDirective, EqualWithValidatorDirective, FileExtensionValidatorDirective, FileMaxSizeValidatorDirective, FileMinSizeValidatorDirective, FileValueAccessor, FocusDirective, FormModule, MaxValidatorDirective, MinValidatorDirective, NumberDirective, UrlValidatorDirective, ValidationModule, equalWithValidator, fileExtensionValidator, fileMaxSizeValidator, fileMinSizeValidator };
package/http/index.d.ts CHANGED
@@ -127,6 +127,26 @@ declare class HttpService {
127
127
  static ɵprov: i0.ɵɵInjectableDeclaration<HttpService>;
128
128
  }
129
129
 
130
+ /**
131
+ * Utility function to create FormData from an object.
132
+ * The function iterates over the properties of the input object and appends them to a FormData instance.
133
+ * It handles string, File, Blob, number, and nested object types. For nested objects, it stringifies them before appending.
134
+ * This function is useful for preparing data to be sent in a multipart/form-data request,
135
+ * especially when dealing with file uploads and complex data structures.
136
+ * @example
137
+ * const data = {
138
+ * name: 'John Doe',
139
+ * age: 30,
140
+ * profilePicture: fileInput.files[0],
141
+ * preferences: { theme: 'dark', notifications: true }
142
+ * };
143
+ * const formData = toFormData(data);
144
+ * // formData can now be sent in an HTTP request with content type 'multipart/form-data'.
145
+ * @param data The input object containing the data to be converted into FormData. The properties of this object can be of type string, number, File, Blob, or nested objects.
146
+ * @returns The FormData instance containing the data from the input object.
147
+ */
148
+ declare function toFormData(data: any): FormData;
149
+
130
150
  declare const HTTP_SERVICE_CONFIG: InjectionToken<HttpServiceConfig>;
131
151
  /**
132
152
  * Configuration for the HttpService.
@@ -163,5 +183,5 @@ declare function provideHttpService(config?: HttpServiceConfig, ...features: Par
163
183
  */
164
184
  declare function httpDataRequestResolver1<T = any>(url: string, dataRequest: DataRequest, options?: HttpRequestOptions): Observable<DataResult<T>>;
165
185
 
166
- export { HTTP_SERVICE_CONFIG, HttpService, httpDataRequestResolver1, provideHttpService };
186
+ export { HTTP_SERVICE_CONFIG, HttpService, httpDataRequestResolver1, provideHttpService, toFormData };
167
187
  export type { HttpDataRequestResolver, HttpRequestCompleteEvent, HttpRequestErrorEvent, HttpRequestEvent, HttpRequestEventBase, HttpRequestOptions, HttpRequestProgressEvent, HttpRequestSendEvent, HttpServiceConfig, HttpServiceFeature };
@@ -42,13 +42,26 @@ declare function createIndexFormatter(index: number | boolean): ObjectFormatter;
42
42
  declare function createNumberFormatter(minimumIntegerDigits?: number, minimumFractionDigits?: number, maximumFractionDigits?: number, useGrouping?: boolean): ObjectFormatter;
43
43
  /**
44
44
  * Creates a currency formatter.
45
- * @param minFractions
46
- * @param maxFractions
47
- * @returns
45
+ * @param currency The ISO 4217 currency code (e.g., "USD", "EUR", "IRR").
46
+ * @param minimumIntegerDigits Minimum number of integer digits to use. Default is 1.
47
+ * @param minimumFractionDigits Minimum number of fraction digits to use. Default is 1.
48
+ * @param maximumFractionDigits Maximum number of fraction digits to use. Default is 2.
49
+ * @param notation The notation to use. Default is 'standard'.
50
+ * @param currencySign The currency sign to use. Default is 'standard'.
51
+ * @returns An ObjectFormatter function.
48
52
  */
49
- declare function createCurrencyFormatter(minFractions?: number, maxFractions?: number): ObjectFormatter;
53
+ declare function createCurrencyFormatter(currency?: string, notation?: 'standard' | 'scientific' | 'engineering' | 'compact', minimumIntegerDigits?: number, minimumFractionDigits?: number, maximumFractionDigits?: number, currencySign?: 'standard' | 'accounting'): ObjectFormatter;
50
54
  /**
51
55
  * Creates a date formatter.
56
+ * The formatter can be created using predefined styles or custom Intl.DateTimeFormatOptions.
57
+ * Predefined styles:
58
+ * - dateStyle: 'short' | 'medium' | 'long' | 'full'
59
+ * - timeStyle: 'short' | 'medium' | 'long' | 'full'
60
+ * - zone: [name, display?] (e.g., ['UTC', 'short'])
61
+ * - calendar: string (e.g., 'gregory', 'persian', 'islamic')
62
+ * #### Custom options:
63
+ * - Any valid Intl.DateTimeFormatOptions can be used for custom formatting.
64
+ * @returns An ObjectFormatter function.
52
65
  */
53
66
  declare function createDateFormatter(dateStyle?: 'short' | 'medium' | 'long' | 'full', timeStyle?: 'short' | 'medium' | 'long' | 'full', zone?: string[], // zone[0]: name, zone[1]: display ('long' | 'short' | 'shortOffset' | 'longOffset' | 'narrowOffset' | 'longGeneric' | 'shortGeneric')
54
67
  calendar?: string): ObjectFormatter;
@@ -70,7 +83,12 @@ declare function createCompositeFormatter(...formatters: ObjectFormatterLike[]):
70
83
  /**
71
84
  * Creates an ObjectFormatter from various ObjectFormatterLike types.
72
85
  * @param formatter The ObjectFormatterLike value to convert.
73
- * @param locale Optional locale object for locale-based formatting.
86
+ * A formatter can be:
87
+ * - A function: used directly as the formatter.
88
+ * - A number: creates an index formatter that retrieves the value at the specified index from an array.
89
+ * - A string: can be a field name (e.g., "user.name"), a predefined formatter symbol ("#", "$", "@"), or a locale formatter name (e.g., "*date").
90
+ * - An array: if the first element is a predefined formatter symbol, it creates a formatter using that symbol and the rest of the elements as parameters.
91
+ * Otherwise, it creates a composite formatter that applies each element in sequence.
74
92
  * @param params Additional parameters for the formatter.
75
93
  * @returns An ObjectFormatter function.
76
94
  */
@@ -128,8 +146,12 @@ interface LocaleDefinition {
128
146
  /** Does this locale belongs to a RTL language */
129
147
  readonly rtl?: boolean;
130
148
  /** Intl API default options */
131
- intl?: {
132
- date?: Intl.DateTimeFormatOptions;
149
+ date?: {
150
+ /**
151
+ * Default options for Intl.DateTimeFormat API.
152
+ * For more info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DateTimeFormat#parameters
153
+ */
154
+ options?: Intl.DateTimeFormatOptions;
133
155
  };
134
156
  /** Locale dictionary */
135
157
  dictionary?: LocaleDictionary;
@@ -310,7 +332,7 @@ declare class DatePipe implements PipeTransform {
310
332
  * Format pipe to format objects using various formatter types.
311
333
  */
312
334
  declare class FormatPipe implements PipeTransform {
313
- private _injector;
335
+ private readonly _injector;
314
336
  transform(obj: any, formatter: ObjectFormatterLike, ...params: any[]): any;
315
337
  static ɵfac: i0.ɵɵFactoryDeclaration<FormatPipe, never>;
316
338
  static ɵpipe: i0.ɵɵPipeDeclaration<FormatPipe, "ng0Format", true>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bootkit/ng0",
3
- "version": "0.0.0-alpha.52",
3
+ "version": "0.0.0-alpha.54",
4
4
  "description": "Angular+Bootstrap Component Library",
5
5
  "homepage": "https://bootkitlib.github.io/",
6
6
  "author": "BootKit",
@@ -22,7 +22,8 @@
22
22
  "@angular/cdk": ">=20.2.0"
23
23
  },
24
24
  "dependencies": {
25
- "tslib": "^2.3.0"
25
+ "tslib": "^2.3.0",
26
+ "deepmerge": "^4.3.1"
26
27
  },
27
28
  "sideEffects": false,
28
29
  "module": "fesm2022/bootkit-ng0.mjs",