@mintplayer/ng-bootstrap 22.26.0 → 22.27.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.
|
@@ -1,220 +1,362 @@
|
|
|
1
|
+
import { isPlatformServer, DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, output, viewChild,
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { Injector, inject, TemplateRef, input, Directive, DestroyRef, contentChild, computed, model, output, linkedSignal, viewChild, ElementRef, effect, untracked, PLATFORM_ID, afterNextRender, ChangeDetectionStrategy, Component, HostAttributeToken } from '@angular/core';
|
|
4
|
+
import { BsIdService } from '@mintplayer/ng-bootstrap/a11y';
|
|
5
|
+
import { machineSignal, useScopedStyles, MpPropsDirective } from '@mintplayer/ng-bootstrap/machine';
|
|
6
|
+
import { writeScopedStyleTag } from '@mintplayer/ui-core/scoped-styles';
|
|
7
|
+
import { DEFAULT_MIN_COLUMN_WIDTH, DEFAULT_GAP, TileManagerMachine, connect, TileFlip, TILE_MANAGER_SCOPE, tileManagerScopedStyles, breakpointCss, gridPointer, readCellMetrics } from '@mintplayer/ui-core/tile-manager';
|
|
8
|
+
export { withoutNarrowerLayouts } from '@mintplayer/ui-core/tile-manager';
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
|
-
* One tile
|
|
11
|
+
* One tile's slots. The manager stamps the `*bsTile` template once per tile with an injector
|
|
12
|
+
* providing that tile's `BsTileSlots`; `*bsTileHeader` / `*bsTileContent` inside it register
|
|
13
|
+
* their template here, and the manager renders them into the tile's header and body. Kept per
|
|
14
|
+
* tile id, so a new tile object (a locked panel, say) updates the view instead of rebuilding it.
|
|
15
|
+
*/
|
|
16
|
+
class BsTileSlots {
|
|
17
|
+
constructor(parent) {
|
|
18
|
+
this.header = null;
|
|
19
|
+
this.content = null;
|
|
20
|
+
this.injector = Injector.create({ providers: [{ provide: BsTileSlots, useValue: this }], parent });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Declares the markup of every tile, once, inside `<bs-tile-manager>`. The header and body are
|
|
25
|
+
* its direct `*bsTileHeader` / `*bsTileContent` children, and both see the tile variable.
|
|
26
|
+
*
|
|
27
|
+
* ```html
|
|
28
|
+
* <bs-tile-manager [(layouts)]="layouts">
|
|
29
|
+
* <ng-container *bsTile="let tile of tiles()">
|
|
30
|
+
* <span *bsTileHeader>{{ tile.title }}</span>
|
|
31
|
+
* <div *bsTileContent>{{ tile.body }}</div>
|
|
32
|
+
* </ng-container>
|
|
33
|
+
* </bs-tile-manager>
|
|
34
|
+
* ```
|
|
8
35
|
*
|
|
9
|
-
*
|
|
10
|
-
* `<bs-tile-header>`) and one for the body (everything else) — which the
|
|
11
|
-
* manager projects into named slots on the underlying `<mp-tile-manager>`
|
|
12
|
-
* web component (`${id}-header` and `${id}-content`).
|
|
36
|
+
* `of` is the manager's tile list, like `ngFor`'s: the manager reads it from here.
|
|
13
37
|
*/
|
|
14
|
-
class
|
|
38
|
+
class BsTileDirective {
|
|
15
39
|
constructor() {
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
...(ngDevMode ? [{ debugName: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...(ngDevMode ? [{ debugName: "disableResize" }] : /* istanbul ignore next */ []));
|
|
24
|
-
this.label = input(null, /* @ts-ignore */
|
|
25
|
-
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
26
|
-
this.positionChange = output();
|
|
27
|
-
this.headerTpl = viewChild.required('headerTpl', /* @ts-ignore */
|
|
28
|
-
...(ngDevMode ? [{ debugName: "headerTpl" }] : /* istanbul ignore next */ []));
|
|
29
|
-
this.contentTpl = viewChild.required('contentTpl', /* @ts-ignore */
|
|
30
|
-
...(ngDevMode ? [{ debugName: "contentTpl" }] : /* istanbul ignore next */ []));
|
|
40
|
+
this.templateRef = inject(TemplateRef);
|
|
41
|
+
/** The visible tiles, in DOM order. */
|
|
42
|
+
this.bsTileOf = input(undefined, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "bsTileOf" }] : /* istanbul ignore next */ []));
|
|
44
|
+
}
|
|
45
|
+
static ngTemplateContextGuard(_dir, ctx) {
|
|
46
|
+
return true;
|
|
31
47
|
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type:
|
|
33
|
-
static { this.ɵ
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
49
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: BsTileDirective, isStandalone: true, selector: "[bsTile]", inputs: { bsTileOf: { classPropertyName: "bsTileOf", publicName: "bsTileOf", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileDirective, decorators: [{
|
|
52
|
+
type: Directive,
|
|
53
|
+
args: [{ selector: '[bsTile]' }]
|
|
54
|
+
}], propDecorators: { bsTileOf: [{ type: i0.Input, args: [{ isSignal: true, alias: "bsTileOf", required: false }] }] } });
|
|
55
|
+
/** A tile's header: the drag handle in `dragMode="header"`. Only valid inside `*bsTile`. */
|
|
56
|
+
class BsTileHeaderDirective {
|
|
57
|
+
constructor() {
|
|
58
|
+
register('header');
|
|
59
|
+
}
|
|
60
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
61
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsTileHeaderDirective, isStandalone: true, selector: "[bsTileHeader]", ngImport: i0 }); }
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileHeaderDirective, decorators: [{
|
|
64
|
+
type: Directive,
|
|
65
|
+
args: [{ selector: '[bsTileHeader]' }]
|
|
66
|
+
}], ctorParameters: () => [] });
|
|
67
|
+
/** A tile's body. Only valid inside `*bsTile`. */
|
|
68
|
+
class BsTileContentDirective {
|
|
69
|
+
constructor() {
|
|
70
|
+
register('content');
|
|
71
|
+
}
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
73
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.8", type: BsTileContentDirective, isStandalone: true, selector: "[bsTileContent]", ngImport: i0 }); }
|
|
74
|
+
}
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileContentDirective, decorators: [{
|
|
76
|
+
type: Directive,
|
|
77
|
+
args: [{ selector: '[bsTileContent]' }]
|
|
78
|
+
}], ctorParameters: () => [] });
|
|
79
|
+
function register(slot) {
|
|
80
|
+
const slots = inject(BsTileSlots);
|
|
81
|
+
const template = inject(TemplateRef);
|
|
82
|
+
slots[slot] = template;
|
|
83
|
+
inject(DestroyRef).onDestroy(() => {
|
|
84
|
+
if (slots[slot] === template)
|
|
85
|
+
slots[slot] = null;
|
|
86
|
+
});
|
|
41
87
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileComponent, decorators: [{
|
|
43
|
-
type: Component,
|
|
44
|
-
args: [{
|
|
45
|
-
selector: 'bs-tile',
|
|
46
|
-
template: `
|
|
47
|
-
<ng-template #headerTpl>
|
|
48
|
-
<ng-content select="bs-tile-header"></ng-content>
|
|
49
|
-
</ng-template>
|
|
50
|
-
<ng-template #contentTpl>
|
|
51
|
-
<ng-content></ng-content>
|
|
52
|
-
</ng-template>
|
|
53
|
-
`,
|
|
54
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
|
-
}]
|
|
56
|
-
}], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: true }] }], disableMove: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableMove", required: false }] }], disableResize: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableResize", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], positionChange: [{ type: i0.Output, args: ["positionChange"] }], headerTpl: [{ type: i0.ViewChild, args: ['headerTpl', { isSignal: true }] }], contentTpl: [{ type: i0.ViewChild, args: ['contentTpl', { isSignal: true }] }] } });
|
|
57
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Tile manager: a dashboard grid whose tiles the user moves and resizes, with one layout per
|
|
91
|
+
* column count (#440).
|
|
92
|
+
*
|
|
93
|
+
* The Angular front of `TileManagerMachine` (`@mintplayer/ui-core/tile-manager`). Every decision
|
|
94
|
+
* (layout per column count, gestures, keyboard, ARIA) is the machine's; this component renders
|
|
95
|
+
* its own template from `connect()`'s bags with `[mpProps]`, measures the grid, owns pointer
|
|
96
|
+
* capture and the FLIP animation, and turns the machine's events into outputs. Tile header and
|
|
97
|
+
* body come from the `*bsTileHeader` / `*bsTileContent` templates inside one `*bsTile` block.
|
|
98
|
+
*
|
|
99
|
+
* SSR: the whole tree is rendered, plus a `<style>` in `<head>` holding the `@container` rules
|
|
100
|
+
* that place every tile at every column count (D14), so the server HTML paints the right layout
|
|
101
|
+
* with no JS. No-JS tier 2: before the first measure the tiles are named groups with no tab stop
|
|
102
|
+
* or grips.
|
|
103
|
+
*/
|
|
58
104
|
class BsTileManagerComponent {
|
|
59
105
|
constructor() {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
106
|
+
/** The `*bsTile` block: the tile markup, and through its `of` the tiles themselves. */
|
|
107
|
+
this.tileTemplate = contentChild(BsTileDirective, /* @ts-ignore */
|
|
108
|
+
...(ngDevMode ? [{ debugName: "tileTemplate" }] : /* istanbul ignore next */ []));
|
|
109
|
+
/**
|
|
110
|
+
* The visible tiles, in DOM order: `*bsTile="let tile of tiles()"`. Read from the directive
|
|
111
|
+
* rather than pushed by it: its input is not set yet when its constructor runs, and a signal
|
|
112
|
+
* write while the view renders is NG0600.
|
|
113
|
+
*/
|
|
114
|
+
this.tiles = computed(() => this.tileTemplate()?.bsTileOf() ?? [], /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "tiles" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/** One layout per column count. Two-way: a commit writes the full next record. */
|
|
117
|
+
this.layouts = model({}, /* @ts-ignore */
|
|
118
|
+
...(ngDevMode ? [{ debugName: "layouts" }] : /* istanbul ignore next */ []));
|
|
119
|
+
/** Explicit `{ minWidth, columns }` map. Wins over `stackBelow` and the generated map. */
|
|
120
|
+
this.breakpoints = input(null, /* @ts-ignore */
|
|
121
|
+
...(ngDevMode ? [{ debugName: "breakpoints" }] : /* istanbul ignore next */ []));
|
|
122
|
+
/** px. Below this width the tiles stack in one column. */
|
|
123
|
+
this.stackBelow = input(null, /* @ts-ignore */
|
|
124
|
+
...(ngDevMode ? [{ debugName: "stackBelow" }] : /* istanbul ignore next */ []));
|
|
125
|
+
/** Upper bound of the generated map when `layouts` is empty. */
|
|
126
|
+
this.maxColumns = input(6, /* @ts-ignore */
|
|
127
|
+
...(ngDevMode ? [{ debugName: "maxColumns" }] : /* istanbul ignore next */ []));
|
|
128
|
+
/** px. No column is narrower than this, except at one column. */
|
|
129
|
+
this.minColumnWidth = input(DEFAULT_MIN_COLUMN_WIDTH, /* @ts-ignore */
|
|
63
130
|
...(ngDevMode ? [{ debugName: "minColumnWidth" }] : /* istanbul ignore next */ []));
|
|
131
|
+
/** CSS length of one grid row. */
|
|
64
132
|
this.minRowHeight = input('8rem', /* @ts-ignore */
|
|
65
133
|
...(ngDevMode ? [{ debugName: "minRowHeight" }] : /* istanbul ignore next */ []));
|
|
66
|
-
|
|
134
|
+
/** px between tiles. */
|
|
135
|
+
this.gap = input(DEFAULT_GAP, /* @ts-ignore */
|
|
67
136
|
...(ngDevMode ? [{ debugName: "gap" }] : /* istanbul ignore next */ []));
|
|
68
137
|
this.dragMode = input('header', /* @ts-ignore */
|
|
69
138
|
...(ngDevMode ? [{ debugName: "dragMode" }] : /* istanbul ignore next */ []));
|
|
70
139
|
this.resizeMode = input('hover', /* @ts-ignore */
|
|
71
140
|
...(ngDevMode ? [{ debugName: "resizeMode" }] : /* istanbul ignore next */ []));
|
|
141
|
+
/** Animate tiles to their new place when the layout reflows. Off under reduced motion. */
|
|
72
142
|
this.animateReflow = input(true, /* @ts-ignore */
|
|
73
143
|
...(ngDevMode ? [{ debugName: "animateReflow" }] : /* istanbul ignore next */ []));
|
|
144
|
+
/** Accessible name of the board. A host `aria-label` / `aria-labelledby` wins. */
|
|
74
145
|
this.label = input(null, /* @ts-ignore */
|
|
75
146
|
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
147
|
+
/** Localized strings for the board's descriptions and announcements. */
|
|
148
|
+
this.messages = input({}, /* @ts-ignore */
|
|
149
|
+
...(ngDevMode ? [{ debugName: "messages" }] : /* istanbul ignore next */ []));
|
|
150
|
+
/** Each step of a gesture or keyboard move: the layout as it would be committed. */
|
|
151
|
+
this.layoutPreview = output();
|
|
152
|
+
/** A commit, with the full layouts record and the stale narrower counts (D15). */
|
|
76
153
|
this.layoutChange = output();
|
|
154
|
+
this.columnCountChange = output();
|
|
77
155
|
this.gestureBlocked = output();
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
return
|
|
156
|
+
this.id = inject(BsIdService).next('bs-tile-manager');
|
|
157
|
+
this.machine = new TileManagerMachine({ vibrate: (ms) => navigator.vibrate?.(ms) });
|
|
158
|
+
this.state = machineSignal(this.machine);
|
|
159
|
+
/** Host transparency: a consumer's aria-* on `<bs-tile-manager>` lands on the region. */
|
|
160
|
+
this.hostAria = takeHostAria();
|
|
161
|
+
this.api = computed(() => {
|
|
162
|
+
this.state();
|
|
163
|
+
const api = connect(this.machine, this.id);
|
|
164
|
+
const describedBy = [api.board.attrs['aria-describedby'], this.hostAria['aria-describedby']].filter(Boolean).join(' ') || null;
|
|
165
|
+
return { ...api, board: { ...api.board, attrs: { ...api.board.attrs, ...this.hostAria, 'aria-describedby': describedBy } } };
|
|
88
166
|
}, /* @ts-ignore */
|
|
89
|
-
...(ngDevMode ? [{ debugName: "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
167
|
+
...(ngDevMode ? [{ debugName: "api" }] : /* istanbul ignore next */ []));
|
|
168
|
+
/** The `*bsTile` context per tile id, stable across change detection. */
|
|
169
|
+
this.tileContext = computed(() => new Map(this.tiles().map((t) => [t.id, { $implicit: t }])), /* @ts-ignore */
|
|
170
|
+
...(ngDevMode ? [{ debugName: "tileContext" }] : /* istanbul ignore next */ []));
|
|
171
|
+
/** Slots per tile id, kept while the id stays so the tile's view is reused, not rebuilt. */
|
|
172
|
+
this.tileSlots = linkedSignal({ ...(ngDevMode ? { debugName: "tileSlots" } : /* istanbul ignore next */ {}), source: this.tiles,
|
|
173
|
+
computation: (tiles, previous) => new Map(tiles.map((t) => [t.id, previous?.value.get(t.id) ?? new BsTileSlots(this.injector)])) });
|
|
174
|
+
// Not `.required`: the machine notifies (onChange) while effects configure it, before the view exists.
|
|
175
|
+
this.grid = viewChild('grid', /* @ts-ignore */
|
|
176
|
+
...(ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []));
|
|
177
|
+
this.host = inject(ElementRef).nativeElement;
|
|
178
|
+
this.injector = inject(Injector);
|
|
179
|
+
this.flip = new TileFlip();
|
|
180
|
+
this.lastRendered = null;
|
|
181
|
+
this.focusSeq = 0;
|
|
182
|
+
this.resizeObserver = null;
|
|
183
|
+
this.measureFrame = 0;
|
|
184
|
+
this.width = 0;
|
|
185
|
+
useScopedStyles(TILE_MANAGER_SCOPE, tileManagerScopedStyles);
|
|
186
|
+
// Inputs → machine. One effect per input, so an unrelated input change never re-pushes a
|
|
187
|
+
// stale controlled `layouts` over the layout the machine just committed (S3).
|
|
188
|
+
const forward = (key, read) => effect(() => {
|
|
189
|
+
const value = read();
|
|
190
|
+
untracked(() => this.machine.setInputs({ [key]: value }));
|
|
191
|
+
});
|
|
192
|
+
forward('tiles', this.tiles);
|
|
193
|
+
forward('breakpoints', this.breakpoints);
|
|
194
|
+
forward('stackBelow', this.stackBelow);
|
|
195
|
+
forward('maxColumns', this.maxColumns);
|
|
196
|
+
forward('minColumnWidth', this.minColumnWidth);
|
|
197
|
+
forward('minRowHeight', this.minRowHeight);
|
|
198
|
+
forward('gap', this.gap);
|
|
199
|
+
forward('dragMode', this.dragMode);
|
|
200
|
+
forward('resizeMode', this.resizeMode);
|
|
201
|
+
forward('label', this.label);
|
|
202
|
+
forward('messages', this.messages);
|
|
203
|
+
// A consumer write to [(layouts)], not the echo of our own commit.
|
|
110
204
|
effect(() => {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
205
|
+
const layouts = this.layouts();
|
|
206
|
+
if (layouts !== untracked(() => this.machine.snapshot.layouts))
|
|
207
|
+
untracked(() => this.machine.setInputs({ layouts }));
|
|
208
|
+
});
|
|
209
|
+
const offEvents = this.machine.onEvent((e) => {
|
|
210
|
+
switch (e.type) {
|
|
211
|
+
case 'layoutchange': {
|
|
212
|
+
const { type: _, ...change } = e;
|
|
213
|
+
this.layouts.set(change.layouts);
|
|
214
|
+
this.layoutChange.emit(change);
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case 'layoutpreview': {
|
|
218
|
+
const { type: _, ...change } = e;
|
|
219
|
+
this.layoutPreview.emit(change);
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
case 'columncountchange':
|
|
223
|
+
this.columnCountChange.emit({ columnCount: e.columnCount, previous: e.previous });
|
|
224
|
+
break;
|
|
225
|
+
case 'gestureblocked': {
|
|
226
|
+
const { type: _, ...blocked } = e;
|
|
227
|
+
this.gestureBlocked.emit(blocked);
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
if (isPlatformServer(inject(PLATFORM_ID))) {
|
|
233
|
+
// D14: Angular strips <style> from templates, so the container rules go into <head>.
|
|
234
|
+
const doc = inject(DOCUMENT);
|
|
235
|
+
effect(() => {
|
|
236
|
+
const css = breakpointCss(this.layouts(), this.tiles(), { breakpoints: this.breakpoints(), stackBelow: this.stackBelow(), minColumnWidth: this.minColumnWidth(), gap: this.gap(), maxColumns: this.maxColumns(), layouts: this.layouts() }, this.id);
|
|
237
|
+
writeScopedStyleTag(doc, `${TILE_MANAGER_SCOPE}-layout-${this.id}`, css);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
// FLIP "first" runs in the store notification, before change detection writes the new positions.
|
|
241
|
+
const unsubscribe = this.machine.subscribe(() => this.onChange());
|
|
242
|
+
const onVisibilityChange = () => {
|
|
243
|
+
if (document.visibilityState === 'hidden')
|
|
244
|
+
this.machine.cancelGesture();
|
|
245
|
+
};
|
|
246
|
+
afterNextRender(() => {
|
|
247
|
+
document.addEventListener('visibilitychange', onVisibilityChange);
|
|
248
|
+
this.observe();
|
|
249
|
+
});
|
|
250
|
+
inject(DestroyRef).onDestroy(() => {
|
|
251
|
+
unsubscribe();
|
|
252
|
+
offEvents();
|
|
253
|
+
this.resizeObserver?.disconnect();
|
|
254
|
+
if (typeof cancelAnimationFrame === 'function')
|
|
255
|
+
cancelAnimationFrame(this.measureFrame);
|
|
256
|
+
if (typeof document !== 'undefined')
|
|
257
|
+
document.removeEventListener('visibilitychange', onVisibilityChange);
|
|
258
|
+
this.machine.destroy();
|
|
116
259
|
});
|
|
117
260
|
}
|
|
118
|
-
|
|
119
|
-
// First push happens via the constructor effect once the view is alive.
|
|
120
|
-
}
|
|
121
|
-
/** Returns the current layout. Mirrors `BsDockManagerComponent.captureLayout()`. */
|
|
261
|
+
/** What is rendered: the resolved column count and its layout (the preview while editing). */
|
|
122
262
|
captureLayout() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
263
|
+
return { columnCount: this.machine.snapshot.columnCount, layout: this.machine.rendered.map((p) => ({ id: p.id, position: { ...p.position } })) };
|
|
264
|
+
}
|
|
265
|
+
/** Drops `layouts[count]` and commits, so that count derives again (D15). */
|
|
266
|
+
resetLayout(count) {
|
|
267
|
+
this.machine.resetLayout(count);
|
|
268
|
+
}
|
|
269
|
+
/** True while a pointer drag or resize is in flight. */
|
|
270
|
+
get isGestureActive() {
|
|
271
|
+
const kind = this.machine.snapshot.gesture.kind;
|
|
272
|
+
return kind === 'drag' || kind === 'resize';
|
|
130
273
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
274
|
+
// ---- template handlers --------------------------------------------------
|
|
275
|
+
down(e, id, part) {
|
|
276
|
+
const grid = this.grid()?.nativeElement;
|
|
277
|
+
if (!grid)
|
|
278
|
+
return;
|
|
279
|
+
const verdict = this.machine.pointerDown(id, part, gridPointer(e, grid), readCellMetrics(grid, this.machine.snapshot.columnCount));
|
|
280
|
+
if (verdict === 'capture') {
|
|
281
|
+
e.preventDefault();
|
|
282
|
+
e.currentTarget.closest('[data-tile-id]')?.setPointerCapture(e.pointerId);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
move(e) {
|
|
286
|
+
const grid = this.grid()?.nativeElement;
|
|
287
|
+
if (grid && this.machine.pointerMove(gridPointer(e, grid)) === 'capture')
|
|
288
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
289
|
+
}
|
|
290
|
+
key(e, id) {
|
|
291
|
+
if (this.machine.keydown(id, e.key, { shift: e.shiftKey }))
|
|
292
|
+
e.preventDefault();
|
|
135
293
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
294
|
+
// ---- internals ----------------------------------------------------------
|
|
295
|
+
// One observer on the grid; `measure` runs in the next frame, never inside the callback (S2).
|
|
296
|
+
observe() {
|
|
297
|
+
const grid = this.grid()?.nativeElement;
|
|
298
|
+
if (!grid || this.resizeObserver || typeof ResizeObserver === 'undefined')
|
|
139
299
|
return;
|
|
140
|
-
|
|
141
|
-
|
|
300
|
+
this.resizeObserver = new ResizeObserver((entries) => {
|
|
301
|
+
const entry = entries[entries.length - 1];
|
|
302
|
+
this.width = entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
|
|
303
|
+
if (this.measureFrame)
|
|
304
|
+
return;
|
|
305
|
+
this.measureFrame = requestAnimationFrame(() => {
|
|
306
|
+
this.measureFrame = 0;
|
|
307
|
+
this.machine.measure(this.width);
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
this.resizeObserver.observe(grid);
|
|
142
311
|
}
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
312
|
+
onChange() {
|
|
313
|
+
const s = this.machine.snapshot;
|
|
314
|
+
const rendered = this.machine.rendered;
|
|
315
|
+
const grid = this.grid()?.nativeElement;
|
|
316
|
+
const reflow = rendered !== this.lastRendered && !!grid && untracked(this.animateReflow) && s.measured;
|
|
317
|
+
this.lastRendered = rendered;
|
|
318
|
+
if (reflow && grid)
|
|
319
|
+
this.flip.first(grid);
|
|
320
|
+
const wantsFocus = !!s.focusRequest && s.focusRequest.seq !== this.focusSeq;
|
|
321
|
+
if (!reflow && !wantsFocus)
|
|
322
|
+
return;
|
|
323
|
+
afterNextRender(() => {
|
|
324
|
+
const now = this.machine.snapshot;
|
|
325
|
+
if (reflow && grid)
|
|
326
|
+
this.flip.play(grid, now.gesture.kind === 'drag' ? now.gesture.tileId : null);
|
|
327
|
+
if (now.focusRequest && now.focusRequest.seq !== this.focusSeq) {
|
|
328
|
+
this.focusSeq = now.focusRequest.seq;
|
|
329
|
+
const tileId = now.focusRequest.tileId;
|
|
330
|
+
Array.from(this.host.querySelectorAll('[data-tile-id]')).find((el) => el.dataset['tileId'] === tileId)?.focus();
|
|
331
|
+
}
|
|
332
|
+
}, { injector: this.injector });
|
|
147
333
|
}
|
|
148
334
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileManagerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
149
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsTileManagerComponent, isStandalone: true, selector: "bs-tile-manager", inputs: {
|
|
150
|
-
<mp-tile-manager
|
|
151
|
-
#manager
|
|
152
|
-
class="bs-tile-manager"
|
|
153
|
-
[attr.column-count]="columnCountAttr()"
|
|
154
|
-
[attr.min-column-width]="minColumnWidth()"
|
|
155
|
-
[attr.min-row-height]="minRowHeight()"
|
|
156
|
-
[attr.gap]="gap()"
|
|
157
|
-
[attr.drag-mode]="dragMode()"
|
|
158
|
-
[attr.resize-mode]="resizeMode()"
|
|
159
|
-
[attr.animate-reflow]="animateReflow() ? '' : null"
|
|
160
|
-
[attr.label]="label()"
|
|
161
|
-
(tilelayoutchange)="onLayoutChange($event)"
|
|
162
|
-
(tilepositionchange)="onPositionChange($event)"
|
|
163
|
-
(tilegestureblocked)="onGestureBlocked($event)"
|
|
164
|
-
>
|
|
165
|
-
@for (tile of tiles(); track tile.id()) {
|
|
166
|
-
<div [attr.slot]="tile.id() + '-header'" class="bs-tile-slot">
|
|
167
|
-
<ng-container *ngTemplateOutlet="tile.headerTpl()"></ng-container>
|
|
168
|
-
</div>
|
|
169
|
-
<div [attr.slot]="tile.id() + '-content'" class="bs-tile-slot">
|
|
170
|
-
<ng-container *ngTemplateOutlet="tile.contentTpl()"></ng-container>
|
|
171
|
-
</div>
|
|
172
|
-
}
|
|
173
|
-
</mp-tile-manager>
|
|
174
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.bs-tile-manager{display:block;width:100%}.bs-tile-slot{display:contents}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
335
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: BsTileManagerComponent, isStandalone: true, selector: "bs-tile-manager", inputs: { layouts: { classPropertyName: "layouts", publicName: "layouts", isSignal: true, isRequired: false, transformFunction: null }, breakpoints: { classPropertyName: "breakpoints", publicName: "breakpoints", isSignal: true, isRequired: false, transformFunction: null }, stackBelow: { classPropertyName: "stackBelow", publicName: "stackBelow", isSignal: true, isRequired: false, transformFunction: null }, maxColumns: { classPropertyName: "maxColumns", publicName: "maxColumns", isSignal: true, isRequired: false, transformFunction: null }, minColumnWidth: { classPropertyName: "minColumnWidth", publicName: "minColumnWidth", isSignal: true, isRequired: false, transformFunction: null }, minRowHeight: { classPropertyName: "minRowHeight", publicName: "minRowHeight", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, dragMode: { classPropertyName: "dragMode", publicName: "dragMode", isSignal: true, isRequired: false, transformFunction: null }, resizeMode: { classPropertyName: "resizeMode", publicName: "resizeMode", isSignal: true, isRequired: false, transformFunction: null }, animateReflow: { classPropertyName: "animateReflow", publicName: "animateReflow", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, messages: { classPropertyName: "messages", publicName: "messages", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { layouts: "layoutsChange", layoutPreview: "layoutPreview", layoutChange: "layoutChange", columnCountChange: "columnCountChange", gestureBlocked: "gestureBlocked" }, host: { classAttribute: "d-block" }, queries: [{ propertyName: "tileTemplate", first: true, predicate: BsTileDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"mp-tile-manager\" [mpProps]=\"api().board.attrs\" [style]=\"api().board.style\">\n <div class=\"tile-container\" [mpProps]=\"api().container\">\n <div #grid class=\"tile-grid\" [mpProps]=\"api().grid.attrs\" [style]=\"api().grid.style\">\n <!-- A press on the header or a grip bubbles to the tile's body handler; the machine\n ignores that second pointerdown for the same pointer, so the innermost part decides. -->\n @for (t of api().tiles; track t.id) {\n @let slots = tileSlots().get(t.id);\n <div class=\"tile\" [mpProps]=\"t.attrs\" [style]=\"t.style\"\n (pointerdown)=\"down($event, t.id, 'body')\"\n (pointermove)=\"move($event)\"\n (pointerup)=\"machine.pointerUp($event)\"\n (pointercancel)=\"machine.pointerCancel($event)\"\n (lostpointercapture)=\"machine.pointerCancel($event)\"\n (keydown)=\"key($event, t.id)\"\n (focus)=\"machine.focus(t.id)\"\n (blur)=\"machine.blur(t.id)\">\n <!-- Stamps the consumer's *bsTile block first: its *bsTileHeader / *bsTileContent\n register into this tile's slots before the outlets below read them. Not inside an\n @if: an @if body refreshes after this view's own bindings, so the reads would run\n first and the server would render empty headers. -->\n <ng-container [ngTemplateOutlet]=\"tileTemplate()?.templateRef ?? null\" [ngTemplateOutletContext]=\"tileContext().get(t.id)\" [ngTemplateOutletInjector]=\"slots?.injector\"></ng-container>\n <div class=\"tile-header\" [mpProps]=\"t.header\" (pointerdown)=\"down($event, t.id, 'header')\">\n @if (slots?.header; as header) {\n <ng-container [ngTemplateOutlet]=\"header\"></ng-container>\n }\n </div>\n <div class=\"tile-content\" [mpProps]=\"t.content\">\n @if (slots?.content; as content) {\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n }\n </div>\n @for (g of t.grips; track g.handle) {\n <span class=\"tile-grip\" [mpProps]=\"g.attrs\" (pointerdown)=\"down($event, t.id, g.handle)\"></span>\n }\n </div>\n }\n </div>\n </div>\n @for (n of api().descriptions; track n.key) {\n <div class=\"tile-sr-only\" [mpProps]=\"n.attrs\">{{ n.text }}</div>\n }\n <span class=\"tile-sr-only\" [mpProps]=\"api().live.attrs\">{{ api().live.text }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: MpPropsDirective, selector: "[mpProps]", inputs: ["mpProps"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
175
336
|
}
|
|
176
337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileManagerComponent, decorators: [{
|
|
177
338
|
type: Component,
|
|
178
|
-
args: [{ selector: 'bs-tile-manager', template:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
@for (tile of tiles(); track tile.id()) {
|
|
195
|
-
<div [attr.slot]="tile.id() + '-header'" class="bs-tile-slot">
|
|
196
|
-
<ng-container *ngTemplateOutlet="tile.headerTpl()"></ng-container>
|
|
197
|
-
</div>
|
|
198
|
-
<div [attr.slot]="tile.id() + '-content'" class="bs-tile-slot">
|
|
199
|
-
<ng-container *ngTemplateOutlet="tile.contentTpl()"></ng-container>
|
|
200
|
-
</div>
|
|
201
|
-
}
|
|
202
|
-
</mp-tile-manager>
|
|
203
|
-
`, imports: [NgTemplateOutlet], schemas: [CUSTOM_ELEMENTS_SCHEMA], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;width:100%}.bs-tile-manager{display:block;width:100%}.bs-tile-slot{display:contents}\n"] }]
|
|
204
|
-
}], ctorParameters: () => [], propDecorators: { columnCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "columnCount", required: false }] }], minColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumnWidth", required: false }] }], minRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRowHeight", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], dragMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragMode", required: false }] }], resizeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeMode", required: false }] }], animateReflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "animateReflow", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], layoutChange: [{ type: i0.Output, args: ["layoutChange"] }], gestureBlocked: [{ type: i0.Output, args: ["gestureBlocked"] }], tiles: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BsTileComponent), { isSignal: true }] }], managerRef: [{ type: i0.ViewChild, args: ['manager', { isSignal: true }] }] } });
|
|
205
|
-
|
|
206
|
-
class BsTileHeaderComponent {
|
|
207
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
208
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: BsTileHeaderComponent, isStandalone: true, selector: "bs-tile-header", ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;font-weight:500;color:var(--bs-body-color, inherit);background:linear-gradient(to bottom,rgba(var(--bs-primary-rgb, 13, 110, 253),.1),rgba(var(--bs-primary-rgb, 13, 110, 253),.04));border-bottom:1px solid var(--bs-border-color, #dee2e6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
339
|
+
args: [{ selector: 'bs-tile-manager', imports: [NgTemplateOutlet, MpPropsDirective], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'd-block' }, template: "<div class=\"mp-tile-manager\" [mpProps]=\"api().board.attrs\" [style]=\"api().board.style\">\n <div class=\"tile-container\" [mpProps]=\"api().container\">\n <div #grid class=\"tile-grid\" [mpProps]=\"api().grid.attrs\" [style]=\"api().grid.style\">\n <!-- A press on the header or a grip bubbles to the tile's body handler; the machine\n ignores that second pointerdown for the same pointer, so the innermost part decides. -->\n @for (t of api().tiles; track t.id) {\n @let slots = tileSlots().get(t.id);\n <div class=\"tile\" [mpProps]=\"t.attrs\" [style]=\"t.style\"\n (pointerdown)=\"down($event, t.id, 'body')\"\n (pointermove)=\"move($event)\"\n (pointerup)=\"machine.pointerUp($event)\"\n (pointercancel)=\"machine.pointerCancel($event)\"\n (lostpointercapture)=\"machine.pointerCancel($event)\"\n (keydown)=\"key($event, t.id)\"\n (focus)=\"machine.focus(t.id)\"\n (blur)=\"machine.blur(t.id)\">\n <!-- Stamps the consumer's *bsTile block first: its *bsTileHeader / *bsTileContent\n register into this tile's slots before the outlets below read them. Not inside an\n @if: an @if body refreshes after this view's own bindings, so the reads would run\n first and the server would render empty headers. -->\n <ng-container [ngTemplateOutlet]=\"tileTemplate()?.templateRef ?? null\" [ngTemplateOutletContext]=\"tileContext().get(t.id)\" [ngTemplateOutletInjector]=\"slots?.injector\"></ng-container>\n <div class=\"tile-header\" [mpProps]=\"t.header\" (pointerdown)=\"down($event, t.id, 'header')\">\n @if (slots?.header; as header) {\n <ng-container [ngTemplateOutlet]=\"header\"></ng-container>\n }\n </div>\n <div class=\"tile-content\" [mpProps]=\"t.content\">\n @if (slots?.content; as content) {\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n }\n </div>\n @for (g of t.grips; track g.handle) {\n <span class=\"tile-grip\" [mpProps]=\"g.attrs\" (pointerdown)=\"down($event, t.id, g.handle)\"></span>\n }\n </div>\n }\n </div>\n </div>\n @for (n of api().descriptions; track n.key) {\n <div class=\"tile-sr-only\" [mpProps]=\"n.attrs\">{{ n.text }}</div>\n }\n <span class=\"tile-sr-only\" [mpProps]=\"api().live.attrs\">{{ api().live.text }}</span>\n</div>\n" }]
|
|
340
|
+
}], ctorParameters: () => [], propDecorators: { tileTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => BsTileDirective), { isSignal: true }] }], layouts: [{ type: i0.Input, args: [{ isSignal: true, alias: "layouts", required: false }] }, { type: i0.Output, args: ["layoutsChange"] }], breakpoints: [{ type: i0.Input, args: [{ isSignal: true, alias: "breakpoints", required: false }] }], stackBelow: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackBelow", required: false }] }], maxColumns: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxColumns", required: false }] }], minColumnWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "minColumnWidth", required: false }] }], minRowHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "minRowHeight", required: false }] }], gap: [{ type: i0.Input, args: [{ isSignal: true, alias: "gap", required: false }] }], dragMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "dragMode", required: false }] }], resizeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizeMode", required: false }] }], animateReflow: [{ type: i0.Input, args: [{ isSignal: true, alias: "animateReflow", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], messages: [{ type: i0.Input, args: [{ isSignal: true, alias: "messages", required: false }] }], layoutPreview: [{ type: i0.Output, args: ["layoutPreview"] }], layoutChange: [{ type: i0.Output, args: ["layoutChange"] }], columnCountChange: [{ type: i0.Output, args: ["columnCountChange"] }], gestureBlocked: [{ type: i0.Output, args: ["gestureBlocked"] }], grid: [{ type: i0.ViewChild, args: ['grid', { isSignal: true }] }] } });
|
|
341
|
+
const HOST_ARIA = ['aria-label', 'aria-labelledby', 'aria-describedby'];
|
|
342
|
+
/**
|
|
343
|
+
* A consumer's static `aria-label` / `-labelledby` / `-describedby` on `<bs-tile-manager>`. Read
|
|
344
|
+
* from the template (HostAttributeToken), not the DOM, so server and hydrated client agree; the
|
|
345
|
+
* copy on the roleless host is removed so nothing is announced twice.
|
|
346
|
+
*/
|
|
347
|
+
function takeHostAria() {
|
|
348
|
+
const host = inject(ElementRef).nativeElement;
|
|
349
|
+
const bag = Object.fromEntries(HOST_ARIA.flatMap((name) => {
|
|
350
|
+
const value = inject(new HostAttributeToken(name), { optional: true });
|
|
351
|
+
return value === null ? [] : [[name, value]];
|
|
352
|
+
}));
|
|
353
|
+
Object.keys(bag).forEach((name) => host.removeAttribute(name));
|
|
354
|
+
return bag;
|
|
209
355
|
}
|
|
210
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: BsTileHeaderComponent, decorators: [{
|
|
211
|
-
type: Component,
|
|
212
|
-
args: [{ selector: 'bs-tile-header', template: `<ng-content></ng-content>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;font-size:.875rem;font-weight:500;color:var(--bs-body-color, inherit);background:linear-gradient(to bottom,rgba(var(--bs-primary-rgb, 13, 110, 253),.1),rgba(var(--bs-primary-rgb, 13, 110, 253),.04));border-bottom:1px solid var(--bs-border-color, #dee2e6);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}\n"] }]
|
|
213
|
-
}] });
|
|
214
356
|
|
|
215
357
|
/**
|
|
216
358
|
* Generated bundle index. Do not edit.
|
|
217
359
|
*/
|
|
218
360
|
|
|
219
|
-
export {
|
|
361
|
+
export { BsTileContentDirective, BsTileDirective, BsTileHeaderDirective, BsTileManagerComponent, BsTileSlots };
|
|
220
362
|
//# sourceMappingURL=mintplayer-ng-bootstrap-tile-manager.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-bootstrap-tile-manager.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/components/tile.component.ts","../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/components/tile-manager.component.ts","../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/components/tile-header.component.ts","../../../../libs/mintplayer-ng-bootstrap/tile-manager/mintplayer-ng-bootstrap-tile-manager.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport type { TilePosition } from '@mintplayer/web-components/tile-manager';\n\n/**\n * One tile inside a `<bs-tile-manager>`.\n *\n * The component captures two `TemplateRef`s — one for the header (a child\n * `<bs-tile-header>`) and one for the body (everything else) — which the\n * manager projects into named slots on the underlying `<mp-tile-manager>`\n * web component (`${id}-header` and `${id}-content`).\n */\n@Component({\n selector: 'bs-tile',\n template: `\n <ng-template #headerTpl>\n <ng-content select=\"bs-tile-header\"></ng-content>\n </ng-template>\n <ng-template #contentTpl>\n <ng-content></ng-content>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsTileComponent {\n readonly id = input.required<string>();\n readonly position = input.required<TilePosition>();\n readonly disableMove = input<boolean>(false);\n readonly disableResize = input<boolean>(false);\n readonly label = input<string | null>(null);\n\n readonly positionChange = output<TilePosition>();\n\n readonly headerTpl = viewChild.required<TemplateRef<unknown>>('headerTpl');\n readonly contentTpl = viewChild.required<TemplateRef<unknown>>('contentTpl');\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n ElementRef,\n computed,\n contentChildren,\n effect,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BsTileComponent } from './tile.component';\nimport {\n type MintTile,\n MintTileManagerElement,\n type TileDragMode,\n type TileResizeMode,\n type TileLayoutSnapshot,\n type TileGestureBlocked,\n type TilePosition,\n} from '@mintplayer/web-components/tile-manager';\n\n// Side-effect import: registers <mp-tile-manager>.\nimport '@mintplayer/web-components/tile-manager';\n\n@Component({\n selector: 'bs-tile-manager',\n template: `\n <mp-tile-manager\n #manager\n class=\"bs-tile-manager\"\n [attr.column-count]=\"columnCountAttr()\"\n [attr.min-column-width]=\"minColumnWidth()\"\n [attr.min-row-height]=\"minRowHeight()\"\n [attr.gap]=\"gap()\"\n [attr.drag-mode]=\"dragMode()\"\n [attr.resize-mode]=\"resizeMode()\"\n [attr.animate-reflow]=\"animateReflow() ? '' : null\"\n [attr.label]=\"label()\"\n (tilelayoutchange)=\"onLayoutChange($event)\"\n (tilepositionchange)=\"onPositionChange($event)\"\n (tilegestureblocked)=\"onGestureBlocked($event)\"\n >\n @for (tile of tiles(); track tile.id()) {\n <div [attr.slot]=\"tile.id() + '-header'\" class=\"bs-tile-slot\">\n <ng-container *ngTemplateOutlet=\"tile.headerTpl()\"></ng-container>\n </div>\n <div [attr.slot]=\"tile.id() + '-content'\" class=\"bs-tile-slot\">\n <ng-container *ngTemplateOutlet=\"tile.contentTpl()\"></ng-container>\n </div>\n }\n </mp-tile-manager>\n `,\n styles: [\n `\n :host {\n display: block;\n width: 100%;\n }\n .bs-tile-manager {\n display: block;\n width: 100%;\n }\n .bs-tile-slot {\n display: contents;\n }\n `,\n ],\n imports: [NgTemplateOutlet],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsTileManagerComponent implements AfterViewInit {\n readonly columnCount = input<number | null>(null);\n readonly minColumnWidth = input<string>('200px');\n readonly minRowHeight = input<string>('8rem');\n readonly gap = input<string>('0.5rem');\n readonly dragMode = input<TileDragMode>('header');\n readonly resizeMode = input<TileResizeMode>('hover');\n readonly animateReflow = input<boolean>(true);\n readonly label = input<string | null>(null);\n\n readonly layoutChange = output<TileLayoutSnapshot>();\n readonly gestureBlocked = output<TileGestureBlocked>();\n\n readonly tiles = contentChildren(BsTileComponent);\n // Deliberately NOT viewChild.required: public methods read it, and a caller that reaches\n // this component through DI (a child's constructor, say) can call one before this\n // component's view exists. There, NG0951 would throw where the guard is a no-op.\n readonly managerRef = viewChild<ElementRef<MintTileManagerElement>>('manager');\n\n protected readonly columnCountAttr = computed(() => {\n const c = this.columnCount();\n return c && c > 0 ? String(c) : null;\n });\n\n // Snapshot of Angular tile state, derived from contentChildren signals.\n // Re-runs whenever any tile's id, position, disableMove, disableResize, or label changes.\n // contentChildren() can surface a child before Angular has finished binding its\n // required inputs; reading them then throws NG0950. flatMap-with-try lets us\n // skip the not-yet-bound entry — the effect re-runs once binding completes.\n private readonly tilesSnapshot = computed<MintTile[]>(() =>\n this.tiles().flatMap((t) => {\n try {\n return [{\n id: t.id(),\n position: t.position(),\n disableMove: t.disableMove(),\n disableResize: t.disableResize(),\n label: t.label(),\n }];\n } catch {\n return [];\n }\n }),\n );\n\n constructor() {\n effect(() => {\n const snapshot = this.tilesSnapshot();\n const ref = this.managerRef();\n if (!ref) return;\n ref.nativeElement.tiles = snapshot;\n });\n }\n\n ngAfterViewInit(): void {\n // First push happens via the constructor effect once the view is alive.\n }\n\n /** Returns the current layout. Mirrors `BsDockManagerComponent.captureLayout()`. */\n captureLayout(): TileLayoutSnapshot {\n const ref = this.managerRef();\n if (!ref) return [];\n return Array.from(ref.nativeElement.tiles ?? []).map((t) => ({\n id: t.id,\n position: { ...t.position },\n }));\n }\n\n protected onLayoutChange(event: Event): void {\n const detail = (event as CustomEvent<TileLayoutSnapshot>).detail;\n if (detail) this.layoutChange.emit(detail);\n }\n\n protected onPositionChange(event: Event): void {\n const detail = (event as CustomEvent<{ id: string; position: TilePosition }>).detail;\n if (!detail) return;\n const tile = this.tiles().find((t) => t.id() === detail.id);\n tile?.positionChange.emit(detail.position);\n }\n\n protected onGestureBlocked(event: Event): void {\n const detail = (event as CustomEvent<TileGestureBlocked>).detail;\n if (detail) this.gestureBlocked.emit(detail);\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'bs-tile-header',\n template: `<ng-content></ng-content>`,\n styles: [\n `:host {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n padding: 0.5rem 0.75rem;\n font-size: 0.875rem;\n font-weight: 500;\n color: var(--bs-body-color, inherit);\n background: linear-gradient(to bottom, rgba(var(--bs-primary-rgb, 13, 110, 253), 0.10), rgba(var(--bs-primary-rgb, 13, 110, 253), 0.04));\n border-bottom: 1px solid var(--bs-border-color, #dee2e6);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n -webkit-touch-callout: none;\n }`,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsTileHeaderComponent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;AAOG;MAaU,eAAe,CAAA;AAZ5B,IAAA,WAAA,GAAA;QAaW,IAAA,CAAA,EAAE,GAAG,KAAK,CAAC,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B,EAAA,UAAA,EAAA,CAAA;kBAzBjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAAA,QAAA,EAChB,CAAA,yBAAA,CAA2B,EAAA,eAAA,EAqBpB,uBAAuB,CAAC,MAAM,EAAA,MAAA,EAAA,CAAA,ydAAA,CAAA,EAAA;;;ACzBjD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-bootstrap-tile-manager.mjs","sources":["../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/directives/tile-template.directives.ts","../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/components/tile-manager.component.ts","../../../../libs/mintplayer-ng-bootstrap/tile-manager/src/lib/components/tile-manager.component.html","../../../../libs/mintplayer-ng-bootstrap/tile-manager/mintplayer-ng-bootstrap-tile-manager.ts"],"sourcesContent":["import { DestroyRef, Directive, inject, Injector, input, TemplateRef } from '@angular/core';\nimport type { MintTile } from '@mintplayer/ui-core/tile-manager';\n\n/** The context of a `*bsTile` template: the tile it renders. */\nexport interface BsTileContext<T extends MintTile = MintTile> {\n $implicit: T;\n}\n\n/**\n * One tile's slots. The manager stamps the `*bsTile` template once per tile with an injector\n * providing that tile's `BsTileSlots`; `*bsTileHeader` / `*bsTileContent` inside it register\n * their template here, and the manager renders them into the tile's header and body. Kept per\n * tile id, so a new tile object (a locked panel, say) updates the view instead of rebuilding it.\n */\nexport class BsTileSlots {\n header: TemplateRef<unknown> | null = null;\n content: TemplateRef<unknown> | null = null;\n readonly injector: Injector;\n\n constructor(parent: Injector) {\n this.injector = Injector.create({ providers: [{ provide: BsTileSlots, useValue: this }], parent });\n }\n}\n\n/**\n * Declares the markup of every tile, once, inside `<bs-tile-manager>`. The header and body are\n * its direct `*bsTileHeader` / `*bsTileContent` children, and both see the tile variable.\n *\n * ```html\n * <bs-tile-manager [(layouts)]=\"layouts\">\n * <ng-container *bsTile=\"let tile of tiles()\">\n * <span *bsTileHeader>{{ tile.title }}</span>\n * <div *bsTileContent>{{ tile.body }}</div>\n * </ng-container>\n * </bs-tile-manager>\n * ```\n *\n * `of` is the manager's tile list, like `ngFor`'s: the manager reads it from here.\n */\n@Directive({ selector: '[bsTile]' })\nexport class BsTileDirective<T extends MintTile = MintTile> {\n readonly templateRef = inject<TemplateRef<BsTileContext<T>>>(TemplateRef);\n /** The visible tiles, in DOM order. */\n readonly bsTileOf = input<readonly T[] | null | undefined>(undefined);\n\n static ngTemplateContextGuard<T extends MintTile>(_dir: BsTileDirective<T>, ctx: unknown): ctx is BsTileContext<T> {\n return true;\n }\n}\n\n/** A tile's header: the drag handle in `dragMode=\"header\"`. Only valid inside `*bsTile`. */\n@Directive({ selector: '[bsTileHeader]' })\nexport class BsTileHeaderDirective {\n constructor() {\n register('header');\n }\n}\n\n/** A tile's body. Only valid inside `*bsTile`. */\n@Directive({ selector: '[bsTileContent]' })\nexport class BsTileContentDirective {\n constructor() {\n register('content');\n }\n}\n\nfunction register(slot: 'header' | 'content'): void {\n const slots = inject(BsTileSlots);\n const template = inject(TemplateRef);\n slots[slot] = template;\n inject(DestroyRef).onDestroy(() => {\n if (slots[slot] === template) slots[slot] = null;\n });\n}\n","import { DOCUMENT, isPlatformServer, NgTemplateOutlet } from '@angular/common';\nimport {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n DestroyRef,\n effect,\n ElementRef,\n HostAttributeToken,\n inject,\n Injector,\n input,\n linkedSignal,\n model,\n output,\n PLATFORM_ID,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { BsIdService } from '@mintplayer/ng-bootstrap/a11y';\nimport { machineSignal, MpPropsDirective, useScopedStyles } from '@mintplayer/ng-bootstrap/machine';\nimport { writeScopedStyleTag } from '@mintplayer/ui-core/scoped-styles';\nimport {\n breakpointCss,\n connect,\n DEFAULT_GAP,\n DEFAULT_MIN_COLUMN_WIDTH,\n gridPointer,\n readCellMetrics,\n TILE_MANAGER_SCOPE,\n TileFlip,\n TileManagerMachine,\n tileManagerScopedStyles,\n type MintTile,\n type TileBreakpoint,\n type TileDragMode,\n type TileGestureBlocked,\n type TileLayoutChange,\n type TileLayouts,\n type TileLayoutSnapshot,\n type TileManagerInputPatch,\n type TileManagerMessages,\n type TilePart,\n type TileResizeMode,\n} from '@mintplayer/ui-core/tile-manager';\nimport { BsTileDirective, BsTileSlots, type BsTileContext } from '../directives/tile-template.directives';\n\n/** Payload of `columnCountChange`. */\nexport interface BsTileColumnCountChange {\n columnCount: number;\n previous: number | null;\n}\n\n/**\n * Tile manager: a dashboard grid whose tiles the user moves and resizes, with one layout per\n * column count (#440).\n *\n * The Angular front of `TileManagerMachine` (`@mintplayer/ui-core/tile-manager`). Every decision\n * (layout per column count, gestures, keyboard, ARIA) is the machine's; this component renders\n * its own template from `connect()`'s bags with `[mpProps]`, measures the grid, owns pointer\n * capture and the FLIP animation, and turns the machine's events into outputs. Tile header and\n * body come from the `*bsTileHeader` / `*bsTileContent` templates inside one `*bsTile` block.\n *\n * SSR: the whole tree is rendered, plus a `<style>` in `<head>` holding the `@container` rules\n * that place every tile at every column count (D14), so the server HTML paints the right layout\n * with no JS. No-JS tier 2: before the first measure the tiles are named groups with no tab stop\n * or grips.\n */\n@Component({\n selector: 'bs-tile-manager',\n templateUrl: './tile-manager.component.html',\n imports: [NgTemplateOutlet, MpPropsDirective],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'd-block' },\n})\nexport class BsTileManagerComponent<T extends MintTile = MintTile> {\n /** The `*bsTile` block: the tile markup, and through its `of` the tiles themselves. */\n readonly tileTemplate = contentChild<BsTileDirective<T>>(BsTileDirective);\n /**\n * The visible tiles, in DOM order: `*bsTile=\"let tile of tiles()\"`. Read from the directive\n * rather than pushed by it: its input is not set yet when its constructor runs, and a signal\n * write while the view renders is NG0600.\n */\n readonly tiles = computed<readonly T[]>(() => this.tileTemplate()?.bsTileOf() ?? []);\n /** One layout per column count. Two-way: a commit writes the full next record. */\n readonly layouts = model<TileLayouts>({});\n /** Explicit `{ minWidth, columns }` map. Wins over `stackBelow` and the generated map. */\n readonly breakpoints = input<readonly TileBreakpoint[] | null>(null);\n /** px. Below this width the tiles stack in one column. */\n readonly stackBelow = input<number | null>(null);\n /** Upper bound of the generated map when `layouts` is empty. */\n readonly maxColumns = input<number>(6);\n /** px. No column is narrower than this, except at one column. */\n readonly minColumnWidth = input<number>(DEFAULT_MIN_COLUMN_WIDTH);\n /** CSS length of one grid row. */\n readonly minRowHeight = input<string>('8rem');\n /** px between tiles. */\n readonly gap = input<number>(DEFAULT_GAP);\n readonly dragMode = input<TileDragMode>('header');\n readonly resizeMode = input<TileResizeMode>('hover');\n /** Animate tiles to their new place when the layout reflows. Off under reduced motion. */\n readonly animateReflow = input<boolean>(true);\n /** Accessible name of the board. A host `aria-label` / `aria-labelledby` wins. */\n readonly label = input<string | null>(null);\n /** Localized strings for the board's descriptions and announcements. */\n readonly messages = input<Partial<TileManagerMessages>>({});\n\n /** Each step of a gesture or keyboard move: the layout as it would be committed. */\n readonly layoutPreview = output<TileLayoutChange>();\n /** A commit, with the full layouts record and the stale narrower counts (D15). */\n readonly layoutChange = output<TileLayoutChange>();\n readonly columnCountChange = output<BsTileColumnCountChange>();\n readonly gestureBlocked = output<TileGestureBlocked>();\n\n readonly id = inject(BsIdService).next('bs-tile-manager');\n readonly machine = new TileManagerMachine({ vibrate: (ms) => navigator.vibrate?.(ms) });\n readonly state = machineSignal(this.machine);\n /** Host transparency: a consumer's aria-* on `<bs-tile-manager>` lands on the region. */\n private readonly hostAria = takeHostAria();\n readonly api = computed(() => {\n this.state();\n const api = connect(this.machine, this.id);\n const describedBy = [api.board.attrs['aria-describedby'], this.hostAria['aria-describedby']].filter(Boolean).join(' ') || null;\n return { ...api, board: { ...api.board, attrs: { ...api.board.attrs, ...this.hostAria, 'aria-describedby': describedBy } } };\n });\n /** The `*bsTile` context per tile id, stable across change detection. */\n readonly tileContext = computed(() => new Map(this.tiles().map((t) => [t.id, { $implicit: t } as BsTileContext<T>])));\n /** Slots per tile id, kept while the id stays so the tile's view is reused, not rebuilt. */\n readonly tileSlots = linkedSignal<readonly T[], ReadonlyMap<string, BsTileSlots>>({\n source: this.tiles,\n computation: (tiles, previous) => new Map(tiles.map((t) => [t.id, previous?.value.get(t.id) ?? new BsTileSlots(this.injector)])),\n });\n\n // Not `.required`: the machine notifies (onChange) while effects configure it, before the view exists.\n private readonly grid = viewChild<ElementRef<HTMLElement>>('grid');\n private readonly host = inject(ElementRef).nativeElement as HTMLElement;\n private readonly injector = inject(Injector);\n private readonly flip = new TileFlip();\n private lastRendered: TileLayoutSnapshot | null = null;\n private focusSeq = 0;\n private resizeObserver: ResizeObserver | null = null;\n private measureFrame = 0;\n private width = 0;\n\n constructor() {\n useScopedStyles(TILE_MANAGER_SCOPE, tileManagerScopedStyles);\n\n // Inputs → machine. One effect per input, so an unrelated input change never re-pushes a\n // stale controlled `layouts` over the layout the machine just committed (S3).\n const forward = <K extends keyof TileManagerInputPatch>(key: K, read: () => TileManagerInputPatch[K]) =>\n effect(() => {\n const value = read();\n untracked(() => this.machine.setInputs({ [key]: value } as TileManagerInputPatch));\n });\n forward('tiles', this.tiles);\n forward('breakpoints', this.breakpoints);\n forward('stackBelow', this.stackBelow);\n forward('maxColumns', this.maxColumns);\n forward('minColumnWidth', this.minColumnWidth);\n forward('minRowHeight', this.minRowHeight);\n forward('gap', this.gap);\n forward('dragMode', this.dragMode);\n forward('resizeMode', this.resizeMode);\n forward('label', this.label);\n forward('messages', this.messages);\n // A consumer write to [(layouts)], not the echo of our own commit.\n effect(() => {\n const layouts = this.layouts();\n if (layouts !== untracked(() => this.machine.snapshot.layouts)) untracked(() => this.machine.setInputs({ layouts }));\n });\n\n const offEvents = this.machine.onEvent((e) => {\n switch (e.type) {\n case 'layoutchange': {\n const { type: _, ...change } = e;\n this.layouts.set(change.layouts);\n this.layoutChange.emit(change);\n break;\n }\n case 'layoutpreview': {\n const { type: _, ...change } = e;\n this.layoutPreview.emit(change);\n break;\n }\n case 'columncountchange':\n this.columnCountChange.emit({ columnCount: e.columnCount, previous: e.previous });\n break;\n case 'gestureblocked': {\n const { type: _, ...blocked } = e;\n this.gestureBlocked.emit(blocked);\n break;\n }\n }\n });\n\n if (isPlatformServer(inject(PLATFORM_ID))) {\n // D14: Angular strips <style> from templates, so the container rules go into <head>.\n const doc = inject(DOCUMENT);\n effect(() => {\n const css = breakpointCss(\n this.layouts(),\n this.tiles(),\n { breakpoints: this.breakpoints(), stackBelow: this.stackBelow(), minColumnWidth: this.minColumnWidth(), gap: this.gap(), maxColumns: this.maxColumns(), layouts: this.layouts() },\n this.id,\n );\n writeScopedStyleTag(doc, `${TILE_MANAGER_SCOPE}-layout-${this.id}`, css);\n });\n }\n\n // FLIP \"first\" runs in the store notification, before change detection writes the new positions.\n const unsubscribe = this.machine.subscribe(() => this.onChange());\n const onVisibilityChange = () => {\n if (document.visibilityState === 'hidden') this.machine.cancelGesture();\n };\n afterNextRender(() => {\n document.addEventListener('visibilitychange', onVisibilityChange);\n this.observe();\n });\n\n inject(DestroyRef).onDestroy(() => {\n unsubscribe();\n offEvents();\n this.resizeObserver?.disconnect();\n if (typeof cancelAnimationFrame === 'function') cancelAnimationFrame(this.measureFrame);\n if (typeof document !== 'undefined') document.removeEventListener('visibilitychange', onVisibilityChange);\n this.machine.destroy();\n });\n }\n\n /** What is rendered: the resolved column count and its layout (the preview while editing). */\n captureLayout(): { columnCount: number; layout: TileLayoutSnapshot } {\n return { columnCount: this.machine.snapshot.columnCount, layout: this.machine.rendered.map((p) => ({ id: p.id, position: { ...p.position } })) };\n }\n\n /** Drops `layouts[count]` and commits, so that count derives again (D15). */\n resetLayout(count: number): void {\n this.machine.resetLayout(count);\n }\n\n /** True while a pointer drag or resize is in flight. */\n get isGestureActive(): boolean {\n const kind = this.machine.snapshot.gesture.kind;\n return kind === 'drag' || kind === 'resize';\n }\n\n // ---- template handlers --------------------------------------------------\n\n down(e: PointerEvent, id: string, part: TilePart): void {\n const grid = this.grid()?.nativeElement;\n if (!grid) return;\n const verdict = this.machine.pointerDown(id, part, gridPointer(e, grid), readCellMetrics(grid, this.machine.snapshot.columnCount));\n if (verdict === 'capture') {\n e.preventDefault();\n (e.currentTarget as HTMLElement).closest<HTMLElement>('[data-tile-id]')?.setPointerCapture(e.pointerId);\n }\n }\n\n move(e: PointerEvent): void {\n const grid = this.grid()?.nativeElement;\n if (grid && this.machine.pointerMove(gridPointer(e, grid)) === 'capture') (e.currentTarget as HTMLElement).setPointerCapture(e.pointerId);\n }\n\n key(e: KeyboardEvent, id: string): void {\n if (this.machine.keydown(id, e.key, { shift: e.shiftKey })) e.preventDefault();\n }\n\n // ---- internals ----------------------------------------------------------\n\n // One observer on the grid; `measure` runs in the next frame, never inside the callback (S2).\n private observe(): void {\n const grid = this.grid()?.nativeElement;\n if (!grid || this.resizeObserver || typeof ResizeObserver === 'undefined') return;\n this.resizeObserver = new ResizeObserver((entries) => {\n const entry = entries[entries.length - 1];\n this.width = entry.contentBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;\n if (this.measureFrame) return;\n this.measureFrame = requestAnimationFrame(() => {\n this.measureFrame = 0;\n this.machine.measure(this.width);\n });\n });\n this.resizeObserver.observe(grid);\n }\n\n private onChange(): void {\n const s = this.machine.snapshot;\n const rendered = this.machine.rendered;\n const grid = this.grid()?.nativeElement;\n const reflow = rendered !== this.lastRendered && !!grid && untracked(this.animateReflow) && s.measured;\n this.lastRendered = rendered;\n if (reflow && grid) this.flip.first(grid);\n const wantsFocus = !!s.focusRequest && s.focusRequest.seq !== this.focusSeq;\n if (!reflow && !wantsFocus) return;\n afterNextRender(\n () => {\n const now = this.machine.snapshot;\n if (reflow && grid) this.flip.play(grid,now.gesture.kind === 'drag' ? now.gesture.tileId : null);\n if (now.focusRequest && now.focusRequest.seq !== this.focusSeq) {\n this.focusSeq = now.focusRequest.seq;\n const tileId = now.focusRequest.tileId;\n Array.from(this.host.querySelectorAll<HTMLElement>('[data-tile-id]')).find((el) => el.dataset['tileId'] === tileId)?.focus();\n }\n },\n { injector: this.injector },\n );\n }\n}\n\nconst HOST_ARIA = ['aria-label', 'aria-labelledby', 'aria-describedby'] as const;\n\n/**\n * A consumer's static `aria-label` / `-labelledby` / `-describedby` on `<bs-tile-manager>`. Read\n * from the template (HostAttributeToken), not the DOM, so server and hydrated client agree; the\n * copy on the roleless host is removed so nothing is announced twice.\n */\nfunction takeHostAria(): Record<string, string> {\n const host = inject(ElementRef).nativeElement as HTMLElement;\n const bag: Record<string, string> = Object.fromEntries(\n HOST_ARIA.flatMap((name) => {\n const value = inject(new HostAttributeToken(name), { optional: true });\n return value === null ? [] : [[name, value]];\n }),\n );\n Object.keys(bag).forEach((name) => host.removeAttribute(name));\n return bag;\n}\n","<div class=\"mp-tile-manager\" [mpProps]=\"api().board.attrs\" [style]=\"api().board.style\">\n <div class=\"tile-container\" [mpProps]=\"api().container\">\n <div #grid class=\"tile-grid\" [mpProps]=\"api().grid.attrs\" [style]=\"api().grid.style\">\n <!-- A press on the header or a grip bubbles to the tile's body handler; the machine\n ignores that second pointerdown for the same pointer, so the innermost part decides. -->\n @for (t of api().tiles; track t.id) {\n @let slots = tileSlots().get(t.id);\n <div class=\"tile\" [mpProps]=\"t.attrs\" [style]=\"t.style\"\n (pointerdown)=\"down($event, t.id, 'body')\"\n (pointermove)=\"move($event)\"\n (pointerup)=\"machine.pointerUp($event)\"\n (pointercancel)=\"machine.pointerCancel($event)\"\n (lostpointercapture)=\"machine.pointerCancel($event)\"\n (keydown)=\"key($event, t.id)\"\n (focus)=\"machine.focus(t.id)\"\n (blur)=\"machine.blur(t.id)\">\n <!-- Stamps the consumer's *bsTile block first: its *bsTileHeader / *bsTileContent\n register into this tile's slots before the outlets below read them. Not inside an\n @if: an @if body refreshes after this view's own bindings, so the reads would run\n first and the server would render empty headers. -->\n <ng-container [ngTemplateOutlet]=\"tileTemplate()?.templateRef ?? null\" [ngTemplateOutletContext]=\"tileContext().get(t.id)\" [ngTemplateOutletInjector]=\"slots?.injector\"></ng-container>\n <div class=\"tile-header\" [mpProps]=\"t.header\" (pointerdown)=\"down($event, t.id, 'header')\">\n @if (slots?.header; as header) {\n <ng-container [ngTemplateOutlet]=\"header\"></ng-container>\n }\n </div>\n <div class=\"tile-content\" [mpProps]=\"t.content\">\n @if (slots?.content; as content) {\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n }\n </div>\n @for (g of t.grips; track g.handle) {\n <span class=\"tile-grip\" [mpProps]=\"g.attrs\" (pointerdown)=\"down($event, t.id, g.handle)\"></span>\n }\n </div>\n }\n </div>\n </div>\n @for (n of api().descriptions; track n.key) {\n <div class=\"tile-sr-only\" [mpProps]=\"n.attrs\">{{ n.text }}</div>\n }\n <span class=\"tile-sr-only\" [mpProps]=\"api().live.attrs\">{{ api().live.text }}</span>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAQA;;;;;AAKG;MACU,WAAW,CAAA;AAKtB,IAAA,WAAA,CAAY,MAAgB,EAAA;QAJ5B,IAAA,CAAA,MAAM,GAAgC,IAAI;QAC1C,IAAA,CAAA,OAAO,GAAgC,IAAI;QAIzC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IACpG;AACD;AAED;;;;;;;;;;;;;;AAcG;MAEU,eAAe,CAAA;AAD5B,IAAA,WAAA,GAAA;AAEW,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAgC,WAAW,CAAC;;QAEhE,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAkC,SAAS;qFAAC;AAKtE,IAAA;AAHC,IAAA,OAAO,sBAAsB,CAAqB,IAAwB,EAAE,GAAY,EAAA;AACtF,QAAA,OAAO,IAAI;IACb;8GAPW,eAAe,EAAA,IAAA,EA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A,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,eAAe,+gDAyDb,MAAM,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AA8KnE,MAAM,SAAS,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,CAAU;AAEhF;;;;AAIG;AACH,SAAS,YAAY,GAAA;IACnB,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,aAA4B;AAC5D,IAAA,MAAM,GAAG,GAA2B,MAAM,CAAC,WAAW,CACpD,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,KAAI;AACzB,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACtE,QAAA,OAAO,KAAK,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC,CACH;IACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;AAC9D,IAAA,OAAO,GAAG;AACZ;;AEvUA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/ng-bootstrap",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "22.
|
|
4
|
+
"version": "22.27.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
}
|
|
416
416
|
},
|
|
417
417
|
"peerDependencies": {
|
|
418
|
-
"@mintplayer/ui-core": "^1.
|
|
418
|
+
"@mintplayer/ui-core": "^1.1.0",
|
|
419
419
|
"@angular/common": "^22.0.0",
|
|
420
420
|
"@angular/core": "^22.0.0",
|
|
421
421
|
"@angular/cdk": "^22.0.0",
|
|
@@ -429,7 +429,7 @@
|
|
|
429
429
|
"@mintplayer/ng-animations": "^22.0.0",
|
|
430
430
|
"@mintplayer/pagination": "^2.3.0",
|
|
431
431
|
"@mintplayer/ng-focus-on-load": "^22.0.0",
|
|
432
|
-
"@mintplayer/web-components": "^
|
|
432
|
+
"@mintplayer/web-components": "^3.0.0",
|
|
433
433
|
"lit": "^3.3.0"
|
|
434
434
|
},
|
|
435
435
|
"dependencies": {
|
|
@@ -1,58 +1,173 @@
|
|
|
1
|
+
import * as _mintplayer_ui_core_tile_manager from '@mintplayer/ui-core/tile-manager';
|
|
2
|
+
import { MintTile, TileLayoutSnapshot, TileBreakpoint, TileDragMode, TileResizeMode, TileManagerMessages, TileLayoutChange, TileGestureBlocked, TileManagerMachine, TilePart } from '@mintplayer/ui-core/tile-manager';
|
|
3
|
+
export { MintTile, TileBreakpoint, TileDragMode, TileGestureBlocked, TileLayoutChange, TileLayoutSnapshot, TileLayouts, TileManagerMessages, TilePosition, TileResizeMode, TileSize, withoutNarrowerLayouts } from '@mintplayer/ui-core/tile-manager';
|
|
1
4
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { TemplateRef,
|
|
3
|
-
import { TilePosition, TileDragMode, TileResizeMode, TileLayoutSnapshot, TileGestureBlocked, MintTileManagerElement } from '@mintplayer/web-components/tile-manager';
|
|
4
|
-
export * from '@mintplayer/web-components/tile-manager';
|
|
5
|
+
import { TemplateRef, Injector } from '@angular/core';
|
|
5
6
|
|
|
7
|
+
/** The context of a `*bsTile` template: the tile it renders. */
|
|
8
|
+
interface BsTileContext<T extends MintTile = MintTile> {
|
|
9
|
+
$implicit: T;
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
|
-
* One tile
|
|
12
|
+
* One tile's slots. The manager stamps the `*bsTile` template once per tile with an injector
|
|
13
|
+
* providing that tile's `BsTileSlots`; `*bsTileHeader` / `*bsTileContent` inside it register
|
|
14
|
+
* their template here, and the manager renders them into the tile's header and body. Kept per
|
|
15
|
+
* tile id, so a new tile object (a locked panel, say) updates the view instead of rebuilding it.
|
|
16
|
+
*/
|
|
17
|
+
declare class BsTileSlots {
|
|
18
|
+
header: TemplateRef<unknown> | null;
|
|
19
|
+
content: TemplateRef<unknown> | null;
|
|
20
|
+
readonly injector: Injector;
|
|
21
|
+
constructor(parent: Injector);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Declares the markup of every tile, once, inside `<bs-tile-manager>`. The header and body are
|
|
25
|
+
* its direct `*bsTileHeader` / `*bsTileContent` children, and both see the tile variable.
|
|
26
|
+
*
|
|
27
|
+
* ```html
|
|
28
|
+
* <bs-tile-manager [(layouts)]="layouts">
|
|
29
|
+
* <ng-container *bsTile="let tile of tiles()">
|
|
30
|
+
* <span *bsTileHeader>{{ tile.title }}</span>
|
|
31
|
+
* <div *bsTileContent>{{ tile.body }}</div>
|
|
32
|
+
* </ng-container>
|
|
33
|
+
* </bs-tile-manager>
|
|
34
|
+
* ```
|
|
8
35
|
*
|
|
9
|
-
*
|
|
10
|
-
* `<bs-tile-header>`) and one for the body (everything else) — which the
|
|
11
|
-
* manager projects into named slots on the underlying `<mp-tile-manager>`
|
|
12
|
-
* web component (`${id}-header` and `${id}-content`).
|
|
36
|
+
* `of` is the manager's tile list, like `ngFor`'s: the manager reads it from here.
|
|
13
37
|
*/
|
|
14
|
-
declare class
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
readonly
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
38
|
+
declare class BsTileDirective<T extends MintTile = MintTile> {
|
|
39
|
+
readonly templateRef: TemplateRef<BsTileContext<T>>;
|
|
40
|
+
/** The visible tiles, in DOM order. */
|
|
41
|
+
readonly bsTileOf: _angular_core.InputSignal<readonly T[] | null | undefined>;
|
|
42
|
+
static ngTemplateContextGuard<T extends MintTile>(_dir: BsTileDirective<T>, ctx: unknown): ctx is BsTileContext<T>;
|
|
43
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileDirective<any>, never>;
|
|
44
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BsTileDirective<any>, "[bsTile]", never, { "bsTileOf": { "alias": "bsTileOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
45
|
+
}
|
|
46
|
+
/** A tile's header: the drag handle in `dragMode="header"`. Only valid inside `*bsTile`. */
|
|
47
|
+
declare class BsTileHeaderDirective {
|
|
48
|
+
constructor();
|
|
49
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileHeaderDirective, never>;
|
|
50
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BsTileHeaderDirective, "[bsTileHeader]", never, {}, {}, never, never, true, never>;
|
|
51
|
+
}
|
|
52
|
+
/** A tile's body. Only valid inside `*bsTile`. */
|
|
53
|
+
declare class BsTileContentDirective {
|
|
54
|
+
constructor();
|
|
55
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileContentDirective, never>;
|
|
56
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BsTileContentDirective, "[bsTileContent]", never, {}, {}, never, never, true, never>;
|
|
25
57
|
}
|
|
26
58
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
59
|
+
/** Payload of `columnCountChange`. */
|
|
60
|
+
interface BsTileColumnCountChange {
|
|
61
|
+
columnCount: number;
|
|
62
|
+
previous: number | null;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Tile manager: a dashboard grid whose tiles the user moves and resizes, with one layout per
|
|
66
|
+
* column count (#440).
|
|
67
|
+
*
|
|
68
|
+
* The Angular front of `TileManagerMachine` (`@mintplayer/ui-core/tile-manager`). Every decision
|
|
69
|
+
* (layout per column count, gestures, keyboard, ARIA) is the machine's; this component renders
|
|
70
|
+
* its own template from `connect()`'s bags with `[mpProps]`, measures the grid, owns pointer
|
|
71
|
+
* capture and the FLIP animation, and turns the machine's events into outputs. Tile header and
|
|
72
|
+
* body come from the `*bsTileHeader` / `*bsTileContent` templates inside one `*bsTile` block.
|
|
73
|
+
*
|
|
74
|
+
* SSR: the whole tree is rendered, plus a `<style>` in `<head>` holding the `@container` rules
|
|
75
|
+
* that place every tile at every column count (D14), so the server HTML paints the right layout
|
|
76
|
+
* with no JS. No-JS tier 2: before the first measure the tiles are named groups with no tab stop
|
|
77
|
+
* or grips.
|
|
78
|
+
*/
|
|
79
|
+
declare class BsTileManagerComponent<T extends MintTile = MintTile> {
|
|
80
|
+
/** The `*bsTile` block: the tile markup, and through its `of` the tiles themselves. */
|
|
81
|
+
readonly tileTemplate: _angular_core.Signal<BsTileDirective<T> | undefined>;
|
|
82
|
+
/**
|
|
83
|
+
* The visible tiles, in DOM order: `*bsTile="let tile of tiles()"`. Read from the directive
|
|
84
|
+
* rather than pushed by it: its input is not set yet when its constructor runs, and a signal
|
|
85
|
+
* write while the view renders is NG0600.
|
|
86
|
+
*/
|
|
87
|
+
readonly tiles: _angular_core.Signal<readonly T[]>;
|
|
88
|
+
/** One layout per column count. Two-way: a commit writes the full next record. */
|
|
89
|
+
readonly layouts: _angular_core.ModelSignal<Readonly<Record<number, TileLayoutSnapshot>>>;
|
|
90
|
+
/** Explicit `{ minWidth, columns }` map. Wins over `stackBelow` and the generated map. */
|
|
91
|
+
readonly breakpoints: _angular_core.InputSignal<readonly TileBreakpoint[] | null>;
|
|
92
|
+
/** px. Below this width the tiles stack in one column. */
|
|
93
|
+
readonly stackBelow: _angular_core.InputSignal<number | null>;
|
|
94
|
+
/** Upper bound of the generated map when `layouts` is empty. */
|
|
95
|
+
readonly maxColumns: _angular_core.InputSignal<number>;
|
|
96
|
+
/** px. No column is narrower than this, except at one column. */
|
|
97
|
+
readonly minColumnWidth: _angular_core.InputSignal<number>;
|
|
98
|
+
/** CSS length of one grid row. */
|
|
30
99
|
readonly minRowHeight: _angular_core.InputSignal<string>;
|
|
31
|
-
|
|
100
|
+
/** px between tiles. */
|
|
101
|
+
readonly gap: _angular_core.InputSignal<number>;
|
|
32
102
|
readonly dragMode: _angular_core.InputSignal<TileDragMode>;
|
|
33
103
|
readonly resizeMode: _angular_core.InputSignal<TileResizeMode>;
|
|
104
|
+
/** Animate tiles to their new place when the layout reflows. Off under reduced motion. */
|
|
34
105
|
readonly animateReflow: _angular_core.InputSignal<boolean>;
|
|
106
|
+
/** Accessible name of the board. A host `aria-label` / `aria-labelledby` wins. */
|
|
35
107
|
readonly label: _angular_core.InputSignal<string | null>;
|
|
36
|
-
|
|
108
|
+
/** Localized strings for the board's descriptions and announcements. */
|
|
109
|
+
readonly messages: _angular_core.InputSignal<Partial<TileManagerMessages>>;
|
|
110
|
+
/** Each step of a gesture or keyboard move: the layout as it would be committed. */
|
|
111
|
+
readonly layoutPreview: _angular_core.OutputEmitterRef<TileLayoutChange>;
|
|
112
|
+
/** A commit, with the full layouts record and the stale narrower counts (D15). */
|
|
113
|
+
readonly layoutChange: _angular_core.OutputEmitterRef<TileLayoutChange>;
|
|
114
|
+
readonly columnCountChange: _angular_core.OutputEmitterRef<BsTileColumnCountChange>;
|
|
37
115
|
readonly gestureBlocked: _angular_core.OutputEmitterRef<TileGestureBlocked>;
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly machine: TileManagerMachine;
|
|
118
|
+
readonly state: _angular_core.Signal<_mintplayer_ui_core_tile_manager.TileManagerState>;
|
|
119
|
+
/** Host transparency: a consumer's aria-* on `<bs-tile-manager>` lands on the region. */
|
|
120
|
+
private readonly hostAria;
|
|
121
|
+
readonly api: _angular_core.Signal<{
|
|
122
|
+
board: {
|
|
123
|
+
attrs: {
|
|
124
|
+
'aria-describedby': string | null;
|
|
125
|
+
};
|
|
126
|
+
style: _mintplayer_ui_core_tile_manager.StyleBag;
|
|
127
|
+
};
|
|
128
|
+
container: _mintplayer_ui_core_tile_manager.AttrBag;
|
|
129
|
+
grid: {
|
|
130
|
+
attrs: _mintplayer_ui_core_tile_manager.AttrBag;
|
|
131
|
+
style: _mintplayer_ui_core_tile_manager.StyleBag;
|
|
132
|
+
};
|
|
133
|
+
tiles: _mintplayer_ui_core_tile_manager.TileView[];
|
|
134
|
+
descriptions: _mintplayer_ui_core_tile_manager.TileTextView[];
|
|
135
|
+
live: {
|
|
136
|
+
attrs: _mintplayer_ui_core_tile_manager.AttrBag;
|
|
137
|
+
text: string;
|
|
138
|
+
};
|
|
139
|
+
}>;
|
|
140
|
+
/** The `*bsTile` context per tile id, stable across change detection. */
|
|
141
|
+
readonly tileContext: _angular_core.Signal<Map<string, BsTileContext<T>>>;
|
|
142
|
+
/** Slots per tile id, kept while the id stays so the tile's view is reused, not rebuilt. */
|
|
143
|
+
readonly tileSlots: _angular_core.WritableSignal<ReadonlyMap<string, BsTileSlots>>;
|
|
144
|
+
private readonly grid;
|
|
145
|
+
private readonly host;
|
|
146
|
+
private readonly injector;
|
|
147
|
+
private readonly flip;
|
|
148
|
+
private lastRendered;
|
|
149
|
+
private focusSeq;
|
|
150
|
+
private resizeObserver;
|
|
151
|
+
private measureFrame;
|
|
152
|
+
private width;
|
|
42
153
|
constructor();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
154
|
+
/** What is rendered: the resolved column count and its layout (the preview while editing). */
|
|
155
|
+
captureLayout(): {
|
|
156
|
+
columnCount: number;
|
|
157
|
+
layout: TileLayoutSnapshot;
|
|
158
|
+
};
|
|
159
|
+
/** Drops `layouts[count]` and commits, so that count derives again (D15). */
|
|
160
|
+
resetLayout(count: number): void;
|
|
161
|
+
/** True while a pointer drag or resize is in flight. */
|
|
162
|
+
get isGestureActive(): boolean;
|
|
163
|
+
down(e: PointerEvent, id: string, part: TilePart): void;
|
|
164
|
+
move(e: PointerEvent): void;
|
|
165
|
+
key(e: KeyboardEvent, id: string): void;
|
|
166
|
+
private observe;
|
|
167
|
+
private onChange;
|
|
168
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTileManagerComponent<any>, never>;
|
|
169
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsTileManagerComponent<any>, "bs-tile-manager", never, { "layouts": { "alias": "layouts"; "required": false; "isSignal": true; }; "breakpoints": { "alias": "breakpoints"; "required": false; "isSignal": true; }; "stackBelow": { "alias": "stackBelow"; "required": false; "isSignal": true; }; "maxColumns": { "alias": "maxColumns"; "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; }; "messages": { "alias": "messages"; "required": false; "isSignal": true; }; }, { "layouts": "layoutsChange"; "layoutPreview": "layoutPreview"; "layoutChange": "layoutChange"; "columnCountChange": "columnCountChange"; "gestureBlocked": "gestureBlocked"; }, ["tileTemplate"], never, true, never>;
|
|
56
170
|
}
|
|
57
171
|
|
|
58
|
-
export {
|
|
172
|
+
export { BsTileContentDirective, BsTileDirective, BsTileHeaderDirective, BsTileManagerComponent, BsTileSlots };
|
|
173
|
+
export type { BsTileColumnCountChange, BsTileContext };
|