/// /** Core */ import { CoreComponent } from "cmf.core/src/core"; /** Angular2 */ import * as ng from "@angular/core"; /** Kendo */ import "kendo.splitter"; import { PageBag } from "../page/pageBag"; import { PageSplitterPane } from "./pageSplitterPane"; import { LayoutBaseDef, OnLayout } from "../../directives/layout/layoutDef"; /** * Layout changes event args */ export interface PageSplitterLayoutChangedArgs extends kendo.ui.SplitterEvent { leftPane?: { pane: PaneLeft; width: number; widthPercentage: number; }; rightPane?: { pane: PaneRight; width: number; widthPercentage: number; }; } /** * Page splitter Sides enumeration */ export declare enum PageSplitterSides { /** * Left Panel */ Left = "left", /** * Right Panel */ Right = "right" } /** * BasePane class. * Used to parse input panes and its parameters. * * @class BasePane */ export declare class BasePane { _elementRef: ng.ElementRef; side: string; mainTitle?: string; subTitle?: string; size?: string; collapsed?: boolean; collapsible?: boolean; collapsedSize?: string; contentUrl?: string; min?: string; max?: string; resizable: boolean; scrollable: boolean; showButtons?: boolean; expandedPaneHeaderTitle?: string; title: string; class: string; constructor(_elementRef: ng.ElementRef); } /** * Left pane directive. * @directive */ export declare class PaneLeft extends BasePane { _elementRef: ng.ElementRef; constructor(_elementRef: ng.ElementRef); } /** * Center pane directive. * @directive */ export declare class PaneCenter extends BasePane { _elementRef: ng.ElementRef; constructor(_elementRef: ng.ElementRef); } /** * Right pane directive. * @directive */ export declare class PaneRight extends BasePane { _elementRef: ng.ElementRef; constructor(_elementRef: ng.ElementRef); } /** * Personalized layout definition for the PageSplitter */ export declare class PageSplitterLayoutDef extends LayoutBaseDef { leftPane?: { collapsed?: boolean; collapsedSize?: string; max?: string; min?: string; size?: string; }; rightPane?: { collapsed?: boolean; collapsedSize?: string; max?: string; min?: string; size?: string; }; } /** * @whatItDoes * Page Splitter component. * Creates panel splitter that collapse, with 3 columns max. * Title will be used to the collapsed panel. * * @howToUse * Each pane supports the following options: * - mainTitle ; * - size ; * - collapsible; * - collapsibleSize * - contentUrl * - min * - max * - resizable * - scrollable * - reference: http:// docs.telerik.com/kendo-ui/api/javascript/ui/splitter * This component is used with the inputs and outputs mentioned below. * * ### Inputs * `string` : **orientation** - Pane splitter orientation (by default is _horizontal_) ; * `boolean` : **showButtons** - The showButtons of this component . * * ### Outputs * `PageSplitterLayoutChangedArgs` : **layoutChange** - Triggered when PageSplitter layout change ; * * ### Example * To use the component, assume this HTML Template as an example: * * ```HTML * * * * * * ``` * */ export declare class PageSplitter extends CoreComponent implements ng.AfterViewInit, ng.OnDestroy, OnLayout { private _elementRef; private pageBag; private _ngZone; /** * Private variables */ private _splitter; /** * Child pane component. * We will need this reference to collapse/expand this pane */ private _panesView; /** * Child pane content. * We will need this reference to read the attributes! */ _paneLeftContent: PaneLeft; private _paneCenterContent; _paneRightContent: PaneRight; /** * Resize event handler */ private _onResizeHandler; /** * Page Enter subscription */ private _onPageEnterSubscription; /** * Whether the page is in mobile mode */ private isMobile; /** * Pane splitter orientation */ orientation: string; /** * PageSplitter layout change event */ layoutChange: ng.EventEmitter; /** * PageSplitter component constructor. * Installs an handler for resize the PageSwitcher when the page is active (on enter). * This is needed because the KendoUI discards the resize event when the component is not visible. * Also, if there is a ProgressIndicator meanwhile, it will not update the UI correctly. * @method constructor */ constructor(_elementRef: ng.ElementRef, pageBag: PageBag, _ngZone: ng.NgZone); private onPageEnter; /** * Collapse left and right panels */ private collapseSidePanels; /** * Destroys kendo splitter - resets the DOM to its previous state before kendo ui splitter was applied */ private destroyKendoSplitter; /** * Setup the kendo splitter based on the contents of its panes */ private createKendoSplitter; /** * Check if panel width is invalid */ private isPanelWidthInvalid; /** * Setup splitter after all children are placed in the right place * @method ngAfterViewInit */ ngAfterViewInit(): void; /** * Update kendo splitter */ refresh(): void; /** * Destroy cycle. * Remove splitter and free memory and handlers. * @method ngOnDestroy */ ngOnDestroy(): void; /** * Get content pane depending on the side. * @method getContentPane * @param {string} [side] the side of the component */ getContentPane(side: string): BasePane; /** * Get view pane used by this component depending on the side. * @method getViewPane * @param {string} [side] the side of the component */ getViewPane(side: string): PageSplitterPane; /** * Get kendo panes configuration * @method getKendoPaneConfiguration */ getKendoPaneConfiguration(): Array; /** * Collapses the left or right pane * @param [side] the side of the pane */ collapse(side: string): void; /** * Expands the left or right pane * @param [side] the side of the pane */ expand(side: string): void; /** * Force to resize and re-render this component. * Caution: this is heavy, use it only when needed! */ resize(force?: boolean): void; /** * This component has a layout available to be set */ onLoadLayout(layoutDef: PageSplitterLayoutDef): Promise; /** * A save operation was called by the page to save the component layout */ onSaveLayout(): Promise; /** * Handle collapse action. Collapse pane. * @method onCollapseButtonClick * @param {any} [side] the side of the component */ onCollapseButtonClick(side: any): void; /** * Handle expand action. Expand pane. * @method onExpandButtonClick * @param {any} [side] the side of the component */ onExpandButtonClick(side: any): void; /** * Handle splitter collapse action. * Stops bubbling and handles like a click. * @method onKendoPaneCollapse */ private onKendoPaneCollapse; /** * Handle splitter expand action. * Stops bubbling and handles like a click. * @method onKendoPaneExpand */ private onKendoPaneExpand; /** * Handle splitter resize action. * @method onKendoPaneResize */ private onKendoPaneResize; } export declare class PageSplitterModule { }