UNPKG

2.61 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 */
6import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, Renderer2 } from '@angular/core';
7import { Observable, Subject } from 'rxjs';
8import { NbStatusService } from '../../services/status.service';
9import { NbBooleanInput } from '../helpers';
10import { NbButton, NbButtonAppearance } from '../button/base-button';
11import * as i0 from "@angular/core";
12export type NbButtonToggleAppearance = Exclude<NbButtonAppearance, 'hero'>;
13export interface NbButtonToggleChange {
14 source: NbButtonToggleDirective;
15 pressed: boolean;
16}
17/**
18 * `[nbButtonToggle]` is a directive to add a `pressed` state to a button.
19 */
20export declare class NbButtonToggleDirective extends NbButton {
21 protected renderer: Renderer2;
22 protected hostElement: ElementRef<HTMLElement>;
23 protected cd: ChangeDetectorRef;
24 protected zone: NgZone;
25 protected statusService: NbStatusService;
26 protected buttonGroup?: any;
27 protected readonly _pressedChange$: Subject<NbButtonToggleChange>;
28 get pressedChange$(): Observable<NbButtonToggleChange>;
29 appearance: NbButtonToggleAppearance;
30 /**
31 * A value associated with the button.
32 */
33 value: any;
34 /**
35 * Controls button pressed state
36 **/
37 get pressed(): boolean;
38 set pressed(value: boolean);
39 protected _pressed: boolean;
40 static ngAcceptInputType_pressed: NbBooleanInput;
41 /**
42 * Emits whenever button pressed state change
43 **/
44 readonly pressedChange: EventEmitter<boolean>;
45 get basic(): boolean;
46 get primary(): boolean;
47 get success(): boolean;
48 get info(): boolean;
49 get warning(): boolean;
50 get danger(): boolean;
51 get control(): boolean;
52 get additionalClasses(): string[];
53 onClick(): void;
54 constructor(renderer: Renderer2, hostElement: ElementRef<HTMLElement>, cd: ChangeDetectorRef, zone: NgZone, statusService: NbStatusService, buttonGroup?: any);
55 /**
56 * @docs-private
57 */
58 _updatePressed(value: boolean): void;
59 static ɵfac: i0.ɵɵFactoryDeclaration<NbButtonToggleDirective, [null, null, null, null, null, { optional: true; }]>;
60 static ɵdir: i0.ɵɵDirectiveDeclaration<NbButtonToggleDirective, "button[nbButtonToggle]", ["nbButtonToggle"], { "appearance": { "alias": "appearance"; "required": false; }; "value": { "alias": "value"; "required": false; }; "pressed": { "alias": "pressed"; "required": false; }; }, { "pressedChange": "pressedChange"; }, never, never, false, never>;
61}