@acorex/cdk 19.10.1 → 19.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -20
- package/dom/README.md +3 -0
- package/dom/index.d.ts +1 -0
- package/dom/lib/dom-change.directive.d.ts +13 -0
- package/fesm2022/acorex-cdk-dom.mjs +41 -0
- package/fesm2022/acorex-cdk-dom.mjs.map +1 -0
- package/fesm2022/acorex-cdk-outline.mjs +9 -7
- package/fesm2022/acorex-cdk-outline.mjs.map +1 -1
- package/fesm2022/acorex-cdk-pan-view.mjs +15 -6
- package/fesm2022/acorex-cdk-pan-view.mjs.map +1 -1
- package/fesm2022/acorex-cdk-resizable.mjs +246 -0
- package/fesm2022/acorex-cdk-resizable.mjs.map +1 -0
- package/outline/lib/outline-container.directive.d.ts +3 -1
- package/package.json +9 -1
- package/pan-view/lib/pan-view.directive.d.ts +3 -1
- package/resizable/README.md +3 -0
- package/resizable/index.d.ts +1 -0
- package/resizable/lib/resize.directive.d.ts +56 -0
package/README.md
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
|
-
# ACoreX CDK
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://acorexui.com/acorex-slang-dark.svg">
|
|
8
|
-
<img alt="Acorex - Design System, UI Framework, App Builder" src="https://acorexui.com/acorex-slang.svg" width="100%">
|
|
9
|
-
</picture>
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<div style="text-align: center;">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://acorexui.com/public/acorex-slang-dark.svg">
|
|
4
|
+
<img alt="Acorex - Design System, UI Framework, App Builder" src="https://acorexui.com/public/acorex-slang-dark.svg" width="100%">
|
|
5
|
+
</picture>
|
|
13
6
|
|
|
14
7
|
[]()
|
|
15
8
|
|
|
16
|
-
|
|
9
|
+
# ACoreX
|
|
10
|
+
|
|
11
|
+
ACoreX is an UI framework based on angular. With over 50+ beautiful fully responsive and accessible components for everyone.
|
|
17
12
|
|
|
18
13
|
A few links to help you get started:
|
|
19
14
|
|
|
20
15
|
- [ACoreX: Documentation, Guides](https://acorexui.com)
|
|
21
16
|
|
|
22
|
-
##
|
|
17
|
+
## Team Leads
|
|
18
|
+
|
|
19
|
+
| Arash Oshnoudi | Ali Safari |
|
|
20
|
+
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|
|
|
21
|
+
|  |  |
|
|
22
|
+
|
|
23
|
+
## Develop Team
|
|
24
|
+
|
|
25
|
+
| Reza Safari | Matin Givi | Shahin Kahrizi | Mohammad Parsaeifard | Mojtaba Erfan Rad |
|
|
26
|
+
|-----------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------|
|
|
27
|
+
|  |  |  |  |  |
|
|
23
28
|
|
|
24
|
-
| Arash Oshnoudi | Ali Safari | Matin Givi | Reza Safari |
|
|
25
|
-
| ------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
|
26
|
-
|  |  |  |  |
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
## Design Team
|
|
29
31
|
|
|
30
|
-
|
|
|
31
|
-
|
|
32
|
-
|  |  |
|
package/dom/README.md
ADDED
package/dom/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/dom-change.directive';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AXDomChangeDirective implements OnDestroy {
|
|
4
|
+
private mutationObserver;
|
|
5
|
+
private resizeObserver;
|
|
6
|
+
private elementRef;
|
|
7
|
+
axMutationObserver: import("@angular/core").OutputEmitterRef<MutationRecord[]>;
|
|
8
|
+
axResizeObserver: import("@angular/core").OutputEmitterRef<ResizeObserverEntry[]>;
|
|
9
|
+
constructor();
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXDomChangeDirective, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXDomChangeDirective, "[axDomChange]", never, {}, { "axMutationObserver": "axMutationObserver"; "axResizeObserver": "axResizeObserver"; }, never, never, true, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, output, Directive } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
class AXDomChangeDirective {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.elementRef = inject(ElementRef);
|
|
7
|
+
this.axMutationObserver = output();
|
|
8
|
+
this.axResizeObserver = output();
|
|
9
|
+
this.mutationObserver = new MutationObserver((mutations) => {
|
|
10
|
+
this.axMutationObserver.emit(mutations);
|
|
11
|
+
});
|
|
12
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
13
|
+
this.axResizeObserver.emit(entries);
|
|
14
|
+
});
|
|
15
|
+
this.mutationObserver.observe(this.elementRef.nativeElement, {
|
|
16
|
+
attributes: true,
|
|
17
|
+
});
|
|
18
|
+
this.resizeObserver.observe(this.elementRef.nativeElement, {
|
|
19
|
+
box: 'border-box',
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
ngOnDestroy() {
|
|
23
|
+
this.mutationObserver.disconnect();
|
|
24
|
+
this.resizeObserver.disconnect();
|
|
25
|
+
}
|
|
26
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXDomChangeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
27
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: AXDomChangeDirective, isStandalone: true, selector: "[axDomChange]", outputs: { axMutationObserver: "axMutationObserver", axResizeObserver: "axResizeObserver" }, ngImport: i0 }); }
|
|
28
|
+
}
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXDomChangeDirective, decorators: [{
|
|
30
|
+
type: Directive,
|
|
31
|
+
args: [{
|
|
32
|
+
selector: '[axDomChange]',
|
|
33
|
+
}]
|
|
34
|
+
}], ctorParameters: () => [] });
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Generated bundle index. Do not edit.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
export { AXDomChangeDirective };
|
|
41
|
+
//# sourceMappingURL=acorex-cdk-dom.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-cdk-dom.mjs","sources":["../../../../libs/cdk/dom/src/lib/dom-change.directive.ts","../../../../libs/cdk/dom/src/acorex-cdk-dom.ts"],"sourcesContent":["import { Directive, ElementRef, inject, OnDestroy, output } from '@angular/core';\n\n@Directive({\n selector: '[axDomChange]',\n})\nexport class AXDomChangeDirective implements OnDestroy {\n private mutationObserver: MutationObserver;\n private resizeObserver: ResizeObserver;\n private elementRef = inject(ElementRef);\n public axMutationObserver = output<MutationRecord[]>();\n public axResizeObserver = output<ResizeObserverEntry[]>();\n\n constructor() {\n this.mutationObserver = new MutationObserver((mutations: MutationRecord[]) => {\n this.axMutationObserver.emit(mutations);\n });\n\n this.resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {\n this.axResizeObserver.emit(entries);\n });\n\n this.mutationObserver.observe(this.elementRef.nativeElement, {\n attributes: true,\n });\n\n this.resizeObserver.observe(this.elementRef.nativeElement, {\n box: 'border-box',\n });\n }\n\n ngOnDestroy(): void {\n this.mutationObserver.disconnect();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AAA,EAAA,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;;ACJD;;AAEG;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AXUnsubscriber } from '@acorex/core/utils';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, NgZone, ElementRef, input, signal, afterNextRender, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { inject, NgZone, ElementRef, input, signal, computed, afterNextRender, Directive, NgModule } from '@angular/core';
|
|
4
4
|
import { Router, NavigationEnd } from '@angular/router';
|
|
5
5
|
import { BehaviorSubject, fromEvent, map } from 'rxjs';
|
|
6
6
|
import { CommonModule } from '@angular/common';
|
|
@@ -15,12 +15,14 @@ class AXOutlineContainerDirective {
|
|
|
15
15
|
this.smoothScroll = input(true);
|
|
16
16
|
this.activationOffset = input(16);
|
|
17
17
|
this.activateLastAtBottom = input(true);
|
|
18
|
+
this.scrollableElementId = input(null);
|
|
18
19
|
this.scrollTop = signal(0);
|
|
19
20
|
this.outlineItems = signal([]);
|
|
21
|
+
this.scrollableElement = computed(() => this.scrollableElementId() ? document.getElementById(this.scrollableElementId()) : this.el.nativeElement);
|
|
20
22
|
this.outlineItems$ = new BehaviorSubject([]);
|
|
21
23
|
this.#anr = afterNextRender(() => {
|
|
22
24
|
if (this.smoothScroll) {
|
|
23
|
-
this.
|
|
25
|
+
this.scrollableElement().style.scrollBehavior = 'smooth';
|
|
24
26
|
}
|
|
25
27
|
this.setOutlineItems();
|
|
26
28
|
this.router.events.pipe(this.unsubscriber.takeUntilDestroy).subscribe((e) => {
|
|
@@ -29,8 +31,8 @@ class AXOutlineContainerDirective {
|
|
|
29
31
|
}
|
|
30
32
|
});
|
|
31
33
|
this.zone.runOutsideAngular(() => {
|
|
32
|
-
fromEvent(this.
|
|
33
|
-
.pipe(this.unsubscriber.takeUntilDestroy, map(() => this.
|
|
34
|
+
fromEvent(this.scrollableElement(), 'scroll')
|
|
35
|
+
.pipe(this.unsubscriber.takeUntilDestroy, map(() => this.scrollableElement().scrollTop))
|
|
34
36
|
.subscribe((scrollTop) => {
|
|
35
37
|
this.scrollTop.set(scrollTop);
|
|
36
38
|
this.scrollChanged(scrollTop);
|
|
@@ -43,8 +45,8 @@ class AXOutlineContainerDirective {
|
|
|
43
45
|
this.outlineItems.update((prevItems) => {
|
|
44
46
|
if (prevItems.length === 0)
|
|
45
47
|
return prevItems;
|
|
46
|
-
const scrollHeight = this.
|
|
47
|
-
const clientHeight = this.
|
|
48
|
+
const scrollHeight = this.scrollableElement().scrollHeight;
|
|
49
|
+
const clientHeight = this.scrollableElement().clientHeight;
|
|
48
50
|
const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;
|
|
49
51
|
if (isAtBottom && this.activateLastAtBottom()) {
|
|
50
52
|
return prevItems.map((item, index) => ({
|
|
@@ -93,7 +95,7 @@ class AXOutlineContainerDirective {
|
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXOutlineContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
96
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXOutlineContainerDirective, isStandalone: false, selector: "[axOutlineContainer]", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, smoothScroll: { classPropertyName: "smoothScroll", publicName: "smoothScroll", isSignal: true, isRequired: false, transformFunction: null }, activationOffset: { classPropertyName: "activationOffset", publicName: "activationOffset", isSignal: true, isRequired: false, transformFunction: null }, activateLastAtBottom: { classPropertyName: "activateLastAtBottom", publicName: "activateLastAtBottom", isSignal: true, isRequired: false, transformFunction: null } }, providers: [AXUnsubscriber], exportAs: ["axOutlineContainer"], ngImport: i0 }); }
|
|
98
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXOutlineContainerDirective, isStandalone: false, selector: "[axOutlineContainer]", inputs: { target: { classPropertyName: "target", publicName: "target", isSignal: true, isRequired: false, transformFunction: null }, smoothScroll: { classPropertyName: "smoothScroll", publicName: "smoothScroll", isSignal: true, isRequired: false, transformFunction: null }, activationOffset: { classPropertyName: "activationOffset", publicName: "activationOffset", isSignal: true, isRequired: false, transformFunction: null }, activateLastAtBottom: { classPropertyName: "activateLastAtBottom", publicName: "activateLastAtBottom", isSignal: true, isRequired: false, transformFunction: null }, scrollableElementId: { classPropertyName: "scrollableElementId", publicName: "scrollableElementId", isSignal: true, isRequired: false, transformFunction: null } }, providers: [AXUnsubscriber], exportAs: ["axOutlineContainer"], ngImport: i0 }); }
|
|
97
99
|
}
|
|
98
100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXOutlineContainerDirective, decorators: [{
|
|
99
101
|
type: Directive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-outline.mjs","sources":["../../../../libs/cdk/outline/src/lib/outline-container.directive.ts","../../../../libs/cdk/outline/src/lib/outline-item.directive.ts","../../../../libs/cdk/outline/src/lib/outline.module.ts","../../../../libs/cdk/outline/src/acorex-cdk-outline.ts"],"sourcesContent":["import { AXUnsubscriber } from '@acorex/core/utils';\nimport { afterNextRender, Directive, ElementRef, inject, input, NgZone, signal } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, fromEvent, map } from 'rxjs';\n\nexport type outlineItemType = { el: HTMLElement; active: boolean; scrollY: number };\n\n@Directive({\n selector: '[axOutlineContainer]',\n standalone: false,\n exportAs: 'axOutlineContainer',\n providers: [AXUnsubscriber],\n})\nexport class AXOutlineContainerDirective {\n router = inject(Router);\n private zone = inject(NgZone);\n private el = inject(ElementRef<HTMLElement>);\n private unsubscriber = inject(AXUnsubscriber);\n\n target = input<string>();\n smoothScroll = input(true);\n activationOffset = input(16);\n activateLastAtBottom = input(true);\n\n private scrollTop = signal(0);\n private outlineItems = signal<outlineItemType[]>([]);\n\n outlineItems$ = new BehaviorSubject<outlineItemType[]>([]);\n\n #anr = afterNextRender(() => {\n if (this.smoothScroll) {\n (this.el.nativeElement as HTMLElement).style.scrollBehavior = 'smooth';\n }\n this.setOutlineItems();\n this.router.events.pipe(this.unsubscriber.takeUntilDestroy).subscribe((e) => {\n if (e instanceof NavigationEnd) {\n this.setOutlineItems();\n }\n });\n this.zone.runOutsideAngular(() => {\n fromEvent(this.el.nativeElement, 'scroll')\n .pipe(\n this.unsubscriber.takeUntilDestroy,\n map(() => this.el.nativeElement.scrollTop),\n )\n .subscribe((scrollTop) => {\n this.scrollTop.set(scrollTop);\n this.scrollChanged(scrollTop);\n });\n });\n });\n\n private scrollChanged(scrollTop: number) {\n this.outlineItems.update((prevItems) => {\n if (prevItems.length === 0) return prevItems;\n\n const scrollHeight = this.el.nativeElement.scrollHeight;\n const clientHeight = this.el.nativeElement.clientHeight;\n const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;\n\n if (isAtBottom && this.activateLastAtBottom()) {\n return prevItems.map((item, index) => ({\n ...item,\n active: index === prevItems.length - 1,\n }));\n }\n\n let activeIndex = -1;\n for (let i = 0; i < prevItems.length; i++) {\n const item = prevItems[i];\n if (scrollTop >= item.scrollY - this.activationOffset()) {\n activeIndex = i;\n }\n }\n return prevItems.map((item, index) => ({\n ...item,\n active: index === activeIndex,\n }));\n });\n this.outlineItems$.next(this.outlineItems());\n }\n\n private setOutlineItems() {\n setTimeout(() => {\n const targets = this.target() ? [...this.el.nativeElement.querySelectorAll(this.target())] : [];\n targets.push(...this.el.nativeElement.querySelectorAll('[data-ax-outline-item=\"true\"]'));\n const uniqueTargets = new Set(targets);\n const outlineItems = Array.from(uniqueTargets)\n .map((el) => {\n const existingId = el.id;\n let newId;\n if (!existingId) {\n const textContent = el.textContent.trim();\n if (textContent) {\n newId = `${textContent.replace(/\\s+/g, '-')}`;\n } else {\n newId = `${Math.random().toString(36).slice(2, 7)}`;\n }\n el.id = newId;\n }\n return { el, active: false, scrollY: el.offsetTop };\n })\n .sort((a, b) => a.scrollY - b.scrollY);\n this.outlineItems.set(outlineItems);\n this.scrollChanged(this.scrollTop());\n });\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject, input } from '@angular/core';\n\n@Directive({\n selector: '[axOutlineItem]',\n exportAs: 'axOutlineItem',\n standalone: false,\n})\nexport class AXOutlineItemDirective {\n private el = inject(ElementRef);\n id = input<string>();\n #anr = afterNextRender(() => {\n (this.el.nativeElement as HTMLElement).dataset['axOutlineItem'] = 'true';\n\n let newId;\n if (!this.id()) {\n const textContent = this.el.nativeElement.textContent.trim();\n if (textContent) {\n newId = `${textContent.replace(/\\s+/g, '-')}`;\n } else {\n newId = `${Math.random().toString(36).slice(2, 7)}`;\n }\n this.el.nativeElement.id = newId;\n }\n });\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXOutlineContainerDirective } from './outline-container.directive';\nimport { AXOutlineItemDirective } from './outline-item.directive';\n\nconst COMPONENT = [AXOutlineContainerDirective, AXOutlineItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXOutlineModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,2BAA2B,CAAA;AANxC,IAAA,WAAA,GAAA;AAOE,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACf,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;AAC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["../../../../libs/cdk/outline/src/lib/outline-container.directive.ts","../../../../libs/cdk/outline/src/lib/outline-item.directive.ts","../../../../libs/cdk/outline/src/lib/outline.module.ts","../../../../libs/cdk/outline/src/acorex-cdk-outline.ts"],"sourcesContent":["import { AXUnsubscriber } from '@acorex/core/utils';\nimport { afterNextRender, computed, Directive, ElementRef, inject, input, NgZone, signal } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { BehaviorSubject, fromEvent, map } from 'rxjs';\n\nexport type outlineItemType = { el: HTMLElement; active: boolean; scrollY: number };\n\n@Directive({\n selector: '[axOutlineContainer]',\n standalone: false,\n exportAs: 'axOutlineContainer',\n providers: [AXUnsubscriber],\n})\nexport class AXOutlineContainerDirective {\n router = inject(Router);\n private zone = inject(NgZone);\n private el = inject(ElementRef<HTMLElement>);\n private unsubscriber = inject(AXUnsubscriber);\n\n target = input<string>();\n smoothScroll = input(true);\n activationOffset = input(16);\n activateLastAtBottom = input(true);\n scrollableElementId = input<string | null>(null);\n\n private scrollTop = signal(0);\n private outlineItems = signal<outlineItemType[]>([]);\n\n private scrollableElement = computed(() =>\n this.scrollableElementId() ? document.getElementById(this.scrollableElementId()) : (this.el.nativeElement as HTMLElement),\n );\n\n outlineItems$ = new BehaviorSubject<outlineItemType[]>([]);\n\n #anr = afterNextRender(() => {\n if (this.smoothScroll) {\n this.scrollableElement().style.scrollBehavior = 'smooth';\n }\n this.setOutlineItems();\n this.router.events.pipe(this.unsubscriber.takeUntilDestroy).subscribe((e) => {\n if (e instanceof NavigationEnd) {\n this.setOutlineItems();\n }\n });\n this.zone.runOutsideAngular(() => {\n fromEvent(this.scrollableElement(), 'scroll')\n .pipe(\n this.unsubscriber.takeUntilDestroy,\n map(() => this.scrollableElement().scrollTop),\n )\n .subscribe((scrollTop) => {\n this.scrollTop.set(scrollTop);\n this.scrollChanged(scrollTop);\n });\n });\n });\n\n private scrollChanged(scrollTop: number) {\n this.outlineItems.update((prevItems) => {\n if (prevItems.length === 0) return prevItems;\n\n const scrollHeight = this.scrollableElement().scrollHeight;\n const clientHeight = this.scrollableElement().clientHeight;\n const isAtBottom = scrollTop + clientHeight >= scrollHeight - 1;\n\n if (isAtBottom && this.activateLastAtBottom()) {\n return prevItems.map((item, index) => ({\n ...item,\n active: index === prevItems.length - 1,\n }));\n }\n\n let activeIndex = -1;\n for (let i = 0; i < prevItems.length; i++) {\n const item = prevItems[i];\n if (scrollTop >= item.scrollY - this.activationOffset()) {\n activeIndex = i;\n }\n }\n return prevItems.map((item, index) => ({\n ...item,\n active: index === activeIndex,\n }));\n });\n this.outlineItems$.next(this.outlineItems());\n }\n\n private setOutlineItems() {\n setTimeout(() => {\n const targets = this.target() ? [...this.el.nativeElement.querySelectorAll(this.target())] : [];\n targets.push(...this.el.nativeElement.querySelectorAll('[data-ax-outline-item=\"true\"]'));\n const uniqueTargets = new Set(targets);\n const outlineItems = Array.from(uniqueTargets)\n .map((el) => {\n const existingId = el.id;\n let newId;\n if (!existingId) {\n const textContent = el.textContent.trim();\n if (textContent) {\n newId = `${textContent.replace(/\\s+/g, '-')}`;\n } else {\n newId = `${Math.random().toString(36).slice(2, 7)}`;\n }\n el.id = newId;\n }\n return { el, active: false, scrollY: el.offsetTop };\n })\n .sort((a, b) => a.scrollY - b.scrollY);\n this.outlineItems.set(outlineItems);\n this.scrollChanged(this.scrollTop());\n });\n }\n}\n","import { afterNextRender, Directive, ElementRef, inject, input } from '@angular/core';\n\n@Directive({\n selector: '[axOutlineItem]',\n exportAs: 'axOutlineItem',\n standalone: false,\n})\nexport class AXOutlineItemDirective {\n private el = inject(ElementRef);\n id = input<string>();\n #anr = afterNextRender(() => {\n (this.el.nativeElement as HTMLElement).dataset['axOutlineItem'] = 'true';\n\n let newId;\n if (!this.id()) {\n const textContent = this.el.nativeElement.textContent.trim();\n if (textContent) {\n newId = `${textContent.replace(/\\s+/g, '-')}`;\n } else {\n newId = `${Math.random().toString(36).slice(2, 7)}`;\n }\n this.el.nativeElement.id = newId;\n }\n });\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXOutlineContainerDirective } from './outline-container.directive';\nimport { AXOutlineItemDirective } from './outline-item.directive';\n\nconst COMPONENT = [AXOutlineContainerDirective, AXOutlineItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXOutlineModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,2BAA2B,CAAA;AANxC,IAAA,WAAA,GAAA;AAOE,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACf,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,EAAC,UAAuB,EAAC;AACpC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;QAE7C,IAAM,CAAA,MAAA,GAAG,KAAK,EAAU;AACxB,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC;AAC1B,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAAC;AAC5B,QAAA,IAAA,CAAA,oBAAoB,GAAG,KAAK,CAAC,IAAI,CAAC;AAClC,QAAA,IAAA,CAAA,mBAAmB,GAAG,KAAK,CAAgB,IAAI,CAAC;AAExC,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC;AACrB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAoB,EAAE,CAAC;AAE5C,QAAA,IAAA,CAAA,iBAAiB,GAAG,QAAQ,CAAC,MACnC,IAAI,CAAC,mBAAmB,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,GAAI,IAAI,CAAC,EAAE,CAAC,aAA6B,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AAE,eAAe;AACzB,oBAAA,UAAU,EAAE,KAAK;AAClB,iBAAA;;;ACDD,MAAM,SAAS,GAAG,CAAC,2BAA2B,EAAE,sBAAsB,CAAC;AACvE,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC;MAQjB,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,YAAA,EAAA,CATT,2BAA2B,EAAE,sBAAsB,aACrD,YAAY,CAAA,EAAA,OAAA,EAAA,CADV,2BAA2B,EAAE,sBAAsB,CAAA,EAAA,CAAA,CAAA;AASzD,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,YAJb,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
@@ -70,7 +70,8 @@ class AXPanViewDirective {
|
|
|
70
70
|
createWrapper() {
|
|
71
71
|
this.wrapper.set(this.render.createElement('div'));
|
|
72
72
|
this.render.addClass(this.wrapper(), 'ax-pan-view-wrapper');
|
|
73
|
-
|
|
73
|
+
if (this.wrapperClasses())
|
|
74
|
+
this.render.addClass(this.wrapper(), this.wrapperClasses());
|
|
74
75
|
const parent = this.nativeEl().parentNode;
|
|
75
76
|
this.render.appendChild(this.wrapper(), this.nativeEl());
|
|
76
77
|
this.render.insertBefore(parent, this.wrapper(), this.nativeEl().nextSibling);
|
|
@@ -138,11 +139,6 @@ class AXPanViewDirective {
|
|
|
138
139
|
this.panY.update((prev) => prev - (newHeight - prevHeight) / 2);
|
|
139
140
|
this.setElementPosition();
|
|
140
141
|
}
|
|
141
|
-
setElementPosition() {
|
|
142
|
-
this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px) scale(${this.zoom() / 100})`;
|
|
143
|
-
this.positionChange.emit({ x: this.panX(), y: this.panY() });
|
|
144
|
-
this.zoomChange.emit(this.zoom());
|
|
145
|
-
}
|
|
146
142
|
setFitContentScale() {
|
|
147
143
|
if (!this.fitContent())
|
|
148
144
|
return;
|
|
@@ -150,6 +146,11 @@ class AXPanViewDirective {
|
|
|
150
146
|
const width = this.wrapper().clientWidth / this.nativeEl().clientWidth;
|
|
151
147
|
this.zoom.set(Math.round(Math.min(height, width) * 100));
|
|
152
148
|
}
|
|
149
|
+
setElementPosition() {
|
|
150
|
+
this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px) scale(${this.zoom() / 100})`;
|
|
151
|
+
this.positionChange.emit({ x: this.panX(), y: this.panY() });
|
|
152
|
+
this.zoomChange.emit(this.zoom());
|
|
153
|
+
}
|
|
153
154
|
resetPosition() {
|
|
154
155
|
const containerWidth = this.wrapper().offsetWidth;
|
|
155
156
|
const containerHeight = this.wrapper().offsetHeight;
|
|
@@ -163,6 +164,14 @@ class AXPanViewDirective {
|
|
|
163
164
|
this.zoom.set(100);
|
|
164
165
|
this.setElementPosition();
|
|
165
166
|
}
|
|
167
|
+
zoomIn() {
|
|
168
|
+
this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + this.zoomStep()))));
|
|
169
|
+
this.setElementPosition();
|
|
170
|
+
}
|
|
171
|
+
zoomOut() {
|
|
172
|
+
this.zoom.set(Math.round(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() - this.zoomStep()))));
|
|
173
|
+
this.setElementPosition();
|
|
174
|
+
}
|
|
166
175
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
167
176
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXPanViewDirective, isStandalone: true, selector: "[axPanView]", inputs: { minZoom: { classPropertyName: "minZoom", publicName: "minZoom", isSignal: true, isRequired: false, transformFunction: null }, maxZoom: { classPropertyName: "maxZoom", publicName: "maxZoom", isSignal: true, isRequired: false, transformFunction: null }, zoomStep: { classPropertyName: "zoomStep", publicName: "zoomStep", 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 }); }
|
|
168
177
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-pan-view.mjs","sources":["../../../../libs/cdk/pan-view/src/lib/pan-view.directive.ts","../../../../libs/cdk/pan-view/src/acorex-cdk-pan-view.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { afterNextRender, computed, Directive, ElementRef, inject, input, linkedSignal, model, NgZone, output, Renderer2, signal } from '@angular/core';\n\n@Directive({\n selector: '[axPanView]',\n exportAs: 'axPanView',\n standalone: true,\n})\nexport class AXPanViewDirective {\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 minZoom = input(25);\n maxZoom = input(400);\n zoomStep = input(7);\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) {\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 const x = new ResizeObserver(() => this.sizeChanged());\n x.observe(this.wrapper());\n x.observe(this.nativeEl());\n });\n setTimeout(() => {\n this.resetPosition();\n });\n });\n\n private createWrapper() {\n this.wrapper.set(this.render.createElement('div'));\n this.render.addClass(this.wrapper(), 'ax-pan-view-wrapper');\n 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 ((e.pointerType === 'mouse' && e.buttons === 4) || e.pointerType !== 'mouse') {\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\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(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + zoomDirection * this.zoomStep())));\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 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 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 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","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,kBAAkB,CAAA;AAL/B,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC;AACrB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAC1B,QAAA,IAAA,C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","../../../../libs/cdk/pan-view/src/acorex-cdk-pan-view.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport { afterNextRender, computed, Directive, ElementRef, inject, input, linkedSignal, model, NgZone, output, Renderer2, signal } from '@angular/core';\n\n@Directive({\n selector: '[axPanView]',\n exportAs: 'axPanView',\n standalone: true,\n})\nexport class AXPanViewDirective {\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 minZoom = input(25);\n maxZoom = input(400);\n zoomStep = input(7);\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) {\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 const x = new ResizeObserver(() => this.sizeChanged());\n x.observe(this.wrapper());\n x.observe(this.nativeEl());\n });\n setTimeout(() => {\n this.resetPosition();\n });\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 ((e.pointerType === 'mouse' && e.buttons === 4) || e.pointerType !== 'mouse') {\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\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(Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom() + zoomDirection * this.zoomStep())));\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":";;;;MAQa,kBAAkB,CAAA;AAL/B,IAAA,WAAA,GAAA;AAMU,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,GAAG,MAAM,EAAC,UAAuB,EAAC;AAEpC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;AAClB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC;AAClB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAwB,IAAI,CAAC;AAErD,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;AACnB,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC;AACpB,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC;AACnB,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC;AACxB,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;AACzB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;AAC1B,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC;AAE1B,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACf,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC;AACf,QAAA,IAAA,CAAA,IAAI,GAAG,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AA,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;kBAL9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import { AXPlatform } from '@acorex/core/platform';
|
|
2
|
+
import { AXHtmlUtil } from '@acorex/core/utils';
|
|
3
|
+
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, ElementRef, NgZone, PLATFORM_ID, signal, model, output, Directive } from '@angular/core';
|
|
6
|
+
|
|
7
|
+
class AXResizableDirective {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.el = inject(ElementRef);
|
|
10
|
+
this.platformService = inject(AXPlatform);
|
|
11
|
+
this.zone = inject(NgZone);
|
|
12
|
+
this.document = inject(DOCUMENT);
|
|
13
|
+
this.platformID = inject(PLATFORM_ID);
|
|
14
|
+
this.isResizing = signal(false);
|
|
15
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
16
|
+
this.maxWidth.set(entries[0].contentRect.width);
|
|
17
|
+
});
|
|
18
|
+
/** Define if directive is active or not */
|
|
19
|
+
this.axResizable = model(true);
|
|
20
|
+
/** Minimum width for the resizable element. */
|
|
21
|
+
this.minWidth = model(100);
|
|
22
|
+
/** Maximum width for the resizable element. Defaults to parent width if not provided. */
|
|
23
|
+
this.maxWidth = model(Infinity);
|
|
24
|
+
/** Behavior on double-click: 'reset' or 'maximize'. */
|
|
25
|
+
this.dblClickAction = model('reset');
|
|
26
|
+
/** Define initial width for the element. */
|
|
27
|
+
this.initialWidth = model(null);
|
|
28
|
+
/** Event emitted when resizing starts. */
|
|
29
|
+
this.onResizingStarted = output();
|
|
30
|
+
/** Event emitted when resizing ends. */
|
|
31
|
+
this.onResizingEnded = output();
|
|
32
|
+
/** Event emitted on double-click. */
|
|
33
|
+
this.onResizingDblClick = output();
|
|
34
|
+
this.isRTL = signal(AXHtmlUtil.isRtl(this.document.documentElement));
|
|
35
|
+
this.platformService.directionChange.subscribe((i) => {
|
|
36
|
+
this.isRTL.set(i.data === 'rtl');
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
ngAfterViewInit() {
|
|
40
|
+
this.initialElementWidth = this.el.nativeElement.offsetWidth; // Store the initial width
|
|
41
|
+
if (this.initialWidth() !== null) {
|
|
42
|
+
this.el.nativeElement.style.width = `${this.initialWidth()}px`;
|
|
43
|
+
}
|
|
44
|
+
if (this.maxWidth() === Infinity) {
|
|
45
|
+
const parentWidth = this.el.nativeElement.parentElement?.offsetWidth;
|
|
46
|
+
if (parentWidth) {
|
|
47
|
+
this.maxWidth.set(parentWidth);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
this.resizeObserver.observe(this.el.nativeElement.parentElement);
|
|
51
|
+
this.createResizeHandle();
|
|
52
|
+
this.setupResizableState();
|
|
53
|
+
}
|
|
54
|
+
ngOnDestroy() {
|
|
55
|
+
this.resizeObserver.disconnect();
|
|
56
|
+
this.cleanupEventListeners();
|
|
57
|
+
}
|
|
58
|
+
// ngDoCheck(): void {
|
|
59
|
+
// console.log('check');
|
|
60
|
+
// }
|
|
61
|
+
setupResizableState() {
|
|
62
|
+
this.axResizable.subscribe((isActive) => {
|
|
63
|
+
if (!isActive) {
|
|
64
|
+
this.resetToInitialWidth(); // Reset width when disabled
|
|
65
|
+
this.cleanupEventListeners(); // Remove event listeners
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.createResizeHandle(); // Re-enable functionality
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
createResizeHandle() {
|
|
73
|
+
if (!this.axResizable())
|
|
74
|
+
return; // Do nothing if directive is disabled
|
|
75
|
+
this.el.nativeElement.style.position = 'relative';
|
|
76
|
+
this.resizeHandle = this.document.createElement('div');
|
|
77
|
+
this.resizeHandle.classList.add('ax-resizable-handler');
|
|
78
|
+
this.el.nativeElement.appendChild(this.resizeHandle);
|
|
79
|
+
const isRTL = this.isRTL();
|
|
80
|
+
Object.assign(this.resizeHandle.style, {
|
|
81
|
+
width: STYLES.handlerWidth,
|
|
82
|
+
backgroundColor: STYLES.backgroundColor,
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
top: '0',
|
|
85
|
+
[isRTL ? 'left' : 'right']: '0',
|
|
86
|
+
bottom: '0',
|
|
87
|
+
cursor: STYLES.cursor,
|
|
88
|
+
zIndex: STYLES.zIndex,
|
|
89
|
+
transition: STYLES.transition,
|
|
90
|
+
borderRadius: STYLES.borderRadius,
|
|
91
|
+
userSelect: 'none',
|
|
92
|
+
});
|
|
93
|
+
this.zone.runOutsideAngular(() => {
|
|
94
|
+
this.resizeHandle.addEventListener('mousedown', this.onMouseDown.bind(this));
|
|
95
|
+
this.document.addEventListener('mousemove', this.onMouseMove.bind(this));
|
|
96
|
+
this.document.addEventListener('mouseup', this.onMouseUp.bind(this));
|
|
97
|
+
this.resizeHandle.addEventListener('mouseenter', this.onMouseEnter.bind(this));
|
|
98
|
+
this.resizeHandle.addEventListener('mouseleave', this.onMouseLeave.bind(this));
|
|
99
|
+
this.resizeHandle.addEventListener('dblclick', this.onDoubleClick.bind(this));
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
cleanupEventListeners() {
|
|
103
|
+
if (this.resizeHandle) {
|
|
104
|
+
this.resizeHandle.removeEventListener('mousedown', this.onMouseDown.bind(this));
|
|
105
|
+
this.resizeHandle.removeEventListener('mouseenter', this.onMouseEnter.bind(this));
|
|
106
|
+
this.resizeHandle.removeEventListener('mouseleave', this.onMouseLeave.bind(this));
|
|
107
|
+
this.resizeHandle.removeEventListener('dblclick', this.onDoubleClick.bind(this));
|
|
108
|
+
if (this.resizeHandle.parentElement) {
|
|
109
|
+
this.resizeHandle.parentElement.removeChild(this.resizeHandle);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
this.document.removeEventListener('mousemove', this.onMouseMove.bind(this));
|
|
113
|
+
this.document.removeEventListener('mouseup', this.onMouseUp.bind(this));
|
|
114
|
+
this.document.body.style.cursor = '';
|
|
115
|
+
}
|
|
116
|
+
onMouseDown(event) {
|
|
117
|
+
if (isPlatformBrowser(this.platformID)) {
|
|
118
|
+
const handleRect = this.resizeHandle.getBoundingClientRect();
|
|
119
|
+
if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {
|
|
120
|
+
this.isResizing.set(true);
|
|
121
|
+
this.document.body.style.cursor = STYLES.cursorActive;
|
|
122
|
+
this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;
|
|
123
|
+
event.preventDefault();
|
|
124
|
+
this.startMoveWidth = this.el.nativeElement.offsetWidth;
|
|
125
|
+
this.onResizingStarted.emit({
|
|
126
|
+
component: this,
|
|
127
|
+
htmlElement: this.el.nativeElement,
|
|
128
|
+
isUserInteraction: true,
|
|
129
|
+
name: 'resizingStarted',
|
|
130
|
+
value: this.el.nativeElement.offsetWidth,
|
|
131
|
+
oldValue: this.el.nativeElement.offsetWidth,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
onMouseMove(event) {
|
|
137
|
+
if (this.isResizing() && isPlatformBrowser(this.platformID)) {
|
|
138
|
+
const rect = this.el.nativeElement.getBoundingClientRect();
|
|
139
|
+
const isRTL = this.isRTL();
|
|
140
|
+
let newWidth;
|
|
141
|
+
if (isRTL) {
|
|
142
|
+
newWidth = rect.right - event.clientX;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
newWidth = event.clientX - rect.left;
|
|
146
|
+
}
|
|
147
|
+
// Clamp the width to minWidth and maxWidth
|
|
148
|
+
newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));
|
|
149
|
+
// Update the width only if it has changed
|
|
150
|
+
if (newWidth !== this.el.nativeElement.offsetWidth) {
|
|
151
|
+
this.el.nativeElement.style.width = `${newWidth}px`;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
onMouseUp() {
|
|
156
|
+
if (this.isResizing() && isPlatformBrowser(this.platformID)) {
|
|
157
|
+
this.isResizing.set(false);
|
|
158
|
+
this.document.body.style.cursor = 'default';
|
|
159
|
+
this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;
|
|
160
|
+
this.onResizingEnded.emit({
|
|
161
|
+
component: this,
|
|
162
|
+
htmlElement: this.el.nativeElement,
|
|
163
|
+
isUserInteraction: true,
|
|
164
|
+
name: 'resizingEnded',
|
|
165
|
+
value: this.el.nativeElement.offsetWidth,
|
|
166
|
+
oldValue: this.startMoveWidth,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
onMouseEnter() {
|
|
171
|
+
if (!this.isResizing()) {
|
|
172
|
+
this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
onMouseLeave() {
|
|
176
|
+
if (!this.isResizing()) {
|
|
177
|
+
this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
onDoubleClick() {
|
|
181
|
+
const elementWidth = this.el.nativeElement.offsetWidth;
|
|
182
|
+
// const maxWidth = this.maxWidth();
|
|
183
|
+
// const initialWidth = this.initialWidth() !== null ? this.initialWidth() : this.initialElementWidth;
|
|
184
|
+
let newWidth;
|
|
185
|
+
if (this.dblClickAction() === 'reset') {
|
|
186
|
+
newWidth = this.resetToInitialWidth();
|
|
187
|
+
}
|
|
188
|
+
else if (this.dblClickAction() === 'maximize') {
|
|
189
|
+
newWidth = this.maximizeToMaxWidth();
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.onResizingDblClick.emit({
|
|
195
|
+
component: this,
|
|
196
|
+
htmlElement: this.el.nativeElement,
|
|
197
|
+
isUserInteraction: true,
|
|
198
|
+
name: 'onResizingDblClick',
|
|
199
|
+
oldValue: elementWidth,
|
|
200
|
+
value: newWidth,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
resetToInitialWidth() {
|
|
204
|
+
if (this.initialWidth() !== null) {
|
|
205
|
+
this.el.nativeElement.style.width = `${this.initialWidth()}px`;
|
|
206
|
+
return this.initialWidth();
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
this.el.nativeElement.style.width = `${this.initialElementWidth}px`;
|
|
210
|
+
return this.initialElementWidth;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
maximizeToMaxWidth() {
|
|
214
|
+
const maxWidth = this.maxWidth();
|
|
215
|
+
if (maxWidth !== Infinity) {
|
|
216
|
+
this.el.nativeElement.style.width = `${maxWidth}px`;
|
|
217
|
+
}
|
|
218
|
+
return maxWidth;
|
|
219
|
+
}
|
|
220
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXResizableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
221
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", 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 }, initialWidth: { classPropertyName: "initialWidth", publicName: "initialWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { axResizable: "axResizableChange", minWidth: "minWidthChange", maxWidth: "maxWidthChange", dblClickAction: "dblClickActionChange", initialWidth: "initialWidthChange", onResizingStarted: "onResizingStarted", onResizingEnded: "onResizingEnded", onResizingDblClick: "onResizingDblClick" }, ngImport: i0 }); }
|
|
222
|
+
}
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXResizableDirective, decorators: [{
|
|
224
|
+
type: Directive,
|
|
225
|
+
args: [{
|
|
226
|
+
selector: '[axResizable]',
|
|
227
|
+
}]
|
|
228
|
+
}], ctorParameters: () => [] });
|
|
229
|
+
const STYLES = {
|
|
230
|
+
handlerWidth: 'var(--ax-comp-resizable-handler-width, 4px)',
|
|
231
|
+
backgroundColor: 'rgba(var(--ax-comp-resizable-background-color)',
|
|
232
|
+
backgroundColorActive: 'rgba(var(--ax-comp-resizable-background-color-active, var(--ax-sys-color-primary-surface)))',
|
|
233
|
+
backgroundColorHover: 'rgba(var(--ax-comp-resizable-background-color-hover, var(--ax-sys-color-primary-light-surface)))',
|
|
234
|
+
cursor: 'var(--ax-comp-resizable-cursor, ew-resize)',
|
|
235
|
+
cursorActive: 'var(--ax-comp-resizable-cursor-active, ew-resize)',
|
|
236
|
+
zIndex: 'var(--ax-comp-resizable-z-index, 999)',
|
|
237
|
+
transition: 'var(--ax-comp-resizable-transition, background-color --ax-sys-transition-duration --ax-sys-transition-timing-function)',
|
|
238
|
+
borderRadius: 'var(--ax-comp-resizable-border-radius, --ax-sys-border-radius)',
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Generated bundle index. Do not edit.
|
|
243
|
+
*/
|
|
244
|
+
|
|
245
|
+
export { AXResizableDirective };
|
|
246
|
+
//# sourceMappingURL=acorex-cdk-resizable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-cdk-resizable.mjs","sources":["../../../../libs/cdk/resizable/src/lib/resize.directive.ts","../../../../libs/cdk/resizable/src/acorex-cdk-resizable.ts"],"sourcesContent":["import { AXPlatform } from '@acorex/core/platform';\nimport { AXHtmlUtil } from '@acorex/core/utils';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { AfterViewInit, Directive, ElementRef, inject, model, NgZone, OnDestroy, output, PLATFORM_ID, signal, WritableSignal } from '@angular/core';\n\n@Directive({\n selector: '[axResizable]',\n})\nexport class AXResizableDirective implements AfterViewInit, OnDestroy {\n private el = inject(ElementRef);\n private platformService = inject(AXPlatform);\n private zone = inject(NgZone);\n private document = inject(DOCUMENT);\n private platformID = inject(PLATFORM_ID);\n private resizeHandle: HTMLElement;\n private isResizing: WritableSignal<boolean> = signal(false);\n private initialElementWidth: number;\n private startMoveWidth: number;\n private resizeObserver = new ResizeObserver((entries) => {\n this.maxWidth.set(entries[0].contentRect.width);\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'>('reset');\n\n /** Define initial width for the element. */\n initialWidth = 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.platformService.directionChange.subscribe((i) => {\n this.isRTL.set(i.data === 'rtl');\n });\n }\n\n ngAfterViewInit(): void {\n this.initialElementWidth = (this.el.nativeElement as HTMLElement).offsetWidth; // Store the initial width\n\n if (this.initialWidth() !== null) {\n (this.el.nativeElement as HTMLElement).style.width = `${this.initialWidth()}px`;\n }\n\n if (this.maxWidth() === Infinity) {\n const parentWidth = (this.el.nativeElement as HTMLElement).parentElement?.offsetWidth;\n if (parentWidth) {\n this.maxWidth.set(parentWidth);\n }\n }\n this.resizeObserver.observe((this.el.nativeElement as HTMLElement).parentElement);\n this.createResizeHandle();\n this.setupResizableState();\n }\n\n ngOnDestroy(): void {\n this.resizeObserver.disconnect();\n this.cleanupEventListeners();\n }\n\n // ngDoCheck(): void {\n // console.log('check');\n // }\n\n private setupResizableState(): void {\n this.axResizable.subscribe((isActive) => {\n if (!isActive) {\n this.resetToInitialWidth(); // Reset width when disabled\n this.cleanupEventListeners(); // Remove event listeners\n } else {\n this.createResizeHandle(); // Re-enable functionality\n }\n });\n }\n\n private createResizeHandle(): void {\n if (!this.axResizable()) return; // Do nothing if directive is disabled\n\n (this.el.nativeElement as HTMLElement).style.position = 'relative';\n\n this.resizeHandle = this.document.createElement('div');\n this.resizeHandle.classList.add('ax-resizable-handler');\n (this.el.nativeElement as HTMLElement).appendChild(this.resizeHandle);\n\n const isRTL = this.isRTL();\n Object.assign(this.resizeHandle.style, {\n width: STYLES.handlerWidth,\n backgroundColor: STYLES.backgroundColor,\n position: 'absolute',\n top: '0',\n [isRTL ? 'left' : 'right']: '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.zone.runOutsideAngular(() => {\n this.resizeHandle.addEventListener('mousedown', this.onMouseDown.bind(this));\n this.document.addEventListener('mousemove', this.onMouseMove.bind(this));\n this.document.addEventListener('mouseup', this.onMouseUp.bind(this));\n this.resizeHandle.addEventListener('mouseenter', this.onMouseEnter.bind(this));\n this.resizeHandle.addEventListener('mouseleave', this.onMouseLeave.bind(this));\n this.resizeHandle.addEventListener('dblclick', this.onDoubleClick.bind(this));\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.resizeHandle) {\n this.resizeHandle.removeEventListener('mousedown', this.onMouseDown.bind(this));\n this.resizeHandle.removeEventListener('mouseenter', this.onMouseEnter.bind(this));\n this.resizeHandle.removeEventListener('mouseleave', this.onMouseLeave.bind(this));\n this.resizeHandle.removeEventListener('dblclick', this.onDoubleClick.bind(this));\n\n if (this.resizeHandle.parentElement) {\n this.resizeHandle.parentElement.removeChild(this.resizeHandle);\n }\n }\n\n this.document.removeEventListener('mousemove', this.onMouseMove.bind(this));\n this.document.removeEventListener('mouseup', this.onMouseUp.bind(this));\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 (isPlatformBrowser(this.platformID)) {\n const handleRect = this.resizeHandle.getBoundingClientRect();\n if (event.clientX >= handleRect.left && event.clientX <= handleRect.right) {\n this.isResizing.set(true);\n this.document.body.style.cursor = STYLES.cursorActive;\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorActive;\n event.preventDefault();\n this.startMoveWidth = (this.el.nativeElement as HTMLElement).offsetWidth;\n this.onResizingStarted.emit({\n component: this,\n htmlElement: this.el.nativeElement as HTMLElement,\n isUserInteraction: true,\n name: 'resizingStarted',\n value: (this.el.nativeElement as HTMLElement).offsetWidth,\n oldValue: (this.el.nativeElement as HTMLElement).offsetWidth,\n });\n }\n }\n }\n\n private onMouseMove(event: MouseEvent): void {\n if (this.isResizing() && isPlatformBrowser(this.platformID)) {\n const rect = (this.el.nativeElement as HTMLElement).getBoundingClientRect();\n const isRTL = this.isRTL();\n let newWidth: number;\n\n if (isRTL) {\n newWidth = rect.right - event.clientX;\n } else {\n newWidth = event.clientX - rect.left;\n }\n\n // Clamp the width to minWidth and maxWidth\n newWidth = Math.max(this.minWidth(), Math.min(newWidth, this.maxWidth()));\n\n // Update the width only if it has changed\n if (newWidth !== (this.el.nativeElement as HTMLElement).offsetWidth) {\n (this.el.nativeElement as HTMLElement).style.width = `${newWidth}px`;\n }\n }\n }\n\n private onMouseUp(): void {\n if (this.isResizing() && isPlatformBrowser(this.platformID)) {\n this.isResizing.set(false);\n this.document.body.style.cursor = 'default';\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n\n this.onResizingEnded.emit({\n component: this,\n htmlElement: this.el.nativeElement as HTMLElement,\n isUserInteraction: true,\n name: 'resizingEnded',\n value: (this.el.nativeElement as HTMLElement).offsetWidth,\n oldValue: this.startMoveWidth,\n });\n }\n }\n\n private onMouseEnter(): void {\n if (!this.isResizing()) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColorHover;\n }\n }\n\n private onMouseLeave(): void {\n if (!this.isResizing()) {\n this.resizeHandle.style.backgroundColor = STYLES.backgroundColor;\n }\n }\n\n private onDoubleClick(): void {\n const elementWidth = (this.el.nativeElement as HTMLElement).offsetWidth;\n // const maxWidth = this.maxWidth();\n // const initialWidth = this.initialWidth() !== null ? this.initialWidth() : this.initialElementWidth;\n let newWidth: number;\n\n if (this.dblClickAction() === 'reset') {\n newWidth = this.resetToInitialWidth();\n } else if (this.dblClickAction() === 'maximize') {\n newWidth = this.maximizeToMaxWidth();\n } else {\n return;\n }\n\n this.onResizingDblClick.emit({\n component: this,\n htmlElement: this.el.nativeElement as HTMLElement,\n isUserInteraction: true,\n name: 'onResizingDblClick',\n oldValue: elementWidth,\n value: newWidth,\n });\n }\n\n private resetToInitialWidth(): number {\n if (this.initialWidth() !== null) {\n (this.el.nativeElement as HTMLElement).style.width = `${this.initialWidth()}px`;\n return this.initialWidth();\n } else {\n (this.el.nativeElement as HTMLElement).style.width = `${this.initialElementWidth}px`;\n return this.initialElementWidth;\n }\n }\n\n private maximizeToMaxWidth() {\n const maxWidth = this.maxWidth();\n if (maxWidth !== Infinity) {\n (this.el.nativeElement as HTMLElement).style.width = `${maxWidth}px`;\n }\n return maxWidth;\n }\n}\n\ninterface AXValueChangedEvent<T> {\n component: any;\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: '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: '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":";;;;;;MAQa,oBAAoB,CAAA;AAsC/B,IAAA,WAAA,GAAA;AArCQ,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AACvB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,UAAU,CAAC;AACpC,QAAA,IAA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AAA,EAAA,EAAA,OAAA,EAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,cAAA,EAAA,sBAAA,EAAA,YAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,mBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAHhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;AAoQD,MAAM,MAAM,GAAG;AACb,IAAA,YAAY,EAAE,6CAA6C;AAC3D,IAAA,eAAe,EAAE,gDAAgD;AACjE,IAAA,qBAAqB,EAAE,6FAA6F;AACpH,IAAA,oBAAoB,EAAE,kGAAkG;AACxH,IAAA,MAAM,EAAE,4CAA4C;AACpD,IAAA,YAAY,EAAE,mDAAmD;AACjE,IAAA,MAAM,EAAE,uCAAuC;AAC/C,IAAA,UAAU,EAAE,wHAAwH;AACpI,IAAA,YAAY,EAAE,gEAAgE;CAC/E;;ACrRD;;AAEG;;;;"}
|
|
@@ -16,11 +16,13 @@ export declare class AXOutlineContainerDirective {
|
|
|
16
16
|
smoothScroll: import("@angular/core").InputSignal<boolean>;
|
|
17
17
|
activationOffset: import("@angular/core").InputSignal<number>;
|
|
18
18
|
activateLastAtBottom: import("@angular/core").InputSignal<boolean>;
|
|
19
|
+
scrollableElementId: import("@angular/core").InputSignal<string>;
|
|
19
20
|
private scrollTop;
|
|
20
21
|
private outlineItems;
|
|
22
|
+
private scrollableElement;
|
|
21
23
|
outlineItems$: BehaviorSubject<outlineItemType[]>;
|
|
22
24
|
private scrollChanged;
|
|
23
25
|
private setOutlineItems;
|
|
24
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXOutlineContainerDirective, never>;
|
|
25
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXOutlineContainerDirective, "[axOutlineContainer]", ["axOutlineContainer"], { "target": { "alias": "target"; "required": false; "isSignal": true; }; "smoothScroll": { "alias": "smoothScroll"; "required": false; "isSignal": true; }; "activationOffset": { "alias": "activationOffset"; "required": false; "isSignal": true; }; "activateLastAtBottom": { "alias": "activateLastAtBottom"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXOutlineContainerDirective, "[axOutlineContainer]", ["axOutlineContainer"], { "target": { "alias": "target"; "required": false; "isSignal": true; }; "smoothScroll": { "alias": "smoothScroll"; "required": false; "isSignal": true; }; "activationOffset": { "alias": "activationOffset"; "required": false; "isSignal": true; }; "activateLastAtBottom": { "alias": "activateLastAtBottom"; "required": false; "isSignal": true; }; "scrollableElementId": { "alias": "scrollableElementId"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>;
|
|
26
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/cdk",
|
|
3
|
-
"version": "19.10.
|
|
3
|
+
"version": "19.10.3",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=19.0.0",
|
|
6
6
|
"@angular/core": ">=19.0.0",
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
"types": "./collapse/index.d.ts",
|
|
32
32
|
"default": "./fesm2022/acorex-cdk-collapse.mjs"
|
|
33
33
|
},
|
|
34
|
+
"./dom": {
|
|
35
|
+
"types": "./dom/index.d.ts",
|
|
36
|
+
"default": "./fesm2022/acorex-cdk-dom.mjs"
|
|
37
|
+
},
|
|
34
38
|
"./list-navigation": {
|
|
35
39
|
"types": "./list-navigation/index.d.ts",
|
|
36
40
|
"default": "./fesm2022/acorex-cdk-list-navigation.mjs"
|
|
@@ -47,6 +51,10 @@
|
|
|
47
51
|
"types": "./qrcode/index.d.ts",
|
|
48
52
|
"default": "./fesm2022/acorex-cdk-qrcode.mjs"
|
|
49
53
|
},
|
|
54
|
+
"./resizable": {
|
|
55
|
+
"types": "./resizable/index.d.ts",
|
|
56
|
+
"default": "./fesm2022/acorex-cdk-resizable.mjs"
|
|
57
|
+
},
|
|
50
58
|
"./selection": {
|
|
51
59
|
"types": "./selection/index.d.ts",
|
|
52
60
|
"default": "./fesm2022/acorex-cdk-selection.mjs"
|
|
@@ -33,9 +33,11 @@ export declare class AXPanViewDirective {
|
|
|
33
33
|
private handlePointerUp;
|
|
34
34
|
private handleZoomChange;
|
|
35
35
|
private sizeChanged;
|
|
36
|
-
private setElementPosition;
|
|
37
36
|
private setFitContentScale;
|
|
37
|
+
setElementPosition(): void;
|
|
38
38
|
resetPosition(): void;
|
|
39
|
+
zoomIn(): void;
|
|
40
|
+
zoomOut(): void;
|
|
39
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPanViewDirective, never>;
|
|
40
42
|
static ɵdir: i0.ɵɵDirectiveDeclaration<AXPanViewDirective, "[axPanView]", ["axPanView"], { "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; "fitContent": { "alias": "fitContent"; "required": false; "isSignal": true; }; "disablePan": { "alias": "disablePan"; "required": false; "isSignal": true; }; "disableZoom": { "alias": "disableZoom"; "required": false; "isSignal": true; }; "wrapperClasses": { "alias": "wrapperClasses"; "required": false; "isSignal": true; }; "panX": { "alias": "panX"; "required": false; "isSignal": true; }; "panY": { "alias": "panY"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; }, { "panX": "panXChange"; "panY": "panYChange"; "zoom": "zoomChange"; "zoomChange": "zoomChange"; "positionChange": "positionChange"; }, never, never, true, never>;
|
|
41
43
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib/resize.directive';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AXResizableDirective implements AfterViewInit, OnDestroy {
|
|
4
|
+
private el;
|
|
5
|
+
private platformService;
|
|
6
|
+
private zone;
|
|
7
|
+
private document;
|
|
8
|
+
private platformID;
|
|
9
|
+
private resizeHandle;
|
|
10
|
+
private isResizing;
|
|
11
|
+
private initialElementWidth;
|
|
12
|
+
private startMoveWidth;
|
|
13
|
+
private resizeObserver;
|
|
14
|
+
/** Define if directive is active or not */
|
|
15
|
+
axResizable: import("@angular/core").ModelSignal<boolean>;
|
|
16
|
+
/** Minimum width for the resizable element. */
|
|
17
|
+
minWidth: import("@angular/core").ModelSignal<number>;
|
|
18
|
+
/** Maximum width for the resizable element. Defaults to parent width if not provided. */
|
|
19
|
+
maxWidth: import("@angular/core").ModelSignal<number>;
|
|
20
|
+
/** Behavior on double-click: 'reset' or 'maximize'. */
|
|
21
|
+
dblClickAction: import("@angular/core").ModelSignal<"reset" | "maximize">;
|
|
22
|
+
/** Define initial width for the element. */
|
|
23
|
+
initialWidth: import("@angular/core").ModelSignal<number>;
|
|
24
|
+
/** Event emitted when resizing starts. */
|
|
25
|
+
onResizingStarted: import("@angular/core").OutputEmitterRef<AXValueChangedEvent<number>>;
|
|
26
|
+
/** Event emitted when resizing ends. */
|
|
27
|
+
onResizingEnded: import("@angular/core").OutputEmitterRef<AXValueChangedEvent<number>>;
|
|
28
|
+
/** Event emitted on double-click. */
|
|
29
|
+
onResizingDblClick: import("@angular/core").OutputEmitterRef<AXValueChangedEvent<number>>;
|
|
30
|
+
constructor();
|
|
31
|
+
ngAfterViewInit(): void;
|
|
32
|
+
ngOnDestroy(): void;
|
|
33
|
+
private setupResizableState;
|
|
34
|
+
private createResizeHandle;
|
|
35
|
+
private cleanupEventListeners;
|
|
36
|
+
private isRTL;
|
|
37
|
+
private onMouseDown;
|
|
38
|
+
private onMouseMove;
|
|
39
|
+
private onMouseUp;
|
|
40
|
+
private onMouseEnter;
|
|
41
|
+
private onMouseLeave;
|
|
42
|
+
private onDoubleClick;
|
|
43
|
+
private resetToInitialWidth;
|
|
44
|
+
private maximizeToMaxWidth;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXResizableDirective, never>;
|
|
46
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXResizableDirective, "[axResizable]", never, { "axResizable": { "alias": "axResizable"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "maxWidth": { "alias": "maxWidth"; "required": false; "isSignal": true; }; "dblClickAction": { "alias": "dblClickAction"; "required": false; "isSignal": true; }; "initialWidth": { "alias": "initialWidth"; "required": false; "isSignal": true; }; }, { "axResizable": "axResizableChange"; "minWidth": "minWidthChange"; "maxWidth": "maxWidthChange"; "dblClickAction": "dblClickActionChange"; "initialWidth": "initialWidthChange"; "onResizingStarted": "onResizingStarted"; "onResizingEnded": "onResizingEnded"; "onResizingDblClick": "onResizingDblClick"; }, never, never, true, never>;
|
|
47
|
+
}
|
|
48
|
+
interface AXValueChangedEvent<T> {
|
|
49
|
+
component: any;
|
|
50
|
+
htmlElement?: HTMLElement;
|
|
51
|
+
isUserInteraction?: boolean;
|
|
52
|
+
name?: string;
|
|
53
|
+
value?: T;
|
|
54
|
+
oldValue?: T;
|
|
55
|
+
}
|
|
56
|
+
export {};
|