import{p as e}from"./nc-util.BWncs0l6.js";import{t}from"./_plugin-vue_export-helper.dOX-z6IG.js";import{Fragment as n,createElementBlock as r,createElementVNode as i,createTextVNode as a,inject as o,normalizeClass as s,onMounted as c,openBlock as l,ref as u,renderList as d,renderSlot as f,toDisplayString as p}from"/vue.js";var m={name:`NcLink`,props:{model:{type:Array,default:void 0,required:!0},callback:{type:Function,default:void 0,required:!0}},setup(t){let n=o(`state`);if(!t.model){console.error(`link component, model does not exist`,this);return}if(!e.isFunction(t.callback)){console.warn(`link component, callback does not exist or is not a function`,this);return}let r=[];if(r.length!==0)return c(function(){for(let i=0,a=t.model.length;i<a;i++){let a=t.model[i],o={};o.value=a,a.icon&&(o.icon=a.icon);let s=n.hdr[a.field]||`wrong field name: `+a.field,c=a.field.search(`_`);if(c>=0){let e=n.hdr[a.field.substr(0,c)];e&&(s=e+`, `+s.toLowerCase())}e.isNil(a.show)?o.show=s+`: `+a.value:a.show===``?o.show=s:o.show=s+`: `+a.show,r.push(o)}}),{dropdownArr:u(r)}}},h={class:`ui dropdown`},g={class:`menu`},_=[`onClick`];function v(e,t,o,c,u,m){return l(),r(`div`,h,[t[0]||(t[0]=i(`i`,{class:`nc-no-print nc-link-icon far fa-arrow-alt-circle-right`},null,-1)),i(`div`,g,[(l(!0),r(n,null,d(c.dropdownArr,e=>(l(),r(`div`,{key:e.value,class:`item`,onClick:t=>o.callback(e.value)},[i(`i`,{class:s(e.icon)},null,2),a(` `+p(e.show),1)],8,_))),128))]),f(e.$slots,`default`)])}var y=t(m,[[`render`,v]]);export{y as default};