@acorex/core 18.14.1-next.4 → 18.15.0
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/file/lib/file.service.mjs +8 -6
- package/esm2022/image/lib/image.service.mjs +7 -3
- package/esm2022/platform/lib/platform.service.mjs +33 -29
- package/esm2022/translation/lib/translation.service.mjs +65 -8
- package/esm2022/utils/lib/drawing-util.mjs +6 -3
- package/esm2022/utils/lib/resize.directive.mjs +7 -5
- package/fesm2022/acorex-core-file.mjs +7 -5
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +6 -2
- package/fesm2022/acorex-core-image.mjs.map +1 -1
- package/fesm2022/acorex-core-platform.mjs +31 -27
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +64 -7
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +11 -7
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/file/lib/file.service.d.ts +1 -0
- package/image/lib/image.service.d.ts +1 -0
- package/package.json +1 -1
- package/platform/lib/platform.service.d.ts +3 -1
- package/utils/lib/resize.directive.d.ts +1 -0
@@ -1,7 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
2
3
|
import * as i0 from "@angular/core";
|
3
4
|
export class AXFileService {
|
4
5
|
constructor() {
|
6
|
+
this.document = inject(DOCUMENT);
|
5
7
|
this.blobToBase64 = (blob) => {
|
6
8
|
if (blob instanceof Blob) {
|
7
9
|
return new Promise((resolve, reject) => {
|
@@ -21,16 +23,16 @@ export class AXFileService {
|
|
21
23
|
choose(options) {
|
22
24
|
return new Promise((resolve, reject) => {
|
23
25
|
options = Object.assign({ multiple: false }, options);
|
24
|
-
const input = document.createElement('input');
|
26
|
+
const input = this.document.createElement('input');
|
25
27
|
input.style.display = 'none';
|
26
|
-
document.body.appendChild(input);
|
28
|
+
this.document.body.appendChild(input);
|
27
29
|
input.type = 'file';
|
28
30
|
input.accept = options.accept || '';
|
29
31
|
input.multiple = options.multiple || false;
|
30
32
|
//
|
31
33
|
const onError = (e) => {
|
32
34
|
reject(e);
|
33
|
-
document.body.removeChild(input);
|
35
|
+
this.document.body.removeChild(input);
|
34
36
|
input.remove();
|
35
37
|
input.removeEventListener('change', onChange);
|
36
38
|
input.removeEventListener('error', onError);
|
@@ -38,7 +40,7 @@ export class AXFileService {
|
|
38
40
|
//
|
39
41
|
const onChange = () => {
|
40
42
|
resolve(Array.from(input.files || []));
|
41
|
-
document.body.removeChild(input);
|
43
|
+
this.document.body.removeChild(input);
|
42
44
|
input.remove();
|
43
45
|
input.removeEventListener('change', onChange);
|
44
46
|
input.removeEventListener('error', onError);
|
@@ -71,4 +73,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
71
73
|
providedIn: 'root',
|
72
74
|
}]
|
73
75
|
}] });
|
74
|
-
//# sourceMappingURL=data:application/json;base64,
|
76
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL2ZpbGUvc3JjL2xpYi9maWxlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzNDLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUtuRCxNQUFNLE9BQU8sYUFBYTtJQUgxQjtRQUlVLGFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7UUFrQzdCLGlCQUFZLEdBQUcsQ0FBQyxJQUFVLEVBQUUsRUFBRTtZQUNuQyxJQUFJL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Byb21pc2UucmVqZWN0KCdpbnB1dCBpcyBub3QgYmxvYicpO1xuICAgIH1cbiAgfTtcblxuICBwdWJsaWMgZ2V0U2l6ZShmaWxlOiBGaWxlIHwgQmxvYiB8IHN0cmluZykge1xuICAgIGlmICh0aGlzLmlzQmFzZTY0KGZpbGUgYXMgc3RyaW5nKSkge1xuICAgICAgcmV0dXJuIHRoaXMuZ2V0QmFzZTY0U2l6ZShmaWxlIGFzIHN0cmluZyk7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHB1YmxpYyBpc0Jhc2U2NChiYXNlNjQ6IHN0cmluZykge1xuICAgIGNvbnN0IHJlZ3ggPSAvW146XVxcdytcXC9bXFx3LStcXGQuXSsoPz07fCwpLztcbiAgICByZXR1cm4gcmVneC50ZXN0KGJhc2U2NCk7XG4gIH1cblxuICBwdWJsaWMgZ2V0QmFzZTY0U2l6ZShiYXNlNjQ6IHN0cmluZykge1xuICAgIHJldHVybiBhdG9iKGJhc2U2NC5zdWJzdHJpbmcoYmFzZTY0LmluZGV4T2YoJywnKSArIDEpKS5sZW5ndGg7XG4gIH1cbn1cbiJdfQ==
|
@@ -1,6 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
2
|
+
import { inject, Injectable } from '@angular/core';
|
2
3
|
import * as i0 from "@angular/core";
|
3
4
|
export class AXImageService {
|
5
|
+
constructor() {
|
6
|
+
this.document = inject(DOCUMENT);
|
7
|
+
}
|
4
8
|
async resize(options) {
|
5
9
|
options = Object.assign({ type: 'image/png', quality: 1 }, options);
|
6
10
|
let image;
|
@@ -14,7 +18,7 @@ export class AXImageService {
|
|
14
18
|
image = options.source;
|
15
19
|
}
|
16
20
|
// Resize the image
|
17
|
-
const canvas = document.createElement('canvas');
|
21
|
+
const canvas = this.document.createElement('canvas');
|
18
22
|
let width = image.width;
|
19
23
|
let height = image.height;
|
20
24
|
if (width > height) {
|
@@ -40,4 +44,4 @@ export class AXImageService {
|
|
40
44
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXImageService, decorators: [{
|
41
45
|
type: Injectable
|
42
46
|
}] });
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1hZ2Uuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9pbWFnZS9zcmMvbGliL2ltYWdlLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQzNDLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUduRCxNQUFNLE9BQU8sY0FBYztJQUQzQjtRQUVVLGFBQVEsR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7S0F1Q3JDO0lBdENDLEtBQUssQ0FBQyxNQUFNLENBQUMsT0FLWjtRQUNDLE9BQU8sR0FBRyxNQUFNLENBQUMsTUFBTSxDQUFDLEVBQUUsSUFBSSxFQUFFLFdBQVcsRUFBRSxPQUFPLEVBQUUsQ0FBQyxFQUFFLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFFcEUsSUFBSSxLQUF1QixDQUFDO1FBQzVCLElBQUksT0FBTyxDQUFDLE1BQU0sWUFBWSxJQUFJLEVBQUUsQ0FBQztZQUNuQyxNQUFNLENBQUMsR0FBRyxJQUFJLEtBQUssRUFBRSxDQUFDO1lBQ3RCLENBQUMsQ0FBQyxHQUFHLEdBQUcsR0FBRyxDQUFDLGVBQWUsQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7WUFDNUMsTUFBTSxJQUFJLE9BQU8sQ0FBUSxDQUF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2ZSkgPT4gY2FudmFzLnRvQmxvYihyZXNvbHZlLCBvcHRpb25zLnR5cGUsIG9wdGlvbnMucXVhbGl0eSkpO1xuICB9XG59XG4iXX0=
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
2
|
+
import { inject, Injectable, signal } from '@angular/core';
|
3
|
+
import { BehaviorSubject, fromEvent, Subject } from 'rxjs';
|
3
4
|
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
|
4
5
|
import * as i0 from "@angular/core";
|
5
6
|
const isChrome = (win) => testUserAgent(win, /Chrome/i);
|
@@ -59,11 +60,11 @@ export const isServer = new Function('try {return this===global;}catch(e){return
|
|
59
60
|
const matchMedia = (win, query) => {
|
60
61
|
return win.matchMedia(query).matches;
|
61
62
|
};
|
62
|
-
const isSMScreen = (win) => matchMedia(win, '(max-width:
|
63
|
+
const isSMScreen = (win) => matchMedia(win, '(max-width: 640px)');
|
63
64
|
const isMDScreen = (win) => matchMedia(win, '(max-width: 768px)');
|
64
|
-
const isLGScreen = (win) => matchMedia(win, '(max-width:
|
65
|
-
const isXLScreen = (win) => matchMedia(win, '(max-width:
|
66
|
-
const is2XLScreen = (win) => matchMedia(win, '(max-width:
|
65
|
+
const isLGScreen = (win) => matchMedia(win, '(max-width: 1024px)');
|
66
|
+
const isXLScreen = (win) => matchMedia(win, '(max-width: 1280px)');
|
67
|
+
const is2XLScreen = (win) => matchMedia(win, '(max-width: 1536px)');
|
67
68
|
const is3XLScreen = (win) => matchMedia(win, '(max-width: 1920px)');
|
68
69
|
const is4XLScreen = (win) => matchMedia(win, '(max-width: 2560px)');
|
69
70
|
const PLATFORMS_MAP = {
|
@@ -92,10 +93,12 @@ export class AXPlatformEvent {
|
|
92
93
|
}
|
93
94
|
export class AXPlatform {
|
94
95
|
isDark() {
|
95
|
-
return document.documentElement.classList.contains('ax-dark');
|
96
|
+
return this.document.documentElement.classList.contains('ax-dark');
|
96
97
|
}
|
97
98
|
isRtl() {
|
98
|
-
return
|
99
|
+
return (this.document.dir == 'rtl' ||
|
100
|
+
this.document.body.dir == 'rtl' ||
|
101
|
+
this.document.body.style.direction == 'rtl');
|
99
102
|
}
|
100
103
|
isLandscape() {
|
101
104
|
return window.innerHeight < window.innerWidth;
|
@@ -115,35 +118,35 @@ export class AXPlatform {
|
|
115
118
|
return (['SM', 'MD', 'LG', 'XL', '2XL', '3XL', '4XL'].find((name) => PLATFORMS_MAP[name](window) == true) || '5XL');
|
116
119
|
}
|
117
120
|
switchLightMode() {
|
118
|
-
const _html = document.getElementsByTagName('html')[0];
|
121
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
119
122
|
_html.classList.remove('ax-dark');
|
120
|
-
|
121
|
-
this.themeMode$.next('light');
|
122
|
-
this.themeMode.set('light');
|
123
|
+
this.#setSystemTheme('light');
|
123
124
|
return 'light';
|
124
125
|
}
|
125
126
|
switchDarkMode() {
|
126
|
-
const _html = document.getElementsByTagName('html')[0];
|
127
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
127
128
|
_html.classList.add('ax-dark');
|
128
|
-
|
129
|
-
this.themeMode$.next('dark');
|
130
|
-
this.themeMode.set('dark');
|
129
|
+
this.#setSystemTheme('dark');
|
131
130
|
return 'dark';
|
132
131
|
}
|
133
132
|
switchSystemMode() {
|
134
133
|
if (isBrowser()) {
|
135
134
|
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
136
|
-
const _html = document.getElementsByTagName('html')[0];
|
135
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
137
136
|
_html.classList.add('ax-dark');
|
137
|
+
this.#setSystemTheme('system-dark');
|
138
138
|
}
|
139
139
|
else {
|
140
|
-
const _html = document.getElementsByTagName('html')[0];
|
140
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
141
141
|
_html.classList.remove('ax-dark');
|
142
|
+
this.#setSystemTheme('system-light');
|
142
143
|
}
|
143
144
|
}
|
144
|
-
|
145
|
-
|
146
|
-
this.themeMode
|
145
|
+
}
|
146
|
+
#setSystemTheme(themeMode) {
|
147
|
+
this.themeMode$.next(themeMode);
|
148
|
+
localStorage.setItem('AX_THEME_MODE', themeMode);
|
149
|
+
this.themeMode.set(themeMode);
|
147
150
|
}
|
148
151
|
autoDetectThemeMode() {
|
149
152
|
const mode = localStorage.getItem('AX_THEME_MODE') || 'system';
|
@@ -159,7 +162,7 @@ export class AXPlatform {
|
|
159
162
|
setFullHeightRatio() {
|
160
163
|
if (isBrowser()) {
|
161
164
|
try {
|
162
|
-
document
|
165
|
+
this.document
|
163
166
|
.querySelector(':root')
|
164
167
|
?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
|
165
168
|
}
|
@@ -172,11 +175,11 @@ export class AXPlatform {
|
|
172
175
|
if (this.themeMode() === 'system') {
|
173
176
|
const themeMode = event.matches ? 'dark' : 'light';
|
174
177
|
if (themeMode === 'dark') {
|
175
|
-
const _html = document.getElementsByTagName('html')[0];
|
178
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
176
179
|
_html.classList.add('ax-dark');
|
177
180
|
}
|
178
181
|
else {
|
179
|
-
const _html = document.getElementsByTagName('html')[0];
|
182
|
+
const _html = this.document.getElementsByTagName('html')[0];
|
180
183
|
_html.classList.remove('ax-dark');
|
181
184
|
}
|
182
185
|
}
|
@@ -188,6 +191,7 @@ export class AXPlatform {
|
|
188
191
|
this.scroll = new Subject();
|
189
192
|
this.themeMode$ = new BehaviorSubject('system');
|
190
193
|
this.themeMode = signal('system');
|
194
|
+
this.document = inject(DOCUMENT);
|
191
195
|
if (isBrowser()) {
|
192
196
|
this.detectDarkMode();
|
193
197
|
this.detectOnResize();
|
@@ -220,7 +224,7 @@ export class AXPlatform {
|
|
220
224
|
});
|
221
225
|
}
|
222
226
|
detectClickEvent() {
|
223
|
-
document.addEventListener('click', (e) => {
|
227
|
+
this.document.addEventListener('click', (e) => {
|
224
228
|
this.click.next({
|
225
229
|
nativeEvent: e,
|
226
230
|
source: this,
|
@@ -228,7 +232,7 @@ export class AXPlatform {
|
|
228
232
|
}, true);
|
229
233
|
}
|
230
234
|
detectScrollEvent() {
|
231
|
-
document.addEventListener('scroll', (e) => {
|
235
|
+
this.document.addEventListener('scroll', (e) => {
|
232
236
|
this.scroll.next({
|
233
237
|
nativeEvent: e,
|
234
238
|
source: this,
|
@@ -240,12 +244,12 @@ export class AXPlatform {
|
|
240
244
|
mutations.forEach((mutation) => {
|
241
245
|
// Detect Direction Change
|
242
246
|
if (mutation.attributeName === 'dir') {
|
243
|
-
const dir = document.documentElement.getAttribute('dir');
|
247
|
+
const dir = this.document.documentElement.getAttribute('dir');
|
244
248
|
this.directionChange.next({ source: this, nativeEvent: null, data: dir });
|
245
249
|
}
|
246
250
|
});
|
247
251
|
});
|
248
|
-
observer.observe(document.documentElement, {
|
252
|
+
observer.observe(this.document.documentElement, {
|
249
253
|
attributes: true,
|
250
254
|
childList: false,
|
251
255
|
characterData: false,
|
@@ -260,4 +264,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
260
264
|
providedIn: 'root',
|
261
265
|
}]
|
262
266
|
}], ctorParameters: () => [] });
|
263
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9wbGF0Zm9ybS9zcmMvbGliL3BsYXRmb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLGVBQWUsRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzNELE9BQU8sRUFBRSxZQ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GVcbiAgICAgICAgdGhpcy5hdXRvU3lzdGVtTW9kZURldGVjdGlvbihldmVudCk7XG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuICBwcml2YXRlIGRldGVjdE9uUmVzaXplKCkge1xuICAgIGZyb21FdmVudDxVSUV2ZW50Pih3aW5kb3csICdyZXNpemUnKVxuICAgICAgLnBpcGUoZGVib3VuY2VUaW1lKDEwMCkpXG4gICAgICAucGlwZShkaXN0aW5jdFVudGlsQ2hhbmdlZCgpKVxuICAgICAgLnN1YnNjcmliZSgoZSkgPT4ge1xuICAgICAgICB0aGlzLnJlc2l6ZS5uZXh0KHtcbiAgICAgICAgICBuYXRpdmVFdmVudDogZSxcbiAgICAgICAgICBzb3VyY2U6IHRoaXMsXG4gICAgICAgIH0pO1xuICAgICAgICAvL1xuICAgICAgICB0aGlzLnNldEZ1bGxIZWlnaHRSYXRpbygpO1xuICAgICAgfSk7XG4gIH1cblxuICBwcml2YXRlIGRldGVjdENsaWNrRXZlbnQoKSB7XG4gICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICdjbGljaycsXG4gICAgICAoZSkgPT4ge1xuICAgICAgICB0aGlzLmNsaWNrLm5leHQoe1xuICAgICAgICAgIG5hdGl2ZUV2ZW50OiBlLFxuICAgICAgICAgIHNvdXJjZTogdGhpcyxcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgICAgdHJ1ZSxcbiAgICApO1xuICB9XG5cbiAgcHJpdmF0ZSBkZXRlY3RTY3JvbGxFdmVudCgpIHtcbiAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgJ3Njcm9sbCcsXG4gICAgICAoZSkgPT4ge1xuICAgICAgICB0aGlzLnNjcm9sbC5uZXh0KHtcbiAgICAgICAgICBuYXRpdmVFdmVudDogZSxcbiAgICAgICAgICBzb3VyY2U6IHRoaXMsXG4gICAgICAgIH0pO1xuICAgICAgfSxcbiAgICAgIHRydWUsXG4gICAgKTtc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