@thalassic/ui 0.8.2 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thalassic/ui",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "peerDependencies": {
6
6
  "@angular/cdk": "^21.0.0",
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InputSignal, InputSignalWithTransform, InjectionToken, ModelSignal, Signal, WritableSignal, OnDestroy, TemplateRef, OutputEmitterRef, TrackByFunction, EnvironmentProviders } from '@angular/core';
2
+ import { InputSignal, InputSignalWithTransform, InjectionToken, ModelSignal, Signal, WritableSignal, TemplateRef, OutputEmitterRef, TrackByFunction, OnDestroy, EnvironmentProviders } from '@angular/core';
3
3
  import * as _thalassic_ui from '@thalassic/ui';
4
4
  import { CdkDialogContainer, DialogRole, DialogRef } from '@angular/cdk/dialog';
5
5
  import { ComponentType } from '@angular/cdk/portal';
@@ -39,6 +39,7 @@ interface tlsUiConfigProvider {
39
39
  stepper?: Partial<StepperConfig>;
40
40
  table?: Partial<TableConfig>;
41
41
  tabs?: Partial<TabsConfig>;
42
+ textarea?: Partial<TextareaConfig>;
42
43
  tooltip?: Partial<TooltipConfig>;
43
44
  };
44
45
  }
@@ -423,15 +424,11 @@ interface NormalizedOption<V = unknown> {
423
424
  label: string;
424
425
  disabled: boolean;
425
426
  }
