UNPKG

@obliczeniowo/elementary

Version:
80 lines (79 loc) 3.26 kB
import { ElementRef, Renderer2, ViewContainerRef } from '@angular/core'; import * as i0 from "@angular/core"; /** * Set class for the button element * * Default class name is: 'obl-button' you cen extend it by using input oblButton * in such case the name of class will change to 'obl-button-'+this.oblButton * * You can use scss mixin to generate new set of styles: * * @example * * // in HTML * * <button oblButton="red">Some button</button> * * // in global scss file style.scss * * @use "node_modules/@obliczeniowo/elementary/styles/global.scss" as *; * * @include button-styles("red", #080808, black, red, white, #cc5d5d, white, gray); */ export declare class ButtonDirective { protected renderer: Renderer2; protected elementRef: ElementRef<HTMLButtonElement>; private readonly viewContainerRef; private _oblButton; private _spinner?; private _icon?; private _name?; get oblButton(): string; /** * Let you set default class if no extended class is set * * if extended is set then you can generate your own styles class using mixin * * @example * @use "node_modules/@obliczeniowo/elementary/styles/buttons-styles.scss" as *; * * @include button-styles("red", #080808, black, red, white, #cc5d5d, white, gray); */ set oblButton(value: string); /** * Name of icon to display inside of button, when no icon set then no icon to display * * When loading = true icon is removed and spinner is displayed */ set icon(icon: string | undefined); blockWhenLoading: boolean; protected _loading?: boolean; /** * If loading is set to true then button is disabled and spinner is added as first child of button * * on loading = false spinner is removed and if icon is set then icon displayed on his place */ set loading(loading: boolean); /** */ toggle: import("@angular/core").InputSignal<boolean>; /** */ selected: boolean; /** * link to open when clicked */ link: import("@angular/core").InputSignal<string | undefined>; /** * target option for link option only */ target: import("@angular/core").InputSignal<string>; /** * To handle disable state of button */ get load(): boolean; clicked(event: MouseEvent): void; constructor(renderer: Renderer2, elementRef: ElementRef<HTMLButtonElement>, viewContainerRef: ViewContainerRef); ngAfterViewInit(): void; protected class(prefix?: string): string; static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "oblButton, [oblButton]", ["oblButton"], { "oblButton": { "alias": "oblButton"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "blockWhenLoading": { "alias": "blockWhenLoading"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "toggle": { "alias": "toggle"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; }; "link": { "alias": "link"; "required": false; "isSignal": true; }; "target": { "alias": "target"; "required": false; "isSignal": true; }; }, {}, never, never, false, never>; }