@ts-core/angular 13.1.30 → 13.1.33
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.
- package/directive/ScrollCheckDirective.d.ts +12 -3
- package/esm2020/directive/ScrollCheckDirective.mjs +62 -17
- package/fesm2015/ts-core-angular.mjs +61 -16
- package/fesm2015/ts-core-angular.mjs.map +1 -1
- package/fesm2020/ts-core-angular.mjs +61 -16
- package/fesm2020/ts-core-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -2948,27 +2948,64 @@ class ScrollCheckDirective extends DestroyableContainer {
|
|
|
2948
2948
|
// Properties
|
|
2949
2949
|
//
|
|
2950
2950
|
//--------------------------------------------------------------------------
|
|
2951
|
+
this.top = new EventEmitter();
|
|
2952
|
+
this.bottom = new EventEmitter();
|
|
2951
2953
|
this.limitExceed = new EventEmitter();
|
|
2954
|
+
this.isTop = false;
|
|
2955
|
+
this.isBottom = false;
|
|
2952
2956
|
this.isExceedLimit = false;
|
|
2953
|
-
this.
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2957
|
+
this.delay = DateUtil.MILLISECONDS_SECOND / 10;
|
|
2958
|
+
this.offset = 50;
|
|
2959
|
+
//--------------------------------------------------------------------------
|
|
2960
|
+
//
|
|
2961
|
+
// Protected Methods
|
|
2962
|
+
//
|
|
2963
|
+
//--------------------------------------------------------------------------
|
|
2964
|
+
this.check = () => {
|
|
2965
|
+
let value = this.scrollValue >= this.scrollLimit;
|
|
2966
|
+
if (value !== this.isExceedLimit) {
|
|
2967
|
+
this.isExceedLimit = value;
|
|
2968
|
+
this.limitExceed.emit(value);
|
|
2969
|
+
}
|
|
2970
|
+
value = this.scrollValue + this.clientHeight + this.offset > this.scrollHeight;
|
|
2971
|
+
this.bottom.next(value);
|
|
2972
|
+
/*
|
|
2973
|
+
if (value !== this.isBottom) {
|
|
2974
|
+
this.isBottom = value;
|
|
2975
|
+
this.bottom.next(value);
|
|
2976
|
+
}
|
|
2977
|
+
*/
|
|
2978
|
+
value = this.scrollValue < this.offset;
|
|
2979
|
+
this.top.next(value);
|
|
2980
|
+
/*
|
|
2981
|
+
if (value !== this.isTop) {
|
|
2982
|
+
this.isTop = value;
|
|
2983
|
+
this.top.next(value);
|
|
2984
|
+
}
|
|
2985
|
+
*/
|
|
2986
|
+
};
|
|
2987
|
+
this.delay = DateUtil.MILLISECONDS_SECOND / 10;
|
|
2988
|
+
this.element = element.nativeElement;
|
|
2989
|
+
fromEvent(this.element, 'scroll').pipe(debounceTime(this.delay), takeUntil(this.destroyed)).subscribe(this.check);
|
|
2960
2990
|
}
|
|
2961
2991
|
//--------------------------------------------------------------------------
|
|
2962
2992
|
//
|
|
2963
|
-
//
|
|
2993
|
+
// Private Properties
|
|
2964
2994
|
//
|
|
2965
2995
|
//--------------------------------------------------------------------------
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2996
|
+
// --------------------------------------------------------------------------
|
|
2997
|
+
//
|
|
2998
|
+
// Private Properties
|
|
2999
|
+
//
|
|
3000
|
+
// --------------------------------------------------------------------------
|
|
3001
|
+
get scrollValue() {
|
|
3002
|
+
return this.element.scrollTop;
|
|
3003
|
+
}
|
|
3004
|
+
get scrollHeight() {
|
|
3005
|
+
return this.element.scrollHeight;
|
|
3006
|
+
}
|
|
3007
|
+
get clientHeight() {
|
|
3008
|
+
return this.element.clientHeight;
|
|
2972
3009
|
}
|
|
2973
3010
|
//--------------------------------------------------------------------------
|
|
2974
3011
|
//
|
|
@@ -2987,14 +3024,22 @@ class ScrollCheckDirective extends DestroyableContainer {
|
|
|
2987
3024
|
}
|
|
2988
3025
|
}
|
|
2989
3026
|
ScrollCheckDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollCheckDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2990
|
-
ScrollCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ScrollCheckDirective, selector: "[vi-scroll-check]", inputs: { scrollLimit: ["vi-scroll-check", "scrollLimit"] }, outputs: { limitExceed: "limitExceed" }, usesInheritance: true, ngImport: i0 });
|
|
3027
|
+
ScrollCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ScrollCheckDirective, selector: "[vi-scroll-check]", inputs: { delay: "delay", offset: "offset", scrollLimit: ["vi-scroll-check", "scrollLimit"] }, outputs: { top: "top", bottom: "bottom", limitExceed: "limitExceed" }, usesInheritance: true, ngImport: i0 });
|
|
2991
3028
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollCheckDirective, decorators: [{
|
|
2992
3029
|
type: Directive,
|
|
2993
3030
|
args: [{
|
|
2994
3031
|
selector: '[vi-scroll-check]'
|
|
2995
3032
|
}]
|
|
2996
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: {
|
|
3033
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { top: [{
|
|
2997
3034
|
type: Output
|
|
3035
|
+
}], bottom: [{
|
|
3036
|
+
type: Output
|
|
3037
|
+
}], limitExceed: [{
|
|
3038
|
+
type: Output
|
|
3039
|
+
}], delay: [{
|
|
3040
|
+
type: Input
|
|
3041
|
+
}], offset: [{
|
|
3042
|
+
type: Input
|
|
2998
3043
|
}], scrollLimit: [{
|
|
2999
3044
|
type: Input,
|
|
3000
3045
|
args: ['vi-scroll-check']
|