UNPKG

primevue

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primevue.svg)](https://badge.fury.io/js/primevue)

2 lines (1 loc) 2.15 kB
this.primevue=this.primevue||{},this.primevue.chip=function(e){"use strict";var n={emits:["remove"],props:{label:{type:String,default:null},icon:{type:String,default:null},image:{type:String,default:null},removable:{type:Boolean,default:!1},removeIcon:{type:String,default:"pi pi-times-circle"}},data:()=>({visible:!0}),methods:{close(e){this.visible=!1,this.$emit("remove",e)}},computed:{containerClass(){return["p-chip p-component",{"p-chip-image":null!=this.image}]},iconClass(){return["p-chip-icon",this.icon]},removeIconClass(){return["pi-chip-remove-icon",this.removeIcon]}}};const i={key:2,class:"p-chip-text"};return function(e,n){void 0===n&&(n={});var i=n.insertAt;if(e&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],l=document.createElement("style");l.type="text/css","top"===i&&t.firstChild?t.insertBefore(l,t.firstChild):t.appendChild(l),l.styleSheet?l.styleSheet.cssText=e:l.appendChild(document.createTextNode(e))}}("\n.p-chip {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n}\n.p-chip-text {\n line-height: 1.5;\n}\n.p-chip-icon.pi {\n line-height: 1.5;\n}\n.pi-chip-remove-icon {\n line-height: 1.5;\n cursor: pointer;\n}\n.p-chip img {\n border-radius: 50%;\n}\n"),n.render=function(n,t,l,o,c,s){return c.visible?(e.openBlock(),e.createBlock("div",{key:0,class:s.containerClass},[e.renderSlot(n.$slots,"default",{},(()=>[l.image?(e.openBlock(),e.createBlock("img",{key:0,src:l.image},null,8,["src"])):l.icon?(e.openBlock(),e.createBlock("span",{key:1,class:s.iconClass},null,2)):e.createCommentVNode("",!0),l.label?(e.openBlock(),e.createBlock("div",i,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0),l.removable?(e.openBlock(),e.createBlock("span",{key:3,tabindex:"0",class:s.removeIconClass,onClick:t[1]||(t[1]=(...e)=>s.close&&s.close(...e)),onKeydown:t[2]||(t[2]=e.withKeys(((...e)=>s.close&&s.close(...e)),["enter"]))},null,34)):e.createCommentVNode("",!0)]))],2)):e.createCommentVNode("",!0)},n}(Vue);