@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,146 @@
|
|
|
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
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Turns a native `<input>` into a locale-aware number input with a
|
|
8
|
+
* `number | null` value model:
|
|
9
|
+
*
|
|
10
|
+
* - Free typing while focused; the value is committed on blur/Enter
|
|
11
|
+
* (unparseable text reverts, out-of-range values are clamped — no wrapping).
|
|
12
|
+
* - Display is formatted via `Intl.NumberFormat` while blurred; while focused
|
|
13
|
+
* the text is the raw, ungrouped edit form.
|
|
14
|
+
* - `ArrowUp`/`ArrowDown` step by `step`, with `Shift` by `bigStep`.
|
|
15
|
+
* Results are rounded to the operands' precision so float drift never shows.
|
|
16
|
+
* - Exposes the {@link NgnBase.stepValue}/{@link NgnBase.canStepValue} hooks,
|
|
17
|
+
* so `ngn-spin-buttons` (or a surrounding field) can step the value.
|
|
18
|
+
*
|
|
19
|
+
* @category control
|
|
20
|
+
*/
|
|
21
|
+
declare class NgnNumberInput extends ValueControlBase<'numberInput', number | null> {
|
|
22
|
+
readonly isFieldControl = true;
|
|
23
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"input", ["root", "invalid", "empty"], readonly []>>;
|
|
24
|
+
/**
|
|
25
|
+
* The minimum allowed value (inclusive). Typed values below are clamped on
|
|
26
|
+
* commit; stepping stops here.
|
|
27
|
+
*/
|
|
28
|
+
readonly min: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* The maximum allowed value (inclusive). Typed values above are clamped on
|
|
31
|
+
* commit; stepping stops here.
|
|
32
|
+
*/
|
|
33
|
+
readonly max: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* The step amount applied by the spin buttons and `ArrowUp`/`ArrowDown`.
|
|
36
|
+
* Non-finite or non-positive values fall back to `1`.
|
|
37
|
+
* @default 1
|
|
38
|
+
*/
|
|
39
|
+
readonly step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
40
|
+
/**
|
|
41
|
+
* The step amount applied with `Shift+ArrowUp`/`Shift+ArrowDown`.
|
|
42
|
+
* Non-finite or non-positive values fall back to `appliedStep * 10`.
|
|
43
|
+
* @default step * 10
|
|
44
|
+
*/
|
|
45
|
+
readonly bigStep: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
46
|
+
/**
|
|
47
|
+
* The locale used for formatting and parsing.
|
|
48
|
+
* @default LOCALE_ID
|
|
49
|
+
*/
|
|
50
|
+
readonly locale: _angular_core.InputSignal<string | undefined>;
|
|
51
|
+
/**
|
|
52
|
+
* Additional `Intl.NumberFormat` options for the blurred display format only
|
|
53
|
+
* (e.g. `{ minimumFractionDigits: 2 }`). While focused the input shows the
|
|
54
|
+
* plain, ungrouped edit form, so display options never round or reshape the
|
|
55
|
+
* value the user is typing.
|
|
56
|
+
*/
|
|
57
|
+
readonly formatOptions: _angular_core.InputSignal<Intl.NumberFormatOptions | undefined>;
|
|
58
|
+
private readonly _input;
|
|
59
|
+
private readonly _localeId;
|
|
60
|
+
protected readonly appliedLocale: _angular_core.Signal<string>;
|
|
61
|
+
/** Sanitized step — a finite positive number, defaulting to `1`. */
|
|
62
|
+
protected readonly appliedStep: _angular_core.Signal<number>;
|
|
63
|
+
protected readonly appliedBigStep: _angular_core.Signal<number>;
|
|
64
|
+
private readonly _localeInfo;
|
|
65
|
+
private readonly _displayFormat;
|
|
66
|
+
private readonly _editFormat;
|
|
67
|
+
/** Whether the input currently holds focus (raw edit format while focused). */
|
|
68
|
+
protected readonly focused: _angular_core.WritableSignal<boolean>;
|
|
69
|
+
/** Mirror of the input element's current text (drives the `empty` class). */
|
|
70
|
+
private readonly _text;
|
|
71
|
+
/**
|
|
72
|
+
* The last value applied by an internal mutation (step/commit/clear) that
|
|
73
|
+
* already set the edit text itself. Lets the value→text effect ignore those
|
|
74
|
+
* changes while focused, so a deferred flush can't clobber text the user
|
|
75
|
+
* typed right after (`undefined` = nothing applied internally yet).
|
|
76
|
+
*/
|
|
77
|
+
private readonly _appliedValue;
|
|
78
|
+
/** Whether the input holds no text at all. */
|
|
79
|
+
readonly empty: _angular_core.Signal<boolean>;
|
|
80
|
+
constructor();
|
|
81
|
+
/**
|
|
82
|
+
* Steps the value by `step` (or `bigStep`) without wrapping. Uncommitted
|
|
83
|
+
* typed text is parsed and used as the base; an empty value seeds at `min`
|
|
84
|
+
* (increment) or `max` (decrement), falling back to `0` on open bounds.
|
|
85
|
+
*/
|
|
86
|
+
stepValue(direction: 1 | -1, big?: boolean): boolean;
|
|
87
|
+
/** Whether stepping in `direction` is currently possible (bound not reached). */
|
|
88
|
+
canStepValue(direction: 1 | -1): boolean;
|
|
89
|
+
/** Clears value and text (invoked by a surrounding field's clear button). */
|
|
90
|
+
clearValue(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Parses the current text and commits it to the value model: empty → `null`,
|
|
93
|
+
* out-of-range → clamped, unparseable → reverted to the last committed value.
|
|
94
|
+
*/
|
|
95
|
+
private _commit;
|
|
96
|
+
private _setText;
|
|
97
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnNumberInput, never>;
|
|
98
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgnNumberInput, "input[ngnNumberInput]", ["ngnNumberInput"], { "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "bigStep": { "alias": "bigStep"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "formatOptions": { "alias": "formatOptions"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Locale-specific separators derived from `Intl.NumberFormat`. */
|
|
102
|
+
type LocaleNumberInfo = {
|
|
103
|
+
/** The decimal separator, e.g. `.` (en) or `,` (de). */
|
|
104
|
+
decimal: string;
|
|
105
|
+
/** The grouping (thousands) separator, e.g. `,` (en) or `.` (de). */
|
|
106
|
+
group: string;
|
|
107
|
+
/**
|
|
108
|
+
* The locale's digit glyphs indexed by value (`digits[0]` … `digits[9]`).
|
|
109
|
+
* Non-Latin numbering systems (e.g. `ar-EG` → `٠…٩`) are mapped back to
|
|
110
|
+
* ASCII before parsing. `null` when the locale already uses ASCII digits.
|
|
111
|
+
*/
|
|
112
|
+
digits: readonly string[] | null;
|
|
113
|
+
};
|
|
114
|
+
/** Derives the decimal/grouping separators and digit glyphs for a locale. */
|
|
115
|
+
declare function localeNumberInfo(locale: string): LocaleNumberInfo;
|
|
116
|
+
type ParsedNumber = {
|
|
117
|
+
kind: 'empty';
|
|
118
|
+
} | {
|
|
119
|
+
kind: 'invalid';
|
|
120
|
+
} | {
|
|
121
|
+
kind: 'value';
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Parses user-typed text into a number using the locale's separators:
|
|
126
|
+
* grouping separators (and non-breaking spaces used as such) are stripped,
|
|
127
|
+
* the locale decimal separator is normalized to `.`. Exponent notation is
|
|
128
|
+
* accepted; anything else non-numeric is `invalid`.
|
|
129
|
+
*/
|
|
130
|
+
declare function parseLocaleNumber(text: string, info: LocaleNumberInfo): ParsedNumber;
|
|
131
|
+
/** Number of decimal places of `value` (bounded to 20, exponent-safe). */
|
|
132
|
+
declare function decimalPlaces(value: number): number;
|
|
133
|
+
/** Rounds `value` to `decimals` decimal places (float-drift cleanup). */
|
|
134
|
+
declare function roundToPrecision(value: number, decimals: number): number;
|
|
135
|
+
/** Clamps `value` into `[min, max]`; open bounds when `null`/`undefined`. */
|
|
136
|
+
declare function clampValue(value: number, min?: number | null, max?: number | null): number;
|
|
137
|
+
/**
|
|
138
|
+
* Steps `current` by `amount` in `direction`, clamped into `[min, max]` (no
|
|
139
|
+
* wrapping). The result is rounded to the combined precision of the operands
|
|
140
|
+
* so float drift (`0.1 + 0.2`) never surfaces. Stepping from `null` seeds at
|
|
141
|
+
* `min` (increment) or `max` (decrement), falling back to `0` on open bounds.
|
|
142
|
+
*/
|
|
143
|
+
declare function stepNumberValue(current: number | null, direction: 1 | -1, amount: number, min?: number | null, max?: number | null): number;
|
|
144
|
+
|
|
145
|
+
export { NgnNumberInput, clampValue, decimalPlaces, localeNumberInfo, parseLocaleNumber, roundToPrecision, stepNumberValue };
|
|
146
|
+
export type { LocaleNumberInfo, ParsedNumber };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import * as _ngneers_signal_translate from '@ngneers/signal-translate';
|
|
3
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
4
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
5
|
+
import { NgnBase } from '@ngneers/controls/base';
|
|
6
|
+
import { NgnItem } from '@ngneers/controls/api';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Defines the pagination state including current page and slice information.
|
|
10
|
+
* Depending on the context or API design, you can choose to use either page-based or slice-based pagination.
|
|
11
|
+
*/
|
|
12
|
+
type PaginationState = {
|
|
13
|
+
/**
|
|
14
|
+
* The current pagination state in terms of page size and current page index.
|
|
15
|
+
*/
|
|
16
|
+
page: {
|
|
17
|
+
size: number;
|
|
18
|
+
current: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* The slice of items to be displayed based on the current page and page size.
|
|
22
|
+
*/
|
|
23
|
+
slice: {
|
|
24
|
+
skip: number;
|
|
25
|
+
take: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @category control
|
|
31
|
+
*/
|
|
32
|
+
declare class NgnPaginator extends NgnBase<'paginator'> {
|
|
33
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"paginator", ["root", "page-size-options", "active-page"], readonly [{
|
|
34
|
+
readonly class: "previous";
|
|
35
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
36
|
+
}, {
|
|
37
|
+
readonly class: "next";
|
|
38
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
39
|
+
}, {
|
|
40
|
+
readonly class: "page-number";
|
|
41
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
42
|
+
}, {
|
|
43
|
+
readonly class: "overflow";
|
|
44
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"button", ["root", "inline", "loading", `kind-${string}`, `color-${string}`], readonly []>;
|
|
45
|
+
}, {
|
|
46
|
+
readonly class: "item-view";
|
|
47
|
+
readonly template: _ngneers_controls_themes.ControlTemplate<"item-view", ["root", "item", "item-overflowing", "more-items", "more-items-hidden", "more-items-default", "hidden-separator"], readonly []>;
|
|
48
|
+
}]>>;
|
|
49
|
+
protected readonly i18n: _ngneers_signal_translate.TranslationsSignal<{
|
|
50
|
+
calendar: {
|
|
51
|
+
today: string;
|
|
52
|
+
input: string;
|
|
53
|
+
selectYear: string;
|
|
54
|
+
selectMonth: string;
|
|
55
|
+
previousMonth: string;
|
|
56
|
+
nextMonth: string;
|
|
57
|
+
weekdays: {
|
|
58
|
+
monday: string;
|
|
59
|
+
tuesday: string;
|
|
60
|
+
wednesday: string;
|
|
61
|
+
thursday: string;
|
|
62
|
+
friday: string;
|
|
63
|
+
saturday: string;
|
|
64
|
+
sunday: string;
|
|
65
|
+
};
|
|
66
|
+
weekdaysShort: {
|
|
67
|
+
monday: string;
|
|
68
|
+
tuesday: string;
|
|
69
|
+
wednesday: string;
|
|
70
|
+
thursday: string;
|
|
71
|
+
friday: string;
|
|
72
|
+
saturday: string;
|
|
73
|
+
sunday: string;
|
|
74
|
+
};
|
|
75
|
+
months: {
|
|
76
|
+
january: string;
|
|
77
|
+
february: string;
|
|
78
|
+
march: string;
|
|
79
|
+
april: string;
|
|
80
|
+
may: string;
|
|
81
|
+
june: string;
|
|
82
|
+
july: string;
|
|
83
|
+
august: string;
|
|
84
|
+
september: string;
|
|
85
|
+
october: string;
|
|
86
|
+
november: string;
|
|
87
|
+
december: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
editInplace: {
|
|
91
|
+
placeholder: string;
|
|
92
|
+
confirm: string;
|
|
93
|
+
};
|
|
94
|
+
filter: {
|
|
95
|
+
noFilter: string;
|
|
96
|
+
addCondition: string;
|
|
97
|
+
removeCondition: string;
|
|
98
|
+
operator: string;
|
|
99
|
+
value: string;
|
|
100
|
+
clear: string;
|
|
101
|
+
apply: string;
|
|
102
|
+
cancel: string;
|
|
103
|
+
matchModeLabel: string;
|
|
104
|
+
match: {
|
|
105
|
+
all: string;
|
|
106
|
+
any: string;
|
|
107
|
+
and: string;
|
|
108
|
+
or: string;
|
|
109
|
+
};
|
|
110
|
+
selected: string;
|
|
111
|
+
conditions: string;
|
|
112
|
+
operators: {
|
|
113
|
+
isEqual: string;
|
|
114
|
+
isNotEqual: string;
|
|
115
|
+
contains: string;
|
|
116
|
+
startsWith: string;
|
|
117
|
+
endsWith: string;
|
|
118
|
+
in: string;
|
|
119
|
+
isEmpty: string;
|
|
120
|
+
isNotEmpty: string;
|
|
121
|
+
greaterThan: string;
|
|
122
|
+
greaterThanOrEqual: string;
|
|
123
|
+
lessThan: string;
|
|
124
|
+
lessThanOrEqual: string;
|
|
125
|
+
after: string;
|
|
126
|
+
onOrAfter: string;
|
|
127
|
+
before: string;
|
|
128
|
+
onOrBefore: string;
|
|
129
|
+
isTrue: string;
|
|
130
|
+
isFalse: string;
|
|
131
|
+
custom: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
splitter: {
|
|
135
|
+
handleLabel: string;
|
|
136
|
+
};
|
|
137
|
+
inputField: {
|
|
138
|
+
clearInput: string;
|
|
139
|
+
};
|
|
140
|
+
maskInput: {
|
|
141
|
+
roleDescription: string;
|
|
142
|
+
segmentRange: string;
|
|
143
|
+
optionSeparator: string;
|
|
144
|
+
};
|
|
145
|
+
drawer: {
|
|
146
|
+
close: string;
|
|
147
|
+
};
|
|
148
|
+
dialog: {
|
|
149
|
+
close: string;
|
|
150
|
+
};
|
|
151
|
+
chip: {
|
|
152
|
+
close: string;
|
|
153
|
+
};
|
|
154
|
+
breadcrumb: {
|
|
155
|
+
overflow: string;
|
|
156
|
+
};
|
|
157
|
+
toast: {
|
|
158
|
+
close: string;
|
|
159
|
+
region: string;
|
|
160
|
+
};
|
|
161
|
+
snackbar: {
|
|
162
|
+
close: string;
|
|
163
|
+
region: string;
|
|
164
|
+
severity: {
|
|
165
|
+
error: string;
|
|
166
|
+
warning: string;
|
|
167
|
+
success: string;
|
|
168
|
+
info: string;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
upload: {
|
|
172
|
+
upload: string;
|
|
173
|
+
uploadNamed: string;
|
|
174
|
+
retryNamed: string;
|
|
175
|
+
cancelNamed: string;
|
|
176
|
+
removeNamed: string;
|
|
177
|
+
progressNamed: string;
|
|
178
|
+
};
|
|
179
|
+
select: {
|
|
180
|
+
filterOptions: string;
|
|
181
|
+
};
|
|
182
|
+
paginator: {
|
|
183
|
+
previousPage: string;
|
|
184
|
+
nextPage: string;
|
|
185
|
+
};
|
|
186
|
+
listBox: {
|
|
187
|
+
noItemsFound: string;
|
|
188
|
+
};
|
|
189
|
+
tree: {
|
|
190
|
+
noItemsFound: string;
|
|
191
|
+
};
|
|
192
|
+
table: {
|
|
193
|
+
selectAllRows: string;
|
|
194
|
+
selectRow: string;
|
|
195
|
+
sortedBy: string;
|
|
196
|
+
sortAscending: string;
|
|
197
|
+
sortDescending: string;
|
|
198
|
+
sortCleared: string;
|
|
199
|
+
selectedCount: string;
|
|
200
|
+
page: string;
|
|
201
|
+
resultCount: string;
|
|
202
|
+
};
|
|
203
|
+
state: {
|
|
204
|
+
loading: string;
|
|
205
|
+
success: string;
|
|
206
|
+
warning: string;
|
|
207
|
+
error: string;
|
|
208
|
+
cancelled: string;
|
|
209
|
+
};
|
|
210
|
+
}, "_">;
|
|
211
|
+
/**
|
|
212
|
+
* Total number of items to paginate.
|
|
213
|
+
*/
|
|
214
|
+
readonly totalItems: _angular_core.InputSignal<number>;
|
|
215
|
+
/**
|
|
216
|
+
* Number of items per page. If not set, the first value from {@link possiblePageSizes} is used.
|
|
217
|
+
*/
|
|
218
|
+
readonly pageSize: _angular_core.ModelSignal<number | undefined>;
|
|
219
|
+
/**
|
|
220
|
+
* Possible page sizes to choose from.
|
|
221
|
+
* @default [5, 10, 25, 50]
|
|
222
|
+
*/
|
|
223
|
+
readonly possiblePageSizes: _angular_core.InputSignalWithTransform<number[], number[]>;
|
|
224
|
+
/**
|
|
225
|
+
* If set to `true`, the page size selector will be hidden and the page size cannot be changed by the user.
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
228
|
+
readonly fixedPageSize: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
229
|
+
protected readonly appliedPageSize: _angular_core.Signal<number>;
|
|
230
|
+
protected readonly pageCount: _angular_core.Signal<number>;
|
|
231
|
+
protected readonly pages: _angular_core.Signal<{
|
|
232
|
+
page: number;
|
|
233
|
+
}[]>;
|
|
234
|
+
protected readonly pageSizeOptions: _angular_core.Signal<NgnItem[]>;
|
|
235
|
+
/**
|
|
236
|
+
* Emits the current pagination state whenever the page or page size changes.
|
|
237
|
+
*/
|
|
238
|
+
readonly value: _angular_core.OutputEmitterRef<PaginationState>;
|
|
239
|
+
/**
|
|
240
|
+
* Current page index (zero-based).
|
|
241
|
+
* @default 0
|
|
242
|
+
*/
|
|
243
|
+
readonly page: _angular_core.ModelSignal<number>;
|
|
244
|
+
constructor();
|
|
245
|
+
protected previousPage(event: PointerEvent): void;
|
|
246
|
+
protected nextPage(event: PointerEvent): void;
|
|
247
|
+
protected getButtonFontStyles(page: number): {
|
|
248
|
+
[klass: string]: string;
|
|
249
|
+
};
|
|
250
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnPaginator, never>;
|
|
251
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnPaginator, "ngn-paginator", never, { "totalItems": { "alias": "totalItems"; "required": true; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "possiblePageSizes": { "alias": "possiblePageSizes"; "required": false; "isSignal": true; }; "fixedPageSize": { "alias": "fixedPageSize"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; }, { "pageSize": "pageSizeChange"; "value": "value"; "page": "pageChange"; }, never, never, true, never>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export { NgnPaginator };
|
|
255
|
+
export type { PaginationState };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as _floating_ui_dom from '@floating-ui/dom';
|
|
2
|
+
import { Placement } from '@floating-ui/dom';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
import { TemplateRef, ElementRef } from '@angular/core';
|
|
5
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
6
|
+
import { PositioningSizeConstraints, Openable, Anchor, PopoverCloseBy } from '@ngneers/controls/api/ng';
|
|
7
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
8
|
+
import { NgnBase } from '@ngneers/controls/base';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Template projection for {@link NgnPopover}, extracted into a dedicated base class so the
|
|
12
|
+
* component itself stays focused on positioning and open/close behavior.
|
|
13
|
+
*/
|
|
14
|
+
declare abstract class PopoverTemplates extends NgnBase<'popover'> {
|
|
15
|
+
/**
|
|
16
|
+
* User-provided lazy content, projected via an `<ng-template #lazy>` inside the popover.
|
|
17
|
+
* Rendered only once the popover first opens.
|
|
18
|
+
*/
|
|
19
|
+
protected readonly lazyContent: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
20
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PopoverTemplates, never>;
|
|
21
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<PopoverTemplates, never, never, {}, {}, ["lazyContent"], never, true, never>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type PopoverOptions = {
|
|
25
|
+
/**
|
|
26
|
+
* Constraints for the size of the popover.
|
|
27
|
+
*/
|
|
28
|
+
sizeConstraints?: PositioningSizeConstraints;
|
|
29
|
+
/**
|
|
30
|
+
* If true, the content of the popover will be cached and not recreated on each open.
|
|
31
|
+
* This is useful for performance when the content is expensive to create.
|
|
32
|
+
*/
|
|
33
|
+
cache?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The placement of the popover relative to the anchor element.
|
|
36
|
+
*/
|
|
37
|
+
placement?: Placement;
|
|
38
|
+
/**
|
|
39
|
+
* The padding of the popover content.
|
|
40
|
+
*/
|
|
41
|
+
padding?: number;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @category control
|
|
46
|
+
*/
|
|
47
|
+
declare class NgnPopover extends PopoverTemplates implements Openable {
|
|
48
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"popover", ["root", "content", "content-closing"], readonly []>>;
|
|
49
|
+
/**
|
|
50
|
+
* Emits when the popover has fully closed.
|
|
51
|
+
*/
|
|
52
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Emits when the popover is closed.
|
|
55
|
+
*/
|
|
56
|
+
readonly closing: _angular_core.OutputEmitterRef<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Shows or hides the popover.
|
|
59
|
+
*
|
|
60
|
+
* You probably want to react to openChange events from outside to update your variable accordingly.
|
|
61
|
+
*/
|
|
62
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* The element to which the popover is anchored.
|
|
65
|
+
*/
|
|
66
|
+
readonly anchor: _angular_core.InputSignal<Anchor>;
|
|
67
|
+
/**
|
|
68
|
+
* The popover options.
|
|
69
|
+
*/
|
|
70
|
+
readonly options: _angular_core.InputSignal<PopoverOptions | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Set to true for scrollable/shrink-able content
|
|
73
|
+
*/
|
|
74
|
+
readonly hasShrinkableContent: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* How the popover closes depending on user interaction.
|
|
77
|
+
* @default any
|
|
78
|
+
*/
|
|
79
|
+
readonly closeBy: _angular_core.InputSignal<PopoverCloseBy>;
|
|
80
|
+
protected readonly _content: _angular_core.Signal<ElementRef<HTMLElement>>;
|
|
81
|
+
protected readonly closeByPopover: _angular_core.Signal<"auto" | "manual">;
|
|
82
|
+
protected readonly isFullyClosed: _angular_core.WritableSignal<boolean>;
|
|
83
|
+
private _skipEmitCloseEvent;
|
|
84
|
+
private _triggeredByInput;
|
|
85
|
+
private _internalToggle;
|
|
86
|
+
protected readonly appliedOptions: _angular_core.Signal<{
|
|
87
|
+
sizeConstraints?: _ngneers_controls_api_ng.PositioningSizeConstraints;
|
|
88
|
+
cache: boolean;
|
|
89
|
+
placement?: _floating_ui_dom.Placement;
|
|
90
|
+
padding?: number;
|
|
91
|
+
}>;
|
|
92
|
+
private readonly _injector;
|
|
93
|
+
private readonly _cdr;
|
|
94
|
+
private readonly _popoverRef;
|
|
95
|
+
private readonly _popover;
|
|
96
|
+
private readonly _autoPos;
|
|
97
|
+
constructor();
|
|
98
|
+
/**
|
|
99
|
+
* Opens the popover. Alternatively, you can also set the {@link open} input to `true`.
|
|
100
|
+
*/
|
|
101
|
+
show(): void;
|
|
102
|
+
/**
|
|
103
|
+
* Closes the popover. Alternatively, you can also set the {@link open} input to `false`.
|
|
104
|
+
*/
|
|
105
|
+
hide(emitCloseEvent?: boolean): void;
|
|
106
|
+
/**
|
|
107
|
+
* Toggles the popover open or closed. Alternatively, you can also set the {@link open} input accordingly.
|
|
108
|
+
*/
|
|
109
|
+
toggle(): void;
|
|
110
|
+
protected onToggle(event: Event): void;
|
|
111
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnPopover, never>;
|
|
112
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnPopover, "ngn-popover", never, { "open": { "alias": "open"; "required": false; "isSignal": true; }; "anchor": { "alias": "anchor"; "required": true; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "hasShrinkableContent": { "alias": "hasShrinkableContent"; "required": false; "isSignal": true; }; "closeBy": { "alias": "closeBy"; "required": false; "isSignal": true; }; }, { "closed": "closed"; "closing": "closing"; "open": "openChange"; }, never, ["*"], true, never>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { NgnPopover };
|
|
116
|
+
export type { PopoverOptions };
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { NgnBase } from '@ngneers/controls/base';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category control
|
|
8
|
+
*/
|
|
9
|
+
declare class NgnProgress extends NgnBase<'progress'> {
|
|
10
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"progress", ["root", "svg", "track", "indeterminate", "circular", "fill", "fill2"], readonly []>>;
|
|
11
|
+
/**
|
|
12
|
+
* The current progress value, clamped to the 0-100 range.
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
readonly value: _angular_core.InputSignal<number>;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the progress indicator is indeterminate (animated, no fixed value).
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
readonly indeterminate: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the progress indicator renders as a circle instead of a bar.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
readonly circular: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
26
|
+
/**
|
|
27
|
+
* Radius of the circular progress indicator, in px. Only applies when {@link circular} is `true`.
|
|
28
|
+
* @default 40
|
|
29
|
+
*/
|
|
30
|
+
readonly radius: _angular_core.InputSignal<number>;
|
|
31
|
+
/**
|
|
32
|
+
* Thickness of the circular progress indicator stroke, in px. Only applies when {@link circular} is `true`.
|
|
33
|
+
* @default 8
|
|
34
|
+
*/
|
|
35
|
+
readonly thickness: _angular_core.InputSignal<number>;
|
|
36
|
+
protected readonly safeValue: _angular_core.Signal<number>;
|
|
37
|
+
protected readonly safeRadius: _angular_core.Signal<number>;
|
|
38
|
+
protected readonly safeThickness: _angular_core.Signal<number>;
|
|
39
|
+
protected readonly svgSize: _angular_core.Signal<number>;
|
|
40
|
+
protected readonly svgCenter: _angular_core.Signal<number>;
|
|
41
|
+
protected readonly circumference: _angular_core.Signal<number>;
|
|
42
|
+
protected readonly strokeDasharray: _angular_core.Signal<string>;
|
|
43
|
+
protected readonly strokeDashoffset: _angular_core.Signal<string>;
|
|
44
|
+
constructor();
|
|
45
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnProgress, never>;
|
|
46
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnProgress, "ngn-progress", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "circular": { "alias": "circular"; "required": false; "isSignal": true; }; "radius": { "alias": "radius"; "required": false; "isSignal": true; }; "thickness": { "alias": "thickness"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { NgnProgress };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as _ngneers_controls_api_ng from '@ngneers/controls/api/ng';
|
|
2
|
+
import * as _ngneers_controls_themes from '@ngneers/controls-themes';
|
|
3
|
+
import { ValueControlBase, NgnBase } from '@ngneers/controls/base';
|
|
4
|
+
import * as i1 from '@ngneers/controls/roving-focus';
|
|
5
|
+
import { NgnRovingGroup } from '@ngneers/controls/roving-focus';
|
|
6
|
+
import * as _angular_core from '@angular/core';
|
|
7
|
+
import { InjectionToken, Signal } from '@angular/core';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A single radio option registered with its enclosing group. The group keys
|
|
11
|
+
* selection and keyboard coordination off these refs; `element` correlates a
|
|
12
|
+
* roving-focus item back to its payload `value`.
|
|
13
|
+
*/
|
|
14
|
+
interface NgnRadioRef<V> {
|
|
15
|
+
readonly element: HTMLElement;
|
|
16
|
+
/** The option payload this radio contributes to the group value. */
|
|
17
|
+
readonly value: Signal<V>;
|
|
18
|
+
/** Effective disabled state (own disabled OR the group being disabled). */
|
|
19
|
+
readonly disabled: Signal<boolean>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The slice of the radio group that child `ngn-radio`s consume. Kept as a
|
|
23
|
+
* token + interface (rather than the concrete class) so the child never imports
|
|
24
|
+
* the group component — avoiding a circular dependency between the two files.
|
|
25
|
+
*/
|
|
26
|
+
interface NgnRadioGroupApi<V> {
|
|
27
|
+
/** The currently selected group value. */
|
|
28
|
+
readonly value: Signal<V>;
|
|
29
|
+
/** Whether the whole group is disabled. */
|
|
30
|
+
readonly disabled: Signal<boolean>;
|
|
31
|
+
/** Whether the group is read-only (navigable, but selection is frozen). */
|
|
32
|
+
readonly readonly: Signal<boolean>;
|
|
33
|
+
register(ref: NgnRadioRef<V>): void;
|
|
34
|
+
unregister(ref: NgnRadioRef<V>): void;
|
|
35
|
+
}
|
|
36
|
+
declare const NGN_RADIO_GROUP: InjectionToken<NgnRadioGroupApi<unknown>>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A themed radio group. Owns the selected {@link value}; the individual
|
|
40
|
+
* `ngn-radio` children projected inside are presentational and report their
|
|
41
|
+
* payload up through {@link register}.
|
|
42
|
+
*
|
|
43
|
+
* Keyboard handling and roving tab order are delegated to `NgnRovingGroup`
|
|
44
|
+
* (applied as a host directive). Selection follows focus: moving the roving
|
|
45
|
+
* active item (arrows / Home / End / pointer) selects it, matching native
|
|
46
|
+
* radio-group behavior.
|
|
47
|
+
*
|
|
48
|
+
* @category control
|
|
49
|
+
*/
|
|
50
|
+
declare class NgnRadioGroup<V> extends ValueControlBase<'radioGroup', V> implements NgnRadioGroupApi<V> {
|
|
51
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"radio-group", ["root", "invalid"], readonly []>>;
|
|
52
|
+
/** The roving-focus host directive that drives keyboard/tab coordination. */
|
|
53
|
+
protected readonly roving: NgnRovingGroup;
|
|
54
|
+
private readonly _radios;
|
|
55
|
+
register(ref: NgnRadioRef<V>): void;
|
|
56
|
+
unregister(ref: NgnRadioRef<V>): void;
|
|
57
|
+
constructor();
|
|
58
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnRadioGroup<any>, never>;
|
|
59
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnRadioGroup<any>, "ngn-radio-group", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.NgnRovingGroup; inputs: { "orientation": "orientation"; "rovingWrap": "rovingWrap"; }; outputs: {}; }]>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A single radio option. Must be projected inside an `ngn-radio-group`, which
|
|
64
|
+
* owns the selected value — this control only contributes its {@link value}
|
|
65
|
+
* payload and renders the themed dot. The label is authored via content
|
|
66
|
+
* projection (`<ngn-radio [value]="…">Label</ngn-radio>`) with an optional
|
|
67
|
+
* {@link label} input fallback.
|
|
68
|
+
*
|
|
69
|
+
* @category control
|
|
70
|
+
*/
|
|
71
|
+
declare class NgnRadio<V> extends NgnBase<'radio'> {
|
|
72
|
+
protected readonly theme: _ngneers_controls_api_ng.ControlTemplateInfo<_ngneers_controls_themes.ControlTemplate<"radio", ["root", "circle", "circle-checked", "dot", "label"], readonly []>>;
|
|
73
|
+
/** The payload this radio selects into the enclosing group. */
|
|
74
|
+
readonly value: _angular_core.InputSignal<V>;
|
|
75
|
+
/** Disables this individual option. */
|
|
76
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
77
|
+
/** Optional accessible label; overrides projected content for the a11y name. */
|
|
78
|
+
readonly label: _angular_core.InputSignal<string | null>;
|
|
79
|
+
private readonly _group;
|
|
80
|
+
private readonly _rovingItem;
|
|
81
|
+
/** Whether this radio is the currently selected option in its group. */
|
|
82
|
+
protected readonly checked: _angular_core.Signal<boolean>;
|
|
83
|
+
/** Disabled if this option or the whole group is disabled. */
|
|
84
|
+
protected readonly effectiveDisabled: _angular_core.Signal<boolean>;
|
|
85
|
+
constructor();
|
|
86
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgnRadio<any>, never>;
|
|
87
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgnRadio<any>, "ngn-radio", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.NgnRovingItem; inputs: {}; outputs: {}; }]>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { NGN_RADIO_GROUP, NgnRadio, NgnRadioGroup };
|
|
91
|
+
export type { NgnRadioGroupApi, NgnRadioRef };
|