Sha256: 8216088e9c1fab841b2a90c84b5b20b76d29ae0cf5f0e9e555dc0683d15f4cba

Contents?: true

Size: 1.76 KB

Versions: 39

Compression:

Stored size: 1.76 KB

Contents

'use strict'

define 'aura/extensions/mask',

  version: '0.1.2'

  require:
    paths:
      jquery: true
      'jquery.mask': true
      'jquery.mask_extensions': true
      'jquery.mask_numeric_extensions': true
    shim:
      # TODO implement exports option to check for properties
      'jquery.mask_extensions': ['jquery.mask']
      'jquery.mask_numeric_extensions': ['jquery.mask', 'jquery.mask_extensions']

  initialize: (application) ->
    {core, sandbox} = application

    with_aura = 'jquery.mask'
    require with_aura

    with_aura = 'jquery.mask_extensions'
    require with_aura

    with_aura = 'jquery.mask_numeric_extensions'
    require with_aura

    mask = (selector, mask, options) -> $(selector).inputmask mask, options

    sandbox.ui = sandbox.util.extend sandbox.ui, mask: mask

  extend: ->

    # TODO conditionally extend and require this masks

    $.extend $.inputmask.defaults.aliases.integer,
        groupSeparator : '.'
        autoGroup      : true
        autoUnmask     : true

    $.extend $.inputmask.defaults.aliases.decimal,
        groupSeparator : '.'
        radixPoint     : ','
        autoGroup      : true
        autoUnmask     : true

    $.extend $.inputmask.defaults.aliases,
        price:
          alias          : 'decimal'
          digits         : 2
          allowMinus     : false
          allowPlus      : false

        plate:
          mask           : 'AAA-9999'

        meters:
          alias          : 'integer'
          allowMinus     : false
          allowPlus      : false
          integerDigits  : 6

        cpf:
          mask           : '999.999.999-99'

        cnpj:
          mask           : '99.999.999/9999-99'

        phone:
          mask           : '(99) 9999[9]-9999'


  afterAppStart: ->
    @extend()


Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ende-0.5.22 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.21 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.20 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.19 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.18 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.17 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.16 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.15 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.14 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.13 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.12 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.10 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.9 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.8 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.7 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.6 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.4.25 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.5 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.4 lib/assets/javascripts/aura/extensions/mask.js.coffee
ende-0.5.3 lib/assets/javascripts/aura/extensions/mask.js.coffee