@colijnit/corecomponents_v12 12.0.98 → 12.0.99

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.
@@ -10784,10 +10784,9 @@
10784
10784
  var ObserveVisibilityDirective = /** @class */ (function () {
10785
10785
  function ObserveVisibilityDirective(_element) {
10786
10786
  this._element = _element;
10787
- this.debounceTime = 0;
10788
10787
  this.threshold = 0;
10789
- this.visible = new i0.EventEmitter();
10790
- this._subject = new rxjs.Subject();
10788
+ this.visibilityChange = new i0.EventEmitter();
10789
+ this.visible = false;
10791
10790
  }
10792
10791
  ObserveVisibilityDirective.prototype.ngOnInit = function () {
10793
10792
  this._createObserver();
@@ -10800,19 +10799,6 @@
10800
10799
  this._observer.disconnect();
10801
10800
  this._observer = undefined;
10802
10801
  }
10803
- this._subject.next();
10804
- this._subject.complete();
10805
- };
10806
- ObserveVisibilityDirective.prototype._isVisible = function (element) {
10807
- var _this = this;
10808
- return new Promise(function (resolve) {
10809
- var observer = new IntersectionObserver(function (_a) {
10810
- var _b = __read(_a, 1), entry = _b[0];
10811
- resolve(entry.isIntersecting && entry.intersectionRatio >= _this.threshold);
10812
- observer.disconnect();
10813
- });
10814
- observer.observe(element);
10815
- });
10816
10802
  };
10817
10803
  ObserveVisibilityDirective.prototype._createObserver = function () {
10818
10804
  var _this = this;
@@ -10820,58 +10806,33 @@
10820
10806
  rootMargin: '0px',
10821
10807
  threshold: this.threshold,
10822
10808
  };
10823
- var isIntersecting = function (entry) { return entry.isIntersecting || entry.intersectionRatio > 0; };
10824
10809
  this._observer = new IntersectionObserver(function (entries, observer) {
10825
10810
  entries.forEach(function (entry) {
10826
- if (isIntersecting(entry)) {
10827
- _this._subject.next({ entry: entry, observer: observer });
10828
- }
10811
+ _this.visible = entry.isIntersecting || entry.intersectionRatio > 0;
10812
+ _this.visibilityChange.emit(_this.visible);
10829
10813
  });
10830
10814
  }, options);
10831
10815
  };
10832
10816
  ObserveVisibilityDirective.prototype._startObservingElements = function () {
10833
- var _this = this;
10834
10817
  if (!this._observer) {
10835
10818
  return;
10836
10819
  }
10837
10820
  this._observer.observe(this._element.nativeElement);
10838
- this._subject
10839
- .pipe(operators.delay(this.debounceTime), operators.filter(Boolean))
10840
- .subscribe(function (_a) {
10841
- var entry = _a.entry, observer = _a.observer;
10842
- return __awaiter(_this, void 0, void 0, function () {
10843
- var target, isStillVisible;
10844
- return __generator(this, function (_a) {
10845
- switch (_a.label) {
10846
- case 0:
10847
- target = entry.target;
10848
- return [4 /*yield*/, this._isVisible(target)];
10849
- case 1:
10850
- isStillVisible = _a.sent();
10851
- if (isStillVisible) {
10852
- this.visible.emit(target);
10853
- observer.unobserve(target);
10854
- }
10855
- return [2 /*return*/];
10856
- }
10857
- });
10858
- });
10859
- });
10860
10821
  };
10861
10822
  return ObserveVisibilityDirective;
10862
10823
  }());
10863
10824
  ObserveVisibilityDirective.decorators = [
10864
10825
  { type: i0.Directive, args: [{
10865
10826
  selector: '[observeVisibility]',
10827
+ exportAs: 'visibilityObserve'
10866
10828
  },] }
10867
10829
  ];
10868
10830
  ObserveVisibilityDirective.ctorParameters = function () { return [
10869
10831
  { type: i0.ElementRef }
10870
10832
  ]; };
10871
10833
  ObserveVisibilityDirective.propDecorators = {
10872
- debounceTime: [{ type: i0.Input }],
10873
10834
  threshold: [{ type: i0.Input }],
10874
- visible: [{ type: i0.Output }]
10835
+ visibilityChange: [{ type: i0.Output }]
10875
10836
  };
10876
10837
 
10877
10838
  var ObserveVisibilityModule = /** @class */ (function () {
@@ -11162,7 +11123,8 @@
11162
11123
  { type: i0.Component, args: [{
11163
11124
  selector: "co-filter-item",
11164
11125
  template: "\n <div class=\"co-filter-item-header\">\n <co-collapsible\n [headerTitle]=\"placeholder\"\n [expandButtonLast]=\"true\"\n [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"\n [expanded]=\"expanded\"\n [showButton]=\"showButton\"\n [buttonText]=\"filterButtonLabel\"\n (buttonClicked)=\"onButtonClicked()\"\n >\n <div class=\"co-filter-item-collapsable-content\">\n <div class=\"co-filter-item-custom-content\" *ngIf=\"customContent; else collectionContent\"\n (keydown)=\"showButton=true\" (mousedown)=\"showButton=true\">\n <ng-content></ng-content>\n </div>\n <ng-template #collectionContent>\n <div class=\"co-filter-item-collection-content\">\n <co-input-text\n *ngIf=\"collection?.length > 10 || minSearchCharsToLoadCollection\"\n [placeholder]=\"searchPlaceholder\"\n [model]=\"filterText\"\n (modelChange)=\"applyFilter($event)\"\n >\n </co-input-text>\n <div class=\"no-results\" *ngIf=\"filteredCollection?.length === 0\">\n <span [textContent]=\"noResultsLabel\"></span>\n </div>\n <div class=\"co-filter-item-collection-results\">\n <ng-container\n *ngFor=\"let option of filteredCollection; let index = index\">\n <div class=\"co-filter-item-collection-result-item\" *ngIf=\"index < limitTo || showAllResults\">\n <co-input-checkbox *ngIf=\"!singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n [clickableLabel]=\"false\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-checkbox>\n <co-input-radio-button *ngIf=\"singleSelect\"\n [label]=\"option.description\"\n [model]=\"option.checked\"\n (modelChange)=\"handleModelChange(option)\"\n ></co-input-radio-button>\n <div class=\"co-filter-item-amount\" *ngIf=\"option.count\"\n [textContent]=\"option.count.toString() | append: ')' | prepend: ' ('\"\n ></div>\n </div>\n\n </ng-container>\n </div>\n <div class=\"co-filter-show-more-or-less\" *ngIf=\"!showAllResults\">\n <div class=\"co-filter-show-more clickable\"\n *ngIf=\"moreToShow()\">\n <a (click)=\"increaseLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointDown)\"></co-icon>\n <span [textContent]=\"showMoreLabel\"></span>\n </a>\n </div>\n <div class=\"co-filter-show-less clickable\"\n *ngIf=\"lessToShow()\">\n <a (click)=\"setToInitialLimit()\">\n <co-icon [iconData]=\"iconService.getIcon(icons.ArrowPointUp)\"></co-icon>\n <span [textContent]=\"showLessLabel\"></span>\n </a>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n </co-collapsible>\n </div>\n\n ",
11165
- encapsulation: i0.ViewEncapsulation.None
11126
+ encapsulation: i0.ViewEncapsulation.None,
11127
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
11166
11128
  },] }
11167
11129
  ];
11168
11130
  FilterItemComponent.ctorParameters = function () { return [