Invision UI v.19.6.0-0

Getting Started

  • Running Invision UI
  • UI Component Anatomy
  • Authoring SCSS
  • Authoring Presentational Behavior

Component Foundations

  • SCSS Authoring
    • Mixins & Variables
    • Stateful Classes
  • State Guidance
    • Empty/Zero State
    • Loading State
  • Utilities
    • Align
    • Display
    • Flexbox
    • Font Size
    • Layout
    • Offset
    • Position
    • Overflow
    • Size
    • Spacing
    • Text
  • Layout
    • Arrange [Deprectated]
    • Divided Columns
    • Embed Video
    • Full and Center
    • Fill [Deprectated]
    • Grid
    • Media Blocks
    • Panels
    • Vertical Layouts
  • Media Queries
  • Angular Behaviors
    • App Theme Directive
    • Auto Focus Input
    • Filters
    • Popup (modal dialog) Manager
    • Tether (tooltip/dropdown) Manager
    • Resize Sensor
    • Watchers

UI Component Library

  • Content & Containment
    • Active Translation
    • Auto Fit Text
    • Address
    • Basic & Input Table
    • Brand Logo/Slogan
    • Call to Action - Empty State
    • Carousel
    • Cart
    • Choice
    • Collapsible Container
    • Copyright Footer
    • Coupon Redeemer
    • Content
    • Date Relative Display
    • Definition Lists
    • Delimited List
    • Details
    • Expiration Date Display
    • Feature Toggle
    • Form Section Heading
    • Header
    • Heading
    • Heading With Annotation
    • Icons
    • Interaction Details
    • Labeled Balance
    • Link
    • Main Container
    • Metadata Card
    • Metadata List Item
    • Offering QuickView
    • Payment Instrument
    • Preference Dialog
    • Pricing Plan Decoration
    • Product Availability
    • Product Details
    • Product Image
    • Quick Info Panel
    • Remark
    • Renewal Column
    • Richlist Filterbar
    • Richlist Wrapper
    • Scrollable Horizontal List
    • Search Card
    • Search Panel
    • Section
    • Selectable Option
    • Smart Truncate
    • Status Grid
    • Tooltip
  • Data Visualizations
    • Bill Runs
    • Comparison Table
    • Datatable
    • Progress Tracker
    • Schedules
    • Query Builder
  • Dialogs
    • Confirmation Dialog
    • Dialog
    • Rich List Dialog
    • Wait Dialog
  • Forms and Filters
    • Additional Properties
    • Autocomplete
    • 3 Field Date Input
    • Checkbox
    • Credit Card
    • Bulk Action Bar
    • Buttons
    • Confirmation Button
    • Date Picker
    • E-Check
    • Entity Specification
    • External Bill
    • External Gift Card
    • Focus Group
    • Forms
    • Filter Bar
    • Filter Dropdowns
    • Gift Card
    • Grouped Check Filters
    • Inputs
    • Input Select Combo
    • Monetary Input
    • Multi Dropdown Selector
    • Multiple Numeric Input
    • Monetary Range Input
    • Password Unmask Button
    • Select
    • Select Button Or Stepper
    • Select Or Text Input
    • Stepper
    • Tag Dropdown
  • Navigation & Flow
    • Back Banner
    • Back Component
    • Breadcrumbs
    • Details Pager
    • Expandable Section
    • Infinite Scroll
    • Open New Window
    • Pager
    • Fancy Richlist
    • Standard Navigator
    • Status Indicator
    • Step Progress Bar
    • Step Progress Indicator
    • Tab Card
    • Tab Panel
    • Tier Navigator
    • Wizard
  • Notifications
    • Loading Indicator
    • Toast Notifications
  • Deprecated
    • Content Area

Showcase

  • General
    • Simplelist
    • Richlist
    • Primary (side) Navigator
  • Customer Care
    • Case Activity List
    • Customer Care Navigator Component
    • Dashboard
    • Decisions
  • Reporting
    • Content Visualization

Unit Testing

  • Actions
  • Components
  • Selectors
  • Reducers

End-to-end Testing

Statistics

Filters

In this section

Variants
  • Currency Formatting
  • Datetime Filtering
  • Empty Value Formatting
  • Phone Formatting

Currency Formatting

Invision supports the formatting of currency values using the ISO 4217 specification via the browser's toLocaleString function. The filter has a single required parameter, the currency code, and also an optional parameter to specify the locale that governs the transformation. By default, the locale is currently hard coded to English, but once we expose the ability for the user to select their locale/language, we will update the default to represent the user's selection.

For this example, our controller specifies a cost variable on scope with a value of 125.25. Our first format will render that cost in the English locale, using USD as the currency.

