@acorex/cdk 19.9.0 → 19.10.0-next.0
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-pan-view.mjs +28 -54
- package/fesm2022/acorex-cdk-pan-view.mjs.map +1 -1
- package/fesm2022/acorex-cdk-selection.mjs +29 -22
- package/fesm2022/acorex-cdk-selection.mjs.map +1 -1
- package/fesm2022/acorex-cdk-sliding-item.mjs +113 -0
- package/fesm2022/acorex-cdk-sliding-item.mjs.map +1 -0
- package/package.json +5 -1
- package/pan-view/index.d.ts +0 -1
- package/pan-view/lib/pan-view.directive.d.ts +2 -1
- package/selection/lib/selection-group.directive.d.ts +5 -5
- package/selection/lib/selection-item.directive.d.ts +1 -1
- package/sliding-item/README.md +3 -0
- package/sliding-item/index.d.ts +2 -0
- package/sliding-item/lib/sliding-item.directive.d.ts +13 -0
- package/sliding-item/lib/sliding-item.module.d.ts +8 -0
- package/pan-view/lib/pan-view.module.d.ts +0 -8
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, NgZone, Renderer2, ElementRef, signal, input, model, output, computed, effect, afterNextRender, Directive
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { inject, NgZone, Renderer2, ElementRef, signal, input, model, output, computed, effect, afterNextRender, Directive } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
class AXPanViewDirective {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.zone = inject(NgZone);
|
|
8
8
|
this.render = inject(Renderer2);
|
|
9
|
+
this.document = inject(DOCUMENT);
|
|
9
10
|
this.el = inject((ElementRef));
|
|
10
11
|
this.prevX = signal(0);
|
|
11
12
|
this.prevY = signal(0);
|
|
@@ -39,40 +40,31 @@ class AXPanViewDirective {
|
|
|
39
40
|
this.#anr = afterNextRender(() => {
|
|
40
41
|
// Create Wrapper
|
|
41
42
|
this.createWrapper();
|
|
42
|
-
// Wheel Event
|
|
43
|
-
this.render.listen(this.wrapper(), 'wheel', (e) => {
|
|
44
|
-
e.preventDefault();
|
|
45
|
-
if (e.ctrlKey) {
|
|
46
|
-
this.handleZoomChange(e);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
else if (e.shiftKey) {
|
|
50
|
-
if (this.disablePan())
|
|
51
|
-
return;
|
|
52
|
-
this.panX.update((prev) => prev - e.deltaY / 3);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
if (this.disablePan())
|
|
56
|
-
return;
|
|
57
|
-
this.panY.update((prev) => prev - e.deltaY / 3);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
// Pointer Down Event
|
|
61
43
|
this.zone.runOutsideAngular(() => {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
44
|
+
// Wheel Event
|
|
45
|
+
this.wrapper().onwheel = (e) => {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
if (e.ctrlKey) {
|
|
48
|
+
this.handleZoomChange(e);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
else if (e.shiftKey) {
|
|
52
|
+
if (this.disablePan())
|
|
53
|
+
return;
|
|
54
|
+
this.panX.update((prev) => prev - e.deltaY / 3);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
if (this.disablePan())
|
|
58
|
+
return;
|
|
59
|
+
this.panY.update((prev) => prev - e.deltaY / 3);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
// Pointer Down Event
|
|
63
|
+
this.wrapper().onpointerdown = (e) => this.handlePointerDown(e);
|
|
65
64
|
// Pointer Move Event
|
|
66
|
-
this.
|
|
67
|
-
this.handlePointerMove(e);
|
|
68
|
-
});
|
|
65
|
+
this.document.onpointermove = (e) => this.handlePointerMove(e);
|
|
69
66
|
// Pointer Up/Leave Event
|
|
70
|
-
this.
|
|
71
|
-
this.handlePointerUp(e);
|
|
72
|
-
});
|
|
73
|
-
this.render.listen(this.wrapper(), 'pointerleave', (e) => {
|
|
74
|
-
this.handlePointerUp(e);
|
|
75
|
-
});
|
|
67
|
+
this.document.onpointerup = (e) => this.handlePointerUp(e);
|
|
76
68
|
});
|
|
77
69
|
});
|
|
78
70
|
}
|
|
@@ -101,7 +93,6 @@ class AXPanViewDirective {
|
|
|
101
93
|
this.render.setStyle(this.wrapper(), 'position', 'relative');
|
|
102
94
|
this.render.setStyle(this.nativeEl(), 'top', '0');
|
|
103
95
|
this.render.setStyle(this.nativeEl(), 'left', '0');
|
|
104
|
-
this.render.setStyle(this.nativeEl(), 'width', '100%');
|
|
105
96
|
this.render.setStyle(this.nativeEl(), 'position', 'absolute');
|
|
106
97
|
}
|
|
107
98
|
handlePointerDown(e) {
|
|
@@ -139,31 +130,14 @@ class AXPanViewDirective {
|
|
|
139
130
|
}
|
|
140
131
|
}
|
|
141
132
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
142
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", type: AXPanViewDirective, isStandalone:
|
|
133
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.3", 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 }, 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 }); }
|
|
143
134
|
}
|
|
144
135
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewDirective, decorators: [{
|
|
145
136
|
type: Directive,
|
|
146
137
|
args: [{
|
|
147
138
|
selector: '[axPanView]',
|
|
148
139
|
exportAs: 'axPanView',
|
|
149
|
-
standalone:
|
|
150
|
-
}]
|
|
151
|
-
}] });
|
|
152
|
-
|
|
153
|
-
const COMPONENT = [AXPanViewDirective];
|
|
154
|
-
const MODULES = [CommonModule];
|
|
155
|
-
class AXPanViewModule {
|
|
156
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
157
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewModule, declarations: [AXPanViewDirective], imports: [CommonModule], exports: [AXPanViewDirective] }); }
|
|
158
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewModule, imports: [MODULES] }); }
|
|
159
|
-
}
|
|
160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPanViewModule, decorators: [{
|
|
161
|
-
type: NgModule,
|
|
162
|
-
args: [{
|
|
163
|
-
declarations: [...COMPONENT],
|
|
164
|
-
imports: [...MODULES],
|
|
165
|
-
exports: [...COMPONENT],
|
|
166
|
-
providers: [],
|
|
140
|
+
standalone: true,
|
|
167
141
|
}]
|
|
168
142
|
}] });
|
|
169
143
|
|
|
@@ -171,5 +145,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
171
145
|
* Generated bundle index. Do not edit.
|
|
172
146
|
*/
|
|
173
147
|
|
|
174
|
-
export { AXPanViewDirective
|
|
148
|
+
export { AXPanViewDirective };
|
|
175
149
|
//# sourceMappingURL=acorex-cdk-pan-view.mjs.map
|
|
@@ -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/lib/pan-view.module.ts","../../../../libs/cdk/pan-view/src/acorex-cdk-pan-view.ts"],"sourcesContent":["import {\n afterNextRender,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n NgZone,\n output,\n Renderer2,\n signal,\n} from '@angular/core';\n\n@Directive({\n selector: '[axPanView]',\n exportAs: 'axPanView',\n standalone: false,\n})\nexport class AXPanViewDirective {\n private zone = inject(NgZone);\n private render = inject(Renderer2);\n private el = inject(ElementRef<HTMLElement>);\n\n private prevX = signal(0);\n private prevY = 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 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 private zoomValue = computed(() => {\n const zoomLevel = Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom()));\n return zoomLevel / 100;\n });\n\n #zoomChange = effect(() => {\n const zoomLevel = Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom()));\n this.zoomChange.emit(zoomLevel);\n this.nativeEl().style.scale = this.zoomValue().toString();\n });\n #positionChange = effect(() => {\n this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px)`;\n this.positionChange.emit({ x: this.panX(), y: this.panY() });\n });\n #anr = afterNextRender(() => {\n // Create Wrapper\n this.createWrapper();\n // Wheel Event\n this.render.listen(this.wrapper(), 'wheel', (e: WheelEvent) => {\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 } else {\n if (this.disablePan()) return;\n this.panY.update((prev) => prev - e.deltaY / 3);\n }\n });\n // Pointer Down Event\n this.zone.runOutsideAngular(() => {\n this.render.listen(this.wrapper(), 'pointerdown', (e: PointerEvent) => {\n this.handlePointerDown(e);\n });\n // Pointer Move Event\n this.render.listen(this.wrapper(), 'pointermove', (e: PointerEvent) => {\n this.handlePointerMove(e);\n });\n // Pointer Up/Leave Event\n this.render.listen(this.wrapper(), 'pointerup', (e: PointerEvent) => {\n this.handlePointerUp(e);\n });\n this.render.listen(this.wrapper(), 'pointerleave', (e: PointerEvent) => {\n this.handlePointerUp(e);\n });\n });\n });\n\n private handleZoomChange(e: WheelEvent) {\n if (this.disableZoom()) return;\n if (e.deltaY > 0) {\n this.zoom.update((prev) => Math.min(this.maxZoom(), prev - this.zoomStep()));\n return;\n }\n this.zoom.update((prev) => Math.max(this.minZoom(), prev + this.zoomStep()));\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(), 'width', '100%');\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 const currentX = e.clientX;\n const currentY = e.clientY;\n this.prevX.set(currentX);\n this.prevY.set(currentY);\n }\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (this.pointerDown() && !this.disablePan()) {\n e.preventDefault();\n const currentX = e.clientX;\n const currentY = e.clientY;\n const deltaX = currentX - this.prevX();\n const deltaY = currentY - this.prevY();\n this.panX.update((prev) => prev + deltaX / this.zoomValue());\n this.panY.update((prev) => prev + deltaY / this.zoomValue());\n this.prevX.set(currentX);\n this.prevY.set(currentY);\n }\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (this.pointerDown() && !this.disablePan()) {\n e.preventDefault();\n this.pointerDown.set(false);\n this.wrapper().style.cursor = 'auto';\n }\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXPanViewDirective } from './pan-view.directive';\n\nconst COMPONENT = [AXPanViewDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXPanViewModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAoBa,kBAAkB,CAAA;AAL/B,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,IAAI,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AAA,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;;;ACZD;;AAEG;;;;"}
|
|
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 {\n afterNextRender,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n NgZone,\n output,\n Renderer2,\n signal,\n} 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 prevX = signal(0);\n private prevY = 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 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 private zoomValue = computed(() => {\n const zoomLevel = Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom()));\n return zoomLevel / 100;\n });\n\n #zoomChange = effect(() => {\n const zoomLevel = Math.max(this.minZoom(), Math.min(this.maxZoom(), this.zoom()));\n this.zoomChange.emit(zoomLevel);\n this.nativeEl().style.scale = this.zoomValue().toString();\n });\n #positionChange = effect(() => {\n this.nativeEl().style.transform = `translate(${this.panX()}px, ${this.panY()}px)`;\n this.positionChange.emit({ x: this.panX(), y: this.panY() });\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 } else {\n if (this.disablePan()) return;\n this.panY.update((prev) => prev - e.deltaY / 3);\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 });\n\n private handleZoomChange(e: WheelEvent) {\n if (this.disableZoom()) return;\n if (e.deltaY > 0) {\n this.zoom.update((prev) => Math.min(this.maxZoom(), prev - this.zoomStep()));\n return;\n }\n this.zoom.update((prev) => Math.max(this.minZoom(), prev + this.zoomStep()));\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 const currentX = e.clientX;\n const currentY = e.clientY;\n this.prevX.set(currentX);\n this.prevY.set(currentY);\n }\n }\n\n private handlePointerMove(e: PointerEvent) {\n if (this.pointerDown() && !this.disablePan()) {\n e.preventDefault();\n const currentX = e.clientX;\n const currentY = e.clientY;\n const deltaX = currentX - this.prevX();\n const deltaY = currentY - this.prevY();\n this.panX.update((prev) => prev + deltaX / this.zoomValue());\n this.panY.update((prev) => prev + deltaY / this.zoomValue());\n this.prevX.set(currentX);\n this.prevY.set(currentY);\n }\n }\n\n private handlePointerUp(e: PointerEvent) {\n if (this.pointerDown() && !this.disablePan()) {\n e.preventDefault();\n this.pointerDown.set(false);\n this.wrapper().style.cursor = 'auto';\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAqBa,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,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AACjB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AACjB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,C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AA,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;kBAL9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,WAAW;AACrB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACpBD;;AAEG;;;;"}
|
|
@@ -38,14 +38,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImpor
|
|
|
38
38
|
|
|
39
39
|
class AXSelectionGroupDirective {
|
|
40
40
|
constructor() {
|
|
41
|
+
this.content = contentChildren(AXSelectionItemDirective, { descendants: true });
|
|
41
42
|
this.activeIndex = signal(null);
|
|
42
43
|
this.multiple = input(false);
|
|
44
|
+
this.disable = input(false);
|
|
43
45
|
this.selectedKeys = input();
|
|
44
46
|
this.onSelectionChanged = output();
|
|
45
47
|
this.selectionItemsClass = contentChildren(AXSelectionItemDirective, { descendants: true });
|
|
46
48
|
this.#init = afterNextRender(() => {
|
|
47
49
|
this.selectionItemsClass().forEach((element) => {
|
|
48
50
|
element.onClick.subscribe((e) => {
|
|
51
|
+
if (this.disable())
|
|
52
|
+
return;
|
|
49
53
|
this.activeIndex.set(e.sender.key());
|
|
50
54
|
if (this.multiple()) {
|
|
51
55
|
element.toggle();
|
|
@@ -62,11 +66,33 @@ class AXSelectionGroupDirective {
|
|
|
62
66
|
});
|
|
63
67
|
});
|
|
64
68
|
this.#effect = effect(() => {
|
|
69
|
+
if (!this.selectedKeys())
|
|
70
|
+
return;
|
|
71
|
+
if (typeof this.selectedKeys() === 'string' || typeof this.selectedKeys() === 'number') {
|
|
72
|
+
this.content().forEach((element) => {
|
|
73
|
+
element.isActive.set(false);
|
|
74
|
+
if (this.selectedKeys() === element.key()) {
|
|
75
|
+
element.isActive.set(true);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else if (this.selectedKeys() instanceof Array) {
|
|
80
|
+
this.selectedKeys().forEach((index) => {
|
|
81
|
+
this.content().forEach((element) => {
|
|
82
|
+
element.isActive.set(false);
|
|
83
|
+
if (index === element.key()) {
|
|
84
|
+
element.isActive.set(true);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
this.#effect2 = effect(() => {
|
|
65
91
|
if (!this.selectedKeys()) {
|
|
66
92
|
this.selectionItemsClass()[0].isActive.set(true);
|
|
67
93
|
}
|
|
68
94
|
});
|
|
69
|
-
this.#
|
|
95
|
+
this.#effect3 = effect(() => {
|
|
70
96
|
if (!this.activeIndex())
|
|
71
97
|
return;
|
|
72
98
|
if (this.multiple()) {
|
|
@@ -84,28 +110,9 @@ class AXSelectionGroupDirective {
|
|
|
84
110
|
});
|
|
85
111
|
}
|
|
86
112
|
#init;
|
|
87
|
-
ngAfterContentInit() {
|
|
88
|
-
if (!this.selectedKeys())
|
|
89
|
-
return;
|
|
90
|
-
if (typeof this.selectedKeys() === 'string') {
|
|
91
|
-
this.selectionItemsClass().forEach((element) => {
|
|
92
|
-
if (this.selectedKeys() === element.key()) {
|
|
93
|
-
element.isActive.set(true);
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
else if (this.selectedKeys() instanceof Array) {
|
|
98
|
-
this.selectedKeys().forEach((index) => {
|
|
99
|
-
this.selectionItemsClass().forEach((element) => {
|
|
100
|
-
if (index === element.key()) {
|
|
101
|
-
element.isActive.set(true);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
113
|
#effect;
|
|
108
114
|
#effect2;
|
|
115
|
+
#effect3;
|
|
109
116
|
activeItemByIndex(...restParams) {
|
|
110
117
|
this.selectionItemsClass().forEach((item) => item.isActive.set(false));
|
|
111
118
|
restParams.forEach((item) => {
|
|
@@ -113,7 +120,7 @@ class AXSelectionGroupDirective {
|
|
|
113
120
|
});
|
|
114
121
|
}
|
|
115
122
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSelectionGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
116
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.3", type: AXSelectionGroupDirective, isStandalone: false, selector: "[axSelectionGroup]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChanged: "onSelectionChanged" }, queries: [{ propertyName: "selectionItemsClass", predicate: AXSelectionItemDirective, descendants: true, isSignal: true }], exportAs: ["axSelectionGroup"], ngImport: i0 }); }
|
|
123
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.3", type: AXSelectionGroupDirective, isStandalone: false, selector: "[axSelectionGroup]", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, disable: { classPropertyName: "disable", publicName: "disable", isSignal: true, isRequired: false, transformFunction: null }, selectedKeys: { classPropertyName: "selectedKeys", publicName: "selectedKeys", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSelectionChanged: "onSelectionChanged" }, queries: [{ propertyName: "content", predicate: AXSelectionItemDirective, descendants: true, isSignal: true }, { propertyName: "selectionItemsClass", predicate: AXSelectionItemDirective, descendants: true, isSignal: true }], exportAs: ["axSelectionGroup"], ngImport: i0 }); }
|
|
117
124
|
}
|
|
118
125
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSelectionGroupDirective, decorators: [{
|
|
119
126
|
type: Directive,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-selection.mjs","sources":["../../../../libs/cdk/selection/src/lib/selection-item.directive.ts","../../../../libs/cdk/selection/src/lib/selection-group.directive.ts","../../../../libs/cdk/selection/src/lib/selection.module.ts","../../../../libs/cdk/selection/src/acorex-cdk-selection.ts"],"sourcesContent":["import { afterNextRender, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n@Directive({\n selector: '[axSelectionItem]',\n exportAs: 'axSelectionItem',\n standalone: false,\n})\nexport class AXSelectionItemDirective {\n private elm = inject(ElementRef);\n isActive = signal(false);\n onClick = output<{ sender: AXSelectionItemDirective }>();\n key = input.required<string>();\n\n #init = afterNextRender(() => {\n (this.elm.nativeElement as HTMLElement).onclick = () => {\n this.onClick.emit({ sender: this });\n };\n });\n\n public toggle() {\n this.isActive.update((prev) => !prev);\n }\n public select() {\n this.isActive.set(true);\n }\n public unselect() {\n this.isActive.set(false);\n }\n}\n","import {\n AfterContentInit,\n afterNextRender,\n contentChildren,\n Directive,\n effect,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\n@Directive({\n selector: '[axSelectionGroup]',\n standalone: false,\n exportAs: 'axSelectionGroup',\n})\nexport class AXSelectionGroupDirective implements AfterContentInit {\n private activeIndex = signal(null);\n multiple = input(false);\n selectedKeys = input<string | string[]>();\n onSelectionChanged = output<{ sender: AXSelectionGroupDirective; selectedKeys: string[] }>();\n selectionItemsClass = contentChildren(AXSelectionItemDirective, { descendants: true });\n\n #init = afterNextRender(() => {\n this.selectionItemsClass().forEach((element) => {\n element.onClick.subscribe((e) => {\n this.activeIndex.set(e.sender.key());\n if (this.multiple()) {\n element.toggle();\n } else {\n this.selectionItemsClass().forEach((element) => {\n if (element.key() !== this.activeIndex()) {\n element.unselect();\n }\n });\n element.select();\n }\n });\n });\n });\n\n ngAfterContentInit(): void {\n if (!this.selectedKeys()) return;\n if (typeof this.selectedKeys() === 'string') {\n this.selectionItemsClass().forEach((element) => {\n if (this.selectedKeys() === element.key()) {\n element.isActive.set(true);\n }\n });\n } else if (this.selectedKeys() instanceof Array) {\n (this.selectedKeys() as Array<string>).forEach((index) => {\n this.selectionItemsClass().forEach((element) => {\n if (index === element.key()) {\n element.isActive.set(true);\n }\n });\n });\n }\n }\n\n #effect = effect(() => {\n if (!this.selectedKeys()) {\n this.selectionItemsClass()[0].isActive.set(true);\n }\n });\n\n #effect2 = effect(() => {\n if (!this.activeIndex()) return;\n if (this.multiple()) {\n const selectedKeys = [];\n this.selectionItemsClass().forEach((item) => {\n if (item.isActive()) {\n selectedKeys.push(item.key());\n }\n });\n this.onSelectionChanged.emit({ sender: this, selectedKeys: selectedKeys });\n } else {\n this.onSelectionChanged.emit({ sender: this, selectedKeys: [this.activeIndex()] });\n }\n });\n\n activeItemByIndex(...restParams: number[]) {\n this.selectionItemsClass().forEach((item) => item.isActive.set(false));\n restParams.forEach((item) => {\n this.selectionItemsClass()[item].isActive.set(true);\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSelectionGroupDirective } from './selection-group.directive';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\nconst COMPONENT = [AXSelectionGroupDirective, AXSelectionItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSelectionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,wBAAwB,CAAA;AALrC,IAAA,WAAA,GAAA;AAMU,QAAA,IAAA,CAAA,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;QACxB,IAAO,CAAA,OAAA,GAAG,MAAM,EAAwC;AACxD,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK,CAAC,QAAQ,EAAU;AAE9B,QAAA,IAAA,CAAA,KAAK,GAAG,eAAe,CAAC,MAAK;YAC1B,IAAI,CAAC,GAAG,CAAC,aAA6B,CAAC,OAAO,GAAG,MAAK;gBACrD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AACrC,aAAC;AACH,SAAC,CAAC;AAWH;AAfC,IAAA,KAAK;IAME,MAAM,GAAA;AACX,QAAA,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC;;IAEhC,MAAM,GAAA;AACX,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;;IAElB,QAAQ,GAAA;AACb,QAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;;8GAnBf,wBAAwB,EAAA,IAAA,EAAA,EAA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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;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-selection.mjs","sources":["../../../../libs/cdk/selection/src/lib/selection-item.directive.ts","../../../../libs/cdk/selection/src/lib/selection-group.directive.ts","../../../../libs/cdk/selection/src/lib/selection.module.ts","../../../../libs/cdk/selection/src/acorex-cdk-selection.ts"],"sourcesContent":["import { afterNextRender, Directive, ElementRef, inject, input, output, signal } from '@angular/core';\n\n@Directive({\n selector: '[axSelectionItem]',\n exportAs: 'axSelectionItem',\n standalone: false,\n})\nexport class AXSelectionItemDirective {\n private elm = inject(ElementRef);\n isActive = signal(false);\n onClick = output<{ sender: AXSelectionItemDirective }>();\n key = input.required<string | number>();\n\n #init = afterNextRender(() => {\n (this.elm.nativeElement as HTMLElement).onclick = () => {\n this.onClick.emit({ sender: this });\n };\n });\n\n public toggle() {\n this.isActive.update((prev) => !prev);\n }\n public select() {\n this.isActive.set(true);\n }\n public unselect() {\n this.isActive.set(false);\n }\n}\n","import { afterNextRender, contentChildren, Directive, effect, input, output, signal } from '@angular/core';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\n@Directive({\n selector: '[axSelectionGroup]',\n standalone: false,\n exportAs: 'axSelectionGroup',\n})\nexport class AXSelectionGroupDirective {\n private content = contentChildren(AXSelectionItemDirective, { descendants: true });\n private activeIndex = signal(null);\n multiple = input(false);\n disable = input(false);\n selectedKeys = input<string | string[] | number | number[]>();\n onSelectionChanged = output<{ sender: AXSelectionGroupDirective; selectedKeys: string[] }>();\n selectionItemsClass = contentChildren(AXSelectionItemDirective, { descendants: true });\n\n #init = afterNextRender(() => {\n this.selectionItemsClass().forEach((element) => {\n element.onClick.subscribe((e) => {\n if (this.disable()) return;\n this.activeIndex.set(e.sender.key());\n if (this.multiple()) {\n element.toggle();\n } else {\n this.selectionItemsClass().forEach((element) => {\n if (element.key() !== this.activeIndex()) {\n element.unselect();\n }\n });\n element.select();\n }\n });\n });\n });\n\n #effect = effect(() => {\n if (!this.selectedKeys()) return;\n\n if (typeof this.selectedKeys() === 'string' || typeof this.selectedKeys() === 'number') {\n this.content().forEach((element) => {\n element.isActive.set(false);\n if (this.selectedKeys() === element.key()) {\n element.isActive.set(true);\n }\n });\n } else if (this.selectedKeys() instanceof Array) {\n (this.selectedKeys() as Array<string>).forEach((index) => {\n this.content().forEach((element) => {\n element.isActive.set(false);\n if (index === element.key()) {\n element.isActive.set(true);\n }\n });\n });\n }\n });\n\n #effect2 = effect(() => {\n if (!this.selectedKeys()) {\n this.selectionItemsClass()[0].isActive.set(true);\n }\n });\n\n #effect3 = effect(() => {\n if (!this.activeIndex()) return;\n if (this.multiple()) {\n const selectedKeys = [];\n this.selectionItemsClass().forEach((item) => {\n if (item.isActive()) {\n selectedKeys.push(item.key());\n }\n });\n this.onSelectionChanged.emit({ sender: this, selectedKeys: selectedKeys });\n } else {\n this.onSelectionChanged.emit({ sender: this, selectedKeys: [this.activeIndex()] });\n }\n });\n\n activeItemByIndex(...restParams: number[]) {\n this.selectionItemsClass().forEach((item) => item.isActive.set(false));\n restParams.forEach((item) => {\n this.selectionItemsClass()[item].isActive.set(true);\n });\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSelectionGroupDirective } from './selection-group.directive';\nimport { AXSelectionItemDirective } from './selection-item.directive';\n\nconst COMPONENT = [AXSelectionGroupDirective, AXSelectionItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSelectionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],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,kBAAkB;AAC7B,iBAAA;;;ACFD,MAAM,SAAS,GAAG,CAAC,yBAAyB,EAAE,wBAAwB,CAAC;AACvE,MAAM,OAAO,GAAG,CAAC,YAAY,CAAC;MAQjB,iBAAiB,CAAA;8GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAjB,iBAAiB,EAAA,YAAA,EAAA,CATX,yBAAyB,EAAE,wBAAwB,aACrD,YAAY,CAAA,EAAA,OAAA,EAAA,CADV,yBAAyB,EAAE,wBAAwB,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,iBAAiB,YAJf,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAN7B,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;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, signal, effect, afterNextRender, Directive, NgModule } from '@angular/core';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
|
|
5
|
+
class AXSlidingItemDirective {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.hostElement = inject(ElementRef);
|
|
8
|
+
this.isMouseDown = signal(false);
|
|
9
|
+
this.prevX = signal(0);
|
|
10
|
+
this.currentX = signal(0);
|
|
11
|
+
this.stopPoint = signal(0);
|
|
12
|
+
this.#positionChange = effect(() => {
|
|
13
|
+
this.setPosition(this.currentX());
|
|
14
|
+
});
|
|
15
|
+
this.#init = afterNextRender(() => {
|
|
16
|
+
const el = this.hostElement.nativeElement.parentElement;
|
|
17
|
+
el.style.display = 'flex';
|
|
18
|
+
el.style.justifyContent = 'space-between';
|
|
19
|
+
el.style.position = 'relative';
|
|
20
|
+
el.style.overflow = 'hidden';
|
|
21
|
+
});
|
|
22
|
+
this.#effect2 = effect(() => {
|
|
23
|
+
this.hostElement.nativeElement.style.position = 'absolute';
|
|
24
|
+
this.hostElement.nativeElement.style.top = '0';
|
|
25
|
+
this.hostElement.nativeElement.style.left = '0';
|
|
26
|
+
this.hostElement.nativeElement.style.width = '100%';
|
|
27
|
+
this.hostElement.nativeElement.style.height = '100%';
|
|
28
|
+
this.hostElement.nativeElement.style.zIndex = '1';
|
|
29
|
+
this.hostElement.nativeElement.style.cursor = 'grab';
|
|
30
|
+
this.hostElement.nativeElement.style.userSelect = 'none';
|
|
31
|
+
this.hostElement.nativeElement.style.touchAction = 'none';
|
|
32
|
+
this.hostElement.nativeElement.onpointerdown = (e) => {
|
|
33
|
+
this.hostElement.nativeElement.style.transition = 'none';
|
|
34
|
+
this.hostElement.nativeElement.style.cursor = 'grabbing';
|
|
35
|
+
this.isMouseDown.set(true);
|
|
36
|
+
this.prevX.set(e.clientX);
|
|
37
|
+
};
|
|
38
|
+
this.hostElement.nativeElement.onpointermove = (e) => {
|
|
39
|
+
if (!this.isMouseDown())
|
|
40
|
+
return;
|
|
41
|
+
const currentX = e.clientX;
|
|
42
|
+
const deltaX = currentX - this.prevX();
|
|
43
|
+
this.currentX.update((prev) => prev + deltaX);
|
|
44
|
+
this.prevX.set(currentX);
|
|
45
|
+
};
|
|
46
|
+
this.hostElement.nativeElement.onpointerup = () => {
|
|
47
|
+
this.isMouseDown.set(false);
|
|
48
|
+
this.dismiss();
|
|
49
|
+
};
|
|
50
|
+
this.hostElement.nativeElement.onpointerleave = () => {
|
|
51
|
+
if (!this.isMouseDown())
|
|
52
|
+
return;
|
|
53
|
+
this.isMouseDown.set(false);
|
|
54
|
+
this.dismiss();
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
#positionChange;
|
|
59
|
+
#init;
|
|
60
|
+
#effect2;
|
|
61
|
+
dismiss() {
|
|
62
|
+
const el = this.hostElement.nativeElement;
|
|
63
|
+
this.hostElement.nativeElement.style.transition = '.5s transform ease';
|
|
64
|
+
el.style.cursor = 'grab';
|
|
65
|
+
if (this.stopPoint()) {
|
|
66
|
+
el.style.transform = `translate(${this.stopPoint()}, 0)`;
|
|
67
|
+
this.currentX.set(this.stopPoint());
|
|
68
|
+
this.prevX.set(this.stopPoint());
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
el.style.transform = `translate(0, 0)`;
|
|
72
|
+
this.currentX.set(0);
|
|
73
|
+
this.prevX.set(0);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
setPosition(pos) {
|
|
77
|
+
const el = this.hostElement.nativeElement;
|
|
78
|
+
el.style.transform = `translate(${pos}px, 0)`;
|
|
79
|
+
}
|
|
80
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
81
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.3", type: AXSlidingItemDirective, isStandalone: false, selector: "[axSlidingItem]", ngImport: i0 }); }
|
|
82
|
+
}
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirective, decorators: [{
|
|
84
|
+
type: Directive,
|
|
85
|
+
args: [{
|
|
86
|
+
selector: '[axSlidingItem]',
|
|
87
|
+
standalone: false,
|
|
88
|
+
}]
|
|
89
|
+
}] });
|
|
90
|
+
|
|
91
|
+
const COMPONENT = [AXSlidingItemDirective];
|
|
92
|
+
const MODULES = [CommonModule];
|
|
93
|
+
class AXSlidingItemDirectiveModule {
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
95
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirectiveModule, declarations: [AXSlidingItemDirective], imports: [CommonModule], exports: [AXSlidingItemDirective] }); }
|
|
96
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirectiveModule, imports: [MODULES] }); }
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXSlidingItemDirectiveModule, decorators: [{
|
|
99
|
+
type: NgModule,
|
|
100
|
+
args: [{
|
|
101
|
+
declarations: [...COMPONENT],
|
|
102
|
+
imports: [...MODULES],
|
|
103
|
+
exports: [...COMPONENT],
|
|
104
|
+
providers: [],
|
|
105
|
+
}]
|
|
106
|
+
}] });
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Generated bundle index. Do not edit.
|
|
110
|
+
*/
|
|
111
|
+
|
|
112
|
+
export { AXSlidingItemDirective, AXSlidingItemDirectiveModule };
|
|
113
|
+
//# sourceMappingURL=acorex-cdk-sliding-item.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-cdk-sliding-item.mjs","sources":["../../../../libs/cdk/sliding-item/src/lib/sliding-item.directive.ts","../../../../libs/cdk/sliding-item/src/lib/sliding-item.module.ts","../../../../libs/cdk/sliding-item/src/acorex-cdk-sliding-item.ts"],"sourcesContent":["import { afterNextRender, Directive, effect, ElementRef, inject, signal } from '@angular/core';\n\n@Directive({\n selector: '[axSlidingItem]',\n standalone: false,\n})\nexport class AXSlidingItemDirective {\n private hostElement = inject(ElementRef);\n private isMouseDown = signal(false);\n private prevX = signal(0);\n currentX = signal(0);\n stopPoint = signal(0);\n\n #positionChange = effect(() => {\n this.setPosition(this.currentX());\n });\n\n #init = afterNextRender(() => {\n const el = (this.hostElement.nativeElement as HTMLElement).parentElement;\n el.style.display = 'flex';\n el.style.justifyContent = 'space-between';\n el.style.position = 'relative';\n el.style.overflow = 'hidden';\n });\n\n #effect2 = effect(() => {\n this.hostElement.nativeElement.style.position = 'absolute';\n this.hostElement.nativeElement.style.top = '0';\n this.hostElement.nativeElement.style.left = '0';\n this.hostElement.nativeElement.style.width = '100%';\n this.hostElement.nativeElement.style.height = '100%';\n this.hostElement.nativeElement.style.zIndex = '1';\n this.hostElement.nativeElement.style.cursor = 'grab';\n this.hostElement.nativeElement.style.userSelect = 'none';\n this.hostElement.nativeElement.style.touchAction = 'none';\n\n this.hostElement.nativeElement.onpointerdown = (e: PointerEvent) => {\n this.hostElement.nativeElement.style.transition = 'none';\n this.hostElement.nativeElement.style.cursor = 'grabbing';\n this.isMouseDown.set(true);\n this.prevX.set(e.clientX);\n };\n\n this.hostElement.nativeElement.onpointermove = (e: PointerEvent) => {\n if (!this.isMouseDown()) return;\n const currentX = e.clientX;\n const deltaX = currentX - this.prevX();\n this.currentX.update((prev) => prev + deltaX);\n this.prevX.set(currentX);\n };\n\n this.hostElement.nativeElement.onpointerup = () => {\n this.isMouseDown.set(false);\n this.dismiss();\n };\n\n this.hostElement.nativeElement.onpointerleave = () => {\n if (!this.isMouseDown()) return;\n this.isMouseDown.set(false);\n this.dismiss();\n };\n });\n\n private dismiss() {\n const el = this.hostElement.nativeElement as HTMLElement;\n this.hostElement.nativeElement.style.transition = '.5s transform ease';\n el.style.cursor = 'grab';\n\n if (this.stopPoint()) {\n el.style.transform = `translate(${this.stopPoint()}, 0)`;\n this.currentX.set(this.stopPoint());\n this.prevX.set(this.stopPoint());\n } else {\n el.style.transform = `translate(0, 0)`;\n this.currentX.set(0);\n this.prevX.set(0);\n }\n }\n\n setPosition(pos: number) {\n const el = this.hostElement.nativeElement as HTMLElement;\n el.style.transform = `translate(${pos}px, 0)`;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXSlidingItemDirective } from './sliding-item.directive';\n\nconst COMPONENT = [AXSlidingItemDirective];\nconst MODULES = [CommonModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXSlidingItemDirectiveModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAMa,sBAAsB,CAAA;AAJnC,IAAA,WAAA,GAAA;AAKU,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC;AAChC,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;AAC3B,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC;AACzB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC;AACpB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC;AAErB,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAAC,MAAK;YAC5B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;AACnC,SAAC,CAAC;AAEF,QAAA,IAAA,CAAA,KAAK,GAAG,eAAe,CAAC,MAAK;YAC3B,MAAM,EAAE,GAAI,IAAI,CAAC,WAAW,CAAC,aAA6B,CAAC,aAAa;AACxE,YAAA,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM;AACzB,YAAA,EAAE,CAAC,KAAK,CAAC,cAAc,GAAG,eAAe;AACzC,YAAA,EAAE,CAAC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ATtB,YAAA,EAAA,CAAA,sBAAsB,CACxB,EAAA,OAAA,EAAA,CAAA,YAAY,aADV,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAS5B,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,4BAA4B,YAJ1B,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBANxC,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;;;ACZD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/cdk",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.10.0-next.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": ">=19.0.0",
|
|
6
6
|
"@angular/core": ">=19.0.0",
|
|
@@ -51,6 +51,10 @@
|
|
|
51
51
|
"types": "./selection/index.d.ts",
|
|
52
52
|
"default": "./fesm2022/acorex-cdk-selection.mjs"
|
|
53
53
|
},
|
|
54
|
+
"./sliding-item": {
|
|
55
|
+
"types": "./sliding-item/index.d.ts",
|
|
56
|
+
"default": "./fesm2022/acorex-cdk-sliding-item.mjs"
|
|
57
|
+
},
|
|
54
58
|
"./sticky": {
|
|
55
59
|
"types": "./sticky/index.d.ts",
|
|
56
60
|
"default": "./fesm2022/acorex-cdk-sticky.mjs"
|
package/pan-view/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare class AXPanViewDirective {
|
|
|
3
3
|
#private;
|
|
4
4
|
private zone;
|
|
5
5
|
private render;
|
|
6
|
+
private document;
|
|
6
7
|
private el;
|
|
7
8
|
private prevX;
|
|
8
9
|
private prevY;
|
|
@@ -30,5 +31,5 @@ export declare class AXPanViewDirective {
|
|
|
30
31
|
private handlePointerMove;
|
|
31
32
|
private handlePointerUp;
|
|
32
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXPanViewDirective, never>;
|
|
33
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXPanViewDirective, "[axPanView]", ["axPanView"], { "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "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,
|
|
34
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXPanViewDirective, "[axPanView]", ["axPanView"], { "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "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>;
|
|
34
35
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { AfterContentInit } from '@angular/core';
|
|
2
1
|
import { AXSelectionItemDirective } from './selection-item.directive';
|
|
3
2
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class AXSelectionGroupDirective
|
|
3
|
+
export declare class AXSelectionGroupDirective {
|
|
5
4
|
#private;
|
|
5
|
+
private content;
|
|
6
6
|
private activeIndex;
|
|
7
7
|
multiple: import("@angular/core").InputSignal<boolean>;
|
|
8
|
-
|
|
8
|
+
disable: import("@angular/core").InputSignal<boolean>;
|
|
9
|
+
selectedKeys: import("@angular/core").InputSignal<string | number | string[] | number[]>;
|
|
9
10
|
onSelectionChanged: import("@angular/core").OutputEmitterRef<{
|
|
10
11
|
sender: AXSelectionGroupDirective;
|
|
11
12
|
selectedKeys: string[];
|
|
12
13
|
}>;
|
|
13
14
|
selectionItemsClass: import("@angular/core").Signal<readonly AXSelectionItemDirective[]>;
|
|
14
|
-
ngAfterContentInit(): void;
|
|
15
15
|
activeItemByIndex(...restParams: number[]): void;
|
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXSelectionGroupDirective, never>;
|
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXSelectionGroupDirective, "[axSelectionGroup]", ["axSelectionGroup"], { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "selectedKeys": { "alias": "selectedKeys"; "required": false; "isSignal": true; }; }, { "onSelectionChanged": "onSelectionChanged"; }, ["selectionItemsClass"], never, false, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXSelectionGroupDirective, "[axSelectionGroup]", ["axSelectionGroup"], { "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "disable": { "alias": "disable"; "required": false; "isSignal": true; }; "selectedKeys": { "alias": "selectedKeys"; "required": false; "isSignal": true; }; }, { "onSelectionChanged": "onSelectionChanged"; }, ["content", "selectionItemsClass"], never, false, never>;
|
|
18
18
|
}
|
|
@@ -6,7 +6,7 @@ export declare class AXSelectionItemDirective {
|
|
|
6
6
|
onClick: import("@angular/core").OutputEmitterRef<{
|
|
7
7
|
sender: AXSelectionItemDirective;
|
|
8
8
|
}>;
|
|
9
|
-
key: import("@angular/core").InputSignal<string>;
|
|
9
|
+
key: import("@angular/core").InputSignal<string | number>;
|
|
10
10
|
toggle(): void;
|
|
11
11
|
select(): void;
|
|
12
12
|
unselect(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class AXSlidingItemDirective {
|
|
3
|
+
#private;
|
|
4
|
+
private hostElement;
|
|
5
|
+
private isMouseDown;
|
|
6
|
+
private prevX;
|
|
7
|
+
currentX: import("@angular/core").WritableSignal<number>;
|
|
8
|
+
stopPoint: import("@angular/core").WritableSignal<number>;
|
|
9
|
+
private dismiss;
|
|
10
|
+
setPosition(pos: number): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXSlidingItemDirective, never>;
|
|
12
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AXSlidingItemDirective, "[axSlidingItem]", never, {}, {}, never, never, false, never>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./sliding-item.directive";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class AXSlidingItemDirectiveModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXSlidingItemDirectiveModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXSlidingItemDirectiveModule, [typeof i1.AXSlidingItemDirective], [typeof i2.CommonModule], [typeof i1.AXSlidingItemDirective]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXSlidingItemDirectiveModule>;
|
|
8
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./pan-view.directive";
|
|
3
|
-
import * as i2 from "@angular/common";
|
|
4
|
-
export declare class AXPanViewModule {
|
|
5
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXPanViewModule, never>;
|
|
6
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AXPanViewModule, [typeof i1.AXPanViewDirective], [typeof i2.CommonModule], [typeof i1.AXPanViewDirective]>;
|
|
7
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<AXPanViewModule>;
|
|
8
|
-
}
|