@acorex/core 21.0.1-next.7 → 21.0.1-next.71

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.
Files changed (61) hide show
  1. package/fesm2022/acorex-core-components.mjs +5 -5
  2. package/fesm2022/acorex-core-components.mjs.map +1 -1
  3. package/fesm2022/acorex-core-config.mjs +3 -3
  4. package/fesm2022/acorex-core-config.mjs.map +1 -1
  5. package/fesm2022/acorex-core-constants.mjs +214 -3
  6. package/fesm2022/acorex-core-constants.mjs.map +1 -1
  7. package/fesm2022/acorex-core-date-time.mjs +30 -31
  8. package/fesm2022/acorex-core-date-time.mjs.map +1 -1
  9. package/fesm2022/acorex-core-events.mjs +3 -3
  10. package/fesm2022/acorex-core-events.mjs.map +1 -1
  11. package/fesm2022/acorex-core-file.mjs +10 -10
  12. package/fesm2022/acorex-core-file.mjs.map +1 -1
  13. package/fesm2022/acorex-core-format.mjs +19 -19
  14. package/fesm2022/acorex-core-format.mjs.map +1 -1
  15. package/fesm2022/acorex-core-full-screen.mjs +16 -6
  16. package/fesm2022/acorex-core-full-screen.mjs.map +1 -1
  17. package/fesm2022/acorex-core-icon.mjs +3 -3
  18. package/fesm2022/acorex-core-icon.mjs.map +1 -1
  19. package/fesm2022/acorex-core-image.mjs +3 -3
  20. package/fesm2022/acorex-core-image.mjs.map +1 -1
  21. package/fesm2022/acorex-core-locale.mjs +10 -10
  22. package/fesm2022/acorex-core-locale.mjs.map +1 -1
  23. package/fesm2022/acorex-core-network.mjs +3 -3
  24. package/fesm2022/acorex-core-network.mjs.map +1 -1
  25. package/fesm2022/acorex-core-pipes.mjs +3 -3
  26. package/fesm2022/acorex-core-pipes.mjs.map +1 -1
  27. package/fesm2022/acorex-core-platform.mjs +3 -3
  28. package/fesm2022/acorex-core-platform.mjs.map +1 -1
  29. package/fesm2022/acorex-core-storage.mjs +9 -9
  30. package/fesm2022/acorex-core-storage.mjs.map +1 -1
  31. package/fesm2022/acorex-core-translation.mjs +145 -63
  32. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  33. package/fesm2022/acorex-core-utils.mjs +3 -4
  34. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  35. package/fesm2022/acorex-core-validation.mjs +40 -40
  36. package/fesm2022/acorex-core-validation.mjs.map +1 -1
  37. package/fesm2022/acorex-core-z-index.mjs +44 -0
  38. package/fesm2022/acorex-core-z-index.mjs.map +1 -0
  39. package/package.json +28 -26
  40. package/{components/index.d.ts → types/acorex-core-components.d.ts} +2 -2
  41. package/{constants/index.d.ts → types/acorex-core-constants.d.ts} +2 -1
  42. package/{format/index.d.ts → types/acorex-core-format.d.ts} +2 -2
  43. package/{full-screen/index.d.ts → types/acorex-core-full-screen.d.ts} +5 -0
  44. package/{translation/index.d.ts → types/acorex-core-translation.d.ts} +29 -4
  45. package/{validation/index.d.ts → types/acorex-core-validation.d.ts} +10 -10
  46. package/types/acorex-core-z-index.d.ts +20 -0
  47. package/z-index/README.md +3 -0
  48. /package/{config/index.d.ts → types/acorex-core-config.d.ts} +0 -0
  49. /package/{date-time/index.d.ts → types/acorex-core-date-time.d.ts} +0 -0
  50. /package/{events/index.d.ts → types/acorex-core-events.d.ts} +0 -0
  51. /package/{file/index.d.ts → types/acorex-core-file.d.ts} +0 -0
  52. /package/{icon/index.d.ts → types/acorex-core-icon.d.ts} +0 -0
  53. /package/{image/index.d.ts → types/acorex-core-image.d.ts} +0 -0
  54. /package/{locale/index.d.ts → types/acorex-core-locale.d.ts} +0 -0
  55. /package/{memoize/index.d.ts → types/acorex-core-memoize.d.ts} +0 -0
  56. /package/{network/index.d.ts → types/acorex-core-network.d.ts} +0 -0
  57. /package/{pipes/index.d.ts → types/acorex-core-pipes.d.ts} +0 -0
  58. /package/{platform/index.d.ts → types/acorex-core-platform.d.ts} +0 -0
  59. /package/{storage/index.d.ts → types/acorex-core-storage.d.ts} +0 -0
  60. /package/{utils/index.d.ts → types/acorex-core-utils.d.ts} +0 -0
  61. /package/{index.d.ts → types/acorex-core.d.ts} +0 -0
@@ -44,10 +44,10 @@ class AXEventService {
44
44
  d.events = [];
45
45
  }
46
46
  }
47
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
48
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXEventService, providedIn: 'root' }); }
47
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
48
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXEventService, providedIn: 'root' }); }
49
49
  }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXEventService, decorators: [{
50
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXEventService, decorators: [{
51
51
  type: Injectable,
52
52
  args: [{ providedIn: 'root' }]
53
53
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-events.mjs","sources":["../../../../packages/core/events/src/lib/event.service.ts","../../../../packages/core/events/src/acorex-core-events.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nexport enum AXSystemEvents {\n AXLocaleChanged = 'AX_LOCALE_CHANGED',\n AXLocaleLoaded = 'AX_LOCALE_LOADED',\n //\n AXCalendarChanged = 'AX_CALENDAR_CHANGED',\n //\n AXLanguageChanged = 'AX_LANGUAGE_CHANGED',\n AXLanguageLoaded = 'AX_LANGUAGE_LOADED',\n}\n\n\nexport interface AXEventData {\n type: string;\n payload?: any;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXEventService {\n private eventSubject = new Subject<AXEventData>();\n // Observable property\n public onEvent: Observable<AXEventData> = this.eventSubject.asObservable();\n\n emitEvent(event: AXEventData): void {\n this.eventSubject.next(event);\n }\n\n private list: any[] = [];\n\n public broadcast(key: string, options?: any): void {\n const d = this.list.find((c) => c.key === key);\n if (d) {\n d.events.forEach((c: any) => {\n c(options);\n });\n }\n }\n\n public on(key: string, callback: (options?: any) => void) {\n let d = this.list.find((c) => c.key === key);\n if (!d) {\n d = { key, events: [] };\n this.list.push(d);\n }\n d.events.push(callback);\n }\n\n public destroy(key: string, callback: (options?: any) => void): void {\n const d = this.list.find((c) => c.key === key);\n if (d) {\n d.events = [];\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAGY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,mBAAqC;AACrC,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,kBAAmC;;AAEnC,IAAA,cAAA,CAAA,mBAAA,CAAA,GAAA,qBAAyC;;AAEzC,IAAA,cAAA,CAAA,mBAAA,CAAA,GAAA,qBAAyC;AACzC,IAAA,cAAA,CAAA,kBAAA,CAAA,GAAA,oBAAuC;AACzC,CAAC,EARW,cAAc,KAAd,cAAc,GAAA,EAAA,CAAA,CAAA;MAiBb,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAe;;AAE1C,QAAA,IAAA,CAAA,OAAO,GAA4B,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE;QAMlE,IAAA,CAAA,IAAI,GAAU,EAAE;AA0BzB,IAAA;AA9BC,IAAA,SAAS,CAAC,KAAkB,EAAA;AAC1B,QAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/B;IAIO,SAAS,CAAC,GAAW,EAAE,OAAa,EAAA;AACzC,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,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MAAM,EAAE;;;ACnBlC;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-events.mjs","sources":["../../../../packages/core/events/src/lib/event.service.ts","../../../../packages/core/events/src/acorex-core-events.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable, Subject } from 'rxjs';\n\nexport enum AXSystemEvents {\n AXLocaleChanged = 'AX_LOCALE_CHANGED',\n AXLocaleLoaded = 'AX_LOCALE_LOADED',\n //\n AXCalendarChanged = 'AX_CALENDAR_CHANGED',\n //\n AXLanguageChanged = 'AX_LANGUAGE_CHANGED',\n AXLanguageLoaded = 'AX_LANGUAGE_LOADED',\n}\n\n\nexport interface AXEventData {\n type: string;\n payload?: any;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXEventService {\n private eventSubject = new Subject<AXEventData>();\n // Observable property\n public onEvent: Observable<AXEventData> = this.eventSubject.asObservable();\n\n emitEvent(event: AXEventData): void {\n this.eventSubject.next(event);\n }\n\n private list: any[] = [];\n\n public broadcast(key: string, options?: any): void {\n const d = this.list.find((c) => c.key === key);\n if (d) {\n d.events.forEach((c: any) => {\n c(options);\n });\n }\n }\n\n public on(key: string, callback: (options?: any) => void) {\n let d = this.list.find((c) => c.key === key);\n if (!d) {\n d = { key, events: [] };\n this.list.push(d);\n }\n d.events.push(callback);\n }\n\n public destroy(key: string, callback: (options?: any) => void): void {\n const d = this.list.find((c) => c.key === key);\n if (d) {\n d.events = [];\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;IAGY;AAAZ,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,iBAAA,CAAA,GAAA,mBAAqC;AACrC,IAAA,cAAA,CAAA,gBAAA,CAAA,GAAA,kBAAmC;;AAEnC,IAAA,cAAA,CAAA,mBAAA,CAAA,GAAA,qBAAyC;;AAEzC,IAAA,cAAA,CAAA,mBAAA,CAAA,GAAA,qBAAyC;AACzC,IAAA,cAAA,CA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C,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC;QAC9C,IAAI,CAAC,EAAE;AACL,YAAA,CAAC,CAAC,MAAM,GAAG,EAAE;QACf;IACF;8GAlCW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAd,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cADD,MAAM,EAAA,CAAA,CAAA;;2FACnB,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACnBlC;;AAEG;;;;"}
@@ -29,19 +29,19 @@ class AXFileSizeFormatter {
29
29
  const i = Math.floor(Math.log(size) / Math.log(k));
30
30
  return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
31
31
  }
32
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileSizeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
33
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileSizeFormatter }); }
32
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileSizeFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
33
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileSizeFormatter }); }
34
34
  }