Note: Invision UI does not support accessing Redux, but within Invision the second parameter of locale is optional. If you want to use the default locale (you probably will), you can omit passing 'en-us' to the filter.

Cost in USD: {{ cost | invCurrency:'USD':'en-us'}}

Next, we'll remain in the default locale, but we'll specify a few different currency codes.

Cost in EUR: {{ cost | invCurrency:'EUR':'en-us'}}
Cost in CNY: {{ cost | invCurrency:'CNY':'en-us'}}

Let's take a look at using a different locale. For these examples, we'll use the same currencies from the initial example, but we'll override the locale to French.

Cost in USD: {{ cost | invCurrency:'USD':'fr-fr'}}
Cost in EUR: {{ cost | invCurrency:'EUR':'fr-fr'}}
Cost in CNY: {{ cost | invCurrency:'CNY':'fr-fr'}}

Note that the filter automatically converts demial points to commas, and moves the currency code to the end of the currency.

Cost in USD without rounding: {{ cost | invCurrency:'USD':'en-us':true}}
HTML
<div class="t-content" ng-controller="invCurrencyExampleController">
    <p>For this example, our controller specifies a cost variable on scope with a value of 125.25.
        Our first format will render that cost in the English locale, using USD as the currency.</p>
    <p><strong>Note:</strong>  Invision UI does not support accessing Redux, but within Invision the second parameter of locale is optional.  If you want to use the default locale (you probably will), you can omit passing 'en-us' to the filter.</p>
    <div>Cost in USD: {{ cost | invCurrency:'USD':'en-us'}}</div>
    <p>Next, we'll remain in the default locale, but we'll specify a few different currency codes.</p>
    <div>Cost in EUR: {{ cost | invCurrency:'EUR':'en-us'}}</div>
    <div>Cost in CNY: {{ cost | invCurrency:'CNY':'en-us'}}</div>
    <p>Let's take a look at using a different locale.  For these examples, we'll use the same currencies from the initial example, but we'll override the locale to French.</p>
    <div>Cost in USD: {{ cost | invCurrency:'USD':'fr-fr'}}</div>
    <div>Cost in EUR: {{ cost | invCurrency:'EUR':'fr-fr'}}</div>
    <div>Cost in CNY: {{ cost | invCurrency:'CNY':'fr-fr'}}</div>
    <p>Note that the filter automatically converts demial points to commas, and moves the currency code to the end of the currency.</p>
    <div>Cost in USD without rounding: {{ cost | invCurrency:'USD':'en-us':true}}</div>
</div>

Datetime Filtering

Filters date time returned from Api to display.

Click a button to filter the "current" date to a localized format.
Localized Value: {{localDate | localShortDate}}
Localized Value: {{localDatetime | localShort}}
Duration: {{previousDatetime | timeAgo}}
Filter Datetime
Convert Time to UTC then Display in Local: {{anyDateTimeString | utcToLocalShort}}
- Takes time without timezone and considers it to be in UTC timezone.
Formatted to Short with Seconds: {{utcTime | shortWithSeconds}}
HTML
<div class="t-content">
    <div ng-controller="datetimeFormatterExampleController">
        <div>
            <div class="Test-box u-textNoWrap" style="margin-bottom: 10px;">
                Click a button to filter the "current" date to a localized format.
            </div>
            <div style="margin-bottom: 10px;">
                <button class="c-button u-ph0 u-mh0" ng-click="localizeDateToShortDate()">Filter Datetime to Localized Date Format</button>
            </div>
             <div style="margin-bottom: 10px; margin-left: 7px;">
                <span><strong>Localized Value</strong>: </span>
                <span class="Test-box u-textNoWrap">
                    {{localDate | localShortDate}}
                </span>
            </div>
            <div style="margin-bottom: 10px;">
                <button class="c-button u-ph0 u-mh0" ng-click="localizeDateToShort()">Filter Datetime to Localized Datetime Format</button>
            </div>
            <div style="margin-bottom: 10px; margin-left: 7px;">
                <span><strong>Localized Value</strong>: </span>
                <span class="Test-box u-textNoWrap">
                    {{localDatetime | localShort}}
                </span>
            </div>
            <div style="margin-bottom: 10px;">
                <button class="c-button u-ph0 u-mh0" ng-click="previousDatetime()">Get duration since the provided Datetime</button>
            </div>
            <div style="margin-bottom: 10px; padding-left: 7px;">
                <span><strong>Duration</strong>: </span>
                <span class="Test-box u-textNoWrap">
                    {{previousDatetime | timeAgo}}
                </span>
            </div>
            <div style="margin-bottom: 10px;">
                <span class="Test-box u-textNoWrap u-mr+">
                    <strong>Filter Datetime</strong>
                </span>
                <input id="dateWithoutZ"
                       type="text"
                       placeholder="Datetime string in any format"
                       ng-model="anyDateTimeString">
            </div>
            <div style="margin-bottom: 10px;">
                <span><strong>Convert Time to UTC then Display in Local</strong>: </span>
                <span class="Test-box u-textNoWrap">
                    {{anyDateTimeString | utcToLocalShort}}
                </span>
                <div>
                    - Takes time without timezone and considers it to be in UTC timezone.
                </div>
            </div>
            <div style="margin-bottom: 10px;">
                <span><strong>Formatted to Short with Seconds</strong>: </span>
                <span class="Test-box u-textNoWrap">
                    {{utcTime | shortWithSeconds}}
                </span>
            </div>
        </div>
    </div>
