x-tag-text-pattern-matcher

Used to watch text inputs for regular expression matches, then fires a custom method that allows the user to return a list of results.


Keywords
Element, web-components, x-tag
Install
bower install x-tag-text-pattern-matcher

Documentation

About Text Pattern Matcher

These elements allow you to watch multiple input fields for multiple patterns and then return a custom list of suggestions for each match.

Use

bower install x-tag-text-pattern-matcher

Example

// describe usage

<p>Enter text that begins with # or @</p>
<input type="text" class="tagFields">
<p>A single tag can watch multiple inputs</p>
<input type="text" class="tagFields">

<x-text-pattern-matcher target="input.tagFields">
  <x-pattern-matcher split="(#\w+)" select="#(\w+)" onmatch="matchColors"></x-pattern-matcher>
  <x-pattern-matcher split="(@\w+)" select="@(\w+)" onmatch="matchUsers"></x-pattern-matcher>
  <x-pattern-matcher split="(@)" select="@" onmatch="topUsers"></x-pattern-matcher>
</x-text-pattern-matcher>

function matchColors(match, callback){
	callback([]);
}

function matchUsers(match, callback){
	callback([]);
}

function topUsers(match, callback){
	callback([]);
}

Links

Yeoman X-Tag Generator

X-Tags Docs

Guide for creating X-Tag Components

Using X-Tag components in your applications