35
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileSizeFormatter, decorators: [{
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileSizeFormatter, decorators: [{
36
36
  type: Injectable
37
37
  }] });
38
38
 
39
39
  class AXFileModule {
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
41
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXFileModule, imports: [i1.AXFormatModule] }); }
42
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileModule, providers: [AXFileSizeFormatter], imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })] }); }
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
41
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: AXFileModule, imports: [i1.AXFormatModule] }); }
42
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileModule, providers: [AXFileSizeFormatter], imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })] }); }
43
43
  }
44
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileModule, decorators: [{
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileModule, decorators: [{
45
45
  type: NgModule,
46
46
  args: [{
47
47
  imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })],
@@ -147,10 +147,10 @@ class AXFileService {
147
147
  getBase64Size(base64) {
148
148
  return atob(base64.substring(base64.indexOf(',') + 1)).length;
149
149
  }
150
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
151
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileService, providedIn: 'root' }); }
150
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
151
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileService, providedIn: 'root' }); }
152
152
  }
153
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFileService, decorators: [{
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFileService, decorators: [{
154
154
  type: Injectable,
155
155
  args: [{
156
156
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-file.mjs","sources":["../../../../packages/core/file/src/lib/file-size-formatter.ts","../../../../packages/core/file/src/lib/file.module.ts","../../../../packages/core/file/src/lib/file.service.ts","../../../../packages/core/file/src/acorex-core-file.ts"],"sourcesContent":["import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXFileSizeFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n filesize: AXFileSizeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXFileSizeFormatter implements AXFormatter {\n /**\n * Gets the name of the formatter.\n *\n * @returns string - The formatter name 'filesize'\n */\n\n get name(): string {\n return 'filesize';\n }\n\n /**\n * Formats a file size value to human-readable format.\n *\n * @param value - The file size in bytes\n * @returns string - The formatted file size string (e.g., '1.5 MB')\n */\n\n format(value: number): string {\n const size = Number(value);\n\n if (size === 0) return '0 Bytes';\n if (Number.isNaN(size)) return 'Unknown';\n\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXFileSizeFormatter } from './file-size-formatter';\n\n@NgModule({\n imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })],\n exports: [],\n declarations: [],\n providers: [AXFileSizeFormatter],\n})\nexport class AXFileModule {}\n","import { DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\n private document = inject(DOCUMENT);\n private platformID = inject(PLATFORM_ID);\n\n /**\n * Opens a file selection dialog and returns the selected files.\n *\n * @param options - Optional configuration for file selection\n * @param options.accept - File types to accept (e.g., 'image/*', '.pdf')\n * @param options.multiple - Whether to allow multiple file selection\n * @returns Promise<File[]> - Promise that resolves with the selected files\n */\n\n public choose(options?: { accept?: string; multiple?: boolean }): Promise<File[]> {\n return new Promise<File[]>((resolve, reject) => {\n options = Object.assign({ multiple: false }, options);\n const input: HTMLInputElement = this.document.createElement('input');\n input.style.display = 'none';\n this.document.body.appendChild(input);\n input.type = 'file';\n input.accept = options.accept || '';\n input.multiple = options.multiple || false;\n //\n const onError = (e) => {\n reject(e);\n this.document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n const onChange = () => {\n resolve(Array.from(input.files || []));\n this.document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n input.addEventListener('change', onChange);\n input.addEventListener('error', onError);\n input.click();\n });\n }\n\n /**\n * Gets the size of a file, blob, or base64 string.\n *\n * @param file - The file, blob, or base64 string to get size for\n * @returns number | false - The size in bytes or false if not a base64 string\n */\n\n public blobToBase64 = (blob: Blob) => {\n if (blob instanceof Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(blob);\n });\n } else {\n return Promise.reject('input is not blob');\n }\n };\n\n /**\n * Gets the size of a file, blob, or base64 string.\n *\n * @param file - The file, blob, or base64 string to get size for\n * @returns number | false - The size in bytes or false if not a base64 string\n */\n\n public getSize(file: File | Blob | string) {\n if (this.isBase64(file as string)) {\n return this.getBase64Size(file as string);\n }\n return false;\n }\n\n /**\n * Checks if a string is a valid base64 string.\n *\n * @param base64 - The string to check\n * @returns boolean - True if the string is a valid base64 string\n */\n\n public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\n }\n\n /**\n * Gets the size of a base64 string in bytes.\n *\n * @param base64 - The base64 string to get size for\n * @returns number - The size in bytes\n */\n\n public getBase64Size(base64: string) {\n return atob(base64.substring(base64.indexOf(',') + 1)).length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAca,mBAAmB,CAAA;AAC9B;;;;AAIG;AAEH,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU;IACnB;AAEA;;;;;AAKG;AAEH,IAAA,MAAM,CAAC,KAAa,EAAA;AAClB,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,IAAI,IAAI,KAAK,CAAC;AAAE,YAAA,OAAO,SAAS;AAChC,QAAA,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;AAAE,YAAA,OAAO,SAAS;QAExC,MAAM,CAAC,GAAG,IAAI;QACd,MAAM,KAAK,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAA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AC,IAAc,CAAC,EAAE;AACjC,YAAA,OAAO,IAAI,CAAC,aAAa,CAAC,IAAc,CAAC;QAC3C;AACA,QAAA,OAAO,KAAK;IACd;AAEA;;;;;AAKG;AAEI,IAAA,QAAQ,CAAC,MAAc,EAAA;QAC5B,MAAM,IAAI,GAAG,4BAA4B;AACzC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B;AAEA;;;;;AAKG;AAEI,IAAA,aAAa,CAAC,MAAc,EAAA;AACjC,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM;IAC/D;+GAtGW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAb,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA,CAAA;;4FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-file.mjs","sources":["../../../../packages/core/file/src/lib/file-size-formatter.ts","../../../../packages/core/file/src/lib/file.module.ts","../../../../packages/core/file/src/lib/file.service.ts","../../../../packages/core/file/src/acorex-core-file.ts"],"sourcesContent":["import { AXFormatOptions, AXFormatter } from '@acorex/core/format';\nimport { Injectable } from '@angular/core';\n\nexport interface AXFileSizeFormatterOptions extends AXFormatOptions {\n format: string;\n}\n\ndeclare module '@acorex/core/format' {\n interface AXFormatOptionsMap {\n filesize: AXFileSizeFormatterOptions;\n }\n}\n\n@Injectable()\nexport class AXFileSizeFormatter implements AXFormatter {\n /**\n * Gets the name of the formatter.\n *\n * @returns string - The formatter name 'filesize'\n */\n\n get name(): string {\n return 'filesize';\n }\n\n /**\n * Formats a file size value to human-readable format.\n *\n * @param value - The file size in bytes\n * @returns string - The formatted file size string (e.g., '1.5 MB')\n */\n\n format(value: number): string {\n const size = Number(value);\n\n if (size === 0) return '0 Bytes';\n if (Number.isNaN(size)) return 'Unknown';\n\n const k = 1024;\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n const i = Math.floor(Math.log(size) / Math.log(k));\n\n return parseFloat((size / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];\n }\n}\n","import { AXFormatModule } from '@acorex/core/format';\nimport { NgModule } from '@angular/core';\nimport { AXFileSizeFormatter } from './file-size-formatter';\n\n@NgModule({\n imports: [AXFormatModule.forChild({ formatters: [AXFileSizeFormatter] })],\n exports: [],\n declarations: [],\n providers: [AXFileSizeFormatter],\n})\nexport class AXFileModule {}\n","import { DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\n private document = inject(DOCUMENT);\n private platformID = inject(PLATFORM_ID);\n\n /**\n * Opens a file selection dialog and returns the selected files.\n *\n * @param options - Optional configuration for file selection\n * @param options.accept - File types to accept (e.g., 'image/*', '.pdf')\n * @param options.multiple - Whether to allow multiple file selection\n * @returns Promise<File[]> - Promise that resolves with the selected files\n */\n\n public choose(options?: { accept?: string; multiple?: boolean }): Promise<File[]> {\n return new Promise<File[]>((resolve, reject) => {\n options = Object.assign({ multiple: false }, options);\n const input: HTMLInputElement = this.document.createElement('input');\n input.style.display = 'none';\n this.document.body.appendChild(input);\n input.type = 'file';\n input.accept = options.accept || '';\n input.multiple = options.multiple || false;\n //\n const onError = (e) => {\n reject(e);\n this.document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n const onChange = () => {\n resolve(Array.from(input.files || []));\n this.document.body.removeChild(input);\n input.remove();\n input.removeEventListener('change', onChange);\n input.removeEventListener('error', onError);\n };\n //\n input.addEventListener('change', onChange);\n input.addEventListener('error', onError);\n input.click();\n });\n }\n\n /**\n * Gets the size of a file, blob, or base64 string.\n *\n * @param file - The file, blob, or base64 string to get size for\n * @returns number | false - The size in bytes or false if not a base64 string\n */\n\n public blobToBase64 = (blob: Blob) => {\n if (blob instanceof Blob) {\n return new Promise<string>((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = reject;\n reader.onload = () => {\n resolve(reader.result as string);\n };\n reader.readAsDataURL(blob);\n });\n } else {\n return Promise.reject('input is not blob');\n }\n };\n\n /**\n * Gets the size of a file, blob, or base64 string.\n *\n * @param file - The file, blob, or base64 string to get size for\n * @returns number | false - The size in bytes or false if not a base64 string\n */\n\n public getSize(file: File | Blob | string) {\n if (this.isBase64(file as string)) {\n return this.getBase64Size(file as string);\n }\n return false;\n }\n\n /**\n * Checks if a string is a valid base64 string.\n *\n * @param base64 - The string to check\n * @returns boolean - True if the string is a valid base64 string\n */\n\n public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\n }\n\n /**\n * Gets the size of a base64 string in bytes.\n *\n * @param base64 - The base64 string to get size for\n * @returns number - The size in bytes\n */\n\n public getBase64Size(base64: string) {\n return atob(base64.substring(base64.indexOf(',') + 1)).length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAca,mBAAmB,CAAA;AAC9B;;;;AAIG;AAEH,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU;IACnB;AAEA;;;;;AAKG;AAEH,IAAA,MAAM,CAAC,KAAa,EAAA;AAClB,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,IAAI,IAAI,K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: "20.3.15", ngImport: i0, type: AXFormatterRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
45
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatterRegistryService, providedIn: 'root' }); }
44
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatterRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
45
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatterRegistryService, providedIn: 'root' }); }
46
46
  }
47
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatterRegistryService, decorators: [{
47
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatterRegistryService, decorators: [{
48
48
  type: Injectable,
49
49
  args: [{
50
50
  providedIn: 'root',
@@ -82,10 +82,10 @@ class AXFormatService {
82
82
  return new AXFormatFluent(this, this.pluginRegistry, value);
83
83
  }
84
84
  }
85
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
86
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatService, providedIn: 'root' }); }
85
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
86
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatService, providedIn: 'root' }); }
87
87
  }
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatService, decorators: [{
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatService, decorators: [{
89
89
  type: Injectable,
90
90
  args: [{ providedIn: 'root' }]
91
91
  }] });
