@progress/kendo-angular-common 23.3.0-develop.11 → 23.3.0-develop.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1649,40 +1649,92 @@ class PreventableEvent {
|
|
|
1649
1649
|
|
|
1650
1650
|
const canCreateElement = () => isDocumentAvailable() && document.createElement;
|
|
1651
1651
|
const propName = '--kendo-scrollbar-width';
|
|
1652
|
+
let cachedScrollbarWidth = null;
|
|
1653
|
+
let cachedPixelRatio;
|
|
1654
|
+
let cachedRtlScrollLeft = null;
|
|
1652
1655
|
/**
|
|
1653
1656
|
* @hidden
|
|
1654
1657
|
*/
|
|
1655
1658
|
const scrollbarWidth = () => {
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
const
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
document.body.
|
|
1664
|
-
|
|
1665
|
-
|
|
1659
|
+
if (cachedScrollbarWidth === null && canCreateElement()) {
|
|
1660
|
+
cachedPixelRatio = window.devicePixelRatio || 1;
|
|
1661
|
+
const outer = document.createElement('div');
|
|
1662
|
+
const inner = document.createElement('div');
|
|
1663
|
+
outer.style.cssText = 'overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block;width:100px;visibility:hidden';
|
|
1664
|
+
inner.style.cssText = 'width:100%;display:block';
|
|
1665
|
+
outer.appendChild(inner);
|
|
1666
|
+
document.body.appendChild(outer);
|
|
1667
|
+
cachedScrollbarWidth = outer.getBoundingClientRect().width - inner.getBoundingClientRect().width;
|
|
1668
|
+
document.body.removeChild(outer);
|
|
1669
|
+
}
|
|
1670
|
+
return cachedScrollbarWidth;
|
|
1666
1671
|
};
|
|
1667
1672
|
/**
|
|
1668
1673
|
* @hidden
|
|
1669
1674
|
*/
|
|
1670
|
-
|
|
1675
|
+
const rtlScrollLeft = () => {
|
|
1676
|
+
if (cachedRtlScrollLeft === null && canCreateElement()) {
|
|
1677
|
+
const outer = document.createElement('div');
|
|
1678
|
+
outer.style.direction = 'rtl';
|
|
1679
|
+
outer.style.display = 'block';
|
|
1680
|
+
outer.style.clear = 'both';
|
|
1681
|
+
outer.style.width = '100px';
|
|
1682
|
+
outer.style.visibility = 'hidden';
|
|
1683
|
+
outer.style.position = 'absolute';
|
|
1684
|
+
outer.style.left = '-10000px';
|
|
1685
|
+
outer.style.overflow = 'scroll';
|
|
1686
|
+
outer.style.zoom = '1';
|
|
1687
|
+
const inner = document.createElement('div');
|
|
1688
|
+
inner.style.width = '200px';
|
|
1689
|
+
inner.style.height = '1px';
|
|
1690
|
+
outer.append(inner);
|
|
1691
|
+
document.body.appendChild(outer);
|
|
1692
|
+
const initial = outer.scrollLeft;
|
|
1693
|
+
outer.scrollLeft = -1;
|
|
1694
|
+
cachedRtlScrollLeft = outer.scrollLeft < 0 ? outer.scrollLeft : initial;
|
|
1695
|
+
document.body.removeChild(outer);
|
|
1696
|
+
}
|
|
1697
|
+
return cachedRtlScrollLeft;
|
|
1698
|
+
};
|
|
1699
|
+
/**
|
|
1700
|
+
* @hidden
|
|
1701
|
+
*/
|
|
1702
|
+
class ScrollbarService {
|
|
1671
1703
|
changes = new EventEmitter();
|
|
1672
|
-
|
|
1704
|
+
subscription;
|
|
1705
|
+
constructor(ngZone) {
|
|
1673
1706
|
if (typeof window !== 'undefined' && isDocumentAvailable()) {
|
|
1674
1707
|
document.body.style.setProperty(propName, `${scrollbarWidth()}px`);
|
|
1708
|
+
ngZone.runOutsideAngular(() => {
|
|
1709
|
+
this.subscription = fromEvent(window, 'resize').pipe(auditTime(100)).subscribe(() => {
|
|
1710
|
+
if (cachedPixelRatio !== window.devicePixelRatio) {
|
|
1711
|
+
cachedScrollbarWidth = null;
|
|
1712
|
+
document.body.style.setProperty(propName, `${scrollbarWidth()}px`);
|
|
1713
|
+
this.changes.emit();
|
|
1714
|
+
}
|
|
1715
|
+
});
|
|
1716
|
+
});
|
|
1675
1717
|
}
|
|
1676
1718
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1719
|
+
get scrollbarWidth() {
|
|
1720
|
+
return scrollbarWidth();
|
|
1721
|
+
}
|
|
1722
|
+
get rtlScrollLeft() {
|
|
1723
|
+
return rtlScrollLeft();
|
|
1724
|
+
}
|
|
1725
|
+
ngOnDestroy() {
|
|
1726
|
+
this.subscription?.unsubscribe();
|
|
1727
|
+
this.subscription = null;
|
|
1728
|
+
}
|
|
1729
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ScrollbarService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1730
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ScrollbarService, providedIn: 'root' });
|
|
1679
1731
|
}
|
|
1680
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type:
|
|
1732
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ScrollbarService, decorators: [{
|
|
1681
1733
|
type: Injectable,
|
|
1682
1734
|
args: [{
|
|
1683
1735
|
providedIn: 'root'
|
|
1684
1736
|
}]
|
|
1685
|
-
}], ctorParameters: () => [] });
|
|
1737
|
+
}], ctorParameters: () => [{ type: i0.NgZone }] });
|
|
1686
1738
|
|
|
1687
1739
|
/**
|
|
1688
1740
|
* @hidden
|
|
@@ -2037,5 +2089,5 @@ const replaceMessagePlaceholder = (message, name, value) => (message ?? '').repl
|
|
|
2037
2089
|
* Generated bundle index. Do not edit.
|
|
2038
2090
|
*/
|
|
2039
2091
|
|
|
2040
|
-
export { DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent,
|
|
2092
|
+
export { ScrollbarService as BrowserSupportService, DraggableDirective, EventsOutsideAngularDirective, KENDO_ADORNMENTS, KENDO_COMMON, KENDO_DRAGGABLE, KENDO_EVENTS, KENDO_RESIZESENSOR, KENDO_TEMPLATE_CONTEXT, KENDO_TOGGLEBUTTONTABSTOP, KENDO_WATERMARK, KendoInput, Keys, MultiTabStop, PrefixTemplateDirective, PreventableEvent, ResizeBatchService, ResizeCompatService, ResizeObserverService, ResizeSensorComponent, ScrollbarService, SeparatorComponent, SuffixTemplateDirective, TemplateContextDirective, ToggleButtonTabStopDirective, WatermarkOverlayComponent, anyChanged, applyAttributes, areObjectsEqual, closest, closestBySelector, closestInScope, contains, findElement, findFocusable, findFocusableChild, firefoxMaxHeight, focusableSelector, getLicenseMessage, getter, guid, hasClasses, hasFocusableParent, hasObservers, isChanged, isControlRequired, isDocumentAvailable, isFirefox, isFocusable, isFocusableWithTabKey, isObject, isObjectPresent, isPresent, isSafari, isSet, isString, isVisible, matchesClasses, matchesNodeName, normalizeKeys, parseAttributes, parseCSSClassNames, processCssValue, removeHTMLAttributes, replaceMessagePlaceholder, rtlScrollLeft, rtlScrollPosition, scrollbarWidth, setHTMLAttributes, setter, shouldShowValidationUI, splitStringToArray };
|
|
2041
2093
|
|
package/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export * from './utils/setter';
|
|
|
17
17
|
export * from './watermark';
|
|
18
18
|
export * from './adornments';
|
|
19
19
|
export { PreventableEvent } from './preventable-event';
|
|
20
|
-
export {
|
|
20
|
+
export { ScrollbarService, ScrollbarService as BrowserSupportService, scrollbarWidth, rtlScrollLeft } from './utils/scrollbar.service';
|
|
21
21
|
export * from './toggle-button-tab-stop';
|
|
22
22
|
export * from './directives';
|
|
23
23
|
export * from './template-context';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-common",
|
|
3
|
-
"version": "23.3.0-develop.
|
|
3
|
+
"version": "23.3.0-develop.12",
|
|
4
4
|
"description": "Kendo UI for Angular - Utility Package",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@progress/kendo-common": "^1.0.1",
|
|
24
24
|
"@progress/kendo-draggable": "^3.0.2",
|
|
25
25
|
"tslib": "^2.3.1",
|
|
26
|
-
"@progress/kendo-angular-schematics": "23.3.0-develop.
|
|
26
|
+
"@progress/kendo-angular-schematics": "23.3.0-develop.12"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { EventEmitter } from '@angular/core';
|
|
5
|
+
import { EventEmitter, NgZone, OnDestroy } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
@@ -11,9 +11,17 @@ export declare const scrollbarWidth: () => number;
|
|
|
11
11
|
/**
|
|
12
12
|
* @hidden
|
|
13
13
|
*/
|
|
14
|
-
export declare
|
|
14
|
+
export declare const rtlScrollLeft: () => number;
|
|
15
|
+
/**
|
|
16
|
+
* @hidden
|
|
17
|
+
*/
|
|
18
|
+
export declare class ScrollbarService implements OnDestroy {
|
|
15
19
|
changes: EventEmitter<any>;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
private subscription;
|
|
21
|
+
constructor(ngZone: NgZone);
|
|
22
|
+
get scrollbarWidth(): number;
|
|
23
|
+
get rtlScrollLeft(): number;
|
|
24
|
+
ngOnDestroy(): void;
|
|
25
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ScrollbarService, never>;
|
|
26
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ScrollbarService>;
|
|
19
27
|
}
|