Your IP : 216.73.216.43


Current Path : /home/rtorresani/www/vendor/magento/module-ui/view/base/web/js/grid/filters/
Upload File :
Current File : //home/rtorresani/www/vendor/magento/module-ui/view/base/web/js/grid/filters/chips.js

/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

/**
 * @api
 */
define([
    'underscore',
    'uiCollection'
], function (_, Collection) {
    'use strict';

    return Collection.extend({
        defaults: {
            template: 'ui/grid/filters/chips',
            componentType: 'filtersChips'
        },

        /**
         * Defines if some of components' children has available previews.
         *
         * @returns {Boolean}
         */
        hasPreviews: function () {
            return this.elems().some(function (elem) {
                return !!elem.previews.length;
            });
        },

        /**
         * Calls clear method on all of its' children.
         *
         * @returns {Chips} Chainable.
         */
        clear: function () {
            _.invoke(this.elems(), 'clear');

            return this;
        }
    });
});