@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
73 lines (60 loc) • 2.21 kB
JavaScript
Object.defineProperty(exports, '__esModule', { value: true });
require('./kendo.html.base.js');
require('./kendo.core.js');
const __meta__ = {
id: "html.chiplist",
name: "Html.ChipList",
category: "web",
description: "HTML rendering utility for Kendo UI for jQuery.",
depends: ["html.base"],
features: []
};
(function($, undefined$1) {
var kendo = window.kendo,
HTMLBase = kendo.html.HTMLBase;
var renderChipList = function(element, options) {
if (arguments[0] === undefined$1 || $.isPlainObject(arguments[0])) {
options = element;
element = $("<div></div>");
}
return (new HTMLChipList(element, options)).html();
};
var HTMLChipList = HTMLBase.extend({
init: function(element, options) {
var that = this;
HTMLBase.fn.init.call(that, element, options);
that.wrapper = that.element.addClass("k-chip-list");
that._applyAriaAttributes(options);
that._addClasses();
},
options: {
name: "HTMLChipList",
size: "medium",
stylingOptions: ["size"]
},
_applyAriaAttributes: function(options) {
var that = this;
options = $.extend({ selectable: "none" }, options);
var ariaLabelOption = (options.attributes || {})["aria-label"];
if (options.selectable !== "none") {
that.element.attr({
"aria-multiselectable": options.selectable === "multiple",
role: "listbox",
"aria-label": ariaLabelOption || that.element.attr("id") + " listbox",
"aria-orientation": "horizontal"
});
} else {
that.element.removeAttr("role aria-label aria-multiselectable aria-orientation");
}
}
});
$.extend(kendo.html, {
renderChipList: renderChipList,
HTMLChipList: HTMLChipList
});
kendo.cssProperties.registerPrefix("HTMLChipList", "k-chip-list-");
})(window.kendo.jQuery);
var kendo$1 = kendo;
exports.__meta__ = __meta__;
exports.default = kendo$1;
;