@@ -126,10 +126,10 @@ class AXFormatterDirective {
126
126
  },
127
127
  });
128
128
  }
129
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: AXFormatterDirective, isStandalone: true, selector: "[formatter]", ngImport: i0 }); }
129
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
130
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: AXFormatterDirective, isStandalone: true, selector: "[formatter]", ngImport: i0 }); }
131
131
  }
132
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatterDirective, decorators: [{
132
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatterDirective, decorators: [{
133
133
  type: Directive,
134
134
  args: [{
135
135
  selector: '[formatter]',
@@ -177,10 +177,10 @@ class AXFormatPipe {
177
177
  // For non-periodic formatters, use the original behavior
178
178
  return systemEvents$.pipe(startWith(null), map(() => this.formatService.format(value, name, options)));
179
179
  }
180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
181
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXFormatPipe, isStandalone: true, name: "format" }); }
180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
181
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: AXFormatPipe, isStandalone: true, name: "format" }); }
182
182
  }
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatPipe, decorators: [{
183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatPipe, decorators: [{
184
184
  type: Pipe,
185
185
  args: [{
186
186
  name: 'format',
@@ -252,10 +252,10 @@ class AXNumberFormatter {
252
252
  this.separatorsCache[locale] = { thousandSeparator, decimalSeparator };
253
253
  return this.separatorsCache[locale];
254
254
  }
255
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXNumberFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
256
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXNumberFormatter }); }
255
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXNumberFormatter, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
256
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXNumberFormatter }); }
257
257
  }
258
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXNumberFormatter, decorators: [{
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXNumberFormatter, decorators: [{
259
259
  type: Injectable
260
260
  }] });
261
261
 
@@ -330,11 +330,11 @@ class AXFormatModule {
330
330
  f();
331
331
  });
332
332
  }
