UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

57 lines (56 loc) 1.75 kB
//#region ../src/kendo.html.chiplist.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) { var kendo = window.kendo, HTMLBase = kendo.html.HTMLBase; var renderChipList = function(element, options) { if (arguments[0] === undefined || $.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: undefined, 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, HTMLChipList }); kendo.cssProperties.registerPrefix("HTMLChipList", "k-chip-list-"); })(window.kendo.jQuery); var kendo_html_chiplist_default = kendo; //#endregion export { kendo_html_chiplist_default as n, __meta__ as t };