A text input component for Social Insurance Numbers (SIN) in Canada. A social insurance number consists of nine digits, divided into three parts of three digits each. An example social insurance number is 123 456 789.

Events:

openfl.events.Event.CHANGE

Dispatched when SINTextInput.text changes.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

Static variables

@:value("sinTextInput_errorCallout")staticfinalread onlyCHILD_VARIANT_ERROR_CALLOUT:String = "sinTextInput_errorCallout"

The variant used to style the error string TextCallout child component in a theme.

To override this default variant, set the SINTextInput.customErrorCalloutVariant property.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

Constructor

@:value({ text : "" })new(text:String = "", ?changeListener:Event ‑> Void)

Creates a new SINTextInput object.

Available since

feathersui-text-inputs-pack 1.0.0

.

Variables

@:style@:flash.propertybackgroundSkin:DisplayObject

The default background skin for the text input, which is used when no other skin is defined for the current state with setSkinForState().

The following example passes a bitmap for the text input to use as a background skin:

input.backgroundSkin = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

read onlybaseline:Float

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.ITextControl.baseline

@:bindable("stateChange")read onlycurrentState:TextInputState

The current state of the text input.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.TextInputState

  • FeathersEvent.STATE_CHANGE

@:style@:flash.propertycustomErrorCalloutVariant:String

A custom variant to set on the error callout, instead of SINTextInput.CHILD_VARIANT_ERROR_CALLOUT.

The customErrorCalloutVariant will be not be used if the TextCallout already has a variant set.

Available since

feathersui-text-inputs-pack 1.0.0s

.

See also:

@:style@:flash.propertydisabledTextFormat:AbstractTextFormat

The font styles used to render the text input's text when the text input is disabled.

In the following example, the text input's disabled text formatting is customized:

input.enabled = false;
input.disabledTextFormat = new TextFormat("Helvetica", 20, 0xee0000);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

editable:Bool

Indicates if the text input is editable.

The following example disables editing:

textInput.editable = false;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertyembedFonts:Bool

Determines if an embedded font is used or not.

In the following example, the text input uses embedded fonts:

input.embedFonts = true;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

errorCalloutFactory:AbstractDisplayObjectFactory<Dynamic, TextCallout>

Creates the error callout, which must be of type feathers.controls.TextCallout.

In the following example, a custom error callout factory is provided:

textInput.errorCalloutFactory = () ->
{
	return new TextCallout();
};
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.controls.TextCallout

errorString:String

Error text to display in a TextCallout when the text input has focus. When this value is not null the text input's currentState is changed to TextInputState.ERROR.

An empty string will change the background, but no TextCallout will appear on focus.

To clear an error, the errorString property must be set to null.

The following example displays an error string:

input.errorString = "Something is wrong";
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

read onlyerrorStringCalloutOpen:Bool

Indicates if the callout for the errorString is currently open or closed.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyleftView:DisplayObject

An optional view displayed inside the text input, to the left of its text.

The following example passes a bitmap for the text input to use as a left view:

input.leftView = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyleftViewGap:Float

The gap between the left view and the text.

The following example sets the left view's gap to 20 pixels:

input.leftViewGap = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertypaddingBottom:Float

The minimum space, in pixels, between the text input's bottom edge and the text input's content.

In the following example, the text input's bottom padding is set to 20 pixels:

input.paddingBottom = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingLeft:Float

The minimum space, in pixels, between the text input's left edge and the text input's content.

In the following example, the text input's left padding is set to 20 pixels:

input.paddingLeft = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingRight:Float

The minimum space, in pixels, between the text input's right edge and the text input's content.

In the following example, the text input's right padding is set to 20 pixels:

input.paddingRight = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertypaddingTop:Float

The minimum space, in pixels, between the text input's top edge and the text input's content.

In the following example, the text input's top padding is set to 20 pixels:

input.paddingTop = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

@:style@:flash.propertyrightView:DisplayObject

An optional view displayed inside the text input, to the right of its text.

The following example passes a bitmap for the text input to use as a right view:

input.rightView = new Bitmap(bitmapData);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyrightViewGap:Float

The gap between the right view and the text.

The following example sets the right view's gap to 20 pixels:

input.rightViewGap = 20.0;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:bindable("change")text:String

The SIN string displayed by the text input. Always returns a formatted SIN with a space between each group of three digits. May be set with a string that has the same formatting. However, the setter also accepts a string of numeric digits only with no spaces, or it will allow a - character as the delimiter between each group of three digits instead of a space. Partial SIN values are allowed as well.

When the value of the text property changes, the text input will dispatch an event of type Event.CHANGE.

The following example sets the text input's text to a valid SIN:

input.text = "123 456 789";

The following example sets the text input's text to a valid SIN without delimiters between each groups of three digits:

input.text = "123456789";

The following example sets the text input's text to a valid partial SIN:

input.text = "123 4";
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertytextFormat:AbstractTextFormat

The font styles used to render the text input's text.

In the following example, the text input's formatting is customized:

input.textFormat = new TextFormat("Helvetica", 20, 0xcc0000);
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@:style@:flash.propertyverticalAlign:VerticalAlign

How the content is positioned vertically (along the y-axis) within the text input.

The following example aligns the text input's content to the top:

input.verticalAlign = TOP;
Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

  • feathers.layout.VerticalAlign.TOP

  • feathers.layout.VerticalAlign.MIDDLE

  • feathers.layout.VerticalAlign.BOTTOM

  • feathers.layout.VerticalAlign.JUSTIFY

Methods

getSkinForState(state:TextInputState):DisplayObject

Gets the skin to be used by the text input when its currentState property matches the specified state value.

If a skin is not defined for a specific state, returns null.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

getTextFormatForState(state:TextInputState):AbstractTextFormat

Gets the text format to be used by the text input when its currentState property matches the specified state value.

If a text format is not defined for a specific state, returns null.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

setPadding(value:Float):Void

Sets all four padding properties to the same value.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@stylesetSkinForState(state:TextInputState, skin:DisplayObject):Void

Set the skin to be used by the text input when its currentState property matches the specified state value.

If a skin is not defined for a specific state, the value of the backgroundSkin property will be used instead.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also:

@stylesetTextFormatForState(state:TextInputState, textFormat:AbstractTextFormat):Void

Set the text format to be used by the text input when its currentState property matches the specified state value.

If a text format is not defined for a specific state, the value of the textFormat property will be used instead.

Available since

feathersui-text-inputs-pack 1.0.0

.

See also: