@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,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 };
|
|
@@ -1,40 +1,149 @@
|
|
|
1
|
+
import * as _mintplayer_ui_core_typeahead from '@mintplayer/ui-core/typeahead';
|
|
2
|
+
import { TypeaheadRequest, TypeaheadMachine } from '@mintplayer/ui-core/typeahead';
|
|
3
|
+
export { TypeaheadLabels, TypeaheadProvider, TypeaheadRequest, inMemoryTypeaheadProvider } from '@mintplayer/ui-core/typeahead';
|
|
1
4
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
5
|
+
import { TemplateRef } from '@angular/core';
|
|
6
|
+
import { ControlValueAccessor } from '@angular/forms';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
/** The context of a `*bsTypeaheadItem` template: the item and the current term (for highlighting). */
|
|
10
|
+
interface BsTypeaheadItemContext<T = unknown> {
|
|
11
|
+
$implicit: T;
|
|
12
|
+
term: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Renders one suggestion row. Declared inside `<bs-typeahead>`; absent, the
|
|
16
|
+
* row shows the item's text (`itemText`).
|
|
17
|
+
*
|
|
18
|
+
* ```html
|
|
19
|
+
* <bs-typeahead [provider]="streets">
|
|
20
|
+
* <ng-container *bsTypeaheadItem="let street; let term = term; of: streetList">
|
|
21
|
+
* {{ street.name }} <small>{{ street.municipality }}</small>
|
|
22
|
+
* </ng-container>
|
|
23
|
+
* </bs-typeahead>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* `of:` is optional and only carries the item type into the template (like
|
|
27
|
+
* `ngFor`'s `of`); pass any value of the item type or an array of it.
|
|
28
|
+
*/
|
|
29
|
+
declare class BsTypeaheadItemDirective<T = unknown> {
|
|
30
|
+
readonly templateRef: TemplateRef<BsTypeaheadItemContext<T>>;
|
|
31
|
+
/** Type carrier only; never read at runtime. */
|
|
32
|
+
readonly bsTypeaheadItemOf: _angular_core.InputSignal<T | readonly T[] | null | undefined>;
|
|
33
|
+
static ngTemplateContextGuard<T>(_dir: BsTypeaheadItemDirective<T>, ctx: unknown): ctx is BsTypeaheadItemContext<T>;
|
|
34
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTypeaheadItemDirective<any>, never>;
|
|
35
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BsTypeaheadItemDirective<any>, "[bsTypeaheadItem]", never, { "bsTypeaheadItemOf": { "alias": "bsTypeaheadItemOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* An Angular provider may answer with a Promise or an Observable. An
|
|
40
|
+
* Observable is unsubscribed when `request.signal` aborts, which cancels an
|
|
41
|
+
* `HttpClient` request in flight.
|
|
42
|
+
*/
|
|
43
|
+
type BsTypeaheadProvider<T> = (term: string, request: TypeaheadRequest) => Promise<readonly T[]> | Observable<readonly T[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Typeahead: a text input with asynchronous suggestions and free text.
|
|
46
|
+
*
|
|
47
|
+
* The first component built on the headless-core architecture (#436): all
|
|
48
|
+
* behaviour lives in `TypeaheadMachine` (`@mintplayer/ui-core/typeahead`); this
|
|
49
|
+
* component renders its own Angular template from the machine's snapshot and
|
|
50
|
+
* applies the core's ARIA bags with `[mpProps]`. Because it is an Angular
|
|
51
|
+
* template, Angular SSR emits a real, named `<input>` that submits free text
|
|
52
|
+
* with JavaScript disabled, and hydration attaches to that same node.
|
|
53
|
+
*
|
|
54
|
+
* Value = the term (string). `selectedItem()` holds the last picked item until
|
|
55
|
+
* the text changes. Usable with `[(value)]`, `[(ngModel)]`, `formControlName`.
|
|
56
|
+
*/
|
|
57
|
+
declare class BsTypeaheadComponent<T = unknown> implements ControlValueAccessor {
|
|
58
|
+
/** Supplies suggestions for a settled term; a newer term aborts the previous request. */
|
|
59
|
+
readonly provider: _angular_core.InputSignal<BsTypeaheadProvider<T> | null>;
|
|
60
|
+
/** Quiet time after the last keystroke, ms. 0 requests synchronously. */
|
|
61
|
+
readonly debounceMs: _angular_core.InputSignal<number>;
|
|
62
|
+
/** A trimmed term shorter than this closes the list without querying. */
|
|
63
|
+
readonly minLength: _angular_core.InputSignal<number>;
|
|
64
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
65
|
+
/** The text a pick writes into the input. Default: `item.text`, else `String(item)`. */
|
|
66
|
+
readonly itemText: _angular_core.InputSignal<((item: T) => string) | undefined>;
|
|
67
|
+
/** Row identity for keyed rendering. Default: `itemText`. */
|
|
68
|
+
readonly itemKey: _angular_core.InputSignal<((item: T) => unknown) | undefined>;
|
|
69
|
+
/** Submitted with a native `<form>` under this name (also with JavaScript disabled). */
|
|
70
|
+
readonly name: _angular_core.InputSignal<string | null>;
|
|
71
|
+
/** Accessible name of the input. A host `aria-label` or `aria-labelledby` wins. */
|
|
72
|
+
readonly inputLabel: _angular_core.InputSignal<string | null>;
|
|
73
|
+
readonly loadingLabel: _angular_core.InputSignal<string | undefined>;
|
|
74
|
+
readonly noResultsLabel: _angular_core.InputSignal<string | undefined>;
|
|
75
|
+
/** Spoken once per settled request, e.g. `n => n + ' resultaten'`. */
|
|
76
|
+
readonly resultsLabel: _angular_core.InputSignal<((count: number) => string) | undefined>;
|
|
77
|
+
/** A persistent validation message, wired to the input with aria-errormessage. */
|
|
78
|
+
readonly errorText: _angular_core.InputSignal<string | null>;
|
|
79
|
+
/** The term. Two-way; also the ControlValueAccessor value. */
|
|
80
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
81
|
+
readonly select: _angular_core.OutputEmitterRef<T>;
|
|
82
|
+
readonly submitted: _angular_core.OutputEmitterRef<string>;
|
|
83
|
+
readonly opened: _angular_core.OutputEmitterRef<void>;
|
|
84
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
85
|
+
readonly loadError: _angular_core.OutputEmitterRef<unknown>;
|
|
86
|
+
readonly itemTemplate: _angular_core.Signal<BsTypeaheadItemDirective<T> | undefined>;
|
|
87
|
+
private readonly inputRef;
|
|
88
|
+
readonly id: string;
|
|
8
89
|
/**
|
|
9
|
-
*
|
|
10
|
-
* typeahead
|
|
11
|
-
*
|
|
90
|
+
* Host transparency: a consumer's `aria-*`, `id` and `tabindex` on
|
|
91
|
+
* `<bs-typeahead>` land on the role-bearing input (`id` and `tabindex` are
|
|
92
|
+
* moved, so no duplicate id and no dead tab stop on the host). A consumer
|
|
93
|
+
* `role` is NOT forwarded: the input's role is `combobox` by contract. Read
|
|
94
|
+
* once, in the constructor, so the server render carries them too.
|
|
12
95
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
96
|
+
private readonly hostAria;
|
|
97
|
+
readonly machine: TypeaheadMachine<T>;
|
|
98
|
+
readonly state: _angular_core.Signal<_mintplayer_ui_core_typeahead.TypeaheadState<T>>;
|
|
99
|
+
readonly api: _angular_core.Signal<{
|
|
100
|
+
input: {
|
|
101
|
+
[x: string]: string | boolean | null;
|
|
102
|
+
};
|
|
103
|
+
root: _mintplayer_ui_core_typeahead.AttrBag;
|
|
104
|
+
listbox: _mintplayer_ui_core_typeahead.AttrBag;
|
|
105
|
+
status: {
|
|
106
|
+
attrs: _mintplayer_ui_core_typeahead.AttrBag;
|
|
107
|
+
text: string;
|
|
108
|
+
} | null;
|
|
109
|
+
option(index: number): _mintplayer_ui_core_typeahead.AttrBag;
|
|
110
|
+
live: {
|
|
111
|
+
attrs: _mintplayer_ui_core_typeahead.AttrBag;
|
|
112
|
+
text: string;
|
|
113
|
+
};
|
|
114
|
+
error: {
|
|
115
|
+
attrs: _mintplayer_ui_core_typeahead.AttrBag;
|
|
116
|
+
text: string;
|
|
117
|
+
} | null;
|
|
118
|
+
}>;
|
|
119
|
+
/** The last picked item, `null` once the text changes after the pick. */
|
|
120
|
+
readonly selectedItem: _angular_core.Signal<T | null>;
|
|
121
|
+
private readonly disabledByCva;
|
|
122
|
+
private onChange;
|
|
123
|
+
private onTouched;
|
|
28
124
|
constructor();
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Text typed or pasted into the server-rendered input before hydration lives
|
|
127
|
+
* only in the DOM. Hydration's [value] binding would overwrite it with the
|
|
128
|
+
* empty term, and the replayed input event then reads the empty field, so it
|
|
129
|
+
* is lost. Read it here, while the host still holds the server DOM, and keep
|
|
130
|
+
* it as the term; once effects have configured the provider, re-enter it as a
|
|
131
|
+
* typed term so it notifies the model and queries.
|
|
132
|
+
*/
|
|
133
|
+
private adoptPreHydrationText;
|
|
134
|
+
protected onInput(event: Event): void;
|
|
135
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
136
|
+
protected onBlur(): void;
|
|
137
|
+
protected trackItem: (index: number, item: T) => unknown;
|
|
138
|
+
/** Focus the input. */
|
|
35
139
|
focus(): void;
|
|
36
|
-
|
|
37
|
-
|
|
140
|
+
writeValue(value: string | null): void;
|
|
141
|
+
registerOnChange(fn: (value: string) => void): void;
|
|
142
|
+
registerOnTouched(fn: () => void): void;
|
|
143
|
+
setDisabledState(isDisabled: boolean): void;
|
|
144
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BsTypeaheadComponent<any>, never>;
|
|
145
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<BsTypeaheadComponent<any>, "bs-typeahead", never, { "provider": { "alias": "provider"; "required": false; "isSignal": true; }; "debounceMs": { "alias": "debounceMs"; "required": false; "isSignal": true; }; "minLength": { "alias": "minLength"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "itemText": { "alias": "itemText"; "required": false; "isSignal": true; }; "itemKey": { "alias": "itemKey"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputLabel": { "alias": "inputLabel"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "noResultsLabel": { "alias": "noResultsLabel"; "required": false; "isSignal": true; }; "resultsLabel": { "alias": "resultsLabel"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "select": "select"; "submitted": "submitted"; "opened": "opened"; "closed": "closed"; "loadError": "loadError"; }, ["itemTemplate"], never, true, never>;
|
|
38
146
|
}
|
|
39
147
|
|
|
40
|
-
export { BsTypeaheadComponent };
|
|
148
|
+
export { BsTypeaheadComponent, BsTypeaheadItemDirective };
|
|
149
|
+
export type { BsTypeaheadItemContext, BsTypeaheadProvider };
|