@acorex/core 18.10.15 → 18.11.0

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) || isAndroidTablet(win) || (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400);
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
- _setFullHeightRatio() {
156
+ setFullHeightRatio() {
155
157
  if (isBrowser()) {
156
158
  try {
157
- document.querySelector(':root')?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
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
- fromEvent(window, 'resize')
185
- .pipe(debounceTime(100))
186
- .pipe(distinctUntilChanged())
187
- .subscribe((e) => {
188
- this.resize.next({
189
- nativeEvent: e,
190
- source: this,
191
- });
192
- //
193
- this._setFullHeightRatio();
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9wbGF0Zm9ybS9zcmMvbGliL3BsYXRmb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLGVBQWUsRUFBRSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sTUFBTSxDQUFDO0FBQzNELE9BQU8sRUFBRSxZQUFZLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQzs7QUFTcEUsTUFBTSxRQUFRLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsU0FBUyxDQUFDLENBQUM7QUFFekUsTUFBTSxTQUFTLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsVUFBVSxDQUFDLENBQUM7QUFFM0UsTUFBTSxNQUFNLEdBQUcsQ0FBQyxHQUFXLEVBQVcsRUFBRSxDQUFDLGFBQWEsQ0FBQyxHQUFHLEVBQUUsT0FB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zLWNvbG9yLXNjaGVtZTogZGFyayknKT8uYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgLy8gRGV0ZWN0IFN5c3RlbSBjb2xvciBtb2RlXG4gICAgICAgICAgdGhpcy5hdXRvU3lzdGVtTW9kZURldGVjdGlvbihldmVudCk7XG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgJ2NsaWNrJyxcbiAgICAgICAgKGUpID0+IHtcbiAgICAgICAgICB0aGlzLmNsaWNrLm5leHQoe1xuICAgICAgICAgICAgbmF0aXZlRXZlbnQ6IGUsXG4gICAgICAgICAgICBzb3VyY2U6IHRoaXMsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHRydWUsXG4gICAgICApO1xuXG4gICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAnc2Nyb2xsJyxcbiAgICAgICAgKGUpID0+IHtcbiAgICAgICAgICB0aGlzLnNjcm9sbC5uZXh0KHtcbiAgICAgICAgICAgIG5hdGl2ZUV2ZW50OiBlLFxuICAgICAgICAgICAgc291cmNlOiB0aGlzLFxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICB0cnVlLFxuICAgICAgKTtcblxuICAgICAgLy8gaW5pdCBmdW5jdGlvbnNcbiAgICAgIHRoaXMuX3NldEZ1bGxIZWlnaHRSYXRpbygpO1xuICAgIH1cbiAgfVxufVxuIl19
260
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhdGZvcm0uc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL2xpYnMvY29yZS9wbGF0Zm9ybS9zcmMvbGliL3BsYXRmb3JtLnNlcnZpY2UudHMiXSwibmFtZXMiOltdL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ic2VydmVyKChtdXRhdGlvbnMpID0+IHtcbiAgICAgIG11dGF0aW9ucy5mb3JFYWNoKChtdXRhdGlvbikgPT4ge1xuICAgICAgICAvLyBEZXRlY3QgRGlyZWN0aW9uIENoYW5nZVxuICAgICAgICBpZiAobXV0YXRpb24uYXR0cmlidXRlTmFtZSA9PT0gJ2RpcicpIHtcbiAgICAgICAgICBjb25zdCBkaXIgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuZ2V0QXR0cmlidXRlKCdkaXInKTtcbiAgICAgICAgICB0aGlzLmRpcmVjdGlvbkNoYW5nZS5uZXh0KHsgc291cmNlOiB0aGlzLCBuYXRpdmVFdmVudDogbnVsbCwgZGF0YTogZGlyIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9KTtcbiAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCwge1xuICAgICAgYXR0cmlidXRlczogdHJ1ZSxcbiAgICAgIGNoaWxkTGlzdDogZmFsc2UsXG4gICAgICBjaGFyYWN0ZXJEYXRhOiBmYWxzZSxcbiAgICB9KTtcbiAgfVxufVxuIl19
@@ -29,5 +29,26 @@ export class AXHtmlUtil {
29
29
  }
30
30
  return false;
31
31
  }
32
+ /**
33
+ * Helper function to check if an element is scrollable
34
+ */
35
+ static isScrollable(element) {
36
+ const overflowY = window.getComputedStyle(element).overflowY;
37
+ return (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;
38
+ }
39
+ /**
40
+ * Utility function to find scrollable parent elements
41
+ */
42
+ static getScrollableParents(element) {
43
+ const parents = [];
44
+ let currentElement = element;
45
+ while (currentElement) {
46
+ if (AXHtmlUtil.isScrollable(currentElement)) {
47
+ parents.push(currentElement);
48
+ }
49
+ currentElement = currentElement.parentElement;
50
+ }
51
+ return parents;
52
+ }
32
53
  }
33
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC11d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sbGFibGUoY3VycmVudEVsZW1lbnQpKSB7XG4gICAgICAgIHBhcmVudHMucHVzaChjdXJyZW50RWxlbWVudCk7XG4gICAgICB9XG4gICAgICBjdXJyZW50RWxlbWVudCA9IGN1cnJlbnRFbGVtZW50LnBhcmVudEVsZW1lbnQ7XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcmVudHM7XG4gIH1cbn1cbiJdfQ==
@@ -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) || isAndroidTablet(win) || (smallest > 460 && smallest < 820 && largest > 780 && largest < 1400);
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
- _setFullHeightRatio() {
157
+ setFullHeightRatio() {
156
158
  if (isBrowser()) {
157
159
  try {
158
- document.querySelector(':root')?.style.setProperty('--ax-vh', window.innerHeight / 100 + 'px');
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
- fromEvent(window, 'resize')
186
- .pipe(debounceTime(100))
187
- .pipe(distinctUntilChanged())
188
- .subscribe((e) => {
189
- this.resize.next({
190
- nativeEvent: e,
191
- source: this,
192
- });
193
- //
194
- this._setFullHeightRatio();
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,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AAE9E,MAAM,MAAM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","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,CAAC,CAAC;AAEvG,MAAM,WAAW,GAAG,CAAC,GAAW,KAAc,QAAQ,CAAC,GAAG,CAAC,IAA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;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;;;;"}
@@ -231,6 +231,27 @@ class AXHtmlUtil {
231
231
  }
232
232
  return false;
233
233
  }
234
+ /**
235
+ * Helper function to check if an element is scrollable
236
+ */
237
+ static isScrollable(element) {
238
+ const overflowY = window.getComputedStyle(element).overflowY;
239
+ return (overflowY === 'auto' || overflowY === 'scroll') && element.scrollHeight > element.clientHeight;
240
+ }
241
+ /**
242
+ * Utility function to find scrollable parent elements
243
+ */
244
+ static getScrollableParents(element) {
245
+ const parents = [];
246
+ let currentElement = element;
247
+ while (currentElement) {
248
+ if (AXHtmlUtil.isScrollable(currentElement)) {
249
+ parents.push(currentElement);
250
+ }
251
+ currentElement = currentElement.parentElement;
252
+ }
253
+ return parents;
254
+ }
234
255
  }
235
256
 
236
257
  // @dynamic
@@ -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 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 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 return false;\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","/**\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,CAAC;AAC/C,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,CAAC;AAC5B,gBAAA,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,UAAU,EAAE;oBAC5C,QAAQ,CAAC,WAAW,EAAE,CAAC;iBACxB;aACF;YACD,IAAI,CAAC,KAAK,EAAE,CAAC;AACf,SAAC,CAAC;AACJ,KAAC,CAAC;AACJ,CAAC;MAGY,cAAc,CAAA;AAD3B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,SAAS,GAAG,IAAI,OAAO,EAAQ,CAAC;AAEjC,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAI,MAAkC,KACvE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;AAU1C,KAAA;IARQ,WAAW,GAAA;AAChB,QAAA,IAAI,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CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;AACpE,QAAA,KAAK,IAAI,cAAc,CAAC,KAAK,CAAC;QAC9B,IAAI,GAAG,GAAG,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC3C,OAAO;YACL,KAAK;YACL,GAAG;SACJ,CAAC;KACH;AACF;;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/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,\n end,\n };\n }\n}\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,CAAC;AAC/C,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,CAAC;AAC5B,gBAAA,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,UAAU,EAAE;oBAC5C,QAAQ,CAAC,WAAW,EAAE,CAAC;iBACxB;aACF;YACD,IAAI,CAAC,KAAK,EAA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HANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "18.10.15",
3
+ "version": "18.11.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.2.0",
6
6
  "@angular/core": ">=18.2.0",
@@ -38,11 +38,11 @@
38
38
  "esm": "./esm2022/config/acorex-core-config.mjs",
39
39
  "default": "./fesm2022/acorex-core-config.mjs"
40
40
  },
41
- "./events": {
42
- "types": "./events/index.d.ts",
43
- "esm2022": "./esm2022/events/acorex-core-events.mjs",
44
- "esm": "./esm2022/events/acorex-core-events.mjs",
45
- "default": "./fesm2022/acorex-core-events.mjs"
41
+ "./format": {
42
+ "types": "./format/index.d.ts",
43
+ "esm2022": "./esm2022/format/acorex-core-format.mjs",
44
+ "esm": "./esm2022/format/acorex-core-format.mjs",
45
+ "default": "./fesm2022/acorex-core-format.mjs"
46
46
  },
47
47
  "./file": {
48
48
  "types": "./file/index.d.ts",
@@ -50,11 +50,11 @@
50
50
  "esm": "./esm2022/file/acorex-core-file.mjs",
51
51
  "default": "./fesm2022/acorex-core-file.mjs"
52
52
  },
53
- "./format": {
54
- "types": "./format/index.d.ts",
55
- "esm2022": "./esm2022/format/acorex-core-format.mjs",
56
- "esm": "./esm2022/format/acorex-core-format.mjs",
57
- "default": "./fesm2022/acorex-core-format.mjs"
53
+ "./events": {
54
+ "types": "./events/index.d.ts",
55
+ "esm2022": "./esm2022/events/acorex-core-events.mjs",
56
+ "esm": "./esm2022/events/acorex-core-events.mjs",
57
+ "default": "./fesm2022/acorex-core-events.mjs"
58
58
  },
59
59
  "./date-time": {
60
60
  "types": "./date-time/index.d.ts",
@@ -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 _setFullHeightRatio;
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
  }
@@ -3,4 +3,12 @@ export declare class AXHtmlUtil {
3
3
  static blurElement(element: HTMLElement): HTMLElement;
4
4
  static hasFocus(element: HTMLElement): boolean;
5
5
  static isRtl(element: HTMLElement): boolean;
6
+ /**
7
+ * Helper function to check if an element is scrollable
8
+ */
9
+ static isScrollable(element: HTMLElement): boolean;
10
+ /**
11
+ * Utility function to find scrollable parent elements
12
+ */
13
+ static getScrollableParents(element: HTMLElement): HTMLElement[];
6
14
  }