ng-hub-ui-forms 21.0.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/README.md +252 -0
- package/fesm2022/ng-hub-ui-forms-signals.mjs +93 -0
- package/fesm2022/ng-hub-ui-forms-signals.mjs.map +1 -0
- package/fesm2022/ng-hub-ui-forms.mjs +5882 -0
- package/fesm2022/ng-hub-ui-forms.mjs.map +1 -0
- package/ng-hub-ui-forms-21.0.0.tgz +0 -0
- package/package.json +58 -0
- package/signals/README.md +63 -0
- package/src/lib/styles/_field.scss +132 -0
- package/src/lib/styles/_tokens.scss +179 -0
- package/src/lib/styles/index.scss +13 -0
- package/types/ng-hub-ui-forms-signals.d.ts +65 -0
- package/types/ng-hub-ui-forms.d.ts +1463 -0
|
@@ -0,0 +1,1463 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnInit, AfterContentInit, OnDestroy, TemplateRef, ElementRef, InjectionToken, EnvironmentProviders, PipeTransform, NgZone } from '@angular/core';
|
|
3
|
+
import { NgControl, ControlContainer, ControlValueAccessor, ValidationErrors, AbstractControl, ValidatorFn } from '@angular/forms';
|
|
4
|
+
import { Subject, OperatorFunction } from 'rxjs';
|
|
5
|
+
import * as ng_hub_ui_forms from 'ng-hub-ui-forms';
|
|
6
|
+
import { SafeUrl } from '@angular/platform-browser';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Base class for every form field in `ng-hub-ui-forms`.
|
|
10
|
+
*
|
|
11
|
+
* Provides the shared `ControlValueAccessor`-adjacent plumbing used by the field components:
|
|
12
|
+
* reactive `required` tracking derived from the bound control's validators, programmatic
|
|
13
|
+
* show/hide/toggle helpers exposed on the underlying `AbstractControl`, and lifecycle wiring.
|
|
14
|
+
*
|
|
15
|
+
* Subclasses must provide the injected `NgControl` and `ControlContainer` instances.
|
|
16
|
+
*/
|
|
17
|
+
declare abstract class HubFormControl implements OnInit, AfterContentInit, OnDestroy {
|
|
18
|
+
/**
|
|
19
|
+
* Name of the form control when used within a form group/array.
|
|
20
|
+
*/
|
|
21
|
+
readonly formControlName: _angular_core.InputSignal<string | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the control is required. Derived from the bound control's validators when reactive.
|
|
24
|
+
*/
|
|
25
|
+
readonly required: _angular_core.ModelSignal<boolean | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the control is hidden.
|
|
28
|
+
*/
|
|
29
|
+
hidden: boolean;
|
|
30
|
+
protected _destroy$: Subject<unknown>;
|
|
31
|
+
protected _isFormControl: boolean;
|
|
32
|
+
protected abstract _control: NgControl;
|
|
33
|
+
protected abstract _controlContainer: ControlContainer;
|
|
34
|
+
/**
|
|
35
|
+
* Shows the control.
|
|
36
|
+
*/
|
|
37
|
+
show: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Hides the control.
|
|
40
|
+
*/
|
|
41
|
+
hide: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Toggles the control visibility.
|
|
44
|
+
*/
|
|
45
|
+
toggle: () => void;
|
|
46
|
+
ngOnInit(): void;
|
|
47
|
+
ngAfterContentInit(): void;
|
|
48
|
+
ngOnDestroy(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Attaches `show`, `hide` and `toggle` helpers to the underlying form control object.
|
|
51
|
+
*
|
|
52
|
+
* Best-effort: if the control cannot be resolved (e.g. the container is not yet initialized),
|
|
53
|
+
* the helpers are simply not attached. This never throws — a missing convenience must not break
|
|
54
|
+
* rendering.
|
|
55
|
+
*/
|
|
56
|
+
protected setShowAndHideFunctions(): void;
|
|
57
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubFormControl, never>;
|
|
58
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubFormControl, never, never, { "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, { "required": "requiredChange"; }, never, never, true, never>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Marks a template as the validation error message for a specific error key.
|
|
63
|
+
*
|
|
64
|
+
* Used by form fields and form containers to override the default message rendered
|
|
65
|
+
* for a given validation error (e.g. `required`, `min`, `equal`).
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```html
|
|
69
|
+
* <hub-input formControlName="age">
|
|
70
|
+
* <ng-template hubValidationError key="min">Must be at least 18.</ng-template>
|
|
71
|
+
* </hub-input>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare class HubValidationErrorDirective {
|
|
75
|
+
/** Unique key for the validation error (e.g. `'required'`, `'min'`). */
|
|
76
|
+
readonly key: _angular_core.InputSignal<string>;
|
|
77
|
+
/** Template reference for the error message. */
|
|
78
|
+
readonly template: TemplateRef<any>;
|
|
79
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubValidationErrorDirective, never>;
|
|
80
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubValidationErrorDirective, "[hubValidationError]", never, { "key": { "alias": "key"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Shared base for single-value form fields (input, textarea, slider, select…).
|
|
85
|
+
*
|
|
86
|
+
* Extends {@link HubFormControl} with the `ControlValueAccessor` plumbing and the automatic
|
|
87
|
+
* validation-error display that every field shares:
|
|
88
|
+
*
|
|
89
|
+
* - Injects the bound `NgControl` / `ControlContainer` and registers itself as value accessor.
|
|
90
|
+
* - Exposes `isInvalid` / `errors`, resolving from the reactive control or from native validity.
|
|
91
|
+
* - Collects projected `hubValidationError` templates and resolves messages through the per-field
|
|
92
|
+
* override, the global {@link provideHubForms} config, or the built-in defaults.
|
|
93
|
+
* - Keeps the (OnPush) view in sync with the control via `control.events` + `markForCheck`.
|
|
94
|
+
*
|
|
95
|
+
* Subclasses only implement the value-specific bits: the `_value` signal, `writeValue`, the change
|
|
96
|
+
* handler and their own template/inputs.
|
|
97
|
+
*/
|
|
98
|
+
declare abstract class HubFieldControl extends HubFormControl implements ControlValueAccessor, AfterContentInit {
|
|
99
|
+
#private;
|
|
100
|
+
protected readonly _elementRef: ElementRef<any>;
|
|
101
|
+
protected readonly _control: NgControl;
|
|
102
|
+
protected readonly _controlContainer: ControlContainer;
|
|
103
|
+
/** Resolved templates that override the default message of a given error key. */
|
|
104
|
+
protected _errorTemplates: {
|
|
105
|
+
[key: string]: TemplateRef<any>;
|
|
106
|
+
};
|
|
107
|
+
/** Stable unique id linking the label and the control. */
|
|
108
|
+
readonly id: string;
|
|
109
|
+
/** Query for a projected `hubFormText` helper template. */
|
|
110
|
+
readonly formTextTmp: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
111
|
+
/** Query for projected `hubValidationError` templates. */
|
|
112
|
+
readonly errorTpts: _angular_core.Signal<readonly HubValidationErrorDirective[]>;
|
|
113
|
+
/** Whether the field is disabled. */
|
|
114
|
+
readonly disabled: _angular_core.ModelSignal<boolean>;
|
|
115
|
+
/** Per-field override for the invalid-feedback message builder. */
|
|
116
|
+
readonly invalidFeedbackTemplateFn: _angular_core.InputSignal<((key: string, value: any) => string) | null>;
|
|
117
|
+
onChange: (value: any) => void;
|
|
118
|
+
onTouched: () => void;
|
|
119
|
+
protected readonly _nativeErrors: _angular_core.WritableSignal<ValidationErrors | null>;
|
|
120
|
+
protected readonly _nativeTouched: _angular_core.WritableSignal<boolean>;
|
|
121
|
+
constructor();
|
|
122
|
+
/** Whether the field should display its error feedback (touched + invalid). */
|
|
123
|
+
get isInvalid(): boolean;
|
|
124
|
+
/** Current validation errors, from the reactive control or from native validity. */
|
|
125
|
+
get errors(): ValidationErrors | null;
|
|
126
|
+
ngAfterContentInit(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Marks the field as touched when focus leaves it.
|
|
129
|
+
*
|
|
130
|
+
* @param event - The originating focus event.
|
|
131
|
+
*/
|
|
132
|
+
handleBlur(event?: FocusEvent): void;
|
|
133
|
+
registerOnChange(fn: (value: any) => void): void;
|
|
134
|
+
registerOnTouched(fn: () => void): void;
|
|
135
|
+
setDisabledState(isDisabled: boolean): void;
|
|
136
|
+
/**
|
|
137
|
+
* Resolves the message for a given validation error, honoring per-field and global overrides.
|
|
138
|
+
*
|
|
139
|
+
* @param key - The validation error key.
|
|
140
|
+
* @param value - The error payload.
|
|
141
|
+
* @returns The resolved message (HTML allowed).
|
|
142
|
+
*/
|
|
143
|
+
getInvalidFeedbackTemplate(key: string, value: any): string;
|
|
144
|
+
abstract writeValue(value: any): void;
|
|
145
|
+
/**
|
|
146
|
+
* Derives native validation errors when the field is used without a reactive control.
|
|
147
|
+
*
|
|
148
|
+
* @param target - The DOM element to read validity from, if available.
|
|
149
|
+
*/
|
|
150
|
+
protected updateNativeErrors(target?: EventTarget | null): void;
|
|
151
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubFieldControl, never>;
|
|
152
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubFieldControl, never, never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalidFeedbackTemplateFn": { "alias": "invalidFeedbackTemplateFn"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, ["formTextTmp", "errorTpts"], never, true, never>;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** When a container reveals its group-level validation errors. */
|
|
156
|
+
type HubGroupErrorTrigger = 'touched' | 'submit' | 'always';
|
|
157
|
+
/**
|
|
158
|
+
* Shared base for form *containers* (`hub-form`, `hub-fieldset`, `hub-legend`).
|
|
159
|
+
*
|
|
160
|
+
* Resolves a target `FormGroup`/`FormArray` — provided explicitly via the `group` input or by name
|
|
161
|
+
* from the parent `ControlContainer` — and automatically surfaces its **group-level** validation
|
|
162
|
+
* errors (those set on the group itself by cross-field validators such as `hubAreEqual`), the same
|
|
163
|
+
* way the field components surface control-level errors.
|
|
164
|
+
*
|
|
165
|
+
* It intentionally ignores child-control errors: those are rendered by the individual fields.
|
|
166
|
+
*/
|
|
167
|
+
declare abstract class HubGroupControl implements AfterContentInit, OnDestroy {
|
|
168
|
+
#private;
|
|
169
|
+
protected readonly _config: ng_hub_ui_forms.HubFormsConfig;
|
|
170
|
+
private readonly _parent;
|
|
171
|
+
private readonly _self;
|
|
172
|
+
protected _destroy$: Subject<void>;
|
|
173
|
+
/** Explicit target group/array. Takes precedence over name resolution. */
|
|
174
|
+
readonly group: _angular_core.InputSignal<AbstractControl<any, any, any> | null>;
|
|
175
|
+
/** Name of the target group/array within the parent container (alternative to `group`). */
|
|
176
|
+
readonly groupName: _angular_core.InputSignal<string | undefined>;
|
|
177
|
+
/** When to reveal the group-level errors. `touched` (default) or `always`. */
|
|
178
|
+
readonly errorTrigger: _angular_core.InputSignal<HubGroupErrorTrigger>;
|
|
179
|
+
/** Per-container override for the invalid-feedback message builder. */
|
|
180
|
+
readonly invalidFeedbackTemplateFn: _angular_core.InputSignal<((key: string, value: any) => string) | null>;
|
|
181
|
+
/** Query for projected `hubValidationError` templates. */
|
|
182
|
+
readonly errorTpts: _angular_core.Signal<readonly HubValidationErrorDirective[]>;
|
|
183
|
+
protected _errorTemplates: {
|
|
184
|
+
[key: string]: TemplateRef<any>;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* The currently bound group control. A `computed` (not an `effect`-fed signal) so it resolves
|
|
188
|
+
* synchronously on first render — otherwise a `<form [formGroup]>` would briefly bind `null` and
|
|
189
|
+
* the projected `formControlName` fields would fail to locate their controls.
|
|
190
|
+
*/
|
|
191
|
+
protected readonly _control: _angular_core.Signal<AbstractControl<any, any, any> | null>;
|
|
192
|
+
/** Whether the owning form has been submitted (set by `hub-form`; drives the `submit` trigger). */
|
|
193
|
+
protected readonly _submitted: _angular_core.WritableSignal<boolean>;
|
|
194
|
+
constructor();
|
|
195
|
+
/** Whether the group's own (cross-field) errors should be displayed. */
|
|
196
|
+
get isInvalid(): boolean;
|
|
197
|
+
/** The group's own validation errors (excludes child-control errors). */
|
|
198
|
+
get errors(): ValidationErrors | null;
|
|
199
|
+
ngAfterContentInit(): void;
|
|
200
|
+
ngOnDestroy(): void;
|
|
201
|
+
/**
|
|
202
|
+
* Resolves the message for a given group-level validation error.
|
|
203
|
+
*
|
|
204
|
+
* @param key - The validation error key.
|
|
205
|
+
* @param value - The error payload.
|
|
206
|
+
* @returns The resolved message (HTML allowed).
|
|
207
|
+
*/
|
|
208
|
+
getInvalidFeedbackTemplate(key: string, value: any): string;
|
|
209
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubGroupControl, never>;
|
|
210
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubGroupControl, never, never, { "group": { "alias": "group"; "required": false; "isSignal": true; }; "groupName": { "alias": "groupName"; "required": false; "isSignal": true; }; "errorTrigger": { "alias": "errorTrigger"; "required": false; "isSignal": true; }; "invalidFeedbackTemplateFn": { "alias": "invalidFeedbackTemplateFn"; "required": false; "isSignal": true; }; }, {}, ["errorTpts"], never, true, never>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Default, human-readable messages for the most common Angular validation errors.
|
|
215
|
+
*
|
|
216
|
+
* Consumers can override this per field (via the `invalidFeedbackTemplateFn` input) or globally
|
|
217
|
+
* (via {@link provideHubForms}). The function receives the error `key` and its `value` (the payload
|
|
218
|
+
* Angular stores for that error) and returns the message string (HTML allowed).
|
|
219
|
+
*
|
|
220
|
+
* @param key - The validation error key (e.g. `required`, `min`, `minlength`, `equal`).
|
|
221
|
+
* @param value - The error payload as stored on the control's `errors` object.
|
|
222
|
+
* @returns A localized-by-default English message describing the error.
|
|
223
|
+
*/
|
|
224
|
+
declare function defaultInvalidFeedback(key: string, value: any): string;
|
|
225
|
+
|
|
226
|
+
/** Selection mode for `<hub-datepicker>`. */
|
|
227
|
+
type HubDatepickerMode = 'single' | 'range';
|
|
228
|
+
/** A selected date range (ISO `YYYY-MM-DD` strings, or `null` while incomplete). */
|
|
229
|
+
interface HubDateRange {
|
|
230
|
+
start: string | null;
|
|
231
|
+
end: string | null;
|
|
232
|
+
}
|
|
233
|
+
/** The CVA value of `<hub-datepicker>`: an ISO string in `single` mode, a range in `range` mode. */
|
|
234
|
+
type HubDateValue = string | HubDateRange | null;
|
|
235
|
+
/**
|
|
236
|
+
* Localizable, overridable labels for the datepicker (button text + accessibility names).
|
|
237
|
+
* Month and weekday names come from the `Intl` API and need no translation.
|
|
238
|
+
*/
|
|
239
|
+
interface HubDatepickerLabels {
|
|
240
|
+
/** Aria label for the calendar trigger button. */
|
|
241
|
+
openCalendar: string;
|
|
242
|
+
/** Aria label for the previous-month button. */
|
|
243
|
+
previousMonth: string;
|
|
244
|
+
/** Aria label for the next-month button. */
|
|
245
|
+
nextMonth: string;
|
|
246
|
+
/** Aria label for the previous-year button. */
|
|
247
|
+
previousYear: string;
|
|
248
|
+
/** Aria label for the next-year button. */
|
|
249
|
+
nextYear: string;
|
|
250
|
+
/** Text + aria label for the "today" shortcut button. */
|
|
251
|
+
today: string;
|
|
252
|
+
/** Text + aria label for the "clear" button. */
|
|
253
|
+
clear: string;
|
|
254
|
+
}
|
|
255
|
+
/** Global datepicker defaults, set via {@link provideHubForms}. */
|
|
256
|
+
interface HubDatepickerConfig {
|
|
257
|
+
/** First weekday (0 = Sunday, 1 = Monday…). */
|
|
258
|
+
firstDayOfWeek: number;
|
|
259
|
+
/** Weekday header width. */
|
|
260
|
+
weekdayFormat: 'short' | 'narrow' | 'long';
|
|
261
|
+
/** `Intl` options used to format the displayed value. */
|
|
262
|
+
displayFormat: Intl.DateTimeFormatOptions;
|
|
263
|
+
/** Separator between the two dates of a range in the input display. */
|
|
264
|
+
rangeSeparator: string;
|
|
265
|
+
/** Localizable labels. */
|
|
266
|
+
labels: HubDatepickerLabels;
|
|
267
|
+
}
|
|
268
|
+
/** Built-in (English) datepicker labels. */
|
|
269
|
+
declare const defaultHubDatepickerLabels: HubDatepickerLabels;
|
|
270
|
+
/** Built-in datepicker defaults. */
|
|
271
|
+
declare const defaultHubDatepickerConfig: HubDatepickerConfig;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Global configuration contract for `ng-hub-ui-forms`.
|
|
275
|
+
*/
|
|
276
|
+
interface HubFormsConfig {
|
|
277
|
+
/**
|
|
278
|
+
* Builds the message shown for a given validation error.
|
|
279
|
+
*
|
|
280
|
+
* @param key - The validation error key (e.g. `required`, `min`).
|
|
281
|
+
* @param value - The error payload stored on the control.
|
|
282
|
+
* @returns The message string (HTML allowed).
|
|
283
|
+
*/
|
|
284
|
+
invalidFeedbackTemplateFn: (key: string, value: any) => string;
|
|
285
|
+
/** Global datepicker defaults (locale labels, formats, first day of week…). */
|
|
286
|
+
datepicker: HubDatepickerConfig;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Default configuration used when {@link provideHubForms} is not called.
|
|
290
|
+
*/
|
|
291
|
+
declare const defaultHubFormsConfig: HubFormsConfig;
|
|
292
|
+
/**
|
|
293
|
+
* Injection token holding the resolved {@link HubFormsConfig}.
|
|
294
|
+
*
|
|
295
|
+
* Falls back to {@link defaultHubFormsConfig} when no provider is registered, so the library works
|
|
296
|
+
* out of the box without bootstrapping.
|
|
297
|
+
*/
|
|
298
|
+
declare const HUB_FORMS_CONFIG: InjectionToken<HubFormsConfig>;
|
|
299
|
+
/**
|
|
300
|
+
* Registers a global configuration for `ng-hub-ui-forms`.
|
|
301
|
+
*
|
|
302
|
+
* @param config - Partial configuration; unspecified fields keep their defaults.
|
|
303
|
+
* @returns Environment providers to add to `bootstrapApplication` (or a route's providers).
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```ts
|
|
307
|
+
* bootstrapApplication(App, {
|
|
308
|
+
* providers: [
|
|
309
|
+
* provideHubForms({
|
|
310
|
+
* invalidFeedbackTemplateFn: (key) => myI18n.translate(`errors.${key}`)
|
|
311
|
+
* })
|
|
312
|
+
* ]
|
|
313
|
+
* });
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
declare function provideHubForms(config?: DeepPartial<HubFormsConfig>): EnvironmentProviders;
|
|
317
|
+
/** Recursively-optional version of a type, for partial config overrides. */
|
|
318
|
+
type DeepPartial<T> = {
|
|
319
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Possible display types for form helper text.
|
|
324
|
+
*/
|
|
325
|
+
type FormTextType = 'bottom' | 'tooltip';
|
|
326
|
+
/**
|
|
327
|
+
* Enum for form helper text display types.
|
|
328
|
+
*/
|
|
329
|
+
declare enum FormTextTypes {
|
|
330
|
+
Bottom = "bottom",
|
|
331
|
+
Tooltip = "tooltip"
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Possible label display types shared by the form field components.
|
|
335
|
+
*/
|
|
336
|
+
type HubLabelType = 'floating' | 'stacked' | 'horizontal';
|
|
337
|
+
/**
|
|
338
|
+
* Enum for label display types.
|
|
339
|
+
*/
|
|
340
|
+
declare enum HubLabelTypes {
|
|
341
|
+
Floating = "floating",
|
|
342
|
+
Stacked = "stacked",
|
|
343
|
+
Horizontal = "horizontal"
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Supported formats (native input types) for the `<hub-input>` component.
|
|
348
|
+
*/
|
|
349
|
+
type HubInputFormat = 'text' | 'number' | 'password' | 'email' | 'tel' | 'url' | 'color' | 'checkbox' | 'switch' | 'counter' | 'file';
|
|
350
|
+
/**
|
|
351
|
+
* Enum mirror of {@link HubInputFormat} for ergonomic template usage.
|
|
352
|
+
*/
|
|
353
|
+
declare enum HubInputFormats {
|
|
354
|
+
Text = "text",
|
|
355
|
+
Number = "number",
|
|
356
|
+
Password = "password",
|
|
357
|
+
Email = "email",
|
|
358
|
+
Tel = "tel",
|
|
359
|
+
Url = "url",
|
|
360
|
+
Color = "color",
|
|
361
|
+
Checkbox = "checkbox",
|
|
362
|
+
Switch = "switch",
|
|
363
|
+
Counter = "counter",
|
|
364
|
+
File = "file"
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/** Value held by a `<hub-input>` across its supported formats. */
|
|
368
|
+
type HubInputValue = number | string | boolean | File | FileList | null;
|
|
369
|
+
/**
|
|
370
|
+
* Accessible form field with automatic validation-error display.
|
|
371
|
+
*
|
|
372
|
+
* Works both with Reactive Forms (`formControlName` / `[formControl]`) and as a standalone
|
|
373
|
+
* value-bound control. When invalid and touched, it renders the control's errors using the
|
|
374
|
+
* default messages, the global {@link provideHubForms} config, the per-field
|
|
375
|
+
* `invalidFeedbackTemplateFn` input, or projected `hubValidationError` templates.
|
|
376
|
+
*
|
|
377
|
+
* Formats: `text`, `number`, `password`, `email`, `tel`, `url`, `color`, `checkbox`, `switch`,
|
|
378
|
+
* `counter`. Label types: `stacked`, `floating`, `horizontal`. Text-like formats support prepend /
|
|
379
|
+
* append addons (input groups). Numeric formats auto-attach `min`/`max` validators when bound to a
|
|
380
|
+
* reactive control.
|
|
381
|
+
*
|
|
382
|
+
* @example
|
|
383
|
+
* ```html
|
|
384
|
+
* <hub-input formControlName="email" type="email" label="Email" />
|
|
385
|
+
* <hub-input formControlName="accept" type="switch" label="Accept terms" />
|
|
386
|
+
* <hub-input formControlName="qty" type="counter" label="Quantity" [min]="1" [max]="9" />
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
declare class HubInputComponent extends HubFieldControl {
|
|
390
|
+
#private;
|
|
391
|
+
protected readonly _inputFormats: typeof HubInputFormats;
|
|
392
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
393
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
394
|
+
protected readonly _value: _angular_core.WritableSignal<HubInputValue>;
|
|
395
|
+
/** Whether the password value is currently revealed (password format only). */
|
|
396
|
+
showPassword: boolean;
|
|
397
|
+
/** Native input type. */
|
|
398
|
+
readonly type: _angular_core.InputSignal<HubInputFormat>;
|
|
399
|
+
/** Label text. */
|
|
400
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
401
|
+
/** Label display type (`stacked`, `floating`, `horizontal`). */
|
|
402
|
+
readonly labelType: _angular_core.ModelSignal<HubLabelType>;
|
|
403
|
+
/** Placeholder text. */
|
|
404
|
+
readonly placeholder: _angular_core.ModelSignal<string>;
|
|
405
|
+
/** Minimum value (numeric / counter inputs). */
|
|
406
|
+
readonly min: _angular_core.ModelSignal<number | undefined>;
|
|
407
|
+
/** Maximum value (numeric / counter inputs). */
|
|
408
|
+
readonly max: _angular_core.ModelSignal<number | undefined>;
|
|
409
|
+
/** Step value (numeric / counter inputs). */
|
|
410
|
+
readonly step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
411
|
+
/** Whether the input is read-only. */
|
|
412
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
413
|
+
/** Helper text shown below the control. */
|
|
414
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
415
|
+
/** Helper text placement. Only `bottom` is supported. */
|
|
416
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
417
|
+
/** Text shown before the control as an input-group addon (text-like formats). */
|
|
418
|
+
readonly prepend: _angular_core.InputSignal<string | string[]>;
|
|
419
|
+
/** Text shown after the control as an input-group addon (text-like formats). */
|
|
420
|
+
readonly append: _angular_core.InputSignal<string | string[]>;
|
|
421
|
+
/** Extra CSS classes applied to the host element. */
|
|
422
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
423
|
+
/**
|
|
424
|
+
* Pattern mask for text-like formats. Tokens: `0` = digit, `A` = letter, `*` =
|
|
425
|
+
* alphanumeric; any other character is an auto-inserted literal separator.
|
|
426
|
+
* Example: `0000 0000 0000 0000` (card), `00/00/0000` (date).
|
|
427
|
+
*/
|
|
428
|
+
readonly mask: _angular_core.InputSignal<string>;
|
|
429
|
+
/**
|
|
430
|
+
* When a `mask` is set, controls the form value: `false` (default) stores the
|
|
431
|
+
* formatted text (e.g. `1234 5678`); `true` stores only the typed characters
|
|
432
|
+
* (e.g. `12345678`).
|
|
433
|
+
*/
|
|
434
|
+
readonly unmaskValue: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
435
|
+
/** Emits whenever the value changes. */
|
|
436
|
+
readonly valueChange: _angular_core.OutputEmitterRef<HubInputValue>;
|
|
437
|
+
/** Emits the current value when Enter is pressed. */
|
|
438
|
+
readonly enter: _angular_core.OutputEmitterRef<HubInputValue>;
|
|
439
|
+
/** Accepted file types (file format), e.g. `image/*,.pdf`. */
|
|
440
|
+
readonly accept: _angular_core.InputSignal<string>;
|
|
441
|
+
/** Whether multiple files can be selected (file format). */
|
|
442
|
+
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
443
|
+
/** Text of the file-picker button (file format). */
|
|
444
|
+
readonly buttonLabel: _angular_core.InputSignal<string>;
|
|
445
|
+
/** Reference to the hidden native file input. */
|
|
446
|
+
protected readonly fileInput: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
|
|
447
|
+
/** Whether the current format renders a checkable control (checkbox / switch). */
|
|
448
|
+
protected readonly isCheckable: _angular_core.Signal<boolean>;
|
|
449
|
+
/** Display label for the selected file(s). */
|
|
450
|
+
protected readonly fileLabel: _angular_core.Signal<string>;
|
|
451
|
+
/** Normalized list of prepend addons. */
|
|
452
|
+
protected readonly _prepend: _angular_core.Signal<string[]>;
|
|
453
|
+
/** Normalized list of append addons. */
|
|
454
|
+
protected readonly _append: _angular_core.Signal<string[]>;
|
|
455
|
+
/** Whether the control is wrapped in an input group (has addons). */
|
|
456
|
+
protected readonly hasGroup: _angular_core.Signal<boolean>;
|
|
457
|
+
/** Resolves the actual native `type` attribute, accounting for password reveal. */
|
|
458
|
+
protected readonly resolvedType: _angular_core.Signal<string>;
|
|
459
|
+
ngAfterContentInit(): void;
|
|
460
|
+
writeValue(value: HubInputValue): void;
|
|
461
|
+
/**
|
|
462
|
+
* Reads the new value from an input/model event and propagates it to the form and outputs.
|
|
463
|
+
*
|
|
464
|
+
* @param event - A DOM event or the raw value emitted by `ngModelChange`.
|
|
465
|
+
*/
|
|
466
|
+
setValue(event: any): void;
|
|
467
|
+
/** Increments the counter value, clamped to `max`. */
|
|
468
|
+
protected add(): void;
|
|
469
|
+
/** Decrements the counter value, clamped to `min`. */
|
|
470
|
+
protected subtract(): void;
|
|
471
|
+
/** Toggles password visibility. */
|
|
472
|
+
protected togglePassword(): void;
|
|
473
|
+
/** Opens the native file dialog. */
|
|
474
|
+
protected triggerFile(): void;
|
|
475
|
+
/**
|
|
476
|
+
* Reads the selected file(s) from the native input and propagates them.
|
|
477
|
+
*
|
|
478
|
+
* @param event - The native `change` event of the file input.
|
|
479
|
+
*/
|
|
480
|
+
protected setFileValue(event: Event): void;
|
|
481
|
+
/** Clears the selected file(s). */
|
|
482
|
+
protected clearFile(): void;
|
|
483
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubInputComponent, never>;
|
|
484
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubInputComponent, "hub-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "prepend": { "alias": "prepend"; "required": false; "isSignal": true; }; "append": { "alias": "append"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; "unmaskValue": { "alias": "unmaskValue"; "required": false; "isSignal": true; }; "accept": { "alias": "accept"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; }, { "labelType": "labelTypeChange"; "placeholder": "placeholderChange"; "min": "minChange"; "max": "maxChange"; "valueChange": "valueChange"; "enter": "enter"; }, never, never, true, never>;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** Character set accepted by the OTP field. */
|
|
488
|
+
type HubOtpMode = 'numeric' | 'alphanumeric' | 'alpha';
|
|
489
|
+
/**
|
|
490
|
+
* Segmented one-time-code input (`hub-otp-input`): a row of single-character cells for
|
|
491
|
+
* entering verification / 2FA codes. Supports auto-advance, backspace navigation, arrow
|
|
492
|
+
* keys, and pasting the whole code at once. Implements `ControlValueAccessor`, so the
|
|
493
|
+
* form value is the concatenated string.
|
|
494
|
+
*
|
|
495
|
+
* ```html
|
|
496
|
+
* <hub-otp-input formControlName="code" [length]="6" label="Verification code" />
|
|
497
|
+
* <hub-otp-input formControlName="pin" [length]="4" mode="numeric" [secret]="true" />
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
declare class HubOtpInputComponent extends HubFieldControl {
|
|
501
|
+
#private;
|
|
502
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
503
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
504
|
+
/** Number of cells / characters in the code. */
|
|
505
|
+
readonly length: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
506
|
+
/** Accepted character set. */
|
|
507
|
+
readonly mode: _angular_core.InputSignal<HubOtpMode>;
|
|
508
|
+
/** Field label. */
|
|
509
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
510
|
+
/** Label placement. */
|
|
511
|
+
readonly labelType: _angular_core.InputSignal<HubLabelType>;
|
|
512
|
+
/** Helper text shown below the cells. */
|
|
513
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
514
|
+
/** Helper-text placement. */
|
|
515
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
516
|
+
/** Masks the characters like a password. */
|
|
517
|
+
readonly secret: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
518
|
+
/** Renders the cells read-only. */
|
|
519
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
520
|
+
/** Inserts a visual separator every N cells (0 = none). */
|
|
521
|
+
readonly separatorEvery: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
522
|
+
/** The separator character shown between groups. */
|
|
523
|
+
readonly separator: _angular_core.InputSignal<string>;
|
|
524
|
+
/** Extra CSS classes applied to the host element. */
|
|
525
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
526
|
+
/** Emits whenever the value changes. */
|
|
527
|
+
readonly valueChange: _angular_core.OutputEmitterRef<string>;
|
|
528
|
+
/** Emits the full code once every cell is filled. */
|
|
529
|
+
readonly completed: _angular_core.OutputEmitterRef<string>;
|
|
530
|
+
/** References to the cell inputs, for focus management. */
|
|
531
|
+
private readonly _cells;
|
|
532
|
+
/** Index list driving the `@for`. */
|
|
533
|
+
readonly cells: _angular_core.Signal<number[]>;
|
|
534
|
+
/** Per-cell characters derived from the current value. */
|
|
535
|
+
readonly chars: _angular_core.Signal<string[]>;
|
|
536
|
+
/** ARIA label prefix for each cell. */
|
|
537
|
+
readonly ariaCellLabel: _angular_core.Signal<string>;
|
|
538
|
+
writeValue(value: unknown): void;
|
|
539
|
+
/** Handles typing into a cell: keep the last valid char, advance focus, and emit. */
|
|
540
|
+
protected onInput(index: number, event: Event): void;
|
|
541
|
+
/** Handles navigation / deletion keys. */
|
|
542
|
+
protected onKeydown(index: number, event: KeyboardEvent): void;
|
|
543
|
+
/** Distributes a pasted code across the cells starting at the current one. */
|
|
544
|
+
protected onPaste(index: number, event: ClipboardEvent): void;
|
|
545
|
+
/** Selects the cell content on focus for quick overwrite. */
|
|
546
|
+
protected select(index: number): void;
|
|
547
|
+
/** Marks the field as touched when focus leaves the whole group. */
|
|
548
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
549
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubOtpInputComponent, never>;
|
|
550
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubOtpInputComponent, "hub-otp-input", never, { "length": { "alias": "length"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "secret": { "alias": "secret"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "separatorEvery": { "alias": "separatorEvery"; "required": false; "isSignal": true; }; "separator": { "alias": "separator"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "completed": "completed"; }, never, never, true, never>;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* Accessible multi-line text field with optional auto-resize, character counter and automatic
|
|
555
|
+
* validation-error display.
|
|
556
|
+
*
|
|
557
|
+
* Shares all the form plumbing (CVA, error feedback, touched tracking) with the other
|
|
558
|
+
* `ng-hub-ui-forms` fields through {@link HubFieldControl}.
|
|
559
|
+
*
|
|
560
|
+
* @example
|
|
561
|
+
* ```html
|
|
562
|
+
* <hub-textarea formControlName="bio" label="Biography" [rows]="4" [maxlength]="280" [counter]="true" />
|
|
563
|
+
* ```
|
|
564
|
+
*/
|
|
565
|
+
declare class HubTextareaComponent extends HubFieldControl {
|
|
566
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
567
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
568
|
+
protected readonly _value: _angular_core.WritableSignal<string>;
|
|
569
|
+
/** Label text. */
|
|
570
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
571
|
+
/** Label display type (`stacked`, `horizontal`). */
|
|
572
|
+
readonly labelType: _angular_core.InputSignal<HubLabelType>;
|
|
573
|
+
/** Placeholder text. */
|
|
574
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
575
|
+
/** Number of visible text rows. */
|
|
576
|
+
readonly rows: _angular_core.InputSignalWithTransform<number | undefined, string | number>;
|
|
577
|
+
/** Number of visible columns. When set, the textarea stops stretching to full width. */
|
|
578
|
+
readonly cols: _angular_core.InputSignalWithTransform<number | undefined, string | number>;
|
|
579
|
+
/** Maximum number of characters. Drives both the native limit and the counter. */
|
|
580
|
+
readonly maxlength: _angular_core.InputSignalWithTransform<number | undefined, string | number>;
|
|
581
|
+
/** Whether the textarea grows to fit its content. */
|
|
582
|
+
readonly autoresize: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
583
|
+
/** Whether to show a character counter below the control. */
|
|
584
|
+
readonly counter: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
585
|
+
/** Whether the textarea is read-only. */
|
|
586
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
587
|
+
/** Helper text shown below the control. */
|
|
588
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
589
|
+
/** Helper text placement. Only `bottom` is supported in the MVP. */
|
|
590
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
591
|
+
/** Extra CSS classes applied to the host element. */
|
|
592
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
593
|
+
/** Emits whenever the value changes. */
|
|
594
|
+
readonly valueChange: _angular_core.OutputEmitterRef<string>;
|
|
595
|
+
/** Current character counter text (e.g. `12 / 280`). */
|
|
596
|
+
protected readonly counterText: _angular_core.Signal<string>;
|
|
597
|
+
writeValue(value: string | null): void;
|
|
598
|
+
/**
|
|
599
|
+
* Updates the value from the textarea and propagates it to the form and outputs.
|
|
600
|
+
*
|
|
601
|
+
* @param value - The new textarea value.
|
|
602
|
+
*/
|
|
603
|
+
setValue(value: string): void;
|
|
604
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubTextareaComponent, never>;
|
|
605
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubTextareaComponent, "hub-textarea", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "cols": { "alias": "cols"; "required": false; "isSignal": true; }; "maxlength": { "alias": "maxlength"; "required": false; "isSignal": true; }; "autoresize": { "alias": "autoresize"; "required": false; "isSignal": true; }; "counter": { "alias": "counter"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/** Value of `<hub-slider>`: a number in single mode, a `[lower, upper]` tuple in range mode. */
|
|
609
|
+
type HubSliderValue = number | [number, number];
|
|
610
|
+
/**
|
|
611
|
+
* Accessible numeric slider with an optional value bubble. Supports a single thumb or a
|
|
612
|
+
* **dual-thumb range** (`range`), whose value is a `[lower, upper]` tuple.
|
|
613
|
+
*
|
|
614
|
+
* Shares the form plumbing (CVA, error feedback, touched tracking) with the other
|
|
615
|
+
* `ng-hub-ui-forms` fields through {@link HubFieldControl}. The filled track and bubbles are
|
|
616
|
+
* positioned from the `--hub-slider-from` / `--hub-slider-to` percentages.
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* ```html
|
|
620
|
+
* <hub-slider formControlName="volume" label="Volume" [min]="0" [max]="100" [step]="5" />
|
|
621
|
+
* <hub-slider formControlName="price" label="Price" [range]="true" [min]="0" [max]="1000" />
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
declare class HubSliderComponent extends HubFieldControl {
|
|
625
|
+
#private;
|
|
626
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
627
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
628
|
+
protected readonly _value: _angular_core.WritableSignal<HubSliderValue>;
|
|
629
|
+
/** Label text. */
|
|
630
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
631
|
+
/** Label display type (`stacked`, `horizontal`). */
|
|
632
|
+
readonly labelType: _angular_core.InputSignal<HubLabelType>;
|
|
633
|
+
/** Whether the slider selects a `[lower, upper]` range with two thumbs. */
|
|
634
|
+
readonly range: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
635
|
+
/** Minimum value. */
|
|
636
|
+
readonly min: _angular_core.InputSignalWithTransform<number, string | number>;
|
|
637
|
+
/** Maximum value. */
|
|
638
|
+
readonly max: _angular_core.InputSignalWithTransform<number, string | number>;
|
|
639
|
+
/** Step increment. */
|
|
640
|
+
readonly step: _angular_core.InputSignalWithTransform<number, string | number>;
|
|
641
|
+
/** Whether to show the value bubble(s) above the thumb(s). */
|
|
642
|
+
readonly showValue: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
643
|
+
/** Helper text shown below the control. */
|
|
644
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
645
|
+
/** Helper text placement. Only `bottom` is supported. */
|
|
646
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
647
|
+
/** Extra CSS classes applied to the host element. */
|
|
648
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
649
|
+
/** Emits whenever the value changes. */
|
|
650
|
+
readonly valueChange: _angular_core.OutputEmitterRef<HubSliderValue>;
|
|
651
|
+
/** Current single value (single mode). */
|
|
652
|
+
protected readonly single: _angular_core.Signal<number>;
|
|
653
|
+
/** Lower bound of the current range (range mode). */
|
|
654
|
+
protected readonly lower: _angular_core.Signal<number>;
|
|
655
|
+
/** Upper bound of the current range (range mode). */
|
|
656
|
+
protected readonly upper: _angular_core.Signal<number>;
|
|
657
|
+
/** Single-thumb position as a clamped 0–100 percentage. */
|
|
658
|
+
protected readonly percent: _angular_core.Signal<number>;
|
|
659
|
+
/** Lower-thumb position as a clamped 0–100 percentage. */
|
|
660
|
+
protected readonly lowerPercent: _angular_core.Signal<number>;
|
|
661
|
+
/** Upper-thumb position as a clamped 0–100 percentage. */
|
|
662
|
+
protected readonly upperPercent: _angular_core.Signal<number>;
|
|
663
|
+
writeValue(value: HubSliderValue | null): void;
|
|
664
|
+
/**
|
|
665
|
+
* Updates the single value and propagates it.
|
|
666
|
+
*
|
|
667
|
+
* @param value - The new value (string from the DOM or number).
|
|
668
|
+
*/
|
|
669
|
+
setValue(value: string | number): void;
|
|
670
|
+
/**
|
|
671
|
+
* Updates the lower thumb (clamped not to cross the upper thumb).
|
|
672
|
+
*
|
|
673
|
+
* @param value - The new lower value.
|
|
674
|
+
*/
|
|
675
|
+
setLower(value: string | number): void;
|
|
676
|
+
/**
|
|
677
|
+
* Updates the upper thumb (clamped not to cross the lower thumb).
|
|
678
|
+
*
|
|
679
|
+
* @param value - The new upper value.
|
|
680
|
+
*/
|
|
681
|
+
setUpper(value: string | number): void;
|
|
682
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSliderComponent, never>;
|
|
683
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSliderComponent, "hub-slider", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "range": { "alias": "range"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Groups related fields under a `<fieldset>`/`<legend>` and **automatically displays the
|
|
688
|
+
* group-level (cross-field) validation errors** of the bound `FormGroup`/`FormArray`.
|
|
689
|
+
*
|
|
690
|
+
* Bind the target group explicitly with `[group]` (recommended) or by `groupName` resolved from the
|
|
691
|
+
* parent container. Errors set on the group itself — e.g. by `hubAreEqual` — are rendered without
|
|
692
|
+
* any extra wiring, mirroring how the field components show control-level errors.
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* ```html
|
|
696
|
+
* <hub-fieldset legend="Credentials" [group]="form.controls.credentials">
|
|
697
|
+
* <hub-input formControlName="password" type="password" label="Password" />
|
|
698
|
+
* <hub-input formControlName="confirm" type="password" label="Confirm" />
|
|
699
|
+
* </hub-fieldset>
|
|
700
|
+
* ```
|
|
701
|
+
*/
|
|
702
|
+
declare class HubFieldsetComponent extends HubGroupControl {
|
|
703
|
+
/** Legend text. Ignored when a `hubLegend` template is projected. */
|
|
704
|
+
readonly legend: _angular_core.InputSignal<string>;
|
|
705
|
+
/** Extra CSS classes applied to the host element. */
|
|
706
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
707
|
+
/** Query for a projected `hubLegend` template. */
|
|
708
|
+
readonly legendTmp: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
709
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubFieldsetComponent, never>;
|
|
710
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubFieldsetComponent, "hub-fieldset", never, { "legend": { "alias": "legend"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, {}, ["legendTmp"], ["*"], true, never>;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Applied to a reactive `<form [formGroup]>`, **automatically displays the form-level validation
|
|
715
|
+
* errors** (cross-field errors set on the root group) and centralizes submit handling.
|
|
716
|
+
*
|
|
717
|
+
* Because it sits on the same host as the `formGroup` directive, projected `formControlName` fields
|
|
718
|
+
* resolve their control normally — no extra wiring. On submit it prevents the default navigation,
|
|
719
|
+
* marks the whole tree as touched (so every field reveals its errors) and reveals the form-level
|
|
720
|
+
* errors. Bind the form's own `(submit)` event for your handler — there is no custom output, which
|
|
721
|
+
* keeps the API idiomatic and avoids the double-emit you get when a directive output shadows the
|
|
722
|
+
* native `submit` event on a `<form>`.
|
|
723
|
+
*
|
|
724
|
+
* @example
|
|
725
|
+
* ```html
|
|
726
|
+
* <form [formGroup]="form" hubForm (submit)="save()">
|
|
727
|
+
* <hub-input formControlName="email" type="email" label="Email" />
|
|
728
|
+
* <button type="submit">Save</button>
|
|
729
|
+
* </form>
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
732
|
+
declare class HubFormComponent extends HubGroupControl {
|
|
733
|
+
/**
|
|
734
|
+
* Augments the native form submit: prevents the default navigation, marks the tree as touched
|
|
735
|
+
* and flips the submitted state so form-level errors appear. The consumer's own `(submit)`
|
|
736
|
+
* binding still fires for their handler.
|
|
737
|
+
*
|
|
738
|
+
* @param event - The native submit event.
|
|
739
|
+
*/
|
|
740
|
+
protected handleSubmit(event: Event): void;
|
|
741
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubFormComponent, never>;
|
|
742
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubFormComponent, "form[hubForm]", never, {}, {}, never, ["*"], true, never>;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Presentational legend for a `<hub-fieldset>` (or any grouped section), with optional
|
|
747
|
+
* required/invalid state styling.
|
|
748
|
+
*
|
|
749
|
+
* Use it inside a `hubLegend` template, or standalone as a section title.
|
|
750
|
+
*
|
|
751
|
+
* @example
|
|
752
|
+
* ```html
|
|
753
|
+
* <hub-fieldset [group]="form.controls.address">
|
|
754
|
+
* <ng-template hubLegend>
|
|
755
|
+
* <hub-legend [required]="true" [invalid]="form.controls.address.invalid">Shipping address</hub-legend>
|
|
756
|
+
* </ng-template>
|
|
757
|
+
* </hub-fieldset>
|
|
758
|
+
* ```
|
|
759
|
+
*/
|
|
760
|
+
declare class HubLegendComponent {
|
|
761
|
+
/** Whether to render the required indicator. */
|
|
762
|
+
readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
763
|
+
/** Whether to render the invalid state styling. */
|
|
764
|
+
readonly invalid: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
765
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubLegendComponent, never>;
|
|
766
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubLegendComponent, "hub-legend", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
/**
|
|
770
|
+
* Rendering formats for `<hub-select>`.
|
|
771
|
+
*
|
|
772
|
+
* - `dropdown` — the ng-select engine (search, virtual scroll, tags…).
|
|
773
|
+
* - `buttons` — a toggle-button group (single or multiple, per `multiple`).
|
|
774
|
+
* - `checkbox` — a list of checkboxes (always multiple).
|
|
775
|
+
* - `radio` — a list of radios (always single).
|
|
776
|
+
*/
|
|
777
|
+
type HubSelectFormat = 'dropdown' | 'buttons' | 'checkbox' | 'radio';
|
|
778
|
+
/**
|
|
779
|
+
* Enum mirror of {@link HubSelectFormat} for ergonomic template usage.
|
|
780
|
+
*/
|
|
781
|
+
declare enum HubSelectFormats {
|
|
782
|
+
Dropdown = "dropdown",
|
|
783
|
+
Buttons = "buttons",
|
|
784
|
+
Checkbox = "checkbox",
|
|
785
|
+
Radio = "radio"
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/**
|
|
789
|
+
* Accessible select / multiselect / autocomplete built on the vendored ng-select engine, with the
|
|
790
|
+
* `ng-hub-ui-forms` conventions on top: CVA binding, automatic error display (via
|
|
791
|
+
* {@link HubFieldControl}), label, helper text and `--hub-select-*` token theming.
|
|
792
|
+
*
|
|
793
|
+
* The underlying ng-select DOM is themed in place from this component's stylesheet
|
|
794
|
+
* (`ViewEncapsulation.None`) using hub tokens — no external `::ng-deep` overrides, and the vendored
|
|
795
|
+
* source stays untouched so the upstream sync remains automatic.
|
|
796
|
+
*
|
|
797
|
+
* @example
|
|
798
|
+
* ```html
|
|
799
|
+
* <hub-select formControlName="country" label="Country" [items]="countries" bindLabel="name" bindValue="code" />
|
|
800
|
+
* ```
|
|
801
|
+
*/
|
|
802
|
+
declare class HubSelectComponent extends HubFieldControl {
|
|
803
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
804
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
805
|
+
protected readonly _selectFormats: typeof HubSelectFormats;
|
|
806
|
+
protected readonly _value: _angular_core.WritableSignal<any>;
|
|
807
|
+
protected readonly _optionTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
808
|
+
protected readonly _optgroupTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
809
|
+
protected readonly _labelTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
810
|
+
protected readonly _multiLabelTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
811
|
+
protected readonly _headerTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
812
|
+
protected readonly _footerTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
813
|
+
protected readonly _notFoundTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
814
|
+
/** Rendering format (`dropdown`, `buttons`, `checkbox`, `radio`). */
|
|
815
|
+
readonly format: _angular_core.InputSignal<HubSelectFormat>;
|
|
816
|
+
/** Lay out the `buttons`/`checkbox`/`radio` options vertically. */
|
|
817
|
+
readonly vertical: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
818
|
+
/** Items to choose from. */
|
|
819
|
+
readonly items: _angular_core.InputSignal<any[]>;
|
|
820
|
+
/** Property used as the visible label for object items. */
|
|
821
|
+
readonly bindLabel: _angular_core.InputSignal<string | undefined>;
|
|
822
|
+
/** Property used as the bound value for object items. */
|
|
823
|
+
readonly bindValue: _angular_core.InputSignal<string | undefined>;
|
|
824
|
+
/** Property (or fn) used to group items. */
|
|
825
|
+
readonly groupBy: _angular_core.InputSignal<string | undefined>;
|
|
826
|
+
/** Label text. */
|
|
827
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
828
|
+
/** Label display type (`stacked`, `horizontal`). */
|
|
829
|
+
readonly labelType: _angular_core.InputSignal<HubLabelType>;
|
|
830
|
+
/** Placeholder text. */
|
|
831
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
832
|
+
/** Whether multiple selection is allowed. */
|
|
833
|
+
readonly multiple: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
834
|
+
/** Whether the options can be searched. */
|
|
835
|
+
readonly searchable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
836
|
+
/** Whether the selection can be cleared. */
|
|
837
|
+
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
838
|
+
/** Whether the dropdown closes after a selection. */
|
|
839
|
+
readonly closeOnSelect: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
840
|
+
/**
|
|
841
|
+
* Keep the placeholder visible even when a value is selected. Defaults to `false` (the
|
|
842
|
+
* placeholder hides on selection) — ng-select v23 defaults this to `true`, which is not the
|
|
843
|
+
* conventional behavior.
|
|
844
|
+
*/
|
|
845
|
+
readonly fixedPlaceholder: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
846
|
+
/** Whether the control shows a loading state. */
|
|
847
|
+
readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
848
|
+
/** Whether the control is read-only. */
|
|
849
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
850
|
+
/** Text shown when no items match. */
|
|
851
|
+
readonly notFoundText: _angular_core.InputSignal<string>;
|
|
852
|
+
/**
|
|
853
|
+
* Where the dropdown panel is rendered, as a CSS selector. Defaults to
|
|
854
|
+
* `'body'` so the panel escapes `overflow`/`transform` ancestors (cards,
|
|
855
|
+
* scroll containers, modals) and is never clipped. Pass `undefined` to
|
|
856
|
+
* render it inline within the component instead.
|
|
857
|
+
*/
|
|
858
|
+
readonly appendTo: _angular_core.InputSignal<string | undefined>;
|
|
859
|
+
/** Helper text shown below the control. */
|
|
860
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
861
|
+
/** Helper text placement. Only `bottom` is supported. */
|
|
862
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
863
|
+
/** Extra CSS classes applied to the host element. */
|
|
864
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
865
|
+
/** Emits whenever the value changes. */
|
|
866
|
+
readonly valueChange: _angular_core.OutputEmitterRef<any>;
|
|
867
|
+
/** Emits when the control gains focus (dropdown format). */
|
|
868
|
+
readonly onFocus: _angular_core.OutputEmitterRef<any>;
|
|
869
|
+
/** Emits when the control loses focus (dropdown format). */
|
|
870
|
+
readonly onBlur: _angular_core.OutputEmitterRef<any>;
|
|
871
|
+
/** Emits when the dropdown opens. */
|
|
872
|
+
readonly onOpen: _angular_core.OutputEmitterRef<void>;
|
|
873
|
+
/** Emits when the dropdown closes. */
|
|
874
|
+
readonly onClose: _angular_core.OutputEmitterRef<void>;
|
|
875
|
+
/** Emits when the value is cleared. */
|
|
876
|
+
readonly onClear: _angular_core.OutputEmitterRef<void>;
|
|
877
|
+
/** Emits on search-term changes (use with `typeahead`/async data). */
|
|
878
|
+
readonly onSearch: _angular_core.OutputEmitterRef<{
|
|
879
|
+
term: string;
|
|
880
|
+
items: any[];
|
|
881
|
+
}>;
|
|
882
|
+
/** Emits when an item is added to the selection. */
|
|
883
|
+
readonly onAdd: _angular_core.OutputEmitterRef<any>;
|
|
884
|
+
/** Emits when an item is removed from the selection. */
|
|
885
|
+
readonly onRemove: _angular_core.OutputEmitterRef<any>;
|
|
886
|
+
/** Emits while the dropdown list scrolls (virtual scroll window). */
|
|
887
|
+
readonly scroll: _angular_core.OutputEmitterRef<{
|
|
888
|
+
start: number;
|
|
889
|
+
end: number;
|
|
890
|
+
}>;
|
|
891
|
+
/** Emits when the dropdown list is scrolled to the end (infinite loading). */
|
|
892
|
+
readonly scrollToEnd: _angular_core.OutputEmitterRef<any>;
|
|
893
|
+
/** Whether the current format selects multiple values. */
|
|
894
|
+
protected readonly isMulti: _angular_core.Signal<boolean>;
|
|
895
|
+
writeValue(value: any): void;
|
|
896
|
+
/**
|
|
897
|
+
* Propagates the value to the form and outputs.
|
|
898
|
+
*
|
|
899
|
+
* @param value - The new value emitted by the control.
|
|
900
|
+
*/
|
|
901
|
+
setValue(value: any): void;
|
|
902
|
+
/**
|
|
903
|
+
* Resolves the visible label of an item, honoring `bindLabel`.
|
|
904
|
+
*
|
|
905
|
+
* @param item - The source item.
|
|
906
|
+
* @returns The label to display.
|
|
907
|
+
*/
|
|
908
|
+
protected itemLabel(item: any): any;
|
|
909
|
+
/**
|
|
910
|
+
* Resolves the bound value of an item, honoring `bindValue`.
|
|
911
|
+
*
|
|
912
|
+
* @param item - The source item.
|
|
913
|
+
* @returns The value stored when the item is selected.
|
|
914
|
+
*/
|
|
915
|
+
protected itemValue(item: any): any;
|
|
916
|
+
/**
|
|
917
|
+
* Whether an item is currently selected (used by the buttons/checkbox/radio formats).
|
|
918
|
+
*
|
|
919
|
+
* @param item - The source item.
|
|
920
|
+
* @returns `true` when the item's value is part of the current selection.
|
|
921
|
+
*/
|
|
922
|
+
protected isSelected(item: any): boolean;
|
|
923
|
+
/**
|
|
924
|
+
* Toggles an item's selection for the buttons/checkbox/radio formats.
|
|
925
|
+
*
|
|
926
|
+
* @param item - The item to toggle.
|
|
927
|
+
*/
|
|
928
|
+
protected toggleItem(item: any): void;
|
|
929
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSelectComponent, never>;
|
|
930
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubSelectComponent, "hub-select", never, { "format": { "alias": "format"; "required": false; "isSignal": true; }; "vertical": { "alias": "vertical"; "required": false; "isSignal": true; }; "items": { "alias": "items"; "required": false; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "fixedPlaceholder": { "alias": "fixedPlaceholder"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "notFoundText": { "alias": "notFoundText"; "required": false; "isSignal": true; }; "appendTo": { "alias": "appendTo"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "onFocus": "onFocus"; "onBlur": "onBlur"; "onOpen": "onOpen"; "onClose": "onClose"; "onClear": "onClear"; "onSearch": "onSearch"; "onAdd": "onAdd"; "onRemove": "onRemove"; "scroll": "scroll"; "scrollToEnd": "scrollToEnd"; }, ["_optionTpl", "_optgroupTpl", "_labelTpl", "_multiLabelTpl", "_headerTpl", "_footerTpl", "_notFoundTpl"], ["*"], true, never>;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/** A calendar cell enriched with its selection / range / disabled / focus state. */
|
|
934
|
+
interface DatepickerCell {
|
|
935
|
+
date: Date;
|
|
936
|
+
day: number;
|
|
937
|
+
currentMonth: boolean;
|
|
938
|
+
today: boolean;
|
|
939
|
+
disabled: boolean;
|
|
940
|
+
selected: boolean;
|
|
941
|
+
rangeStart: boolean;
|
|
942
|
+
rangeEnd: boolean;
|
|
943
|
+
inRange: boolean;
|
|
944
|
+
focused: boolean;
|
|
945
|
+
}
|
|
946
|
+
/**
|
|
947
|
+
* Accessible, fully customizable date / range picker built from scratch on native `Date` + CDK
|
|
948
|
+
* Overlay (no date dependency). Shares the `ng-hub-ui-forms` conventions (CVA, auto error display,
|
|
949
|
+
* label, helper text, `--hub-datepicker-*` theming) and adds:
|
|
950
|
+
*
|
|
951
|
+
* - `single` and `range` selection (`mode`).
|
|
952
|
+
* - `min` / `max` bounds and a `disabledDates` predicate.
|
|
953
|
+
* - Keyboard navigation (arrows, Home/End, PageUp/Down, Enter, Escape).
|
|
954
|
+
* - `Today` and `Clear` shortcuts.
|
|
955
|
+
* - Full i18n: locale-driven month/weekday names plus overridable `labels`, `displayFormat`,
|
|
956
|
+
* `weekdayFormat`, `firstDayOfWeek` and `rangeSeparator` — per instance or globally via
|
|
957
|
+
* {@link provideHubForms}.
|
|
958
|
+
*
|
|
959
|
+
* The value is an ISO `YYYY-MM-DD` string (`single`) or a `{ start, end }` range (`range`).
|
|
960
|
+
*
|
|
961
|
+
* @example
|
|
962
|
+
* ```html
|
|
963
|
+
* <hub-datepicker formControlName="stay" mode="range" label="Stay" [min]="today" />
|
|
964
|
+
* ```
|
|
965
|
+
*/
|
|
966
|
+
declare class HubDatepickerComponent extends HubFieldControl {
|
|
967
|
+
#private;
|
|
968
|
+
protected readonly _labelTypes: typeof HubLabelTypes;
|
|
969
|
+
protected readonly _formTextTypes: typeof FormTextTypes;
|
|
970
|
+
protected readonly _value: _angular_core.WritableSignal<HubDateValue>;
|
|
971
|
+
/** Month currently shown in the calendar panel. */
|
|
972
|
+
protected readonly _viewDate: _angular_core.WritableSignal<Date>;
|
|
973
|
+
/** Date that currently holds keyboard focus inside the grid. */
|
|
974
|
+
protected readonly _focusedDate: _angular_core.WritableSignal<Date>;
|
|
975
|
+
/** Whether the calendar overlay is open. */
|
|
976
|
+
protected readonly _open: _angular_core.WritableSignal<boolean>;
|
|
977
|
+
/** Selection mode (`single` or `range`). */
|
|
978
|
+
readonly mode: _angular_core.InputSignal<HubDatepickerMode>;
|
|
979
|
+
/** Label text. */
|
|
980
|
+
readonly label: _angular_core.InputSignal<string>;
|
|
981
|
+
/** Label display type (`stacked`, `horizontal`). */
|
|
982
|
+
readonly labelType: _angular_core.InputSignal<HubLabelType>;
|
|
983
|
+
/** Placeholder shown when nothing is selected. */
|
|
984
|
+
readonly placeholder: _angular_core.InputSignal<string>;
|
|
985
|
+
/** BCP-47 locale for the display value and month/weekday names. */
|
|
986
|
+
readonly locale: _angular_core.InputSignal<string>;
|
|
987
|
+
/** First weekday (0 = Sunday, 1 = Monday…). Falls back to the global config. */
|
|
988
|
+
readonly firstDayOfWeek: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
989
|
+
/** Weekday header width. Falls back to the global config. */
|
|
990
|
+
readonly weekdayFormat: _angular_core.InputSignal<"short" | "narrow" | "long" | undefined>;
|
|
991
|
+
/** `Intl` options to format the displayed value. Falls back to the global config. */
|
|
992
|
+
readonly displayFormat: _angular_core.InputSignal<Intl.DateTimeFormatOptions | undefined>;
|
|
993
|
+
/** Separator between the two dates of a range. Falls back to the global config. */
|
|
994
|
+
readonly rangeSeparator: _angular_core.InputSignal<string | undefined>;
|
|
995
|
+
/** Earliest selectable date (ISO string or `Date`). */
|
|
996
|
+
readonly min: _angular_core.InputSignal<string | Date | null>;
|
|
997
|
+
/** Latest selectable date (ISO string or `Date`). */
|
|
998
|
+
readonly max: _angular_core.InputSignal<string | Date | null>;
|
|
999
|
+
/** Predicate marking individual dates as non-selectable. */
|
|
1000
|
+
readonly disabledDates: _angular_core.InputSignal<((date: Date) => boolean) | null>;
|
|
1001
|
+
/** Whether to show the clear shortcut. */
|
|
1002
|
+
readonly clearable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1003
|
+
/** Whether to show the "today" shortcut. */
|
|
1004
|
+
readonly showToday: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1005
|
+
/** Whether selecting a date closes the calendar (`single` mode only). */
|
|
1006
|
+
readonly closeOnSelect: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1007
|
+
/** Per-instance label overrides (merged over the global config). */
|
|
1008
|
+
readonly labels: _angular_core.InputSignal<Partial<HubDatepickerLabels>>;
|
|
1009
|
+
/** Whether the picker is read-only. */
|
|
1010
|
+
readonly readonly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1011
|
+
/** Helper text shown below the control. */
|
|
1012
|
+
readonly formText: _angular_core.InputSignal<string>;
|
|
1013
|
+
/** Helper text placement. Only `bottom` is supported. */
|
|
1014
|
+
readonly formTextType: _angular_core.InputSignal<FormTextType>;
|
|
1015
|
+
/** Extra CSS classes applied to the host element. */
|
|
1016
|
+
readonly classlist: _angular_core.InputSignal<string>;
|
|
1017
|
+
/** Emits whenever the value changes. */
|
|
1018
|
+
readonly valueChange: _angular_core.OutputEmitterRef<HubDateValue>;
|
|
1019
|
+
/** Emits when the calendar opens. */
|
|
1020
|
+
readonly opened: _angular_core.OutputEmitterRef<void>;
|
|
1021
|
+
/** Emits when the calendar closes. */
|
|
1022
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
1023
|
+
/** Emits the first day of the displayed month when navigating. */
|
|
1024
|
+
readonly viewChange: _angular_core.OutputEmitterRef<Date>;
|
|
1025
|
+
/** Emits when the value is cleared. */
|
|
1026
|
+
readonly cleared: _angular_core.OutputEmitterRef<void>;
|
|
1027
|
+
protected readonly _labels: _angular_core.Signal<HubDatepickerLabels>;
|
|
1028
|
+
protected readonly _firstDayOfWeek: _angular_core.Signal<number>;
|
|
1029
|
+
protected readonly _weekdayFormat: _angular_core.Signal<"short" | "narrow" | "long">;
|
|
1030
|
+
protected readonly _displayFormat: _angular_core.Signal<Intl.DateTimeFormatOptions>;
|
|
1031
|
+
protected readonly _rangeSeparator: _angular_core.Signal<string>;
|
|
1032
|
+
protected readonly _minDate: _angular_core.Signal<Date | null>;
|
|
1033
|
+
protected readonly _maxDate: _angular_core.Signal<Date | null>;
|
|
1034
|
+
protected readonly rangeStart: _angular_core.Signal<Date | null>;
|
|
1035
|
+
protected readonly rangeEnd: _angular_core.Signal<Date | null>;
|
|
1036
|
+
/** Locale-formatted display string for the input. */
|
|
1037
|
+
protected readonly displayValue: _angular_core.Signal<string>;
|
|
1038
|
+
protected readonly weekdays: _angular_core.Signal<string[]>;
|
|
1039
|
+
protected readonly monthYearLabel: _angular_core.Signal<string>;
|
|
1040
|
+
/** Enriched 6×7 grid for the displayed month. */
|
|
1041
|
+
protected readonly grid: _angular_core.Signal<DatepickerCell[]>;
|
|
1042
|
+
writeValue(value: HubDateValue | Date): void;
|
|
1043
|
+
/** Opens the calendar (no-op when disabled/read-only). */
|
|
1044
|
+
protected open(): void;
|
|
1045
|
+
/** Closes the calendar and marks the control as touched. */
|
|
1046
|
+
protected close(): void;
|
|
1047
|
+
/** Toggles the calendar. */
|
|
1048
|
+
protected toggleCalendar(): void;
|
|
1049
|
+
/** Shifts the displayed month by `delta` and emits {@link viewChange}. */
|
|
1050
|
+
protected shiftMonth(delta: number): void;
|
|
1051
|
+
/** Jumps the view to today (and focuses it). */
|
|
1052
|
+
protected goToToday(): void;
|
|
1053
|
+
/** Clears the value. */
|
|
1054
|
+
protected clear(): void;
|
|
1055
|
+
/**
|
|
1056
|
+
* Selects a day cell. In `single` mode it sets the value; in `range` mode it sets the start
|
|
1057
|
+
* (resetting the range) or completes it, keeping start ≤ end.
|
|
1058
|
+
*
|
|
1059
|
+
* @param cell - The picked cell.
|
|
1060
|
+
*/
|
|
1061
|
+
protected selectDay(cell: DatepickerCell): void;
|
|
1062
|
+
/**
|
|
1063
|
+
* Keyboard navigation within the grid.
|
|
1064
|
+
*
|
|
1065
|
+
* @param event - The originating keyboard event (handled on the grid container).
|
|
1066
|
+
*/
|
|
1067
|
+
protected onGridKeydown(event: KeyboardEvent): void;
|
|
1068
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubDatepickerComponent, never>;
|
|
1069
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<HubDatepickerComponent, "hub-datepicker", never, { "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelType": { "alias": "labelType"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "firstDayOfWeek": { "alias": "firstDayOfWeek"; "required": false; "isSignal": true; }; "weekdayFormat": { "alias": "weekdayFormat"; "required": false; "isSignal": true; }; "displayFormat": { "alias": "displayFormat"; "required": false; "isSignal": true; }; "rangeSeparator": { "alias": "rangeSeparator"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "disabledDates": { "alias": "disabledDates"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "showToday": { "alias": "showToday"; "required": false; "isSignal": true; }; "closeOnSelect": { "alias": "closeOnSelect"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "formText": { "alias": "formText"; "required": false; "isSignal": true; }; "formTextType": { "alias": "formTextType"; "required": false; "isSignal": true; }; "classlist": { "alias": "classlist"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "opened": "opened"; "closed": "closed"; "viewChange": "viewChange"; "cleared": "cleared"; }, never, never, true, never>;
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
declare class NgOptionComponent implements OnInit {
|
|
1073
|
+
readonly value: _angular_core.InputSignal<any>;
|
|
1074
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1075
|
+
readonly elementRef: ElementRef<any>;
|
|
1076
|
+
readonly label: _angular_core.WritableSignal<string>;
|
|
1077
|
+
/** True when this component's inputs are initialized (after first change detection). */
|
|
1078
|
+
readonly isInitialized: _angular_core.WritableSignal<boolean>;
|
|
1079
|
+
constructor();
|
|
1080
|
+
ngOnInit(): void;
|
|
1081
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgOptionComponent, never>;
|
|
1082
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgOptionComponent, "ng-option", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
declare class NgSelectConfig {
|
|
1086
|
+
placeholder: string;
|
|
1087
|
+
fixedPlaceholder: boolean;
|
|
1088
|
+
notFoundText: string;
|
|
1089
|
+
typeToSearchText: string;
|
|
1090
|
+
addTagText: string;
|
|
1091
|
+
loadingText: string;
|
|
1092
|
+
clearAllText: string;
|
|
1093
|
+
ariaLabelDropdown: string;
|
|
1094
|
+
disableVirtualScroll: boolean;
|
|
1095
|
+
openOnEnter: boolean;
|
|
1096
|
+
appendTo: string;
|
|
1097
|
+
bindValue: string;
|
|
1098
|
+
bindLabel: string;
|
|
1099
|
+
appearance: string;
|
|
1100
|
+
clearSearchOnAdd: boolean;
|
|
1101
|
+
deselectOnClick: boolean;
|
|
1102
|
+
tabFocusOnClear: boolean;
|
|
1103
|
+
/**
|
|
1104
|
+
* Controls which DOM event is used to detect outside clicks for closing the dropdown.
|
|
1105
|
+
* Defaults to 'click'. Set to 'mousedown' to handle early outside interactions
|
|
1106
|
+
* (useful when backdrops load on click and would otherwise close the dropdown).
|
|
1107
|
+
*/
|
|
1108
|
+
outsideClickEvent: 'click' | 'mousedown';
|
|
1109
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgSelectConfig, never>;
|
|
1110
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<NgSelectConfig>;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
declare class NgOptionTemplateDirective {
|
|
1114
|
+
readonly template: TemplateRef<any>;
|
|
1115
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgOptionTemplateDirective, never>;
|
|
1116
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgOptionTemplateDirective, "[ng-option-tmp]", never, {}, {}, never, never, true, never>;
|
|
1117
|
+
}
|
|
1118
|
+
declare class NgOptgroupTemplateDirective {
|
|
1119
|
+
readonly template: TemplateRef<any>;
|
|
1120
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgOptgroupTemplateDirective, never>;
|
|
1121
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgOptgroupTemplateDirective, "[ng-optgroup-tmp]", never, {}, {}, never, never, true, never>;
|
|
1122
|
+
}
|
|
1123
|
+
declare class NgLabelTemplateDirective {
|
|
1124
|
+
readonly template: TemplateRef<any>;
|
|
1125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgLabelTemplateDirective, never>;
|
|
1126
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgLabelTemplateDirective, "[ng-label-tmp]", never, {}, {}, never, never, true, never>;
|
|
1127
|
+
}
|
|
1128
|
+
declare class NgMultiLabelTemplateDirective {
|
|
1129
|
+
readonly template: TemplateRef<any>;
|
|
1130
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgMultiLabelTemplateDirective, never>;
|
|
1131
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgMultiLabelTemplateDirective, "[ng-multi-label-tmp]", never, {}, {}, never, never, true, never>;
|
|
1132
|
+
}
|
|
1133
|
+
declare class NgHeaderTemplateDirective {
|
|
1134
|
+
readonly template: TemplateRef<any>;
|
|
1135
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgHeaderTemplateDirective, never>;
|
|
1136
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgHeaderTemplateDirective, "[ng-header-tmp]", never, {}, {}, never, never, true, never>;
|
|
1137
|
+
}
|
|
1138
|
+
declare class NgFooterTemplateDirective {
|
|
1139
|
+
readonly template: TemplateRef<any>;
|
|
1140
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgFooterTemplateDirective, never>;
|
|
1141
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgFooterTemplateDirective, "[ng-footer-tmp]", never, {}, {}, never, never, true, never>;
|
|
1142
|
+
}
|
|
1143
|
+
declare class NgNotFoundTemplateDirective {
|
|
1144
|
+
readonly template: TemplateRef<any>;
|
|
1145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgNotFoundTemplateDirective, never>;
|
|
1146
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgNotFoundTemplateDirective, "[ng-notfound-tmp]", never, {}, {}, never, never, true, never>;
|
|
1147
|
+
}
|
|
1148
|
+
declare class NgTypeToSearchTemplateDirective {
|
|
1149
|
+
readonly template: TemplateRef<any>;
|
|
1150
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgTypeToSearchTemplateDirective, never>;
|
|
1151
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgTypeToSearchTemplateDirective, "[ng-typetosearch-tmp]", never, {}, {}, never, never, true, never>;
|
|
1152
|
+
}
|
|
1153
|
+
declare class NgLoadingTextTemplateDirective {
|
|
1154
|
+
readonly template: TemplateRef<any>;
|
|
1155
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgLoadingTextTemplateDirective, never>;
|
|
1156
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgLoadingTextTemplateDirective, "[ng-loadingtext-tmp]", never, {}, {}, never, never, true, never>;
|
|
1157
|
+
}
|
|
1158
|
+
declare class NgTagTemplateDirective {
|
|
1159
|
+
readonly template: TemplateRef<any>;
|
|
1160
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgTagTemplateDirective, never>;
|
|
1161
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgTagTemplateDirective, "[ng-tag-tmp]", never, {}, {}, never, never, true, never>;
|
|
1162
|
+
}
|
|
1163
|
+
declare class NgLoadingSpinnerTemplateDirective {
|
|
1164
|
+
readonly template: TemplateRef<any>;
|
|
1165
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgLoadingSpinnerTemplateDirective, never>;
|
|
1166
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgLoadingSpinnerTemplateDirective, "[ng-loadingspinner-tmp]", never, {}, {}, never, never, true, never>;
|
|
1167
|
+
}
|
|
1168
|
+
declare class NgClearButtonTemplateDirective {
|
|
1169
|
+
readonly template: TemplateRef<any>;
|
|
1170
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgClearButtonTemplateDirective, never>;
|
|
1171
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<NgClearButtonTemplateDirective, "[ng-clearbutton-tmp]", never, {}, {}, never, never, true, never>;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Marks a template as form helper text projected into a form field.
|
|
1176
|
+
*
|
|
1177
|
+
* @example
|
|
1178
|
+
* ```html
|
|
1179
|
+
* <hub-input formControlName="email">
|
|
1180
|
+
* <ng-template hubFormText>We'll never share your email.</ng-template>
|
|
1181
|
+
* </hub-input>
|
|
1182
|
+
* ```
|
|
1183
|
+
*/
|
|
1184
|
+
declare class HubFormTextDirective {
|
|
1185
|
+
/** Template reference for the helper text. */
|
|
1186
|
+
readonly template: TemplateRef<any>;
|
|
1187
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubFormTextDirective, never>;
|
|
1188
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubFormTextDirective, "[hubFormText]", never, {}, {}, never, never, true, never>;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Marks a template as the legend content of a `<hub-fieldset>`.
|
|
1193
|
+
*
|
|
1194
|
+
* @example
|
|
1195
|
+
* ```html
|
|
1196
|
+
* <hub-fieldset formGroupName="address">
|
|
1197
|
+
* <ng-template hubLegend>Shipping address <span class="badge">required</span></ng-template>
|
|
1198
|
+
* </hub-fieldset>
|
|
1199
|
+
* ```
|
|
1200
|
+
*/
|
|
1201
|
+
declare class HubLegendDirective {
|
|
1202
|
+
/** Template reference for the legend content. */
|
|
1203
|
+
readonly template: TemplateRef<any>;
|
|
1204
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubLegendDirective, never>;
|
|
1205
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubLegendDirective, "[hubLegend]", never, {}, {}, never, never, true, never>;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* Auto-resizes a `<textarea>` to fit its content height.
|
|
1210
|
+
*
|
|
1211
|
+
* @example
|
|
1212
|
+
* ```html
|
|
1213
|
+
* <textarea hubAutoresize></textarea>
|
|
1214
|
+
* ```
|
|
1215
|
+
*/
|
|
1216
|
+
declare class HubAutoresizeDirective implements OnInit {
|
|
1217
|
+
#private;
|
|
1218
|
+
/** Whether auto-resizing is enabled. */
|
|
1219
|
+
readonly hubAutoresize: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1220
|
+
onChange(): void;
|
|
1221
|
+
ngOnInit(): void;
|
|
1222
|
+
/** Resizes the textarea to fit its content. */
|
|
1223
|
+
resize(): void;
|
|
1224
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubAutoresizeDirective, never>;
|
|
1225
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<HubAutoresizeDirective, "textarea[hubAutoresize]", never, { "hubAutoresize": { "alias": "hubAutoresize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Inverts a HEX color, or returns the best contrasting black/white when `bw` is enabled.
|
|
1230
|
+
*/
|
|
1231
|
+
declare class HubInvertColorPipe implements PipeTransform {
|
|
1232
|
+
/**
|
|
1233
|
+
* @param hex - HEX color (`#rgb` or `#rrggbb`).
|
|
1234
|
+
* @param bw - When `true`, returns `#000000` or `#FFFFFF` for maximum contrast.
|
|
1235
|
+
* @returns The inverted (or contrasting) HEX color.
|
|
1236
|
+
*/
|
|
1237
|
+
transform(hex: string, bw?: boolean): unknown;
|
|
1238
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubInvertColorPipe, never>;
|
|
1239
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubInvertColorPipe, "hubInvertColor", true>;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Joins an array using a separator for all but the last element, which uses a dedicated glue.
|
|
1244
|
+
*/
|
|
1245
|
+
declare class HubJoinButLastPipe implements PipeTransform {
|
|
1246
|
+
/**
|
|
1247
|
+
* @param values - Values to join.
|
|
1248
|
+
* @param glue - Separator between all but the last element.
|
|
1249
|
+
* @param lastGlue - Separator before the last element.
|
|
1250
|
+
* @returns The joined string.
|
|
1251
|
+
*/
|
|
1252
|
+
transform(values: any[], glue?: string, lastGlue?: string): string;
|
|
1253
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubJoinButLastPipe, never>;
|
|
1254
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubJoinButLastPipe, "hubJoinButLast", true>;
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
/**
|
|
1258
|
+
* Maps an array of objects to an array of values read from a dot-separated path.
|
|
1259
|
+
*/
|
|
1260
|
+
declare class HubMapPipe implements PipeTransform {
|
|
1261
|
+
/**
|
|
1262
|
+
* @param value - Array of objects.
|
|
1263
|
+
* @param path - Dot-separated path read from each item.
|
|
1264
|
+
* @returns The array of resolved values.
|
|
1265
|
+
*/
|
|
1266
|
+
transform(value: any[], path: string): any[];
|
|
1267
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubMapPipe, never>;
|
|
1268
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubMapPipe, "hubMap", true>;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
/**
|
|
1272
|
+
* Marks a URL as a trusted resource URL via the `DomSanitizer`.
|
|
1273
|
+
*/
|
|
1274
|
+
declare class HubSafeUrlPipe implements PipeTransform {
|
|
1275
|
+
private readonly sanitizer;
|
|
1276
|
+
/**
|
|
1277
|
+
* @param value - The raw URL.
|
|
1278
|
+
* @returns A `SafeUrl` trusted as a resource URL.
|
|
1279
|
+
*/
|
|
1280
|
+
transform(value: string): SafeUrl;
|
|
1281
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSafeUrlPipe, never>;
|
|
1282
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubSafeUrlPipe, "hubSafeUrl", true>;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
/**
|
|
1286
|
+
* Converts a camelCase string to UPPER_SNAKE_CASE.
|
|
1287
|
+
*/
|
|
1288
|
+
declare class HubSnakeUpperPipe implements PipeTransform {
|
|
1289
|
+
/**
|
|
1290
|
+
* @param value - camelCase identifier.
|
|
1291
|
+
* @returns The UPPER_SNAKE_CASE representation.
|
|
1292
|
+
*/
|
|
1293
|
+
transform(value: string): unknown;
|
|
1294
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubSnakeUpperPipe, never>;
|
|
1295
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubSnakeUpperPipe, "hubSnakeUpper", true>;
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Capitalizes the first letter of a string, skipping leading non-letter characters.
|
|
1300
|
+
*/
|
|
1301
|
+
declare class HubUcfirstPipe implements PipeTransform {
|
|
1302
|
+
/**
|
|
1303
|
+
* @param value - Input string.
|
|
1304
|
+
* @returns The string with its first letter uppercased.
|
|
1305
|
+
*/
|
|
1306
|
+
transform(value?: string): string;
|
|
1307
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<HubUcfirstPipe, never>;
|
|
1308
|
+
static ɵpipe: _angular_core.ɵɵPipeDeclaration<HubUcfirstPipe, "hubUcfirst", true>;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Cross-field validator that checks whether two controls of a `FormGroup` hold equal values.
|
|
1313
|
+
*
|
|
1314
|
+
* Sets the `equal` error on the group when the values differ. Returns `null` (valid) when either
|
|
1315
|
+
* control is empty, so the requirement is only enforced once both have a value.
|
|
1316
|
+
*
|
|
1317
|
+
* @param primaryControlName - Name of the first control.
|
|
1318
|
+
* @param secondaryControlName - Name of the second control.
|
|
1319
|
+
* @returns A validator function for use on a `FormGroup`.
|
|
1320
|
+
*
|
|
1321
|
+
* @example
|
|
1322
|
+
* ```ts
|
|
1323
|
+
* new FormGroup({
|
|
1324
|
+
* password: new FormControl(''),
|
|
1325
|
+
* confirm: new FormControl('')
|
|
1326
|
+
* }, { validators: hubAreEqual('password', 'confirm') });
|
|
1327
|
+
* ```
|
|
1328
|
+
*/
|
|
1329
|
+
declare function hubAreEqual(primaryControlName: string, secondaryControlName: string): ValidatorFn;
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Checks if a value is a string.
|
|
1333
|
+
*
|
|
1334
|
+
* @param value - Value to test.
|
|
1335
|
+
* @returns `true` when `value` is a string.
|
|
1336
|
+
*/
|
|
1337
|
+
declare function isString(value: any): value is string;
|
|
1338
|
+
/**
|
|
1339
|
+
* Checks if a value is defined and not null.
|
|
1340
|
+
*
|
|
1341
|
+
* @param value - Value to test.
|
|
1342
|
+
* @returns `true` when `value` is neither `undefined` nor `null`.
|
|
1343
|
+
*/
|
|
1344
|
+
declare function isDefined(value: any): boolean;
|
|
1345
|
+
/**
|
|
1346
|
+
* Operator that runs the source observable within a specified Angular zone.
|
|
1347
|
+
*
|
|
1348
|
+
* @param zone - The `NgZone` instance used to run emissions.
|
|
1349
|
+
* @returns An `OperatorFunction` that re-enters the given zone for every notification.
|
|
1350
|
+
*/
|
|
1351
|
+
declare function runInZone<T>(zone: NgZone): OperatorFunction<T, T>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Joins an array of strings using a separator for all but the last element, which uses `lastSeparator`.
|
|
1354
|
+
*
|
|
1355
|
+
* @param texts - Strings to join.
|
|
1356
|
+
* @param separator - Separator used between all but the last element. Defaults to `', '`.
|
|
1357
|
+
* @param lastSeparator - Separator used before the last element. Defaults to `' and '`.
|
|
1358
|
+
* @returns The joined string.
|
|
1359
|
+
*/
|
|
1360
|
+
declare function joinButLast(texts: string[], separator?: string, lastSeparator?: string): string;
|
|
1361
|
+
/**
|
|
1362
|
+
* Checks if two values are equal, taking different types into account.
|
|
1363
|
+
*
|
|
1364
|
+
* Primitives are compared with strict equality; everything else is compared by JSON serialization.
|
|
1365
|
+
*
|
|
1366
|
+
* @param first - First value.
|
|
1367
|
+
* @param second - Second value.
|
|
1368
|
+
* @returns `true` when both values are considered equal.
|
|
1369
|
+
*/
|
|
1370
|
+
declare function areEqual(first: any, second: any): boolean;
|
|
1371
|
+
/**
|
|
1372
|
+
* Checks whether a control declares a `min` or `max` validator.
|
|
1373
|
+
*
|
|
1374
|
+
* @param control - The control to inspect.
|
|
1375
|
+
* @param type - Either `'min'` or `'max'`.
|
|
1376
|
+
* @returns `true` when the validator is present.
|
|
1377
|
+
*/
|
|
1378
|
+
declare function controlHasMinOrMaxValidator(control: AbstractControl, type: 'min' | 'max'): boolean;
|
|
1379
|
+
/**
|
|
1380
|
+
* Reads the configured `min`/`max` value from a control's validator.
|
|
1381
|
+
*
|
|
1382
|
+
* @param control - The control to inspect.
|
|
1383
|
+
* @param type - Either `'min'` or `'max'`.
|
|
1384
|
+
* @returns The configured bound, or `null` when not present.
|
|
1385
|
+
*/
|
|
1386
|
+
declare function getMinOrMaxValueFromValidator(control: AbstractControl, type: 'min' | 'max'): number | null;
|
|
1387
|
+
/**
|
|
1388
|
+
* Retrieves a value from an object following a dot-separated path, with an optional fallback.
|
|
1389
|
+
*
|
|
1390
|
+
* @param object - Source object.
|
|
1391
|
+
* @param path - Dot-separated path (e.g. `'a.b.c'`).
|
|
1392
|
+
* @param fallback - Value returned when the path cannot be resolved. Defaults to `null`.
|
|
1393
|
+
* @returns The resolved value, or the fallback.
|
|
1394
|
+
*/
|
|
1395
|
+
declare function get(object: {
|
|
1396
|
+
[key: string]: any;
|
|
1397
|
+
}, path: string, fallback?: any): any;
|
|
1398
|
+
/**
|
|
1399
|
+
* Converts a camelCase string to UPPER_SNAKE_CASE.
|
|
1400
|
+
*
|
|
1401
|
+
* @param value - camelCase identifier.
|
|
1402
|
+
* @returns The UPPER_SNAKE_CASE representation.
|
|
1403
|
+
*/
|
|
1404
|
+
declare function camelToSnakeUpper(value: string): string;
|
|
1405
|
+
/**
|
|
1406
|
+
* Generates a UUID using `crypto.randomUUID()` when available, falling back to a timestamp-based id.
|
|
1407
|
+
*
|
|
1408
|
+
* @returns A unique string identifier.
|
|
1409
|
+
*/
|
|
1410
|
+
declare function uuid(): string;
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns the active element within the given root, descending into shadow roots when needed.
|
|
1413
|
+
*
|
|
1414
|
+
* @param root - The document or shadow root to search. Defaults to `document`.
|
|
1415
|
+
* @returns The deepest active element, or `null`.
|
|
1416
|
+
*/
|
|
1417
|
+
declare function getActiveElement(root?: Document | ShadowRoot): Element | null;
|
|
1418
|
+
|
|
1419
|
+
/**
|
|
1420
|
+
* Pattern-mask utilities for `hub-input`.
|
|
1421
|
+
*
|
|
1422
|
+
* A mask is a template string where these tokens accept user input and every other
|
|
1423
|
+
* character is a literal separator that is inserted automatically as the user types:
|
|
1424
|
+
*
|
|
1425
|
+
* | Token | Accepts |
|
|
1426
|
+
* |-------|------------------------|
|
|
1427
|
+
* | `0` | a digit (`0`–`9`) |
|
|
1428
|
+
* | `A` | a letter (`a`–`z`/`A`–`Z`) |
|
|
1429
|
+
* | `*` | a letter or a digit |
|
|
1430
|
+
*
|
|
1431
|
+
* Examples: card `0000 0000 0000 0000`, date `00/00/0000`, IBAN `AA00 0000 0000 0000 0000 0000`,
|
|
1432
|
+
* phone `+00 000 000 000`.
|
|
1433
|
+
*/
|
|
1434
|
+
/** Result of applying a mask: the formatted string and its raw (separator-free) value. */
|
|
1435
|
+
interface HubMaskResult {
|
|
1436
|
+
/** The value formatted with literals inserted, e.g. `1234 5678`. */
|
|
1437
|
+
readonly masked: string;
|
|
1438
|
+
/** Only the characters that filled tokens, e.g. `12345678`. */
|
|
1439
|
+
readonly unmasked: string;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* Returns whether a mask string actually contains at least one input token.
|
|
1443
|
+
*
|
|
1444
|
+
* @param mask Mask template (may be empty).
|
|
1445
|
+
* @returns True when the mask has a `0`, `A` or `*` token.
|
|
1446
|
+
*/
|
|
1447
|
+
declare function isMaskActive(mask: string | null | undefined): boolean;
|
|
1448
|
+
/**
|
|
1449
|
+
* Formats a raw input string against a mask template.
|
|
1450
|
+
*
|
|
1451
|
+
* The input may already contain literals from a previous pass (live re-formatting):
|
|
1452
|
+
* non-matching characters are skipped, and literals present in the input are consumed.
|
|
1453
|
+
* Formatting stops as soon as the input is exhausted, so no trailing separators are shown
|
|
1454
|
+
* before the user has typed the next character.
|
|
1455
|
+
*
|
|
1456
|
+
* @param value Raw user input (with or without separators).
|
|
1457
|
+
* @param mask Mask template.
|
|
1458
|
+
* @returns The masked and unmasked representations.
|
|
1459
|
+
*/
|
|
1460
|
+
declare function applyMask(value: string | null | undefined, mask: string): HubMaskResult;
|
|
1461
|
+
|
|
1462
|
+
export { FormTextTypes, HUB_FORMS_CONFIG, HubAutoresizeDirective, HubDatepickerComponent, HubFieldControl, HubFieldsetComponent, HubFormComponent, HubFormControl, HubFormTextDirective, HubGroupControl, HubInputComponent, HubInputFormats, HubInvertColorPipe, HubJoinButLastPipe, HubLabelTypes, HubLegendComponent, HubLegendDirective, HubMapPipe, HubOtpInputComponent, HubSafeUrlPipe, HubSelectComponent, HubSelectFormats, HubSliderComponent, HubSnakeUpperPipe, HubTextareaComponent, HubUcfirstPipe, HubValidationErrorDirective, NgClearButtonTemplateDirective, NgFooterTemplateDirective, NgHeaderTemplateDirective, NgLabelTemplateDirective, NgLoadingSpinnerTemplateDirective, NgLoadingTextTemplateDirective, NgMultiLabelTemplateDirective, NgNotFoundTemplateDirective, NgOptgroupTemplateDirective, NgOptionComponent, NgOptionTemplateDirective, NgSelectConfig, NgTagTemplateDirective, NgTypeToSearchTemplateDirective, applyMask, areEqual, camelToSnakeUpper, controlHasMinOrMaxValidator, defaultHubDatepickerConfig, defaultHubDatepickerLabels, defaultHubFormsConfig, defaultInvalidFeedback, get, getActiveElement, getMinOrMaxValueFromValidator, hubAreEqual, isDefined, isMaskActive, isString, joinButLast, provideHubForms, runInZone, uuid };
|
|
1463
|
+
export type { FormTextType, HubDateRange, HubDateValue, HubDatepickerConfig, HubDatepickerLabels, HubDatepickerMode, HubFormsConfig, HubGroupErrorTrigger, HubInputFormat, HubLabelType, HubMaskResult, HubOtpMode, HubSelectFormat, HubSliderValue };
|