@acorex/cdk 22.1.0-next.31 → 22.1.0-next.32
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/acorex-cdk-accordion.mjs +19 -19
- package/fesm2022/acorex-cdk-carousel.mjs +25 -7
- package/fesm2022/acorex-cdk-carousel.mjs.map +1 -1
- package/fesm2022/acorex-cdk-clipboard.mjs +6 -6
- package/fesm2022/acorex-cdk-common.mjs +169 -93
- package/fesm2022/acorex-cdk-common.mjs.map +1 -1
- package/fesm2022/acorex-cdk-dom.mjs +3 -3
- package/fesm2022/acorex-cdk-drag-drop.mjs +210 -68
- package/fesm2022/acorex-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/acorex-cdk-drawer.mjs +10 -10
- package/fesm2022/acorex-cdk-focus-trap.mjs +3 -3
- package/fesm2022/acorex-cdk-full-screen.mjs +26 -147
- package/fesm2022/acorex-cdk-full-screen.mjs.map +1 -1
- package/fesm2022/acorex-cdk-gesture.mjs +36 -7
- package/fesm2022/acorex-cdk-gesture.mjs.map +1 -1
- package/fesm2022/acorex-cdk-highlight.mjs +108 -0
- package/fesm2022/acorex-cdk-highlight.mjs.map +1 -0
- package/fesm2022/acorex-cdk-horizontal-scroll.mjs +104 -44
- package/fesm2022/acorex-cdk-horizontal-scroll.mjs.map +1 -1
- package/fesm2022/acorex-cdk-input-mask.mjs +3 -3
- package/fesm2022/acorex-cdk-list-navigation.mjs +10 -10
- package/fesm2022/acorex-cdk-outline.mjs +277 -74
- package/fesm2022/acorex-cdk-outline.mjs.map +1 -1
- package/fesm2022/acorex-cdk-overlay.mjs +192 -18
- package/fesm2022/acorex-cdk-overlay.mjs.map +1 -1
- package/fesm2022/acorex-cdk-pan-view.mjs +3 -3
- package/fesm2022/acorex-cdk-resizable.mjs +3 -3
- package/fesm2022/acorex-cdk-selection.mjs +10 -10
- package/fesm2022/acorex-cdk-shimmer.mjs +220 -0
- package/fesm2022/acorex-cdk-shimmer.mjs.map +1 -0
- package/fesm2022/acorex-cdk-sliding-item.mjs +3 -3
- package/fesm2022/acorex-cdk-sticky.mjs +3 -3
- package/fesm2022/acorex-cdk-uploader.mjs +9 -9
- package/fesm2022/acorex-cdk-virtual-scroll.mjs +10 -10
- package/fesm2022/acorex-cdk-z-index.mjs +3 -3
- package/package.json +10 -6
- package/shimmer/README.md +11 -0
- package/types/acorex-cdk-carousel.d.ts +2 -0
- package/types/acorex-cdk-clipboard.d.ts +1 -1
- package/types/acorex-cdk-common.d.ts +36 -19
- package/types/acorex-cdk-drag-drop.d.ts +31 -4
- package/types/acorex-cdk-full-screen.d.ts +18 -43
- package/types/acorex-cdk-gesture.d.ts +13 -1
- package/types/acorex-cdk-highlight.d.ts +54 -0
- package/types/acorex-cdk-horizontal-scroll.d.ts +23 -9
- package/types/acorex-cdk-outline.d.ts +20 -0
- package/types/acorex-cdk-overlay.d.ts +47 -4
- package/types/acorex-cdk-shimmer.d.ts +68 -0
- package/types/acorex-cdk-uploader.d.ts +1 -1
- package/fesm2022/acorex-cdk-double-click.mjs +0 -178
- package/fesm2022/acorex-cdk-double-click.mjs.map +0 -1
- package/types/acorex-cdk-double-click.d.ts +0 -66
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Applies the shimmer text effect to a host element.
|
|
5
|
+
*/
|
|
6
|
+
declare class AXShimmerDirective {
|
|
7
|
+
#private;
|
|
8
|
+
private readonly hostElement;
|
|
9
|
+
private readonly destroyRef;
|
|
10
|
+
private readonly platformId;
|
|
11
|
+
private readonly refresh;
|
|
12
|
+
/**
|
|
13
|
+
* Plays the shimmer animation once instead of looping.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue false
|
|
16
|
+
*/
|
|
17
|
+
once: _angular_core.InputSignal<boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* Reverses the shimmer sweep direction.
|
|
20
|
+
*
|
|
21
|
+
* @defaultValue false
|
|
22
|
+
*/
|
|
23
|
+
reverse: _angular_core.InputSignal<boolean>;
|
|
24
|
+
/**
|
|
25
|
+
* Disables the shimmer effect and renders normal text.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue false
|
|
28
|
+
*/
|
|
29
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Duration of one shimmer sweep in milliseconds.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue 2000
|
|
34
|
+
*/
|
|
35
|
+
duration: _angular_core.InputSignal<number>;
|
|
36
|
+
/**
|
|
37
|
+
* Width of the highlight band. Numbers use the spacing scale; strings accept any CSS length.
|
|
38
|
+
*/
|
|
39
|
+
spread: _angular_core.InputSignal<string | number>;
|
|
40
|
+
/**
|
|
41
|
+
* Tilt of the highlight band in degrees.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue 20
|
|
44
|
+
*/
|
|
45
|
+
angle: _angular_core.InputSignal<number>;
|
|
46
|
+
/**
|
|
47
|
+
* Explicit highlight color. Accepts ACoreX semantic colors (`primary`, `danger`, …) or any CSS color value.
|
|
48
|
+
* Falls back to a tint derived from currentColor when omitted.
|
|
49
|
+
*/
|
|
50
|
+
color: _angular_core.InputSignal<string>;
|
|
51
|
+
constructor();
|
|
52
|
+
private get element();
|
|
53
|
+
private resolveSpread;
|
|
54
|
+
private isSemanticColor;
|
|
55
|
+
private resolveHighlightColor;
|
|
56
|
+
private isDarkMode;
|
|
57
|
+
private isRtl;
|
|
58
|
+
private prefersReducedMotion;
|
|
59
|
+
private buildBackgroundImage;
|
|
60
|
+
private applyShimmerStyles;
|
|
61
|
+
private clearShimmerStyles;
|
|
62
|
+
private restartShimmerAnimation;
|
|
63
|
+
private cancelShimmerAnimation;
|
|
64
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXShimmerDirective, never>;
|
|
65
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXShimmerDirective, "[axShimmer]", never, { "once": { "alias": "once"; "required": false; "isSignal": true; }; "reverse": { "alias": "reverse"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "spread": { "alias": "spread"; "required": false; "isSignal": true; }; "angle": { "alias": "angle"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { AXShimmerDirective };
|
|
@@ -381,7 +381,7 @@ declare class AXUploaderService {
|
|
|
381
381
|
private bindEvents;
|
|
382
382
|
private applyFileTypeValidation;
|
|
383
383
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXUploaderService, never>;
|
|
384
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<
|
|
384
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
385
385
|
}
|
|
386
386
|
|
|
387
387
|
export { AXUploadRequest, AXUploaderBrowseDirective, AXUploaderService, AXUploaderZoneDirective };
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, input, output, Directive } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Directive to detect single-click and double-click events on the host element.
|
|
6
|
-
* Supports both desktop (click-based detection) and mobile (touchend) events.
|
|
7
|
-
* Prevents native click event propagation and emits separate single-click and double-click events.
|
|
8
|
-
* Can be disabled to allow native DOM behavior (click and dblclick events).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* <button
|
|
12
|
-
* axDoubleClick
|
|
13
|
-
* [duration]="300"
|
|
14
|
-
* [disabled]="false"
|
|
15
|
-
* (onClick)="onSingleClick($event)"
|
|
16
|
-
* (onDblClick)="onDoubleClick($event)"
|
|
17
|
-
* >Click me</button>
|
|
18
|
-
*/
|
|
19
|
-
class AXDoubleClickDirective {
|
|
20
|
-
constructor() {
|
|
21
|
-
this.elementRef = inject(ElementRef);
|
|
22
|
-
/**
|
|
23
|
-
* Input to configure the duration in milliseconds for detecting double-clicks.
|
|
24
|
-
* Defaults to 250ms.
|
|
25
|
-
* Two clicks/taps within this duration are considered a double-click.
|
|
26
|
-
*/
|
|
27
|
-
this.duration = input(250, /* @ts-ignore */
|
|
28
|
-
...(ngDevMode ? [{ debugName: "duration" }] : /* istanbul ignore next */ []));
|
|
29
|
-
/**
|
|
30
|
-
* Input to disable the directive's custom click handling.
|
|
31
|
-
* When true, native click and dblclick events will fire normally (DOM default behavior).
|
|
32
|
-
* When false (default), the directive prevents default and emits custom single/double-click events.
|
|
33
|
-
* Defaults to false.
|
|
34
|
-
*/
|
|
35
|
-
this.disabled = input(false, /* @ts-ignore */
|
|
36
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
37
|
-
/**
|
|
38
|
-
* Output event emitted when a single-click is detected.
|
|
39
|
-
* Emits after the configured duration milliseconds if no second click occurs.
|
|
40
|
-
* Emits the MouseEvent.
|
|
41
|
-
*/
|
|
42
|
-
this.onClick = output();
|
|
43
|
-
/**
|
|
44
|
-
* Output event emitted when a double-click is detected.
|
|
45
|
-
* Emits when two clicks occur within the configured duration milliseconds.
|
|
46
|
-
* Emits the Event (MouseEvent for desktop, TouchEvent for mobile).
|
|
47
|
-
*/
|
|
48
|
-
this.onDblClick = output();
|
|
49
|
-
this.lastClick = 0;
|
|
50
|
-
this.lastTap = 0;
|
|
51
|
-
this.clickTimeout = null;
|
|
52
|
-
this.pendingClickEvent = null;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Handles click events and detects both single-clicks and double-clicks.
|
|
56
|
-
* Prevents native click propagation and emits appropriate events.
|
|
57
|
-
* When disabled is true, emits click immediately, still detects double-clicks, and allows native DOM behavior (no preventDefault).
|
|
58
|
-
*/
|
|
59
|
-
handleClick(event) {
|
|
60
|
-
const duration = this.duration();
|
|
61
|
-
const currentTime = new Date().getTime();
|
|
62
|
-
const clickGap = currentTime - this.lastClick;
|
|
63
|
-
// If disabled, emit click immediately and still track for double-click, but don't prevent default
|
|
64
|
-
if (this.disabled()) {
|
|
65
|
-
// Emit single click immediately
|
|
66
|
-
this.onClick.emit(event);
|
|
67
|
-
// Still track for double-click detection
|
|
68
|
-
if (clickGap > 0 && clickGap < duration) {
|
|
69
|
-
// Double-click detected - emit double-click
|
|
70
|
-
if (this.clickTimeout) {
|
|
71
|
-
clearTimeout(this.clickTimeout);
|
|
72
|
-
this.clickTimeout = null;
|
|
73
|
-
}
|
|
74
|
-
if (this.pendingClickEvent) {
|
|
75
|
-
this.pendingClickEvent = null;
|
|
76
|
-
}
|
|
77
|
-
this.onDblClick.emit(event);
|
|
78
|
-
this.lastClick = 0;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
// First click - store it and wait to see if a second click comes
|
|
82
|
-
this.lastClick = currentTime;
|
|
83
|
-
this.pendingClickEvent = event;
|
|
84
|
-
if (this.clickTimeout) {
|
|
85
|
-
clearTimeout(this.clickTimeout);
|
|
86
|
-
}
|
|
87
|
-
// Set timeout to emit double-click if second click occurs within duration
|
|
88
|
-
// Note: We already emitted single-click, so we just track for double-click here
|
|
89
|
-
this.clickTimeout = setTimeout(() => {
|
|
90
|
-
// No double-click detected within duration, reset state
|
|
91
|
-
this.pendingClickEvent = null;
|
|
92
|
-
this.lastClick = 0;
|
|
93
|
-
this.clickTimeout = null;
|
|
94
|
-
}, duration);
|
|
95
|
-
}
|
|
96
|
-
// Don't prevent default - allow native click and dblclick to fire
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
// When enabled, prevent the native click event from propagating
|
|
100
|
-
event.preventDefault();
|
|
101
|
-
event.stopPropagation();
|
|
102
|
-
event.stopImmediatePropagation();
|
|
103
|
-
if (clickGap > 0 && clickGap < duration) {
|
|
104
|
-
// Double-click detected - clear pending single click and emit double-click
|
|
105
|
-
if (this.clickTimeout) {
|
|
106
|
-
clearTimeout(this.clickTimeout);
|
|
107
|
-
this.clickTimeout = null;
|
|
108
|
-
}
|
|
109
|
-
if (this.pendingClickEvent) {
|
|
110
|
-
this.pendingClickEvent = null;
|
|
111
|
-
}
|
|
112
|
-
this.onDblClick.emit(event);
|
|
113
|
-
this.lastClick = 0;
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
// First click - store it and wait to see if a second click comes
|
|
117
|
-
this.lastClick = currentTime;
|
|
118
|
-
this.pendingClickEvent = event;
|
|
119
|
-
if (this.clickTimeout) {
|
|
120
|
-
clearTimeout(this.clickTimeout);
|
|
121
|
-
}
|
|
122
|
-
// Set timeout to emit single-click if no second click occurs
|
|
123
|
-
this.clickTimeout = setTimeout(() => {
|
|
124
|
-
// No double-click detected, emit single-click
|
|
125
|
-
if (this.pendingClickEvent) {
|
|
126
|
-
this.onClick.emit(this.pendingClickEvent);
|
|
127
|
-
this.pendingClickEvent = null;
|
|
128
|
-
}
|
|
129
|
-
this.lastClick = 0;
|
|
130
|
-
this.clickTimeout = null;
|
|
131
|
-
}, duration);
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Handles touchend events (mobile) to detect double-tap.
|
|
136
|
-
* When disabled is true, allows native touch behavior.
|
|
137
|
-
*/
|
|
138
|
-
onTouchEnd(event) {
|
|
139
|
-
// If disabled, let native events fire normally
|
|
140
|
-
if (this.disabled()) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const duration = this.duration();
|
|
144
|
-
const currentTime = new Date().getTime();
|
|
145
|
-
const tapGap = currentTime - this.lastTap;
|
|
146
|
-
if (tapGap > 0 && tapGap < duration) {
|
|
147
|
-
// Detected a double-tap
|
|
148
|
-
this.onDblClick.emit(event);
|
|
149
|
-
event.preventDefault(); // Prevent further default actions
|
|
150
|
-
}
|
|
151
|
-
this.lastTap = currentTime;
|
|
152
|
-
}
|
|
153
|
-
ngOnDestroy() {
|
|
154
|
-
if (this.clickTimeout) {
|
|
155
|
-
clearTimeout(this.clickTimeout);
|
|
156
|
-
this.clickTimeout = null;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDoubleClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
160
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: AXDoubleClickDirective, isStandalone: true, selector: "[axDoubleClick]", inputs: { duration: { classPropertyName: "duration", publicName: "duration", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onClick: "onClick", onDblClick: "onDblClick" }, host: { listeners: { "click": "handleClick($event)", "touchend": "onTouchEnd($event)" } }, ngImport: i0 }); }
|
|
161
|
-
}
|
|
162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDoubleClickDirective, decorators: [{
|
|
163
|
-
type: Directive,
|
|
164
|
-
args: [{
|
|
165
|
-
selector: '[axDoubleClick]',
|
|
166
|
-
host: {
|
|
167
|
-
'(click)': 'handleClick($event)',
|
|
168
|
-
'(touchend)': 'onTouchEnd($event)',
|
|
169
|
-
},
|
|
170
|
-
}]
|
|
171
|
-
}], propDecorators: { duration: [{ type: i0.Input, args: [{ isSignal: true, alias: "duration", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], onDblClick: [{ type: i0.Output, args: ["onDblClick"] }] } });
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Generated bundle index. Do not edit.
|
|
175
|
-
*/
|
|
176
|
-
|
|
177
|
-
export { AXDoubleClickDirective };
|
|
178
|
-
//# sourceMappingURL=acorex-cdk-double-click.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-double-click.mjs","sources":["../../../../packages/cdk/double-click/src/lib/double-click.directive.ts","../../../../packages/cdk/double-click/src/acorex-cdk-double-click.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input, OnDestroy, output } from '@angular/core';\n\n/**\n * Directive to detect single-click and double-click events on the host element.\n * Supports both desktop (click-based detection) and mobile (touchend) events.\n * Prevents native click event propagation and emits separate single-click and double-click events.\n * Can be disabled to allow native DOM behavior (click and dblclick events).\n *\n * Usage:\n * <button\n * axDoubleClick\n * [duration]=\"300\"\n * [disabled]=\"false\"\n * (onClick)=\"onSingleClick($event)\"\n * (onDblClick)=\"onDoubleClick($event)\"\n * >Click me</button>\n */\n@Directive({\n selector: '[axDoubleClick]',\n host: {\n '(click)': 'handleClick($event)',\n '(touchend)': 'onTouchEnd($event)',\n },\n})\nexport class AXDoubleClickDirective implements OnDestroy {\n private elementRef = inject(ElementRef);\n\n /**\n * Input to configure the duration in milliseconds for detecting double-clicks.\n * Defaults to 250ms.\n * Two clicks/taps within this duration are considered a double-click.\n */\n public duration = input<number>(250);\n\n /**\n * Input to disable the directive's custom click handling.\n * When true, native click and dblclick events will fire normally (DOM default behavior).\n * When false (default), the directive prevents default and emits custom single/double-click events.\n * Defaults to false.\n */\n public disabled = input<boolean>(false);\n\n /**\n * Output event emitted when a single-click is detected.\n * Emits after the configured duration milliseconds if no second click occurs.\n * Emits the MouseEvent.\n */\n public onClick = output<MouseEvent>();\n\n /**\n * Output event emitted when a double-click is detected.\n * Emits when two clicks occur within the configured duration milliseconds.\n * Emits the Event (MouseEvent for desktop, TouchEvent for mobile).\n */\n public onDblClick = output<Event>();\n\n private lastClick = 0;\n private lastTap = 0;\n private clickTimeout: ReturnType<typeof setTimeout> | null = null;\n private pendingClickEvent: MouseEvent | null = null;\n\n /**\n * Handles click events and detects both single-clicks and double-clicks.\n * Prevents native click propagation and emits appropriate events.\n * When disabled is true, emits click immediately, still detects double-clicks, and allows native DOM behavior (no preventDefault).\n */\n handleClick(event: MouseEvent): void {\n const duration = this.duration();\n const currentTime = new Date().getTime();\n const clickGap = currentTime - this.lastClick;\n\n // If disabled, emit click immediately and still track for double-click, but don't prevent default\n if (this.disabled()) {\n // Emit single click immediately\n this.onClick.emit(event);\n\n // Still track for double-click detection\n if (clickGap > 0 && clickGap < duration) {\n // Double-click detected - emit double-click\n if (this.clickTimeout) {\n clearTimeout(this.clickTimeout);\n this.clickTimeout = null;\n }\n if (this.pendingClickEvent) {\n this.pendingClickEvent = null;\n }\n this.onDblClick.emit(event);\n this.lastClick = 0;\n } else {\n // First click - store it and wait to see if a second click comes\n this.lastClick = currentTime;\n this.pendingClickEvent = event;\n\n if (this.clickTimeout) {\n clearTimeout(this.clickTimeout);\n }\n\n // Set timeout to emit double-click if second click occurs within duration\n // Note: We already emitted single-click, so we just track for double-click here\n this.clickTimeout = setTimeout(() => {\n // No double-click detected within duration, reset state\n this.pendingClickEvent = null;\n this.lastClick = 0;\n this.clickTimeout = null;\n }, duration);\n }\n\n // Don't prevent default - allow native click and dblclick to fire\n return;\n }\n\n // When enabled, prevent the native click event from propagating\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n\n if (clickGap > 0 && clickGap < duration) {\n // Double-click detected - clear pending single click and emit double-click\n if (this.clickTimeout) {\n clearTimeout(this.clickTimeout);\n this.clickTimeout = null;\n }\n if (this.pendingClickEvent) {\n this.pendingClickEvent = null;\n }\n this.onDblClick.emit(event);\n this.lastClick = 0;\n } else {\n // First click - store it and wait to see if a second click comes\n this.lastClick = currentTime;\n this.pendingClickEvent = event;\n\n if (this.clickTimeout) {\n clearTimeout(this.clickTimeout);\n }\n\n // Set timeout to emit single-click if no second click occurs\n this.clickTimeout = setTimeout(() => {\n // No double-click detected, emit single-click\n if (this.pendingClickEvent) {\n this.onClick.emit(this.pendingClickEvent);\n this.pendingClickEvent = null;\n }\n this.lastClick = 0;\n this.clickTimeout = null;\n }, duration);\n }\n }\n\n /**\n * Handles touchend events (mobile) to detect double-tap.\n * When disabled is true, allows native touch behavior.\n */\n onTouchEnd(event: TouchEvent): void {\n // If disabled, let native events fire normally\n if (this.disabled()) {\n return;\n }\n\n const duration = this.duration();\n const currentTime = new Date().getTime();\n const tapGap = currentTime - this.lastTap;\n\n if (tapGap > 0 && tapGap < duration) {\n // Detected a double-tap\n this.onDblClick.emit(event);\n event.preventDefault(); // Prevent further default actions\n }\n this.lastTap = currentTime;\n }\n\n ngOnDestroy(): void {\n if (this.clickTimeout) {\n clearTimeout(this.clickTimeout);\n this.clickTimeout = null;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;AAcG;MAQU,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;AAQU,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEvC;;;;AAIG;QACI,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAS,GAAG;qFAAC;AAEpC;;;;;AAKG;QACI,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK;qFAAC;AAEvC;;;;AAIG;QACI,IAAA,CAAA,OAAO,GAAG,MAAM,EAAc;AAErC;;;;AAIG;QACI,IAAA,CAAA,UAAU,GAAG,MAAM,EAAS;QAE3B,IAAA,CAAA,SAAS,GAAG,CAAC;QACb,IAAA,CAAA,OAAO,GAAG,CAAC;QACX,IAAA,CAAA,YAAY,GAAyC,IAAI;QACzD,IAAA,CAAA,iBAAiB,GAAsB,IAAI;AAsHpD,IAAA;AApHC;;;;AAIG;AACH,IAAA,WAAW,CAAC,KAAiB,EAAA;AAC3B,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE;QAChC,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;AACxC,QAAA,MAAM,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC,SAAS;;AAG7C,QAAA,I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|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnDestroy } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Directive to detect single-click and double-click events on the host element.
|
|
6
|
-
* Supports both desktop (click-based detection) and mobile (touchend) events.
|
|
7
|
-
* Prevents native click event propagation and emits separate single-click and double-click events.
|
|
8
|
-
* Can be disabled to allow native DOM behavior (click and dblclick events).
|
|
9
|
-
*
|
|
10
|
-
* Usage:
|
|
11
|
-
* <button
|
|
12
|
-
* axDoubleClick
|
|
13
|
-
* [duration]="300"
|
|
14
|
-
* [disabled]="false"
|
|
15
|
-
* (onClick)="onSingleClick($event)"
|
|
16
|
-
* (onDblClick)="onDoubleClick($event)"
|
|
17
|
-
* >Click me</button>
|
|
18
|
-
*/
|
|
19
|
-
declare class AXDoubleClickDirective implements OnDestroy {
|
|
20
|
-
private elementRef;
|
|
21
|
-
/**
|
|
22
|
-
* Input to configure the duration in milliseconds for detecting double-clicks.
|
|
23
|
-
* Defaults to 250ms.
|
|
24
|
-
* Two clicks/taps within this duration are considered a double-click.
|
|
25
|
-
*/
|
|
26
|
-
duration: _angular_core.InputSignal<number>;
|
|
27
|
-
/**
|
|
28
|
-
* Input to disable the directive's custom click handling.
|
|
29
|
-
* When true, native click and dblclick events will fire normally (DOM default behavior).
|
|
30
|
-
* When false (default), the directive prevents default and emits custom single/double-click events.
|
|
31
|
-
* Defaults to false.
|
|
32
|
-
*/
|
|
33
|
-
disabled: _angular_core.InputSignal<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Output event emitted when a single-click is detected.
|
|
36
|
-
* Emits after the configured duration milliseconds if no second click occurs.
|
|
37
|
-
* Emits the MouseEvent.
|
|
38
|
-
*/
|
|
39
|
-
onClick: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
40
|
-
/**
|
|
41
|
-
* Output event emitted when a double-click is detected.
|
|
42
|
-
* Emits when two clicks occur within the configured duration milliseconds.
|
|
43
|
-
* Emits the Event (MouseEvent for desktop, TouchEvent for mobile).
|
|
44
|
-
*/
|
|
45
|
-
onDblClick: _angular_core.OutputEmitterRef<Event>;
|
|
46
|
-
private lastClick;
|
|
47
|
-
private lastTap;
|
|
48
|
-
private clickTimeout;
|
|
49
|
-
private pendingClickEvent;
|
|
50
|
-
/**
|
|
51
|
-
* Handles click events and detects both single-clicks and double-clicks.
|
|
52
|
-
* Prevents native click propagation and emits appropriate events.
|
|
53
|
-
* When disabled is true, emits click immediately, still detects double-clicks, and allows native DOM behavior (no preventDefault).
|
|
54
|
-
*/
|
|
55
|
-
handleClick(event: MouseEvent): void;
|
|
56
|
-
/**
|
|
57
|
-
* Handles touchend events (mobile) to detect double-tap.
|
|
58
|
-
* When disabled is true, allows native touch behavior.
|
|
59
|
-
*/
|
|
60
|
-
onTouchEnd(event: TouchEvent): void;
|
|
61
|
-
ngOnDestroy(): void;
|
|
62
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXDoubleClickDirective, never>;
|
|
63
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXDoubleClickDirective, "[axDoubleClick]", never, { "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; "onDblClick": "onDblClick"; }, never, never, true, never>;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export { AXDoubleClickDirective };
|