@ngneers/controls 0.0.1-next.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/ngneers-controls-accordion.mjs +234 -0
- package/fesm2022/ngneers-controls-accordion.mjs.map +1 -0
- package/fesm2022/ngneers-controls-api-ng.mjs +959 -0
- package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -0
- package/fesm2022/ngneers-controls-api-resize.mjs +712 -0
- package/fesm2022/ngneers-controls-api-resize.mjs.map +1 -0
- package/fesm2022/ngneers-controls-api.mjs +347 -0
- package/fesm2022/ngneers-controls-api.mjs.map +1 -0
- package/fesm2022/ngneers-controls-avatar.mjs +77 -0
- package/fesm2022/ngneers-controls-avatar.mjs.map +1 -0
- package/fesm2022/ngneers-controls-base.mjs +620 -0
- package/fesm2022/ngneers-controls-base.mjs.map +1 -0
- package/fesm2022/ngneers-controls-breadcrumb.mjs +100 -0
- package/fesm2022/ngneers-controls-breadcrumb.mjs.map +1 -0
- package/fesm2022/ngneers-controls-button-group.mjs +110 -0
- package/fesm2022/ngneers-controls-button-group.mjs.map +1 -0
- package/fesm2022/ngneers-controls-button.mjs +83 -0
- package/fesm2022/ngneers-controls-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-calendar-time-CJT5AFlA.mjs +74 -0
- package/fesm2022/ngneers-controls-calendar-time-CJT5AFlA.mjs.map +1 -0
- package/fesm2022/ngneers-controls-calendar.mjs +801 -0
- package/fesm2022/ngneers-controls-calendar.mjs.map +1 -0
- package/fesm2022/ngneers-controls-checkbox.mjs +63 -0
- package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -0
- package/fesm2022/ngneers-controls-chip.mjs +55 -0
- package/fesm2022/ngneers-controls-chip.mjs.map +1 -0
- package/fesm2022/ngneers-controls-default-icons.mjs +82 -0
- package/fesm2022/ngneers-controls-default-icons.mjs.map +1 -0
- package/fesm2022/ngneers-controls-defer.mjs +72 -0
- package/fesm2022/ngneers-controls-defer.mjs.map +1 -0
- package/fesm2022/ngneers-controls-dialog.mjs +407 -0
- package/fesm2022/ngneers-controls-dialog.mjs.map +1 -0
- package/fesm2022/ngneers-controls-directives.mjs +498 -0
- package/fesm2022/ngneers-controls-directives.mjs.map +1 -0
- package/fesm2022/ngneers-controls-drawer.mjs +271 -0
- package/fesm2022/ngneers-controls-drawer.mjs.map +1 -0
- package/fesm2022/ngneers-controls-edit-inplace.mjs +127 -0
- package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -0
- package/fesm2022/ngneers-controls-errors.mjs +329 -0
- package/fesm2022/ngneers-controls-errors.mjs.map +1 -0
- package/fesm2022/ngneers-controls-filter.mjs +708 -0
- package/fesm2022/ngneers-controls-filter.mjs.map +1 -0
- package/fesm2022/ngneers-controls-hint.mjs +153 -0
- package/fesm2022/ngneers-controls-hint.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs +170 -0
- package/fesm2022/ngneers-controls-i18n-translations-de.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs +170 -0
- package/fesm2022/ngneers-controls-i18n-translations-en.mjs.map +1 -0
- package/fesm2022/ngneers-controls-i18n.mjs +57 -0
- package/fesm2022/ngneers-controls-i18n.mjs.map +1 -0
- package/fesm2022/ngneers-controls-icon.mjs +195 -0
- package/fesm2022/ngneers-controls-icon.mjs.map +1 -0
- package/fesm2022/ngneers-controls-inplace.mjs +150 -0
- package/fesm2022/ngneers-controls-inplace.mjs.map +1 -0
- package/fesm2022/ngneers-controls-input-field.mjs +165 -0
- package/fesm2022/ngneers-controls-input-field.mjs.map +1 -0
- package/fesm2022/ngneers-controls-input.mjs +72 -0
- package/fesm2022/ngneers-controls-input.mjs.map +1 -0
- package/fesm2022/ngneers-controls-item-view.mjs +473 -0
- package/fesm2022/ngneers-controls-item-view.mjs.map +1 -0
- package/fesm2022/ngneers-controls-list-box.mjs +281 -0
- package/fesm2022/ngneers-controls-list-box.mjs.map +1 -0
- package/fesm2022/ngneers-controls-mask-input.mjs +888 -0
- package/fesm2022/ngneers-controls-mask-input.mjs.map +1 -0
- package/fesm2022/ngneers-controls-menu.mjs +371 -0
- package/fesm2022/ngneers-controls-menu.mjs.map +1 -0
- package/fesm2022/ngneers-controls-message.mjs +30 -0
- package/fesm2022/ngneers-controls-message.mjs.map +1 -0
- package/fesm2022/ngneers-controls-number-input.mjs +366 -0
- package/fesm2022/ngneers-controls-number-input.mjs.map +1 -0
- package/fesm2022/ngneers-controls-paginator.mjs +129 -0
- package/fesm2022/ngneers-controls-paginator.mjs.map +1 -0
- package/fesm2022/ngneers-controls-popover.mjs +215 -0
- package/fesm2022/ngneers-controls-popover.mjs.map +1 -0
- package/fesm2022/ngneers-controls-progress.mjs +98 -0
- package/fesm2022/ngneers-controls-progress.mjs.map +1 -0
- package/fesm2022/ngneers-controls-radio.mjs +152 -0
- package/fesm2022/ngneers-controls-radio.mjs.map +1 -0
- package/fesm2022/ngneers-controls-roving-focus.mjs +323 -0
- package/fesm2022/ngneers-controls-roving-focus.mjs.map +1 -0
- package/fesm2022/ngneers-controls-scroll-shadow.mjs +65 -0
- package/fesm2022/ngneers-controls-scroll-shadow.mjs.map +1 -0
- package/fesm2022/ngneers-controls-scroller.mjs +308 -0
- package/fesm2022/ngneers-controls-scroller.mjs.map +1 -0
- package/fesm2022/ngneers-controls-select-button.mjs +58 -0
- package/fesm2022/ngneers-controls-select-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-select.mjs +417 -0
- package/fesm2022/ngneers-controls-select.mjs.map +1 -0
- package/fesm2022/ngneers-controls-slider.mjs +167 -0
- package/fesm2022/ngneers-controls-slider.mjs.map +1 -0
- package/fesm2022/ngneers-controls-snackbar.mjs +414 -0
- package/fesm2022/ngneers-controls-snackbar.mjs.map +1 -0
- package/fesm2022/ngneers-controls-spin-buttons.mjs +126 -0
- package/fesm2022/ngneers-controls-spin-buttons.mjs.map +1 -0
- package/fesm2022/ngneers-controls-spinner.mjs +184 -0
- package/fesm2022/ngneers-controls-spinner.mjs.map +1 -0
- package/fesm2022/ngneers-controls-splitter.mjs +604 -0
- package/fesm2022/ngneers-controls-splitter.mjs.map +1 -0
- package/fesm2022/ngneers-controls-state.mjs +185 -0
- package/fesm2022/ngneers-controls-state.mjs.map +1 -0
- package/fesm2022/ngneers-controls-switch.mjs +39 -0
- package/fesm2022/ngneers-controls-switch.mjs.map +1 -0
- package/fesm2022/ngneers-controls-table.mjs +2634 -0
- package/fesm2022/ngneers-controls-table.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tabs.mjs +336 -0
- package/fesm2022/ngneers-controls-tabs.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tag.mjs +30 -0
- package/fesm2022/ngneers-controls-tag.mjs.map +1 -0
- package/fesm2022/ngneers-controls-toast.mjs +350 -0
- package/fesm2022/ngneers-controls-toast.mjs.map +1 -0
- package/fesm2022/ngneers-controls-toggle-button.mjs +70 -0
- package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tooltip.mjs +506 -0
- package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -0
- package/fesm2022/ngneers-controls-tree.mjs +599 -0
- package/fesm2022/ngneers-controls-tree.mjs.map +1 -0
- package/fesm2022/ngneers-controls-upload.mjs +377 -0
- package/fesm2022/ngneers-controls-upload.mjs.map +1 -0
- package/fesm2022/ngneers-controls-utils-ng.mjs +411 -0
- package/fesm2022/ngneers-controls-utils-ng.mjs.map +1 -0
- package/fesm2022/ngneers-controls-utils.mjs +261 -0
- package/fesm2022/ngneers-controls-utils.mjs.map +1 -0
- package/fesm2022/ngneers-controls.mjs +6 -0
- package/fesm2022/ngneers-controls.mjs.map +1 -0
- package/package.json +302 -0
- package/types/ngneers-controls-accordion.d.ts +139 -0
- package/types/ngneers-controls-api-ng.d.ts +364 -0
- package/types/ngneers-controls-api-resize.d.ts +318 -0
- package/types/ngneers-controls-api.d.ts +145 -0
- package/types/ngneers-controls-avatar.d.ts +54 -0
- package/types/ngneers-controls-base.d.ts +277 -0
- package/types/ngneers-controls-breadcrumb.d.ts +272 -0
- package/types/ngneers-controls-button-group.d.ts +46 -0
- package/types/ngneers-controls-button.d.ts +48 -0
- package/types/ngneers-controls-calendar.d.ts +466 -0
- package/types/ngneers-controls-checkbox.d.ts +40 -0
- package/types/ngneers-controls-chip.d.ts +202 -0
- package/types/ngneers-controls-default-icons.d.ts +5 -0
- package/types/ngneers-controls-defer.d.ts +48 -0
- package/types/ngneers-controls-dialog.d.ts +399 -0
- package/types/ngneers-controls-directives.d.ts +171 -0
- package/types/ngneers-controls-drawer.d.ts +308 -0
- package/types/ngneers-controls-edit-inplace.d.ts +263 -0
- package/types/ngneers-controls-errors.d.ts +155 -0
- package/types/ngneers-controls-filter.d.ts +609 -0
- package/types/ngneers-controls-hint.d.ts +88 -0
- package/types/ngneers-controls-i18n-translations-de.d.ts +164 -0
- package/types/ngneers-controls-i18n-translations-en.d.ts +164 -0
- package/types/ngneers-controls-i18n.d.ts +186 -0
- package/types/ngneers-controls-icon.d.ts +68 -0
- package/types/ngneers-controls-inplace.d.ts +98 -0
- package/types/ngneers-controls-input-field.d.ts +248 -0
- package/types/ngneers-controls-input.d.ts +30 -0
- package/types/ngneers-controls-item-view.d.ts +215 -0
- package/types/ngneers-controls-list-box.d.ts +334 -0
- package/types/ngneers-controls-mask-input.d.ts +434 -0
- package/types/ngneers-controls-menu.d.ts +192 -0
- package/types/ngneers-controls-message.d.ts +21 -0
- package/types/ngneers-controls-number-input.d.ts +146 -0
- package/types/ngneers-controls-paginator.d.ts +255 -0
- package/types/ngneers-controls-popover.d.ts +116 -0
- package/types/ngneers-controls-progress.d.ts +49 -0
- package/types/ngneers-controls-radio.d.ts +91 -0
- package/types/ngneers-controls-roving-focus.d.ts +107 -0
- package/types/ngneers-controls-scroll-shadow.d.ts +25 -0
- package/types/ngneers-controls-scroller.d.ts +151 -0
- package/types/ngneers-controls-select-button.d.ts +51 -0
- package/types/ngneers-controls-select.d.ts +409 -0
- package/types/ngneers-controls-slider.d.ts +57 -0
- package/types/ngneers-controls-snackbar.d.ts +330 -0
- package/types/ngneers-controls-spin-buttons.d.ts +69 -0
- package/types/ngneers-controls-spinner.d.ts +117 -0
- package/types/ngneers-controls-splitter.d.ts +465 -0
- package/types/ngneers-controls-state.d.ts +102 -0
- package/types/ngneers-controls-switch.d.ts +18 -0
- package/types/ngneers-controls-table.d.ts +3127 -0
- package/types/ngneers-controls-tabs.d.ts +118 -0
- package/types/ngneers-controls-tag.d.ts +21 -0
- package/types/ngneers-controls-toast.d.ts +298 -0
- package/types/ngneers-controls-toggle-button.d.ts +48 -0
- package/types/ngneers-controls-tooltip.d.ts +189 -0
- package/types/ngneers-controls-tree.d.ts +409 -0
- package/types/ngneers-controls-upload.d.ts +347 -0
- package/types/ngneers-controls-utils-ng.d.ts +129 -0
- package/types/ngneers-controls-utils.d.ts +130 -0
- package/types/ngneers-controls.d.ts +2 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Signal, InjectionToken } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
type RovingOrientation = 'horizontal' | 'vertical';
|
|
5
|
+
type RovingMode = 'tabindex' | 'activedescendant';
|
|
6
|
+
interface RovingItemRef {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly element: HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* Optional reactive disabled flag. When it reads `true`, the item is skipped
|
|
11
|
+
* by keyboard navigation (`next`/`prev`/`first`/`last`) and pointer
|
|
12
|
+
* `activate()`. Absent (undefined) is treated as enabled.
|
|
13
|
+
*/
|
|
14
|
+
readonly disabled?: Signal<boolean>;
|
|
15
|
+
}
|
|
16
|
+
declare const ROVING_GROUP: InjectionToken<NgnRovingGroup>;
|
|
17
|
+
declare class NgnRovingGroup {
|
|
18
|
+
/**
|
|
19
|
+
* Which arrow keys move the active item: `'horizontal'` uses Left/Right,
|
|
20
|
+
* `'vertical'` uses Up/Down. Home/End always jump to first/last.
|
|
21
|
+
* @default 'horizontal'
|
|
22
|
+
*/
|
|
23
|
+
readonly orientation: _angular_core.InputSignal<RovingOrientation>;
|
|
24
|
+
/**
|
|
25
|
+
* How the active item is exposed. `'tabindex'` moves the tab stop (and DOM
|
|
26
|
+
* focus) between items; `'activedescendant'` keeps focus on the group and
|
|
27
|
+
* points `aria-activedescendant` at the active item.
|
|
28
|
+
* @default 'tabindex'
|
|
29
|
+
*/
|
|
30
|
+
readonly rovingMode: _angular_core.InputSignal<RovingMode>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether keyboard navigation wraps around the ends of the list instead of
|
|
33
|
+
* stopping at the first/last item.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
readonly rovingWrap: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Emits the index of the newly active item whenever it changes via keyboard,
|
|
39
|
+
* pointer, or {@link setActive}. Not emitted by {@link syncActiveIndex}.
|
|
40
|
+
*/
|
|
41
|
+
readonly activeItemChange: _angular_core.OutputEmitterRef<number>;
|
|
42
|
+
private readonly _host;
|
|
43
|
+
private readonly _items;
|
|
44
|
+
/** Items in DOM order. */
|
|
45
|
+
readonly items: Signal<RovingItemRef[]>;
|
|
46
|
+
readonly activeIndex: _angular_core.WritableSignal<number>;
|
|
47
|
+
/**
|
|
48
|
+
* Tracks the previously active item's id so we can decide whether to call
|
|
49
|
+
* `.focus()`. Initialized to `null` — the first effect pass sets it without
|
|
50
|
+
* focusing; subsequent passes focus when the id actually changes.
|
|
51
|
+
*/
|
|
52
|
+
private _prevActiveId;
|
|
53
|
+
/**
|
|
54
|
+
* When set, the next focus-mode effect pass updates the tab stop / attributes
|
|
55
|
+
* but does NOT move DOM focus. Consumed (reset) by that pass. Lets consumers
|
|
56
|
+
* sync the active item to a programmatic selection (e.g. a radio group's
|
|
57
|
+
* `value` change) without stealing focus into the group.
|
|
58
|
+
*/
|
|
59
|
+
private _suppressFocus;
|
|
60
|
+
constructor();
|
|
61
|
+
register(item: RovingItemRef): void;
|
|
62
|
+
unregister(item: RovingItemRef): void;
|
|
63
|
+
activate(target: RovingItemRef): void;
|
|
64
|
+
next(): void;
|
|
65
|
+
prev(): void;
|
|
66
|
+
first(): void;
|
|
67
|
+
last(): void;
|
|
68
|
+
/** Set the active item by index (clamped to range); emits activeItemChange. */
|
|
69
|
+
setActive(index: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Move the tab stop to `index` WITHOUT moving DOM focus or emitting
|
|
72
|
+
* `activeItemChange`. For syncing the roving state to a programmatic
|
|
73
|
+
* selection (e.g. a radio group's `value` changing from code) where stealing
|
|
74
|
+
* focus into the group would be wrong.
|
|
75
|
+
*/
|
|
76
|
+
syncActiveIndex(index: number): void;
|
|
77
|
+
private _onKeydown;
|
|
78
|
+
private _move;
|
|
79
|
+
private _setActive;
|
|
80
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnRovingGroup, never>;
|
|
81
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgnRovingGroup, "[ngnRovingGroup]", ["ngnRovingGroup"], { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "rovingMode": { "alias": "rovingMode"; "required": false; "isSignal": true; }; "rovingWrap": { "alias": "rovingWrap"; "required": false; "isSignal": true; }; }, { "activeItemChange": "activeItemChange"; }, never, never, true, never>;
|
|
82
|
+
}
|
|
83
|
+
declare class NgnRovingItem implements RovingItemRef {
|
|
84
|
+
private readonly _injectedGroup;
|
|
85
|
+
/**
|
|
86
|
+
* The {@link NgnRovingGroup} this item belongs to. Pass a group reference when
|
|
87
|
+
* the item is not a DOM descendant of its group; leave empty/undefined to use
|
|
88
|
+
* the nearest ancestor group via dependency injection.
|
|
89
|
+
*/
|
|
90
|
+
readonly ngnRovingItem: _angular_core.InputSignal<"" | NgnRovingGroup | undefined>;
|
|
91
|
+
readonly element: HTMLElement;
|
|
92
|
+
readonly id: string;
|
|
93
|
+
/**
|
|
94
|
+
* Reactive disabled flag for this item. Consumers (e.g. `ngn-radio`) set it
|
|
95
|
+
* so the group's keyboard navigation and pointer `activate()` skip the item.
|
|
96
|
+
*/
|
|
97
|
+
readonly disabled: _angular_core.WritableSignal<boolean>;
|
|
98
|
+
private readonly _group;
|
|
99
|
+
/** Whether this item is currently the active item in its group. */
|
|
100
|
+
readonly isActive: Signal<boolean>;
|
|
101
|
+
constructor();
|
|
102
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnRovingItem, never>;
|
|
103
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgnRovingItem, "[ngnRovingItem]", ["ngnRovingItem"], { "ngnRovingItem": { "alias": "ngnRovingItem"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { NgnRovingGroup, NgnRovingItem, ROVING_GROUP };
|
|
107
|
+
export type { RovingItemRef, RovingMode, RovingOrientation };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
3
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
4
|
+
|
|
5
|
+
declare class NgnScrollShadow {
|
|
6
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"scrollShadow", ["root", "scrolled-start", "scrolled-end", "scrolled-top", "scrolled-bottom"], readonly []>>;
|
|
7
|
+
private readonly _el;
|
|
8
|
+
private readonly _injector;
|
|
9
|
+
/**
|
|
10
|
+
* Which scroll axis to track and add shadow classes for.
|
|
11
|
+
* @default 'horizontal'
|
|
12
|
+
*/
|
|
13
|
+
readonly ngnScrollShadow: _angular_core.InputSignal<"horizontal" | "vertical" | "both">;
|
|
14
|
+
/**
|
|
15
|
+
* Element that receives the shadow classes. Defaults to the host element (which
|
|
16
|
+
* is also the scroll container being observed).
|
|
17
|
+
* @default undefined
|
|
18
|
+
*/
|
|
19
|
+
readonly scrollShadowTarget: _angular_core.InputSignal<HTMLElement | undefined>;
|
|
20
|
+
constructor();
|
|
21
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnScrollShadow, never>;
|
|
22
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgnScrollShadow, "[ngnScrollShadow]", never, { "ngnScrollShadow": { "alias": "ngnScrollShadow"; "required": false; "isSignal": true; }; "scrollShadowTarget": { "alias": "scrollShadowTarget"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { NgnScrollShadow };
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef, AfterViewInit } from '@angular/core';
|
|
3
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
4
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
5
|
+
import { AllKeysOfUnion } from '@ngneers/controls/utils';
|
|
6
|
+
import { NgnBase } from '@ngneers/controls/base';
|
|
7
|
+
import * as i1 from '@ngneers/controls/directives';
|
|
8
|
+
|
|
9
|
+
declare abstract class ScrollerTemplates<T> extends NgnBase<'scroller'> {
|
|
10
|
+
/**
|
|
11
|
+
* The template to be used for rendering each item in the scroller.
|
|
12
|
+
* Can also be set using the `item` content child.
|
|
13
|
+
*/
|
|
14
|
+
readonly templateItem: _angular_core.InputSignal<TemplateRef<{
|
|
15
|
+
$implicit: T;
|
|
16
|
+
index: number;
|
|
17
|
+
}> | null>;
|
|
18
|
+
private readonly _userItemTemplate;
|
|
19
|
+
protected readonly itemTemplate: _angular_core.Signal<TemplateRef<{
|
|
20
|
+
$implicit: T;
|
|
21
|
+
index: number;
|
|
22
|
+
}> | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Template types for the scroller.
|
|
25
|
+
* Can be used with the {@link NgnTemplate} directive for type safe ng-templates.
|
|
26
|
+
*/
|
|
27
|
+
readonly templateTypes: {
|
|
28
|
+
item: {
|
|
29
|
+
$implicit: T;
|
|
30
|
+
index: number;
|
|
31
|
+
};
|
|
32
|
+
} & {
|
|
33
|
+
$implicit: {
|
|
34
|
+
item: Partial<{
|
|
35
|
+
$implicit: T;
|
|
36
|
+
index: number;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScrollerTemplates<any>, never>;
|
|
41
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ScrollerTemplates<any>, never, never, { "templateItem": { "alias": "templateItem"; "required": false; "isSignal": true; }; }, {}, ["_userItemTemplate"], never, true, never>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @category control
|
|
46
|
+
*/
|
|
47
|
+
declare class NgnScroller<T> extends ScrollerTemplates<T> {
|
|
48
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"scroller", ["root", "virtual", "item", "item-sticky"], readonly []>>;
|
|
49
|
+
private readonly _el;
|
|
50
|
+
private readonly _scrollAmount;
|
|
51
|
+
/**
|
|
52
|
+
* The items to be displayed in the scroller.
|
|
53
|
+
* This is a required input and should be an array of items of type {@link T}.
|
|
54
|
+
*/
|
|
55
|
+
readonly items: _angular_core.InputSignal<readonly T[]>;
|
|
56
|
+
/**
|
|
57
|
+
* The field of the item that uniquely identifies it.
|
|
58
|
+
*/
|
|
59
|
+
readonly fieldId: _angular_core.InputSignal<keyof T | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Whether the scroller should use virtual scrolling.
|
|
62
|
+
* When set to true, the scroller will only render the items that are currently visible
|
|
63
|
+
* on the screen, improving performance for large lists.
|
|
64
|
+
*
|
|
65
|
+
* When virtual scrolling is enabled, {@link itemHeight} must be set to a non-zero value.
|
|
66
|
+
* @default `false`
|
|
67
|
+
*/
|
|
68
|
+
readonly virtual: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
69
|
+
/**
|
|
70
|
+
* When {@link virtual} scrolling is enabled, this input is required to define the height of each item in pixels.
|
|
71
|
+
*/
|
|
72
|
+
readonly itemHeight: _angular_core.InputSignal<number | undefined>;
|
|
73
|
+
/**
|
|
74
|
+
* When {@link virtual} scrolling is enabled, this input defines the number of items to be rendered above and below the visible area.
|
|
75
|
+
* This can help to reduce flickering when scrolling.
|
|
76
|
+
* @default `2`
|
|
77
|
+
*/
|
|
78
|
+
readonly virtualPadding: _angular_core.InputSignal<number>;
|
|
79
|
+
/**
|
|
80
|
+
* Determines whether the scroller should have a tab index and be focusable.
|
|
81
|
+
* @default `false`
|
|
82
|
+
*/
|
|
83
|
+
readonly focusable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Determines whether an item is sticky or not.
|
|
86
|
+
* If set, the scroller will stick the items with a truthy value for the specified field to the top of the scroller.
|
|
87
|
+
*/
|
|
88
|
+
readonly fieldSticky: _angular_core.InputSignal<AllKeysOfUnion<T> | null>;
|
|
89
|
+
/**
|
|
90
|
+
* Viewport size — tracks the scroll ancestor's dimensions so that virtual
|
|
91
|
+
* scrolling works when an outer element handles overflow (e.g. table wrapper).
|
|
92
|
+
*/
|
|
93
|
+
private readonly _viewportSize;
|
|
94
|
+
private readonly _itemHeightPx;
|
|
95
|
+
/**
|
|
96
|
+
* Vertical offset between the scroll container's top and the scroller element.
|
|
97
|
+
* Non-zero when a parent (e.g. table wrapper) owns the scroll and the scroller
|
|
98
|
+
* is positioned below other content (e.g. a sticky header row).
|
|
99
|
+
*/
|
|
100
|
+
private readonly _scrollOffset;
|
|
101
|
+
private readonly _visibleItemCount;
|
|
102
|
+
private readonly _scrollTop;
|
|
103
|
+
/**
|
|
104
|
+
* The index of the first item that is rendered in the (virtual) scroller.
|
|
105
|
+
*/
|
|
106
|
+
readonly itemStartIndex: _angular_core.Signal<number>;
|
|
107
|
+
private readonly _itemEndIndex;
|
|
108
|
+
protected readonly paddingTop: _angular_core.Signal<number>;
|
|
109
|
+
protected readonly paddingBottom: _angular_core.Signal<number>;
|
|
110
|
+
protected readonly visibleItems: _angular_core.Signal<{
|
|
111
|
+
item: T;
|
|
112
|
+
index: number;
|
|
113
|
+
}[]>;
|
|
114
|
+
/**
|
|
115
|
+
* Returns the last sticky item that is not rendered regularly in the list.
|
|
116
|
+
* Required because sticky items might need to be rendered longer than they would.
|
|
117
|
+
* Only applicable when virtual scrolling is enabled.
|
|
118
|
+
*/
|
|
119
|
+
protected readonly latestStickyItem: _angular_core.Signal<{
|
|
120
|
+
item: T;
|
|
121
|
+
index: number;
|
|
122
|
+
} | null>;
|
|
123
|
+
constructor();
|
|
124
|
+
/**
|
|
125
|
+
* Scrolls the item with the given index into view.
|
|
126
|
+
* @param index The index of the item to scroll to.
|
|
127
|
+
*/
|
|
128
|
+
scrollToIndex(index: number, position?: ScrollLogicalPosition): void;
|
|
129
|
+
protected track(item: {
|
|
130
|
+
item: T;
|
|
131
|
+
index: number;
|
|
132
|
+
}): unknown;
|
|
133
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnScroller<any>, never>;
|
|
134
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnScroller<any>, "ngn-scroller, [ngn-scroller]", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "fieldId": { "alias": "fieldId"; "required": false; "isSignal": true; }; "virtual": { "alias": "virtual"; "required": false; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "virtualPadding": { "alias": "virtualPadding"; "required": false; "isSignal": true; }; "focusable": { "alias": "focusable"; "required": false; "isSignal": true; }; "fieldSticky": { "alias": "fieldSticky"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.NgnScrollAmount; inputs: { "ngnScrollAmountContainer": "scrollContainer"; }; outputs: {}; }]>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
declare class NgnScrollerItem implements AfterViewInit {
|
|
138
|
+
private readonly _el;
|
|
139
|
+
/**
|
|
140
|
+
* The item bound to this element. Used to resolve its sticky state and apply
|
|
141
|
+
* the scroller's item classes from the enclosing {@link NgnScroller}.
|
|
142
|
+
*/
|
|
143
|
+
readonly ngnScrollerItem: _angular_core.InputSignal<object>;
|
|
144
|
+
private readonly _scroller;
|
|
145
|
+
ngAfterViewInit(): void;
|
|
146
|
+
constructor();
|
|
147
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnScrollerItem, never>;
|
|
148
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgnScrollerItem, "[ngnScrollerItem]", never, { "ngnScrollerItem": { "alias": "ngnScrollerItem"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export { NgnScroller, NgnScrollerItem };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
3
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
4
|
+
import { ValueControlBase } from '@ngneers/controls/base';
|
|
5
|
+
import { maybeCallback } from '@ngneers/controls/utils';
|
|
6
|
+
import { NgnActionItemFlat, NgnItem } from '@ngneers/controls/api';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @category control
|
|
10
|
+
*/
|
|
11
|
+
declare class NgnSelectButton<V> extends ValueControlBase<'selectButton', V> {
|
|
12
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"select-button", ["root", "invalid"], readonly [{
|
|
13
|
+
readonly class: "group";
|
|
14
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button-group", ["root", "vertical", "horizontal"], readonly [{
|
|
15
|
+
readonly class: "button";
|
|
16
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
17
|
+
readonly projected: true;
|
|
18
|
+
}, {
|
|
19
|
+
readonly class: "toggle-button";
|
|
20
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"toggle-button", ["root", "invalid", "button", "label", "active", "placeholder", "placeholder-active"], readonly []>;
|
|
21
|
+
readonly projected: true;
|
|
22
|
+
}]>;
|
|
23
|
+
}, {
|
|
24
|
+
readonly class: "button";
|
|
25
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"toggle-button", ["root", "invalid", "button", "label", "active", "placeholder", "placeholder-active"], readonly []>;
|
|
26
|
+
}]>>;
|
|
27
|
+
/**
|
|
28
|
+
* Defines the orientation of the select buttons.
|
|
29
|
+
* - 'auto' - The orientation is determined based on the available space.
|
|
30
|
+
* - 'horizontal' - The buttons are arranged horizontally. (Default for `auto` if enough space)
|
|
31
|
+
* - 'vertical' - The buttons are arranged vertically.
|
|
32
|
+
* @default 'auto'
|
|
33
|
+
*/
|
|
34
|
+
readonly orientation: _angular_core.InputSignal<"vertical" | "horizontal" | "auto">;
|
|
35
|
+
/**
|
|
36
|
+
* Defines the options for the select button.
|
|
37
|
+
*/
|
|
38
|
+
readonly options: _angular_core.InputSignal<readonly NgnActionItemFlat<NgnItem<unknown, V>>[]>;
|
|
39
|
+
/**
|
|
40
|
+
* When `true`, allows unselecting the currently selected option by clicking on it again.
|
|
41
|
+
* If `false`, clicking on the selected option will not change the selection.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
readonly allowUnselect: _angular_core.InputSignal<boolean>;
|
|
45
|
+
protected readonly maybeCallback: typeof maybeCallback;
|
|
46
|
+
protected valueChange(value: V): void;
|
|
47
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnSelectButton<any>, never>;
|
|
48
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnSelectButton<any>, "ngn-select-button", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": true; "isSignal": true; }; "allowUnselect": { "alias": "allowUnselect"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { NgnSelectButton };
|