/** Angular2 */
import * as ng from "@angular/core";
/** Core */
import { CoreComponent } from "cmf.core/src/core";
/** Bags */
import { ResultMessageBag } from "../resultMessage/resultMessageBag";
import { OnValidate, OnValidateArgs } from "../../directives/validator/validator";
export declare enum SpinnerType {
Long,
Decimal,
Integer
}
/**
* Boolean flag the controls the default behavior of the spinner increase or decrease icons visibility
*/
export declare const SPINNER_STEPS_DEFAULT_VISIBILITY: boolean;
/**
* @whatItDoes
* Spinner 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 ;
* `any` : **rangeType** - Defines if min and max are included in the range of type Cmf.Foundation.Common.RangeType ;
* `any` : **min** - Min value accepted by the input ;
* `any` : **max** - Max value accepted by the input ;
* `any` : **step** - Step used by the spinner (default is 1, only applies if showIcons is true) ;
* `any` : **numberOfDecimals** - Maximum number of decimal places. Above this number, the value is rounded ;
* `boolean` : **readonly** - A flag that is used to change/not change the keyboard spinner to readonly .
* `boolean` : **showIcons** - Controls wether the plus and minus icons appear to increment or decrement the value (disables visibility of the units)
* `string` : **units** - Displays the units on the right side of the spinner
* `boolean` : **showValidationErrors** - Controls wether validation errors are shown using a popover (default is false)
*
* #### Supported Types
* * Integer (uses max and min equal to C# limits)
* * Decimal (step is 0.01, numberOfDecimals is 8)
* * Long
*
* ### Outputs
* `any` : **valueChange** - Triggered when the value change .
*
* ### Example
* To use the component, assume this HTML Template as an example:
*
* ```HTML
*
* ```
*/
export declare class Spinner extends CoreComponent implements ng.OnChanges, OnValidate {
private _elementRef;
private changeDetector;
/**
* Nested spinner native input element accessor
*/
private _spinnerInput;
/**
* Nested pop over result message component
*/
private _nestedPopOver;
/**
* Field is required
*/
_required: boolean;
/**
* Field is readonly
*/
readonly: boolean;
/**
* Field is disabled
*/
_disabled: boolean;
/**
* Spinner type
*/
_valueType: SpinnerType;
/**
* Gets or sets the range type. Default: IncludeBoth
*/
private _rangeType;
/**
* Range type step. Default is 1 (Integer)
*/
_step: any;
/**
* Maximum number of decimal places. Above this number, the value is rounded. Default is 0 (Integer)
*/
private _numberOfDecimals;
/**
* Minimum value allowed. Default is -2147483648 (Integer)
*/
private _min;
/**
* Maximum value allowed. Default is 2147483647 (Integer)
*/
private _max;
/**
* Defines if the component is in and erroneous state
*/
_validationError: boolean;
/**
* Defines if the control key has been pressed
*/
private _ctrlKeyPressed;
/**
* Defines if the new value was pasted into the input (ctrl+v)
*/
private _valuePasted;
private _inputRef;
/**
* Component value. Number (integer/float), Long (obj) or text value (string)
*/
private _value;
/**
* Regex that validate a decimal number
*/
private validDecimalKeyRegex;
/**
* Regex that validate a integer number
*/
private validIntegerKeyRegex;
/**
* Stores all the messages that are required to show
*/
_resultMessages: Array;
/**
* Component decimal value. Always a decimal object
*/
decimalValue: any;
/**
* Maximum value allowed, defined externally and used for validation purposes
*/
max: any;
/**
* Minimum value allowed, defined externally and used for validation purposes
*/
min: any;
/**
* Value that is incremented or decremented when the spinner is interacted with. Default is 1.
*/
step: any;
/**
* Maximum number of decimal places. Above this number, the value is rounded. This value is defined externally
*/
numberOfDecimals: any;
/**
* Nested input placeholder string
*/
placeholder: string;
/**
* Nested input string value
*/
stringValue: string;
/**
* Controls wether the plus and minus icons appear
*/
showIcons: boolean;
/**
* Controls wether validation errors are shown using a popover
*/
showValidationErrors: boolean;
/**
* Gets the value property.
*/
/**
* Sets the value property
*/
value: any;
/**
* Gets the input type
*/
/**
* Sets the input type
*/
type: any;
/**
* Gets the input valueType
*/
/**
* Sets the input valueType
*/
valueType: any;
/**
* Gets the input type
*/
/**
* Sets the input type
*/
rangeType: any;
/**
* Gets the required property.
*/
/**
* Sets the required property
*/
required: boolean;
/**
* Gets the disabled property.
*/
/**
* Sets the disabled property
*/
disabled: boolean;
/**
* Sets the units property.
*/
/**
* Gets the units property.
*/
units: string;
/**
* Inner units property
*/
_units: string;
/**
* Value Changed
*/
valueChange: ng.EventEmitter;
constructor(_elementRef: ng.ElementRef, changeDetector: ng.ChangeDetectorRef);
/**
* Shortcut to get a decimal
* @param value Can be of type string, number or decimal object
* @return decimal object
*/
private getDecimal;
/**
* Set spinner value (sets both decimalValue and stringValue) based on property value, doesn't set string value
*/
setInternalValue(value: any): void;
/**
* Set spinner value (sets both decimalValue and stringValue) based on property value
*/
setValue(value: any): void;
/**
* Based on the current decimal value update internal value and validates
*/
private updateInternalValue;
/**
* Set default limits
*/
private setDefaultLimits;
/**
* Based on spinner type, update min and max limits, step and number of decimals
*/
private updateLimits;
/**
* Internal validation - Validate content and apply error classes if necessary
*/
private internalValidation;
/**
* Returns the valid state of the spinner
* @returns true if valid
*/
isValid(): boolean;
/**
* On increase click - add step to current value and notify
*/
onIncreaseClick(): void;
/**
* On decrease click - subtract step to current value and notify
*/
onDecreaseClick(): void;
/**
* Validation function (for instance triggered by a wizard).
* @param context ValidationContext
*/
onValidate(context: OnValidateArgs): Promise;
/**
* Called when the spinner value is changed.
*/
onValueChange(value: any): void;
/**
* On key down - filter and prevent default
*/
onKeyDown(event: KeyboardEvent): void;
/**
* On key up - filter and prevent default
*/
onKeyUp(event: KeyboardEvent): void;
/**
* Trigger popover, if visible
*/
triggerPopover(): void;
/**
* When component changes - update
*
* @param {any} [changes] Complex object that contains a set of properties that have changed
*/
ngOnChanges(changes: any): void;
}
export declare class SpinnerModule {
}