kendo-ui-core
Version:
3 lines (2 loc) • 2.65 kB
JavaScript
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?module.exports=a(require("kendo.html.base.js"),require("kendo.icons.js")):"function"==typeof define&&define.amd?define(["kendo.html.base.min","kendo.icons.min"],a):((e="undefined"!=typeof globalThis?globalThis:e||self).kendohtml=e.kendohtml||{},e.kendohtml.chip=e.kendohtml.chip||{},e.kendohtml.chip.js=a())}(this,(function(){return function(e,a){var n=window.kendo,t=n.html.HTMLBase,s=t.extend({init:function(e,a){t.fn.init.call(this,e,a),this._wrapper()},options:{name:"HTMLChip",size:"medium",rounded:"medium",fillMode:"solid",themeColor:"base",attr:{},icon:"",iconClass:"",iconAttr:{},removable:!1,removableAttr:{},removeIcon:"x-circle",removeIconClass:"",content:"",text:"",actions:[],stylingOptions:["size","rounded","fillMode","themeColor"]},_wrapper:function(){var a=this,t=a.options;t.text=t.text||t.label,a.wrapper=a.element.wrap("<div class='k-chip'></div>").parent().attr(t.attr),a._addClasses(),t.icon?a.wrapper.prepend(e(n.ui.icon({icon:t.icon,size:"small",iconClass:"k-chip-icon"+(t.iconClass?` ${t.iconClass}`:"")})).attr(t.iconAttr)):t.iconClass?a.wrapper.prepend(e("<span class='"+t.iconClass+"'></span>").attr(t.iconAttr)):t.avatarClass&&a.wrapper.prepend(e("<span class='k-chip-avatar k-avatar k-avatar-md k-avatar-solid k-avatar-solid-primary k-rounded-full "+t.avatarClass+"'></span>").attr(t.iconAttr)),a.element.addClass("k-chip-content"),t.text&&a.element.html('<span class="k-chip-label">'+t.text+"</span>"),!1===t.visible&&a.wrapper.addClass("k-hidden"),!0===t.selected&&a.wrapper.addClass("k-selected"),!1===t.enabled&&a.wrapper.addClass("k-disabled"),(t.actions&&t.actions.length>0||t.removable)&&a._actions()},_actions:function(){var a=this,t=a.options;if(a.actionsWrapper=e("<span class='k-chip-actions'></span>"),a.actionsWrapper.appendTo(a.wrapper),t.actions&&t.actions.length>0)for(var s=0;s<t.actions.length;s++){var i=t.actions[s];a.actionsWrapper.append(e(`<span class='k-chip-action ${i.iconClass?i.iconClass:""}'>${n.ui.icon({icon:i.icon,size:"small"})}</span>`).attr(i.attr?i.attr:{}))}t.removable&&a.actionsWrapper.append(e(`<span class='k-chip-action k-chip-remove-action'>${n.ui.icon({icon:t.removeIcon,size:"small"})}</span>`).attr(t.removableAttr))}});e.extend(n.html,{renderChip:function(a,n){return a&&!e.isPlainObject(a)||(n=a,a=e("<span></span>")),new s(a,n).html()},HTMLChip:s}),n.cssProperties.registerPrefix("HTMLChip","k-chip-"),n.cssProperties.registerValues("HTMLChip",[{prop:"rounded",values:n.cssProperties.roundedValues.concat([["full","full"]])}])}(window.kendo.jQuery),kendo}));
//# sourceMappingURL=kendo.html.chip.min.js.map