turbogui-angular
Version:
A library that tries to help with the most common user interface elements on several frameworks and platforms
83 lines • 4.29 kB
TypeScript
/**
* TurboGUI is A library that helps with the most common and generic UI elements and functionalities
*
* Website : -> http://www.turbogui.org
* License : -> Licensed under the Apache License, Version 2.0. You may not use this file except in compliance with the License.
* License Url : -> http://www.apache.org/licenses/LICENSE-2.0
* CopyRight : -> Copyright 2018 Edertone Advanded Solutions. https://www.edertone.com
*/
import { ElementRef } from '@angular/core';
import { MatDialogRef } from '@angular/material/dialog';
import { DialogBaseComponent } from '../dialog-base/dialog-base.component';
import { BrowserService } from '../../../controller/browser.service';
import { StringUtils } from 'turbocommons-ts';
import * as i0 from "@angular/core";
/**
* A dialog component which allows us to select one single item from a list. The elements on that list are displayed on a table
* which may show a scroll if necessary when there are many elements on the list.
*
* It also allows us to filter inside the list with a custom text that we can type into a search input, which is optional.
*
* texts parameter must contain the title, the description (optional), the filter input title (optional), and the submit button caption.
* If that caption is not provided, the selection will be automatically performed once user clicks on an element on the list. Otherwise,
* the element will be selected on the list and the selection will be performed once the user clicks on the submit button.
*
* options parameter must contain the list of elements that will be displayed to the user
*/
export declare class DialogSingleSelectionListComponent extends DialogBaseComponent {
elementRef: ElementRef;
dialogRef: MatDialogRef<DialogBaseComponent>;
browserService: BrowserService;
data: any;
static readonly DIALOG_CLASS_NAME = "DialogSingleSelectionListComponent";
/**
* Declare a reference to the string utils class so it can be used on the html part
*/
stringUtils: typeof StringUtils;
/**
* Contains the list of elements that will be directly shown to the user at the component list.
* It may be filtered or not depending on this component setup and the user input
*/
filteredOptions: string[];
/**
* Stores the number of options that are currently visible to the user
*/
filteredOptionsCount: number;
/**
* Contains the original list of elements that are provided to be listed on this component before
* being possibly filtered. It is only used as a backup, not shown to the user
*/
private originalOptions;
/**
* The same list as the originally provided but processed for a better text search.
* It will be used to perform the search, but not shown to the user.
*/
private originalOptionsFullTextSearch;
/**
* Stores the index for the element that's been selected by the user
*/
selectedItemIndex: number;
constructor(elementRef: ElementRef, dialogRef: MatDialogRef<DialogBaseComponent>, browserService: BrowserService, data: any);
/**
* Method to calculate the max possible height that the list items container is allowed to have
*/
getListItemsContainerMaxheight(): string;
/**
* If the user presses enter key and there's only one element filtered in the list, we will close this dialog
* setting that element as the selected.
*/
onIntroKeyPress(): void;
/**
* When the user types a value on the input element to filter the list, this method will perform
* that filtering and refresh the list
*/
onSearchChange(input: HTMLInputElement): void;
/**
* This method is used to greatly improve ngFor performance with arrays of primitive values. It tells the refresh
* function to work by index instead of by value. The change in performance when refreshing the list is massive.
*/
trackByFn: (index: number, _value: string) => number;
static ɵfac: i0.ɵɵFactoryDeclaration<DialogSingleSelectionListComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<DialogSingleSelectionListComponent, "tg-dialog-single-selection-list", never, {}, {}, never, never, true, never>;
}
//# sourceMappingURL=dialog-single-selection-list.component.d.ts.map