/** Core */ import { Generic } from "cmf.core/src/core"; /** Angular2 */ import * as ng from "@angular/core"; /** Nested components */ import { OnValidateArgs, ValidatorModel } from "../../directives/validator/validator"; /** Model */ import * as ColumnViewStructure from "./columnViewStructure"; /** * Header buttons actions */ export declare enum HeaderButtonOperationType { Add = 0, Delete = 1 } /** * The automatic configurations for scroll, in the center */ export declare const SCROLL_INTO_VIEW_DEFAULT_CENTER_OPTIONS: ScrollIntoViewOptions; /** * The automatic configurations for scroll, in the end */ export declare const SCROLL_INTO_VIEW_DEFAULT_END_OPTIONS: ScrollIntoViewOptions; /** * Generic column view leaf state - used to define property and link items state */ export declare enum ColumnViewLeafState { NotApplicable = 0, Adding = 1, Added = 2, Unchanged = 3, Updating = 4, Updated = 5, Deleting = 6, Deleted = 7 } /** * ColumnView leaf tag */ export interface ColumnViewLeafTag { id: string; state: ColumnViewLeafState; valid: boolean; } /** * ColumnView util class * * @class ColumnViewUtil */ export declare class ColumnViewUtil extends Generic { /** * Get leaf id */ getNewId(prefix: string): string; /** * Get a blank leaf to add to a columnView item * @returns The new leaf */ getBlankLeaf(): ColumnViewStructure.ColumnViewLeaf; /** * Add a blank leaf to columnView * @param node Node that will have a new leaf * @returns The newly addded leaf */ addBlankLeaf(node: ColumnViewStructure.ColumnViewNode): ColumnViewStructure.ColumnViewLeaf; /** * Based on properties form validate a single leaf */ validateLeaf(validatorModel: ValidatorModel): Promise; /** * Based on a ColumnView model, checks if all the leafs are valid */ areAllLeafsValid(columnView: ColumnViewStructure.ColumnViewModel): boolean; /** * Based on a ColumnView model, checks if all the leafs are valid */ isColumnViewValid(columnView: ColumnViewStructure.ColumnViewModel): boolean; /** * Based on a ColumnView model, checks if all the leafs are valid */ isItemValid(columnViewItem: ColumnViewStructure.ColumnViewItem): boolean; /** * Checks if a state is valid */ isStateValid(state: ColumnViewLeafState): boolean; /** * Checks if a single the leaf is valid */ isLeafValid(leaf: ColumnViewStructure.ColumnViewLeaf): boolean; /** * Checks if a state is final */ isStateFinal(state: ColumnViewLeafState): boolean; /** * Checks if a single leaf is in state final */ isLeafFinal(leaf: ColumnViewStructure.ColumnViewLeaf): boolean; /** * Based on a ColumnView model, get all valid leafs ids */ getFinalLeafsIds(columnView: ColumnViewStructure.ColumnViewModel): Array; /** * Based on a ColumnView model, get all invalid leafs ids */ getUnfinalLeafsIds(columnView: ColumnViewStructure.ColumnViewModel): Array; /** * Based on a ColumnView model, get all valid leafs */ getFinalLeafsObjs(originalObjs: Array, columnView: ColumnViewStructure.ColumnViewModel): Array; /** * Based on a ColumnViewLeaf validation result - update its state */ getLeafState(state: ColumnViewLeafState, valid: boolean): ColumnViewLeafState; /** * onValidate - Check if all the leafs are valid */ onColumnViewValidate(args: OnValidateArgs, elementRef: ng.ElementRef, columnViewModel: ColumnViewStructure.ColumnViewColumnModel, contextMessage: string): Promise; /** * onValidate - Check if all the leafs are valid */ onColumnViewValidateWithDialog(context: OnValidateArgs, elementRef: ng.ElementRef, columnViewModel: ColumnViewStructure.ColumnViewColumnModel, contextMessage: string): Promise; /** * Returns the path to a given leaf, starting on a given node, using rudimentary depth first approach * Note: This only works if the node children are a strict array instead of a function * @param node Starting node * @param leafIf Id of leaf we are trying to find * @param path Current path to this node */ findPathToLeaf(node: ColumnViewStructure.ColumnViewNode, leafId: string, path?: ColumnViewStructure.ColumnViewNode[]): Array; /** * Method responsible to scroll into view * @param classes the classes target to use in the smooth scroll * @param scrollConfigurations the scroll configurations. Behavior and/or block */ scrollToSelectedIntoView(contextElement: HTMLElement, scrollConfigurations?: ScrollIntoViewOptions | boolean, classes?: string): void; }