UNPKG

4.03 kBTypeScriptView Raw
1import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, AfterViewInit, NgZone, Renderer2 } from '@angular/core';
2import { Observable, Subject } from 'rxjs';
3import { NbBooleanInput } from '../helpers';
4import { NbFocusableOption } from '../cdk/a11y/focus-key-manager';
5import { NbHighlightableOption } from '../cdk/a11y/descendant-key-manager';
6import { NbSelectComponent } from '../select/select.component';
7import * as i0 from "@angular/core";
8/**
9 * NbOptionComponent
10 *
11 * @styles
12 *
13 * option-background-color:
14 * option-text-color:
15 * option-text-font-family:
16 * option-hover-background-color:
17 * option-hover-text-color:
18 * option-active-background-color:
19 * option-active-text-color:
20 * option-focus-background-color:
21 * option-focus-text-color:
22 * option-selected-background-color:
23 * option-selected-text-color:
24 * option-selected-hover-background-color:
25 * option-selected-hover-text-color:
26 * option-selected-active-background-color:
27 * option-selected-active-text-color:
28 * option-selected-focus-background-color:
29 * option-selected-focus-text-color:
30 * option-disabled-background-color:
31 * option-disabled-text-color:
32 * option-tiny-text-font-size:
33 * option-tiny-text-font-weight:
34 * option-tiny-text-line-height:
35 * option-tiny-padding:
36 * option-small-text-font-size:
37 * option-small-text-font-weight:
38 * option-small-text-line-height:
39 * option-small-padding:
40 * option-medium-text-font-size:
41 * option-medium-text-font-weight:
42 * option-medium-text-line-height:
43 * option-medium-padding:
44 * option-large-text-font-size:
45 * option-large-text-font-weight:
46 * option-large-text-line-height:
47 * option-large-padding:
48 * option-giant-text-font-size:
49 * option-giant-text-font-weight:
50 * option-giant-text-line-height:
51 * option-giant-padding:
52 **/
53export declare class NbOptionComponent<T = any> implements OnDestroy, AfterViewInit, NbFocusableOption, NbHighlightableOption {
54 protected elementRef: ElementRef;
55 protected cd: ChangeDetectorRef;
56 protected zone: NgZone;
57 protected renderer: Renderer2;
58 protected disabledByGroup: boolean;
59 /**
60 * Option value that will be fired on selection.
61 * */
62 value: T;
63 get disabled(): boolean;
64 set disabled(value: boolean);
65 protected _disabled: boolean;
66 static ngAcceptInputType_disabled: NbBooleanInput;
67 /**
68 * Fires value when option selection change.
69 * */
70 selectionChange: EventEmitter<NbOptionComponent<T>>;
71 /**
72 * Fires when option clicked
73 */
74 protected click$: Subject<NbOptionComponent<T>>;
75 get click(): Observable<NbOptionComponent<T>>;
76 selected: boolean;
77 protected parent: NbSelectComponent;
78 protected alive: boolean;
79 /**
80 * Component scoped id for aria attributes.
81 * */
82 id: string;
83 constructor(parent: any, elementRef: ElementRef, cd: ChangeDetectorRef, zone: NgZone, renderer: Renderer2);
84 ngOnDestroy(): void;
85 ngAfterViewInit(): void;
86 /**
87 * Determines should we render checkbox.
88 * */
89 get withCheckbox(): boolean;
90 get content(): any;
91 get hidden(): any;
92 get multiple(): boolean;
93 get selectedClass(): boolean;
94 get disabledAttribute(): '' | null;
95 get tabindex(): string;
96 get activeClass(): boolean;
97 protected _active: boolean;
98 onClick(event: any): void;
99 select(): void;
100 deselect(): void;
101 /**
102 * Sets disabled by group state and marks component for check.
103 */
104 setDisabledByGroupState(disabled: boolean): void;
105 protected setSelection(selected: boolean): void;
106 focus(): void;
107 getLabel(): string;
108 setActiveStyles(): void;
109 setInactiveStyles(): void;
110 static ɵfac: i0.ɵɵFactoryDeclaration<NbOptionComponent<any>, [{ optional: true; }, null, null, null, null]>;
111 static ɵcmp: i0.ɵɵComponentDeclaration<NbOptionComponent<any>, "nb-option", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "selectionChange": "selectionChange"; }, never, ["*"], false, never>;
112}