Socket
Socket
Sign inDemoInstall

ember-text-mask-addons

Package Overview
Dependencies
228
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ember-text-mask-addons

Addons for Ember Text Mask https://github.com/text-mask/text-mask/ember


Version published
Weekly downloads
181
increased by4.02%
Maintainers
1
Install size
13.4 MB
Created
Weekly downloads
 

Readme

Source

Ember-text-mask-addons

This Ember-cli addon provides a set of ready-to-use pipes and masks that can be used with Ember-text-mask.

  • Masks

    • numberMask
    • emailMask
  • Pipes

    • autoCorrectedDatePipe

Installation

ember install ember-text-mask-addons

Usage

Components

The addon provides Ember components that can be used directly in templates.

{{number-mask}}

{{email-mask}}

{{auto-corrected-date-pipe}}

Importing the masks and pipes

You can also import the masks or pipes and use them with the {{masked-input}} component provided by Ember-text-mask.

emailMask

To import and use the emailMask:

import { emailMask } from 'ember-text-mask-addons';

// ... do something with the emailMask

If you wanted to use the emailMask with the {{masked-input}} component, you would do this:

import Ember from 'ember';
import { emailMask } from 'ember-text-mask-addons';

export default Ember.Controller.extend({
  emailMask: emailMask
});
{{masked-input mask=emailMask}}
createNumberMask

You can use the createNumberMask() method to create a numberMask.

import Ember from 'ember';
import { createNumberMask } from 'ember-text-mask-addons';

export default Ember.Controller.extend({
  numberMask: createNumberMask()
});

Then you can use the numberMask with the {{masked-input}} component.

{{masked-input mask=numberMask}}
createAutoCorrectedDatePipe

You can use the createAutoCorrectedDatePipe() method to create an autoCorrectedDatePipe.

import Ember from 'ember';
import { createAutoCorrectedDatePipe } from 'ember-text-mask-addons';

export default Ember.Controller.extend({
  autoCorrectedDatePipe: createAutoCorrectedDatePipe('mm/dd/yyyy')
});

Then you can use the autoCorrectedDatePipe with the {{masked-input}} component.

{{masked-input pipe=autoCorrectedDatePipe}}

Documentation

See Text Mask Addons for more information and usage instructions.

For more information about the attributes that the {{masked-input}} component accepts, see the documentation here.

Example

To see an example of the code running, follow these steps:

  • Clone the repo, git clone git@github.com:text-mask/ember-text-mask-addons.git
  • cd ember-text-mask-addons
  • npm install
  • bower install
  • ember server
  • Open http://localhost:4200

License

Public domain - CC0 1.0 Universal

Keywords

FAQs

Last updated on 26 Apr 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc