@acorex/core 18.10.14 → 18.10.16
Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,9 @@ const isTablet = (win) => {
|
|
38
38
|
const height = win.innerHeight;
|
39
39
|
const smallest = Math.min(width, height);
|
40
40
|
const largest = Math.max(width, height);
|
41
|
-
return isIpad(win) ||
|
41
|
+
return (isIpad(win) ||
|
42
|
+
isAndroidTablet(win) ||
|
43
|
+
(smallest > 460 && smallest < 820 && largest > 780 && largest < 1400));
|
42
44
|
};
|
43
45
|
const isMobile = (win) => matchMedia(win, '(any-pointer:coarse)');
|
44
46
|
const isTouch = (win) => matchMedia(win, '(any-pointer:coarse)');
|
@@ -151,10 +153,12 @@ export class AXPlatform {
|
|
151
153
|
return this.switchSystemMode();
|
152
154
|
}
|
153
155
|
}
|
154
|
-
|
156
|
+
setFullHeightRatio() {
|
155
157
|
if (isBrowser()) {
|
156
158
|
try {
|
157
|
-
document
|
159
|
+
document
|
160
|
+
.querySelector(':root')
|
161
|
+
?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
|
158
162
|
}
|
159
163
|
catch (error) {
|
160
164
|
console.error(error);
|
@@ -176,44 +180,74 @@ export class AXPlatform {
|
|
176
180
|
}
|
177
181
|
constructor() {
|
178
182
|
this.resize = new Subject();
|
183
|
+
this.directionChange = new Subject();
|
179
184
|
this.click = new Subject();
|
180
185
|
this.scroll = new Subject();
|
181
186
|
this.themeMode$ = new BehaviorSubject('system');
|
182
187
|
this.themeMode = signal('system');
|
183
188
|
if (isBrowser()) {
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
189
|
+
this.detectDarkMode();
|
190
|
+
this.detectOnResize();
|
191
|
+
this.detectClickEvent();
|
192
|
+
this.detectScrollEvent();
|
193
|
+
this.setFullHeightRatio();
|
194
|
+
this.detectDocumentDirectionChange();
|
195
|
+
}
|
196
|
+
}
|
197
|
+
detectDarkMode() {
|
198
|
+
// fromEvent(UIEvent)(window,'')
|
199
|
+
if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {
|
200
|
+
window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {
|
201
|
+
// Detect System color mode
|
202
|
+
this.autoSystemModeDetection(event);
|
194
203
|
});
|
195
|
-
if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {
|
196
|
-
window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {
|
197
|
-
// Detect System color mode
|
198
|
-
this.autoSystemModeDetection(event);
|
199
|
-
});
|
200
|
-
}
|
201
|
-
document.addEventListener('click', (e) => {
|
202
|
-
this.click.next({
|
203
|
-
nativeEvent: e,
|
204
|
-
source: this,
|
205
|
-
});
|
206
|
-
}, true);
|
207
|
-
document.addEventListener('scroll', (e) => {
|
208
|
-
this.scroll.next({
|
209
|
-
nativeEvent: e,
|
210
|
-
source: this,
|
211
|
-
});
|
212
|
-
}, true);
|
213
|
-
// init functions
|
214
|
-
this._setFullHeightRatio();
|
215
204
|
}
|
216
205
|
}
|
206
|
+
detectOnResize() {
|
207
|
+
fromEvent(window, 'resize')
|
208
|
+
.pipe(debounceTime(100))
|
209
|
+
.pipe(distinctUntilChanged())
|
210
|
+
.subscribe((e) => {
|
211
|
+
this.resize.next({
|
212
|
+
nativeEvent: e,
|
213
|
+
source: this,
|
214
|
+
});
|
215
|
+
//
|
216
|
+
this.setFullHeightRatio();
|
217
|
+
});
|
218
|
+
}
|
219
|
+
detectClickEvent() {
|
220
|
+
document.addEventListener('click', (e) => {
|
221
|
+
this.click.next({
|
222
|
+
nativeEvent: e,
|
223
|
+
source: this,
|
224
|
+
});
|
225
|
+
}, true);
|
226
|
+
}
|
227
|
+
detectScrollEvent() {
|
228
|
+
document.addEventListener('scroll', (e) => {
|
229
|
+
this.scroll.next({
|
230
|
+
nativeEvent: e,
|
231
|
+
source: this,
|
232
|
+
});
|
233
|
+
}, true);
|
234
|
+
}
|
235
|
+
detectDocumentDirectionChange() {
|
236
|
+
const observer = new MutationObserver((mutations) => {
|
237
|
+
mutations.forEach((mutation) => {
|
238
|
+
// Detect Direction Change
|
239
|
+
if (mutation.attributeName === 'dir') {
|
240
|
+
const dir = document.documentElement.getAttribute('dir');
|
241
|
+
this.directionChange.next({ source: this, nativeEvent: null, data: dir });
|
242
|
+
}
|
243
|
+
});
|
244
|
+
});
|
245
|
+
observer.observe(document.documentElement, {
|
246
|
+
attributes: true,
|
247
|
+
childList: false,
|
248
|
+
characterData: false,
|
249
|
+
});
|
250
|
+
}
|
217
251
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
218
252
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPlatform, providedIn: 'root' }); }
|
219
253
|
}
|
@@ -223,4 +257,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
223
257
|
providedIn: 'root',
|
224
258
|
}]
|
225
259
|
}], ctorParameters: () => [] });
|
226
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9wbGF0Zm9ybS9zcmMvbGliL3BsYXRmb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLGVBQWUsRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzNELE9BQU8sRUFBRSxZQUFZLEVBQUUs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YnNjcmliZSgoZSkgPT4ge1xuICAgICAgICAgIHRoaXMucmVzaXplLm5leHQoe1xuICAgICAgICAgICAgbmF0aXZlRXZlbnQ6IGUsXG4gICAgICAgICAgICBzb3VyY2U6IHRoaXMsXG4gICAgICAgICAgfSk7XG4gICAgICAgICAgLy9cbiAgICAgICAgICB0aGlzLl9zZXRGdWxsSGVpZ2h0UmF0aW8oKTtcbiAgICAgICAgfSk7XG4gICAgICBpZiAod2luZG93Py5tYXRjaE1lZGlhKCcocHJlZmVycy1jb2xvci1zY2hlbWU6IGRhcmspJykubWF0Y2hlcykge1xuICAgICAgICB3aW5kb3c/Lm1hdGNoTWVkaWEoJyhwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyayknKT8uYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgLy8gRGV0ZWN0IFN5c3RlbSBjb2xvciBtb2RlXG4gICAgICAgICAgdGhpcy5hdXRvU3lzdGVtTW9kZURldGVjdGlvbihldmVudCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgJ2NsaWNrJyxcbiAgICAgICAgKGUpID0+IHtcbiAgICAgICAgICB0aGlzLmNsaWNrLm5leHQoe1xuICAgICAgICAgICAgbmF0aXZlRXZlbnQ6IGUsXG4gICAgICAgICAgICBzb3VyY2U6IHRoaXMsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHRydWUsXG4gICAgICApO1xuXG4gICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAnc2Nyb2xsJyxcbiAgICAgICAgKGUpID0+IHtcbiAgICAgICAgICB0aGlzLnNjcm9sbC5uZXh0KHtcbiAgICAgICAgICAgIG5hdGl2ZUV2ZW50OiBlLFxuICAgICAgICAgICAgc291cmNlOiB0aGlzLFxuICAgICAgICAgIH0pO1xuICA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bEV2ZW50KCkge1xuICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAnc2Nyb2xsJyxcbiAgICAgIChlKSA9PiB7XG4gICAgICAgIHRoaXMuc2Nyb2xsLm5leHQoe1xuICAgICAgICAgIG5hdGl2ZUV2ZW50OiBlLFxuICAgICAgICAgIHNvdXJjZTogdGhpcyxcbiAgICAgICAgfSk7XG4gICAgICB9LFxuICAgICAgdHJ1ZSxcbiAgICApO1xuICB9XG5cbiAgcHJpdmF0ZSBkZXRlY3REb2N1bWVudERpcmVjdGlvbkNoYW5nZSgpIHtcbiAgICBjb25zdCBvYnNlcnZlciA9IG5ldyBNdXRhdGlvbk9ic2VydmVyKChtdXRhdGlvbnMpID0+IHtcbiAgICAgIG11dGF0aW9ucy5mb3JFYWNoKChtdXRhdGlvbikgPT4ge1xuICAgICAgICAvLyBEZXRlY3QgRGlyZWN0aW9uIENoYW5nZVxuICAgICAgICBpZiAobXV0YXRpb24uYXR0cmlidXRlTmFtZSA9PT0gJ2RpcicpIHtcbiAgICAgICAgICBjb25zdCBkaXIgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuZ2V0QXR0cmlidXRlKCdkaXInKTtcbiAgICAgICAgICB0aGlzLmRpcmVjdGlvbkNoYW5nZS5uZXh0KHsgc291cmNlOiB0aGlzLCBuYXRpdmVFdmVudDogbnVsbCwgZGF0YTogZGlyIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCwge1xuICAgICAgYXR0cmlidXRlczogdHJ1ZSxcbiAgICAgIGNoaWxkTGlzdDogZmFsc2UsXG4gICAgICBjaGFyYWN0ZXJEYXRhOiBmYWxzZSxcbiAgICB9KTtcbiAgfVxufVxuIl19
|
@@ -39,7 +39,9 @@ const isTablet = (win) => {
|
|
39
39
|
const height = win.innerHeight;
|
40
40
|
const smallest = Math.min(width, height);
|
41
41
|
const largest = Math.max(width, height);
|
42
|
-
return isIpad(win) ||
|
42
|
+
return (isIpad(win) ||
|
43
|
+
isAndroidTablet(win) ||
|
44
|
+
(smallest > 460 && smallest < 820 && largest > 780 && largest < 1400));
|
43
45
|
};
|
44
46
|
const isMobile = (win) => matchMedia(win, '(any-pointer:coarse)');
|
45
47
|
const isTouch = (win) => matchMedia(win, '(any-pointer:coarse)');
|
@@ -152,10 +154,12 @@ class AXPlatform {
|
|
152
154
|
return this.switchSystemMode();
|
153
155
|
}
|
154
156
|
}
|
155
|
-
|
157
|
+
setFullHeightRatio() {
|
156
158
|
if (isBrowser()) {
|
157
159
|
try {
|
158
|
-
document
|
160
|
+
document
|
161
|
+
.querySelector(':root')
|
162
|
+
?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
|
159
163
|
}
|
160
164
|
catch (error) {
|
161
165
|
console.error(error);
|
@@ -177,44 +181,74 @@ class AXPlatform {
|
|
177
181
|
}
|
178
182
|
constructor() {
|
179
183
|
this.resize = new Subject();
|
184
|
+
this.directionChange = new Subject();
|
180
185
|
this.click = new Subject();
|
181
186
|
this.scroll = new Subject();
|
182
187
|
this.themeMode$ = new BehaviorSubject('system');
|
183
188
|
this.themeMode = signal('system');
|
184
189
|
if (isBrowser()) {
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
190
|
+
this.detectDarkMode();
|
191
|
+
this.detectOnResize();
|
192
|
+
this.detectClickEvent();
|
193
|
+
this.detectScrollEvent();
|
194
|
+
this.setFullHeightRatio();
|
195
|
+
this.detectDocumentDirectionChange();
|
196
|
+
}
|
197
|
+
}
|
198
|
+
detectDarkMode() {
|
199
|
+
// fromEvent(UIEvent)(window,'')
|
200
|
+
if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {
|
201
|
+
window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {
|
202
|
+
// Detect System color mode
|
203
|
+
this.autoSystemModeDetection(event);
|
195
204
|
});
|
196
|
-
if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {
|
197
|
-
window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {
|
198
|
-
// Detect System color mode
|
199
|
-
this.autoSystemModeDetection(event);
|
200
|
-
});
|
201
|
-
}
|
202
|
-
document.addEventListener('click', (e) => {
|
203
|
-
this.click.next({
|
204
|
-
nativeEvent: e,
|
205
|
-
source: this,
|
206
|
-
});
|
207
|
-
}, true);
|
208
|
-
document.addEventListener('scroll', (e) => {
|
209
|
-
this.scroll.next({
|
210
|
-
nativeEvent: e,
|
211
|
-
source: this,
|
212
|
-
});
|
213
|
-
}, true);
|
214
|
-
// init functions
|
215
|
-
this._setFullHeightRatio();
|
216
205
|
}
|
217
206
|
}
|
207
|
+
detectOnResize() {
|
208
|
+
fromEvent(window, 'resize')
|
209
|
+
.pipe(debounceTime(100))
|
210
|
+
.pipe(distinctUntilChanged())
|
211
|
+
.subscribe((e) => {
|
212
|
+
this.resize.next({
|
213
|
+
nativeEvent: e,
|
214
|
+
source: this,
|
215
|
+
});
|
216
|
+
//
|
217
|
+
this.setFullHeightRatio();
|
218
|
+
});
|
219
|
+
}
|
220
|
+
detectClickEvent() {
|
221
|
+
document.addEventListener('click', (e) => {
|
222
|
+
this.click.next({
|
223
|
+
nativeEvent: e,
|
224
|
+
source: this,
|
225
|
+
});
|
226
|
+
}, true);
|
227
|
+
}
|
228
|
+
detectScrollEvent() {
|
229
|
+
document.addEventListener('scroll', (e) => {
|
230
|
+
this.scroll.next({
|
231
|
+
nativeEvent: e,
|
232
|
+
source: this,
|
233
|
+
});
|
234
|
+
}, true);
|
235
|
+
}
|
236
|
+
detectDocumentDirectionChange() {
|
237
|
+
const observer = new MutationObserver((mutations) => {
|
238
|
+
mutations.forEach((mutation) => {
|
239
|
+
// Detect Direction Change
|
240
|
+
if (mutation.attributeName === 'dir') {
|
241
|
+
const dir = document.documentElement.getAttribute('dir');
|
242
|
+
this.directionChange.next({ source: this, nativeEvent: null, data: dir });
|
243
|
+
}
|
244
|
+
});
|
245
|
+
});
|
246
|
+
observer.observe(document.documentElement, {
|
247
|
+
attributes: true,
|
248
|
+
childList: false,
|
249
|
+
characterData: false,
|
250
|
+
});
|
251
|
+
}
|
218
252
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPlatform, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
219
253
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPlatform, providedIn: 'root' }); }
|
220
254
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-core-platform.mjs","sources":["../../../../libs/core/platform/src/lib/platform.service.ts","../../../../libs/core/platform/src/acorex-core-platform.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject, Subject, fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\nexport type AXThemeMode = 'light' | 'dark' | 'system';\nexport type AXPlatforms = 'Android' | 'Desktop' | 'iOS' | 'Mobile';\nexport type AXBrowsers = 'Chrome' | 'Safari' | 'Edge' | 'Firefox' | 'Opera' | 'MSIE';\nexport type AXTechnologies = 'PWA' | 'Hybrid' | 'Electron';\n\nexport type AXScreenSizes = 'SM' | 'MD' | 'LG' | 'XL' | '2XL' | '3XL' | '4XL' | '5XL';\n\nconst isChrome = (win: Window): boolean => testUserAgent(win, /Chrome/i);\n\nconst isFirefox = (win: Window): boolean => testUserAgent(win, /Firefox/i);\n\nconst isEdge = (win: Window): boolean => testUserAgent(win, /Edge/i);\n\nconst isSafari = (win: Window): boolean => testUserAgent(win, /Safari/i);\n\nconst isOpera = (win: Window): boolean => testUserAgent(win, /Opera/i) || testUserAgent(win, /OPR/i);\n\nconst isMSIE = (win: Window): boolean => testUserAgent(win, /MSIE/i) || testUserAgent(win, /Trident/i);\n\nconst isMobileWeb = (win: Window): boolean => isMobile(win) && !isHybrid(win);\n\nconst isIpad = (win: Window) => {\n // iOS 12 and below\n if (testUserAgent(win, /iPad/i)) {\n return true;\n }\n\n // iOS 13+\n if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {\n return true;\n }\n\n return false;\n};\n\nconst isIphone = (win: Window) => testUserAgent(win, /iPhone/i);\n\nconst isIOS = (win: Window) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);\n\nconst isAndroid = (win: Window) => testUserAgent(win, /android|sink/i);\n\nconst isAndroidTablet = (win: Window) => {\n return isAndroid(win) && !testUserAgent(win, /mobile/i);\n};\n\nconst isPhablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return smallest > 390 && smallest < 520 && largest > 620 && largest < 800;\n};\n\nconst isTablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return isIpad(win) || isAndroidTablet(win) || (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400);\n};\n\nconst isMobile = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\nconst isTouch = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\n\nconst isDesktop = (win: Window) => !isMobile(win);\n\nconst isHybrid = (win: Window) => isCordova(win) || isCapacitorNative(win);\n\nconst isCordova = (win: any): boolean => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);\n\nconst isCapacitorNative = (win: any): boolean => {\n const capacitor = win['Capacitor'];\n return !!(capacitor && capacitor.isNative);\n};\n\nconst isElectron = (win: Window): boolean => testUserAgent(win, /electron/i);\n\nconst isPWA = (win: Window): boolean => !!(win.matchMedia('(display-mode: standalone)').matches || (win.navigator as any).standalone);\n\nexport const testUserAgent = (win: Window, expr: RegExp) => expr.test(win.navigator.userAgent);\n\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isServer = new Function('try {return this===global;}catch(e){return false;}');\n\nconst matchMedia = (win: Window, query: string): boolean => {\n return win.matchMedia(query).matches;\n};\n\nconst isSMScreen = (win: Window) => matchMedia(win, '(max-width: 578px)');\nconst isMDScreen = (win: Window) => matchMedia(win, '(max-width: 768px)');\nconst isLGScreen = (win: Window) => matchMedia(win, '(max-width: 992px)');\nconst isXLScreen = (win: Window) => matchMedia(win, '(max-width: 1200px)');\nconst is2XLScreen = (win: Window) => matchMedia(win, '(max-width: 1440px)');\nconst is3XLScreen = (win: Window) => matchMedia(win, '(max-width: 1920px)');\nconst is4XLScreen = (win: Window) => matchMedia(win, '(max-width: 2560px)');\n\nconst PLATFORMS_MAP: any = {\n Android: isAndroid,\n iOS: isIOS,\n Desktop: isDesktop,\n Mobile: isMobile,\n Touch: isTouch,\n Chrome: isChrome,\n Firefox: isFirefox,\n Safari: isSafari,\n Edge: isEdge,\n Opera: isOpera,\n Hybrid: isHybrid,\n PWA: isPWA,\n Electron: isElectron,\n SM: isSMScreen,\n MD: isMDScreen,\n LG: isLGScreen,\n XL: isXLScreen,\n '2XL': is2XLScreen,\n '3XL': is3XLScreen,\n '4XL': is4XLScreen,\n};\n\nexport class AXPlatformEvent<T extends Event = Event> {\n nativeEvent!: T;\n source!: AXPlatform;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXPlatform {\n resize: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n click: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n scroll: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n\n themeMode$: BehaviorSubject<AXThemeMode> = new BehaviorSubject<AXThemeMode>('system');\n\n themeMode = signal<AXThemeMode>('system');\n\n isRtl(): boolean {\n return document.dir == 'rtl' || document.body.dir == 'rtl' || document.body.style.direction == 'rtl';\n }\n\n isLandscape(): boolean {\n return window.innerHeight < window.innerWidth;\n }\n\n isPortrate(): boolean {\n return !this.isLandscape();\n }\n\n is(name: AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes): boolean {\n if (isBrowser()) {\n return PLATFORMS_MAP[name](window) || false;\n } else {\n return false;\n }\n }\n\n get screenSize(): AXScreenSizes {\n return (['SM', 'MD', 'LG', 'XL', '2XL', '3XL', '4XL'].find((name) => PLATFORMS_MAP[name](window) == true) || '5XL') as AXScreenSizes;\n }\n\n switchLightMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'light');\n this.themeMode$.next('light');\n this.themeMode.set('light');\n return 'light';\n }\n\n switchDarkMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'dark');\n this.themeMode$.next('dark');\n this.themeMode.set('dark');\n return 'dark';\n }\n\n switchSystemMode() {\n if (isBrowser()) {\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n localStorage.setItem('AX_THEME_MODE', 'system');\n this.themeMode$.next('system');\n this.themeMode.set('system');\n }\n\n autoDetectThemeMode() {\n const mode = localStorage.getItem('AX_THEME_MODE') || 'system';\n switch (mode) {\n case 'light':\n return this.switchLightMode();\n\n case 'dark':\n return this.switchDarkMode();\n\n case 'system':\n return this.switchSystemMode();\n }\n }\n\n private _setFullHeightRatio() {\n if (isBrowser()) {\n try {\n document.querySelector<HTMLElement>(':root')?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n private autoSystemModeDetection(event) {\n if (this.themeMode() === 'system') {\n const themeMode = event.matches ? 'dark' : 'light';\n\n if (themeMode === 'dark') {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n }\n\n constructor() {\n if (isBrowser()) {\n fromEvent<UIEvent>(window, 'resize')\n .pipe(debounceTime(100))\n .pipe(distinctUntilChanged())\n .subscribe((e) => {\n this.resize.next({\n nativeEvent: e,\n source: this,\n });\n //\n this._setFullHeightRatio();\n });\n if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {\n window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {\n // Detect System color mode\n this.autoSystemModeDetection(event);\n });\n }\n document.addEventListener(\n 'click',\n (e) => {\n this.click.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n\n document.addEventListener(\n 'scroll',\n (e) => {\n this.scroll.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n\n // init functions\n this._setFullHeightRatio();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzE,MAAM,SAAS,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAErE,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAErG,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAEvG,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,QAAQ,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MAAM;AACnB,iBAAA,CAAA;;;ACpID;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-core-platform.mjs","sources":["../../../../libs/core/platform/src/lib/platform.service.ts","../../../../libs/core/platform/src/acorex-core-platform.ts"],"sourcesContent":["import { Injectable, signal } from '@angular/core';\nimport { BehaviorSubject, Subject, fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged } from 'rxjs/operators';\n\nexport type AXThemeMode = 'light' | 'dark' | 'system';\nexport type AXPlatforms = 'Android' | 'Desktop' | 'iOS' | 'Mobile';\nexport type AXBrowsers = 'Chrome' | 'Safari' | 'Edge' | 'Firefox' | 'Opera' | 'MSIE';\nexport type AXTechnologies = 'PWA' | 'Hybrid' | 'Electron';\n\nexport type AXScreenSizes = 'SM' | 'MD' | 'LG' | 'XL' | '2XL' | '3XL' | '4XL' | '5XL';\n\nconst isChrome = (win: Window): boolean => testUserAgent(win, /Chrome/i);\n\nconst isFirefox = (win: Window): boolean => testUserAgent(win, /Firefox/i);\n\nconst isEdge = (win: Window): boolean => testUserAgent(win, /Edge/i);\n\nconst isSafari = (win: Window): boolean => testUserAgent(win, /Safari/i);\n\nconst isOpera = (win: Window): boolean => testUserAgent(win, /Opera/i) || testUserAgent(win, /OPR/i);\n\nconst isMSIE = (win: Window): boolean => testUserAgent(win, /MSIE/i) || testUserAgent(win, /Trident/i);\n\nconst isMobileWeb = (win: Window): boolean => isMobile(win) && !isHybrid(win);\n\nconst isIpad = (win: Window) => {\n // iOS 12 and below\n if (testUserAgent(win, /iPad/i)) {\n return true;\n }\n\n // iOS 13+\n if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {\n return true;\n }\n\n return false;\n};\n\nconst isIphone = (win: Window) => testUserAgent(win, /iPhone/i);\n\nconst isIOS = (win: Window) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);\n\nconst isAndroid = (win: Window) => testUserAgent(win, /android|sink/i);\n\nconst isAndroidTablet = (win: Window) => {\n return isAndroid(win) && !testUserAgent(win, /mobile/i);\n};\n\nconst isPhablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return smallest > 390 && smallest < 520 && largest > 620 && largest < 800;\n};\n\nconst isTablet = (win: Window) => {\n const width = win.innerWidth;\n const height = win.innerHeight;\n const smallest = Math.min(width, height);\n const largest = Math.max(width, height);\n\n return (\n isIpad(win) ||\n isAndroidTablet(win) ||\n (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400)\n );\n};\n\nconst isMobile = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\nconst isTouch = (win: Window) => matchMedia(win, '(any-pointer:coarse)');\n\nconst isDesktop = (win: Window) => !isMobile(win);\n\nconst isHybrid = (win: Window) => isCordova(win) || isCapacitorNative(win);\n\nconst isCordova = (win: any): boolean => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);\n\nconst isCapacitorNative = (win: any): boolean => {\n const capacitor = win['Capacitor'];\n return !!(capacitor && capacitor.isNative);\n};\n\nconst isElectron = (win: Window): boolean => testUserAgent(win, /electron/i);\n\nconst isPWA = (win: Window): boolean =>\n !!(win.matchMedia('(display-mode: standalone)').matches || (win.navigator as any).standalone);\n\nexport const testUserAgent = (win: Window, expr: RegExp) => expr.test(win.navigator.userAgent);\n\nexport const isBrowser = new Function('try {return this===window;}catch(e){ return false;}');\nexport const isServer = new Function('try {return this===global;}catch(e){return false;}');\n\nconst matchMedia = (win: Window, query: string): boolean => {\n return win.matchMedia(query).matches;\n};\n\nconst isSMScreen = (win: Window) => matchMedia(win, '(max-width: 578px)');\nconst isMDScreen = (win: Window) => matchMedia(win, '(max-width: 768px)');\nconst isLGScreen = (win: Window) => matchMedia(win, '(max-width: 992px)');\nconst isXLScreen = (win: Window) => matchMedia(win, '(max-width: 1200px)');\nconst is2XLScreen = (win: Window) => matchMedia(win, '(max-width: 1440px)');\nconst is3XLScreen = (win: Window) => matchMedia(win, '(max-width: 1920px)');\nconst is4XLScreen = (win: Window) => matchMedia(win, '(max-width: 2560px)');\n\nconst PLATFORMS_MAP: any = {\n Android: isAndroid,\n iOS: isIOS,\n Desktop: isDesktop,\n Mobile: isMobile,\n Touch: isTouch,\n Chrome: isChrome,\n Firefox: isFirefox,\n Safari: isSafari,\n Edge: isEdge,\n Opera: isOpera,\n Hybrid: isHybrid,\n PWA: isPWA,\n Electron: isElectron,\n SM: isSMScreen,\n MD: isMDScreen,\n LG: isLGScreen,\n XL: isXLScreen,\n '2XL': is2XLScreen,\n '3XL': is3XLScreen,\n '4XL': is4XLScreen,\n};\n\nexport class AXPlatformEvent<T extends Event = Event> {\n nativeEvent!: T;\n source!: AXPlatform;\n data?: any;\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXPlatform {\n resize: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n directionChange: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n click: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n scroll: Subject<AXPlatformEvent> = new Subject<AXPlatformEvent>();\n themeMode$: BehaviorSubject<AXThemeMode> = new BehaviorSubject<AXThemeMode>('system');\n\n themeMode = signal<AXThemeMode>('system');\n\n isRtl(): boolean {\n return document.dir == 'rtl' || document.body.dir == 'rtl' || document.body.style.direction == 'rtl';\n }\n\n isLandscape(): boolean {\n return window.innerHeight < window.innerWidth;\n }\n\n isPortrate(): boolean {\n return !this.isLandscape();\n }\n\n is(name: AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes): boolean {\n if (isBrowser()) {\n return PLATFORMS_MAP[name](window) || false;\n } else {\n return false;\n }\n }\n\n get screenSize(): AXScreenSizes {\n return (['SM', 'MD', 'LG', 'XL', '2XL', '3XL', '4XL'].find(\n (name) => PLATFORMS_MAP[name](window) == true,\n ) || '5XL') as AXScreenSizes;\n }\n\n switchLightMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'light');\n this.themeMode$.next('light');\n this.themeMode.set('light');\n return 'light';\n }\n\n switchDarkMode() {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n localStorage.setItem('AX_THEME_MODE', 'dark');\n this.themeMode$.next('dark');\n this.themeMode.set('dark');\n return 'dark';\n }\n\n switchSystemMode() {\n if (isBrowser()) {\n if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n localStorage.setItem('AX_THEME_MODE', 'system');\n this.themeMode$.next('system');\n this.themeMode.set('system');\n }\n\n autoDetectThemeMode() {\n const mode = localStorage.getItem('AX_THEME_MODE') || 'system';\n switch (mode) {\n case 'light':\n return this.switchLightMode();\n\n case 'dark':\n return this.switchDarkMode();\n\n case 'system':\n return this.switchSystemMode();\n }\n }\n\n private setFullHeightRatio() {\n if (isBrowser()) {\n try {\n document\n .querySelector<HTMLElement>(':root')\n ?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');\n } catch (error) {\n console.error(error);\n }\n }\n }\n\n private autoSystemModeDetection(event) {\n if (this.themeMode() === 'system') {\n const themeMode = event.matches ? 'dark' : 'light';\n\n if (themeMode === 'dark') {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.add('ax-dark');\n } else {\n const _html = document.getElementsByTagName('html')[0];\n _html.classList.remove('ax-dark');\n }\n }\n }\n\n constructor() {\n if (isBrowser()) {\n this.detectDarkMode();\n this.detectOnResize();\n this.detectClickEvent();\n this.detectScrollEvent();\n this.setFullHeightRatio();\n this.detectDocumentDirectionChange();\n }\n }\n\n private detectDarkMode() {\n // fromEvent(UIEvent)(window,'')\n if (window?.matchMedia('(prefers-color-scheme: dark)').matches) {\n window?.matchMedia('(prefers-color-scheme: dark)')?.addEventListener('change', (event) => {\n // Detect System color mode\n this.autoSystemModeDetection(event);\n });\n }\n }\n\n private detectOnResize() {\n fromEvent<UIEvent>(window, 'resize')\n .pipe(debounceTime(100))\n .pipe(distinctUntilChanged())\n .subscribe((e) => {\n this.resize.next({\n nativeEvent: e,\n source: this,\n });\n //\n this.setFullHeightRatio();\n });\n }\n\n private detectClickEvent() {\n document.addEventListener(\n 'click',\n (e) => {\n this.click.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectScrollEvent() {\n document.addEventListener(\n 'scroll',\n (e) => {\n this.scroll.next({\n nativeEvent: e,\n source: this,\n });\n },\n true,\n );\n }\n\n private detectDocumentDirectionChange() {\n const observer = new MutationObserver((mutations) => {\n mutations.forEach((mutation) => {\n // Detect Direction Change\n if (mutation.attributeName === 'dir') {\n const dir = document.documentElement.getAttribute('dir');\n this.directionChange.next({ source: this, nativeEvent: null, data: dir });\n }\n });\n });\n observer.observe(document.documentElement, {\n attributes: true,\n childList: false,\n characterData: false,\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAWA,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzE,MAAM,SAAS,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAE3E,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AAErE,MAAM,QAAQ,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAEzE,MAAM,OAAO,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAErG,MAAM,MAAM,GAAG,CAAC,GAAW,KAAc,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,aAAa,CAAC,GAAG,EAAE,UAAU,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;IAEO,6BAA6B,GAAA;QACnC,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,CAAC,SAAS,KAAI;AAClD,YAAA,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;;AAE7B,gBAAA,IAAI,QAAQ,CAAC,aAAa,KAAK,KAAK,EAAE;oBACpC,MAAM,GAAG,GAAG,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACzD,oBAAA,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;iBAC3E;AACH,aAAC,CAAC,CAAC;AACL,SAAC,CAAC,CAAC;AACH,QAAA,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;AACzC,YAAA,UAAU,EAAE,IAAI;AAChB,YAAA,SAAS,EAAE,KAAK;AAChB,YAAA,aAAa,EAAE,KAAK;AACrB,SAAA,CAAC,CAAC;KACJ;8GAxLU,UAAU,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAV,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAU,cAFT,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEP,UAAU,EAAA,UAAA,EAAA,CAAA;kBAHtB,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;AC1ID;;AAEG;;;;"}
|
package/package.json
CHANGED
@@ -11,9 +11,11 @@ export declare const isServer: Function;
|
|
11
11
|
export declare class AXPlatformEvent<T extends Event = Event> {
|
12
12
|
nativeEvent: T;
|
13
13
|
source: AXPlatform;
|
14
|
+
data?: any;
|
14
15
|
}
|
15
16
|
export declare class AXPlatform {
|
16
17
|
resize: Subject<AXPlatformEvent>;
|
18
|
+
directionChange: Subject<AXPlatformEvent>;
|
17
19
|
click: Subject<AXPlatformEvent>;
|
18
20
|
scroll: Subject<AXPlatformEvent>;
|
19
21
|
themeMode$: BehaviorSubject<AXThemeMode>;
|
@@ -27,9 +29,14 @@ export declare class AXPlatform {
|
|
27
29
|
switchDarkMode(): string;
|
28
30
|
switchSystemMode(): void;
|
29
31
|
autoDetectThemeMode(): string | void;
|
30
|
-
private
|
32
|
+
private setFullHeightRatio;
|
31
33
|
private autoSystemModeDetection;
|
32
34
|
constructor();
|
35
|
+
private detectDarkMode;
|
36
|
+
private detectOnResize;
|
37
|
+
private detectClickEvent;
|
38
|
+
private detectScrollEvent;
|
39
|
+
private detectDocumentDirectionChange;
|
33
40
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPlatform, never>;
|
34
41
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXPlatform>;
|
35
42
|
}
|