426
- declare class Select<T, V = unknown> extends ValueFormControl<V | null> implements OnDestroy {
427
+ declare class Select<T, V = unknown> extends ValueFormControl<V | null> {
427
428
  private readonly _config;
428
429
  private readonly _overlay;
429
- private readonly _viewContainerRef;
430
- private readonly _destroyRef;
431
430
  private readonly _triggerElement;
432
431
  private readonly _panelTemplate;
433
- private _overlayRef;
434
- private _portal;
435
432
  readonly value: ModelSignal<V | null>;
436
433
  readonly inputId: InputSignal<string | null>;
437
434
  readonly options: InputSignal<selectOptionType<T>[]>;
@@ -443,7 +440,7 @@ declare class Select<T, V = unknown> extends ValueFormControl<V | null> implemen
443
440
  readonly fluid: InputSignalWithTransform<boolean, unknown>;
444
441
  readonly tabindex: InputSignal<string | number>;
445
442
  readonly clearable: InputSignalWithTransform<boolean, unknown>;
446
- protected readonly isOpen: WritableSignal<boolean>;
443
+ protected readonly isOpen: Signal<boolean>;
447
444
  protected readonly activeIndex: WritableSignal<number>;
448
445
  protected readonly normalizedOptions: Signal<NormalizedOption<V>[]>;
449
446
  protected readonly hasValue: Signal<boolean>;
@@ -457,7 +454,6 @@ declare class Select<T, V = unknown> extends ValueFormControl<V | null> implemen
457
454
  protected onOptionHover(index: number, disabled?: boolean): void;
458
455
  protected onKeydown(event: KeyboardEvent): void;
459
456
  private _moveActive;
460
- ngOnDestroy(): void;
461
457
  static ɵfac: i0.ɵɵFactoryDeclaration<Select<any, any>, never>;
462
458
  static ɵcmp: i0.ɵɵComponentDeclaration<Select<any, any>, "tls-select", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "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; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
463
459
  }
@@ -495,6 +491,33 @@ declare const DEFAULT_SWITCH_CONFIG: SwitchConfig;
495
491
 
496
492
  declare const SWITCH_CONFIG: InjectionToken<SwitchConfig>;
497
493
 
494
+ type textareaResize = 'none' | 'both' | 'horizontal' | 'vertical';
495
+ interface TextareaConfig {
496
+ size: controlSize;
497
+ placeholder: string;
498
+ fluid: boolean;
499
+ rows: number;
500
+ resize: textareaResize;
501
+ }
502
+ declare const DEFAULT_TEXTAREA_CONFIG: TextareaConfig;
503
+
504
+ declare class Textarea extends ValueFormControl<string> {
505
+ private _config;
506
+ readonly value: ModelSignal<string>;
507
+ readonly inputId: InputSignal<string | null>;
508
+ readonly placeholder: InputSignal<string>;
509
+ readonly size: InputSignal<controlSize>;
510
+ readonly fluid: InputSignalWithTransform<boolean, unknown>;
511
+ readonly rows: InputSignalWithTransform<number, unknown>;
512
+ readonly resize: InputSignal<textareaResize>;
513
+ protected readonly classes: Signal<string[]>;
514
+ protected onInput(event: Event): void;
515
+ static ɵfac: i0.ɵɵFactoryDeclaration<Textarea, never>;
516
+ static ɵcmp: i0.ɵɵComponentDeclaration<Textarea, "tls-textarea", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; "rows": { "alias": "rows"; "required": false; "isSignal": true; }; "resize": { "alias": "resize"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
517
+ }
518
+
519
+ declare const TEXTAREA_CONFIG: InjectionToken<TextareaConfig>;
520
+
498
521
  declare class Icon {
499
522
  private _iconService;
500
523
  private _config;
@@ -558,6 +581,95 @@ declare const DEFAULT_LOADER_CONFIG: LoaderConfig;
558
581
 
559
582
  declare const LOADER_CONFIG: InjectionToken<LoaderConfig>;
560
583
 
584
+ declare class MenuItemComponent {
585
+ readonly key: i0.InputSignal<string>;
586
+ readonly templateRef: i0.Signal<TemplateRef<unknown>>;
587
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuItemComponent, never>;
588
+ static ɵcmp: i0.ɵɵComponentDeclaration<MenuItemComponent, "tls-menu-item", never, { "key": { "alias": "key"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
589
+ }
590
+
591
+ type menuPosition = overlayPosition;
592
+ type menuItemType = 'item' | 'label' | 'divider' | 'custom';
593
+ interface BaseMenuItem {
594
+ type: menuItemType;
595
+ }
596
+ interface MenuActionItem extends BaseMenuItem {
597
+ type: 'item';
598
+ label: string;
599
+ icon?: string;
600
+ shortcut?: string;
601
+ disabled?: boolean;
602
+ data?: unknown;
603
+ action?: () => void;
604
+ }
605
+ interface MenuDivider extends BaseMenuItem {
606
+ type: 'divider';
607
+ data?: unknown;
608
+ }
609
+ interface MenuLabel extends BaseMenuItem {
610
+ type: 'label';
611
+ label: string;
612
+ data?: unknown;
613
+ }
614
+ interface MenuCustomItem {
615
+ type: 'custom';
616
+ key: string;
617
+ }
618
+ type MenuItemDefinition = MenuActionItem | MenuDivider | MenuLabel | MenuCustomItem;
619
+
620
+ declare class Menu {
621
+ private static _counter;
622
+ private readonly _config;
623
+ private readonly _overlay;
624
+ private readonly _panelRef;
625
+ protected readonly _customItems: i0.Signal<readonly MenuItemComponent[]>;
626
+ protected readonly customTemplates: i0.Signal<Map<string, TemplateRef<unknown>>>;
627
+ protected readonly itemTemplate: i0.Signal<TemplateRef<unknown> | undefined>;
628
+ protected readonly labelTemplate: i0.Signal<TemplateRef<unknown> | undefined>;
629
+ protected readonly dividerTemplate: i0.Signal<TemplateRef<unknown> | undefined>;
630
+ protected readonly iconTemplate: i0.Signal<TemplateRef<unknown> | undefined>;
631
+ readonly id: string;
632
+ readonly items: InputSignal<MenuItemDefinition[]>;
633
+ readonly position: InputSignal<overlayPosition>;
634
+ readonly offset: InputSignal<Point>;
635
+ readonly ariaLabel: InputSignal<string | undefined>;
636
+ readonly inline: InputSignalWithTransform<boolean, unknown>;
637
+ private readonly _positions;
638
+ readonly isOpen: i0.Signal<boolean>;
639
+ constructor();
640
+ open(trigger: MouseEvent | HTMLElement): void;
641
+ openAtPoint(x: number, y: number): void;
642
+ close(): void;
643
+ toggle(trigger: MouseEvent | HTMLElement): void;
644
+ protected onItemClick(item: MenuActionItem): void;
645
+ static ɵfac: i0.ɵɵFactoryDeclaration<Menu, never>;
646
+ static ɵcmp: i0.ɵɵComponentDeclaration<Menu, "tls-menu", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "inline": { "alias": "inline"; "required": false; "isSignal": true; }; }, {}, ["_customItems", "itemTemplate", "labelTemplate", "dividerTemplate", "iconTemplate"], never, true, never>;
647
+ }
648
+
649
+ interface MenuConfig {
650
+ position: menuPosition;
651
+ offset: Point;
652
+ }
653
+ declare const DEFAULT_MENU_CONFIG: MenuConfig;
654
+
655
+ declare const MENU_CONFIG: InjectionToken<MenuConfig>;
656
+
657
+ declare class MenuTriggerDirective {
658
+ readonly menu: i0.InputSignal<Menu>;
659
+ protected readonly isOpen: i0.Signal<boolean>;
660
+ protected readonly menuId: i0.Signal<string>;
661
+ protected onClick(event: MouseEvent): void;
662
+ static ɵfac: i0.ɵɵFactoryDeclaration<MenuTriggerDirective, never>;
663
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MenuTriggerDirective, "[tlsMenuTrigger]", never, { "menu": { "alias": "tlsMenuTrigger"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
664
+ }
665
+
666
+ declare class ContextMenuDirective {
667
+ readonly menu: i0.InputSignal<Menu>;
668
+ protected onContextMenu(event: MouseEvent): void;
669
+ static ɵfac: i0.ɵɵFactoryDeclaration<ContextMenuDirective, never>;
670
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ContextMenuDirective, "[tlsContextMenu]", never, { "menu": { "alias": "tlsContextMenu"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
671
+ }
672
+
561
673
  type paginationItem = number | 'gap';
562
674
 
563
675
  declare class Pagination {
@@ -598,15 +710,11 @@ declare const DEFAULT_PAGINATION_CONFIG: PaginationConfig;
598
710
 
599
711
  declare const PAGINATION_CONFIG: InjectionToken<PaginationConfig>;
600
712
 
601
- declare class Popover implements OnDestroy {
713
+ declare class Popover {
602
714
  private static _counter;
603
- private readonly _overlay;
604
- private readonly _viewContainerRef;
605
715
  private readonly _config;
606
- private readonly _destroyRef;
716
+ private readonly _overlay;
607
717
  private readonly _templateRef;
608
- private _overlayRef;
609
- private readonly _isOpen;
610
718
  readonly id: string;
611
719
  readonly isOpen: i0.Signal<boolean>;
612
720
  readonly position: i0.InputSignal<overlayPosition>;
@@ -616,7 +724,6 @@ declare class Popover implements OnDestroy {
616
724
  open(trigger: MouseEvent | HTMLElement): void;
617
725
  close(): void;
618
726
  toggle(trigger: MouseEvent | HTMLElement): void;
619
- ngOnDestroy(): void;
620
727
  static ɵfac: i0.ɵɵFactoryDeclaration<Popover, never>;
621
728
  static ɵcmp: i0.ɵɵComponentDeclaration<Popover, "tls-popover", never, { "position": { "alias": "position"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
622
729
  }
@@ -848,5 +955,5 @@ declare const TOOLTIP_CONFIG: InjectionToken<TooltipConfig>;
848
955
 
849
956
  declare const provideThalassicUIConfig: (config: tlsUiConfigProvider) => EnvironmentProviders;
850
957
 
851
- export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, Checkbox, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_LOADER_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_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FORM_ITEM_CONFIG, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, LOADER_CONFIG, Loader, 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, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, TooltipDirective, provideThalassicUIConfig };
852
- export type { AlertConfig, ButtonConfig, CheckboxConfig, DateTimePickerConfig, DialogConfig, DialogOpenConfig, DividerConfig, FormItemConfig, IconConfig, InputConfig, LoaderConfig, PaginationConfig, PasswordConfig, PinInputConfig, PopoverConfig, RadioButtonConfig, SelectConfig, SkeletonConfig, StepConfig, StepperConfig, StepperSelectEvent, SwitchConfig, TableColumnDefinition, TableConfig, TableData, TableTrackBy, TabsConfig, TooltipConfig, color, controlSize, dateTimePickerMode, dialogSize, dividerContentPosition, dividerOrientation, dividerVariant, orientation, overlayPosition, paginationItem, pinInputType, selectOptionType, size, stepperColor, stepperOrientation, stepperValue, tableColumnAlignment, tlsUiConfigProvider, tooltipColor, tooltipOrigin, tooltipPosition };
958
+ export { ALERT_CONFIG, Alert, BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, Checkbox, ContextMenuDirective, DATE_TIME_PICKER_CONFIG, DEFAULT_ALERT_CONFIG, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_DATE_TIME_PICKER_CONFIG, DEFAULT_DIALOG_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_LOADER_CONFIG, DEFAULT_MENU_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_TOOLTIP_CONFIG, DIALOG_CONFIG, DIVIDER_CONFIG, DateTimePicker, Dialog, DialogService, Divider, FORM_ITEM_CONFIG, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, LOADER_CONFIG, Loader, MENU_CONFIG, Menu, MenuItemComponent, MenuTriggerDirective, 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, TOOLTIP_CONFIG, Tab, Table, TableColumn, Tabs, Textarea, TooltipDirective, provideThalassicUIConfig };
959
+ export type { AlertConfig, ButtonConfig, CheckboxConfig, DateTimePickerConfig, DialogConfig, DialogOpenConfig, DividerConfig, FormItemConfig, IconConfig, InputConfig, LoaderConfig, MenuActionItem, MenuConfig, MenuCustomItem, MenuDivider, MenuItemDefinition, MenuLabel, PaginationConfig, PasswordConfig, PinInputConfig, PopoverConfig, RadioButtonConfig, SelectConfig, SkeletonConfig, StepConfig, StepperConfig, StepperSelectEvent, SwitchConfig, TableColumnDefinition, TableConfig, TableData, TableTrackBy, TabsConfig, TextareaConfig, TooltipConfig, color, controlSize, dateTimePickerMode, dialogSize, dividerContentPosition, dividerOrientation, dividerVariant, menuItemType, menuPosition, orientation, overlayPosition, paginationItem, pinInputType, selectOptionType, size, stepperColor, stepperOrientation, stepperValue, tableColumnAlignment, textareaResize, tlsUiConfigProvider, tooltipColor, tooltipOrigin, tooltipPosition };