@deepkit/desktop-ui
Version:
Library for desktop UI widgets in Angular 10+
197 lines (196 loc) • 9.97 kB
TypeScript
import { AfterViewInit, ApplicationRef, ChangeDetectorRef, ElementRef, EventEmitter, Injector, OnChanges, OnDestroy, OnInit } from '@angular/core';
import { WindowComponent } from '../window/window.component';
import { WindowState } from '../window/window-state';
import { FormComponent } from '../form/form.component';
import { ValueAccessorBase } from '../../core/form';
import { ActivatedRoute, Router, UrlTree } from '@angular/router';
import * as i0 from "@angular/core";
/**
* hotkey has format of "ctrl+shift+alt+key", e.g "ctrl+s" or "shift+o"
* and supports more than one, e.g. "ctrl+s,ctrl+o"
*/
export type HotKey = string;
declare function hotKeySize(hotkey: HotKey): number;
export declare class ButtonHotkeyComponent implements OnChanges, OnInit {
hotkey?: HotKey;
isMac: boolean;
metaKey: boolean;
ctrlKey: boolean;
shiftKey: boolean;
altKey: boolean;
key: string;
ngOnInit(): void;
ngOnChanges(): void;
parse(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonHotkeyComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonHotkeyComponent, "dui-button-hotkey", never, { "hotkey": { "alias": "hotkey"; "required": false; }; }, {}, never, never, false, never>;
}
export declare class ButtonComponent implements OnInit, AfterViewInit {
element: ElementRef;
cdParent: ChangeDetectorRef;
formComponent: FormComponent;
router?: Router | undefined;
activatedRoute?: ActivatedRoute | undefined;
hotKeySize: typeof hotKeySize;
/**
* The icon for this button. Either a icon name same as for dui-icon, or an image path.
*/
icon?: string;
/**
* Change in the icon size. Should not be necessary usually.
*/
iconSize?: number;
iconRight?: boolean | '';
iconColor?: string;
showHotkey?: HotKey;
/**
* Whether the button is active (pressed)
*/
active: boolean | '';
routerLink?: string | UrlTree | any[];
routerLinkExact?: boolean;
/**
* Whether the button has no padding and smaller font size
*/
small: boolean | '';
/**
* Whether the button has smaller padding. Better for button with icons.
*/
tight: boolean | '';
/**
* Whether the button is highlighted.
*/
highlighted: boolean | '';
/**
* Whether the button is primary.
*/
primary: boolean | '';
/**
* Whether the button is focused on initial loading.
*/
focused: boolean | '';
/**
* Whether the button is focused on initial loading.
*/
submitForm?: FormComponent;
/**
* Auto-detected but could be set manually as well.
* Necessary for correct icon placement.
*/
withText?: boolean;
protected detectedText: boolean;
constructor(element: ElementRef, cdParent: ChangeDetectorRef, formComponent: FormComponent, router?: Router | undefined, activatedRoute?: ActivatedRoute | undefined);
hasText(): boolean;
disabled: boolean | '';
get isDisabled(): boolean;
square: boolean | '';
get isRound(): boolean;
textured: boolean | '';
get isTextured(): boolean;
ngOnInit(): void;
isActive(): boolean;
ngAfterViewInit(): void;
onClick(): Promise<void>;
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, [null, { skipSelf: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "dui-button", never, { "icon": { "alias": "icon"; "required": false; }; "iconSize": { "alias": "iconSize"; "required": false; }; "iconRight": { "alias": "iconRight"; "required": false; }; "iconColor": { "alias": "iconColor"; "required": false; }; "showHotkey": { "alias": "showHotkey"; "required": false; }; "active": { "alias": "active"; "required": false; }; "routerLink": { "alias": "routerLink"; "required": false; }; "routerLinkExact": { "alias": "routerLinkExact"; "required": false; }; "small": { "alias": "small"; "required": false; }; "tight": { "alias": "tight"; "required": false; }; "highlighted": { "alias": "highlighted"; "required": false; }; "primary": { "alias": "primary"; "required": false; }; "focused": { "alias": "focused"; "required": false; }; "submitForm": { "alias": "submitForm"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "square": { "alias": "square"; "required": false; }; "textured": { "alias": "textured"; "required": false; }; }, {}, never, ["*"], false, never>;
}
export declare class HotkeyDirective {
private elementRef;
private app;
private button?;
hotkey: HotKey;
protected oldButtonActive?: boolean | '';
protected active: boolean;
constructor(elementRef: ElementRef, app: ApplicationRef, button?: ButtonComponent | undefined);
onKeyDown(event: KeyboardEvent): void;
onKeyUp(event: KeyboardEvent): void;
static ɵfac: i0.ɵɵFactoryDeclaration<HotkeyDirective, [null, null, { optional: true; }]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<HotkeyDirective, "[hotkey]", never, { "hotkey": { "alias": "hotkey"; "required": false; }; }, {}, never, never, false, never>;
}
/**
* Used to group buttons together.
*/
export declare class ButtonGroupComponent implements AfterViewInit, OnDestroy {
private element;
protected cd: ChangeDetectorRef;
private windowState?;
private windowComponent?;
/**
* How the button should behave.
* `sidebar` means it aligns with the sidebar. Is the sidebar open, this button-group has a left margin.
* Is it closed, the margin is gone.
*/
float: 'static' | 'sidebar' | 'float' | 'right';
padding: 'normal' | 'none';
get isPaddingNone(): boolean;
constructor(element: ElementRef<HTMLElement>, cd: ChangeDetectorRef, windowState?: WindowState | undefined, windowComponent?: WindowComponent | undefined);
activateOneTimeAnimation(): void;
sidebarMoved(): void;
ngOnDestroy(): void;
transitionEnded(): void;
ngAfterViewInit(): void;
updatePaddingLeft(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupComponent, [null, { skipSelf: true; }, { optional: true; }, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupComponent, "dui-button-group", never, { "float": { "alias": "float"; "required": false; }; "padding": { "alias": "padding"; "required": false; }; }, {}, never, ["*"], false, never>;
}
export declare class ButtonGroupsComponent {
align: 'left' | 'center' | 'right';
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonGroupsComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ButtonGroupsComponent, "dui-button-groups", never, { "align": { "alias": "align"; "required": false; }; }, {}, never, ["*"], false, never>;
}
export declare class FileChooserDirective extends ValueAccessorBase<any> implements OnDestroy, OnChanges {
protected injector: Injector;
readonly cd: ChangeDetectorRef;
readonly cdParent: ChangeDetectorRef;
private app;
duiFileMultiple?: boolean | '';
duiFileDirectory?: boolean | '';
duiFileChooserChange: EventEmitter<string | string[]>;
protected input: HTMLInputElement;
constructor(injector: Injector, cd: ChangeDetectorRef, cdParent: ChangeDetectorRef, app: ApplicationRef);
ngOnDestroy(): void;
ngOnChanges(): void;
onClick(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FileChooserDirective, [null, null, { skipSelf: true; }, null]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<FileChooserDirective, "[duiFileChooser]", never, { "duiFileMultiple": { "alias": "duiFileMultiple"; "required": false; }; "duiFileDirectory": { "alias": "duiFileDirectory"; "required": false; }; }, { "duiFileChooserChange": "duiFileChooserChange"; }, never, never, false, never>;
}
export interface FilePickerItem {
data: Uint8Array;
name: string;
}
export declare class FilePickerDirective extends ValueAccessorBase<any> implements OnDestroy, AfterViewInit {
protected injector: Injector;
readonly cd: ChangeDetectorRef;
readonly cdParent: ChangeDetectorRef;
private app;
duiFileMultiple?: boolean | '';
duiFileAutoOpen: boolean;
duiFilePickerChange: EventEmitter<FilePickerItem | FilePickerItem[]>;
protected input: HTMLInputElement;
constructor(injector: Injector, cd: ChangeDetectorRef, cdParent: ChangeDetectorRef, app: ApplicationRef);
ngOnDestroy(): void;
ngAfterViewInit(): void;
onClick(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FilePickerDirective, [null, null, { skipSelf: true; }, null]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<FilePickerDirective, "[duiFilePicker]", never, { "duiFileMultiple": { "alias": "duiFileMultiple"; "required": false; }; "duiFileAutoOpen": { "alias": "duiFileAutoOpen"; "required": false; }; }, { "duiFilePickerChange": "duiFilePickerChange"; }, never, never, false, never>;
}
export declare class FileDropDirective extends ValueAccessorBase<any> implements OnDestroy {
protected injector: Injector;
readonly cd: ChangeDetectorRef;
readonly cdParent: ChangeDetectorRef;
private app;
duiFileDropMultiple?: boolean | '';
duiFileDropChange: EventEmitter<FilePickerItem | FilePickerItem[]>;
i: number;
constructor(injector: Injector, cd: ChangeDetectorRef, cdParent: ChangeDetectorRef, app: ApplicationRef);
onDragEnter(ev: any): void;
onDragOver(ev: any): void;
onDragLeave(ev: any): void;
onDrop(ev: any): Promise<void>;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<FileDropDirective, [null, null, { skipSelf: true; }, null]>;
static ɵdir: i0.ɵɵDirectiveDeclaration<FileDropDirective, "[duiFileDrop]", never, { "duiFileDropMultiple": { "alias": "duiFileDropMultiple"; "required": false; }; }, { "duiFileDropChange": "duiFileDropChange"; }, never, never, false, never>;
}
export {};
export declare type __ΩHotKey = any[];
export declare type __ΩFilePickerItem = any[];