@mintplayer/ng-bootstrap 22.25.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.
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs +27 -48
- package/fesm2022/mintplayer-ng-bootstrap-a11y.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs +0 -1
- package/fesm2022/mintplayer-ng-bootstrap-code-snippet.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs +7 -19
- package/fesm2022/mintplayer-ng-bootstrap-dropdown-menu.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs +6 -160
- package/fesm2022/mintplayer-ng-bootstrap-dropdown.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs +102 -0
- package/fesm2022/mintplayer-ng-bootstrap-machine.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-navbar.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs +316 -174
- package/fesm2022/mintplayer-ng-bootstrap-tile-manager.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs +250 -103
- package/fesm2022/mintplayer-ng-bootstrap-typeahead.mjs.map +1 -1
- package/machine/package.json +4 -0
- package/package.json +7 -2
- package/types/mintplayer-ng-bootstrap-a11y.d.ts +23 -34
- package/types/mintplayer-ng-bootstrap-code-snippet.d.ts +0 -1
- package/types/mintplayer-ng-bootstrap-datatable.d.ts +7 -0
- package/types/mintplayer-ng-bootstrap-dropdown-menu.d.ts +6 -18
- package/types/mintplayer-ng-bootstrap-dropdown.d.ts +2 -48
- package/types/mintplayer-ng-bootstrap-machine.d.ts +54 -0
- package/types/mintplayer-ng-bootstrap-tile-manager.d.ts +157 -42
- package/types/mintplayer-ng-bootstrap-typeahead.d.ts +141 -32
|
@@ -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
|