import { CoreComponent } from "cmf.core/src/core";
import * as ng from "@angular/core";
/**
* Tile orientation type. If you change this keep the enum values.
*/
export declare enum TileOrientationType {
Horizontal = 0,
Vertical = 1
}
/**
* Selection mode enum.
*/
export declare enum SelectionMode {
None = 0,
Single = 1,
Multiple = 2
}
/**
* Tile badge interface
*/
export interface TileBadge {
/**
* badge numeric value
*/
value: number;
/**
* icon class to display on the entity type
*/
icon: string;
/**
* badge color class or string to be applied to style.color property
*/
color?: string;
/**
* badge background color class or string to be applied to style.background-color property
*/
backgroundColor?: string;
/**
* title indicator on badge hover
*/
title?: string;
}
/**
* @whatItDoes
* Tile Component
*
* @howToUse
* This component is used with the inputs and outputs mentioned below.
*
* ### Inputs
* `string` : **name** - Header title ;
* `string` : **description** - Header subtitle ;
* `TileOrientationType | string` : **orientation** - Badge direction of type TileOrientationType (Horizontal or Vertical) ;
* `TileBadge` : **badges** - Array of badges with properties:
* * value: number ;
* * icon: string class representing an icon ;
* * color: (optional) class color of the badge icon (cmf-core-controls-tile-color-[red|green|gray]) or rgb css to be applied to style.color ;
* * backgroundColor: (optional) class background color of the badge icon .
* `string` : **status-color** - (optional) side bar color class (cmf-core-controls-tile-background-[red|green|gray]) ;
* `string` : **iconClass** - String class representing an icon ;
* `any` : **background-color** - (optional) background color class (cmf-core-controls-tile-background-[light-red|basic]) ;
* `boolean` : **disabled** - (default false) controls the trigger to the (click) output and controls hover events ;
* `SelectionMode` : **selection-mode** - (@see SelectionMode), one of SelectionMode.None | SelectionMode.Single | SelectionMode.Multiple ;
* `boolean` : **selected** - Boolean value two way binding Inputs ;
* `boolean` : **dblClickable** - Boolean value that controls the double click event .
*
* ### Outputs
* **click-tile($event)** - Click event, triggered when user clicked if clickable input is set to true. Carries the $event parameter
* **click-tile-icon($event)** - Icon click event, triggered when user clicks in the icon of the tile. Carries the $event parameter
* **dblclick-tile($event)** - Double click event, triggered when user double clicks, depends on dblClickable input
* **selectedChange(Boolean)** - Selection change event. Depends on selection-mode (!= None). Carries the Boolean value
* **selectedChangeEvent[Boolean, Event])** - Selection change event. Depends on selection-mode (!= None).
* Carries the Boolean value and the event that triggered it
* ## Example
*
* ```html
* ">
*
* ```
*/
export declare class Tile extends CoreComponent implements ng.OnChanges, ng.AfterViewInit, ng.OnDestroy {
private _ngZone;
/**
* Orientation type attributes. The value to be used depends on the property _orientation
*/
private static ORIENTATION_TYPE_ATTRIBUTES;
/**
* Color classes
*/
private static TILE_COLOR_CLASSES;
/**
* Background color classes
*/
private static TILE_BACKGROUND_COLOR_CLASSES;
/**
* Tile background color classes
*/
private static TILE_CONTENT_BACKGROUND_COLOR_CLASSES;
/**
* Tile width values to be matched with TileOrientationType
*/
static TILE_WIDTH_VALUES: number[];
private _tile;
/**
* Enum value that controls the dimensions of the tile and badge orientation
*/
private _orientation;
/**
* Click timer event to launch the click if no double click occurs
*/
private _clickTimer;
/**
* Boolean value to prevent click until double click is checked
*/
private _clickPrevent;
/**
* Click delay on double click case
*/
private _clickDelay;
/**
* Boolean value that controls display on selected
*/
_selected: boolean;
/**
* Boolean value that controls display on time between trigger select and double click event
*/
_selectedDelay: boolean;
/**
* The string object input for the title field
*/
name: string;
/**
* The string object input for the sub-title field
*/
description: string;
/**
* The icon class
*/
iconClass: string;
/**
* Property _orientation getter
*
*/
/**
* Property _orientation setter
*
* @param [value]
*/
orientation: TileOrientationType | string;
/**
* The array object input for the badges
*/
badges: Array;
/**
* The class of the side bar representing status bar background color
*/
statusColor: string;
/**
* The array object input for the badges
*/
backgroundColor: string;
/**
* The boolean object controlling hover events and click
*/
disabled: boolean;
/**
* The boolean object controlling double click event and click speed (with out without delay)
*/
dblClickable: boolean;
/**
* The boolean object controlling hover events and click
*/
selectionMode: SelectionMode;
/**
* The selection change, carrying the selection value and the event that triggered it
*/
selectedChangeEvent: ng.EventEmitter<[Boolean, Event]>;
/**
* The select input change event
*/
selectedChange: ng.EventEmitter;
/**
* Click event triggered the tile is clicked.
*/
click: ng.EventEmitter;
/**
* Click event triggered when the tile icon is clicked.
*/
iconClick: ng.EventEmitter;
/**
* Double click event emitter
*/
dblClick: ng.EventEmitter;
/**
* Tile width
*/
tileWidth: string;
/**
* Boolean to keep track if the touch if just a press or it's a swipe to scroll
* On touch start, the variable is set to false, on touch move is set to true if the
* event is called. Runs outside the zone since it has a lot of calls that don't reflect in
* the view itself.
* On touch end, if the flag is set to true, the function will skip the event
*/
hasMoved: boolean;
constructor(_ngZone: ng.NgZone);
/**
* Handle tile touch when started
* @param event Touch Event
*/
tileTouchStart(event: TouchEvent): void;
/**
* Handle tile touch event when it ends
*/
tileTouchEnd(event: TouchEvent): void;
/**
* Handle tile touch event when there is movement
*/
touchMove(): void;
/**
* Handle tile click event.
*/
private clickHandle;
/**
* Handle tile icon click event
*/
tileIconClick(event: MouseEvent): void;
/**
* Handle element click event
*/
tileClick(event: MouseEvent): void;
/**
* Handle Tile double click
*/
onTileDoubleClick(event: MouseEvent): void;
/**
* Property selected value getter
*
* @return {boolean} current value for selected value
*/
/**
* Property selected value setter
*
* @param {boolean} [value] new value for selected value
*/
selected: boolean;
/**
* Return orientation attribute value based on orientation
*/
readonly orientationAttribute: string;
private tileBackgroundColor;
badgeColorClass(badge: TileBadge): string;
badgeBackgroundColorClass(badge: TileBadge): string;
badgeColorStyle(badge: TileBadge): string;
badgeBackgroundColorStyle(badge: TileBadge): string;
statusBackgroundColorClass(): string;
statusBackgroundColorStyle(): string;
/**
* Handle input changes.
* @param changes Changes
*/
ngOnChanges(changes: ng.SimpleChanges): void;
/**
* Unsubscribe the events on destroy
*/
ngOnDestroy(): void;
/**
* Subscribe for event outside the zone
*/
ngAfterViewInit(): void;
}
export declare class TileModule {
}