@acorex/core 18.12.44 → 18.14.1-next.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,7 @@ export class AXTranslationService {
22
22
  this.activeLang = new BehaviorSubject(this.getDefaultLang());
23
23
  this.langChanges$ = this.activeLang.asObservable();
24
24
  this.lastActiveLang = null;
25
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
25
26
  service = this;
26
27
  }
27
28
  loadLanguagesAndScopes(languages, scopes) {
@@ -77,6 +78,9 @@ export class AXTranslationService {
77
78
  isLangAvailable(lang, scope = null) {
78
79
  return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);
79
80
  }
81
+ getLangAvailable() {
82
+ return this.config.availableLangs;
83
+ }
80
84
  load(key, options = {}) {
81
85
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;
82
86
  // Function to fetch translation
@@ -142,22 +146,63 @@ export class AXTranslationService {
142
146
  }));
143
147
  }
144
148
  async translateAsync(key, options) {
145
- const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
146
- let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
147
- if (!translation) {
148
- // If the translation is not in the cache, load it
149
- await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));
150
- translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
151
- }
152
- // If still not available, try the last active language or default language
153
- if (!translation && this.lastActiveLang) {
154
- translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
149
+ // debugger;
150
+ if (this.findAXTranslateOptions(key).length > 0) {
151
+ // Use findAXTranslateOptions to parse all <axt> tags in the input string
152
+ const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
153
+ const splitParts = key.split(regex); // Split into <axt> parts and text parts
154
+ let translatedResult = '';
155
+ for (const part of splitParts) {
156
+ // Check if the part is an <axt> tag by using the findAXTranslateOptions function
157
+ const optionsFromKey = this.findAXTranslateOptions(part);
158
+ if (optionsFromKey.length > 0) {
159
+ // This is an <axt> part, translate it
160
+ for (const parsed of optionsFromKey) {
161
+ const parsedLang = parsed.lang ?? this.getActiveLang();
162
+ const parsedScope = parsed.scope ?? this.config.defaultScope;
163
+ const parsedKey = parsed.key;
164
+ let translation = lodashGet(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);
165
+ if (!translation) {
166
+ await firstValueFrom(this.load(parsedKey, { lang: parsedLang, scope: parsedScope }).pipe(take(1)));
167
+ translation = lodashGet(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);
168
+ }
169
+ if (!translation && this.lastActiveLang) {
170
+ translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${parsedScope}.${parsedKey}`);
171
+ }
172
+ if (!translation) {
173
+ translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${parsedScope}.${parsedKey}`);
174
+ }
175
+ // Get the final translation, applying any params if needed
176
+ const newTranslation = this.getTranslation((translation || parsedKey), parsedLang, parsedScope, options?.params);
177
+ // Append the translated text
178
+ translatedResult += `${newTranslation}`;
179
+ }
180
+ }
181
+ else {
182
+ // This is plain text, so add it as-is
183
+ translatedResult += part;
184
+ }
185
+ }
186
+ return translatedResult;
155
187
  }
156
- if (!translation) {
157
- translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
188
+ else {
189
+ const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
190
+ let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
191
+ if (!translation) {
192
+ // If the translation is not in the cache, load it
193
+ await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));
194
+ translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);
195
+ }
196
+ // If still not available, try the last active language or default language
197
+ if (!translation && this.lastActiveLang) {
198
+ translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
199
+ }
200
+ if (!translation) {
201
+ translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
202
+ }
203
+ // Perform parameter replacement
204
+ return this.getTranslation((translation || key), lang, scope, options?.params);
158
205
  }
159
- // Perform parameter replacement
160
- return this.getTranslation((translation || key), lang, scope, options?.params);
161
206
  }
162
207
  translateSync(key, options) {
163
208
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
@@ -178,6 +223,20 @@ export class AXTranslationService {
178
223
  // Perform parameter replacement
179
224
  return this.getTranslation((translation || key), lang, scope, options?.params);
180
225
  }
226
+ findAXTranslateOptions(inputString) {
227
+ const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
228
+ const result = [];
229
+ let match;
230
+ // Loop through all matches in the input string
231
+ while ((match = regex.exec(inputString)) !== null) {
232
+ result.push({
233
+ lang: match[1] || undefined,
234
+ scope: match[2] || undefined,
235
+ key: match[3] || undefined,
236
+ });
237
+ }
238
+ return result;
239
+ }
181
240
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
182
241
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXTranslationService, providedIn: 'root' }); }
183
242
  }
@@ -185,4 +244,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
185
244
  type: Injectable,
186
245
  args: [{ providedIn: 'root' }]
187
246
  }], ctorParameters: () => [] });
188
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS90cmFuc2xhdGlvbi9zcmMvbGliL3RyYW5zbGF0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FB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cbiAgfVxufVxuIl19
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24udHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHJhbnNsYXRpb24vc3JjL2xpYi90cmFuc2xhdGlvbi50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgQVhUcmFuc2xhdGVQYXJhbXM8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0ZUhhc2hNYXA8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0aW9uID0gUmVjb3JkPHN0cmluZywgc3RyaW5nPjtcbmV4cG9ydCB0eXBlIEFYVHJhbnNsYXRlTGFuZyA9IHN0cmluZztcblxuZXhwb3J0IHR5cGUgQVhUcmFuc2xhdGVTY29wZSA9IHN0cmluZztcblxuZXhwb3J0IGludGVyZmFjZSBBWFRyYW5zbGF0ZU9wdGlvbnMge1xuICBsYW5nPzogQVhUcmFuc2xhdGVMYW5nO1xuICBzY29wZT86IEFYVHJhbnNsYXRlU2NvcGU7XG4gIHBhcmFtcz86IEFYVHJhbnNsYXRlUGFyYW1zO1xufVxuIl19
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNsYXRpb24udHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdHJhbnNsYXRpb24vc3JjL2xpYi90cmFuc2xhdGlvbi50eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgQVhUcmFuc2xhdGVQYXJhbXM8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0ZUhhc2hNYXA8VCA9IHVua25vd24+ID0gUmVjb3JkPHN0cmluZywgVD47XG5leHBvcnQgdHlwZSBBWFRyYW5zbGF0aW9uID0gUmVjb3JkPHN0cmluZywgc3RyaW5nPjtcbmV4cG9ydCB0eXBlIEFYVHJhbnNsYXRlTGFuZyA9IHN0cmluZztcbmV4cG9ydCB0eXBlIEFYVHJhbnNsYXRlU2NvcGUgPSBzdHJpbmc7XG5cbmV4cG9ydCBpbnRlcmZhY2UgQVhUcmFuc2xhdGVPcHRpb25zIHtcbiAgbGFuZz86IEFYVHJhbnNsYXRlTGFuZztcbiAgc2NvcGU/OiBBWFRyYW5zbGF0ZVNjb3BlO1xuICBwYXJhbXM/OiBBWFRyYW5zbGF0ZVBhcmFtcztcbn1cbiJdfQ==
@@ -2,5 +2,7 @@ export * from './lib/auto-unsubscribe';
2
2
  export * from './lib/color-util';
3
3
  export * from './lib/drawing-util';
4
4
  export * from './lib/html-util';
