@opentiny/vue-search-box 2.27.0 → 3.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("@opentiny/vue-common"),Oe=require("@opentiny/vue-tag"),_e=require("@opentiny/vue-input"),Fe=require("@opentiny/vue-dropdown"),Ae=require("@opentiny/vue-dropdown-menu"),ye=require("@opentiny/vue-button"),Be=require("@opentiny/vue-tooltip"),xe=require("@opentiny/vue-date-picker"),ze=require("@opentiny/vue-form"),we=require("@opentiny/vue-form-item"),je=require("@opentiny/vue-popover"),qe=require("@opentiny/vue-select"),He=require("@opentiny/vue-option"),se=require("@opentiny/vue-icon"),Ie=require("@opentiny/vue-dropdown-item"),Ge=require("@opentiny/vue-checkbox"),Ue=require("@opentiny/vue-checkbox-group"),Ke=require("@opentiny/vue-loading"),Ze=(a,e,t,s="0")=>{if(typeof a=="string"&&typeof s=="string"&&ke(e)){let n=a.length-e;if(n>0)return t?a.substr(0,e):a.substr(n,e);{const r=[];for(n=Math.abs(n)/s.length;n>0;n--)r.push(s);const p=r.join("");return t?a+p:p+a}}},Ye=Object.prototype.toString,We=Object.prototype.hasOwnProperty,Qe=We.toString;Qe.call(Object);const Xe={"[object Error]":"error","[object Object]":"object","[object RegExp]":"regExp","[object Date]":"date","[object Array]":"array","[object Function]":"function","[object AsyncFunction]":"asyncFunction","[object String]":"string","[object Number]":"number","[object Boolean]":"boolean"},Je=a=>a==null,et=a=>Je(a)?String(a):Xe[Ye.call(a)]||"object",ke=a=>typeof a=="number"&&isFinite(a),tt=a=>et(a)==="date",Ce=[31,28,31,30,31,30,31,31,30,31,30,31],at=new RegExp("^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),nt=new RegExp("^(((0)?[1-9])|(1[0-2]))(/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1]))?(/|-)?(\\d{4})( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),st=new RegExp("^(\\d{4})-(((0)?[1-9])|(1[0-2]))-(((0)?[1-9])|([1-2][0-9])|(3[0-1]))T(((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?(Z|([+-])((0)?[0-9]|1[0-9]|20|21|22|23):?([0-5]?[0-9]))$"),rt={"y{1,4}":/y{1,4}/,"M{1,2}":/M{1,2}/,"d{1,2}":/d{1,2}/,"h{1,2}":/h{1,2}/,"H{1,2}":/H{1,2}/,"m{1,2}":/m{1,2}/,"s{1,2}":/s{1,2}/,"S{1,3}":/S{1,3}/,"Z{1,1}":/Z{1,1}/},j={YEAR:9999,MONTH:11,DATE:31,HOUR:23,MINUTE:59,SECOND:59,MILLISECOND:999},ot="-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00",lt="-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00",it="+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00",ct=[].concat(ot.split(","),lt.split(","),it.split(",")),pt=a=>{const e=0-a.getTimezoneOffset()/60;let t;return e===0?t="Z":e>0?t="+"+(e>10?e:"0"+e)+"00":t=(e<-10?e:"-0"+-e)+"00",t},Te=a=>a%400===0||a%4===0&&a%100!==0,Ve=a=>a>j.MILLISECOND?Number(String(a).substring(0,3)):a,pe=({year:a,month:e,date:t,hours:s,minutes:n,seconds:r,milliseconds:p})=>{let c=Ce[e];if(Te(a)&&e===1&&(c+=1),t<=c)return new Date(a,e,t,s,n,r,Ve(p))},ut=a=>{if(a.length===23){const e=Number(a[1]),t=a[3]-1,s=Number(a[9]||1),n=a[15]||0,r=a[17]||0,p=a[20]||0,c=a[22]||0;return pe({date:s,year:e,hours:n,month:t,seconds:p,minutes:r,milliseconds:c})}},dt=a=>{if(a.length===22){const e=Number(a[12]),t=a[1]-1,s=Number(a[6]||1),n=a[14]||0,r=a[16]||0,p=a[19]||0,c=a[21]||0;return pe({year:e,month:t,date:s,hours:n,minutes:r,seconds:p,milliseconds:c})}},mt=a=>{if(a.length!==25)return;const e=Number(a[1]),t=a[2]-1,s=Number(a[6]),n=new Date(e,t,s).getTimezoneOffset(),r=a[12]||0,p=a[14]||0,c=a[17]||0,i=a[19]||0;let m=a[20];const u=a[21],o=a[22]||0,l=a[24]||0;let h=Ce[t],d,v;if(Te(e)&&t===1&&(h+=1),s<=h){if(m==="Z")d=r-n/60,v=p;else{if(m.includes(":")||(m=m.substr(0,3)+":"+m.substr(3)),!ct.includes(m))return;d=u==="+"?r-o-n/60:Number(r)+Number(o)-n/60,v=u==="+"?p-l:Number(p)+Number(l)}return new Date(e,t,s,d,v,c,Ve(i))}},re=[[at,ut],[nt,dt],[st,mt]],ht=a=>{for(let e=0,t=re.length;e<t;e++){const s=re[e][0].exec(a);if(s&&s.length>0)return re[e][1](s)}},ft=(a,e,t)=>{if(t)switch(t){case"yyyy":case"yy":a[0]=e;break;case"M":case"MM":a[1]=e-1;break;case"d":case"dd":a[2]=e;break;case"h":case"hh":a[3]=e;break;case"m":case"mm":a[4]=e;break;case"s":case"ss":a[5]=e;break;case"S":case"SS":case"SSS":a[6]=e;break}},vt=(a,e)=>{const t=[0,-1,0,0,0,0];if(a.length!==e.length)return t;let s=0,n=0;for(let r=0,p=a.length;r<p;r++){const c=a.substr(r,1),i=isNaN(Number(c))||c.trim()==="";if(i&&c===e.substr(r,1)||r===p-1){let m,u;if(i){m=a.substring(s,r),s=r+1;const o=e.indexOf(c,n);u=e.substring(n,o===-1?e.length:o),n=o+1}else m=a.substring(s,p),u=e.substring(n,p);(m.length===u.length||m)&&ft(t,m,u)}}return t},K=(a,e,t)=>isNaN(a)||a<e||a>t,bt=({year:a,month:e,date:t,hours:s,minutes:n,seconds:r,milliseconds:p})=>K(a,0,j.YEAR)||K(e,0,j.MONTH)||K(t,0,j.DATE)||K(s,0,j.HOUR)||K(n,0,j.MINUTE)||K(r,0,j.SECOND)||K(p,0,j.MILLISECOND),gt=(a,e)=>{if(typeof e=="string"){const t=vt(a,e),s=Number(t[0]),n=Number(t[1]),r=Number(t[2]||1),p=Number(t[3]||0),c=Number(t[4]||0),i=Number(t[5]||0),m=Number(t[6]||0);return bt({year:s,month:n,date:r,hours:p,minutes:c,seconds:i,milliseconds:m})?void 0:pe({year:s,date:r,month:n,minutes:c,hours:p,milliseconds:m,seconds:i})}else return ht(a)},Se=(a,e,t)=>{let s;if(ke(a)?s=new Date(a):typeof a=="string"&&(s=gt(a,e)),t){const n=t&&Se(t)||new Date(1,1,1,0,0,0);return s&&s<n?n:s}return s},le=function(a,e="yyyy/MM/dd hh:mm:ss"){if(tt(a)){if(typeof e=="string"){const t={"y{1,4}":a.getFullYear(),"M{1,2}":a.getMonth()+1,"d{1,2}":a.getDate(),"h{1,2}":a.getHours(),"H{1,2}":a.getHours(),"m{1,2}":a.getMinutes(),"s{1,2}":a.getSeconds(),"S{1,3}":a.getMilliseconds(),"Z{1,1}":pt(a)};return Object.keys(t).forEach(s=>{const n=e.match(rt[s]);s&&n&&n.length&&(e=e.replace(n[0],s==="Z{1,1}"?t[s]:Ze(t[s].toString(),n[0].length)))}),e}}else if(typeof a=="string"&&arguments.length>=2){let t=e;arguments.length===2?e=void 0:t=arguments[2];const s=Se(a,e);return s?le(s,t):""}},C=(a,e=!0)=>{e?a.visibleTimer=setTimeout(()=>{a.visible=!0},0):(clearTimeout(a.visibleTimer),a.visibleTimer=null,a.visible=!1)},X=(a,e=!0)=>{if(!a.instance)return;a.popoverVisible=e;const{dropdownRef:t}=a.instance;e&&t.state.visible&&(clearTimeout(Number(t.state.timeout)),t.state.timeout=null,t.state.visible=!1)},_t=(a,e=200)=>{let t=null;const s=function(...n){t&&clearTimeout(t),t=setTimeout(()=>{a.apply(this,n),t=null},e)};return s.cancel=()=>{t&&(clearTimeout(t),t=null)},s},B=a=>parseFloat(a).toString()!=="NaN",q=a=>{const e=Array.isArray(a)?[]:{};if(a&&typeof a=="object"){const t=Object.keys(a);if(t.length)t.forEach(s=>{a[s]&&typeof a[s]=="object"?e[s]=q(a[s]):e[s]=a[s]});else return a}return e},J=(a,e=["mergeTag","options","idMapKey"])=>{const t={...a};return e.forEach(s=>{delete t[s]}),t},O=(a,e,t="")=>{const{valueMap:s,prevItem:n}=a,r=(n.label||t)+e;return s.has(r)},ee=a=>{a.propItem={},a.inputValue=""},P=({emit:a,state:e,nextTick:t,...s})=>{X(e,!1);const{tagList:n=null,index:r=-1,newTag:p=null,newValue:c=null,oldValue:i=null,isEdit:m}=s;if(m||ee(e),!n&&r===-1&&!c)return;const u=i||q(e.innerModelValue);let o=[];c?o=[...c]:r!==-1?(o=[...e.innerModelValue],p?o.splice(r,1,p):o.splice(r,1)):o=[...e.innerModelValue,...n],e.innerModelValue=o,a("update:modelValue",q(o)),a("change",q(o),u)},H=a=>a,G=(a,e,t)=>{const s=e.idMapKey||a.idMapKey;return t&&t[s]!==void 0?{[s]:t[s]}:null};function yt({props:a,state:e,emit:t,nextTick:s}){let n=q(e.inputValue);const r=m=>{if(m){const u=e.recordItems.find(o=>o.label===m.label);if(u&&u.options){const o=u.options.find(l=>l.label===m.value);o&&(o.isChecked=!1)}}};return{deleteTag:m=>{C(e,!1),r(m);const u=a.modelValue.filter(o=>o!==m);P({emit:t,state:e,nextTick:s,newValue:u})},clearTag:()=>{C(e,!1),a.modelValue.forEach(m=>r(m)),e.propItem={},e.inputValue="",P({emit:t,state:e,nextTick:s,newValue:[]}),t("clear")},backspaceDeleteTag:()=>{var m,u,o;if(!e.inputValue){if(e.propItem.label){e.propItem={};return}if(n===""&&e.inputValue===""){C(e,!1);const l=a.modelValue.length-1;r(a.modelValue[l]);const h=e.innerModelValue.slice(0,a.modelValue.length-1);P({emit:t,state:e,nextTick:s,newValue:h})}n=e.inputValue,(o=(u=(m=e==null?void 0:e.instance)==null?void 0:m.refs)==null?void 0:u.inputRef)!=null&&o.$el&&e.instance.refs.inputRef.$el.click()}}}}const xt=async(a,e,t)=>{const{prevItem:s,inputEditValue:n}=e,{operators:r}=s,p=J(s);let c=null,i=!0;if(await a.$refs.formRef.validateField(["inputEditValue"],m=>{m&&(i=!1)}),i){let m=null;const u=e.operatorValue&&r?{operator:e.operatorValue}:null;let o=n;const l={};if(Array.isArray(n))l.options=[],o="",n.forEach(h=>{const d=e.currentEditValue.find(f=>f.label===h),v=(d==null?void 0:d.label)||h;if(o=o?`${o} | ${v}`:v,d){const f=G(t,s,d);l.options.push({label:v,...f})}else l.options.push({label:v})});else if(Array.isArray(e.currentEditValue)){const h=e.currentEditValue.find(d=>d.label===o);m=G(t,s,h)}c=H({...p,label:e.selectValue,...u,value:o,...m,...l})}return c},De=async(a,e,t)=>{const{prevItem:s}=e,n=`min${s.field}`,r=`max${s.field}`,p=e[n],c=e[r],i=[n,r];let m=!0,u=null;if(await a.$refs.formRef.validateField(i,o=>{o&&(m=!1)}),m){const{field:o,label:l,unit:h,type:d,operators:v}=s,f=h?`${l}(${h})`:l;let b="";p&&c?b=`${p}-${c}`:b=p?`≥${p}`:`≤${c}`;const w=G(t,s,s),k=e.operatorValue&&v?{operator:e.operatorValue}:null;u=H({type:d,field:o,label:f,value:b,...w,start:p,end:c,...k})}return u},ie=async(a,e,t,s)=>{const{prevItem:n,startDate:r,endDate:p,startDateTime:c,endDateTime:i}=e;let m=null,u=null,o=!0,l=null,h=null;if(s?(m=c,u=i,h=["startDateTime","endDateTime"]):(m=r,u=p,h=["startDate","endDate"]),await a.$refs.formRef.validateField(h,d=>{d&&(o=!1)}),o){const{operators:d}=n,v=J(n);let f="";if(m&&u){if(m>u)return;m===u?f=m:f=`${m}-${u}`}else f=m?`≥${m}`:`≤${u}`;const b=G(t,n,n),w=e.operatorValue&&d?{operator:e.operatorValue}:null;l=H({...v,value:f,start:m,end:u,...b,...w})}return l},Me=(a,e,t)=>{const{prevItem:s}=a,{field:n,start:r,end:p,min:c=s.min,max:i=s.max}=e,m=`min${n}`,u=`max${n}`;(a.curMinNumVar!==m||a.curMaxNumVar!==u)&&(delete a[a.curMinNumVar],delete a[a.curMaxNumVar],delete a.formRules[a.curMinNumVar],delete a.formRules[a.curMaxNumVar],a.curMinNumVar=m,a.curMaxNumVar=u),a[a.curMinNumVar]=r,a[a.curMaxNumVar]=p;const{curMinNumVar:o,curMaxNumVar:l}=a,h=B(c),d=B(i);h||d?(a.formRules[o]={validator:(v,f,b)=>{const w=B(f);!w&&B(a[l])||w&&(h&&!d&&f>=c||!h&&d&&f<=i||f>=c&&f<=i)?b():(a.numberShowMessage=!!(f||a[l]),b(new Error(t("tvp.tvpSearchbox.rangeMinErr",[c,i]))))}},a.formRules[l]={validator:(v,f,b)=>{const w=B(a[o]),k=w&&c<a[o]?Number(a[o]):c,g=B(k),_=B(f);!_&&w||_&&(g&&!d&&f>=k||!g&&d&&f<=i||f>=k&&f<=i)?b():b(!_&&!w?new Error(t("tvp.tvpSearchbox.rangeNumberTitle")):new Error(t("tvp.tvpSearchbox.rangeMaxErr")))}}):a.formRules[l]={validator:(v,f,b)=>{const w=a[o],k=B(f),g=B(w);k&&!g||!k&&g||k&&g&&f>=Number(w)?b():b(!k&&!g?new Error(t("tvp.tvpSearchbox.rangeNumberTitle")):new Error(t("tvp.tvpSearchbox.rangeMaxErr")))}}};function wt({props:a,emit:e,state:t,t:s,format:n,nextTick:r,vm:p,cancelHandleInput:c}){const i=p||t.instance,m=g=>{var x,V,M;const{start:_,end:y,type:I}=g;if(t.backupList=g.options,I==="numRange")Me(t,g,s);else if(I==="dateRange"){const{dateRangeFormat:T}=t;if(!t.startDate&&_){const S=n(_,T);t.startDate=t.endDate<S?null:S}if(!t.endDate&&y){const S=n(y,T);t.endDate=S<t.startDate?null:S}}else if(I==="datetimeRange"){const{datetimeRangeFormat:T}=t;if(!t.startDateTime&&_){const S=n(_,T);t.startDateTime=t.endDateTime<S?null:S}if(!t.endDateTime&&y){const S=n(y,T);t.endDateTime=S<t.startDateTime?null:S}}else t.backupList&&I==="checkbox"&&(t.filterList=t.backupList,t.checkboxGroup=[],(x=t.backupList)==null||x.forEach(T=>{O(t,T.label)&&t.checkboxGroup.push(`${g.label}${T.label}`),T.isFilter=!1}));I!=="checkbox"&&((V=t.backupList)!=null&&V.length)&&((M=t.backupList)==null||M.forEach(T=>{T.isFilter=!1,T.isChecked=O(t,T.label)})),t.currentOperators=null,!t.backupList&&!["dateRange","datetimeRange","numRange","custom"].includes(I)?C(t,!1):C(t)},u=g=>{var V;const{field:_,label:y}=g;t.propItem={...t.propItem,label:y},e("first-level-select",_);const I=(V=i.$refs)==null?void 0:V.inputRef;t.prevItem=g,t.backupPrevItem=g;const{operators:x}=g;x!=null&&x.length?(t.operatorValue="",t.currentOperators=x,C(t)):(t.operatorValue=":",m(g)),t.inputValue="",I.focus()},o=g=>{t.operatorValue=g,m(t.prevItem)},l=(g,_,y,I)=>{const{replace:x,operators:V,mergeTag:M}=g,T=J(g),{indexMap:S}=t,D=S.get(y),$=G(a,g,_),z=t.operatorValue&&V?{operator:t.operatorValue}:null;let A=null;if(M){const U={label:I,...$};if(D>=0){const te=`${t.innerModelValue[D].value} | ${I}`,ae=[...t.innerModelValue[D].options,U];A=H({...t.innerModelValue[D],value:te,options:ae})}else A=H({...T,label:y,value:I,options:[U]})}else A=H({...T,label:y,value:I,...$,...z});if(O(t,I,y)){ee(t);return}C(t,!1);const N=q(t.innerModelValue);let F=[];if((x||M)&&D>=0){const U=[...t.innerModelValue];U.splice(D,1),F=[...U,A]}else F=[...t.innerModelValue,A];P({emit:e,state:t,newValue:F,oldValue:N})},h=g=>{var _;(_=t.propItem)!=null&&_.label?d({label:g}):w()},d=(g,_=!1)=>{var V;C(t,!1),_&&(t.prevItem=g,t.backupPrevItem=g);const{prevItem:y}=t,I=g.value||g.label,x=(V=i.$refs)==null?void 0:V.inputRef;if(!O(t,I)){const M=t.propItem.label||g.label;l(y,g,M,I)}x.focus()},v=(g,_)=>{if(g.label){if(!_.options)return;if(!a.modelValue.find(I=>I.value===_.options[0].label)){const I=_.label,x=_.options&&_.options[0].label;l(_,_.options[0],I,x);return}}else e("search",t.innerModelValue)},f=(g,_,y)=>{var x;const I=(x=t.backupList)==null?void 0:x.find(V=>V.label===y);l(g,I,_.label,y)},b=(g,_,y)=>{var I,x;if(_.label){const{regexp:V,replace:M,type:T,mergeTag:S}=y,D=T!=="checkbox"&&M||T==="checkbox"&&S?[g]:g.split(a.splitInputValue);if(V)for(const $ of D)V.test($)&&f(y,_,$);else for(const $ of D)f(y,_,$)}else{const{items:V,defaultField:M}=a,T=V.find(N=>{const{regexp:F}=N;return F&&F.test(t.inputValue)})||(M?V.find(N=>N.field===M):t.allTypeAttri),{replace:S,type:D,mergeTag:$}=T,z=D!=="checkbox"&&S||D==="checkbox"&&$?[g]:g.split(a.splitInputValue);(I=T==null?void 0:T.options)!=null&&I.length&&(t.backupList=[...T.options],(x=t.backupList)==null||x.forEach(N=>{const F=N.value||N.label;z.includes(F)&&(N.isChecked=!0)}));const A=T.label;for(const N of z)l(T,{},A,N)}},w=()=>{const{inputValue:g,propItem:_,prevItem:y}=t;if(c&&c(),C(t,!1),!g)v(_,y);else{const{maxlength:I}=a;if(I&&I<g.length){e("exceed",I);return}b(g,_,y)}};return{selectPropItem:u,selectRadioItem:d,selectInputValue:h,createTag:w,helpClick:()=>{e("help")},setOperator:o}}const It=a=>a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),oe=(a,e)=>{const t=[];let s=0,n;for(;(n=a.exec(e))!==null;){const r=n.index,p=a.lastIndex;r>s&&t.push(e.slice(s,r)),t.push(e.slice(r,p)),s=p}return s<e.length&&t.push(e.slice(s)),t};function kt({props:a,state:e,emit:t,nextTick:s}){const n=async u=>{e.potentialOptions=await a.potentialOptions.getMatchList(u),C(e,!0)},p=_t(u=>{var _,y,I;const{recordItems:o,propItem:l}=e,h=typeof u=="string"?u:u&&u.target&&typeof u.target.value=="string"?u.target.value:e.inputValue||"",d=String(h).trim(),{maxlength:v}=a;if(v&&v<d.length){t("exceed",v);return}if(d.length===0){C(e);return}Object.keys(e.matchItems).forEach(x=>{e.matchItems[x].attr=[],e.matchItems[x].attrValue=[]});const f=It(d),b=new RegExp(f,"i"),w=l.label||!f?null:o.find(x=>x.type==="map"&&b.test(x.label));if(w){e.propItem={...e.propItem,label:w.label},e.inputValue="",e.prevItem=w,e.backupPrevItem=w,e.backupList=w.options||[];return}e.filterList=(_=e.backupList)==null?void 0:_.filter(x=>b.test(x.label)?(delete x.isFilter,O(e,x.label)&&e.checkboxGroup.push(`${e.prevItem.label}${x.label}`),!0):(x.isFilter=!0,!1));const k=new RegExp(f,"ig"),g=d.toLowerCase();if(e.propItem.label){(y=e.backupList)==null||y.forEach(x=>{x.hightlighStr=g;const V=x.label;b.test(V)?(x.match=oe(k,V),x.isFilter=!1):x.isFilter=!0}),(I=e.backupList)!=null&&I.length||d?C(e):C(e,!1);return}for(const x of o){const{options:V=[],groupKey:M="0",...T}=x,S=T.label;if(b.test(S)){const D=oe(k,S);e.matchItems[M].attr.push({...x,match:D,hightlighStr:g})}for(const D of V){const $=e.propItem.label?S:`${S}:${D.label}`;if(b.test($)){const z=oe(k,$);e.matchItems[M].attrValue.push({...D,...T,options:V,hightlighStr:g,value:D.label,match:z})}}}f&&a.potentialOptions&&a.potentialOptions.getMatchList?n(f):C(e)},500),c=()=>{p.cancel&&p.cancel()},i=()=>{var u;(u=e.backupList)==null||u.forEach(o=>o.isFilter&&delete o.isFilter)};return{handleInput:p,selectFirstMap:(u,o)=>{var v;const{options:l}=u,{prevItem:h,propItem:d}=e;if(l)C(e,!1),e.propItem={...e.propItem,value:`${u.label}=`},e.isShowTagKey=!1,e.inputValue="",e.backupList=u.options||[],i(),(v=e.backupList)==null||v.forEach(f=>{const b=d.value+f.label;f.isChecked=O(e,b)});else{if(u.isChecked)return;C(e,!1),e.isShowTagKey=!0,i();const{field:f,type:b}=h,w=d.value+u.label,k=G(a,h,u),_=[H({type:b,field:f,label:d.label,value:w,...k})];P({emit:t,state:e,nextTick:s,tagList:_})}o&&C(e)},cancelHandleInput:c}}function Ct({props:a,state:e,emit:t,nextTick:s}){return{selectCheckbox:r=>{var u,o;C(e,!1);const{checkboxGroup:p,prevItem:c,propItem:i}=e,m=J(c);if(r){const l=[],h=q(e.innerModelValue),{mergeTag:d,operators:v,label:f}=c;if(d){let b="";const w=[],{indexMap:k}=e,g=k.get(f);if(g!==void 0&&e.innerModelValue.splice(g,1),(u=e.backupList)==null||u.forEach(_=>{const{label:y}=_,I=`${f}${y}`;if(p.includes(I)){delete _.isFilter;const V=G(a,c,_),M={label:_.label,...V};b+=b?` | ${y}`:y,w.push(M)}}),w.length>0){const _={...m,value:b,options:w};l.push(_)}}else{const{valueMap:b}=e,w=[];if((o=e.backupList)==null||o.forEach(k=>{const{label:g}=k,_=`${f}${g}`,y=p.includes(_);if(y&&!O(e,g)){const I=G(a,c,k),x=e.operatorValue&&v?{operator:e.operatorValue}:null,V=H({...m,label:i.label,value:g,...I,...x});l.push(V),k.isChecked=!0}else if(!y&&O(e,g)){k.isChecked=!1;const I=b.get(_);w.push(I)}}),w.length){const k=e.innerModelValue.filter((g,_)=>g&&!w.includes(_));P({emit:t,state:e,nextTick:s,newValue:k,oldValue:h});return}}P({emit:t,state:e,nextTick:s,tagList:l,oldValue:h})}else e.propItem={...i,label:""},e.inputValue=""}}}function Tt({props:a,state:e,emit:t,nextTick:s,vm:n}){const r=n||e.instance;return{onConfirmDate:async(m,u=!1)=>{if(!m){e.propItem={label:""};return}const o=await ie(r,e,a,u);if(o){C(e,!1);const l=a.modelValue.filter(h=>h.type!==o.type||h.field!==o.field);l.push(o),P({emit:t,state:e,nextTick:s,newValue:l})}else C(e)},handleDateShow:()=>C(e),pickerOptions:(m,u="")=>({disabledDate(o){const{maxTimeLength:l=0,min:h,max:d}=e.prevItem,v=e[u],f=o.getTime();if(l>0)if(h||d)if(u&&v){const b=new Date(v).getTime(),w=!h&&d?b-l:Math.max(h.getTime(),b-l);return f<w||f>b}else if(!u&&m){const b=new Date(m).getTime(),w=h&&!d?b+l:Math.min(d.getTime(),b+l);return f<b||f>w}else return h&&f<h.getTime()||d&&f>d.getTime();else if(u&&v){const b=new Date(v).getTime(),w=b-l;return f<w||f>b}else if(!u&&m){const b=new Date(m).getTime(),w=b+l;return f<b||f>w}else return!1;else if(h||d)if(u&&v){const b=new Date(v).getTime();return h&&f<h.getTime()||f>b}else if(!u&&m){const b=new Date(m).getTime();return f<b||d&&f>d.getTime()}else return f<h||f>d;else if(u&&v){const b=new Date(v).getTime();return f>b}else if(!u&&m){const b=new Date(m).getTime();return f<b}else return!1}})}}function Vt({props:a,state:e,t,emit:s,nextTick:n,vm:r}){const p=r||e.instance,c=async u=>{if(!u){e.propItem={...e.propItem,label:""};return}const o=await De(p,e,a);if(o){C(e,!1);const l=a.modelValue.filter(h=>h.type!==o.type||h.field!==o.field);l.push(o),P({emit:s,state:e,nextTick:n,newValue:l})}else C(e)},i=(u,o,l)=>{const{maxTimeLength:h=0}=u;return{[o]:{validator:(d,v,f)=>{h>0&&!v?f(new Error(t("tvp.tvpSearchbox.notBeNull"))):!v&&!e[l]?f(new Error(t("tvp.tvpSearchbox.rangeDateTitle"))):f()}},[l]:{validator:(d,v,f)=>{h>0&&!v?f(new Error(t("tvp.tvpSearchbox.notBeNull"))):!v&&!e[o]?f(new Error(t("tvp.tvpSearchbox.rangeDateTitle"))):f()}}}};return{initFormRule:()=>{let u={},o={};a.items.forEach(l=>{l.type==="dateRange"&&(u=i(l,"startDate","endDate")),l.type==="datetimeRange"&&(o=i(l,"startDateTime","endDateTime"))}),e.formRules={...u,...o},a.editable&&(e.formRules.inputEditValue={required:!0,message:t("tvp.tvpSearchbox.notBeNull"),trigger:["change","blur"]})},sizeChange:c}}function St({props:a,state:e,t,nextTick:s,format:n,emit:r,vm:p}){const c=l=>{var _;const{operator:h,value:d,start:v,end:f}=l,{options:b,operators:w,type:k,mergeTag:g}=e.prevItem;if(k!=="custom"){if(k==="numRange")Me(e,l,t);else if(k==="dateRange"){const{dateRangeFormat:y}=e;e.startDate=n(v,y),e.endDate=n(f,y)}else if(k==="datetimeRange"){const{datetimeRangeFormat:y}=e;e.startDateTime=n(v,y),e.endDateTime=n(f,y)}else{if(g){const y=((_=l.options)==null?void 0:_.flatMap(I=>I.label))||[];e.inputEditValue=y,e.currentEditSelectTags=y}else e.inputEditValue=Array.isArray(d)?d.join(","):d||"";e.currentEditValue=b}e.operatorValue=h,e.currentOperators=w}};return{editTag:(l,h,d)=>{if(!a.editable||l.type&&l.type==="map")return;C(e,!1),e.popoverVisible=!1;const v=d.target.classList.contains("tiny-tag")?d.target:d.srcElement.parentElement;s(()=>{const{popoverRef:f}=e.instance.$refs;f.state.referenceElm=v,f.state.popperElm&&(f.state.popperElm.style.display="none"),f.doDestroy(),e.popoverVisible=!0}),e.prevItem=e.recordItems.find(f=>f.field===l.field),!e.prevItem&&(e.prevItem=l),e.selectValue=l.label,e.currentModelValueIndex=h,r("tagClick",l),c(l)},confirmEditTag:async l=>{if(!l){e.popoverVisible=!1;return}const{prevItem:h,currentModelValueIndex:d}=e;let v=null;h.type==="numRange"?v=await De(e.instance,e,a):h.type==="dateRange"?v=await ie(e.instance,e,a,!1):h.type==="datetimeRange"?v=await ie(e.instance,e,a,!0):v=await xt(e.instance,e,a),v?(C(e,!1),e.popoverVisible=!1,P({emit:r,state:e,nextTick:s,index:d,newTag:v,isEdit:!0})):e.popoverVisible=!0,e.currentEditValue=[]},selectPropChange:(l,h)=>{h||(e.prevItem=l,c(l))},selectItemIsDisable:l=>{var d,v,f,b;if(l.type&&l.type==="map")return!0;if((d=e.prevItem)!=null&&d.operators||l.operators)return((v=e.prevItem.operators)==null?void 0:v.length)!==((f=l.operators)==null?void 0:f.length);const h=["radio","checkbox"];return e.prevItem.type&&h.includes(e.prevItem.type)?l.type?!h.includes(l.type):!1:((b=e.prevItem)==null?void 0:b.type)!==l.type}}}function Dt({state:a,emit:e,nextTick:t}){const s=p=>{C(a,!1);const{prevItem:c,indexMap:i}=a,{replace:m,label:u}=c,o=[];if(m&&i.has(u)){const l=i.get(u),h={...c,...p};P({emit:e,state:a,nextTick:t,newTag:h,index:l});return}else!m&&Array.isArray(p)?p.forEach(l=>{O(a,l.value)||o.push({...c,...l})}):O(a,p.value)||o.push({...c,...p});P({emit:e,state:a,nextTick:t,tagList:o})};return{handleConfirm:p=>{if(!p){ee(a),C(a,!1);return}s(p)},handleEditConfirm:p=>{if(!p){X(a,!1);return}s(p)}}}function Mt({props:a,state:e}){return{initItems:()=>{e.groupItems={},e.recordItems.forEach(c=>{var m;const{groupKey:i="0"}=c;if(e.groupItems[i]?e.groupItems[i].push({...c}):(e.groupItems[i]=[{...c}],e.matchItems[i]={attr:[],attrValue:[]}),e.prevItem&&c.field===e.prevItem.field&&c!==e.prevItem){const{options:u,type:o}=c;e.prevItem=c,u!=null&&u.length&&(e.backupList=u),o==="checkbox"&&(e.filterList=e.backupList,e.checkboxGroup=[],(m=e.backupList)==null||m.forEach(l=>{const{label:h}=l;O(e,h)&&e.checkboxGroup.push(`${c.label}${h}`),l.isFilter=!1})),C(e,c.field===e.prevItem.field&&c!==e.prevItem)}})},watchOutsideClick:()=>{a.editable&&X(e,!1),e.isMouseDown=!1,C(e,!1)},watchMouseDown:()=>{e.isMouseDown=!0},watchMouseMove:()=>{e.isMouseDown&&(e.isMouseDown=!1)},handleClick:c=>{var u;const{backupPrevItem:i,prevItem:m}=e;c.stopPropagation(),a.editable&&(e.popoverVisible=!1,e.currentEditValue=[],e.propItem.label&&i&&i!==m&&(e.prevItem=i)),e.hasBackupList&&(((u=e.backupList)==null?void 0:u.length)===0||!e.backupList)&&!e.inputValue||a.items.length===0?C(e,!1):C(e)}}}const ue={tvp:{tvpSearchbox:{defaultPlaceholder:"请选择属性筛选,或输入关键字",addPlaceholder:"添加筛选条件",tagPlaceholder:"请选择标签键/值搜索,或输入“键=值”搜索",dynamicPlaceholder:"请选择{newValue}搜索",attributeType:"属性类型",propertyValue:"{0}的值",matched:"潜在匹配项",allValues:"所有值",allProperty:"全部属性",operator:"运算符",clearAll:"清空",emptyValue:"空 值",help:"点击查看帮助",switchText:"切换到默认搜索项",tagKey:"键",tagValue:"值",minValueText:"最小值",maxValueText:"最大值",rangeMinErr:"输入值必须在{0}~{1}之间",rangeMaxErr:"最大值必须大于等于最小值,或者为空",rangeNumberTitle:"请至少输入一个值",rangeDateTitle:"请至少输入一个日期",timeLengthTitle:"可选时间跨度为{value}天内",rangeBeginLabel:"开始日期",rangeEndLabel:"结束日期",rulekeyword1:"关键字",notBeNull:"值不能为空",noData:"暂无匹配数据...",selectAll:"全选",confirm:"确定",cancel:"取消",equal:"等于",notEqual:"不等于",contain:"包含",notContain:"不包含",initUse:"搜索"}}},de={tvp:{tvpSearchbox:{defaultPlaceholder:"Select attribute filtering or enter keywords",addPlaceholder:"Add filtering criteria",tagPlaceholder:'Please select tag key/value search, or enter "key=value" to search',dynamicPlaceholder:"Please select {newValue} to search",attributeType:"Attribute Type",propertyValue:"The value of {0}",matched:"Potential matching items",allValues:"All values",allProperty:"All Properties",operator:"Operator",clearAll:"Clear",emptyValue:"Empty value",help:"Click to view help",switchText:"Switch to default search terms",tagKey:"Key",tagValue:"Value",minValueText:"Minimum value",maxValueText:"Maximum value",rangeMinErr:"The input value must be between {0} and {1}",rangeMaxErr:"The maximum value must be greater than or equal to the minimum value, or empty",rangeNumberTitle:"Please enter at least one value",rangeDateTitle:"Please enter at least one date",timeLengthTitle:"The optional time span is within {value} days",rangeBeginLabel:"Start date",rangeEndLabel:"End date",rulekeyword1:"Keywords",notBeNull:"The value cannot be empty",noData:"There is currently no matching data available ..",selectAll:"Select All",confirm:"Confirm",cancel:"Cancel",equal:"Equal",notEqual:"Not equal",contain:"Contain",notContain:"Does not contain",initUse:"Search"}}},Q="zh-CN",Y={"zh-CN":ue,"en-US":de};let E=null;const Ee=a=>{E=a},me=()=>{var a,e,t,s,n;if((t=(e=(a=E==null?void 0:E.config)==null?void 0:a.globalProperties)==null?void 0:e.$i18n)!=null&&t.locale)return E.config.globalProperties.$i18n.locale;if((s=E==null?void 0:E.$i18n)!=null&&s.locale)return E.$i18n.locale;if(typeof navigator<"u"){const r=navigator.language||((n=navigator.languages)==null?void 0:n[0]);if(r)return r.startsWith("zh")?"zh-CN":"en-US"}return Q},ce=a=>Y[a]||Y[Q],R=(a,e={})=>{var p,c;if(!a)return"";if((c=(p=E==null?void 0:E.config)==null?void 0:p.globalProperties)!=null&&c.$t)try{const i=E.config.globalProperties.$t(a,e);if(i&&i!==a)return i}catch(i){console.warn("[TinySearchBox] i18n translation failed:",i)}if(E!=null&&E.$t)try{const i=E.$t(a,e);if(i&&i!==a)return i}catch(i){console.warn("[TinySearchBox] i18n translation failed:",i)}const t=me(),s=ce(t),n=a.split(".");let r=s;for(const i of n)if(r&&typeof r=="object"&&i in r)r=r[i];else{if(t!==Q){r=ce(Q);for(const u of n)if(r&&typeof r=="object"&&u in r)r=r[u];else{r=a;break}}else r=a;break}return typeof r=="string"&&Object.keys(e).length>0?r.replace(/\{(\w+)\}/g,(i,m)=>e[m]!==void 0?e[m]:i):typeof r=="string"?r:a},Et=(a,e={})=>a.map(t=>R(t,e)),$t=a=>a in Y,Lt=()=>Object.keys(Y),Nt=(a,e)=>{Y[a]=e},Rt=a=>{a!==Q&&delete Y[a]},Pt={t:R,zhCN:ue,enUS:de,tArray:Et,setGlobalApp:Ee,getCurrentLocale:me,getLocaleMessages:ce,isLocaleSupported:$t,getSupportedLocales:Lt,addLocale:Nt,removeLocale:Rt},Ot=["t","state","isShowClose","showHelp","maxlength","panelMaxHeight","editable","emptyPlaceholder","deleteTag","editTag","backspaceDeleteTag","createTag","clearTag","helpClick","handleInput","handleClick","handleEvents","pickerOptions","resetInput","selectItemIsDisable","selectPropChange","confirmEditTag","handleConfirm","handleEditConfirm","showDropdown","showPopover"],Ft=({reactive:a,computed:e,api:t,i18n:s,watch:n,props:r,emit:p,vm:c})=>{const i=a({innerModelValue:[...r.modelValue],placeholder:r.emptyPlaceholder||R("tvp.tvpSearchbox.addPlaceholder"),emitter:p,recordItems:[],groupItems:{},inputValue:"",matchItems:{},propItem:{},backupList:[],filterList:[],checkboxGroup:[],prevItem:{},backupPrevItem:"",formRules:null,validType:"text",numberShowMessage:!0,startDate:null,startDateTime:null,endDate:null,endDateTime:null,isShowTagKey:!0,potentialOptions:null,dateRangeFormat:"yyyy/MM/dd",datetimeRangeFormat:"yyyy/MM/dd HH:mm:ss",indexMap:new Map,valueMap:new Map,popoverVisible:!1,selectValue:"",allTypeAttri:{label:R("tvp.tvpSearchbox.rulekeyword1"),field:"tvpKeyword",type:"radio"},operatorValue:":",inputEditValue:"",currentOperators:"",currentEditValue:"",currentModelValueIndex:-1,curMinNumVar:"",curMaxNumVar:"",instance:null,isMouseDown:!1,currentEditSelectTags:[],visible:!1,visibleTimer:null,hasBackupList:e(()=>i.propItem.label&&[void 0,"radio","checkbox","map"].includes(i.prevItem.type)),isIndeterminate:e(()=>i.checkboxGroup.length>0&&i.checkboxGroup.length!==i.filterList.length),checkAll:e({get:()=>i.checkboxGroup.length&&i.checkboxGroup.length===i.filterList.length,set:m=>{m?i.checkboxGroup=i.filterList.flatMap(u=>`${i.prevItem.label}${u.label}`):i.checkboxGroup=[]}})});return i},At=(a,{getCurrentInstance:e,onMounted:t,onBeforeUnmount:s,computed:n,reactive:r,watch:p},{emit:c,nextTick:i,refs:m,vm:u})=>{const o={},l=a.emitter?a.emitter.emit:c,h=Ft({reactive:r,computed:n,api:o,i18n:Pt,watch:p,props:a,emit:l,vm:u});return Bt({api:o,state:h,t:R,props:a,emit:l,nextTick:i,vm:u,computed:n}),zt({watch:p,state:h,props:a,api:o,nextTick:i,vm:u}),h.instance=u,t(()=>{typeof document<"u"&&(document.addEventListener("click",o.watchOutsideClick),document.addEventListener("mousedown",o.watchMouseDown),document.addEventListener("mousemove",o.watchMouseMove))}),s(()=>{typeof document<"u"&&(document.removeEventListener("click",o.watchOutsideClick),document.removeEventListener("mousedown",o.watchMouseDown),document.removeEventListener("mousemove",o.watchMouseMove),h.localeCheckInterval&&(clearInterval(h.localeCheckInterval),h.localeCheckInterval=null))}),o},Bt=({api:a,state:e,t,props:s,emit:n,nextTick:r,vm:p,computed:c})=>{const{deleteTag:i,clearTag:m,backspaceDeleteTag:u}=yt({props:s,state:e,emit:n,nextTick:r}),{editTag:o,confirmEditTag:l,selectPropChange:h,selectItemIsDisable:d}=St({props:s,state:e,t,nextTick:r,format:le,emit:n,vm:p}),{handleInput:v,selectFirstMap:f,cancelHandleInput:b}=kt({props:s,state:e,emit:n,nextTick:r}),{selectPropItem:w,selectRadioItem:k,selectInputValue:g,createTag:_,helpClick:y,setOperator:I}=wt({props:s,emit:n,state:e,t,format:le,nextTick:r,vm:p,cancelHandleInput:b}),{selectCheckbox:x}=Ct({props:s,state:e,emit:n,nextTick:r}),{onConfirmDate:V,handleDateShow:M,pickerOptions:T}=Tt({props:s,state:e,emit:n,nextTick:r,vm:p}),{sizeChange:S,initFormRule:D}=Vt({props:s,state:e,t,emit:n,nextTick:r,vm:p}),{handleConfirm:$,handleEditConfirm:z}=Dt({state:e,emit:n,nextTick:r}),{initItems:A,watchOutsideClick:N,watchMouseDown:F,watchMouseMove:U,handleClick:te}=Mt({props:s,state:e}),ae=c(()=>s.modelValue.length||e.propItem.label||e.inputValue),Ne=()=>({selectInputValue:g,selectPropItem:w,selectRadioItem:k,setOperator:I,selectCheckbox:x,sizeChange:S,onConfirmDate:V,selectFirstMap:f,handleDateShow:M}),ne=W=>{e.placeholder=W};s.modelValue.length>0,ne(t("tvp.tvpSearchbox.addPlaceholder")),Object.assign(a,{t,state:e,isShowClose:ae,deleteTag:i,editTag:o,backspaceDeleteTag:u,createTag:_,clearTag:m,helpClick:y,handleInput:v,handleClick:te,handleEvents:(W,Re,Pe)=>{const fe=Ne();typeof fe[W]=="function"?fe[W](Re,Pe):console.warn(`[TinySearchBox] Unknown event: ${W}`)},pickerOptions:T,resetInput:ee,selectItemIsDisable:d,selectPropChange:h,confirmEditTag:l,handleConfirm:$,handleEditConfirm:z,showDropdown:C,showPopover:X,setPlaceholder:ne,initItems:A,initFormRule:D,watchOutsideClick:N,watchMouseDown:F,watchMouseMove:U})},zt=({watch:a,state:e,props:t,api:s,nextTick:n,vm:r})=>{var u;const p=()=>{var o;if(e.propItem.label){const{placeholder:l,type:h}=e.prevItem;l?s.setPlaceholder(l):h==="map"?s.setPlaceholder(R("tvp.tvpSearchbox.tagPlaceholder")):(o=e.backupList)!=null&&o.length?s.setPlaceholder(R("tvp.tvpSearchbox.dynamicPlaceholder",{newValue:e.propItem.label})):s.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder"))}else s.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder"))},c=()=>{var o,l,h;return(o=r==null?void 0:r.$i18n)!=null&&o.locale?r.$i18n.locale:(h=(l=r==null?void 0:r.proxy)==null?void 0:l.$i18n)!=null&&h.locale?r.proxy.$i18n.locale:me()};let i=c();if(r!=null&&r.$i18n)try{r.$watch(()=>r.$i18n.locale,o=>{o!==i&&(i=o,p())},{immediate:!1})}catch(o){console.warn("[TinySearchBox] Unable to watch i18n.locale via vm.$watch:",o)}if((u=r==null?void 0:r.proxy)!=null&&u.$i18n)try{a(()=>r.proxy.$i18n.locale,o=>{o!==i&&(i=o,p())},{immediate:!1})}catch(o){console.warn("[TinySearchBox] Unable to watch i18n.locale via watch:",o)}const m=()=>{const o=c();o!==i&&(i=o,p())};typeof window<"u"&&(e.localeCheckInterval=setInterval(m,200)),a(()=>t.modelValue,()=>{m()}),a(()=>t.items,o=>{const l=e.visible,h=e.prevItem&&e.prevItem.field;e.recordItems=q(o),s.initItems(),s.initFormRule(),n(()=>{if(s.initItems(),s.initFormRule(),l&&e.propItem.label){const d=e.recordItems.find(v=>v.field===h)||e.prevItem;e.prevItem=d||{},e.backupList=d&&d.options?[...d.options]:[],e.filterList=e.backupList?[...e.backupList]:[],C(e)}})},{deep:!0,immediate:!0}),a(()=>e.inputValue,o=>{!o&&!e.propItem.type&&(e.visible=!1)},{immediate:!0}),a(()=>e.popoverVisible,o=>{!o&&!e.inputEditValue.length&&(e.prevItem&&e.prevItem.mergeTag?e.inputEditValue=Array.isArray(e.currentEditSelectTags)?e.currentEditSelectTags:[]:e.inputEditValue=Array.isArray(e.currentEditSelectTags)?e.currentEditSelectTags.join(","):e.currentEditSelectTags||"")},{immediate:!0}),a(()=>e.propItem.label,o=>{p()}),a(()=>t.modelValue,o=>{if(o){if(e.indexMap.clear(),e.valueMap.clear(),o.forEach((l,h)=>{var v;const d=`${l.label}${l.value}`;e.indexMap.set(l.label,h),e.valueMap.set(d,h),((v=l.options)==null?void 0:v.length)>0&&l.options.forEach(f=>{const b=`${l.label}${f.label}`;e.valueMap.set(b,h)})}),X(e,!1),o.length===0&&s.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder")),t.editable&&!e.inputEditValue.length&&o[0]){const l=o[0];if((e.recordItems.find(d=>d.field===l.field)||l).mergeTag&&l.options){const d=l.options.flatMap(v=>v.label)||[];e.inputEditValue=d,e.currentEditSelectTags=d}else{const d=l.value;e.inputEditValue=Array.isArray(d)?d.join(","):d||""}}e.innerModelValue=[...o]}},{deep:!0,immediate:!0})};var jt=function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("div",{attrs:{tiny_mode:"pc"}},[t("tiny-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:a.state.inputValue.trim(),expression:"state.inputValue.trim()"}],staticClass:"tvp-search-box__filter-item tvp-search-box__dropdown-item tvp-search-box__dropdown-item-init",attrs:{"item-data":{label:a.state.inputValue}},on:{"item-click":function(){return a.selectInputValue(a.state.inputValue)}}},[t("span",[a._v(" "+a._s(a.t("tvp.tvpSearchbox.initUse"))+"""+a._s(a.state.inputValue)+""")])]),t("div",{directives:[{name:"show",rawName:"v-show",value:!a.state.propItem.label&&a.state.inputValue.trim(),expression:"!state.propItem.label && state.inputValue.trim()"}]},[a._l(a.state.matchItems,function(s,n){return t("div",{key:n},[s.attr.length?t("div",[t("span",{staticClass:"tvp-search-box__filter-type"},[a._v(a._s(n==="0"?a.t("tvp.tvpSearchbox.attributeType"):n))]),a._l(s.attr,function(r,p){return t("tiny-dropdown-item",{key:r.label+p,staticClass:"tvp-search-box__filter-item tvp-search-box__dropdown-item",attrs:{"item-data":r},on:{"item-click":function(){return a.selectPropItem(r)}}},[t("span",a._l(r.match,function(c){return t("span",{key:c},[c.toLowerCase()===r.hightlighStr?t("span",{staticClass:"tvp-search-box__text-highlight"},[a._v(a._s(c))]):t("span",[a._v(a._s(c))])])}),0)])})],2):a._e(),s.attrValue.length?[t("span",{staticClass:"tvp-search-box__filter-type"},[a._v(a._s(a.t("tvp.tvpSearchbox.propertyValue",[n==="0"?a.t("tvp.tvpSearchbox.attributeType"):n])))]),a._l(s.attrValue,function(r,p){return t("tiny-dropdown-item",{key:r.label+p,staticClass:"tvp-search-box__filter-item tvp-search-box__dropdown-item",attrs:{disabled:r.isChecked,"item-data":r},on:{"item-click":function(){return a.selectRadioItem(r,!0)}}},[t("span",a._l(r.match,function(c){return t("span",{key:c},[c.toLowerCase()===r.hightlighStr?t("span",{staticClass:"tvp-search-box__text-highlight"},[a._v(a._s(c))]):t("span",[a._v(a._s(c))])])}),0)])})]:a._e()],2)}),t("div",{directives:[{name:"show",rawName:"v-show",value:a.state.potentialOptions,expression:"state.potentialOptions"}]},[t("span",{staticClass:"tvp-search-box__filter-type"},[a._v(a._s(a.t("tvp.tvpSearchbox.matched")))]),t("div",{staticClass:"tvp-search-box__potential-box",attrs:{id:"potential-loading"}},[a.state.potentialOptions?t("div",a._l(a.state.potentialOptions,function(s,n){return t("tiny-dropdown-item",{key:s.label+n,staticClass:"tvp-search-box__filter-item tvp-search-box__dropdown-item",attrs:{"item-data":s},on:{"item-click":function(){return a.selectRadioItem(s,!0)}}},[a._v(" "+a._s(s.label)+": "),t("span",{staticClass:"tvp-search-box__text-highlight"},[a._v(a._s(s.value))])])}),1):a._e()])])],2),t("div",{directives:[{name:"show",rawName:"v-show",value:a.state.visible&&!a.state.propItem.label&&!a.state.inputValue.trim(),expression:"state.visible && !state.propItem.label && !state.inputValue.trim()"}],staticClass:"tvp-search-box__first-panel"},a._l(a.state.groupItems,function(s,n){return t("div",{key:n},[s.length?t("span",{staticClass:"tvp-search-box__filter-type"},[a._v(a._s(n==="0"?a.t("tvp.tvpSearchbox.attributeType"):n))]):a._e(),a._l(s,function(r,p){return t("tiny-dropdown-item",{key:(r.field||r.label)+p,staticClass:"tvp-search-box__dropdown-item",attrs:{"item-data":r},on:{"item-click":function(){return a.selectPropItem(r)}}},[t("span",{attrs:{title:r.label}},[a._v(a._s(r.label))])])})],2)}),0)],1)},qt=[];function he(a,e,t,s,n,r,p,c){var i=typeof a=="function"?a.options:a;e&&(i.render=e,i.staticRenderFns=t,i._compiled=!0),s&&(i.functional=!0),r&&(i._scopeId="data-v-"+r);var m;if(p?(m=function(l){l=l||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!l&&typeof __VUE_SSR_CONTEXT__<"u"&&(l=__VUE_SSR_CONTEXT__),n&&n.call(this,l),l&&l._registeredComponents&&l._registeredComponents.add(p)},i._ssrRegister=m):n&&(m=c?function(){n.call(this,(i.functional?this.parent:this).$root.$options.shadowRoot)}:n),m)if(i.functional){i._injectStyles=m;var u=i.render;i.render=function(h,d){return m.call(d),u(h,d)}}else{var o=i.beforeCreate;i.beforeCreate=o?[].concat(o,m):[m]}return{exports:a,options:i}}const Ht=(a,e,{emit:t})=>{const s=a.handleEvents||a.events||((c,i,m)=>{t("events",c,i,m)});return{selectInputValue:c=>{s("selectInputValue",c)},selectPropItem:c=>{s("selectPropItem",c)},selectRadioItem:(c,i)=>{s("selectRadioItem",c,i)},t:R}},Gt=["selectInputValue","selectPropItem","selectRadioItem","t"],Ut=L.defineComponent({name:L.$prefix+"SearchBoxFirstLevelPanel",components:{TinyDropdownItem:Ie},props:{...L.$props,state:{type:Object,default:()=>({})},potentialOptions:{type:Array,default:()=>[]},events:{type:Function,default:null},handleEvents:{type:Function,default:null}},emits:["events"],setup(a,e){return L.setup({props:a,context:e,renderless:Ht,api:Gt})}}),ve={};var Kt=he(Ut,jt,qt,!1,Zt,null,null,null);function Zt(a){for(let e in ve)this[e]=ve[e]}const $e=function(){return Kt.exports}();var Yt=function(){var a,e=this,t=e.$createElement,s=e._self._c||t;return s("div",{attrs:{tiny_mode:"pc"}},[(a=e.state.currentOperators)!==null&&a!==void 0&&a.length?s("div",[s("span",{staticClass:"tvp-search-box__filter-type"},[e._v(e._s(e.t("tvp.tvpSearchbox.operator")))]),e._l(e.state.currentOperators,function(n,r){return s("tiny-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:n.includes(e.state.inputValue),expression:"item.includes(state.inputValue)"}],key:n+r,staticClass:"tvp-search-box__dropdown-item",attrs:{"item-data":{label:n}},on:{"item-click":function(){return e.setOperator(n)}}},[e._v(" "+e._s(n)+" ")])})],2):!e.state.prevItem.type||e.state.prevItem.type==="radio"?s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isLoading,expression:"isLoading"}],class:["tvp-search-box__radio-wrap",e.isLoading&&"tvp-search-box__loading-box"]},e._l(e.state.backupList,function(n,r){return s("tiny-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:!n.isFilter||!e.state.inputValue,expression:"!item.isFilter || !state.inputValue"}],key:r+(n.field||n.label),staticClass:"tvp-search-box__dropdown-item",attrs:{disabled:n.isChecked,"item-data":n},on:{"item-click":function(){return e.selectRadioItem(n)}}},[n.match?s("span",{attrs:{title:n.label}},e._l(n.match,function(p){return s("span",{key:p},[p.toLowerCase()===n.hightlighStr?s("span",{staticClass:"tvp-search-box__text-highlight"},[e._v(e._s(p))]):s("span",[e._v(e._s(p))])])}),0):s("span",{attrs:{title:n.label}},[e._v(e._s(n.label))])])}),1):e.state.prevItem.type==="checkbox"?s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isLoading,expression:"isLoading"}],class:e.isLoading&&"tvp-search-box__loading-box"},[e.showCheckBoxList?s("div",[s("div",{staticClass:"tvp-search-box__checkbox-wrap"},[s("tiny-checkbox-group",{staticClass:"tvp-search-box__checkbox",model:{value:e.state.checkAll,callback:function(n){e.$set(e.state,"checkAll",n)},expression:"state.checkAll"}},[s("tiny-dropdown-item",{staticClass:"tvp-search-box__dropdown-item tvp-search-box__checkbox-item"},[s("tiny-checkbox",{attrs:{indeterminate:e.state.isIndeterminate},model:{value:e.state.checkAll,callback:function(n){e.$set(e.state,"checkAll",n)},expression:"state.checkAll"}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.selectAll"))+" ")])],1)],1),s("tiny-checkbox-group",{staticClass:"tvp-search-box__checkbox",model:{value:e.state.checkboxGroup,callback:function(n){e.$set(e.state,"checkboxGroup",n)},expression:"state.checkboxGroup"}},e._l(e.state.backupList,function(n,r){return s("tiny-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:!n.isFilter,expression:"!item.isFilter"}],key:(n.field||n.label)+r,staticClass:"tvp-search-box__dropdown-item tvp-search-box__checkbox-item"},[s("tiny-checkbox",{staticClass:"tvp-search-box__checkbox-item-label",attrs:{label:e.state.prevItem.label+n.label,title:n.label}},[e._v(" "+e._s(n.label)+" ")])],1)}),1)],1),s("div",{staticClass:"tvp-search-box__checkbox-btn"},[s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.selectCheckbox(!1)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.cancel"))+" ")]),s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.selectCheckbox(!0)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.confirm"))+" ")])],1)]):e._e()]):e.state.prevItem.type==="numRange"?s("div",{staticClass:"tvp-search-box__panel-box"},[s("div",{staticClass:"tvp-search-box__number"},[s("div",{staticClass:"tvp-search-box__dropdown-title"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.rangeNumberTitle"))+" ")]),s("div",{staticClass:"tvp-search-box__dropdown-start"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.minValueText"))+"("+e._s(e.state.prevItem.unit)+") ")]),s("tiny-form-item",{staticClass:"tvp-search-box__number-item",attrs:{prop:e.state.curMinNumVar,"show-message":e.state.numberShowMessage}},[s("tiny-input",{staticClass:"tvp-search-box__number-input",attrs:{type:"number"},model:{value:e.state[e.state.curMinNumVar],callback:function(n){e.$set(e.state,e.state.curMinNumVar,n)},expression:"state[state.curMinNumVar]"}})],1),s("div",{staticClass:"tvp-search-box__dropdown-end"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.maxValueText"))+"("+e._s(e.state.prevItem.unit)+") ")]),s("tiny-form-item",{staticClass:"tvp-search-box__number-item",attrs:{prop:e.state.curMaxNumVar}},[s("tiny-input",{staticClass:"tvp-search-box__number-input",attrs:{type:"number"},model:{value:e.state[e.state.curMaxNumVar],callback:function(n){e.$set(e.state,e.state.curMaxNumVar,n)},expression:"state[state.curMaxNumVar]"}})],1)],1),s("div",{staticClass:"tvp-search-box__bottom-btn"},[s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.sizeChange(!1)}}},[e._v(e._s(e.t("tvp.tvpSearchbox.cancel")))]),s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return n.stopPropagation(),e.sizeChange(!0)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.confirm"))+" ")])],1)]):e.state.prevItem.type==="dateRange"?s("div",{staticClass:"tvp-search-box__panel-box"},[s("div",{staticClass:"tvp-search-box__date-wrap"},[s("div",{staticClass:"tvp-search-box__dropdown-title"},[e._v(" "+e._s(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle"))+" ")]),s("div",{staticClass:"tvp-search-box__dropdown-start"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.rangeBeginLabel"))+" ")]),s("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"startDate","show-message":!!e.state.prevItem.maxTimeLength}},[s("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate,"endDate")},on:{"visible-change":e.handleDateShow},model:{value:e.state.startDate,callback:function(n){e.$set(e.state,"startDate",n)},expression:"state.startDate"}})],1),s("div",{staticClass:"tvp-search-box__dropdown-end"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.rangeEndLabel"))+" ")]),s("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"endDate"}},[s("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate)},on:{change:e.handleDateShow,blur:e.handleDateShow},model:{value:e.state.endDate,callback:function(n){e.$set(e.state,"endDate",n)},expression:"state.endDate"}})],1)],1),s("div",{staticClass:"tvp-search-box__bottom-btn"},[s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.onConfirmDate(!1)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.cancel"))+" ")]),s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.onConfirmDate(!0)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.confirm"))+" ")])],1)]):e.state.prevItem.type==="datetimeRange"?s("div",{staticClass:"tvp-search-box__panel-box"},[s("div",{staticClass:"tvp-search-box__date-wrap"},[s("div",{staticClass:"tvp-search-box__dropdown-title"},[e._v(" "+e._s(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle"))+" ")]),s("div",{staticClass:"tvp-search-box__dropdown-start"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.rangeBeginLabel"))+" ")]),s("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"startDateTime","show-message":!!e.state.prevItem.maxTimeLength}},[s("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime,"endDateTime")},on:{change:e.handleDateShow,blur:e.handleDateShow},model:{value:e.state.startDateTime,callback:function(n){e.$set(e.state,"startDateTime",n)},expression:"state.startDateTime"}})],1),s("div",{staticClass:"tvp-search-box__dropdown-end"},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.rangeEndLabel"))+" ")]),s("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"endDateTime"}},[s("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime)},on:{change:e.handleDateShow,blur:e.handleDateShow},model:{value:e.state.endDateTime,callback:function(n){e.$set(e.state,"endDateTime",n)},expression:"state.endDateTime"}})],1)],1),s("div",{staticClass:"tvp-search-box__bottom-btn"},[s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.onConfirmDate(!1,!0)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.cancel"))+" ")]),s("tiny-button",{attrs:{size:"mini"},on:{click:function(n){return e.onConfirmDate(!0,!0)}}},[e._v(" "+e._s(e.t("tvp.tvpSearchbox.confirm"))+" ")])],1)]):e.state.prevItem.type==="map"?s("div",{directives:[{name:"loading",rawName:"v-loading",value:e.isLoading,expression:"isLoading"}]},[e.state.isShowTagKey?s("span",{staticClass:"tvp-search-box__filter-type"},[e._v(e._s(e.t("tvp.tvpSearchbox.tagKey")))]):s("span",{staticClass:"tvp-search-box__filter-type"},[e._v(e._s(e.t("tvp.tvpSearchbox.tagValue")))]),e._l(e.state.backupList,function(n,r){return s("tiny-dropdown-item",{directives:[{name:"show",rawName:"v-show",value:!n.isFilter,expression:"!item.isFilter"}],key:n.label+n.value+r,staticClass:"tvp-search-box__dropdown-item",attrs:{disabled:n.isChecked,"item-data":n},on:{"item-click":function(){return e.selectFirstMap(n,e.state.isShowTagKey)}}},[s("span",{attrs:{title:n.label}},[e._v(e._s(n.label))])])})],2):e._e()])},Wt=[];const Qt=(a,e,{emit:t})=>{const{computed:s}=e,n=a.handleEvents||a.events||((d,v,f)=>{t("events",d,v,f)}),r=d=>{n("setOperator",d)},p=d=>{n("selectRadioItem",d)},c=d=>{n("selectCheckbox",d)},i=d=>{n("sizeChange",d)},m=(d,v)=>{n("onConfirmDate",d,v)},u=(d,v)=>{n("selectFirstMap",d,v)},o=d=>{n("handleDateShow",d)},l=s(()=>{var d;return a.state.hasBackupList&&((d=a.state.backupList)==null?void 0:d.length)===0}),h=s(()=>{var d;return(d=a.state.backupList)==null?void 0:d.find(v=>!v.isFilter)});return{setOperator:r,selectRadioItem:p,selectCheckbox:c,sizeChange:i,onConfirmDate:m,selectFirstMap:u,handleDateShow:o,isLoading:l,showCheckBoxList:h,t:R}},Xt=["setOperator","selectRadioItem","selectCheckbox","sizeChange","onConfirmDate","selectFirstMap","handleDateShow","isLoading","showCheckBoxList","t"],Jt=L.defineComponent({name:L.$prefix+"SearchBoxSecondLevelPanel",emits:["events"],components:{TinyFormItem:we,TinyDropdownItem:Ie,TinyCheckbox:Ge,TinyCheckboxGroup:Ue,TinyDatePicker:xe,TinyInput:_e,TinyButton:ye},directives:{loading:Ke.directive},props:{...L.$props,state:{type:Object,default:()=>({})},pickerOptions:{type:Function,default:()=>{}},events:{type:Function,default:null},handleEvents:{type:Function,default:null}},setup(a,e){return L.setup({props:a,context:e,renderless:Qt,api:Xt})}}),be={};var ea=he(Jt,Yt,Wt,!1,ta,null,null,null);function ta(a){for(let e in be)this[e]=be[e]}const Le=function(){return ea.exports}();const aa=L.defineComponent({model:{prop:"modelValue",event:"update:modelValue"},props:{...L.$props,tiny_mode:{type:String,default:"pc"},modelValue:{type:Array,default:()=>[]},items:{type:Array,default:()=>[]},emptyPlaceholder:{type:String,default:""},potentialOptions:{type:Object,default:()=>null},showHelp:{type:Boolean,default:!0},idMapKey:{type:String,default:"id"},defaultField:{type:String,default:""},editable:{type:Boolean,default:!1},maxlength:{type:Number,default:void 0},panelMaxHeight:{type:String,default:"999px"},splitInputValue:{type:String,default:","},size:{type:String,default:""}},emits:["update:modelValue","change","search","exceed","first-level-select","clear"],components:{TinyTag:Oe,TinyInput:_e,TinyDropdown:Fe,TinyDropdownMenu:Ae,TinyButton:ye,TinyTooltip:Be,TinyDatePicker:xe,TinyForm:ze,TinyFormItem:we,TinyPopover:je,TinySelect:qe,TinyOption:He,TinySearchBoxFirstLevelPanel:$e,TinySearchBoxSecondLevelPanel:Le,TinyIconSearch:se.iconSearch(),TinyIconClose:se.iconClose(),TinyIconHelpQuery:se.iconHelpQuery()},setup(a,e){return L.setup({props:a,context:e,renderless:At,api:Ot})}});var na=function(){var a,e,t=this,s=t.$createElement,n=t._self._c||s;return n("div",{class:["tvp-search-box",t.size==="small"?"tvp-search-box--small":""],on:{click:function(r){return r.stopPropagation(),t.showPopover(t.state,!1)}}},[n("tiny-icon-search",{staticClass:"tvp-search-box__prefix"}),t._l(t.modelValue,function(r,p){return n("tiny-tag",{key:r.field+p,staticClass:"tvp-search-box__tag",class:t.editable&&r.type!=="map"?"tvp-search-box__tag-editor":"",attrs:{closable:"",title:`${r.label} ${r.operator||":"} ${r.value}`},on:{close:function(c){return t.deleteTag(r)},click:function(c){return c.stopPropagation(),t.editTag(r,p,c)}}},[n("span",{staticClass:"tvp-search-box__tag-value"},[t._v(t._s(r.label)+" "+t._s(r.operator||":")+" "+t._s(r.value)+" ")])])}),t.modelValue.length?n("span",{staticClass:"tvp-search-box__placeholder"}):t._e(),n("tiny-form",{ref:"formRef",staticClass:"tvp-search-box__form",attrs:{model:t.state,rules:t.state.formRules,"validate-type":t.state.validType,size:t.size==="small"?"small":"","label-width":"0px","message-type":"block"}},[n("div",{staticClass:"tvp-search-box__input-wrapper"},[n("section",{staticClass:"tvp-search-box__prop"},[n("span",{directives:[{name:"show",rawName:"v-show",value:t.state.propItem.label,expression:"state.propItem.label"}]},[t._v(t._s(t.state.propItem.label)+" "+t._s(`${t.state.operatorValue?t.state.operatorValue:""} `))]),n("span",{directives:[{name:"show",rawName:"v-show",value:t.state.propItem.value,expression:"state.propItem.value"}]},[t._v(t._s(t.state.propItem.value))])]),n("tiny-dropdown",{ref:"dropdownRef",staticClass:"tvp-search-box__dropdown",attrs:{trigger:"click","show-icon":!1,size:t.size==="small"?"small":"","lazy-show-popper":"","close-on-click-outside":!0},scopedSlots:t._u([{key:"dropdown",fn:function(){var r,p;return[n("tiny-dropdown-menu",{style:{"max-height":t.panelMaxHeight},attrs:{placement:"bottom-start","popper-class":"tvp-search-box__dropdown-menu"},on:{mouseup:function(c){return c.stopPropagation(),(function(){}).apply(null,arguments)}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!t.state.propItem.label||t.state.inputValue.trim(),expression:"!state.propItem.label || state.inputValue.trim()"}]},[(r=t.state.instance)!==null&&r!==void 0&&r.slots["first-panel"]?t._t("first-panel",null,null,{state:t.state,handleEvents:t.handleEvents}):n("TinySearchBoxFirstLevelPanel",{attrs:{state:t.state,handleEvents:t.handleEvents}})],2),n("div",{directives:[{name:"show",rawName:"v-show",value:t.state.propItem.label,expression:"state.propItem.label"}]},[(p=t.state.instance)!==null&&p!==void 0&&p.slots["second-panel"]?t._t("second-panel",null,null,{state:t.state,pickerOptions:t.pickerOptions,handleEvents:t.handleEvents,back:function(){return t.resetInput(t.state)}}):t.state.prevItem.type!=="custom"?n("TinySearchBoxSecondLevelPanel",{attrs:{state:t.state,"picker-options":t.pickerOptions},on:{events:t.handleEvents}}):n("div",{staticClass:"tvp-search-box__panel-box",on:{click:function(c){return t.showDropdown(t.state)}}},[t._t(t.state.prevItem.slotName,null,null,{showDropdown:function(){return t.showDropdown(t.state)},onConfirm:t.handleConfirm})],2)],2)])]},proxy:!0}],null,!0),model:{value:t.state.visible,callback:function(r){t.$set(t.state,"visible",r)},expression:"state.visible"}},[n("tiny-input",{ref:"inputRef",staticClass:"tvp-search-box__input",attrs:{placeholder:t.state.placeholder,maxlength:t.maxlength&&t.maxlength+1},on:{keydown:[function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"delete",[8,46],r.key,["Backspace","Delete","Del"])?null:(r.stopPropagation(),t.backspaceDeleteTag.apply(null,arguments))},function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:(r.stopPropagation(),t.createTag.apply(null,arguments))}],input:t.handleInput,click:t.handleClick},scopedSlots:t._u([{key:"suffix",fn:function(){return[n("tiny-icon-close",{directives:[{name:"show",rawName:"v-show",value:t.isShowClose,expression:"isShowClose"}],staticClass:"tvp-search-box__input-close",on:{click:function(r){return r.stopPropagation(),t.clearTag.apply(null,arguments)}}}),n("span",{directives:[{name:"show",rawName:"v-show",value:t.isShowClose,expression:"isShowClose"}],staticClass:"tvp-search-box__input-separator"}),t.showHelp?n("tiny-tooltip",{attrs:{effect:"light",content:t.t("tvp.tvpSearchbox.help"),placement:"top"}},[n("tiny-icon-help-query",{staticClass:"tvp-search-box__input-help",on:{click:function(r){return r.stopPropagation(),t.helpClick.apply(null,arguments)}}})],1):t._e(),n("tiny-icon-search",{staticClass:"tvp-search-box__input-search",on:{click:function(r){return r.stopPropagation(),t.createTag.apply(null,arguments)}}})]},proxy:!0}]),model:{value:t.state.inputValue,callback:function(r){t.$set(t.state,"inputValue",r)},expression:"state.inputValue"}})],1)],1),t.editable?[n("tiny-popover",{ref:"popoverRef",staticClass:"tvp-search-box__form-popover",attrs:{placement:"bottom-start","visible-arrow":!1,trigger:"manual","popper-class":"tvp-search-box__popover"},model:{value:t.state.popoverVisible,callback:function(r){t.$set(t.state,"popoverVisible",r)},expression:"state.popoverVisible"}},[t.state.prevItem.type!=="custom"?[n("div",{staticClass:"tvp-search-box__date-wrap"},[n("div",{staticClass:"tvp-search-box__dropdown-start"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.attributeType"))+" ")]),n("tiny-form-item",{staticClass:"tvp-search-box__number-item"},[n("tiny-select",{attrs:{searchable:"",disabled:t.state.prevItem.editAttrDisabled},model:{value:t.state.selectValue,callback:function(r){t.$set(t.state,"selectValue",r)},expression:"state.selectValue"}},[n("tiny-option",{key:t.state.allTypeAttri.label,attrs:{label:t.t("tvp.tvpSearchbox.allProperty"),value:t.state.allTypeAttri.label,disabled:t.selectItemIsDisable(t.state.allTypeAttri)},on:{click:function(r){t.selectPropChange(t.state.allTypeAttri,t.selectItemIsDisable(t.state.allTypeAttri))}}}),t._l(t.state.recordItems,function(r){return n("tiny-option",{key:r.label,attrs:{label:r.label,value:r.label,disabled:t.selectItemIsDisable(r)},on:{click:function(p){t.selectPropChange(r,t.selectItemIsDisable(r))}}})})],2)],1),t.state.prevItem.operators?n("div",{staticClass:"tvp-search-box__dropdown-end"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.operator"))+" ")]):t._e(),t.state.prevItem.operators?n("tiny-form-item",{staticClass:"tvp-search-box__number-item"},[n("tiny-select",{model:{value:t.state.operatorValue,callback:function(r){t.$set(t.state,"operatorValue",r)},expression:"state.operatorValue"}},t._l(t.state.currentOperators,function(r){return n("tiny-option",{key:r,attrs:{label:r,value:r}})}),1)],1):t._e(),t.state.prevItem.type!=="numRange"?n("div",{staticClass:"tvp-search-box__dropdown-end"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.tagValue"))+" ")]):t._e(),["numRange","dateRange","datetimeRange","custom"].includes(t.state.prevItem.type)?t._e():n("tiny-form-item",{staticClass:"tvp-search-box__number-item",attrs:{prop:"inputEditValue"}},[((a=t.state.currentEditValue)===null||a===void 0?void 0:a.length)>0?n("tiny-select",{staticClass:"tvp-search-box-select",attrs:{multiple:!!t.state.prevItem.mergeTag,"allow-create":(e=t.state.prevItem)===null||e===void 0?void 0:e.allowCreate,filterable:"","default-first-option":"",clearable:""},model:{value:t.state.inputEditValue,callback:function(r){t.$set(t.state,"inputEditValue",r)},expression:"state.inputEditValue"}},t._l(t.state.currentEditValue,function(r){return n("tiny-option",{key:r.label,attrs:{label:r.label,value:r.label}})}),1):n("tiny-input",{attrs:{clearable:""},model:{value:t.state.inputEditValue,callback:function(r){t.$set(t.state,"inputEditValue",r)},expression:"state.inputEditValue"}})],1),t.state.prevItem.type==="numRange"?n("div",{staticClass:"tvp-search-box__number"},[n("div",{staticClass:"tvp-search-box__dropdown-start"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.minValueText"))+"("+t._s(t.state.prevItem.unit)+") ")]),n("tiny-form-item",{staticClass:"tvp-search-box__number-item",attrs:{prop:t.state.curMinNumVar,"show-message":t.state.numberShowMessage}},[n("tiny-input",{staticClass:"tvp-search-box__number-input",attrs:{type:"number"},model:{value:t.state[t.state.curMinNumVar],callback:function(r){t.$set(t.state,t.state.curMinNumVar,r)},expression:"state[state.curMinNumVar]"}})],1),n("div",{staticClass:"tvp-search-box__dropdown-end"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.maxValueText"))+"("+t._s(t.state.prevItem.unit)+") ")]),n("tiny-form-item",{staticClass:"tvp-search-box__number-item",attrs:{prop:t.state.curMaxNumVar}},[n("tiny-input",{staticClass:"tvp-search-box__number-input",attrs:{type:"number"},model:{value:t.state[t.state.curMaxNumVar],callback:function(r){t.$set(t.state,t.state.curMaxNumVar,r)},expression:"state[state.curMaxNumVar]"}})],1)],1):t._e(),t.state.prevItem.type==="dateRange"?n("div",{staticClass:"tvp-search-box__date-wrap"},[n("div",{staticClass:"tvp-search-box__dropdown-title"},[t._v(" "+t._s(t.state.prevItem.maxTimeLength>0?t.t("tvp.tvpSearchbox.timeLengthTitle",{value:(t.state.prevItem.maxTimeLength/864e5).toFixed(1)}):t.t("tvp.tvpSearchbox.rangeDateTitle"))+" ")]),n("div",{staticClass:"tvp-search-box__dropdown-start"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.rangeBeginLabel"))+" ")]),n("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"startDate","show-message":!!t.state.prevItem.maxTimeLength}},[n("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{format:t.state.prevItem.format||t.state.dateRangeFormat,"value-format":t.state.prevItem.format||t.state.dateRangeFormat,"picker-options":t.pickerOptions(t.state.startDate,"endDate")},model:{value:t.state.startDate,callback:function(r){t.$set(t.state,"startDate",r)},expression:"state.startDate"}})],1),n("div",{staticClass:"tvp-search-box__dropdown-end"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.rangeEndLabel"))+" ")]),n("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"endDate"}},[n("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{format:t.state.prevItem.format||t.state.dateRangeFormat,"value-format":t.state.prevItem.format||t.state.dateRangeFormat,"picker-options":t.pickerOptions(t.state.startDate)},model:{value:t.state.endDate,callback:function(r){t.$set(t.state,"endDate",r)},expression:"state.endDate"}})],1)],1):t._e(),t.state.prevItem.type==="datetimeRange"?n("div",{staticClass:"tvp-search-box__date-wrap"},[n("div",{staticClass:"tvp-search-box__dropdown-title"},[t._v(" "+t._s(t.state.prevItem.maxTimeLength>0?t.t("tvp.tvpSearchbox.timeLengthTitle",{value:(t.state.prevItem.maxTimeLength/864e5).toFixed(1)}):t.t("tvp.tvpSearchbox.rangeDateTitle"))+" ")]),n("div",{staticClass:"tvp-search-box__dropdown-start"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.rangeBeginLabel"))+" ")]),n("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"startDateTime","show-message":!!t.state.prevItem.maxTimeLength}},[n("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{type:"datetime",isutc8:!0,format:t.state.prevItem.format||t.state.datetimeRangeFormat,"value-format":t.state.prevItem.format||t.state.datetimeRangeFormat,"picker-options":t.pickerOptions(t.state.startDateTime,"endDateTime")},model:{value:t.state.startDateTime,callback:function(r){t.$set(t.state,"startDateTime",r)},expression:"state.startDateTime"}})],1),n("div",{staticClass:"tvp-search-box__dropdown-end"},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.rangeEndLabel"))+" ")]),n("tiny-form-item",{staticClass:"tvp-search-box__date-item",attrs:{prop:"endDateTime"}},[n("tiny-date-picker",{staticClass:"tvp-search-box__date-picker",attrs:{type:"datetime",isutc8:!0,format:t.state.prevItem.format||t.state.datetimeRangeFormat,"value-format":t.state.prevItem.format||t.state.datetimeRangeFormat,"picker-options":t.pickerOptions(t.state.startDateTime)},model:{value:t.state.endDateTime,callback:function(r){t.$set(t.state,"endDateTime",r)},expression:"state.endDateTime"}})],1)],1):t._e()],1),n("div",{staticClass:"tvp-search-box__bottom-btn"},[n("tiny-button",{attrs:{size:"mini"},on:{click:function(r){return t.confirmEditTag(!1)}}},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.cancel"))+" ")]),n("tiny-button",{attrs:{size:"mini"},on:{click:function(r){return t.confirmEditTag(!0)}}},[t._v(" "+t._s(t.t("tvp.tvpSearchbox.confirm"))+" ")])],1)]:n("div",{staticClass:"tvp-search-box__panel-box"},[t._t(`${t.state.prevItem.slotName}-edit`,null,null,{showDropdown:function(){return t.showPopover(t.state)},onConfirm:t.handleEditConfirm})],2)],2)]:t._e()],2)],2)},sa=[];const ge={};var ra=he(aa,na,sa,!1,oa,null,null,null);function oa(a){for(let e in ge)this[e]=ge[e]}const la=function(){return ra.exports}(),ia={...L.$props,tiny_mode:{type:String,default:"pc"},modelValue:{type:Array,default:()=>[]},items:{type:Array,default:()=>[]},emptyPlaceholder:{type:String,default:""},potentialOptions:{type:Object,default:()=>null},showHelp:{type:Boolean,default:!0},idMapKey:{type:String,default:"id"},defaultField:{type:String,default:""},editable:{type:Boolean,default:!1},maxlength:{type:Number,default:void 0},panelMaxHeight:{type:String,default:"999px"},splitInputValue:{type:String,default:","},customClass:{type:String,default:""},customStyle:{type:Object,default:()=>({})},size:{type:String,default:""}},Z=L.defineComponent({name:L.$prefix+"SearchBox",props:ia,...la}),ca="3.27.0";Z.install=function(a){a.component(Z.name,Z)};Z.version=ca;window&&typeof window<"u"&&window.Vue&&Z.install(window.Vue);exports.TinySearchBoxFirstLevelPanel=$e;exports.TinySearchBoxSecondLevelPanel=Le;exports.default=Z;exports.enUS=de;exports.setGlobalApp=Ee;exports.t=R;exports.zhCN=ue;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const _=require("@opentiny/vue-common"),xe=require("@opentiny/vue-tag"),be=require("@opentiny/vue-input"),Re=require("@opentiny/vue-dropdown"),Pe=require("@opentiny/vue-dropdown-menu"),ge=require("@opentiny/vue-button"),Fe=require("@opentiny/vue-tooltip"),ye=require("@opentiny/vue-date-picker"),Oe=require("@opentiny/vue-form"),ke=require("@opentiny/vue-form-item"),Ae=require("@opentiny/vue-popover"),ze=require("@opentiny/vue-select"),Ue=require("@opentiny/vue-option"),ae=require("@opentiny/vue-icon"),Ve=require("@opentiny/vue-dropdown-item"),t=require("vue"),qe=require("@opentiny/vue-checkbox"),je=require("@opentiny/vue-checkbox-group"),He=require("@opentiny/vue-loading"),Ke=(e,o,n,a="0")=>{if(typeof e=="string"&&typeof a=="string"&&we(o)){let u=e.length-o;if(u>0)return n?e.substr(0,o):e.substr(u,o);{const c=[];for(u=Math.abs(u)/a.length;u>0;u--)c.push(a);const f=c.join("");return n?e+f:f+e}}},Ge=Object.prototype.toString,Ze=Object.prototype.hasOwnProperty,Ye=Ze.toString;Ye.call(Object);const Qe={"[object Error]":"error","[object Object]":"object","[object RegExp]":"regExp","[object Date]":"date","[object Array]":"array","[object Function]":"function","[object AsyncFunction]":"asyncFunction","[object String]":"string","[object Number]":"number","[object Boolean]":"boolean"},We=e=>e==null,Je=e=>We(e)?String(e):Qe[Ge.call(e)]||"object",we=e=>typeof e=="number"&&isFinite(e),Xe=e=>Je(e)==="date",Ie=[31,28,31,30,31,30,31,31,30,31,30,31],et=new RegExp("^(\\d{4})(/|-)(((0)?[1-9])|(1[0-2]))((/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1])))?( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),tt=new RegExp("^(((0)?[1-9])|(1[0-2]))(/|-)(((0)?[1-9])|([1-2][0-9])|(3[0-1]))?(/|-)?(\\d{4})( ((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?$"),ot=new RegExp("^(\\d{4})-(((0)?[1-9])|(1[0-2]))-(((0)?[1-9])|([1-2][0-9])|(3[0-1]))T(((0)?[0-9]|1[0-9]|20|21|22|23):([0-5]?[0-9])((:([0-5]?[0-9]))?(.([0-9]{1,6}))?)?)?(Z|([+-])((0)?[0-9]|1[0-9]|20|21|22|23):?([0-5]?[0-9]))$"),nt={"y{1,4}":/y{1,4}/,"M{1,2}":/M{1,2}/,"d{1,2}":/d{1,2}/,"h{1,2}":/h{1,2}/,"H{1,2}":/H{1,2}/,"m{1,2}":/m{1,2}/,"s{1,2}":/s{1,2}/,"S{1,3}":/S{1,3}/,"Z{1,1}":/Z{1,1}/},q={YEAR:9999,MONTH:11,DATE:31,HOUR:23,MINUTE:59,SECOND:59,MILLISECOND:999},lt="-12:00,-11:00,-10:00,-09:30,-08:00,-07:00,-06:00,-05:00,-04:30,-04:00,-03:30,-02:00,-01:00",at="-00:00,+00:00,+01:00,+02:00,+03:00,+03:30,+04:00,+04:30,+05:00,+05:30,+05:45,+06:00",rt="+06:30,+07:00,+08:00,+09:00,+10:00,+10:30,+11:00,+11:30,+12:00,+12:45,+13:00,+14:00",st=[].concat(lt.split(","),at.split(","),rt.split(",")),it=e=>{const o=0-e.getTimezoneOffset()/60;let n;return o===0?n="Z":o>0?n="+"+(o>10?o:"0"+o)+"00":n=(o<-10?o:"-0"+-o)+"00",n},Ce=e=>e%400===0||e%4===0&&e%100!==0,Se=e=>e>q.MILLISECOND?Number(String(e).substring(0,3)):e,ue=({year:e,month:o,date:n,hours:a,minutes:u,seconds:c,milliseconds:f})=>{let m=Ie[o];if(Ce(e)&&o===1&&(m+=1),n<=m)return new Date(e,o,n,a,u,c,Se(f))},ct=e=>{if(e.length===23){const o=Number(e[1]),n=e[3]-1,a=Number(e[9]||1),u=e[15]||0,c=e[17]||0,f=e[20]||0,m=e[22]||0;return ue({date:a,year:o,hours:u,month:n,seconds:f,minutes:c,milliseconds:m})}},pt=e=>{if(e.length===22){const o=Number(e[12]),n=e[1]-1,a=Number(e[6]||1),u=e[14]||0,c=e[16]||0,f=e[19]||0,m=e[21]||0;return ue({year:o,month:n,date:a,hours:u,minutes:c,seconds:f,milliseconds:m})}},ut=e=>{if(e.length!==25)return;const o=Number(e[1]),n=e[2]-1,a=Number(e[6]),u=new Date(o,n,a).getTimezoneOffset(),c=e[12]||0,f=e[14]||0,m=e[17]||0,d=e[19]||0;let s=e[20];const p=e[21],l=e[22]||0,i=e[24]||0;let b=Ie[n],h,r;if(Ce(o)&&n===1&&(b+=1),a<=b){if(s==="Z")h=c-u/60,r=f;else{if(s.includes(":")||(s=s.substr(0,3)+":"+s.substr(3)),!st.includes(s))return;h=p==="+"?c-l-u/60:Number(c)+Number(l)-u/60,r=p==="+"?f-i:Number(f)+Number(i)}return new Date(o,n,a,h,r,m,Se(d))}},re=[[et,ct],[tt,pt],[ot,ut]],dt=e=>{for(let o=0,n=re.length;o<n;o++){const a=re[o][0].exec(e);if(a&&a.length>0)return re[o][1](a)}},mt=(e,o,n)=>{if(n)switch(n){case"yyyy":case"yy":e[0]=o;break;case"M":case"MM":e[1]=o-1;break;case"d":case"dd":e[2]=o;break;case"h":case"hh":e[3]=o;break;case"m":case"mm":e[4]=o;break;case"s":case"ss":e[5]=o;break;case"S":case"SS":case"SSS":e[6]=o;break}},ht=(e,o)=>{const n=[0,-1,0,0,0,0];if(e.length!==o.length)return n;let a=0,u=0;for(let c=0,f=e.length;c<f;c++){const m=e.substr(c,1),d=isNaN(Number(m))||m.trim()==="";if(d&&m===o.substr(c,1)||c===f-1){let s,p;if(d){s=e.substring(a,c),a=c+1;const l=o.indexOf(m,u);p=o.substring(u,l===-1?o.length:l),u=l+1}else s=e.substring(a,f),p=o.substring(u,f);(s.length===p.length||s)&&mt(n,s,p)}}return n},Z=(e,o,n)=>isNaN(e)||e<o||e>n,ft=({year:e,month:o,date:n,hours:a,minutes:u,seconds:c,milliseconds:f})=>Z(e,0,q.YEAR)||Z(o,0,q.MONTH)||Z(n,0,q.DATE)||Z(a,0,q.HOUR)||Z(u,0,q.MINUTE)||Z(c,0,q.SECOND)||Z(f,0,q.MILLISECOND),vt=(e,o)=>{if(typeof o=="string"){const n=ht(e,o),a=Number(n[0]),u=Number(n[1]),c=Number(n[2]||1),f=Number(n[3]||0),m=Number(n[4]||0),d=Number(n[5]||0),s=Number(n[6]||0);return ft({year:a,month:u,date:c,hours:f,minutes:m,seconds:d,milliseconds:s})?void 0:ue({year:a,date:c,month:u,minutes:m,hours:f,milliseconds:s,seconds:d})}else return dt(e)},Ee=(e,o,n)=>{let a;if(we(e)?a=new Date(e):typeof e=="string"&&(a=vt(e,o)),n){const u=n&&Ee(n)||new Date(1,1,1,0,0,0);return a&&a<u?u:a}return a},ie=function(e,o="yyyy/MM/dd hh:mm:ss"){if(Xe(e)){if(typeof o=="string"){const n={"y{1,4}":e.getFullYear(),"M{1,2}":e.getMonth()+1,"d{1,2}":e.getDate(),"h{1,2}":e.getHours(),"H{1,2}":e.getHours(),"m{1,2}":e.getMinutes(),"s{1,2}":e.getSeconds(),"S{1,3}":e.getMilliseconds(),"Z{1,1}":it(e)};return Object.keys(n).forEach(a=>{const u=o.match(nt[a]);a&&u&&u.length&&(o=o.replace(u[0],a==="Z{1,1}"?n[a]:Ke(n[a].toString(),u[0].length)))}),o}}else if(typeof e=="string"&&arguments.length>=2){let n=o;arguments.length===2?o=void 0:n=arguments[2];const a=Ee(e,o);return a?ie(a,n):""}},D=(e,o=!0)=>{o?e.visibleTimer=setTimeout(()=>{e.visible=!0},0):(clearTimeout(e.visibleTimer),e.visibleTimer=null,e.visible=!1)},X=(e,o=!0)=>{if(!e.instance)return;e.popoverVisible=o;const{dropdownRef:n}=e.instance;o&&n.state.visible&&(clearTimeout(Number(n.state.timeout)),n.state.timeout=null,n.state.visible=!1)},bt=(e,o=200)=>{let n=null;const a=function(...u){n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,u),n=null},o)};return a.cancel=()=>{n&&(clearTimeout(n),n=null)},a},z=e=>parseFloat(e).toString()!=="NaN",j=e=>{const o=Array.isArray(e)?[]:{};if(e&&typeof e=="object"){const n=Object.keys(e);if(n.length)n.forEach(a=>{e[a]&&typeof e[a]=="object"?o[a]=j(e[a]):o[a]=e[a]});else return e}return o},ee=(e,o=["mergeTag","options","idMapKey"])=>{const n={...e};return o.forEach(a=>{delete n[a]}),n},F=(e,o,n="")=>{const{valueMap:a,prevItem:u}=e,c=(u.label||n)+o;return a.has(c)},te=e=>{e.propItem={},e.inputValue=""},P=({emit:e,state:o,nextTick:n,...a})=>{X(o,!1);const{tagList:u=null,index:c=-1,newTag:f=null,newValue:m=null,oldValue:d=null,isEdit:s}=a;if(s||te(o),!u&&c===-1&&!m)return;const p=d||j(o.innerModelValue);let l=[];m?l=[...m]:c!==-1?(l=[...o.innerModelValue],f?l.splice(c,1,f):l.splice(c,1)):l=[...o.innerModelValue,...u],o.innerModelValue=l,e("update:modelValue",j(l)),e("change",j(l),p)},H=e=>e,K=(e,o,n)=>{const a=o.idMapKey||e.idMapKey;return n&&n[a]!==void 0?{[a]:n[a]}:null};function gt({props:e,state:o,emit:n,nextTick:a}){let u=j(o.inputValue);const c=s=>{if(s){const p=o.recordItems.find(l=>l.label===s.label);if(p&&p.options){const l=p.options.find(i=>i.label===s.value);l&&(l.isChecked=!1)}}};return{deleteTag:s=>{D(o,!1),c(s);const p=e.modelValue.filter(l=>l!==s);P({emit:n,state:o,nextTick:a,newValue:p})},clearTag:()=>{D(o,!1),e.modelValue.forEach(s=>c(s)),o.propItem={},o.inputValue="",P({emit:n,state:o,nextTick:a,newValue:[]}),n("clear")},backspaceDeleteTag:()=>{var s,p,l;if(!o.inputValue){if(o.propItem.label){o.propItem={};return}if(u===""&&o.inputValue===""){D(o,!1);const i=e.modelValue.length-1;c(e.modelValue[i]);const b=o.innerModelValue.slice(0,e.modelValue.length-1);P({emit:n,state:o,nextTick:a,newValue:b})}u=o.inputValue,(l=(p=(s=o==null?void 0:o.instance)==null?void 0:s.refs)==null?void 0:p.inputRef)!=null&&l.$el&&o.instance.refs.inputRef.$el.click()}}}}const yt=async(e,o,n)=>{const{prevItem:a,inputEditValue:u}=o,{operators:c}=a,f=ee(a);let m=null,d=!0;if(await e.$refs.formRef.validateField(["inputEditValue"],s=>{s&&(d=!1)}),d){let s=null;const p=o.operatorValue&&c?{operator:o.operatorValue}:null;let l=u;const i={};if(Array.isArray(u))i.options=[],l="",u.forEach(b=>{const h=o.currentEditValue.find(v=>v.label===b),r=(h==null?void 0:h.label)||b;if(l=l?`${l} | ${r}`:r,h){const v=K(n,a,h);i.options.push({label:r,...v})}else i.options.push({label:r})});else if(Array.isArray(o.currentEditValue)){const b=o.currentEditValue.find(h=>h.label===l);s=K(n,a,b)}m=H({...f,label:o.selectValue,...p,value:l,...s,...i})}return m},De=async(e,o,n)=>{const{prevItem:a}=o,u=`min${a.field}`,c=`max${a.field}`,f=o[u],m=o[c],d=[u,c];let s=!0,p=null;if(await e.$refs.formRef.validateField(d,l=>{l&&(s=!1)}),s){const{field:l,label:i,unit:b,type:h,operators:r}=a,v=b?`${i}(${b})`:i;let y="";f&&m?y=`${f}-${m}`:y=f?`≥${f}`:`≤${m}`;const I=K(n,a,a),E=o.operatorValue&&r?{operator:o.operatorValue}:null;p=H({type:h,field:l,label:v,value:y,...I,start:f,end:m,...E})}return p},ce=async(e,o,n,a)=>{const{prevItem:u,startDate:c,endDate:f,startDateTime:m,endDateTime:d}=o;let s=null,p=null,l=!0,i=null,b=null;if(a?(s=m,p=d,b=["startDateTime","endDateTime"]):(s=c,p=f,b=["startDate","endDate"]),await e.$refs.formRef.validateField(b,h=>{h&&(l=!1)}),l){const{operators:h}=u,r=ee(u);let v="";if(s&&p){if(s>p)return;s===p?v=s:v=`${s}-${p}`}else v=s?`≥${s}`:`≤${p}`;const y=K(n,u,u),I=o.operatorValue&&h?{operator:o.operatorValue}:null;i=H({...r,value:v,start:s,end:p,...y,...I})}return i},Te=(e,o,n)=>{const{prevItem:a}=e,{field:u,start:c,end:f,min:m=a.min,max:d=a.max}=o,s=`min${u}`,p=`max${u}`;(e.curMinNumVar!==s||e.curMaxNumVar!==p)&&(delete e[e.curMinNumVar],delete e[e.curMaxNumVar],delete e.formRules[e.curMinNumVar],delete e.formRules[e.curMaxNumVar],e.curMinNumVar=s,e.curMaxNumVar=p),e[e.curMinNumVar]=c,e[e.curMaxNumVar]=f;const{curMinNumVar:l,curMaxNumVar:i}=e,b=z(m),h=z(d);b||h?(e.formRules[l]={validator:(r,v,y)=>{const I=z(v);!I&&z(e[i])||I&&(b&&!h&&v>=m||!b&&h&&v<=d||v>=m&&v<=d)?y():(e.numberShowMessage=!!(v||e[i]),y(new Error(n("tvp.tvpSearchbox.rangeMinErr",[m,d]))))}},e.formRules[i]={validator:(r,v,y)=>{const I=z(e[l]),E=I&&m<e[l]?Number(e[l]):m,k=z(E),V=z(v);!V&&I||V&&(k&&!h&&v>=E||!k&&h&&v<=d||v>=E&&v<=d)?y():y(!V&&!I?new Error(n("tvp.tvpSearchbox.rangeNumberTitle")):new Error(n("tvp.tvpSearchbox.rangeMaxErr")))}}):e.formRules[i]={validator:(r,v,y)=>{const I=e[l],E=z(v),k=z(I);E&&!k||!E&&k||E&&k&&v>=Number(I)?y():y(!E&&!k?new Error(n("tvp.tvpSearchbox.rangeNumberTitle")):new Error(n("tvp.tvpSearchbox.rangeMaxErr")))}}};function kt({props:e,emit:o,state:n,t:a,format:u,nextTick:c,vm:f,cancelHandleInput:m}){const d=f||n.instance,s=k=>{var w,S,M;const{start:V,end:C,type:g}=k;if(n.backupList=k.options,g==="numRange")Te(n,k,a);else if(g==="dateRange"){const{dateRangeFormat:T}=n;if(!n.startDate&&V){const N=u(V,T);n.startDate=n.endDate<N?null:N}if(!n.endDate&&C){const N=u(C,T);n.endDate=N<n.startDate?null:N}}else if(g==="datetimeRange"){const{datetimeRangeFormat:T}=n;if(!n.startDateTime&&V){const N=u(V,T);n.startDateTime=n.endDateTime<N?null:N}if(!n.endDateTime&&C){const N=u(C,T);n.endDateTime=N<n.startDateTime?null:N}}else n.backupList&&g==="checkbox"&&(n.filterList=n.backupList,n.checkboxGroup=[],(w=n.backupList)==null||w.forEach(T=>{F(n,T.label)&&n.checkboxGroup.push(`${k.label}${T.label}`),T.isFilter=!1}));g!=="checkbox"&&((S=n.backupList)!=null&&S.length)&&((M=n.backupList)==null||M.forEach(T=>{T.isFilter=!1,T.isChecked=F(n,T.label)})),n.currentOperators=null,!n.backupList&&!["dateRange","datetimeRange","numRange","custom"].includes(g)?D(n,!1):D(n)},p=k=>{var S;const{field:V,label:C}=k;n.propItem={...n.propItem,label:C},o("first-level-select",V);const g=(S=d.$refs)==null?void 0:S.inputRef;n.prevItem=k,n.backupPrevItem=k;const{operators:w}=k;w!=null&&w.length?(n.operatorValue="",n.currentOperators=w,D(n)):(n.operatorValue=":",s(k)),n.inputValue="",g.focus()},l=k=>{n.operatorValue=k,s(n.prevItem)},i=(k,V,C,g)=>{const{replace:w,operators:S,mergeTag:M}=k,T=ee(k),{indexMap:N}=n,B=N.get(C),$=K(e,k,V),U=n.operatorValue&&S?{operator:n.operatorValue}:null;let A=null;if(M){const G={label:g,...$};if(B>=0){const oe=`${n.innerModelValue[B].value} | ${g}`,ne=[...n.innerModelValue[B].options,G];A=H({...n.innerModelValue[B],value:oe,options:ne})}else A=H({...T,label:C,value:g,options:[G]})}else A=H({...T,label:C,value:g,...$,...U});if(F(n,g,C)){te(n);return}D(n,!1);const x=j(n.innerModelValue);let O=[];if((w||M)&&B>=0){const G=[...n.innerModelValue];G.splice(B,1),O=[...G,A]}else O=[...n.innerModelValue,A];P({emit:o,state:n,newValue:O,oldValue:x})},b=k=>{var V;(V=n.propItem)!=null&&V.label?h({label:k}):I()},h=(k,V=!1)=>{var S;D(n,!1),V&&(n.prevItem=k,n.backupPrevItem=k);const{prevItem:C}=n,g=k.value||k.label,w=(S=d.$refs)==null?void 0:S.inputRef;if(!F(n,g)){const M=n.propItem.label||k.label;i(C,k,M,g)}w.focus()},r=(k,V)=>{if(k.label){if(!V.options)return;if(!e.modelValue.find(g=>g.value===V.options[0].label)){const g=V.label,w=V.options&&V.options[0].label;i(V,V.options[0],g,w);return}}else o("search",n.innerModelValue)},v=(k,V,C)=>{var w;const g=(w=n.backupList)==null?void 0:w.find(S=>S.label===C);i(k,g,V.label,C)},y=(k,V,C)=>{var g,w;if(V.label){const{regexp:S,replace:M,type:T,mergeTag:N}=C,B=T!=="checkbox"&&M||T==="checkbox"&&N?[k]:k.split(e.splitInputValue);if(S)for(const $ of B)S.test($)&&v(C,V,$);else for(const $ of B)v(C,V,$)}else{const{items:S,defaultField:M}=e,T=S.find(x=>{const{regexp:O}=x;return O&&O.test(n.inputValue)})||(M?S.find(x=>x.field===M):n.allTypeAttri),{replace:N,type:B,mergeTag:$}=T,U=B!=="checkbox"&&N||B==="checkbox"&&$?[k]:k.split(e.splitInputValue);(g=T==null?void 0:T.options)!=null&&g.length&&(n.backupList=[...T.options],(w=n.backupList)==null||w.forEach(x=>{const O=x.value||x.label;U.includes(O)&&(x.isChecked=!0)}));const A=T.label;for(const x of U)i(T,{},A,x)}},I=()=>{const{inputValue:k,propItem:V,prevItem:C}=n;if(m&&m(),D(n,!1),!k)r(V,C);else{const{maxlength:g}=e;if(g&&g<k.length){o("exceed",g);return}y(k,V,C)}};return{selectPropItem:p,selectRadioItem:h,selectInputValue:b,createTag:I,helpClick:()=>{o("help")},setOperator:l}}const Vt=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),se=(e,o)=>{const n=[];let a=0,u;for(;(u=e.exec(o))!==null;){const c=u.index,f=e.lastIndex;c>a&&n.push(o.slice(a,c)),n.push(o.slice(c,f)),a=f}return a<o.length&&n.push(o.slice(a)),n};function wt({props:e,state:o,emit:n,nextTick:a}){const u=async p=>{o.potentialOptions=await e.potentialOptions.getMatchList(p),D(o,!0)},f=bt(p=>{var V,C,g;const{recordItems:l,propItem:i}=o,b=typeof p=="string"?p:p&&p.target&&typeof p.target.value=="string"?p.target.value:o.inputValue||"",h=String(b).trim(),{maxlength:r}=e;if(r&&r<h.length){n("exceed",r);return}if(h.length===0){D(o);return}Object.keys(o.matchItems).forEach(w=>{o.matchItems[w].attr=[],o.matchItems[w].attrValue=[]});const v=Vt(h),y=new RegExp(v,"i"),I=i.label||!v?null:l.find(w=>w.type==="map"&&y.test(w.label));if(I){o.propItem={...o.propItem,label:I.label},o.inputValue="",o.prevItem=I,o.backupPrevItem=I,o.backupList=I.options||[];return}o.filterList=(V=o.backupList)==null?void 0:V.filter(w=>y.test(w.label)?(delete w.isFilter,F(o,w.label)&&o.checkboxGroup.push(`${o.prevItem.label}${w.label}`),!0):(w.isFilter=!0,!1));const E=new RegExp(v,"ig"),k=h.toLowerCase();if(o.propItem.label){(C=o.backupList)==null||C.forEach(w=>{w.hightlighStr=k;const S=w.label;y.test(S)?(w.match=se(E,S),w.isFilter=!1):w.isFilter=!0}),(g=o.backupList)!=null&&g.length||h?D(o):D(o,!1);return}for(const w of l){const{options:S=[],groupKey:M="0",...T}=w,N=T.label;if(y.test(N)){const B=se(E,N);o.matchItems[M].attr.push({...w,match:B,hightlighStr:k})}for(const B of S){const $=o.propItem.label?N:`${N}:${B.label}`;if(y.test($)){const U=se(E,$);o.matchItems[M].attrValue.push({...B,...T,options:S,hightlighStr:k,value:B.label,match:U})}}}v&&e.potentialOptions&&e.potentialOptions.getMatchList?u(v):D(o)},500),m=()=>{f.cancel&&f.cancel()},d=()=>{var p;(p=o.backupList)==null||p.forEach(l=>l.isFilter&&delete l.isFilter)};return{handleInput:f,selectFirstMap:(p,l)=>{var r;const{options:i}=p,{prevItem:b,propItem:h}=o;if(i)D(o,!1),o.propItem={...o.propItem,value:`${p.label}=`},o.isShowTagKey=!1,o.inputValue="",o.backupList=p.options||[],d(),(r=o.backupList)==null||r.forEach(v=>{const y=h.value+v.label;v.isChecked=F(o,y)});else{if(p.isChecked)return;D(o,!1),o.isShowTagKey=!0,d();const{field:v,type:y}=b,I=h.value+p.label,E=K(e,b,p),V=[H({type:y,field:v,label:h.label,value:I,...E})];P({emit:n,state:o,nextTick:a,tagList:V})}l&&D(o)},cancelHandleInput:m}}function It({props:e,state:o,emit:n,nextTick:a}){return{selectCheckbox:c=>{var p,l;D(o,!1);const{checkboxGroup:f,prevItem:m,propItem:d}=o,s=ee(m);if(c){const i=[],b=j(o.innerModelValue),{mergeTag:h,operators:r,label:v}=m;if(h){let y="";const I=[],{indexMap:E}=o,k=E.get(v);if(k!==void 0&&o.innerModelValue.splice(k,1),(p=o.backupList)==null||p.forEach(V=>{const{label:C}=V,g=`${v}${C}`;if(f.includes(g)){delete V.isFilter;const S=K(e,m,V),M={label:V.label,...S};y+=y?` | ${C}`:C,I.push(M)}}),I.length>0){const V={...s,value:y,options:I};i.push(V)}}else{const{valueMap:y}=o,I=[];if((l=o.backupList)==null||l.forEach(E=>{const{label:k}=E,V=`${v}${k}`,C=f.includes(V);if(C&&!F(o,k)){const g=K(e,m,E),w=o.operatorValue&&r?{operator:o.operatorValue}:null,S=H({...s,label:d.label,value:k,...g,...w});i.push(S),E.isChecked=!0}else if(!C&&F(o,k)){E.isChecked=!1;const g=y.get(V);I.push(g)}}),I.length){const E=o.innerModelValue.filter((k,V)=>k&&!I.includes(V));P({emit:n,state:o,nextTick:a,newValue:E,oldValue:b});return}}P({emit:n,state:o,nextTick:a,tagList:i,oldValue:b})}else o.propItem={...d,label:""},o.inputValue=""}}}function Ct({props:e,state:o,emit:n,nextTick:a,vm:u}){const c=u||o.instance;return{onConfirmDate:async(s,p=!1)=>{if(!s){o.propItem={label:""};return}const l=await ce(c,o,e,p);if(l){D(o,!1);const i=e.modelValue.filter(b=>b.type!==l.type||b.field!==l.field);i.push(l),P({emit:n,state:o,nextTick:a,newValue:i})}else D(o)},handleDateShow:()=>D(o),pickerOptions:(s,p="")=>({disabledDate(l){const{maxTimeLength:i=0,min:b,max:h}=o.prevItem,r=o[p],v=l.getTime();if(i>0)if(b||h)if(p&&r){const y=new Date(r).getTime(),I=!b&&h?y-i:Math.max(b.getTime(),y-i);return v<I||v>y}else if(!p&&s){const y=new Date(s).getTime(),I=b&&!h?y+i:Math.min(h.getTime(),y+i);return v<y||v>I}else return b&&v<b.getTime()||h&&v>h.getTime();else if(p&&r){const y=new Date(r).getTime(),I=y-i;return v<I||v>y}else if(!p&&s){const y=new Date(s).getTime(),I=y+i;return v<y||v>I}else return!1;else if(b||h)if(p&&r){const y=new Date(r).getTime();return b&&v<b.getTime()||v>y}else if(!p&&s){const y=new Date(s).getTime();return v<y||h&&v>h.getTime()}else return v<b||v>h;else if(p&&r){const y=new Date(r).getTime();return v>y}else if(!p&&s){const y=new Date(s).getTime();return v<y}else return!1}})}}function St({props:e,state:o,t:n,emit:a,nextTick:u,vm:c}){const f=c||o.instance,m=async p=>{if(!p){o.propItem={...o.propItem,label:""};return}const l=await De(f,o,e);if(l){D(o,!1);const i=e.modelValue.filter(b=>b.type!==l.type||b.field!==l.field);i.push(l),P({emit:a,state:o,nextTick:u,newValue:i})}else D(o)},d=(p,l,i)=>{const{maxTimeLength:b=0}=p;return{[l]:{validator:(h,r,v)=>{b>0&&!r?v(new Error(n("tvp.tvpSearchbox.notBeNull"))):!r&&!o[i]?v(new Error(n("tvp.tvpSearchbox.rangeDateTitle"))):v()}},[i]:{validator:(h,r,v)=>{b>0&&!r?v(new Error(n("tvp.tvpSearchbox.notBeNull"))):!r&&!o[l]?v(new Error(n("tvp.tvpSearchbox.rangeDateTitle"))):v()}}}};return{initFormRule:()=>{let p={},l={};e.items.forEach(i=>{i.type==="dateRange"&&(p=d(i,"startDate","endDate")),i.type==="datetimeRange"&&(l=d(i,"startDateTime","endDateTime"))}),o.formRules={...p,...l},e.editable&&(o.formRules.inputEditValue={required:!0,message:n("tvp.tvpSearchbox.notBeNull"),trigger:["change","blur"]})},sizeChange:m}}function Et({props:e,state:o,t:n,nextTick:a,format:u,emit:c,vm:f}){const m=i=>{var V;const{operator:b,value:h,start:r,end:v}=i,{options:y,operators:I,type:E,mergeTag:k}=o.prevItem;if(E!=="custom"){if(E==="numRange")Te(o,i,n);else if(E==="dateRange"){const{dateRangeFormat:C}=o;o.startDate=u(r,C),o.endDate=u(v,C)}else if(E==="datetimeRange"){const{datetimeRangeFormat:C}=o;o.startDateTime=u(r,C),o.endDateTime=u(v,C)}else{if(k){const C=((V=i.options)==null?void 0:V.flatMap(g=>g.label))||[];o.inputEditValue=C,o.currentEditSelectTags=C}else o.inputEditValue=Array.isArray(h)?h.join(","):h||"";o.currentEditValue=y}o.operatorValue=b,o.currentOperators=I}};return{editTag:(i,b,h)=>{if(!e.editable||i.type&&i.type==="map")return;D(o,!1),o.popoverVisible=!1;const r=h.target.classList.contains("tiny-tag")?h.target:h.srcElement.parentElement;a(()=>{const{popoverRef:v}=o.instance.$refs;v.state.referenceElm=r,v.state.popperElm&&(v.state.popperElm.style.display="none"),v.doDestroy(),o.popoverVisible=!0}),o.prevItem=o.recordItems.find(v=>v.field===i.field),!o.prevItem&&(o.prevItem=i),o.selectValue=i.label,o.currentModelValueIndex=b,c("tagClick",i),m(i)},confirmEditTag:async i=>{if(!i){o.popoverVisible=!1;return}const{prevItem:b,currentModelValueIndex:h}=o;let r=null;b.type==="numRange"?r=await De(o.instance,o,e):b.type==="dateRange"?r=await ce(o.instance,o,e,!1):b.type==="datetimeRange"?r=await ce(o.instance,o,e,!0):r=await yt(o.instance,o,e),r?(D(o,!1),o.popoverVisible=!1,P({emit:c,state:o,nextTick:a,index:h,newTag:r,isEdit:!0})):o.popoverVisible=!0,o.currentEditValue=[]},selectPropChange:(i,b)=>{b||(o.prevItem=i,m(i))},selectItemIsDisable:i=>{var h,r,v,y;if(i.type&&i.type==="map")return!0;if((h=o.prevItem)!=null&&h.operators||i.operators)return((r=o.prevItem.operators)==null?void 0:r.length)!==((v=i.operators)==null?void 0:v.length);const b=["radio","checkbox"];return o.prevItem.type&&b.includes(o.prevItem.type)?i.type?!b.includes(i.type):!1:((y=o.prevItem)==null?void 0:y.type)!==i.type}}}function Dt({state:e,emit:o,nextTick:n}){const a=f=>{D(e,!1);const{prevItem:m,indexMap:d}=e,{replace:s,label:p}=m,l=[];if(s&&d.has(p)){const i=d.get(p),b={...m,...f};P({emit:o,state:e,nextTick:n,newTag:b,index:i});return}else!s&&Array.isArray(f)?f.forEach(i=>{F(e,i.value)||l.push({...m,...i})}):F(e,f.value)||l.push({...m,...f});P({emit:o,state:e,nextTick:n,tagList:l})};return{handleConfirm:f=>{if(!f){te(e),D(e,!1);return}a(f)},handleEditConfirm:f=>{if(!f){X(e,!1);return}a(f)}}}function Tt({props:e,state:o}){return{initItems:()=>{o.groupItems={},o.recordItems.forEach(m=>{var s;const{groupKey:d="0"}=m;if(o.groupItems[d]?o.groupItems[d].push({...m}):(o.groupItems[d]=[{...m}],o.matchItems[d]={attr:[],attrValue:[]}),o.prevItem&&m.field===o.prevItem.field&&m!==o.prevItem){const{options:p,type:l}=m;o.prevItem=m,p!=null&&p.length&&(o.backupList=p),l==="checkbox"&&(o.filterList=o.backupList,o.checkboxGroup=[],(s=o.backupList)==null||s.forEach(i=>{const{label:b}=i;F(o,b)&&o.checkboxGroup.push(`${m.label}${b}`),i.isFilter=!1})),D(o,m.field===o.prevItem.field&&m!==o.prevItem)}})},watchOutsideClick:()=>{e.editable&&X(o,!1),o.isMouseDown=!1,D(o,!1)},watchMouseDown:()=>{o.isMouseDown=!0},watchMouseMove:()=>{o.isMouseDown&&(o.isMouseDown=!1)},handleClick:m=>{var p;const{backupPrevItem:d,prevItem:s}=o;m.stopPropagation(),e.editable&&(o.popoverVisible=!1,o.currentEditValue=[],o.propItem.label&&d&&d!==s&&(o.prevItem=d)),o.hasBackupList&&(((p=o.backupList)==null?void 0:p.length)===0||!o.backupList)&&!o.inputValue||e.items.length===0?D(o,!1):D(o)}}}const de={tvp:{tvpSearchbox:{defaultPlaceholder:"请选择属性筛选,或输入关键字",addPlaceholder:"添加筛选条件",tagPlaceholder:"请选择标签键/值搜索,或输入“键=值”搜索",dynamicPlaceholder:"请选择{newValue}搜索",attributeType:"属性类型",propertyValue:"{0}的值",matched:"潜在匹配项",allValues:"所有值",allProperty:"全部属性",operator:"运算符",clearAll:"清空",emptyValue:"空 值",help:"点击查看帮助",switchText:"切换到默认搜索项",tagKey:"键",tagValue:"值",minValueText:"最小值",maxValueText:"最大值",rangeMinErr:"输入值必须在{0}~{1}之间",rangeMaxErr:"最大值必须大于等于最小值,或者为空",rangeNumberTitle:"请至少输入一个值",rangeDateTitle:"请至少输入一个日期",timeLengthTitle:"可选时间跨度为{value}天内",rangeBeginLabel:"开始日期",rangeEndLabel:"结束日期",rulekeyword1:"关键字",notBeNull:"值不能为空",noData:"暂无匹配数据...",selectAll:"全选",confirm:"确定",cancel:"取消",equal:"等于",notEqual:"不等于",contain:"包含",notContain:"不包含",initUse:"搜索"}}},me={tvp:{tvpSearchbox:{defaultPlaceholder:"Select attribute filtering or enter keywords",addPlaceholder:"Add filtering criteria",tagPlaceholder:'Please select tag key/value search, or enter "key=value" to search',dynamicPlaceholder:"Please select {newValue} to search",attributeType:"Attribute Type",propertyValue:"The value of {0}",matched:"Potential matching items",allValues:"All values",allProperty:"All Properties",operator:"Operator",clearAll:"Clear",emptyValue:"Empty value",help:"Click to view help",switchText:"Switch to default search terms",tagKey:"Key",tagValue:"Value",minValueText:"Minimum value",maxValueText:"Maximum value",rangeMinErr:"The input value must be between {0} and {1}",rangeMaxErr:"The maximum value must be greater than or equal to the minimum value, or empty",rangeNumberTitle:"Please enter at least one value",rangeDateTitle:"Please enter at least one date",timeLengthTitle:"The optional time span is within {value} days",rangeBeginLabel:"Start date",rangeEndLabel:"End date",rulekeyword1:"Keywords",notBeNull:"The value cannot be empty",noData:"There is currently no matching data available ..",selectAll:"Select All",confirm:"Confirm",cancel:"Cancel",equal:"Equal",notEqual:"Not equal",contain:"Contain",notContain:"Does not contain",initUse:"Search"}}},J="zh-CN",Q={"zh-CN":de,"en-US":me};let L=null;const Ne=e=>{L=e},he=()=>{var e,o,n,a,u;if((n=(o=(e=L==null?void 0:L.config)==null?void 0:e.globalProperties)==null?void 0:o.$i18n)!=null&&n.locale)return L.config.globalProperties.$i18n.locale;if((a=L==null?void 0:L.$i18n)!=null&&a.locale)return L.$i18n.locale;if(typeof navigator<"u"){const c=navigator.language||((u=navigator.languages)==null?void 0:u[0]);if(c)return c.startsWith("zh")?"zh-CN":"en-US"}return J},pe=e=>Q[e]||Q[J],R=(e,o={})=>{var f,m;if(!e)return"";if((m=(f=L==null?void 0:L.config)==null?void 0:f.globalProperties)!=null&&m.$t)try{const d=L.config.globalProperties.$t(e,o);if(d&&d!==e)return d}catch(d){console.warn("[TinySearchBox] i18n translation failed:",d)}if(L!=null&&L.$t)try{const d=L.$t(e,o);if(d&&d!==e)return d}catch(d){console.warn("[TinySearchBox] i18n translation failed:",d)}const n=he(),a=pe(n),u=e.split(".");let c=a;for(const d of u)if(c&&typeof c=="object"&&d in c)c=c[d];else{if(n!==J){c=pe(J);for(const p of u)if(c&&typeof c=="object"&&p in c)c=c[p];else{c=e;break}}else c=e;break}return typeof c=="string"&&Object.keys(o).length>0?c.replace(/\{(\w+)\}/g,(d,s)=>o[s]!==void 0?o[s]:d):typeof c=="string"?c:e},Nt=(e,o={})=>e.map(n=>R(n,o)),Bt=e=>e in Q,Mt=()=>Object.keys(Q),Lt=(e,o)=>{Q[e]=o},$t=e=>{e!==J&&delete Q[e]},_t={t:R,zhCN:de,enUS:me,tArray:Nt,setGlobalApp:Ne,getCurrentLocale:he,getLocaleMessages:pe,isLocaleSupported:Bt,getSupportedLocales:Mt,addLocale:Lt,removeLocale:$t},xt=["t","state","isShowClose","showHelp","maxlength","panelMaxHeight","editable","emptyPlaceholder","deleteTag","editTag","backspaceDeleteTag","createTag","clearTag","helpClick","handleInput","handleClick","handleEvents","pickerOptions","resetInput","selectItemIsDisable","selectPropChange","confirmEditTag","handleConfirm","handleEditConfirm","showDropdown","showPopover"],Rt=({reactive:e,computed:o,api:n,i18n:a,watch:u,props:c,emit:f,vm:m})=>{const d=e({innerModelValue:[...c.modelValue],placeholder:c.emptyPlaceholder||R("tvp.tvpSearchbox.addPlaceholder"),emitter:f,recordItems:[],groupItems:{},inputValue:"",matchItems:{},propItem:{},backupList:[],filterList:[],checkboxGroup:[],prevItem:{},backupPrevItem:"",formRules:null,validType:"text",numberShowMessage:!0,startDate:null,startDateTime:null,endDate:null,endDateTime:null,isShowTagKey:!0,potentialOptions:null,dateRangeFormat:"yyyy/MM/dd",datetimeRangeFormat:"yyyy/MM/dd HH:mm:ss",indexMap:new Map,valueMap:new Map,popoverVisible:!1,selectValue:"",allTypeAttri:{label:R("tvp.tvpSearchbox.rulekeyword1"),field:"tvpKeyword",type:"radio"},operatorValue:":",inputEditValue:"",currentOperators:"",currentEditValue:"",currentModelValueIndex:-1,curMinNumVar:"",curMaxNumVar:"",instance:null,isMouseDown:!1,currentEditSelectTags:[],visible:!1,visibleTimer:null,hasBackupList:o(()=>d.propItem.label&&[void 0,"radio","checkbox","map"].includes(d.prevItem.type)),isIndeterminate:o(()=>d.checkboxGroup.length>0&&d.checkboxGroup.length!==d.filterList.length),checkAll:o({get:()=>d.checkboxGroup.length&&d.checkboxGroup.length===d.filterList.length,set:s=>{s?d.checkboxGroup=d.filterList.flatMap(p=>`${d.prevItem.label}${p.label}`):d.checkboxGroup=[]}})});return d},Pt=(e,{getCurrentInstance:o,onMounted:n,onBeforeUnmount:a,computed:u,reactive:c,watch:f},{emit:m,nextTick:d,refs:s,vm:p})=>{const l={},i=e.emitter?e.emitter.emit:m,b=Rt({reactive:c,computed:u,api:l,i18n:_t,watch:f,props:e,emit:i,vm:p});return Ft({api:l,state:b,t:R,props:e,emit:i,nextTick:d,vm:p,computed:u}),Ot({watch:f,state:b,props:e,api:l,nextTick:d,vm:p}),b.instance=p,n(()=>{typeof document<"u"&&(document.addEventListener("click",l.watchOutsideClick),document.addEventListener("mousedown",l.watchMouseDown),document.addEventListener("mousemove",l.watchMouseMove))}),a(()=>{typeof document<"u"&&(document.removeEventListener("click",l.watchOutsideClick),document.removeEventListener("mousedown",l.watchMouseDown),document.removeEventListener("mousemove",l.watchMouseMove),b.localeCheckInterval&&(clearInterval(b.localeCheckInterval),b.localeCheckInterval=null))}),l},Ft=({api:e,state:o,t:n,props:a,emit:u,nextTick:c,vm:f,computed:m})=>{const{deleteTag:d,clearTag:s,backspaceDeleteTag:p}=gt({props:a,state:o,emit:u,nextTick:c}),{editTag:l,confirmEditTag:i,selectPropChange:b,selectItemIsDisable:h}=Et({props:a,state:o,t:n,nextTick:c,format:ie,emit:u,vm:f}),{handleInput:r,selectFirstMap:v,cancelHandleInput:y}=wt({props:a,state:o,emit:u,nextTick:c}),{selectPropItem:I,selectRadioItem:E,selectInputValue:k,createTag:V,helpClick:C,setOperator:g}=kt({props:a,emit:u,state:o,t:n,format:ie,nextTick:c,vm:f,cancelHandleInput:y}),{selectCheckbox:w}=It({props:a,state:o,emit:u,nextTick:c}),{onConfirmDate:S,handleDateShow:M,pickerOptions:T}=Ct({props:a,state:o,emit:u,nextTick:c,vm:f}),{sizeChange:N,initFormRule:B}=St({props:a,state:o,t:n,emit:u,nextTick:c,vm:f}),{handleConfirm:$,handleEditConfirm:U}=Dt({state:o,emit:u,nextTick:c}),{initItems:A,watchOutsideClick:x,watchMouseDown:O,watchMouseMove:G,handleClick:oe}=Tt({props:a,state:o}),ne=m(()=>a.modelValue.length||o.propItem.label||o.inputValue),Le=()=>({selectInputValue:k,selectPropItem:I,selectRadioItem:E,setOperator:g,selectCheckbox:w,sizeChange:N,onConfirmDate:S,selectFirstMap:v,handleDateShow:M}),le=W=>{o.placeholder=W};a.modelValue.length>0,le(n("tvp.tvpSearchbox.addPlaceholder")),Object.assign(e,{t:n,state:o,isShowClose:ne,deleteTag:d,editTag:l,backspaceDeleteTag:p,createTag:V,clearTag:s,helpClick:C,handleInput:r,handleClick:oe,handleEvents:(W,$e,_e)=>{const ve=Le();typeof ve[W]=="function"?ve[W]($e,_e):console.warn(`[TinySearchBox] Unknown event: ${W}`)},pickerOptions:T,resetInput:te,selectItemIsDisable:h,selectPropChange:b,confirmEditTag:i,handleConfirm:$,handleEditConfirm:U,showDropdown:D,showPopover:X,setPlaceholder:le,initItems:A,initFormRule:B,watchOutsideClick:x,watchMouseDown:O,watchMouseMove:G})},Ot=({watch:e,state:o,props:n,api:a,nextTick:u,vm:c})=>{var p;const f=()=>{var l;if(o.propItem.label){const{placeholder:i,type:b}=o.prevItem;i?a.setPlaceholder(i):b==="map"?a.setPlaceholder(R("tvp.tvpSearchbox.tagPlaceholder")):(l=o.backupList)!=null&&l.length?a.setPlaceholder(R("tvp.tvpSearchbox.dynamicPlaceholder",{newValue:o.propItem.label})):a.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder"))}else a.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder"))},m=()=>{var l,i,b;return(l=c==null?void 0:c.$i18n)!=null&&l.locale?c.$i18n.locale:(b=(i=c==null?void 0:c.proxy)==null?void 0:i.$i18n)!=null&&b.locale?c.proxy.$i18n.locale:he()};let d=m();if(c!=null&&c.$i18n)try{c.$watch(()=>c.$i18n.locale,l=>{l!==d&&(d=l,f())},{immediate:!1})}catch(l){console.warn("[TinySearchBox] Unable to watch i18n.locale via vm.$watch:",l)}if((p=c==null?void 0:c.proxy)!=null&&p.$i18n)try{e(()=>c.proxy.$i18n.locale,l=>{l!==d&&(d=l,f())},{immediate:!1})}catch(l){console.warn("[TinySearchBox] Unable to watch i18n.locale via watch:",l)}const s=()=>{const l=m();l!==d&&(d=l,f())};typeof window<"u"&&(o.localeCheckInterval=setInterval(s,200)),e(()=>n.modelValue,()=>{s()}),e(()=>n.items,l=>{const i=o.visible,b=o.prevItem&&o.prevItem.field;o.recordItems=j(l),a.initItems(),a.initFormRule(),u(()=>{if(a.initItems(),a.initFormRule(),i&&o.propItem.label){const h=o.recordItems.find(r=>r.field===b)||o.prevItem;o.prevItem=h||{},o.backupList=h&&h.options?[...h.options]:[],o.filterList=o.backupList?[...o.backupList]:[],D(o)}})},{deep:!0,immediate:!0}),e(()=>o.inputValue,l=>{!l&&!o.propItem.type&&(o.visible=!1)},{immediate:!0}),e(()=>o.popoverVisible,l=>{!l&&!o.inputEditValue.length&&(o.prevItem&&o.prevItem.mergeTag?o.inputEditValue=Array.isArray(o.currentEditSelectTags)?o.currentEditSelectTags:[]:o.inputEditValue=Array.isArray(o.currentEditSelectTags)?o.currentEditSelectTags.join(","):o.currentEditSelectTags||"")},{immediate:!0}),e(()=>o.propItem.label,l=>{f()}),e(()=>n.modelValue,l=>{if(l){if(o.indexMap.clear(),o.valueMap.clear(),l.forEach((i,b)=>{var r;const h=`${i.label}${i.value}`;o.indexMap.set(i.label,b),o.valueMap.set(h,b),((r=i.options)==null?void 0:r.length)>0&&i.options.forEach(v=>{const y=`${i.label}${v.label}`;o.valueMap.set(y,b)})}),X(o,!1),l.length===0&&a.setPlaceholder(R("tvp.tvpSearchbox.addPlaceholder")),n.editable&&!o.inputEditValue.length&&l[0]){const i=l[0];if((o.recordItems.find(h=>h.field===i.field)||i).mergeTag&&i.options){const h=i.options.flatMap(r=>r.label)||[];o.inputEditValue=h,o.currentEditSelectTags=h}else{const h=i.value;o.inputEditValue=Array.isArray(h)?h.join(","):h||""}}o.innerModelValue=[...l]}},{deep:!0,immediate:!0})},fe=(e,o)=>{const n=e.__vccOpts||e;for(const[a,u]of o)n[a]=u;return n},At=(e,o,{emit:n})=>{const a=e.handleEvents||e.events||((m,d,s)=>{n("events",m,d,s)});return{selectInputValue:m=>{a("selectInputValue",m)},selectPropItem:m=>{a("selectPropItem",m)},selectRadioItem:(m,d)=>{a("selectRadioItem",m,d)},t:R}},zt=["selectInputValue","selectPropItem","selectRadioItem","t"],Ut=_.defineComponent({name:_.$prefix+"SearchBoxFirstLevelPanel",components:{TinyDropdownItem:Ve},props:{..._.$props,state:{type:Object,default:()=>({})},potentialOptions:{type:Array,default:()=>[]},events:{type:Function,default:null},handleEvents:{type:Function,default:null}},emits:["events"],setup(e,o){return _.setup({props:e,context:o,renderless:At,api:zt})}}),qt={tiny_mode:"pc"},jt={key:0},Ht={class:"tvp-search-box__filter-type"},Kt={key:0,class:"tvp-search-box__text-highlight"},Gt={key:1},Zt={class:"tvp-search-box__filter-type"},Yt={key:0,class:"tvp-search-box__text-highlight"},Qt={key:1},Wt={class:"tvp-search-box__filter-type"},Jt={id:"potential-loading",class:"tvp-search-box__potential-box"},Xt={key:0},eo={class:"tvp-search-box__text-highlight"},to={class:"tvp-search-box__first-panel"},oo={key:0,class:"tvp-search-box__filter-type"},no=["title"];function lo(e,o,n,a,u,c){const f=t.resolveComponent("tiny-dropdown-item");return t.openBlock(),t.createElementBlock("div",qt,[t.withDirectives(t.createVNode(f,{class:"tvp-search-box__filter-item tvp-search-box__dropdown-item tvp-search-box__dropdown-item-init","item-data":{label:e.state.inputValue},onItemClick:o[0]||(o[0]=()=>e.selectInputValue(e.state.inputValue))},{default:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(e.t("tvp.tvpSearchbox.initUse"))+"""+t.toDisplayString(e.state.inputValue)+""",1)]),_:1},8,["item-data"]),[[t.vShow,e.state.inputValue.trim()]]),t.withDirectives(t.createElementVNode("div",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.matchItems,(m,d)=>(t.openBlock(),t.createElementBlock("div",{key:d},[m.attr.length?(t.openBlock(),t.createElementBlock("div",jt,[t.createElementVNode("span",Ht,t.toDisplayString(d==="0"?e.t("tvp.tvpSearchbox.attributeType"):d),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.attr,(s,p)=>(t.openBlock(),t.createBlock(f,{key:s.label+p,class:"tvp-search-box__filter-item tvp-search-box__dropdown-item","item-data":s,onItemClick:()=>e.selectPropItem(s)},{default:t.withCtx(()=>[t.createElementVNode("span",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.match,l=>(t.openBlock(),t.createElementBlock("span",{key:l},[l.toLowerCase()===s.hightlighStr?(t.openBlock(),t.createElementBlock("span",Kt,t.toDisplayString(l),1)):(t.openBlock(),t.createElementBlock("span",Gt,t.toDisplayString(l),1))]))),128))])]),_:2},1032,["item-data","onItemClick"]))),128))])):t.createCommentVNode("",!0),m.attrValue.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("span",Zt,t.toDisplayString(e.t("tvp.tvpSearchbox.propertyValue",[d==="0"?e.t("tvp.tvpSearchbox.attributeType"):d])),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m.attrValue,(s,p)=>(t.openBlock(),t.createBlock(f,{key:s.label+p,disabled:s.isChecked,class:"tvp-search-box__filter-item tvp-search-box__dropdown-item","item-data":s,onItemClick:()=>e.selectRadioItem(s,!0)},{default:t.withCtx(()=>[t.createElementVNode("span",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.match,l=>(t.openBlock(),t.createElementBlock("span",{key:l},[l.toLowerCase()===s.hightlighStr?(t.openBlock(),t.createElementBlock("span",Yt,t.toDisplayString(l),1)):(t.openBlock(),t.createElementBlock("span",Qt,t.toDisplayString(l),1))]))),128))])]),_:2},1032,["disabled","item-data","onItemClick"]))),128))],64)):t.createCommentVNode("",!0)]))),128)),t.withDirectives(t.createElementVNode("div",null,[t.createElementVNode("span",Wt,t.toDisplayString(e.t("tvp.tvpSearchbox.matched")),1),t.createElementVNode("div",Jt,[e.state.potentialOptions?(t.openBlock(),t.createElementBlock("div",Xt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.potentialOptions,(m,d)=>(t.openBlock(),t.createBlock(f,{key:m.label+d,class:"tvp-search-box__filter-item tvp-search-box__dropdown-item","item-data":m,onItemClick:()=>e.selectRadioItem(m,!0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(m.label)+": ",1),t.createElementVNode("span",eo,t.toDisplayString(m.value),1)]),_:2},1032,["item-data","onItemClick"]))),128))])):t.createCommentVNode("",!0)])],512),[[t.vShow,e.state.potentialOptions]])],512),[[t.vShow,!e.state.propItem.label&&e.state.inputValue.trim()]]),t.withDirectives(t.createElementVNode("div",to,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.groupItems,(m,d)=>(t.openBlock(),t.createElementBlock("div",{key:d},[m.length?(t.openBlock(),t.createElementBlock("span",oo,t.toDisplayString(d==="0"?e.t("tvp.tvpSearchbox.attributeType"):d),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(m,(s,p)=>(t.openBlock(),t.createBlock(f,{key:(s.field||s.label)+p,class:"tvp-search-box__dropdown-item","item-data":s,onItemClick:()=>e.selectPropItem(s)},{default:t.withCtx(()=>[t.createElementVNode("span",{title:s.label},t.toDisplayString(s.label),9,no)]),_:2},1032,["item-data","onItemClick"]))),128))]))),128))],512),[[t.vShow,e.state.visible&&!e.state.propItem.label&&!e.state.inputValue.trim()]])])}const Be=fe(Ut,[["render",lo]]),ao=(e,o,{emit:n})=>{const{computed:a}=o,u=e.handleEvents||e.events||((h,r,v)=>{n("events",h,r,v)}),c=h=>{u("setOperator",h)},f=h=>{u("selectRadioItem",h)},m=h=>{u("selectCheckbox",h)},d=h=>{u("sizeChange",h)},s=(h,r)=>{u("onConfirmDate",h,r)},p=(h,r)=>{u("selectFirstMap",h,r)},l=h=>{u("handleDateShow",h)},i=a(()=>{var h;return e.state.hasBackupList&&((h=e.state.backupList)==null?void 0:h.length)===0}),b=a(()=>{var h;return(h=e.state.backupList)==null?void 0:h.find(r=>!r.isFilter)});return{setOperator:c,selectRadioItem:f,selectCheckbox:m,sizeChange:d,onConfirmDate:s,selectFirstMap:p,handleDateShow:l,isLoading:i,showCheckBoxList:b,t:R}},ro=["setOperator","selectRadioItem","selectCheckbox","sizeChange","onConfirmDate","selectFirstMap","handleDateShow","isLoading","showCheckBoxList","t"],so=_.defineComponent({name:_.$prefix+"SearchBoxSecondLevelPanel",emits:["events"],components:{TinyFormItem:ke,TinyDropdownItem:Ve,TinyCheckbox:qe,TinyCheckboxGroup:je,TinyDatePicker:ye,TinyInput:be,TinyButton:ge},directives:{loading:He.directive},props:{..._.$props,state:{type:Object,default:()=>({})},pickerOptions:{type:Function,default:()=>{}},events:{type:Function,default:null},handleEvents:{type:Function,default:null}},setup(e,o){return _.setup({props:e,context:o,renderless:ao,api:ro})}}),io={tiny_mode:"pc"},co={key:0},po={class:"tvp-search-box__filter-type"},uo=["title"],mo={key:0,class:"tvp-search-box__text-highlight"},ho={key:1},fo=["title"],vo={key:0},bo={class:"tvp-search-box__checkbox-wrap"},go={class:"tvp-search-box__checkbox-btn"},yo={key:3,class:"tvp-search-box__panel-box"},ko={class:"tvp-search-box__number"},Vo={class:"tvp-search-box__dropdown-title"},wo={class:"tvp-search-box__dropdown-start"},Io={class:"tvp-search-box__dropdown-end"},Co={class:"tvp-search-box__bottom-btn"},So={key:4,class:"tvp-search-box__panel-box"},Eo={class:"tvp-search-box__date-wrap"},Do={class:"tvp-search-box__dropdown-title"},To={class:"tvp-search-box__dropdown-start"},No={class:"tvp-search-box__dropdown-end"},Bo={class:"tvp-search-box__bottom-btn"},Mo={key:5,class:"tvp-search-box__panel-box"},Lo={class:"tvp-search-box__date-wrap"},$o={class:"tvp-search-box__dropdown-title"},_o={class:"tvp-search-box__dropdown-start"},xo={class:"tvp-search-box__dropdown-end"},Ro={class:"tvp-search-box__bottom-btn"},Po={key:6},Fo={key:0,class:"tvp-search-box__filter-type"},Oo={key:1,class:"tvp-search-box__filter-type"},Ao=["title"];function zo(e,o,n,a,u,c){var h;const f=t.resolveComponent("tiny-dropdown-item"),m=t.resolveComponent("tiny-checkbox"),d=t.resolveComponent("tiny-checkbox-group"),s=t.resolveComponent("tiny-button"),p=t.resolveComponent("tiny-input"),l=t.resolveComponent("tiny-form-item"),i=t.resolveComponent("tiny-date-picker"),b=t.resolveDirective("loading");return t.openBlock(),t.createElementBlock("div",io,[(h=e.state.currentOperators)!=null&&h.length?(t.openBlock(),t.createElementBlock("div",co,[t.createElementVNode("span",po,t.toDisplayString(e.t("tvp.tvpSearchbox.operator")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.currentOperators,(r,v)=>t.withDirectives((t.openBlock(),t.createBlock(f,{key:r+v,class:"tvp-search-box__dropdown-item","item-data":{label:r},onItemClick:()=>e.setOperator(r)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r),1)]),_:2},1032,["item-data","onItemClick"])),[[t.vShow,r.includes(e.state.inputValue)]])),128))])):!e.state.prevItem.type||e.state.prevItem.type==="radio"?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["tvp-search-box__radio-wrap",e.isLoading&&"tvp-search-box__loading-box"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.backupList,(r,v)=>t.withDirectives((t.openBlock(),t.createBlock(f,{key:v+(r.field||r.label),disabled:r.isChecked,class:"tvp-search-box__dropdown-item","item-data":r,onItemClick:()=>e.selectRadioItem(r)},{default:t.withCtx(()=>[r.match?(t.openBlock(),t.createElementBlock("span",{key:0,title:r.label},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.match,y=>(t.openBlock(),t.createElementBlock("span",{key:y},[y.toLowerCase()===r.hightlighStr?(t.openBlock(),t.createElementBlock("span",mo,t.toDisplayString(y),1)):(t.openBlock(),t.createElementBlock("span",ho,t.toDisplayString(y),1))]))),128))],8,uo)):(t.openBlock(),t.createElementBlock("span",{key:1,title:r.label},t.toDisplayString(r.label),9,fo))]),_:2},1032,["disabled","item-data","onItemClick"])),[[t.vShow,!r.isFilter||!e.state.inputValue]])),128))],2)),[[b,e.isLoading]]):e.state.prevItem.type==="checkbox"?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:2,class:t.normalizeClass(e.isLoading&&"tvp-search-box__loading-box")},[e.showCheckBoxList?(t.openBlock(),t.createElementBlock("div",vo,[t.createElementVNode("div",bo,[t.createVNode(d,{modelValue:e.state.checkAll,"onUpdate:modelValue":o[1]||(o[1]=r=>e.state.checkAll=r),class:"tvp-search-box__checkbox"},{default:t.withCtx(()=>[t.createVNode(f,{class:"tvp-search-box__dropdown-item tvp-search-box__checkbox-item"},{default:t.withCtx(()=>[t.createVNode(m,{modelValue:e.state.checkAll,"onUpdate:modelValue":o[0]||(o[0]=r=>e.state.checkAll=r),indeterminate:e.state.isIndeterminate},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.selectAll")),1)]),_:1},8,["modelValue","indeterminate"])]),_:1})]),_:1},8,["modelValue"]),t.createVNode(d,{modelValue:e.state.checkboxGroup,"onUpdate:modelValue":o[2]||(o[2]=r=>e.state.checkboxGroup=r),class:"tvp-search-box__checkbox"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.backupList,(r,v)=>t.withDirectives((t.openBlock(),t.createBlock(f,{key:(r.field||r.label)+v,class:"tvp-search-box__dropdown-item tvp-search-box__checkbox-item"},{default:t.withCtx(()=>[t.createVNode(m,{label:e.state.prevItem.label+r.label,title:r.label,class:"tvp-search-box__checkbox-item-label"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(r.label),1)]),_:2},1032,["label","title"])]),_:2},1024)),[[t.vShow,!r.isFilter]])),128))]),_:1},8,["modelValue"])]),t.createElementVNode("div",go,[t.createVNode(s,{size:"mini",onClick:o[3]||(o[3]=r=>e.selectCheckbox(!1))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.cancel")),1)]),_:1}),t.createVNode(s,{size:"mini",onClick:o[4]||(o[4]=r=>e.selectCheckbox(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.confirm")),1)]),_:1})])])):t.createCommentVNode("",!0)],2)),[[b,e.isLoading]]):e.state.prevItem.type==="numRange"?(t.openBlock(),t.createElementBlock("div",yo,[t.createElementVNode("div",ko,[t.createElementVNode("div",Vo,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeNumberTitle")),1),t.createElementVNode("div",wo,t.toDisplayString(e.t("tvp.tvpSearchbox.minValueText"))+"("+t.toDisplayString(e.state.prevItem.unit)+") ",1),t.createVNode(l,{prop:e.state.curMinNumVar,class:"tvp-search-box__number-item","show-message":e.state.numberShowMessage},{default:t.withCtx(()=>[t.createVNode(p,{modelValue:e.state[e.state.curMinNumVar],"onUpdate:modelValue":o[5]||(o[5]=r=>e.state[e.state.curMinNumVar]=r),type:"number",class:"tvp-search-box__number-input"},null,8,["modelValue"])]),_:1},8,["prop","show-message"]),t.createElementVNode("div",Io,t.toDisplayString(e.t("tvp.tvpSearchbox.maxValueText"))+"("+t.toDisplayString(e.state.prevItem.unit)+") ",1),t.createVNode(l,{prop:e.state.curMaxNumVar,class:"tvp-search-box__number-item"},{default:t.withCtx(()=>[t.createVNode(p,{modelValue:e.state[e.state.curMaxNumVar],"onUpdate:modelValue":o[6]||(o[6]=r=>e.state[e.state.curMaxNumVar]=r),type:"number",class:"tvp-search-box__number-input"},null,8,["modelValue"])]),_:1},8,["prop"])]),t.createElementVNode("div",Co,[t.createVNode(s,{size:"mini",onClick:o[7]||(o[7]=r=>e.sizeChange(!1))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.cancel")),1)]),_:1}),t.createVNode(s,{size:"mini",onClick:o[8]||(o[8]=t.withModifiers(r=>e.sizeChange(!0),["stop"]))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.confirm")),1)]),_:1})])])):e.state.prevItem.type==="dateRange"?(t.openBlock(),t.createElementBlock("div",So,[t.createElementVNode("div",Eo,[t.createElementVNode("div",Do,t.toDisplayString(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle")),1),t.createElementVNode("div",To,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeBeginLabel")),1),t.createVNode(l,{prop:"startDate","show-message":!!e.state.prevItem.maxTimeLength,class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(i,{modelValue:e.state.startDate,"onUpdate:modelValue":o[9]||(o[9]=r=>e.state.startDate=r),format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate,"endDate"),class:"tvp-search-box__date-picker",onVisibleChange:e.handleDateShow},null,8,["modelValue","format","value-format","picker-options","onVisibleChange"])]),_:1},8,["show-message"]),t.createElementVNode("div",No,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeEndLabel")),1),t.createVNode(l,{prop:"endDate",class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(i,{modelValue:e.state.endDate,"onUpdate:modelValue":o[10]||(o[10]=r=>e.state.endDate=r),format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate),class:"tvp-search-box__date-picker",onChange:e.handleDateShow,onBlur:e.handleDateShow},null,8,["modelValue","format","value-format","picker-options","onChange","onBlur"])]),_:1})]),t.createElementVNode("div",Bo,[t.createVNode(s,{size:"mini",onClick:o[11]||(o[11]=r=>e.onConfirmDate(!1))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.cancel")),1)]),_:1}),t.createVNode(s,{size:"mini",onClick:o[12]||(o[12]=r=>e.onConfirmDate(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.confirm")),1)]),_:1})])])):e.state.prevItem.type==="datetimeRange"?(t.openBlock(),t.createElementBlock("div",Mo,[t.createElementVNode("div",Lo,[t.createElementVNode("div",$o,t.toDisplayString(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle")),1),t.createElementVNode("div",_o,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeBeginLabel")),1),t.createVNode(l,{prop:"startDateTime","show-message":!!e.state.prevItem.maxTimeLength,class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(i,{modelValue:e.state.startDateTime,"onUpdate:modelValue":o[13]||(o[13]=r=>e.state.startDateTime=r),type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime,"endDateTime"),class:"tvp-search-box__date-picker",onChange:e.handleDateShow,onBlur:e.handleDateShow},null,8,["modelValue","format","value-format","picker-options","onChange","onBlur"])]),_:1},8,["show-message"]),t.createElementVNode("div",xo,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeEndLabel")),1),t.createVNode(l,{prop:"endDateTime",class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(i,{modelValue:e.state.endDateTime,"onUpdate:modelValue":o[14]||(o[14]=r=>e.state.endDateTime=r),type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime),class:"tvp-search-box__date-picker",onChange:e.handleDateShow,onBlur:e.handleDateShow},null,8,["modelValue","format","value-format","picker-options","onChange","onBlur"])]),_:1})]),t.createElementVNode("div",Ro,[t.createVNode(s,{size:"mini",onClick:o[15]||(o[15]=r=>e.onConfirmDate(!1,!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.cancel")),1)]),_:1}),t.createVNode(s,{size:"mini",onClick:o[16]||(o[16]=r=>e.onConfirmDate(!0,!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.confirm")),1)]),_:1})])])):e.state.prevItem.type==="map"?t.withDirectives((t.openBlock(),t.createElementBlock("div",Po,[e.state.isShowTagKey?(t.openBlock(),t.createElementBlock("span",Fo,t.toDisplayString(e.t("tvp.tvpSearchbox.tagKey")),1)):(t.openBlock(),t.createElementBlock("span",Oo,t.toDisplayString(e.t("tvp.tvpSearchbox.tagValue")),1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.backupList,(r,v)=>t.withDirectives((t.openBlock(),t.createBlock(f,{key:r.label+r.value+v,disabled:r.isChecked,class:"tvp-search-box__dropdown-item","item-data":r,onItemClick:()=>e.selectFirstMap(r,e.state.isShowTagKey)},{default:t.withCtx(()=>[t.createElementVNode("span",{title:r.label},t.toDisplayString(r.label),9,Ao)]),_:2},1032,["disabled","item-data","onItemClick"])),[[t.vShow,!r.isFilter]])),128))])),[[b,e.isLoading]]):t.createCommentVNode("",!0)])}const Me=fe(so,[["render",zo]]);const Uo=_.defineComponent({model:{prop:"modelValue",event:"update:modelValue"},props:{..._.$props,tiny_mode:{type:String,default:"pc"},modelValue:{type:Array,default:()=>[]},items:{type:Array,default:()=>[]},emptyPlaceholder:{type:String,default:""},potentialOptions:{type:Object,default:()=>null},showHelp:{type:Boolean,default:!0},idMapKey:{type:String,default:"id"},defaultField:{type:String,default:""},editable:{type:Boolean,default:!1},maxlength:{type:Number,default:void 0},panelMaxHeight:{type:String,default:"999px"},splitInputValue:{type:String,default:","},size:{type:String,default:""}},emits:["update:modelValue","change","search","exceed","first-level-select","clear"],components:{TinyTag:xe,TinyInput:be,TinyDropdown:Re,TinyDropdownMenu:Pe,TinyButton:ge,TinyTooltip:Fe,TinyDatePicker:ye,TinyForm:Oe,TinyFormItem:ke,TinyPopover:Ae,TinySelect:ze,TinyOption:Ue,TinySearchBoxFirstLevelPanel:Be,TinySearchBoxSecondLevelPanel:Me,TinyIconSearch:ae.iconSearch(),TinyIconClose:ae.iconClose(),TinyIconHelpQuery:ae.iconHelpQuery()},setup(e,o){return _.setup({props:e,context:o,renderless:Pt,api:xt})}}),qo={class:"tvp-search-box__tag-value"},jo={key:0,class:"tvp-search-box__placeholder"},Ho={class:"tvp-search-box__input-wrapper"},Ko={class:"tvp-search-box__prop"},Go={class:"tvp-search-box__input-separator"},Zo={class:"tvp-search-box__date-wrap"},Yo={class:"tvp-search-box__dropdown-start"},Qo={key:0,class:"tvp-search-box__dropdown-end"},Wo={key:2,class:"tvp-search-box__dropdown-end"},Jo={key:4,class:"tvp-search-box__number"},Xo={class:"tvp-search-box__dropdown-start"},en={class:"tvp-search-box__dropdown-end"},tn={key:5,class:"tvp-search-box__date-wrap"},on={class:"tvp-search-box__dropdown-title"},nn={class:"tvp-search-box__dropdown-start"},ln={class:"tvp-search-box__dropdown-end"},an={key:6,class:"tvp-search-box__date-wrap"},rn={class:"tvp-search-box__dropdown-title"},sn={class:"tvp-search-box__dropdown-start"},cn={class:"tvp-search-box__dropdown-end"},pn={class:"tvp-search-box__bottom-btn"},un={key:1,class:"tvp-search-box__panel-box"};function dn(e,o,n,a,u,c){const f=t.resolveComponent("tiny-icon-search"),m=t.resolveComponent("tiny-tag"),d=t.resolveComponent("tiny-icon-close"),s=t.resolveComponent("tiny-icon-help-query"),p=t.resolveComponent("tiny-tooltip"),l=t.resolveComponent("tiny-input"),i=t.resolveComponent("TinySearchBoxFirstLevelPanel"),b=t.resolveComponent("TinySearchBoxSecondLevelPanel"),h=t.resolveComponent("tiny-dropdown-menu"),r=t.resolveComponent("tiny-dropdown"),v=t.resolveComponent("tiny-option"),y=t.resolveComponent("tiny-select"),I=t.resolveComponent("tiny-form-item"),E=t.resolveComponent("tiny-date-picker"),k=t.resolveComponent("tiny-button"),V=t.resolveComponent("tiny-popover"),C=t.resolveComponent("tiny-form");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["tvp-search-box",e.size==="small"?"tvp-search-box--small":""]),onClick:o[21]||(o[21]=t.withModifiers(g=>e.showPopover(e.state,!1),["stop"]))},[t.createVNode(f,{class:"tvp-search-box__prefix"}),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.modelValue,(g,w)=>(t.openBlock(),t.createBlock(m,{key:g.field+w,closable:"",class:t.normalizeClass(["tvp-search-box__tag",e.editable&&g.type!=="map"?"tvp-search-box__tag-editor":""]),title:`${g.label} ${g.operator||":"} ${g.value}`,onClose:S=>e.deleteTag(g),onClick:t.withModifiers(S=>e.editTag(g,w,S),["stop"])},{default:t.withCtx(()=>[t.createElementVNode("span",qo,t.toDisplayString(g.label)+" "+t.toDisplayString(g.operator||":")+" "+t.toDisplayString(g.value),1)]),_:2},1032,["class","title","onClose","onClick"]))),128)),e.modelValue.length?(t.openBlock(),t.createElementBlock("span",jo)):t.createCommentVNode("",!0),t.createVNode(C,{ref:"formRef",model:e.state,rules:e.state.formRules,"validate-type":e.state.validType,size:e.size==="small"?"small":"","label-width":"0px","message-type":"block",class:"tvp-search-box__form"},{default:t.withCtx(()=>[t.createElementVNode("div",Ho,[t.createElementVNode("section",Ko,[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.state.propItem.label)+" "+t.toDisplayString(`${e.state.operatorValue?e.state.operatorValue:""} `),513),[[t.vShow,e.state.propItem.label]]),t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.state.propItem.value),513),[[t.vShow,e.state.propItem.value]])]),t.createVNode(r,{ref:"dropdownRef",visible:e.state.visible,"onUpdate:visible":o[5]||(o[5]=g=>e.state.visible=g),trigger:"click",class:"tvp-search-box__dropdown","show-icon":!1,size:e.size==="small"?"small":"","lazy-show-popper":"","close-on-click-outside":!0},{dropdown:t.withCtx(()=>[t.createVNode(h,{placement:"bottom-start","popper-class":"tvp-search-box__dropdown-menu",style:t.normalizeStyle({"max-height":e.panelMaxHeight}),onMouseup:t.withModifiers(()=>{},["stop"])},{default:t.withCtx(()=>{var g,w;return[t.withDirectives(t.createElementVNode("div",null,[(g=e.state.instance)!=null&&g.slots["first-panel"]?t.renderSlot(e.$slots,"first-panel",t.mergeProps({key:0},{state:e.state,handleEvents:e.handleEvents},{onClick:o[1]||(o[1]=t.withModifiers(()=>{},["stop"]))})):(t.openBlock(),t.createBlock(i,{key:1,state:e.state,handleEvents:e.handleEvents},null,8,["state","handleEvents"]))],512),[[t.vShow,!e.state.propItem.label||e.state.inputValue.trim()]]),t.withDirectives(t.createElementVNode("div",null,[(w=e.state.instance)!=null&&w.slots["second-panel"]?t.renderSlot(e.$slots,"second-panel",t.mergeProps({key:0},{state:e.state,pickerOptions:e.pickerOptions,handleEvents:e.handleEvents,back:()=>e.resetInput(e.state)},{onClick:o[2]||(o[2]=t.withModifiers(()=>{},["stop"]))})):e.state.prevItem.type!=="custom"?(t.openBlock(),t.createBlock(b,{key:1,state:e.state,"picker-options":e.pickerOptions,onEvents:e.handleEvents},null,8,["state","picker-options","onEvents"])):(t.openBlock(),t.createElementBlock("div",{key:2,class:"tvp-search-box__panel-box",onClick:o[4]||(o[4]=S=>e.showDropdown(e.state))},[t.renderSlot(e.$slots,e.state.prevItem.slotName,t.mergeProps({showDropdown:()=>e.showDropdown(e.state),onConfirm:e.handleConfirm},{onClick:o[3]||(o[3]=t.withModifiers(()=>{},["stop"]))}))]))],512),[[t.vShow,e.state.propItem.label]])]}),_:3},8,["style"])]),default:t.withCtx(()=>[t.createVNode(l,{ref:"inputRef",modelValue:e.state.inputValue,"onUpdate:modelValue":o[0]||(o[0]=g=>e.state.inputValue=g),class:"tvp-search-box__input",placeholder:e.state.placeholder,maxlength:e.maxlength&&e.maxlength+1,onKeydown:[t.withKeys(t.withModifiers(e.backspaceDeleteTag,["stop"]),["delete"]),t.withKeys(t.withModifiers(e.createTag,["stop"]),["enter"])],onInput:e.handleInput,onClick:e.handleClick},{suffix:t.withCtx(()=>[t.withDirectives(t.createVNode(d,{class:"tvp-search-box__input-close",onClick:t.withModifiers(e.clearTag,["stop"])},null,8,["onClick"]),[[t.vShow,e.isShowClose]]),t.withDirectives(t.createElementVNode("span",Go,null,512),[[t.vShow,e.isShowClose]]),e.showHelp?(t.openBlock(),t.createBlock(p,{key:0,effect:"light",content:e.t("tvp.tvpSearchbox.help"),placement:"top"},{default:t.withCtx(()=>[t.createVNode(s,{class:"tvp-search-box__input-help",onClick:t.withModifiers(e.helpClick,["stop"])},null,8,["onClick"])]),_:1},8,["content"])):t.createCommentVNode("",!0),t.createVNode(f,{class:"tvp-search-box__input-search",onClick:t.withModifiers(e.createTag,["stop"])},null,8,["onClick"])]),_:1},8,["modelValue","placeholder","maxlength","onKeydown","onInput","onClick"])]),_:3},8,["visible","size"])]),e.editable?(t.openBlock(),t.createBlock(V,{key:0,ref:"popoverRef",modelValue:e.state.popoverVisible,"onUpdate:modelValue":o[20]||(o[20]=g=>e.state.popoverVisible=g),placement:"bottom-start","visible-arrow":!1,trigger:"manual","popper-class":"tvp-search-box__popover",class:"tvp-search-box__form-popover"},{default:t.withCtx(()=>[e.state.prevItem.type!=="custom"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Zo,[t.createElementVNode("div",Yo,t.toDisplayString(e.t("tvp.tvpSearchbox.attributeType")),1),t.createVNode(I,{class:"tvp-search-box__number-item"},{default:t.withCtx(()=>[t.createVNode(y,{modelValue:e.state.selectValue,"onUpdate:modelValue":o[7]||(o[7]=g=>e.state.selectValue=g),searchable:"",disabled:e.state.prevItem.editAttrDisabled},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(v,{key:e.state.allTypeAttri.label,label:e.t("tvp.tvpSearchbox.allProperty"),value:e.state.allTypeAttri.label,disabled:e.selectItemIsDisable(e.state.allTypeAttri),onClick:o[6]||(o[6]=g=>e.selectPropChange(e.state.allTypeAttri,e.selectItemIsDisable(e.state.allTypeAttri)))},null,8,["label","value","disabled"])),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.recordItems,g=>(t.openBlock(),t.createBlock(v,{key:g.label,label:g.label,value:g.label,disabled:e.selectItemIsDisable(g),onClick:w=>e.selectPropChange(g,e.selectItemIsDisable(g))},null,8,["label","value","disabled","onClick"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),e.state.prevItem.operators?(t.openBlock(),t.createElementBlock("div",Qo,t.toDisplayString(e.t("tvp.tvpSearchbox.operator")),1)):t.createCommentVNode("",!0),e.state.prevItem.operators?(t.openBlock(),t.createBlock(I,{key:1,class:"tvp-search-box__number-item"},{default:t.withCtx(()=>[t.createVNode(y,{modelValue:e.state.operatorValue,"onUpdate:modelValue":o[8]||(o[8]=g=>e.state.operatorValue=g)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.currentOperators,g=>(t.openBlock(),t.createBlock(v,{key:g,label:g,value:g},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):t.createCommentVNode("",!0),e.state.prevItem.type!=="numRange"?(t.openBlock(),t.createElementBlock("div",Wo,t.toDisplayString(e.t("tvp.tvpSearchbox.tagValue")),1)):t.createCommentVNode("",!0),["numRange","dateRange","datetimeRange","custom"].includes(e.state.prevItem.type)?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(I,{key:3,prop:"inputEditValue",class:"tvp-search-box__number-item"},{default:t.withCtx(()=>{var g,w;return[((g=e.state.currentEditValue)==null?void 0:g.length)>0?(t.openBlock(),t.createBlock(y,{key:0,modelValue:e.state.inputEditValue,"onUpdate:modelValue":o[9]||(o[9]=S=>e.state.inputEditValue=S),class:"tvp-search-box-select",multiple:!!e.state.prevItem.mergeTag,"allow-create":(w=e.state.prevItem)==null?void 0:w.allowCreate,filterable:"","default-first-option":"",clearable:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.state.currentEditValue,S=>(t.openBlock(),t.createBlock(v,{key:S.label,label:S.label,value:S.label},null,8,["label","value"]))),128))]),_:1},8,["modelValue","multiple","allow-create"])):(t.openBlock(),t.createBlock(l,{key:1,modelValue:e.state.inputEditValue,"onUpdate:modelValue":o[10]||(o[10]=S=>e.state.inputEditValue=S),clearable:""},null,8,["modelValue"]))]}),_:1})),e.state.prevItem.type==="numRange"?(t.openBlock(),t.createElementBlock("div",Jo,[t.createElementVNode("div",Xo,t.toDisplayString(e.t("tvp.tvpSearchbox.minValueText"))+"("+t.toDisplayString(e.state.prevItem.unit)+") ",1),t.createVNode(I,{prop:e.state.curMinNumVar,class:"tvp-search-box__number-item","show-message":e.state.numberShowMessage},{default:t.withCtx(()=>[t.createVNode(l,{modelValue:e.state[e.state.curMinNumVar],"onUpdate:modelValue":o[11]||(o[11]=g=>e.state[e.state.curMinNumVar]=g),type:"number",class:"tvp-search-box__number-input"},null,8,["modelValue"])]),_:1},8,["prop","show-message"]),t.createElementVNode("div",en,t.toDisplayString(e.t("tvp.tvpSearchbox.maxValueText"))+"("+t.toDisplayString(e.state.prevItem.unit)+") ",1),t.createVNode(I,{prop:e.state.curMaxNumVar,class:"tvp-search-box__number-item"},{default:t.withCtx(()=>[t.createVNode(l,{modelValue:e.state[e.state.curMaxNumVar],"onUpdate:modelValue":o[12]||(o[12]=g=>e.state[e.state.curMaxNumVar]=g),type:"number",class:"tvp-search-box__number-input"},null,8,["modelValue"])]),_:1},8,["prop"])])):t.createCommentVNode("",!0),e.state.prevItem.type==="dateRange"?(t.openBlock(),t.createElementBlock("div",tn,[t.createElementVNode("div",on,t.toDisplayString(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle")),1),t.createElementVNode("div",nn,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeBeginLabel")),1),t.createVNode(I,{prop:"startDate","show-message":!!e.state.prevItem.maxTimeLength,class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:e.state.startDate,"onUpdate:modelValue":o[13]||(o[13]=g=>e.state.startDate=g),format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate,"endDate"),class:"tvp-search-box__date-picker"},null,8,["modelValue","format","value-format","picker-options"])]),_:1},8,["show-message"]),t.createElementVNode("div",ln,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeEndLabel")),1),t.createVNode(I,{prop:"endDate",class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:e.state.endDate,"onUpdate:modelValue":o[14]||(o[14]=g=>e.state.endDate=g),format:e.state.prevItem.format||e.state.dateRangeFormat,"value-format":e.state.prevItem.format||e.state.dateRangeFormat,"picker-options":e.pickerOptions(e.state.startDate),class:"tvp-search-box__date-picker"},null,8,["modelValue","format","value-format","picker-options"])]),_:1})])):t.createCommentVNode("",!0),e.state.prevItem.type==="datetimeRange"?(t.openBlock(),t.createElementBlock("div",an,[t.createElementVNode("div",rn,t.toDisplayString(e.state.prevItem.maxTimeLength>0?e.t("tvp.tvpSearchbox.timeLengthTitle",{value:(e.state.prevItem.maxTimeLength/864e5).toFixed(1)}):e.t("tvp.tvpSearchbox.rangeDateTitle")),1),t.createElementVNode("div",sn,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeBeginLabel")),1),t.createVNode(I,{prop:"startDateTime","show-message":!!e.state.prevItem.maxTimeLength,class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:e.state.startDateTime,"onUpdate:modelValue":o[15]||(o[15]=g=>e.state.startDateTime=g),type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime,"endDateTime"),class:"tvp-search-box__date-picker"},null,8,["modelValue","format","value-format","picker-options"])]),_:1},8,["show-message"]),t.createElementVNode("div",cn,t.toDisplayString(e.t("tvp.tvpSearchbox.rangeEndLabel")),1),t.createVNode(I,{prop:"endDateTime",class:"tvp-search-box__date-item"},{default:t.withCtx(()=>[t.createVNode(E,{modelValue:e.state.endDateTime,"onUpdate:modelValue":o[16]||(o[16]=g=>e.state.endDateTime=g),type:"datetime",isutc8:!0,format:e.state.prevItem.format||e.state.datetimeRangeFormat,"value-format":e.state.prevItem.format||e.state.datetimeRangeFormat,"picker-options":e.pickerOptions(e.state.startDateTime),class:"tvp-search-box__date-picker"},null,8,["modelValue","format","value-format","picker-options"])]),_:1})])):t.createCommentVNode("",!0)]),t.createElementVNode("div",pn,[t.createVNode(k,{size:"mini",onClick:o[17]||(o[17]=g=>e.confirmEditTag(!1))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.cancel")),1)]),_:1}),t.createVNode(k,{size:"mini",onClick:o[18]||(o[18]=g=>e.confirmEditTag(!0))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.t("tvp.tvpSearchbox.confirm")),1)]),_:1})])],64)):(t.openBlock(),t.createElementBlock("div",un,[t.renderSlot(e.$slots,`${e.state.prevItem.slotName}-edit`,t.mergeProps({showDropdown:()=>e.showPopover(e.state),onConfirm:e.handleEditConfirm},{onClick:o[19]||(o[19]=t.withModifiers(()=>{},["stop"]))}))]))]),_:3},8,["modelValue"])):t.createCommentVNode("",!0)]),_:3},8,["model","rules","validate-type","size"])],2)}const mn=fe(Uo,[["render",dn]]),hn={..._.$props,tiny_mode:{type:String,default:"pc"},modelValue:{type:Array,default:()=>[]},items:{type:Array,default:()=>[]},emptyPlaceholder:{type:String,default:""},potentialOptions:{type:Object,default:()=>null},showHelp:{type:Boolean,default:!0},idMapKey:{type:String,default:"id"},defaultField:{type:String,default:""},editable:{type:Boolean,default:!1},maxlength:{type:Number,default:void 0},panelMaxHeight:{type:String,default:"999px"},splitInputValue:{type:String,default:","},customClass:{type:String,default:""},customStyle:{type:Object,default:()=>({})},size:{type:String,default:""}},Y=_.defineComponent({name:_.$prefix+"SearchBox",props:hn,...mn}),fn="3.27.0";Y.install=function(e){e.component(Y.name,Y)};Y.version=fn;window&&typeof window<"u"&&window.Vue&&Y.install(window.Vue);exports.TinySearchBoxFirstLevelPanel=Be;exports.TinySearchBoxSecondLevelPanel=Me;exports.default=Y;exports.enUS=me;exports.setGlobalApp=Ne;exports.t=R;exports.zhCN=de;
2
2
  //# sourceMappingURL=index.cjs.js.map