MCPcopy Index your code
hub / github.com/assisrafael/angular-input-masks

github.com/assisrafael/angular-input-masks @v4.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v4.4.1 ↗ · + Follow
40 symbols 77 edges 88 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

angular-input-masks Build Status Coverage Status Standard Version

NPM

Join the chat at https://gitter.im/assisrafael/angular-input-masks Bountysource

Opinionated angular input masks. Provides ready to use masks with little (br/inscricao-estadual) to no configuration (number, cnpj, etc).

Compatibility

  • angular-input-masks@~2: angular@^1.3 (however is only tested with lastest 1.x version) and ECMAScript 5 compliant browsers (however CI only tests chrome and firefox).
  • angular-input-masks@~1: angular@~1.2

Installation

npm install --save angular-input-masks

Configuration

Without browserify:

  1. Import the angular-input-masks-standalone.min.js script in your page. For example:
<script src="https://github.com/assisrafael/angular-input-masks/raw/v4.4.1/angular-input-masks-standalone.min.js"></script>

Obs: for npm the build scripts are available inside releases folder.

  1. Include the module name ui.utils.masks in your angular app. For example:
angular.module('app', ['ui.utils.masks']);

With browserify:

angular.module('demo', [require('angular-input-masks')]);

Internationalization

Some masks are internationalized, so you need to include the proper angular-locale in your app(see: https://docs.angularjs.org/guide/i18n).

How to use

  • Number mask Example :
<input type="text" name="field" ng-model="number" ui-number-mask>
  • Define the number of decimals (default is 2):
<input type="text" name="field" ng-model="number" ui-number-mask="3">

More examples

See more usage examples in the Demo page

Other build options

If you are using npm (without browserify):

  • angular-input-masks-dependencies.js: provides all external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-br.js: provides only global and BR directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-us.js: provides only global and US directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-fr.js: provides only global and FR directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks.js: provides all directives, and does not include external dependencies (string-mask, br-validations, momentjs)

If you are using npm with browserify:

  • require('angular-input-masks'): provides all directives
  • require('angular-input-masks/br'): only global and BR directives
  • require('angular-input-masks/us'): only global and US directives
  • require('angular-input-masks/fr'): only global and FR directives

Filters

Looking for related filters? Take a look at angular-br-filters

Build

npm install
npm run build

Tests

npm run test:unit
  • e2e:
  • Uses Protractor + Jasmine
  • Files: src/**/*.spec.js
npm run test:e2e
  • To run both tests:
npm test

Core symbols most depended-on inside this repo

maskFactory
called by 16
src/global/money/money.js
clearValue
called by 3
src/br/inscricao-estadual/ie.js
applyIEMask
called by 2
src/br/inscricao-estadual/ie.js
findOption
called by 2
src/br/phone/br-phone.js
parser
called by 2
src/global/money/money.js
getMask
called by 1
src/br/inscricao-estadual/ie.js
parser
called by 1
src/br/inscricao-estadual/ie.js
clearDelimitersAndLeadingZeros
called by 1
src/helpers/pre-formatters.js

Shape

Function 40

Languages

TypeScript100%

Modules by API surface

src/br/inscricao-estadual/ie.js6 symbols
src/global/scientific-notation/scientific-notation.js5 symbols
src/global/percentage/percentage.js4 symbols
src/global/number/number.js4 symbols
src/global/money/money.js4 symbols
src/global/date/date.js3 symbols
config/protractor.conf.js3 symbols
src/helpers/pre-formatters.js2 symbols
src/helpers/number-mask-builder.js2 symbols
gulpfile.js2 symbols
src/us/phone/us-phone.spec.js1 symbols
src/global/time/time.js1 symbols

For agents

$ claude mcp add angular-input-masks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact