ngx-kit 7.4.0 → 8.0.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/drag-resize/README.md +25 -3
- package/fesm2022/ngx-kit-data-table.mjs +3 -3
- package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +11 -7
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drag-resize.mjs +1311 -406
- package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -1
- package/fesm2022/ngx-kit-image-viewer.mjs +348 -0
- package/fesm2022/ngx-kit-image-viewer.mjs.map +1 -0
- package/fesm2022/ngx-kit-notify.mjs +2 -2
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-side-nav.mjs +170 -0
- package/fesm2022/ngx-kit-side-nav.mjs.map +1 -0
- package/{gallery → image-viewer}/README.md +43 -7
- package/package.json +9 -9
- package/side-nav/README.md +11 -0
- package/types/ngx-kit-dialog.d.ts +6 -2
- package/types/ngx-kit-drag-resize.d.ts +135 -39
- package/types/{ngx-kit-gallery.d.ts → ngx-kit-image-viewer.d.ts} +5 -39
- package/types/ngx-kit-side-nav.d.ts +53 -0
- package/drawer-menu/README.md +0 -125
- package/fesm2022/ngx-kit-drawer-menu.mjs +0 -456
- package/fesm2022/ngx-kit-drawer-menu.mjs.map +0 -1
- package/fesm2022/ngx-kit-gallery.mjs +0 -419
- package/fesm2022/ngx-kit-gallery.mjs.map +0 -1
- package/types/ngx-kit-drawer-menu.d.ts +0 -161
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef, EventEmitter, InjectionToken, OnInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core';
|
|
2
|
+
import { TemplateRef, EventEmitter, InjectionToken, OnInit, OnDestroy, ElementRef, Renderer2, AfterContentInit, Injector } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
interface IPosition {
|
|
5
5
|
x: number;
|
|
@@ -12,6 +12,7 @@ interface IPosition {
|
|
|
12
12
|
* Lists register themselves automatically when `NgxDropListGroup` wraps them.
|
|
13
13
|
*/
|
|
14
14
|
declare class DropListGroupRef {
|
|
15
|
+
el?: HTMLElement;
|
|
15
16
|
readonly lists: Set<DropListRef<any>>;
|
|
16
17
|
add(list: DropListRef<any>): void;
|
|
17
18
|
remove(list: DropListRef<any>): void;
|
|
@@ -23,16 +24,26 @@ declare class PlaceHolderRef {
|
|
|
23
24
|
dropList?: DropListRef;
|
|
24
25
|
element?: HTMLElement;
|
|
25
26
|
private _visible;
|
|
27
|
+
/**
|
|
28
|
+
* Angular embedded view created from `tpl`.
|
|
29
|
+
*/
|
|
30
|
+
private _view?;
|
|
26
31
|
attach(container: HTMLElement, source: HTMLElement, reference?: Node | null): HTMLElement;
|
|
27
32
|
detach(): void;
|
|
28
33
|
get visible(): boolean;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
37
|
+
* A drop list.
|
|
38
|
+
*
|
|
39
|
+
* Membership (`_draggables`) only ever reflects which draggables *belong* to this list in the
|
|
40
|
+
* template. It is never changed by dragging. Everything that is transient during a drag lives
|
|
41
|
+
* in a single `SortSession` (see sorting/sort-session.ts) that is created when a drag enters
|
|
42
|
+
* the list and disposed when it leaves or the drag ends:
|
|
43
|
+
*
|
|
44
|
+
* - the list the drag started in keeps its session for the whole drag (its placeholder holds
|
|
45
|
+
* the item's original slot, so leaving and re-entering is stable);
|
|
46
|
+
* - any other list gets a fresh session on every entry and drops it on every exit.
|
|
36
47
|
*/
|
|
37
48
|
declare class DropListRef<T = any> {
|
|
38
49
|
data?: T;
|
|
@@ -40,34 +51,98 @@ declare class DropListRef<T = any> {
|
|
|
40
51
|
disableSort: boolean;
|
|
41
52
|
connectedTo: HTMLElement[];
|
|
42
53
|
dropListGroup?: DropListGroupRef | null;
|
|
54
|
+
/** Duration (ms) of the sibling slide animation. `0` disables animation. */
|
|
55
|
+
sortAnimationDuration: number;
|
|
43
56
|
readonly _draggables: Set<DragRef<T>>;
|
|
44
57
|
readonly onDrop: EventEmitter<IDropEvent<T>>;
|
|
45
|
-
private
|
|
46
|
-
private active;
|
|
47
|
-
private previousIndex;
|
|
58
|
+
private session;
|
|
48
59
|
private placeholder?;
|
|
60
|
+
customPlaceholder?: PlaceHolderRef;
|
|
61
|
+
private activeDrag;
|
|
62
|
+
private isOrigin;
|
|
63
|
+
private hovered;
|
|
64
|
+
private hit;
|
|
65
|
+
/** Pre-insertion geometry of a foreign list, restored when the drag leaves it. */
|
|
66
|
+
private naturalHit;
|
|
67
|
+
private hitCached;
|
|
49
68
|
addItem(item: DragRef<T>): void;
|
|
50
69
|
removeItem(item: DragRef<T>): void;
|
|
51
70
|
isConnectedTo(other: DropListRef<any>): boolean;
|
|
71
|
+
/** Measure the list and its clipping ancestors once, at drag start. */
|
|
72
|
+
_cacheGeometry(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Is the point over the *visible* part of this list? Scroll-aware without re-measuring.
|
|
75
|
+
*
|
|
76
|
+
* The list box and every clipping ancestor are tracked separately because they react to scroll
|
|
77
|
+
* differently: scrolling a container moves the list but not the container's own clip window.
|
|
78
|
+
*/
|
|
79
|
+
_containsPoint(x: number, y: number): boolean;
|
|
80
|
+
/** Approximate area, used to break ties between overlapping, unrelated lists. */
|
|
81
|
+
_area(): number;
|
|
82
|
+
_onScroll(): void;
|
|
83
|
+
/** Re-measure after a viewport resize. */
|
|
84
|
+
_refresh(): void;
|
|
85
|
+
/** Backwards-compatible entry point: makes this list the drag's target. */
|
|
52
86
|
createPlaceholder(drag: DragRef<T>): PlaceHolderRef;
|
|
87
|
+
/** The drag pointer entered this list (or the drag started inside it). */
|
|
53
88
|
enter(drag: DragRef<T>, x?: number, y?: number): void;
|
|
89
|
+
/** Re-evaluate the insertion index for the pointer. Returns the new index, or null if unchanged. */
|
|
54
90
|
sortItem(drag: DragRef<T>, position: IPosition): number | null;
|
|
91
|
+
/** The pointer left this list. */
|
|
92
|
+
exit(drag: DragRef<T>): void;
|
|
93
|
+
/**
|
|
94
|
+
* Ends the drag for this list. Returns the drop event when the pointer was released over this
|
|
95
|
+
* list, `null` otherwise (nothing to emit). All transient state is disposed either way.
|
|
96
|
+
*/
|
|
97
|
+
_finish(drag: DragRef<T>, commit: boolean): IDropEvent<T> | null;
|
|
98
|
+
/** Compatibility wrapper: finish + emit. */
|
|
55
99
|
finishDrag(drag: DragRef<T>): void;
|
|
56
|
-
exit(_drag: DragRef<T>): void;
|
|
57
100
|
resetSortTransforms(): void;
|
|
58
101
|
getFinalIndex(): number;
|
|
59
102
|
getItemIndex(item: DragRef<T>): number;
|
|
103
|
+
/** End of the drag: dispose EVERYTHING this list holds, including cached geometry. Idempotent. */
|
|
104
|
+
_release(drag?: DragRef<T>): void;
|
|
105
|
+
/** Dispose the sort session, placeholder and drag ownership. */
|
|
106
|
+
private releaseSession;
|
|
107
|
+
private begin;
|
|
108
|
+
/**
|
|
109
|
+
* First placement into a list that does not contain the item yet: the node the placeholder
|
|
110
|
+
* must be inserted before (null = append). Same pure resolver as sorting, no hysteresis.
|
|
111
|
+
*/
|
|
112
|
+
private foreignInsertionReference;
|
|
113
|
+
private otherSlots;
|
|
60
114
|
private indexOf;
|
|
61
|
-
private
|
|
62
|
-
|
|
115
|
+
private lockPlaceholderGeometry;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
declare class DragDropService {
|
|
119
|
+
readonly drags: _angular_core.WritableSignal<readonly DragRef<unknown>[]>;
|
|
120
|
+
readonly dropLists: _angular_core.WritableSignal<readonly DropListRef<any>[]>;
|
|
121
|
+
readonly activeDrag: _angular_core.WritableSignal<DragRef<unknown> | null>;
|
|
122
|
+
registerDragItem(ref: DragRef<any>): void;
|
|
123
|
+
removeDragItem(ref: DragRef<any>): void;
|
|
124
|
+
registerDropList(ref: DropListRef): void;
|
|
125
|
+
removeDropList(ref: DropListRef<any>): void;
|
|
126
|
+
begin(ref: DragRef<any>): void;
|
|
127
|
+
end(ref: DragRef<any>): void;
|
|
128
|
+
cancelActive(): void;
|
|
63
129
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
130
|
+
* Which drop list is under `point`?
|
|
131
|
+
*
|
|
132
|
+
* - Only lists connected to the drag's ORIGIN list qualify (connectivity is not transitive, so
|
|
133
|
+
* A→B→C never lets an item hop A→C). Without an origin (a free-drag element) nothing
|
|
134
|
+
* qualifies: free dragging is never captured by a list.
|
|
135
|
+
* - Only the visible (clip-aware) part of a list counts.
|
|
136
|
+
* - A list inside the dragged element itself is never a target.
|
|
137
|
+
* - Nested lists: the innermost qualifying list wins. Among unrelated overlapping lists the
|
|
138
|
+
* current one is kept (no flicker), otherwise the smallest.
|
|
67
139
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
140
|
+
findDropList(point: {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
}, current?: DropListRef | null, origin?: DropListRef | null, dragEl?: HTMLElement | null): DropListRef | null;
|
|
144
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragDropService, never>;
|
|
145
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DragDropService>;
|
|
71
146
|
}
|
|
72
147
|
|
|
73
148
|
type DragAxis = 'x' | 'y' | undefined;
|
|
@@ -76,8 +151,16 @@ declare class DragRef<T = unknown> {
|
|
|
76
151
|
el: HTMLElement;
|
|
77
152
|
boundary?: HTMLElement;
|
|
78
153
|
lockAxis?: DragAxis;
|
|
154
|
+
/**
|
|
155
|
+
* The list this draggable BELONGS to (set by the template). Dragging never changes it.
|
|
156
|
+
* The list the pointer is currently over is `activeDropList`.
|
|
157
|
+
*/
|
|
79
158
|
dropList: DropListRef<T> | null;
|
|
80
159
|
dropListGroup?: DropListGroupRef | null;
|
|
160
|
+
/** Used to find the drop list under the pointer. Set by the directive; optional. */
|
|
161
|
+
service?: DragDropService;
|
|
162
|
+
/** Drop list currently under the pointer during a drop-list drag (null = outside every list). */
|
|
163
|
+
activeDropList: DropListRef<T> | null;
|
|
81
164
|
placeholder?: PlaceHolderRef;
|
|
82
165
|
originDropList: DropListRef<T> | null;
|
|
83
166
|
originIndex: number;
|
|
@@ -97,6 +180,13 @@ declare class DragRef<T = unknown> {
|
|
|
97
180
|
private sourceVisibility;
|
|
98
181
|
private sourceDisplay;
|
|
99
182
|
private sourcePointerEvents;
|
|
183
|
+
private sourceTransition;
|
|
184
|
+
/** True while a drop-list drag (body preview + placeholder) is in progress. Free drag: always false. */
|
|
185
|
+
private listDrag;
|
|
186
|
+
private cachedLists;
|
|
187
|
+
private lastEffective;
|
|
188
|
+
private scrollListener?;
|
|
189
|
+
private resizeListener?;
|
|
100
190
|
init(): void;
|
|
101
191
|
withDropList(list: DropListRef<T> | null): this;
|
|
102
192
|
clearDropList(): void;
|
|
@@ -106,6 +196,12 @@ declare class DragRef<T = unknown> {
|
|
|
106
196
|
nudge(dx: number, dy: number): void;
|
|
107
197
|
endDrag(): void;
|
|
108
198
|
cancelDrag(): void;
|
|
199
|
+
/** Abort without emitting anything (the directive was destroyed mid-drag). Idempotent. */
|
|
200
|
+
dispose(): void;
|
|
201
|
+
/** True while a drop-list drag is running. */
|
|
202
|
+
get isListDrag(): boolean;
|
|
203
|
+
/** Inline `display` the source element had before it was hidden for the drag. */
|
|
204
|
+
get originalDisplay(): string;
|
|
109
205
|
get x(): number;
|
|
110
206
|
get y(): number;
|
|
111
207
|
get pointer(): IPosition;
|
|
@@ -118,6 +214,15 @@ declare class DragRef<T = unknown> {
|
|
|
118
214
|
*/
|
|
119
215
|
notifyScroll(dx: number, dy: number): void;
|
|
120
216
|
private applyTransform;
|
|
217
|
+
private beginListDrag;
|
|
218
|
+
/** Decide which list is under the pointer, switch if needed, then re-sort in the active one. */
|
|
219
|
+
private updateDropTarget;
|
|
220
|
+
/**
|
|
221
|
+
* Single teardown path for every way a drop-list drag can end (drop on a list, drop outside,
|
|
222
|
+
* Escape, pointercancel, destroy). Everything transient is removed here, so nothing can leak
|
|
223
|
+
* regardless of how the drag ended. Only then is the drop event emitted.
|
|
224
|
+
*/
|
|
225
|
+
private finishListDrag;
|
|
121
226
|
private updatePreview;
|
|
122
227
|
}
|
|
123
228
|
|
|
@@ -148,25 +253,6 @@ interface IResizableOutput {
|
|
|
148
253
|
direction: ResizeDirection;
|
|
149
254
|
}
|
|
150
255
|
|
|
151
|
-
declare class DragDropService {
|
|
152
|
-
readonly drags: _angular_core.WritableSignal<readonly DragRef<unknown>[]>;
|
|
153
|
-
readonly dropLists: _angular_core.WritableSignal<readonly DropListRef<any>[]>;
|
|
154
|
-
readonly activeDrag: _angular_core.WritableSignal<DragRef<unknown> | null>;
|
|
155
|
-
registerDragItem(ref: DragRef<any>): void;
|
|
156
|
-
removeDragItem(ref: DragRef<any>): void;
|
|
157
|
-
registerDropList(ref: DropListRef): void;
|
|
158
|
-
removeDropList(ref: DropListRef<any>): void;
|
|
159
|
-
begin(ref: DragRef<any>): void;
|
|
160
|
-
end(ref: DragRef<any>): void;
|
|
161
|
-
cancelActive(): void;
|
|
162
|
-
findDropList(point: {
|
|
163
|
-
x: number;
|
|
164
|
-
y: number;
|
|
165
|
-
}, current?: DropListRef | null): DropListRef | null;
|
|
166
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DragDropService, never>;
|
|
167
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<DragDropService>;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
256
|
declare const NGX_DRAGGABLE: InjectionToken<NgxDraggable<unknown>>;
|
|
171
257
|
declare class NgxDraggable<T = unknown> implements OnInit, OnDestroy {
|
|
172
258
|
private readonly host;
|
|
@@ -205,6 +291,8 @@ declare class NgxDraggable<T = unknown> implements OnInit, OnDestroy {
|
|
|
205
291
|
private removeUp?;
|
|
206
292
|
private removeKeydown?;
|
|
207
293
|
private removeEscape?;
|
|
294
|
+
private removeCancel?;
|
|
295
|
+
private removeLostCapture?;
|
|
208
296
|
private scrollTarget;
|
|
209
297
|
private lastScroll;
|
|
210
298
|
private lastWindowScroll;
|
|
@@ -222,6 +310,8 @@ declare class NgxDraggable<T = unknown> implements OnInit, OnDestroy {
|
|
|
222
310
|
private stopScrollTracking;
|
|
223
311
|
private pointerMove;
|
|
224
312
|
private pointerUp;
|
|
313
|
+
/** Browser cancelled the pointer (touch takeover, lost capture...). */
|
|
314
|
+
private pointerCancel;
|
|
225
315
|
private cancel;
|
|
226
316
|
private finish;
|
|
227
317
|
/** Arrow-key movement for keyboard/assistive-tech users. Shift multiplies the step by 4. */
|
|
@@ -277,29 +367,35 @@ declare class NgxResizable {
|
|
|
277
367
|
}
|
|
278
368
|
|
|
279
369
|
declare const NGX_DROPLIST: InjectionToken<NgxDropList<any>>;
|
|
280
|
-
declare class NgxDropList<T = any> implements OnInit, OnDestroy {
|
|
370
|
+
declare class NgxDropList<T = any> implements OnInit, OnDestroy, AfterContentInit {
|
|
281
371
|
private readonly el;
|
|
282
372
|
readonly _ref: DropListRef<T>;
|
|
283
373
|
set data(value: T);
|
|
284
374
|
set connectedTo(value: HTMLElement[] | null | undefined);
|
|
285
375
|
set disableSort(value: boolean);
|
|
286
376
|
readonly drop: EventEmitter<IDropEvent<T>>;
|
|
377
|
+
private readonly customPlaceholder?;
|
|
378
|
+
private sub?;
|
|
287
379
|
private readonly service;
|
|
288
380
|
private readonly group;
|
|
289
381
|
constructor(el: ElementRef<HTMLElement>);
|
|
290
382
|
ngOnInit(): void;
|
|
383
|
+
ngAfterContentInit(): void;
|
|
291
384
|
ngOnDestroy(): void;
|
|
292
385
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxDropList<any>, never>;
|
|
293
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDropList<any>, "[NgxDropList],[ngxDropList]", never, { "data": { "alias": "data"; "required": false; }; "connectedTo": { "alias": "connectedTo"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; }, { "drop": "drop"; },
|
|
386
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDropList<any>, "[NgxDropList],[ngxDropList]", never, { "data": { "alias": "data"; "required": false; }; "connectedTo": { "alias": "connectedTo"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; }, { "drop": "drop"; }, ["customPlaceholder"], never, true, never>;
|
|
294
387
|
}
|
|
295
388
|
|
|
296
389
|
declare const NGX_DROPLIST_GROUP: InjectionToken<NgxDropListGroup>;
|
|
297
390
|
/** Wrap several `ngxDropList`s to let items move freely between them. */
|
|
298
391
|
declare class NgxDropListGroup implements OnDestroy {
|
|
299
392
|
readonly _ref: DropListGroupRef;
|
|
393
|
+
protected readonly el: ElementRef<any>;
|
|
394
|
+
injector: Injector;
|
|
395
|
+
constructor();
|
|
300
396
|
ngOnDestroy(): void;
|
|
301
397
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxDropListGroup, never>;
|
|
302
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDropListGroup, "[NgxDropListGroup],[ngxDropListGroup]",
|
|
398
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgxDropListGroup, "[NgxDropListGroup],[ngxDropListGroup]", ["ngxDropListGroup"], {}, {}, never, never, true, never>;
|
|
303
399
|
}
|
|
304
400
|
|
|
305
401
|
declare const NGX_PLACEHOLDER: InjectionToken<PlaceHolderRef>;
|
|
@@ -4,13 +4,8 @@ interface NgxImageViewerItem {
|
|
|
4
4
|
src: string;
|
|
5
5
|
alt?: string;
|
|
6
6
|
caption?: string;
|
|
7
|
-
/** نام فایل هنگام دانلود؛ نبود یعنی از روی src حدس زده میشه */
|
|
8
7
|
downloadFileName?: string;
|
|
9
8
|
}
|
|
10
|
-
/**
|
|
11
|
-
* هر دکمهی نوار ابزار جدا فعال/غیرفعال میشه — دقیقاً طبق خواسته: «این
|
|
12
|
-
* دکمههای کانفیگی باشه که هر کدوم خواست فعال کنه».
|
|
13
|
-
*/
|
|
14
9
|
interface NgxImageViewerToolbarConfig {
|
|
15
10
|
prevNext?: boolean;
|
|
16
11
|
counter?: boolean;
|
|
@@ -47,7 +42,7 @@ declare const NGX_IMAGE_VIEWER_DEFAULT_TOOLBAR: Required<NgxImageViewerToolbarCo
|
|
|
47
42
|
* ngx-kit/dialog (یا هر overlay دیگه) قرار بگیره — خودش به هیچکدوم وابسته
|
|
48
43
|
* نیست، فقط با closed خروجی به بیرون خبر میده که «ببندم».
|
|
49
44
|
*/
|
|
50
|
-
declare class
|
|
45
|
+
declare class NgxImageViewer {
|
|
51
46
|
images: _angular_core.InputSignal<NgxImageViewerItem[]>;
|
|
52
47
|
startIndex: _angular_core.InputSignal<number>;
|
|
53
48
|
toolbar: _angular_core.InputSignal<NgxImageViewerToolbarConfig>;
|
|
@@ -103,37 +98,8 @@ declare class NgxImageViewerComponent {
|
|
|
103
98
|
private applyZoomAt;
|
|
104
99
|
private clientXOf;
|
|
105
100
|
private clientYOf;
|
|
106
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<
|
|
107
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
interface NgxImageViewerOpenOptions {
|
|
111
|
-
startIndex?: number;
|
|
112
|
-
toolbar?: NgxImageViewerToolbarConfig;
|
|
113
|
-
minZoom?: number;
|
|
114
|
-
maxZoom?: number;
|
|
115
|
-
zoomStep?: number;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* راه میانبر برای وقتی که کاربر میخواد ویوئر رو داخل یه دیالوگِ تمامصفحه
|
|
119
|
-
* باز کنه، بدون اینکه خودش دستی wire کنه. اگه کسی میخواد داخل دیالوگِ
|
|
120
|
-
* خودش (مثلاً ngx-kit/dialog) بذارتش، کافیه مستقیم از NgxImageViewerComponent
|
|
121
|
-
* استفاده کنه — این سرویس صرفاً یه میانبَره، وابستگی اجباری نیست.
|
|
122
|
-
*
|
|
123
|
-
* دقیقاً همون الگوی امنشدهی NgxMessageService: با Map<id, ComponentRef> و
|
|
124
|
-
* detachView قبل از destroy، تا اون نشتی حافظهای که قبلاً توی message
|
|
125
|
-
* service پیدا و رفع شد، اینجا از اول تکرار نشه.
|
|
126
|
-
*/
|
|
127
|
-
declare class NgxImageViewerService {
|
|
128
|
-
private readonly appRef;
|
|
129
|
-
private readonly envInjector;
|
|
130
|
-
private nextId;
|
|
131
|
-
private readonly openInstances;
|
|
132
|
-
open(images: NgxImageViewerItem[], options?: NgxImageViewerOpenOptions): {
|
|
133
|
-
close: () => void;
|
|
134
|
-
};
|
|
135
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxImageViewerService, never>;
|
|
136
|
-
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgxImageViewerService>;
|
|
101
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxImageViewer, never>;
|
|
102
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxImageViewer, "ngx-image-viewer", never, { "images": { "alias": "images"; "required": true; "isSignal": true; }; "startIndex": { "alias": "startIndex"; "required": false; "isSignal": true; }; "toolbar": { "alias": "toolbar"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; }, { "indexChange": "indexChange"; "closed": "closed"; }, never, never, true, never>;
|
|
137
103
|
}
|
|
138
104
|
|
|
139
105
|
interface PanZoomState {
|
|
@@ -164,5 +130,5 @@ declare function downloadImage(src: string, filename?: string): Promise<void>;
|
|
|
164
130
|
/** یه پنجرهی جدید فقط با همون تصویر باز میکنه و بعد از لود، print میزنه؛ با DOM API (نه innerHTML) پس در برابر src مخرب امنه */
|
|
165
131
|
declare function printImage(src: string): void;
|
|
166
132
|
|
|
167
|
-
export { NGX_IMAGE_VIEWER_DEFAULT_TOOLBAR,
|
|
168
|
-
export type { NgxImageViewerItem,
|
|
133
|
+
export { NGX_IMAGE_VIEWER_DEFAULT_TOOLBAR, NgxImageViewer, clamp, distanceBetweenTouches, downloadImage, midpointOfTouches, printImage, zoomAroundPoint };
|
|
134
|
+
export type { NgxImageViewerItem, NgxImageViewerToolbarConfig, PanZoomState };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import * as ngx_kit_side_nav from 'ngx-kit/side-nav';
|
|
4
|
+
|
|
5
|
+
declare class NgxDrawerMenu {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDrawerMenu, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDrawerMenu, "[ngxDrawerMenu]", never, {}, {}, never, never, true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare class NgxDrawerMenuToggle {
|
|
11
|
+
readonly hideOnBreakPoint: i0.InputSignal<boolean>;
|
|
12
|
+
protected readonly sideNav: ngx_kit_side_nav.NgxSideNav;
|
|
13
|
+
hide: i0.WritableSignal<boolean>;
|
|
14
|
+
constructor();
|
|
15
|
+
protected onClick(): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDrawerMenuToggle, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDrawerMenuToggle, "[ngxDrawerMenuToggle]", never, { "hideOnBreakPoint": { "alias": "hideOnBreakPoint"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type NgxSideNavMode = 'push' | 'overlay';
|
|
21
|
+
|
|
22
|
+
declare const NGX_SIDE_NAV: InjectionToken<NgxSideNav>;
|
|
23
|
+
declare class NgxSideNav implements OnInit, OnDestroy {
|
|
24
|
+
readonly open: i0.ModelSignal<boolean>;
|
|
25
|
+
readonly width: i0.InputSignal<number>;
|
|
26
|
+
readonly breakpoint: i0.InputSignal<number | null>;
|
|
27
|
+
readonly mode: i0.InputSignal<NgxSideNavMode>;
|
|
28
|
+
shouldShowOverlay: i0.WritableSignal<boolean>;
|
|
29
|
+
private mediaQuery?;
|
|
30
|
+
readonly isMatchMediaQuery: i0.WritableSignal<boolean>;
|
|
31
|
+
private removeMediaQueryListener?;
|
|
32
|
+
protected readonly win: Window | null;
|
|
33
|
+
constructor();
|
|
34
|
+
ngOnInit(): void;
|
|
35
|
+
ngOnDestroy(): void;
|
|
36
|
+
initialize(): void;
|
|
37
|
+
setupMediaQuery(): void;
|
|
38
|
+
onResize(): void;
|
|
39
|
+
toggleMenu(): void;
|
|
40
|
+
closeMenu(): void;
|
|
41
|
+
openMenu(): void;
|
|
42
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSideNav, never>;
|
|
43
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NgxSideNav, "ngx-side-nav", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "breakpoint": { "alias": "breakpoint"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, { "open": "openChange"; }, never, ["[ngxDrawerMenu]", "*"], true, never>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class NgxSideNavModule {
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxSideNavModule, never>;
|
|
48
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxSideNavModule, never, [typeof NgxDrawerMenu, typeof NgxDrawerMenuToggle, typeof NgxSideNav], [typeof NgxDrawerMenu, typeof NgxDrawerMenuToggle, typeof NgxSideNav]>;
|
|
49
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxSideNavModule>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { NGX_SIDE_NAV, NgxDrawerMenu, NgxDrawerMenuToggle, NgxSideNav, NgxSideNavModule };
|
|
53
|
+
export type { NgxSideNavMode };
|
package/drawer-menu/README.md
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# ngx-kit/drawer-menu
|
|
2
|
-
|
|
3
|
-
A gesture-first Angular navigation drawer designed for desktop and mobile.
|
|
4
|
-
|
|
5
|
-
## Highlights
|
|
6
|
-
|
|
7
|
-
- Logical `start` / `end` placement with RTL/LTR support.
|
|
8
|
-
- Mouse + touch + pen drag using Pointer Events.
|
|
9
|
-
- Open from the screen edge when closed.
|
|
10
|
-
- Drag the drawer itself to close it.
|
|
11
|
-
- Live 0..1 gesture progress — effects react while dragging.
|
|
12
|
-
- Fabric / curtain / spring / elastic effects.
|
|
13
|
-
- `overlay`, `push`, and `reveal` content modes.
|
|
14
|
-
- Desktop/mobile responsive state.
|
|
15
|
-
- True docked desktop sidebar: open means it occupies layout space and clicking the page never closes it.
|
|
16
|
-
- Mobile overlay behavior with backdrop and edge swipe.
|
|
17
|
-
- Pin/unpin support.
|
|
18
|
-
- Controlled state with `[(open)]`.
|
|
19
|
-
- Reduced-motion support.
|
|
20
|
-
- Escape and backdrop closing.
|
|
21
|
-
|
|
22
|
-
## Recommended configuration
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<ngx-drawer-menu
|
|
26
|
-
side="start"
|
|
27
|
-
mode="push"
|
|
28
|
-
effect="fabric"
|
|
29
|
-
[width]="300"
|
|
30
|
-
[openOnDesktop]="true"
|
|
31
|
-
[openOnMobile]="false"
|
|
32
|
-
[mobileBreakpoint]="960"
|
|
33
|
-
[(open)]="drawerOpen"
|
|
34
|
-
[(pinned)]="drawerPinned">
|
|
35
|
-
<router-outlet />
|
|
36
|
-
|
|
37
|
-
<div drawerContent>
|
|
38
|
-
<!-- navigation -->
|
|
39
|
-
</div>
|
|
40
|
-
</ngx-drawer-menu>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Behavior model
|
|
44
|
-
|
|
45
|
-
The drawer owns one continuous `progress` value between `0` and `1`.
|
|
46
|
-
|
|
47
|
-
- `0`: fully closed.
|
|
48
|
-
- `1`: fully open.
|
|
49
|
-
- Pointer dragging directly changes progress.
|
|
50
|
-
- On release, velocity and the configured threshold decide the final state.
|
|
51
|
-
|
|
52
|
-
This is the key to getting a physical-feeling drawer instead of a drawer that simply jumps between CSS classes.
|
|
53
|
-
|
|
54
|
-
## Inputs
|
|
55
|
-
|
|
56
|
-
| Input | Default | Purpose |
|
|
57
|
-
| ------------------- | --------- | ------------------------------------------------------------ |
|
|
58
|
-
| `side` | `start` | Logical drawer side. |
|
|
59
|
-
| `mode` | `overlay` | `overlay`, `push`, or `reveal`. |
|
|
60
|
-
| `effect` | `fabric` | `slide`, `spring`, `fabric`, `curtain`, `elastic`, `reveal`. |
|
|
61
|
-
| `width` | `300` | Drawer width in px. |
|
|
62
|
-
| `maxWidth` | `420` | Safety cap for drawer width. |
|
|
63
|
-
| `edgeSize` | `34` | Edge swipe activation area. |
|
|
64
|
-
| `swipeEnabled` | `true` | Enables gesture interaction. |
|
|
65
|
-
| `backdropClose` | `true` | Close on backdrop press. |
|
|
66
|
-
| `escapeClose` | `true` | Close on Escape. |
|
|
67
|
-
| `open` | `true` | Two-way state via `[(open)]`. |
|
|
68
|
-
| `pinned` | `false` | Persistent drawer state via `[(pinned)]`. |
|
|
69
|
-
| `mobileBreakpoint` | `768` | Mobile breakpoint. |
|
|
70
|
-
| `openOnDesktop` | `true` | State on desktop. |
|
|
71
|
-
| `openOnMobile` | `false` | State on mobile/tablet. |
|
|
72
|
-
| `respondToViewport` | `true` | Enables live responsive switching. |
|
|
73
|
-
| `transitionMs` | `420` | Settle animation duration. |
|
|
74
|
-
|
|
75
|
-
## Responsive behavior
|
|
76
|
-
|
|
77
|
-
By default:
|
|
78
|
-
|
|
79
|
-
- Desktop >= 768px: open.
|
|
80
|
-
- Mobile < 768px: closed.
|
|
81
|
-
- Crossing the breakpoint updates the drawer live.
|
|
82
|
-
- A pinned drawer is not closed by responsive rules.
|
|
83
|
-
|
|
84
|
-
A full `responsive` object is also available when a single config object is preferable:
|
|
85
|
-
|
|
86
|
-
```html
|
|
87
|
-
<ngx-drawer-menu
|
|
88
|
-
[responsive]="{
|
|
89
|
-
mode: 'auto',
|
|
90
|
-
breakpoint: 960,
|
|
91
|
-
desktopOpen: true,
|
|
92
|
-
mobileOpen: false,
|
|
93
|
-
respectPinned: true
|
|
94
|
-
}"></ngx-drawer-menu>
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Recommended responsive behavior
|
|
98
|
-
|
|
99
|
-
When `respondToViewport` is enabled, the drawer uses a real sidebar on desktop and an overlay drawer on mobile by default:
|
|
100
|
-
|
|
101
|
-
```html
|
|
102
|
-
<ngx-drawer-menu
|
|
103
|
-
side="start"
|
|
104
|
-
[responsive]="{
|
|
105
|
-
mode: 'auto',
|
|
106
|
-
breakpoint: 960,
|
|
107
|
-
desktopOpen: true,
|
|
108
|
-
mobileOpen: false,
|
|
109
|
-
desktopBehavior: 'dock',
|
|
110
|
-
mobileBehavior: 'overlay',
|
|
111
|
-
respectPinned: true
|
|
112
|
-
}"
|
|
113
|
-
effect="fabric"
|
|
114
|
-
[width]="300">
|
|
115
|
-
<router-outlet />
|
|
116
|
-
<nav drawerContent>...</nav>
|
|
117
|
-
</ngx-drawer-menu>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
In this setup:
|
|
121
|
-
|
|
122
|
-
- `>= 960px`: the open drawer is a real docked sidebar; it owns layout width and does not create a backdrop.
|
|
123
|
-
- `< 960px`: the drawer is an overlay; the page is dimmed and clicking the backdrop can close it.
|
|
124
|
-
- On desktop the drawer can still be dragged closed from its full-height edge handle.
|
|
125
|
-
- When closed, the screen edge remains a mouse/touch drag target and opens the drawer.
|