@kirbydesign/extensions-angular 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -212,32 +212,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
212
212
  }]
213
213
  }], ctorParameters: () => [{ type: FormatNumberService }] });
214
214
 
215
- function formatAmount(amount, locale, nativeCurrency, amountServiceConfiguration) {
216
- const config = deriveConfiguration(amountServiceConfiguration);
217
- let formattedAmount = formatNumber(amount && amount.amount, locale, config.digitsInfo);
218
- if (config.stripSign) {
215
+ function formatAmount(amount, locale, config, amountServiceConfiguration) {
216
+ const amountConfig = deriveConfiguration(amountServiceConfiguration);
217
+ let formattedAmount = formatNumber(amount && amount.amount, locale, amountConfig.digitsInfo);
218
+ if (amountConfig.stripSign) {
219
219
  formattedAmount = formattedAmount.replace('-', '').trim();
220
220
  }
221
- const currencyCodeToAppend = deriveCurrencyCode(config, amount, nativeCurrency);
221
+ const currencyCodeToAppend = deriveCurrencyCode(amountConfig, amount, config);
222
222
  if (!currencyCodeToAppend) {
223
223
  return formattedAmount;
224
224
  }
225
- if (config.currencyCodePosition === 'postfix') {
225
+ if (amountConfig.currencyCodePosition === 'postfix') {
226
226
  return formattedAmount + ' ' + currencyCodeToAppend;
227
227
  }
228
228
  else {
229
229
  return currencyCodeToAppend + ' ' + formattedAmount;
230
230
  }
231
231
  }
232
- function deriveCurrencyCode(config, amount, nativeCurrency) {
232
+ function deriveCurrencyCode(amountConfig, amount, config) {
233
233
  let currencyCodeToAppend;
234
- if (config.showCurrencyCode) {
235
- if (config.showCurrencyCode === 'alwaysShowCurrency') {
236
- currencyCodeToAppend = amount && amount.currencyCode;
234
+ if (amountConfig.showCurrencyCode) {
235
+ if (amountConfig.showCurrencyCode === 'alwaysShowCurrency') {
236
+ currencyCodeToAppend = amount.currencyCode;
237
237
  }
238
- else if (config.showCurrencyCode === 'showForeignCurrency') {
238
+ else if (amountConfig.showCurrencyCode === 'showForeignCurrency') {
239
239
  currencyCodeToAppend =
240
- amount && amount.currencyCode !== nativeCurrency ? amount.currencyCode : '';
240
+ amount.currencyCode !== config.nativeCurrency ? amount.currencyCode : '';
241
+ }
242
+ else if (amountConfig.showCurrencyCode === 'useCurrencyMapping') {
243
+ currencyCodeToAppend = config.currencyMappings?.[amount.currencyCode] || amount.currencyCode;
241
244
  }
242
245
  }
243
246
  return currencyCodeToAppend || '';
@@ -275,7 +278,7 @@ class AmountService {
275
278
  currencyCode: '',
276
279
  };
277
280
  }
278
- return formatAmount(amount, this.locale, this.config.nativeCurrency, amountServiceConfiguration);
281
+ return formatAmount(amount, this.locale, this.config, amountServiceConfiguration);
279
282
  }
280
283
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
281
284
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AmountService, providedIn: 'root' }); }
@@ -1 +1 @@
1
- {"version":3,"file":"kirbydesign-extensions-angular-localization.mjs","sources":["../../localization/src/date-time/date-formats.ts","../../localization/src/di-tokens.ts","../../localization/src/date-time/abstract-timezone-compensating.pipe.ts","../../localization/src/date-time/date-only/date-only.pipe.ts","../../localization/src/date-time/time-only/time-only.pipe.ts","../../localization/src/date-time/time-or-date/time-or-date.pipe.ts","../../localization/src/number/format-number.service.ts","../../localization/src/number/format-number.pipe.ts","../../localization/src/amount/amount-service-formatter.ts","../../localization/src/amount/amount.service.ts","../../localization/src/amount/amount.pipe.ts","../../localization/src/account-number/account-number-service-formatter.ts","../../localization/src/account-number/account-number.pipe.ts","../../localization/src/phone-number/phone-number.service.ts","../../localization/src/phone-number/phone-number.pipe.ts","../../localization/src/kirbydesign-extensions-angular-localization.ts"],"sourcesContent":["export class DateFormats {\n static readonly SHORT_DATE_FORMAT = 'dd.MM.yyyy';\n static readonly MEDIUM_DATE_FORMAT = 'd. MMMM y';\n static readonly MEDIUM_LETTER_DATE_FORMAT = 'dd. MMM yyyy';\n static readonly SHORT_TIME_FORMAT = 'HH:mm';\n static readonly MEDIUM_TIME_FORMAT = 'HH:mm:ss';\n static readonly SHORT_DATE_MEDIUM_TIME_FORMAT = `${DateFormats.SHORT_DATE_FORMAT} ${DateFormats.MEDIUM_TIME_FORMAT}`;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const KIRBY_EXTENSIONS_LOCALIZATION_TOKEN =\n new InjectionToken<KirbyExtensionsLocalizationToken>('KIRBY_EXTENSIONS_LOCALIZATION_TOKEN');\n\nexport function provideKirbyExtensionsLocalizationToken(\n factory: () => KirbyExtensionsLocalizationToken\n) {\n return {\n provide: KIRBY_EXTENSIONS_LOCALIZATION_TOKEN,\n useFactory: factory,\n };\n}\n\ninterface KirbyExtensionsLocalizationToken {\n /**\n * @example 'DKK | kr. | EUR'\n */\n nativeCurrency: string;\n /**\n * Default language for the application. Used to determine if the phone number country code should be shown, if not specified as input, based on the locale.\n * @example 'da'\n */\n defaultLang: string;\n /**\n * Default phone country code\n * @example '+45'\n */\n countryCode: string;\n /**\n * Default timezone for the application\n * @example 'Europe/Copenhagen'\n */\n timeZone: string;\n}\n","import { inject, LOCALE_ID, PipeTransform } from '@angular/core';\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { DateFormats } from './date-formats';\n\n/**\n * Abstract implementation of pipe that should format dates, and compensate for time-zone offset.\n *\n * This class provides tools for formatting dates (and timestamps) in a time zone\n */\nexport abstract class AbstractTimezoneCompensatingPipe implements PipeTransform {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n abstract transform(value: unknown, ...args: unknown[]): unknown;\n\n protected format(time: number | Date | string, formatPattern: string): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const timeZone = this.config.timeZone;\n const options = this.getIntlOptions(formatPattern);\n\n const formatter = new Intl.DateTimeFormat(this.locale, { ...options, timeZone });\n let formattedDate = formatter.format(date);\n\n // Capitalize month abbreviation and remove trailing period for `MEDIUM_LETTER_DATE_FORMAT`\n if (formatPattern === DateFormats.MEDIUM_LETTER_DATE_FORMAT) {\n formattedDate = formattedDate.replace(\n /(\\d{2}\\.\\s)(\\w+)\\.(\\s\\d{4})/,\n (_, day, month, year) => {\n return `${day}${month.charAt(0).toUpperCase()}${month.slice(1)}${year}`;\n }\n );\n }\n\n if (\n formatPattern === DateFormats.SHORT_TIME_FORMAT ||\n formatPattern === DateFormats.MEDIUM_TIME_FORMAT\n ) {\n formattedDate = formattedDate.replace(/\\./g, ':');\n }\n\n return formattedDate;\n }\n\n private getIntlOptions(formatPattern: string): Intl.DateTimeFormatOptions {\n switch (formatPattern) {\n case DateFormats.SHORT_DATE_FORMAT:\n return { year: 'numeric', month: '2-digit', day: '2-digit' };\n\n case DateFormats.MEDIUM_DATE_FORMAT:\n return { year: 'numeric', month: 'long', day: 'numeric' };\n\n case DateFormats.MEDIUM_LETTER_DATE_FORMAT:\n return {\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n };\n\n case DateFormats.SHORT_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', hour12: false };\n\n case DateFormats.MEDIUM_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };\n\n case DateFormats.SHORT_DATE_MEDIUM_TIME_FORMAT:\n return {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n\n default:\n throw new Error(`Unsupported format pattern: ${formatPattern}`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp as a date.\n */\n@Pipe({\n name: 'dateOnly',\n standalone: true,\n})\nexport class DateOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string): string {\n return this.format(input, DateFormats.SHORT_DATE_FORMAT);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\nexport type TimeOnlyFormat = 'short' | 'medium';\n\n/**\n * Formats a given timestamp as a time.\n *\n * Timestamps can be formatted as 2 variants:\n * - 'short' being 'HH:mm' (hours and minutes)\n * - 'medium' being 'HH:mm:ss' (as above, but with seconds appended)\n *\n */\n@Pipe({\n name: 'timeOnly',\n standalone: true,\n})\nexport class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string, format: TimeOnlyFormat = 'short'): string {\n return this.format(input, this.getFormat(format));\n }\n\n private getFormat(format: TimeOnlyFormat): string {\n switch (format) {\n case 'short':\n return DateFormats.SHORT_TIME_FORMAT;\n case 'medium':\n return DateFormats.MEDIUM_TIME_FORMAT;\n default:\n throw new Error(`Unable to derive format from \"${format}\"`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp so that:\n * - If timestamp is of \"today\", it's formatted as time with hours and minutes (eg. 23:56)\n * - If timestamp is different from \"today\", it's formatted as date with \"day of month\", month and year (eg. 28.02.2020)\n *\n * All formatting and parsing is expect to be handled in \"Europe/Copenhagen\" time zone and with\n * the locale provided by `LOCALE_ID`.\n */\n\n@Pipe({\n name: 'timeOrDate',\n standalone: true,\n})\nexport class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(\n time: number | Date | string,\n showSeconds = false,\n formatMonth: 'month-as-digits' | 'month-as-letters' = 'month-as-digits'\n ): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const today = new Date();\n const sameDay =\n date.getFullYear() === today.getFullYear() &&\n date.getMonth() === today.getMonth() &&\n date.getDate() === today.getDate();\n\n let format = DateFormats.SHORT_DATE_FORMAT;\n\n if (formatMonth === 'month-as-letters') {\n format = DateFormats.MEDIUM_LETTER_DATE_FORMAT;\n }\n\n if (sameDay) {\n format = showSeconds ? DateFormats.MEDIUM_TIME_FORMAT : DateFormats.SHORT_TIME_FORMAT;\n }\n\n return this.format(date, format);\n }\n}\n","import { formatNumber } from '@angular/common';\nimport { Inject, Injectable, LOCALE_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormatNumberService {\n constructor(@Inject(LOCALE_ID) private localeId: string) {}\n\n public formatNumber(value: number, digitsInfo: string) {\n if (value == null) {\n return '';\n }\n\n return formatNumber(value, this.localeId, digitsInfo);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { FormatNumberService } from './format-number.service';\n\n@Pipe({\n name: 'formatNumber',\n standalone: true,\n})\nexport class FormatNumberPipe implements PipeTransform {\n constructor(private formatNumberService: FormatNumberService) {}\n\n transform(value: number, digitsInfo = '1.2-2') {\n return this.formatNumberService.formatNumber(value, digitsInfo);\n }\n}\n","import { formatNumber } from '@angular/common';\n\nimport { Amount } from './amount.model';\n\nexport function formatAmount(\n amount: Amount,\n locale: string,\n nativeCurrency: string,\n amountServiceConfiguration?: AmountServiceConfiguration\n) {\n const config = deriveConfiguration(amountServiceConfiguration);\n\n let formattedAmount = formatNumber(amount && amount.amount, locale, config.digitsInfo);\n\n if (config.stripSign) {\n formattedAmount = formattedAmount.replace('-', '').trim();\n }\n\n const currencyCodeToAppend = deriveCurrencyCode(config, amount, nativeCurrency);\n\n if (!currencyCodeToAppend) {\n return formattedAmount;\n }\n if (config.currencyCodePosition === 'postfix') {\n return formattedAmount + ' ' + currencyCodeToAppend;\n } else {\n return currencyCodeToAppend + ' ' + formattedAmount;\n }\n}\n\nexport function deriveCurrencyCode(\n config: AmountServiceConfiguration,\n amount: Amount,\n nativeCurrency: string\n) {\n let currencyCodeToAppend;\n\n if (config.showCurrencyCode) {\n if (config.showCurrencyCode === 'alwaysShowCurrency') {\n currencyCodeToAppend = amount && amount.currencyCode;\n } else if (config.showCurrencyCode === 'showForeignCurrency') {\n currencyCodeToAppend =\n amount && amount.currencyCode !== nativeCurrency ? amount.currencyCode : '';\n }\n }\n\n return currencyCodeToAppend || '';\n}\n\nexport function deriveConfiguration(configuration: AmountServiceConfiguration = {}) {\n const config: AmountServiceConfiguration = {\n showCurrencyCode: '',\n digitsInfo: '1.2-2',\n stripSign: false,\n };\n\n return Object.assign({}, config, configuration);\n}\n\nexport type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency';\nexport type CurrencyCodePosition = '' | 'prefix' | 'postfix';\n\nexport interface AmountServiceConfiguration {\n /**\n * - '' - don't output CurrencyCode\n * - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency\n * - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency\n */\n showCurrencyCode?: ShowCurrencyCode;\n /**\n * The position of the currency code in the formatted amount\n * - 'postfix' - output CurrencyCode after the formatted amount, eg. 1.234,56 EUR\n * - 'prefix' - output CurrencyCode before the formatted amount, eg. DKK 1.234,56\n */\n currencyCodePosition?: CurrencyCodePosition;\n /**\n * A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n */\n digitsInfo?: string;\n /**\n * Remove the minus sign from the formatted amount and trim any leading or trailing whitespace.\n */\n stripSign?: boolean;\n /**\n * The string to return if the amount is empty\n */\n returnValueOnEmptyAmount?: string;\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { Amount } from './amount.model';\nimport {\n AmountServiceConfiguration,\n deriveConfiguration,\n formatAmount,\n} from './amount-service-formatter';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AmountService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration}\n *\n * The number is always formatted according to Angular LOCALE_ID\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n\n formatAmount(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n if (amount == undefined) {\n const config = deriveConfiguration(amountServiceConfiguration);\n if (config.returnValueOnEmptyAmount) {\n return config.returnValueOnEmptyAmount;\n }\n amount = {\n amount: 0.0,\n currencyCode: '',\n };\n }\n\n return formatAmount(\n amount,\n this.locale,\n this.config.nativeCurrency,\n amountServiceConfiguration\n );\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Amount } from './amount.model';\nimport { AmountService } from './amount.service';\nimport { AmountServiceConfiguration } from './amount-service-formatter';\n\n/**\n * Configuration object for the amount-pipe. The configuration object can be used to control\n * the formatting of the amount, and can be passed as an argument to the amount-pipe when used on an {@link Amount}.\n * - `showCurrencyCode`: Controls whether the currency code should be displayed or not.\n * - `''`: Don't output currency code\n * - `alwaysShowCurrency`: Always show currency code, regardless of presentation currency\n * - `showForeignCurrency`: Only show currency code if it differs from the presentation currency\n * - `digitsInfo`: A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n * - `stripSign`: Controls whether the minus sign should be stripped from a negative amount.\n * - `currencyCodePosition`: Controls the position of the currency code in the formatted amount.\n * - `postfix`: Output currency code after the formatted amount, e.g. 1.234,56 EUR\n * - `prefix`: Output currency code before the formatted amount, e.g. DKK 1.234,56\n */\n@Pipe({\n name: 'amount',\n standalone: true,\n})\nexport class AmountPipe implements PipeTransform {\n constructor(private amountService: AmountService) {}\n\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration} (or a number of arguments, for backwards compatibility).\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n transform(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n return this.amountService.formatAmount(amount, amountServiceConfiguration);\n }\n}\n","import { AccountNumber } from './account-number.model';\n\nexport function formatAccountNumber(value: AccountNumber): string {\n return `${value.regNo.padStart(4, '0')} ${value.accountNo.replace(/^0+/, '')}`;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AccountNumber } from './account-number.model';\nimport { formatAccountNumber } from './account-number-service-formatter';\n\n/**\n * Pipe that formats a {@link AccountNumber}-object to a common format.\n */\n@Pipe({\n name: 'accountNumber',\n standalone: true,\n})\nexport class AccountNumberPipe implements PipeTransform {\n /**\n * Formats the {@link AccountNumber} to a common format.\n *\n * @param value the {@link AccountNumber} to format\n */\n transform(value: AccountNumber): string | undefined {\n return formatAccountNumber(value);\n }\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { PhoneNumber } from './phone-number';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhoneNumberService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n private static chunkUpPhoneNumber(str: string, chunk: number): string {\n return str.match(new RegExp(`.{1,${chunk}}`, 'g'))?.join(' ') ?? '';\n }\n\n formatPhoneNumber(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n const countryCode =\n typeof phoneNumber === 'string' ? this.config.countryCode : phoneNumber.countryCode;\n const number = typeof phoneNumber === 'string' ? phoneNumber : phoneNumber.number;\n\n if (!/^\\d+$/.test(number)) {\n return;\n }\n\n if (showCountryCode === undefined) {\n showCountryCode = !this.locale.match(`${this.config.defaultLang}.*`);\n }\n\n const formattedNumber = PhoneNumberService.chunkUpPhoneNumber(number, chunk);\n\n if (showCountryCode) {\n return `${countryCode} ${formattedNumber}`;\n } else {\n return formattedNumber;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { PhoneNumber } from './phone-number';\nimport { PhoneNumberService } from './phone-number.service';\n\n@Pipe({\n name: 'phoneNumber',\n standalone: true,\n})\nexport class PhoneNumberPipe implements PipeTransform {\n constructor(private phoneNumberService: PhoneNumberService) {}\n\n /**\n * Transforms a phone number, chunked up with spaces between the chunks and the country code in front, if desired.\n *\n * @param phoneNumber A PhoneNumber or a string representation of a phone number\n * @param chunk The chunk size used to split up the phone number with spaces\n * @param showCountryCode Show the country code in front of the phone number. If a string representation is supplied, the KIRBY_EXTENSIONS_LOCALIZATION_TOKEN.countryCode is used.\n */\n transform(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n return this.phoneNumberService.formatPhoneNumber(phoneNumber, chunk, showCountryCode);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FormatNumberService","i1.AmountService","i1.PhoneNumberService"],"mappings":";;;;MAAa,WAAW,CAAA;aACN,IAAiB,CAAA,iBAAA,GAAG,YAAY,CAAC;aACjC,IAAkB,CAAA,kBAAA,GAAG,WAAW,CAAC;aACjC,IAAyB,CAAA,yBAAA,GAAG,cAAc,CAAC;aAC3C,IAAiB,CAAA,iBAAA,GAAG,OAAO,CAAC;aAC5B,IAAkB,CAAA,kBAAA,GAAG,UAAU,CAAC;aAChC,IAA6B,CAAA,6BAAA,GAAG,CAAG,EAAA,WAAW,CAAC,iBAAiB,IAAI,WAAW,CAAC,kBAAkB,CAAA,CAAE,CAAC;;;MCJ1G,mCAAmC,GAC9C,IAAI,cAAc,CAAmC,qCAAqC;AAEtF,SAAU,uCAAuC,CACrD,OAA+C,EAAA;IAE/C,OAAO;AACL,QAAA,OAAO,EAAE,mCAAmC;AAC5C,QAAA,UAAU,EAAE,OAAO;KACpB;AACH;;ACRA;;;;AAI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AAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
1
+ {"version":3,"file":"kirbydesign-extensions-angular-localization.mjs","sources":["../../localization/src/date-time/date-formats.ts","../../localization/src/di-tokens.ts","../../localization/src/date-time/abstract-timezone-compensating.pipe.ts","../../localization/src/date-time/date-only/date-only.pipe.ts","../../localization/src/date-time/time-only/time-only.pipe.ts","../../localization/src/date-time/time-or-date/time-or-date.pipe.ts","../../localization/src/number/format-number.service.ts","../../localization/src/number/format-number.pipe.ts","../../localization/src/amount/amount-service-formatter.ts","../../localization/src/amount/amount.service.ts","../../localization/src/amount/amount.pipe.ts","../../localization/src/account-number/account-number-service-formatter.ts","../../localization/src/account-number/account-number.pipe.ts","../../localization/src/phone-number/phone-number.service.ts","../../localization/src/phone-number/phone-number.pipe.ts","../../localization/src/kirbydesign-extensions-angular-localization.ts"],"sourcesContent":["export class DateFormats {\n static readonly SHORT_DATE_FORMAT = 'dd.MM.yyyy';\n static readonly MEDIUM_DATE_FORMAT = 'd. MMMM y';\n static readonly MEDIUM_LETTER_DATE_FORMAT = 'dd. MMM yyyy';\n static readonly SHORT_TIME_FORMAT = 'HH:mm';\n static readonly MEDIUM_TIME_FORMAT = 'HH:mm:ss';\n static readonly SHORT_DATE_MEDIUM_TIME_FORMAT = `${DateFormats.SHORT_DATE_FORMAT} ${DateFormats.MEDIUM_TIME_FORMAT}`;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport const KIRBY_EXTENSIONS_LOCALIZATION_TOKEN =\n new InjectionToken<KirbyExtensionsLocalizationToken>('KIRBY_EXTENSIONS_LOCALIZATION_TOKEN');\n\nexport function provideKirbyExtensionsLocalizationToken(\n factory: () => KirbyExtensionsLocalizationToken\n) {\n return {\n provide: KIRBY_EXTENSIONS_LOCALIZATION_TOKEN,\n useFactory: factory,\n };\n}\n\ntype DkkMapping = Record<'DKK', 'kr.'>;\n\ntype CurrencyMappings = DkkMapping & Record<string, string>;\n\nexport interface KirbyExtensionsLocalizationToken {\n /**\n * @example 'DKK | EUR'\n */\n nativeCurrency: string;\n /**\n * Default language for the application. Used to determine if the phone number country code should be shown, if not specified as input, based on the locale.\n * @example 'da'\n */\n defaultLang: string;\n /**\n * Default phone country code\n * @example '+45'\n */\n countryCode: string;\n /**\n * Default timezone for the application\n * @example 'Europe/Copenhagen'\n */\n timeZone: string;\n /**\n * @example { DKK: 'kr.', EUR: '€' }\n */\n currencyMappings?: CurrencyMappings;\n}\n","import { inject, LOCALE_ID, PipeTransform } from '@angular/core';\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { DateFormats } from './date-formats';\n\n/**\n * Abstract implementation of pipe that should format dates, and compensate for time-zone offset.\n *\n * This class provides tools for formatting dates (and timestamps) in a time zone\n */\nexport abstract class AbstractTimezoneCompensatingPipe implements PipeTransform {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n abstract transform(value: unknown, ...args: unknown[]): unknown;\n\n protected format(time: number | Date | string, formatPattern: string): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const timeZone = this.config.timeZone;\n const options = this.getIntlOptions(formatPattern);\n\n const formatter = new Intl.DateTimeFormat(this.locale, { ...options, timeZone });\n let formattedDate = formatter.format(date);\n\n // Capitalize month abbreviation and remove trailing period for `MEDIUM_LETTER_DATE_FORMAT`\n if (formatPattern === DateFormats.MEDIUM_LETTER_DATE_FORMAT) {\n formattedDate = formattedDate.replace(\n /(\\d{2}\\.\\s)(\\w+)\\.(\\s\\d{4})/,\n (_, day, month, year) => {\n return `${day}${month.charAt(0).toUpperCase()}${month.slice(1)}${year}`;\n }\n );\n }\n\n if (\n formatPattern === DateFormats.SHORT_TIME_FORMAT ||\n formatPattern === DateFormats.MEDIUM_TIME_FORMAT\n ) {\n formattedDate = formattedDate.replace(/\\./g, ':');\n }\n\n return formattedDate;\n }\n\n private getIntlOptions(formatPattern: string): Intl.DateTimeFormatOptions {\n switch (formatPattern) {\n case DateFormats.SHORT_DATE_FORMAT:\n return { year: 'numeric', month: '2-digit', day: '2-digit' };\n\n case DateFormats.MEDIUM_DATE_FORMAT:\n return { year: 'numeric', month: 'long', day: 'numeric' };\n\n case DateFormats.MEDIUM_LETTER_DATE_FORMAT:\n return {\n year: 'numeric',\n month: 'short',\n day: '2-digit',\n };\n\n case DateFormats.SHORT_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', hour12: false };\n\n case DateFormats.MEDIUM_TIME_FORMAT:\n return { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false };\n\n case DateFormats.SHORT_DATE_MEDIUM_TIME_FORMAT:\n return {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n\n default:\n throw new Error(`Unsupported format pattern: ${formatPattern}`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp as a date.\n */\n@Pipe({\n name: 'dateOnly',\n standalone: true,\n})\nexport class DateOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string): string {\n return this.format(input, DateFormats.SHORT_DATE_FORMAT);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\nexport type TimeOnlyFormat = 'short' | 'medium';\n\n/**\n * Formats a given timestamp as a time.\n *\n * Timestamps can be formatted as 2 variants:\n * - 'short' being 'HH:mm' (hours and minutes)\n * - 'medium' being 'HH:mm:ss' (as above, but with seconds appended)\n *\n */\n@Pipe({\n name: 'timeOnly',\n standalone: true,\n})\nexport class TimeOnlyPipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(input: number | Date | string, format: TimeOnlyFormat = 'short'): string {\n return this.format(input, this.getFormat(format));\n }\n\n private getFormat(format: TimeOnlyFormat): string {\n switch (format) {\n case 'short':\n return DateFormats.SHORT_TIME_FORMAT;\n case 'medium':\n return DateFormats.MEDIUM_TIME_FORMAT;\n default:\n throw new Error(`Unable to derive format from \"${format}\"`);\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AbstractTimezoneCompensatingPipe } from '../abstract-timezone-compensating.pipe';\nimport { DateFormats } from '../date-formats';\n\n/**\n * Formats a given timestamp so that:\n * - If timestamp is of \"today\", it's formatted as time with hours and minutes (eg. 23:56)\n * - If timestamp is different from \"today\", it's formatted as date with \"day of month\", month and year (eg. 28.02.2020)\n *\n * All formatting and parsing is expect to be handled in \"Europe/Copenhagen\" time zone and with\n * the locale provided by `LOCALE_ID`.\n */\n\n@Pipe({\n name: 'timeOrDate',\n standalone: true,\n})\nexport class TimeOrDatePipe extends AbstractTimezoneCompensatingPipe implements PipeTransform {\n transform(\n time: number | Date | string,\n showSeconds = false,\n formatMonth: 'month-as-digits' | 'month-as-letters' = 'month-as-digits'\n ): string {\n if (!time) {\n return '';\n }\n\n const date = typeof time === 'number' || typeof time === 'string' ? new Date(time) : time;\n\n const today = new Date();\n const sameDay =\n date.getFullYear() === today.getFullYear() &&\n date.getMonth() === today.getMonth() &&\n date.getDate() === today.getDate();\n\n let format = DateFormats.SHORT_DATE_FORMAT;\n\n if (formatMonth === 'month-as-letters') {\n format = DateFormats.MEDIUM_LETTER_DATE_FORMAT;\n }\n\n if (sameDay) {\n format = showSeconds ? DateFormats.MEDIUM_TIME_FORMAT : DateFormats.SHORT_TIME_FORMAT;\n }\n\n return this.format(date, format);\n }\n}\n","import { formatNumber } from '@angular/common';\nimport { Inject, Injectable, LOCALE_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FormatNumberService {\n constructor(@Inject(LOCALE_ID) private localeId: string) {}\n\n public formatNumber(value: number, digitsInfo: string) {\n if (value == null) {\n return '';\n }\n\n return formatNumber(value, this.localeId, digitsInfo);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { FormatNumberService } from './format-number.service';\n\n@Pipe({\n name: 'formatNumber',\n standalone: true,\n})\nexport class FormatNumberPipe implements PipeTransform {\n constructor(private formatNumberService: FormatNumberService) {}\n\n transform(value: number, digitsInfo = '1.2-2') {\n return this.formatNumberService.formatNumber(value, digitsInfo);\n }\n}\n","import { formatNumber } from '@angular/common';\nimport { KirbyExtensionsLocalizationToken } from '../di-tokens';\nimport { Amount } from './amount.model';\n\nexport function formatAmount(\n amount: Amount,\n locale: string,\n config: KirbyExtensionsLocalizationToken,\n amountServiceConfiguration?: AmountServiceConfiguration\n) {\n const amountConfig = deriveConfiguration(amountServiceConfiguration);\n\n let formattedAmount = formatNumber(amount && amount.amount, locale, amountConfig.digitsInfo);\n\n if (amountConfig.stripSign) {\n formattedAmount = formattedAmount.replace('-', '').trim();\n }\n\n const currencyCodeToAppend = deriveCurrencyCode(amountConfig, amount, config);\n\n if (!currencyCodeToAppend) {\n return formattedAmount;\n }\n if (amountConfig.currencyCodePosition === 'postfix') {\n return formattedAmount + ' ' + currencyCodeToAppend;\n } else {\n return currencyCodeToAppend + ' ' + formattedAmount;\n }\n}\n\nexport function deriveCurrencyCode(\n amountConfig: AmountServiceConfiguration,\n amount: Amount,\n config: KirbyExtensionsLocalizationToken\n) {\n let currencyCodeToAppend;\n\n if (amountConfig.showCurrencyCode) {\n if (amountConfig.showCurrencyCode === 'alwaysShowCurrency') {\n currencyCodeToAppend = amount.currencyCode;\n } else if (amountConfig.showCurrencyCode === 'showForeignCurrency') {\n currencyCodeToAppend =\n amount.currencyCode !== config.nativeCurrency ? amount.currencyCode : '';\n } else if (amountConfig.showCurrencyCode === 'useCurrencyMapping') {\n currencyCodeToAppend = config.currencyMappings?.[amount.currencyCode] || amount.currencyCode;\n }\n }\n\n return currencyCodeToAppend || '';\n}\n\nexport function deriveConfiguration(configuration: AmountServiceConfiguration = {}) {\n const config: AmountServiceConfiguration = {\n showCurrencyCode: '',\n digitsInfo: '1.2-2',\n stripSign: false,\n };\n\n return Object.assign({}, config, configuration);\n}\n\nexport type ShowCurrencyCode =\n | ''\n | 'alwaysShowCurrency'\n | 'showForeignCurrency'\n | 'useCurrencyMapping';\nexport type CurrencyCodePosition = '' | 'prefix' | 'postfix';\n\nexport interface AmountServiceConfiguration {\n /**\n * - '' - don't output CurrencyCode\n * - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency\n * - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency\n * - 'useCurrencyMapping' - Shows the currency symbol defined in KirbyExtensionsLocalizationToken.currencyMappings instead of the currency code. Fallback to currencyCode\n */\n showCurrencyCode?: ShowCurrencyCode;\n /**\n * The position of the currency code in the formatted amount\n * - 'postfix' - output CurrencyCode after the formatted amount, eg. 1.234,56 EUR\n * - 'prefix' - output CurrencyCode before the formatted amount, eg. DKK 1.234,56\n */\n currencyCodePosition?: CurrencyCodePosition;\n /**\n * A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n */\n digitsInfo?: string;\n /**\n * Remove the minus sign from the formatted amount and trim any leading or trailing whitespace.\n */\n stripSign?: boolean;\n /**\n * The string to return if the amount is empty\n */\n returnValueOnEmptyAmount?: string;\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { Amount } from './amount.model';\nimport {\n AmountServiceConfiguration,\n deriveConfiguration,\n formatAmount,\n} from './amount-service-formatter';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AmountService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration}\n *\n * The number is always formatted according to Angular LOCALE_ID\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n\n formatAmount(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n if (amount == undefined) {\n const config = deriveConfiguration(amountServiceConfiguration);\n if (config.returnValueOnEmptyAmount) {\n return config.returnValueOnEmptyAmount;\n }\n amount = {\n amount: 0.0,\n currencyCode: '',\n };\n }\n\n return formatAmount(amount, this.locale, this.config, amountServiceConfiguration);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { Amount } from './amount.model';\nimport { AmountService } from './amount.service';\nimport { AmountServiceConfiguration } from './amount-service-formatter';\n\n/**\n * Configuration object for the amount-pipe. The configuration object can be used to control\n * the formatting of the amount, and can be passed as an argument to the amount-pipe when used on an {@link Amount}.\n * - `showCurrencyCode`: Controls whether the currency code should be displayed or not.\n * - `''`: Don't output currency code\n * - `alwaysShowCurrency`: Always show currency code, regardless of presentation currency\n * - `showForeignCurrency`: Only show currency code if it differs from the presentation currency\n * - `digitsInfo`: A string that represents the format of the number. Learn more about the format here: https://angular.io/api/common/DecimalPipe#parameters\n * - `stripSign`: Controls whether the minus sign should be stripped from a negative amount.\n * - `currencyCodePosition`: Controls the position of the currency code in the formatted amount.\n * - `postfix`: Output currency code after the formatted amount, e.g. 1.234,56 EUR\n * - `prefix`: Output currency code before the formatted amount, e.g. DKK 1.234,56\n */\n@Pipe({\n name: 'amount',\n standalone: true,\n})\nexport class AmountPipe implements PipeTransform {\n constructor(private amountService: AmountService) {}\n\n /**\n * Applies the transformation logic, by taking the `amount`-argument, and a configuration object - {@link AmountServiceConfiguration} (or a number of arguments, for backwards compatibility).\n *\n * @param amount the {@link Amount} to configure\n * @param amountServiceConfiguration\n */\n transform(amount: Amount, amountServiceConfiguration?: AmountServiceConfiguration) {\n return this.amountService.formatAmount(amount, amountServiceConfiguration);\n }\n}\n","import { AccountNumber } from './account-number.model';\n\nexport function formatAccountNumber(value: AccountNumber): string {\n return `${value.regNo.padStart(4, '0')} ${value.accountNo.replace(/^0+/, '')}`;\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { AccountNumber } from './account-number.model';\nimport { formatAccountNumber } from './account-number-service-formatter';\n\n/**\n * Pipe that formats a {@link AccountNumber}-object to a common format.\n */\n@Pipe({\n name: 'accountNumber',\n standalone: true,\n})\nexport class AccountNumberPipe implements PipeTransform {\n /**\n * Formats the {@link AccountNumber} to a common format.\n *\n * @param value the {@link AccountNumber} to format\n */\n transform(value: AccountNumber): string | undefined {\n return formatAccountNumber(value);\n }\n}\n","import { inject, Injectable, LOCALE_ID } from '@angular/core';\n\nimport { KIRBY_EXTENSIONS_LOCALIZATION_TOKEN } from '../di-tokens';\nimport { PhoneNumber } from './phone-number';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class PhoneNumberService {\n private config = inject(KIRBY_EXTENSIONS_LOCALIZATION_TOKEN);\n private locale = inject(LOCALE_ID);\n\n private static chunkUpPhoneNumber(str: string, chunk: number): string {\n return str.match(new RegExp(`.{1,${chunk}}`, 'g'))?.join(' ') ?? '';\n }\n\n formatPhoneNumber(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n const countryCode =\n typeof phoneNumber === 'string' ? this.config.countryCode : phoneNumber.countryCode;\n const number = typeof phoneNumber === 'string' ? phoneNumber : phoneNumber.number;\n\n if (!/^\\d+$/.test(number)) {\n return;\n }\n\n if (showCountryCode === undefined) {\n showCountryCode = !this.locale.match(`${this.config.defaultLang}.*`);\n }\n\n const formattedNumber = PhoneNumberService.chunkUpPhoneNumber(number, chunk);\n\n if (showCountryCode) {\n return `${countryCode} ${formattedNumber}`;\n } else {\n return formattedNumber;\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\nimport { PhoneNumber } from './phone-number';\nimport { PhoneNumberService } from './phone-number.service';\n\n@Pipe({\n name: 'phoneNumber',\n standalone: true,\n})\nexport class PhoneNumberPipe implements PipeTransform {\n constructor(private phoneNumberService: PhoneNumberService) {}\n\n /**\n * Transforms a phone number, chunked up with spaces between the chunks and the country code in front, if desired.\n *\n * @param phoneNumber A PhoneNumber or a string representation of a phone number\n * @param chunk The chunk size used to split up the phone number with spaces\n * @param showCountryCode Show the country code in front of the phone number. If a string representation is supplied, the KIRBY_EXTENSIONS_LOCALIZATION_TOKEN.countryCode is used.\n */\n transform(\n phoneNumber: PhoneNumber | string,\n chunk = 2,\n showCountryCode?: boolean\n ): string | undefined {\n return this.phoneNumberService.formatPhoneNumber(phoneNumber, chunk, showCountryCode);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FormatNumberService","i1.AmountService","i1.PhoneNumberService"],"mappings":";;;;MAAa,WAAW,CAAA;aACN,IAAiB,CAAA,iBAAA,GAAG,YAAY,CAAC;aACjC,IAAkB,CAAA,kBAAA,GAAG,WAAW,CAAC;aACjC,IAAyB,CAAA,yBAAA,GAAG,cAAc,CAAC;aAC3C,IAAiB,CAAA,iBAAA,GAAG,OAAO,CAAC;aAC5B,IAAkB,CAAA,kBAAA,GAAG,UAAU,CAAC;aAChC,IAA6B,CAAA,6BAAA,GAAG,CAAG,EAAA,WAAW,CAAC,iBAAiB,IAAI,WAAW,CAAC,kBAAkB,CAAA,CAAE,CAAC;;;MCJ1G,mCAAmC,GAC9C,IAAI,cAAc,CAAmC,qCAAqC;AAEtF,SAAU,uCAAuC,CACrD,OAA+C,EAAA;IAE/C,OAAO;AACL,QAAA,OAAO,EAAE,mCAAmC;AAC5C,QAAA,UAAU,EAAE,OAAO;KACpB;AACH;;ACRA;;;;AAIG;MACmB,gCAAgC,CAAA;AAAtD,IAAA,WAAA,GAAA;AACU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,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,aAAa;AACnB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -1,14 +1,16 @@
1
+ import { KirbyExtensionsLocalizationToken } from '../di-tokens';
1
2
  import { Amount } from './amount.model';
2
- export declare function formatAmount(amount: Amount, locale: string, nativeCurrency: string, amountServiceConfiguration?: AmountServiceConfiguration): string;
3
- export declare function deriveCurrencyCode(config: AmountServiceConfiguration, amount: Amount, nativeCurrency: string): string;
3
+ export declare function formatAmount(amount: Amount, locale: string, config: KirbyExtensionsLocalizationToken, amountServiceConfiguration?: AmountServiceConfiguration): string;
4
+ export declare function deriveCurrencyCode(amountConfig: AmountServiceConfiguration, amount: Amount, config: KirbyExtensionsLocalizationToken): string;
4
5
  export declare function deriveConfiguration(configuration?: AmountServiceConfiguration): AmountServiceConfiguration;
5
- export type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency';
6
+ export type ShowCurrencyCode = '' | 'alwaysShowCurrency' | 'showForeignCurrency' | 'useCurrencyMapping';
6
7
  export type CurrencyCodePosition = '' | 'prefix' | 'postfix';
7
8
  export interface AmountServiceConfiguration {
8
9
  /**
9
10
  * - '' - don't output CurrencyCode
10
11
  * - 'alwaysShowCurrency' - always shows CurrencyCode, regardless of presentation currency
11
12
  * - 'showForeignCurrency' - only show CurrencyCode if it differs from the presentation currency
13
+ * - 'useCurrencyMapping' - Shows the currency symbol defined in KirbyExtensionsLocalizationToken.currencyMappings instead of the currency code. Fallback to currencyCode
12
14
  */
13
15
  showCurrencyCode?: ShowCurrencyCode;
14
16
  /**
@@ -4,9 +4,11 @@ export declare function provideKirbyExtensionsLocalizationToken(factory: () => K
4
4
  provide: InjectionToken<KirbyExtensionsLocalizationToken>;
5
5
  useFactory: () => KirbyExtensionsLocalizationToken;
6
6
  };
7
- interface KirbyExtensionsLocalizationToken {
7
+ type DkkMapping = Record<'DKK', 'kr.'>;
8
+ type CurrencyMappings = DkkMapping & Record<string, string>;
9
+ export interface KirbyExtensionsLocalizationToken {
8
10
  /**
9
- * @example 'DKK | kr. | EUR'
11
+ * @example 'DKK | EUR'
10
12
  */
11
13
  nativeCurrency: string;
12
14
  /**
@@ -24,5 +26,9 @@ interface KirbyExtensionsLocalizationToken {
24
26
  * @example 'Europe/Copenhagen'
25
27
  */
26
28
  timeZone: string;
29
+ /**
30
+ * @example { DKK: 'kr.', EUR: '€' }
31
+ */
32
+ currencyMappings?: CurrencyMappings;
27
33
  }
28
34
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirbydesign/extensions-angular",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0 || ^19.0.0",
6
6
  "@angular/compiler": "^18.0.0 || ^19.0.0",