</div>

Empty Value Formatting

If the value specified is undefined, null or an empty string, it will display the emdash unicode character.

For this filter, we will demonstrate the use of formatting string values.

Examples

Values Code Output
Value Specified valueSpecified | invEmpty {{invEmptyExample.valueSpecified | invEmpty}}
Value Undefined valueUndefined | invEmpty {{invEmptyExample.valueUndefined | invEmpty}}
HTML
<div class="t-content" ng-controller="invEmptyExampleController as invEmptyExample">
    <p>
        For this filter, we will demonstrate the use of formatting string values.
    </p>

    <p><strong>Examples</strong></p>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px"><strong>Values</strong></span>
        <span class="u-flexItemGrow" style="width: 450px"><strong>Code</strong></span>
        <span class="u-flexItemGrow" style="width: 125px"><strong>Output</strong></span>
    </div>

    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Value Specified</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>valueSpecified | invEmpty</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invEmptyExample.valueSpecified | invEmpty}}</span>
    </div>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Value Undefined</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>valueUndefined | invEmpty</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invEmptyExample.valueUndefined | invEmpty}}</span>
    </div>
</div>

Phone Formatting

Invision supports the formatting of international phone numbers.

For this filter, we will demonstrate the use of formatting phone numbers.

Options

Nine Digit Number ("025550123")

Ten Digit Number ("4025550123")

Eleven Digit American Number ("14025550123")

Eleven Digit Non-American Number ("24025550123")

Examples

Values Code Output
Nine Digit nineDigitNumber | invPhone {{invPhoneExample.nineDigitNumber | invPhone}}
Ten Digit tenDigitNumber | invPhone {{invPhoneExample.tenDigitNumber | invPhone}}
Eleven Digit American elevenDigitAmericanNumber | invPhone {{invPhoneExample.elevenDigitAmericanNumber | invPhone}}
Eleven Digit Non-American elevenDigitNonAmericanNumber | invPhone {{invPhoneExample.elevenDigitNonAmericanNumber | invPhone}}
HTML
<div class="t-content" ng-controller="invPhoneExampleController as invPhoneExample">
    <p>
        For this filter, we will demonstrate the use of formatting phone numbers.
    </p>

    <p><strong>Options</strong></p>
    <p>Nine Digit Number ("025550123")</p>
    <p>Ten Digit Number ("4025550123")</p>
    <p>Eleven Digit American Number ("14025550123")</p>
    <p>Eleven Digit Non-American Number ("24025550123")</p>

    <p><strong>Examples</strong></p>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px"><strong>Values</strong></span>
        <span class="u-flexItemGrow" style="width: 450px"><strong>Code</strong></span>
        <span class="u-flexItemGrow" style="width: 125px"><strong>Output</strong></span>
    </div>

    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Nine Digit</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>nineDigitNumber | invPhone</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invPhoneExample.nineDigitNumber | invPhone}}</span>
    </div>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Ten Digit</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>tenDigitNumber | invPhone</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invPhoneExample.tenDigitNumber | invPhone}}</span>
    </div>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Eleven Digit American</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>elevenDigitAmericanNumber | invPhone</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invPhoneExample.elevenDigitAmericanNumber | invPhone}}</span>
    </div>
    <div class="u-flex" style="height:35px; width:775px">
        <span class="u-flexItemGrow" style="width: 200px">Eleven Digit Non-American</span>
        <span class="u-flexItemGrow" style="width: 450px"><code>elevenDigitNonAmericanNumber | invPhone</code></span>
        <span class="u-flexItemGrow" style="width: 125px">{{invPhoneExample.elevenDigitNonAmericanNumber | invPhone}}</span>
    </div>
</div>