@acorex/core 18.10.16 → 18.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHRtbC11dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb3JlL3V0aWxzL3NyYy9saWIvaHRtbC11dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVsRCxXQUFXO0FBQ1gsTUFBTSxPQUFPLFVBQVU7SUFDckIsTUFBTSxDQUFDLFlBQVksQ0FBQyxPQUFvQjtRQUN0QyxNQUFNLElBQUksR0FBRyxDQUFDLFFBQVEsRUFBRSxPQUFPLEVBQUUsUUFBUSxFQUFFLFFBQVEsRUFBRSxVQUFVLEVBQUUsWUFBWSxDQUFDLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLEdBQUcsdUJBQXVCLENBQUMsQ0FBQztRQUN2SCxNQUFNLFNBQVMsR0FBRyxPQUFPLENBQUMsYUFBYSxDQUFjLElBQUksQ0FBQyx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yZmxvd1kgPT09ICdzY3JvbGwnKSAmJiBlbGVtZW50LnNjcm9sbEhlaWdodCA+IGVsZW1lbnQuY2xpZW50SGVpZ2h0O1xuICB9XG5cbiAgLyoqXG4gKiBVdGlsaXR5IGZ1bmN0aW9uIHRvIGZpbmQgc2Nyb2xsYWJsZSBwYXJlbnQgZWxlbWVudHNcbiAqL1xuICBzdGF0aWMgZ2V0U2Nyb2xsYWJsZVBhcmVudHMoZWxlbWVudDogSFRNTEVsZW1lbnQpOiBIVE1MRWxlbWVudFtdIHtcbiAgICBjb25zdCBwYXJlbnRzOiBIVE1MRWxlbWVudFtdID0gW107XG4gICAgbGV0IGN1cnJlbnRFbGVtZW50OiBIVE1MRWxlbWVudCB8IG51bGwgPSBlbGVtZW50O1xuXG4gICAgd2hpbGUgKGN1cnJlbnRFbGVtZW50KSB7XG4gICAgICBpZiAoQVhIdG1sVXRpbC5pc1Njcm9sbGFibGUoY3VycmVudEVsZW1lbnQpKSB7XG4gICAgICAgIHBhcmVudHMucHVzaChjdXJyZW50RWxlbWVudCk7XG4gICAgICB9XG4gICAgICBjdXJyZW50RWxlbWVudCA9IGN1cnJlbnRFbGVtZW50LnBhcmVudEVsZW1lbnQ7XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcmVudHM7XG4gIH1cbn1cbiJdfQ==
@@ -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,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;AACtB,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KAC3B;IAEM,WAAW,GAAA;QAChB,IAAI,CAAC,WAAW,EAAE,CAAC;KACpB;8GAbU,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA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J,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,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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AC;QAEjD,OAAO,cAAc,EAAE;AACrB,YAAA,IAAI,UAAU,CAAC,YAAY,CAAC,cAAc,CAAC,EAAE;AAC3C,gBAAA,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAC9B;AACD,YAAA,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;SAC/C;AAED,QAAA,OAAO,OAAO,CAAC;KAChB;AACF;;AC9DD;MACa,YAAY,CAAA;AACvB,IAAA,OAAO,uBAAuB,CAAC,GAAW,EAAE,QAAgB,EAAA;AAC1D,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAChD,QAAA,IAAI,KAAK,GAAG,QAAQ,GAAG,CAAC,CAAC;AAEzB,QAAA,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YACzC,KAAK,IAAI,CAAC,CAAC;SACZ;QACD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAC/B,QAAA,MAAM,cAAc,GAAQ,GAAG,CAAC,KAAK,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;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/core",
3
- "version": "18.10.16",
3
+ "version": "18.11.1",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=18.2.0",
6
6
  "@angular/core": ">=18.2.0",
@@ -38,30 +38,30 @@
38
38
  "esm": "./esm2022/config/acorex-core-config.mjs",
39
39
  "default": "./fesm2022/acorex-core-config.mjs"
40
40
  },
41
- "./date-time": {
42
- "types": "./date-time/index.d.ts",
43
- "esm2022": "./esm2022/date-time/acorex-core-date-time.mjs",
44
- "esm": "./esm2022/date-time/acorex-core-date-time.mjs",
45
- "default": "./fesm2022/acorex-core-date-time.mjs"
46
- },
47
- "./file": {
48
- "types": "./file/index.d.ts",
49
- "esm2022": "./esm2022/file/acorex-core-file.mjs",
50
- "esm": "./esm2022/file/acorex-core-file.mjs",
51
- "default": "./fesm2022/acorex-core-file.mjs"
52
- },
53
41
  "./events": {
54
42
  "types": "./events/index.d.ts",
55
43
  "esm2022": "./esm2022/events/acorex-core-events.mjs",
56
44
  "esm": "./esm2022/events/acorex-core-events.mjs",
57
45
  "default": "./fesm2022/acorex-core-events.mjs"
58
46
  },
47
+ "./date-time": {
48
+ "types": "./date-time/index.d.ts",
49
+ "esm2022": "./esm2022/date-time/acorex-core-date-time.mjs",
50
+ "esm": "./esm2022/date-time/acorex-core-date-time.mjs",
51
+ "default": "./fesm2022/acorex-core-date-time.mjs"
52
+ },
59
53
  "./format": {
60
54
  "types": "./format/index.d.ts",
61
55
  "esm2022": "./esm2022/format/acorex-core-format.mjs",
62
56
  "esm": "./esm2022/format/acorex-core-format.mjs",
63
57
  "default": "./fesm2022/acorex-core-format.mjs"
64
58
  },
59
+ "./file": {
60
+ "types": "./file/index.d.ts",
61
+ "esm2022": "./esm2022/file/acorex-core-file.mjs",
62
+ "esm": "./esm2022/file/acorex-core-file.mjs",
63
+ "default": "./fesm2022/acorex-core-file.mjs"
64
+ },
65
65
  "./image": {
66
66
  "types": "./image/index.d.ts",
67
67
  "esm2022": "./esm2022/image/acorex-core-image.mjs",
@@ -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
  }