@bizy/core 19.17.1 → 19.17.2
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/fesm2022/bizy-core.mjs
CHANGED
|
@@ -7623,43 +7623,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
|
7623
7623
|
}] } });
|
|
7624
7624
|
|
|
7625
7625
|
class BizyLongPressDirective {
|
|
7626
|
-
elementRef;
|
|
7626
|
+
#elementRef = inject(ElementRef);
|
|
7627
7627
|
threshold = 500;
|
|
7628
|
-
|
|
7628
|
+
bizyLongPress = new EventEmitter();
|
|
7629
7629
|
#event;
|
|
7630
|
-
constructor(
|
|
7631
|
-
this.
|
|
7632
|
-
const mousedown = fromEvent(this.elementRef.nativeElement, 'mousedown').pipe(filter$1((event) => event.button == 0), // Only allow left button (Primary button)
|
|
7630
|
+
constructor() {
|
|
7631
|
+
const mousedown = fromEvent(this.#elementRef.nativeElement, 'mousedown').pipe(filter$1((event) => event.button == 0), // Only allow left button (Primary button)
|
|
7633
7632
|
map(() => true) // turn on threshold counter
|
|
7634
7633
|
);
|
|
7635
|
-
const touchstart = fromEvent(this
|
|
7636
|
-
const touchEnd = fromEvent(this
|
|
7634
|
+
const touchstart = fromEvent(this.#elementRef.nativeElement, 'touchstart').pipe(map(() => true));
|
|
7635
|
+
const touchEnd = fromEvent(this.#elementRef.nativeElement, 'touchend').pipe(map(() => false));
|
|
7637
7636
|
const mouseup = fromEvent(window, 'mouseup').pipe(filter$1((event) => event.button == 0), // Only allow left button (Primary button)
|
|
7638
7637
|
map(() => false) // reset threshold counter
|
|
7639
7638
|
);
|
|
7640
7639
|
this.#event = merge(mousedown, mouseup, touchstart, touchEnd)
|
|
7641
7640
|
.pipe(switchMap(state => (state ? timer(this.threshold, 100) : of(null))), filter$1(value => Boolean(value)))
|
|
7642
|
-
.subscribe(() => this.
|
|
7641
|
+
.subscribe(() => this.bizyLongPress.emit());
|
|
7643
7642
|
}
|
|
7644
7643
|
ngOnDestroy() {
|
|
7645
7644
|
if (this.#event) {
|
|
7646
7645
|
this.#event.unsubscribe();
|
|
7647
7646
|
}
|
|
7648
7647
|
}
|
|
7649
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, deps: [
|
|
7650
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.10", type: BizyLongPressDirective, isStandalone: true, selector: "[bizyLongPress]", inputs: { threshold: "threshold" }, outputs: {
|
|
7648
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
7649
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.10", type: BizyLongPressDirective, isStandalone: true, selector: "[bizyLongPress]", inputs: { threshold: "threshold" }, outputs: { bizyLongPress: "bizyLongPress" }, ngImport: i0 });
|
|
7651
7650
|
}
|
|
7652
7651
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: BizyLongPressDirective, decorators: [{
|
|
7653
7652
|
type: Directive,
|
|
7654
7653
|
args: [{
|
|
7655
7654
|
selector: '[bizyLongPress]',
|
|
7656
7655
|
}]
|
|
7657
|
-
}], ctorParameters: () => [
|
|
7658
|
-
type: Inject,
|
|
7659
|
-
args: [ElementRef]
|
|
7660
|
-
}] }], propDecorators: { threshold: [{
|
|
7656
|
+
}], ctorParameters: () => [], propDecorators: { threshold: [{
|
|
7661
7657
|
type: Input
|
|
7662
|
-
}],
|
|
7658
|
+
}], bizyLongPress: [{
|
|
7663
7659
|
type: Output
|
|
7664
7660
|
}] } });
|
|
7665
7661
|
|