UNPKG

@jecloud/ui

Version:

JECloud UI库,基于ant-design-vue封装

1 lines 1.6 kB
var e=this&&this.__assign||function(){return e=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},e.apply(this,arguments)};import{mergeProps as n,createVNode as t,Fragment as o}from"vue";import{defineComponent as l,ref as a}from"vue";import r from"../../input";import i from"../../modal";import u from"./icon-panel";import{useModelValue as s,useListeners as c}from"../../hooks";export default l({name:"JeIcon",components:{Input:r,IconPanel:u,Modal:i},props:{value:{type:String,default:""}},emits:["update:value","select"],setup:function(l,p){var f=p.slots,v=p.attrs,m=c({props:l,context:p}).fireListener,d=s({props:l,context:p,changeValid:!0}),h=a(!1),g=a(),y=function(){var e;h.value=!0,null===(e=g.value)||void 0===e||e.reset()},b=function(e){!1!==m("select",{value:e,visible:h})&&(d.value=e,h.value=!1)};return function(){return t(o,null,[t(r,n(v,{"allow-clear":!0,value:d.value,"onUpdate:value":function(e){return d.value=e},class:"je-input-icon"}),e(e({},f),{prefix:function(){return t("i",{class:["icon-value",d.value],style:{color:d.value}},null)},suffix:function(){return t("i",{class:"fal fa-icons icon-button",onClick:y},null)}})),t(i,{visible:h.value,"onUpdate:visible":function(e){return h.value=e},"show-header":!1,width:"1000","body-style":"padding:10px 0;"},{default:function(){return[t(u,{ref:g,copy:!1,help:!1,size:"small",onSelect:b},{action:function(){return t("i",{class:"fal fa-times action",style:"margin-right:10px;",onClick:function(){h.value=!1}},null)}})]}})])}}});