@ts-core/angular 13.1.30 → 13.1.31

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.
@@ -2948,27 +2948,56 @@ 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._scrollValue = element.nativeElement.scrollTop;
2954
- fromEvent(element.nativeElement, 'scroll')
2955
- .pipe(debounceTime(DateUtil.MILISECONDS_SECOND / 10), takeUntil(this.destroyed))
2956
- .subscribe(() => {
2957
- this._scrollValue = element.nativeElement.scrollTop;
2958
- this.check();
2959
- });
2957
+ this.offset = 50;
2958
+ //--------------------------------------------------------------------------
2959
+ //
2960
+ // Protected Methods
2961
+ //
2962
+ //--------------------------------------------------------------------------
2963
+ this.check = () => {
2964
+ let value = this.scrollValue >= this.scrollLimit;
2965
+ if (value !== this.isExceedLimit) {
2966
+ this.isExceedLimit = value;
2967
+ this.limitExceed.emit(this.isExceedLimit);
2968
+ }
2969
+ value = this.scrollValue + this.clientHeight + this.offset > this.scrollHeight;
2970
+ if (value != this.isBottom) {
2971
+ this.bottom.next(value);
2972
+ }
2973
+ value = this.scrollValue < this.offset;
2974
+ if (value != this.isTop) {
2975
+ this.top.next(value);
2976
+ }
2977
+ };
2978
+ this.element = element.nativeElement;
2979
+ fromEvent(this.element, 'scroll')
2980
+ .pipe(debounceTime(DateUtil.MILLISECONDS_SECOND / 10), takeUntil(this.destroyed))
2981
+ .subscribe(this.check);
2960
2982
  }
2961
2983
  //--------------------------------------------------------------------------
2962
2984
  //
2963
- // Protected Methods
2985
+ // Private Properties
2964
2986
  //
2965
2987
  //--------------------------------------------------------------------------
2966
- check() {
2967
- let value = this._scrollValue >= this.scrollLimit;
2968
- if (value !== this.isExceedLimit) {
2969
- this.isExceedLimit = value;
2970
- this.limitExceed.emit(this.isExceedLimit);
2971
- }
2988
+ // --------------------------------------------------------------------------
2989
+ //
2990
+ // Private Properties
2991
+ //
2992
+ // --------------------------------------------------------------------------
2993
+ get scrollValue() {
2994
+ return this.element.scrollTop;
2995
+ }
2996
+ get scrollHeight() {
2997
+ return this.element.scrollHeight;
2998
+ }
2999
+ get clientHeight() {
3000
+ return this.element.clientHeight;
2972
3001
  }
2973
3002
  //--------------------------------------------------------------------------
2974
3003
  //
@@ -2987,14 +3016,20 @@ class ScrollCheckDirective extends DestroyableContainer {
2987
3016
  }
2988
3017
  }
2989
3018
  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 });
3019
+ ScrollCheckDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ScrollCheckDirective, selector: "[vi-scroll-check]", inputs: { offset: "offset", scrollLimit: ["vi-scroll-check", "scrollLimit"] }, outputs: { top: "top", bottom: "bottom", limitExceed: "limitExceed" }, usesInheritance: true, ngImport: i0 });
2991
3020
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ScrollCheckDirective, decorators: [{
2992
3021
  type: Directive,
2993
3022
  args: [{
2994
3023
  selector: '[vi-scroll-check]'
2995
3024
  }]
2996
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { limitExceed: [{
3025
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { top: [{
2997
3026
  type: Output
3027
+ }], bottom: [{
3028
+ type: Output
3029
+ }], limitExceed: [{
3030
+ type: Output
3031
+ }], offset: [{
3032
+ type: Input
2998
3033
  }], scrollLimit: [{
2999
3034
  type: Input,
3000
3035
  args: ['vi-scroll-check']