5
+ export * from './lib/resize.directive';
5
6
  export * from './lib/string-util';
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdXRpbHMvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyxtQkFBbUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2F1dG8tdW5zdWJzY3JpYmUnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvY29sb3ItdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9kcmF3aW5nLXV0aWwnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvaHRtbC11dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3N0cmluZy11dGlsJztcbiJdfQ==
7
+ export * from './lib/utils.module';
8
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2NvcmUvdXRpbHMvc3JjL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxrQkFBa0IsQ0FBQztBQUNqQyxjQUFjLG9CQUFvQixDQUFDO0FBQ25DLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsb0JBQW9CLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYi9hdXRvLXVuc3Vic2NyaWJlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2NvbG9yLXV0aWwnO1xuZXhwb3J0ICogZnJvbSAnLi9saWIvZHJhd2luZy11dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL2h0bWwtdXRpbCc7XG5leHBvcnQgKiBmcm9tICcuL2xpYi9yZXNpemUuZGlyZWN0aXZlJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3N0cmluZy11dGlsJztcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWxzLm1vZHVsZSc7XG4iXX0=
@@ -0,0 +1,117 @@
1
+ import { Directive, ElementRef, HostListener, Input, NgZone, Renderer2 } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class AXResizableDirective {
4
+ constructor(el, renderer, zone) {
5
+ this.el = el;
6
+ this.renderer = renderer;
7
+ this.zone = zone;
8
+ this.minWidth = 100; // Minimum width for the resizable element
9
+ this.isResizing = false;
10
+ this.createResizeHandle(); // Initialize the resize handle
11
+ }
12
+ // Create the resize handle element and apply inline styles
13
+ createResizeHandle() {
14
+ // Apply position relative to the container to allow the absolute positioning of the handle
15
+ this.renderer.setStyle(this.el.nativeElement, 'position', 'relative');
16
+ // Create the resize handle dynamically
17
+ this.resizeHandle = this.renderer.createElement('div');
18
+ this.renderer.addClass(this.resizeHandle, 'resize-handle');
19
+ this.renderer.appendChild(this.el.nativeElement, this.resizeHandle);
20
+ // Apply inline styles for the resize handle
21
+ this.renderer.setStyle(this.resizeHandle, 'width', '6px'); // Resize handle width
22
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');
23
+ this.renderer.setStyle(this.resizeHandle, 'position', 'absolute');
24
+ this.renderer.setStyle(this.resizeHandle, 'top', '0');
25
+ this.renderer.setStyle(this.resizeHandle, 'right', '0');
26
+ this.renderer.setStyle(this.resizeHandle, 'bottom', '0');
27
+ this.renderer.setStyle(this.resizeHandle, 'cursor', 'ew-resize'); // Horizontal resize cursor
28
+ this.renderer.setStyle(this.resizeHandle, 'z-index', '10');
29
+ this.renderer.setStyle(this.resizeHandle, 'transition', 'background-color 0.2s ease');
30
+ this.renderer.setStyle(this.resizeHandle, 'border-radius', '4px');
31
+ }
32
+ // Mouse down event: Start resizing
33
+ onMouseDown(event) {
34
+ // Only allow resizing when clicking on the handle
35
+ const handleRect = this.resizeHandle.getBoundingClientRect();
36
+ if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {
37
+ this.zone.runOutsideAngular(() => {
38
+ this.isResizing = true;
39
+ document.body.style.cursor = 'ew-resize'; // Change cursor to resize mode
40
+ // Change resize handle color to blue when resizing starts
41
+ this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff');
42
+ event.preventDefault();
43
+ });
44
+ }
45
+ }
46
+ // Mouse move event: Resize the element
47
+ onMouseMove(event) {
48
+ this.zone.runOutsideAngular(() => {
49
+ if (this.isResizing) {
50
+ const rect = this.el.nativeElement.getBoundingClientRect();
51
+ let newWidth;
52
+ // Resize logic (LTR or RTL support)
53
+ if (document.documentElement.dir === 'rtl') {
54
+ newWidth = rect.right - event.clientX;
55
+ }
56
+ else {
57
+ newWidth = event.clientX - rect.left;
58
+ }
59
+ // Ensure the width does not go below the minimum width
60
+ if (newWidth > this.minWidth) {
61
+ this.renderer.setStyle(this.el.nativeElement, 'width', `${newWidth}px`);
62
+ }
63
+ }
64
+ });
65
+ }
66
+ // Mouse up event: End resizing
67
+ onMouseUp() {
68
+ this.zone.runOutsideAngular(() => {
69
+ if (this.isResizing) {
70
+ this.isResizing = false;
71
+ document.body.style.cursor = 'default'; // Reset the cursor
72
+ // Reset the resize handle color to default when resizing ends
73
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');
74
+ }
75
+ });
76
+ }
77
+ // Mouse enter event to change the background color (hover effect)
78
+ onMouseEnter() {
79
+ // Only change color to blue if not resizing
80
+ if (!this.isResizing) {
81
+ this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff'); // Blue color on hover
82
+ }
83
+ }
84
+ // Mouse leave event to reset the background color
85
+ onMouseLeave() {
86
+ // Only reset to default color if not resizing
87
+ if (!this.isResizing) {
88
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)'); // Default background color
89
+ }
90
+ }
91
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXResizableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
92
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: AXResizableDirective, selector: "[axResizable]", inputs: { minWidth: "minWidth" }, host: { listeners: { "mousedown": "onMouseDown($event)", "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp()", "mouseenter": "onMouseEnter($event)", "mouseleave": "onMouseLeave($event)" } }, ngImport: i0 }); }
93
+ }
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXResizableDirective, decorators: [{
95
+ type: Directive,
96
+ args: [{
97
+ selector: '[axResizable]', // Apply this directive on any element like <div axResizable></div>
98
+ }]
99
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }], propDecorators: { minWidth: [{
100
+ type: Input
101
+ }], onMouseDown: [{
102
+ type: HostListener,
103
+ args: ['mousedown', ['$event']]
104
+ }], onMouseMove: [{
105
+ type: HostListener,
106
+ args: ['document:mousemove', ['$event']]
107
+ }], onMouseUp: [{
108
+ type: HostListener,
109
+ args: ['document:mouseup']
110
+ }], onMouseEnter: [{
111
+ type: HostListener,
112
+ args: ['mouseenter', ['$event']]
113
+ }], onMouseLeave: [{
114
+ type: HostListener,
115
+ args: ['mouseleave', ['$event']]
116
+ }] } });
117
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzaXplLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS91dGlscy9zcmMvbGliL3Jlc2l6ZS5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxVQUFVLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsU0FBUyxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUs5RixNQUFNL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cmVzZXQgdGhlIGJhY2tncm91bmQgY29sb3JcbiAgQEhvc3RMaXN0ZW5lcignbW91c2VsZWF2ZScsIFsnJGV2ZW50J10pXG4gIG9uTW91c2VMZWF2ZSgpOiB2b2lkIHtcbiAgICAvLyBPbmx5IHJlc2V0IHRvIGRlZmF1bHQgY29sb3IgaWYgbm90IHJlc2l6aW5nXG4gICAgaWYgKCF0aGlzLmlzUmVzaXppbmcpIHtcbiAgICAgIHRoaXMucmVuZGVyZXIuc2V0U3R5bGUodGhpcy5yZXNpemVIYW5kbGUsICdiYWNrZ3JvdW5kLWNvbG9yJywgJ3JnYmEoMCwgMCwgMCwgMC4yKScpOyAvLyBEZWZhdWx0IGJhY2tncm91bmQgY29sb3JcbiAgICB9XG4gIH1cbn1cbiJdfQ==
@@ -0,0 +1,18 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { AXResizableDirective } from './resize.directive';
4
+ import * as i0 from "@angular/core";
5
+ export class UtilsModule {
6
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
7
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, declarations: [AXResizableDirective], imports: [CommonModule], exports: [AXResizableDirective] }); }
8
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, imports: [CommonModule] }); }
9
+ }
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ declarations: [AXResizableDirective],
14
+ imports: [CommonModule],
15
+ exports: [AXResizableDirective],
16
+ }]
17
+ }] });
18
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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ufSlcbmV4cG9ydCBjbGFzcyBVdGlsc01vZHVsZSB7fVxuIl19
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injector, Injectable, inject, Pipe, NgModule, Inject } from '@angular/core';
2
+ import { Injector, Injectable, inject, Pipe, Inject, NgModule } from '@angular/core';
3
3
  import { AXEventService } from '@acorex/core/events';
4
4
  import { Subject, filter, startWith, switchMap, of } from 'rxjs';
5
5
  import { defaults, padStart, isInteger, get } from 'lodash-es';
@@ -1,6 +1,6 @@
1
1
  import { isPlatformBrowser, DOCUMENT } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { PLATFORM_ID, Injectable, Inject, InjectionToken } from '@angular/core';
3
+ import { PLATFORM_ID, Inject, Injectable, InjectionToken } from '@angular/core';
4
4
  import { isBrowser } from '@acorex/core/platform';
5
5
  import CryptoJS from 'crypto-es';
6
6
 
@@ -52,6 +52,7 @@ class AXTranslationService {
52
52
  this.activeLang = new BehaviorSubject(this.getDefaultLang());
53
53
  this.langChanges$ = this.activeLang.asObservable();
54
54
  this.lastActiveLang = null;
55
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
55
56
  service = this;
56
57
  }
57
58
  loadLanguagesAndScopes(languages, scopes) {
@@ -107,6 +108,9 @@ class AXTranslationService {
107
108
  isLangAvailable(lang, scope = null) {
108
109
  return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);
109
110
  }
111
+ getLangAvailable() {
112
+ return this.config.availableLangs;
113
+ }
110
114
  load(key, options = {}) {
111
115
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;
112
116
  // Function to fetch translation
@@ -172,22 +176,63 @@ class AXTranslationService {
172
176
  }));
173
177
  }
