@acorex/core 19.8.0-next.9 → 19.10.0-next.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.
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +30 -5
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +1 -1
- package/fesm2022/acorex-core-translation.mjs +11 -5
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +1 -1
- package/fesm2022/acorex-core-validation.mjs +1 -1
- package/format/index.d.ts +1 -0
- package/format/lib/format.directive.d.ts +12 -0
- package/format/lib/format.module.d.ts +2 -1
- package/format/lib/format.service.d.ts +1 -1
- package/package.json +5 -5
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-date-time.mjs","sources":["../../../../libs/core/date-time/src/lib/datetime.class.ts","../../../../libs/core/date-time/src/lib/georgian.calendar.ts","../../../../libs/core/date-time/src/lib/jalali.calendar.ts","../../../../libs/core/date-time/src/lib/dateTime.config.ts","../../../../libs/core/date-time/src/lib/holidays.loader.ts","../../../../libs/core/date-time/src/lib/calendar.service.ts","../../../../libs/core/date-time/src/lib/datetime.pipe.ts","../../../../libs/core/date-time/src/lib/formatters/datetime-formatter.ts","../../../../libs/core/date-time/src/lib/formatters/time-duration-formatter.ts","../../../../libs/core/date-time/src/lib/formatters/timeleft-formatter.ts","../../../../libs/core/date-time/src/lib/datetime.module.ts","../../../../libs/core/date-time/src/acorex-core-date-time.ts"],"sourcesContent":["import { isBrowser } from '@acorex/core/platform';\nimport { translateSync } from '@acorex/core/translation';\nimport { defaults, orderBy } from 'lodash-es';\n\nexport type TimeUnit = 'ms' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'week';\n\nexport interface AXDateValue {\n year: number;\n month: number;\n date: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n ms?: number;\n}\n\nexport interface AXDateTimeDisplayFormats {\n dateInput: string;\n timeInput: string;\n dateTimeInput: string;\n dateDisplay: string;\n timeDisplay: string;\n dateTimeDisplay: string;\n}\n\nexport type AXDateTimeUnitNames = {\n long: string;\n short: string;\n letter: string;\n}[];\n\nexport type AXDateTimePart = {\n key: string;\n placeholder: string;\n placeholders: string[];\n typedValue?: string | null;\n default: number;\n enabled: boolean;\n realValue: () => string;\n};\n\nexport type AXDateTimeParts = {\n year: AXDateTimePart;\n month: AXDateTimePart;\n day: AXDateTimePart;\n hour: AXDateTimePart;\n minute: AXDateTimePart;\n second: AXDateTimePart;\n};\n\nexport interface AXCalendarConfig {\n weekdays: number[];\n weekend: number[];\n formats: AXDateTimeDisplayFormats;\n}\n\nexport abstract class AXCalendar {\n private _config: AXCalendarConfig;\n\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n this._config = config;\n }\n\n public get weekend(): number[] {\n return this._config.weekend;\n }\n\n public get formats(): AXDateTimeDisplayFormats {\n return this._config.formats;\n }\n\n public get weekdays(): number[] {\n return this._config.weekdays;\n }\n\n abstract name(): string;\n\n abstract dayOfMonth(date: Date): number;\n\n abstract dayOfYear(date: Date): number;\n\n abstract dayOfWeek(date: Date): number;\n\n abstract monthOfYear(date: Date): number;\n\n abstract weekOfYear(date: Date): number;\n\n abstract year(date: Date): number;\n\n abstract add(date: Date, unit: TimeUnit, amount: number): AXDateTime;\n\n abstract set(date: Date, unit: TimeUnit, value: number): AXDateTime;\n\n abstract startOf(date: Date, unit: TimeUnit): AXDateTime;\n\n abstract endOf(date: Date, unit: TimeUnit): AXDateTime;\n\n abstract create(value: AXDateValue): AXDateTime;\n\n abstract parse(value: string): AXDateTime;\n}\n\nexport class AXDateTime {\n private _date: Date;\n\n get date(): Date {\n return this._date;\n }\n\n private _calendar: AXCalendar;\n get calendar(): AXCalendar {\n return this._calendar;\n }\n\n constructor(value: Date, calendar: AXCalendar) {\n this._calendar = calendar;\n this._date = value;\n }\n\n clone(): AXDateTime {\n return new AXDateTime(this.date, this.calendar);\n }\n\n get dayOfMonth(): number {\n return this._calendar.dayOfMonth(this.date);\n }\n\n get dayOfYear(): number {\n return this._calendar.dayOfYear(this.date);\n }\n\n get dayOfWeek(): number {\n return this._calendar.dayOfWeek(this.date);\n }\n\n get hour(): number {\n return this._date.getHours();\n }\n\n get minute(): number {\n return this._date.getMinutes();\n }\n\n get second(): number {\n return this._date.getSeconds();\n }\n\n get year(): number {\n return this._calendar.year(this.date);\n }\n\n get monthOfYear(): number {\n return this._calendar.monthOfYear(this.date);\n }\n\n get weekOfYear(): number {\n return this._calendar.weekOfYear(this.date);\n }\n\n get month(): AXCalendarMonth {\n return new AXCalendarMonth(this);\n }\n\n add(unit: TimeUnit, amount: number): AXDateTime {\n return this._calendar.add(this.date, unit, amount);\n }\n\n set(unit: TimeUnit = 'day', value: number): AXDateTime {\n return this._calendar.set(this.date, unit, value);\n }\n\n duration(end: Date | AXDateTime): AXTimeSpan {\n const date = end instanceof AXDateTime ? end.date : (end as Date);\n const val = new AXDateTime(date, this.calendar);\n const range = new AXDateTimeRange(this, val);\n return range.duration();\n }\n\n startOf(unit: TimeUnit = 'day'): AXDateTime {\n return this._calendar.startOf(this.date, unit);\n }\n\n endOf(unit: TimeUnit = 'day'): AXDateTime {\n return this._calendar.endOf(this.date, unit);\n }\n\n //TODO: remove unused items\n private _formatKeys = {\n ss: () => this.pad(this.date.getSeconds(), 2),\n s: () => this.date.getSeconds().toString(),\n //\n dd: () => this.pad(this.calendar.dayOfMonth(this.date), 2),\n DD: () => this.pad(this.calendar.dayOfMonth(this.date), 2),\n d: () => this.calendar.dayOfMonth(this.date).toString(),\n //\n mm: () => this.pad(this.date.getMinutes(), 2),\n m: () => this.date.getMinutes().toString(),\n //\n MMMM: () => translateSync(`dateTime.months.${this.calendar.name()}.long.${this.calendar.monthOfYear(this.date) - 1}`),\n MMM: () => translateSync(`dateTime.months.${this.calendar.name()}.short.${this.calendar.monthOfYear(this.date) - 1}`),\n MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),\n M: () => this.calendar.monthOfYear(this.date),\n //\n E: () => translateSync(`dateTime.weekdays.long.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),\n DDD: () => translateSync(`dateTime.weekdays.short.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),\n DDDD: () => this._formatKeys['E'](),\n //\n yyyy: () => this.pad(this.calendar.year(this.date), 4),\n YYYY: () => this.pad(this.calendar.year(this.date), 4),\n yy: () => this.pad(this.calendar.year(this.date), 4).substring(2),\n YY: () => this.pad(this.calendar.year(this.date), 4).substring(2),\n //\n HH: () => this.pad(this.date.getHours(), 2),\n H: () => this.date.getHours().toString(),\n //\n hh: () => this.pad(this.date.getHours() % 12 || 12, 2),\n h: () => (this.date.getHours() % 12 || 12).toString(),\n //\n A: () => (this.date.getHours() < 12 ? 'am' : 'pm'),\n a: () => (this.date.getHours() < 12 ? 'am' : 'pm'),\n date: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),\n shortDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),\n longDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longDate')),\n //\n shortTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),\n time: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),\n longTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longTime')),\n //\n datetime: (options) => this.format('date time', { locale: options.locale }),\n };\n\n protected _language = () => (isBrowser() ? navigator.language : 'en-GB');\n\n format(format: string = this.getDateTimeFormatByLocale(this._language(), 'shortDate'), options?: { locale?: string }): string {\n const effectiveOptions = defaults({}, options, {\n locale: this._language(),\n });\n const re = new RegExp(orderBy(Object.keys(this._formatKeys), (c) => c.length, ['desc']).join('|'), 'gi');\n return format.replace(re, (matched) => {\n const f = this._formatKeys[matched];\n const r = f(effectiveOptions);\n return r;\n });\n }\n\n getDateTimeFormatByLocale(locale: string, style: 'shortDate' | 'longDate' | 'shortTime' | 'longTime'): string {\n let options: Intl.DateTimeFormatOptions = {};\n switch (style) {\n case 'shortDate': // Year, Month, Day\n options = { year: 'numeric', month: '2-digit', day: '2-digit' };\n break;\n case 'longDate': // Weekday, Month name, Day, Year\n options = {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n };\n break;\n case 'shortTime': // Hour, Minute\n options = { hour: '2-digit', minute: '2-digit', hour12: false };\n break;\n case 'longTime': // Hour, Minute, Second\n options = {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n break;\n }\n\n const formatter = new Intl.DateTimeFormat(locale, options);\n\n // Get parts of the date and/or time\n const parts = formatter.formatToParts(new Date());\n\n // Map parts to their respective format\n const formatMap: { [key: string]: string } = {\n day: 'dd',\n month: style == 'longDate' ? 'MMMM' : 'MM',\n year: 'yyyy',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n weekday: 'E',\n literal: '',\n };\n\n // Construct the date and/or time format string\n return parts\n .map((part) => {\n if (part.type === 'literal') {\n // Use the literal part directly as separator\n return part.value;\n } else {\n return formatMap[part.type] || part.value;\n }\n })\n .join('');\n }\n\n private pad(n, width, z = '0') {\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }\n\n equal(value: Date | AXDateTime, unit: TimeUnit = 'day') {\n return this.compare(value, unit) == 0;\n }\n\n compare(value: Date | AXDateTime, unit: TimeUnit = 'day') {\n const date = value instanceof AXDateTime ? value.date : (value as Date);\n const val = new AXDateTime(date, this.calendar);\n const func = (v1: number, v2: number) => {\n if (v1 == v2) {\n return 0;\n } else if (v1 > v2) {\n return 1;\n } else {\n return -1;\n }\n };\n let p = 0;\n switch (unit) {\n case 'year':\n return func(this.year, val.year);\n case 'week':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.weekOfYear, val.weekOfYear) : p;\n case 'month':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.monthOfYear, val.monthOfYear) : p;\n case 'day':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.dayOfYear, val.dayOfYear) : p;\n case 'hour':\n p = this.compare(val, 'day');\n return p == 0 ? func(this.hour, val.hour) : p;\n case 'minute':\n p = this.compare(val, 'hour');\n return p == 0 ? func(this.minute, val.minute) : p;\n case 'second':\n p = this.compare(val, 'minute');\n return p == 0 ? func(this.second, val.second) : p;\n default:\n return func(this.date.getTime(), val.date.getTime());\n }\n }\n}\n\nexport class AXCalendarMonth {\n private _range: AXDateTimeRange;\n public get range(): AXDateTimeRange {\n return this._range;\n }\n public set range(v: AXDateTimeRange) {\n this._range = v;\n }\n\n public get totalDays(): number {\n return this.range.endTime.dayOfMonth;\n }\n\n constructor(date: AXDateTime) {\n this.index = date.date.getMonth();\n this.name = date.format('MMMM');\n this.range = new AXDateTimeRange(\n new AXDateTime(date.startOf('month').date, date.calendar),\n new AXDateTime(date.endOf('month').date, date.calendar),\n );\n }\n\n private readonly index: number;\n private readonly name: string;\n}\n\nexport interface AXTimeSpanTotal {\n miliseconds: number;\n seconds: number;\n minutes: number;\n hours: number;\n days: number;\n weeks: number;\n months: number;\n years: number;\n}\n\nexport interface AXTimeSpan {\n miliseconds: number;\n seconds: number;\n minutes: number;\n hours: number;\n days: number;\n months: number;\n years: number;\n total: AXTimeSpanTotal;\n}\n\nexport class AXDateTimeRange {\n private _startTime: AXDateTime;\n private _endTime: AXDateTime;\n\n public get startTime(): AXDateTime {\n return this._startTime;\n }\n\n public get endTime(): AXDateTime {\n return this._endTime;\n }\n\n constructor(startTime: AXDateTime, endTime: AXDateTime) {\n this._startTime = startTime;\n this._endTime = endTime;\n }\n\n duration(): AXTimeSpan {\n const result: AXTimeSpan = {\n miliseconds: 0,\n seconds: 0,\n minutes: 0,\n hours: 0,\n days: 0,\n months: 0,\n years: 0,\n total: {\n miliseconds: 0,\n seconds: 0,\n minutes: 0,\n hours: 0,\n days: 0,\n weeks: 0,\n months: 0,\n years: 0,\n },\n };\n\n const one_second = 1000;\n const one_min = one_second * 60;\n const one_hour = one_min * 60;\n const one_day = one_hour * 24;\n const one_week = one_day * 7;\n const one_year = 365.25 * one_day;\n const one_month = one_year / 12;\n const startTime = this._startTime.date.getTime();\n const endTime = this._endTime.date.getTime();\n const diff = Math.abs(endTime - startTime);\n //\n result.total.miliseconds = diff;\n result.total.seconds = Number((diff / one_second).toFixed(2));\n result.total.minutes = Number((diff / one_min).toFixed(2));\n result.total.hours = Number((diff / one_hour).toFixed(2));\n result.total.days = Number((diff / one_day).toFixed(2));\n result.total.weeks = Number((diff / one_week).toFixed(2));\n //\n // let months = (this.endTime.year - this.startTime.year) * 12;\n // months += this.endTime.monthOfYear - this.startTime.monthOfYear + 1;\n // if (this.endTime.dayOfYear < this.startTime.dayOfYear) {\n // months--;\n // }\n // result.total.months = Math.abs(months);\n // TODO: review\n result.total.months = Number((diff / one_month).toFixed(2));\n result.total.years = Number((diff / one_year).toFixed(2));\n //\n result.miliseconds = result.total.miliseconds % 1000;\n result.seconds = Number((result.total.seconds % 60).toFixed(0));\n result.minutes = Number((result.total.minutes % 60).toFixed(0));\n result.hours = Number((result.total.hours % 24).toFixed(0));\n // TODO: review\n result.days = Number((result.total.days % 30.4).toFixed(0));\n result.months = Number((result.total.months % 12).toFixed(0));\n result.years = Number(result.total.years.toFixed(0));\n return result;\n }\n\n enumurate(unit: TimeUnit = 'day', amount = 1): AXDateTime[] {\n const result: AXDateTime[] = [];\n let item = this._startTime.clone();\n while (item.compare(this._endTime, unit) < 1) {\n if (!result.some((c) => c.equal(item, unit))) {\n result.push(item);\n }\n item = item.add(unit, amount);\n }\n return result;\n }\n}\n","import { AXCalendar, AXCalendarConfig, AXDateTime, AXDateValue, TimeUnit } from './datetime.class';\n\nexport class GeorgianCalendar extends AXCalendar {\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n super(config);\n }\n\n create(value: AXDateValue): AXDateTime {\n return new AXDateTime(\n new Date(value.year, value.month - 1, value.date, value.hours || 0, value.minutes || 0, value.seconds || 0, value.ms || 0),\n this,\n );\n }\n\n name(): string {\n return 'georgian';\n }\n\n dayOfMonth(date: Date): number {\n return date.getDate();\n }\n\n dayOfYear(date: Date): number {\n let result = 0;\n let m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (this.isLeap(date)) {\n m[1] = 29;\n }\n for (let i = 0; i < date.getMonth(); i++) {\n result = result + m[i];\n }\n result += date.getDate();\n return result;\n }\n\n dayOfWeek(date: Date): number {\n return date.getDay() + 1;\n }\n\n weekOfYear(date: Date): number {\n const firstDay = new AXDateTime(date, this).startOf('year');\n return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);\n }\n\n year(date: Date): number {\n return date.getFullYear();\n }\n\n monthOfYear(date: Date): number {\n return date.getMonth() + 1;\n }\n\n add(date: Date, unit: TimeUnit, amount: number): AXDateTime {\n let value = date.valueOf();\n switch (unit) {\n case 'second':\n value += 1000 * amount;\n break;\n case 'minute':\n value += 60000 * amount;\n break;\n case 'hour':\n value += 3600000 * amount;\n break;\n case 'month': {\n const v = new Date(value);\n\n // Calculate the new year and month considering the amount\n let newYear = v.getFullYear();\n let newMonth = v.getMonth() + amount;\n\n // Adjust for year overflow or underflow\n while (newMonth > 11) {\n newMonth -= 12;\n newYear++;\n }\n while (newMonth < 0) {\n newMonth += 12;\n newYear--;\n }\n\n // Set the date to the first of the month to prevent overflow\n v.setDate(1);\n v.setFullYear(newYear);\n v.setMonth(newMonth);\n\n // Get the last day of the new month\n const lastDayOfMonth = new Date(newYear, newMonth + 1, 0).getDate();\n\n // Set the date to either the original day or the last day of the new month, whichever is smaller\n const originalDay = date.getDate();\n v.setDate(Math.min(originalDay, lastDayOfMonth));\n\n value = v.valueOf();\n break;\n }\n case 'week':\n value += 7 * 86400000 * amount;\n break;\n case 'year': {\n const newDate = new Date(value);\n newDate.setFullYear(newDate.getFullYear() + amount);\n // Handling for leap years: if the original date is February 29th, and the new year is not a leap year,\n // set the date to February 28th.\n if (date.getMonth() === 1 && date.getDate() === 29 && newDate.getMonth() !== 1) {\n newDate.setMonth(1);\n newDate.setDate(28);\n }\n value = newDate.valueOf();\n break;\n }\n case 'day':\n default:\n value += 86400000 * amount;\n }\n return new AXDateTime(new Date(value), this);\n }\n\n set(date: Date, unit: TimeUnit, value: number): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());\n break;\n case 'minute':\n clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());\n break;\n case 'hour':\n clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());\n break;\n default:\n case 'day':\n clone.setDate(value);\n break;\n case 'week':\n break;\n case 'month':\n clone.setMonth(Math.max(0, value - 1));\n break;\n case 'year':\n clone.setFullYear(value);\n break;\n }\n return new AXDateTime(clone, this);\n }\n\n startOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 0, 0, 0);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n case 'week': {\n const start = 1; // Week starts on Monday\n const day = clone.getDay();\n const diff = clone.getDate() - day + (day == 0 ? -6 : start - day);\n clone.setDate(diff);\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n }\n case 'month':\n clone.setDate(1);\n return new AXDateTime(clone, this).startOf('day');\n case 'year':\n clone.setMonth(0);\n clone.setDate(1);\n return new AXDateTime(clone, this).startOf('day');\n }\n }\n\n endOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 999);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 59, 59, 999);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(23, 59, 59, 999);\n return new AXDateTime(clone, this);\n case 'week':\n return this.startOf(date, 'week').add('day', 6).endOf('day');\n case 'month': {\n const dateObj = new Date(date.getFullYear(), date.getMonth() + 1, 0);\n dateObj.setHours(23, 59, 59, 999);\n return new AXDateTime(dateObj, this);\n }\n case 'year':\n clone.setMonth(11);\n return new AXDateTime(clone, this).endOf('month');\n }\n }\n\n isLeap(date: Date) {\n let leapYear = new Date(date.getFullYear(), 1, 29);\n return leapYear.getDate() == 29;\n }\n\n parse(value: string): AXDateTime {\n return new AXDateTime(new Date(value), this);\n }\n}\n","import { AXCalendar, AXCalendarConfig, AXDateTime, AXDateValue, TimeUnit } from './datetime.class';\n\nexport class JalaliCalendar extends AXCalendar {\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n super(config);\n }\n\n /*\n Jalaali years starting the 33-year rule.\n*/\n private breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];\n\n create(value: AXDateValue): AXDateTime {\n const a = this.toGregorian(value.year, value.month, value.date);\n return new AXDateTime(\n new Date(a.getFullYear(), a.getMonth(), a.getDate(), value.hours || 0, value.minutes || 0, value.seconds || 0, value.ms || 0),\n this,\n );\n }\n\n name(): string {\n return 'jalali';\n }\n\n dayOfMonth(date: Date): number {\n return this.toJalaali(date).day;\n }\n\n dayOfYear(date: Date): number {\n const j = this.toJalaali(date);\n return (j.month <= 6 ? (j.month - 1) * 31 : 6 * 31 + (j.month - 7) * 30) + j.day;\n }\n\n dayOfWeek(date: Date): number {\n return date.getDay() == 6 ? 1 : date.getDay() + 2;\n }\n\n weekOfYear(date: Date): number {\n //TODO : apply jalali\n const firstDay = new AXDateTime(date, this).startOf('year');\n return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);\n }\n\n year(date: Date): number {\n return this.toJalaali(date).year;\n }\n\n monthOfYear(date: Date): number {\n return this.toJalaali(date).month;\n }\n\n add(date: Date, unit: TimeUnit, amount: number): AXDateTime {\n let value = date.valueOf();\n switch (unit) {\n case 'second':\n value += 1000 * amount;\n break;\n case 'minute':\n value += 60000 * amount;\n break;\n case 'hour':\n value += 3600000 * amount;\n break;\n case 'month': {\n // const v = new Date(value);\n // let jd = this.dayOfMonth(date);\n // let jm = this.monthOfYear(date);\n // let jy = this.year(date);\n // const nm = jm + amount;\n // const ny = nm % 12 ? Math.floor(nm / 12) : 0;\n // jy += ny;\n // jm = nm - ny * 12;\n // const vv = this.toGregorian(jy, jm, jd);\n // v.setFullYear(vv.getFullYear());\n // v.setMonth(vv.getMonth());\n // v.setDate(vv.getDate());\n // value = v.valueOf();\n // break;\n let jd = this.dayOfMonth(date);\n let jm = this.monthOfYear(date);\n let jy = this.year(date);\n\n let newMonth = jm + amount;\n let yearsToAdd = Math.floor(newMonth / 12);\n newMonth = newMonth % 12;\n if (newMonth <= 0) {\n newMonth += 12;\n yearsToAdd--;\n }\n\n jy += yearsToAdd;\n\n // Temporary set to first of the month to prevent rollover\n const tempDate = this.toGregorian(jy, newMonth, 1);\n const gregorianDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());\n\n // Adjust the day to either the original day or the last day of the new month, whichever is smaller\n const lastDayOfNewMonth = this.jalaaliMonthLength(jy, newMonth); // Implement this method to find the last day in a Jalali month\n jd = Math.min(jd, lastDayOfNewMonth);\n\n const finalDate = this.toGregorian(jy, newMonth, jd);\n gregorianDate.setFullYear(finalDate.getFullYear());\n gregorianDate.setMonth(finalDate.getMonth());\n gregorianDate.setDate(finalDate.getDate());\n\n value = gregorianDate.valueOf();\n break;\n }\n case 'week':\n value += 7 * 86400000 * amount;\n break;\n case 'year': {\n const v = new Date(value);\n let jd = this.dayOfMonth(date);\n let jm = this.monthOfYear(date);\n let jy = this.year(date);\n const vv = this.toGregorian(jy + amount, jm, jd);\n v.setFullYear(vv.getFullYear());\n v.setMonth(vv.getMonth());\n v.setDate(vv.getDate());\n value = v.valueOf();\n break;\n }\n case 'day':\n default:\n value += 86400000 * amount;\n }\n return new AXDateTime(new Date(value), this);\n }\n\n set(date: Date, unit: TimeUnit, value: number): AXDateTime {\n const clone = new Date(date.valueOf());\n const jDate = this.toJalaali(clone);\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());\n break;\n case 'minute':\n clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());\n break;\n case 'hour':\n clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());\n break;\n default:\n case 'day': {\n const gDate = this.toGregorian(jDate.year, jDate.month, value);\n clone.setDate(gDate.getDate());\n break;\n }\n case 'week':\n break;\n case 'month': {\n const gDate2 = this.toGregorian(jDate.year, value, jDate.day);\n clone.setMonth(gDate2.getMonth());\n break;\n }\n case 'year': {\n const gDate3 = this.toGregorian(value, jDate.month, jDate.day);\n clone.setFullYear(gDate3.getFullYear());\n break;\n }\n }\n return new AXDateTime(clone, this);\n }\n\n startOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 0, 0, 0);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n case 'week':\n return new AXDateTime(clone, this).add('day', -this.dayOfWeek(clone) + 1).startOf('day');\n case 'month': {\n const jy = this.year(date);\n const jm = this.monthOfYear(date);\n const gDate = this.toGregorian(jy, jm, 1);\n return new AXDateTime(gDate, this).startOf('day');\n }\n case 'year': {\n const jy = this.year(date);\n const gDate = this.toGregorian(jy, 1, 1);\n return new AXDateTime(gDate, this).startOf('day');\n }\n }\n }\n\n endOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 999);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 59, 59, 999);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(23, 59, 59, 999);\n return new AXDateTime(clone, this);\n case 'week': {\n return this.startOf(date, 'week').add('day', 6).endOf('day');\n }\n case 'month': {\n const jy = this.year(date);\n const jm = this.monthOfYear(date);\n const jd = this.jalaaliMonthLength(jy, jm);\n const gDate = this.toGregorian(jy, jm, jd);\n return new AXDateTime(gDate, this).endOf('day');\n }\n case 'year': {\n const jy = this.year(date);\n const gDate = this.toGregorian(jy, 12, this.jalaaliMonthLength(jy, 12));\n return new AXDateTime(gDate, this).endOf('day');\n }\n }\n }\n\n parse(value: string): AXDateTime {\n const [y, M, d, h, m, s, ms] = value.split(/[^a-zA-Z0-9]+/gi);\n const date = this.toGregorian(Number(y) ?? 0, Number(M) ?? 1, Number(d) ?? 1);\n if (h != null) date.setHours(Number(h));\n if (m != null) date.setMinutes(Number(m));\n if (s != null) date.setSeconds(Number(s));\n if (ms != null) date.setMilliseconds(Number(d));\n return new AXDateTime(date, this);\n }\n\n /*\n Converts a Gregorian date to Jalaali.\n*/\n toJalaali(date: Date): { year: number; month: number; day: number } {\n const gd = date.getDate();\n const gm = date.getMonth() + 1;\n const gy = date.getFullYear();\n const r = this.d2j(this.g2d(gy, gm, gd));\n return {\n year: r.jy,\n month: r.jm,\n day: r.jd,\n };\n }\n\n /*\n Converts a Jalaali date to Gregorian.\n */\n toGregorian(jy, jm, jd): Date {\n const g = this.d2g(this.j2d(jy, jm, jd));\n return new Date(g.gy, g.gm - 1, g.gd);\n }\n\n /*\n Checks whether a Jalaali date is valid or not.\n */\n isValidJalaaliDate(jy, jm, jd) {\n return jy >= -61 && jy <= 3177 && jm >= 1 && jm <= 12 && jd >= 1 && jd <= this.jalaaliMonthLength(jy, jm);\n }\n\n /*\n Is this a leap year or not?\n */\n isLeapJalaaliYear(jy) {\n return this.jalCalLeap(jy) === 0;\n }\n\n /*\n Number of days in a given month in a Jalaali year.\n */\n jalaaliMonthLength(jy, jm) {\n if (jm <= 6) return 31;\n if (jm <= 11) return 30;\n if (this.isLeapJalaaliYear(jy)) return 30;\n return 29;\n }\n\n /*\n This determines if the Jalaali (Persian) year is\n leap (366-day long) or is the common year (365 days)\n \n @param jy Jalaali calendar year (-61 to 3177)\n @returns number of years since the last leap year (0 to 4)\n */\n private jalCalLeap(jy: number) {\n let bl = this.breaks.length,\n jp = this.breaks[0],\n jm,\n jump,\n leap,\n n,\n i;\n\n if (jy < jp || jy >= this.breaks[bl - 1]) throw new Error('Invalid Jalaali year ' + jy);\n\n for (i = 1; i < bl; i += 1) {\n jm = this.breaks[i];\n jump = jm - jp;\n if (jy < jm) break;\n jp = jm;\n }\n n = jy - jp;\n\n if (jump - n < 6) n = n - jump + this.div(jump + 4, 33) * 33;\n leap = this.mod(this.mod(n + 1, 33) - 1, 4);\n if (leap === -1) {\n leap = 4;\n }\n\n return leap;\n }\n\n private jalCal(jy: number, withoutLeap: boolean) {\n let bl = this.breaks.length,\n gy = jy + 621,\n leapJ = -14,\n jp = this.breaks[0],\n jm,\n jump,\n leap,\n leapG,\n march,\n n,\n i;\n\n if (jy < jp || jy >= this.breaks[bl - 1]) throw new Error('Invalid Jalaali year ' + jy);\n\n // Find the limiting years for the Jalaali year jy.\n for (i = 1; i < bl; i += 1) {\n jm = this.breaks[i];\n jump = jm - jp;\n if (jy < jm) break;\n leapJ = leapJ + this.div(jump, 33) * 8 + this.div(this.mod(jump, 33), 4);\n jp = jm;\n }\n n = jy - jp;\n\n // Find the number of leap years from AD 621 to the beginning\n // of the current Jalaali year in the Persian calendar.\n leapJ = leapJ + this.div(n, 33) * 8 + this.div(this.mod(n, 33) + 3, 4);\n if (this.mod(jump, 33) === 4 && jump - n === 4) leapJ += 1;\n\n // And the same in the Gregorian calendar (until the year gy).\n leapG = this.div(gy, 4) - this.div((this.div(gy, 100) + 1) * 3, 4) - 150;\n\n // Determine the Gregorian date of Farvardin the 1st.\n march = 20 + leapJ - leapG;\n\n // return with gy and march when we don't need leap\n if (withoutLeap) return { gy: gy, march: march };\n\n // Find how many years have passed since the last leap year.\n if (jump - n < 6) n = n - jump + this.div(jump + 4, 33) * 33;\n leap = this.mod(this.mod(n + 1, 33) - 1, 4);\n if (leap === -1) {\n leap = 4;\n }\n\n return {\n leap: leap,\n gy: gy,\n march: march,\n };\n }\n\n private j2d(jy, jm, jd): number {\n let r = this.jalCal(jy, true);\n return this.g2d(r.gy, 3, r.march) + (jm - 1) * 31 - this.div(jm, 7) * (jm - 7) + jd - 1;\n }\n\n private d2j(jdn: number) {\n let gy = this.d2g(jdn).gy, // Calculate Gregorian year (gy).\n jy = gy - 621,\n r = this.jalCal(jy, false),\n jdn1f = this.g2d(gy, 3, r.march),\n jd,\n jm,\n k;\n\n // Find number of days that passed since 1 Farvardin.\n k = jdn - jdn1f;\n if (k >= 0) {\n if (k <= 185) {\n // The first 6 months.\n jm = 1 + this.div(k, 31);\n jd = this.mod(k, 31) + 1;\n return {\n jy: jy,\n jm: jm,\n jd: jd,\n };\n } else {\n // The remaining months.\n k -= 186;\n }\n } else {\n // Previous Jalaali year.\n jy -= 1;\n k += 179;\n if (r.leap === 1) k += 1;\n }\n jm = 7 + this.div(k, 30);\n jd = this.mod(k, 30) + 1;\n return {\n jy: jy,\n jm: jm,\n jd: jd,\n };\n }\n\n private g2d(gy: number, gm: number, gd: number): number {\n let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4) + this.div(153 * this.mod(gm + 9, 12) + 2, 5) + gd - 34840408;\n d = d - this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) + 752;\n return d;\n }\n\n private d2g(jdn: number) {\n let j, i, gd, gm, gy;\n j = 4 * jdn + 139361631;\n j = j + this.div(this.div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;\n i = this.div(this.mod(j, 1461), 4) * 5 + 308;\n gd = this.div(this.mod(i, 153), 5) + 1;\n gm = this.mod(this.div(i, 153), 12) + 1;\n gy = this.div(j, 1461) - 100100 + this.div(8 - gm, 6);\n return {\n gy: gy,\n gm: gm,\n gd: gd,\n };\n }\n\n private jalaaliWeek(jy: number, jm: number, jd: number): { saturday: any; friday: any } {\n let dayOfWeek = this.jalaaliToDateObject(jy, jm, jd, 0, 0, 0, 0).getDay();\n\n let startDayDifference = dayOfWeek == 6 ? 0 : -(dayOfWeek + 1);\n let endDayDifference = 6 + startDayDifference;\n\n return {\n saturday: this.d2j(this.j2d(jy, jm, jd + startDayDifference)),\n friday: this.d2j(this.j2d(jy, jm, jd + endDayDifference)),\n };\n }\n\n private jalaaliToDateObject(jy: number, jm: number, jd: number, h: number = 0, m: number = 0, s: number = 0, ms: number = 0) {\n let gregorianCalenderDate = this.toGregorian(jy, jm, jd);\n\n return new Date(\n gregorianCalenderDate.getFullYear(),\n gregorianCalenderDate.getMonth() - 1,\n gregorianCalenderDate.getDate(),\n h || 0,\n m || 0,\n s || 0,\n ms || 0,\n );\n }\n\n /*\n Utility helper functions.\n */\n\n private div(a: number, b: number) {\n return ~~(a / b);\n }\n\n private mod(a: number, b: number) {\n return a - ~~(a / b) * b;\n }\n}\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\nimport { AXCalendar } from './datetime.class';\nimport { GeorgianCalendar } from './georgian.calendar';\nimport { JalaliCalendar } from './jalali.calendar';\n\nexport interface AXDateTimeConfig {\n calendar: string;\n calendars: {\n [key: string]: AXCalendar;\n };\n}\n\nexport const AX_DATETIME_CONFIG = new InjectionToken<AXDateTimeConfig>('AX_DATETIME_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'dateTime', AX_DATETIME_CONFIG);\n return AXDateTimeDefaultConfig;\n },\n});\n\nexport const AXDateTimeDefaultConfig: AXDateTimeConfig = {\n calendar: 'georgian',\n calendars: {\n georgian: new GeorgianCalendar({\n weekdays: [0, 1, 2, 3, 4, 5, 6],\n weekend: [5, 6],\n formats: {\n dateInput: 'yyyy/MM/dd',\n timeInput: 'HH:mm',\n dateTimeInput: 'yyyy/MM/dd HH:mm',\n dateDisplay: 'DDDD, d MMM yyyy',\n timeDisplay: 'HH:mm',\n dateTimeDisplay: 'DDDD, d MMM yyyy HH:mm',\n },\n }),\n jalali: new JalaliCalendar({\n weekdays: [6, 0, 1, 2, 3, 4, 5],\n weekend: [6],\n formats: {\n dateInput: 'yyyy/MM/dd',\n timeInput: 'HH:mm',\n dateTimeInput: 'yyyy/MM/dd HH:mm',\n dateDisplay: 'DDDD, d MMM yyyy',\n timeDisplay: 'HH:mm',\n dateTimeDisplay: 'DDDD, d MMM yyyy HH:mm',\n },\n }),\n },\n};\n\nexport type PartialDateTimeConfig = Partial<AXDateTimeConfig>;\n\nexport function dateTimeConfig(config: PartialDateTimeConfig = {}): AXDateTimeConfig {\n const result = {\n ...AXDateTimeDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface AXHolidayDate {\n date: Date;\n title: string;\n description?: string;\n [key: string]: unknown;\n}\n\nexport interface AXHolidaysLoaderOptions {\n calendar?: string;\n range?: { start: Date; end: Date };\n}\n\nexport interface AXHolidaysLoader {\n getHolidays(options?: AXHolidaysLoaderOptions): Promise<AXHolidayDate[]>;\n}\n\nexport class AXHolidaysLoaderDefault implements AXHolidaysLoader {\n getHolidays(options?: AXHolidaysLoaderOptions | undefined): Promise<AXHolidayDate[]> {\n return Promise.resolve([]);\n }\n}\n\nexport const AX_DATETIME_HOLIDAYS_LOADER = new InjectionToken<AXHolidaysLoader>('AX_DATETIME_HOLIDAYS_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXHolidaysLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { AXDateTimeConfig, AX_DATETIME_CONFIG } from './dateTime.config';\nimport { AXCalendar, AXDateTime, AXDateValue } from './datetime.class';\nimport { AXHolidayDate, AXHolidaysLoaderOptions, AX_DATETIME_HOLIDAYS_LOADER } from './holidays.loader';\n\n@Injectable({ providedIn: 'root' })\nexport class AXCalendarService {\n private config: AXDateTimeConfig = inject(AX_DATETIME_CONFIG);\n private _holidaysLoader = inject(AX_DATETIME_HOLIDAYS_LOADER);\n private eventService = inject(AXEventService);\n\n public get calendar(): AXCalendar {\n return this.getActiveCalendar();\n }\n\n private activeCalendar = new BehaviorSubject<AXCalendar>(this.getDefaultCalendar());\n calendarChanges$ = this.activeCalendar.asObservable();\n\n public getDefaultCalendar(): AXCalendar {\n return this.config.calendars[this.config.calendar];\n }\n\n public getActiveCalendar(): AXCalendar {\n return this.activeCalendar.getValue();\n }\n\n public setActiveCalendar(name: string): void {\n if (name != this.calendar.name()) {\n const calendar = this.resolveCalendar(name);\n this.activeCalendar.next(calendar);\n this.eventService.emitEvent({\n type: AXEventTypes.AXCalendarChanged,\n payload: this.getActiveCalendar(),\n });\n }\n }\n\n public onHolidaysChanged: Subject<AXHolidayDate[]> = new Subject<AXHolidayDate[]>();\n private _holidays: AXHolidayDate[] = [];\n public get holidays(): AXHolidayDate[] {\n return this._holidays;\n }\n\n constructor() {\n this.loadHolidays();\n }\n\n public loadHolidays(options?: AXHolidaysLoaderOptions) {\n return this._holidaysLoader.getHolidays(options).then((value) => {\n this._holidays = value;\n this.onHolidaysChanged.next(this._holidays);\n });\n }\n\n public create(value: AXDateValue, calendarName?: string): AXDateTime;\n public create(value: Date, calendarName?: string): AXDateTime;\n public create(value: AXDateValue | Date, calendarName?: string): AXDateTime {\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n if (value instanceof Date) {\n return new AXDateTime(value, calendar);\n } else if (value?.year && value?.month) {\n return calendar.create(value as AXDateValue);\n }\n return this.now();\n }\n\n public now(calendarName?: string): AXDateTime {\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n return new AXDateTime(new Date(), calendar);\n }\n\n public resolveCalendar(name: string): AXCalendar {\n const c = this.config.calendars[name];\n if (!c) {\n return this.calendar;\n }\n return c;\n }\n\n public convert(value: Date | AXDateTime | string, calendarName?: string): AXDateTime {\n const isISOString = (str) => {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(.\\d{3}Z)?/.test(str)) return false;\n const d = new Date(str);\n return d instanceof Date && !isNaN(d.getTime()); // valid date\n };\n //\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n if (typeof value === 'string') {\n if (isISOString(value)) return new AXDateTime(new Date(value), calendar);\n else return calendar.parse(value);\n }\n const date = value instanceof AXDateTime ? value.date : (value as Date);\n return new AXDateTime(date, calendar);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { AXCalendarService } from './calendar.service';\nimport { AXDateTime } from './datetime.class';\n\n/**\n * @deprecated The pipe should not be used, use format instead\n */\n@Pipe({\n name: 'axDate',\n standalone: false\n})\nexport class AXDateTimePipe implements PipeTransform {\n private _calendarService: AXCalendarService = inject(AXCalendarService);\n\n transform(value: Date | AXDateTime | string, format?: string, calendarName?: string): string {\n if (value == null) {\n return '';\n }\n let calendar = this._calendarService.calendar;\n if (calendarName) {\n calendar = this._calendarService.resolveCalendar(calendarName);\n }\n const val: AXDateTime = this._calendarService.convert(value, calendar.name());\n return val.format(format);\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable, inject } from '@angular/core';\nimport { AXCalendarService } from '../calendar.service';\n\nexport interface AXDateTimeFormatterOptions extends AXFormatOptions {\n format?: string;\n calendar?: string;\n locale?: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n datetime: AXDateTimeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXDateTimeFormatter implements AXFormatter {\n private calendarService = inject(AXCalendarService);\n\n get name(): string {\n return 'datetime';\n }\n\n format(value: unknown, options?: AXDateTimeFormatterOptions | string): string {\n const effectiveOptions =\n typeof options == 'object'\n ? {\n format: options.format ?? 'date',\n locale: options.locale,\n calendar: options.calendar ?? this.calendarService.calendar.name(),\n }\n : {\n format: options,\n calendar: this.calendarService.calendar.name(),\n };\n\n const date:Date | null = (value instanceof Date ) ? value : \n (typeof value==\"number\" || typeof value==\"string\" ? new Date(value as any) : null) ;\n //\n if(!date)\n return \"\";\n //\n return this.calendarService\n .create(date, effectiveOptions.calendar as string)\n .format(effectiveOptions.format, { locale: effectiveOptions.locale });\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXTimeDurationFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n duration: AXTimeDurationFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXTimeDurationFormatter implements AXFormatter {\n get name(): string {\n return 'time-duration';\n }\n\n format(value: number, options?: AXTimeDurationFormatterOptions): string {\n const milliseconds = Number(value);\n if (milliseconds === null || isNaN(milliseconds)) {\n return '...';\n }\n\n // Convert milliseconds to various units\n const totalMilliseconds = milliseconds % 1000;\n const totalSeconds = Math.floor(milliseconds / 1000);\n const seconds = totalSeconds % 60;\n const totalMinutes = Math.floor(totalSeconds / 60);\n const minutes = totalMinutes % 60;\n const totalHours = Math.floor(totalMinutes / 60);\n\n // Helper function for zero-padding\n const pad = (num: number, length = 2) => num.toString().padStart(length, '0');\n\n // Default format if none provided\n const format = options?.format || (totalHours >= 0 ? 'HH:mm:ss' : 'mm:ss');\n\n const formattedTime = [];\n\n // Parse format and build the time string accordingly\n if (format.includes('HH') || format.includes('H')) {\n formattedTime.push(pad(totalHours));\n }\n if (format.includes('mm')) {\n formattedTime.push(pad(minutes));\n } else if (format.includes('m')) {\n formattedTime.push(minutes.toString());\n }\n if (format.includes('ss')) {\n formattedTime.push(pad(seconds));\n } else if (format.includes('s')) {\n formattedTime.push(seconds.toString());\n }\n if (format.includes('ms') || format.includes('MS')) {\n formattedTime.push(pad(totalMilliseconds, 3));\n }\n\n // Join the parts according to the format\n return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\nimport { isNil } from 'lodash-es';\n\nexport interface AXTimeLeftFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n timeleft: AXTimeLeftFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXTimeLeftFormatter implements AXFormatter {\n get name(): string {\n return 'timeleft';\n }\n\n format(value: number | string, options?: AXTimeLeftFormatterOptions): string {\n const valueNumber = Number(value);\n const sign = valueNumber >= 0 ? 'left' : 'ago';\n const milliseconds = Math.abs(valueNumber);\n const durationInSeconds = Math.round(milliseconds / 1000);\n let format = options?.format;\n // Determine the best format if format is null\n if (isNil(format)) {\n if (durationInSeconds < 45) format = 's';\n else if (durationInSeconds < 60 * 45) format = 'm';\n else if (durationInSeconds < 60 * 60 * 22) format = 'h';\n else if (durationInSeconds < 60 * 60 * 24 * 26) format = 'd';\n else if (durationInSeconds < 60 * 60 * 24 * 320) format = 'M';\n else format = 'y';\n }\n\n // Helper function for zero-padding\n const pad = (num: number) => num.toString().padStart(2, '0');\n\n switch (format) {\n case 's':\n return `${durationInSeconds} seconds ${sign}`;\n case 'ss':\n return `${pad(durationInSeconds)} seconds ${sign}`;\n case 'm':\n return `${Math.round(durationInSeconds / 60)} minute${durationInSeconds >= 120 ? 's' : ''} ${sign}`;\n case 'mm':\n return `${pad(Math.round(durationInSeconds / 60))} minutes ${sign}`;\n case 'h':\n case 'H':\n if (durationInSeconds < 60 * 89) return `an hour ${sign}`;\n return `${Math.round(durationInSeconds / 3600)} hour${durationInSeconds >= 60 * 180 ? 's' : ''} ${sign}`;\n case 'hh':\n case 'HH':\n if (durationInSeconds < 60 * 89) return `01 hour ${sign}`;\n return `${pad(Math.round(durationInSeconds / 3600))} hours ${sign}`;\n case 'd':\n case 'D':\n if (durationInSeconds < 60 * 60 * 35) return `a day ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24))} day${durationInSeconds >= 60 * 60 * 70 ? 's' : ''} ${sign}`;\n case 'dd':\n case 'DD':\n if (durationInSeconds < 60 * 60 * 35) return `01 day ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24)))} days ${sign}`;\n case 'M':\n if (durationInSeconds < 60 * 60 * 24 * 45) return `a month ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24 * 30))} month${durationInSeconds >= 60 * 60 * 24 * 90 ? 's' : ''} ${sign}`;\n case 'MM':\n if (durationInSeconds < 60 * 60 * 24 * 45) return `01 month ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24 * 30)))} months ${sign}`;\n case 'y':\n case 'Y':\n if (durationInSeconds < 60 * 60 * 24 * 547) return `a year ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24 * 365))} year${durationInSeconds >= 60 * 60 * 24 * 730 ? 's' : ''} ${sign}`;\n case 'yy':\n case 'YY':\n case 'yyyy':\n case 'YYYY':\n if (durationInSeconds < 60 * 60 * 24 * 547) return `01 year ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24 * 365)))} years ${sign}`;\n default:\n return 'Invalid format';\n }\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXDateTimePipe } from './datetime.pipe';\nimport { AXDateTimeFormatter } from './formatters/datetime-formatter';\nimport { AXTimeDurationFormatter } from './formatters/time-duration-formatter';\nimport { AXTimeLeftFormatter } from './formatters/timeleft-formatter';\n\n@NgModule({\n imports: [\n AXFormatModule.forChild({\n formatters: [AXDateTimeFormatter, AXTimeLeftFormatter, AXTimeDurationFormatter],\n }),\n ],\n exports: [AXDateTimePipe],\n declarations: [AXDateTimePipe],\n})\nexport class AXDateTimeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAwDsB,UAAU,CAAA;AAG9B;;AAEG;AACH,IAAA,WAAA,CAAY,MAAwB,EAAA;AAClC,QAAA,IAAI,CAAC,OAAO,GAAG,MAAM;;AAGvB,IAAA,IAAW,OAAO,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;;AAG7B,IAAA,IAAW,OAAO,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO;;AAG7B,IAAA,IAAW,QAAQ,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ;;AA4B/B;MAEY,UAAU,CAAA;AAGrB,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK;;AAInB,IAAA,IAAI,QAAQ,GAAA;QACV,OAAO,IAAI,CAAC,SAAS;;IAGvB,WAAY,CAAA,KAAW,EAAE,QAAoB,EAAA;;AAyErC,QAAA,IAAA,CAAA,WAAW,GAAG;AACpB,YAAA,EAAE,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7C,YA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ex-core-date-time.mjs","sources":["../../../../libs/core/date-time/src/lib/datetime.class.ts","../../../../libs/core/date-time/src/lib/georgian.calendar.ts","../../../../libs/core/date-time/src/lib/jalali.calendar.ts","../../../../libs/core/date-time/src/lib/dateTime.config.ts","../../../../libs/core/date-time/src/lib/holidays.loader.ts","../../../../libs/core/date-time/src/lib/calendar.service.ts","../../../../libs/core/date-time/src/lib/datetime.pipe.ts","../../../../libs/core/date-time/src/lib/formatters/datetime-formatter.ts","../../../../libs/core/date-time/src/lib/formatters/time-duration-formatter.ts","../../../../libs/core/date-time/src/lib/formatters/timeleft-formatter.ts","../../../../libs/core/date-time/src/lib/datetime.module.ts","../../../../libs/core/date-time/src/acorex-core-date-time.ts"],"sourcesContent":["import { isBrowser } from '@acorex/core/platform';\nimport { translateSync } from '@acorex/core/translation';\nimport { defaults, orderBy } from 'lodash-es';\n\nexport type TimeUnit = 'ms' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'week';\n\nexport interface AXDateValue {\n year: number;\n month: number;\n date: number;\n hours?: number;\n minutes?: number;\n seconds?: number;\n ms?: number;\n}\n\nexport interface AXDateTimeDisplayFormats {\n dateInput: string;\n timeInput: string;\n dateTimeInput: string;\n dateDisplay: string;\n timeDisplay: string;\n dateTimeDisplay: string;\n}\n\nexport type AXDateTimeUnitNames = {\n long: string;\n short: string;\n letter: string;\n}[];\n\nexport type AXDateTimePart = {\n key: string;\n placeholder: string;\n placeholders: string[];\n typedValue?: string | null;\n default: number;\n enabled: boolean;\n realValue: () => string;\n};\n\nexport type AXDateTimeParts = {\n year: AXDateTimePart;\n month: AXDateTimePart;\n day: AXDateTimePart;\n hour: AXDateTimePart;\n minute: AXDateTimePart;\n second: AXDateTimePart;\n};\n\nexport interface AXCalendarConfig {\n weekdays: number[];\n weekend: number[];\n formats: AXDateTimeDisplayFormats;\n}\n\nexport abstract class AXCalendar {\n private _config: AXCalendarConfig;\n\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n this._config = config;\n }\n\n public get weekend(): number[] {\n return this._config.weekend;\n }\n\n public get formats(): AXDateTimeDisplayFormats {\n return this._config.formats;\n }\n\n public get weekdays(): number[] {\n return this._config.weekdays;\n }\n\n abstract name(): string;\n\n abstract dayOfMonth(date: Date): number;\n\n abstract dayOfYear(date: Date): number;\n\n abstract dayOfWeek(date: Date): number;\n\n abstract monthOfYear(date: Date): number;\n\n abstract weekOfYear(date: Date): number;\n\n abstract year(date: Date): number;\n\n abstract add(date: Date, unit: TimeUnit, amount: number): AXDateTime;\n\n abstract set(date: Date, unit: TimeUnit, value: number): AXDateTime;\n\n abstract startOf(date: Date, unit: TimeUnit): AXDateTime;\n\n abstract endOf(date: Date, unit: TimeUnit): AXDateTime;\n\n abstract create(value: AXDateValue): AXDateTime;\n\n abstract parse(value: string): AXDateTime;\n}\n\nexport class AXDateTime {\n private _date: Date;\n\n get date(): Date {\n return this._date;\n }\n\n private _calendar: AXCalendar;\n get calendar(): AXCalendar {\n return this._calendar;\n }\n\n constructor(value: Date, calendar: AXCalendar) {\n this._calendar = calendar;\n this._date = value;\n }\n\n clone(): AXDateTime {\n return new AXDateTime(this.date, this.calendar);\n }\n\n get dayOfMonth(): number {\n return this._calendar.dayOfMonth(this.date);\n }\n\n get dayOfYear(): number {\n return this._calendar.dayOfYear(this.date);\n }\n\n get dayOfWeek(): number {\n return this._calendar.dayOfWeek(this.date);\n }\n\n get hour(): number {\n return this._date.getHours();\n }\n\n get minute(): number {\n return this._date.getMinutes();\n }\n\n get second(): number {\n return this._date.getSeconds();\n }\n\n get year(): number {\n return this._calendar.year(this.date);\n }\n\n get monthOfYear(): number {\n return this._calendar.monthOfYear(this.date);\n }\n\n get weekOfYear(): number {\n return this._calendar.weekOfYear(this.date);\n }\n\n get month(): AXCalendarMonth {\n return new AXCalendarMonth(this);\n }\n\n add(unit: TimeUnit, amount: number): AXDateTime {\n return this._calendar.add(this.date, unit, amount);\n }\n\n set(unit: TimeUnit = 'day', value: number): AXDateTime {\n return this._calendar.set(this.date, unit, value);\n }\n\n duration(end: Date | AXDateTime): AXTimeSpan {\n const date = end instanceof AXDateTime ? end.date : (end as Date);\n const val = new AXDateTime(date, this.calendar);\n const range = new AXDateTimeRange(this, val);\n return range.duration();\n }\n\n startOf(unit: TimeUnit = 'day'): AXDateTime {\n return this._calendar.startOf(this.date, unit);\n }\n\n endOf(unit: TimeUnit = 'day'): AXDateTime {\n return this._calendar.endOf(this.date, unit);\n }\n\n //TODO: remove unused items\n private _formatKeys = {\n ss: () => this.pad(this.date.getSeconds(), 2),\n s: () => this.date.getSeconds().toString(),\n //\n dd: () => this.pad(this.calendar.dayOfMonth(this.date), 2),\n DD: () => this.pad(this.calendar.dayOfMonth(this.date), 2),\n d: () => this.calendar.dayOfMonth(this.date).toString(),\n //\n mm: () => this.pad(this.date.getMinutes(), 2),\n m: () => this.date.getMinutes().toString(),\n //\n MMMM: () => translateSync(`dateTime.months.${this.calendar.name()}.long.${this.calendar.monthOfYear(this.date) - 1}`),\n MMM: () => translateSync(`dateTime.months.${this.calendar.name()}.short.${this.calendar.monthOfYear(this.date) - 1}`),\n MM: () => this.pad(this.calendar.monthOfYear(this.date), 2),\n M: () => this.calendar.monthOfYear(this.date),\n //\n E: () => translateSync(`dateTime.weekdays.long.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),\n DDD: () => translateSync(`dateTime.weekdays.short.${this.calendar.weekdays[this.calendar.dayOfWeek(this.date) - 1]}`),\n DDDD: () => this._formatKeys['E'](),\n //\n yyyy: () => this.pad(this.calendar.year(this.date), 4),\n YYYY: () => this.pad(this.calendar.year(this.date), 4),\n yy: () => this.pad(this.calendar.year(this.date), 4).substring(2),\n YY: () => this.pad(this.calendar.year(this.date), 4).substring(2),\n //\n HH: () => this.pad(this.date.getHours(), 2),\n H: () => this.date.getHours().toString(),\n //\n hh: () => this.pad(this.date.getHours() % 12 || 12, 2),\n h: () => (this.date.getHours() % 12 || 12).toString(),\n //\n A: () => (this.date.getHours() < 12 ? 'am' : 'pm'),\n a: () => (this.date.getHours() < 12 ? 'am' : 'pm'),\n date: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),\n shortDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortDate')),\n longDate: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longDate')),\n //\n shortTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),\n time: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'shortTime')),\n longTime: (options) => this.format(this.getDateTimeFormatByLocale(options.locale, 'longTime')),\n //\n datetime: (options) => this.format('date time', { locale: options.locale }),\n };\n\n protected _language = () => (isBrowser() ? navigator.language : 'en-GB');\n\n format(format: string = this.getDateTimeFormatByLocale(this._language(), 'shortDate'), options?: { locale?: string }): string {\n const effectiveOptions = defaults({}, options, {\n locale: this._language(),\n });\n const re = new RegExp(orderBy(Object.keys(this._formatKeys), (c) => c.length, ['desc']).join('|'), 'gi');\n return format.replace(re, (matched) => {\n const f = this._formatKeys[matched];\n const r = f(effectiveOptions);\n return r;\n });\n }\n\n getDateTimeFormatByLocale(locale: string, style: 'shortDate' | 'longDate' | 'shortTime' | 'longTime'): string {\n let options: Intl.DateTimeFormatOptions = {};\n switch (style) {\n case 'shortDate': // Year, Month, Day\n options = { year: 'numeric', month: '2-digit', day: '2-digit' };\n break;\n case 'longDate': // Weekday, Month name, Day, Year\n options = {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n };\n break;\n case 'shortTime': // Hour, Minute\n options = { hour: '2-digit', minute: '2-digit', hour12: false };\n break;\n case 'longTime': // Hour, Minute, Second\n options = {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false,\n };\n break;\n }\n\n const formatter = new Intl.DateTimeFormat(locale, options);\n\n // Get parts of the date and/or time\n const parts = formatter.formatToParts(new Date());\n\n // Map parts to their respective format\n const formatMap: { [key: string]: string } = {\n day: 'dd',\n month: style == 'longDate' ? 'MMMM' : 'MM',\n year: 'yyyy',\n hour: 'HH',\n minute: 'mm',\n second: 'ss',\n weekday: 'E',\n literal: '',\n };\n\n // Construct the date and/or time format string\n return parts\n .map((part) => {\n if (part.type === 'literal') {\n // Use the literal part directly as separator\n return part.value;\n } else {\n return formatMap[part.type] || part.value;\n }\n })\n .join('');\n }\n\n private pad(n, width, z = '0') {\n n = n + '';\n return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;\n }\n\n equal(value: Date | AXDateTime, unit: TimeUnit = 'day') {\n return this.compare(value, unit) == 0;\n }\n\n compare(value: Date | AXDateTime, unit: TimeUnit = 'day') {\n const date = value instanceof AXDateTime ? value.date : (value as Date);\n const val = new AXDateTime(date, this.calendar);\n const func = (v1: number, v2: number) => {\n if (v1 == v2) {\n return 0;\n } else if (v1 > v2) {\n return 1;\n } else {\n return -1;\n }\n };\n let p = 0;\n switch (unit) {\n case 'year':\n return func(this.year, val.year);\n case 'week':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.weekOfYear, val.weekOfYear) : p;\n case 'month':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.monthOfYear, val.monthOfYear) : p;\n case 'day':\n p = this.compare(val, 'year');\n return p == 0 ? func(this.dayOfYear, val.dayOfYear) : p;\n case 'hour':\n p = this.compare(val, 'day');\n return p == 0 ? func(this.hour, val.hour) : p;\n case 'minute':\n p = this.compare(val, 'hour');\n return p == 0 ? func(this.minute, val.minute) : p;\n case 'second':\n p = this.compare(val, 'minute');\n return p == 0 ? func(this.second, val.second) : p;\n default:\n return func(this.date.getTime(), val.date.getTime());\n }\n }\n}\n\nexport class AXCalendarMonth {\n private _range: AXDateTimeRange;\n public get range(): AXDateTimeRange {\n return this._range;\n }\n public set range(v: AXDateTimeRange) {\n this._range = v;\n }\n\n public get totalDays(): number {\n return this.range.endTime.dayOfMonth;\n }\n\n constructor(date: AXDateTime) {\n this.index = date.date.getMonth();\n this.name = date.format('MMMM');\n this.range = new AXDateTimeRange(\n new AXDateTime(date.startOf('month').date, date.calendar),\n new AXDateTime(date.endOf('month').date, date.calendar),\n );\n }\n\n private readonly index: number;\n private readonly name: string;\n}\n\nexport interface AXTimeSpanTotal {\n miliseconds: number;\n seconds: number;\n minutes: number;\n hours: number;\n days: number;\n weeks: number;\n months: number;\n years: number;\n}\n\nexport interface AXTimeSpan {\n miliseconds: number;\n seconds: number;\n minutes: number;\n hours: number;\n days: number;\n months: number;\n years: number;\n total: AXTimeSpanTotal;\n}\n\nexport class AXDateTimeRange {\n private _startTime: AXDateTime;\n private _endTime: AXDateTime;\n\n public get startTime(): AXDateTime {\n return this._startTime;\n }\n\n public get endTime(): AXDateTime {\n return this._endTime;\n }\n\n constructor(startTime: AXDateTime, endTime: AXDateTime) {\n this._startTime = startTime;\n this._endTime = endTime;\n }\n\n duration(): AXTimeSpan {\n const result: AXTimeSpan = {\n miliseconds: 0,\n seconds: 0,\n minutes: 0,\n hours: 0,\n days: 0,\n months: 0,\n years: 0,\n total: {\n miliseconds: 0,\n seconds: 0,\n minutes: 0,\n hours: 0,\n days: 0,\n weeks: 0,\n months: 0,\n years: 0,\n },\n };\n\n const one_second = 1000;\n const one_min = one_second * 60;\n const one_hour = one_min * 60;\n const one_day = one_hour * 24;\n const one_week = one_day * 7;\n const one_year = 365.25 * one_day;\n const one_month = one_year / 12;\n const startTime = this._startTime.date.getTime();\n const endTime = this._endTime.date.getTime();\n const diff = Math.abs(endTime - startTime);\n //\n result.total.miliseconds = diff;\n result.total.seconds = Number((diff / one_second).toFixed(2));\n result.total.minutes = Number((diff / one_min).toFixed(2));\n result.total.hours = Number((diff / one_hour).toFixed(2));\n result.total.days = Number((diff / one_day).toFixed(2));\n result.total.weeks = Number((diff / one_week).toFixed(2));\n //\n // let months = (this.endTime.year - this.startTime.year) * 12;\n // months += this.endTime.monthOfYear - this.startTime.monthOfYear + 1;\n // if (this.endTime.dayOfYear < this.startTime.dayOfYear) {\n // months--;\n // }\n // result.total.months = Math.abs(months);\n // TODO: review\n result.total.months = Number((diff / one_month).toFixed(2));\n result.total.years = Number((diff / one_year).toFixed(2));\n //\n result.miliseconds = result.total.miliseconds % 1000;\n result.seconds = Number((result.total.seconds % 60).toFixed(0));\n result.minutes = Number((result.total.minutes % 60).toFixed(0));\n result.hours = Number((result.total.hours % 24).toFixed(0));\n // TODO: review\n result.days = Number((result.total.days % 30.4).toFixed(0));\n result.months = Number((result.total.months % 12).toFixed(0));\n result.years = Number(result.total.years.toFixed(0));\n return result;\n }\n\n enumurate(unit: TimeUnit = 'day', amount = 1): AXDateTime[] {\n const result: AXDateTime[] = [];\n let item = this._startTime.clone();\n while (item.compare(this._endTime, unit) < 1) {\n if (!result.some((c) => c.equal(item, unit))) {\n result.push(item);\n }\n item = item.add(unit, amount);\n }\n return result;\n }\n}\n","import { AXCalendar, AXCalendarConfig, AXDateTime, AXDateValue, TimeUnit } from './datetime.class';\n\nexport class GeorgianCalendar extends AXCalendar {\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n super(config);\n }\n\n create(value: AXDateValue): AXDateTime {\n return new AXDateTime(\n new Date(value.year, value.month - 1, value.date, value.hours || 0, value.minutes || 0, value.seconds || 0, value.ms || 0),\n this,\n );\n }\n\n name(): string {\n return 'georgian';\n }\n\n dayOfMonth(date: Date): number {\n return date.getDate();\n }\n\n dayOfYear(date: Date): number {\n let result = 0;\n let m = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if (this.isLeap(date)) {\n m[1] = 29;\n }\n for (let i = 0; i < date.getMonth(); i++) {\n result = result + m[i];\n }\n result += date.getDate();\n return result;\n }\n\n dayOfWeek(date: Date): number {\n return date.getDay() + 1;\n }\n\n weekOfYear(date: Date): number {\n const firstDay = new AXDateTime(date, this).startOf('year');\n return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);\n }\n\n year(date: Date): number {\n return date.getFullYear();\n }\n\n monthOfYear(date: Date): number {\n return date.getMonth() + 1;\n }\n\n add(date: Date, unit: TimeUnit, amount: number): AXDateTime {\n let value = date.valueOf();\n switch (unit) {\n case 'second':\n value += 1000 * amount;\n break;\n case 'minute':\n value += 60000 * amount;\n break;\n case 'hour':\n value += 3600000 * amount;\n break;\n case 'month': {\n const v = new Date(value);\n\n // Calculate the new year and month considering the amount\n let newYear = v.getFullYear();\n let newMonth = v.getMonth() + amount;\n\n // Adjust for year overflow or underflow\n while (newMonth > 11) {\n newMonth -= 12;\n newYear++;\n }\n while (newMonth < 0) {\n newMonth += 12;\n newYear--;\n }\n\n // Set the date to the first of the month to prevent overflow\n v.setDate(1);\n v.setFullYear(newYear);\n v.setMonth(newMonth);\n\n // Get the last day of the new month\n const lastDayOfMonth = new Date(newYear, newMonth + 1, 0).getDate();\n\n // Set the date to either the original day or the last day of the new month, whichever is smaller\n const originalDay = date.getDate();\n v.setDate(Math.min(originalDay, lastDayOfMonth));\n\n value = v.valueOf();\n break;\n }\n case 'week':\n value += 7 * 86400000 * amount;\n break;\n case 'year': {\n const newDate = new Date(value);\n newDate.setFullYear(newDate.getFullYear() + amount);\n // Handling for leap years: if the original date is February 29th, and the new year is not a leap year,\n // set the date to February 28th.\n if (date.getMonth() === 1 && date.getDate() === 29 && newDate.getMonth() !== 1) {\n newDate.setMonth(1);\n newDate.setDate(28);\n }\n value = newDate.valueOf();\n break;\n }\n case 'day':\n default:\n value += 86400000 * amount;\n }\n return new AXDateTime(new Date(value), this);\n }\n\n set(date: Date, unit: TimeUnit, value: number): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());\n break;\n case 'minute':\n clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());\n break;\n case 'hour':\n clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());\n break;\n default:\n case 'day':\n clone.setDate(value);\n break;\n case 'week':\n break;\n case 'month':\n clone.setMonth(Math.max(0, value - 1));\n break;\n case 'year':\n clone.setFullYear(value);\n break;\n }\n return new AXDateTime(clone, this);\n }\n\n startOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 0, 0, 0);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n case 'week': {\n const start = 1; // Week starts on Monday\n const day = clone.getDay();\n const diff = clone.getDate() - day + (day == 0 ? -6 : start - day);\n clone.setDate(diff);\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n }\n case 'month':\n clone.setDate(1);\n return new AXDateTime(clone, this).startOf('day');\n case 'year':\n clone.setMonth(0);\n clone.setDate(1);\n return new AXDateTime(clone, this).startOf('day');\n }\n }\n\n endOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 999);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 59, 59, 999);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(23, 59, 59, 999);\n return new AXDateTime(clone, this);\n case 'week':\n return this.startOf(date, 'week').add('day', 6).endOf('day');\n case 'month': {\n const dateObj = new Date(date.getFullYear(), date.getMonth() + 1, 0);\n dateObj.setHours(23, 59, 59, 999);\n return new AXDateTime(dateObj, this);\n }\n case 'year':\n clone.setMonth(11);\n return new AXDateTime(clone, this).endOf('month');\n }\n }\n\n isLeap(date: Date) {\n let leapYear = new Date(date.getFullYear(), 1, 29);\n return leapYear.getDate() == 29;\n }\n\n parse(value: string): AXDateTime {\n return new AXDateTime(new Date(value), this);\n }\n}\n","import { AXCalendar, AXCalendarConfig, AXDateTime, AXDateValue, TimeUnit } from './datetime.class';\n\nexport class JalaliCalendar extends AXCalendar {\n /**\n * @ignore\n */\n constructor(config: AXCalendarConfig) {\n super(config);\n }\n\n /*\n Jalaali years starting the 33-year rule.\n*/\n private breaks = [-61, 9, 38, 199, 426, 686, 756, 818, 1111, 1181, 1210, 1635, 2060, 2097, 2192, 2262, 2324, 2394, 2456, 3178];\n\n create(value: AXDateValue): AXDateTime {\n const a = this.toGregorian(value.year, value.month, value.date);\n return new AXDateTime(\n new Date(a.getFullYear(), a.getMonth(), a.getDate(), value.hours || 0, value.minutes || 0, value.seconds || 0, value.ms || 0),\n this,\n );\n }\n\n name(): string {\n return 'jalali';\n }\n\n dayOfMonth(date: Date): number {\n return this.toJalaali(date).day;\n }\n\n dayOfYear(date: Date): number {\n const j = this.toJalaali(date);\n return (j.month <= 6 ? (j.month - 1) * 31 : 6 * 31 + (j.month - 7) * 30) + j.day;\n }\n\n dayOfWeek(date: Date): number {\n return date.getDay() == 6 ? 1 : date.getDay() + 2;\n }\n\n weekOfYear(date: Date): number {\n //TODO : apply jalali\n const firstDay = new AXDateTime(date, this).startOf('year');\n return Math.ceil(((date.getTime() - firstDay.date.getTime()) / 86400000 + firstDay.date.getDay() + 1) / 7);\n }\n\n year(date: Date): number {\n return this.toJalaali(date).year;\n }\n\n monthOfYear(date: Date): number {\n return this.toJalaali(date).month;\n }\n\n add(date: Date, unit: TimeUnit, amount: number): AXDateTime {\n let value = date.valueOf();\n switch (unit) {\n case 'second':\n value += 1000 * amount;\n break;\n case 'minute':\n value += 60000 * amount;\n break;\n case 'hour':\n value += 3600000 * amount;\n break;\n case 'month': {\n // const v = new Date(value);\n // let jd = this.dayOfMonth(date);\n // let jm = this.monthOfYear(date);\n // let jy = this.year(date);\n // const nm = jm + amount;\n // const ny = nm % 12 ? Math.floor(nm / 12) : 0;\n // jy += ny;\n // jm = nm - ny * 12;\n // const vv = this.toGregorian(jy, jm, jd);\n // v.setFullYear(vv.getFullYear());\n // v.setMonth(vv.getMonth());\n // v.setDate(vv.getDate());\n // value = v.valueOf();\n // break;\n let jd = this.dayOfMonth(date);\n let jm = this.monthOfYear(date);\n let jy = this.year(date);\n\n let newMonth = jm + amount;\n let yearsToAdd = Math.floor(newMonth / 12);\n newMonth = newMonth % 12;\n if (newMonth <= 0) {\n newMonth += 12;\n yearsToAdd--;\n }\n\n jy += yearsToAdd;\n\n // Temporary set to first of the month to prevent rollover\n const tempDate = this.toGregorian(jy, newMonth, 1);\n const gregorianDate = new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate());\n\n // Adjust the day to either the original day or the last day of the new month, whichever is smaller\n const lastDayOfNewMonth = this.jalaaliMonthLength(jy, newMonth); // Implement this method to find the last day in a Jalali month\n jd = Math.min(jd, lastDayOfNewMonth);\n\n const finalDate = this.toGregorian(jy, newMonth, jd);\n gregorianDate.setFullYear(finalDate.getFullYear());\n gregorianDate.setMonth(finalDate.getMonth());\n gregorianDate.setDate(finalDate.getDate());\n\n value = gregorianDate.valueOf();\n break;\n }\n case 'week':\n value += 7 * 86400000 * amount;\n break;\n case 'year': {\n const v = new Date(value);\n let jd = this.dayOfMonth(date);\n let jm = this.monthOfYear(date);\n let jy = this.year(date);\n const vv = this.toGregorian(jy + amount, jm, jd);\n v.setFullYear(vv.getFullYear());\n v.setMonth(vv.getMonth());\n v.setDate(vv.getDate());\n value = v.valueOf();\n break;\n }\n case 'day':\n default:\n value += 86400000 * amount;\n }\n return new AXDateTime(new Date(value), this);\n }\n\n set(date: Date, unit: TimeUnit, value: number): AXDateTime {\n const clone = new Date(date.valueOf());\n const jDate = this.toJalaali(clone);\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), value, clone.getMilliseconds());\n break;\n case 'minute':\n clone.setHours(clone.getHours(), value, clone.getSeconds(), clone.getMilliseconds());\n break;\n case 'hour':\n clone.setHours(value, clone.getMinutes(), clone.getSeconds(), clone.getMilliseconds());\n break;\n default:\n case 'day': {\n const gDate = this.toGregorian(jDate.year, jDate.month, value);\n clone.setDate(gDate.getDate());\n break;\n }\n case 'week':\n break;\n case 'month': {\n const gDate2 = this.toGregorian(jDate.year, value, jDate.day);\n clone.setMonth(gDate2.getMonth());\n break;\n }\n case 'year': {\n const gDate3 = this.toGregorian(value, jDate.month, jDate.day);\n clone.setFullYear(gDate3.getFullYear());\n break;\n }\n }\n return new AXDateTime(clone, this);\n }\n\n startOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 0);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 0, 0);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 0, 0, 0);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(0, 0, 0, 0);\n return new AXDateTime(clone, this);\n case 'week':\n return new AXDateTime(clone, this).add('day', -this.dayOfWeek(clone) + 1).startOf('day');\n case 'month': {\n const jy = this.year(date);\n const jm = this.monthOfYear(date);\n const gDate = this.toGregorian(jy, jm, 1);\n return new AXDateTime(gDate, this).startOf('day');\n }\n case 'year': {\n const jy = this.year(date);\n const gDate = this.toGregorian(jy, 1, 1);\n return new AXDateTime(gDate, this).startOf('day');\n }\n }\n }\n\n endOf(date: Date, unit: TimeUnit): AXDateTime {\n const clone = new Date(date.valueOf());\n switch (unit) {\n case 'second':\n clone.setHours(clone.getHours(), clone.getMinutes(), clone.getSeconds(), 999);\n return new AXDateTime(clone, this);\n case 'minute':\n clone.setHours(clone.getHours(), clone.getMinutes(), 59, 999);\n return new AXDateTime(clone, this);\n case 'hour':\n clone.setHours(clone.getHours(), 59, 59, 999);\n return new AXDateTime(clone, this);\n default:\n case 'day':\n clone.setHours(23, 59, 59, 999);\n return new AXDateTime(clone, this);\n case 'week': {\n return this.startOf(date, 'week').add('day', 6).endOf('day');\n }\n case 'month': {\n const jy = this.year(date);\n const jm = this.monthOfYear(date);\n const jd = this.jalaaliMonthLength(jy, jm);\n const gDate = this.toGregorian(jy, jm, jd);\n return new AXDateTime(gDate, this).endOf('day');\n }\n case 'year': {\n const jy = this.year(date);\n const gDate = this.toGregorian(jy, 12, this.jalaaliMonthLength(jy, 12));\n return new AXDateTime(gDate, this).endOf('day');\n }\n }\n }\n\n parse(value: string): AXDateTime {\n const [y, M, d, h, m, s, ms] = value.split(/[^a-zA-Z0-9]+/gi);\n const date = this.toGregorian(Number(y) ?? 0, Number(M) ?? 1, Number(d) ?? 1);\n if (h != null) date.setHours(Number(h));\n if (m != null) date.setMinutes(Number(m));\n if (s != null) date.setSeconds(Number(s));\n if (ms != null) date.setMilliseconds(Number(d));\n return new AXDateTime(date, this);\n }\n\n /*\n Converts a Gregorian date to Jalaali.\n*/\n toJalaali(date: Date): { year: number; month: number; day: number } {\n const gd = date.getDate();\n const gm = date.getMonth() + 1;\n const gy = date.getFullYear();\n const r = this.d2j(this.g2d(gy, gm, gd));\n return {\n year: r.jy,\n month: r.jm,\n day: r.jd,\n };\n }\n\n /*\n Converts a Jalaali date to Gregorian.\n */\n toGregorian(jy, jm, jd): Date {\n const g = this.d2g(this.j2d(jy, jm, jd));\n return new Date(g.gy, g.gm - 1, g.gd);\n }\n\n /*\n Checks whether a Jalaali date is valid or not.\n */\n isValidJalaaliDate(jy, jm, jd) {\n return jy >= -61 && jy <= 3177 && jm >= 1 && jm <= 12 && jd >= 1 && jd <= this.jalaaliMonthLength(jy, jm);\n }\n\n /*\n Is this a leap year or not?\n */\n isLeapJalaaliYear(jy) {\n return this.jalCalLeap(jy) === 0;\n }\n\n /*\n Number of days in a given month in a Jalaali year.\n */\n jalaaliMonthLength(jy, jm) {\n if (jm <= 6) return 31;\n if (jm <= 11) return 30;\n if (this.isLeapJalaaliYear(jy)) return 30;\n return 29;\n }\n\n /*\n This determines if the Jalaali (Persian) year is\n leap (366-day long) or is the common year (365 days)\n \n @param jy Jalaali calendar year (-61 to 3177)\n @returns number of years since the last leap year (0 to 4)\n */\n private jalCalLeap(jy: number) {\n let bl = this.breaks.length,\n jp = this.breaks[0],\n jm,\n jump,\n leap,\n n,\n i;\n\n if (jy < jp || jy >= this.breaks[bl - 1]) throw new Error('Invalid Jalaali year ' + jy);\n\n for (i = 1; i < bl; i += 1) {\n jm = this.breaks[i];\n jump = jm - jp;\n if (jy < jm) break;\n jp = jm;\n }\n n = jy - jp;\n\n if (jump - n < 6) n = n - jump + this.div(jump + 4, 33) * 33;\n leap = this.mod(this.mod(n + 1, 33) - 1, 4);\n if (leap === -1) {\n leap = 4;\n }\n\n return leap;\n }\n\n private jalCal(jy: number, withoutLeap: boolean) {\n let bl = this.breaks.length,\n gy = jy + 621,\n leapJ = -14,\n jp = this.breaks[0],\n jm,\n jump,\n leap,\n leapG,\n march,\n n,\n i;\n\n if (jy < jp || jy >= this.breaks[bl - 1]) throw new Error('Invalid Jalaali year ' + jy);\n\n // Find the limiting years for the Jalaali year jy.\n for (i = 1; i < bl; i += 1) {\n jm = this.breaks[i];\n jump = jm - jp;\n if (jy < jm) break;\n leapJ = leapJ + this.div(jump, 33) * 8 + this.div(this.mod(jump, 33), 4);\n jp = jm;\n }\n n = jy - jp;\n\n // Find the number of leap years from AD 621 to the beginning\n // of the current Jalaali year in the Persian calendar.\n leapJ = leapJ + this.div(n, 33) * 8 + this.div(this.mod(n, 33) + 3, 4);\n if (this.mod(jump, 33) === 4 && jump - n === 4) leapJ += 1;\n\n // And the same in the Gregorian calendar (until the year gy).\n leapG = this.div(gy, 4) - this.div((this.div(gy, 100) + 1) * 3, 4) - 150;\n\n // Determine the Gregorian date of Farvardin the 1st.\n march = 20 + leapJ - leapG;\n\n // return with gy and march when we don't need leap\n if (withoutLeap) return { gy: gy, march: march };\n\n // Find how many years have passed since the last leap year.\n if (jump - n < 6) n = n - jump + this.div(jump + 4, 33) * 33;\n leap = this.mod(this.mod(n + 1, 33) - 1, 4);\n if (leap === -1) {\n leap = 4;\n }\n\n return {\n leap: leap,\n gy: gy,\n march: march,\n };\n }\n\n private j2d(jy, jm, jd): number {\n let r = this.jalCal(jy, true);\n return this.g2d(r.gy, 3, r.march) + (jm - 1) * 31 - this.div(jm, 7) * (jm - 7) + jd - 1;\n }\n\n private d2j(jdn: number) {\n let gy = this.d2g(jdn).gy, // Calculate Gregorian year (gy).\n jy = gy - 621,\n r = this.jalCal(jy, false),\n jdn1f = this.g2d(gy, 3, r.march),\n jd,\n jm,\n k;\n\n // Find number of days that passed since 1 Farvardin.\n k = jdn - jdn1f;\n if (k >= 0) {\n if (k <= 185) {\n // The first 6 months.\n jm = 1 + this.div(k, 31);\n jd = this.mod(k, 31) + 1;\n return {\n jy: jy,\n jm: jm,\n jd: jd,\n };\n } else {\n // The remaining months.\n k -= 186;\n }\n } else {\n // Previous Jalaali year.\n jy -= 1;\n k += 179;\n if (r.leap === 1) k += 1;\n }\n jm = 7 + this.div(k, 30);\n jd = this.mod(k, 30) + 1;\n return {\n jy: jy,\n jm: jm,\n jd: jd,\n };\n }\n\n private g2d(gy: number, gm: number, gd: number): number {\n let d = this.div((gy + this.div(gm - 8, 6) + 100100) * 1461, 4) + this.div(153 * this.mod(gm + 9, 12) + 2, 5) + gd - 34840408;\n d = d - this.div(this.div(gy + 100100 + this.div(gm - 8, 6), 100) * 3, 4) + 752;\n return d;\n }\n\n private d2g(jdn: number) {\n let j, i, gd, gm, gy;\n j = 4 * jdn + 139361631;\n j = j + this.div(this.div(4 * jdn + 183187720, 146097) * 3, 4) * 4 - 3908;\n i = this.div(this.mod(j, 1461), 4) * 5 + 308;\n gd = this.div(this.mod(i, 153), 5) + 1;\n gm = this.mod(this.div(i, 153), 12) + 1;\n gy = this.div(j, 1461) - 100100 + this.div(8 - gm, 6);\n return {\n gy: gy,\n gm: gm,\n gd: gd,\n };\n }\n\n private jalaaliWeek(jy: number, jm: number, jd: number): { saturday: any; friday: any } {\n let dayOfWeek = this.jalaaliToDateObject(jy, jm, jd, 0, 0, 0, 0).getDay();\n\n let startDayDifference = dayOfWeek == 6 ? 0 : -(dayOfWeek + 1);\n let endDayDifference = 6 + startDayDifference;\n\n return {\n saturday: this.d2j(this.j2d(jy, jm, jd + startDayDifference)),\n friday: this.d2j(this.j2d(jy, jm, jd + endDayDifference)),\n };\n }\n\n private jalaaliToDateObject(jy: number, jm: number, jd: number, h: number = 0, m: number = 0, s: number = 0, ms: number = 0) {\n let gregorianCalenderDate = this.toGregorian(jy, jm, jd);\n\n return new Date(\n gregorianCalenderDate.getFullYear(),\n gregorianCalenderDate.getMonth() - 1,\n gregorianCalenderDate.getDate(),\n h || 0,\n m || 0,\n s || 0,\n ms || 0,\n );\n }\n\n /*\n Utility helper functions.\n */\n\n private div(a: number, b: number) {\n return ~~(a / b);\n }\n\n private mod(a: number, b: number) {\n return a - ~~(a / b) * b;\n }\n}\n","import { AX_GLOBAL_CONFIG } from '@acorex/core/config';\nimport { InjectionToken, inject } from '@angular/core';\nimport { set } from 'lodash-es';\nimport { AXCalendar } from './datetime.class';\nimport { GeorgianCalendar } from './georgian.calendar';\nimport { JalaliCalendar } from './jalali.calendar';\n\nexport interface AXDateTimeConfig {\n calendar: string;\n calendars: {\n [key: string]: AXCalendar;\n };\n}\n\nexport const AX_DATETIME_CONFIG = new InjectionToken<AXDateTimeConfig>('AX_DATETIME_CONFIG', {\n providedIn: 'root',\n factory: () => {\n const global = inject(AX_GLOBAL_CONFIG);\n set(global, 'dateTime', AX_DATETIME_CONFIG);\n return AXDateTimeDefaultConfig;\n },\n});\n\nexport const AXDateTimeDefaultConfig: AXDateTimeConfig = {\n calendar: 'georgian',\n calendars: {\n georgian: new GeorgianCalendar({\n weekdays: [0, 1, 2, 3, 4, 5, 6],\n weekend: [5, 6],\n formats: {\n dateInput: 'yyyy/MM/dd',\n timeInput: 'HH:mm',\n dateTimeInput: 'yyyy/MM/dd HH:mm',\n dateDisplay: 'DDDD, d MMM yyyy',\n timeDisplay: 'HH:mm',\n dateTimeDisplay: 'DDDD, d MMM yyyy HH:mm',\n },\n }),\n jalali: new JalaliCalendar({\n weekdays: [6, 0, 1, 2, 3, 4, 5],\n weekend: [6],\n formats: {\n dateInput: 'yyyy/MM/dd',\n timeInput: 'HH:mm',\n dateTimeInput: 'yyyy/MM/dd HH:mm',\n dateDisplay: 'DDDD, d MMM yyyy',\n timeDisplay: 'HH:mm',\n dateTimeDisplay: 'DDDD, d MMM yyyy HH:mm',\n },\n }),\n },\n};\n\nexport type PartialDateTimeConfig = Partial<AXDateTimeConfig>;\n\nexport function dateTimeConfig(config: PartialDateTimeConfig = {}): AXDateTimeConfig {\n const result = {\n ...AXDateTimeDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface AXHolidayDate {\n date: Date;\n title: string;\n description?: string;\n [key: string]: unknown;\n}\n\nexport interface AXHolidaysLoaderOptions {\n calendar?: string;\n range?: { start: Date; end: Date };\n}\n\nexport interface AXHolidaysLoader {\n getHolidays(options?: AXHolidaysLoaderOptions): Promise<AXHolidayDate[]>;\n}\n\nexport class AXHolidaysLoaderDefault implements AXHolidaysLoader {\n getHolidays(options?: AXHolidaysLoaderOptions | undefined): Promise<AXHolidayDate[]> {\n return Promise.resolve([]);\n }\n}\n\nexport const AX_DATETIME_HOLIDAYS_LOADER = new InjectionToken<AXHolidaysLoader>('AX_DATETIME_HOLIDAYS_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXHolidaysLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { AXDateTimeConfig, AX_DATETIME_CONFIG } from './dateTime.config';\nimport { AXCalendar, AXDateTime, AXDateValue } from './datetime.class';\nimport { AXHolidayDate, AXHolidaysLoaderOptions, AX_DATETIME_HOLIDAYS_LOADER } from './holidays.loader';\n\n@Injectable({ providedIn: 'root' })\nexport class AXCalendarService {\n private config: AXDateTimeConfig = inject(AX_DATETIME_CONFIG);\n private _holidaysLoader = inject(AX_DATETIME_HOLIDAYS_LOADER);\n private eventService = inject(AXEventService);\n\n public get calendar(): AXCalendar {\n return this.getActiveCalendar();\n }\n\n private activeCalendar = new BehaviorSubject<AXCalendar>(this.getDefaultCalendar());\n calendarChanges$ = this.activeCalendar.asObservable();\n\n public getDefaultCalendar(): AXCalendar {\n return this.config.calendars[this.config.calendar];\n }\n\n public getActiveCalendar(): AXCalendar {\n return this.activeCalendar.getValue();\n }\n\n public setActiveCalendar(name: string): void {\n if (name != this.calendar.name()) {\n const calendar = this.resolveCalendar(name);\n this.activeCalendar.next(calendar);\n this.eventService.emitEvent({\n type: AXEventTypes.AXCalendarChanged,\n payload: this.getActiveCalendar(),\n });\n }\n }\n\n public onHolidaysChanged: Subject<AXHolidayDate[]> = new Subject<AXHolidayDate[]>();\n private _holidays: AXHolidayDate[] = [];\n public get holidays(): AXHolidayDate[] {\n return this._holidays;\n }\n\n constructor() {\n this.loadHolidays();\n }\n\n public loadHolidays(options?: AXHolidaysLoaderOptions) {\n return this._holidaysLoader.getHolidays(options).then((value) => {\n this._holidays = value;\n this.onHolidaysChanged.next(this._holidays);\n });\n }\n\n public create(value: AXDateValue, calendarName?: string): AXDateTime;\n public create(value: Date, calendarName?: string): AXDateTime;\n public create(value: AXDateValue | Date, calendarName?: string): AXDateTime {\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n if (value instanceof Date) {\n return new AXDateTime(value, calendar);\n } else if (value?.year && value?.month) {\n return calendar.create(value as AXDateValue);\n }\n return this.now();\n }\n\n public now(calendarName?: string): AXDateTime {\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n return new AXDateTime(new Date(), calendar);\n }\n\n public resolveCalendar(name: string): AXCalendar {\n const c = this.config.calendars[name];\n if (!c) {\n return this.calendar;\n }\n return c;\n }\n\n public convert(value: Date | AXDateTime | string, calendarName?: string): AXDateTime {\n const isISOString = (str) => {\n if (!/\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(.\\d{3}Z)?/.test(str)) return false;\n const d = new Date(str);\n return d instanceof Date && !isNaN(d.getTime()); // valid date\n };\n //\n const calendar = calendarName ? this.resolveCalendar(calendarName) : this.calendar;\n if (typeof value === 'string') {\n if (isISOString(value)) return new AXDateTime(new Date(value), calendar);\n else return calendar.parse(value);\n }\n const date = value instanceof AXDateTime ? value.date : (value as Date);\n return new AXDateTime(date, calendar);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { AXCalendarService } from './calendar.service';\nimport { AXDateTime } from './datetime.class';\n\n/**\n * @deprecated The pipe should not be used, use format instead\n */\n@Pipe({\n name: 'axDate',\n standalone: false\n})\nexport class AXDateTimePipe implements PipeTransform {\n private _calendarService: AXCalendarService = inject(AXCalendarService);\n\n transform(value: Date | AXDateTime | string, format?: string, calendarName?: string): string {\n if (value == null) {\n return '';\n }\n let calendar = this._calendarService.calendar;\n if (calendarName) {\n calendar = this._calendarService.resolveCalendar(calendarName);\n }\n const val: AXDateTime = this._calendarService.convert(value, calendar.name());\n return val.format(format);\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable, inject } from '@angular/core';\nimport { AXCalendarService } from '../calendar.service';\n\nexport interface AXDateTimeFormatterOptions extends AXFormatOptions {\n format?: string;\n calendar?: string;\n locale?: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n datetime: AXDateTimeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXDateTimeFormatter implements AXFormatter {\n private calendarService = inject(AXCalendarService);\n\n get name(): string {\n return 'datetime';\n }\n\n format(value: unknown, options?: AXDateTimeFormatterOptions | string): string {\n const effectiveOptions =\n typeof options == 'object'\n ? {\n format: options.format ?? 'date',\n locale: options.locale,\n calendar: options.calendar ?? this.calendarService.calendar.name(),\n }\n : {\n format: options,\n calendar: this.calendarService.calendar.name(),\n };\n\n const date: Date | null = (value instanceof Date) ? value :\n (typeof value == \"number\" || typeof value == \"string\" ? new Date(value as any) : null);\n //\n if (!date)\n return \"\";\n //\n return this.calendarService\n .create(date, effectiveOptions.calendar as string)\n .format(effectiveOptions.format, { locale: effectiveOptions.locale });\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXTimeDurationFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n duration: AXTimeDurationFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXTimeDurationFormatter implements AXFormatter {\n get name(): string {\n return 'time-duration';\n }\n\n format(value: number, options?: AXTimeDurationFormatterOptions): string {\n const milliseconds = Number(value);\n if (milliseconds === null || isNaN(milliseconds)) {\n return '...';\n }\n\n // Convert milliseconds to various units\n const totalMilliseconds = milliseconds % 1000;\n const totalSeconds = Math.floor(milliseconds / 1000);\n const seconds = totalSeconds % 60;\n const totalMinutes = Math.floor(totalSeconds / 60);\n const minutes = totalMinutes % 60;\n const totalHours = Math.floor(totalMinutes / 60);\n\n // Helper function for zero-padding\n const pad = (num: number, length = 2) => num.toString().padStart(length, '0');\n\n // Default format if none provided\n const format = options?.format || (totalHours >= 0 ? 'HH:mm:ss' : 'mm:ss');\n\n const formattedTime = [];\n\n // Parse format and build the time string accordingly\n if (format.includes('HH') || format.includes('H')) {\n formattedTime.push(pad(totalHours));\n }\n if (format.includes('mm')) {\n formattedTime.push(pad(minutes));\n } else if (format.includes('m')) {\n formattedTime.push(minutes.toString());\n }\n if (format.includes('ss')) {\n formattedTime.push(pad(seconds));\n } else if (format.includes('s')) {\n formattedTime.push(seconds.toString());\n }\n if (format.includes('ms') || format.includes('MS')) {\n formattedTime.push(pad(totalMilliseconds, 3));\n }\n\n // Join the parts according to the format\n return formattedTime.join(format.includes('ms') || format.includes('MS') ? ':' : ':');\n }\n}\n","import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\nimport { isNil } from 'lodash-es';\n\nexport interface AXTimeLeftFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n timeleft: AXTimeLeftFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXTimeLeftFormatter implements AXFormatter {\n get name(): string {\n return 'timeleft';\n }\n\n format(value: number | string, options?: AXTimeLeftFormatterOptions): string {\n const valueNumber = Number(value);\n const sign = valueNumber >= 0 ? 'left' : 'ago';\n const milliseconds = Math.abs(valueNumber);\n const durationInSeconds = Math.round(milliseconds / 1000);\n let format = options?.format;\n // Determine the best format if format is null\n if (isNil(format)) {\n if (durationInSeconds < 45) format = 's';\n else if (durationInSeconds < 60 * 45) format = 'm';\n else if (durationInSeconds < 60 * 60 * 22) format = 'h';\n else if (durationInSeconds < 60 * 60 * 24 * 26) format = 'd';\n else if (durationInSeconds < 60 * 60 * 24 * 320) format = 'M';\n else format = 'y';\n }\n\n // Helper function for zero-padding\n const pad = (num: number) => num.toString().padStart(2, '0');\n\n switch (format) {\n case 's':\n return `${durationInSeconds} seconds ${sign}`;\n case 'ss':\n return `${pad(durationInSeconds)} seconds ${sign}`;\n case 'm':\n return `${Math.round(durationInSeconds / 60)} minute${durationInSeconds >= 120 ? 's' : ''} ${sign}`;\n case 'mm':\n return `${pad(Math.round(durationInSeconds / 60))} minutes ${sign}`;\n case 'h':\n case 'H':\n if (durationInSeconds < 60 * 89) return `an hour ${sign}`;\n return `${Math.round(durationInSeconds / 3600)} hour${durationInSeconds >= 60 * 180 ? 's' : ''} ${sign}`;\n case 'hh':\n case 'HH':\n if (durationInSeconds < 60 * 89) return `01 hour ${sign}`;\n return `${pad(Math.round(durationInSeconds / 3600))} hours ${sign}`;\n case 'd':\n case 'D':\n if (durationInSeconds < 60 * 60 * 35) return `a day ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24))} day${durationInSeconds >= 60 * 60 * 70 ? 's' : ''} ${sign}`;\n case 'dd':\n case 'DD':\n if (durationInSeconds < 60 * 60 * 35) return `01 day ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24)))} days ${sign}`;\n case 'M':\n if (durationInSeconds < 60 * 60 * 24 * 45) return `a month ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24 * 30))} month${durationInSeconds >= 60 * 60 * 24 * 90 ? 's' : ''} ${sign}`;\n case 'MM':\n if (durationInSeconds < 60 * 60 * 24 * 45) return `01 month ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24 * 30)))} months ${sign}`;\n case 'y':\n case 'Y':\n if (durationInSeconds < 60 * 60 * 24 * 547) return `a year ${sign}`;\n return `${Math.round(durationInSeconds / (3600 * 24 * 365))} year${durationInSeconds >= 60 * 60 * 24 * 730 ? 's' : ''} ${sign}`;\n case 'yy':\n case 'YY':\n case 'yyyy':\n case 'YYYY':\n if (durationInSeconds < 60 * 60 * 24 * 547) return `01 year ${sign}`;\n return `${pad(Math.round(durationInSeconds / (3600 * 24 * 365)))} years ${sign}`;\n default:\n return 'Invalid format';\n }\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXDateTimePipe } from './datetime.pipe';\nimport { AXDateTimeFormatter } from './formatters/datetime-formatter';\nimport { AXTimeDurationFormatter } from './formatters/time-duration-formatter';\nimport { AXTimeLeftFormatter } from './formatters/timeleft-formatter';\n\n@NgModule({\n imports: [\n AXFormatModule.forChild({\n formatters: [AXDateTimeFormatter, AXTimeLeftFormatter, AXTimeDurationFormatter],\n }),\n ],\n exports: [AXDateTimePipe],\n declarations: [AXDateTimePipe],\n})\nexport class AXDateTimeModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;MAwDsB,UAAU,CAAA;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,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,EAPzB,OAAA,EAAA,CAAA,cAAc,CAAC,QAAQ,CAAC;AACtB,gBAAA,UAAU,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC;aAChF,CAAC,CAAA,EAAA,CAAA,CAAA;;2FAKO,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAT5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,cAAc,CAAC,QAAQ,CAAC;AACtB,4BAAA,UAAU,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,uBAAuB,CAAC;yBAChF,CAAC;AACH,qBAAA;oBACD,OAAO,EAAE,CAAC,cAAc,CAAC;oBACzB,YAAY,EAAE,CAAC,cAAc,CAAC;AAC/B,iBAAA;;;ACfD;;AAEG;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Injector, Injectable, inject, Pipe,
|
2
|
+
import { Injector, Injectable, inject, Pipe, Directive, Inject, NgModule } from '@angular/core';
|
3
3
|
import { AXEventService } from '@acorex/core/events';
|
4
4
|
import { Subject, filter, startWith, switchMap, of } from 'rxjs';
|
5
5
|
import { defaults, padStart, isInteger, get } from 'lodash-es';
|
@@ -213,6 +213,31 @@ class AXStringFormatter {
|
|
213
213
|
}
|
214
214
|
}
|
215
215
|
|
216
|
+
class AXFormatterDirective {
|
217
|
+
constructor(templateRef, viewContainer, formatService) {
|
218
|
+
this.templateRef = templateRef;
|
219
|
+
this.viewContainer = viewContainer;
|
220
|
+
this.formatService = formatService;
|
221
|
+
}
|
222
|
+
ngOnInit() {
|
223
|
+
this.viewContainer.clear();
|
224
|
+
this.viewContainer.createEmbeddedView(this.templateRef, {
|
225
|
+
$implicit: (value, formatter, options) => {
|
226
|
+
return this.formatService.format(value, formatter, options);
|
227
|
+
},
|
228
|
+
});
|
229
|
+
}
|
230
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXFormatterDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: AXFormatService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
231
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: AXFormatterDirective, isStandalone: false, selector: "[format]", ngImport: i0 }); }
|
232
|
+
}
|
233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXFormatterDirective, decorators: [{
|
234
|
+
type: Directive,
|
235
|
+
args: [{
|
236
|
+
selector: '[format]',
|
237
|
+
standalone: false
|
238
|
+
}]
|
239
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: AXFormatService }] });
|
240
|
+
|
216
241
|
const BUILT_IN_RULES = [AXNumberFormatter, AXStringFormatter];
|
217
242
|
class AXFormatModule {
|
218
243
|
static forRoot(configs) {
|
@@ -256,15 +281,15 @@ class AXFormatModule {
|
|
256
281
|
});
|
257
282
|
}
|
258
283
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXFormatModule, deps: [{ token: 'AXFormatModuleFactory' }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
259
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXFormatModule, declarations: [AXFormatPipe], exports: [AXFormatPipe] }); }
|
284
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXFormatModule, declarations: [AXFormatPipe, AXFormatterDirective], exports: [AXFormatPipe, AXFormatterDirective] }); }
|
260
285
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXFormatModule }); }
|
261
286
|
}
|
262
287
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXFormatModule, decorators: [{
|
263
288
|
type: NgModule,
|
264
289
|
args: [{
|
265
290
|
imports: [],
|
266
|
-
exports: [AXFormatPipe],
|
267
|
-
declarations: [AXFormatPipe],
|
291
|
+
exports: [AXFormatPipe, AXFormatterDirective],
|
292
|
+
declarations: [AXFormatPipe, AXFormatterDirective],
|
268
293
|
}]
|
269
294
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
270
295
|
type: Inject,
|
@@ -275,5 +300,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
275
300
|
* Generated bundle index. Do not edit.
|
276
301
|
*/
|
277
302
|
|
278
|
-
export { AXFormatModule, AXFormatPipe, AXFormatService, AXFormatter, AXFormatterRegistryService, AXNumberFormatter, AXStringFormatter };
|
303
|
+
export { AXFormatModule, AXFormatPipe, AXFormatService, AXFormatter, AXFormatterDirective, AXFormatterRegistryService, AXNumberFormatter, AXStringFormatter };
|
279
304
|
//# sourceMappingURL=acorex-core-format.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-format.mjs","sources":["../../../../libs/core/format/src/lib/format.config.ts","../../../../libs/core/format/src/lib/format.service.ts","../../../../libs/core/format/src/lib/format.pipe.ts","../../../../libs/core/format/src/lib/formatters/number-formatter.ts","../../../../libs/core/format/src/lib/formatters/string-formatter.ts","../../../../libs/core/format/src/lib/format.module.ts","../../../../libs/core/format/src/acorex-core-format.ts"],"sourcesContent":["import { AXFormatOptions } from './format.types';\n\nexport abstract class AXFormatter {\n abstract get name(): string;\n abstract format(value: unknown, options?: AXFormatOptions | string): string;\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { AXFormatter } from './format.config';\nimport { AXFormatOptionsMap } from './format.types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFormatterRegistryService {\n private plugins: AXFormatter[] = [];\n\n private injector: Injector;\n\n constructor(injector: Injector) {\n this.injector = injector;\n }\n\n register(...plugins: (new () => AXFormatter)[]) {\n plugins.forEach((t) => {\n const childInjector = Injector.create({\n providers: [{ provide: t, useClass: t, deps: [] }],\n parent: this.injector,\n });\n const v = childInjector.get(t);\n\n if (v && !this.plugins.some((p) => p.name == v.name)) {\n this.plugins.push(v);\n }\n });\n }\n\n get formatters(): AXFormatter[] {\n return this.plugins;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXFormatService {\n constructor(private pluginRegistry: AXFormatterRegistryService) {}\n\n private renderSubject = new Subject<void>();\n\n // Observable that other services/components can subscribe to\n onRender = this.renderSubject.asObservable();\n\n render() {\n this.renderSubject.next();\n }\n\n /**\n * Resolves a formatter by its name.\n * @param name The name of the formatter.\n * @returns The formatter if found, otherwise throws an error.\n */\n resolveFormatter(name: string): AXFormatter {\n const formatter = this.pluginRegistry.formatters.find((c) => c.name == name);\n if (!formatter) {\n throw new Error(`Formatter not found: ${name}`);\n }\n return formatter;\n }\n\n // Overload for traditional formatting\n format<K extends keyof AXFormatOptionsMap>(value: unknown, name: K, options?: AXFormatOptionsMap[K]): string;\n\n // Overload for starting fluent API chain\n format(value: unknown): AXFormatFluent;\n\n // Implementation of the format method\n format<K extends keyof AXFormatOptionsMap>(value: unknown, formatter?: K, options?: AXFormatOptionsMap[K]): string | AXFormatFluent {\n if (typeof formatter === 'string') {\n const formatterRef = this.resolveFormatter(formatter);\n return formatterRef.format(value, options);\n } else {\n return new AXFormatFluent(this, value);\n }\n }\n}\n\nclass AXFormatFluent {\n constructor(\n private formatService: AXFormatService,\n private initialValue: unknown,\n ) {}\n\n /**\n * Formats the value using the specified formatter and options.\n * @param formatter The name of the formatter to use.\n * @param options The options to pass to the formatter.\n * @returns The formatted string.\n */\n to<K extends keyof AXFormatOptionsMap>(formatter: K, options?: AXFormatOptionsMap[K]): string {\n try {\n const formatterRef = this.formatService.resolveFormatter(formatter);\n return formatterRef.format(this.initialValue, options);\n } catch (error) {\n return String(this.initialValue);\n }\n }\n}\n","import { AXEventData, AXEventService } from '@acorex/core/events';\nimport { Pipe, PipeTransform, inject } from '@angular/core';\nimport { Observable, filter, of, startWith, switchMap } from 'rxjs';\nimport { AXFormatService } from './format.service';\nimport { AXFormatOptions } from './format.types';\n\n@Pipe({\n name: 'format',\n pure: true,\n standalone: false\n})\nexport class AXFormatPipe implements PipeTransform {\n private formatService = inject(AXFormatService);\n private eventService = inject(AXEventService);\n\n private triggers = ['AX_CALENDAR_CHANGED', 'AX_LANGUAGE_CHANGED', 'AX_LANGUAGE_LOADED'];\n\n transform(value: unknown, name: string, options?: AXFormatOptions | string): Observable<string> {\n // Initial formatted value\n const initialFormattedValue = this.formatService.format(value, name as any, options);\n\n // React to language changes and re-format the value\n return this.eventService.onEvent.pipe(\n filter((event: AXEventData) => this.triggers.includes(event.type)),\n startWith(initialFormattedValue), // Emit the initial formatted value immediately\n switchMap((event) => {\n // Re-call format method on every language change\n const formattedValue = this.formatService.format(value, name as any, options);\n return of(formattedValue);\n }),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { defaults, isInteger, padStart } from 'lodash-es';\nimport { AXFormatter } from '../format.config';\nimport { AXFormatOptions } from '../format.types';\n\nexport interface AXNumberFormatterOptions extends AXFormatOptions {\n decimalPlaces?: number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n zeroPadLength?: number; // New option for zero padding,\n locale?: string;\n}\n\ndeclare module '../format.types' {\n interface AXFormatOptionsMap {\n number: AXNumberFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXNumberFormatter implements AXFormatter {\n private separatorsCache: any = {};\n\n get name(): string {\n return 'number';\n }\n\n format(value: number, options: AXNumberFormatterOptions): string {\n const { thousandSeparator, decimalSeparator } = this.getLocaleSeparators(options?.locale);\n // Merge user options with default options\n const effectiveOptions = defaults({}, options, {\n thousandSeparator,\n decimalSeparator,\n zeroPadLength: 0,\n locale: navigator.language,\n });\n\n const sign = value < 0 ? '-' : '';\n const absoluteValue = Math.abs(value);\n\n // Handling zero padding for integer part\n let integerPart = Math.floor(absoluteValue).toString();\n if (effectiveOptions.zeroPadLength && effectiveOptions.zeroPadLength > integerPart.length) {\n integerPart = padStart(integerPart, effectiveOptions.zeroPadLength, '0');\n }\n\n // Applying thousand separator to integer part\n if (effectiveOptions.thousandSeparator) {\n integerPart = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, effectiveOptions.thousandSeparator);\n }\n\n // Constructing the final formatted value\n let formattedValue = sign + integerPart;\n if (effectiveOptions.decimalPlaces !== undefined) {\n // Limiting decimal places if specified\n const decimalPart = absoluteValue.toFixed(effectiveOptions.decimalPlaces).split('.')[1];\n formattedValue += effectiveOptions.decimalSeparator + decimalPart;\n } else if (!isInteger(value)) {\n // Showing full decimal part if decimalPlaces is not specified\n const decimalPart = absoluteValue.toString().split('.')[1] || '';\n if (decimalPart.length > 0) {\n formattedValue += effectiveOptions.decimalSeparator + decimalPart;\n }\n }\n\n return formattedValue;\n }\n\n private getLocaleSeparators(locale = navigator.language): {\n thousandSeparator: string;\n decimalSeparator: string;\n } {\n // Use cache if available\n if (this.separatorsCache[locale]) {\n return this.separatorsCache[locale];\n }\n\n const numberFormat = new Intl.NumberFormat(locale);\n const parts = numberFormat.formatToParts(1234567.89);\n let thousandSeparator = '';\n let decimalSeparator = '';\n\n for (const part of parts) {\n if (part.type === 'group') {\n thousandSeparator = part.value;\n } else if (part.type === 'decimal') {\n decimalSeparator = part.value;\n }\n }\n\n // Cache the result\n this.separatorsCache[locale] = { thousandSeparator, decimalSeparator };\n return this.separatorsCache[locale];\n }\n}\n","import { get } from 'lodash-es';\nimport { AXFormatter } from '../format.config';\nimport { AXFormatOptions } from '../format.types';\n\nexport interface AXStringFormatterOptions extends AXFormatOptions {\n [key: string]: any;\n}\n\ndeclare module '../format.types' {\n interface AXFormatOptionsMap {\n string: AXStringFormatterOptions;\n }\n}\n\nexport class AXStringFormatter implements AXFormatter {\n get name(): string {\n return 'string';\n }\n\n format(value: unknown, options: AXStringFormatterOptions): string {\n if (typeof value != 'string') return String(value);\n const result = get(options, value)\n ? get(options, value)\n : value.replace(/{{\\s*([^}]+)\\s*}}/g, (match, path: string) => {\n return (get(options, path.trim()) as string) ?? match;\n });\n\n return result;\n }\n}\n","import { Inject, ModuleWithProviders, NgModule } from '@angular/core';\nimport { AXFormatter } from './format.config';\nimport { AXFormatPipe } from './format.pipe';\nimport { AXFormatterRegistryService } from './format.service';\nimport { AXNumberFormatter } from './formatters/number-formatter';\nimport { AXStringFormatter } from './formatters/string-formatter';\n\nconst BUILT_IN_RULES = [AXNumberFormatter, AXStringFormatter];\n\nexport interface AXFormatModuleConfigs {\n formatters: (new () => AXFormatter)[];\n}\n\n@NgModule({\n imports: [],\n exports: [AXFormatPipe],\n declarations: [AXFormatPipe],\n})\nexport class AXFormatModule {\n static forRoot(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule> {\n return {\n ngModule: AXFormatModule,\n providers: [\n ...(configs?.formatters || []),\n {\n provide: 'AXFormatModuleFactory',\n useFactory: (pluginRegistry: AXFormatterRegistryService) => () => {\n pluginRegistry.register(...[...BUILT_IN_RULES, ...(configs?.formatters || [])]);\n },\n deps: [AXFormatterRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n static forChild(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule> {\n return {\n ngModule: AXFormatModule,\n providers: [\n ...(configs?.formatters || []),\n {\n provide: 'AXFormatModuleFactory',\n useFactory: (pluginRegistry: AXFormatterRegistryService) => () => {\n pluginRegistry.register(...[...BUILT_IN_RULES, ...(configs?.formatters || [])]);\n },\n deps: [AXFormatterRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n /**\n * @ignore\n */\n constructor(@Inject('AXFormatModuleFactory') instances: any[]) {\n instances.forEach((f) => {\n f();\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAEsB,WAAW,CAAA;AAGhC;;MCGY,0BAA0B,CAAA;AAKrC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAJtB,IAAO,CAAA,OAAA,GAAkB,EAAE;AAKjC,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;;IAG1B,QAAQ,CAAC,GAAG,OAAkC,EAAA;AAC5C,QAAA,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AACpB,YAAA,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;AACpC,gBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;gBAClD,MAAM,EAAE,IAAI,CAAC,QAAQ;AACtB,aAAA,CAAC;YACF,MAAM,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YAE9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;AACpD,gBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;;AAExB,SAAC,CAAC;;AAGJ,IAAA,IAAI,UAAU,GAAA;QACZ,OAAO,IAAI,CAAC,OAAO;;8GAxBV,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,QAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAA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;;AAGH;;AAEG;AACH,IAAA,WAAA,CAA6C,SAAgB,EAAA;AAC3D,QAAA,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AACtB,YAAA,CAAC,EAAE;AACL,SAAC,CAAC;;AAzCO,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,kBAsCL,uBAAuB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAtChC,cAAc,EAAA,YAAA,EAAA,CAFV,YAAY,CAAA,EAAA,OAAA,EAAA,CADjB,YAAY,CAAA,EAAA,CAAA,CAAA;+GAGX,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAL1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;oBACX,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,YAAY,CAAC;AAC7B,iBAAA;;0BAuCc,MAAM;2BAAC,uBAAuB;;;ACxD7C;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-format.mjs","sources":["../../../../libs/core/format/src/lib/format.config.ts","../../../../libs/core/format/src/lib/format.service.ts","../../../../libs/core/format/src/lib/format.pipe.ts","../../../../libs/core/format/src/lib/formatters/number-formatter.ts","../../../../libs/core/format/src/lib/formatters/string-formatter.ts","../../../../libs/core/format/src/lib/format.directive.ts","../../../../libs/core/format/src/lib/format.module.ts","../../../../libs/core/format/src/acorex-core-format.ts"],"sourcesContent":["import { AXFormatOptions } from './format.types';\n\nexport abstract class AXFormatter {\n abstract get name(): string;\n abstract format(value: unknown, options?: AXFormatOptions | string): string;\n}\n","import { Injectable, Injector } from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { AXFormatter } from './format.config';\nimport { AXFormatOptionsMap } from './format.types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFormatterRegistryService {\n private plugins: AXFormatter[] = [];\n\n private injector: Injector;\n\n constructor(injector: Injector) {\n this.injector = injector;\n }\n\n register(...plugins: (new () => AXFormatter)[]) {\n plugins.forEach((t) => {\n const childInjector = Injector.create({\n providers: [{ provide: t, useClass: t, deps: [] }],\n parent: this.injector,\n });\n const v = childInjector.get(t);\n\n if (v && !this.plugins.some((p) => p.name == v.name)) {\n this.plugins.push(v);\n }\n });\n }\n\n get formatters(): AXFormatter[] {\n return this.plugins;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXFormatService {\n constructor(private pluginRegistry: AXFormatterRegistryService) {}\n\n private renderSubject = new Subject<void>();\n\n // Observable that other services/components can subscribe to\n onRender = this.renderSubject.asObservable();\n\n render() {\n this.renderSubject.next();\n }\n\n /**\n * Resolves a formatter by its name.\n * @param name The name of the formatter.\n * @returns The formatter if found, otherwise throws an error.\n */\n resolveFormatter(name: string): AXFormatter {\n const formatter = this.pluginRegistry.formatters.find((c) => c.name == name);\n if (!formatter) {\n throw new Error(`Formatter not found: ${name}`);\n }\n return formatter;\n }\n\n // Overload for traditional formatting\n format<K extends keyof AXFormatOptionsMap>(value: unknown, formatter: K, options?: AXFormatOptionsMap[K]): string;\n\n // Overload for starting fluent API chain\n format(value: unknown): AXFormatFluent;\n\n // Implementation of the format method\n format<K extends keyof AXFormatOptionsMap>(value: unknown, formatter?: K, options?: AXFormatOptionsMap[K]): string | AXFormatFluent {\n if (typeof formatter === 'string') {\n const formatterRef = this.resolveFormatter(formatter);\n return formatterRef.format(value, options);\n } else {\n return new AXFormatFluent(this, value);\n }\n }\n}\n\nclass AXFormatFluent {\n constructor(\n private formatService: AXFormatService,\n private initialValue: unknown,\n ) {}\n\n /**\n * Formats the value using the specified formatter and options.\n * @param formatter The name of the formatter to use.\n * @param options The options to pass to the formatter.\n * @returns The formatted string.\n */\n to<K extends keyof AXFormatOptionsMap>(formatter: K, options?: AXFormatOptionsMap[K]): string {\n try {\n const formatterRef = this.formatService.resolveFormatter(formatter);\n return formatterRef.format(this.initialValue, options);\n } catch (error) {\n return String(this.initialValue);\n }\n }\n}\n","import { AXEventData, AXEventService } from '@acorex/core/events';\nimport { Pipe, PipeTransform, inject } from '@angular/core';\nimport { Observable, filter, of, startWith, switchMap } from 'rxjs';\nimport { AXFormatService } from './format.service';\nimport { AXFormatOptions } from './format.types';\n\n@Pipe({\n name: 'format',\n pure: true,\n standalone: false\n})\nexport class AXFormatPipe implements PipeTransform {\n private formatService = inject(AXFormatService);\n private eventService = inject(AXEventService);\n\n private triggers = ['AX_CALENDAR_CHANGED', 'AX_LANGUAGE_CHANGED', 'AX_LANGUAGE_LOADED'];\n\n transform(value: unknown, name: string, options?: AXFormatOptions | string): Observable<string> {\n // Initial formatted value\n const initialFormattedValue = this.formatService.format(value, name as any, options);\n\n // React to language changes and re-format the value\n return this.eventService.onEvent.pipe(\n filter((event: AXEventData) => this.triggers.includes(event.type)),\n startWith(initialFormattedValue), // Emit the initial formatted value immediately\n switchMap((event) => {\n // Re-call format method on every language change\n const formattedValue = this.formatService.format(value, name as any, options);\n return of(formattedValue);\n }),\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { defaults, isInteger, padStart } from 'lodash-es';\nimport { AXFormatter } from '../format.config';\nimport { AXFormatOptions } from '../format.types';\n\nexport interface AXNumberFormatterOptions extends AXFormatOptions {\n decimalPlaces?: number;\n thousandSeparator?: string;\n decimalSeparator?: string;\n zeroPadLength?: number; // New option for zero padding,\n locale?: string;\n}\n\ndeclare module '../format.types' {\n interface AXFormatOptionsMap {\n number: AXNumberFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXNumberFormatter implements AXFormatter {\n private separatorsCache: any = {};\n\n get name(): string {\n return 'number';\n }\n\n format(value: number, options: AXNumberFormatterOptions): string {\n const { thousandSeparator, decimalSeparator } = this.getLocaleSeparators(options?.locale);\n // Merge user options with default options\n const effectiveOptions = defaults({}, options, {\n thousandSeparator,\n decimalSeparator,\n zeroPadLength: 0,\n locale: navigator.language,\n });\n\n const sign = value < 0 ? '-' : '';\n const absoluteValue = Math.abs(value);\n\n // Handling zero padding for integer part\n let integerPart = Math.floor(absoluteValue).toString();\n if (effectiveOptions.zeroPadLength && effectiveOptions.zeroPadLength > integerPart.length) {\n integerPart = padStart(integerPart, effectiveOptions.zeroPadLength, '0');\n }\n\n // Applying thousand separator to integer part\n if (effectiveOptions.thousandSeparator) {\n integerPart = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, effectiveOptions.thousandSeparator);\n }\n\n // Constructing the final formatted value\n let formattedValue = sign + integerPart;\n if (effectiveOptions.decimalPlaces !== undefined) {\n // Limiting decimal places if specified\n const decimalPart = absoluteValue.toFixed(effectiveOptions.decimalPlaces).split('.')[1];\n formattedValue += effectiveOptions.decimalSeparator + decimalPart;\n } else if (!isInteger(value)) {\n // Showing full decimal part if decimalPlaces is not specified\n const decimalPart = absoluteValue.toString().split('.')[1] || '';\n if (decimalPart.length > 0) {\n formattedValue += effectiveOptions.decimalSeparator + decimalPart;\n }\n }\n\n return formattedValue;\n }\n\n private getLocaleSeparators(locale = navigator.language): {\n thousandSeparator: string;\n decimalSeparator: string;\n } {\n // Use cache if available\n if (this.separatorsCache[locale]) {\n return this.separatorsCache[locale];\n }\n\n const numberFormat = new Intl.NumberFormat(locale);\n const parts = numberFormat.formatToParts(1234567.89);\n let thousandSeparator = '';\n let decimalSeparator = '';\n\n for (const part of parts) {\n if (part.type === 'group') {\n thousandSeparator = part.value;\n } else if (part.type === 'decimal') {\n decimalSeparator = part.value;\n }\n }\n\n // Cache the result\n this.separatorsCache[locale] = { thousandSeparator, decimalSeparator };\n return this.separatorsCache[locale];\n }\n}\n","import { get } from 'lodash-es';\nimport { AXFormatter } from '../format.config';\nimport { AXFormatOptions } from '../format.types';\n\nexport interface AXStringFormatterOptions extends AXFormatOptions {\n [key: string]: any;\n}\n\ndeclare module '../format.types' {\n interface AXFormatOptionsMap {\n string: AXStringFormatterOptions;\n }\n}\n\nexport class AXStringFormatter implements AXFormatter {\n get name(): string {\n return 'string';\n }\n\n format(value: unknown, options: AXStringFormatterOptions): string {\n if (typeof value != 'string') return String(value);\n const result = get(options, value)\n ? get(options, value)\n : value.replace(/{{\\s*([^}]+)\\s*}}/g, (match, path: string) => {\n return (get(options, path.trim()) as string) ?? match;\n });\n\n return result;\n }\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXFormatService } from './format.service';\nimport { AXFormatOptionsMap } from './format.types';\n\n@Directive({\n selector: '[format]',\n standalone: false\n})\nexport class AXFormatterDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private formatService: AXFormatService,\n ) { }\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: <K extends keyof AXFormatOptionsMap>(value: unknown, formatter: K, options?: AXFormatOptionsMap[K]) => {\n return this.formatService.format(value, formatter, options);\n },\n });\n }\n}\n","import { Inject, ModuleWithProviders, NgModule } from '@angular/core';\nimport { AXFormatter } from './format.config';\nimport { AXFormatPipe } from './format.pipe';\nimport { AXFormatterRegistryService } from './format.service';\nimport { AXNumberFormatter } from './formatters/number-formatter';\nimport { AXStringFormatter } from './formatters/string-formatter';\nimport { AXFormatterDirective } from './format.directive';\n\nconst BUILT_IN_RULES = [AXNumberFormatter, AXStringFormatter];\n\nexport interface AXFormatModuleConfigs {\n formatters: (new () => AXFormatter)[];\n}\n\n@NgModule({\n imports: [],\n exports: [AXFormatPipe, AXFormatterDirective],\n declarations: [AXFormatPipe, AXFormatterDirective],\n})\nexport class AXFormatModule {\n static forRoot(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule> {\n return {\n ngModule: AXFormatModule,\n providers: [\n ...(configs?.formatters || []),\n {\n provide: 'AXFormatModuleFactory',\n useFactory: (pluginRegistry: AXFormatterRegistryService) => () => {\n pluginRegistry.register(...[...BUILT_IN_RULES, ...(configs?.formatters || [])]);\n },\n deps: [AXFormatterRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n static forChild(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule> {\n return {\n ngModule: AXFormatModule,\n providers: [\n ...(configs?.formatters || []),\n {\n provide: 'AXFormatModuleFactory',\n useFactory: (pluginRegistry: AXFormatterRegistryService) => () => {\n pluginRegistry.register(...[...BUILT_IN_RULES, ...(configs?.formatters || [])]);\n },\n deps: [AXFormatterRegistryService],\n multi: true,\n },\n ],\n };\n }\n\n /**\n * @ignore\n */\n constructor(@Inject('AXFormatModuleFactory') instances: any[]) {\n instances.forEach((f) => {\n f();\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AXFormatService"],"mappings":";;;;;;MAEsB,WAAW,CAAA;AAGhC;;MCGY,0BAA0B,CAAA;AAKrC,IAAA,WAAA,CAAY,QAAkB,EAAA;QAJtB,IAAO,CAAA,OAAA,GAAkB,EAAE;AAKjC,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;;IAG1B,QAAQ,CAAC,GAAG,OAAkC,EAAA;AAC5C,QAAA,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AACpB,YAAA,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC;AACpC,gBAAA,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;gBAClD,MAAM,EAAE,IAAI,CAAC,QAAQ;AACtB,aAAA,CAAC;YACF,MAAM,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;YAE9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,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;;;"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { isPlatformBrowser, DOCUMENT } from '@angular/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { PLATFORM_ID,
|
3
|
+
import { PLATFORM_ID, Inject, Injectable, InjectionToken } from '@angular/core';
|
4
4
|
import { isBrowser } from '@acorex/core/platform';
|
5
5
|
import CryptoJS from 'crypto-es';
|
6
6
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, inject, Injectable, Directive, Pipe, provideAppInitializer, NgModule } from '@angular/core';
|
3
3
|
import { AXEventTypes, AXEventService } from '@acorex/core/events';
|
4
4
|
import { set, get } from 'lodash-es';
|
5
|
-
import { of, BehaviorSubject, forkJoin, tap, catchError, finalize, shareReplay,
|
5
|
+
import { of, BehaviorSubject, forkJoin, tap, catchError, finalize, shareReplay, startWith, map, distinctUntilChanged, switchMap, firstValueFrom } from 'rxjs';
|
6
6
|
|
7
7
|
const AX_TRANSLATION_CONFIG = new InjectionToken('AX_TRANSLATION_CONFIG', {
|
8
8
|
providedIn: 'root',
|
@@ -119,8 +119,10 @@ class AXTranslationService {
|
|
119
119
|
}
|
120
120
|
translateKey(key, lang, scope, params) {
|
121
121
|
// Trigger async preloading without blocking execution
|
122
|
-
this.loadLanguagesAndScopes([lang], [scope]).subscribe({
|
123
|
-
error: (err) =>
|
122
|
+
this.loadLanguagesAndScopes([lang], [scope]).pipe(startWith()).subscribe({
|
123
|
+
error: (err) => {
|
124
|
+
this.handleError(`Error preloading translations for ${lang}, ${scope}`, err);
|
125
|
+
},
|
124
126
|
});
|
125
127
|
// Retrieve the translation from the cache or fallback to the key
|
126
128
|
let translation = this.getTranslationFromCache(lang, scope, key);
|
@@ -177,7 +179,10 @@ class AXTranslationService {
|
|
177
179
|
//#region Async Translation Methods
|
178
180
|
translateText(text, contextLang, contextScope, params) {
|
179
181
|
if (!this.isExpression(text)) {
|
180
|
-
return
|
182
|
+
return this.loadLanguagesAndScopes([contextLang], [contextScope]).pipe(map(() => this.translateKey(text, contextLang, contextScope, params)), catchError((error) => {
|
183
|
+
this.handleError(`Error during translation:`, error);
|
184
|
+
return of(text); // Fallback to the original text
|
185
|
+
}));
|
181
186
|
}
|
182
187
|
const matches = this.decodeExpression(text);
|
183
188
|
// Extract unique languages and scopes for batch loading
|
@@ -292,7 +297,8 @@ class AXTranslatorPipe {
|
|
292
297
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXTranslatorPipe, decorators: [{
|
293
298
|
type: Pipe,
|
294
299
|
args: [{
|
295
|
-
name: 'translate',
|
300
|
+
name: 'translate',
|
301
|
+
pure: true,
|
296
302
|
standalone: false
|
297
303
|
}]
|
298
304
|
}], ctorParameters: () => [{ type: AXTranslationService }] });
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n distinctUntilChanged,\n finalize,\n firstValueFrom,\n forkJoin,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport { AXTranslateHashMap, AXTranslateOptions, AXTranslateParams } from './translation.types';\n\nlet singletonInstance: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return singletonInstance.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private expressionCache = new Map<\n string,\n { key: string; scope?: string; lang?: string; fullMatch: string }[]\n >();\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n /**\n * @ignore\n */\n constructor() {\n singletonInstance = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.fetchTranslationFiles(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private fetchTranslationFiles(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.setTranslationCache(lang, scope, translations)),\n catchError((error) => {\n this.handleError(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n //#region Helpers Methods\n\n /**\n * Set translation data into cache\n */\n private setTranslationCache(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n /**\n * Get the translation from the cache or fallback to loading\n */\n private getTranslationFromCache(lang: string, scope: string, key: string): string {\n return lodashGet(this.translationCache, `${lang}.${scope}.${key}`, key) as string;\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n private translateKey(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n // Trigger async preloading without blocking execution\n this.loadLanguagesAndScopes([lang], [scope]).subscribe({\n error: (err) => this.handleError(`Error preloading translations for ${lang}, ${scope}`, err),\n });\n\n // Retrieve the translation from the cache or fallback to the key\n let translation: string = this.getTranslationFromCache(lang, scope, key);\n\n // Replace params like {{ name }}\n if (params && typeof translation === 'string') {\n Object.keys(params).forEach((paramKey) => {\n translation = translation.replace(\n new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'),\n params[paramKey] as string,\n );\n });\n }\n\n return translation || key;\n }\n\n private isExpression = (value: string) => value.includes('t(');\n\n private decodeExpression(\n expression: string,\n ): { key: string; scope?: string; lang?: string; fullMatch: string }[] {\n if (this.expressionCache.has(expression)) {\n return this.expressionCache.get(expression);\n }\n\n const regex = /t\\([\"']([^\"']+)[\"']\\s*(?:,\\s*(\\{.*?\\}))?\\)/g;\n const matches: { key: string; scope?: string; lang?: string; fullMatch: string }[] = [];\n let match;\n\n while ((match = regex.exec(expression)) !== null) {\n const key = match[1];\n const rawOptions = match[2];\n\n if (!rawOptions) {\n matches.push({ key, scope: null, lang: null, fullMatch: match[0] });\n continue;\n }\n\n try {\n const jsonString = rawOptions\n .replace(/(['\"])?([a-zA-Z0-9_]+)(['\"])?\\s*:/g, '\"$2\":') // Ensure keys are quoted\n .replace(/'/g, '\"'); // Replace single quotes with double quotes\n const options = JSON.parse(jsonString);\n\n matches.push({\n key,\n scope: options.scope || null,\n lang: options.lang || null,\n fullMatch: match[0],\n });\n } catch (error) {\n this.handleError(`Failed to parse options for key \"${key}\":`, error);\n matches.push({ key, scope: null, lang: null, fullMatch: match[0] });\n }\n }\n\n this.expressionCache.set(expression, matches);\n return matches;\n }\n\n private handleError(message: string, error: any): void {\n console.error(message, error);\n this.eventService.emitEvent({\n type: 'error',\n payload: { message, error },\n });\n }\n\n //#endregion\n\n //#region Async Translation Methods\n\n private translateText(\n text: string,\n contextLang: string,\n contextScope: string,\n params?: AXTranslateParams,\n ): Observable<string> {\n if (!this.isExpression(text)) {\n return of(this.translateKey(text, contextLang, contextScope, params));\n }\n const matches = this.decodeExpression(text);\n\n // Extract unique languages and scopes for batch loading\n const langScopeSet = new Set(\n matches.map(({ lang, scope }) => `${lang || contextLang}_${scope || contextScope}`),\n );\n\n const langs = Array.from(new Set(Array.from(langScopeSet).map((pair) => pair.split('_')[0])));\n const scopes = Array.from(new Set(Array.from(langScopeSet).map((pair) => pair.split('_')[1])));\n\n // Load all required languages and scopes\n return this.loadLanguagesAndScopes(langs, scopes).pipe(\n map(() => {\n // Resolve translations after loading\n const translations = matches.reduce(\n (acc, { key, scope, lang, fullMatch }) => {\n const resolvedScope = scope || contextScope;\n const resolvedLang = lang || contextLang;\n\n acc[fullMatch] = this.translateKey(key, resolvedLang, resolvedScope, params);\n return acc;\n },\n {} as Record<string, string>,\n );\n\n // Replace all matches in the text with their resolved translations\n return matches.reduce(\n (result, { fullMatch }) =>\n result.replace(\n new RegExp(fullMatch.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'),\n translations[fullMatch],\n ),\n text,\n );\n }),\n catchError((error) => {\n this.handleError(`Error during translation:`, error);\n return of(text); // Fallback to the original text\n }),\n );\n }\n\n public translate$(text: string, options?: AXTranslateOptions): Observable<string> {\n if (options?.lang) {\n return this.translateText(\n text,\n options.lang,\n options?.scope ?? this.config.defaultScope,\n options?.params,\n );\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n distinctUntilChanged(),\n switchMap((lang) => {\n return this.translateText(text, lang, options?.scope ?? this.config.defaultScope, options?.params);\n }),\n );\n }\n\n public async translateAsync(text: string, options?: AXTranslateOptions): Promise<string> {\n return firstValueFrom(this.translate$(text, options));\n }\n\n //#endregion\n\n //#region Sync Translation Methods\n\n public translateSync(text: string, options?: AXTranslateOptions) {\n if (this.isExpression(text)) {\n return this.translateTextSync(\n text,\n options?.lang ?? this.getActiveLang(),\n options?.scope ?? this.config.defaultScope,\n );\n } else {\n return this.translateKey(\n text,\n options?.lang ?? this.getActiveLang(),\n options?.scope ?? this.config.defaultScope,\n );\n }\n }\n\n private translateTextSync(\n text: string,\n contextLang: string,\n contextScope: string,\n params?: AXTranslateParams,\n ): string {\n const matches = this.decodeExpression(text);\n\n const translations = matches.reduce(\n (acc, { key, scope, lang, fullMatch }) => {\n const resolvedScope = scope || contextScope;\n const resolvedLang = lang || contextLang;\n\n // Cache translation to avoid redundant processing\n if (!acc[fullMatch]) {\n acc[fullMatch] = this.translateKey(key, resolvedLang, resolvedScope, params);\n }\n return acc;\n },\n {} as Record<string, string>,\n );\n\n // Replace all matches in one go\n return matches.reduce(\n (result, { fullMatch }) => result.replace(fullMatch, translations[fullMatch]),\n text,\n );\n }\n\n //#endregion\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n standalone: false\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate$(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({\n name: 'translate', pure: true,\n standalone: false\n}) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate$(key, options);\n }\n}\n","import { NgModule, inject, provideAppInitializer } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n provideAppInitializer(() => {\n const initializerFn = (initializeApp)(inject(AXTranslationService), inject(AX_TRANSLATION_CONFIG));\n return initializerFn();\n }),\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAA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AAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,EAPnB,SAAA,EAAA;YACT,qBAAqB,CAAC,MAAK;AACvB,gBAAA,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;gBAClG,OAAO,aAAa,EAAE;AACxB,aAAC,CAAC;AACL,SAAA,EAAA,CAAA,CAAA;;2FAEU,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAX/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAClD,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AACvD,oBAAA,SAAS,EAAE;wBACT,qBAAqB,CAAC,MAAK;AACvB,4BAAA,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;4BAClG,OAAO,aAAa,EAAE;AACxB,yBAAC,CAAC;AACL,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n distinctUntilChanged,\n finalize,\n firstValueFrom,\n forkJoin,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport { AXTranslateHashMap, AXTranslateOptions, AXTranslateParams } from './translation.types';\n\nlet singletonInstance: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return singletonInstance.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private expressionCache = new Map<\n string,\n { key: string; scope?: string; lang?: string; fullMatch: string }[]\n >();\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n /**\n * @ignore\n */\n constructor() {\n singletonInstance = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.fetchTranslationFiles(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private fetchTranslationFiles(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.setTranslationCache(lang, scope, translations)),\n catchError((error) => {\n this.handleError(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n //#region Helpers Methods\n\n /**\n * Set translation data into cache\n */\n private setTranslationCache(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n /**\n * Get the translation from the cache or fallback to loading\n */\n private getTranslationFromCache(lang: string, scope: string, key: string): string {\n return lodashGet(this.translationCache, `${lang}.${scope}.${key}`, key) as string;\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n private translateKey(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n // Trigger async preloading without blocking execution\n this.loadLanguagesAndScopes([lang], [scope]).pipe(startWith()).subscribe({\n error: (err) => {\n this.handleError(`Error preloading translations for ${lang}, ${scope}`, err)\n },\n });\n\n // Retrieve the translation from the cache or fallback to the key\n let translation: string = this.getTranslationFromCache(lang, scope, key);\n\n // Replace params like {{ name }}\n if (params && typeof translation === 'string') {\n Object.keys(params).forEach((paramKey) => {\n translation = translation.replace(\n new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'),\n params[paramKey] as string,\n );\n });\n }\n\n return translation || key;\n }\n\n private isExpression = (value: string) => value.includes('t(');\n\n private decodeExpression(\n expression: string,\n ): { key: string; scope?: string; lang?: string; fullMatch: string }[] {\n if (this.expressionCache.has(expression)) {\n return this.expressionCache.get(expression);\n }\n\n const regex = /t\\([\"']([^\"']+)[\"']\\s*(?:,\\s*(\\{.*?\\}))?\\)/g;\n const matches: { key: string; scope?: string; lang?: string; fullMatch: string }[] = [];\n let match;\n\n while ((match = regex.exec(expression)) !== null) {\n const key = match[1];\n const rawOptions = match[2];\n\n if (!rawOptions) {\n matches.push({ key, scope: null, lang: null, fullMatch: match[0] });\n continue;\n }\n\n try {\n const jsonString = rawOptions\n .replace(/(['\"])?([a-zA-Z0-9_]+)(['\"])?\\s*:/g, '\"$2\":') // Ensure keys are quoted\n .replace(/'/g, '\"'); // Replace single quotes with double quotes\n const options = JSON.parse(jsonString);\n\n matches.push({\n key,\n scope: options.scope || null,\n lang: options.lang || null,\n fullMatch: match[0],\n });\n } catch (error) {\n this.handleError(`Failed to parse options for key \"${key}\":`, error);\n matches.push({ key, scope: null, lang: null, fullMatch: match[0] });\n }\n }\n\n this.expressionCache.set(expression, matches);\n return matches;\n }\n\n private handleError(message: string, error: any): void {\n console.error(message, error);\n this.eventService.emitEvent({\n type: 'error',\n payload: { message, error },\n });\n }\n\n //#endregion\n\n //#region Async Translation Methods\n\n private translateText(\n text: string,\n contextLang: string,\n contextScope: string,\n params?: AXTranslateParams,\n ): Observable<string> {\n\n if (!this.isExpression(text)) {\n return this.loadLanguagesAndScopes([contextLang], [contextScope]).pipe(\n map(() => this.translateKey(text, contextLang, contextScope, params)),\n catchError((error) => {\n this.handleError(`Error during translation:`, error);\n return of(text); // Fallback to the original text\n })\n );\n }\n\n\n\n\n const matches = this.decodeExpression(text);\n\n // Extract unique languages and scopes for batch loading\n const langScopeSet = new Set(\n matches.map(({ lang, scope }) => `${lang || contextLang}_${scope || contextScope}`),\n );\n\n const langs = Array.from(new Set(Array.from(langScopeSet).map((pair) => pair.split('_')[0])));\n const scopes = Array.from(new Set(Array.from(langScopeSet).map((pair) => pair.split('_')[1])));\n\n // Load all required languages and scopes\n return this.loadLanguagesAndScopes(langs, scopes).pipe(\n map(() => {\n // Resolve translations after loading\n const translations = matches.reduce(\n (acc, { key, scope, lang, fullMatch }) => {\n const resolvedScope = scope || contextScope;\n const resolvedLang = lang || contextLang;\n\n acc[fullMatch] = this.translateKey(key, resolvedLang, resolvedScope, params);\n return acc;\n },\n {} as Record<string, string>,\n );\n\n // Replace all matches in the text with their resolved translations\n return matches.reduce(\n (result, { fullMatch }) =>\n result.replace(\n new RegExp(fullMatch.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'),\n translations[fullMatch],\n ),\n text,\n );\n }),\n catchError((error) => {\n this.handleError(`Error during translation:`, error);\n return of(text); // Fallback to the original text\n }),\n );\n }\n\n public translate$(text: string, options?: AXTranslateOptions): Observable<string> {\n if (options?.lang) {\n return this.translateText(\n text,\n options.lang,\n options?.scope ?? this.config.defaultScope,\n options?.params,\n );\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n distinctUntilChanged(),\n switchMap((lang) => {\n return this.translateText(text, lang, options?.scope ?? this.config.defaultScope, options?.params);\n }),\n );\n }\n\n public async translateAsync(text: string, options?: AXTranslateOptions): Promise<string> {\n return firstValueFrom(this.translate$(text, options));\n }\n\n //#endregion\n\n //#region Sync Translation Methods\n\n public translateSync(text: string, options?: AXTranslateOptions) {\n if (this.isExpression(text)) {\n return this.translateTextSync(\n text,\n options?.lang ?? this.getActiveLang(),\n options?.scope ?? this.config.defaultScope,\n );\n } else {\n return this.translateKey(\n text,\n options?.lang ?? this.getActiveLang(),\n options?.scope ?? this.config.defaultScope,\n );\n }\n }\n\n private translateTextSync(\n text: string,\n contextLang: string,\n contextScope: string,\n params?: AXTranslateParams,\n ): string {\n const matches = this.decodeExpression(text);\n\n const translations = matches.reduce(\n (acc, { key, scope, lang, fullMatch }) => {\n const resolvedScope = scope || contextScope;\n const resolvedLang = lang || contextLang;\n\n // Cache translation to avoid redundant processing\n if (!acc[fullMatch]) {\n acc[fullMatch] = this.translateKey(key, resolvedLang, resolvedScope, params);\n }\n return acc;\n },\n {} as Record<string, string>,\n );\n\n // Replace all matches in one go\n return matches.reduce(\n (result, { fullMatch }) => result.replace(fullMatch, translations[fullMatch]),\n text,\n );\n }\n\n //#endregion\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n standalone: false\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate$(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({\n name: 'translate',\n pure: true,\n standalone: false\n}) // The pipe can now be pure\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) { }\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) {\n return of(''); // Return an empty observable if the key is not provided\n }\n return this.service.translate$(key, options);\n }\n}\n","import { NgModule, inject, provideAppInitializer } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n provideAppInitializer(() => {\n const initializerFn = (initializeApp)(inject(AXTranslationService), inject(AX_TRANSLATION_CONFIG));\n return initializerFn();\n }),\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,OAAO,0BAA0B;KAClC;AACF,CAAA;AAEY,MAAA,0BAA0B,GAAwB;AAC7D,IAAA,WAAW,EAAE,IAAI;AACjB,IAAA,YAAY,EAAE,QAAQ;AACtB,IAAA,gBAAgB,EAAE,OAAO;;AAKX,SAAA,iBAAiB,CAAC,MAAA,GAAqC,EAAE,EAAA;AACvE,IAAA,MAAM,MAAM,GAAG;AACb,QAAA,GAAG,0BAA0B;AAC7B,QAAA,GAAG,MAAM;KACV;AACD,IAAA,OAAO,MAAM;AACf;;MCpBa,0BAA0B,CAAA;AACrC,IAAA,cAAc,CAAC,OAAmC,EAAA;AAChD,QAAA,OAAO,EAAE,CAAC,EAAE,CAAC;;AAEhB;MAEY,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;QACZ,OAAO,IAAI,0BAA0B,EAAE;KACxC;AACF,CAAA;;ACFD,IAAI,iBAAuC;AAE3B,SAAA,aAAa,CAAC,GAAW,EAAE,OAA4B,EAAA;IACrE,OAAO,iBAAiB,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC;AACtD;MAGa,oBAAoB,CAAA;I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A,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAClD,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AACvD,oBAAA,SAAS,EAAE;wBACT,qBAAqB,CAAC,MAAK;AACvB,4BAAA,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,qBAAqB,CAAC,CAAC;4BAClG,OAAO,aAAa,EAAE;AACxB,yBAAC,CAAC;AACL,qBAAA;AACF,iBAAA;;;AC1BD;;AAEG;;;;"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Injectable, inject, PLATFORM_ID,
|
2
|
+
import { Injectable, inject, PLATFORM_ID, HostListener, Input, Directive, NgModule } from '@angular/core';
|
3
3
|
import { Subject, takeUntil } from 'rxjs';
|
4
4
|
import tinycolor from 'tinycolor2';
|
5
5
|
import tinygradient from 'tinygradient-es';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Injectable, inject, InjectionToken, Injector,
|
2
|
+
import { Injectable, inject, InjectionToken, Injector, Inject, NgModule } from '@angular/core';
|
3
3
|
import * as i1 from '@acorex/core/translation';
|
4
4
|
import { AXTranslationService } from '@acorex/core/translation';
|
5
5
|
import { isString, isEmpty, isBoolean, isNull, isUndefined, isNumber, isArray, find, isEqual, merge } from 'lodash-es';
|
package/format/index.d.ts
CHANGED
@@ -2,6 +2,7 @@ export * from './lib/format.config';
|
|
2
2
|
export * from './lib/format.module';
|
3
3
|
export * from './lib/format.pipe';
|
4
4
|
export * from './lib/format.service';
|
5
|
+
export * from './lib/format.directive';
|
5
6
|
export * from './lib/format.types';
|
6
7
|
export * from './lib/formatters/number-formatter';
|
7
8
|
export * from './lib/formatters/string-formatter';
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
|
2
|
+
import { AXFormatService } from './format.service';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export declare class AXFormatterDirective implements OnInit {
|
5
|
+
private templateRef;
|
6
|
+
private viewContainer;
|
7
|
+
private formatService;
|
8
|
+
constructor(templateRef: TemplateRef<any>, viewContainer: ViewContainerRef, formatService: AXFormatService);
|
9
|
+
ngOnInit(): void;
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatterDirective, never>;
|
11
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXFormatterDirective, "[format]", never, {}, {}, never, never, false, never>;
|
12
|
+
}
|
@@ -2,6 +2,7 @@ import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { AXFormatter } from './format.config';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
import * as i1 from "./format.pipe";
|
5
|
+
import * as i2 from "./format.directive";
|
5
6
|
export interface AXFormatModuleConfigs {
|
6
7
|
formatters: (new () => AXFormatter)[];
|
7
8
|
}
|
@@ -13,6 +14,6 @@ export declare class AXFormatModule {
|
|
13
14
|
*/
|
14
15
|
constructor(instances: any[]);
|
15
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatModule, never>;
|
16
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFormatModule, [typeof i1.AXFormatPipe], never, [typeof i1.AXFormatPipe]>;
|
17
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXFormatModule, [typeof i1.AXFormatPipe, typeof i2.AXFormatterDirective], never, [typeof i1.AXFormatPipe, typeof i2.AXFormatterDirective]>;
|
17
18
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXFormatModule>;
|
18
19
|
}
|
@@ -23,7 +23,7 @@ export declare class AXFormatService {
|
|
23
23
|
* @returns The formatter if found, otherwise throws an error.
|
24
24
|
*/
|
25
25
|
resolveFormatter(name: string): AXFormatter;
|
26
|
-
format<K extends keyof AXFormatOptionsMap>(value: unknown,
|
26
|
+
format<K extends keyof AXFormatOptionsMap>(value: unknown, formatter: K, options?: AXFormatOptionsMap[K]): string;
|
27
27
|
format(value: unknown): AXFormatFluent;
|
28
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatService, never>;
|
29
29
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFormatService>;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@acorex/core",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.10.0-next.0",
|
4
4
|
"peerDependencies": {
|
5
5
|
"@angular/common": ">=19.0.0",
|
6
6
|
"@angular/core": ">=19.0.0",
|
@@ -76,14 +76,14 @@
|
|
76
76
|
"types": "./translation/index.d.ts",
|
77
77
|
"default": "./fesm2022/acorex-core-translation.mjs"
|
78
78
|
},
|
79
|
-
"./utils": {
|
80
|
-
"types": "./utils/index.d.ts",
|
81
|
-
"default": "./fesm2022/acorex-core-utils.mjs"
|
82
|
-
},
|
83
79
|
"./types": {
|
84
80
|
"types": "./types/index.d.ts",
|
85
81
|
"default": "./fesm2022/acorex-core-types.mjs"
|
86
82
|
},
|
83
|
+
"./utils": {
|
84
|
+
"types": "./utils/index.d.ts",
|
85
|
+
"default": "./fesm2022/acorex-core-utils.mjs"
|
86
|
+
},
|
87
87
|
"./validation": {
|
88
88
|
"types": "./validation/index.d.ts",
|
89
89
|
"default": "./fesm2022/acorex-core-validation.mjs"
|