@acorex/cdk 21.0.2-next.5 → 21.0.2-next.50
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 +35 -35
- package/fesm2022/acorex-cdk-accordion.mjs.map +1 -1
- package/fesm2022/acorex-cdk-carousel.mjs +4 -4
- package/fesm2022/acorex-cdk-carousel.mjs.map +1 -1
- package/fesm2022/acorex-cdk-clipboard.mjs +7 -7
- package/fesm2022/acorex-cdk-clipboard.mjs.map +1 -1
- package/fesm2022/acorex-cdk-common.mjs +102 -103
- package/fesm2022/acorex-cdk-common.mjs.map +1 -1
- package/fesm2022/acorex-cdk-dom.mjs +3 -3
- package/fesm2022/acorex-cdk-double-click.mjs +5 -5
- package/fesm2022/acorex-cdk-double-click.mjs.map +1 -1
- package/fesm2022/acorex-cdk-drag-drop.mjs +68 -68
- package/fesm2022/acorex-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/acorex-cdk-drawer.mjs +35 -35
- package/fesm2022/acorex-cdk-drawer.mjs.map +1 -1
- package/fesm2022/acorex-cdk-focus-trap.mjs +19 -19
- package/fesm2022/acorex-cdk-focus-trap.mjs.map +1 -1
- package/fesm2022/acorex-cdk-full-screen.mjs +4 -4
- package/fesm2022/acorex-cdk-full-screen.mjs.map +1 -1
- package/fesm2022/acorex-cdk-horizontal-scroll.mjs +136 -0
- package/fesm2022/acorex-cdk-horizontal-scroll.mjs.map +1 -0
- package/fesm2022/acorex-cdk-input-mask.mjs +19 -13
- package/fesm2022/acorex-cdk-input-mask.mjs.map +1 -1
- package/fesm2022/acorex-cdk-list-navigation.mjs +17 -17
- package/fesm2022/acorex-cdk-list-navigation.mjs.map +1 -1
- package/fesm2022/acorex-cdk-outline.mjs +77 -66
- package/fesm2022/acorex-cdk-outline.mjs.map +1 -1
- package/fesm2022/acorex-cdk-overlay.mjs +17 -13
- package/fesm2022/acorex-cdk-overlay.mjs.map +1 -1
- package/fesm2022/acorex-cdk-pan-view.mjs +67 -49
- package/fesm2022/acorex-cdk-pan-view.mjs.map +1 -1
- package/fesm2022/acorex-cdk-resizable.mjs +46 -22
- package/fesm2022/acorex-cdk-resizable.mjs.map +1 -1
- package/fesm2022/acorex-cdk-selection.mjs +21 -21
- package/fesm2022/acorex-cdk-selection.mjs.map +1 -1
- package/fesm2022/acorex-cdk-sliding-item.mjs +11 -11
- package/fesm2022/acorex-cdk-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-cdk-sticky.mjs +3 -3
- package/fesm2022/acorex-cdk-uploader.mjs +298 -188
- package/fesm2022/acorex-cdk-uploader.mjs.map +1 -1
- package/fesm2022/acorex-cdk-virtual-scroll.mjs +17 -17
- package/fesm2022/acorex-cdk-virtual-scroll.mjs.map +1 -1
- package/fesm2022/acorex-cdk-wysiwyg.mjs +1 -1
- package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
- package/fesm2022/acorex-cdk-z-index.mjs +4 -4
- package/fesm2022/acorex-cdk-z-index.mjs.map +1 -1
- package/horizontal-scroll/README.md +5 -0
- package/package.json +7 -2
- package/types/acorex-cdk-common.d.ts +1 -1
- package/types/acorex-cdk-drawer.d.ts +2 -0
- package/types/acorex-cdk-focus-trap.d.ts +2 -3
- package/types/acorex-cdk-horizontal-scroll.d.ts +44 -0
- package/types/acorex-cdk-input-mask.d.ts +1 -0
- package/types/acorex-cdk-outline.d.ts +1 -0
- package/types/acorex-cdk-overlay.d.ts +1 -0
- package/types/acorex-cdk-pan-view.d.ts +4 -0
- package/types/acorex-cdk-resizable.d.ts +2 -0
- package/types/acorex-cdk-uploader.d.ts +120 -110
|
@@ -9,50 +9,35 @@ class AXPanViewDirective {
|
|
|
9
9
|
this.render = inject(Renderer2);
|
|
10
10
|
this.document = inject(DOCUMENT);
|
|
11
11
|
this.el = inject((ElementRef));
|
|
12
|
-
this.startX = signal(0, ...(ngDevMode ? [{ debugName: "startX" }] : []));
|
|
13
|
-
this.startY = signal(0, ...(ngDevMode ? [{ debugName: "startY" }] : []));
|
|
14
|
-
this.pointerDown = signal(false, ...(ngDevMode ? [{ debugName: "pointerDown" }] : []));
|
|
15
|
-
this.wrapper = signal(null, ...(ngDevMode ? [{ debugName: "wrapper" }] : []));
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
12
|
+
this.startX = signal(0, ...(ngDevMode ? [{ debugName: "startX" }] : /* istanbul ignore next */ []));
|
|
13
|
+
this.startY = signal(0, ...(ngDevMode ? [{ debugName: "startY" }] : /* istanbul ignore next */ []));
|
|
14
|
+
this.pointerDown = signal(false, ...(ngDevMode ? [{ debugName: "pointerDown" }] : /* istanbul ignore next */ []));
|
|
15
|
+
this.wrapper = signal(null, ...(ngDevMode ? [{ debugName: "wrapper" }] : /* istanbul ignore next */ []));
|
|
16
|
+
this.wheelListener = (e) => this.handleWheel(e);
|
|
17
|
+
this.zoomStep = input(7, ...(ngDevMode ? [{ debugName: "zoomStep" }] : /* istanbul ignore next */ []));
|
|
18
|
+
this.minZoom = input(25, ...(ngDevMode ? [{ debugName: "minZoom" }] : /* istanbul ignore next */ []));
|
|
19
|
+
this.maxZoom = input(400, ...(ngDevMode ? [{ debugName: "maxZoom" }] : /* istanbul ignore next */ []));
|
|
20
|
+
this.freeMode = input(false, ...(ngDevMode ? [{ debugName: "freeMode" }] : /* istanbul ignore next */ []));
|
|
21
|
+
this.fitContent = input(true, ...(ngDevMode ? [{ debugName: "fitContent" }] : /* istanbul ignore next */ []));
|
|
22
|
+
this.disablePan = input(false, ...(ngDevMode ? [{ debugName: "disablePan" }] : /* istanbul ignore next */ []));
|
|
23
|
+
this.disableZoom = input(false, ...(ngDevMode ? [{ debugName: "disableZoom" }] : /* istanbul ignore next */ []));
|
|
24
|
+
this.wrapperClasses = input('', ...(ngDevMode ? [{ debugName: "wrapperClasses" }] : /* istanbul ignore next */ []));
|
|
25
|
+
this.panX = model(0, ...(ngDevMode ? [{ debugName: "panX" }] : /* istanbul ignore next */ []));
|
|
26
|
+
this.panY = model(0, ...(ngDevMode ? [{ debugName: "panY" }] : /* istanbul ignore next */ []));
|
|
27
|
+
this.zoom = model(100, ...(ngDevMode ? [{ debugName: "zoom" }] : /* istanbul ignore next */ []));
|
|
27
28
|
this.zoomChange = output();
|
|
28
29
|
this.positionChange = output();
|
|
29
|
-
this.nativeEl = computed(() => this.el.nativeElement, ...(ngDevMode ? [{ debugName: "nativeEl" }] : []));
|
|
30
|
-
this.initialWidth = linkedSignal(() => this.nativeEl().getBoundingClientRect().width, ...(ngDevMode ? [{ debugName: "initialWidth" }] : []));
|
|
31
|
-
this.initialHeight = linkedSignal(() => this.nativeEl().getBoundingClientRect().height, ...(ngDevMode ? [{ debugName: "initialHeight" }] : []));
|
|
30
|
+
this.nativeEl = computed(() => this.el.nativeElement, ...(ngDevMode ? [{ debugName: "nativeEl" }] : /* istanbul ignore next */ []));
|
|
31
|
+
this.initialWidth = linkedSignal(() => this.nativeEl().getBoundingClientRect().width, ...(ngDevMode ? [{ debugName: "initialWidth" }] : /* istanbul ignore next */ []));
|
|
32
|
+
this.initialHeight = linkedSignal(() => this.nativeEl().getBoundingClientRect().height, ...(ngDevMode ? [{ debugName: "initialHeight" }] : /* istanbul ignore next */ []));
|
|
32
33
|
this.#anr = afterNextRender(() => {
|
|
33
34
|
// Create Wrapper
|
|
34
35
|
this.createWrapper();
|
|
35
36
|
this.zone.runOutsideAngular(() => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.handleZoomChange(e);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
else if (e.shiftKey) {
|
|
44
|
-
if (this.disablePan())
|
|
45
|
-
return;
|
|
46
|
-
this.panX.update((prev) => prev - e.deltaY / 3);
|
|
47
|
-
this.setElementPosition();
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
if (this.disablePan())
|
|
51
|
-
return;
|
|
52
|
-
this.panY.update((prev) => prev - e.deltaY / 3);
|
|
53
|
-
this.setElementPosition();
|
|
54
|
-
}
|
|
55
|
-
};
|
|
37
|
+
const wrapper = this.wrapper();
|
|
38
|
+
if (!wrapper)
|
|
39
|
+
return;
|
|
40
|
+
wrapper.addEventListener('wheel', this.wheelListener, { passive: false });
|
|
56
41
|
// Pointer Down Event
|
|
57
42
|
this.wrapper().onpointerdown = (e) => this.handlePointerDown(e);
|
|
58
43
|
// Pointer Move Event
|
|
@@ -70,10 +55,13 @@ class AXPanViewDirective {
|
|
|
70
55
|
});
|
|
71
56
|
});
|
|
72
57
|
}
|
|
58
|
+
static { this.WHEEL_PAN_FACTOR = 1 / 3; }
|
|
73
59
|
#anr;
|
|
74
60
|
ngOnDestroy() {
|
|
75
|
-
if (isPlatformBrowser(this.platformId))
|
|
76
|
-
|
|
61
|
+
if (!isPlatformBrowser(this.platformId))
|
|
62
|
+
return;
|
|
63
|
+
this.wrapper()?.removeEventListener('wheel', this.wheelListener);
|
|
64
|
+
this.resizeObserver?.disconnect();
|
|
77
65
|
}
|
|
78
66
|
createWrapper() {
|
|
79
67
|
this.wrapper.set(this.render.createElement('div'));
|
|
@@ -120,10 +108,38 @@ class AXPanViewDirective {
|
|
|
120
108
|
this.pointerDown.set(false);
|
|
121
109
|
this.wrapper().style.cursor = 'auto';
|
|
122
110
|
}
|
|
111
|
+
handleWheel(e) {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
if (this.freeMode()) {
|
|
114
|
+
this.handleZoomChange(e);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (e.ctrlKey) {
|
|
118
|
+
this.handleZoomChange(e);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (this.disablePan())
|
|
122
|
+
return;
|
|
123
|
+
const delta = this.getWheelDelta(e, e.shiftKey);
|
|
124
|
+
this.zone.run(() => {
|
|
125
|
+
if (e.shiftKey) {
|
|
126
|
+
this.panX.update((prev) => prev - delta * AXPanViewDirective.WHEEL_PAN_FACTOR);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
this.panY.update((prev) => prev - delta * AXPanViewDirective.WHEEL_PAN_FACTOR);
|
|
130
|
+
}
|
|
131
|
+
this.setElementPosition();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
getWheelDelta(e, horizontal) {
|
|
135
|
+
if (horizontal) {
|
|
136
|
+
return e.deltaX !== 0 ? e.deltaX : e.deltaY;
|
|
137
|
+
}
|
|
138
|
+
return e.deltaY !== 0 ? e.deltaY : e.deltaX;
|
|
139
|
+
}
|
|
123
140
|
handleZoomChange(e) {
|
|
124
141
|
if (this.disableZoom())
|
|
125
142
|
return;
|
|
126
|
-
e.preventDefault();
|
|
127
143
|
const rect = this.nativeEl().getBoundingClientRect();
|
|
128
144
|
const mouseX = e.clientX - rect.left;
|
|
129
145
|
const mouseY = e.clientY - rect.top;
|
|
@@ -131,11 +147,13 @@ class AXPanViewDirective {
|
|
|
131
147
|
const zoomDirection = e.deltaY > 0 ? -1 : 1; // Scroll up -> zoom in, scroll down -> zoom out
|
|
132
148
|
const newZoom = Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + zoomDirection * this.zoomStep())));
|
|
133
149
|
const scaleChange = newZoom / this.zoom();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
150
|
+
this.zone.run(() => {
|
|
151
|
+
// Adjust pan to keep zoom centered at the mouse position
|
|
152
|
+
this.panX.update((prev) => prev - (mouseX - rect.width / 2) * (scaleChange - 1));
|
|
153
|
+
this.panY.update((prev) => prev - (mouseY - rect.height / 2) * (scaleChange - 1));
|
|
154
|
+
this.zoom.set(newZoom);
|
|
155
|
+
this.setElementPosition();
|
|
156
|
+
});
|
|
139
157
|
}
|
|
140
158
|
sizeChanged() {
|
|
141
159
|
const prevWidth = this.initialWidth();
|
|
@@ -182,10 +200,10 @@ class AXPanViewDirective {
|
|
|
182
200
|
this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() - this.zoomStep()))));
|
|
183
201
|
this.setElementPosition();
|
|
184
202
|
}
|
|
185
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
186
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
203
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPanViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
204
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: AXPanViewDirective, isStandalone: true, selector: "[axPanView]", inputs: { zoomStep: { classPropertyName: "zoomStep", publicName: "zoomStep", isSignal: true, isRequired: false, transformFunction: null }, minZoom: { classPropertyName: "minZoom", publicName: "minZoom", isSignal: true, isRequired: false, transformFunction: null }, maxZoom: { classPropertyName: "maxZoom", publicName: "maxZoom", isSignal: true, isRequired: false, transformFunction: null }, freeMode: { classPropertyName: "freeMode", publicName: "freeMode", isSignal: true, isRequired: false, transformFunction: null }, fitContent: { classPropertyName: "fitContent", publicName: "fitContent", isSignal: true, isRequired: false, transformFunction: null }, disablePan: { classPropertyName: "disablePan", publicName: "disablePan", isSignal: true, isRequired: false, transformFunction: null }, disableZoom: { classPropertyName: "disableZoom", publicName: "disableZoom", isSignal: true, isRequired: false, transformFunction: null }, wrapperClasses: { classPropertyName: "wrapperClasses", publicName: "wrapperClasses", isSignal: true, isRequired: false, transformFunction: null }, panX: { classPropertyName: "panX", publicName: "panX", isSignal: true, isRequired: false, transformFunction: null }, panY: { classPropertyName: "panY", publicName: "panY", isSignal: true, isRequired: false, transformFunction: null }, zoom: { classPropertyName: "zoom", publicName: "zoom", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { panX: "panXChange", panY: "panYChange", zoom: "zoomChange", zoomChange: "zoomChange", positionChange: "positionChange" }, exportAs: ["axPanView"], ngImport: i0 }); }
|
|
187
205
|
}
|
|
188
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPanViewDirective, decorators: [{
|
|
189
207
|
type: Directive,
|
|
190
208
|
args: [{
|
|
191
209
|
selector: '[axPanView]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-pan-view.mjs","sources":["../../../../packages/cdk/pan-view/src/lib/pan-view.directive.ts","../../../../packages/cdk/pan-view/src/acorex-cdk-pan-view.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n Renderer2,\n signal,\n} from '@angular/core';\n\n@Directive({\n selector: '[axPanView]',\n exportAs: 'axPanView',\n})\nexport class AXPanViewDirective implements OnDestroy {\n private resizeObserver: ResizeObserver;\n\n private platformId = inject(PLATFORM_ID);\n private zone = inject(NgZone);\n private render = inject(Renderer2);\n private document = inject(DOCUMENT);\n private el = inject(ElementRef<HTMLElement>);\n\n private startX = signal(0);\n private startY = signal(0);\n private pointerDown = signal(false);\n private wrapper = signal<HTMLDivElement | null>(null);\n\n zoomStep = input(7);\n minZoom = input(25);\n maxZoom = input(400);\n freeMode = input(false);\n fitContent = input(true);\n disablePan = input(false);\n disableZoom = input(false);\n wrapperClasses = input('');\n\n panX = model(0);\n panY = model(0);\n zoom = model(100);\n\n zoomChange = output<number>();\n positionChange = output<{ x: number; y: number }>();\n\n private nativeEl = computed(() => this.el.nativeElement as HTMLElement);\n\n private initialWidth = linkedSignal(() => this.nativeEl().getBoundingClientRect().width);\n private initialHeight = linkedSignal(() => this.nativeEl().getBoundingClientRect().height);\n\n #anr = afterNextRender(() => {\n // Create Wrapper\n this.createWrapper();\n this.zone.runOutsideAngular(() => {\n // Wheel Event\n this.wrapper().onwheel = (e) => {\n e.preventDefault();\n if (e.ctrlKey || this.freeMode()) {\n this.handleZoomChange(e);\n return;\n } else if (e.shiftKey) {\n if (this.disablePan()) return;\n this.panX.update((prev) => prev - e.deltaY / 3);\n this.setElementPosition();\n } else {\n if (this.disablePan()) return;\n this.panY.update((prev) => prev - e.deltaY / 3);\n this.setElementPosition();\n }\n };\n // Pointer Down Event\n this.wrapper().onpointerdown = (e) => this.handlePointerDown(e);\n // Pointer Move Event\n this.document.onpointermove = (e) => this.handlePointerMove(e);\n // Pointer Up/Leave Event\n this.document.onpointerup = (e) => this.handlePointerUp(e);\n\n if (isPlatformBrowser(this.platformId)) {\n this.resizeObserver = new ResizeObserver(() => this.sizeChanged());\n this.resizeObserver.observe(this.wrapper());\n this.resizeObserver.observe(this.nativeEl());\n }\n });\n setTimeout(() => {\n this.resetPosition();\n });\n });\n\n ngOnDestroy(): void {\n if (isPlatformBrowser(this.platformId)) this.resizeObserver.disconnect();\n }\n\n private createWrapper() {\n this.wrapper.set(this.render.createElement('div'));\n this.render.addClass(this.wrapper(), 'ax-pan-view-wrapper');\n if (this.wrapperClasses()) this.render.addClass(this.wrapper(), this.wrapperClasses());\n\n const parent = this.nativeEl().parentNode;\n this.render.appendChild(this.wrapper(), this.nativeEl());\n this.render.insertBefore(parent, this.wrapper(), this.nativeEl().nextSibling);\n\n this.render.setStyle(this.wrapper(), 'width', '100%');\n this.render.setStyle(this.wrapper(), 'height', '100%');\n this.render.setStyle(this.wrapper(), 'overflow', 'hidden');\n this.render.setStyle(this.wrapper(), 'position', 'relative');\n\n this.render.setStyle(this.nativeEl(), 'top', '0');\n this.render.setStyle(this.nativeEl(), 'left', '0');\n this.render.setStyle(this.nativeEl(), 'position', 'absolute');\n }\n\n private handlePointerDown(e: PointerEvent) {\n if (this.disablePan()) return;\n if (!this.freeMode() && e.pointerType === 'mouse' && e.buttons !== 4) return;\n if (this.freeMode() && e.pointerType === 'mouse' && e.buttons !== 1) return;\n e.preventDefault();\n this.pointerDown.set(true);\n this.wrapper().style.cursor = 'grabbing';\n\n // Update previous position for next move\n this.startX.set(e.clientX - this.panX());\n this.startY.set(e.clientY - this.panY());\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (!this.pointerDown() || this.disablePan()) return;\n e.preventDefault();\n this.panX.set(e.clientX - this.startX());\n this.panY.set(e.clientY - this.startY());\n\n this.setElementPosition();\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (!this.pointerDown() || this.disablePan()) return;\n e.preventDefault();\n this.pointerDown.set(false);\n this.wrapper().style.cursor = 'auto';\n }\n\n private handleZoomChange(e: WheelEvent) {\n if (this.disableZoom()) return;\n\n e.preventDefault();\n\n const rect = this.nativeEl().getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const mouseY = e.clientY - rect.top;\n\n // Calculate the new zoom based on step\n const zoomDirection = e.deltaY > 0 ? -1 : 1; // Scroll up -> zoom in, scroll down -> zoom out\n const newZoom = Math.round(\n Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + zoomDirection * this.zoomStep())),\n );\n\n const scaleChange = newZoom / this.zoom();\n\n // Adjust pan to keep zoom centered at the mouse position\n this.panX.update((prev) => prev - (mouseX - rect.width / 2) * (scaleChange - 1));\n this.panY.update((prev) => prev - (mouseY - rect.height / 2) * (scaleChange - 1));\n this.zoom.set(newZoom);\n\n this.setElementPosition();\n }\n\n private sizeChanged() {\n const prevWidth = this.initialWidth();\n const prevHeight = this.initialHeight();\n\n this.initialWidth.set((this.nativeEl().getBoundingClientRect().width * 100) / this.zoom());\n this.initialHeight.set((this.nativeEl().getBoundingClientRect().height * 100) / this.zoom());\n\n const newWidth = this.initialWidth();\n const newHeight = this.initialHeight();\n\n // Maintain the same relative position\n this.panX.update((prev) => prev - (newWidth - prevWidth) / 2);\n this.panY.update((prev) => prev - (newHeight - prevHeight) / 2);\n\n this.setElementPosition();\n }\n\n private setFitContentScale() {\n if (!this.fitContent()) return;\n const height = this.wrapper().clientHeight / this.nativeEl().clientHeight;\n const width = this.wrapper().clientWidth / this.nativeEl().clientWidth;\n this.zoom.set(Math.round(Math.min(height, width) * 100));\n }\n\n setElementPosition() {\n this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px) scale(${this.zoom() / 100})`;\n\n this.positionChange.emit({ x: this.panX(), y: this.panY() });\n this.zoomChange.emit(this.zoom());\n }\n\n resetPosition() {\n const containerWidth = this.wrapper().offsetWidth;\n const containerHeight = this.wrapper().offsetHeight;\n\n const boxLeft = (containerWidth - this.initialWidth()) / 2;\n const boxTop = (containerHeight - this.initialHeight()) / 2;\n\n this.panX.set(boxLeft);\n this.panY.set(boxTop);\n\n if (this.fitContent()) this.setFitContentScale();\n else this.zoom.set(100);\n\n this.setElementPosition();\n }\n\n zoomIn() {\n this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + this.zoomStep()))));\n this.setElementPosition();\n }\n\n zoomOut() {\n this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() - this.zoomStep()))));\n this.setElementPosition();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,kBAAkB,CAAA;AAJ/B,IAAA,WAAA,GAAA;AAOU,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1B,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,EAAE,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ACtB,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-pan-view.mjs","sources":["../../../../packages/cdk/pan-view/src/lib/pan-view.directive.ts","../../../../packages/cdk/pan-view/src/acorex-cdk-pan-view.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n afterNextRender,\n computed,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n linkedSignal,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n Renderer2,\n signal,\n} from '@angular/core';\n\n@Directive({\n selector: '[axPanView]',\n exportAs: 'axPanView',\n})\nexport class AXPanViewDirective implements OnDestroy {\n private resizeObserver: ResizeObserver;\n\n private platformId = inject(PLATFORM_ID);\n private zone = inject(NgZone);\n private render = inject(Renderer2);\n private document = inject(DOCUMENT);\n private el = inject(ElementRef<HTMLElement>);\n\n private startX = signal(0);\n private startY = signal(0);\n private pointerDown = signal(false);\n private wrapper = signal<HTMLDivElement | null>(null);\n private readonly wheelListener = (e: WheelEvent) => this.handleWheel(e);\n\n private static readonly WHEEL_PAN_FACTOR = 1 / 3;\n\n zoomStep = input(7);\n minZoom = input(25);\n maxZoom = input(400);\n freeMode = input(false);\n fitContent = input(true);\n disablePan = input(false);\n disableZoom = input(false);\n wrapperClasses = input('');\n\n panX = model(0);\n panY = model(0);\n zoom = model(100);\n\n zoomChange = output<number>();\n positionChange = output<{ x: number; y: number }>();\n\n private nativeEl = computed(() => this.el.nativeElement as HTMLElement);\n\n private initialWidth = linkedSignal(() => this.nativeEl().getBoundingClientRect().width);\n private initialHeight = linkedSignal(() => this.nativeEl().getBoundingClientRect().height);\n\n #anr = afterNextRender(() => {\n // Create Wrapper\n this.createWrapper();\n this.zone.runOutsideAngular(() => {\n const wrapper = this.wrapper();\n if (!wrapper) return;\n wrapper.addEventListener('wheel', this.wheelListener, { passive: false });\n // Pointer Down Event\n this.wrapper().onpointerdown = (e) => this.handlePointerDown(e);\n // Pointer Move Event\n this.document.onpointermove = (e) => this.handlePointerMove(e);\n // Pointer Up/Leave Event\n this.document.onpointerup = (e) => this.handlePointerUp(e);\n\n if (isPlatformBrowser(this.platformId)) {\n this.resizeObserver = new ResizeObserver(() => this.sizeChanged());\n this.resizeObserver.observe(this.wrapper());\n this.resizeObserver.observe(this.nativeEl());\n }\n });\n setTimeout(() => {\n this.resetPosition();\n });\n });\n\n ngOnDestroy(): void {\n if (!isPlatformBrowser(this.platformId)) return;\n this.wrapper()?.removeEventListener('wheel', this.wheelListener);\n this.resizeObserver?.disconnect();\n }\n\n private createWrapper() {\n this.wrapper.set(this.render.createElement('div'));\n this.render.addClass(this.wrapper(), 'ax-pan-view-wrapper');\n if (this.wrapperClasses()) this.render.addClass(this.wrapper(), this.wrapperClasses());\n\n const parent = this.nativeEl().parentNode;\n this.render.appendChild(this.wrapper(), this.nativeEl());\n this.render.insertBefore(parent, this.wrapper(), this.nativeEl().nextSibling);\n\n this.render.setStyle(this.wrapper(), 'width', '100%');\n this.render.setStyle(this.wrapper(), 'height', '100%');\n this.render.setStyle(this.wrapper(), 'overflow', 'hidden');\n this.render.setStyle(this.wrapper(), 'position', 'relative');\n\n this.render.setStyle(this.nativeEl(), 'top', '0');\n this.render.setStyle(this.nativeEl(), 'left', '0');\n this.render.setStyle(this.nativeEl(), 'position', 'absolute');\n }\n\n private handlePointerDown(e: PointerEvent) {\n if (this.disablePan()) return;\n if (!this.freeMode() && e.pointerType === 'mouse' && e.buttons !== 4) return;\n if (this.freeMode() && e.pointerType === 'mouse' && e.buttons !== 1) return;\n e.preventDefault();\n this.pointerDown.set(true);\n this.wrapper().style.cursor = 'grabbing';\n\n // Update previous position for next move\n this.startX.set(e.clientX - this.panX());\n this.startY.set(e.clientY - this.panY());\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (!this.pointerDown() || this.disablePan()) return;\n e.preventDefault();\n this.panX.set(e.clientX - this.startX());\n this.panY.set(e.clientY - this.startY());\n\n this.setElementPosition();\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (!this.pointerDown() || this.disablePan()) return;\n e.preventDefault();\n this.pointerDown.set(false);\n this.wrapper().style.cursor = 'auto';\n }\n\n private handleWheel(e: WheelEvent) {\n e.preventDefault();\n\n if (this.freeMode()) {\n this.handleZoomChange(e);\n return;\n }\n\n if (e.ctrlKey) {\n this.handleZoomChange(e);\n return;\n }\n\n if (this.disablePan()) return;\n\n const delta = this.getWheelDelta(e, e.shiftKey);\n this.zone.run(() => {\n if (e.shiftKey) {\n this.panX.update((prev) => prev - delta * AXPanViewDirective.WHEEL_PAN_FACTOR);\n } else {\n this.panY.update((prev) => prev - delta * AXPanViewDirective.WHEEL_PAN_FACTOR);\n }\n this.setElementPosition();\n });\n }\n\n private getWheelDelta(e: WheelEvent, horizontal: boolean): number {\n if (horizontal) {\n return e.deltaX !== 0 ? e.deltaX : e.deltaY;\n }\n return e.deltaY !== 0 ? e.deltaY : e.deltaX;\n }\n\n private handleZoomChange(e: WheelEvent) {\n if (this.disableZoom()) return;\n\n const rect = this.nativeEl().getBoundingClientRect();\n const mouseX = e.clientX - rect.left;\n const mouseY = e.clientY - rect.top;\n\n // Calculate the new zoom based on step\n const zoomDirection = e.deltaY > 0 ? -1 : 1; // Scroll up -> zoom in, scroll down -> zoom out\n const newZoom = Math.round(\n Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + zoomDirection * this.zoomStep())),\n );\n\n const scaleChange = newZoom / this.zoom();\n\n this.zone.run(() => {\n // Adjust pan to keep zoom centered at the mouse position\n this.panX.update((prev) => prev - (mouseX - rect.width / 2) * (scaleChange - 1));\n this.panY.update((prev) => prev - (mouseY - rect.height / 2) * (scaleChange - 1));\n this.zoom.set(newZoom);\n this.setElementPosition();\n });\n }\n\n private sizeChanged() {\n const prevWidth = this.initialWidth();\n const prevHeight = this.initialHeight();\n\n this.initialWidth.set((this.nativeEl().getBoundingClientRect().width * 100) / this.zoom());\n this.initialHeight.set((this.nativeEl().getBoundingClientRect().height * 100) / this.zoom());\n\n const newWidth = this.initialWidth();\n const newHeight = this.initialHeight();\n\n // Maintain the same relative position\n this.panX.update((prev) => prev - (newWidth - prevWidth) / 2);\n this.panY.update((prev) => prev - (newHeight - prevHeight) / 2);\n\n this.setElementPosition();\n }\n\n private setFitContentScale() {\n if (!this.fitContent()) return;\n const height = this.wrapper().clientHeight / this.nativeEl().clientHeight;\n const width = this.wrapper().clientWidth / this.nativeEl().clientWidth;\n this.zoom.set(Math.round(Math.min(height, width) * 100));\n }\n\n setElementPosition() {\n this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px) scale(${this.zoom() / 100})`;\n\n this.positionChange.emit({ x: this.panX(), y: this.panY() });\n this.zoomChange.emit(this.zoom());\n }\n\n resetPosition() {\n const containerWidth = this.wrapper().offsetWidth;\n const containerHeight = this.wrapper().offsetHeight;\n\n const boxLeft = (containerWidth - this.initialWidth()) / 2;\n const boxTop = (containerHeight - this.initialHeight()) / 2;\n\n this.panX.set(boxLeft);\n this.panY.set(boxTop);\n\n if (this.fitContent()) this.setFitContentScale();\n else this.zoom.set(100);\n\n this.setElementPosition();\n }\n\n zoomIn() {\n this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + this.zoomStep()))));\n this.setElementPosition();\n }\n\n zoomOut() {\n this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() - this.zoomStep()))));\n this.setElementPosition();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAuBa,kBAAkB,CAAA;AAJ/B,IAAA,WAAA,GAAA;AAOU,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAChC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1B,QAAA,IAAA,CAAA,QAAQ,GAAG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,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,IAAA,EAAA,YAAA,EAAA,IAAA,EAAA,YAAA,EAAA,IAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,cAAA,EAAA,gBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,WAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACtB,iBAAA;;;ACtBD;;AAEG;;;;"}
|
|
@@ -2,7 +2,7 @@ import { AXPlatform } from '@acorex/core/platform';
|
|
|
2
2
|
import { AXHtmlUtil } from '@acorex/core/utils';
|
|
3
3
|
import { isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject, ElementRef, NgZone, DOCUMENT, PLATFORM_ID, signal, model, output, Directive } from '@angular/core';
|
|
5
|
+
import { inject, ElementRef, NgZone, DOCUMENT, PLATFORM_ID, signal, model, output, effect, Directive } from '@angular/core';
|
|
6
6
|
import { Subscription } from 'rxjs';
|
|
7
7
|
|
|
8
8
|
class AXResizableDirective {
|
|
@@ -12,7 +12,7 @@ class AXResizableDirective {
|
|
|
12
12
|
this.zone = inject(NgZone);
|
|
13
13
|
this.document = inject(DOCUMENT);
|
|
14
14
|
this.platformID = inject(PLATFORM_ID);
|
|
15
|
-
this.isResizing = signal(false, ...(ngDevMode ? [{ debugName: "isResizing" }] : []));
|
|
15
|
+
this.isResizing = signal(false, ...(ngDevMode ? [{ debugName: "isResizing" }] : /* istanbul ignore next */ []));
|
|
16
16
|
this.initialElementWidth = 0;
|
|
17
17
|
this.startMoveWidth = 0;
|
|
18
18
|
this.subscriptions = new Subscription();
|
|
@@ -35,24 +35,24 @@ class AXResizableDirective {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
/** Define if directive is active or not */
|
|
38
|
-
this.axResizable = model(true, ...(ngDevMode ? [{ debugName: "axResizable" }] : []));
|
|
38
|
+
this.axResizable = model(true, ...(ngDevMode ? [{ debugName: "axResizable" }] : /* istanbul ignore next */ []));
|
|
39
39
|
/** Minimum width for the resizable element. */
|
|
40
|
-
this.minWidth = model(100, ...(ngDevMode ? [{ debugName: "minWidth" }] : []));
|
|
40
|
+
this.minWidth = model(100, ...(ngDevMode ? [{ debugName: "minWidth" }] : /* istanbul ignore next */ []));
|
|
41
41
|
/** Maximum width for the resizable element. Defaults to parent width if not provided. */
|
|
42
|
-
this.maxWidth = model(Infinity, ...(ngDevMode ? [{ debugName: "maxWidth" }] : []));
|
|
42
|
+
this.maxWidth = model(Infinity, ...(ngDevMode ? [{ debugName: "maxWidth" }] : /* istanbul ignore next */ []));
|
|
43
43
|
/** Behavior on double-click: 'reset' or 'maximize'. */
|
|
44
|
-
this.dblClickAction = model('reset', ...(ngDevMode ? [{ debugName: "dblClickAction" }] : []));
|
|
44
|
+
this.dblClickAction = model('reset', ...(ngDevMode ? [{ debugName: "dblClickAction" }] : /* istanbul ignore next */ []));
|
|
45
45
|
/** Define initial width for the element. */
|
|
46
|
-
this.width = model(null, ...(ngDevMode ? [{ debugName: "width" }] : []));
|
|
46
|
+
this.width = model(null, ...(ngDevMode ? [{ debugName: "width" }] : /* istanbul ignore next */ []));
|
|
47
47
|
/** Define reset width for the element. */
|
|
48
|
-
this.defaultWidth = model(null, ...(ngDevMode ? [{ debugName: "defaultWidth" }] : []));
|
|
48
|
+
this.defaultWidth = model(null, ...(ngDevMode ? [{ debugName: "defaultWidth" }] : /* istanbul ignore next */ []));
|
|
49
49
|
/** Event emitted when resizing starts. */
|
|
50
50
|
this.onResizingStarted = output();
|
|
51
51
|
/** Event emitted when resizing ends. */
|
|
52
52
|
this.onResizingEnded = output();
|
|
53
53
|
/** Event emitted on double-click. */
|
|
54
54
|
this.onResizingDblClick = output();
|
|
55
|
-
this.isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement), ...(ngDevMode ? [{ debugName: "isRTL" }] : []));
|
|
55
|
+
this.isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement), ...(ngDevMode ? [{ debugName: "isRTL" }] : /* istanbul ignore next */ []));
|
|
56
56
|
this.isBrowser = isPlatformBrowser(this.platformID);
|
|
57
57
|
this.hostElement = this.el.nativeElement;
|
|
58
58
|
this.subscriptions.add(this.platformService.directionChange.subscribe((i) => {
|
|
@@ -61,15 +61,23 @@ class AXResizableDirective {
|
|
|
61
61
|
this.updateHandlePosition();
|
|
62
62
|
}
|
|
63
63
|
}));
|
|
64
|
+
if (this.isBrowser) {
|
|
65
|
+
effect(() => {
|
|
66
|
+
if (this.isResizing()) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const resolvedWidth = this.width() ?? this.defaultWidth();
|
|
70
|
+
if (resolvedWidth !== null) {
|
|
71
|
+
this.applyElementWidth(resolvedWidth);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
64
75
|
}
|
|
65
76
|
ngAfterViewInit() {
|
|
66
77
|
if (!this.isBrowser)
|
|
67
78
|
return;
|
|
68
79
|
this.initialElementWidth = this.hostElement.offsetWidth;
|
|
69
|
-
|
|
70
|
-
if (initialWidth !== null) {
|
|
71
|
-
this.hostElement.style.width = `${initialWidth}px`;
|
|
72
|
-
}
|
|
80
|
+
this.applyWidthFromModel();
|
|
73
81
|
if (this.maxWidth() === Infinity) {
|
|
74
82
|
const parentWidth = this.hostElement.parentElement?.offsetWidth;
|
|
75
83
|
if (parentWidth) {
|
|
@@ -91,14 +99,29 @@ class AXResizableDirective {
|
|
|
91
99
|
setupResizableState() {
|
|
92
100
|
this.subscriptions.add(this.axResizable.subscribe((isActive) => {
|
|
93
101
|
if (!isActive) {
|
|
94
|
-
this.
|
|
102
|
+
this.applyWidthFromModel();
|
|
95
103
|
this.cleanupEventListeners();
|
|
96
104
|
}
|
|
97
105
|
else {
|
|
106
|
+
this.applyWidthFromModel();
|
|
98
107
|
this.createResizeHandle();
|
|
99
108
|
}
|
|
100
109
|
}));
|
|
101
110
|
}
|
|
111
|
+
applyWidthFromModel() {
|
|
112
|
+
const width = this.width();
|
|
113
|
+
if (width !== null) {
|
|
114
|
+
this.applyElementWidth(width);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const defaultWidth = this.defaultWidth();
|
|
118
|
+
if (defaultWidth !== null) {
|
|
119
|
+
this.applyElementWidth(defaultWidth);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
applyElementWidth(width) {
|
|
123
|
+
this.hostElement.style.width = `${width}px`;
|
|
124
|
+
}
|
|
102
125
|
createResizeHandle() {
|
|
103
126
|
if (!this.axResizable() || this.resizeHandle)
|
|
104
127
|
return;
|
|
@@ -201,11 +224,11 @@ class AXResizableDirective {
|
|
|
201
224
|
onMouseUp() {
|
|
202
225
|
if (!this.isResizing() || !this.resizeHandle)
|
|
203
226
|
return;
|
|
204
|
-
this.isResizing.set(false);
|
|
205
227
|
this.document.body.style.cursor = '';
|
|
206
228
|
this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;
|
|
207
229
|
const currentWidth = this.hostElement.offsetWidth;
|
|
208
230
|
this.zone.run(() => {
|
|
231
|
+
this.width.set(currentWidth);
|
|
209
232
|
this.onResizingEnded.emit({
|
|
210
233
|
component: this,
|
|
211
234
|
htmlElement: this.hostElement,
|
|
@@ -215,6 +238,7 @@ class AXResizableDirective {
|
|
|
215
238
|
oldValue: this.startMoveWidth,
|
|
216
239
|
});
|
|
217
240
|
});
|
|
241
|
+
this.isResizing.set(false);
|
|
218
242
|
}
|
|
219
243
|
onMouseEnter() {
|
|
220
244
|
if (!this.isResizing() && this.resizeHandle) {
|
|
@@ -257,21 +281,21 @@ class AXResizableDirective {
|
|
|
257
281
|
resetToInitialWidth() {
|
|
258
282
|
const defaultWidth = this.defaultWidth();
|
|
259
283
|
if (defaultWidth !== null) {
|
|
260
|
-
this.
|
|
284
|
+
this.applyElementWidth(defaultWidth);
|
|
261
285
|
return defaultWidth;
|
|
262
286
|
}
|
|
263
287
|
const initialWidth = this.width();
|
|
264
288
|
if (initialWidth !== null) {
|
|
265
|
-
this.
|
|
289
|
+
this.applyElementWidth(initialWidth);
|
|
266
290
|
return initialWidth;
|
|
267
291
|
}
|
|
268
|
-
this.
|
|
292
|
+
this.applyElementWidth(this.initialElementWidth);
|
|
269
293
|
return this.initialElementWidth;
|
|
270
294
|
}
|
|
271
295
|
maximizeToMaxWidth() {
|
|
272
296
|
const maxWidth = this.maxWidth();
|
|
273
297
|
if (maxWidth !== Infinity) {
|
|
274
|
-
this.
|
|
298
|
+
this.applyElementWidth(maxWidth);
|
|
275
299
|
}
|
|
276
300
|
return maxWidth;
|
|
277
301
|
}
|
|
@@ -279,10 +303,10 @@ class AXResizableDirective {
|
|
|
279
303
|
this.hostElement.style.width = 'fit-content';
|
|
280
304
|
return this.hostElement.clientWidth;
|
|
281
305
|
}
|
|
282
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
283
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.
|
|
306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXResizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
307
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: AXResizableDirective, isStandalone: true, selector: "[axResizable]", inputs: { axResizable: { classPropertyName: "axResizable", publicName: "axResizable", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, dblClickAction: { classPropertyName: "dblClickAction", publicName: "dblClickAction", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, defaultWidth: { classPropertyName: "defaultWidth", publicName: "defaultWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { axResizable: "axResizableChange", minWidth: "minWidthChange", maxWidth: "maxWidthChange", dblClickAction: "dblClickActionChange", width: "widthChange", defaultWidth: "defaultWidthChange", onResizingStarted: "onResizingStarted", onResizingEnded: "onResizingEnded", onResizingDblClick: "onResizingDblClick" }, ngImport: i0 }); }
|
|
284
308
|
}
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXResizableDirective, decorators: [{
|
|
286
310
|
type: Directive,
|
|
287
311
|
args: [{
|
|
288
312
|
selector: '[axResizable]',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-resizable.mjs","sources":["../../../../packages/cdk/resizable/src/lib/resize.directive.ts","../../../../packages/cdk/resizable/src/acorex-cdk-resizable.ts"],"sourcesContent":["import { AXPlatform } from '@acorex/core/platform';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewInit,\n Directive,\n DOCUMENT,\n ElementRef,\n inject,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\n@Directive({\n selector: '[axResizable]',\n})\nexport class AXResizableDirective implements AfterViewInit, OnDestroy {\n private readonly el = inject(ElementRef);\n private readonly platformService = inject(AXPlatform);\n private readonly zone = inject(NgZone);\n private readonly document = inject(DOCUMENT);\n private readonly platformID = inject(PLATFORM_ID);\n private readonly isBrowser: boolean;\n \n private hostElement!: HTMLElement;\n private resizeHandle?: HTMLElement;\n private isResizing: WritableSignal<boolean> = signal(false);\n private initialElementWidth = 0;\n private startMoveWidth = 0;\n private subscriptions = new Subscription();\n \n // Bound event handlers to maintain reference for cleanup\n private readonly boundMouseDown = this.onMouseDown.bind(this);\n private readonly boundMouseMove = this.onMouseMove.bind(this);\n private readonly boundMouseUp = this.onMouseUp.bind(this);\n private readonly boundMouseEnter = this.onMouseEnter.bind(this);\n private readonly boundMouseLeave = this.onMouseLeave.bind(this);\n private readonly boundDoubleClick = this.onDoubleClick.bind(this);\n \n private readonly resizeObserver = new ResizeObserver((entries) => {\n const parentElement = this.hostElement.parentElement;\n if (!parentElement) return;\n \n for (const entry of entries) {\n if (entry.target === parentElement && this.maxWidth() === Infinity) {\n this.maxWidth.set(entry.contentRect.width);\n break;\n }\n }\n });\n\n /** Define if directive is active or not */\n axResizable = model(true);\n\n /** Minimum width for the resizable element. */\n minWidth = model(100);\n\n /** Maximum width for the resizable element. Defaults to parent width if not provided. */\n maxWidth = model(Infinity);\n\n /** Behavior on double-click: 'reset' or 'maximize'. */\n dblClickAction = model<'reset' | 'maximize' | 'fit'>('reset');\n\n /** Define initial width for the element. */\n width = model<null | number>(null);\n\n /** Define reset width for the element. */\n defaultWidth = model<null | number>(null);\n\n /** Event emitted when resizing starts. */\n onResizingStarted = output<AXValueChangedEvent<number>>();\n\n /** Event emitted when resizing ends. */\n onResizingEnded = output<AXValueChangedEvent<number>>();\n\n /** Event emitted on double-click. */\n onResizingDblClick = output<AXValueChangedEvent<number>>();\n\n constructor() {\n this.isBrowser = isPlatformBrowser(this.platformID);\n this.hostElement = this.el.nativeElement as HTMLElement;\n \n this.subscriptions.add(\n this.platformService.directionChange.subscribe((i) => {\n this.isRTL.set(i.data === 'rtl');\n if (this.resizeHandle) {\n this.updateHandlePosition();\n }\n })\n );\n }\n\n ngAfterViewInit(): void {\n if (!this.isBrowser) return;\n \n this.initialElementWidth = this.hostElement.offsetWidth;\n\n const initialWidth = this.width();\n if (initialWidth !== null) {\n this.hostElement.style.width = `${initialWidth}px`;\n }\n\n if (this.maxWidth() === Infinity) {\n const parentWidth = this.hostElement.parentElement?.offsetWidth;\n if (parentWidth) {\n this.maxWidth.set(parentWidth);\n }\n }\n \n const parentElement = this.hostElement.parentElement;\n if (parentElement) {\n this.resizeObserver.observe(parentElement);\n }\n \n this.createResizeHandle();\n this.setupResizableState();\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n this.resizeObserver.disconnect();\n this.cleanupEventListeners();\n }\n\n private setupResizableState(): void {\n this.subscriptions.add(\n this.axResizable.subscribe((isActive) => {\n if (!isActive) {\n this.resetToInitialWidth();\n this.cleanupEventListeners();\n } else {\n this.createResizeHandle();\n }\n })\n );\n }\n\n private createResizeHandle(): void {\n if (!this.axResizable() || this.resizeHandle) return;\n\n this.hostElement.style.position = 'relative';\n\n this.resizeHandle = this.document.createElement('div');\n this.resizeHandle.classList.add('ax-resizable-handler');\n this.hostElement.appendChild(this.resizeHandle);\n\n this.applyHandleStyles();\n this.attachEventListeners();\n }\n \n private applyHandleStyles(): void {\n if (!this.resizeHandle) return;\n \n Object.assign(this.resizeHandle.style, {\n width: STYLES.handlerWidth,\n backgroundColor: STYLES.backgroundColor,\n position: 'absolute',\n top: '0',\n bottom: '0',\n cursor: STYLES.cursor,\n zIndex: STYLES.zIndex,\n transition: STYLES.transition,\n borderRadius: STYLES.borderRadius,\n userSelect: 'none',\n });\n \n this.updateHandlePosition();\n }\n \n private updateHandlePosition(): void {\n if (!this.resizeHandle) return;\n \n const isRTL = this.isRTL();\n if (isRTL) {\n this.resizeHandle.style.left = '0';\n this.resizeHandle.style.right = '';\n } else {\n this.resizeHandle.style.right = '0';\n this.resizeHandle.style.left = '';\n }\n }\n \n private attachEventListeners(): void {\n if (!this.resizeHandle) return;\n \n const handle = this.resizeHandle;\n this.zone.runOutsideAngular(() => {\n handle.addEventListener('mousedown', this.boundMouseDown);\n handle.addEventListener('mouseenter', this.boundMouseEnter);\n handle.addEventListener('mouseleave', this.boundMouseLeave);\n handle.addEventListener('dblclick', this.boundDoubleClick);\n this.document.addEventListener('mousemove', this.boundMouseMove);\n this.document.addEventListener('mouseup', this.boundMouseUp);\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.resizeHandle) {\n this.resizeHandle.removeEventListener('mousedown', this.boundMouseDown);\n this.resizeHandle.removeEventListener('mouseenter', this.boundMouseEnter);\n this.resizeHandle.removeEventListener('mouseleave', this.boundMouseLeave);\n this.resizeHandle.removeEventListener('dblclick', this.boundDoubleClick);\n this.resizeHandle.remove();\n this.resizeHandle = undefined;\n }\n\n this.document.removeEventListener('mousemove', this.boundMouseMove);\n this.document.removeEventListener('mouseup', this.boundMouseUp);\n this.document.body.style.cursor = '';\n }\n\n private isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement));\n\n private onMouseDown(event: MouseEvent): void {\n if (!this.resizeHandle) return;\n \n const handleRect = this.resizeHandle.getBoundingClientRect();\n if (event.clientX < handleRect.left || event.clientX > handleRect.right) return;\n \n event.preventDefault();\n \n this.isResizing.set(true);\n this.document.body.style.cursor = STYLES.cursorActive;\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;\n this.startMoveWidth = this.hostElement.offsetWidth;\n \n this.zone.run(() => {\n this.onResizingStarted.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingStarted',\n value: this.startMoveWidth,\n oldValue: this.startMoveWidth,\n });\n });\n }\n\n private onMouseMove(event: MouseEvent): void {\n if (!this.isResizing()) return;\n \n const rect = this.hostElement.getBoundingClientRect();\n const isRTL = this.isRTL();\n \n let newWidth = isRTL ? rect.right - event.clientX : event.clientX - rect.left;\n newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));\n\n if (newWidth !== this.hostElement.offsetWidth) {\n this.hostElement.style.width = `${newWidth}px`;\n }\n }\n\n private onMouseUp(): void {\n if (!this.isResizing() || !this.resizeHandle) return;\n \n this.isResizing.set(false);\n this.document.body.style.cursor = '';\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n \n const currentWidth = this.hostElement.offsetWidth;\n \n this.zone.run(() => {\n this.onResizingEnded.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingEnded',\n value: currentWidth,\n oldValue: this.startMoveWidth,\n });\n });\n }\n\n private onMouseEnter(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;\n }\n }\n\n private onMouseLeave(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n }\n }\n\n private onDoubleClick(): void {\n const elementWidth = this.hostElement.offsetWidth;\n const action = this.dblClickAction();\n \n let newWidth: number;\n switch (action) {\n case 'reset':\n newWidth = this.resetToInitialWidth();\n break;\n case 'maximize':\n newWidth = this.maximizeToMaxWidth();\n break;\n case 'fit':\n newWidth = this.fitToContent();\n break;\n default:\n newWidth = elementWidth;\n }\n\n this.zone.run(() => {\n this.onResizingDblClick.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'onResizingDblClick',\n oldValue: elementWidth,\n value: newWidth,\n });\n });\n }\n\n private resetToInitialWidth(): number {\n const defaultWidth = this.defaultWidth();\n if (defaultWidth !== null) {\n this.hostElement.style.width = `${defaultWidth}px`;\n return defaultWidth;\n }\n \n const initialWidth = this.width();\n if (initialWidth !== null) {\n this.hostElement.style.width = `${initialWidth}px`;\n return initialWidth;\n }\n \n this.hostElement.style.width = `${this.initialElementWidth}px`;\n return this.initialElementWidth;\n }\n\n private maximizeToMaxWidth(): number {\n const maxWidth = this.maxWidth();\n if (maxWidth !== Infinity) {\n this.hostElement.style.width = `${maxWidth}px`;\n }\n return maxWidth;\n }\n\n private fitToContent(): number {\n this.hostElement.style.width = 'fit-content';\n return this.hostElement.clientWidth;\n }\n}\n\ninterface AXValueChangedEvent<T> {\n component: unknown;\n htmlElement?: HTMLElement;\n isUserInteraction?: boolean;\n name?: string;\n value?: T;\n oldValue?: T;\n}\n\nconst STYLES = {\n handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',\n backgroundColor: 'rgba(var(--ax-comp-resizable-background-color))',\n backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',\n backgroundColorHover:\n 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',\n cursor: 'var(--ax-comp-resizable-cursor, ew-resize)',\n cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',\n zIndex: 'var(--ax-comp-resizable-z-index, 999)',\n transition:\n 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',\n borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAsBa,oBAAoB,CAAA;AA8D/B,IAAA,WAAA,GAAA;AA7DiB,QAAA,IAAA,CAAA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FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;AAqVD,MAAM,MAAM,GAAG;AACb,IAAA,YAAY,EAAE,6CAA6C;AAC3D,IAAA,eAAe,EAAE,iDAAiD;AAClE,IAAA,qBAAqB,EAAE,6FAA6F;AACpH,IAAA,oBAAoB,EAClB,kGAAkG;AACpG,IAAA,MAAM,EAAE,4CAA4C;AACpD,IAAA,YAAY,EAAE,mDAAmD;AACjE,IAAA,MAAM,EAAE,uCAAuC;AAC/C,IAAA,UAAU,EACR,wHAAwH;AAC1H,IAAA,YAAY,EAAE,gEAAgE;CAC/E;;ACtXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-resizable.mjs","sources":["../../../../packages/cdk/resizable/src/lib/resize.directive.ts","../../../../packages/cdk/resizable/src/acorex-cdk-resizable.ts"],"sourcesContent":["import { AXPlatform } from '@acorex/core/platform';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n AfterViewInit,\n Directive,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n model,\n NgZone,\n OnDestroy,\n output,\n PLATFORM_ID,\n signal,\n WritableSignal,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\n\n@Directive({\n selector: '[axResizable]',\n})\nexport class AXResizableDirective implements AfterViewInit, OnDestroy {\n private readonly el = inject(ElementRef);\n private readonly platformService = inject(AXPlatform);\n private readonly zone = inject(NgZone);\n private readonly document = inject(DOCUMENT);\n private readonly platformID = inject(PLATFORM_ID);\n private readonly isBrowser: boolean;\n \n private hostElement!: HTMLElement;\n private resizeHandle?: HTMLElement;\n private isResizing: WritableSignal<boolean> = signal(false);\n private initialElementWidth = 0;\n private startMoveWidth = 0;\n private subscriptions = new Subscription();\n \n // Bound event handlers to maintain reference for cleanup\n private readonly boundMouseDown = this.onMouseDown.bind(this);\n private readonly boundMouseMove = this.onMouseMove.bind(this);\n private readonly boundMouseUp = this.onMouseUp.bind(this);\n private readonly boundMouseEnter = this.onMouseEnter.bind(this);\n private readonly boundMouseLeave = this.onMouseLeave.bind(this);\n private readonly boundDoubleClick = this.onDoubleClick.bind(this);\n \n private readonly resizeObserver = new ResizeObserver((entries) => {\n const parentElement = this.hostElement.parentElement;\n if (!parentElement) return;\n \n for (const entry of entries) {\n if (entry.target === parentElement && this.maxWidth() === Infinity) {\n this.maxWidth.set(entry.contentRect.width);\n break;\n }\n }\n });\n\n /** Define if directive is active or not */\n axResizable = model(true);\n\n /** Minimum width for the resizable element. */\n minWidth = model(100);\n\n /** Maximum width for the resizable element. Defaults to parent width if not provided. */\n maxWidth = model(Infinity);\n\n /** Behavior on double-click: 'reset' or 'maximize'. */\n dblClickAction = model<'reset' | 'maximize' | 'fit'>('reset');\n\n /** Define initial width for the element. */\n width = model<null | number>(null);\n\n /** Define reset width for the element. */\n defaultWidth = model<null | number>(null);\n\n /** Event emitted when resizing starts. */\n onResizingStarted = output<AXValueChangedEvent<number>>();\n\n /** Event emitted when resizing ends. */\n onResizingEnded = output<AXValueChangedEvent<number>>();\n\n /** Event emitted on double-click. */\n onResizingDblClick = output<AXValueChangedEvent<number>>();\n\n constructor() {\n this.isBrowser = isPlatformBrowser(this.platformID);\n this.hostElement = this.el.nativeElement as HTMLElement;\n \n this.subscriptions.add(\n this.platformService.directionChange.subscribe((i) => {\n this.isRTL.set(i.data === 'rtl');\n if (this.resizeHandle) {\n this.updateHandlePosition();\n }\n })\n );\n\n if (this.isBrowser) {\n effect(() => {\n if (this.isResizing()) {\n return;\n }\n const resolvedWidth = this.width() ?? this.defaultWidth();\n if (resolvedWidth !== null) {\n this.applyElementWidth(resolvedWidth);\n }\n });\n }\n }\n\n ngAfterViewInit(): void {\n if (!this.isBrowser) return;\n \n this.initialElementWidth = this.hostElement.offsetWidth;\n\n this.applyWidthFromModel();\n\n if (this.maxWidth() === Infinity) {\n const parentWidth = this.hostElement.parentElement?.offsetWidth;\n if (parentWidth) {\n this.maxWidth.set(parentWidth);\n }\n }\n \n const parentElement = this.hostElement.parentElement;\n if (parentElement) {\n this.resizeObserver.observe(parentElement);\n }\n \n this.createResizeHandle();\n this.setupResizableState();\n }\n\n ngOnDestroy(): void {\n this.subscriptions.unsubscribe();\n this.resizeObserver.disconnect();\n this.cleanupEventListeners();\n }\n\n private setupResizableState(): void {\n this.subscriptions.add(\n this.axResizable.subscribe((isActive) => {\n if (!isActive) {\n this.applyWidthFromModel();\n this.cleanupEventListeners();\n } else {\n this.applyWidthFromModel();\n this.createResizeHandle();\n }\n })\n );\n }\n\n private applyWidthFromModel(): void {\n const width = this.width();\n if (width !== null) {\n this.applyElementWidth(width);\n return;\n }\n const defaultWidth = this.defaultWidth();\n if (defaultWidth !== null) {\n this.applyElementWidth(defaultWidth);\n }\n }\n\n private applyElementWidth(width: number): void {\n this.hostElement.style.width = `${width}px`;\n }\n\n private createResizeHandle(): void {\n if (!this.axResizable() || this.resizeHandle) return;\n\n this.hostElement.style.position = 'relative';\n\n this.resizeHandle = this.document.createElement('div');\n this.resizeHandle.classList.add('ax-resizable-handler');\n this.hostElement.appendChild(this.resizeHandle);\n\n this.applyHandleStyles();\n this.attachEventListeners();\n }\n \n private applyHandleStyles(): void {\n if (!this.resizeHandle) return;\n \n Object.assign(this.resizeHandle.style, {\n width: STYLES.handlerWidth,\n backgroundColor: STYLES.backgroundColor,\n position: 'absolute',\n top: '0',\n bottom: '0',\n cursor: STYLES.cursor,\n zIndex: STYLES.zIndex,\n transition: STYLES.transition,\n borderRadius: STYLES.borderRadius,\n userSelect: 'none',\n });\n \n this.updateHandlePosition();\n }\n \n private updateHandlePosition(): void {\n if (!this.resizeHandle) return;\n \n const isRTL = this.isRTL();\n if (isRTL) {\n this.resizeHandle.style.left = '0';\n this.resizeHandle.style.right = '';\n } else {\n this.resizeHandle.style.right = '0';\n this.resizeHandle.style.left = '';\n }\n }\n \n private attachEventListeners(): void {\n if (!this.resizeHandle) return;\n \n const handle = this.resizeHandle;\n this.zone.runOutsideAngular(() => {\n handle.addEventListener('mousedown', this.boundMouseDown);\n handle.addEventListener('mouseenter', this.boundMouseEnter);\n handle.addEventListener('mouseleave', this.boundMouseLeave);\n handle.addEventListener('dblclick', this.boundDoubleClick);\n this.document.addEventListener('mousemove', this.boundMouseMove);\n this.document.addEventListener('mouseup', this.boundMouseUp);\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.resizeHandle) {\n this.resizeHandle.removeEventListener('mousedown', this.boundMouseDown);\n this.resizeHandle.removeEventListener('mouseenter', this.boundMouseEnter);\n this.resizeHandle.removeEventListener('mouseleave', this.boundMouseLeave);\n this.resizeHandle.removeEventListener('dblclick', this.boundDoubleClick);\n this.resizeHandle.remove();\n this.resizeHandle = undefined;\n }\n\n this.document.removeEventListener('mousemove', this.boundMouseMove);\n this.document.removeEventListener('mouseup', this.boundMouseUp);\n this.document.body.style.cursor = '';\n }\n\n private isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement));\n\n private onMouseDown(event: MouseEvent): void {\n if (!this.resizeHandle) return;\n \n const handleRect = this.resizeHandle.getBoundingClientRect();\n if (event.clientX < handleRect.left || event.clientX > handleRect.right) return;\n \n event.preventDefault();\n \n this.isResizing.set(true);\n this.document.body.style.cursor = STYLES.cursorActive;\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;\n this.startMoveWidth = this.hostElement.offsetWidth;\n \n this.zone.run(() => {\n this.onResizingStarted.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingStarted',\n value: this.startMoveWidth,\n oldValue: this.startMoveWidth,\n });\n });\n }\n\n private onMouseMove(event: MouseEvent): void {\n if (!this.isResizing()) return;\n \n const rect = this.hostElement.getBoundingClientRect();\n const isRTL = this.isRTL();\n \n let newWidth = isRTL ? rect.right - event.clientX : event.clientX - rect.left;\n newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));\n\n if (newWidth !== this.hostElement.offsetWidth) {\n this.hostElement.style.width = `${newWidth}px`;\n }\n }\n\n private onMouseUp(): void {\n if (!this.isResizing() || !this.resizeHandle) return;\n\n this.document.body.style.cursor = '';\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n\n const currentWidth = this.hostElement.offsetWidth;\n\n this.zone.run(() => {\n this.width.set(currentWidth);\n this.onResizingEnded.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'resizingEnded',\n value: currentWidth,\n oldValue: this.startMoveWidth,\n });\n });\n\n this.isResizing.set(false);\n }\n\n private onMouseEnter(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;\n }\n }\n\n private onMouseLeave(): void {\n if (!this.isResizing() && this.resizeHandle) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n }\n }\n\n private onDoubleClick(): void {\n const elementWidth = this.hostElement.offsetWidth;\n const action = this.dblClickAction();\n \n let newWidth: number;\n switch (action) {\n case 'reset':\n newWidth = this.resetToInitialWidth();\n break;\n case 'maximize':\n newWidth = this.maximizeToMaxWidth();\n break;\n case 'fit':\n newWidth = this.fitToContent();\n break;\n default:\n newWidth = elementWidth;\n }\n\n this.zone.run(() => {\n this.onResizingDblClick.emit({\n component: this,\n htmlElement: this.hostElement,\n isUserInteraction: true,\n name: 'onResizingDblClick',\n oldValue: elementWidth,\n value: newWidth,\n });\n });\n }\n\n private resetToInitialWidth(): number {\n const defaultWidth = this.defaultWidth();\n if (defaultWidth !== null) {\n this.applyElementWidth(defaultWidth);\n return defaultWidth;\n }\n\n const initialWidth = this.width();\n if (initialWidth !== null) {\n this.applyElementWidth(initialWidth);\n return initialWidth;\n }\n\n this.applyElementWidth(this.initialElementWidth);\n return this.initialElementWidth;\n }\n\n private maximizeToMaxWidth(): number {\n const maxWidth = this.maxWidth();\n if (maxWidth !== Infinity) {\n this.applyElementWidth(maxWidth);\n }\n return maxWidth;\n }\n\n private fitToContent(): number {\n this.hostElement.style.width = 'fit-content';\n return this.hostElement.clientWidth;\n }\n}\n\ninterface AXValueChangedEvent<T> {\n component: unknown;\n htmlElement?: HTMLElement;\n isUserInteraction?: boolean;\n name?: string;\n value?: T;\n oldValue?: T;\n}\n\nconst STYLES = {\n handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',\n backgroundColor: 'rgba(var(--ax-comp-resizable-background-color))',\n backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',\n backgroundColorHover:\n 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',\n cursor: 'var(--ax-comp-resizable-cursor, ew-resize)',\n cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',\n zIndex: 'var(--ax-comp-resizable-z-index, 999)',\n transition:\n 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',\n borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAuBa,oBAAoB,CAAA;AA8D/B,IAAA,WAAA,GAAA;AA7DiB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;AAKzC,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,KAAK,iFAAC;QACnD,IAAA,CAAA,mBAAmB,GAAG,CAAC;QACvB,IAAA,CAAA,cAAc,GAAG,CAAC;AAClB,QA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