diff --git a/README.md b/README.md index 6637e8d..3dd8b90 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,8 @@ $input.change(function() { Options can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-source=""`. +If you are using jQuery in your application, note that camel case attributes such as `data-minLength` should be formatted as `data-min-length`. If you want more explanation, see [this issue](https://github.com/bassjobsen/Bootstrap-3-Typeahead/issues/28). + |Name|Type|Default|Description| |--- |--- |--- |--- | |source|array, function|`[]`|The data source to query against. May be an array of strings, an array of JSON object with a name property or a function. The function accepts two arguments, the query value in the input field and the process callback. The function may be used synchronously by returning the data source directly or asynchronously via the process callback's single argument.| diff --git a/bootstrap3-typeahead.js b/bootstrap3-typeahead.js index 57dba2b..ab1d7a2 100644 --- a/bootstrap3-typeahead.js +++ b/bootstrap3-typeahead.js @@ -22,714 +22,745 @@ (function (root, factory) { - 'use strict'; - - // CommonJS module is defined - if (typeof module !== 'undefined' && module.exports) { - module.exports = factory(require('jquery')); - } - // AMD module is defined - else if (typeof define === 'function' && define.amd) { - define(['jquery'], function ($) { - return factory($); - }); - } else { - factory(root.jQuery); - } - -}(this, function ($) { + 'use strict'; - 'use strict'; - // jshint laxcomma: true - - - /* TYPEAHEAD PUBLIC CLASS DEFINITION - * ================================= */ - - var Typeahead = function (element, options) { - this.$element = $(element); - this.options = $.extend({}, Typeahead.defaults, options); - this.matcher = this.options.matcher || this.matcher; - this.sorter = this.options.sorter || this.sorter; - this.select = this.options.select || this.select; - this.autoSelect = typeof this.options.autoSelect == 'boolean' ? this.options.autoSelect : true; - this.highlighter = this.options.highlighter || this.highlighter; - this.render = this.options.render || this.render; - this.updater = this.options.updater || this.updater; - this.displayText = this.options.displayText || this.displayText; - this.itemLink = this.options.itemLink || this.itemLink; - this.followLinkOnSelect = this.options.followLinkOnSelect || this.followLinkOnSelect; - this.source = this.options.source; - this.delay = this.options.delay; - this.$menu = $(this.options.menu); - this.$appendTo = this.options.appendTo ? $(this.options.appendTo) : null; - this.fitToElement = typeof this.options.fitToElement == 'boolean' ? this.options.fitToElement : false; - this.shown = false; - this.listen(); - this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' || this.options.showHintOnFocus === 'all' ? this.options.showHintOnFocus : false; - this.afterSelect = this.options.afterSelect; - this.afterEmptySelect = this.options.afterEmptySelect; - this.addItem = false; - this.value = this.$element.val() || this.$element.text(); - this.keyPressed = false; - this.focused = this.$element.is(':focus'); - this.changeInputOnSelect = this.options.changeInputOnSelect || this.changeInputOnSelect; - this.changeInputOnMove = this.options.changeInputOnMove || this.changeInputOnMove; - this.openLinkInNewTab = this.options.openLinkInNewTab || this.openLinkInNewTab; - this.selectOnBlur = this.options.selectOnBlur || this.selectOnBlur; - this.showCategoryHeader = this.options.showCategoryHeader || this.showCategoryHeader; - }; - - Typeahead.prototype = { - - constructor: Typeahead, - - - setDefault: function (val) { - // var val = this.$menu.find('.active').data('value'); - this.$element.data('active', val); - if (this.autoSelect || val) { - var newVal = this.updater(val); - // Updater can be set to any random functions via "options" parameter in constructor above. - // Add null check for cases when updater returns void or undefined. - if (!newVal) { - newVal = ''; - } - this.$element - .val(this.displayText(newVal) || newVal) - .text(this.displayText(newVal) || newVal) - .change(); - this.afterSelect(newVal); - } - return this.hide(); - }, - - select: function () { - var val = this.$menu.find('.active').data('value'); - - this.$element.data('active', val); - if (this.autoSelect || val) { - var newVal = this.updater(val); - // Updater can be set to any random functions via "options" parameter in constructor above. - // Add null check for cases when updater returns void or undefined. - if (!newVal) { - newVal = ''; - } + // CommonJS module is defined + if (typeof module !== 'undefined' && module.exports) { + module.exports = factory(require('jquery')); + } + // AMD module is defined + else if (typeof define === 'function' && define.amd) { + define(['jquery'], function ($) { + return factory($); + }); + } else { + factory(root.jQuery); + } - if (this.changeInputOnSelect) { - this.$element - .val(this.displayText(newVal) || newVal) - .text(this.displayText(newVal) || newVal) - .change(); - } +}(this, function ($) { - if (this.followLinkOnSelect && this.itemLink(val)) { - if (this.openLinkInNewTab) { - window.open(this.itemLink(val), '_blank'); - } else { - document.location = this.itemLink(val); - } - this.afterSelect(newVal); - } else if (this.followLinkOnSelect && !this.itemLink(val)) { - this.afterEmptySelect(newVal); - } else { - this.afterSelect(newVal); - } - } else { - this.afterEmptySelect(); - } - - return this.hide(); - }, - - updater: function (item) { - return item; - }, - - setSource: function (source) { - this.source = source; - }, - - show: function () { - var pos = $.extend({}, this.$element.position(), { - height: this.$element[0].offsetHeight - }); - - var scrollHeight = typeof this.options.scrollHeight == 'function' ? - this.options.scrollHeight.call() : - this.options.scrollHeight; - - var element; - if (this.shown) { - element = this.$menu; - } else if (this.$appendTo) { - element = this.$menu.appendTo(this.$appendTo); - this.hasSameParent = this.$appendTo.is(this.$element.parent()); - } else { - element = this.$menu.insertAfter(this.$element); - this.hasSameParent = true; - } - - if (!this.hasSameParent) { - // We cannot rely on the element position, need to position relative to the window - element.css('position', 'fixed'); - var offset = this.$element.offset(); - pos.top = offset.top; - pos.left = offset.left; - } - // The rules for bootstrap are: 'dropup' in the parent and 'dropdown-menu-right' in the element. - // Note that to get right alignment, you'll need to specify `menu` in the options to be: - // '' - var dropup = $(element).parent().hasClass('dropup'); - var newTop = dropup ? 'auto' : (pos.top + pos.height + scrollHeight); - var right = $(element).hasClass('dropdown-menu-right'); - var newLeft = right ? 'auto' : pos.left; - // it seems like setting the css is a bad idea (just let Bootstrap do it), but I'll keep the old - // logic in place except for the dropup/right-align cases. - element.css({ top: newTop, left: newLeft }).show(); - - if (this.options.fitToElement === true) { - element.css('width', this.$element.outerWidth() + 'px'); - } - - this.shown = true; - return this; - }, - - hide: function () { - this.$menu.hide(); - this.shown = false; - return this; - }, - - lookup: function (query) { - if (typeof(query) != 'undefined' && query !== null) { - this.query = query; - } else { - this.query = this.$element.val(); - } - - if (this.query.length < this.options.minLength && !this.options.showHintOnFocus) { - return this.shown ? this.hide() : this; - } - - var worker = $.proxy(function () { - - // Bloodhound (since 0.11) needs three arguments. - // Two of them are callback functions (sync and async) for local and remote data processing - // see https://github.com/twitter/typeahead.js/blob/master/src/bloodhound/bloodhound.js#L132 - if ($.isFunction(this.source) && this.source.length === 3) { - this.source(this.query, $.proxy(this.process, this), $.proxy(this.process, this)); - } else if ($.isFunction(this.source)) { - this.source(this.query, $.proxy(this.process, this)); - } else if (this.source) { - this.process(this.source); - } - }, this); - - clearTimeout(this.lookupWorker); - this.lookupWorker = setTimeout(worker, this.delay); - }, - - process: function (items) { - var that = this; - - items = $.grep(items, function (item) { - return that.matcher(item); - }); - - items = this.sorter(items); - - if (!items.length && !this.options.addItem) { - return this.shown ? this.hide() : this; - } - - if (items.length > 0) { - this.$element.data('active', items[0]); - } else { - this.$element.data('active', null); - } - - if (this.options.items != 'all') { - items = items.slice(0, this.options.items); - } - - // Add item - if (this.options.addItem) { - items.push(this.options.addItem); - } - - return this.render(items).show(); - }, - - matcher: function (item) { - var it = this.displayText(item); - return ~it.toLowerCase().indexOf(this.query.toLowerCase()); - }, - - sorter: function (items) { - var beginswith = []; - var caseSensitive = []; - var caseInsensitive = []; - var item; - - while ((item = items.shift())) { - var it = this.displayText(item); - if (!it.toLowerCase().indexOf(this.query.toLowerCase())) { - beginswith.push(item); - } else if (~it.indexOf(this.query)) { - caseSensitive.push(item); - } else { - caseInsensitive.push(item); - } - } - - return beginswith.concat(caseSensitive, caseInsensitive); - }, - - highlighter: function (item) { - var text = this.query; - if (text === '') { - return item; - } - var matches = item.match(/(>)([^<]*)(<)/g); - var first = []; - var second = []; - var i; - if (matches && matches.length) { - // html - for (i = 0; i < matches.length; ++i) { - if (matches[i].length > 2) {// escape '><' - first.push(matches[i]); - } - } - } else { - // text - first = []; - first.push(item); - } - text = text.replace((/[\(\)\/\.\*\+\?\[\]]/g), function (mat) { - return '\\' + mat; - }); - var reg = new RegExp(text, 'g'); - var m; - for (i = 0; i < first.length; ++i) { - m = first[i].match(reg); - if (m && m.length > 0) {// find all text nodes matches - second.push(first[i]); - } - } - for (i = 0; i < second.length; ++i) { - item = item.replace(second[i], second[i].replace(reg, '$&')); - } - return item; - }, - - render: function (items) { - var that = this; - var self = this; - var activeFound = false; - var data = []; - var _category = that.options.separator; - - $.each(items, function (key, value) { - // inject separator - if (key > 0 && value[_category] !== items[key - 1][_category]) { - data.push({ - __type: 'divider' - }); - } + 'use strict'; + // jshint laxcomma: true + + + /* TYPEAHEAD PUBLIC CLASS DEFINITION + * ================================= */ + + var Typeahead = function (element, options) { + this.$element = $(element); + this.options = $.extend({}, Typeahead.defaults, options); + this.matcher = this.options.matcher || this.matcher; + this.sorter = this.options.sorter || this.sorter; + this.select = this.options.select || this.select; + this.autoSelect = typeof this.options.autoSelect == 'boolean' ? this.options.autoSelect : true; + this.highlighter = this.options.highlighter || this.highlighter; + this.render = this.options.render || this.render; + this.updater = this.options.updater || this.updater; + this.displayText = this.options.displayText || this.displayText; + this.itemLink = this.options.itemLink || this.itemLink; + this.itemTitle = this.options.itemTitle || this.itemTitle; + this.followLinkOnSelect = this.options.followLinkOnSelect || this.followLinkOnSelect; + this.source = this.options.source; + this.delay = this.options.delay; + this.theme = this.options.theme && this.options.themes && this.options.themes[this.options.theme] || Typeahead.defaults.themes[Typeahead.defaults.theme]; + this.$menu = $(this.options.menu || this.theme.menu); + this.$appendTo = this.options.appendTo ? $(this.options.appendTo) : null; + this.fitToElement = typeof this.options.fitToElement == 'boolean' ? this.options.fitToElement : false; + this.shown = false; + this.listen(); + this.showHintOnFocus = typeof this.options.showHintOnFocus == 'boolean' || this.options.showHintOnFocus === 'all' ? this.options.showHintOnFocus : false; + this.afterSelect = this.options.afterSelect; + this.afterEmptySelect = this.options.afterEmptySelect; + this.addItem = false; + this.value = this.$element.val() || this.$element.text(); + this.keyPressed = false; + this.focused = this.$element.is(':focus'); + this.changeInputOnSelect = this.options.changeInputOnSelect || this.changeInputOnSelect; + this.changeInputOnMove = this.options.changeInputOnMove || this.changeInputOnMove; + this.openLinkInNewTab = this.options.openLinkInNewTab || this.openLinkInNewTab; + this.selectOnBlur = this.options.selectOnBlur || this.selectOnBlur; + this.showCategoryHeader = this.options.showCategoryHeader || this.showCategoryHeader; + }; + + Typeahead.prototype = { + + constructor: Typeahead, + + + setDefault: function (val) { + // var val = this.$menu.find('.active').data('value'); + this.$element.data('active', val); + if (this.autoSelect || val) { + var newVal = this.updater(val); + // Updater can be set to any random functions via "options" parameter in constructor above. + // Add null check for cases when updater returns void or undefined. + if (!newVal) { + newVal = ''; + } + this.$element + .val(this.displayText(newVal) || newVal) + .text(this.displayText(newVal) || newVal) + .change(); + this.afterSelect(newVal); + } + return this.hide(); + }, + + select: function () { + var val = this.$menu.find('.active').data('value'); + + this.$element.data('active', val); + if (this.autoSelect || val) { + var newVal = this.updater(val); + // Updater can be set to any random functions via "options" parameter in constructor above. + // Add null check for cases when updater returns void or undefined. + if (!newVal) { + newVal = ''; + } + + if (this.changeInputOnSelect) { + this.$element + .val(this.displayText(newVal) || newVal) + .text(this.displayText(newVal) || newVal) + .change(); + } + + if (this.followLinkOnSelect && this.itemLink(val)) { + if (this.openLinkInNewTab) { + window.open(this.itemLink(val), '_blank'); + } else { + document.location = this.itemLink(val); + } + this.afterSelect(newVal); + } else if (this.followLinkOnSelect && !this.itemLink(val)) { + this.afterEmptySelect(newVal); + } else { + this.afterSelect(newVal); + } + } else { + this.afterEmptySelect(); + } + + return this.hide(); + }, + + updater: function (item) { + return item; + }, + + setSource: function (source) { + this.source = source; + }, + + show: function () { + var pos = $.extend({}, this.$element.position(), { + height: this.$element[0].offsetHeight + }); - if (this.showCategoryHeader) { - // inject category header - if (value[_category] && (key === 0 || value[_category] !== items[key - 1][_category])) { - data.push({ - __type: 'category', - name: value[_category] + var scrollHeight = typeof this.options.scrollHeight == 'function' ? + this.options.scrollHeight.call() : + this.options.scrollHeight; + + var element; + if (this.shown) { + element = this.$menu; + } else if (this.$appendTo) { + element = this.$menu.appendTo(this.$appendTo); + this.hasSameParent = this.$appendTo.is(this.$element.parent()); + } else { + element = this.$menu.insertAfter(this.$element); + this.hasSameParent = true; + } + + if (!this.hasSameParent) { + // We cannot rely on the element position, need to position relative to the window + element.css('position', 'fixed'); + var offset = this.$element.offset(); + pos.top = offset.top; + pos.left = offset.left; + } + // The rules for bootstrap are: 'dropup' in the parent and 'dropdown-menu-right' in the element. + // Note that to get right alignment, you'll need to specify `menu` in the options to be: + // '' + var dropup = $(element).parent().hasClass('dropup'); + var newTop = dropup ? 'auto' : (pos.top + pos.height + scrollHeight); + var right = $(element).hasClass('dropdown-menu-right'); + var newLeft = right ? 'auto' : pos.left; + // it seems like setting the css is a bad idea (just let Bootstrap do it), but I'll keep the old + // logic in place except for the dropup/right-align cases. + element.css({ top: newTop, left: newLeft }).show(); + + if (this.options.fitToElement === true) { + element.css('width', this.$element.outerWidth() + 'px'); + } + + this.shown = true; + return this; + }, + + hide: function () { + this.$menu.hide(); + this.shown = false; + return this; + }, + + lookup: function (query) { + if (typeof(query) != 'undefined' && query !== null) { + this.query = query; + } else { + this.query = this.$element.val(); + } + + if (this.query.length < this.options.minLength && !this.options.showHintOnFocus) { + return this.shown ? this.hide() : this; + } + + var worker = $.proxy(function () { + + // Bloodhound (since 0.11) needs three arguments. + // Two of them are callback functions (sync and async) for local and remote data processing + // see https://github.com/twitter/typeahead.js/blob/master/src/bloodhound/bloodhound.js#L132 + if ($.isFunction(this.source) && this.source.length === 3) { + this.source(this.query, $.proxy(this.process, this), $.proxy(this.process, this)); + } else if ($.isFunction(this.source)) { + this.source(this.query, $.proxy(this.process, this)); + } else if (this.source) { + this.process(this.source); + } + }, this); + + clearTimeout(this.lookupWorker); + this.lookupWorker = setTimeout(worker, this.delay); + }, + + process: function (items) { + var that = this; + + items = $.grep(items, function (item) { + return that.matcher(item); }); - } - } - data.push(value); - }); + items = this.sorter(items); + + if (!items.length && !this.options.addItem) { + return this.shown ? this.hide() : this; + } + + if (items.length > 0) { + this.$element.data('active', items[0]); + } else { + this.$element.data('active', null); + } + + if (this.options.items != 'all') { + items = items.slice(0, this.options.items); + } + + // Add item + if (this.options.addItem) { + items.push(this.options.addItem); + } + + return this.render(items).show(); + }, + + matcher: function (item) { + var it = this.displayText(item); + return ~it.toLowerCase().indexOf(this.query.toLowerCase()); + }, + + sorter: function (items) { + var beginswith = []; + var caseSensitive = []; + var caseInsensitive = []; + var item; + + while ((item = items.shift())) { + var it = this.displayText(item); + if (!it.toLowerCase().indexOf(this.query.toLowerCase())) { + beginswith.push(item); + } else if (~it.indexOf(this.query)) { + caseSensitive.push(item); + } else { + caseInsensitive.push(item); + } + } + + return beginswith.concat(caseSensitive, caseInsensitive); + }, + + highlighter: function (item) { + var text = this.query; + if (text === '') { + return item; + } + var matches = item.match(/(>)([^<]*)(<)/g); + var first = []; + var second = []; + var i; + if (matches && matches.length) { + // html + for (i = 0; i < matches.length; ++i) { + if (matches[i].length > 2) {// escape '><' + first.push(matches[i]); + } + } + } else { + // text + first = []; + first.push(item); + } + text = text.replace((/[\(\)\/\.\*\+\?\[\]]/g), function (mat) { + return '\\' + mat; + }); + var reg = new RegExp(text, 'g'); + var m; + for (i = 0; i < first.length; ++i) { + m = first[i].match(reg); + if (m && m.length > 0) {// find all text nodes matches + second.push(first[i]); + } + } + for (i = 0; i < second.length; ++i) { + item = item.replace(second[i], second[i].replace(reg, '$&')); + } + return item; + }, + + render: function (items) { + var that = this; + var self = this; + var activeFound = false; + var data = []; + var _category = that.options.separator; + + $.each(items, function (key, value) { + // inject separator + if (key > 0 && value[_category] !== items[key - 1][_category]) { + data.push({ + __type: 'divider' + }); + } + + if (this.showCategoryHeader) { + // inject category header + if (value[_category] && (key === 0 || value[_category] !== items[key - 1][_category])) { + data.push({ + __type: 'category', + name: value[_category] + }); + } + } + + data.push(value); + }); - items = $(data).map(function (i, item) { - if ((item.__type || false) == 'category') { - return $(that.options.headerHtml).text(item.name)[0]; + items = $(data).map(function (i, item) { + if ((item.__type || false) == 'category'){ + return $(that.options.headerHtml || that.theme.headerHtml).text(item.name)[0]; + } + + if ((item.__type || false) == 'divider'){ + return $(that.options.headerDivider || that.theme.headerDivider)[0]; + } + + var text = self.displayText(item); + i = $(that.options.item || that.theme.item).data('value', item); + i.find(that.options.itemContentSelector || that.theme.itemContentSelector) + .addBack(that.options.itemContentSelector || that.theme.itemContentSelector) + .html(that.highlighter(text, item)); + if(that.options.followLinkOnSelect) { + i.find('a').attr('href', self.itemLink(item)); + } + i.find('a').attr('title', self.itemTitle(item)); + if (text == self.$element.val()) { + i.addClass('active'); + self.$element.data('active', item); + activeFound = true; + } + return i[0]; + }); + + if (this.autoSelect && !activeFound) { + items.filter(':not(.dropdown-header)').first().addClass('active'); + this.$element.data('active', items.first().data('value')); + } + this.$menu.html(items); + return this; + }, + + displayText: function (item) { + return typeof item !== 'undefined' && typeof item.name != 'undefined' ? item.name : item; + }, + + itemLink: function (item) { + return null; + }, + + itemTitle: function (item) { + return null; + }, + + next: function (event) { + var active = this.$menu.find('.active').removeClass('active'); + var next = active.next(); + + if (!next.length) { + next = $(this.$menu.find($(this.options.item || this.theme.item).prop('tagName'))[0]); + } + + while (next.hasClass('divider') || next.hasClass('dropdown-header')) { + next = next.next(); + } + + next.addClass('active'); + // added for screen reader + var newVal = this.updater(next.data('value')); + if (this.changeInputOnMove) { + this.$element.val(this.displayText(newVal) || newVal); + } + }, + + prev: function (event) { + var active = this.$menu.find('.active').removeClass('active'); + var prev = active.prev(); + + if (!prev.length) { + prev = this.$menu.find($(this.options.item || this.theme.item).prop('tagName')).last(); + } + + while (prev.hasClass('divider') || prev.hasClass('dropdown-header')) { + prev = prev.prev(); + } + + prev.addClass('active'); + // added for screen reader + var newVal = this.updater(prev.data('value')); + if (this.changeInputOnMove) { + this.$element.val(this.displayText(newVal) || newVal); + } + }, + + listen: function () { + this.$element + .on('focus.bootstrap3Typeahead', $.proxy(this.focus, this)) + .on('blur.bootstrap3Typeahead', $.proxy(this.blur, this)) + .on('keypress.bootstrap3Typeahead', $.proxy(this.keypress, this)) + .on('propertychange.bootstrap3Typeahead input.bootstrap3Typeahead', $.proxy(this.input, this)) + .on('keyup.bootstrap3Typeahead', $.proxy(this.keyup, this)); + + if (this.eventSupported('keydown')) { + this.$element.on('keydown.bootstrap3Typeahead', $.proxy(this.keydown, this)); + } + + var itemTagName = $(this.options.item || this.theme.item).prop('tagName'); + if ('ontouchstart' in document.documentElement) { + this.$menu + .on('touchstart', itemTagName, $.proxy(this.touchstart, this)) + .on('touchend', itemTagName, $.proxy(this.click, this)); + } else { + this.$menu + .on('click', $.proxy(this.click, this)) + .on('mouseenter', itemTagName, $.proxy(this.mouseenter, this)) + .on('mouseleave', itemTagName, $.proxy(this.mouseleave, this)) + .on('mousedown', $.proxy(this.mousedown, this)); + } + }, + + destroy: function () { + this.$element.data('typeahead', null); + this.$element.data('active', null); + this.$element + .unbind('focus.bootstrap3Typeahead') + .unbind('blur.bootstrap3Typeahead') + .unbind('keypress.bootstrap3Typeahead') + .unbind('propertychange.bootstrap3Typeahead input.bootstrap3Typeahead') + .unbind('keyup.bootstrap3Typeahead'); + + if (this.eventSupported('keydown')) { + this.$element.unbind('keydown.bootstrap3-typeahead'); + } + + this.$menu.remove(); + this.destroyed = true; + }, + + eventSupported: function (eventName) { + var isSupported = eventName in this.$element; + if (!isSupported) { + this.$element.setAttribute(eventName, 'return;'); + isSupported = typeof this.$element[eventName] === 'function'; + } + return isSupported; + }, + + move: function (e) { + if (!this.shown) { + return; + } + + switch (e.keyCode) { + case 9: // tab + case 13: // enter + case 27: // escape + e.preventDefault(); + break; + + case 38: // up arrow + // with the shiftKey (this is actually the left parenthesis) + if (e.shiftKey) { + return; + } + e.preventDefault(); + this.prev(); + break; + + case 40: // down arrow + // with the shiftKey (this is actually the right parenthesis) + if (e.shiftKey) { + return; + } + e.preventDefault(); + this.next(); + break; + } + }, + + keydown: function (e) { + /** + * Prevent to make an ajax call while copying and pasting. + * + * @author Simone Sacchi + * @version 2018/01/18 + */ + if (e.keyCode === 17) { // ctrl + return; + } + this.keyPressed = true; + this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40, 38, 9, 13, 27]); + if (!this.shown && e.keyCode == 40) { + this.lookup(); + } else { + this.move(e); + } + }, + + keypress: function (e) { + if (this.suppressKeyPressRepeat) { + return; + } + this.move(e); + }, + + input: function (e) { + // This is a fixed for IE10/11 that fires the input event when a placehoder is changed + // (https://connect.microsoft.com/IE/feedback/details/810538/ie-11-fires-input-event-on-focus) + var currentValue = this.$element.val() || this.$element.text(); + if (this.value !== currentValue) { + this.value = currentValue; + this.lookup(); + } + }, + + keyup: function (e) { + if (this.destroyed) { + return; + } + switch (e.keyCode) { + case 40: // down arrow + case 38: // up arrow + case 16: // shift + case 17: // ctrl + case 18: // alt + break; + + case 9: // tab + if (!this.shown || (this.showHintOnFocus && !this.keyPressed)) { + return; + } + this.select(); + break; + case 13: // enter + if (!this.shown) { + return; + } + this.select(); + break; + + case 27: // escape + if (!this.shown) { + return; + } + this.hide(); + break; + } + + }, + + focus: function (e) { + if (!this.focused) { + this.focused = true; + this.keyPressed = false; + if (this.options.showHintOnFocus && this.skipShowHintOnFocus !== true) { + if (this.options.showHintOnFocus === 'all') { + this.lookup(''); + } else { + this.lookup(); + } + } + } + if (this.skipShowHintOnFocus) { + this.skipShowHintOnFocus = false; + } + }, + + blur: function (e) { + if (!this.mousedover && !this.mouseddown && this.shown) { + if (this.selectOnBlur) { + this.select(); + } + this.hide(); + this.focused = false; + this.keyPressed = false; + } else if (this.mouseddown) { + // This is for IE that blurs the input when user clicks on scroll. + // We set the focus back on the input and prevent the lookup to occur again + this.skipShowHintOnFocus = true; + this.$element.focus(); + this.mouseddown = false; + } + }, + + click: function (e) { + e.preventDefault(); + this.skipShowHintOnFocus = true; + this.select(); + this.$element.focus(); + this.hide(); + }, + + mouseenter: function (e) { + this.mousedover = true; + this.$menu.find('.active').removeClass('active'); + $(e.currentTarget).addClass('active'); + }, + + mouseleave: function (e) { + this.mousedover = false; + if (!this.focused && this.shown) { + this.hide(); + } + }, + + /** + * We track the mousedown for IE. When clicking on the menu scrollbar, IE makes the input blur thus hiding the menu. + */ + mousedown: function (e) { + this.mouseddown = true; + this.$menu.one('mouseup', function (e) { + // IE won't fire this, but FF and Chrome will so we reset our flag for them here + this.mouseddown = false; + }.bind(this)); + }, + + touchstart: function (e) { + e.preventDefault(); + this.$menu.find('.active').removeClass('active'); + $(e.currentTarget).addClass('active'); + }, + + touchend: function (e) { + e.preventDefault(); + this.select(); + this.$element.focus(); } - if ((item.__type || false) == 'divider') { - return $(that.options.headerDivider)[0]; - } + }; - var text = self.displayText(item); - i = $(that.options.item).data('value', item); - i.find(that.options.itemContentSelector).addBack(that.options.itemContentSelector).html(that.highlighter(text, item)); - if (this.followLinkOnSelect) { - i.find('a').attr('href', self.itemLink(item)); - } - if (text == self.$element.val()) { - i.addClass('active'); - self.$element.data('active', item); - activeFound = true; - } - return i[0]; - }); - - if (this.autoSelect && !activeFound) { - items.filter(':not(.dropdown-header)').first().addClass('active'); - this.$element.data('active', items.first().data('value')); - } - this.$menu.html(items); - return this; - }, - - displayText: function (item) { - return typeof item !== 'undefined' && typeof item.name != 'undefined' ? item.name : item; - }, - - itemLink: function (item) { - return null; - }, - - next: function (event) { - var active = this.$menu.find('.active').removeClass('active'); - var next = active.next(); - - if (!next.length) { - next = $(this.$menu.find('li')[0]); - } - - while (next.hasClass('divider') || next.hasClass('dropdown-header')) { - next = next.next(); - } - - next.addClass('active'); - // added for screen reader - var newVal = this.updater(next.data('value')); - if (this.changeInputOnMove) { - this.$element.val(this.displayText(newVal) || newVal); - } - }, - - prev: function (event) { - var active = this.$menu.find('.active').removeClass('active'); - var prev = active.prev(); - - if (!prev.length) { - prev = this.$menu.find('li').last(); - } - - while (prev.hasClass('divider') || prev.hasClass('dropdown-header')) { - prev = prev.prev(); - } - - prev.addClass('active'); - // added for screen reader - var newVal = this.updater(prev.data('value')); - if (this.changeInputOnMove) { - this.$element.val(this.displayText(newVal) || newVal); - } - }, - - listen: function () { - this.$element - .on('focus.bootstrap3Typeahead', $.proxy(this.focus, this)) - .on('blur.bootstrap3Typeahead', $.proxy(this.blur, this)) - .on('keypress.bootstrap3Typeahead', $.proxy(this.keypress, this)) - .on('propertychange.bootstrap3Typeahead input.bootstrap3Typeahead', $.proxy(this.input, this)) - .on('keyup.bootstrap3Typeahead', $.proxy(this.keyup, this)); - - if (this.eventSupported('keydown')) { - this.$element.on('keydown.bootstrap3Typeahead', $.proxy(this.keydown, this)); - } - - if ('ontouchstart' in document.documentElement) { - this.$menu - .on('touchstart', 'li', $.proxy(this.touchstart, this)) - .on('touchend', 'li', $.proxy(this.click, this)); - } else { - this.$menu - .on('click', $.proxy(this.click, this)) - .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) - .on('mouseleave', 'li', $.proxy(this.mouseleave, this)) - .on('mousedown', $.proxy(this.mousedown, this)); - } - }, - - destroy: function () { - this.$element.data('typeahead', null); - this.$element.data('active', null); - this.$element - .unbind('focus.bootstrap3Typeahead') - .unbind('blur.bootstrap3Typeahead') - .unbind('keypress.bootstrap3Typeahead') - .unbind('propertychange.bootstrap3Typeahead input.bootstrap3Typeahead') - .unbind('keyup.bootstrap3Typeahead'); - - if (this.eventSupported('keydown')) { - this.$element.unbind('keydown.bootstrap3-typeahead'); - } - - this.$menu.remove(); - this.destroyed = true; - }, - - eventSupported: function (eventName) { - var isSupported = eventName in this.$element; - if (!isSupported) { - this.$element.setAttribute(eventName, 'return;'); - isSupported = typeof this.$element[eventName] === 'function'; - } - return isSupported; - }, - - move: function (e) { - if (!this.shown) { - return; - } - - switch (e.keyCode) { - case 9: // tab - case 13: // enter - case 27: // escape - e.preventDefault(); - break; - - case 38: // up arrow - // with the shiftKey (this is actually the left parenthesis) - if (e.shiftKey) { - return; - } - e.preventDefault(); - this.prev(); - break; - - case 40: // down arrow - // with the shiftKey (this is actually the right parenthesis) - if (e.shiftKey) { - return; - } - e.preventDefault(); - this.next(); - break; - } - }, - - keydown: function (e) { - this.keyPressed = true; - this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40, 38, 9, 13, 27]); - if (!this.shown && e.keyCode == 40) { - this.lookup(); - } else { - this.move(e); - } - }, - - keypress: function (e) { - if (this.suppressKeyPressRepeat) { - return; - } - this.move(e); - }, - - input: function (e) { - // This is a fixed for IE10/11 that fires the input event when a placehoder is changed - // (https://connect.microsoft.com/IE/feedback/details/810538/ie-11-fires-input-event-on-focus) - var currentValue = this.$element.val() || this.$element.text(); - if (this.value !== currentValue) { - this.value = currentValue; - this.lookup(); - } - }, - - keyup: function (e) { - if (this.destroyed) { - return; - } - switch (e.keyCode) { - case 40: // down arrow - case 38: // up arrow - case 16: // shift - case 17: // ctrl - case 18: // alt - break; - - case 9: // tab - if (!this.shown || (this.showHintOnFocus && !this.keyPressed)) { - return; - } - this.select(); - break; - case 13: // enter - if (!this.shown) { - return; - } - this.select(); - break; - case 27: // escape - if (!this.shown) { - return; - } - this.hide(); - break; - } + /* TYPEAHEAD PLUGIN DEFINITION + * =========================== */ - }, + var old = $.fn.typeahead; - focus: function (e) { - if (!this.focused) { - this.focused = true; - this.keyPressed = false; - if (this.options.showHintOnFocus && this.skipShowHintOnFocus !== true) { - if (this.options.showHintOnFocus === 'all') { - this.lookup(''); - } else { - this.lookup(); - } + $.fn.typeahead = function (option) { + var arg = arguments; + if (typeof option == 'string' && option == 'getActive') { + return this.data('active'); } - } - if (this.skipShowHintOnFocus) { - this.skipShowHintOnFocus = false; - } - }, - - blur: function (e) { - if (!this.mousedover && !this.mouseddown && this.shown) { - if (this.selectOnBlur) { - this.select(); + return this.each(function () { + var $this = $(this); + var data = $this.data('typeahead'); + var options = typeof option == 'object' && option; + if (!data) { + $this.data('typeahead', (data = new Typeahead(this, options))); + } + if (typeof option == 'string' && data[option]) { + if (arg.length > 1) { + data[option].apply(data, Array.prototype.slice.call(arg, 1)); + } else { + data[option](); + } + } + }); + }; + + Typeahead.defaults = { + source: [], + items: 8, + minLength: 1, + scrollHeight: 0, + autoSelect: true, + afterSelect: $.noop, + afterEmptySelect: $.noop, + addItem: false, + followLinkOnSelect: false, + delay: 0, + separator: 'category', + changeInputOnSelect: true, + changeInputOnMove: true, + openLinkInNewTab: false, + selectOnBlur: true, + showCategoryHeader: true, + theme: "bootstrap3", + themes: { + bootstrap3: { + menu: '', + item: '
  • ', + itemContentSelector: "a", + headerHtml: '', + headerDivider: '' + }, + bootstrap4: { + menu: '', + item: '', + itemContentSelector: '.dropdown-item', + headerHtml: '', + headerDivider: '' } - this.hide(); - this.focused = false; - this.keyPressed = false; - } else if (this.mouseddown) { - // This is for IE that blurs the input when user clicks on scroll. - // We set the focus back on the input and prevent the lookup to occur again - this.skipShowHintOnFocus = true; - this.$element.focus(); - this.mouseddown = false; - } - }, - - click: function (e) { - e.preventDefault(); - this.skipShowHintOnFocus = true; - this.select(); - this.$element.focus(); - this.hide(); - }, - - mouseenter: function (e) { - this.mousedover = true; - this.$menu.find('.active').removeClass('active'); - $(e.currentTarget).addClass('active'); - }, - - mouseleave: function (e) { - this.mousedover = false; - if (!this.focused && this.shown) { - this.hide(); - } - }, - - /** - * We track the mousedown for IE. When clicking on the menu scrollbar, IE makes the input blur thus hiding the menu. - */ - mousedown: function (e) { - this.mouseddown = true; - this.$menu.one('mouseup', function (e) { - // IE won't fire this, but FF and Chrome will so we reset our flag for them here - this.mouseddown = false; - }.bind(this)); - }, - - touchstart: function (e) { - e.preventDefault(); - this.$menu.find('.active').removeClass('active'); - $(e.currentTarget).addClass('active'); - }, - - touchend: function (e) { - e.preventDefault(); - this.select(); - this.$element.focus(); } +}; - }; + $.fn.typeahead.Constructor = Typeahead; + /* TYPEAHEAD NO CONFLICT + * =================== */ - /* TYPEAHEAD PLUGIN DEFINITION - * =========================== */ + $.fn.typeahead.noConflict = function () { + $.fn.typeahead = old; + return this; + }; - var old = $.fn.typeahead; - $.fn.typeahead = function (option) { - var arg = arguments; - if (typeof option == 'string' && option == 'getActive') { - return this.data('active'); - } - return this.each(function () { - var $this = $(this); - var data = $this.data('typeahead'); - var options = typeof option == 'object' && option; - if (!data) { - $this.data('typeahead', (data = new Typeahead(this, options))); - } - if (typeof option == 'string' && data[option]) { - if (arg.length > 1) { - data[option].apply(data, Array.prototype.slice.call(arg, 1)); - } else { - data[option](); + /* TYPEAHEAD DATA-API + * ================== */ + + $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { + var $this = $(this); + if ($this.data('typeahead')) { + return; } - } + $this.typeahead($this.data()); }); - }; - - Typeahead.defaults = { - source: [], - items: 8, - menu: '', - item: '
  • ', - itemContentSelector: 'a', - minLength: 1, - scrollHeight: 0, - autoSelect: true, - afterSelect: $.noop, - afterEmptySelect: $.noop, - addItem: false, - followLinkOnSelect: false, - delay: 0, - separator: 'category', - headerHtml: '', - headerDivider: '', - changeInputOnSelect: true, - changeInputOnMove: true, - openLinkInNewTab: false, - selectOnBlur: true, - showCategoryHeader: true - }; - - $.fn.typeahead.Constructor = Typeahead; - - /* TYPEAHEAD NO CONFLICT - * =================== */ - - $.fn.typeahead.noConflict = function () { - $.fn.typeahead = old; - return this; - }; - - - /* TYPEAHEAD DATA-API - * ================== */ - - $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { - var $this = $(this); - if ($this.data('typeahead')) { - return; - } - $this.typeahead($this.data()); - }); })); diff --git a/bootstrap3-typeahead.min.js b/bootstrap3-typeahead.min.js index 9018558..f184d08 100644 --- a/bootstrap3-typeahead.min.js +++ b/bootstrap3-typeahead.min.js @@ -1 +1 @@ -!function(a,b){"use strict";"undefined"!=typeof module&&module.exports?module.exports=b(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):b(a.jQuery)}(this,function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.defaults,d),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"!=typeof this.options.autoSelect||this.options.autoSelect,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.itemLink=this.options.itemLink||this.itemLink,this.followLinkOnSelect=this.options.followLinkOnSelect||this.followLinkOnSelect,this.source=this.options.source,this.delay=this.options.delay,this.$menu=a(this.options.menu),this.$appendTo=this.options.appendTo?a(this.options.appendTo):null,this.fitToElement="boolean"==typeof this.options.fitToElement&&this.options.fitToElement,this.shown=!1,this.listen(),this.showHintOnFocus=("boolean"==typeof this.options.showHintOnFocus||"all"===this.options.showHintOnFocus)&&this.options.showHintOnFocus,this.afterSelect=this.options.afterSelect,this.afterEmptySelect=this.options.afterEmptySelect,this.addItem=!1,this.value=this.$element.val()||this.$element.text(),this.keyPressed=!1,this.focused=this.$element.is(":focus"),this.changeInputOnSelect=this.options.changeInputOnSelect||this.changeInputOnSelect,this.changeInputOnMove=this.options.changeInputOnMove||this.changeInputOnMove,this.openLinkInNewTab=this.options.openLinkInNewTab||this.openLinkInNewTab,this.selectOnBlur=this.options.selectOnBlur||this.selectOnBlur,this.showCategoryHeader=this.options.showCategoryHeader||this.showCategoryHeader};b.prototype={constructor:b,setDefault:function(a){if(this.$element.data("active",a),this.autoSelect||a){var b=this.updater(a);b||(b=""),this.$element.val(this.displayText(b)||b).text(this.displayText(b)||b).change(),this.afterSelect(b)}return this.hide()},select:function(){var a=this.$menu.find(".active").data("value");if(this.$element.data("active",a),this.autoSelect||a){var b=this.updater(a);b||(b=""),this.changeInputOnSelect&&this.$element.val(this.displayText(b)||b).text(this.displayText(b)||b).change(),this.followLinkOnSelect&&this.itemLink(a)?(this.openLinkInNewTab?window.open(this.itemLink(a),"_blank"):document.location=this.itemLink(a),this.afterSelect(b)):this.followLinkOnSelect&&!this.itemLink(a)?this.afterEmptySelect(b):this.afterSelect(b)}else this.afterEmptySelect();return this.hide()},updater:function(a){return a},setSource:function(a){this.source=a},show:function(){var b,c=a.extend({},this.$element.position(),{height:this.$element[0].offsetHeight}),d="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight;if(this.shown?b=this.$menu:this.$appendTo?(b=this.$menu.appendTo(this.$appendTo),this.hasSameParent=this.$appendTo.is(this.$element.parent())):(b=this.$menu.insertAfter(this.$element),this.hasSameParent=!0),!this.hasSameParent){b.css("position","fixed");var e=this.$element.offset();c.top=e.top,c.left=e.left}var f=a(b).parent().hasClass("dropup"),g=f?"auto":c.top+c.height+d,h=a(b).hasClass("dropdown-menu-right"),i=h?"auto":c.left;return b.css({top:g,left:i}).show(),!0===this.options.fitToElement&&b.css("width",this.$element.outerWidth()+"px"),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){if(this.query=void 0!==b&&null!==b?b:this.$element.val(),this.query.length0?this.$element.data("active",b[0]):this.$element.data("active",null),"all"!=this.options.items&&(b=b.slice(0,this.options.items)),this.options.addItem&&b.push(this.options.addItem),this.render(b).show()):this.shown?this.hide():this},matcher:function(a){return~this.displayText(a).toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){for(var b,c=[],d=[],e=[];b=a.shift();){var f=this.displayText(b);f.toLowerCase().indexOf(this.query.toLowerCase())?~f.indexOf(this.query)?d.push(b):e.push(b):c.push(b)}return c.concat(d,e)},highlighter:function(a){var b=this.query;if(""===b)return a;var c,d=a.match(/(>)([^<]*)(<)/g),e=[],f=[];if(d&&d.length)for(c=0;c2&&e.push(d[c]);else e=[],e.push(a);b=b.replace(/[\(\)\/\.\*\+\?\[\]]/g,function(a){return"\\"+a});var g,h=new RegExp(b,"g");for(c=0;c0&&f.push(e[c]);for(c=0;c$&"));return a},render:function(b){var c=this,d=this,e=!1,f=[],g=c.options.separator;return a.each(b,function(a,c){a>0&&c[g]!==b[a-1][g]&&f.push({__type:"divider"}),this.showCategoryHeader&&(!c[g]||0!==a&&c[g]===b[a-1][g]||f.push({__type:"category",name:c[g]})),f.push(c)}),b=a(f).map(function(b,f){if("category"==(f.__type||!1))return a(c.options.headerHtml).text(f.name)[0];if("divider"==(f.__type||!1))return a(c.options.headerDivider)[0];var g=d.displayText(f);return b=a(c.options.item).data("value",f),b.find(c.options.itemContentSelector).addBack(c.options.itemContentSelector).html(c.highlighter(g,f)),this.followLinkOnSelect&&b.find("a").attr("href",d.itemLink(f)),g==d.$element.val()&&(b.addClass("active"),d.$element.data("active",f),e=!0),b[0]}),this.autoSelect&&!e&&(b.filter(":not(.dropdown-header)").first().addClass("active"),this.$element.data("active",b.first().data("value"))),this.$menu.html(b),this},displayText:function(a){return void 0!==a&&void 0!==a.name?a.name:a},itemLink:function(a){return null},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();for(d.length||(d=a(this.$menu.find("li")[0]));d.hasClass("divider")||d.hasClass("dropdown-header");)d=d.next();d.addClass("active");var e=this.updater(d.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(e)||e)},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();for(c.length||(c=this.$menu.find("li").last());c.hasClass("divider")||c.hasClass("dropdown-header");)c=c.prev();c.addClass("active");var d=this.updater(c.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(d)||d)},listen:function(){this.$element.on("focus.bootstrap3Typeahead",a.proxy(this.focus,this)).on("blur.bootstrap3Typeahead",a.proxy(this.blur,this)).on("keypress.bootstrap3Typeahead",a.proxy(this.keypress,this)).on("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead",a.proxy(this.input,this)).on("keyup.bootstrap3Typeahead",a.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown.bootstrap3Typeahead",a.proxy(this.keydown,this)),"ontouchstart"in document.documentElement?this.$menu.on("touchstart","li",a.proxy(this.touchstart,this)).on("touchend","li",a.proxy(this.click,this)):this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this)).on("mouseleave","li",a.proxy(this.mouseleave,this)).on("mousedown",a.proxy(this.mousedown,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.unbind("focus.bootstrap3Typeahead").unbind("blur.bootstrap3Typeahead").unbind("keypress.bootstrap3Typeahead").unbind("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead").unbind("keyup.bootstrap3Typeahead"),this.eventSupported("keydown")&&this.$element.unbind("keydown.bootstrap3-typeahead"),this.$menu.remove(),this.destroyed=!0},eventSupported:function(a){var b=a in this.$element;return b||(this.$element.setAttribute(a,"return;"),b="function"==typeof this.$element[a]),b},move:function(a){if(this.shown)switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:if(a.shiftKey)return;a.preventDefault(),this.prev();break;case 40:if(a.shiftKey)return;a.preventDefault(),this.next()}},keydown:function(b){this.keyPressed=!0,this.suppressKeyPressRepeat=~a.inArray(b.keyCode,[40,38,9,13,27]),this.shown||40!=b.keyCode?this.move(b):this.lookup()},keypress:function(a){this.suppressKeyPressRepeat||this.move(a)},input:function(a){var b=this.$element.val()||this.$element.text();this.value!==b&&(this.value=b,this.lookup())},keyup:function(a){if(!this.destroyed)switch(a.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:if(!this.shown||this.showHintOnFocus&&!this.keyPressed)return;this.select();break;case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide()}},focus:function(a){this.focused||(this.focused=!0,this.keyPressed=!1,this.options.showHintOnFocus&&!0!==this.skipShowHintOnFocus&&("all"===this.options.showHintOnFocus?this.lookup(""):this.lookup())),this.skipShowHintOnFocus&&(this.skipShowHintOnFocus=!1)},blur:function(a){this.mousedover||this.mouseddown||!this.shown?this.mouseddown&&(this.skipShowHintOnFocus=!0,this.$element.focus(),this.mouseddown=!1):(this.selectOnBlur&&this.select(),this.hide(),this.focused=!1,this.keyPressed=!1)},click:function(a){a.preventDefault(),this.skipShowHintOnFocus=!0,this.select(),this.$element.focus(),this.hide()},mouseenter:function(b){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},mouseleave:function(a){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},mousedown:function(a){this.mouseddown=!0,this.$menu.one("mouseup",function(a){this.mouseddown=!1}.bind(this))},touchstart:function(b){b.preventDefault(),this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")},touchend:function(a){a.preventDefault(),this.select(),this.$element.focus()}};var c=a.fn.typeahead;a.fn.typeahead=function(c){var d=arguments;return"string"==typeof c&&"getActive"==c?this.data("active"):this.each(function(){var e=a(this),f=e.data("typeahead"),g="object"==typeof c&&c;f||e.data("typeahead",f=new b(this,g)),"string"==typeof c&&f[c]&&(d.length>1?f[c].apply(f,Array.prototype.slice.call(d,1)):f[c]())})},b.defaults={source:[],items:8,menu:'',item:'
  • ',itemContentSelector:"a",minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:a.noop,afterEmptySelect:a.noop,addItem:!1,followLinkOnSelect:!1,delay:0,separator:"category",headerHtml:'',headerDivider:'',changeInputOnSelect:!0,changeInputOnMove:!0,openLinkInNewTab:!1,selectOnBlur:!0,showCategoryHeader:!0},a.fn.typeahead.Constructor=b,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);c.data("typeahead")||c.typeahead(c.data())})}); \ No newline at end of file +!function(t,e){"use strict";"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):e(t.jQuery)}(this,function(t){"use strict";var e=function(s,i){this.$element=t(s),this.options=t.extend({},e.defaults,i),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.select=this.options.select||this.select,this.autoSelect="boolean"!=typeof this.options.autoSelect||this.options.autoSelect,this.highlighter=this.options.highlighter||this.highlighter,this.render=this.options.render||this.render,this.updater=this.options.updater||this.updater,this.displayText=this.options.displayText||this.displayText,this.itemLink=this.options.itemLink||this.itemLink,this.itemTitle=this.options.itemTitle||this.itemTitle,this.followLinkOnSelect=this.options.followLinkOnSelect||this.followLinkOnSelect,this.source=this.options.source,this.delay=this.options.delay,this.theme=this.options.theme&&this.options.themes&&this.options.themes[this.options.theme]||e.defaults.themes[e.defaults.theme],this.$menu=t(this.options.menu||this.theme.menu),this.$appendTo=this.options.appendTo?t(this.options.appendTo):null,this.fitToElement="boolean"==typeof this.options.fitToElement&&this.options.fitToElement,this.shown=!1,this.listen(),this.showHintOnFocus=("boolean"==typeof this.options.showHintOnFocus||"all"===this.options.showHintOnFocus)&&this.options.showHintOnFocus,this.afterSelect=this.options.afterSelect,this.afterEmptySelect=this.options.afterEmptySelect,this.addItem=!1,this.value=this.$element.val()||this.$element.text(),this.keyPressed=!1,this.focused=this.$element.is(":focus"),this.changeInputOnSelect=this.options.changeInputOnSelect||this.changeInputOnSelect,this.changeInputOnMove=this.options.changeInputOnMove||this.changeInputOnMove,this.openLinkInNewTab=this.options.openLinkInNewTab||this.openLinkInNewTab,this.selectOnBlur=this.options.selectOnBlur||this.selectOnBlur,this.showCategoryHeader=this.options.showCategoryHeader||this.showCategoryHeader};e.prototype={constructor:e,setDefault:function(t){if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.afterSelect(e)}return this.hide()},select:function(){var t=this.$menu.find(".active").data("value");if(this.$element.data("active",t),this.autoSelect||t){var e=this.updater(t);e||(e=""),this.changeInputOnSelect&&this.$element.val(this.displayText(e)||e).text(this.displayText(e)||e).change(),this.followLinkOnSelect&&this.itemLink(t)?(this.openLinkInNewTab?window.open(this.itemLink(t),"_blank"):document.location=this.itemLink(t),this.afterSelect(e)):this.followLinkOnSelect&&!this.itemLink(t)?this.afterEmptySelect(e):this.afterSelect(e)}else this.afterEmptySelect();return this.hide()},updater:function(t){return t},setSource:function(t){this.source=t},show:function(){var e,s=t.extend({},this.$element.position(),{height:this.$element[0].offsetHeight}),i="function"==typeof this.options.scrollHeight?this.options.scrollHeight.call():this.options.scrollHeight;if(this.shown?e=this.$menu:this.$appendTo?(e=this.$menu.appendTo(this.$appendTo),this.hasSameParent=this.$appendTo.is(this.$element.parent())):(e=this.$menu.insertAfter(this.$element),this.hasSameParent=!0),!this.hasSameParent){e.css("position","fixed");var o=this.$element.offset();s.top=o.top,s.left=o.left}var n=t(e).parent().hasClass("dropup")?"auto":s.top+s.height+i,h=t(e).hasClass("dropdown-menu-right")?"auto":s.left;return e.css({top:n,left:h}).show(),!0===this.options.fitToElement&&e.css("width",this.$element.outerWidth()+"px"),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(e){if(this.query=null!=e?e:this.$element.val(),this.query.length0?this.$element.data("active",e[0]):this.$element.data("active",null),"all"!=this.options.items&&(e=e.slice(0,this.options.items)),this.options.addItem&&e.push(this.options.addItem),this.render(e).show()):this.shown?this.hide():this},matcher:function(t){return~this.displayText(t).toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(t){for(var e,s=[],i=[],o=[];e=t.shift();){var n=this.displayText(e);n.toLowerCase().indexOf(this.query.toLowerCase())?~n.indexOf(this.query)?i.push(e):o.push(e):s.push(e)}return s.concat(i,o)},highlighter:function(t){var e=this.query;if(""===e)return t;var s,i=t.match(/(>)([^<]*)(<)/g),o=[],n=[];if(i&&i.length)for(s=0;s2&&o.push(i[s]);else(o=[]).push(t);e=e.replace(/[\(\)\/\.\*\+\?\[\]]/g,function(t){return"\\"+t});var h,a=new RegExp(e,"g");for(s=0;s0&&n.push(o[s]);for(s=0;s$&"));return t},render:function(e){var s=this,i=this,o=!1,n=[],h=s.options.separator;return t.each(e,function(t,s){t>0&&s[h]!==e[t-1][h]&&n.push({__type:"divider"}),this.showCategoryHeader&&(!s[h]||0!==t&&s[h]===e[t-1][h]||n.push({__type:"category",name:s[h]})),n.push(s)}),e=t(n).map(function(e,n){if("category"==(n.__type||!1))return t(s.options.headerHtml||s.theme.headerHtml).text(n.name)[0];if("divider"==(n.__type||!1))return t(s.options.headerDivider||s.theme.headerDivider)[0];var h=i.displayText(n);return(e=t(s.options.item||s.theme.item).data("value",n)).find(s.options.itemContentSelector||s.theme.itemContentSelector).addBack(s.options.itemContentSelector||s.theme.itemContentSelector).html(s.highlighter(h,n)),s.options.followLinkOnSelect&&e.find("a").attr("href",i.itemLink(n)),e.find("a").attr("title",i.itemTitle(n)),h==i.$element.val()&&(e.addClass("active"),i.$element.data("active",n),o=!0),e[0]}),this.autoSelect&&!o&&(e.filter(":not(.dropdown-header)").first().addClass("active"),this.$element.data("active",e.first().data("value"))),this.$menu.html(e),this},displayText:function(t){return void 0!==t&&void 0!==t.name?t.name:t},itemLink:function(t){return null},itemTitle:function(t){return null},next:function(e){var s=this.$menu.find(".active").removeClass("active").next();for(s.length||(s=t(this.$menu.find(t(this.options.item||this.theme.item).prop("tagName"))[0]));s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.next();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},prev:function(e){var s=this.$menu.find(".active").removeClass("active").prev();for(s.length||(s=this.$menu.find(t(this.options.item||this.theme.item).prop("tagName")).last());s.hasClass("divider")||s.hasClass("dropdown-header");)s=s.prev();s.addClass("active");var i=this.updater(s.data("value"));this.changeInputOnMove&&this.$element.val(this.displayText(i)||i)},listen:function(){this.$element.on("focus.bootstrap3Typeahead",t.proxy(this.focus,this)).on("blur.bootstrap3Typeahead",t.proxy(this.blur,this)).on("keypress.bootstrap3Typeahead",t.proxy(this.keypress,this)).on("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead",t.proxy(this.input,this)).on("keyup.bootstrap3Typeahead",t.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown.bootstrap3Typeahead",t.proxy(this.keydown,this));var e=t(this.options.item||this.theme.item).prop("tagName");"ontouchstart"in document.documentElement?this.$menu.on("touchstart",e,t.proxy(this.touchstart,this)).on("touchend",e,t.proxy(this.click,this)):this.$menu.on("click",t.proxy(this.click,this)).on("mouseenter",e,t.proxy(this.mouseenter,this)).on("mouseleave",e,t.proxy(this.mouseleave,this)).on("mousedown",t.proxy(this.mousedown,this))},destroy:function(){this.$element.data("typeahead",null),this.$element.data("active",null),this.$element.unbind("focus.bootstrap3Typeahead").unbind("blur.bootstrap3Typeahead").unbind("keypress.bootstrap3Typeahead").unbind("propertychange.bootstrap3Typeahead input.bootstrap3Typeahead").unbind("keyup.bootstrap3Typeahead"),this.eventSupported("keydown")&&this.$element.unbind("keydown.bootstrap3-typeahead"),this.$menu.remove(),this.destroyed=!0},eventSupported:function(t){var e=t in this.$element;return e||(this.$element.setAttribute(t,"return;"),e="function"==typeof this.$element[t]),e},move:function(t){if(this.shown)switch(t.keyCode){case 9:case 13:case 27:t.preventDefault();break;case 38:if(t.shiftKey)return;t.preventDefault(),this.prev();break;case 40:if(t.shiftKey)return;t.preventDefault(),this.next()}},keydown:function(e){17!==e.keyCode&&(this.keyPressed=!0,this.suppressKeyPressRepeat=~t.inArray(e.keyCode,[40,38,9,13,27]),this.shown||40!=e.keyCode?this.move(e):this.lookup())},keypress:function(t){this.suppressKeyPressRepeat||this.move(t)},input:function(t){var e=this.$element.val()||this.$element.text();this.value!==e&&(this.value=e,this.lookup())},keyup:function(t){if(!this.destroyed)switch(t.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:if(!this.shown||this.showHintOnFocus&&!this.keyPressed)return;this.select();break;case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide()}},focus:function(t){this.focused||(this.focused=!0,this.keyPressed=!1,this.options.showHintOnFocus&&!0!==this.skipShowHintOnFocus&&("all"===this.options.showHintOnFocus?this.lookup(""):this.lookup())),this.skipShowHintOnFocus&&(this.skipShowHintOnFocus=!1)},blur:function(t){this.mousedover||this.mouseddown||!this.shown?this.mouseddown&&(this.skipShowHintOnFocus=!0,this.$element.focus(),this.mouseddown=!1):(this.selectOnBlur&&this.select(),this.hide(),this.focused=!1,this.keyPressed=!1)},click:function(t){t.preventDefault(),this.skipShowHintOnFocus=!0,this.select(),this.$element.focus(),this.hide()},mouseenter:function(e){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},mouseleave:function(t){this.mousedover=!1,!this.focused&&this.shown&&this.hide()},mousedown:function(t){this.mouseddown=!0,this.$menu.one("mouseup",function(t){this.mouseddown=!1}.bind(this))},touchstart:function(e){e.preventDefault(),this.$menu.find(".active").removeClass("active"),t(e.currentTarget).addClass("active")},touchend:function(t){t.preventDefault(),this.select(),this.$element.focus()}};var s=t.fn.typeahead;t.fn.typeahead=function(s){var i=arguments;return"string"==typeof s&&"getActive"==s?this.data("active"):this.each(function(){var o=t(this),n=o.data("typeahead"),h="object"==typeof s&&s;n||o.data("typeahead",n=new e(this,h)),"string"==typeof s&&n[s]&&(i.length>1?n[s].apply(n,Array.prototype.slice.call(i,1)):n[s]())})},e.defaults={source:[],items:8,minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:t.noop,afterEmptySelect:t.noop,addItem:!1,followLinkOnSelect:!1,delay:0,separator:"category",changeInputOnSelect:!0,changeInputOnMove:!0,openLinkInNewTab:!1,selectOnBlur:!0,showCategoryHeader:!0,theme:"bootstrap3",themes:{bootstrap3:{menu:'',item:'
  • ',itemContentSelector:"a",headerHtml:'',headerDivider:''},bootstrap4:{menu:'',item:'',itemContentSelector:".dropdown-item",headerHtml:'',headerDivider:''}}},t.fn.typeahead.Constructor=e,t.fn.typeahead.noConflict=function(){return t.fn.typeahead=s,this},t(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(e){var s=t(this);s.data("typeahead")||s.typeahead(s.data())})}); \ No newline at end of file diff --git a/package.json b/package.json index 0c0ec07..15eb1f6 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "homepage": "https://github.com/bassjobsen/Bootstrap-3-Typeahead/", "author": "Bass Jobsen", "scripts": { - "test": "grunt test" + "test": "grunt test", + "uglify": "uglifyjs ./bootstrap3-typeahead.js --output ./bootstrap3-typeahead.min.js --warn --compress drop_console=true" }, "repository": { "type": "git", @@ -32,5 +33,8 @@ }, "engines": { "node": "~0.10.1" + }, + "dependencies": { + "uglify-js": "^3.3.7" } } diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..21cdda0 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1033 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +ansi-regex@^0.2.0, ansi-regex@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + +ansi-styles@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +"argparse@~ 0.1.11": + version "0.1.16" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-0.1.16.tgz#cfd01e0fbba3d6caed049fbd758d40f65196f57c" + dependencies: + underscore "~1.7.0" + underscore.string "~2.4.0" + +array-differ@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-0.1.0.tgz#12e2c9b706bed47c8b483b57e487473fb0861f3a" + +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-union@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-0.1.0.tgz#ede98088330665e699e1ebf0227cbc6034e627db" + dependencies: + array-uniq "^0.1.0" + +array-uniq@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-0.1.1.tgz#5861f3ed4e4bb6175597a4e078e8aa78ebe958c7" + +async@~0.1.22: + version "0.1.22" + resolved "https://registry.yarnpkg.com/async/-/async-0.1.22.tgz#0fc1aaa088a0e3ef0ebe2d8831bab0dcf8845061" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browserify-zlib@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" + dependencies: + ansi-styles "^1.1.0" + escape-string-regexp "^1.0.0" + has-ansi "^0.1.0" + strip-ansi "^0.3.0" + supports-color "^0.2.0" + +chalk@^1.0.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +cli@0.6.x: + version "0.6.6" + resolved "https://registry.yarnpkg.com/cli/-/cli-0.6.6.tgz#02ad44a380abf27adac5e6f0cdd7b043d74c53e3" + dependencies: + exit "0.1.2" + glob "~ 3.2.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +coffee-script@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.3.3.tgz#150d6b4cb522894369efed6a2101c20bc7f4a4f4" + +colors@~0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + +commander@~2.13.0: + version "2.13.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" + +commander@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.3.0.tgz#fd430e889832ec353b9acd1de217c11cb3eef873" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@^1.4.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" + dependencies: + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +console-browserify@1.1.x: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" + dependencies: + date-now "^0.1.4" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +dateformat@1.0.2-1.2.3: + version "1.0.2-1.2.3" + resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.2-1.2.3.tgz#b0220c02de98617433b72851cf47de3df2cdbee9" + +decamelize@^1.0.0, decamelize@^1.1.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +dom-serializer@0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" + dependencies: + domelementtype "~1.1.1" + entities "~1.1.1" + +domelementtype@1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domhandler@2.3: + version "2.3.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.3.0.tgz#2de59a0822d5027fabff6f032c2b25a2a8abe738" + dependencies: + domelementtype "1" + +domutils@1.5: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" + +entities@1.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz#b2987aa3821347fcde642b24fdfc9e4fb712bf26" + +entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + +esprima-harmony-jscs@1.1.0-dev-harmony: + version "1.1.0-dev-harmony" + resolved "https://registry.yarnpkg.com/esprima-harmony-jscs/-/esprima-harmony-jscs-1.1.0-dev-harmony.tgz#10041935337145f09965c34acf65b09f9eee49e4" + +"esprima@~ 1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" + +esprima@~1.2.2: + version "1.2.5" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.2.5.tgz#0993502feaf668138325756f30f9a51feeec11e9" + +eventemitter2@~0.4.13: + version "0.4.14" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" + +exit@0.1.2, exit@0.1.x, exit@~0.1.1, exit@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +figures@^1.0.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" + dependencies: + escape-string-regexp "^1.0.5" + object-assign "^4.1.0" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +findup-sync@^0.1.2, findup-sync@~0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.1.3.tgz#7f3e7a97b82392c653bf06589bd85190e93c3683" + dependencies: + glob "~3.2.9" + lodash "~2.4.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + +getobject@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/getobject/-/getobject-0.1.0.tgz#047a449789fa160d018f5486ed91320b6ec7885c" + +glob@^7.0.5: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +"glob@~ 3.2.1", glob@~3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.2.11.tgz#4a973f635b9190f715d10987d5c00fd2815ebe3d" + dependencies: + inherits "2" + minimatch "0.3" + +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" + minimatch "~0.2.11" + +glob@~4.0.0: + version "4.0.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-4.0.6.tgz#695c50bdd4e2fb5c5d370b091f388d3707e291a7" + dependencies: + graceful-fs "^3.0.2" + inherits "2" + minimatch "^1.0.0" + once "^1.3.0" + +graceful-fs@^3.0.2: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + +graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +graceful-fs@~1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" + +grunt-contrib-jshint@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-jshint/-/grunt-contrib-jshint-0.10.0.tgz#57ebccca87e8f327af6645d8a3c586d4845e4d81" + dependencies: + hooker "~0.2.3" + jshint "~2.5.0" + +grunt-contrib-uglify@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/grunt-contrib-uglify/-/grunt-contrib-uglify-0.6.0.tgz#3a271d4dc4daba64691d0d0d08550ec54a7ec0ab" + dependencies: + chalk "^0.5.1" + lodash "^2.4.1" + maxmin "^1.0.0" + uglify-js "^2.4.0" + uri-path "0.0.2" + +grunt-jscs@~0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/grunt-jscs/-/grunt-jscs-0.8.1.tgz#156e0dc312bafaede978a367dd1897d7d9c21b2e" + dependencies: + hooker "~0.2.3" + jscs "~1.7.2" + lodash "~2.4.1" + vow "~0.4.1" + +grunt-legacy-log-utils@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/grunt-legacy-log-utils/-/grunt-legacy-log-utils-0.1.1.tgz#c0706b9dd9064e116f36f23fe4e6b048672c0f7e" + dependencies: + colors "~0.6.2" + lodash "~2.4.1" + underscore.string "~2.3.3" + +grunt-legacy-log@~0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/grunt-legacy-log/-/grunt-legacy-log-0.1.3.tgz#ec29426e803021af59029f87d2f9cd7335a05531" + dependencies: + colors "~0.6.2" + grunt-legacy-log-utils "~0.1.1" + hooker "~0.2.3" + lodash "~2.4.1" + underscore.string "~2.3.3" + +grunt-legacy-util@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/grunt-legacy-util/-/grunt-legacy-util-0.2.0.tgz#93324884dbf7e37a9ff7c026dff451d94a9e554b" + dependencies: + async "~0.1.22" + exit "~0.1.1" + getobject "~0.1.0" + hooker "~0.2.3" + lodash "~0.9.2" + underscore.string "~2.2.1" + which "~1.0.5" + +grunt@~0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/grunt/-/grunt-0.4.5.tgz#56937cd5194324adff6d207631832a9d6ba4e7f0" + dependencies: + async "~0.1.22" + coffee-script "~1.3.3" + colors "~0.6.2" + dateformat "1.0.2-1.2.3" + eventemitter2 "~0.4.13" + exit "~0.1.1" + findup-sync "~0.1.2" + getobject "~0.1.0" + glob "~3.1.21" + grunt-legacy-log "~0.1.0" + grunt-legacy-util "~0.2.0" + hooker "~0.2.3" + iconv-lite "~0.2.11" + js-yaml "~2.0.5" + lodash "~0.9.2" + minimatch "~0.2.12" + nopt "~1.0.10" + rimraf "~2.2.8" + underscore.string "~2.2.1" + which "~1.0.5" + +gzip-size@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-1.0.0.tgz#66cf8b101047227b95bace6ea1da0c177ed5c22f" + dependencies: + browserify-zlib "^0.1.4" + concat-stream "^1.4.1" + +has-ansi@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" + dependencies: + ansi-regex "^0.2.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +hooker@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959" + +hosted-git-info@^2.1.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c" + +htmlparser2@3.8.x: + version "3.8.3" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.8.3.tgz#996c28b191516a8be86501a7d79757e5c70c1068" + dependencies: + domelementtype "1" + domhandler "2.3" + domutils "1.5" + entities "1.0" + readable-stream "1.1" + +iconv-lite@~0.2.11: + version "0.2.11" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.2.11.tgz#1ce60a3a57864a292d1321ff4609ca4bb965adc8" + +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" + +inherits@2, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +js-yaml@~2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-2.0.5.tgz#a25ae6509999e97df278c6719da11bd0687743a8" + dependencies: + argparse "~ 0.1.11" + esprima "~ 1.0.2" + +jscs@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/jscs/-/jscs-1.7.3.tgz#26a40ca52e03085a69b6169cdd7294e2e7e1a1df" + dependencies: + colors "~0.6.2" + commander "~2.3.0" + esprima "~1.2.2" + esprima-harmony-jscs "1.1.0-dev-harmony" + exit "~0.1.2" + glob "~4.0.0" + minimatch "~1.0.0" + strip-json-comments "~1.0.1" + supports-color "~1.1.0" + vow "~0.4.3" + vow-fs "~0.3.1" + xmlbuilder "~2.4.0" + +jshint@~2.5.0: + version "2.5.11" + resolved "https://registry.yarnpkg.com/jshint/-/jshint-2.5.11.tgz#e2d95858bbb1aa78300108a2e81099fb095622e0" + dependencies: + cli "0.6.x" + console-browserify "1.1.x" + exit "0.1.x" + htmlparser2 "3.8.x" + minimatch "1.0.x" + shelljs "0.3.x" + strip-json-comments "1.0.x" + underscore "1.6.x" + +kind-of@^3.0.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + dependencies: + is-buffer "^1.1.5" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +load-grunt-tasks@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/load-grunt-tasks/-/load-grunt-tasks-0.6.0.tgz#043c04ad69ecc85e02a82258fdf25b7a79e0db6c" + dependencies: + findup-sync "^0.1.2" + multimatch "^0.3.0" + +load-json-file@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + +lodash-node@~2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/lodash-node/-/lodash-node-2.4.1.tgz#ea82f7b100c733d1a42af76801e506105e2a80ec" + +lodash@^2.4.1, lodash@~2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.4.2.tgz#fadd834b9683073da179b3eae6d9c0d15053f73e" + +lodash@~0.9.2: + version "0.9.2" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-0.9.2.tgz#8f3499c5245d346d682e5b0d3b40767e09f1a92c" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lru-cache@2: + version "2.7.3" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952" + +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + +maxmin@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/maxmin/-/maxmin-1.1.0.tgz#71365e84a99dd8f8b3f7d5fde2f00d1e7f73be61" + dependencies: + chalk "^1.0.0" + figures "^1.0.1" + gzip-size "^1.0.0" + pretty-bytes "^1.0.0" + +meow@^3.1.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + +minimatch@0.3, minimatch@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimatch@1.0.x, minimatch@^1.0.0, minimatch@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-1.0.0.tgz#e0dd2120b49e1b724ce8d714c520822a9438576d" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimatch@~0.2.11, minimatch@~0.2.12: + version "0.2.14" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" + dependencies: + lru-cache "2" + sigmund "~1.0.0" + +minimist@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +multimatch@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-0.3.0.tgz#603dbc3fe3281d338094a1e1b93a8b5f2be038da" + dependencies: + array-differ "^0.1.0" + array-union "^0.1.0" + minimatch "^0.3.0" + +natives@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.1.tgz#011acce1f7cbd87f7ba6b3093d6cd9392be1c574" + +nopt@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" + dependencies: + abbrev "1" + +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +object-assign@^4.0.1, object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pretty-bytes@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84" + dependencies: + get-stdin "^4.0.1" + meow "^3.1.0" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +readable-stream@1.1: + version "1.1.13" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.13.tgz#f6eef764f514c89e2b9e23146a75ba106756d23e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@^2.2.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@~2.2.8: + version "2.2.8" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.2.8.tgz#e439be2aaee327321952730f99a8929e4fc50582" + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + +"semver@2 || 3 || 4 || 5": + version "5.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" + +shelljs@0.3.x: + version "0.3.0" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.3.0.tgz#3596e6307a781544f591f37da618360f31db57b1" + +sigmund@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/sigmund/-/sigmund-1.0.1.tgz#3ff21f198cad2175f9f3b781853fd94d0d19b590" + +signal-exit@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + +source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" + dependencies: + spdx-license-ids "^1.0.2" + +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" + dependencies: + ansi-regex "^0.2.1" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + +strip-json-comments@1.0.x, strip-json-comments@~1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" + +supports-color@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +supports-color@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.1.0.tgz#fdc4b1a210121071505a2d1ef4d9f5d8fba7ef82" + +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +uglify-js@^2.4.0: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-js@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.3.7.tgz#28463e7c7451f89061d2b235e30925bf5625e14d" + dependencies: + commander "~2.13.0" + source-map "~0.6.1" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +underscore.string@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.2.1.tgz#d7c0fa2af5d5a1a67f4253daee98132e733f0f19" + +underscore.string@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.3.3.tgz#71c08bf6b428b1133f37e78fa3a21c82f7329b0d" + +underscore.string@~2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/underscore.string/-/underscore.string-2.4.0.tgz#8cdd8fbac4e2d2ea1e7e2e8097c42f442280f85b" + +underscore@1.6.x: + version "1.6.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" + +underscore@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.7.0.tgz#6bbaf0877500d36be34ecaa584e0db9fef035209" + +uri-path@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/uri-path/-/uri-path-0.0.2.tgz#803eb01f2feb17927dcce0f6187e72b75f53f554" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +uuid@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +vow-fs@~0.3.1: + version "0.3.6" + resolved "https://registry.yarnpkg.com/vow-fs/-/vow-fs-0.3.6.tgz#2d4c59be22e2bf2618ddf597ab4baa923be7200d" + dependencies: + glob "^7.0.5" + uuid "^2.0.2" + vow "^0.4.7" + vow-queue "^0.4.1" + +vow-queue@^0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/vow-queue/-/vow-queue-0.4.3.tgz#4ba8f64b56e9212c0dbe57f1405aeebd54cce78d" + dependencies: + vow "^0.4.17" + +vow@^0.4.17, vow@^0.4.7, vow@~0.4.1, vow@~0.4.3: + version "0.4.17" + resolved "https://registry.yarnpkg.com/vow/-/vow-0.4.17.tgz#b16e08fae58c52f3ebc6875f2441b26a92682904" + +which@~1.0.5: + version "1.0.9" + resolved "https://registry.yarnpkg.com/which/-/which-1.0.9.tgz#460c1da0f810103d0321a9b633af9e575e64486f" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xmlbuilder@~2.4.0: + version "2.4.6" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.4.6.tgz#42c664f1358864e5beb1461b4346aec87b63450f" + dependencies: + lodash-node "~2.4.1" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0"