174
178
  async translateAsync(key, options) {
175
- const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
176
- let translation = get(this.translationCache, `${lang}.${scope}.${key}`);
177
- if (!translation) {
178
- // If the translation is not in the cache, load it
179
- await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));
180
- translation = get(this.translationCache, `${lang}.${scope}.${key}`);
181
- }
182
- // If still not available, try the last active language or default language
183
- if (!translation && this.lastActiveLang) {
184
- translation = get(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
179
+ // debugger;
180
+ if (this.findAXTranslateOptions(key).length > 0) {
181
+ // Use findAXTranslateOptions to parse all <axt> tags in the input string
182
+ const regex = /(<axt(?:\s+lang="[^"]*")?(?:\s+scope="[^"]*")?>.*?<\/axt>)/g;
183
+ const splitParts = key.split(regex); // Split into <axt> parts and text parts
184
+ let translatedResult = '';
185
+ for (const part of splitParts) {
186
+ // Check if the part is an <axt> tag by using the findAXTranslateOptions function
187
+ const optionsFromKey = this.findAXTranslateOptions(part);
188
+ if (optionsFromKey.length > 0) {
189
+ // This is an <axt> part, translate it
190
+ for (const parsed of optionsFromKey) {
191
+ const parsedLang = parsed.lang ?? this.getActiveLang();
192
+ const parsedScope = parsed.scope ?? this.config.defaultScope;
193
+ const parsedKey = parsed.key;
194
+ let translation = get(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);
195
+ if (!translation) {
196
+ await firstValueFrom(this.load(parsedKey, { lang: parsedLang, scope: parsedScope }).pipe(take(1)));
197
+ translation = get(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);
198
+ }
199
+ if (!translation && this.lastActiveLang) {
200
+ translation = get(this.translationCache, `${this.lastActiveLang}.${parsedScope}.${parsedKey}`);
201
+ }
202
+ if (!translation) {
203
+ translation = get(this.translationCache, `${this.getDefaultLang()}.${parsedScope}.${parsedKey}`);
204
+ }
205
+ // Get the final translation, applying any params if needed
206
+ const newTranslation = this.getTranslation((translation || parsedKey), parsedLang, parsedScope, options?.params);
207
+ // Append the translated text
208
+ translatedResult += `${newTranslation}`;
209
+ }
210
+ }
211
+ else {
212
+ // This is plain text, so add it as-is
213
+ translatedResult += part;
214
+ }
215
+ }
216
+ return translatedResult;
185
217
  }
186
- if (!translation) {
187
- translation = get(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
218
+ else {
219
+ const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
220
+ let translation = get(this.translationCache, `${lang}.${scope}.${key}`);
221
+ if (!translation) {
222
+ // If the translation is not in the cache, load it
223
+ await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));
224
+ translation = get(this.translationCache, `${lang}.${scope}.${key}`);
225
+ }
226
+ // If still not available, try the last active language or default language
227
+ if (!translation && this.lastActiveLang) {
228
+ translation = get(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);
229
+ }
230
+ if (!translation) {
231
+ translation = get(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);
232
+ }
233
+ // Perform parameter replacement
234
+ return this.getTranslation((translation || key), lang, scope, options?.params);
188
235
  }
189
- // Perform parameter replacement
190
- return this.getTranslation((translation || key), lang, scope, options?.params);
191
236
  }
192
237
  translateSync(key, options) {
193
238
  const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};
@@ -208,6 +253,20 @@ class AXTranslationService {
208
253
  // Perform parameter replacement
209
254
  return this.getTranslation((translation || key), lang, scope, options?.params);
210
255
  }
256
+ findAXTranslateOptions(inputString) {
257
+ const regex = /<axt(?:\s+lang="([^"]*)")?(?:\s+scope="([^"]*)")?>(.*?)<\/axt>/g;
258
+ const result = [];
259
+ let match;
260
+ // Loop through all matches in the input string
261
+ while ((match = regex.exec(inputString)) !== null) {
262
+ result.push({
263
+ lang: match[1] || undefined,
264
+ scope: match[2] || undefined,
265
+ key: match[3] || undefined,
266
+ });
267
+ }
268
+ return result;
269
+ }
211
270
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXTranslationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
212
271
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXTranslationService, providedIn: 'root' }); }
213
272
  }
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport { AXTranslateHashMap, AXTranslateOptions, AXTranslateParams } from './translation.types';\n\nlet service: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n service = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.cacheTranslations(lang, scope, translations)),\n catchError((error) => {\n console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n private load(key: string, options: AXTranslateOptions = {}): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation = this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(translation, language, scope, options.params);\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n }),\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(key, this.lastActiveLang, scope, options.params);\n return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n let translation: string = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n translation = translation.replace(new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'), paramValue);\n }\n });\n }\n\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n }\n\n return translation;\n }\n\n public translate(key: string, options?: AXTranslateOptions): Observable<string> {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n }),\n );\n }\n\n public async translateAsync(key: string, options?: AXTranslateOptions): Promise<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n if (!translation) {\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n //\n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true })\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) return of('');\n\n const splitKey = this.splitString(key);\n return Array.isArray(splitKey)\n ? this.service.translate(splitKey[1], { ...options, scope: splitKey[0] })\n : this.service.translate(key, options);\n }\n\n private splitString(value: string): [string, string] | string {\n if (value.startsWith('#')) {\n const [first, ...rest] = value.slice(1).split('.');\n return [first, rest.join('.')];\n }\n return value;\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;;MAYa,qBAAqB,GAAG,IAAI,cAAc,CAAsB,uBAAuB,EAAE;AACpG,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,MAAK;AACZ,QAAA,OAAO,0BAA0B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AAAnB,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,mBAAmB,iBAVf,gBAAgB,EAAE,qBAAqB,CAD5C,EAAA,OAAA,EAAA,CAAA,gBAAgB,EAAE,qBAAqB,CAAA,EAAA,CAAA,CAAA;AAWtC,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,mBAAmB,EATnB,SAAA,EAAA;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,eAAe;AACxB,gBAAA,UAAU,EAAE,aAAa;AACzB,gBAAA,IAAI,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AACnD,gBAAA,KAAK,EAAE,IAAI;AACZ,aAAA;AACF,SAAA,EAAA,CAAA,CAAA;;2FAEU,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAb/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE,EAAE;AACX,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AAClD,oBAAA,YAAY,EAAE,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;AACvD,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,eAAe;AACxB,4BAAA,UAAU,EAAE,aAAa;AACzB,4BAAA,IAAI,EAAE,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AACnD,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;AACF,qBAAA;AACF,iBAAA;;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-translation.mjs","sources":["../../../../libs/core/translation/src/lib/translation.config.ts","../../../../libs/core/translation/src/lib/translation.loader.ts","../../../../libs/core/translation/src/lib/translation.service.ts","../../../../libs/core/translation/src/lib/translation-scope.resolver.ts","../../../../libs/core/translation/src/lib/translator.directive.ts","../../../../libs/core/translation/src/lib/translator.pipe.ts","../../../../libs/core/translation/src/lib/translation.module.ts","../../../../libs/core/translation/src/acorex-core-translation.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { AXTranslateLang, AXTranslateScope } from './translation.types';\n\nexport interface AXTranslationConfig {\n defaultLang: AXTranslateLang;\n defaultScope: AXTranslateScope;\n preloadLangs?: AXTranslateLang[];\n preloadScopes?: AXTranslateLang[];\n availableLangs?: AXTranslateLang[];\n scopeResolverKey: string;\n}\n\nexport const AX_TRANSLATION_CONFIG = new InjectionToken<AXTranslationConfig>('AX_TRANSLATION_CONFIG', {\n providedIn: 'root',\n factory: () => {\n return AXTranslationDefaultConfig;\n },\n});\n\nexport const AXTranslationDefaultConfig: AXTranslationConfig = {\n defaultLang: 'en',\n defaultScope: 'common',\n scopeResolverKey: 'scope',\n};\n\nexport type AXPartialTranslationConfig = Partial<AXTranslationConfig>;\n\nexport function translationConfig(config: AXPartialTranslationConfig = {}): AXTranslationConfig {\n const result = {\n ...AXTranslationDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslateLang, AXTranslateScope, AXTranslation } from './translation.types';\n\nexport interface AXTranslationLoaderOptions {\n lang: AXTranslateLang;\n scope?: AXTranslateScope;\n}\n\nexport interface AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation>;\n}\n\nexport class AXTranslationLoaderDefault implements AXTranslationLoader {\n getTranslation(options: AXTranslationLoaderOptions): Observable<AXTranslation> {\n return of({});\n }\n}\n\nexport const AX_TRANSLATION_LOADER = new InjectionToken<AXTranslationLoader>('AX_TRANSLATION_LOADER', {\n providedIn: 'root',\n factory: () => {\n return new AXTranslationLoaderDefault();\n },\n});\n","import { AXEventService, AXEventTypes } from '@acorex/core/events';\nimport { Injectable, inject } from '@angular/core';\nimport { get as lodashGet, set as lodashSet } from 'lodash-es';\nimport {\n BehaviorSubject,\n Observable,\n catchError,\n finalize,\n firstValueFrom,\n forkJoin,\n lastValueFrom,\n map,\n of,\n shareReplay,\n startWith,\n switchMap,\n take,\n tap,\n} from 'rxjs';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AX_TRANSLATION_LOADER } from './translation.loader';\nimport {\n AXTranslateHashMap,\n AXTranslateLang,\n AXTranslateOptions,\n AXTranslateParams,\n} from './translation.types';\n\nlet service: AXTranslationService;\n\nexport function translateSync(key: string, options?: AXTranslateOptions): string {\n return service.translateSync(key, options);\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXTranslationService {\n private loader = inject(AX_TRANSLATION_LOADER);\n private config = inject(AX_TRANSLATION_CONFIG);\n\n private eventService = inject(AXEventService);\n\n private translationCache: AXTranslateHashMap<AXTranslateHashMap<string>> = {};\n private ongoingRequests: Map<string, Observable<any>> = new Map();\n\n private activeLang: BehaviorSubject<string> = new BehaviorSubject<string>(this.getDefaultLang());\n langChanges$: Observable<string> = this.activeLang.asObservable();\n\n private lastActiveLang: string | null = null;\n\n /**\n * @ignore\n */\n constructor() {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n service = this;\n }\n\n public loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown> {\n const requests = languages.flatMap((lang) =>\n scopes.map((scope) => {\n // Check if translations are already cached\n if (this.translationCache[lang]?.[scope]) {\n return of(this.translationCache[lang][scope]);\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(lang, scope);\n }),\n );\n\n return forkJoin(requests);\n }\n\n private getOrLoadTranslations(lang: string, scope: string): Observable<AXTranslateHashMap<string>> {\n const requestKey = `${lang}_${scope}`;\n\n // Return existing observable if the request is already in progress\n if (this.ongoingRequests.has(requestKey)) {\n return this.ongoingRequests.get(requestKey);\n }\n\n // Load translations if not in cache or ongoing requests\n const translationObservable = this.loader.getTranslation({ lang, scope }).pipe(\n tap((translations) => this.cacheTranslations(lang, scope, translations)),\n catchError((error) => {\n console.error(`Error loading translations for lang: ${lang}, scope: ${scope}`, error);\n return of(null);\n }),\n finalize(() => {\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageLoaded,\n payload: lang,\n });\n this.ongoingRequests.delete(requestKey);\n }),\n shareReplay(1),\n );\n\n this.ongoingRequests.set(requestKey, translationObservable);\n return translationObservable;\n }\n\n private cacheTranslations(lang: string, scope: string, translations: AXTranslateHashMap<string>): void {\n lodashSet(this.translationCache, `${lang}.${scope}`, translations);\n }\n\n public getDefaultLang(): string {\n return this.config.defaultLang;\n }\n\n public getActiveLang(): string {\n return this.activeLang.getValue();\n }\n\n public setActiveLang(lang: string): void {\n if (lang != this.getActiveLang()) {\n this.lastActiveLang = this.getActiveLang(); // Update last active language\n this.activeLang.next(lang);\n this.eventService.emitEvent({\n type: AXEventTypes.AXLanguageChanged,\n payload: lang,\n });\n }\n }\n\n public isLangAvailable(lang: string, scope: string = null): boolean {\n return !this.translationCache[lang] && (!scope || !this.translationCache[lang][scope]);\n }\n\n public getLangAvailable(): AXTranslateLang[] | undefined {\n return this.config.availableLangs;\n }\n\n private load(key: string, options: AXTranslateOptions = {}): Observable<string> {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options;\n\n // Function to fetch translation\n const fetchTranslation = (language: string): Observable<string> => {\n // Check if translations are available in the cache\n if (this.translationCache[language]?.[scope]) {\n return of(this.getTranslation(key, language, scope, options.params));\n }\n\n // Use the new method to handle ongoing requests and loading\n return this.getOrLoadTranslations(language, scope).pipe(\n map(() => {\n const translation = this.translationCache[language]?.[scope]?.[key] || key;\n return this.getTranslation(translation, language, scope, options.params);\n }),\n switchMap((translatedText) => {\n if (translatedText === key && language !== this.getDefaultLang()) {\n // If the translation is not found and the language is not default,\n // try fetching from the default language\n return fetchTranslation(this.getDefaultLang());\n }\n return of(translatedText);\n }),\n );\n };\n\n // First, try to fetch the translation for the requested language\n const translationForRequestedLang = fetchTranslation(lang);\n\n // If lastActiveLang is available and different from the requested language, use it as a fallback\n if (this.lastActiveLang && this.lastActiveLang !== lang) {\n const translationForLastActiveLang = this.getTranslation(\n key,\n this.lastActiveLang,\n scope,\n options.params,\n );\n return translationForRequestedLang.pipe(startWith(translationForLastActiveLang));\n }\n\n return translationForRequestedLang;\n }\n\n private getTranslation(key: string, lang: string, scope: string, params?: AXTranslateParams): string {\n let translation: string = (lodashGet(this.translationCache, `${lang}.${scope}.${key}`) || key) as string;\n\n // Replace params like {{ name }}\n if (params) {\n Object.keys(params).forEach((paramKey) => {\n const paramValue = params[paramKey] as string;\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n translation = translation.replace(new RegExp(`{{\\\\s*${paramKey}\\\\s*}}`, 'g'), paramValue);\n }\n });\n }\n\n if (typeof translation !== 'string') {\n console.error(`${key} is not string`, { key, lang, scope, params, translation });\n } else {\n // Replace translations like {{ t('key') }}\n const translationPattern = /{{\\s*t\\('([^']+)'\\)\\s*}}/g;\n translation = translation.replace(translationPattern, (match, innerKey) => {\n return this.getTranslation(innerKey, lang, scope, params);\n });\n }\n\n return translation;\n }\n\n public translate(key: string, options?: AXTranslateOptions): Observable<string> {\n if (options?.lang) {\n return this.load(key, options);\n }\n return this.langChanges$.pipe(\n startWith(this.getActiveLang()),\n switchMap((lang) => {\n return this.load(key, { ...options, lang: lang });\n }),\n );\n }\n\n public async translateAsync(key: string, options?: AXTranslateOptions): Promise<string> {\n // debugger;\n if (this.findAXTranslateOptions(key).length > 0) {\n // Use findAXTranslateOptions to parse all <axt> tags in the input string\n const regex = /(<axt(?:\\s+lang=\"[^\"]*\")?(?:\\s+scope=\"[^\"]*\")?>.*?<\\/axt>)/g;\n const splitParts = key.split(regex); // Split into <axt> parts and text parts\n\n let translatedResult = '';\n\n for (const part of splitParts) {\n // Check if the part is an <axt> tag by using the findAXTranslateOptions function\n const optionsFromKey = this.findAXTranslateOptions(part);\n\n if (optionsFromKey.length > 0) {\n // This is an <axt> part, translate it\n for (const parsed of optionsFromKey) {\n const parsedLang = parsed.lang ?? this.getActiveLang();\n const parsedScope = parsed.scope ?? this.config.defaultScope;\n const parsedKey = parsed.key;\n\n let translation = lodashGet(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);\n\n if (!translation) {\n await firstValueFrom(\n this.load(parsedKey, { lang: parsedLang, scope: parsedScope }).pipe(take(1)),\n );\n translation = lodashGet(this.translationCache, `${parsedLang}.${parsedScope}.${parsedKey}`);\n }\n\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(\n this.translationCache,\n `${this.lastActiveLang}.${parsedScope}.${parsedKey}`,\n );\n }\n\n if (!translation) {\n translation = lodashGet(\n this.translationCache,\n `${this.getDefaultLang()}.${parsedScope}.${parsedKey}`,\n );\n }\n\n // Get the final translation, applying any params if needed\n const newTranslation = this.getTranslation(\n (translation || parsedKey) as any,\n parsedLang,\n parsedScope,\n options?.params,\n );\n\n // Append the translated text\n translatedResult += `${newTranslation}`;\n }\n } else {\n // This is plain text, so add it as-is\n translatedResult += part;\n }\n }\n\n return translatedResult;\n } else {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n if (!translation) {\n // If the translation is not in the cache, load it\n await firstValueFrom(this.load(key, { lang, scope }).pipe(take(1)));\n translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n }\n\n // If still not available, try the last active language or default language\n if (!translation && this.lastActiveLang) {\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n if (!translation) {\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n }\n\n public translateSync(key: string, options?: AXTranslateOptions): string {\n const { lang = this.getActiveLang(), scope = this.config.defaultScope } = options || {};\n\n // Check if the translation for the active language is available\n let translation = lodashGet(this.translationCache, `${lang}.${scope}.${key}`);\n\n //\n const loadLang = () => lastValueFrom(this.getOrLoadTranslations(lang, scope));\n // If not available, check lastActiveLang\n if (!translation && this.lastActiveLang) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.lastActiveLang}.${scope}.${key}`);\n }\n\n // If still not available, use the default language\n if (!translation) {\n loadLang();\n translation = lodashGet(this.translationCache, `${this.getDefaultLang()}.${scope}.${key}`);\n }\n\n // Perform parameter replacement\n return this.getTranslation((translation || key) as any, lang, scope, options?.params);\n }\n\n findAXTranslateOptions(inputString: string): (Omit<AXTranslateOptions, 'params'> & { key: string })[] {\n const regex = /<axt(?:\\s+lang=\"([^\"]*)\")?(?:\\s+scope=\"([^\"]*)\")?>(.*?)<\\/axt>/g;\n const result: (Omit<AXTranslateOptions, 'params'> & { key: string })[] = [];\n let match;\n\n // Loop through all matches in the input string\n while ((match = regex.exec(inputString)) !== null) {\n result.push({\n lang: match[1] || undefined,\n scope: match[2] || undefined,\n key: match[3] || undefined,\n });\n }\n\n return result;\n }\n}\n","import { inject } from '@angular/core';\nimport { ResolveFn } from '@angular/router';\nimport { AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\n\nexport const loadTranslationScope: ResolveFn<unknown> = (route, state) => {\n const translatorService = inject(AXTranslationService);\n const config = inject(AX_TRANSLATION_CONFIG);\n const scopeValue = route.data[config.scopeResolverKey];\n const scopes = Array.isArray(scopeValue) ? scopeValue : [scopeValue];\n return translatorService.loadLanguagesAndScopes([translatorService.getActiveLang()], scopes);\n};\n","import { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Directive({\n selector: '[translate]',\n})\nexport class AXTranslatorDirective implements OnInit {\n constructor(\n private templateRef: TemplateRef<any>,\n private viewContainer: ViewContainerRef,\n private translationService: AXTranslationService,\n ) {}\n\n ngOnInit() {\n this.viewContainer.clear();\n this.viewContainer.createEmbeddedView(this.templateRef, {\n $implicit: (key: string, options?: AXTranslateOptions) => {\n return this.translationService.translate(key, options);\n },\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { Observable, of } from 'rxjs';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslateOptions } from './translation.types';\n\n@Pipe({ name: 'translate', pure: true })\nexport class AXTranslatorPipe implements PipeTransform {\n constructor(private service: AXTranslationService) {}\n\n transform(key: string, options?: AXTranslateOptions): Observable<string> {\n if (!key) return of('');\n\n const splitKey = this.splitString(key);\n return Array.isArray(splitKey)\n ? this.service.translate(splitKey[1], { ...options, scope: splitKey[0] })\n : this.service.translate(key, options);\n }\n\n private splitString(value: string): [string, string] | string {\n if (value.startsWith('#')) {\n const [first, ...rest] = value.slice(1).split('.');\n return [first, rest.join('.')];\n }\n return value;\n }\n}\n","import { APP_INITIALIZER, NgModule } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AXTranslationConfig, AX_TRANSLATION_CONFIG } from './translation.config';\nimport { AXTranslationService } from './translation.service';\nimport { AXTranslatorDirective } from './translator.directive';\nimport { AXTranslatorPipe } from './translator.pipe';\n\nfunction initializeApp(translatorService: AXTranslationService, config: AXTranslationConfig) {\n return (): Observable<any> => {\n return translatorService.loadLanguagesAndScopes(\n config.preloadLangs ?? [config.defaultLang],\n config.preloadScopes ?? [config.defaultScope],\n );\n };\n}\n\n@NgModule({\n imports: [],\n exports: [AXTranslatorPipe, AXTranslatorDirective],\n declarations: [AXTranslatorPipe, AXTranslatorDirective],\n providers: [\n {\n provide: APP_INITIALIZER,\n useFactory: initializeApp,\n deps: [AXTranslationService, AX_TRANSLATION_CONFIG],\n multi: true,\n },\n ],\n})\nexport class AXTranslationModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["lodashSet","lodashGet","i1.AXTranslationService"],"mappings":";;;;;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ular/core';
2
+ import { Injectable, HostListener, Input, Directive, NgModule } from '@angular/core';
3
3
  import { Subject, takeUntil } from 'rxjs';
4
4
  import tinycolor from 'tinycolor2';
5
5
  import tinygradient from 'tinygradient-es';
6
6
  import { isBrowser } from '@acorex/core/platform';
7
+ import { CommonModule } from '@angular/common';
7
8
 
8
9
  function AXAutoUnsubscriber() {
9
10
  return function (constructor) {
@@ -254,6 +255,121 @@ class AXHtmlUtil {
254
255
  }
255
256
  }
256
257
 
258
+ class AXResizableDirective {
259
+ constructor(el, renderer, zone) {
260
+ this.el = el;
261
+ this.renderer = renderer;
262
+ this.zone = zone;
263
+ this.minWidth = 100; // Minimum width for the resizable element
264
+ this.isResizing = false;
265
+ this.createResizeHandle(); // Initialize the resize handle
266
+ }
267
+ // Create the resize handle element and apply inline styles
268
+ createResizeHandle() {
269
+ // Apply position relative to the container to allow the absolute positioning of the handle
270
+ this.renderer.setStyle(this.el.nativeElement, 'position', 'relative');
271
+ // Create the resize handle dynamically
272
+ this.resizeHandle = this.renderer.createElement('div');
273
+ this.renderer.addClass(this.resizeHandle, 'resize-handle');
274
+ this.renderer.appendChild(this.el.nativeElement, this.resizeHandle);
275
+ // Apply inline styles for the resize handle
276
+ this.renderer.setStyle(this.resizeHandle, 'width', '6px'); // Resize handle width
277
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');
278
+ this.renderer.setStyle(this.resizeHandle, 'position', 'absolute');
279
+ this.renderer.setStyle(this.resizeHandle, 'top', '0');
280
+ this.renderer.setStyle(this.resizeHandle, 'right', '0');
281
+ this.renderer.setStyle(this.resizeHandle, 'bottom', '0');
282
+ this.renderer.setStyle(this.resizeHandle, 'cursor', 'ew-resize'); // Horizontal resize cursor
283
+ this.renderer.setStyle(this.resizeHandle, 'z-index', '10');
284
+ this.renderer.setStyle(this.resizeHandle, 'transition', 'background-color 0.2s ease');
285
+ this.renderer.setStyle(this.resizeHandle, 'border-radius', '4px');
286
+ }
287
+ // Mouse down event: Start resizing
288
+ onMouseDown(event) {
289
+ // Only allow resizing when clicking on the handle
290
+ const handleRect = this.resizeHandle.getBoundingClientRect();
291
+ if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {
292
+ this.zone.runOutsideAngular(() => {
293
+ this.isResizing = true;
294
+ document.body.style.cursor = 'ew-resize'; // Change cursor to resize mode
295
+ // Change resize handle color to blue when resizing starts
296
+ this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff');
297
+ event.preventDefault();
298
+ });
299
+ }
300
+ }
301
+ // Mouse move event: Resize the element
302
+ onMouseMove(event) {
303
+ this.zone.runOutsideAngular(() => {
304
+ if (this.isResizing) {
305
+ const rect = this.el.nativeElement.getBoundingClientRect();
306
+ let newWidth;
307
+ // Resize logic (LTR or RTL support)
308
+ if (document.documentElement.dir === 'rtl') {
309
+ newWidth = rect.right - event.clientX;
310
+ }
311
+ else {
312
+ newWidth = event.clientX - rect.left;
313
+ }
314
+ // Ensure the width does not go below the minimum width
315
+ if (newWidth > this.minWidth) {
316
+ this.renderer.setStyle(this.el.nativeElement, 'width', `${newWidth}px`);
317
+ }
318
+ }
319
+ });
320
+ }
321
+ // Mouse up event: End resizing
322
+ onMouseUp() {
323
+ this.zone.runOutsideAngular(() => {
324
+ if (this.isResizing) {
325
+ this.isResizing = false;
326
+ document.body.style.cursor = 'default'; // Reset the cursor
327
+ // Reset the resize handle color to default when resizing ends
328
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');
329
+ }
330
+ });
331
+ }
332
+ // Mouse enter event to change the background color (hover effect)
333
+ onMouseEnter() {
334
+ // Only change color to blue if not resizing
335
+ if (!this.isResizing) {
336
+ this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff'); // Blue color on hover
337
+ }
338
+ }
339
+ // Mouse leave event to reset the background color
340
+ onMouseLeave() {
341
+ // Only reset to default color if not resizing
342
+ if (!this.isResizing) {
343
+ this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)'); // Default background color
344
+ }
345
+ }
346
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXResizableDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
347
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: AXResizableDirective, selector: "[axResizable]", inputs: { minWidth: "minWidth" }, host: { listeners: { "mousedown": "onMouseDown($event)", "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp()", "mouseenter": "onMouseEnter($event)", "mouseleave": "onMouseLeave($event)" } }, ngImport: i0 }); }
348
+ }
349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXResizableDirective, decorators: [{
350
+ type: Directive,
351
+ args: [{
352
+ selector: '[axResizable]', // Apply this directive on any element like <div axResizable></div>
353
+ }]
354
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.NgZone }], propDecorators: { minWidth: [{
355
+ type: Input
356
+ }], onMouseDown: [{
357
+ type: HostListener,
358
+ args: ['mousedown', ['$event']]
359
+ }], onMouseMove: [{
360
+ type: HostListener,
361
+ args: ['document:mousemove', ['$event']]
362
+ }], onMouseUp: [{
363
+ type: HostListener,
364
+ args: ['document:mouseup']
365
+ }], onMouseEnter: [{
366
+ type: HostListener,
367
+ args: ['mouseenter', ['$event']]
368
+ }], onMouseLeave: [{
369
+ type: HostListener,
370
+ args: ['mouseleave', ['$event']]
371
+ }] } });
372
+
257
373
  // @dynamic
