@yuuvis/client-components 3.0.0-beta.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/autocomplete/README.md +3 -0
- package/common/README.md +3 -0
- package/datepicker/README.md +3 -0
- package/fesm2022/yuuvis-client-components-autocomplete.mjs +236 -0
- package/fesm2022/yuuvis-client-components-autocomplete.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-common.mjs +1724 -0
- package/fesm2022/yuuvis-client-components-common.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-datepicker.mjs +456 -0
- package/fesm2022/yuuvis-client-components-datepicker.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-list.mjs +666 -0
- package/fesm2022/yuuvis-client-components-list.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-master-details.mjs +136 -0
- package/fesm2022/yuuvis-client-components-master-details.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-overflow-hidden.mjs +109 -0
- package/fesm2022/yuuvis-client-components-overflow-hidden.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-overflow-menu.mjs +171 -0
- package/fesm2022/yuuvis-client-components-overflow-menu.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-popout.mjs +240 -0
- package/fesm2022/yuuvis-client-components-popout.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-split-view.mjs +317 -0
- package/fesm2022/yuuvis-client-components-split-view.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components-widget-grid.mjs +933 -0
- package/fesm2022/yuuvis-client-components-widget-grid.mjs.map +1 -0
- package/fesm2022/yuuvis-client-components.mjs +18 -0
- package/fesm2022/yuuvis-client-components.mjs.map +1 -0
- package/lib/assets/i18n/de.json +56 -0
- package/lib/assets/i18n/en.json +56 -0
- package/list/README.md +3 -0
- package/master-details/README.md +3 -0
- package/overflow-hidden/README.md +3 -0
- package/overflow-menu/README.md +3 -0
- package/package.json +67 -0
- package/popout/README.md +3 -0
- package/split-view/README.md +3 -0
- package/types/yuuvis-client-components-autocomplete.d.ts +89 -0
- package/types/yuuvis-client-components-common.d.ts +536 -0
- package/types/yuuvis-client-components-datepicker.d.ts +94 -0
- package/types/yuuvis-client-components-list.d.ts +380 -0
- package/types/yuuvis-client-components-master-details.d.ts +69 -0
- package/types/yuuvis-client-components-overflow-hidden.d.ts +72 -0
- package/types/yuuvis-client-components-overflow-menu.d.ts +89 -0
- package/types/yuuvis-client-components-popout.d.ts +106 -0
- package/types/yuuvis-client-components-split-view.d.ts +197 -0
- package/types/yuuvis-client-components-widget-grid.d.ts +299 -0
- package/types/yuuvis-client-components.d.ts +8 -0
- package/widget-grid/README.md +48 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, TemplateRef } from '@angular/core';
|
|
3
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
4
|
+
import { Highlightable } from '@angular/cdk/a11y';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Directive for list items. It is used in the `yuvList` component
|
|
8
|
+
* to keep track of active and selected items. Every element with this
|
|
9
|
+
* directive will be treated as a list item and can be selected and focused.
|
|
10
|
+
*
|
|
11
|
+
*```html
|
|
12
|
+
* <yuv-list (itemSelect)="itemSelected($event)">
|
|
13
|
+
* <div yuvListItem>Entry #1</div>
|
|
14
|
+
* <div yuvListItem>Entry #2</div>
|
|
15
|
+
* </yuv-list>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare class ListItemDirective implements Highlightable, AfterViewInit {
|
|
19
|
+
#private;
|
|
20
|
+
onClick?: (evt: MouseEvent) => void;
|
|
21
|
+
disabled?: boolean | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the item is active or not.
|
|
24
|
+
*/
|
|
25
|
+
active: _angular_core.InputSignal<boolean>;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the item is selected or not.
|
|
28
|
+
*/
|
|
29
|
+
selected: _angular_core.InputSignal<boolean>;
|
|
30
|
+
selectedInput: _angular_core.WritableSignal<any>;
|
|
31
|
+
activeInput: _angular_core.WritableSignal<any>;
|
|
32
|
+
focusableChildren: Element[];
|
|
33
|
+
focusedIndex: number;
|
|
34
|
+
onHostClick(evt: MouseEvent): void;
|
|
35
|
+
setActiveStyles(): void;
|
|
36
|
+
setInactiveStyles(): void;
|
|
37
|
+
focusNext(): void;
|
|
38
|
+
focusPrevious(): void;
|
|
39
|
+
ngAfterViewInit(): void;
|
|
40
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListItemDirective, never>;
|
|
41
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ListItemDirective, "[yuvListItem]", never, { "disabled": { "alias": "disabled"; "required": false; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Accessible list component with keyboard navigation, single- and multi-selection,
|
|
46
|
+
* and flexible delegation of click- and selection-handling to the parent.
|
|
47
|
+
*
|
|
48
|
+
* The component renders as an ARIA `listbox` and delegates keyboard focus tracking
|
|
49
|
+
* to Angular CDK's `ActiveDescendantKeyManager`. Content is projected via
|
|
50
|
+
* `[yuvListItem]`-attributed children (see `ListItemDirective`).
|
|
51
|
+
*
|
|
52
|
+
* **Key Features:**
|
|
53
|
+
* - Single and multi-selection (with Shift / Ctrl modifier support)
|
|
54
|
+
* - Full keyboard navigation (Arrow keys, Space, Enter, Escape)
|
|
55
|
+
* - Horizontal and vertical layout via the `horizontal` host attribute
|
|
56
|
+
* - Auto-selection on initialization via the `autoSelect` input
|
|
57
|
+
* - Selection guarding via `preventChangeUntil` callback
|
|
58
|
+
* - Optional delegation of click and selection handling to the parent component
|
|
59
|
+
* - Accessible: `role="listbox"`, active-descendant focus management, `aria-selected` on items
|
|
60
|
+
*
|
|
61
|
+
* **Basic usage:**
|
|
62
|
+
* ```html
|
|
63
|
+
* <yuv-list (itemSelect)="onItemSelect($event)">
|
|
64
|
+
* <div yuvListItem>Entry #1</div>
|
|
65
|
+
* <div yuvListItem>Entry #2</div>
|
|
66
|
+
* </yuv-list>
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* **Multi-selection with Shift/Ctrl:**
|
|
70
|
+
* ```html
|
|
71
|
+
* <yuv-list [multiselect]="true" (itemSelect)="onSelect($event)">
|
|
72
|
+
* @for (item of items; track item.id) {
|
|
73
|
+
* <div yuvListItem>{{ item.label }}</div>
|
|
74
|
+
* }
|
|
75
|
+
* </yuv-list>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* **Host Attributes (set declaratively in the template):**
|
|
79
|
+
* - `selectOnEnter` — treat the Enter key as a selection trigger (in addition to Space)
|
|
80
|
+
* - `horizontal` — switch key navigation to left/right arrows instead of up/down
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```html
|
|
84
|
+
* <!-- Horizontal list, Enter key selects -->
|
|
85
|
+
* <yuv-list horizontal selectOnEnter (itemSelect)="onSelect($event)">
|
|
86
|
+
* <button yuvListItem>A</button>
|
|
87
|
+
* <button yuvListItem>B</button>
|
|
88
|
+
* </yuv-list>
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare class ListComponent implements OnDestroy {
|
|
92
|
+
#private;
|
|
93
|
+
/**
|
|
94
|
+
* All `[yuvListItem]` children projected into this list.
|
|
95
|
+
*
|
|
96
|
+
* Queried reactively via `contentChildren` — every time the projected content
|
|
97
|
+
* changes (items added, removed, or reordered), the `#itemsEffect` re-runs,
|
|
98
|
+
* rebuilds the key manager, and re-attaches click handlers.
|
|
99
|
+
*/
|
|
100
|
+
items: _angular_core.Signal<readonly ListItemDirective[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Guard function that temporarily blocks all selection changes.
|
|
103
|
+
*
|
|
104
|
+
* Provide a factory that returns a predicate; as long as that predicate
|
|
105
|
+
* returns `true`, any attempt to change the selection (via click, keyboard,
|
|
106
|
+
* or programmatic API) is silently ignored. Useful when the parent has
|
|
107
|
+
* unsaved changes tied to the current selection and needs to prevent the user
|
|
108
|
+
* from accidentally navigating away.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* // Block selection while a save is in progress
|
|
113
|
+
* preventChangeUntil = () => () => this.isSaving();
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* @default () => false (never prevents)
|
|
117
|
+
*/
|
|
118
|
+
preventChangeUntil: _angular_core.InputSignal<() => boolean>;
|
|
119
|
+
/**
|
|
120
|
+
* Enables multi-selection mode.
|
|
121
|
+
*
|
|
122
|
+
* When `true`, the user can hold **Shift** to range-select items between the last
|
|
123
|
+
* selected item and the clicked one, or hold **Ctrl** to toggle individual items
|
|
124
|
+
* in and out of the selection. The programmatic `multiSelect()` method is also
|
|
125
|
+
* only effective when this input is `true`.
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
multiselect: _angular_core.InputSignal<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* Delegates visual selection and focus state rendering to the parent component.
|
|
132
|
+
*
|
|
133
|
+
* When `false` (default), `yuv-list` applies `.selected` and `.active` CSS classes
|
|
134
|
+
* to items via `ListItemDirective` signals, so the list stylesheet controls the look.
|
|
135
|
+
* When `true`, those signals are still updated but the host gets the
|
|
136
|
+
* `self-handle-selection` CSS class, which the parent can use to opt into its own
|
|
137
|
+
* visual treatment — useful when item templates have custom selected/focused styling.
|
|
138
|
+
*
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
selfHandleSelection: _angular_core.InputSignal<boolean>;
|
|
142
|
+
/**
|
|
143
|
+
* Disables the built-in click-to-select behavior, letting the parent component
|
|
144
|
+
* decide when `select()` is called.
|
|
145
|
+
*
|
|
146
|
+
* By default the list attaches an `onClick` handler to every `ListItemDirective`
|
|
147
|
+
* that calls `select()` with the correct Shift/Ctrl modifier flags. Set this
|
|
148
|
+
* input to `true` to suppress that wiring — the parent must then call `select()`
|
|
149
|
+
* imperatively in response to whatever interaction it chooses (e.g. a single-click
|
|
150
|
+
* that is distinguished from a double-click by `ClickDoubleDirective`).
|
|
151
|
+
*
|
|
152
|
+
* @default false
|
|
153
|
+
*/
|
|
154
|
+
selfHandleClick: _angular_core.InputSignal<boolean>;
|
|
155
|
+
/**
|
|
156
|
+
* Automatically selects an item when the list is first rendered.
|
|
157
|
+
*
|
|
158
|
+
* The selection logic runs once per content-children change (see `#itemsEffect`)
|
|
159
|
+
* and follows this priority order:
|
|
160
|
+
* 1. The first non-disabled item that already carries the `selected` attribute.
|
|
161
|
+
* 2. If no such item exists and `autoSelect` is `true`, the item at index 0.
|
|
162
|
+
*
|
|
163
|
+
* Accepts any truthy string value in addition to a real boolean because the
|
|
164
|
+
* input is also consumable as a plain HTML attribute (`<yuv-list autoSelect>`).
|
|
165
|
+
*
|
|
166
|
+
* @default false
|
|
167
|
+
*/
|
|
168
|
+
autoSelect: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
|
|
169
|
+
/**
|
|
170
|
+
* Emits the current selection as an array of zero-based item indices whenever
|
|
171
|
+
* the selection changes — via click, keyboard, or programmatic API calls.
|
|
172
|
+
*
|
|
173
|
+
* An empty array signals that the selection has been cleared.
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* onItemSelect(indices: number[]): void {
|
|
178
|
+
* this.selectedItems = indices.map(i => this.items[i]);
|
|
179
|
+
* }
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
itemSelect: _angular_core.OutputEmitterRef<number[]>;
|
|
183
|
+
/**
|
|
184
|
+
* Emits the zero-based index of the item that received keyboard focus
|
|
185
|
+
* (i.e. the active descendant managed by `ActiveDescendantKeyManager`).
|
|
186
|
+
*
|
|
187
|
+
* Note that focus and selection are independent: navigating with arrow keys
|
|
188
|
+
* moves focus without changing the selection until Space (or Enter when
|
|
189
|
+
* `selectOnEnter` is set) is pressed.
|
|
190
|
+
*/
|
|
191
|
+
itemFocus: _angular_core.OutputEmitterRef<number>;
|
|
192
|
+
/**
|
|
193
|
+
* Puts the list into a display-only mode where no item can be selected.
|
|
194
|
+
*
|
|
195
|
+
* When `true`, all selection paths are blocked: clicks, keyboard shortcuts
|
|
196
|
+
* (`Space`, `Enter`, `Escape`), and programmatic calls to `select()`,
|
|
197
|
+
* `multiSelect()`, and `clear()` are all no-ops. The list still renders
|
|
198
|
+
* normally and keyboard navigation still moves the focus indicator.
|
|
199
|
+
*
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
disableSelection: _angular_core.InputSignal<boolean>;
|
|
203
|
+
/**
|
|
204
|
+
* When `true`, pressing **Enter** triggers item selection in addition to **Space**.
|
|
205
|
+
*
|
|
206
|
+
* Resolved once at construction time from the static `selectOnEnter` host attribute.
|
|
207
|
+
* Useful in contexts where Enter has a conventional "confirm" meaning (e.g. search
|
|
208
|
+
* result lists, command palettes).
|
|
209
|
+
*
|
|
210
|
+
* Set declaratively in the template: `<yuv-list selectOnEnter>`.
|
|
211
|
+
*/
|
|
212
|
+
selectOnEnter: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* When `true`, switches the `ActiveDescendantKeyManager` to horizontal mode so that
|
|
215
|
+
* the **Left** / **Right** arrow keys navigate between items instead of **Up** / **Down**.
|
|
216
|
+
*
|
|
217
|
+
* Resolved once at construction time from the static `horizontal` host attribute.
|
|
218
|
+
* The text direction of the document is respected automatically (RTL-aware via CDK
|
|
219
|
+
* `Directionality`).
|
|
220
|
+
*
|
|
221
|
+
* Set declaratively in the template: `<yuv-list horizontal>`.
|
|
222
|
+
*/
|
|
223
|
+
horizontal: boolean;
|
|
224
|
+
constructor();
|
|
225
|
+
ngOnDestroy(): void;
|
|
226
|
+
/**
|
|
227
|
+
* Moves keyboard focus to the item at the given index and selects it.
|
|
228
|
+
*
|
|
229
|
+
* Combines three operations in one call: updating the CDK key manager's active
|
|
230
|
+
* descendant (which drives the ARIA active-descendant attribute and the visual focus ring),
|
|
231
|
+
* selecting the item, and transferring DOM focus to the list host element so that
|
|
232
|
+
* subsequent keyboard events are processed correctly.
|
|
233
|
+
*
|
|
234
|
+
* Safe to call before the key manager is initialized — the guard at the top of
|
|
235
|
+
* the method prevents errors during early lifecycle phases.
|
|
236
|
+
*
|
|
237
|
+
* @param index Zero-based index of the item to activate.
|
|
238
|
+
*/
|
|
239
|
+
setActiveItem(index: number): void;
|
|
240
|
+
/**
|
|
241
|
+
* Transfers DOM focus to the list host element.
|
|
242
|
+
*
|
|
243
|
+
* Calling this ensures that subsequent keyboard events (arrow keys, Space, etc.)
|
|
244
|
+
* are routed to the list's `(keydown)` handler. Called internally by
|
|
245
|
+
* `setActiveItem()`, but also useful from the parent when programmatic focus
|
|
246
|
+
* management is needed (e.g. after closing a dialog that was triggered from a
|
|
247
|
+
* list item).
|
|
248
|
+
*/
|
|
249
|
+
focus(): void;
|
|
250
|
+
/**
|
|
251
|
+
* Smoothly scrolls the list container back to the top.
|
|
252
|
+
*
|
|
253
|
+
* Useful after programmatically refreshing the list contents when the user may
|
|
254
|
+
* have scrolled far down and the new result set should be shown from the beginning.
|
|
255
|
+
*/
|
|
256
|
+
scrollToTop(): void;
|
|
257
|
+
/**
|
|
258
|
+
* Shifts all selected and focused item indices by the given offset.
|
|
259
|
+
*
|
|
260
|
+
* Use this when items are prepended or inserted at the beginning of the list so
|
|
261
|
+
* that the existing selection and keyboard-focus position stay attached to the
|
|
262
|
+
* same logical items after the index space shifts. A positive offset moves
|
|
263
|
+
* indices forward (items were inserted before the selection); a negative offset
|
|
264
|
+
* moves them backward (items were removed before the selection).
|
|
265
|
+
*
|
|
266
|
+
* Does **not** emit `itemSelect` — the selection indices change structurally,
|
|
267
|
+
* not because the user chose different items.
|
|
268
|
+
*
|
|
269
|
+
* @param offset Number of positions to shift every selected index by.
|
|
270
|
+
*/
|
|
271
|
+
shiftSelectionBy(offset: number): void;
|
|
272
|
+
/**
|
|
273
|
+
* Programmatically replaces the entire selection with the given indices.
|
|
274
|
+
*
|
|
275
|
+
* Only effective when `multiselect` is `true` and `disableSelection` is `false`.
|
|
276
|
+
* Out-of-range indices are silently discarded. The resulting selection is sorted
|
|
277
|
+
* ascending before being applied and emitted.
|
|
278
|
+
*
|
|
279
|
+
* Use this when the parent needs to restore a previously saved multi-selection
|
|
280
|
+
* state, e.g. after navigation or on component re-initialization.
|
|
281
|
+
*
|
|
282
|
+
* @param index Array of zero-based item indices to select.
|
|
283
|
+
*/
|
|
284
|
+
multiSelect(index: number[]): void;
|
|
285
|
+
/**
|
|
286
|
+
* Selects the item at the given index, optionally extending or toggling
|
|
287
|
+
* the existing selection using modifier-key semantics.
|
|
288
|
+
*
|
|
289
|
+
* - **No modifiers** (default): replaces the current selection with the single item.
|
|
290
|
+
* - **`shiftKey = true`** (`multiselect` only): range-selects all items between the
|
|
291
|
+
* last selected index and `index` (inclusive of neither endpoint, matching typical
|
|
292
|
+
* OS list behavior).
|
|
293
|
+
* - **`ctrlKey = true`** (`multiselect` only): toggles `index` in the selection
|
|
294
|
+
* without affecting the rest.
|
|
295
|
+
*
|
|
296
|
+
* Index is clamped to `[0, items.length - 1]`. Negative values and calls while
|
|
297
|
+
* `disableSelection` is `true` are ignored. The `preventChangeUntil` guard is
|
|
298
|
+
* also respected.
|
|
299
|
+
*
|
|
300
|
+
* Emits `itemSelect` after updating the visual state.
|
|
301
|
+
*
|
|
302
|
+
* @param index Zero-based index of the item to select.
|
|
303
|
+
* @param shiftKey Extend the selection from the last selected item to `index`.
|
|
304
|
+
* @param ctrlKey Toggle `index` in or out of the current selection.
|
|
305
|
+
*/
|
|
306
|
+
select(index: number, shiftKey?: boolean, ctrlKey?: boolean): void;
|
|
307
|
+
/**
|
|
308
|
+
* Clears the current selection and resets the active keyboard-focus index.
|
|
309
|
+
*
|
|
310
|
+
* If the selection is already empty, the method is a no-op (no event emitted,
|
|
311
|
+
* no state update). The `preventChangeUntil` guard is respected — if the guard
|
|
312
|
+
* returns `true`, the clear is blocked entirely.
|
|
313
|
+
*
|
|
314
|
+
* Also triggered internally when the user presses **Escape**.
|
|
315
|
+
*
|
|
316
|
+
* @param silent When `true`, skips emitting `itemSelect` after clearing. Use this
|
|
317
|
+
* when the parent needs to reset state programmatically without
|
|
318
|
+
* triggering downstream reactions.
|
|
319
|
+
*/
|
|
320
|
+
clear(silent?: boolean): void;
|
|
321
|
+
/**
|
|
322
|
+
* Host `keydown` handler — routes keyboard events to selection or navigation logic.
|
|
323
|
+
*
|
|
324
|
+
* Handled keys:
|
|
325
|
+
* - **Escape**: clears the selection.
|
|
326
|
+
* - **Space** (always) / **Enter** (when `selectOnEnter` is set): selects the
|
|
327
|
+
* currently focused item. `preventDefault()` is called to stop the browser
|
|
328
|
+
* from scrolling the container when Space is pressed.
|
|
329
|
+
* - **All other keys**: forwarded to `ActiveDescendantKeyManager` so arrow keys,
|
|
330
|
+
* Home, End, etc. move the focus indicator without changing the selection.
|
|
331
|
+
*
|
|
332
|
+
* When `disableSelection` is `true`, only navigation keys are forwarded to the
|
|
333
|
+
* key manager — selection keys (Space, Enter, Escape) are suppressed.
|
|
334
|
+
*
|
|
335
|
+
* Bound via the `host` metadata as `(keydown)`.
|
|
336
|
+
*
|
|
337
|
+
* @param event The keyboard event originating from the list host element.
|
|
338
|
+
*/
|
|
339
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
340
|
+
/**
|
|
341
|
+
* Host `focus` handler — restores a sensible focus position when the list
|
|
342
|
+
* host element receives DOM focus without an item already being active.
|
|
343
|
+
*
|
|
344
|
+
* The logic runs inside a 300 ms timeout so that focus events triggered by
|
|
345
|
+
* an item being clicked (which also bubbles a focus event up to the host)
|
|
346
|
+
* have already resolved their own active-item state before this handler acts.
|
|
347
|
+
* If an active item already exists when the timeout fires, nothing happens.
|
|
348
|
+
*
|
|
349
|
+
* Focus target priority:
|
|
350
|
+
* 1. The first index in the current selection (so the user lands back on the
|
|
351
|
+
* previously selected item when tabbing into the list).
|
|
352
|
+
* 2. Index 0 as the fallback when there is no selection.
|
|
353
|
+
*
|
|
354
|
+
* Bound via the `host` metadata as `(focus)`.
|
|
355
|
+
*/
|
|
356
|
+
protected onFocus(): void;
|
|
357
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListComponent, never>;
|
|
358
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListComponent, "yuv-list", never, { "preventChangeUntil": { "alias": "preventChangeUntil"; "required": false; "isSignal": true; }; "multiselect": { "alias": "multiselect"; "required": false; "isSignal": true; }; "selfHandleSelection": { "alias": "selfHandleSelection"; "required": false; "isSignal": true; }; "selfHandleClick": { "alias": "selfHandleClick"; "required": false; "isSignal": true; }; "autoSelect": { "alias": "autoSelect"; "required": false; "isSignal": true; }; "disableSelection": { "alias": "disableSelection"; "required": false; "isSignal": true; }; }, { "itemSelect": "itemSelect"; "itemFocus": "itemFocus"; }, ["items"], ["*"], true, never>;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
declare class ListTileComponent {
|
|
362
|
+
iconSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
363
|
+
titleSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
364
|
+
descriptionSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
365
|
+
asideSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
366
|
+
actionsSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
367
|
+
badgesSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
368
|
+
metaSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
369
|
+
extensionSlot: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
370
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ListTileComponent, never>;
|
|
371
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ListTileComponent, "yuv-list-tile", never, {}, {}, ["iconSlot", "titleSlot", "descriptionSlot", "asideSlot", "actionsSlot", "badgesSlot", "metaSlot", "extensionSlot"], ["*"], true, never>;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
declare class YuvListModule {
|
|
375
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuvListModule, never>;
|
|
376
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<YuvListModule, never, [typeof ListComponent, typeof ListItemDirective, typeof ListTileComponent], [typeof ListComponent, typeof ListItemDirective, typeof ListTileComponent]>;
|
|
377
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<YuvListModule>;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export { ListComponent, ListItemDirective, ListTileComponent, YuvListModule };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterViewInit, TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
interface MasterDetailsLayoutOptions {
|
|
5
|
+
masterSize?: number;
|
|
6
|
+
masterMinSize?: number;
|
|
7
|
+
detailsSize?: number;
|
|
8
|
+
detailsMinSize?: number;
|
|
9
|
+
resizable: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Component rendering a master/details view.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <yuv-master-details [(detailsActive)]="detailsActive">
|
|
17
|
+
* <ng-template #yuvMasterPane>Main Pane</ng-template>
|
|
18
|
+
* <ng-template #yuvDetailsPane>Details Pane</ng-template>
|
|
19
|
+
* </yuv-master-details>
|
|
20
|
+
*/
|
|
21
|
+
declare class YuvMasterDetailsComponent implements AfterViewInit {
|
|
22
|
+
#private;
|
|
23
|
+
masterPane: _angular_core.Signal<TemplateRef<any>>;
|
|
24
|
+
detailsPane: _angular_core.Signal<TemplateRef<any>>;
|
|
25
|
+
detailsPaneTplateRef: _angular_core.Signal<TemplateRef<any>>;
|
|
26
|
+
private _defaultLayoutOptions;
|
|
27
|
+
/**
|
|
28
|
+
* Enable/disable details pane (also use as two-way-bound variable: [(detailsActive)])
|
|
29
|
+
*/
|
|
30
|
+
detailsActive: _angular_core.ModelSignal<boolean>;
|
|
31
|
+
smallScreenLayout: _angular_core.WritableSignal<boolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Layout settings is the state of the master details that could be persisted.
|
|
34
|
+
* Setting a `layoutSettingsID` will save the current state (details area visibilkity and
|
|
35
|
+
* split area sizes etc.) to the local storage. If the component is created, it will load
|
|
36
|
+
* those settings and re-apply them.
|
|
37
|
+
*/
|
|
38
|
+
readonly layoutSettingsID: _angular_core.InputSignal<string | undefined>;
|
|
39
|
+
private _layoutOptions;
|
|
40
|
+
/**
|
|
41
|
+
* Layout options to be applied.
|
|
42
|
+
*/
|
|
43
|
+
set layoutOptions(lo: Partial<MasterDetailsLayoutOptions>);
|
|
44
|
+
get layoutOptions(): MasterDetailsLayoutOptions;
|
|
45
|
+
undockableDetails: _angular_core.InputSignal<boolean>;
|
|
46
|
+
/**
|
|
47
|
+
* Styles tp be applied to the panels
|
|
48
|
+
*/
|
|
49
|
+
panelStyle: _angular_core.InputSignal<{
|
|
50
|
+
[key: string]: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* Size of the gutter in Pixel.
|
|
54
|
+
*/
|
|
55
|
+
gutterSize: _angular_core.InputSignal<number | undefined>;
|
|
56
|
+
onPopIn(): void;
|
|
57
|
+
ngAfterViewInit(): void;
|
|
58
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuvMasterDetailsComponent, never>;
|
|
59
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<YuvMasterDetailsComponent, "yuv-master-details", never, { "detailsActive": { "alias": "detailsActive"; "required": false; "isSignal": true; }; "layoutSettingsID": { "alias": "layoutSettingsID"; "required": false; "isSignal": true; }; "layoutOptions": { "alias": "layoutOptions"; "required": false; }; "undockableDetails": { "alias": "undockableDetails"; "required": false; "isSignal": true; }; "panelStyle": { "alias": "panelStyle"; "required": false; "isSignal": true; }; "gutterSize": { "alias": "gutterSize"; "required": false; "isSignal": true; }; }, { "detailsActive": "detailsActiveChange"; }, ["masterPane", "detailsPane"], never, true, never>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare class YuvMasterDetailsModule {
|
|
63
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuvMasterDetailsModule, never>;
|
|
64
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<YuvMasterDetailsModule, never, [typeof YuvMasterDetailsComponent], [typeof YuvMasterDetailsComponent]>;
|
|
65
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<YuvMasterDetailsModule>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { YuvMasterDetailsComponent, YuvMasterDetailsModule };
|
|
69
|
+
export type { MasterDetailsLayoutOptions };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy, TemplateRef } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A layout component that switches rendered content based on available space.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* When there is sufficient space, the `yuvDefaultSlot` content is displayed.
|
|
9
|
+
* Once the default content would overflow its container, it is hidden and the
|
|
10
|
+
* optional `yuvOverflowSlot` content is shown in its place. If no overflow slot
|
|
11
|
+
* is provided, the component simply disappears to free up space for surrounding
|
|
12
|
+
* components.
|
|
13
|
+
*
|
|
14
|
+
* This can also be used to remove certain elements on small screens, making layouts more adaptive.
|
|
15
|
+
*
|
|
16
|
+
* Overflow detection uses an
|
|
17
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver | IntersectionObserver}
|
|
18
|
+
* that watches whether the default slot is fully visible within the host element.
|
|
19
|
+
* The host element receives the CSS class `overflowing` while content is hidden.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <yuv-overflow-hidden>
|
|
24
|
+
* <ng-template #yuvDefaultSlot>
|
|
25
|
+
* <my-full-component />
|
|
26
|
+
* </ng-template>
|
|
27
|
+
* <!-- optional: shown instead of the default slot when space is insufficient -->
|
|
28
|
+
* <ng-template #yuvOverflowSlot>
|
|
29
|
+
* <my-compact-component />
|
|
30
|
+
* </ng-template>
|
|
31
|
+
* </yuv-overflow-hidden>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare class OverflowHiddenComponent implements AfterViewInit, OnDestroy {
|
|
35
|
+
#private;
|
|
36
|
+
/**
|
|
37
|
+
* Required content template rendered when there is sufficient space.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* Declare the template with the variable `#yuvDefaultSlot` inside the component's
|
|
41
|
+
* content projection area.
|
|
42
|
+
*/
|
|
43
|
+
defaultSlot: i0.Signal<TemplateRef<any>>;
|
|
44
|
+
/**
|
|
45
|
+
* Optional content template rendered when the default slot overflows.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Declare the template with the variable `#yuvOverflowSlot` inside the component's
|
|
49
|
+
* content projection area. When omitted, the component becomes invisible once its
|
|
50
|
+
* default content no longer fits.
|
|
51
|
+
*/
|
|
52
|
+
overflowSlot: i0.Signal<TemplateRef<any> | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Reactive signal indicating whether the default slot content is currently overflowing.
|
|
55
|
+
*
|
|
56
|
+
* `true` when the default content no longer fits within the host element and is hidden;
|
|
57
|
+
* `false` when the default content is fully visible.
|
|
58
|
+
*/
|
|
59
|
+
overflow: i0.WritableSignal<boolean>;
|
|
60
|
+
ngAfterViewInit(): void;
|
|
61
|
+
ngOnDestroy(): void;
|
|
62
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<OverflowHiddenComponent, never>;
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<OverflowHiddenComponent, "yuv-overflow-hidden", never, {}, {}, ["defaultSlot", "overflowSlot"], never, true, never>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class YuvOverflowHiddenModule {
|
|
67
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<YuvOverflowHiddenModule, never>;
|
|
68
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<YuvOverflowHiddenModule, never, [typeof OverflowHiddenComponent], [typeof OverflowHiddenComponent]>;
|
|
69
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<YuvOverflowHiddenModule>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { OverflowHiddenComponent, YuvOverflowHiddenModule };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { AfterViewInit, OnDestroy } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
interface OverflowMenuItem {
|
|
5
|
+
id: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
svgIcon?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
active?: boolean;
|
|
10
|
+
group?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
callback: (item: OverflowMenuItem) => void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type __MenuItem = OverflowMenuItem & {
|
|
16
|
+
overflow: boolean;
|
|
17
|
+
};
|
|
18
|
+
interface MenuGroup {
|
|
19
|
+
id: string;
|
|
20
|
+
items: __MenuItem[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A responsive toolbar component that automatically moves items that no longer
|
|
24
|
+
* fit into the available horizontal (or vertical) space into an overflow menu.
|
|
25
|
+
*
|
|
26
|
+
* Items are rendered as icon buttons with a tooltip. When items overflow, they
|
|
27
|
+
* collapse into a `MatMenu` triggered by the overflow icon button. Items that
|
|
28
|
+
* share the same `group` value on {@link OverflowMenuItem} are rendered in
|
|
29
|
+
* labeled sections both in the toolbar and in the overflow menu.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```html
|
|
33
|
+
* <yuv-overflow-menu
|
|
34
|
+
* [menuItems]="actions"
|
|
35
|
+
* [groupLabels]="{ edit: 'Edit', view: 'View' }"
|
|
36
|
+
* />
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @selector `yuv-overflow-menu`
|
|
40
|
+
*/
|
|
41
|
+
declare class OverflowMenuComponent implements AfterViewInit, OnDestroy {
|
|
42
|
+
#private;
|
|
43
|
+
/**
|
|
44
|
+
* Material icon ligature used for the overflow trigger button.
|
|
45
|
+
* Defaults to `'more_horiz'` (three horizontal dots).
|
|
46
|
+
*/
|
|
47
|
+
overflowIcon: _angular_core.InputSignal<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional display labels for item groups shown in the overflow menu.
|
|
50
|
+
* The key must match the `group` property of the corresponding
|
|
51
|
+
* {@link OverflowMenuItem} entries.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* { edit: 'Edit actions', view: 'View options' }
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
groupLabels: _angular_core.InputSignal<Record<string, string> | undefined>;
|
|
59
|
+
/**
|
|
60
|
+
* The list of items to render in the toolbar.
|
|
61
|
+
* Items are displayed as icon buttons and overflow into a `MatMenu`
|
|
62
|
+
* when they no longer fit the available space.
|
|
63
|
+
*/
|
|
64
|
+
menuItems: _angular_core.InputSignal<OverflowMenuItem[]>;
|
|
65
|
+
/**
|
|
66
|
+
* When `true` the toolbar is laid out vertically and tooltips appear
|
|
67
|
+
* to the right of each button instead of below.
|
|
68
|
+
* The host element receives the CSS class `vertical` to allow style overrides.
|
|
69
|
+
* Defaults to `false`.
|
|
70
|
+
*/
|
|
71
|
+
vertical: _angular_core.InputSignal<boolean>;
|
|
72
|
+
__menuGroups: _angular_core.Signal<MenuGroup[]>;
|
|
73
|
+
private __menuItems;
|
|
74
|
+
overflowGroups: _angular_core.WritableSignal<MenuGroup[]>;
|
|
75
|
+
activeStyles: {};
|
|
76
|
+
ngAfterViewInit(): void;
|
|
77
|
+
ngOnDestroy(): void;
|
|
78
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<OverflowMenuComponent, never>;
|
|
79
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<OverflowMenuComponent, "yuv-overflow-menu", never, { "overflowIcon": { "alias": "overflowIcon"; "required": false; "isSignal": true; }; "groupLabels": { "alias": "groupLabels"; "required": false; "isSignal": true; }; "menuItems": { "alias": "menuItems"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class YuvOverflowMenuModule {
|
|
83
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<YuvOverflowMenuModule, never>;
|
|
84
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<YuvOverflowMenuModule, never, [typeof OverflowMenuComponent], [typeof OverflowMenuComponent]>;
|
|
85
|
+
static ɵinj: _angular_core.ɵɵInjectorDeclaration<YuvOverflowMenuModule>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { OverflowMenuComponent, YuvOverflowMenuModule };
|
|
89
|
+
export type { OverflowMenuItem };
|