333
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
334
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXFormatModule, imports: [AXFormatterDirective, AXFormatPipe], exports: [AXFormatterDirective, AXFormatPipe] }); }
335
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatModule }); }
333
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
334
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: AXFormatModule, imports: [AXFormatterDirective, AXFormatPipe], exports: [AXFormatterDirective, AXFormatPipe] }); }
335
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatModule }); }
336
336
  }
337
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFormatModule, decorators: [{
337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFormatModule, decorators: [{
338
338
  type: NgModule,
339
339
  args: [{
340
340
  imports: [AXFormatterDirective, AXFormatPipe],
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-format.mjs","sources":["../../../../packages/core/format/src/lib/format.config.ts","../../../../packages/core/format/src/lib/format.service.ts","../../../../packages/core/format/src/lib/format.directive.ts","../../../../packages/core/format/src/lib/format.pipe.ts","../../../../packages/core/format/src/lib/formatters/number.formatter.ts","../../../../packages/core/format/src/lib/formatters/string.formatter.ts","../../../../packages/core/format/src/lib/format.module.ts","../../../../packages/core/format/src/acorex-core-format.ts"],"sourcesContent":["import { AXFormatOptions } from './format.types';\n\nexport abstract class AXFormatter {\n abstract get name(): string;\n\n /**\n * Formats a value with optional options.\n * @returns The formatted value.\n */\n abstract format(value: unknown, options?: AXFormatOptions | string): string;\n /**\n * Optional update interval in milliseconds for formatters that need periodic updates.\n * If specified, the format pipe will automatically refresh the formatted value at this interval.\n */\n updateInterval?: number;\n}\n","import { inject, 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 = inject(Injector);\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 * Resolves a formatter instance by its name.\n *\n * @param name - The formatter name.\n * @returns AXFormatter - The resolved formatter instance.\n * @throws Error when no formatter with the given name exists.\n */\n get(name: string): AXFormatter {\n const formatter = this.formatters.find((c) => c.name == name);\n if (!formatter) {\n throw new Error(`Formatter not found: ${name}`);\n }\n return formatter;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXFormatService {\n private pluginRegistry = inject(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 /**\n * Triggers a render event for listeners that care about formatting updates.\n *\n * @returns void - Emits on the onRender observable.\n */\n\n render() {\n this.renderSubject.next();\n }\n\n //TODO\n // Overload for traditional formatting\n\n /**\n * Formats a value using the specified formatter name.\n *\n * @param value - The input value to format.\n * @param formatter - The formatter name to use (e.g., 'number', 'string').\n * @param options - Optional options specific to the formatter.\n * @returns string - The formatted string.\n */\n\n format(value: unknown, formatter: string, options?: any): string;\n\n // Overload for starting fluent API chain\n\n /**\n * Starts a fluent formatting chain.\n *\n * @param value - The input value to format.\n * @returns AXFormatFluent - A fluent API object for chaining.\n */\n format(value: unknown): AXFormatFluent;\n\n // Implementation of the format method\n\n /**\n * Formats a value according to the formatter's rules.\n *\n * @param value - The value to format.\n * @param options - Optional options bag or string, depending on the formatter.\n * @returns string - The formatted result.\n */\n format(value: unknown, formatter?: string, options?: any): string | AXFormatFluent {\n if (typeof formatter === 'string') {\n const formatterRef = this.pluginRegistry.get(formatter);\n return formatterRef.format(value, options);\n } else {\n return new AXFormatFluent(this, this.pluginRegistry, value);\n }\n }\n}\n\nclass AXFormatFluent {\n constructor(\n private formatService: AXFormatService,\n private pluginRegistry: AXFormatterRegistryService,\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.pluginRegistry.get(formatter);\n return formatterRef.format(this.initialValue, options);\n } catch (error) {\n return String(this.initialValue);\n }\n }\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { AXFormatService } from './format.service';\nimport { AXFormatOptionsMap } from './format.types';\n\n@Directive({\n selector: '[formatter]',\n})\nexport class AXFormatterDirective implements OnInit {\n private templateRef = inject<TemplateRef<any>>(TemplateRef);\n private viewContainer = inject(ViewContainerRef);\n private formatService = inject(AXFormatService);\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: <K extends keyof AXFormatOptionsMap>(\n value: unknown,\n formatter: K,\n options?: AXFormatOptionsMap[K],\n ) => {\n return this.formatService.format(value, formatter, options);\n },\n });\n }\n}\n","import { AXEventData, AXEventService, AXSystemEvents } from '@acorex/core/events';\nimport { Pipe, PipeTransform, inject } from '@angular/core';\nimport { Observable, filter, interval, map, merge, shareReplay, startWith } from 'rxjs';\nimport { AXFormatService, AXFormatterRegistryService } from './format.service';\nimport { AXFormatOptions } from './format.types';\n\n// Shared interval streams cache to avoid creating multiple intervals for the same duration\nconst intervalCache = new Map<number, Observable<number>>();\n\nfunction getSharedInterval(ms: number): Observable<number> {\n let cached = intervalCache.get(ms);\n if (!cached) {\n cached = interval(ms).pipe(shareReplay({ bufferSize: 1, refCount: true }));\n intervalCache.set(ms, cached);\n }\n return cached;\n}\n\n@Pipe({\n name: 'format',\n pure: true,\n})\nexport class AXFormatPipe implements PipeTransform {\n private formatService = inject(AXFormatService);\n private eventService = inject(AXEventService);\n private formatterRegistry = inject(AXFormatterRegistryService);\n\n private triggers = [...Object.values(AXSystemEvents).map((event) => event as string)];\n\n /**\n * Angular pipe for formatting values reactively. Re-evaluates when system events (such as language change) occur.\n *\n * @param value - The input value to format.\n * @param name - The formatter name.\n * @param options - Optional options specific to the formatter.\n * @returns Observable<string> - Emits the formatted string and updates on system events.\n */\n\n transform(value: unknown, name: string, options?: AXFormatOptions | string): Observable<string> {\n // Get the formatter to check if it needs periodic updates\n const formatter = this.formatterRegistry.get(name);\n\n // System events stream (language changes, etc.)\n const systemEvents$ = this.eventService.onEvent.pipe(\n filter((event: AXEventData) => this.triggers.includes(event.type as AXSystemEvents)),\n );\n\n // If formatter has updateInterval, create a periodic update stream\n if (formatter.updateInterval) {\n // Use shared interval to optimize performance when multiple instances exist\n const periodicUpdates$ = getSharedInterval(formatter.updateInterval);\n\n // Merge system events and periodic updates\n return merge(systemEvents$, periodicUpdates$).pipe(\n startWith(null), // Emit initial value immediately\n map(() => this.formatService.format(value, name as any, options)),\n );\n }\n\n // For non-periodic formatters, use the original behavior\n return systemEvents$.pipe(\n startWith(null),\n map(() => this.formatService.format(value, name as any, options)),\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 { ModuleWithProviders, NgModule, inject } from '@angular/core';\nimport { AXFormatter } from './format.config';\nimport { AXFormatterDirective } from './format.directive';\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: [AXFormatterDirective, AXFormatPipe],\n exports: [AXFormatterDirective, AXFormatPipe],\n})\nexport class AXFormatModule {\n /**\n * Configures the module for the root injector, optionally registering custom formatters.\n *\n * @param configs - Optional configuration containing custom formatter classes.\n * @returns ModuleWithProviders<AXFormatModule>\n */\n\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 /**\n * Configures the module for a feature injector, optionally registering custom formatters.\n *\n * @param configs - Optional configuration containing custom formatter classes.\n * @returns ModuleWithProviders<AXFormatModule>\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() {\n const instances = inject<any[]>('AXFormatModuleFactory' as any);\n\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;AAahC;;MCPY,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAA,CAAA,OAAO,GAAkB,EAAE;AAE3B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAkCpC,IAAA;IAhCC,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,C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AG,cAAc,EAAE,IAAI,OAAO,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;oBACjF,CAAC;oBACD,IAAI,EAAE,CAAC,0BAA0B,CAAC;AAClC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF;IACH;AAEA;;AAEG;AACH,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,SAAS,GAAG,MAAM,CAAQ,uBAA8B,CAAC;AAE/D,QAAA,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AACtB,YAAA,CAAC,EAAE;AACL,QAAA,CAAC,CAAC;IACJ;+GA1DW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHf,oBAAoB,EAAE,YAAY,CAAA,EAAA,OAAA,EAAA,CAClC,oBAAoB,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA;gHAEjC,cAAc,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,YAAY,CAAC;AAC7C,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,YAAY,CAAC;AAC9C,iBAAA;;;ACjBD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-format.mjs","sources":["../../../../packages/core/format/src/lib/format.config.ts","../../../../packages/core/format/src/lib/format.service.ts","../../../../packages/core/format/src/lib/format.directive.ts","../../../../packages/core/format/src/lib/format.pipe.ts","../../../../packages/core/format/src/lib/formatters/number.formatter.ts","../../../../packages/core/format/src/lib/formatters/string.formatter.ts","../../../../packages/core/format/src/lib/format.module.ts","../../../../packages/core/format/src/acorex-core-format.ts"],"sourcesContent":["import { AXFormatOptions } from './format.types';\n\nexport abstract class AXFormatter {\n abstract get name(): string;\n\n /**\n * Formats a value with optional options.\n * @returns The formatted value.\n */\n abstract format(value: unknown, options?: AXFormatOptions | string): string;\n /**\n * Optional update interval in milliseconds for formatters that need periodic updates.\n * If specified, the format pipe will automatically refresh the formatted value at this interval.\n */\n updateInterval?: number;\n}\n","import { inject, 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 = inject(Injector);\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 * Resolves a formatter instance by its name.\n *\n * @param name - The formatter name.\n * @returns AXFormatter - The resolved formatter instance.\n * @throws Error when no formatter with the given name exists.\n */\n get(name: string): AXFormatter {\n const formatter = this.formatters.find((c) => c.name == name);\n if (!formatter) {\n throw new Error(`Formatter not found: ${name}`);\n }\n return formatter;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXFormatService {\n private pluginRegistry = inject(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 /**\n * Triggers a render event for listeners that care about formatting updates.\n *\n * @returns void - Emits on the onRender observable.\n */\n\n render() {\n this.renderSubject.next();\n }\n\n //TODO\n // Overload for traditional formatting\n\n /**\n * Formats a value using the specified formatter name.\n *\n * @param value - The input value to format.\n * @param formatter - The formatter name to use (e.g., 'number', 'string').\n * @param options - Optional options specific to the formatter.\n * @returns string - The formatted string.\n */\n\n format(value: unknown, formatter: string, options?: any): string;\n\n // Overload for starting fluent API chain\n\n /**\n * Starts a fluent formatting chain.\n *\n * @param value - The input value to format.\n * @returns AXFormatFluent - A fluent API object for chaining.\n */\n format(value: unknown): AXFormatFluent;\n\n // Implementation of the format method\n\n /**\n * Formats a value according to the formatter's rules.\n *\n * @param value - The value to format.\n * @param options - Optional options bag or string, depending on the formatter.\n * @returns string - The formatted result.\n */\n format(value: unknown, formatter?: string, options?: any): string | AXFormatFluent {\n if (typeof formatter === 'string') {\n const formatterRef = this.pluginRegistry.get(formatter);\n return formatterRef.format(value, options);\n } else {\n return new AXFormatFluent(this, this.pluginRegistry, value);\n }\n }\n}\n\nclass AXFormatFluent {\n constructor(\n private formatService: AXFormatService,\n private pluginRegistry: AXFormatterRegistryService,\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.pluginRegistry.get(formatter);\n return formatterRef.format(this.initialValue, options);\n } catch (error) {\n return String(this.initialValue);\n }\n }\n}\n","import { Directive, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';\nimport { AXFormatService } from './format.service';\nimport { AXFormatOptionsMap } from './format.types';\n\n@Directive({\n selector: '[formatter]',\n})\nexport class AXFormatterDirective implements OnInit {\n private templateRef = inject<TemplateRef<any>>(TemplateRef);\n private viewContainer = inject(ViewContainerRef);\n private formatService = inject(AXFormatService);\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: <K extends keyof AXFormatOptionsMap>(\n value: unknown,\n formatter: K,\n options?: AXFormatOptionsMap[K],\n ) => {\n return this.formatService.format(value, formatter, options);\n },\n });\n }\n}\n","import { AXEventData, AXEventService, AXSystemEvents } from '@acorex/core/events';\nimport { Pipe, PipeTransform, inject } from '@angular/core';\nimport { Observable, filter, interval, map, merge, shareReplay, startWith } from 'rxjs';\nimport { AXFormatService, AXFormatterRegistryService } from './format.service';\nimport { AXFormatOptions } from './format.types';\n\n// Shared interval streams cache to avoid creating multiple intervals for the same duration\nconst intervalCache = new Map<number, Observable<number>>();\n\nfunction getSharedInterval(ms: number): Observable<number> {\n let cached = intervalCache.get(ms);\n if (!cached) {\n cached = interval(ms).pipe(shareReplay({ bufferSize: 1, refCount: true }));\n intervalCache.set(ms, cached);\n }\n return cached;\n}\n\n@Pipe({\n name: 'format',\n pure: true,\n})\nexport class AXFormatPipe implements PipeTransform {\n private formatService = inject(AXFormatService);\n private eventService = inject(AXEventService);\n private formatterRegistry = inject(AXFormatterRegistryService);\n\n private triggers = [...Object.values(AXSystemEvents).map((event) => event as string)];\n\n /**\n * Angular pipe for formatting values reactively. Re-evaluates when system events (such as language change) occur.\n *\n * @param value - The input value to format.\n * @param name - The formatter name.\n * @param options - Optional options specific to the formatter.\n * @returns Observable<string> - Emits the formatted string and updates on system events.\n */\n\n transform(value: unknown, name: string, options?: AXFormatOptions | string): Observable<string> {\n // Get the formatter to check if it needs periodic updates\n const formatter = this.formatterRegistry.get(name);\n\n // System events stream (language changes, etc.)\n const systemEvents$ = this.eventService.onEvent.pipe(\n filter((event: AXEventData) => this.triggers.includes(event.type as AXSystemEvents)),\n );\n\n // If formatter has updateInterval, create a periodic update stream\n if (formatter.updateInterval) {\n // Use shared interval to optimize performance when multiple instances exist\n const periodicUpdates$ = getSharedInterval(formatter.updateInterval);\n\n // Merge system events and periodic updates\n return merge(systemEvents$, periodicUpdates$).pipe(\n startWith(null), // Emit initial value immediately\n map(() => this.formatService.format(value, name as any, options)),\n );\n }\n\n // For non-periodic formatters, use the original behavior\n return systemEvents$.pipe(\n startWith(null),\n map(() => this.formatService.format(value, name as any, options)),\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 { ModuleWithProviders, NgModule, inject } from '@angular/core';\nimport { AXFormatter } from './format.config';\nimport { AXFormatterDirective } from './format.directive';\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: [AXFormatterDirective, AXFormatPipe],\n exports: [AXFormatterDirective, AXFormatPipe],\n})\nexport class AXFormatModule {\n /**\n * Configures the module for the root injector, optionally registering custom formatters.\n *\n * @param configs - Optional configuration containing custom formatter classes.\n * @returns ModuleWithProviders<AXFormatModule>\n */\n\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 /**\n * Configures the module for a feature injector, optionally registering custom formatters.\n *\n * @param configs - Optional configuration containing custom formatter classes.\n * @returns ModuleWithProviders<AXFormatModule>\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() {\n const instances = inject<any[]>('AXFormatModuleFactory' as any);\n\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;AAahC;;MCPY,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;QAIU,IAAA,CAAA,OAAO,GAAkB,EAAE;AAE3B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAkCpC,IAAA;IAhCC,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,CA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,EAAE,UAAU,IAAI,EAAE,CAAC,CAAC,CAAC;oBACjF,CAAC;oBACD,IAAI,EAAE,CAAC,0BAA0B,CAAC;AAClC,oBAAA,KAAK,EAAE,IAAI;AACZ,iBAAA;AACF,aAAA;SACF;IACH;AAEA;;AAEG;AACH,IAAA,WAAA,GAAA;AACE,QAAA,MAAM,SAAS,GAAG,MAAM,CAAQ,uBAA8B,CAAC;AAE/D,QAAA,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,KAAI;AACtB,YAAA,CAAC,EAAE;AACL,QAAA,CAAC,CAAC;IACJ;8GA1DW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAd,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAHf,oBAAoB,EAAE,YAAY,CAAA,EAAA,OAAA,EAAA,CAClC,oBAAoB,EAAE,YAAY,CAAA,EAAA,CAAA,CAAA;+GAEjC,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,YAAY,CAAC;AAC7C,oBAAA,OAAO,EAAE,CAAC,oBAAoB,EAAE,YAAY,CAAC;AAC9C,iBAAA;;;ACjBD;;AAEG;;;;"}
@@ -1,8 +1,10 @@
1
+ import { AXZIndexService } from '@acorex/core/z-index';
1
2
  import * as i0 from '@angular/core';
2
- import { signal, Injectable } from '@angular/core';
3
+ import { inject, signal, Injectable } from '@angular/core';
3
4
 
4
5
  class AXFullScreenService {
5
6
  constructor() {
7
+ this.zIndexService = inject(AXZIndexService);
6
8
  /**
7
9
  * Current fullscreen state
8
10
  */
@@ -19,6 +21,10 @@ class AXFullScreenService {
19
21
  * Fullscreen container element
20
22
  */
21
23
  this.fullscreenContainer = null;
24
+ /**
25
+ * Z-index token for this fullscreen instance
26
+ */
27
+ this.zToken = null;
22
28
  }
23
29
  /**
24
30
  * Toggle fullscreen state
@@ -41,6 +47,8 @@ class AXFullScreenService {
41
47
  // Store original styles & parent
42
48
  this.storeOriginalStyles(element);
43
49
  this.originalParent = element.parentElement;
50
+ // Acquire z-index token
51
+ this.zToken = this.zIndexService.acquire();
44
52
  // Create fullscreen container
45
53
  const container = document.createElement('div');
46
54
  container.style.position = 'fixed';
@@ -48,8 +56,7 @@ class AXFullScreenService {
48
56
  container.style.left = '0';
49
57
  container.style.width = '100vw';
50
58
  container.style.height = '100vh';
51
- container.style.zIndex = '100';
52
- container.style.backgroundColor = '#ffffff';
59
+ container.style.zIndex = String(this.zToken.zIndex);
53
60
  container.style.overflow = 'auto';
54
61
  // Move element into container
55
62
  container.appendChild(element);
@@ -87,6 +94,9 @@ class AXFullScreenService {
87
94
  document.body.removeChild(this.fullscreenContainer);
88
95
  }
89
96
  this.fullscreenContainer = null;
97
+ // Release z-index token
98
+ this.zIndexService.release(this.zToken);
99
+ this.zToken = null;
90
100
  // Restore original styles
91
101
  this.restoreOriginalStyles(element);
92
102
  this.isFullscreenState.set(false);
@@ -132,10 +142,10 @@ class AXFullScreenService {
132
142
  });
133
143
  this.originalStyles = {};
134
144
  }
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFullScreenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
136
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFullScreenService, providedIn: 'root' }); }
145
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFullScreenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
146
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFullScreenService, providedIn: 'root' }); }
137
147
  }
138
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXFullScreenService, decorators: [{
148
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXFullScreenService, decorators: [{
139
149
  type: Injectable,
140
150
  args: [{
141
151
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-full-screen.mjs","sources":["../../../../packages/core/full-screen/src/lib/full-screen.service.ts","../../../../packages/core/full-screen/src/acorex-core-full-screen.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFullScreenService {\n /**\n * Current fullscreen state\n */\n private readonly isFullscreenState = signal<boolean>(false);\n\n /**\n * Original element styles to restore\n */\n private originalStyles: Partial<CSSStyleDeclaration> = {};\n\n /**\n * Original parent element reference\n */\n private originalParent: HTMLElement | null = null;\n\n /**\n * Fullscreen container element\n */\n private fullscreenContainer: HTMLElement | null = null;\n\n /**\n * Toggle fullscreen state\n */\n toggle(element: HTMLElement): void {\n if (this.isFullscreenState()) {\n this.exit(element);\n } else {\n this.enter(element);\n }\n }\n\n /**\n * Enter fullscreen mode\n */\n enter(element: HTMLElement): void {\n if (this.isFullscreenState()) return;\n\n try {\n // Store original styles & parent\n this.storeOriginalStyles(element);\n this.originalParent = element.parentElement;\n\n // Create fullscreen container\n const container = document.createElement('div');\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n container.style.width = '100vw';\n container.style.height = '100vh';\n container.style.zIndex = '100';\n container.style.backgroundColor = '#ffffff';\n container.style.overflow = 'auto';\n\n // Move element into container\n container.appendChild(element);\n\n // Apply fullscreen styles to element\n element.style.position = 'relative';\n element.style.width = '100%';\n element.style.height = '100%';\n element.style.margin = '0';\n element.style.padding = '0';\n\n // Append container to body\n document.body.appendChild(container);\n\n // Prevent body scroll\n document.body.style.overflow = 'hidden';\n\n this.fullscreenContainer = container;\n this.isFullscreenState.set(true);\n } catch (error) {\n console.error('Error entering fullscreen:', error);\n this.restoreOriginalStyles(element);\n }\n }\n\n /**\n * Exit fullscreen mode\n */\n exit(element: HTMLElement): void {\n if (!this.isFullscreenState()) return;\n\n try {\n // Restore body scroll\n document.body.style.overflow = '';\n\n // Move element back to original parent\n if (this.fullscreenContainer && this.originalParent) {\n this.fullscreenContainer.removeChild(element);\n this.originalParent.appendChild(element);\n document.body.removeChild(this.fullscreenContainer);\n }\n\n this.fullscreenContainer = null;\n\n // Restore original styles\n this.restoreOriginalStyles(element);\n\n this.isFullscreenState.set(false);\n } catch (error) {\n console.error('Error exiting fullscreen:', error);\n }\n }\n\n /**\n * Check fullscreen state\n */\n isFullscreen(): boolean {\n return this.isFullscreenState();\n }\n\n /**\n * Store original computed styles\n */\n private storeOriginalStyles(element: HTMLElement): void {\n const computed = window.getComputedStyle(element);\n\n this.originalStyles = {\n position: computed.position,\n top: computed.top,\n left: computed.left,\n width: computed.width,\n height: computed.height,\n zIndex: computed.zIndex,\n backgroundColor: computed.backgroundColor,\n margin: computed.margin,\n padding: computed.padding,\n };\n }\n\n /**\n * Restore original styles\n */\n private restoreOriginalStyles(element: HTMLElement): void {\n Object.entries(this.originalStyles).forEach(([key, value]) => {\n if (value) {\n (element.style as any)[key] = value;\n } else {\n (element.style as any)[key] = '';\n }\n });\n\n this.originalStyles = {};\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAKa,mBAAmB,CAAA;AAHhC,IAAA,WAAA,GAAA;AAIE;;AAEG;AACc,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAU,KAAK,6DAAC;AAE3D;;AAEG;QACK,IAAA,CAAA,cAAc,GAAiC,EAAE;AAEzD;;AAEG;Q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AA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;;4FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACJD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-full-screen.mjs","sources":["../../../../packages/core/full-screen/src/lib/full-screen.service.ts","../../../../packages/core/full-screen/src/acorex-core-full-screen.ts"],"sourcesContent":["import { AXZIndexService, AXZToken } from '@acorex/core/z-index';\nimport { inject, Injectable, signal } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFullScreenService {\n private readonly zIndexService = inject(AXZIndexService);\n\n /**\n * Current fullscreen state\n */\n private readonly isFullscreenState = signal<boolean>(false);\n\n /**\n * Original element styles to restore\n */\n private originalStyles: Partial<CSSStyleDeclaration> = {};\n\n /**\n * Original parent element reference\n */\n private originalParent: HTMLElement | null = null;\n\n /**\n * Fullscreen container element\n */\n private fullscreenContainer: HTMLElement | null = null;\n\n /**\n * Z-index token for this fullscreen instance\n */\n private zToken: AXZToken | null = null;\n\n /**\n * Toggle fullscreen state\n */\n toggle(element: HTMLElement): void {\n if (this.isFullscreenState()) {\n this.exit(element);\n } else {\n this.enter(element);\n }\n }\n\n /**\n * Enter fullscreen mode\n */\n enter(element: HTMLElement): void {\n if (this.isFullscreenState()) return;\n\n try {\n // Store original styles & parent\n this.storeOriginalStyles(element);\n this.originalParent = element.parentElement;\n\n // Acquire z-index token\n this.zToken = this.zIndexService.acquire();\n\n // Create fullscreen container\n const container = document.createElement('div');\n container.style.position = 'fixed';\n container.style.top = '0';\n container.style.left = '0';\n container.style.width = '100vw';\n container.style.height = '100vh';\n container.style.zIndex = String(this.zToken.zIndex);\n container.style.overflow = 'auto';\n\n // Move element into container\n container.appendChild(element);\n\n // Apply fullscreen styles to element\n element.style.position = 'relative';\n element.style.width = '100%';\n element.style.height = '100%';\n element.style.margin = '0';\n element.style.padding = '0';\n\n // Append container to body\n document.body.appendChild(container);\n\n // Prevent body scroll\n document.body.style.overflow = 'hidden';\n\n this.fullscreenContainer = container;\n this.isFullscreenState.set(true);\n } catch (error) {\n console.error('Error entering fullscreen:', error);\n this.restoreOriginalStyles(element);\n }\n }\n\n /**\n * Exit fullscreen mode\n */\n exit(element: HTMLElement): void {\n if (!this.isFullscreenState()) return;\n\n try {\n // Restore body scroll\n document.body.style.overflow = '';\n\n // Move element back to original parent\n if (this.fullscreenContainer && this.originalParent) {\n this.fullscreenContainer.removeChild(element);\n this.originalParent.appendChild(element);\n document.body.removeChild(this.fullscreenContainer);\n }\n\n this.fullscreenContainer = null;\n\n // Release z-index token\n this.zIndexService.release(this.zToken);\n this.zToken = null;\n\n // Restore original styles\n this.restoreOriginalStyles(element);\n\n this.isFullscreenState.set(false);\n } catch (error) {\n console.error('Error exiting fullscreen:', error);\n }\n }\n\n /**\n * Check fullscreen state\n */\n isFullscreen(): boolean {\n return this.isFullscreenState();\n }\n\n /**\n * Store original computed styles\n */\n private storeOriginalStyles(element: HTMLElement): void {\n const computed = window.getComputedStyle(element);\n\n this.originalStyles = {\n position: computed.position,\n top: computed.top,\n left: computed.left,\n width: computed.width,\n height: computed.height,\n zIndex: computed.zIndex,\n backgroundColor: computed.backgroundColor,\n margin: computed.margin,\n padding: computed.padding,\n };\n }\n\n /**\n * Restore original styles\n */\n private restoreOriginalStyles(element: HTMLElement): void {\n Object.entries(this.originalStyles).forEach(([key, value]) => {\n if (value) {\n (element.style as any)[key] = value;\n } else {\n (element.style as any)[key] = '';\n }\n });\n\n this.originalStyles = {};\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,mBAAmB,CAAA;AAHhC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AA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,gBAAA,OAAO,CAAC,KAAa,CAAC,GAAG,CAAC,GAAG,EAAE;YAClC;AACF,QAAA,CAAC,CAAC;AAEF,QAAA,IAAI,CAAC,cAAc,GAAG,EAAE;IAC1B;8GA9JW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cAFlB,MAAM,EAAA,CAAA,CAAA;;2FAEP,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAH/B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -35,10 +35,10 @@ class AXIconResolverService {
35
35
  }
36
36
  throw new Error(`AXIconResolverService: Could not resolve icon "${icon}"`);
37
37
  }
38
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXIconResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXIconResolverService, providedIn: 'root' }); }
38
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXIconResolverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
39
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXIconResolverService, providedIn: 'root' }); }
40
40
  }
41
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXIconResolverService, decorators: [{
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXIconResolverService, decorators: [{
42
42
  type: Injectable,
43
43
  args: [{ providedIn: 'root' }]
44
44
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-icon.mjs","sources":["../../../../packages/core/icon/src/lib/icon.types.ts","../../../../packages/core/icon/src/lib/icon-resolver.service.ts","../../../../packages/core/icon/src/acorex-core-icon.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport abstract class AXIconResolver {\n abstract resolve(icon: string): Promise<string | null>;\n}\n\nexport const AX_ICON_RESOLVER = new InjectionToken<AXIconResolver | AXIconResolver[]>('AX_ICON_RESOLVER');\n\n// Optional default fallback\nexport class AXIconResolverDefault extends AXIconResolver {\n async resolve(icon: string): Promise<string | null> {\n return icon;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AX_ICON_RESOLVER } from './icon.types';\n\n@Injectable({ providedIn: 'root' })\nexport class AXIconResolverService {\n private resolvers = (() => {\n const injected = inject(AX_ICON_RESOLVER, { optional: true });\n if (!injected) {\n return [];\n }\n return Array.isArray(injected) ? injected : [injected];\n })();\n\n private cache = new Map<string, string>();\n\n async resolve(icon: string): Promise<string> {\n if (this.cache.has(icon)) {\n return this.cache.get(icon);\n }\n\n for (const resolver of this.resolvers) {\n const result = await resolver.resolve(icon);\n if (result != null) {\n this.cache.set(icon, result);\n return result;\n }\n }\n\n throw new Error(`AXIconResolverService: Could not resolve icon \"${icon}\"`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAEsB,cAAc,CAAA;AAEnC;MAEY,gBAAgB,GAAG,IAAI,cAAc,CAAoC,kBAAkB;AAExG;AACM,MAAO,qBAAsB,SAAQ,cAAc,CAAA;IACvD,MAAM,OAAO,CAAC,IAAY,EAAA;AACxB,QAAA,OAAO,IAAI;IACb;AACD;;MCTY,qBAAqB,CAAA;AADlC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nB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACHlC;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-icon.mjs","sources":["../../../../packages/core/icon/src/lib/icon.types.ts","../../../../packages/core/icon/src/lib/icon-resolver.service.ts","../../../../packages/core/icon/src/acorex-core-icon.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport abstract class AXIconResolver {\n abstract resolve(icon: string): Promise<string | null>;\n}\n\nexport const AX_ICON_RESOLVER = new InjectionToken<AXIconResolver | AXIconResolver[]>('AX_ICON_RESOLVER');\n\n// Optional default fallback\nexport class AXIconResolverDefault extends AXIconResolver {\n async resolve(icon: string): Promise<string | null> {\n return icon;\n }\n}\n","import { inject, Injectable } from '@angular/core';\nimport { AX_ICON_RESOLVER } from './icon.types';\n\n@Injectable({ providedIn: 'root' })\nexport class AXIconResolverService {\n private resolvers = (() => {\n const injected = inject(AX_ICON_RESOLVER, { optional: true });\n if (!injected) {\n return [];\n }\n return Array.isArray(injected) ? injected : [injected];\n })();\n\n private cache = new Map<string, string>();\n\n async resolve(icon: string): Promise<string> {\n if (this.cache.has(icon)) {\n return this.cache.get(icon);\n }\n\n for (const resolver of this.resolvers) {\n const result = await resolver.resolve(icon);\n if (result != null) {\n this.cache.set(icon, result);\n return result;\n }\n }\n\n throw new Error(`AXIconResolverService: Could not resolve icon \"${icon}\"`);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAEsB,cAAc,CAAA;AAEnC;MAEY,gBAAgB,GAAG,IAAI,cAAc,CAAoC,kBAAkB;AAExG;AACM,MAAO,qBAAsB,SAAQ,cAAc,CAAA;IACvD,MAAM,OAAO,CAAC,IAAY,EAAA;AACxB,QAAA,OAAO,IAAI;IACb;AACD;;MCTY,qBAAqB,CAAA;AADlC,IAAA,WAAA,GAAA;QAEU,IAAA,CAAA,SAAS,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UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACHlC;;AAEG;;;;"}
@@ -47,10 +47,10 @@ class AXImageService {
47
47
  canvas.getContext('2d').drawImage(image, 0, 0, width, height);
48
48
  return new Promise((resolve) => canvas.toBlob(resolve, options.type, options.quality));
49
49
  }
50
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXImageService }); }
50
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXImageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXImageService }); }
52
52
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXImageService, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXImageService, decorators: [{
54
54
  type: Injectable
55
55
  }] });
56
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-image.mjs","sources":["../../../../packages/core/image/src/lib/image.service.ts","../../../../packages/core/image/src/acorex-core-image.ts"],"sourcesContent":["import { DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n@Injectable()\nexport class AXImageService {\n private document = inject(DOCUMENT);\n private platformID = inject(PLATFORM_ID);\n\n /**\n * Resizes an image (File or HTMLImageElement) to fit within maxSize while preserving aspect ratio.\n * @param options.maxSize Maximum width/height in pixels.\n * @param options.source File or HTMLImageElement as source.\n * @param options.type Output MIME type (default 'image/png').\n * @param options.quality Output quality (0..1) for supported formats.\n * @returns Promise<Blob> of the resized image.\n */\n\n async resize(options: {\n maxSize: number;\n source: HTMLImageElement | File;\n type?: 'image/png' | 'image/jpeg' | 'image/webp';\n quality?: number;\n }): Promise<Blob> {\n options = Object.assign({ type: 'image/png', quality: 1 }, options);\n\n let image: HTMLImageElement;\n if (options.source instanceof File) {\n const a = new Image();\n a.src = URL.createObjectURL(options.source);\n await new Promise<Event>((res) => (a.onload = res));\n image = a;\n } else {\n image = options.source;\n }\n\n // Resize the image\n const canvas: any = this.document.createElement('canvas');\n let width = image.width;\n let height = image.height;\n if (width > height) {\n if (width > options.maxSize) {\n height *= options.maxSize / width;\n width = options.maxSize;\n }\n } else {\n if (height > options.maxSize) {\n width *= options.maxSize / height;\n height = options.maxSize;\n }\n }\n canvas.width = width;\n canvas.height = height;\n canvas.getContext('2d').drawImage(image, 0, 0, width, height);\n return new Promise((resolve) => canvas.toBlob(resolve, options.type, options.quality));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAGa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAiDzC,IAAA;AA/CC;;;;;;;AAOG;IAEH,MAAM,MAAM,CAAC,OAKZ,EAAA;AACC,QAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC;AAEnE,QAAA,IAAI,KAAuB;AAC3B,QAAA,IAAI,OAAO,CAAC,MAAM,YAAY,IAAI,EAAE;AAClC,YAAA,MAAM,CAAC,GAAG,IAAI,KAAK,EAAE;YACrB,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC;AAC3C,YAAA,MAAM,IAAI,OAAO,CAAQ,CAAC,GAA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AEG;;;;"}
1
+ {"version":3,"file":"acorex-core-image.mjs","sources":["../../../../packages/core/image/src/lib/image.service.ts","../../../../packages/core/image/src/acorex-core-image.ts"],"sourcesContent":["import { DOCUMENT, inject, Injectable, PLATFORM_ID } from '@angular/core';\n\n@Injectable()\nexport class AXImageService {\n private document = inject(DOCUMENT);\n private platformID = inject(PLATFORM_ID);\n\n /**\n * Resizes an image (File or HTMLImageElement) to fit within maxSize while preserving aspect ratio.\n * @param options.maxSize Maximum width/height in pixels.\n * @param options.source File or HTMLImageElement as source.\n * @param options.type Output MIME type (default 'image/png').\n * @param options.quality Output quality (0..1) for supported formats.\n * @returns Promise<Blob> of the resized image.\n */\n\n async resize(options: {\n maxSize: number;\n source: HTMLImageElement | File;\n type?: 'image/png' | 'image/jpeg' | 'image/webp';\n quality?: number;\n }): Promise<Blob> {\n options = Object.assign({ type: 'image/png', quality: 1 }, options);\n\n let image: HTMLImageElement;\n if (options.source instanceof File) {\n const a = new Image();\n a.src = URL.createObjectURL(options.source);\n await new Promise<Event>((res) => (a.onload = res));\n image = a;\n } else {\n image = options.source;\n }\n\n // Resize the image\n const canvas: any = this.document.createElement('canvas');\n let width = image.width;\n let height = image.height;\n if (width > height) {\n if (width > options.maxSize) {\n height *= options.maxSize / width;\n width = options.maxSize;\n }\n } else {\n if (height > options.maxSize) {\n width *= options.maxSize / height;\n height = options.maxSize;\n }\n }\n canvas.width = width;\n canvas.height = height;\n canvas.getContext('2d').drawImage(image, 0, 0, width, height);\n return new Promise((resolve) => canvas.toBlob(resolve, options.type, options.quality));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAGa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEU,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAiDzC,IAAA;AA/CC;;;;;;;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,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC;QAC7D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IACxF;8GAlDW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAd,cAAc,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACFD;;AAEG;;;;"}
@@ -112,10 +112,10 @@ class AXLocaleProfileProviderService {
112
112
  has(localeCode) {
113
113
  return this.registry.has(localeCode);
114
114
  }
115
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleProfileProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
116
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleProfileProviderService, providedIn: 'root' }); }
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleProfileProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
116
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleProfileProviderService, providedIn: 'root' }); }
117
117
  }
