How to use the text-mask-core.createTextMaskInputElement function in text-mask-core

To help you get started, we’ve selected a few text-mask-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dsuryd / dotNetify-Elements / DevApp / src / dotnetify-elements / _internal / VMInput.js View on Github external
'9': /[0-9]/,
            U: /[A-Z]/,
            A: /[a-zA-Z]/,
            '*': /[0-9a-zA-Z]/
         };
         let { type, ...inputMask } = utils.toCamelCase(this.attrs.mask);
         if (type === 'NumberMask') {
            if (inputMask.includeThousandsSeparator) {
               const regex = new RegExp(inputMask.thousandsSeparatorSymbol, 'g');
               this._unmask = value => (typeof value == 'string' ? value.replace(regex, '') : value);
            }
            inputMask = createNumberMask(inputMask);
         }
         else inputMask = inputMask.mask.split('').map(c => (maskMap.hasOwnProperty(c) ? maskMap[c] : c));

         this._textMask = createTextMaskInputElement({ inputElement: this._inputElement, mask: inputMask });
         this._textMask.update(this.value || '');
      }
   }
github atanasster / grommet-nextjs / components / grommet / MaskedInput / MaskedInput.js View on Github external
initTextMask() {
    const { props, props: { value } } = this;
    if (props.mask && this.inputControlRef) {
      this.textMaskInputElement = createTextMaskInputElement({
        inputElement: this.inputControlRef,
        ...props,
      });
      this.textMaskInputElement.update(value);
    }
  }

text-mask-core

Core of https://github.com/text-mask/text-mask

Unlicense
Latest version published 6 years ago

Package Health Score

62 / 100
Full package analysis