@thalassic/ui 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/thalassic-ui.mjs +438 -335
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/thalassic-ui.d.ts +199 -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';
|
|
@@ -196,6 +196,12 @@ declare abstract class FormControl implements FormUiControl {
|
|
|
196
196
|
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
197
|
}
|
|
198
198
|
|
|
199
|
+
declare abstract class ValueFormControl<T> extends FormControl implements FormValueControl<T> {
|
|
200
|
+
abstract readonly value: ModelSignal<T>;
|
|
201
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueFormControl<any>, never>;
|
|
202
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueFormControl<any>, never, never, {}, {}, never, never, true, never>;
|
|
203
|
+
}
|
|
204
|
+
|
|
199
205
|
declare abstract class CheckboxFormControl extends FormControl implements FormCheckboxControl {
|
|
200
206
|
abstract readonly checked: ModelSignal<boolean>;
|
|
201
207
|
protected controlClasses: i0.Signal<string[]>;
|
|
@@ -211,10 +217,141 @@ interface Option<V = unknown> {
|
|
|
211
217
|
|
|
212
218
|
type optionInput<T> = string | number | T;
|
|
213
219
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
220
|
+
type selectionMode = 'single' | 'multiple';
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Shared base for controls that present a list of options and store the
|
|
224
|
+
* selected option values as an array (e.g. toggle group, chip group).
|
|
225
|
+
*
|
|
226
|
+
* Subclasses provide the visual shell plus the `type`/`unselectable` inputs
|
|
227
|
+
* (their defaults differ per component), while this base owns the selection
|
|
228
|
+
* state machine: value model, option normalization, and the toggle logic.
|
|
229
|
+
*/
|
|
230
|
+
declare abstract class SelectionGroup<T, V = unknown> extends ValueFormControl<V[]> {
|
|
231
|
+
readonly value: ModelSignal<V[]>;
|
|
232
|
+
readonly options: InputSignal<optionInput<T>[]>;
|
|
233
|
+
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
234
|
+
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
235
|
+
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
236
|
+
abstract readonly type: Signal<selectionMode>;
|
|
237
|
+
abstract readonly unselectable: Signal<boolean>;
|
|
238
|
+
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
239
|
+
protected isSelected(optionValue: V): boolean;
|
|
240
|
+
protected select(option: Option<V>): void;
|
|
241
|
+
protected onKeyboardSelect(event: Event, option: Option<V>): void;
|
|
242
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionGroup<any, any>, never>;
|
|
243
|
+
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>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface ConnectedOverlayConfig {
|
|
247
|
+
/** Template projected into the overlay. */
|
|
248
|
+
content: TemplateRef<unknown>;
|
|
249
|
+
/** Element or point the overlay is anchored to. */
|
|
250
|
+
origin: FlexibleConnectedPositionStrategyOrigin;
|
|
251
|
+
/** Connected positions to try, in order of preference. */
|
|
252
|
+
positions: ConnectedPosition[];
|
|
253
|
+
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
254
|
+
flexibleDimensions?: boolean;
|
|
255
|
+
/** Forwarded to the position strategy. Defaults to the CDK default (true). */
|
|
256
|
+
push?: boolean;
|
|
257
|
+
/** Scroll handling while open. Defaults to `'reposition'`. */
|
|
258
|
+
scrollStrategy?: 'reposition' | 'close';
|
|
259
|
+
/** Whether to render a backdrop. Defaults to `true`. */
|
|
260
|
+
hasBackdrop?: boolean;
|
|
261
|
+
/** Backdrop class when a backdrop is rendered. Defaults to the transparent backdrop. */
|
|
262
|
+
backdropClass?: string;
|
|
263
|
+
/** Extra class(es) applied to the overlay pane. */
|
|
264
|
+
panelClass?: string | string[];
|
|
265
|
+
/** Close when the backdrop is clicked. Defaults to `true` when a backdrop is rendered. */
|
|
266
|
+
closeOnBackdropClick?: boolean;
|
|
267
|
+
/** Close on an outside pointer event. Defaults to `true` when no backdrop is rendered. */
|
|
268
|
+
closeOnOutsidePointer?: boolean;
|
|
269
|
+
/** Close when Escape is pressed. Defaults to `true`. */
|
|
270
|
+
closeOnEscape?: boolean;
|
|
271
|
+
/** Minimum width applied to the pane on every open (e.g. to match a trigger). */
|
|
272
|
+
minWidth?: number | string;
|
|
273
|
+
/**
|
|
274
|
+
* Keep the overlay alive across open/close (detach instead of dispose), so the
|
|
275
|
+
* same instance is reused on the next open. Defaults to `false`.
|
|
276
|
+
*/
|
|
277
|
+
reuse?: boolean;
|
|
278
|
+
/** Invoked after the overlay closes, from any cause (explicit, backdrop, outside, Escape). */
|
|
279
|
+
onClose?: () => void;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Owns the CDK-Overlay lifecycle shared by the library's connected overlay
|
|
283
|
+
* components (popover, menu, select): create/attach, dismissal wiring
|
|
284
|
+
* (backdrop / outside-pointer / Escape), `isOpen` state, and disposal. The
|
|
285
|
+
* positional and dismissal differences between components are expressed through
|
|
286
|
+
* {@link ConnectedOverlayConfig} rather than duplicated per component.
|
|
287
|
+
*
|
|
288
|
+
* Create one via {@link createOverlayManager} from a component field initializer
|
|
289
|
+
* so it is bound to the host's injection context.
|
|
290
|
+
*/
|
|
291
|
+
declare class OverlayManager {
|
|
292
|
+
private readonly _overlay;
|
|
293
|
+
private readonly _viewContainerRef;
|
|
294
|
+
private readonly _destroyRef;
|
|
295
|
+
private _overlayRef;
|
|
296
|
+
private _config;
|
|
297
|
+
private readonly _isOpen;
|
|
298
|
+
readonly isOpen: i0.Signal<boolean>;
|
|
299
|
+
private readonly _teardown;
|
|
300
|
+
open(config: ConnectedOverlayConfig): void;
|
|
301
|
+
close(): void;
|
|
302
|
+
private _buildPositionStrategy;
|
|
303
|
+
private _wireDismissal;
|
|
304
|
+
private _dispose;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Shared base for the single {@link Select} and {@link MultiSelect} controls.
|
|
309
|
+
* Owns everything the two listbox-combobox controls have in common: the option
|
|
310
|
+
* inputs, the connected overlay lifecycle, roving `aria-activedescendant`
|
|
311
|
+
* navigation, and the keyboard handler. The per-control differences (the value
|
|
312
|
+
* shape, the selected-state check, how the trigger label is built and what a
|
|
313
|
+
* commit does) are expressed through the abstract members below.
|
|
314
|
+
*/
|
|
315
|
+
declare abstract class AbstractSelect<T, V, ValueType> extends ValueFormControl<ValueType> {
|
|
316
|
+
protected readonly overlay: OverlayManager;
|
|
317
|
+
private readonly triggerElement;
|
|
318
|
+
private readonly panelTemplate;
|
|
319
|
+
readonly inputId: InputSignal<string | null>;
|
|
320
|
+
readonly options: InputSignal<optionInput<T>[]>;
|
|
321
|
+
readonly optionLabel: InputSignal<keyof T | undefined>;
|
|
322
|
+
readonly optionValue: InputSignal<keyof T | undefined>;
|
|
323
|
+
readonly optionDisabled: InputSignal<keyof T | undefined>;
|
|
324
|
+
readonly tabindex: InputSignal<string | number>;
|
|
325
|
+
abstract readonly placeholder: InputSignal<string>;
|
|
326
|
+
abstract readonly size: InputSignal<controlSize>;
|
|
327
|
+
abstract readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
328
|
+
abstract readonly clearable: InputSignalWithTransform<boolean, unknown>;
|
|
329
|
+
protected readonly isOpen: Signal<boolean>;
|
|
330
|
+
protected readonly activeIndex: WritableSignal<number>;
|
|
331
|
+
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
332
|
+
protected readonly activeDescendantId: Signal<string | null>;
|
|
333
|
+
protected readonly hostClasses: Signal<string[]>;
|
|
334
|
+
protected get listboxId(): string;
|
|
335
|
+
protected abstract readonly uniqueId: string;
|
|
336
|
+
protected abstract readonly hostClassBase: string;
|
|
337
|
+
protected abstract readonly panelClass: string;
|
|
338
|
+
protected abstract readonly hasValue: Signal<boolean>;
|
|
339
|
+
/** Index the active option starts on when the panel opens. */
|
|
340
|
+
protected abstract getInitialActiveIndex(): number;
|
|
341
|
+
/** Apply the active option's selection when committed via mouse or keyboard. */
|
|
342
|
+
protected abstract commitActiveOption(option: Option<V>): void;
|
|
343
|
+
/** Reset the control to its empty value. */
|
|
344
|
+
protected abstract clear(): void;
|
|
345
|
+
protected open(): void;
|
|
346
|
+
protected close(): void;
|
|
347
|
+
protected toggle(): void;
|
|
348
|
+
protected onOptionHover(index: number, disabled?: boolean): void;
|
|
349
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
350
|
+
protected optionId(index: number): string;
|
|
351
|
+
private moveActive;
|
|
352
|
+
private moveActiveToEdge;
|
|
353
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractSelect<any, any, any>, never>;
|
|
354
|
+
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
355
|
}
|
|
219
356
|
|
|
220
357
|
declare class ChipControl extends CheckboxFormControl {
|
|
@@ -223,12 +360,13 @@ declare class ChipControl extends CheckboxFormControl {
|
|
|
223
360
|
private _chip;
|
|
224
361
|
readonly checked: i0.ModelSignal<boolean>;
|
|
225
362
|
readonly checkedColor: i0.InputSignal<_thalassic_ui.color | undefined>;
|
|
363
|
+
readonly checkedVariant: i0.InputSignal<chipVariant | undefined>;
|
|
226
364
|
protected hostClasses: i0.Signal<string[]>;
|
|
227
365
|
constructor();
|
|
228
366
|
protected toggle(): void;
|
|
229
367
|
protected onKeyboardToggle(event: Event): void;
|
|
230
368
|
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>;
|
|
369
|
+
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
370
|
}
|
|
233
371
|
|
|
234
372
|
interface ChipConfig {
|
|
@@ -242,6 +380,7 @@ declare const CHIP_CONFIG: InjectionToken<ChipConfig>;
|
|
|
242
380
|
|
|
243
381
|
interface ChipControlConfig {
|
|
244
382
|
checkedColor: chipColor | undefined;
|
|
383
|
+
checkedVariant: chipVariant | undefined;
|
|
245
384
|
}
|
|
246
385
|
declare const DEFAULT_CHIP_CONTROL_CONFIG: ChipControlConfig;
|
|
247
386
|
|
|
@@ -424,6 +563,55 @@ declare const DEFAULT_DATE_TIME_PICKER_CONFIG: DateTimePickerConfig;
|
|
|
424
563
|
|
|
425
564
|
declare const DATE_TIME_PICKER_CONFIG: InjectionToken<DateTimePickerConfig>;
|
|
426
565
|
|
|
566
|
+
type chipGroupType = selectionMode;
|
|
567
|
+
interface ChipGroupOptionContext<V = unknown> {
|
|
568
|
+
option: Option<V>;
|
|
569
|
+
selected: boolean;
|
|
570
|
+
disabled: boolean;
|
|
571
|
+
index: number;
|
|
572
|
+
}
|
|
573
|
+
type chipGroupTemplateContext<V = unknown> = {
|
|
574
|
+
$implicit: ChipGroupOptionContext<V>;
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
declare class ChipGroup<T, V = unknown> extends SelectionGroup<T, V> {
|
|
578
|
+
private readonly _config;
|
|
579
|
+
protected CLASS_NAME: string;
|
|
580
|
+
readonly type: InputSignal<chipGroupType>;
|
|
581
|
+
readonly unselectable: InputSignalWithTransform<boolean, unknown>;
|
|
582
|
+
readonly size: InputSignal<controlSize>;
|
|
583
|
+
readonly color: InputSignal<chipColor>;
|
|
584
|
+
readonly checkedColor: InputSignal<_thalassic_ui.color | undefined>;
|
|
585
|
+
readonly variant: InputSignal<chipVariant>;
|
|
586
|
+
readonly checkedVariant: InputSignal<chipVariant | undefined>;
|
|
587
|
+
readonly orientation: InputSignal<orientation>;
|
|
588
|
+
readonly rounded: InputSignalWithTransform<boolean, unknown>;
|
|
589
|
+
protected readonly startIconTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
590
|
+
protected readonly endIconTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
591
|
+
protected readonly labelTemplate: Signal<TemplateRef<chipGroupTemplateContext<V>> | undefined>;
|
|
592
|
+
protected readonly classes: Signal<string[]>;
|
|
593
|
+
protected isDisabled(option: Option<V>): boolean;
|
|
594
|
+
protected optionClasses(option: Option<V>): string[];
|
|
595
|
+
protected optionContext(option: Option<V>, index: number): chipGroupTemplateContext<V>;
|
|
596
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ChipGroup<any, any>, never>;
|
|
597
|
+
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>;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
interface ChipGroupConfig {
|
|
601
|
+
size: controlSize;
|
|
602
|
+
color: chipColor;
|
|
603
|
+
checkedColor: chipColor | undefined;
|
|
604
|
+
variant: chipVariant;
|
|
605
|
+
checkedVariant: chipVariant | undefined;
|
|
606
|
+
orientation: orientation;
|
|
607
|
+
type: chipGroupType;
|
|
608
|
+
unselectable: boolean;
|
|
609
|
+
rounded: boolean;
|
|
610
|
+
}
|
|
611
|
+
declare const DEFAULT_CHIP_GROUP_CONFIG: ChipGroupConfig;
|
|
612
|
+
|
|
613
|
+
declare const CHIP_GROUP_CONFIG: InjectionToken<ChipGroupConfig>;
|
|
614
|
+
|
|
427
615
|
declare class ChipInput extends ValueFormControl<string[]> {
|
|
428
616
|
private readonly _config;
|
|
429
617
|
readonly value: ModelSignal<string[]>;
|
|
@@ -613,117 +801,6 @@ declare class RadioButton extends ValueFormControl<unknown> {
|
|
|
613
801
|
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
802
|
}
|
|
615
803
|
|
|
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
804
|
declare class MultiSelect<T, V = unknown> extends AbstractSelect<T, V, V[]> {
|
|
728
805
|
private static _nextUniqueId;
|
|
729
806
|
private readonly _config;
|
|
@@ -840,16 +917,11 @@ declare class Textarea extends ValueFormControl<string> {
|
|
|
840
917
|
|
|
841
918
|
declare const TEXTAREA_CONFIG: InjectionToken<TextareaConfig>;
|
|
842
919
|
|
|
843
|
-
type toggleGroupType =
|
|
920
|
+
type toggleGroupType = selectionMode;
|
|
844
921
|
|
|
845
|
-
declare class ToggleGroup<T, V = unknown> extends
|
|
922
|
+
declare class ToggleGroup<T, V = unknown> extends SelectionGroup<T, V> {
|
|
846
923
|
private readonly _config;
|
|
847
924
|
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
925
|
readonly type: InputSignal<toggleGroupType>;
|
|
854
926
|
readonly unselectable: InputSignalWithTransform<boolean, unknown>;
|
|
855
927
|
readonly size: InputSignal<controlSize>;
|
|
@@ -858,12 +930,9 @@ declare class ToggleGroup<T, V = unknown> extends ValueFormControl<V[]> {
|
|
|
858
930
|
protected readonly optionTemplate: Signal<TemplateRef<{
|
|
859
931
|
$implicit: Option<V>;
|
|
860
932
|
}> | undefined>;
|
|
861
|
-
protected readonly normalizedOptions: Signal<Option<V>[]>;
|
|
862
933
|
protected readonly classes: Signal<string[]>;
|
|
863
|
-
protected isSelected(optionValue: V): boolean;
|
|
864
|
-
protected select(option: Option<V>): void;
|
|
865
934
|
static ɵfac: i0.ɵɵFactoryDeclaration<ToggleGroup<any, any>, never>;
|
|
866
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ToggleGroup<any, any>, "tls-toggle-group", never, { "
|
|
935
|
+
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
936
|
}
|
|
868
937
|
|
|
869
938
|
interface ToggleGroupConfig {
|
|
@@ -1314,5 +1383,5 @@ declare const TOOLTIP_CONFIG: InjectionToken<TooltipConfig>;
|
|
|
1314
1383
|
|
|
1315
1384
|
declare const provideThalassicUIConfig: (config: tlsUiConfigProvider) => EnvironmentProviders;
|
|
1316
1385
|
|
|
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 };
|
|
1386
|
+
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 };
|
|
1387
|
+
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 };
|