@thalassic/ui 0.11.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui.mjs +440 -333
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +200 -130
package/package.json
CHANGED
package/types/thalassic-ui.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InputSignal, InputSignalWithTransform, InjectionToken, Signal, TemplateRef, ModelSignal, WritableSignal, ElementRef, OutputEmitterRef, TrackByFunction, OnDestroy, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import * as _thalassic_ui from '@thalassic/ui';
|
|
4
|
-
import { FormUiControl, WithOptionalFieldTree, ValidationError,
|
|
4
|
+
import { FormUiControl, WithOptionalFieldTree, ValidationError, FormValueControl, FormCheckboxControl, FieldTree } from '@angular/forms/signals';
|
|
5
5
|
import { CdkDialogContainer, DialogRole, DialogRef } from '@angular/cdk/dialog';
|
|
6
6
|
import { ComponentType } from '@angular/cdk/portal';
|
|
7
7
|
import { Day } from 'date-fns';
|
|
@@ -27,6 +27,7 @@ interface tlsUiConfigProvider {
|
|
|
27
27
|
checkbox?: Partial<CheckboxConfig>;
|
|
28
28
|
chip?: Partial<ChipConfig>;
|
|
29
29
|
chipControl?: Partial<ChipControlConfig>;
|
|
30
|
+
chipGroup?: Partial<ChipGroupConfig>;
|
|
30
31
|
chipInput?: Partial<ChipInputConfig>;
|
|
31
32
|
dateTimePicker?: Partial<DateTimePickerConfig>;
|
|
32
33
|
dialog?: Partial<DialogConfig>;
|
|
@@ -196,6 +197,12 @@ declare abstract class FormControl implements FormUiControl {
|
|
|
196
197
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControl, never, never, { "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "pending": { "alias": "pending"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, { "touched": "touchedChange"; }, never, never, true, never>;
|
|
197
198
|
}
|
|
198
199
|
|
|
200
|
+
declare abstract class ValueFormControl<T> extends FormControl implements FormValueControl<T> {
|
|
201
|
+
abstract readonly value: ModelSignal<T>;
|
|
202
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueFormControl<any>, never>;
|
|
203
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueFormControl<any>, never, never, {}, {}, never, never, true, never>;
|
|
204
|
+
}
|
|
205
|
+
|
|
199
206
|
declare abstract class CheckboxFormControl extends FormControl implements FormCheckboxControl {
|
|
200
207
|
abstract readonly checked: ModelSignal<boolean>;
|
|
201
208
|
protected controlClasses: i0.Signal<string[]>;
|
|
@@ -211,10 +218,141 @@ interface Option<V = unknown> {
|
|
|
211
218
|
|
|
212
219
|
type optionInput<T> = string | number | T;
|
|
213
220
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
221
|
+
type selectionMode = 'single' | 'multiple';
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Shared base for controls that present a list of options and store the
|
|
225
|
+
* selected option values as an array (e.g. toggle group, chip group).
|
|
226
|
+
*
|
|
227
|
+
* Subclasses provide the visual shell plus the `type`/`unselectable` inputs
|
|
228
|
+
* (their defaults differ per component), while this base owns the selection
|
|
229
|
+
* state machine: value model, option normalization, and the toggle logic.
|
|
230
|
+
*/
|
|
231
|
+
declare abstract class SelectionGroup<T, V = unknown> extends ValueFormControl<V[]> {
|
|
232
|
+
readonly value: ModelSignal<V[]>;
|
|
233
|
+
readonly options: InputSignal<optionInput<T>[]>;
|
|
234
|
+
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
235
|
+
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
236
|
+
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
237
|
+
abstract readonly type: Signal<selectionMode>;
|
|
238
|
+
abstract readonly unselectable: Signal<boolean>;
|
|
239
|
+
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
240
|
+
protected isSelected(optionValue: V): boolean;
|
|
241
|
+
protected select(option: Option<V>): void;
|
|
242
|
+
protected onKeyboardSelect(event: Event, option: Option<V>): void;
|
|
243
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionGroup<any, any>, never>;
|
|
244
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectionGroup<any, any>, never, never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
interface ConnectedOverlayConfig {
|
|
248
|
+
/** Template projected into the overlay. */
|
|
249
|
+
content: TemplateRef<unknown>;
|
|
250
|
+
/** Element or point the overlay is anchored to. */
|
|
251
|
+
origin: FlexibleConnectedPositionStrategyOrigin;
|
|
252
|
+
/** Connected positions to try, in order of preference. */
|
|
253
|
+
positions: ConnectedPosition[];
|
|
254
|
+
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
255
|
+
flexibleDimensions?: boolean;
|
|
256
|
+
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
257
|
+
push?: boolean;
|
|
258
|
+
/** Scroll handling while open. Defaults to `'reposition'`. */
|
|
259
|
+
scrollStrategy?: 'reposition' | 'close';
|
|
260
|
+
/** Whether to render a backdrop. Defaults to `true`. */
|
|
261
|
+
hasBackdrop?: boolean;
|
|
262
|
+
/** Backdrop class when a backdrop is rendered. Defaults to the transparent backdrop. */
|
|
263
|
+
backdropClass?: string;
|
|
264
|
+
/** Extra class(es) applied to the overlay pane. */
|
|
265
|
+
panelClass?: string | string[];
|
|
266
|
+
/** Close when the backdrop is clicked. Defaults to `true` when a backdrop is rendered. */
|
|
267
|
+
closeOnBackdropClick?: boolean;
|
|
268
|
+
/** Close on an outside pointer event. Defaults to `true` when no backdrop is rendered. */
|
|
269
|
+
closeOnOutsidePointer?: boolean;
|
|
270
|
+
/** Close when Escape is pressed. Defaults to `true`. */
|
|
271
|
+
closeOnEscape?: boolean;
|
|
272
|
+
/** Minimum width applied to the pane on every open (e.g. to match a trigger). */
|
|
273
|
+
minWidth?: number | string;
|
|
274
|
+
/**
|
|
275
|
+
* Keep the overlay alive across open/close (detach instead of dispose), so the
|
|
276
|
+
* same instance is reused on the next open. Defaults to `false`.
|
|
277
|
+
*/
|
|
278
|
+
reuse?: boolean;
|
|
279
|
+
/** Invoked after the overlay closes, from any cause (explicit, backdrop, outside, Escape). */
|
|
280
|
+
onClose?: () => void;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Owns the CDK-Overlay lifecycle shared by the library's connected overlay
|
|
284
|
+
* components (popover, menu, select): create/attach, dismissal wiring
|
|
285
|
+
* (backdrop / outside-pointer / Escape), `isOpen` state, and disposal. The
|
|
286
|
+
* positional and dismissal differences between components are expressed through
|
|
287
|
+
* {@link ConnectedOverlayConfig} rather than duplicated per component.
|
|
288
|
+
*
|
|
289
|
+
* Create one via {@link createOverlayManager} from a component field initializer
|
|
290
|
+
* so it is bound to the host's injection context.
|
|
291
|
+
*/
|
|
292
|
+
declare class OverlayManager {
|
|
293
|
+
private readonly _overlay;
|
|
294
|
+
private readonly _viewContainerRef;
|
|
295
|
+
private readonly _destroyRef;
|
|
296
|
+
private _overlayRef;
|
|
297
|
+
private _config;
|
|
298
|
+
private readonly _isOpen;
|
|
299
|
+
readonly isOpen: i0.Signal<boolean>;
|
|
300
|
+
private readonly _teardown;
|
|
301
|
+
open(config: ConnectedOverlayConfig): void;
|
|
302
|
+
close(): void;
|
|
303
|
+
private _buildPositionStrategy;
|
|
304
|
+
private _wireDismissal;
|
|
305
|
+
private _dispose;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Shared base for the single {@link Select} and {@link MultiSelect} controls.
|
|
310
|
+
* Owns everything the two listbox-combobox controls have in common: the option
|
|
311
|
+
* inputs, the connected overlay lifecycle, roving `aria-activedescendant`
|
|
312
|
+
* navigation, and the keyboard handler. The per-control differences (the value
|
|
313
|
+
* shape, the selected-state check, how the trigger label is built and what a
|
|
314
|
+
* commit does) are expressed through the abstract members below.
|
|
315
|
+
*/
|
|
316
|
+
declare abstract class AbstractSelect<T, V, ValueType> extends ValueFormControl<ValueType> {
|
|
317
|
+
protected readonly overlay: OverlayManager;
|
|
318
|
+
private readonly triggerElement;
|
|
319
|
+
private readonly panelTemplate;
|
|
320
|
+
readonly inputId: InputSignal<string | null>;
|
|
321
|
+
readonly options: InputSignal<optionInput<T>[]>;
|
|
322
|
+
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
323
|
+
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
324
|
+
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
325
|
+
readonly tabindex: InputSignal<string | number>;
|
|
326
|
+
abstract readonly placeholder: InputSignal<string>;
|
|
327
|
+
abstract readonly size: InputSignal<controlSize>;
|
|
328
|
+
abstract readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
329
|
+
abstract readonly clearable: InputSignalWithTransform<boolean, unknown>;
|
|
330
|
+
protected readonly isOpen: Signal<boolean>;
|
|
331
|
+
protected readonly activeIndex: WritableSignal<number>;
|
|
332
|
+
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
333
|
+
protected readonly activeDescendantId: Signal<string | null>;
|
|
334
|
+
protected readonly hostClasses: Signal<string[]>;
|
|
335
|
+
protected get listboxId(): string;
|
|
336
|
+
protected abstract readonly uniqueId: string;
|
|
337
|
+
protected abstract readonly hostClassBase: string;
|
|
338
|
+
protected abstract readonly panelClass: string;
|
|
339
|
+
protected abstract readonly hasValue: Signal<boolean>;
|
|
340
|
+
/** Index the active option starts on when the panel opens. */
|
|
341
|
+
protected abstract getInitialActiveIndex(): number;
|
|
342
|
+
/** Apply the active option's selection when committed via mouse or keyboard. */
|
|
343
|
+
protected abstract commitActiveOption(option: Option<V>): void;
|
|
344
|
+
/** Reset the control to its empty value. */
|
|
345
|
+
protected abstract clear(): void;
|
|
346
|
+
protected open(): void;
|
|
347
|
+
protected close(): void;
|
|
348
|
+
protected toggle(): void;
|
|
349
|
+
protected onOptionHover(index: number, disabled?: boolean): void;
|
|
350
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
351
|
+
protected optionId(index: number): string;
|
|
352
|
+
private moveActive;
|
|
353
|
+
private moveActiveToEdge;
|
|
354
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractSelect<any, any, any>, never>;
|
|
355
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractSelect<any, any, any>, never, never, { "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
218
356
|
}
|
|
219
357
|
|
|
220
358
|
declare class ChipControl extends CheckboxFormControl {
|
|
@@ -223,12 +361,13 @@ declare class ChipControl extends CheckboxFormControl {
|
|
|
223
361
|
private _chip;
|
|
224
362
|
readonly checked: i0.ModelSignal<boolean>;
|
|
225
363
|
readonly checkedColor: i0.InputSignal<_thalassic_ui.color | undefined>;
|
|
364
|
+
readonly checkedVariant: i0.InputSignal<chipVariant | undefined>;
|
|
226
365
|
protected hostClasses: i0.Signal<string[]>;
|
|
227
366
|
constructor();
|
|
228
367
|
protected toggle(): void;
|
|
229
368
|
protected onKeyboardToggle(event: Event): void;
|
|
230
369
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChipControl, never>;
|
|
231
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ChipControl, "tls-chip[tlsChipControl]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "checkedColor": { "alias": "checkedColor"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; }, never, never, true, never>;
|
|
370
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ChipControl, "tls-chip[tlsChipControl]", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "checkedColor": { "alias": "checkedColor"; "required": false; "isSignal": true; }; "checkedVariant": { "alias": "checkedVariant"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; }, never, never, true, never>;
|
|
232
371
|
}
|
|
233
372
|
|
|
234
373
|
interface ChipConfig {
|
|
@@ -242,6 +381,7 @@ declare const CHIP_CONFIG: InjectionToken<ChipConfig>;
|
|
|
242
381
|
|
|
243
382
|
interface ChipControlConfig {
|
|
244
383
|
checkedColor: chipColor | undefined;
|
|
384
|
+
checkedVariant: chipVariant | undefined;
|
|
245
385
|
}
|
|
246
386
|
declare const DEFAULT_CHIP_CONTROL_CONFIG: ChipControlConfig;
|
|
247
387
|
|
|
@@ -424,6 +564,55 @@ declare const DEFAULT_DATE_TIME_PICKER_CONFIG: DateTimePickerConfig;
|
|
|
424
564
|
|
|
425
565
|
declare const DATE_TIME_PICKER_CONFIG: InjectionToken<DateTimePickerConfig>;
|
|
426
566
|
|
|
567
|
+
type chipGroupType = selectionMode;
|
|
568
|
+
interface ChipGroupOptionContext<V = unknown> {
|
|
569
|
+
option: Option<V>;
|
|
570
|
+
selected: boolean;
|
|
571
|
+
disabled: boolean;
|
|
572
|
+
index: number;
|
|
573
|
+
}
|
|
574
|
+
type chipGroupTemplateContext<V = unknown> = {
|
|
575
|
+
$implicit: ChipGroupOptionContext<V>;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
declare class ChipGroup<T, V = unknown> extends SelectionGroup<T, V> {
|
|
579
|
+
private readonly _config;
|
|
580
|
+
protected CLASS_NAME: string;
|
|
581
|
+
readonly type: InputSignal<chipGroupType>;
|
|
582
|
+
readonly unselectable: InputSignalWithTransform<boolean, unknown>;
|
|
583
|
+
readonly size: InputSignal<controlSize>;
|
|
584
|
+
readonly color: InputSignal<chipColor>;
|
|
585
|
+
readonly checkedColor: InputSignal<_thalassic_ui.color | undefined>;
|
|
586
|
+
readonly variant: InputSignal<chipVariant>;
|
|
587
|
+
readonly checkedVariant: InputSignal<chipVariant | undefined>;
|
|
588
|
+
readonly orientation: InputSignal<orientation>;
|
|
589
|
+
readonly rounded: InputSignalWithTransform<boolean, unknown>;
|
|
590
|
+
protected readonly startIconTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
591
|
+
protected readonly endIconTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
592
|
+
protected readonly labelTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
593
|
+
protected readonly classes: Signal<string[]>;
|
|
594
|
+
protected isDisabled(option: Option<V>): boolean;
|
|
595
|
+
protected optionClasses(option: Option<V>): string[];
|
|
596
|
+
protected optionContext(option: Option<V>, index: number): chipGroupTemplateContext<V>;
|
|
597
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChipGroup<any, any>, never>;
|
|
598
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ChipGroup<any, any>, "tls-chip-group", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "unselectable": { "alias": "unselectable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "checkedColor": { "alias": "checkedColor"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "checkedVariant": { "alias": "checkedVariant"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "rounded": { "alias": "rounded"; "required": false; "isSignal": true; }; }, {}, ["startIconTemplate", "endIconTemplate", "labelTemplate"], never, true, never>;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
interface ChipGroupConfig {
|
|
602
|
+
size: controlSize;
|
|
603
|
+
color: chipColor;
|
|
604
|
+
checkedColor: chipColor | undefined;
|
|
605
|
+
variant: chipVariant;
|
|
606
|
+
checkedVariant: chipVariant | undefined;
|
|
607
|
+
orientation: orientation;
|
|
608
|
+
type: chipGroupType;
|
|
609
|
+
unselectable: boolean;
|
|
610
|
+
rounded: boolean;
|
|
611
|
+
}
|
|
612
|
+
declare const DEFAULT_CHIP_GROUP_CONFIG: ChipGroupConfig;
|
|
613
|
+
|
|
614
|
+
declare const CHIP_GROUP_CONFIG: InjectionToken<ChipGroupConfig>;
|
|
615
|
+
|
|
427
616
|
declare class ChipInput extends ValueFormControl<string[]> {
|
|
428
617
|
private readonly _config;
|
|
429
618
|
readonly value: ModelSignal<string[]>;
|
|
@@ -613,117 +802,6 @@ declare class RadioButton extends ValueFormControl<unknown> {
|
|
|
613
802
|
static ɵcmp: i0.ɵɵComponentDeclaration<RadioButton, "tls-radio-button", never, { "radioValue": { "alias": "radioValue"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
614
803
|
}
|
|
615
804
|
|
|
616
|
-
interface ConnectedOverlayConfig {
|
|
617
|
-
/** Template projected into the overlay. */
|
|
618
|
-
content: TemplateRef<unknown>;
|
|
619
|
-
/** Element or point the overlay is anchored to. */
|
|
620
|
-
origin: FlexibleConnectedPositionStrategyOrigin;
|
|
621
|
-
/** Connected positions to try, in order of preference. */
|
|
622
|
-
positions: ConnectedPosition[];
|
|
623
|
-
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
624
|
-
flexibleDimensions?: boolean;
|
|
625
|
-
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
626
|
-
push?: boolean;
|
|
627
|
-
/** Scroll handling while open. Defaults to `'reposition'`. */
|
|
628
|
-
scrollStrategy?: 'reposition' | 'close';
|
|
629
|
-
/** Whether to render a backdrop. Defaults to `true`. */
|
|
630
|
-
hasBackdrop?: boolean;
|
|
631
|
-
/** Backdrop class when a backdrop is rendered. Defaults to the transparent backdrop. */
|
|
632
|
-
backdropClass?: string;
|
|
633
|
-
/** Extra class(es) applied to the overlay pane. */
|
|
634
|
-
panelClass?: string | string[];
|
|
635
|
-
/** Close when the backdrop is clicked. Defaults to `true` when a backdrop is rendered. */
|
|
636
|
-
closeOnBackdropClick?: boolean;
|
|
637
|
-
/** Close on an outside pointer event. Defaults to `true` when no backdrop is rendered. */
|
|
638
|
-
closeOnOutsidePointer?: boolean;
|
|
639
|
-
/** Close when Escape is pressed. Defaults to `true`. */
|
|
640
|
-
closeOnEscape?: boolean;
|
|
641
|
-
/** Minimum width applied to the pane on every open (e.g. to match a trigger). */
|
|
642
|
-
minWidth?: number | string;
|
|
643
|
-
/**
|
|
644
|
-
* Keep the overlay alive across open/close (detach instead of dispose), so the
|
|
645
|
-
* same instance is reused on the next open. Defaults to `false`.
|
|
646
|
-
*/
|
|
647
|
-
reuse?: boolean;
|
|
648
|
-
/** Invoked after the overlay closes, from any cause (explicit, backdrop, outside, Escape). */
|
|
649
|
-
onClose?: () => void;
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Owns the CDK-Overlay lifecycle shared by the library's connected overlay
|
|
653
|
-
* components (popover, menu, select): create/attach, dismissal wiring
|
|
654
|
-
* (backdrop / outside-pointer / Escape), `isOpen` state, and disposal. The
|
|
655
|
-
* positional and dismissal differences between components are expressed through
|
|
656
|
-
* {@link ConnectedOverlayConfig} rather than duplicated per component.
|
|
657
|
-
*
|
|
658
|
-
* Create one via {@link createOverlayManager} from a component field initializer
|
|
659
|
-
* so it is bound to the host's injection context.
|
|
660
|
-
*/
|
|
661
|
-
declare class OverlayManager {
|
|
662
|
-
private readonly _overlay;
|
|
663
|
-
private readonly _viewContainerRef;
|
|
664
|
-
private readonly _destroyRef;
|
|
665
|
-
private _overlayRef;
|
|
666
|
-
private _config;
|
|
667
|
-
private readonly _isOpen;
|
|
668
|
-
readonly isOpen: i0.Signal<boolean>;
|
|
669
|
-
private readonly _teardown;
|
|
670
|
-
open(config: ConnectedOverlayConfig): void;
|
|
671
|
-
close(): void;
|
|
672
|
-
private _buildPositionStrategy;
|
|
673
|
-
private _wireDismissal;
|
|
674
|
-
private _dispose;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Shared base for the single {@link Select} and {@link MultiSelect} controls.
|
|
679
|
-
* Owns everything the two listbox-combobox controls have in common: the option
|
|
680
|
-
* inputs, the connected overlay lifecycle, roving `aria-activedescendant`
|
|
681
|
-
* navigation, and the keyboard handler. The per-control differences (the value
|
|
682
|
-
* shape, the selected-state check, how the trigger label is built and what a
|
|
683
|
-
* commit does) are expressed through the abstract members below.
|
|
684
|
-
*/
|
|
685
|
-
declare abstract class AbstractSelect<T, V, ValueType> extends ValueFormControl<ValueType> {
|
|
686
|
-
protected readonly overlay: OverlayManager;
|
|
687
|
-
private readonly triggerElement;
|
|
688
|
-
private readonly panelTemplate;
|
|
689
|
-
readonly inputId: InputSignal<string | null>;
|
|
690
|
-
readonly options: InputSignal<optionInput<T>[]>;
|
|
691
|
-
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
692
|
-
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
693
|
-
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
694
|
-
readonly tabindex: InputSignal<string | number>;
|
|
695
|
-
abstract readonly placeholder: InputSignal<string>;
|
|
696
|
-
abstract readonly size: InputSignal<controlSize>;
|
|
697
|
-
abstract readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
698
|
-
abstract readonly clearable: InputSignalWithTransform<boolean, unknown>;
|
|
699
|
-
protected readonly isOpen: Signal<boolean>;
|
|
700
|
-
protected readonly activeIndex: WritableSignal<number>;
|
|
701
|
-
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
702
|
-
protected readonly activeDescendantId: Signal<string | null>;
|
|
703
|
-
protected readonly hostClasses: Signal<string[]>;
|
|
704
|
-
protected get listboxId(): string;
|
|
705
|
-
protected abstract readonly uniqueId: string;
|
|
706
|
-
protected abstract readonly hostClassBase: string;
|
|
707
|
-
protected abstract readonly panelClass: string;
|
|
708
|
-
protected abstract readonly hasValue: Signal<boolean>;
|
|
709
|
-
/** Index the active option starts on when the panel opens. */
|
|
710
|
-
protected abstract getInitialActiveIndex(): number;
|
|
711
|
-
/** Apply the active option's selection when committed via mouse or keyboard. */
|
|
712
|
-
protected abstract commitActiveOption(option: Option<V>): void;
|
|
713
|
-
/** Reset the control to its empty value. */
|
|
714
|
-
protected abstract clear(): void;
|
|
715
|
-
protected open(): void;
|
|
716
|
-
protected close(): void;
|
|
717
|
-
protected toggle(): void;
|
|
718
|
-
protected onOptionHover(index: number, disabled?: boolean): void;
|
|
719
|
-
protected onKeydown(event: KeyboardEvent): void;
|
|
720
|
-
protected optionId(index: number): string;
|
|
721
|
-
private moveActive;
|
|
722
|
-
private moveActiveToEdge;
|
|
723
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractSelect<any, any, any>, never>;
|
|
724
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AbstractSelect<any, any, any>, never, never, { "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": false; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": false; "isSignal": true; }; "optionDisabled": { "alias": "optionDisabled"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
725
|
-
}
|
|
726
|
-
|
|
727
805
|
declare class MultiSelect<T, V = unknown> extends AbstractSelect<T, V, V[]> {
|
|
728
806
|
private static _nextUniqueId;
|
|
729
807
|
private readonly _config;
|
|
@@ -840,16 +918,11 @@ declare class Textarea extends ValueFormControl<string> {
|
|
|
840
918
|
|
|
841
919
|
declare const TEXTAREA_CONFIG: InjectionToken<TextareaConfig>;
|
|
842
920
|
|
|
843
|
-
type toggleGroupType =
|
|
921
|
+
type toggleGroupType = selectionMode;
|
|
844
922
|
|
|
845
|
-
declare class ToggleGroup<T, V = unknown> extends
|
|
923
|
+
declare class ToggleGroup<T, V = unknown> extends SelectionGroup<T, V> {
|
|
846
924
|
private readonly _config;
|
|
847
925
|
protected CLASS_NAME: string;
|
|
848
|
-
readonly value: ModelSignal<V[]>;
|
|
849
|
-
readonly options: InputSignal<optionInput<T>[]>;
|
|
850
|
-
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
851
|
-
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
852
|
-
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
853
926
|
readonly type: InputSignal<toggleGroupType>;
|
|
854
927
|
readonly unselectable: InputSignalWithTransform<boolean, unknown>;
|
|
855
928
|
readonly size: InputSignal<controlSize>;
|
|
@@ -858,12 +931,9 @@ declare class ToggleGroup<T, V = unknown> extends ValueFormControl<V[]> {
|
|
|
858
931
|
protected readonly optionTemplate: Signal<TemplateRef<{
|
|
859
932
|
$implicit: Option<V>;
|
|
860
933
|
}> | undefined>;
|
|
861
|
-
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
862
934
|
protected readonly classes: Signal<string[]>;
|
|
863
|
-
protected isSelected(optionValue: V): boolean;
|
|
864
|
-
protected select(option: Option<V>): void;
|
|
865
935
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleGroup<any, any>, never>;
|
|
866
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleGroup<any, any>, "tls-toggle-group", never, { "
|
|
936
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleGroup<any, any>, "tls-toggle-group", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "unselectable": { "alias": "unselectable"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; }, {}, ["optionTemplate"], never, true, never>;
|
|
867
937
|
}
|
|
868
938
|
|
|
869
939
|
interface ToggleGroupConfig {
|
|
@@ -1314,5 +1384,5 @@ declare const TOOLTIP_CONFIG: InjectionToken<TooltipConfig>;
|
|
|
1314
1384
|
|
|
1315
1385
|
declare const provideThalassicUIConfig: (config: tlsUiConfigProvider) => EnvironmentProviders;
|
|
1316
1386
|
|
|
1317
|
-
export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_INPUT_CONFIG, Checkbox, Chip, ChipControl, ChipInput, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FILE_UPLOADER_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FILE_UPLOADER_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileUploader, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, LOADER_CONFIG, Loader, MENU_CONFIG, MULTI_SELECT_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, PAGINATION_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TEXTAREA_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, Textarea, ToggleGroup, TooltipDirective, provideThalassicUIConfig };
|
|
1318
|
-
export type { AlertConfig, ButtonConfig, CheckboxConfig, ChipConfig, ChipContext, ChipControlConfig, ChipInputConfig, DateTimePickerConfig, DialogConfig, DialogOpenConfig, DividerConfig, FileUploaderConfig, FileUploaderDropZoneContext, FileUploaderFileContext, FormControlGroupConfig, FormItemConfig, IconConfig, InputConfig, LoaderConfig, MenuActionItem, MenuConfig, MenuCustomItem, MenuDivider, MenuItemDefinition, MenuLabel, MultiSelectConfig, PaginationConfig, PasswordConfig, PinInputConfig, PopoverConfig, RadioButtonConfig, SelectConfig, SkeletonConfig, StepConfig, StepperConfig, StepperSelectEvent, SwitchConfig, TableColumnDefinition, TableConfig, TableData, TableTrackBy, TabsConfig, TextareaConfig, ToggleGroupConfig, TooltipConfig, acceptInput, chipColor, chipTemplateContext, chipVariant, color, controlSize, dateTimePickerMode, dialogSize, dividerContentPosition, dividerOrientation, dividerVariant, fileUploaderDragState, menuItemType, menuPosition, orientation, overlayPosition, paginationItem, pinInputType, size, stepperColor, stepperOrientation, stepperValue, tableColumnAlignment, textareaResize, tlsUiConfigProvider, toggleGroupType, tooltipColor, tooltipOrigin, tooltipPosition };
|
|
1387
|
+
export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, CHIP_CONFIG, CHIP_CONTROL_CONFIG, CHIP_GROUP_CONFIG, CHIP_INPUT_CONFIG, Checkbox, Chip, ChipControl, ChipGroup, ChipInput, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_CHIP_CONFIG, DEFAULT_CHIP_CONTROL_CONFIG, DEFAULT_CHIP_GROUP_CONFIG, DEFAULT_CHIP_INPUT_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FILE_UPLOADER_CONFIG, DEFAULT_FORM_CONTROL_GROUP_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_CONFIG, DEFAULT_MULTI_SELECT_CONFIG, DEFAULT_PAGINATION_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_PIN_INPUT_CONFIG, DEFAULT_POPOVER_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SELECT_CONFIG, DEFAULT_SKELETON_CONFIG, DEFAULT_STEPPER_CONFIG, DEFAULT_STEP_CONFIG, DEFAULT_SWITCH_CONFIG, DEFAULT_TABLE_CONFIG, DEFAULT_TABS_CONFIG, DEFAULT_TEXTAREA_CONFIG, DEFAULT_TOGGLE_GROUP_CONFIG, DEFAULT_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FILE_UPLOADER_CONFIG, FORM_CONTROL_GROUP_CONFIG, FORM_ITEM_CONFIG, FileUploader, FormControlAddon, FormControlGroup, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, LOADER_CONFIG, Loader, MENU_CONFIG, MULTI_SELECT_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, MultiSelect, PAGINATION_CONFIG, PASSWORD_CONFIG, PIN_INPUT_CONFIG, POPOVER_CONFIG, Pagination, Password, PinInput, Popover, RADIO_BUTTON_CONFIG, RadioButton, SELECT_CONFIG, SKELETON_CONFIG, STEPPER_CONFIG, SWITCH_CONFIG, Select, Skeleton, Step, Stepper, Switch, TABLE_CONFIG, TABS_CONFIG, TEXTAREA_CONFIG, TOGGLE_GROUP_CONFIG, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, Textarea, ToggleGroup, TooltipDirective, provideThalassicUIConfig };
|
|
1388
|
+
export type { AlertConfig, ButtonConfig, CheckboxConfig, ChipConfig, ChipContext, ChipControlConfig, ChipGroupConfig, ChipGroupOptionContext, ChipInputConfig, DateTimePickerConfig, DialogConfig, DialogOpenConfig, DividerConfig, FileUploaderConfig, FileUploaderDropZoneContext, FileUploaderFileContext, FormControlGroupConfig, FormItemConfig, IconConfig, InputConfig, LoaderConfig, MenuActionItem, MenuConfig, MenuCustomItem, MenuDivider, MenuItemDefinition, MenuLabel, MultiSelectConfig, PaginationConfig, PasswordConfig, PinInputConfig, PopoverConfig, RadioButtonConfig, SelectConfig, SkeletonConfig, StepConfig, StepperConfig, StepperSelectEvent, SwitchConfig, TableColumnDefinition, TableConfig, TableData, TableTrackBy, TabsConfig, TextareaConfig, ToggleGroupConfig, TooltipConfig, acceptInput, chipColor, chipGroupTemplateContext, chipGroupType, chipTemplateContext, chipVariant, color, controlSize, dateTimePickerMode, dialogSize, dividerContentPosition, dividerOrientation, dividerVariant, fileUploaderDragState, menuItemType, menuPosition, orientation, overlayPosition, paginationItem, pinInputType, size, stepperColor, stepperOrientation, stepperValue, tableColumnAlignment, textareaResize, tlsUiConfigProvider, toggleGroupType, tooltipColor, tooltipOrigin, tooltipPosition };
|