j-InputTags
Configuration:
required {Boolean}optional, enables "required" (default:false)icon {String}optional, icon for label e.g.home,cog, etc.licon {String}optional, left icon e.g.home,cog, etc.liconclick {String}optional, a path to methodfunction(component, input)ricon {String}optional, right icon e.g.home,cog, etc.riconclick {String}optional, a path to methodfunction(component, input)label {String}optional, a label (default is HTML content)after {String}optional, it means a char after label (default::)placeholder {String}optional, adds aplaceholdertext into the inputvalidate {String}optional, a condition for validating of value, can contain a link tofunction(value)or!!value.match(/[a-z]+/)disabled {Boolean}optional, disables this componenterror {String}optional, adds astringtext under the componentspaces {Boolean}optional, enables spaces otherwise it removes them (default:true)innerlabel {Boolean}optional, enables inner label (default:true)dirsource {String}optional, path to a data-source or NEW can contain a link to methodfunction(search, next(items_arr))dircustom {String/Boolean}optional, can contain a path tofunction(val, next(new_val))or can beBoolean. This option can enable adding a custom value (value not defined in data-source)dirrender {String}optional, a path tofunction(item, text)(must return HTML forj-Directory), this function can affect list of items inj-Directorydirminwidth {Number}optional, a minimum width forj-Directory, default:200dirmaxwidth {Number}optional, a maximum width forj-Directorydirplaceholder {String}optional, a placeholder forj-Directorydirempty {String}optional, adds an empty field forj-Directorydirkey {String}optional, a key name for reading oftextindirsource(default:name)dirvalue {String}optional, a key name for reading ofvalueindirsource(default:id)autosource {String}a path tosearchfunction inautocomplete,function(search, render(arr))autovalue {String}a property path for the value inautosourcetransform {Number}optional, transforms the text0 - none, 1 - lowercase, 2 - uppercase, 3 - capitalize(Default:0)enteronly {Boolean}optional, appends a new value afterenterkey is pressed (default:true)
Interesting:
dirsource:path.to.datasourceneedsdirectorycomponent- if
liconorriconstarts with!then the component render a raw value instead oficon dirsourcewith paths to methods can load data asynchronously
Use it with <ui-component name="inputtags">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.
<ui-component name="directory" config="placeholder:Search..."></ui-component>
<div style="width:400px">
<ui-component name="inputtags" path="form.frameworks" config="required:1;placeholder:Type a framework name;dirsource:frameworks">Framework</ui-component>
<br />
<ui-component name="inputtags" path="form.countries" config="innerlabel:true">Country</ui-component>
</div>
<script>
var frameworks = [{ id: 1, name: 'jComponent' }, { id: 2, name: 'Angular.js' }, { id: 3, name: 'React' }];
var form = { framework: [1], countries: ['Slovakia', 'Poland', 'Hungary', 'Germany'] };
</script>