ngx-kit 6.2.0 → 7.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/README.md +3 -3
- package/angle-selector/README.md +34 -34
- package/box-shadow/README.md +33 -33
- package/color-picker/README.md +52 -49
- package/data-table/README.md +120 -113
- package/date-picker/README.md +74 -69
- package/dialog/README.md +92 -92
- package/drag-resize/README.md +55 -0
- package/drawer-menu/README.md +125 -77
- package/dropzone/README.md +422 -422
- package/fesm2022/ngx-kit-angle-selector.mjs +2 -2
- package/fesm2022/ngx-kit-angle-selector.mjs.map +1 -1
- package/fesm2022/ngx-kit-box-shadow.mjs +2 -2
- package/fesm2022/ngx-kit-box-shadow.mjs.map +1 -1
- package/fesm2022/ngx-kit-color-picker.mjs +265 -73
- package/fesm2022/ngx-kit-color-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-data-table.mjs +2 -2
- package/fesm2022/ngx-kit-data-table.mjs.map +1 -1
- package/fesm2022/ngx-kit-date-picker.mjs +11 -11
- package/fesm2022/ngx-kit-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-dialog.mjs +3 -3
- package/fesm2022/ngx-kit-dialog.mjs.map +1 -1
- package/fesm2022/ngx-kit-drag-resize.mjs +1664 -0
- package/fesm2022/ngx-kit-drag-resize.mjs.map +1 -0
- package/fesm2022/ngx-kit-drawer-menu.mjs +424 -158
- package/fesm2022/ngx-kit-drawer-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-dropzone.mjs +2 -2
- package/fesm2022/ngx-kit-dropzone.mjs.map +1 -1
- package/fesm2022/ngx-kit-form-field.mjs +3 -5
- package/fesm2022/ngx-kit-form-field.mjs.map +1 -1
- package/fesm2022/ngx-kit-gallery.mjs +2 -2
- package/fesm2022/ngx-kit-gallery.mjs.map +1 -1
- package/fesm2022/ngx-kit-gradient-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-grid-layout.mjs +927 -0
- package/fesm2022/ngx-kit-grid-layout.mjs.map +1 -0
- package/fesm2022/ngx-kit-image-editor.mjs +2 -2
- package/fesm2022/ngx-kit-image-editor.mjs.map +1 -1
- package/fesm2022/ngx-kit-menu.mjs +8 -8
- package/fesm2022/ngx-kit-menu.mjs.map +1 -1
- package/fesm2022/ngx-kit-message.mjs +2 -2
- package/fesm2022/ngx-kit-message.mjs.map +1 -1
- package/fesm2022/ngx-kit-notify.mjs +2 -2
- package/fesm2022/ngx-kit-notify.mjs.map +1 -1
- package/fesm2022/ngx-kit-shared.mjs +54 -3
- package/fesm2022/ngx-kit-shared.mjs.map +1 -1
- package/fesm2022/ngx-kit-time-picker.mjs +2 -2
- package/fesm2022/ngx-kit-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-kit-virtual-scroll.mjs +392 -0
- package/fesm2022/ngx-kit-virtual-scroll.mjs.map +1 -0
- package/fesm2022/ngx-kit-webflow.mjs +709 -0
- package/fesm2022/ngx-kit-webflow.mjs.map +1 -0
- package/gallery/README.md +71 -71
- package/gradient-picker/README.md +41 -41
- package/grid-layout/README.md +64 -0
- package/image-editor/README.md +12 -12
- package/menu/README.md +85 -85
- package/message/README.md +70 -70
- package/notify/README.md +56 -58
- package/package.json +17 -1
- package/shared/README.md +117 -117
- package/time-picker/README.md +89 -95
- package/types/ngx-kit-color-picker.d.ts +72 -16
- package/types/ngx-kit-date-picker.d.ts +2 -1
- package/types/ngx-kit-drag-resize.d.ts +368 -0
- package/types/ngx-kit-drawer-menu.d.ts +148 -88
- package/types/ngx-kit-grid-layout.d.ts +310 -0
- package/types/ngx-kit-image-editor.d.ts +1 -1
- package/types/ngx-kit-shared.d.ts +12 -1
- package/types/ngx-kit-virtual-scroll.d.ts +179 -0
- package/types/ngx-kit-webflow.d.ts +286 -0
- package/virtual-scroll/README.md +199 -0
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { TemplateRef, EventEmitter, InjectionToken, OnInit, OnDestroy, ElementRef, Renderer2 } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
interface IPosition {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Groups multiple drop lists so items can be dragged between them without
|
|
11
|
+
* needing an explicit `connectedTo` list on every single one.
|
|
12
|
+
* Lists register themselves automatically when `NgxDropListGroup` wraps them.
|
|
13
|
+
*/
|
|
14
|
+
declare class DropListGroupRef {
|
|
15
|
+
readonly lists: Set<DropListRef<any>>;
|
|
16
|
+
add(list: DropListRef<any>): void;
|
|
17
|
+
remove(list: DropListRef<any>): void;
|
|
18
|
+
has(list: DropListRef<any> | null | undefined): boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare class PlaceHolderRef {
|
|
22
|
+
tpl?: TemplateRef<unknown>;
|
|
23
|
+
dropList?: DropListRef;
|
|
24
|
+
element?: HTMLElement;
|
|
25
|
+
private _visible;
|
|
26
|
+
attach(container: HTMLElement, source: HTMLElement, reference?: Node | null): HTMLElement;
|
|
27
|
+
detach(): void;
|
|
28
|
+
get visible(): boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* DropListRef is intentionally generic, while the positional sorting strategy
|
|
33
|
+
* works on DragRef<any>. The public DropList/DragRef relationship is invariant
|
|
34
|
+
* because IDropEvent<T> contains T in a callback position. Keep the strongly
|
|
35
|
+
* typed Set here, and narrow only at the DOM-local bridge / strategy boundary.
|
|
36
|
+
*/
|
|
37
|
+
declare class DropListRef<T = any> {
|
|
38
|
+
data?: T;
|
|
39
|
+
el: HTMLElement;
|
|
40
|
+
disableSort: boolean;
|
|
41
|
+
connectedTo: HTMLElement[];
|
|
42
|
+
dropListGroup?: DropListGroupRef | null;
|
|
43
|
+
readonly _draggables: Set<DragRef<T>>;
|
|
44
|
+
readonly onDrop: EventEmitter<IDropEvent<T>>;
|
|
45
|
+
private strategy;
|
|
46
|
+
private active;
|
|
47
|
+
private previousIndex;
|
|
48
|
+
private placeholder?;
|
|
49
|
+
addItem(item: DragRef<T>): void;
|
|
50
|
+
removeItem(item: DragRef<T>): void;
|
|
51
|
+
isConnectedTo(other: DropListRef<any>): boolean;
|
|
52
|
+
createPlaceholder(drag: DragRef<T>): PlaceHolderRef;
|
|
53
|
+
enter(drag: DragRef<T>, x?: number, y?: number): void;
|
|
54
|
+
sortItem(drag: DragRef<T>, position: IPosition): number | null;
|
|
55
|
+
finishDrag(drag: DragRef<T>): void;
|
|
56
|
+
exit(_drag: DragRef<T>): void;
|
|
57
|
+
resetSortTransforms(): void;
|
|
58
|
+
getFinalIndex(): number;
|
|
59
|
+
getItemIndex(item: DragRef<T>): number;
|
|
60
|
+
private indexOf;
|
|
61
|
+
private reset;
|
|
62
|
+
private copyPlaceholderGeometry;
|
|
63
|
+
/**
|
|
64
|
+
* The sorting strategy only needs a read-only collection of draggable refs.
|
|
65
|
+
* Using DragRef<any> at this internal boundary avoids the invariant generic
|
|
66
|
+
* relationship between DragRef<T> and DragRef<unknown>.
|
|
67
|
+
*/
|
|
68
|
+
private getStrategyItems;
|
|
69
|
+
private asStrategyDrag;
|
|
70
|
+
private publishDragItems;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type DragAxis = 'x' | 'y' | undefined;
|
|
74
|
+
declare class DragRef<T = unknown> {
|
|
75
|
+
data?: T;
|
|
76
|
+
el: HTMLElement;
|
|
77
|
+
boundary?: HTMLElement;
|
|
78
|
+
lockAxis?: DragAxis;
|
|
79
|
+
dropList: DropListRef<T> | null;
|
|
80
|
+
dropListGroup?: DropListGroupRef | null;
|
|
81
|
+
placeholder?: PlaceHolderRef;
|
|
82
|
+
originDropList: DropListRef<T> | null;
|
|
83
|
+
originIndex: number;
|
|
84
|
+
readonly isDragging: i0.WritableSignal<boolean>;
|
|
85
|
+
readonly position: i0.WritableSignal<IPosition>;
|
|
86
|
+
private startPointer;
|
|
87
|
+
private startRect;
|
|
88
|
+
private lastPointer;
|
|
89
|
+
private previousTransform;
|
|
90
|
+
private previousZIndex;
|
|
91
|
+
private moveDx;
|
|
92
|
+
private moveDy;
|
|
93
|
+
private preview?;
|
|
94
|
+
private previewOffsetX;
|
|
95
|
+
private previewOffsetY;
|
|
96
|
+
private sourceVisibility;
|
|
97
|
+
private sourceDisplay;
|
|
98
|
+
private sourcePointerEvents;
|
|
99
|
+
init(): void;
|
|
100
|
+
withDropList(list: DropListRef<T> | null): this;
|
|
101
|
+
clearDropList(): void;
|
|
102
|
+
pointerDown(pointer: IPosition): void;
|
|
103
|
+
startDrag(pointer: IPosition): void;
|
|
104
|
+
dragMove(pointer: IPosition): void;
|
|
105
|
+
nudge(dx: number, dy: number): void;
|
|
106
|
+
endDrag(): void;
|
|
107
|
+
cancelDrag(): void;
|
|
108
|
+
get x(): number;
|
|
109
|
+
get y(): number;
|
|
110
|
+
get pointer(): IPosition;
|
|
111
|
+
get start(): DOMRect;
|
|
112
|
+
getPlaceholderElement(): HTMLElement | undefined;
|
|
113
|
+
private applyTransform;
|
|
114
|
+
private updatePreview;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface IDropEvent<T = any> {
|
|
118
|
+
previousIndex: number;
|
|
119
|
+
currentIndex: number;
|
|
120
|
+
item: DragRef<T>;
|
|
121
|
+
container: DropListRef<T>;
|
|
122
|
+
previousContainer: DropListRef<T>;
|
|
123
|
+
isPointerOverContainer?: boolean;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Physical (viewport-space) resize directions — always in LTR screen coordinates. */
|
|
127
|
+
type ResizeDirection = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
|
|
128
|
+
/**
|
|
129
|
+
* Logical (writing-direction aware) resize directions.
|
|
130
|
+
* `start`/`end` resolve to `w`/`e` depending on the host's computed `direction`,
|
|
131
|
+
* so a single template works unchanged in both LTR and RTL layouts.
|
|
132
|
+
*/
|
|
133
|
+
type LogicalResizeDirection = ResizeDirection | 'n-start' | 'n-end' | 's-start' | 's-end' | 'start' | 'end';
|
|
134
|
+
interface IResizableOutput {
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
moveLeft: number;
|
|
138
|
+
moveTop: number;
|
|
139
|
+
left: number;
|
|
140
|
+
top: number;
|
|
141
|
+
direction: ResizeDirection;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
declare class DragDropService {
|
|
145
|
+
readonly drags: i0.WritableSignal<readonly DragRef<unknown>[]>;
|
|
146
|
+
readonly dropLists: i0.WritableSignal<readonly DropListRef<any>[]>;
|
|
147
|
+
readonly activeDrag: i0.WritableSignal<DragRef<unknown> | null>;
|
|
148
|
+
registerDragItem(ref: DragRef<any>): void;
|
|
149
|
+
removeDragItem(ref: DragRef<any>): void;
|
|
150
|
+
registerDropList(ref: DropListRef): void;
|
|
151
|
+
removeDropList(ref: DropListRef<any>): void;
|
|
152
|
+
begin(ref: DragRef<any>): void;
|
|
153
|
+
end(ref: DragRef<any>): void;
|
|
154
|
+
cancelActive(): void;
|
|
155
|
+
findDropList(point: {
|
|
156
|
+
x: number;
|
|
157
|
+
y: number;
|
|
158
|
+
}, current?: DropListRef | null): DropListRef | null;
|
|
159
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DragDropService, never>;
|
|
160
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DragDropService>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
declare const NGX_DRAGGABLE: InjectionToken<NgxDraggable<unknown>>;
|
|
164
|
+
declare class NgxDraggable<T = unknown> implements OnInit, OnDestroy {
|
|
165
|
+
private readonly host;
|
|
166
|
+
private readonly renderer;
|
|
167
|
+
disabled: boolean;
|
|
168
|
+
/** Element whose rect constrains the drag. Now actually enforced. */
|
|
169
|
+
boundary?: HTMLElement;
|
|
170
|
+
dragRootElement: string;
|
|
171
|
+
/** CSS selector for a drag handle. When set, only pointerdowns inside it start a drag. */
|
|
172
|
+
dragHandle: string;
|
|
173
|
+
/** Restrict movement to a single axis. */
|
|
174
|
+
lockAxis: DragAxis;
|
|
175
|
+
/** Minimum pointer travel (px) before a drag starts, so clicks still register normally. */
|
|
176
|
+
dragThreshold: number;
|
|
177
|
+
/** Pixel step used when dragging via the keyboard (arrow keys, focus required). */
|
|
178
|
+
keyboardStep: number;
|
|
179
|
+
/** Auto-scroll the nearest scrollable ancestor while dragging near its edge. */
|
|
180
|
+
autoScroll: boolean;
|
|
181
|
+
set data(v: T);
|
|
182
|
+
readonly dragStart: EventEmitter<IPosition>;
|
|
183
|
+
readonly dragMove: EventEmitter<IPosition>;
|
|
184
|
+
readonly dragEnd: EventEmitter<IPosition>;
|
|
185
|
+
readonly _ref: DragRef<T>;
|
|
186
|
+
readonly dragging: i0.WritableSignal<boolean>;
|
|
187
|
+
private readonly doc;
|
|
188
|
+
private readonly service;
|
|
189
|
+
private readonly list;
|
|
190
|
+
private readonly group;
|
|
191
|
+
private readonly scroller;
|
|
192
|
+
private down;
|
|
193
|
+
private start;
|
|
194
|
+
private pointerId;
|
|
195
|
+
private removeDown?;
|
|
196
|
+
private removeMove?;
|
|
197
|
+
private removeUp?;
|
|
198
|
+
private removeKeydown?;
|
|
199
|
+
private removeEscape?;
|
|
200
|
+
constructor(host: ElementRef<HTMLElement>, renderer: Renderer2);
|
|
201
|
+
ngOnInit(): void;
|
|
202
|
+
ngOnDestroy(): void;
|
|
203
|
+
private pointerDown;
|
|
204
|
+
private pointerMove;
|
|
205
|
+
private pointerUp;
|
|
206
|
+
private cancel;
|
|
207
|
+
private finish;
|
|
208
|
+
/** Arrow-key movement for keyboard/assistive-tech users. Shift multiplies the step by 4. */
|
|
209
|
+
private keyDown;
|
|
210
|
+
private isOnHandle;
|
|
211
|
+
private isInteractive;
|
|
212
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDraggable<any>, never>;
|
|
213
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDraggable<any>, "[NgxDraggable],[ngxDraggable]", never, { "disabled": { "alias": "disabled"; "required": false; }; "boundary": { "alias": "boundary"; "required": false; }; "dragRootElement": { "alias": "dragRootElement"; "required": false; }; "dragHandle": { "alias": "dragHandle"; "required": false; }; "lockAxis": { "alias": "lockAxis"; "required": false; }; "dragThreshold": { "alias": "dragThreshold"; "required": false; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; }; "autoScroll": { "alias": "autoScroll"; "required": false; }; "data": { "alias": "data"; "required": false; }; }, { "dragStart": "dragStart"; "dragMove": "dragMove"; "dragEnd": "dragEnd"; }, never, never, true, never>;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
declare class NgxResizable {
|
|
217
|
+
private readonly el;
|
|
218
|
+
disabled: boolean;
|
|
219
|
+
minWidth: number;
|
|
220
|
+
minHeight: number;
|
|
221
|
+
maxWidth: number;
|
|
222
|
+
maxHeight: number;
|
|
223
|
+
directions: LogicalResizeDirection[];
|
|
224
|
+
grid?: number | {
|
|
225
|
+
x: number;
|
|
226
|
+
y: number;
|
|
227
|
+
};
|
|
228
|
+
/** Element whose rect constrains the resize. Previously accepted nowhere on this directive. */
|
|
229
|
+
boundary?: HTMLElement;
|
|
230
|
+
/** Pixel step used when resizing via the keyboard (arrow keys, focus required). */
|
|
231
|
+
keyboardStep: number;
|
|
232
|
+
readonly resizeStart: EventEmitter<IResizableOutput>;
|
|
233
|
+
readonly resizeMove: EventEmitter<IResizableOutput>;
|
|
234
|
+
readonly resizeEnd: EventEmitter<IResizableOutput>;
|
|
235
|
+
readonly resizing: i0.WritableSignal<boolean>;
|
|
236
|
+
private direction;
|
|
237
|
+
private start;
|
|
238
|
+
private pointer;
|
|
239
|
+
private beforeTransition;
|
|
240
|
+
private beforeWidth;
|
|
241
|
+
private beforeHeight;
|
|
242
|
+
private beforeTransform;
|
|
243
|
+
private pointerId;
|
|
244
|
+
constructor(el: ElementRef<HTMLElement>);
|
|
245
|
+
onPointerDown(e: PointerEvent): void;
|
|
246
|
+
onPointerMove(e: PointerEvent): void;
|
|
247
|
+
onPointerUp(e: PointerEvent): void;
|
|
248
|
+
onDocumentKeyDown(e: KeyboardEvent): void;
|
|
249
|
+
onHandleKeyDown(e: KeyboardEvent): void;
|
|
250
|
+
private calculate;
|
|
251
|
+
private apply;
|
|
252
|
+
private clampGrid;
|
|
253
|
+
private finish;
|
|
254
|
+
private resolvedDirections;
|
|
255
|
+
private hitDirection;
|
|
256
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxResizable, never>;
|
|
257
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxResizable, "[NgxResizable],[ngxResizable]", never, { "disabled": { "alias": "disabled"; "required": false; }; "minWidth": { "alias": "minWidth"; "required": false; }; "minHeight": { "alias": "minHeight"; "required": false; }; "maxWidth": { "alias": "maxWidth"; "required": false; }; "maxHeight": { "alias": "maxHeight"; "required": false; }; "directions": { "alias": "directions"; "required": false; }; "grid": { "alias": "grid"; "required": false; }; "boundary": { "alias": "boundary"; "required": false; }; "keyboardStep": { "alias": "keyboardStep"; "required": false; }; }, { "resizeStart": "resizeStart"; "resizeMove": "resizeMove"; "resizeEnd": "resizeEnd"; }, never, never, true, never>;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
declare const NGX_DROPLIST: InjectionToken<NgxDropList<any>>;
|
|
261
|
+
declare class NgxDropList<T = any> implements OnInit, OnDestroy {
|
|
262
|
+
private readonly el;
|
|
263
|
+
readonly _ref: DropListRef<T>;
|
|
264
|
+
set data(value: T);
|
|
265
|
+
set connectedTo(value: HTMLElement[] | null | undefined);
|
|
266
|
+
set disableSort(value: boolean);
|
|
267
|
+
readonly drop: EventEmitter<IDropEvent<T>>;
|
|
268
|
+
private readonly service;
|
|
269
|
+
private readonly group;
|
|
270
|
+
constructor(el: ElementRef<HTMLElement>);
|
|
271
|
+
ngOnInit(): void;
|
|
272
|
+
ngOnDestroy(): void;
|
|
273
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDropList<any>, never>;
|
|
274
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDropList<any>, "[NgxDropList],[ngxDropList]", never, { "data": { "alias": "data"; "required": false; }; "connectedTo": { "alias": "connectedTo"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; }, { "drop": "drop"; }, never, never, true, never>;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare const NGX_DROPLIST_GROUP: InjectionToken<NgxDropListGroup>;
|
|
278
|
+
/** Wrap several `ngxDropList`s to let items move freely between them. */
|
|
279
|
+
declare class NgxDropListGroup implements OnDestroy {
|
|
280
|
+
readonly _ref: DropListGroupRef;
|
|
281
|
+
ngOnDestroy(): void;
|
|
282
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxDropListGroup, never>;
|
|
283
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDropListGroup, "[NgxDropListGroup],[ngxDropListGroup]", never, {}, {}, never, never, true, never>;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
declare const NGX_PLACEHOLDER: InjectionToken<PlaceHolderRef>;
|
|
287
|
+
declare class NgxPlaceholder {
|
|
288
|
+
readonly tpl: TemplateRef<unknown>;
|
|
289
|
+
readonly _ref: PlaceHolderRef;
|
|
290
|
+
private readonly list;
|
|
291
|
+
constructor(tpl: TemplateRef<unknown>);
|
|
292
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPlaceholder, never>;
|
|
293
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPlaceholder, "[NgxPlaceholder],[ngxPlaceholder]", never, {}, {}, never, never, true, never>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* True when `element` sits inside a right-to-left context.
|
|
298
|
+
*
|
|
299
|
+
* Reads the *computed* `direction` style instead of `element.dir`, because
|
|
300
|
+
* `direction` is inherited and is almost never set on the resizable element
|
|
301
|
+
* itself - it's usually set on `<html>`, `<body>`, or some ancestor wrapper.
|
|
302
|
+
*/
|
|
303
|
+
declare function isRtl(element: HTMLElement): boolean;
|
|
304
|
+
/**
|
|
305
|
+
* Resolves a logical direction ('start' | 'end' | 'n-start' | 'n-end' | 's-start' | 's-end')
|
|
306
|
+
* to a physical, viewport-space direction ('n' | 'e' | 's' | 'w' | 'ne' | 'nw' | 'se' | 'sw')
|
|
307
|
+
* based on `rtl`.
|
|
308
|
+
*
|
|
309
|
+
* Physical directions pass through untouched, so it's always safe to call this
|
|
310
|
+
* even when `dir` might already be physical (e.g. resolving a direction that was
|
|
311
|
+
* already resolved once before).
|
|
312
|
+
*/
|
|
313
|
+
declare function resolveLogicalDirection(dir: string, rtl: boolean): ResizeDirection;
|
|
314
|
+
|
|
315
|
+
/** Clamps a proposed vertical delta so the element's rect stays inside the boundary rect. */
|
|
316
|
+
declare function checkBoundY(selfRect: DOMRect, boundaryRect: DOMRect | undefined, offsetY: number): number;
|
|
317
|
+
/** Clamps a proposed horizontal delta so the element's rect stays inside the boundary rect. */
|
|
318
|
+
declare function checkBoundX(selfRect: DOMRect, boundaryRect: DOMRect | undefined, offsetX: number): number;
|
|
319
|
+
/**
|
|
320
|
+
* Clamps a resize result (width/height/left/top, all relative CSS px deltas from the
|
|
321
|
+
* element's start position) so the element never grows/moves outside `boundaryRect`.
|
|
322
|
+
* `startRect` is the element's `getBoundingClientRect()` captured at resize-start.
|
|
323
|
+
*/
|
|
324
|
+
declare function clampResizeWithinBoundary(boundaryRect: DOMRect | undefined, startRect: DOMRect, width: number, height: number, left: number, top: number): {
|
|
325
|
+
width: number;
|
|
326
|
+
height: number;
|
|
327
|
+
left: number;
|
|
328
|
+
top: number;
|
|
329
|
+
};
|
|
330
|
+
/** Current page zoom level (1 = 100%). Falls back to devicePixelRatio pre visualViewport. */
|
|
331
|
+
declare function getPageZoom(): number;
|
|
332
|
+
/** Adjusts a raw pointer-derived value for the current page zoom level. */
|
|
333
|
+
declare function adjustForZoom(value: number): number;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Auto-scrolls the nearest scrollable ancestor (or window) while the pointer
|
|
337
|
+
* is dragged near the edge of the scrollable viewport. Direction-agnostic —
|
|
338
|
+
* works the same in RTL and LTR since it operates on physical scroll deltas.
|
|
339
|
+
*/
|
|
340
|
+
declare class AutoScroller {
|
|
341
|
+
private raf;
|
|
342
|
+
private container;
|
|
343
|
+
private speed;
|
|
344
|
+
private readonly edge;
|
|
345
|
+
private readonly maxSpeed;
|
|
346
|
+
constructor(edge?: number, maxSpeed?: number);
|
|
347
|
+
start(fromEl: HTMLElement): void;
|
|
348
|
+
/** Call on every pointermove with the current client coordinates. */
|
|
349
|
+
update(clientX: number, clientY: number): void;
|
|
350
|
+
stop(): void;
|
|
351
|
+
private tick;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
declare function moveItemInArray<T>(array: T[], from: number, to: number): void;
|
|
355
|
+
declare function transferArrayItem<T>(src: T[], dst: T[], from: number, to: number): void;
|
|
356
|
+
/**
|
|
357
|
+
* Copies an item from one array to another, leaving it in its
|
|
358
|
+
* original position in current array.
|
|
359
|
+
* @param currentArray Array from which to copy the item.
|
|
360
|
+
* @param targetArray Array into which is copy the item.
|
|
361
|
+
* @param currentIndex Index of the item in its current array.
|
|
362
|
+
* @param targetIndex Index at which to insert the item.
|
|
363
|
+
*
|
|
364
|
+
*/
|
|
365
|
+
declare function copyArrayItem<T = any>(currentArray: T[], targetArray: T[], currentIndex: number, targetIndex: number): void;
|
|
366
|
+
|
|
367
|
+
export { AutoScroller, DragDropService, DragRef, DropListGroupRef, DropListRef, NGX_DRAGGABLE, NGX_DROPLIST, NGX_DROPLIST_GROUP, NGX_PLACEHOLDER, NgxDraggable, NgxDropList, NgxDropListGroup, NgxPlaceholder, NgxResizable, PlaceHolderRef, adjustForZoom, checkBoundX, checkBoundY, clampResizeWithinBoundary, copyArrayItem, getPageZoom, isRtl, moveItemInArray, resolveLogicalDirection, transferArrayItem };
|
|
368
|
+
export type { DragAxis, IDropEvent, IPosition, IResizableOutput, LogicalResizeDirection, ResizeDirection };
|
|
@@ -1,101 +1,161 @@
|
|
|
1
|
+
import * as ngx_kit_drawer_menu from 'ngx-kit/drawer-menu';
|
|
1
2
|
import * as _angular_core from '@angular/core';
|
|
2
3
|
|
|
3
|
-
/**
|
|
4
|
-
* از 'start'/'end' منطقی استفاده میکنیم نه 'left'/'right' — یعنی توی
|
|
5
|
-
* RTL خودکار برعکس میشه (start یعنی راست در RTL، چپ در LTR)، دقیقاً هماهنگ
|
|
6
|
-
* با بقیهی کتابخونه که همهجا از پراپرتیهای منطقیِ CSS استفاده میکنه.
|
|
7
|
-
*/
|
|
4
|
+
/** Logical drawer placement. `start` is right in RTL and left in LTR. */
|
|
8
5
|
type NgxDrawerSide = 'start' | 'end';
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
6
|
+
/** Visual physics used by the drawer while opening/closing. */
|
|
7
|
+
type NgxDrawerEffect = 'none' | 'fabric' | 'slide' | 'push' | 'scale';
|
|
8
|
+
type NgxDrawerBehavior = 'dock' | 'overlay';
|
|
9
|
+
type NgxDrawerResponsiveMode = 'auto' | 'desktop' | 'mobile';
|
|
10
|
+
interface NgxDrawerResponsive {
|
|
11
|
+
/**
|
|
12
|
+
* auto:
|
|
13
|
+
* breakpoint determines desktop/mobile mode
|
|
14
|
+
*
|
|
15
|
+
* desktop:
|
|
16
|
+
* always desktop
|
|
17
|
+
*
|
|
18
|
+
* mobile:
|
|
19
|
+
* always mobile
|
|
20
|
+
*/
|
|
21
|
+
mode?: NgxDrawerResponsiveMode;
|
|
22
|
+
/**
|
|
23
|
+
* Width at which the drawer switches
|
|
24
|
+
* between desktop and mobile.
|
|
25
|
+
*/
|
|
26
|
+
breakpoint?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Initial/default state on desktop.
|
|
29
|
+
*/
|
|
30
|
+
desktopOpen?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Initial/default state on mobile.
|
|
33
|
+
*/
|
|
34
|
+
mobileOpen?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Desktop drawer behavior.
|
|
37
|
+
*/
|
|
38
|
+
desktopBehavior?: NgxDrawerBehavior;
|
|
39
|
+
/**
|
|
40
|
+
* Mobile drawer behavior.
|
|
41
|
+
*/
|
|
42
|
+
mobileBehavior?: NgxDrawerBehavior;
|
|
43
|
+
/**
|
|
44
|
+
* If true, pinned state is preserved
|
|
45
|
+
* when switching between desktop/mobile.
|
|
46
|
+
*/
|
|
47
|
+
respectPinned?: boolean;
|
|
48
|
+
}
|
|
49
|
+
declare const DEFAULT_DRAWER_RESPONSIVE: Required<NgxDrawerResponsive>;
|
|
31
50
|
|
|
32
|
-
/**
|
|
33
|
-
* درور منو (side drawer) با ۶ جلوهی بازوبستهشدنِ متفاوت (از ساده تا
|
|
34
|
-
* سهبعدی/ژلهای) و ۳ رفتار برای محتوای صفحه (overlay/push/reveal) —
|
|
35
|
-
* دقیقاً مدل کتابخونههای حرفهای مثل react-burger-menu یا Ionic Menu، ولی
|
|
36
|
-
* signal-based و بدون هیچ وابستگی خارجی.
|
|
37
|
-
*
|
|
38
|
-
* نکات معماری:
|
|
39
|
-
* - از 'start'/'end' منطقی استفاده میکنه، پس با CSS logical properties
|
|
40
|
-
* زیر RTL خودکار برعکس میشه؛ فقط ریاضیِ درگ (که برخلاف CSS جهت فیزیکیِ
|
|
41
|
-
* واقعی لازم داره) از DirectionService مشترک استفاده میکنه.
|
|
42
|
-
* - وضعیت باز/بسته با model() دوطرفهست، پس هم با [(open)] قابل کنترله و
|
|
43
|
-
* هم میتونه بهصورت خودکار و زنده با عرض صفحه هماهنگ بشه (respondToViewport)
|
|
44
|
-
* — یعنی رد شدن از breakpoint (نه فقط بار اول لود) میتونه خودکار باز/بستهش کنه.
|
|
45
|
-
* - افکتهای jelly/pull با keyframe سهمرحلهای (overshoot → نوسان → استقرار)
|
|
46
|
-
* پیاده شدن، نه فقط یه transition ساده.
|
|
47
|
-
*/
|
|
48
51
|
declare class NgxDrawerMenuComponent {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
contentBehavior: _angular_core.InputSignal<NgxDrawerContentBehavior>;
|
|
52
|
-
width: _angular_core.InputSignal<number>;
|
|
53
|
-
swipeEdgeSize: _angular_core.InputSignal<number>;
|
|
54
|
-
curtainStrips: _angular_core.InputSignal<number>;
|
|
55
|
-
backdropClose: _angular_core.InputSignal<boolean>;
|
|
56
|
-
swipeEnabled: _angular_core.InputSignal<boolean>;
|
|
57
|
-
/** اگه true باشه، رد شدن از mobileBreakpoint بهصورت زنده open رو با openOnDesktop/openOnMobile هماهنگ میکنه */
|
|
58
|
-
respondToViewport: _angular_core.InputSignal<boolean>;
|
|
59
|
-
openOnDesktop: _angular_core.InputSignal<boolean>;
|
|
60
|
-
openOnMobile: _angular_core.InputSignal<boolean>;
|
|
61
|
-
mobileBreakpoint: _angular_core.InputSignal<number>;
|
|
62
|
-
/** state دوطرفهی باز/بسته؛ با [(open)] قابل bind هست */
|
|
63
|
-
open: _angular_core.ModelSignal<boolean>;
|
|
64
|
-
private readonly directionService;
|
|
65
|
-
private readonly doc;
|
|
52
|
+
private readonly elementRef;
|
|
53
|
+
private readonly renderer;
|
|
66
54
|
private readonly destroyRef;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
55
|
+
private readonly platformId;
|
|
56
|
+
readonly side: _angular_core.InputSignal<NgxDrawerSide>;
|
|
57
|
+
readonly effect: _angular_core.InputSignal<NgxDrawerEffect>;
|
|
58
|
+
readonly width: _angular_core.InputSignal<string | number>;
|
|
59
|
+
/**
|
|
60
|
+
* Main drawer state.
|
|
61
|
+
*
|
|
62
|
+
* Usage:
|
|
63
|
+
*
|
|
64
|
+
* [(open)]="sidebarOpen"
|
|
65
|
+
*/
|
|
66
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Pinned state.
|
|
69
|
+
*
|
|
70
|
+
* Useful for desktop layouts.
|
|
71
|
+
*
|
|
72
|
+
* [(pinned)]="sidebarPinned"
|
|
73
|
+
*/
|
|
74
|
+
readonly pinned: _angular_core.ModelSignal<boolean>;
|
|
75
|
+
readonly responsive: _angular_core.InputSignal<NgxDrawerResponsive>;
|
|
76
|
+
/**
|
|
77
|
+
* Whether clicking backdrop closes drawer.
|
|
78
|
+
*/
|
|
79
|
+
readonly closeOnBackdrop: _angular_core.InputSignal<boolean>;
|
|
80
|
+
/**
|
|
81
|
+
* Whether Escape closes drawer.
|
|
82
|
+
*/
|
|
83
|
+
readonly closeOnEscape: _angular_core.InputSignal<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Whether body scrolling should be locked
|
|
86
|
+
* while an overlay drawer is open.
|
|
87
|
+
*/
|
|
88
|
+
readonly lockBodyScroll: _angular_core.InputSignal<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Animation duration in milliseconds.
|
|
91
|
+
*/
|
|
92
|
+
readonly animationDuration: _angular_core.InputSignal<number>;
|
|
93
|
+
/**
|
|
94
|
+
* z-index.
|
|
95
|
+
*/
|
|
96
|
+
readonly zIndex: _angular_core.InputSignal<number>;
|
|
97
|
+
private readonly isBrowser;
|
|
98
|
+
readonly isMobile: _angular_core.WritableSignal<boolean>;
|
|
99
|
+
readonly initialized: _angular_core.WritableSignal<boolean>;
|
|
72
100
|
/**
|
|
73
|
-
*
|
|
74
|
-
* برای transform:translateX() محتوای اصلی (که برخلاف inset-inline، به
|
|
75
|
-
* dir=rtl خودکار واکنش نشون نمیده) لازمه. reactive هست چون هم به side()
|
|
76
|
-
* و هم به جهتِ زندهی صفحه (directionService.isRtl()) وابستهست.
|
|
101
|
+
* Used to avoid applying responsive defaults repeatedly.
|
|
77
102
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
private previousResponsiveMode;
|
|
104
|
+
private mediaQuery?;
|
|
105
|
+
private removeMediaQueryListener?;
|
|
106
|
+
readonly responsiveConfig: _angular_core.Signal<{
|
|
107
|
+
mode: ngx_kit_drawer_menu.NgxDrawerResponsiveMode;
|
|
108
|
+
breakpoint: number;
|
|
109
|
+
desktopOpen: boolean;
|
|
110
|
+
mobileOpen: boolean;
|
|
111
|
+
desktopBehavior: NgxDrawerBehavior;
|
|
112
|
+
mobileBehavior: NgxDrawerBehavior;
|
|
113
|
+
respectPinned: boolean;
|
|
114
|
+
}>;
|
|
115
|
+
readonly currentMode: _angular_core.Signal<"desktop" | "mobile">;
|
|
116
|
+
readonly currentBehavior: _angular_core.Signal<NgxDrawerBehavior>;
|
|
117
|
+
readonly isOverlay: _angular_core.Signal<boolean>;
|
|
118
|
+
readonly isDocked: _angular_core.Signal<boolean>;
|
|
119
|
+
readonly shouldShowBackdrop: _angular_core.Signal<boolean>;
|
|
120
|
+
readonly drawerWidth: _angular_core.Signal<string>;
|
|
121
|
+
readonly drawerVisible: _angular_core.Signal<boolean>;
|
|
122
|
+
readonly shouldPreservePinned: _angular_core.Signal<boolean>;
|
|
123
|
+
readonly isPinnedAndDesktop: _angular_core.Signal<boolean>;
|
|
124
|
+
get drawerStart(): boolean;
|
|
125
|
+
get drawerEnd(): boolean;
|
|
126
|
+
get drawerOpen(): boolean;
|
|
127
|
+
get drawerMobile(): boolean;
|
|
128
|
+
get drawerDesktop(): boolean;
|
|
129
|
+
get drawerOverlay(): boolean;
|
|
130
|
+
get drawerDock(): boolean;
|
|
131
|
+
get hostWidth(): string;
|
|
132
|
+
get hostDuration(): string;
|
|
133
|
+
get hostZIndex(): number;
|
|
134
|
+
get effectNone(): boolean;
|
|
135
|
+
get effectFabric(): boolean;
|
|
136
|
+
get effectSlide(): boolean;
|
|
137
|
+
get effectPush(): boolean;
|
|
138
|
+
get effectScale(): boolean;
|
|
85
139
|
constructor();
|
|
86
|
-
|
|
87
|
-
|
|
140
|
+
private setupResponsive;
|
|
141
|
+
private setupMediaQuery;
|
|
142
|
+
private updateMobileState;
|
|
143
|
+
private handleResponsiveModeChange;
|
|
144
|
+
private applyInitialResponsiveState;
|
|
145
|
+
private destroyResponsive;
|
|
88
146
|
toggle(): void;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
147
|
+
openDrawer(): void;
|
|
148
|
+
close(): void;
|
|
149
|
+
pin(): void;
|
|
150
|
+
unpin(): void;
|
|
151
|
+
togglePinned(): void;
|
|
152
|
+
onBackdropClick(): void;
|
|
153
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
154
|
+
private lockScroll;
|
|
155
|
+
private unlockScroll;
|
|
96
156
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgxDrawerMenuComponent, never>;
|
|
97
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxDrawerMenuComponent, "ngx-drawer-menu", never, { "side": { "alias": "side"; "required": false; "isSignal": true; }; "effect": { "alias": "effect"; "required": false; "isSignal": true; }; "
|
|
157
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgxDrawerMenuComponent, "ngx-drawer-menu", never, { "side": { "alias": "side"; "required": false; "isSignal": true; }; "effect": { "alias": "effect"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; "pinned": { "alias": "pinned"; "required": false; "isSignal": true; }; "responsive": { "alias": "responsive"; "required": false; "isSignal": true; }; "closeOnBackdrop": { "alias": "closeOnBackdrop"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "lockBodyScroll": { "alias": "lockBodyScroll"; "required": false; "isSignal": true; }; "animationDuration": { "alias": "animationDuration"; "required": false; "isSignal": true; }; "zIndex": { "alias": "zIndex"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "pinned": "pinnedChange"; }, never, ["[drawerContent]", "*"], true, never>;
|
|
98
158
|
}
|
|
99
159
|
|
|
100
|
-
export { NgxDrawerMenuComponent };
|
|
101
|
-
export type {
|
|
160
|
+
export { DEFAULT_DRAWER_RESPONSIVE, NgxDrawerMenuComponent };
|
|
161
|
+
export type { NgxDrawerBehavior, NgxDrawerEffect, NgxDrawerResponsive, NgxDrawerResponsiveMode, NgxDrawerSide };
|