@acorex/core 18.14.1-next.4 → 18.15.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -190,28 +190,85 @@ export class AXTranslationService {
190
190
  // Perform parameter replacement
191
191
  return this.getTranslation((translation || key), lang, scope, options?.params);
192
192
  }
193
+ // private findAXTranslateOptionsFromKey(
194
+ // inputString: string,
195
+ // ): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {
196
+ // const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
197
+ // const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];
198
+ // let match;
199
+ // // Loop through all matches in the input string
200
+ // while ((match = regex.exec(inputString)) !== null) {
201
+ // result.push({
202
+ // lang: match[1] || undefined,
203
+ // scope: match[2] || undefined,
204
+ // key: match[3] || undefined,
205
+ // });
206
+ // }
207
+ // return result;
208
+ // }
193
209
  findAXTranslateOptionsFromKey(inputString) {
194
- const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
210
+ const regex = /t\(\s*['"]([^'"]+)['"]\s*(?:,\s*\{\s*([^}]*)\s*\})?\s*\)/g;
195
211
  const result = [];
196
212
  let match;
197
213
  // Loop through all matches in the input string
198
214
  while ((match = regex.exec(inputString)) !== null) {
215
+ const key = match[1]; // Extract the key
216
+ const options = match[2]; // Extract the options object, if present
217
+ // Parse options into a key-value object
218
+ const parsedOptions = {};
219
+ if (options) {
220
+ options.split(',').forEach((option) => {
221
+ const [key, value] = option.split(':').map((s) => s.trim().replace(/^['"]|['"]$/g, ''));
222
+ parsedOptions[key] = value || undefined;
223
+ });
224
+ }
199
225
  result.push({
200
- lang: match[1] || undefined,
201
- scope: match[2] || undefined,
202
- key: match[3] || undefined,
226
+ key,
227
+ lang: parsedOptions['lang'],
228
+ scope: parsedOptions['scope'],
203
229
  });
204
230
  }
205
231
  return result;
206
232
  }
233
+ // private translateAsyncAXTranslate(key: string, options?: AXTranslateOptions): Observable<string> {
234
+ // const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
235
+ // const splitParts = key.split(regex); // Split into <axt> parts and text parts
236
+ // const translationObservables: Observable<string>[] = [];
237
+ // for (const part of splitParts) {
238
+ // const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
239
+ // if (optionsFromKey.length > 0) {
240
+ // // This is an <axt> part, translate it
241
+ // for (const parsed of optionsFromKey) {
242
+ // const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
243
+ // const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
244
+ // const parsedKey = parsed.key;
245
+ // // Push the translation observable to the array
246
+ // translationObservables.push(
247
+ // this.load(parsedKey, {
248
+ // lang: parsedLang,
249
+ // scope: parsedScope,
250
+ // params: options?.params,
251
+ // }),
252
+ // );
253
+ // }
254
+ // } else {
255
+ // // This is plain text, so wrap it in an observable
256
+ // translationObservables.push(of(part));
257
+ // }
258
+ // }
259
+ // // Use forkJoin to wait for all observables to complete
260
+ // return forkJoin(translationObservables).pipe(
261
+ // map((translatedParts) => translatedParts.join('')), // Join all translated parts
262
+ // );
263
+ // }
207
264
  translateAsyncAXTranslate(key, options) {
208
- const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
209
- const splitParts = key.split(regex); // Split into <axt> parts and text parts
265
+ const regex = /(t\(['"][^'"]+['"](?:,\s*\{[^}]*\})?\))/g; // Match t('key', { ... }) calls
266
+ const splitParts = key.split(regex); // Split into t() parts and text parts
210
267
  const translationObservables = [];
211
268
  for (const part of splitParts) {
212
269
  const optionsFromKey = this.findAXTranslateOptionsFromKey(part);
213
270
  if (optionsFromKey.length > 0) {
214
- // This is an <axt> part, translate it
271
+ // This is a t() part, translate it
215
272
  for (const parsed of optionsFromKey) {
216
273
  const parsedLang = parsed.lang || options?.lang || this.getActiveLang();
217
274
  const parsedScope = parsed.scope || options?.scope || this.config.defaultScope;
@@ -239,4 +296,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
239
296
  type: Injectable,
240
297
  args: [{ providedIn: 'root' }]
241
298
  }], ctorParameters: () => [] });
242
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS90cmFuc2xhdGlvbi9zcmMvbGliL3RyYW5zbGF0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxZQUFZLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNuRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQUUsR0FBRyxJQUFJLFNBQVMsRUFBRSxHQUFHLElBQUksU0FBUyxFQUFFLE1BQU0sV0FBVyxDQUFDO0FBQy9ELE9BQU8sRUFDTCxlQUFlLEVBRWYsVUFBVSxFQUNWLFFBQVEsRUFDUixjQUFjLEVBQ2QsUUFBUSxFQUNSLGFBQWEsRUFDYixHQUFHLEVBQ0gsRUFBRSxFQUNGLFdBQVcsRUFDWCxTQUFTLEVBQ1QsU0FBUyxFQUNULElBQUksRUFDSixHQUFHLEdBQ0osTUFBTSxNQUFNLENBQUM7QUFDZCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RCxPQUFPLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQzs7QUFRN0QsSUFBSSxPQUE2QixDQUFDO0FBRWxDLE1BQU0sVUFBVSxhQUFhLENBQUMsR0FBVyxFQUFFLE9BQTRCO0lBQ3JFLE9BQU8sT0FBTyxDQUFDLGFBQW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AgICAgICAgIH0pLFxuICAgICAgICAgICk7XG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIC8vIFRoaXMgaXMgcGxhaW4gdGV4dCwgc28gd3JhcCBpdCBpbiBhbiBvYnNlcnZhYmxlXG4gICAgICAgIHRyYW5zbGF0aW9uT2JzZXJ2YWJsZXMucHVzaChvZihwYXJ0KSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gVXNlIGZvcmtKb2luIHRvIHdhaXQgZm9yIGFsbCBvYnNlcnZhYmxlcyB0byBjb21wbGV0ZVxuICAgIHJldHVybiBmb3JrSm9pbih0cmFuc2xhdGlvbk9ic2VydmFibGVzKS5waXBlKFxuICAgICAgbWFwKCh0cmFuc2xhdGVkUGFydHMpID0+IHRyYW5zbGF0ZWRQYXJ0cy5qb2luKCcnKSksIC8vIEpvaW4gYWxsIHRyYW5zbGF0ZWQgcGFydHNcbiAgICApO1xuICB9XG59XG4iXX0=
@@ -3,7 +3,10 @@ export class AXDrawingUtil {
3
3
  static collision(a, b) {
4
4
  const ac = a.getBoundingClientRect();
5
5
  const bc = b.getBoundingClientRect();
6
- if (ac.left < bc.left + bc.width && ac.left + ac.width > bc.left && ac.top < bc.top + bc.height && ac.top + ac.height > bc.top) {
6
+ if (ac.left < bc.left + bc.width &&
7
+ ac.left + ac.width > bc.left &&
8
+ ac.top < bc.top + bc.height &&
9
+ ac.top + ac.height > bc.top) {
7
10
  return true;
8
11
  }
9
12
  else {
@@ -20,10 +23,10 @@ export class AXDrawingUtil {
20
23
  });
21
24
  }
22
25
  static isInRecPoint(pos, rec) {
23
- return pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height;
26
+ return (pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height);
24
27
  }
25
28
  static convertRemToPixels(rem) {
26
29
  return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);
27
30
  }
28
31
  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ldHVybiBBWERyYXdpbmdVdGlsLmlzSW5SZWNQb2ludChwb3MsIHtcbiAgICAgIGxlZnQ6IGVsQm91bmQueCxcbiAgICAgIHdpZHRoOiBlbEJvdW5kLndpZHRoLFxuICAgICAgdG9wOiBlbEJvdW5kLnksXG4gICAgICBoZWlnaHQ6IGVsQm91bmQuaGVpZ2h0LFxuICAgIH0pO1xuICB9XG5cbiAgc3RhdGljIGlzSW5SZWNQb2ludChwb3M6IEFYUG9pbnQsIHJlYzogQVhCb3VuZGluZ0NsaWVudFJlY3QgfCBhbnkpOiBib29sZWFuIHtcbiAgICByZXR1cm4gKFxuICAgICAgcG9zLnggPj0gcmVjLmxlZnQgJiYgcG9zLnggPD0gcmVjLmxlZnQgKyByZWMud2lkdGggJiYgcG9zLnkgPj0gcmVjLnRvcCAmJiBwb3MueSA8PSByZWMudG9wICsgcmVjLmhlaWdodFxuICAgICk7XG4gIH1cblxuICBzdGF0aWMgY29udmVydFJlbVRvUGl4ZWxzKHJlbTogbnVtYmVyKTogbnVtYmVyIHtcbiAgICByZXR1cm4gcmVtICogcGFyc2VGbG9hdChnZXRDb21wdXRlZFN0eWxlKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCkuZm9udFNpemUpO1xuICB9XG59XG4iXX0=
@@ -1,10 +1,12 @@
1
- import { Directive, ElementRef, HostListener, Input, NgZone, Renderer2 } from '@angular/core';
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { Directive, ElementRef, HostListener, inject, Input, NgZone, Renderer2 } from '@angular/core';
2
3
  import * as i0 from "@angular/core";
3
4
  export class AXResizableDirective {
4
5
  constructor(el, renderer, zone) {
5
6
  this.el = el;
6
7
  this.renderer = renderer;
7
8
  this.zone = zone;
9
+ this.document = inject(DOCUMENT);
8
10
  this.minWidth = 100; // Minimum width for the resizable element
9
11
  this.isResizing = false;
10
12
  this.createResizeHandle(); // Initialize the resize handle
@@ -36,7 +38,7 @@ export class AXResizableDirective {
36
38
  if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {
37
39
  this.zone.runOutsideAngular(() => {
38
40
  this.isResizing = true;
39
- document.body.style.cursor = 'ew-resize'; // Change cursor to resize mode
41
+ this.document.body.style.cursor = 'ew-resize'; // Change cursor to resize mode
40
42
  // Change resize handle color to blue when resizing starts
41
43
  this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff');
42
44
  event.preventDefault();
@@ -50,7 +52,7 @@ export class AXResizableDirective {
50
52
  const rect = this.el.nativeElement.getBoundingClientRect();
51
53
  let newWidth;
52
54
  // Resize logic (LTR or RTL support)
53
- if (document.documentElement.dir === 'rtl') {
55
+ if (this.document.documentElement.dir === 'rtl') {
54
56
  newWidth = rect.right - event.clientX;
55
57
  }
56
58
  else {
@@ -68,7 +70,7 @@ export class AXResizableDirective {
68
70
  this.zone.runOutsideAngular(() => {
69
71
  if (this.isResizing) {
70
72
  this.isResizing = false;
71
- document.body.style.cursor = 'default'; // Reset the cursor
73
+ this.document.body.style.cursor = 'default'; // Reset the cursor
72
74
  // Reset the resize handle color to default when resizing ends
73
75
  this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');
74
76
  }
@@ -114,4 +116,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
114
116
  type: HostListener,
115
117
  args: ['mouseleave', ['$event']]
116
118
  }] } });
117
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzaXplLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS91dGlscy9zcmMvbGliL3Jlc2l6ZS5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsU0FBU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YnKTsgLy8gQmx1ZSBjb2xvciBvbiBob3ZlclxuICAgIH1cbiAgfVxuXG4gIC8vIE1vdXNlIGxlYXZlIGV2ZW50IHRvIHJlc2V0IHRoZSBiYWNrZ3JvdW5kIGNvbG9yXG4gIEBIb3N0TGlzdGVuZXIoJ21vdXNlbGVhdmUnLCBbJyRldmVudCddKVxuICBvbk1vdXNlTGVhdmUoKTogdm9pZCB7XG4gICAgLy8gT25seSByZXNldCB0byBkZWZhdWx0IGNvbG9yIGlmIG5vdCByZXNpemluZ1xuICAgIGlmICghdGhpcy5pc1Jlc2l6aW5nKSB7XG4gICAgICB0aGlzLnJlbmRlcmVyLnNldFN0eWxlKHRoaXMucmVzaXplSGFuZGxlLCAnYmFja2dyb3VuZC1jb2xvcicsICdyZ2JhKDAsIDAsIDAsIDAuMiknKTsgLy8gRGVmYXVsdCBiYWNrZ3JvdW5kIGNvbG9yXG4gICAgfVxuICB9XG59XG4iXX0=
@@ -1,7 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, NgModule } from '@angular/core';
2
+ import { Injectable, NgModule, inject } from '@angular/core';
3
3
  import * as i1 from '@acorex/core/format';
4
4
  import { AXFormatModule } from '@acorex/core/format';
5
+ import { DOCUMENT } from '@angular/common';
5
6
 
6
7
  class AXFileSizeFormatter {
7
8
  get name() {
@@ -42,6 +43,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
42
43
 
43
44
  class AXFileService {
44
45
  constructor() {
46
+ this.document = inject(DOCUMENT);
45
47
  this.blobToBase64 = (blob) => {
46
48
  if (blob instanceof Blob) {
47
49
  return new Promise((resolve, reject) => {
@@ -61,16 +63,16 @@ class AXFileService {
61
63
  choose(options) {
62
64
  return new Promise((resolve, reject) => {
63
65
  options = Object.assign({ multiple: false }, options);
64
- const input = document.createElement('input');
66
+ const input = this.document.createElement('input');
65
67
  input.style.display = 'none';
66
- document.body.appendChild(input);
68
+ this.document.body.appendChild(input);
67
69
  input.type = 'file';
68
70
  input.accept = options.accept || '';
69
71
  input.multiple = options.multiple || false;
70
72
  //
71
73
  const onError = (e) => {
72
74
  reject(e);
73
- document.body.removeChild(input);
75
+ this.document.body.removeChild(input);
74
76
  input.remove();
75
77
  input.removeEventListener('change', onChange);
76
78
  input.removeEventListener('error', onError);
@@ -78,7 +80,7 @@ class AXFileService {
78
80
  //
79
81
  const onChange = () => {
80
82
  resolve(Array.from(input.files || []));
81
- document.body.removeChild(input);
83
+ this.document.body.removeChild(input);
82
84
  input.remove();
83
85
  input.removeEventListener('change', onChange);
84
86
  input.removeEventListener('error', onError);
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-file.mjs","sources":["../../../../libs/core/file/src/lib/file-size-formatter.ts","../../../../libs/core/file/src/lib/file.module.ts","../../../../libs/core/file/src/lib/file.service.ts","../../../../libs/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 get name(): string {\n return 'filesize';\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 { Injectable } from '@angular/core';\n\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\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 = document.createElement('input');\n input.style.display = 'none';\n 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 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 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 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 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 public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\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,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU;;AAGnB,IAAA,MAAM,CAAC,KAAa,EAAA;AAClB,QAAA,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;QAE1B,IAAI,IAAI,KAAK,CAAC;AAAE,YAA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CAAC;;AAE3C,QAAA,OAAO,KAAK;;AAGP,IAAA,QAAQ,CAAC,MAAc,EAAA;QAC5B,MAAM,IAAI,GAAG,4BAA4B;AACzC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;;AAGnB,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;;8GA9DpD,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,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,aAAa,cAFZ,MAAM,EAAA,CAAA,CAAA;;2FAEP,aAAa,EAAA,UAAA,EAAA,CAAA;kBAHzB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-file.mjs","sources":["../../../../libs/core/file/src/lib/file-size-formatter.ts","../../../../libs/core/file/src/lib/file.module.ts","../../../../libs/core/file/src/lib/file.service.ts","../../../../libs/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 get name(): string {\n return 'filesize';\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 } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXFileService {\n private document = inject(DOCUMENT);\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 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 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 public isBase64(base64: string) {\n const regx = /[^:]\\w+\\/[\\w-+\\d.]+(?=;|,)/;\n return regx.test(base64);\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,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,UAAU;;AAGnB,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,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACvE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAElD,OAAO,UAAU,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;;8GAf7D,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAnB,mBAAmB,EAAA,CAAA,CAAA;;2FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B;;;MCHY,YAAY,CAAA;8GAAZ,YAAY,EAAA,IAAA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;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACLD;;AAEG;;;;"}
@@ -1,7 +1,11 @@
1
+ import { DOCUMENT } from '@angular/common';
1
2
  import * as i0 from '@angular/core';
2
- import { Injectable } from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
3
4
 
4
5
  class AXImageService {
6
+ constructor() {
7
+ this.document = inject(DOCUMENT);
8
+ }
5
9
  async resize(options) {
6
10
  options = Object.assign({ type: 'image/png', quality: 1 }, options);
7
11
  let image;
@@ -15,7 +19,7 @@ class AXImageService {
15
19
  image = options.source;
16
20
  }
17
21
  // Resize the image
18
- const canvas = document.createElement('canvas');
22
+ const canvas = this.document.createElement('canvas');
19
23
  let width = image.width;
20
24
  let height = image.height;
21
25
  if (width > height) {
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-image.mjs","sources":["../../../../libs/core/image/src/lib/image.service.ts","../../../../libs/core/image/src/acorex-core-image.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class AXImageService {\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 = 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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AC,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;;8GArC7E,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;;;;"}
1
+ {"version":3,"file":"acorex-core-image.mjs","sources":["../../../../libs/core/image/src/lib/image.service.ts","../../../../libs/core/image/src/acorex-core-image.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable()\nexport class AXImageService {\n private document = inject(DOCUMENT);\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":[],"mapp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