UNPKG

@servoy/jw-bootstrap-switch-ng2

Version:
118 lines (114 loc) 5.04 kB
import * as i0 from '@angular/core'; import { AfterViewInit, OnChanges, EventEmitter, ElementRef, ChangeDetectorRef, Renderer2, SimpleChanges } from '@angular/core'; import * as i3 from '@angular/forms'; import { ControlValueAccessor } from '@angular/forms'; import * as i2 from '@angular/common'; declare class JwBootstrapSwitchNg2Component implements AfterViewInit, ControlValueAccessor, OnChanges { private cd; private render; handleWidth: number; labelWidth: number; labelText: string; inverse: boolean; baseClass: string; onText: string; offText: string; disabled: boolean; readonly: boolean; private _focused; private _size; private _animate; private _innerAnimate; private _indeterminate; private _onColor; private _offColor; private _wrapperClass; private _innerState; private _innerHandleWidth; private _innerLabelWidth; private _dragStart; private _dragEnd; private _onTouchedCallback; private _onChangeCallback; changeState: EventEmitter<any>; container: ElementRef; on: ElementRef; label: ElementRef; off: ElementRef; private $on; private $off; private $label; private $container; /** * @description: Function to set the Classes for the Wrapper Div * @returns string */ getWrapperClasses(): string; /** * @description Function to set the css classes for #on * @returns string */ getOnClasses(): string; /** * @description Function to set the css classes for #off * @returns string */ getOffClasses(): string; /** * @description Function set the marging of the #label when change the state * @returns string */ getLabelMarginLeft(): string; constructor(cd: ChangeDetectorRef, render: Renderer2); ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; onClick(): void; onKeyDown(e: KeyboardEvent): void; private onDragStart; private onDragMove; private onDragEnd; onTouchStart(e: any): void; onMouseDown(e: any): void; onTouchMove(e: any): void; onMouseMove(e: any): void; onMouseUp(e: Event): void; onTouchEnd(e: Event): void; onMouseLeave(e: Event): void; onFocus(): void; onBlur(): void; /** * @description Function to make recalculate the size of the elements when options change * @param disableAnimation */ private calculateWith; set setBaseClass(value: string); set setWrapperClass(value: string); set setOffText(value: string); set setLabelText(value: string); set setOnText(value: string); set setSize(value: string); set setAnimate(value: boolean); set setOnColor(value: string); set setOffColor(value: string); set setDisabled(value: boolean); set setReadOnly(value: boolean); set setIndeterminate(value: boolean); set setInverse(value: boolean); set setHandleWidth(value: number | 'auto'); set setLabelWidth(value: number | 'auto'); get value(): boolean; set value(v: boolean); private setStateValue; writeValue(value: boolean): void; setDisabledState(isDisabled: boolean): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; static ɵfac: i0.ɵɵFactoryDeclaration<JwBootstrapSwitchNg2Component, never>; static ɵcmp: i0.ɵɵComponentDeclaration<JwBootstrapSwitchNg2Component, "bSwitch", never, { "setBaseClass": { "alias": "switch-base-class"; "required": false; }; "setWrapperClass": { "alias": "switch-wrapper-class"; "required": false; }; "setOffText": { "alias": "switch-off-text"; "required": false; }; "setLabelText": { "alias": "switch-label-text"; "required": false; }; "setOnText": { "alias": "switch-on-text"; "required": false; }; "setSize": { "alias": "switch-size"; "required": false; }; "setAnimate": { "alias": "switch-animate"; "required": false; }; "setOnColor": { "alias": "switch-on-color"; "required": false; }; "setOffColor": { "alias": "switch-off-color"; "required": false; }; "setDisabled": { "alias": "switch-disabled"; "required": false; }; "setReadOnly": { "alias": "switch-readonly"; "required": false; }; "setIndeterminate": { "alias": "switch-indeterminate"; "required": false; }; "setInverse": { "alias": "switch-inverse"; "required": false; }; "setHandleWidth": { "alias": "switch-handle-width"; "required": false; }; "setLabelWidth": { "alias": "switch-label-width"; "required": false; }; }, { "changeState": "changeState"; }, never, never, false, never>; } declare class JwBootstrapSwitchNg2Module { static ɵfac: i0.ɵɵFactoryDeclaration<JwBootstrapSwitchNg2Module, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<JwBootstrapSwitchNg2Module, [typeof JwBootstrapSwitchNg2Component], [typeof i2.CommonModule, typeof i3.FormsModule], [typeof JwBootstrapSwitchNg2Component]>; static ɵinj: i0.ɵɵInjectorDeclaration<JwBootstrapSwitchNg2Module>; } export { JwBootstrapSwitchNg2Component, JwBootstrapSwitchNg2Module };