/** Core */ import { CoreComponent } from "cmf.core/src/core"; import Cmf from "cmf.lbos"; /** Angular2 */ import * as ng from "@angular/core"; /** Nested components */ import { KeyPadButtonPressedEventArgs } from "../keyPad/keyPad"; import { ElementQuery } from "../../directives/elementQuery/elementQuery"; /** * @whatItDoes * Spinner keypad Component - * This component shows an input field with a spinner at is right. * * @howToUse * This component is used with the inputs and outputs mentioned below. * * ### Inputs * `boolean` : **required** - Determines if the input is mandatory or not. (default is _null_) ; * `string` : **placeholder** - Placeholder to display inside the input * `boolean` : **disabled** - Determines if the input is disabled (default is _null_) ; * `any` : **value** - Initial value (supports two-way data binding) ; * `any` : **valueType** - ValueType, can be Long, Decimal, Integer ; * `Cmf.Foundation.Common.RangeType` : **rangeType** - Defines if min and max are included in the range of type _Cmf.Foundation.Common.RangeType_ ; * `number` : **min** - Min value accepted by the input ; * `number` : **max** - Max value accepted by the input ; * `number` : **step** - Step used by the spinner (default is 1) ; * `number` : **numberOfDecimals** - Maximum number of decimal places. Above this number, the value is rounded ; * `boolean` : **removeOkButton** - Flag to removeOkButton ; * `boolean` : **disableInvalidOkButton** - Flag to disable ok button when the value is invalid (default is false) * `boolean` : **readonly** - A flag that is used to change/not change the keyboard spinner to readonly. * `boolean` : **showSpinnerValidationErrors** - Flag that controls wether spinner validations errors are shown (defaults to false) * `string` : **units** - Units of the value being manipulated displayed on the spinner * * #### Supported Types * * Integer (uses max and min equal to C# limits) * * Decimal (step is 0.01, numberOfDecimals is 8) * * ### Outputs * `any` : **valueChange** - Triggered when the value change ; * `KeyPadButtonPressedEventArgs` : **keyPressed** - Keypad value changed . * * ## Example * * ```HTML * * * ``` */ export declare class SpinnerKeyPad extends CoreComponent implements ng.AfterViewInit, ng.OnDestroy { private _elementRef; /** * Nested page */ private _nestedSpinner; /** * spinner keypad resize event */ private _resizeWidthHeightSubscription; /** * Nested spinner native input element accessor */ private _spinnerInput; /** * Selection range */ private _selectionRange; /** * Gets or sets the type */ _valueType: any; /** * Gets or sets the spinnerKeyPad width */ _width: string; /** * Gets or sets the spinnerKeyPad height */ _height: string; /** * Visibility of the keypad (depending on available size) */ _collapsed: boolean; /** * Field is required */ required: boolean; /** * Field is disabled */ disabled: boolean; /** * Gets the input type */ /** * Sets the input type */ type: any; /** * Gets the input valueType */ /** * Sets the input valueType */ valueType: any; /** * Gets or sets the maximum value */ max: number; /** * Gets or sets the minimum value */ min: number; /** * Gets or sets the step. */ step: number; /** * Gets or sets the placeholder */ placeholder: string; /** * Maximum number of decimal places. Above this number, the value is rounded. This value is defined externally */ numberOfDecimals: number; /** * Component value - can be either numeric or string */ value: any; /** * Gets or sets the range type. * Default: IncludeBoth */ rangeType: Cmf.Foundation.Common.RangeType; /** * Flag that controls wether spinner validations errors are shown */ showSpinnerValidationErrors: boolean; /** * Spinner value changed */ valueChange: ng.EventEmitter; /** * Keypad value changed */ keyPressed: ng.EventEmitter; /** * Remove OK Button from Keypad */ removeOkButton: boolean; /** * Disables ok button if the value is invalid */ disableInvalidOkButton: boolean; /** * Field is readonly */ readonly: boolean; /** * Element query element */ elementQuery: ElementQuery; /** * Holds the valid status of the spinner */ _isValid: boolean; /** * Units of the value being manipulated displayed on the spinner */ units: string; constructor(_elementRef: ng.ElementRef); /** * On spinner value changed */ onValueChange(value: any): void; /** * Returns true if the spinner keypad value is valid according to validation */ isValid(): boolean; /** * On keypad key selected - update spinner value */ onKeyPadSelected(event: KeyPadButtonPressedEventArgs): void; /** * Trigger popover to pop, if visible */ triggerPopover(): void; /** * On keypad key mouse down - set input selection range */ onKeyPadMouseDown(e: Event): void; ngAfterViewInit(): void; /** * On component destruction - unsubscribe events. */ ngOnDestroy(): void; /** * Returns the respective value from a Percentage * * @param percentageToFindValue percentage value that is intended discover the value. * @param value100Percent value that represents 100%. */ private getValueFromPercentage; /** * Returns the respective percentage from a value * @param valueToFindPercentage value that is intended discover the percentage. * @param value100Percent value that represents 100%. */ private getPercentage; /** * Calculate the new SpinnerKeypad Width and Height when the container is resized in order to keep it on the center * @param dimensionValues current dimensions after resize. */ private onKeypadResize; /** * Sets the spinner value * @param value Can be either numeric or string */ setValue(value: any): void; } export declare class SpinnerKeyPadModule { }