@bizy/core 19.17.1 → 19.17.3

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.
@@ -2,8 +2,8 @@ import * as i0 from '@angular/core';
2
2
  import { EventEmitter, ChangeDetectorRef, Output, Input, Inject, ChangeDetectionStrategy, Component, NgModule, inject, Renderer2, ElementRef, Injectable, Directive, ViewChild, ContentChildren, ContentChild, Pipe, ViewContainerRef, TemplateRef, RendererFactory2, HostListener, Host } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT, registerLocaleData, DatePipe } from '@angular/common';
5
- import { Subject, Subscription, BehaviorSubject, filter, take, skip, auditTime, throttleTime, debounceTime as debounceTime$1, interval, fromEvent, merge, timer, of } from 'rxjs';
6
- import { debounceTime, distinctUntilChanged, takeUntil, map, filter as filter$1, switchMap, take as take$1 } from 'rxjs/operators';
5
+ import { Subject, Subscription, BehaviorSubject, filter, take, skip, auditTime, throttleTime, debounceTime as debounceTime$1, interval, fromEvent, merge } from 'rxjs';
6
+ import { debounceTime, distinctUntilChanged, takeUntil, map, filter as filter$1, take as take$1 } from 'rxjs/operators';
7
7
  import * as echarts from 'echarts';
8
8
  import html2canvas from 'html2canvas';
9
9
  import * as i2 from 'angular-calendar';
@@ -7623,44 +7623,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
7623
7623
  }] } });
7624
7624
 
7625
7625
  class BizyLongPressDirective {
7626
- elementRef;
7627
7626
  threshold = 500;
7628
- press = new EventEmitter();
7629
- #event;
7630
- constructor(elementRef) {
7631
- this.elementRef = elementRef;
7632
- const mousedown = fromEvent(this.elementRef.nativeElement, 'mousedown').pipe(filter$1((event) => event.button == 0), // Only allow left button (Primary button)
7633
- map(() => true) // turn on threshold counter
7634
- );
7635
- const touchstart = fromEvent(this.elementRef.nativeElement, 'touchstart').pipe(map(() => true));
7636
- const touchEnd = fromEvent(this.elementRef.nativeElement, 'touchend').pipe(map(() => false));
7637
- const mouseup = fromEvent(window, 'mouseup').pipe(filter$1((event) => event.button == 0), // Only allow left button (Primary button)
7638
- map(() => false) // reset threshold counter
7639
- );
7640
- this.#event = merge(mousedown, mouseup, touchstart, touchEnd)
7641
- .pipe(switchMap(state => (state ? timer(this.threshold, 100) : of(null))), filter$1(value => Boolean(value)))
7642
- .subscribe(() => this.press.emit());
7627
+ bizyLongPress = new EventEmitter();
7628
+ #pressTimeout = null;
7629
+ onPressStart(event) {
7630
+ this.clearTimeout(); // Clear any existing timeout
7631
+ this.#pressTimeout = setTimeout(() => {
7632
+ this.bizyLongPress.emit(event);
7633
+ }, this.threshold);
7643
7634
  }
7644
- ngOnDestroy() {
7645
- if (this.#event) {
7646
- this.#event.unsubscribe();
7635
+ onPressEnd() {
7636
+ this.clearTimeout();
7637
+ }
7638
+ clearTimeout() {
7639
+ if (this.#pressTimeout) {
7640
+ clearTimeout(this.#pressTimeout);
7641
+ this.#pressTimeout = null;
7647
7642
  }
7648
7643
  }
7649
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, deps: [{ token: ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
7650
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.10", type: BizyLongPressDirective, isStandalone: true, selector: "[bizyLongPress]", inputs: { threshold: "threshold" }, outputs: { press: "press" }, ngImport: i0 });
7644
+ ngOnDestroy() {
7645
+ this.clearTimeout();
7646
+ }
7647
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
7648
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.10", type: BizyLongPressDirective, isStandalone: true, selector: "[bizyLongPress]", inputs: { threshold: "threshold" }, outputs: { bizyLongPress: "bizyLongPress" }, host: { listeners: { "mousedown": "onPressStart($event)", "touchstart": "onPressStart($event)", "mouseup": "onPressEnd()", "mouseleave": "onPressEnd()", "touchend": "onPressEnd()", "touchcancel": "onPressEnd()" } }, ngImport: i0 });
7651
7649
  }
7652
7650
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, decorators: [{
7653
7651
  type: Directive,
7654
7652
  args: [{
7655
7653
  selector: '[bizyLongPress]',
7656
7654
  }]
7657
- }], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
7658
- type: Inject,
7659
- args: [ElementRef]
7660
- }] }], propDecorators: { threshold: [{
7655
+ }], propDecorators: { threshold: [{
7661
7656
  type: Input
7662
- }], press: [{
7657
+ }], bizyLongPress: [{
7663
7658
  type: Output
7659
+ }], onPressStart: [{
7660
+ type: HostListener,
7661
+ args: ['mousedown', ['$event']]
7662
+ }, {
7663
+ type: HostListener,
7664
+ args: ['touchstart', ['$event']]
7665
+ }], onPressEnd: [{
7666
+ type: HostListener,
7667
+ args: ['mouseup']
7668
+ }, {
7669
+ type: HostListener,
7670
+ args: ['mouseleave']
7671
+ }, {
7672
+ type: HostListener,
7673
+ args: ['touchend']
7674
+ }, {
7675
+ type: HostListener,
7676
+ args: ['touchcancel']
7664
7677
  }] } });
7665
7678
 
7666
7679
  class BizyOnlyNumbersDirective {