258
374
  class AXStringUtil {
259
375
  static getWordBoundsAtPosition(str, position) {
@@ -273,9 +389,23 @@ class AXStringUtil {
273
389
  }
274
390
  }
275
391
 
392
+ class UtilsModule {
393
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
394
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, declarations: [AXResizableDirective], imports: [CommonModule], exports: [AXResizableDirective] }); }
395
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, imports: [CommonModule] }); }
396
+ }
397
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: UtilsModule, decorators: [{
398
+ type: NgModule,
399
+ args: [{
400
+ declarations: [AXResizableDirective],
401
+ imports: [CommonModule],
402
+ exports: [AXResizableDirective],
403
+ }]
404
+ }] });
405
+
276
406
  /**
277
407
  * Generated bundle index. Do not edit.
278
408
  */
279
409
 
280
- export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXStringUtil, AXUnsubscriber };
410
+ export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXResizableDirective, AXStringUtil, AXUnsubscriber, UtilsModule };
281
411
  //# sourceMappingURL=acorex-core-utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-core-utils.mjs","sources":["../../../../libs/core/utils/src/lib/auto-unsubscribe.ts","../../../../libs/core/utils/src/lib/color-util.ts","../../../../libs/core/utils/src/lib/drawing-util.ts","../../../../libs/core/utils/src/lib/html-util.ts","../../../../libs/core/utils/src/lib/string-util.ts","../../../../libs/core/utils/src/acorex-core-utils.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject, takeUntil } from 'rxjs';\n\nexport function AXAutoUnsubscriber() {\n return function (constructor) {\n const orig = constructor.prototype.ngOnDestroy;\n constructor.prototype.ngOnDestroy = function () {\n for (const prop in this) {\n const property = this[prop];\n if (typeof property.subscribe === 'function') {\n property.unsubscribe();\n }\n }\n orig.apply();\n };\n };\n}\n\n@Injectable()\nexport class AXUnsubscriber implements OnDestroy {\n private readonly _destroy$ = new Subject<void>();\n\n public readonly takeUntilDestroy = <T>(origin: Observable<T> | Subject<T>): Observable<T> | Subject<T> =>\n origin.pipe(takeUntil(this._destroy$));\n\n public unsubscribe(): void {\n this._destroy$.next();\n this._destroy$.complete();\n }\n\n public ngOnDestroy(): void {\n this.unsubscribe();\n }\n}\n","export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva' | null;\n\nimport tinycolor, { ColorInput } from 'tinycolor2';\nimport tinygradient, { Instance } from 'tinygradient-es';\n\nexport type AXColorFormat = ColorInput;\n\nexport class AXColorUtil {\n static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgb();\n case 'hsla':\n return _color.toHsl();\n case 'hsva':\n return _color.toHsv();\n default:\n return _color.toHex();\n }\n }\n\n static toString(color: AXColorFormat, mode: AXColorMode = null): string {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgbString();\n case 'hsla':\n return _color.toHslString();\n case 'hsva':\n return _color.toHsvString();\n\n case 'hex': {\n const rgba = _color.toRgb();\n return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();\n }\n default: {\n if (typeof color == 'string') {\n if (color.toLowerCase().startsWith('#')) return this.toString(color, 'hex');\n else return this.toString(color, 'rgba');\n } else {\n return this.toString(color, 'rgba');\n }\n }\n }\n }\n\n static isValid(color: AXColorFormat): boolean {\n const _color = tinycolor(color);\n return _color.isValid();\n }\n\n static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string {\n return tinycolor.mix(baseColor, hex, percentage).toString('rgb');\n }\n\n static multiply(color1: AXColorFormat, color2: AXColorFormat): string {\n const rgb1 = tinycolor(color1).toRgb();\n const rgb2 = tinycolor(color2).toRgb();\n rgb1.b = Math.floor((rgb1.b * rgb2.b) / 255);\n rgb1.g = Math.floor((rgb1.g * rgb2.g) / 255);\n rgb1.r = Math.floor((rgb1.r * rgb2.r) / 255);\n return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');\n }\n\n static contrastToWhite(color: AXColorFormat): number {\n return tinycolor.readability('#fff', color);\n }\n\n static lighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).lighten(percentage);\n }\n\n static darken(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).darken(percentage);\n }\n\n static brighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).brighten(percentage);\n }\n\n static saturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).saturate(percentage);\n }\n\n static desaturate(hex: AXColorFormat) {\n return tinycolor(hex).getLuminance();\n }\n\n static equal(color1: AXColorFormat, color2: AXColorFormat): boolean {\n return tinycolor.equals(color1, color2);\n }\n\n static gradient(values: unknown[] | { color: unknown; pos: number }[]): Instance {\n return tinygradient([...values]);\n }\n\n static getLuminance(hex: AXColorFormat) {\n return tinycolor(hex).getLuminance();\n }\n\n static xyToRgb(vX, vY): string {\n vY = vY || 0.00000000001;\n const Y = 1;\n const X = (Y / vY) * vX;\n const Z = (Y / vY) * (1 - vX - vY);\n\n // Convert to RGB using Wide RGB D65 conversion.\n let rgb = [\n X * 1.656492 - Y * 0.354851 - Z * 0.255038,\n -X * 0.707196 + Y * 1.655397 + Z * 0.036152,\n X * 0.051713 - Y * 0.121364 + Z * 1.01153,\n ];\n\n // Apply reverse gamma correction.\n rgb = rgb.map((x) => (x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055));\n\n // Bring all negative components to zero.\n rgb = rgb.map((x) => Math.max(0, x));\n\n // If one component is greater than 1, weight components by that value.\n const max = Math.max(...rgb);\n if (max > 1) {\n rgb = rgb.map((x) => x / max);\n }\n\n rgb = rgb.map((x) => Math.round(x * 255));\n\n return 'rgb(' + rgb.join(',') + ')';\n }\n\n static colorStringToHex(color) {\n // Check if the input is an RGBA color string\n const rgbaMatch = color.match(/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*([\\d.]+))?\\s*\\)$/i);\n if (rgbaMatch) {\n let [_, r, g, b, a] = rgbaMatch;\n r = parseInt(r, 10);\n g = parseInt(g, 10);\n b = parseInt(b, 10);\n a = a ? parseFloat(a) : 1;\n\n // Convert RGB to hex\n let hexColor = `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n\n // Include alpha if present\n if (a < 1) {\n const alphaHex = Math.round(a * 255)\n .toString(16)\n .padStart(2, '0');\n hexColor += alphaHex;\n }\n\n return hexColor;\n }\n\n // Check if the input is a hex color string\n const hexMatch = color.match(/^#([0-9a-fA-F]{3}){1,2}$/);\n if (hexMatch) {\n return color;\n }\n\n throw new Error('Invalid color format');\n }\n}\n","export interface AXPoint {\n x: number;\n y: number;\n}\n\nexport interface AXBoundingClientRect {\n left?: number;\n top?: number;\n width?: number;\n height?: number;\n bottom?: number;\n right?: number;\n}\n// @dynamic\nexport class AXDrawingUtil {\n static collision(a: HTMLElement, b: HTMLElement): boolean {\n const ac = a.getBoundingClientRect();\n const bc = b.getBoundingClientRect();\n\n 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) {\n return true;\n } else {\n return false;\n }\n }\n\n static isInElementBound(pos: AXPoint, element: HTMLElement): boolean {\n const elBound = element.getBoundingClientRect();\n return AXDrawingUtil.isInRecPoint(pos, {\n left: elBound.x,\n width: elBound.width,\n top: elBound.y,\n height: elBound.height,\n });\n }\n\n static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean {\n return pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height;\n }\n\n static convertRemToPixels(rem: number): number {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n }\n}\n","import { isBrowser } from '@acorex/core/platform';\n\n// @dynamic\nexport class AXHtmlUtil {\n\n static focusElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map((c) => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.focus();\n return focusable;\n }\n return null;\n }\n\n static blurElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map((c) => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.blur();\n return focusable;\n }\n return null;\n }\n\n static hasFocus(element: HTMLElement) {\n return element.matches(':focus-within') || element.matches(':focus');\n }\n\n static isRtl(element: HTMLElement) {\n if (isBrowser()) {\n const rtl = element.classList.contains('ax-rtl') || window.getComputedStyle(element, null).getPropertyValue('direction') === 'rtl';\n return rtl;\n }\n\n return false;\n }\n\n /**\n * Helper function to check if an element is scrollable\n */\n static isScrollable(element: HTMLElement): boolean {\n const overflowY = window.getComputedStyle(element).overflowY;\n return (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;\n }\n\n /**\n * Utility function to find scrollable parent elements\n */\n static getScrollableParents(element: HTMLElement): HTMLElement[] {\n const parents: HTMLElement[] = [];\n let currentElement: HTMLElement | null = element;\n\n while (currentElement) {\n if (AXHtmlUtil.isScrollable(currentElement)) {\n parents.push(currentElement);\n }\n currentElement = currentElement.parentElement;\n }\n\n return parents;\n }\n}\n","// @dynamic\nexport class AXStringUtil {\n static getWordBoundsAtPosition(str: string, position: number): { start: number; end: number } {\n const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);\n let start = position - 1;\n\n while (start >= 0 && !isSpace(str[start])) {\n start -= 1;\n }\n start = Math.max(0, start + 1);\n const leftSideString: any = str.slice(start).match(/[a-zA-Z0-9]+/i);\n start += leftSideString.index;\n let end = start + leftSideString[0].length;\n return {\n start,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O;QAEhD,OAAO,cAAc,EAAE;AACrB,YAAA,IAAI,UAAU,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE;AAC3C,gBAAA,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC;;AAE9B,YAAA,cAAc,GAAG,cAAc,CAAC,aAAa;;AAG/C,QAAA,OAAO,OAAO;;AAEjB;;AC9DD;MACa,YAAY,CAAA;AACvB,IAAA,OAAO,uBAAuB,CAAC,GAAW,EAAE,QAAgB,EAAA;AAC1D,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC;AAC/C,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,CAAC;AAExB,QAAA,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YACzC,KAAK,IAAI,CAAC;;QAEZ,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC;AAC9B,QAAA,MAAM,cAAc,GAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;AACnE,QAAA,KAAK,IAAI,cAAc,CAAC,KAAK;QAC7B,IAAI,GAAG,GAAG,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM;QAC1C,OAAO;YACL,KAAK;YACL,GAAG;SACJ;;AAEJ;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-core-utils.mjs","sources":["../../../../libs/core/utils/src/lib/auto-unsubscribe.ts","../../../../libs/core/utils/src/lib/color-util.ts","../../../../libs/core/utils/src/lib/drawing-util.ts","../../../../libs/core/utils/src/lib/html-util.ts","../../../../libs/core/utils/src/lib/resize.directive.ts","../../../../libs/core/utils/src/lib/string-util.ts","../../../../libs/core/utils/src/lib/utils.module.ts","../../../../libs/core/utils/src/acorex-core-utils.ts"],"sourcesContent":["import { Injectable, OnDestroy } from '@angular/core';\nimport { Observable, Subject, takeUntil } from 'rxjs';\n\nexport function AXAutoUnsubscriber() {\n return function (constructor) {\n const orig = constructor.prototype.ngOnDestroy;\n constructor.prototype.ngOnDestroy = function () {\n for (const prop in this) {\n const property = this[prop];\n if (typeof property.subscribe === 'function') {\n property.unsubscribe();\n }\n }\n orig.apply();\n };\n };\n}\n\n@Injectable()\nexport class AXUnsubscriber implements OnDestroy {\n private readonly _destroy$ = new Subject<void>();\n\n public readonly takeUntilDestroy = <T>(origin: Observable<T> | Subject<T>): Observable<T> | Subject<T> =>\n origin.pipe(takeUntil(this._destroy$));\n\n public unsubscribe(): void {\n this._destroy$.next();\n this._destroy$.complete();\n }\n\n public ngOnDestroy(): void {\n this.unsubscribe();\n }\n}\n","export type AXColorMode = 'rgba' | 'hex' | 'hsla' | 'hsva' | null;\n\nimport tinycolor, { ColorInput } from 'tinycolor2';\nimport tinygradient, { Instance } from 'tinygradient-es';\n\nexport type AXColorFormat = ColorInput;\n\nexport class AXColorUtil {\n static to(color: AXColorFormat, mode: AXColorMode): AXColorFormat {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgb();\n case 'hsla':\n return _color.toHsl();\n case 'hsva':\n return _color.toHsv();\n default:\n return _color.toHex();\n }\n }\n\n static toString(color: AXColorFormat, mode: AXColorMode = null): string {\n const _color = tinycolor(color);\n switch (mode) {\n case 'rgba':\n return _color.toRgbString();\n case 'hsla':\n return _color.toHslString();\n case 'hsva':\n return _color.toHsvString();\n\n case 'hex': {\n const rgba = _color.toRgb();\n return rgba.a != 1 ? _color.toHex8String() : _color.toHexString();\n }\n default: {\n if (typeof color == 'string') {\n if (color.toLowerCase().startsWith('#')) return this.toString(color, 'hex');\n else return this.toString(color, 'rgba');\n } else {\n return this.toString(color, 'rgba');\n }\n }\n }\n }\n\n static isValid(color: AXColorFormat): boolean {\n const _color = tinycolor(color);\n return _color.isValid();\n }\n\n static mix(baseColor: AXColorFormat, hex: AXColorFormat, percentage: number): string {\n return tinycolor.mix(baseColor, hex, percentage).toString('rgb');\n }\n\n static multiply(color1: AXColorFormat, color2: AXColorFormat): string {\n const rgb1 = tinycolor(color1).toRgb();\n const rgb2 = tinycolor(color2).toRgb();\n rgb1.b = Math.floor((rgb1.b * rgb2.b) / 255);\n rgb1.g = Math.floor((rgb1.g * rgb2.g) / 255);\n rgb1.r = Math.floor((rgb1.r * rgb2.r) / 255);\n return tinycolor('rgb ' + rgb1.r + ' ' + rgb1.g + ' ' + rgb1.b).toString('rgb');\n }\n\n static contrastToWhite(color: AXColorFormat): number {\n return tinycolor.readability('#fff', color);\n }\n\n static lighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).lighten(percentage);\n }\n\n static darken(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).darken(percentage);\n }\n\n static brighten(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).brighten(percentage);\n }\n\n static saturate(hex: AXColorFormat, percentage?: number) {\n return tinycolor(hex).saturate(percentage);\n }\n\n static desaturate(hex: AXColorFormat) {\n return tinycolor(hex).getLuminance();\n }\n\n static equal(color1: AXColorFormat, color2: AXColorFormat): boolean {\n return tinycolor.equals(color1, color2);\n }\n\n static gradient(values: unknown[] | { color: unknown; pos: number }[]): Instance {\n return tinygradient([...values]);\n }\n\n static getLuminance(hex: AXColorFormat) {\n return tinycolor(hex).getLuminance();\n }\n\n static xyToRgb(vX, vY): string {\n vY = vY || 0.00000000001;\n const Y = 1;\n const X = (Y / vY) * vX;\n const Z = (Y / vY) * (1 - vX - vY);\n\n // Convert to RGB using Wide RGB D65 conversion.\n let rgb = [\n X * 1.656492 - Y * 0.354851 - Z * 0.255038,\n -X * 0.707196 + Y * 1.655397 + Z * 0.036152,\n X * 0.051713 - Y * 0.121364 + Z * 1.01153,\n ];\n\n // Apply reverse gamma correction.\n rgb = rgb.map((x) => (x <= 0.0031308 ? 12.92 * x : (1.0 + 0.055) * Math.pow(x, 1.0 / 2.4) - 0.055));\n\n // Bring all negative components to zero.\n rgb = rgb.map((x) => Math.max(0, x));\n\n // If one component is greater than 1, weight components by that value.\n const max = Math.max(...rgb);\n if (max > 1) {\n rgb = rgb.map((x) => x / max);\n }\n\n rgb = rgb.map((x) => Math.round(x * 255));\n\n return 'rgb(' + rgb.join(',') + ')';\n }\n\n static colorStringToHex(color) {\n // Check if the input is an RGBA color string\n const rgbaMatch = color.match(/^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*([\\d.]+))?\\s*\\)$/i);\n if (rgbaMatch) {\n let [_, r, g, b, a] = rgbaMatch;\n r = parseInt(r, 10);\n g = parseInt(g, 10);\n b = parseInt(b, 10);\n a = a ? parseFloat(a) : 1;\n\n // Convert RGB to hex\n let hexColor = `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;\n\n // Include alpha if present\n if (a < 1) {\n const alphaHex = Math.round(a * 255)\n .toString(16)\n .padStart(2, '0');\n hexColor += alphaHex;\n }\n\n return hexColor;\n }\n\n // Check if the input is a hex color string\n const hexMatch = color.match(/^#([0-9a-fA-F]{3}){1,2}$/);\n if (hexMatch) {\n return color;\n }\n\n throw new Error('Invalid color format');\n }\n}\n","export interface AXPoint {\n x: number;\n y: number;\n}\n\nexport interface AXBoundingClientRect {\n left?: number;\n top?: number;\n width?: number;\n height?: number;\n bottom?: number;\n right?: number;\n}\n// @dynamic\nexport class AXDrawingUtil {\n static collision(a: HTMLElement, b: HTMLElement): boolean {\n const ac = a.getBoundingClientRect();\n const bc = b.getBoundingClientRect();\n\n 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) {\n return true;\n } else {\n return false;\n }\n }\n\n static isInElementBound(pos: AXPoint, element: HTMLElement): boolean {\n const elBound = element.getBoundingClientRect();\n return AXDrawingUtil.isInRecPoint(pos, {\n left: elBound.x,\n width: elBound.width,\n top: elBound.y,\n height: elBound.height,\n });\n }\n\n static isInRecPoint(pos: AXPoint, rec: AXBoundingClientRect | any): boolean {\n return pos.x >= rec.left && pos.x <= rec.left + rec.width && pos.y >= rec.top && pos.y <= rec.top + rec.height;\n }\n\n static convertRemToPixels(rem: number): number {\n return rem * parseFloat(getComputedStyle(document.documentElement).fontSize);\n }\n}\n","import { isBrowser } from '@acorex/core/platform';\n\n// @dynamic\nexport class AXHtmlUtil {\n\n static focusElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map((c) => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.focus();\n return focusable;\n }\n return null;\n }\n\n static blurElement(element: HTMLElement): HTMLElement {\n const list = ['button', 'input', '[href]', 'select', 'textarea', '[tabindex]'].map((c) => c + ':not([tabindex=\"-1\"])');\n const focusable = element.querySelector<HTMLElement>(list.join(', '));\n if (focusable) {\n focusable.blur();\n return focusable;\n }\n return null;\n }\n\n static hasFocus(element: HTMLElement) {\n return element.matches(':focus-within') || element.matches(':focus');\n }\n\n static isRtl(element: HTMLElement) {\n if (isBrowser()) {\n const rtl = element.classList.contains('ax-rtl') || window.getComputedStyle(element, null).getPropertyValue('direction') === 'rtl';\n return rtl;\n }\n\n return false;\n }\n\n /**\n * Helper function to check if an element is scrollable\n */\n static isScrollable(element: HTMLElement): boolean {\n const overflowY = window.getComputedStyle(element).overflowY;\n return (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;\n }\n\n /**\n * Utility function to find scrollable parent elements\n */\n static getScrollableParents(element: HTMLElement): HTMLElement[] {\n const parents: HTMLElement[] = [];\n let currentElement: HTMLElement | null = element;\n\n while (currentElement) {\n if (AXHtmlUtil.isScrollable(currentElement)) {\n parents.push(currentElement);\n }\n currentElement = currentElement.parentElement;\n }\n\n return parents;\n }\n}\n","import { Directive, ElementRef, HostListener, Input, NgZone, Renderer2 } from '@angular/core';\n\n@Directive({\n selector: '[axResizable]', // Apply this directive on any element like <div axResizable></div>\n})\nexport class AXResizableDirective {\n @Input() minWidth = 100; // Minimum width for the resizable element\n private isResizing = false;\n private resizeHandle: HTMLElement;\n\n constructor(\n private el: ElementRef,\n private renderer: Renderer2,\n private zone: NgZone,\n ) {\n this.createResizeHandle(); // Initialize the resize handle\n }\n\n // Create the resize handle element and apply inline styles\n private createResizeHandle(): void {\n // Apply position relative to the container to allow the absolute positioning of the handle\n this.renderer.setStyle(this.el.nativeElement, 'position', 'relative');\n\n // Create the resize handle dynamically\n this.resizeHandle = this.renderer.createElement('div');\n this.renderer.addClass(this.resizeHandle, 'resize-handle');\n this.renderer.appendChild(this.el.nativeElement, this.resizeHandle);\n\n // Apply inline styles for the resize handle\n this.renderer.setStyle(this.resizeHandle, 'width', '6px'); // Resize handle width\n this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');\n this.renderer.setStyle(this.resizeHandle, 'position', 'absolute');\n this.renderer.setStyle(this.resizeHandle, 'top', '0');\n this.renderer.setStyle(this.resizeHandle, 'right', '0');\n this.renderer.setStyle(this.resizeHandle, 'bottom', '0');\n this.renderer.setStyle(this.resizeHandle, 'cursor', 'ew-resize'); // Horizontal resize cursor\n this.renderer.setStyle(this.resizeHandle, 'z-index', '10');\n this.renderer.setStyle(this.resizeHandle, 'transition', 'background-color 0.2s ease');\n this.renderer.setStyle(this.resizeHandle, 'border-radius', '4px');\n }\n\n // Mouse down event: Start resizing\n @HostListener('mousedown', ['$event'])\n onMouseDown(event: MouseEvent): void {\n // Only allow resizing when clicking on the handle\n const handleRect = this.resizeHandle.getBoundingClientRect();\n if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {\n this.zone.runOutsideAngular(() => {\n this.isResizing = true;\n document.body.style.cursor = 'ew-resize'; // Change cursor to resize mode\n // Change resize handle color to blue when resizing starts\n this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff');\n event.preventDefault();\n });\n }\n }\n\n // Mouse move event: Resize the element\n @HostListener('document:mousemove', ['$event'])\n onMouseMove(event: MouseEvent): void {\n this.zone.runOutsideAngular(() => {\n if (this.isResizing) {\n const rect = this.el.nativeElement.getBoundingClientRect();\n let newWidth: number;\n\n // Resize logic (LTR or RTL support)\n if (document.documentElement.dir === 'rtl') {\n newWidth = rect.right - event.clientX;\n } else {\n newWidth = event.clientX - rect.left;\n }\n\n // Ensure the width does not go below the minimum width\n if (newWidth > this.minWidth) {\n this.renderer.setStyle(this.el.nativeElement, 'width', `${newWidth}px`);\n }\n }\n });\n }\n\n // Mouse up event: End resizing\n @HostListener('document:mouseup')\n onMouseUp(): void {\n this.zone.runOutsideAngular(() => {\n if (this.isResizing) {\n this.isResizing = false;\n document.body.style.cursor = 'default'; // Reset the cursor\n // Reset the resize handle color to default when resizing ends\n this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)');\n }\n });\n }\n\n // Mouse enter event to change the background color (hover effect)\n @HostListener('mouseenter', ['$event'])\n onMouseEnter(): void {\n // Only change color to blue if not resizing\n if (!this.isResizing) {\n this.renderer.setStyle(this.resizeHandle, 'background-color', '#007bff'); // Blue color on hover\n }\n }\n\n // Mouse leave event to reset the background color\n @HostListener('mouseleave', ['$event'])\n onMouseLeave(): void {\n // Only reset to default color if not resizing\n if (!this.isResizing) {\n this.renderer.setStyle(this.resizeHandle, 'background-color', 'rgba(0, 0, 0, 0.2)'); // Default background color\n }\n }\n}\n","// @dynamic\nexport class AXStringUtil {\n static getWordBoundsAtPosition(str: string, position: number): { start: number; end: number } {\n const isSpace = (c) => /[^a-zA-Z0-9]+/i.test(c);\n let start = position - 1;\n\n while (start >= 0 && !isSpace(str[start])) {\n start -= 1;\n }\n start = Math.max(0, start + 1);\n const leftSideString: any = str.slice(start).match(/[a-zA-Z0-9]+/i);\n start += leftSideString.index;\n let end = start + leftSideString[0].length;\n return {\n start,\n end,\n };\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXResizableDirective } from './resize.directive';\n\n@NgModule({\n declarations: [AXResizableDirective],\n imports: [CommonModule],\n exports: [AXResizableDirective],\n})\nexport class UtilsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;SAGgB,kBAAkB,GAAA;AAChC,IAAA,OAAO,UAAU,WAAW,EAAA;AAC1B,QAAA,MAAM,IAAI,GAAG,WAAW,CAAC,SAAS,CAAC,WAAW;AAC9C,QAAA,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,YAAA;AAClC,YAAA,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE;AACvB,gBAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;AAC3B,gBAAA,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,UAAU,EAAE;oBAC5C,QAAQ,CAAC,WAAW,EAAE;;;YAG1B,IAAI,CAAC,KAAK,EAAE;AACd,SAAC;AACH,KAAC;AACH;MAGa,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,OAAO,EAAQ;AAEhC,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAI,MAAkC,KACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAUzC;IARQ,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE;AACrB,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE;;IAGpB,WAAW,GAAA;QAChB,IAAI,CAAC,WAAW,EAAE;;8GAZT,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;;;MCXY,WAAW,CAAA;AACtB,IAAA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AAEnB,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,WAAW,YAHZ,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAGX,WAAW,EAAA,UAAA,EAAA,CAAA;kBALvB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, InjectionToken, Injector, NgModule, Inject } from '@angular/core';