118
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleProfileProviderService, decorators: [{
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleProfileProviderService, decorators: [{
119
119
  type: Injectable,
120
120
  args: [{
121
121
  providedIn: 'root',
@@ -132,13 +132,13 @@ const AX_LOCALE_CONFIG = new InjectionToken('AX_LOCALE_CONFIG', {
132
132
  });
133
133
 
134
134
  class AXLocaleModule {
135
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
136
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleModule, imports: [i1.AXFormatModule] }); }
137
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleModule, imports: [AXFormatModule.forChild({
135
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
136
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleModule, imports: [i1.AXFormatModule] }); }
137
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleModule, imports: [AXFormatModule.forChild({
138
138
  formatters: [],
139
139
  })] }); }
140
140
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleModule, decorators: [{
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleModule, decorators: [{
142
142
  type: NgModule,
143
143
  args: [{
144
144
  imports: [
@@ -275,10 +275,10 @@ class AXLocaleService {
275
275
  this._activeProfile.set(cloneDeep(this.originalProfile));
276
276
  }
277
277
  }
278
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
279
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleService, providedIn: 'root' }); }
278
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
279
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleService, providedIn: 'root' }); }
280
280
  }
281
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: AXLocaleService, decorators: [{
281
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: AXLocaleService, decorators: [{
282
282
  type: Injectable,
283
283
  args: [{
284
284
  providedIn: 'root',