@mintplayer/ng-bootstrap 21.27.0 → 21.29.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.
@@ -0,0 +1,285 @@
1
+ import * as _angular_core from '@angular/core';
2
+ import { TemplateRef, AfterViewInit, ElementRef } from '@angular/core';
3
+ import * as lit from 'lit';
4
+ import { LitElement, TemplateResult, PropertyValues } from 'lit';
5
+
6
+ /**
7
+ * Grid placement of a single tile, in CSS Grid 1-based coordinates.
8
+ * `colStart` / `rowStart` are inclusive; `colSpan` / `rowSpan` are counts of cells.
9
+ */
10
+ interface TilePosition {
11
+ colStart: number;
12
+ rowStart: number;
13
+ colSpan: number;
14
+ rowSpan: number;
15
+ }
16
+
17
+ /**
18
+ * One tile inside a `<bs-tile-manager>`.
19
+ *
20
+ * The component captures two `TemplateRef`s — one for the header (a child
21
+ * `<bs-tile-header>`) and one for the body (everything else) — which the
22
+ * manager projects into named slots on the underlying `<mp-tile-manager>`
23
+ * web component (`${id}-header` and `${id}-content`).
24
+ */
25
+ declare class BsTileComponent {
26
+ readonly id: _angular_core.InputSignal<string>;
27
+ readonly position: _angular_core.InputSignal<TilePosition>;
28
+ readonly disableMove: _angular_core.InputSignal<boolean>;
29
+ readonly disableResize: _angular_core.InputSignal<boolean>;
30
+ readonly label: _angular_core.InputSignal<string | null>;
31
+ readonly positionChange: _angular_core.OutputEmitterRef<TilePosition>;
32
+ readonly headerTpl: _angular_core.Signal<TemplateRef<unknown>>;
33
+ readonly contentTpl: _angular_core.Signal<TemplateRef<unknown>>;
34
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileComponent, never>;
35
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsTileComponent, "bs-tile", never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "position": { "alias": "position"; "required": true; "isSignal": true; }; "disableMove": { "alias": "disableMove"; "required": false; "isSignal": true; }; "disableResize": { "alias": "disableResize"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "positionChange": "positionChange"; }, never, ["bs-tile-header", "*"], true, never>;
36
+ }
37
+
38
+ /**
39
+ * Stable, JSON-serializable snapshot of the manager's layout.
40
+ * One entry per tile, keyed by stable id. Host apps `JSON.stringify`
41
+ * this for persistence and project it back into per-tile `position`
42
+ * inputs to restore.
43
+ */
44
+ type TileLayoutSnapshot = Array<{
45
+ id: string;
46
+ position: TilePosition;
47
+ }>;
48
+ interface TileGestureBlocked {
49
+ id: string;
50
+ reason: 'locked-overlap' | 'no-valid-layout';
51
+ }
52
+
53
+ /**
54
+ * Half-open rectangle in grid coordinates: `[colStart, colStart + colSpan) × [rowStart, rowStart + rowSpan)`.
55
+ * Same shape as `TilePosition` but used internally for overlap math; kept
56
+ * as its own type so call-sites read clearly.
57
+ */
58
+ interface GridRect {
59
+ colStart: number;
60
+ rowStart: number;
61
+ colSpan: number;
62
+ rowSpan: number;
63
+ }
64
+ declare function rectsOverlap(a: GridRect, b: GridRect): boolean;
65
+
66
+ interface MintTile {
67
+ id: string;
68
+ position: TilePosition;
69
+ disableMove: boolean;
70
+ disableResize: boolean;
71
+ label: string | null;
72
+ }
73
+ type TileDragMode = 'tile' | 'header' | 'off';
74
+ type TileResizeMode = 'hover' | 'always' | 'off';
75
+ type GestureState = {
76
+ kind: 'idle';
77
+ } | {
78
+ kind: 'arming-touch-drag';
79
+ pointerId: number;
80
+ tileId: string;
81
+ startX: number;
82
+ startY: number;
83
+ timer: number | null;
84
+ pressingTimer: number | null;
85
+ } | {
86
+ kind: 'drag';
87
+ pointerId: number;
88
+ tileId: string;
89
+ pointerOffset: {
90
+ dx: number;
91
+ dy: number;
92
+ };
93
+ currentRect: GridRect;
94
+ blocked: boolean;
95
+ } | {
96
+ kind: 'resize';
97
+ pointerId: number;
98
+ tileId: string;
99
+ mode: 'side' | 'bottom' | 'corner';
100
+ startPointer: {
101
+ x: number;
102
+ y: number;
103
+ };
104
+ startSpans: {
105
+ colSpan: number;
106
+ rowSpan: number;
107
+ };
108
+ currentRect: GridRect;
109
+ blocked: boolean;
110
+ };
111
+ declare class MintTileManagerElement extends LitElement {
112
+ static styles: lit.CSSResult[];
113
+ static get observedAttributes(): string[];
114
+ static properties: {
115
+ tiles: {
116
+ attribute: boolean;
117
+ };
118
+ columnCount: {
119
+ attribute: string;
120
+ type: NumberConstructor;
121
+ };
122
+ minColumnWidth: {
123
+ attribute: string;
124
+ type: StringConstructor;
125
+ };
126
+ minRowHeight: {
127
+ attribute: string;
128
+ type: StringConstructor;
129
+ };
130
+ gap: {
131
+ attribute: string;
132
+ type: StringConstructor;
133
+ };
134
+ dragMode: {
135
+ attribute: string;
136
+ type: StringConstructor;
137
+ reflect: boolean;
138
+ };
139
+ resizeMode: {
140
+ attribute: string;
141
+ type: StringConstructor;
142
+ reflect: boolean;
143
+ };
144
+ animateReflow: {
145
+ attribute: string;
146
+ type: BooleanConstructor;
147
+ };
148
+ label: {
149
+ attribute: string;
150
+ type: StringConstructor;
151
+ };
152
+ previewLayout: {
153
+ state: boolean;
154
+ };
155
+ gestureKind: {
156
+ state: boolean;
157
+ };
158
+ blocked: {
159
+ state: boolean;
160
+ };
161
+ effectiveColumnCount: {
162
+ state: boolean;
163
+ };
164
+ keyboardMode: {
165
+ state: boolean;
166
+ };
167
+ liveRegionMessage: {
168
+ state: boolean;
169
+ };
170
+ };
171
+ tiles: ReadonlyArray<MintTile>;
172
+ columnCount: number | null;
173
+ minColumnWidth: string;
174
+ minRowHeight: string;
175
+ gap: string;
176
+ dragMode: TileDragMode;
177
+ resizeMode: TileResizeMode;
178
+ animateReflow: boolean;
179
+ label: string | null;
180
+ private gestureState;
181
+ private keyboardState;
182
+ protected previewLayout: TileLayoutSnapshot | null;
183
+ protected gestureKind: GestureState['kind'];
184
+ protected blocked: boolean;
185
+ protected effectiveColumnCount: number;
186
+ protected liveRegionMessage: string;
187
+ private hostResizeObserver;
188
+ private flipPreviousRects;
189
+ private cellMetrics;
190
+ private readonly onWindowPointerMove;
191
+ private readonly onWindowPointerUp;
192
+ private readonly onWindowPointerCancel;
193
+ private readonly onWindowKeyDown;
194
+ private readonly onVisibilityChange;
195
+ render(): TemplateResult;
196
+ private renderTile;
197
+ private computeGridStyle;
198
+ /**
199
+ * Refresh the cached layout metrics by reading layout / computed-style state
200
+ * once. Called from firstUpdated, the ResizeObserver tick, and updated()
201
+ * when an input that affects metrics changes — never from render().
202
+ */
203
+ private updateLayoutCache;
204
+ private computeActiveTransform;
205
+ connectedCallback(): void;
206
+ disconnectedCallback(): void;
207
+ protected firstUpdated(): void;
208
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
209
+ protected willUpdate(_changed: PropertyValues): void;
210
+ protected updated(changed: PropertyValues): void;
211
+ private shouldAnimate;
212
+ private lastPointerPosition;
213
+ private onTilePointerDown;
214
+ private onResizeHandlePointerDown;
215
+ private armPointerDrag;
216
+ private armTouchDrag;
217
+ private cleanupTouchArming;
218
+ private beginDragFromTouchArm;
219
+ private beginDrag;
220
+ private beginResize;
221
+ private attachWindowListeners;
222
+ private detachWindowListeners;
223
+ private handleEscapeKey;
224
+ private handlePointerMove;
225
+ private handlePointerUp;
226
+ private handlePointerCancel;
227
+ private runPackerForCurrentGesture;
228
+ private computeDragRect;
229
+ private computeResizeRect;
230
+ private commitGesture;
231
+ private cancelGesture;
232
+ private cleanupGesture;
233
+ private positionsEqual;
234
+ private cloneSnapshot;
235
+ private activeTileId;
236
+ /** Read-only snapshot of the current layout. Mirrors `BsDockManagerComponent.captureLayout()`. */
237
+ captureLayout(): TileLayoutSnapshot;
238
+ /**
239
+ * True while a drag or resize is in flight. The Angular wrapper uses this to
240
+ * avoid clobbering `tiles` mid-gesture. Touch long-press arming does NOT
241
+ * count — the WC isn't yet owning the layout during the hold.
242
+ */
243
+ get isGestureActive(): boolean;
244
+ private onTileKeyDown;
245
+ private applyKeyboardStep;
246
+ }
247
+ declare global {
248
+ interface HTMLElementTagNameMap {
249
+ 'mp-tile-manager': MintTileManagerElement;
250
+ }
251
+ }
252
+
253
+ declare class BsTileManagerComponent implements AfterViewInit {
254
+ readonly columnCount: _angular_core.InputSignal<number | null>;
255
+ readonly minColumnWidth: _angular_core.InputSignal<string>;
256
+ readonly minRowHeight: _angular_core.InputSignal<string>;
257
+ readonly gap: _angular_core.InputSignal<string>;
258
+ readonly dragMode: _angular_core.InputSignal<TileDragMode>;
259
+ readonly resizeMode: _angular_core.InputSignal<TileResizeMode>;
260
+ readonly animateReflow: _angular_core.InputSignal<boolean>;
261
+ readonly label: _angular_core.InputSignal<string | null>;
262
+ readonly layoutChange: _angular_core.OutputEmitterRef<TileLayoutSnapshot>;
263
+ readonly gestureBlocked: _angular_core.OutputEmitterRef<TileGestureBlocked>;
264
+ readonly tiles: _angular_core.Signal<readonly BsTileComponent[]>;
265
+ readonly managerRef: _angular_core.Signal<ElementRef<MintTileManagerElement> | undefined>;
266
+ protected readonly columnCountAttr: _angular_core.Signal<string | null>;
267
+ private readonly tilesSnapshot;
268
+ constructor();
269
+ ngAfterViewInit(): void;
270
+ /** Returns the current layout. Mirrors `BsDockManagerComponent.captureLayout()`. */
271
+ captureLayout(): TileLayoutSnapshot;
272
+ protected onLayoutChange(event: Event): void;
273
+ protected onPositionChange(event: Event): void;
274
+ protected onGestureBlocked(event: Event): void;
275
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileManagerComponent, never>;
276
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsTileManagerComponent, "bs-tile-manager", never, { "columnCount": { "alias": "columnCount"; "required": false; "isSignal": true; }; "minColumnWidth": { "alias": "minColumnWidth"; "required": false; "isSignal": true; }; "minRowHeight": { "alias": "minRowHeight"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "dragMode": { "alias": "dragMode"; "required": false; "isSignal": true; }; "resizeMode": { "alias": "resizeMode"; "required": false; "isSignal": true; }; "animateReflow": { "alias": "animateReflow"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "layoutChange": "layoutChange"; "gestureBlocked": "gestureBlocked"; }, ["tiles"], never, true, never>;
277
+ }
278
+
279
+ declare class BsTileHeaderComponent {
280
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileHeaderComponent, never>;
281
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsTileHeaderComponent, "bs-tile-header", never, {}, {}, never, ["*"], true, never>;
282
+ }
283
+
284
+ export { BsTileComponent, BsTileHeaderComponent, BsTileManagerComponent, MintTileManagerElement, rectsOverlap };
285
+ export type { GridRect, MintTile, TileDragMode, TileGestureBlocked, TileLayoutSnapshot, TilePosition, TileResizeMode };