2
+ import { Injectable, inject, InjectionToken, Injector, Inject, NgModule } from '@angular/core';
3
3
  import * as i1 from '@acorex/core/translation';
4
4
  import { AXTranslationService } from '@acorex/core/translation';
5
- import { isString, isEmpty, isNull, isUndefined, isNumber, isArray, find, isEqual, merge } from 'lodash-es';
5
+ import { isString, isEmpty, find, isNull, isUndefined, isNumber, isArray, isEqual, merge } from 'lodash-es';
6
6
 
7
7
  class AXCallbackValidationRule {
8
8
  get name() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "18.12.44",
3
+ "version": "18.14.1-next.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.2.0",
6
6
  "@angular/core": ">=18.2.0",
@@ -1,5 +1,5 @@
1
1
  import { Observable } from 'rxjs';
2
- import { AXTranslateOptions } from './translation.types';
2
+ import { AXTranslateLang, AXTranslateOptions } from './translation.types';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare function translateSync(key: string, options?: AXTranslateOptions): string;
5
5
  export declare class AXTranslationService {
@@ -22,11 +22,15 @@ export declare class AXTranslationService {
22
22
  getActiveLang(): string;
23
23
  setActiveLang(lang: string): void;
24
24
  isLangAvailable(lang: string, scope?: string): boolean;
25
+ getLangAvailable(): AXTranslateLang[] | undefined;
25
26
  private load;
26
27
  private getTranslation;
27
28
  translate(key: string, options?: AXTranslateOptions): Observable<string>;
28
29
  translateAsync(key: string, options?: AXTranslateOptions): Promise<string>;
29
30
  translateSync(key: string, options?: AXTranslateOptions): string;
31
+ findAXTranslateOptions(inputString: string): (Omit<AXTranslateOptions, 'params'> & {
32
+ key: string;
33
+ })[];
30
34
  static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationService, never>;
31
35
  static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationService>;
32
36
  }
package/utils/index.d.ts CHANGED
@@ -2,4 +2,6 @@ export * from './lib/auto-unsubscribe';
2
2
  export * from './lib/color-util';
3
3
  export * from './lib/drawing-util';
4
4
  export * from './lib/html-util';
5
+ export * from './lib/resize.directive';
5
6
  export * from './lib/string-util';
7
+ export * from './lib/utils.module';
@@ -0,0 +1,19 @@
1
+ import { ElementRef, NgZone, Renderer2 } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AXResizableDirective {
4
+ private el;
5
+ private renderer;
6
+ private zone;
7
+ minWidth: number;
8
+ private isResizing;
9
+ private resizeHandle;
10
+ constructor(el: ElementRef, renderer: Renderer2, zone: NgZone);
11
+ private createResizeHandle;
12
+ onMouseDown(event: MouseEvent): void;
13
+ onMouseMove(event: MouseEvent): void;
14
+ onMouseUp(): void;
15
+ onMouseEnter(): void;
16
+ onMouseLeave(): void;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXResizableDirective, never>;
18
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXResizableDirective, "[axResizable]", never, { "minWidth": { "alias": "minWidth"; "required": false; }; }, {}, never, never, false, never>;
19
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./resize.directive";
3
+ import * as i2 from "@angular/common";
4
+ export declare class UtilsModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<UtilsModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UtilsModule, [typeof i1.AXResizableDirective], [typeof i2.CommonModule], [typeof i1.AXResizableDirective]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<UtilsModule>;
8
+ }